39#if defined(OJPH_ARCH_I386) || defined(OJPH_ARCH_X86_64)
54 float *y,
float *cb,
float *cr,
ui32 repeat)
61 for (
int i = (repeat + 7) >> 3; i > 0; --i)
63 __m256 mr = _mm256_load_ps(r);
64 __m256 mb = _mm256_load_ps(b);
65 __m256 my = _mm256_mul_ps(alpha_rf, mr);
66 my = _mm256_add_ps(my, _mm256_mul_ps(alpha_gf, _mm256_load_ps(g)));
67 my = _mm256_add_ps(my, _mm256_mul_ps(alpha_bf, mb));
68 _mm256_store_ps(y, my);
69 _mm256_store_ps(cb, _mm256_mul_ps(beta_cbf, _mm256_sub_ps(mb, my)));
70 _mm256_store_ps(cr, _mm256_mul_ps(beta_crf, _mm256_sub_ps(mr, my)));
72 r += 8; g += 8; b += 8;
73 y += 8; cb += 8; cr += 8;
79 float *r,
float *g,
float *b,
ui32 repeat)
85 for (
int i = (repeat + 7) >> 3; i > 0; --i)
87 __m256 my = _mm256_load_ps(y);
88 __m256 mcr = _mm256_load_ps(cr);
89 __m256 mcb = _mm256_load_ps(cb);
90 __m256 mg = _mm256_sub_ps(my, _mm256_mul_ps(gamma_cr2g, mcr));
91 _mm256_store_ps(g, _mm256_sub_ps(mg, _mm256_mul_ps(gamma_cb2g, mcb)));
92 _mm256_store_ps(r, _mm256_add_ps(my, _mm256_mul_ps(gamma_cr2r, mcr)));
93 _mm256_store_ps(b, _mm256_add_ps(my, _mm256_mul_ps(gamma_cb2b, mcb)));
95 y += 8; cb += 8; cr += 8;
96 r += 8; g += 8; b += 8;
void avx_ict_forward(const float *r, const float *g, const float *b, float *y, float *cb, float *cr, ui32 repeat)
void avx_ict_backward(const float *y, const float *cb, const float *cr, float *r, float *g, float *b, ui32 repeat)
static const float GAMMA_CR2R
static const float BETA_CbF
static const float GAMMA_CB2B
static const float ALPHA_RF
static const float GAMMA_CB2G
static const float GAMMA_CR2G
static const float ALPHA_BF
static const float BETA_CrF
static const float ALPHA_GF