merge with dev

This commit is contained in:
Desmis
2019-11-12 07:15:29 +01:00
10 changed files with 88 additions and 158 deletions

View File

@@ -1868,11 +1868,9 @@ public:
return (hr);
}
static inline void RGB2Y(const float* R, const float* G, const float* B, float* Y1, float * Y2, float gamma, int W) {
gamma = 1.f / gamma;
static inline void RGB2Y(const float* R, const float* G, const float* B, float* Y1, float * Y2, int W) {
int i = 0;
#ifdef __SSE2__
const vfloat gammav = F2V(gamma);
const vfloat c1v = F2V(0.2627f);
const vfloat c2v = F2V(0.6780f);
const vfloat c3v = F2V(0.0593f);
@@ -1880,7 +1878,7 @@ public:
const vfloat Rv = vmaxf(LVFU(R[i]), ZEROV);
const vfloat Gv = vmaxf(LVFU(G[i]), ZEROV);
const vfloat Bv = vmaxf(LVFU(B[i]), ZEROV);
vfloat yv = pow_F(c1v * Rv + c2v * Gv + c3v * Bv, gammav);
vfloat yv = c1v * Rv + c2v * Gv + c3v * Bv;
STVFU(Y1[i], yv);
STVFU(Y2[i], yv);
}
@@ -1889,7 +1887,7 @@ public:
const float r = std::max(R[i], 0.f);
const float g = std::max(G[i], 0.f);
const float b = std::max(B[i], 0.f);
Y1[i] = Y2[i] = pow_F(0.2627f * r + 0.6780f * g + 0.0593f * b, gamma);
Y1[i] = Y2[i] = 0.2627f * r + 0.6780f * g + 0.0593f * b;
}
}
};