Commit 28007f8a authored by vaclav's avatar vaclav
Browse files

fix

parent 4e094ae8
Loading
Loading
Loading
Loading
+15 −11
Original line number Diff line number Diff line
@@ -2639,7 +2639,7 @@ static Word16 WB_BWE_encoding_ivas_fx(
    Word16 q_WB_fenv[2];
    Word16 yos_fx_16[L_FRAME16k];
#ifdef HARM_FD_BWE
    Word16 Q_class, Q_energy, Q_fenv;
    Word16 Q_class, Q_energy, Q_fenv[2];

    IF( st_fx->element_mode == EVS_MONO )
    {
@@ -2680,7 +2680,8 @@ static Word16 WB_BWE_encoding_ivas_fx(
        Q_energy = Q_synth;
        move16();
        move16();
        Q_fenv = sub( shl( Q_synth, 1 ), 2 );
        Q_fenv[0] = Q_fenv[1] = sub( shl( Q_synth, 1 ), 2 );
        move16();
    }
    ELSE
#endif
@@ -2704,6 +2705,10 @@ static Word16 WB_BWE_encoding_ivas_fx(
            q_WB_fenv[i] = add( shl( Q_synth, 1 ), q_shift );
            move16();
            n_band = add( n_band, 2 );

#ifdef HARM_FD_BWE
            Q_fenv[i] = add( q_WB_fenv[i], 4 );
#endif
        }

        scale = s_min( L_norm_arr( yos_fx, L_FRAME16k ), sub( Q27, Q_synth ) /* To accomodate 10 in Q_synth*/ );
@@ -2711,7 +2716,6 @@ static Word16 WB_BWE_encoding_ivas_fx(
#ifdef HARM_FD_BWE
        Q_class = sub( add( Q_synth, scale ), Q16 );
        Q_energy = sub( add( Q_synth_lf, scale ), Q16 );
        Q_fenv = add( q_WB_fenv[i], 4 );
#endif
    }

@@ -2737,7 +2741,7 @@ static Word16 WB_BWE_encoding_ivas_fx(
            tmp = Log2_norm_lc( L_shl( L_tmp, exp ) );
            /* exp = 30-exp-(2*Q_synth-2 / exp = 30-exp-(q_WB_fenv[i]+4) */
#ifdef HARM_FD_BWE
            exp = sub( sub( 30, exp ), Q_fenv );
            exp = sub( sub( 30, exp ), Q_fenv[i] );
#else
            exp = sub( sub( 30, exp ), ( add( q_WB_fenv[i], 4 ) ) );
#endif