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
tdaede
left a comment
There was a problem hiding this comment.
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
u8andu16for plane components, make thePlanestructure 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.