Commit c7ccca60 authored by multrus's avatar multrus
Browse files

simplified condition (taken from EVS version)

parent 913763bf
Loading
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -3593,7 +3593,9 @@ Word16 tcx_res_Q_spec_fx(
    Word16 c;
    Word32 thres;
    Word16 cmp_1, cmp_2;
#ifndef HARM_2454_TCX_RES_Q_SPEC
    Word32 tmp32_1, tmp32_2;
#endif

    /* Limit the number of residual bits */
    sqTargetBits = s_min( sqTargetBits, NPRM_RESQ );
@@ -3700,6 +3702,7 @@ Word16 tcx_res_Q_spec_fx(
            }

            thres = L_mult( c, lf_deemph_factor ); // Q31
#ifndef HARM_2454_TCX_RES_Q_SPEC
            Word16 shift_tmp = s_max( sqGain_e, x_orig_e );

            tmp1 = Mpy_32_16_1( thres, sqGain );
@@ -3707,6 +3710,11 @@ Word16 tcx_res_Q_spec_fx(
            tmp32_1 = L_shl( x_orig[i], sub( x_orig_e, shift_tmp ) );
            tmp32_2 = L_shl( tmp1, sub( sqGain_e, shift_tmp ) );
            IF( GT_32( tmp32_1, tmp32_2 ) )
#else
            tmp1 = L_shl( Mpy_32_16_1( thres, sqGain ), sub( sqGain_e, x_orig_e ) );

            IF( GT_32( x_orig[i], tmp1 ) )
#endif
            {
                prm[bits] = 1;
                move16();
@@ -3719,7 +3727,11 @@ Word16 tcx_res_Q_spec_fx(
                x_Q[i] = L_shl( thres, sub( 1, x_Q_e ) );
                move32();
            }
#ifdef HARM_2454_TCX_RES_Q_SPEC
            ELSE IF( L_add( x_orig[i], tmp1 ) < 0 )
#else
            ELSE IF( L_add( tmp32_1, tmp32_2 ) < 0 )
#endif
            {
                prm[bits] = 1;
                move16();