Commit 3ee61d8c authored by janssonfr's avatar janssonfr
Browse files

Fix updated, alternate fix removed

parent 3d04f9e7
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1063,7 +1063,11 @@ void stereo_enc_itd_init(

void stereo_dft_enc_update(
    STEREO_DFT_ENC_DATA_HANDLE hStereoDft,                      /* i/o: encoder DFT stereo handle           */
#ifdef FIX_395_CNG_BW
    const int16_t bwidth                                        /* i  : encoded bandwidth                   */
#else
    const int16_t max_bwidth                                    /* i  : maximum encoded bandwidth           */
#endif
);

void stereo_dft_enc_destroy(
+0 −2
Original line number Diff line number Diff line
@@ -168,8 +168,6 @@

#define FIX_395_CNG_BW                                  /* Eri: Issue 395 - CNG bandwidth issue for unified stereo */

/*#define FIX_395_CNG_BW_ALT*/                          /* Eri: Issue 395 - CNG bandwidth issue for unified stereo Alternate solution */

/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
#endif
+9 −12
Original line number Diff line number Diff line
@@ -587,7 +587,11 @@ void stereo_enc_itd_init(

void stereo_dft_enc_update(
    STEREO_DFT_ENC_DATA_HANDLE hStereoDft, /* i/o: encoder stereo handle     */
#ifdef FIX_395_CNG_BW
    const int16_t bwidth                   /* i  : encoded bandwidth */
#else
    const int16_t max_bwidth               /* i  : maximum encoded bandwidth */
#endif
)
{
    int16_t i, k_offset;
@@ -633,8 +637,13 @@ void stereo_dft_enc_update(
    hStereoDft->last_res_cod_mode_modify_flag = hStereoDft->res_cod_sw_flag;
    hStereoDft->res_cod_sw_flag = 0;

#ifdef FIX_395_CNG_BW
    /* update band limits in case of rate switching */
    NFFT_inner = STEREO_DFT_N_MAX_ENC * inner_frame_tbl[bwidth] / L_FRAME48k;
#else
    /* update band limits in case of rate switching assuming max_bwidth as BWD output not yet know here */
    NFFT_inner = STEREO_DFT_N_MAX_ENC * inner_frame_tbl[max_bwidth] / L_FRAME48k;
#endif
    hStereoDft->nbands = stereo_dft_band_config( hStereoDft->band_limits, hStereoDft->hConfig->band_res, NFFT_inner, ENC );
    hStereoDft->nbands_dmx = stereo_dft_band_config( hStereoDft->band_limits_dmx, 1, NFFT_inner, ENC );

@@ -2172,18 +2181,7 @@ void stereo_dft_enc_write_BS(
    k_offset = STEREO_DFT_OFFSET;

    nbands_full = hStereoDft->nbands;
#ifdef FIX_395_CNG_BW_ALT
    if ( core_brate == SID_2k40 )
    {
        NFFT_inner = min( STEREO_DFT_N_32k_ENC,STEREO_DFT_N_MAX_ENC * inner_frame_tbl[hCPE->hCoreCoder[0]->bwidth] / L_FRAME48k );
    }
    else
    {
        NFFT_inner = STEREO_DFT_N_MAX_ENC * inner_frame_tbl[hCPE->hCoreCoder[0]->bwidth] / L_FRAME48k;
    }

    hStereoDft->nbands = stereo_dft_band_config( hStereoDft->band_limits, hStereoDft->band_res[k_offset], NFFT_inner, ENC );
#else
    NFFT_inner = STEREO_DFT_N_MAX_ENC * inner_frame_tbl[hCPE->hCoreCoder[0]->bwidth] / L_FRAME48k;

    if ( !( core_brate == SID_2k40 || core_brate == FRAME_NO_DATA ) )
@@ -2191,7 +2189,6 @@ void stereo_dft_enc_write_BS(
        /* set number of bands according to bandwidth after BWD */
        hStereoDft->nbands = stereo_dft_band_config( hStereoDft->band_limits, hStereoDft->band_res[k_offset], NFFT_inner, ENC );
    }
#endif

    if ( core_brate == FRAME_NO_DATA )
    {