Commit 7ed09264 authored by Fabian Bauer's avatar Fabian Bauer
Browse files

change shr_r to shr_r_sat

parent 37e55195
Loading
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -463,9 +463,9 @@ ivas_error decod_gen_voic_fx(
        test();
        test();
        test();
        IF( GT_16( shr_r( enratio, sub( Qenratio, 15 ) ), 8192 ) &&       /*compare with 0.25 in Q15*/
            LT_16( shr_r( enratio, sub( Qenratio, 10 ) ), 15360 ) &&      /*compare with 15.0 in Q10*/
            GT_16( shr_r( sp_enratio, sub( Qsp_enratio, 15 ) ), 4915 ) && /*compare with 0.15 in Q15*/
        IF( GT_16( shr_r_sat( enratio, sub( Qenratio, 15 ) ), 8192 ) &&       /*compare with 0.25 in Q15*/
            LT_16( shr_r_sat( enratio, sub( Qenratio, 10 ) ), 15360 ) &&      /*compare with 15.0 in Q10*/
            GT_16( shr_r_sat( sp_enratio, sub( Qsp_enratio, 15 ) ), 4915 ) && /*compare with 0.15 in Q15*/
            LT_16( st_fx->bfi_pitch_fx, 9600 ) &&                         /*Q6*/
            LT_16( pitch_buf_fx[( NB_SUBFR16k - 1 )], 9600 ) )            /*Q6*/
        {
+1 −1
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@ Word16 normalized_cross_correlation_self_fx( const Word16 *signal,
        normCC = add( normCC, 16 );
        /* scale to Q15 with saturation */
        BASOP_SATURATE_WARNING_OFF
        cc = shr_r( cc, negate( add( normXY, normCC ) ) );
        cc = shr_r_sat( cc, negate( add( normXY, normCC ) ) );
        BASOP_SATURATE_WARNING_ON
        *energy = L_shr_r( L_deposit_l( sqrtXY ), normXY );
    }
+2 −2
Original line number Diff line number Diff line
@@ -4085,7 +4085,7 @@ void ivas_lfe_synth_with_filters_fx(
            lfeGain_fx = extract_h( BASOP_Util_Divide3232_Scale_newton( hMasaLfeSynth->targetEneLfeSmooth_fx, L_add( EPSILON_FX, hMasaLfeSynth->transportEneSmooth_fx ), &lfeGain_fx_exp ) ); /*Q(31-(lfeGain_fx_exp+hMasaLfeSynth->transportEneSmooth_q-hMasaLfeSynth->targetEneLfeSmooth_q))-16*/
            lfeGain_fx_exp = add( sub( hMasaLfeSynth->transportEneSmooth_q, hMasaLfeSynth->targetEneLfeSmooth_q ), lfeGain_fx_exp );
            lfeGain_fx = Sqrt16( lfeGain_fx, &lfeGain_fx_exp );         // Q15-lfeGain_fx_exp
            lfeGain_fx = shr_r( lfeGain_fx, negate( lfeGain_fx_exp ) ); // Q15
            lfeGain_fx = shr_r_sat( lfeGain_fx, negate( lfeGain_fx_exp ) ); // Q15
        }
        IF( EQ_16( BASOP_Util_Cmp_Mant32Exp( hMasaLfeSynth->targetEneTransSmooth_fx, sub( Q31, hMasaLfeSynth->targetEneTransSmooth_q ), /*EPSILON + */ hMasaLfeSynth->transportEneSmooth_fx, sub( Q31, hMasaLfeSynth->transportEneSmooth_q ) ), 1 ) )
        {
@@ -4097,7 +4097,7 @@ void ivas_lfe_synth_with_filters_fx(
            transportGain_fx = BASOP_Util_Divide3232_Scale( hMasaLfeSynth->targetEneTransSmooth_fx, /*EPSILON + */ hMasaLfeSynth->transportEneSmooth_fx, &transportGain_fx_exp ); /*Q=15-(transportGain_fx_exp+hMasaLfeSynth->transportEneSmooth_q-hMasaLfeSynth->targetEneTransSmooth_q)*/
            transportGain_fx_exp = add( sub( hMasaLfeSynth->transportEneSmooth_q, hMasaLfeSynth->targetEneTransSmooth_q ), transportGain_fx_exp );
            transportGain_fx = Sqrt16( transportGain_fx, &transportGain_fx_exp );         // q15-transportGain_fx_exp
            transportGain_fx = shr_r( transportGain_fx, negate( transportGain_fx_exp ) ); // Q15
            transportGain_fx = shr_r_sat( transportGain_fx, negate( transportGain_fx_exp ) ); // Q15
        }
        j = 0;
        move16();