You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For every scale, we first convert to Xyb (which uses the same data: Vec<[f32; 3]> as LinearRgb) and then to a planar data representation. Instead of a Vec<[f32; 3]>, we get three Vec<f32>, both with len == amount_of_pixels.
The conversion between these two representations is probably not that important in terms of speed (although it does require three fairly large allocations), I wonder if we could use a single Vec<f32> with len == 3*amount_of_pixels instead.
The naive thought I had was to just inline all planes after each other (&data[0..plane_size] is the X plane, for example). This would still require a new allocation, but might be faster when blurring or doing the metric calculations.
Another thought I just had: Maybe we could even reuse the Vec<[f32; 3]>'s allocation. Casting to Vec<f32> is relatively simple with some unsafe code (we already do it in yuvxyb). Bit difficult to tell what performance implications this would have though.
The text was updated successfully, but these errors were encountered:
Potential option for #11.
For every scale, we first convert to Xyb (which uses the same
data: Vec<[f32; 3]>
asLinearRgb
) and then to a planar data representation. Instead of aVec<[f32; 3]>
, we get threeVec<f32>
, both with len == amount_of_pixels.The conversion between these two representations is probably not that important in terms of speed (although it does require three fairly large allocations), I wonder if we could use a single
Vec<f32>
with len == 3*amount_of_pixels instead.The naive thought I had was to just inline all planes after each other (
&data[0..plane_size]
is the X plane, for example). This would still require a new allocation, but might be faster when blurring or doing the metric calculations.Another thought I just had: Maybe we could even reuse the
Vec<[f32; 3]>
's allocation. Casting toVec<f32>
is relatively simple with some unsafe code (we already do it in yuvxyb). Bit difficult to tell what performance implications this would have though.The text was updated successfully, but these errors were encountered: