Module avx

Source
Expand description

AVX color conversion routines

Okay these codes are cool

Herein lies super optimized codes to do color conversions.

  1. 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§

B_AVX_COEF 🔒
G_COEF_AVX_COEF 🔒
R_AVX_COEF 🔒

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

Unions§

YmmRegister