Expand description
AVX color conversion routines
Okay these codes are cool
Herein lies super optimized codes to do color conversions.
- The YCbCr to RGB use integer approximations and not the floating point equivalent.
That means we may be +- 2 of pixels generated by libjpeg-turbo jpeg decoding
(also libjpeg uses routines like
Y = 0.29900 * R + 0.33700 * G + 0.11400 * B + 0.25000 * G
)
Firstly, we use integers (fun fact:there is no part of this code base where were dealing with floating points.., fun fact: the first fun fact wasn’t even fun.)
Secondly ,we have cool clamping code, especially for rgba , where we don’t need clamping and we spend our time cursing that Intel decided permute instructions to work like 2 128 bit vectors(the compiler opitmizes it out to something cool).
There isn’t a lot here (not as fun as bitstream ) but I hope you find what you’re looking for.
O and subscribe to my youtube channel
Constants§
Functions§
- shuffle 🔒
- ycbcr_
to_ rgb_ avx2 - Convert YCBCR to RGB using AVX instructions
- ycbcr_
to_ 🔒 ⚠rgb_ avx2_ 1 avx2
- ycbcr_
to_ 🔒 ⚠rgb_ baseline_ no_ clamp avx2
- A baseline implementation of YCbCr to RGB conversion which does not carry out clamping
- ycbcr_
to_ rgba_ avx2 - ycbcr_
to_ 🔒 ⚠rgba_ unsafe avx2