From c82cd0624a528c4b8ebdcbe00108bdd1bf74b0af Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Tue, 24 Apr 2012 17:12:25 -0400 Subject: [PATCH] Changes all uses of SHR()/SHL() macros to SHR32()/SHL32() --- celt/_kiss_fft_guts.h | 4 ++-- celt/celt.c | 4 ++-- celt/kiss_fft.c | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/celt/_kiss_fft_guts.h b/celt/_kiss_fft_guts.h index 637ce2a0..b683467e 100644 --- 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 ) ;\ diff --git a/celt/celt.c b/celt/celt.c index 580df0d2..3b1b4f6d 100644 --- a/celt/celt.c +++ b/celt/celt.c @@ -329,7 +329,7 @@ static int transient_analysis(const opus_val32 * restrict in, int len, int C, 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 @@ static void celt_decode_lost(CELTDecoder * restrict st, opus_val16 * restrict pc } 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 */ diff --git a/celt/kiss_fft.c b/celt/kiss_fft.c index f6b90944..1a2edb84 100644 --- a/celt/kiss_fft.c +++ b/celt/kiss_fft.c @@ -67,8 +67,8 @@ static void kf_bfly2( for(j=0;jr = 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 @@ static void kf_bfly4( 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;