[FFmpeg-cvslog] sws-PPC: fix after VOFW change.

Michael Niedermayer git at videolan.org
Thu May 12 02:50:09 CEST 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu May 12 02:26:22 2011 +0200| [1cafc23288b9d860b9f309c86a5f148b73c07270] | committer: Michael Niedermayer

sws-PPC: fix after VOFW change.

It seems sws-PPC did hardcode 2048 at various places instead of using VOFW.
This also means that all past VOFW benchmarks on PPC are meaningless
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1cafc23288b9d860b9f309c86a5f148b73c07270
---

 libswscale/ppc/swscale_altivec_template.c |    8 ++++----
 libswscale/ppc/yuv2rgb_altivec.c          |    4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/libswscale/ppc/swscale_altivec_template.c b/libswscale/ppc/swscale_altivec_template.c
index 299fe51..c7aa0fd 100644
--- a/libswscale/ppc/swscale_altivec_template.c
+++ b/libswscale/ppc/swscale_altivec_template.c
@@ -161,12 +161,12 @@ yuv2yuvX_altivec_real(const int16_t *lumFilter, const int16_t **lumSrc, int lumF
 
             perm = vec_lvsl(0, chrSrc[j]);
             l1 = vec_ld(0, chrSrc[j]);
-            l1_V = vec_ld(2048 << 1, chrSrc[j]);
+            l1_V = vec_ld(VOFW << 1, chrSrc[j]);
 
             for (i = 0; i < (chrDstW - 7); i+=8) {
                 int offset = i << 2;
                 vector signed short l2 = vec_ld((i << 1) + 16, chrSrc[j]);
-                vector signed short l2_V = vec_ld(((i + 2048) << 1) + 16, chrSrc[j]);
+                vector signed short l2_V = vec_ld(((i + VOFW) << 1) + 16, chrSrc[j]);
 
                 vector signed int v1 = vec_ld(offset, u);
                 vector signed int v2 = vec_ld(offset + 16, u);
@@ -174,7 +174,7 @@ yuv2yuvX_altivec_real(const int16_t *lumFilter, const int16_t **lumSrc, int lumF
                 vector signed int v2_V = vec_ld(offset + 16, v);
 
                 vector signed short ls = vec_perm(l1, l2, perm); // chrSrc[j][i] ... chrSrc[j][i+7]
-                vector signed short ls_V = vec_perm(l1_V, l2_V, perm); // chrSrc[j][i+2048] ... chrSrc[j][i+2055]
+                vector signed short ls_V = vec_perm(l1_V, l2_V, perm); // chrSrc[j][i+VOFW] ... chrSrc[j][i+2055]
 
                 vector signed int i1 = vec_mule(vChrFilter, ls);
                 vector signed int i2 = vec_mulo(vChrFilter, ls);
@@ -201,7 +201,7 @@ yuv2yuvX_altivec_real(const int16_t *lumFilter, const int16_t **lumSrc, int lumF
             }
             for ( ; i < chrDstW; i++) {
                 u[i] += chrSrc[j][i] * chrFilter[j];
-                v[i] += chrSrc[j][i + 2048] * chrFilter[j];
+                v[i] += chrSrc[j][i + VOFW] * chrFilter[j];
             }
         }
         altivec_packIntArrayToCharArray(u, uDest, chrDstW);
diff --git a/libswscale/ppc/yuv2rgb_altivec.c b/libswscale/ppc/yuv2rgb_altivec.c
index bf605bc..2b58eb2 100644
--- a/libswscale/ppc/yuv2rgb_altivec.c
+++ b/libswscale/ppc/yuv2rgb_altivec.c
@@ -817,7 +817,7 @@ ff_yuv2packedX_altivec(SwsContext *c,
         for (j=0; j<chrFilterSize; j++) {
             X  = vec_ld (0, &chrSrc[j][i/2]);
             U  = vec_mradds (X, CCoeffs[j], U);
-            X  = vec_ld (0, &chrSrc[j][i/2+2048]);
+            X  = vec_ld (0, &chrSrc[j][i/2+VOFW]);
             V  = vec_mradds (X, CCoeffs[j], V);
         }
 
@@ -895,7 +895,7 @@ ff_yuv2packedX_altivec(SwsContext *c,
         for (j=0; j<chrFilterSize; j++) {
             X  = vec_ld (0, &chrSrc[j][i/2]);
             U  = vec_mradds (X, CCoeffs[j], U);
-            X  = vec_ld (0, &chrSrc[j][i/2+2048]);
+            X  = vec_ld (0, &chrSrc[j][i/2+VOFW]);
             V  = vec_mradds (X, CCoeffs[j], V);
         }
 



More information about the ffmpeg-cvslog mailing list