Commit cc2814ac authored by Jan Kiene's avatar Jan Kiene
Browse files

port MR 1291 from float

switch order of setting the BW for MDCT-St and IGF reconfig
parent e32c5a0d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -195,6 +195,7 @@
#define FIX_940_DEBUGGING_VARIABLE                      /* Nokia: issue #940: remove debugging variable */
#define NONBE_FIX_931_IGF_STEREO_DEC_NOISE	                  /* FhG: issue #931: fix noise substitution in the stereo IGF decoder      */
#define FIX_CRASH_LONG_BRIR                /* Orange : port 1202 Fix crash when long BRIR is set */
#define NONBE_FIX_943_RECONFIG_IGF_AFTER_SETTING_BW           /* FhG: issue 943: fix crash in BW switchin from WB in MDCT-Stereo core encoder */

/* #################### End BASOP porting switches ############################ */

+25 −0
Original line number Diff line number Diff line
@@ -1029,6 +1029,7 @@ ivas_error ivas_cpe_enc_fx(
    /*----------------------------------------------------------------*
     * Core codec configuration
     *----------------------------------------------------------------*/
#ifndef NONBE_FIX_943_RECONFIG_IGF_AFTER_SETTING_BW
    /* IGF reconfiguration */
    FOR( n = 0; n < n_CoreChannels; n++ )
    {
@@ -1048,6 +1049,8 @@ ivas_error ivas_cpe_enc_fx(
            }
        }
    }
#endif

    test();
    IF( EQ_16( hCPE->element_mode, IVAS_CPE_MDCT ) && st_ivas->hMCT == NULL )
    {
@@ -1078,6 +1081,28 @@ ivas_error ivas_cpe_enc_fx(
        }
    }

#ifdef NONBE_FIX_943_RECONFIG_IGF_AFTER_SETTING_BW
    /* IGF reconfiguration */
    FOR( n = 0; n < n_CoreChannels; n++ )
    {
        test();
        test();
        test();
        test();
        test();
        test();
        IF( ( NE_32( hCPE->last_element_brate, hCPE->element_brate ) || NE_16( hCPE->element_mode, hCPE->last_element_mode ) || ( EQ_16( hCPE->element_mode, IVAS_CPE_TD ) && NE_16( sts[0]->bits_frame_nominal, last_bits_frame_nominal ) ) || NE_16( sts[n]->last_bwidth, sts[n]->bwidth ) ) && ( n == 0 || EQ_16( hCPE->element_mode, IVAS_CPE_MDCT ) ) )
        {
            Word16 igf;
            igf = getIgfPresent_fx( sts[n]->element_mode, L_mult0( sts[n]->bits_frame_nominal, FRAMES_PER_SEC ), sts[n]->max_bwidth, sts[n]->rf_mode ); /* Q0 */
            IF( ( error = IGF_Reconfig_fx( &sts[n]->hIGFEnc, igf, 0, L_mult0( sts[n]->bits_frame_nominal, FRAMES_PER_SEC ), sts[n]->max_bwidth, sts[n]->element_mode, sts[n]->rf_mode ) ) != IVAS_ERR_OK )
            {
                return error;
            }
        }
    }
#endif

    /* set ACELP@12k8 / ACELP@16k flag for flexible ACELP core */
    FOR( n = 0; n < n_CoreChannels; n++ )
    {