Commit 40543cfe authored by Fabian Bauer's avatar Fabian Bauer
Browse files

ivas_dirac_output_synthesis_dec_fx.c: change shl_ro to shr_r, invert shift...

ivas_dirac_output_synthesis_dec_fx.c: change shl_ro to shr_r, invert shift factor and delete overflow flag
parent 6ab3ac9e
Loading
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -106,10 +106,6 @@ ivas_error decod_gen_voic_fx(
    gain_inov_fx = 0;
    error_fx = 0;
    gain_preQ_fx = 0;
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
    Flag Overflow = 0;
    move32();
#endif
    move16();
    move32();
    move32();
@@ -467,9 +463,9 @@ ivas_error decod_gen_voic_fx(
        test();
        test();
        test();
        IF( GT_16( shl_ro( enratio, sub( 15, Qenratio ), &Overflow ), 8192 ) &&       /*compare with 0.25 in Q15*/
            LT_16( shl_ro( enratio, sub( 10, Qenratio ), &Overflow ), 15360 ) &&      /*compare with 15.0 in Q10*/
            GT_16( shl_ro( sp_enratio, sub( 15, Qsp_enratio ), &Overflow ), 4915 ) && /*compare with 0.15 in Q15*/
        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*/
            LT_16( st_fx->bfi_pitch_fx, 9600 ) &&                                     /*Q6*/
            LT_16( pitch_buf_fx[( NB_SUBFR16k - 1 )], 9600 ) )                        /*Q6*/
        {
+1 −2
Original line number Diff line number Diff line
@@ -128,7 +128,6 @@ Word16 normalized_cross_correlation_self_fx( const Word16 *signal,

    IF( sqrtXY != 0 )
    {
        Flag Overflow = 0;
        move32();
        normCC = 0;
        move16();
@@ -136,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 = shl_ro( cc, add( normXY, normCC ), &Overflow );
        cc = shr_r( cc, negate(add( normXY, normCC )) );
        BASOP_SATURATE_WARNING_ON
        *energy = L_shr_r( L_deposit_l( sqrtXY ), normXY );
    }
+2 −4
Original line number Diff line number Diff line
@@ -4082,11 +4082,10 @@ void ivas_lfe_synth_with_filters_fx(
        }
        ELSE
        {
            Flag overFlow;
            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 = shl_ro( lfeGain_fx, lfeGain_fx_exp, &overFlow ); // Q15
            lfeGain_fx = shr_r( 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 ) )
        {
@@ -4095,11 +4094,10 @@ void ivas_lfe_synth_with_filters_fx(
        }
        ELSE
        {
            Flag overFlow;
            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 = shl_ro( transportGain_fx, transportGain_fx_exp, &overFlow ); // Q15
            transportGain_fx = shr_r( transportGain_fx, negate(transportGain_fx_exp) ); // Q15
        }
        j = 0;
        move16();