Commit 99b3f1d1 authored by Fabian Bauer's avatar Fabian Bauer
Browse files

change shr_r/shl_sat to shr_r_sat

parent 8e52b023
Loading
Loading
Loading
Loading
Loading
+5 −16
Original line number Diff line number Diff line
@@ -464,20 +464,9 @@ ivas_error decod_gen_voic_fx(
        test();
        test();
#ifdef ISSUE_1751_replace_shl_ro
        Word16 op16_1 = sub( Qenratio, 15 );
        Word16 op16_2 = sub( Qenratio, 10 );
        Word16 op16_3 = sub( Qsp_enratio, 15 );

        /*Due to all shift directrions being possible, we need both possibilities, shl_sat and shr_r*/
        BASOP_SATURATE_WARNING_OFF
        op16_1 = op16_1 >= 0 ? shr_r( enratio, op16_1 ) : shl_sat( enratio, negate( op16_1 ) );
        op16_2 = op16_2 >= 0 ? shr_r( sp_enratio, op16_2 ) : shl_sat( sp_enratio, negate( op16_2 ) );
        op16_3 = op16_3 >= 0 ? shr_r( sp_enratio, op16_3 ) : shl_sat( sp_enratio, negate( op16_3 ) );
        BASOP_SATURATE_WARNING_ON

        IF( GT_16( op16_1, 8192 ) &&                           /*compare with 0.25 in Q15*/
            LT_16( op16_2, 15360 ) &&                          /*compare with 15.0 in Q10*/
            GT_16( op16_3, 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*/
#else
+1 −10
Original line number Diff line number Diff line
@@ -136,16 +136,7 @@ Word16 normalized_cross_correlation_self_fx( const Word16 *signal,
        /* scale to Q15 with saturation */
        BASOP_SATURATE_WARNING_OFF
#ifdef ISSUE_1751_replace_shl_ro
        Word16 op1 = add( normXY, normCC );
        /*Both shift directiosn possible*/
        if ( op1 >= 0 )
        {
            cc = shl_sat( cc, op1 );
        }
        else
        {
            cc = shr_r( cc, negate( op1 ) );
        }
        cc = shr_r_sat( cc, negate( add( normXY, normCC ) ) );
#else
        Flag Overflow;
        cc = shl_ro( cc, add( normXY, normCC ), &Overflow );
+2 −6
Original line number Diff line number Diff line
@@ -4428,9 +4428,7 @@ void ivas_lfe_synth_with_filters_fx(
            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
#ifdef ISSUE_1751_replace_shl_ro
            assert( lfeGain_fx_exp <= 0 );
            /*if assert is thrown, shl_sat can handle the left shift*/
            lfeGain_fx = shr_r( lfeGain_fx, negate( lfeGain_fx_exp ) ); // Q15
            lfeGain_fx = shr_r_sat( lfeGain_fx, negate( lfeGain_fx_exp ) ); // Q15
#else
            Flag Overflow;
            lfeGain_fx = shl_ro( lfeGain_fx, lfeGain_fx_exp & Overflow ); // Q15
@@ -4447,9 +4445,7 @@ void ivas_lfe_synth_with_filters_fx(
            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
#ifdef ISSUE_1751_replace_shl_ro
            assert( transportGain_fx_exp <= 0 );
            /*if assert is thrown, shl_sat can handle the left shift*/
            transportGain_fx = shr_r( transportGain_fx, negate( transportGain_fx_exp ) ); // Q15
            transportGain_fx = shr_r_sat( transportGain_fx, negate( transportGain_fx_exp ) ); // Q15
#else
            Flag Overflow;
            transportGain_fx = shl_ro( transportGain_fx, transportGain_fx_exp & Overflow ); // Q15