Commit 41970fb6 authored by reutelhuber's avatar reutelhuber
Browse files

fix crashes for unified stereo and MASA 2TC at 24.4 kbps due to missing IGF (re-)allocation

parent 82cfd242
Loading
Loading
Loading
Loading
Loading

lib_com/options.h

100644 → 100755
+1 −0
Original line number Diff line number Diff line
@@ -179,6 +179,7 @@
#define NONBE_FIX_841_MC_RS_TDOBJ_RENDERER                    /* FhG: Issue #841: [Non-BE] Resolve "MC RS HRFT handle not set to NULL" */
#define NONBE_FIX_840_PARAMMC_RS                              /* FhG: Issue #840: Resolve "MC RS ParamMC hoa encoder wrongly set to zero" */
#define NONBE_FIX_826_JBM_MASA_CNA_CNG                        /* FhG: issue #826:  Resolve "JBM MASA: CNA and CNG not in sync with non-JBM decoding" */
#define NONBE_FIX_838_CRASH_24_4_WB                           /* FhG: Issue 838: fix encoder crashes for Unified Stereo and MASA 2 TC at 24.4 kbps WB due to missing IGF (re-) allocation */

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

lib_enc/ivas_cpe_enc.c

100644 → 100755
+14 −0
Original line number Diff line number Diff line
@@ -110,6 +110,9 @@ ivas_error ivas_cpe_enc(
    ivas_error error;
    int32_t cpe_brate;
    int32_t element_brate_ref;
#ifdef NONBE_FIX_838_CRASH_24_4_WB
    int16_t last_bits_frame_nominal;
#endif

    error = IVAS_ERR_OK;

@@ -123,6 +126,9 @@ ivas_error ivas_cpe_enc(
    input_Fs = hEncoderConfig->input_Fs;
    ivas_total_brate = hEncoderConfig->ivas_total_brate;
    element_brate_ref = hCPE->element_brate;
#ifdef NONBE_FIX_838_CRASH_24_4_WB
    last_bits_frame_nominal = sts[0]->bits_frame_nominal;
#endif

    /*------------------------------------------------------------------*
     * Initialization - general
@@ -521,7 +527,15 @@ ivas_error ivas_cpe_enc(
    /* IGF reconfiguration */
    for ( n = 0; n < n_CoreChannels; n++ )
    {
#ifdef NONBE_FIX_838_CRASH_24_4_WB
        if ( ( hCPE->last_element_brate != hCPE->element_brate
            || hCPE->element_mode != hCPE->last_element_mode
            || ( hCPE->element_mode == IVAS_CPE_TD && sts[0]->bits_frame_nominal != last_bits_frame_nominal )
            || sts[n]->last_bwidth != sts[n]->bwidth )
            && ( n == 0 || hCPE->element_mode == IVAS_CPE_MDCT ) )
#else
        if ( ( hCPE->last_element_brate != hCPE->element_brate || sts[n]->last_bwidth != sts[n]->bwidth ) && ( n == 0 || hCPE->element_mode == IVAS_CPE_MDCT ) )
#endif
        {
            int16_t igf;
            igf = getIgfPresent( sts[n]->element_mode, sts[n]->bits_frame_nominal * FRAMES_PER_SEC, sts[n]->max_bwidth, sts[n]->rf_mode );