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
Is it possible to add the ability to pass an iterator into the encoder (without having an effect on performance)?
I tried looking through the code but it was a bit too complex for me.
Why I ask is that in case you have BGR data, you currently have to convert it beforehand.
Which means going through everything just to convert it,
it's very fast though, but I would imagine it being faster if it could be done when the data is actually being encoded.
Here's an example of BGR to RGB:
pubfnbgr_to_rgb(b:&mut[u8]){// swap R<->B to convert BGR->RGB
b.chunks_exact_mut(3).for_each(|l| l.swap(0,2));}
Now if we could pass an iterator the swap could be done on-the-fly which might be more cache friendly as well.
Thoughts on this?
The text was updated successfully, but these errors were encountered:
Hmmm, seems plausible in principle! Doing the swizzle while data's hot is good for cache, and should be vectorization-friendly.
Main holdup off the top of my head -- we need random access to run filters in parallel, so the API needs to provide for creating a separate iterator for each chunk.
Is it possible to add the ability to pass an iterator into the encoder (without having an effect on performance)?
I tried looking through the code but it was a bit too complex for me.
Why I ask is that in case you have BGR data, you currently have to convert it beforehand.
Which means going through everything just to convert it,
it's very fast though, but I would imagine it being faster if it could be done when the data is actually being encoded.
Here's an example of BGR to RGB:
Now if we could pass an iterator the
swap
could be done on-the-fly which might be more cache friendly as well.Thoughts on this?
The text was updated successfully, but these errors were encountered: