Loading lib_com/cldfb_evs_fx.c +8 −0 Original line number Diff line number Diff line Loading @@ -1329,7 +1329,11 @@ void GetEnergyCldfb( Word32 *energyLookahead, /*!< o: Q(*sf_energyLookahead) { FOR( j = 20; j < numberBandsM; j++ ) { #ifdef ISSUE_1799_replace_L_shr_o nrg = L_add_o( nrg, L_shr_sat( energyValues[k][j], s ), &Overflow ); #else nrg = L_add_o( nrg, L_shr_o( energyValues[k][j], s, &Overflow ), &Overflow ); #endif } } Loading @@ -1352,7 +1356,11 @@ void GetEnergyCldfb( Word32 *energyLookahead, /*!< o: Q(*sf_energyLookahead) { FOR( j = 20; j < numberBandsM; j++ ) { #ifdef ISSUE_1799_replace_L_shr_o nrg = L_add_o( nrg, L_shr_sat( energyValues[k][j], s ), &Overflow ); #else nrg = L_add_o( nrg, L_shr_o( energyValues[k][j], s, &Overflow ), &Overflow ); #endif } } Loading lib_com/cldfb_fx.c +8 −0 Original line number Diff line number Diff line Loading @@ -1590,7 +1590,11 @@ static void GetEnergyCldfb_ivas_fx( Word32 *energyLookahead, /*!< o: Q(*sf_e { FOR( j = 20; j < numberBandsM; j++ ) { #ifdef ISSUE_1799_replace_L_shr_o nrg = L_add_o( nrg, L_shr_sat( energyValues[k][j], s ), &Overflow ); #else nrg = L_add_o( nrg, L_shr_o( energyValues[k][j], s, &Overflow ), &Overflow ); #endif } } Loading @@ -1613,7 +1617,11 @@ static void GetEnergyCldfb_ivas_fx( Word32 *energyLookahead, /*!< o: Q(*sf_e { FOR( j = 20; j < numberBandsM; j++ ) { #ifdef ISSUE_1799_replace_L_shr_o nrg = L_add_o( nrg, L_shr_sat( energyValues[k][j], s ), &Overflow ); #else nrg = L_add_o( nrg, L_shr_o( energyValues[k][j], s, &Overflow ), &Overflow ); #endif } } Loading lib_com/cng_exc_fx.c +32 −4 Original line number Diff line number Diff line Loading @@ -904,7 +904,11 @@ void cng_params_upd_fx( tmpv = shl( *pt_exc2, scale ); L_tmp = L_mac0_o( L_tmp, tmpv, tmpv, &Overflow ); pt_exc2++; #ifdef ISSUE_1799_replace_L_shr_o L_ener = L_add_o( L_ener, L_shr_sat( L_tmp, 7 ), &Overflow ); /* Q(2*(Q_exc+scale)+1) ,division by L_frame done here */ #else L_ener = L_add_o( L_ener, L_shr_o( L_tmp, 7, &Overflow ), &Overflow ); /* Q(2*(Q_exc+scale)+1) ,division by L_frame done here */ #endif } } ELSE /* L_FRAME16k */ Loading @@ -917,10 +921,18 @@ void cng_params_upd_fx( tmpv = shl( *pt_exc2, scale ); L_tmp = L_mac0_o( L_tmp, tmpv, tmpv, &Overflow ); pt_exc2++; #ifdef ISSUE_1799_replace_L_shr_o L_ener = L_add_o( L_ener, L_shr_sat( Mult_32_16( L_tmp, 26214 /* 256/320, Q15 */ ), 7 ), &Overflow ); /* Q(2*(Q_exc+scale)+15+1-16+1) ,division by L_frame done here */ #else L_ener = L_add_o( L_ener, L_shr_o( Mult_32_16( L_tmp, 26214 /* 256/320, Q15 */ ), 7, &Overflow ), &Overflow ); /* Q(2*(Q_exc+scale)+15+1-16+1) ,division by L_frame done here */ #endif } } #ifdef ISSUE_1799_replace_L_shr_o L_ener = L_shr_sat( L_ener, sub( shl( add( Q_exc, scale ), 1 ), 5 ) ); /* Q6 (2*(Q_exc+scale)+1-2*(Q_exc+scale)+5) */ #else L_ener = L_shr_o( L_ener, sub( shl( add( Q_exc, scale ), 1 ), 5 ), &Overflow ); /* Q6 (2*(Q_exc+scale)+1-2*(Q_exc+scale)+5) */ #endif /* update the circular buffer of old energies */ ho_ener_circ[*ho_circ_ptr] = L_ener; Loading Loading @@ -1082,7 +1094,11 @@ void cng_params_upd_ivas_fx( tmpv = shl( *pt_exc2, scale ); L_tmp = L_mac0_o( L_tmp, tmpv, tmpv, &Overflow ); pt_exc2++; #ifdef ISSUE_1799_replace_L_shr_o L_ener = L_add_o( L_ener, L_shr_sat( L_tmp, 7 ), &Overflow ); /* Q(2*(Q_exc+scale)+1) ,division by L_frame done here */ #else L_ener = L_add_o( L_ener, L_shr_o( L_tmp, 7, &Overflow ), &Overflow ); /* Q(2*(Q_exc+scale)+1) ,division by L_frame done here */ #endif } } ELSE /* L_FRAME16k */ Loading @@ -1095,10 +1111,18 @@ void cng_params_upd_ivas_fx( tmpv = shl( *pt_exc2, scale ); L_tmp = L_mac0_o( L_tmp, tmpv, tmpv, &Overflow ); pt_exc2++; #ifdef ISSUE_1799_replace_L_shr_o L_ener = L_add_o( L_ener, L_shr_sat( Mult_32_16( L_tmp, 26214 /* 256/320, Q15 */ ), 7 ), &Overflow ); /* Q(2*(Q_exc+scale)+15+1-16+1) ,division by L_frame done here */ #else L_ener = L_add_o( L_ener, L_shr_o( Mult_32_16( L_tmp, 26214 /* 256/320, Q15 */ ), 7, &Overflow ), &Overflow ); /* Q(2*(Q_exc+scale)+15+1-16+1) ,division by L_frame done here */ #endif } } #ifdef ISSUE_1799_replace_L_shr_o L_ener = L_shr_sat( L_ener, sub( shl( add( Q_exc, scale ), 1 ), 5 ) ); /* Q6 (2*(Q_exc+scale)+1-2*(Q_exc+scale)+5) */ #else L_ener = L_shr_o( L_ener, sub( shl( add( Q_exc, scale ), 1 ), 5 ), &Overflow ); /* Q6 (2*(Q_exc+scale)+1-2*(Q_exc+scale)+5) */ #endif /* update the circular buffer of old energies */ ho_ener_circ[*ho_circ_ptr] = L_ener; Loading Loading @@ -1137,7 +1161,11 @@ void cng_params_upd_ivas_fx( L_tmp = L_add_o( L_tmp, L_tmp, &Overflow ); /* 2*Q_exc+1 */ L_tmp = Mult_32_16( L_tmp, 128 ); /* 2*Q_exc+1 */ tmp = add( add( Q_exc, Q_exc ), 1 ); #ifdef ISSUE_1799_replace_L_shr_o sp[i] = L_shr_sat( L_tmp, sub( tmp, 6 ) ); #else sp[i] = L_shr_o( L_tmp, sub( tmp, 6 ), &Overflow ); #endif move32(); /* Q6 */ ptR++; ptI--; Loading lib_com/edct_fx.c +11 −3 Original line number Diff line number Diff line Loading @@ -504,12 +504,20 @@ void edct_16fx( L_tmp = L_mult( re[i], edct_table[i] ); /*Q(Qx+Q_edct+16) */ Lacc = L_mac_o( L_tmp, im[i], *pt, &Overflow ); /*Q(Qx+Q_edct+16) */ #ifdef ISSUE_1799_replace_L_shr_o y[i2] = round_fx_o( L_shr_sat( Lacc, Q_edct ), &Overflow ); /* Q(Qx) */ #else y[i2] = round_fx_o( L_shr_o( Lacc, Q_edct, &Overflow ), &Overflow ); /* Q(Qx) */ #endif move16(); L_tmp = L_mult( re[i], edct_table[sub( shr( length, 1 ), add( 1, i ) )] ); /*Q(Qx+Q_edct+16) */ Lacc = L_msu( L_tmp, im[i], edct_table[i] ); /*Q(Qx+Q_edct+16) */ #ifdef ISSUE_1799_replace_L_shr_o *py = round_fx_o( L_shr_sat( Lacc, Q_edct ), &Overflow ); /* Q(Qx) */ #else *py = round_fx_o( L_shr_o( Lacc, Q_edct, &Overflow ), &Overflow ); /* Q(Qx) */ #endif move16(); py -= 2; Loading lib_com/frame_ener_fx.c +6 −2 Original line number Diff line number Diff line Loading @@ -277,7 +277,11 @@ Word16 frame_energy_fx( /* o : Frame energy in Q8 /*add ld(2^exp1)=exp1 but check format, first*/ tmp16 = sub( sub( 15, norm_s( exp1 ) ), 5 ); /*factor to shift Ltmp and exp1 with (shr) to avoid overflows when adding*/ #ifdef ISSUE_1799_replace_L_shr_o Ltmp = L_shr_sat( Ltmp, tmp16 ); /*Q25, tmp16*/ #else Ltmp = L_shr_o( Ltmp, tmp16, &Overflow ); /*Q25, tmp16*/ #endif exp2 = shr( exp1, tmp16 ); /*Q0 , tmp16*/ Ltmp = L_add_o( Ltmp, L_shl( L_deposit_l( exp2 ), 25 ), &Overflow ); /*Q25, tmp16, normalized*/ Loading Loading
lib_com/cldfb_evs_fx.c +8 −0 Original line number Diff line number Diff line Loading @@ -1329,7 +1329,11 @@ void GetEnergyCldfb( Word32 *energyLookahead, /*!< o: Q(*sf_energyLookahead) { FOR( j = 20; j < numberBandsM; j++ ) { #ifdef ISSUE_1799_replace_L_shr_o nrg = L_add_o( nrg, L_shr_sat( energyValues[k][j], s ), &Overflow ); #else nrg = L_add_o( nrg, L_shr_o( energyValues[k][j], s, &Overflow ), &Overflow ); #endif } } Loading @@ -1352,7 +1356,11 @@ void GetEnergyCldfb( Word32 *energyLookahead, /*!< o: Q(*sf_energyLookahead) { FOR( j = 20; j < numberBandsM; j++ ) { #ifdef ISSUE_1799_replace_L_shr_o nrg = L_add_o( nrg, L_shr_sat( energyValues[k][j], s ), &Overflow ); #else nrg = L_add_o( nrg, L_shr_o( energyValues[k][j], s, &Overflow ), &Overflow ); #endif } } Loading
lib_com/cldfb_fx.c +8 −0 Original line number Diff line number Diff line Loading @@ -1590,7 +1590,11 @@ static void GetEnergyCldfb_ivas_fx( Word32 *energyLookahead, /*!< o: Q(*sf_e { FOR( j = 20; j < numberBandsM; j++ ) { #ifdef ISSUE_1799_replace_L_shr_o nrg = L_add_o( nrg, L_shr_sat( energyValues[k][j], s ), &Overflow ); #else nrg = L_add_o( nrg, L_shr_o( energyValues[k][j], s, &Overflow ), &Overflow ); #endif } } Loading @@ -1613,7 +1617,11 @@ static void GetEnergyCldfb_ivas_fx( Word32 *energyLookahead, /*!< o: Q(*sf_e { FOR( j = 20; j < numberBandsM; j++ ) { #ifdef ISSUE_1799_replace_L_shr_o nrg = L_add_o( nrg, L_shr_sat( energyValues[k][j], s ), &Overflow ); #else nrg = L_add_o( nrg, L_shr_o( energyValues[k][j], s, &Overflow ), &Overflow ); #endif } } Loading
lib_com/cng_exc_fx.c +32 −4 Original line number Diff line number Diff line Loading @@ -904,7 +904,11 @@ void cng_params_upd_fx( tmpv = shl( *pt_exc2, scale ); L_tmp = L_mac0_o( L_tmp, tmpv, tmpv, &Overflow ); pt_exc2++; #ifdef ISSUE_1799_replace_L_shr_o L_ener = L_add_o( L_ener, L_shr_sat( L_tmp, 7 ), &Overflow ); /* Q(2*(Q_exc+scale)+1) ,division by L_frame done here */ #else L_ener = L_add_o( L_ener, L_shr_o( L_tmp, 7, &Overflow ), &Overflow ); /* Q(2*(Q_exc+scale)+1) ,division by L_frame done here */ #endif } } ELSE /* L_FRAME16k */ Loading @@ -917,10 +921,18 @@ void cng_params_upd_fx( tmpv = shl( *pt_exc2, scale ); L_tmp = L_mac0_o( L_tmp, tmpv, tmpv, &Overflow ); pt_exc2++; #ifdef ISSUE_1799_replace_L_shr_o L_ener = L_add_o( L_ener, L_shr_sat( Mult_32_16( L_tmp, 26214 /* 256/320, Q15 */ ), 7 ), &Overflow ); /* Q(2*(Q_exc+scale)+15+1-16+1) ,division by L_frame done here */ #else L_ener = L_add_o( L_ener, L_shr_o( Mult_32_16( L_tmp, 26214 /* 256/320, Q15 */ ), 7, &Overflow ), &Overflow ); /* Q(2*(Q_exc+scale)+15+1-16+1) ,division by L_frame done here */ #endif } } #ifdef ISSUE_1799_replace_L_shr_o L_ener = L_shr_sat( L_ener, sub( shl( add( Q_exc, scale ), 1 ), 5 ) ); /* Q6 (2*(Q_exc+scale)+1-2*(Q_exc+scale)+5) */ #else L_ener = L_shr_o( L_ener, sub( shl( add( Q_exc, scale ), 1 ), 5 ), &Overflow ); /* Q6 (2*(Q_exc+scale)+1-2*(Q_exc+scale)+5) */ #endif /* update the circular buffer of old energies */ ho_ener_circ[*ho_circ_ptr] = L_ener; Loading Loading @@ -1082,7 +1094,11 @@ void cng_params_upd_ivas_fx( tmpv = shl( *pt_exc2, scale ); L_tmp = L_mac0_o( L_tmp, tmpv, tmpv, &Overflow ); pt_exc2++; #ifdef ISSUE_1799_replace_L_shr_o L_ener = L_add_o( L_ener, L_shr_sat( L_tmp, 7 ), &Overflow ); /* Q(2*(Q_exc+scale)+1) ,division by L_frame done here */ #else L_ener = L_add_o( L_ener, L_shr_o( L_tmp, 7, &Overflow ), &Overflow ); /* Q(2*(Q_exc+scale)+1) ,division by L_frame done here */ #endif } } ELSE /* L_FRAME16k */ Loading @@ -1095,10 +1111,18 @@ void cng_params_upd_ivas_fx( tmpv = shl( *pt_exc2, scale ); L_tmp = L_mac0_o( L_tmp, tmpv, tmpv, &Overflow ); pt_exc2++; #ifdef ISSUE_1799_replace_L_shr_o L_ener = L_add_o( L_ener, L_shr_sat( Mult_32_16( L_tmp, 26214 /* 256/320, Q15 */ ), 7 ), &Overflow ); /* Q(2*(Q_exc+scale)+15+1-16+1) ,division by L_frame done here */ #else L_ener = L_add_o( L_ener, L_shr_o( Mult_32_16( L_tmp, 26214 /* 256/320, Q15 */ ), 7, &Overflow ), &Overflow ); /* Q(2*(Q_exc+scale)+15+1-16+1) ,division by L_frame done here */ #endif } } #ifdef ISSUE_1799_replace_L_shr_o L_ener = L_shr_sat( L_ener, sub( shl( add( Q_exc, scale ), 1 ), 5 ) ); /* Q6 (2*(Q_exc+scale)+1-2*(Q_exc+scale)+5) */ #else L_ener = L_shr_o( L_ener, sub( shl( add( Q_exc, scale ), 1 ), 5 ), &Overflow ); /* Q6 (2*(Q_exc+scale)+1-2*(Q_exc+scale)+5) */ #endif /* update the circular buffer of old energies */ ho_ener_circ[*ho_circ_ptr] = L_ener; Loading Loading @@ -1137,7 +1161,11 @@ void cng_params_upd_ivas_fx( L_tmp = L_add_o( L_tmp, L_tmp, &Overflow ); /* 2*Q_exc+1 */ L_tmp = Mult_32_16( L_tmp, 128 ); /* 2*Q_exc+1 */ tmp = add( add( Q_exc, Q_exc ), 1 ); #ifdef ISSUE_1799_replace_L_shr_o sp[i] = L_shr_sat( L_tmp, sub( tmp, 6 ) ); #else sp[i] = L_shr_o( L_tmp, sub( tmp, 6 ), &Overflow ); #endif move32(); /* Q6 */ ptR++; ptI--; Loading
lib_com/edct_fx.c +11 −3 Original line number Diff line number Diff line Loading @@ -504,12 +504,20 @@ void edct_16fx( L_tmp = L_mult( re[i], edct_table[i] ); /*Q(Qx+Q_edct+16) */ Lacc = L_mac_o( L_tmp, im[i], *pt, &Overflow ); /*Q(Qx+Q_edct+16) */ #ifdef ISSUE_1799_replace_L_shr_o y[i2] = round_fx_o( L_shr_sat( Lacc, Q_edct ), &Overflow ); /* Q(Qx) */ #else y[i2] = round_fx_o( L_shr_o( Lacc, Q_edct, &Overflow ), &Overflow ); /* Q(Qx) */ #endif move16(); L_tmp = L_mult( re[i], edct_table[sub( shr( length, 1 ), add( 1, i ) )] ); /*Q(Qx+Q_edct+16) */ Lacc = L_msu( L_tmp, im[i], edct_table[i] ); /*Q(Qx+Q_edct+16) */ #ifdef ISSUE_1799_replace_L_shr_o *py = round_fx_o( L_shr_sat( Lacc, Q_edct ), &Overflow ); /* Q(Qx) */ #else *py = round_fx_o( L_shr_o( Lacc, Q_edct, &Overflow ), &Overflow ); /* Q(Qx) */ #endif move16(); py -= 2; Loading
lib_com/frame_ener_fx.c +6 −2 Original line number Diff line number Diff line Loading @@ -277,7 +277,11 @@ Word16 frame_energy_fx( /* o : Frame energy in Q8 /*add ld(2^exp1)=exp1 but check format, first*/ tmp16 = sub( sub( 15, norm_s( exp1 ) ), 5 ); /*factor to shift Ltmp and exp1 with (shr) to avoid overflows when adding*/ #ifdef ISSUE_1799_replace_L_shr_o Ltmp = L_shr_sat( Ltmp, tmp16 ); /*Q25, tmp16*/ #else Ltmp = L_shr_o( Ltmp, tmp16, &Overflow ); /*Q25, tmp16*/ #endif exp2 = shr( exp1, tmp16 ); /*Q0 , tmp16*/ Ltmp = L_add_o( Ltmp, L_shl( L_deposit_l( exp2 ), 25 ), &Overflow ); /*Q25, tmp16, normalized*/ Loading