shithub: opus

Download patch

ref: c82cd0624a528c4b8ebdcbe00108bdd1bf74b0af
parent: b3deb5342f54a1b09a5d301ae937914320691f2c
author: Jean-Marc Valin <[email protected]>
date: Tue Apr 24 13:12:25 EDT 2012

Changes all uses of SHR()/SHL() macros to SHR32()/SHL32()

--- a/celt/_kiss_fft_guts.h
+++ b/celt/_kiss_fft_guts.h
@@ -67,8 +67,8 @@
           (m).i = SUB32(S_MUL((a).i,(b).r) , S_MUL((a).r,(b).i)); }while(0)
 
 #   define C_MUL4(m,a,b) \
-      do{ (m).r = SHR(SUB32(S_MUL((a).r,(b).r) , S_MUL((a).i,(b).i)),2); \
-          (m).i = SHR(ADD32(S_MUL((a).r,(b).i) , S_MUL((a).i,(b).r)),2); }while(0)
+      do{ (m).r = SHR32(SUB32(S_MUL((a).r,(b).r) , S_MUL((a).i,(b).i)),2); \
+          (m).i = SHR32(ADD32(S_MUL((a).r,(b).i) , S_MUL((a).i,(b).r)),2); }while(0)
 
 #   define C_MULBYSCALAR( c, s ) \
       do{ (c).r =  S_MUL( (c).r , s ) ;\
--- a/celt/celt.c
+++ b/celt/celt.c
@@ -329,7 +329,7 @@
       mem0 = mem1 + y - 2*x;
       mem1 = x - .5f*y;
 #endif
-      tmp[i] = EXTRACT16(SHR(y,2));
+      tmp[i] = EXTRACT16(SHR32(y,2));
    }
    /* First few samples are bad because we don't propagate the memory */
    for (i=0;i<12;i++)
@@ -2181,7 +2181,7 @@
             }
             if (E1 > E2)
                E1 = E2;
-            decay = celt_sqrt(frac_div32(SHR(E1,1),E2));
+            decay = celt_sqrt(frac_div32(SHR32(E1,1),E2));
          }
 
          /* Copy excitation, taking decay into account */
--- a/celt/kiss_fft.c
+++ b/celt/kiss_fft.c
@@ -67,8 +67,8 @@
       for(j=0;j<m;j++)
       {
          kiss_fft_cpx t;
-         Fout->r = SHR(Fout->r, 1);Fout->i = SHR(Fout->i, 1);
-         Fout2->r = SHR(Fout2->r, 1);Fout2->i = SHR(Fout2->i, 1);
+         Fout->r = SHR32(Fout->r, 1);Fout->i = SHR32(Fout->i, 1);
+         Fout2->r = SHR32(Fout2->r, 1);Fout2->i = SHR32(Fout2->i, 1);
          C_MUL (t,  *Fout2 , *tw1);
          tw1 += fstride;
          C_SUB( *Fout2 ,  *Fout , t );
@@ -136,14 +136,14 @@
          C_MUL4(scratch[1],Fout[m2] , *tw2 );
          C_MUL4(scratch[2],Fout[m3] , *tw3 );
 
-         Fout->r = PSHR(Fout->r, 2);
-         Fout->i = PSHR(Fout->i, 2);
+         Fout->r = PSHR32(Fout->r, 2);
+         Fout->i = PSHR32(Fout->i, 2);
          C_SUB( scratch[5] , *Fout, scratch[1] );
          C_ADDTO(*Fout, scratch[1]);
          C_ADD( scratch[3] , scratch[0] , scratch[2] );
          C_SUB( scratch[4] , scratch[0] , scratch[2] );
-         Fout[m2].r = PSHR(Fout[m2].r, 2);
-         Fout[m2].i = PSHR(Fout[m2].i, 2);
+         Fout[m2].r = PSHR32(Fout[m2].r, 2);
+         Fout[m2].i = PSHR32(Fout[m2].i, 2);
          C_SUB( Fout[m2], *Fout, scratch[3] );
          tw1 += fstride;
          tw2 += fstride*2;