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

Merge branch '3gpp_issue_1382_fix_1' into 'main'

Fix for 3GPP issue 1382: High MLD > 20, obvious audible differences between... [allow regression]

See merge request !1287
parents 339e804c ab4cf272
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -2985,7 +2985,7 @@ Word16 ivas_acelp_tcx20_switching_fx(
    Word16 non_staX,     /* i  : unbound non-stationarity for sp/mu clas */
    Word16 *pitch_fr,    /* i  : fraction pitch values                   */
    Word16 *voicing_fr,  /* i  : fractional voicing values               */
    Word16 currFlatness, /* i  : flatness                                */
    Word32 currFlatness, /* i  : flatness                                */
    Word16 lsp_mid[M],   /* i  : LSPs at the middle of the frame         */
    Word16 stab_fac,     /* i  : LP filter stability                     */
    Word32 *res_cod_SNR_M,
@@ -3102,7 +3102,7 @@ Word16 transient_analysis_ivas_fx(

void set_transient_stereo_fx(
    CPE_ENC_HANDLE hCPE,  /* i  : CPE structure                           */
    Word16 currFlatness[] /* i/o: current flatness                       Q7*/
    Word32 currFlatness[] /* i/o: current flatness                       Q21*/
);

void ivas_smc_mode_selection_fx(
@@ -5955,7 +5955,7 @@ ivas_error pre_proc_front_ivas_fx(
    Word16 *fft_buff_fx_q,                       /* o  : FFT buffer										*/
    const Word16 tdm_A_PCh_fx[M + 1],            /* i  : unq. LP coeff. of primary channel				Q12*/
    const Word16 tdm_lsp_new_PCh_fx[M],          /* i  : unq. LSPs of primary channel					Q15*/
    const Word16 currFlatness_fx,                /* i  : flatness parameter								Q7*/
    const Word32 currFlatness_fx,                /* i  : flatness parameter								Q21*/
    const Word16 tdm_ratio_idx,                  /* i  : Current Ratio_L index							Q0*/
    Word32 fr_bands_LR_fx[][2 * NB_BANDS],       /* i  : energy in frequency bands (fr_bands_LR_fx_q)	fr_bands_LR_fx_q*/
    Word16 fr_bands_LR_fx_q[CPE_CHANNELS],
+2 −2
Original line number Diff line number Diff line
@@ -1028,8 +1028,8 @@ void init_coder_ace_plus_ivas_fx(
    {
        st->acelpFramesCount = 0;
        move16();
        st->prevTempFlatness_fx = 128 /*1.0f Q7*/;
        move16();
        st->prevTempFlatness_32fx = ONE_IN_Q21 /*1.0f Q21*/;
        move32();
    }

    /* Initialize TBE */
+1 −1
Original line number Diff line number Diff line
@@ -115,7 +115,7 @@ ivas_error pre_proc_front_ivas_fx(
    Word16 *fft_buff_fx_q,                       /* o  : FFT buffer										*/
    const Word16 tdm_A_PCh_fx[M + 1],            /* i  : unq. LP coeff. of primary channel				Q12*/
    const Word16 tdm_lsp_new_PCh_fx[M],          /* i  : unq. LSPs of primary channel					Q15*/
    const Word16 currFlatness_fx,                /* i  : flatness parameter								Q7*/
    const Word32 currFlatness_fx,                /* i  : flatness parameter								Q21*/
    const Word16 tdm_ratio_idx,                  /* i  : Current Ratio_L index							Q0*/
    Word32 fr_bands_LR_fx[][2 * NB_BANDS],       /* i  : energy in frequency bands (fr_bands_LR_fx_q)	fr_bands_LR_fx_q*/
    Word16 fr_bands_LR_fx_q[CPE_CHANNELS],
+4 −4
Original line number Diff line number Diff line
@@ -103,7 +103,7 @@ ivas_error ivas_cpe_enc_fx(
    Word16 vad_flag_dtx[CPE_CHANNELS];                         /* HE-SAD flag with additional DTX HO       */
    Word32 enerBuffer_fx[CPE_CHANNELS][CLDFB_NO_CHANNELS_MAX]; /* energy buffer                            */
    Word16 enerBuffer_fx_exp[CPE_CHANNELS];                    /* energy buffer                            */
    Word16 currFlatness_fx[CPE_CHANNELS];                      /* flatness parameter                       Q7 */
    Word32 currFlatness_fx[CPE_CHANNELS];                      /* flatness parameter                       Q21 */
    Word16 tdm_ratio_idx, tdm_ratio_idx_SM;                    /* temp. TD stereo parameters               */
    Word16 tdm_SM_or_LRTD_Pri;                                 /* temp. TD stereo parameters               */

@@ -517,7 +517,7 @@ ivas_error ivas_cpe_enc_fx(
        IF( sts[n]->hTranDet == NULL )
        {
            currFlatness_fx[n] = 0;
            move16();
            move32();
            CONTINUE;
        }

@@ -527,8 +527,8 @@ ivas_error ivas_cpe_enc_fx(
            RunTransientDetection_ivas_fx( sts[n]->input_fx, input_frame, sts[n]->hTranDet, sts[n]->q_inp ); // Note q of sts[n]->input_fx changes inside function
        }

        currFlatness_fx[n] = GetTCXAvgTemporalFlatnessMeasure_ivas_fx( (const TransientDetection *) sts[n]->hTranDet, NSUBBLOCKS, 0 ); // Q7
        move16();
        currFlatness_fx[n] = GetTCXAvgTemporalFlatnessMeasure_ivas_fx( (const TransientDetection *) sts[n]->hTranDet, NSUBBLOCKS, 0 ); // Q21
        move32();
    }

    /* Synchonize detection for downmix-based stereo */
+2 −2
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ ivas_error ivas_ism_enc_fx(
    Word16 vad_flag_dtx[MAX_NUM_OBJECTS][1];                         /* HE-SAD flag with additional DTX HO       */
    Word32 enerBuffer_fx[MAX_NUM_OBJECTS][1][CLDFB_NO_CHANNELS_MAX]; /* energy buffer                            */
    Word16 enerBuffer_fx_exp[MAX_NUM_OBJECTS][1];                    /* energy buffer                            */
    Word16 currFlatness_fx[1];                                       /* flatness parameter                       */
    Word32 currFlatness_fx[1];                                       /* flatness parameter                       */
    Word16 fft_buff_fx[MAX_NUM_OBJECTS][1][2 * L_FFT];               /* FFT buffer                               */
    Word16 fft_buff_fx_q[MAX_NUM_OBJECTS][1];                        /* FFT buffer                               */
    Word32 fr_bands_fx[1][2 * NB_BANDS];                             /* energy in frequency bands                    */
@@ -213,7 +213,7 @@ ivas_error ivas_ism_enc_fx(

        RunTransientDetection_ivas_fx( st->input_fx, input_frame, st->hTranDet, st->q_inp );

        currFlatness_fx[0] = GetTCXAvgTemporalFlatnessMeasure_ivas_fx( (const TransientDetection *) st->hTranDet, NSUBBLOCKS, 0 ); // Q7
        currFlatness_fx[0] = GetTCXAvgTemporalFlatnessMeasure_ivas_fx( (const TransientDetection *) st->hTranDet, NSUBBLOCKS, 0 ); // Q21
        move16();

        /*----------------------------------------------------------------*
Loading