Commit ca8df168 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch '3gpp_issue_1445_fix_1' into 'main'

Fix for 3GPP issue 1445: Deviations with MCT between BASOP and float for LTV...

See merge request !1365
parents f44565a5 ce3ba295
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -372,7 +372,7 @@ void amr_wb_enc_fx(
     * WB, SWB and FB bandwidth detector
     *----------------------------------------------------------------*/

    bw_detect_fx( st, st->input_fx, NULL, NULL, NULL, MONO_FORMAT, 0 );
    bw_detect_fx( st, st->input_fx, NULL, NULL, NULL, MONO_FORMAT, 0, 0 );

    /* in AMR_WB IO, limit the maximum band-width to WB */
    if ( GT_16( st->bwidth, WB ) )
+9 −3
Original line number Diff line number Diff line
@@ -41,12 +41,12 @@
void bw_detect_fx(
    Encoder_State *st,               /* i/o: Encoder State           */
    const Word16 signal_in[],        /* i  : input signal           */
    Word16 *spectrum,                /* i  : MDCT spectrum          */
    Word16 *spectrum,                /* i  : MDCT spectrum       Q_spec   */
    const Word32 *enerBuffer,        /* i  : CLDFB Energy   Q31      */
    const Word16 *cldfbBuf_Ener_Exp, /* i  : CLDFB Energy Exponent   */
    const IVAS_FORMAT ivas_format,   /* i  : IVAS format             */
    const Word16 mct_on              /* i  : flag MCT mode           */
)
    const Word16 mct_on,             /* i  : flag MCT mode           */
    const Word16 Q_spec )
{
    Word16 Q_dct;
    Word16 i, j, k, bw_max, bin_width, n_bins;
@@ -312,6 +312,11 @@ void bw_detect_fx(

                bin_width = i_mult( bin_width, l_frame / BWD_TOTAL_WIDTH );
                Copy( spectrum, spect, l_frame );
                if ( st->element_mode != EVS_MONO )
                {
                    Q_dct = Q_spec;
                    move16();
                }
            }
            /*---------------------------------------------------------------------*
             * compute energy per spectral bins
@@ -903,6 +908,7 @@ void bw_detect_fx(

    return;
}

/*-------------------------------------------------------------------*
 * set_bw_fx()
 *
+1 −1
Original line number Diff line number Diff line
@@ -870,7 +870,7 @@ ivas_error pre_proc_front_ivas_fx(
        Word16 input_fx_tmp[480];
        Copy_Scale_sig( st->input_fx, input_fx_tmp, shr( input_frame, 1 ), negate( st->q_inp ) ); /*scaling from Q_inp_const to q0*/

        bw_detect_fx( st, input_fx_tmp, NULL, enerBuffer_fx, sf_energySum, ivas_format, 0 );
        bw_detect_fx( st, input_fx_tmp, NULL, enerBuffer_fx, sf_energySum, ivas_format, 0, 0 );
    }

    IF( EQ_16( element_mode, IVAS_CPE_DFT ) )
+5 −4
Original line number Diff line number Diff line
@@ -1283,16 +1283,17 @@ void ivas_mdct_core_whitening_enc_fx(
            FOR( n = 0; n < nSubframes; n++ )
            {
                Word16 spect_fx[L_FRAME48k];
                Word16 q_spectrum, l_frame;
                Word16 q_spectrum, lshift, l_frame;
                /*l_frame = (int16_t)(st->input_Fs / FRAMES_PER_SEC); 1 / FRAMES_PER_SEC = 0.2f */
                l_frame = extract_l( Mpy_32_32( st->input_Fs, 42949673 /* 0.2f in Q31 */ ) );
                if ( EQ_16( st->core, TCX_10_CORE ) )
                {
                    l_frame = shr( l_frame, 1 );
                }
                q_spectrum = L_norm_arr( st->hTcxEnc->spectrum_fx[n], l_frame );
                Copy_Scale_sig32_16( st->hTcxEnc->spectrum_fx[n], spect_fx, l_frame, q_spectrum );
                bw_detect_fx( st, NULL, spect_fx, NULL, NULL, MC_FORMAT /*just cannot be ISM_FORMAT*/, mct_on );
                lshift = L_norm_arr( st->hTcxEnc->spectrum_fx[n], l_frame );
                Copy_Scale_sig32_16( st->hTcxEnc->spectrum_fx[n], spect_fx, l_frame, lshift );
                q_spectrum = sub( add( sub( Q31, st->hTcxEnc->spectrum_e[n] ), lshift ), 16 );
                bw_detect_fx( st, NULL, spect_fx, NULL, NULL, MC_FORMAT /*just cannot be ISM_FORMAT*/, mct_on, q_spectrum );

                test();
                if ( EQ_16( nSubframes, NB_DIV ) && n == 0 )
+1 −1
Original line number Diff line number Diff line
@@ -298,7 +298,7 @@ void pre_proc_fx(
        move16();
    }

    bw_detect_fx( st, signal_in, NULL, enerBuffer, sf_energySum, MONO_FORMAT, 0 );
    bw_detect_fx( st, signal_in, NULL, enerBuffer, sf_energySum, MONO_FORMAT, 0, 0 );

    /*----------------------------------------------------------------*
     * Noise energy down-ward update and total noise energy estimation
Loading