This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository efl.
View the commit online.
commit 6860883e1814e7fd935173c4099302c7f30abed1
Author: Carsten Haitzler <ras...@rasterman.com>
AuthorDate: Fri Aug 2 09:59:38 2024 +0100
remove ppc altivec yuv to rgb as it was broken anyway
i have no pcc hw and it seems no one who has any cares enough to run
and test this stuff and/or fix it... so best path - remove it and rely
on the generic c fallbacks and be a bit slower.
fixes #68
@fix
---
src/lib/evas/common/evas_convert_yuv.c | 335 ---------------------------------
1 file changed, 335 deletions(-)
diff --git a/src/lib/evas/common/evas_convert_yuv.c b/src/lib/evas/common/evas_convert_yuv.c
index ee753d1961..a4afcd2f36 100644
--- a/src/lib/evas/common/evas_convert_yuv.c
+++ b/src/lib/evas/common/evas_convert_yuv.c
@@ -22,10 +22,6 @@ static void _evas_yv12torgb_sse (unsigned char **yuv, unsigned char *rgb, int
// Broken atm - the sse and mmx get math.. wrong :(
//static void _evas_yv12_709torgb_mmx(unsigned char **yuv, unsigned char *rgb, int w, int h);
static void _evas_yv12torgb_mmx (unsigned char **yuv, unsigned char *rgb, int w, int h);
-#ifdef BUILD_ALTIVEC
-static void _evas_yv12torgb_altivec(unsigned char **yuv, unsigned char *rgb, int w, int h);
-static void _evas_yv12torgb_diz (unsigned char **yuv, unsigned char *rgb, int w, int h);
-#endif
static void _evas_yv12_709torgb_raster(unsigned char **yuv, unsigned char *rgb, int w, int h);
static void _evas_yv12torgb_raster (unsigned char **yuv, unsigned char *rgb, int w, int h);
static void _evas_yuy2torgb_raster (unsigned char **yuv, unsigned char *rgb, int w, int h);
@@ -101,38 +97,6 @@ const int _cgv709 = RZ(CGV709); /* 0.534 */
#endif
-#ifdef BUILD_ALTIVEC
-#ifdef __VEC__
-const vector unsigned short res = AVV(RES);
-const vector signed short crv = AVV(RZ(CRV));
-const vector signed short cbu = AVV(RZ(CBU));
-const vector signed short cgu = AVV(RZ(CGU));
-const vector signed short cgv = AVV(RZ(CGV));
-const vector signed short ymul = AVV(RZ(YMUL));
-const vector signed short c128 = AVV(128);
-const vector signed short c32 = AVV(RZ(OFF));
-const vector signed short c16 = AVV(16);
-const vector unsigned char zero = AVV(0);
-const vector signed short maxchar = AVV(255);
-const vector unsigned char pickrg1 = AVV(0, 0x1, 0x11, 0,
- 0, 0x3, 0x13, 0,
- 0, 0x5, 0x15, 0,
- 0, 0x7, 0x17, 0);
-const vector unsigned char pickrg2 = AVV(0, 0x9, 0x19, 0,
- 0, 0xb, 0x1b, 0,
- 0, 0xd, 0x1d, 0,
- 0, 0xf, 0x1f, 0);
-const vector unsigned char pickrgb1 = AVV(0x3, 0x1, 0x2, 0x11,
- 0x7, 0x5, 0x6, 0x13,
- 0xb, 0x9, 0xa, 0x15,
- 0xf, 0xd, 0xe, 0x17);
-const vector unsigned char pickrgb2 = AVV(0x3, 0x1, 0x2, 0x19,
- 0x7, 0x5, 0x6, 0x1b,
- 0xb, 0x9, 0xa, 0x1d,
- 0xf, 0xd, 0xe, 0x1f);
-#endif
-#endif
-
/* shortcut speedup lookup-tables */
static short _v1164[256];
static short _v1596[256];
@@ -177,10 +141,6 @@ evas_common_convert_yuv_422p_601_rgba(DATA8 **src, DATA8 *dst, int w, int h)
_evas_yv12torgb_sse(src, dst, w, h);
else if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
_evas_yv12torgb_mmx(src, dst, w, h);
-#ifdef BUILD_ALTIVEC
- if (evas_common_cpu_has_feature(CPU_FEATURE_ALTIVEC))
- _evas_yv12torgb_altivec(src, dst, w, h);
-#endif
else
_evas_yv12torgb_raster(src, dst, w, h);
}
@@ -853,224 +813,6 @@ _evas_yv12torgb_mmx(unsigned char **yuv, unsigned char *rgb, int w, int h)
#endif
}
-#ifdef BUILD_ALTIVEC
-static void
-_evas_yv12torgb_altivec(unsigned char **yuv, unsigned char *rgb, int w, int h)
-{
-#ifdef __VEC__
- int xx, yy;
- int w2, h2;
- unsigned char *yp1, *yp2, *up, *vp;
- unsigned char *dp1, *dp2;
- vector signed short y, u, v;
- vector signed short r, g, b;
- vector signed short tmp1, tmp2, tmp3;
- vector unsigned char yperm, uperm, vperm, rgb1, rgb2;
- vector unsigned char alpha;
-
- /* handy halved w & h */
- w2 = w / 2;
- h2 = h / 2;
- /* plane pointers */
- yp1 = yuv;
- yp2 = yuv + w;
- up = yuv + (w * h);
- vp = up + (w2 * h2);
- /* destination pointers */
- dp1 = rgb;
- dp2 = rgb + (w * 4);
-
- alpha = vec_mergeh((vector unsigned char)AVV(255), zero);
- alpha = (vector unsigned char)vec_mergeh((vector unsigned short)alpha,
- (vector unsigned short)zero);
-
- for (yy = 0; yy < h2; yy++)
- {
- for (xx = 0; xx < w2; xx += 4)
- {
-/* Cycles */
- /*
- * Load 4 y and 4 u & v pixels for the 8x2 pixel block.
- */
-/* 3 */ tmp3 = (vector signed short)vec_lde(0, (unsigned int *)yp1);
-/* 3 */ tmp1 = (vector signed short)vec_lde(0, (unsigned int *)up);
-/* 3 */ tmp2 = (vector signed short)vec_lde(0, (unsigned int *)vp);
-
- /* Prepare for aligning the data in their vectors */
-/* 3 */ yperm = vec_lvsl(0, yp1);
-/* 3 */ uperm = vec_lvsl(0, up);
-/* 3 */ vperm = vec_lvsl(0, vp);
- yp1 += 4;
-
- /* Save y and load the next 4 y pixels for a total of 8 */
-/* 2 */ y = vec_perm(tmp3, tmp3, yperm);
-/* 3 */ tmp3 = (vector signed short)vec_lde(0, (unsigned int *)yp1);
-
- /* Setup and calculate the 4 u pixels */
-/* 2 */ tmp1 = vec_perm(tmp1, tmp1, uperm);
-/* 2 */ tmp2 = vec_perm(tmp2, tmp2, vperm);
-
- /* Avoid dependency stalls on yperm and calculate the 4 u values */
-/* 3 */ yperm = vec_lvsr(12, yp1);
-/* 1 */ tmp1 = (vector signed short)vec_mergeh((vector unsigned char)tmp1,
- (vector unsigned char)tmp1);
-/* 1 */ u = (vector signed short)vec_mergeh(zero,
- (vector unsigned char)tmp1);
-
-/* 1 */ u = vec_sub(u, c128);
-/* 2 */ tmp3 = vec_perm(tmp3, tmp3, yperm);
-
- /* Setup and calculate the 4 v values */
-/* 1 */ tmp2 = (vector signed short)vec_mergeh((vector unsigned char)tmp2,
- (vector unsigned char)tmp2);
-/* 1 */ v = (vector signed short)vec_mergeh(zero,
- (vector unsigned char)tmp2);
-/* 4 */ tmp2 = vec_mladd(cgu, u, (vector signed short)zero);
-/* 1 */ v = vec_sub(v, c128);
-
- /* Move the data into y and start loading the next 4 pixels */
-/* 1 */ y = (vector signed short)vec_mergeh(zero,
- (vector unsigned char)y);
-/* 1 */ tmp3 = (vector signed short)vec_mergeh(zero,
- (vector unsigned char)tmp3);
-/* 1 */ y = vec_or(y, tmp3);
-
- /* Finish calculating y */
-/* 1 */ y = vec_sub(y, c16);
-/* 4 */ y = vec_mladd(ymul, y, (vector signed short)zero);
-
- /* Perform non-dependent multiplies first. */
-/* 4 */ tmp1 = vec_mladd(crv, v, y);
-/* 4 */ tmp2 = vec_mladd(cgv, v, tmp2);
-/* 4 */ tmp3 = vec_mladd(cbu, u, y);
-
- /* Calculate rgb values */
-/* 1 */ r = vec_sra(tmp1, res);
-
-/* 1 */ tmp2 = vec_sub(y, tmp2);
-/* 1 */ tmp2 = vec_add(tmp2, c32);
-/* 1 */ g = vec_sra(tmp2, res);
-
-/* 1 */ tmp3 = vec_add(tmp3, c32);
-/* 1 */ b = vec_sra(tmp3, res);
-
- /* Bound to 0 <= x <= 255 */
-/* 1 */ r = vec_min(r, maxchar);
-/* 1 */ g = vec_min(g, maxchar);
-/* 1 */ b = vec_min(b, maxchar);
-/* 1 */ r = vec_max(r, (vector signed short)zero);
-/* 1 */ g = vec_max(g, (vector signed short)zero);
-/* 1 */ b = vec_max(b, (vector signed short)zero);
-
- /* Combine r, g and b. */
-/* 2 */ rgb1 = vec_perm((vector unsigned char)r, (vector unsigned char)g,
- pickrg1);
-/* 2 */ rgb2 = vec_perm((vector unsigned char)r, (vector unsigned char)g,
- pickrg2);
-
-/* 2 */ rgb1 = vec_perm(rgb1, (vector unsigned char)b, pickrgb1);
-/* 2 */ rgb2 = vec_perm(rgb2, (vector unsigned char)b, pickrgb2);
-
-/* 1 */ rgb1 = vec_or(alpha, rgb1);
-/* 1 */ rgb2 = vec_or(alpha, rgb2);
-
-/* 3 */ vec_stl(rgb1, 0, dp1);
- dp1 += 16;
-/* 3 */ vec_stl(rgb2, 0, dp1);
-
- /*
- * Begin the second row calculations
- */
-
- /*
- * Load 4 y pixels for the 8x2 pixel block.
- */
-/* 3 */ yperm = vec_lvsl(0, yp2);
-/* 3 */ tmp3 = (vector signed short)vec_lde(0, (unsigned int *)yp2);
- yp2 += 4;
-
- /* Save y and load the next 4 y pixels for a total of 8 */
-/* 2 */ y = vec_perm(tmp3, tmp3, yperm);
-/* 3 */ yperm = vec_lvsr(12, yp2);
-/* 3 */ tmp3 = (vector signed short)vec_lde(0, (unsigned int *)yp2);
-/* 1 */ y = (vector signed short)vec_mergeh(zero,
- (vector unsigned char)y);
-
- /* Avoid dependency stalls on yperm */
-/* 2 */ tmp3 = vec_perm(tmp3, tmp3, yperm);
-/* 1 */ tmp3 = (vector signed short)vec_mergeh(zero,
- (vector unsigned char)tmp3);
-/* 1 */ y = vec_or(y, tmp3);
-
- /* Start the calculation for g */
-/* 4 */ tmp2 = vec_mladd(cgu, u, (vector signed short)zero);
-
- /* Finish calculating y */
-/* 1 */ y = vec_sub(y, c16);
-/* 4 */ y = vec_mladd(ymul, y, (vector signed short)zero);
-
- /* Perform non-dependent multiplies first. */
-/* 4 */ tmp2 = vec_mladd(cgv, v, tmp2);
-/* 4 */ tmp1 = vec_mladd(crv, v, y);
-/* 4 */ tmp3 = vec_mladd(cbu, u, y);
-
- /* Calculate rgb values */
-/* 1 */ r = vec_sra(tmp1, res);
-
-/* 1 */ tmp2 = vec_sub(y, tmp2);
-/* 1 */ tmp2 = vec_add(tmp2, c32);
-/* 1 */ g = vec_sra(tmp2, res);
-
-/* 1 */ tmp3 = vec_add(tmp3, c32);
-/* 1 */ b = vec_sra(tmp3, res);
-
- /* Bound to 0 <= x <= 255 */
-/* 1 */ r = vec_min(r, maxchar);
-/* 1 */ g = vec_min(g, maxchar);
-/* 1 */ b = vec_min(b, maxchar);
-/* 1 */ r = vec_max(r, (vector signed short)zero);
-/* 1 */ g = vec_max(g, (vector signed short)zero);
-/* 1 */ b = vec_max(b, (vector signed short)zero);
-
- /* Combine r, g and b. */
-/* 2 */ rgb1 = vec_perm((vector unsigned char)r, (vector unsigned char)g,
- pickrg1);
-/* 2 */ rgb2 = vec_perm((vector unsigned char)r, (vector unsigned char)g,
- pickrg2);
-
-/* 2 */ rgb1 = vec_perm(rgb1, (vector unsigned char)b, pickrgb1);
-/* 2 */ rgb2 = vec_perm(rgb2, (vector unsigned char)b, pickrgb2);
-
-/* 1 */ rgb1 = vec_or(alpha, rgb1);
-/* 1 */ rgb2 = vec_or(alpha, rgb2);
-
-/* 3 */ vec_stl(rgb1, 0, dp2);
- dp2 += 16;
-/* 3 */ vec_stl(rgb2, 0, dp2);
-
- /* Increment the YUV data pointers to the next set of pixels. */
- yp1 += 4;
- yp2 += 4;
- up += 4;
- vp += 4;
-
- /* Move the destination pointers to the next set of pixels. */
- dp1 += 16;
- dp2 += 16;
- }
-
- /* jump down one line since we are doing 2 at once */
- yp1 += w;
- yp2 += w;
- dp1 += (w * 4);
- dp2 += (w * 4);
- }
-#else
- _evas_yv12torgb_diz(yuv, rgb, w, h);
-#endif
-}
-#endif
-
static void
_evas_yuv_init(void)
{
@@ -1099,83 +841,6 @@ _evas_yuv_init(void)
}
}
-#ifdef BUILD_ALTIVEC
-static void
-_evas_yv12torgb_diz(unsigned char **yuv, unsigned char *rgb, int w, int h)
-{
- int xx, yy;
- int y, u, v, r, g, b;
- unsigned char *yp1, *yp2, *up, *vp;
- unsigned char *dp1, *dp2;
- int crv, cbu, cgu, cgv;
-
- /* destination pointers */
- dp1 = rgb;
- dp2 = rgb + (w * 4);
-
- crv = CRV; /* 1.596 */
- cbu = CBU; /* 2.018 */
- cgu = CGU; /* 0.391 */
- cgv = CGV; /* 0.813 */
-
- for (yy = 0; yy < h; yy += 2)
- {
- /* plane pointers */
- yp1 = yuv[yy];
- yp2 = yuv[yy + 1];
- up = yuv[h + (yy / 2)];
- vp = yuv[h + (h / 2) + (yy / 2)];
- for (xx = 0; xx < w; xx += 2)
- {
- /* collect u & v for 2x2 pixel block */
- u = (*up++) - 128;
- v = (*vp++) - 128;
-
- /* do the top 2 pixels of the 2x2 block which shared u & v */
- /* yuv to rgb */
- y = YMUL * ((*yp1++) - 16);
- r = LUT_CLIP((y + (crv * v)) >> 16);
- g = LUT_CLIP((y - (cgu * u) - (cgv * v) + OFF) >>16);
- b = LUT_CLIP((y + (cbu * u) + OFF) >> 16);
- *((DATA32 *) dp1) = 0xff000000 + RGB_JOIN(r,g,b);
-
- dp1 += 4;
-
- /* yuv to rgb */
- y = YMUL * ((*yp1++) - 16);
- r = LUT_CLIP((y + (crv * v)) >> 16);
- g = LUT_CLIP((y - (cgu * u) - (cgv * v) + OFF) >>16);
- b = LUT_CLIP((y + (cbu * u) + OFF) >> 16);
- *((DATA32 *) dp1) = 0xff000000 + RGB_JOIN(r,g,b);
-
- dp1 += 4;
-
- /* do the bottom 2 pixels */
- /* yuv to rgb */
- y = YMUL * ((*yp2++) - 16);
- r = LUT_CLIP((y + (crv * v)) >> 16);
- g = LUT_CLIP((y - (cgu * u) - (cgv * v) + OFF) >>16);
- b = LUT_CLIP((y + (cbu * u) + OFF) >> 16);
- *((DATA32 *) dp2) = 0xff000000 + RGB_JOIN(r,g,b);
-
- dp2 += 4;
-
- /* yuv to rgb */
- y = YMUL * ((*yp2++) - 16);
- r = LUT_CLIP((y + (crv * v)) >> 16);
- g = LUT_CLIP((y - (cgu * u) - (cgv * v) + OFF) >>16);
- b = LUT_CLIP((y + (cbu * u) + OFF) >> 16);
- *((DATA32 *) dp2) = 0xff000000 + RGB_JOIN(r,g,b);
-
- dp2 += 4;
- }
- /* jump down one line since we are doing 2 at once */
- dp1 += (w * 4);
- dp2 += (w * 4);
- }
-}
-#endif
-
static void
_evas_yv12_709torgb_raster(unsigned char **yuv, unsigned char *rgb, int w, int h)
{
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.