-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make plane generic over pixel component type #1002
Conversation
cf4d348
to
c501fc7
Compare
FrameInvariants becoming generic really adds a lot of noise :/ this is because of the reference frame structure correct? |
Yes, just because of its field: pub rec_buffer: ReferenceFramesSet<T>, |
Do you think it would make sense to do some dynamic dispatch over that field? Or does that make it even more complicated? |
That would mean erasing its concrete type behind a trait: pub trait RFS {}
impl<T: Pixel> RFS for ReferenceFramesSet<T> {}
pub struct FrameInvariants {
// …
pub rec_buffer: Box<dyn RFS>,
// …
} But then, from a It would be impractical IMO. In fact, |
I see. I guess we could also split out ReferenceFrameSet to be its own parameter. But that doesn't make many things better. |
lu_zero can you check how the api.rs changes interact with crav1e? |
They would break everything, but I can fix after it lands. |
I need to check what works better compared to
With |
e10d054
to
8c386e3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still wish we could have FI not be per-depth but I think this is currently the best option.
In order to support both u8 and u16 for plane components, make the Plane structure generic over the component type. As a consequence, many other structures and functions also become generic. Some functions are not u8-compatible yet, although they have been make generic over the component type to make the compilation work. They assert that the size of the generic parameter is 16 bits wide. For this reason, the root context structure is unconditionally created as Context<u16> for now.
In order to support both
u8
andu16
for plane components, make thePlane
structure generic over the component type. As a consequence, many other structures and functions also become generic.Some functions are not
u8
-compatible yet, although they have been make generic over the component type to make the compilation work. They assert that the size of the generic parameter is 16 bits wide.For this reason, the root context structure is unconditionally created as
Context<u16>
for now.