Commit 9d3de014 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Fix for 3GPP issue 1202: BASOP encoder ParamISM: strong timbre differences in the noise track - 2

[x] Link #1202
[x] Corrected the formula for the computation of xcorr_ene_fx which then rectifies the computation of hISMDTX->coh_fx that leads to proper value of idx being written to the bitstream on the encoder side.
parent 77886092
Loading
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -445,9 +445,9 @@ void ivas_ism_coh_estim_dtx_enc_fx(
    Word16 sce_id, i;
    Word32 acorr_ene_fx[MAX_NUM_OBJECTS], xcorr_ene_fx;
    Word16 acorr_ene_e[MAX_NUM_OBJECTS], xcorr_ene_e;
    Word16 norm_inp;
    Word16 tot_exp;
    Word32 scaled_inp;
    Word16 norm_inp, norm_inp0;
    Word16 tot_exp, tot_exp2;
    Word32 scaled_inp, scaled_inp0;
    set16_fx( acorr_ene_e, 0, MAX_NUM_OBJECTS );

    IF( EQ_16( nchan_transport, 1 ) )
@@ -493,10 +493,13 @@ void ivas_ism_coh_estim_dtx_enc_fx(
        {
            norm_inp = norm_l( st->input32_fx[i] );
            scaled_inp = L_shl( st->input32_fx[i], norm_inp );
            tot_exp = shl( sub( 20, norm_inp ), 1 );
            tot_exp = shl( sub( sub(31, st->q_inp32), norm_inp ), 1 );
            acorr_ene_fx[sce_id] = BASOP_Util_Add_Mant32Exp( acorr_ene_fx[sce_id], acorr_ene_e[sce_id], Mult_32_32( scaled_inp, scaled_inp ), tot_exp, &acorr_ene_e[sce_id] ); /* exp(acorr_ene_e) */
            move32();
            xcorr_ene_fx = BASOP_Util_Add_Mant32Exp( xcorr_ene_fx, xcorr_ene_e, Mult_32_32( scaled_inp, scaled_inp ), tot_exp, &xcorr_ene_e ); /* exp(xcorr_ene_e) */
            norm_inp0 = norm_l( st_id0->input32_fx[i] );
            scaled_inp0 = L_shl( st_id0->input32_fx[i], norm_inp0 );
            tot_exp2 = add( sub( sub( 31, st_id0->q_inp32 ), norm_inp0 ), sub( sub( 31, st->q_inp32 ), norm_inp ) );
            xcorr_ene_fx = BASOP_Util_Add_Mant32Exp( xcorr_ene_fx, xcorr_ene_e, Mult_32_32( scaled_inp, scaled_inp0 ), tot_exp2, &xcorr_ene_e ); /* exp(xcorr_ene_e) */
        }
        Word16 coh_e;
        Word16 temp_e = acorr_ene_e[hISMDTX->sce_id_dtx] + acorr_ene_e[sce_id];