Commit d946ca6d authored by norvell's avatar norvell
Browse files

Merge branch...

Merge branch 'float_1461-assert-in-dft-stereo-gain-encoder-with-10-db-input-and-debugging-enabled' into 'main'

[Non-BE] Add FIX_1461_CNG_BW_SWITCHING to address BW switching in Stereo CNG - BASOP

See merge request !2629
parents 24e8bdab ff199b0f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -97,6 +97,7 @@
#define FIX_2015_PREMPH_SAT_ALT_PART2                   /* VA: Add missing scaling factor to be passed to AVQ_cod() */
#define FIX_2253_CORRECT_GSC_MINIMUM_PIT_SEARCH         /* VA: Fix Issue 2253 where the encoder and decoder could get out of sync */
#define NONBE_FIX_1967_SBA_DECODER_MONO_OUT_BIG_DIFFERENCES /* Dolby: Fix basop issue 1967 */
#define FIX_1461_CNG_BW_SWITCHING                       /* Eri: float issue 1461: Stereo parameters are not updated when SID/NODATA forces BW to stay the same */

/* ##################### End NON-BE switches ########################### */

+9 −0
Original line number Diff line number Diff line
@@ -130,6 +130,9 @@ ivas_error ivas_cpe_enc_fx(
    Word16 old_wsp_fx[CPE_CHANNELS][L_WSP];
    Word16 e_old_wsp[CPE_CHANNELS], q_old_wsp;
    Word16 Q_new[CPE_CHANNELS] = { 0 };
#ifdef FIX_1461_CNG_BW_SWITCHING
    Word16 NFFT_inner;
#endif
    move16();
    move16();
    Word16 q_com, shift, q_min, gb;
@@ -1124,6 +1127,12 @@ ivas_error ivas_cpe_enc_fx(
            IF( EQ_32( sts[0]->core_brate, SID_2k40 ) || sts[0]->core_brate == FRAME_NO_DATA )
            {
                /* Reconfigure DFT Stereo for inactive frames */
#ifdef FIX_1461_CNG_BW_SWITCHING
                /* -- nbands may need to be updated here in case the bandwidth was changed due to inactive frames */
                NFFT_inner = shl( inner_frame_tbl[sts[0]->bwidth], 1 );
                hCPE->hStereoDft->nbands = stereo_dft_band_config_fx( hCPE->hStereoDft->band_limits, hCPE->hStereoDft->hConfig->band_res, NFFT_inner, ENC );
                move16();
#endif
                IF( EQ_32( sts[0]->core_brate, SID_2k40 ) )
                {
                    stereo_dft_config_fx( hConfigDft, IVAS_SID_5k2, &sts[0]->bits_frame_nominal, &sts[1]->bits_frame_nominal );
+11 −0
Original line number Diff line number Diff line
@@ -3853,6 +3853,17 @@ static void stereo_dft_enc_compute_prm_fx(
    hStereoDft->nrg_past_pos = ( pos + 1 ) % STEREO_DFT_NRG_PAST_LEN;
    move16();

#ifdef FIX_1461_CNG_BW_SWITCHING
    /* Replicate last band for remaining bands in case the bandwidth is higher after SID/NODATA is considered */
    FOR( i = hStereoDft->nbands; i < STEREO_DFT_BAND_MAX; i++ )
    {
        pPredGain[i] = pPredGain[i - 1];
        move32();
        pSideGain[i] = pSideGain[i - 1];
        move32();
    }
#endif


    /*------------------------------------------------------------------*
     * Compute IPDs