Commit 1508027f authored by Fabian Bauer's avatar Fabian Bauer
Browse files

add asserts to catch all shl_sat, replacing shl_ro

parent 36325f77
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -468,6 +468,10 @@ ivas_error decod_gen_voic_fx(
        Word16 op16_2 = sub( Qenratio, 10 );
        Word16 op16_3 = sub( Qsp_enratio, 15 );

        assert( op16_1 >= 0 );
        assert( op16_2 >= 0 );
        assert( op16_3 >= 0 );

        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 ) );
+1 −0
Original line number Diff line number Diff line
@@ -137,6 +137,7 @@ Word16 normalized_cross_correlation_self_fx( const Word16 *signal,
        BASOP_SATURATE_WARNING_OFF
#ifdef ISSUE_1751_replace_shl_ro
        Word16 op1 = add( normXY, normCC );
        assert( op1 >= 0 );
        if ( op1 >= 0 )
        {
            cc = shl_sat( cc, add( normXY, normCC ) );
+2 −0
Original line number Diff line number Diff line
@@ -4086,6 +4086,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 ( lfeGain_fx_exp >= 0 )
            {
                lfeGain_fx = shl_sat( lfeGain_fx, lfeGain_fx_exp ); // Q15
@@ -4110,6 +4111,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 ( transportGain_fx_exp >= 0 )
            {
                transportGain_fx = shl_sat( transportGain_fx, transportGain_fx_exp ); // Q15