changeset 5746:55ed6dc5d476 libavcodec

Remove const vector macro indirection that is useless and obfuscating now that the Metrowerks workarounds are gone.
author diego
date Mon, 01 Oct 2007 14:23:36 +0000
parents 61768139733b
children ed8e08db68c6
files ppc/dsputil_altivec.c ppc/gcc_fixes.h ppc/gmc_altivec.c ppc/idct_altivec.c ppc/mpegvideo_altivec.c
diffstat 5 files changed, 51 insertions(+), 53 deletions(-) [+]
line wrap: on
line diff
--- a/ppc/dsputil_altivec.c	Mon Oct 01 14:16:07 2007 +0000
+++ b/ppc/dsputil_altivec.c	Mon Oct 01 14:23:36 2007 +0000
@@ -55,7 +55,7 @@
 {
     int i;
     DECLARE_ALIGNED_16(int, s);
-    const_vector unsigned char zero = (const_vector unsigned char)vec_splat_u8(0);
+    const vector unsigned char zero = (const vector unsigned char)vec_splat_u8(0);
     vector unsigned char *tv;
     vector unsigned char pix1v, pix2v, pix2iv, avgv, t5;
     vector unsigned int sad;
@@ -102,7 +102,7 @@
 {
     int i;
     DECLARE_ALIGNED_16(int, s);
-    const_vector unsigned char zero = (const_vector unsigned char)vec_splat_u8(0);
+    const vector unsigned char zero = (const vector unsigned char)vec_splat_u8(0);
     vector unsigned char *tv;
     vector unsigned char pix1v, pix2v, pix3v, avgv, t5;
     vector unsigned int sad;
@@ -163,8 +163,8 @@
     int i;
     DECLARE_ALIGNED_16(int, s);
     uint8_t *pix3 = pix2 + line_size;
-    const_vector unsigned char zero = (const_vector unsigned char)vec_splat_u8(0);
-    const_vector unsigned short two = (const_vector unsigned short)vec_splat_u16(2);
+    const vector unsigned char zero = (const vector unsigned char)vec_splat_u8(0);
+    const vector unsigned short two = (const vector unsigned short)vec_splat_u16(2);
     vector unsigned char *tv, avgv, t5;
     vector unsigned char pix1v, pix2v, pix3v, pix2iv, pix3iv;
     vector unsigned short pix2lv, pix2hv, pix2ilv, pix2ihv;
@@ -263,7 +263,7 @@
 {
     int i;
     DECLARE_ALIGNED_16(int, s);
-    const_vector unsigned int zero = (const_vector unsigned int)vec_splat_u32(0);
+    const vector unsigned int zero = (const vector unsigned int)vec_splat_u32(0);
     vector unsigned char perm1, perm2, *pix1v, *pix2v;
     vector unsigned char t1, t2, t3,t4, t5;
     vector unsigned int sad;
@@ -305,7 +305,7 @@
 {
     int i;
     DECLARE_ALIGNED_16(int, s);
-    const_vector unsigned int zero = (const_vector unsigned int)vec_splat_u32(0);
+    const vector unsigned int zero = (const vector unsigned int)vec_splat_u32(0);
     vector unsigned char perm1, perm2, permclear, *pix1v, *pix2v;
     vector unsigned char t1, t2, t3,t4, t5;
     vector unsigned int sad;
@@ -350,7 +350,7 @@
 {
     int i;
     DECLARE_ALIGNED_16(int, s);
-    const_vector unsigned int zero = (const_vector unsigned int)vec_splat_u32(0);
+    const vector unsigned int zero = (const vector unsigned int)vec_splat_u32(0);
     vector unsigned char *tv;
     vector unsigned char pixv;
     vector unsigned int sv;
@@ -386,7 +386,7 @@
 {
     int i;
     DECLARE_ALIGNED_16(int, s);
-    const_vector unsigned int zero = (const_vector unsigned int)vec_splat_u32(0);
+    const vector unsigned int zero = (const vector unsigned int)vec_splat_u32(0);
     vector unsigned char perm1, perm2, permclear, *pix1v, *pix2v;
     vector unsigned char t1, t2, t3,t4, t5;
     vector unsigned int sum;
@@ -442,7 +442,7 @@
 {
     int i;
     DECLARE_ALIGNED_16(int, s);
-    const_vector unsigned int zero = (const_vector unsigned int)vec_splat_u32(0);
+    const vector unsigned int zero = (const vector unsigned int)vec_splat_u32(0);
     vector unsigned char perm1, perm2, *pix1v, *pix2v;
     vector unsigned char t1, t2, t3,t4, t5;
     vector unsigned int sum;
@@ -486,7 +486,7 @@
 
 int pix_sum_altivec(uint8_t * pix, int line_size)
 {
-    const_vector unsigned int zero = (const_vector unsigned int)vec_splat_u32(0);
+    const vector unsigned int zero = (const vector unsigned int)vec_splat_u32(0);
     vector unsigned char perm, *pixv;
     vector unsigned char t1;
     vector unsigned int sad;
@@ -521,7 +521,7 @@
 {
     int i;
     vector unsigned char perm, bytes, *pixv;
-    const_vector unsigned char zero = (const_vector unsigned char)vec_splat_u8(0);
+    const vector unsigned char zero = (const vector unsigned char)vec_splat_u8(0);
     vector signed short shorts;
 
     for(i=0;i<8;i++)
@@ -548,7 +548,7 @@
 {
     int i;
     vector unsigned char perm, bytes, *pixv;
-    const_vector unsigned char zero = (const_vector unsigned char)vec_splat_u8(0);
+    const vector unsigned char zero = (const vector unsigned char)vec_splat_u8(0);
     vector signed short shorts1, shorts2;
 
     for(i=0;i<4;i++)
@@ -767,8 +767,8 @@
      blockv, temp1, temp2;
    register vector unsigned short
      pixelssum1, pixelssum2, temp3;
-   register const_vector unsigned char vczero = (const_vector unsigned char)vec_splat_u8(0);
-   register const_vector unsigned short vctwo = (const_vector unsigned short)vec_splat_u16(2);
+   register const vector unsigned char vczero = (const vector unsigned char)vec_splat_u8(0);
+   register const vector unsigned short vctwo = (const vector unsigned short)vec_splat_u16(2);
 
    temp1 = vec_ld(0, pixels);
    temp2 = vec_ld(16, pixels);
@@ -843,9 +843,9 @@
      blockv, temp1, temp2;
    register vector unsigned short
      pixelssum1, pixelssum2, temp3;
-   register const_vector unsigned char vczero = (const_vector unsigned char)vec_splat_u8(0);
-   register const_vector unsigned short vcone = (const_vector unsigned short)vec_splat_u16(1);
-   register const_vector unsigned short vctwo = (const_vector unsigned short)vec_splat_u16(2);
+   register const vector unsigned char vczero = (const vector unsigned char)vec_splat_u8(0);
+   register const vector unsigned short vcone = (const vector unsigned short)vec_splat_u16(1);
+   register const vector unsigned short vctwo = (const vector unsigned short)vec_splat_u16(2);
 
    temp1 = vec_ld(0, pixels);
    temp2 = vec_ld(16, pixels);
@@ -920,8 +920,8 @@
    register vector unsigned short
      pixelssum1, pixelssum2, temp3,
      pixelssum3, pixelssum4, temp4;
-   register const_vector unsigned char vczero = (const_vector unsigned char)vec_splat_u8(0);
-   register const_vector unsigned short vctwo = (const_vector unsigned short)vec_splat_u16(2);
+   register const vector unsigned char vczero = (const vector unsigned char)vec_splat_u8(0);
+   register const vector unsigned short vctwo = (const vector unsigned short)vec_splat_u16(2);
 
 POWERPC_PERF_START_COUNT(altivec_put_pixels16_xy2_num, 1);
 
@@ -1002,9 +1002,9 @@
    register vector unsigned short
      pixelssum1, pixelssum2, temp3,
      pixelssum3, pixelssum4, temp4;
-   register const_vector unsigned char vczero = (const_vector unsigned char)vec_splat_u8(0);
-   register const_vector unsigned short vcone = (const_vector unsigned short)vec_splat_u16(1);
-   register const_vector unsigned short vctwo = (const_vector unsigned short)vec_splat_u16(2);
+   register const vector unsigned char vczero = (const vector unsigned char)vec_splat_u8(0);
+   register const vector unsigned short vcone = (const vector unsigned short)vec_splat_u16(1);
+   register const vector unsigned short vctwo = (const vector unsigned short)vec_splat_u16(2);
 
 POWERPC_PERF_START_COUNT(altivec_put_no_rnd_pixels16_xy2_num, 1);
 
@@ -1076,25 +1076,25 @@
 int hadamard8_diff8x8_altivec(/*MpegEncContext*/ void *s, uint8_t *dst, uint8_t *src, int stride, int h){
 POWERPC_PERF_DECLARE(altivec_hadamard8_diff8x8_num, 1);
     int sum;
-    register const_vector unsigned char vzero =
-                            (const_vector unsigned char)vec_splat_u8(0);
+    register const vector unsigned char vzero =
+                            (const vector unsigned char)vec_splat_u8(0);
     register vector signed short temp0, temp1, temp2, temp3, temp4,
                                  temp5, temp6, temp7;
 POWERPC_PERF_START_COUNT(altivec_hadamard8_diff8x8_num, 1);
   {
-    register const_vector signed short vprod1 =(const_vector signed short)
+    register const vector signed short vprod1 =(const vector signed short)
                                         AVV( 1,-1, 1,-1, 1,-1, 1,-1);
-    register const_vector signed short vprod2 =(const_vector signed short)
+    register const vector signed short vprod2 =(const vector signed short)
                                         AVV( 1, 1,-1,-1, 1, 1,-1,-1);
-    register const_vector signed short vprod3 =(const_vector signed short)
+    register const vector signed short vprod3 =(const vector signed short)
                                         AVV( 1, 1, 1, 1,-1,-1,-1,-1);
-    register const_vector unsigned char perm1 = (const_vector unsigned char)
+    register const vector unsigned char perm1 = (const vector unsigned char)
       AVV(0x02, 0x03, 0x00, 0x01, 0x06, 0x07, 0x04, 0x05,
           0x0A, 0x0B, 0x08, 0x09, 0x0E, 0x0F, 0x0C, 0x0D);
-    register const_vector unsigned char perm2 = (const_vector unsigned char)
+    register const vector unsigned char perm2 = (const vector unsigned char)
       AVV(0x04, 0x05, 0x06, 0x07, 0x00, 0x01, 0x02, 0x03,
           0x0C, 0x0D, 0x0E, 0x0F, 0x08, 0x09, 0x0A, 0x0B);
-    register const_vector unsigned char perm3 = (const_vector unsigned char)
+    register const vector unsigned char perm3 = (const vector unsigned char)
       AVV(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
           0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
 
@@ -1224,25 +1224,25 @@
         temp5S REG_v(v13),
         temp6S REG_v(v14),
         temp7S REG_v(v15);
-    register const_vector unsigned char vzero REG_v(v31)=
-        (const_vector unsigned char)vec_splat_u8(0);
+    register const vector unsigned char vzero REG_v(v31)=
+        (const vector unsigned char)vec_splat_u8(0);
   {
-    register const_vector signed short vprod1 REG_v(v16)=
-        (const_vector signed short)AVV( 1,-1, 1,-1, 1,-1, 1,-1);
-    register const_vector signed short vprod2 REG_v(v17)=
-        (const_vector signed short)AVV( 1, 1,-1,-1, 1, 1,-1,-1);
-    register const_vector signed short vprod3 REG_v(v18)=
-        (const_vector signed short)AVV( 1, 1, 1, 1,-1,-1,-1,-1);
-    register const_vector unsigned char perm1 REG_v(v19)=
-        (const_vector unsigned char)
+    register const vector signed short vprod1 REG_v(v16)=
+        (const vector signed short)AVV( 1,-1, 1,-1, 1,-1, 1,-1);
+    register const vector signed short vprod2 REG_v(v17)=
+        (const vector signed short)AVV( 1, 1,-1,-1, 1, 1,-1,-1);
+    register const vector signed short vprod3 REG_v(v18)=
+        (const vector signed short)AVV( 1, 1, 1, 1,-1,-1,-1,-1);
+    register const vector unsigned char perm1 REG_v(v19)=
+        (const vector unsigned char)
         AVV(0x02, 0x03, 0x00, 0x01, 0x06, 0x07, 0x04, 0x05,
             0x0A, 0x0B, 0x08, 0x09, 0x0E, 0x0F, 0x0C, 0x0D);
-    register const_vector unsigned char perm2 REG_v(v20)=
-        (const_vector unsigned char)
+    register const vector unsigned char perm2 REG_v(v20)=
+        (const vector unsigned char)
         AVV(0x04, 0x05, 0x06, 0x07, 0x00, 0x01, 0x02, 0x03,
             0x0C, 0x0D, 0x0E, 0x0F, 0x08, 0x09, 0x0A, 0x0B);
-    register const_vector unsigned char perm3 REG_v(v21)=
-        (const_vector unsigned char)
+    register const vector unsigned char perm3 REG_v(v21)=
+        (const vector unsigned char)
         AVV(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
             0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
 
@@ -1490,9 +1490,9 @@
     register vector unsigned char blockv, temp1, temp2, blocktemp;
     register vector unsigned short pixelssum1, pixelssum2, temp3;
 
-    register const_vector unsigned char vczero = (const_vector unsigned char)
+    register const vector unsigned char vczero = (const vector unsigned char)
                                         vec_splat_u8(0);
-    register const_vector unsigned short vctwo = (const_vector unsigned short)
+    register const vector unsigned short vctwo = (const vector unsigned short)
                                         vec_splat_u16(2);
 
     temp1 = vec_ld(0, pixels);
--- a/ppc/gcc_fixes.h	Mon Oct 01 14:16:07 2007 +0000
+++ b/ppc/gcc_fixes.h	Mon Oct 01 14:23:36 2007 +0000
@@ -97,6 +97,4 @@
 
 #endif
 
-#define const_vector const vector
-
 #endif /* GCC_FIXES_H */
--- a/ppc/gmc_altivec.c	Mon Oct 01 14:16:07 2007 +0000
+++ b/ppc/gmc_altivec.c	Mon Oct 01 14:23:36 2007 +0000
@@ -45,8 +45,8 @@
         (   x16)*(   y16), /* D */
         0, 0, 0, 0         /* padding */
       };
-    register const_vector unsigned char vczero = (const_vector unsigned char)vec_splat_u8(0);
-    register const_vector unsigned short vcsr8 = (const_vector unsigned short)vec_splat_u16(8);
+    register const vector unsigned char vczero = (const vector unsigned char)vec_splat_u8(0);
+    register const vector unsigned short vcsr8 = (const vector unsigned short)vec_splat_u16(8);
     register vector unsigned char dstv, dstv2, src_0, src_1, srcvA, srcvB, srcvC, srcvD;
     register vector unsigned short Av, Bv, Cv, Dv, rounderV, tempA, tempB, tempC, tempD;
     int i;
--- a/ppc/idct_altivec.c	Mon Oct 01 14:16:07 2007 +0000
+++ b/ppc/idct_altivec.c	Mon Oct 01 14:23:36 2007 +0000
@@ -45,7 +45,7 @@
 #include "dsputil_altivec.h"
 
 #define vector_s16_t vector signed short
-#define const_vector_s16_t const_vector signed short
+#define const_vector_s16_t const vector signed short
 #define vector_u16_t vector unsigned short
 #define vector_s8_t vector signed char
 #define vector_u8_t vector unsigned char
--- a/ppc/mpegvideo_altivec.c	Mon Oct 01 14:16:07 2007 +0000
+++ b/ppc/mpegvideo_altivec.c	Mon Oct 01 14:23:36 2007 +0000
@@ -79,7 +79,7 @@
     int lastNonZero;
     vector float row0, row1, row2, row3, row4, row5, row6, row7;
     vector float alt0, alt1, alt2, alt3, alt4, alt5, alt6, alt7;
-    const_vector float zero = (const_vector float)FOUROF(0.);
+    const vector float zero = (const vector float)FOUROF(0.);
     // used after quantise step
     int oldBaseValue = 0;
 
@@ -522,7 +522,7 @@
     }
 
     {
-      register const_vector signed short vczero = (const_vector signed short)vec_splat_s16(0);
+      register const vector signed short vczero = (const vector signed short)vec_splat_s16(0);
       DECLARE_ALIGNED_16(short, qmul8[]) =
           {
             qmul, qmul, qmul, qmul,