Commit 0904f1f2 authored by fotopoulou's avatar fotopoulou
Browse files

Merge branch '2172_ref_fix-crash-with-igf-and-bw-switching-with-dtx' into 'ivas-float-update'

[Non-BE] port MR 2297 from float

See merge request !2486
parents 643ad52c c79eb941
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -192,7 +192,7 @@
#define NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS /* Nokia: issue 1339: Apply scaling to the object-part of OMASA for binaural rendering in IVAS_rend. */
#define NONBE_1362_FIX_OMASA_TO_MASA1_RENDERING         /* Nokia: Fix OMASA to MASA1 rendering in IVAS_rend */
#define FIX_1383_HEAD_TRACK_SANITIZER                   /* Nok: issue 1383: Fix head tracking struc values reading in renderer */

#define FIX_1411_IGF_CRASH_BW_SWITCHING                 /* FhG: Fix for issue 1411: fixes crash that can happen for IGF with BW switching and DTX*/

// object-editing feature porting
#define FIX_HRTF_LOAD_API                               // solves API conflicts between HRTF and object-editing features
+35 −23
Original line number Diff line number Diff line
@@ -558,6 +558,10 @@ ivas_error ivas_cpe_enc(
     * Core codec configuration
     *----------------------------------------------------------------*/

#ifdef FIX_1411_IGF_CRASH_BW_SWITCHING
    if ( !( sts[0]->core_brate == SID_2k40 || sts[0]->core_brate == FRAME_NO_DATA ) ) /* Reconfigurations not needed with DTX*/
    {
#endif
        if ( hCPE->element_mode == IVAS_CPE_MDCT && st_ivas->hMCT == NULL )
        {
            /* set coded BW for MDCT stereo */
@@ -582,7 +586,12 @@ ivas_error ivas_cpe_enc(
        /* IGF reconfiguration */
        for ( n = 0; n < n_CoreChannels; n++ )
        {
        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 ) )
            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
#ifdef FIX_1411_IGF_CRASH_BW_SWITCHING
                   || ( sts[n]->last_core_brate == SID_2k40 || sts[n]->last_core_brate == FRAME_NO_DATA )
#endif
                       ) &&
                 ( n == 0 || hCPE->element_mode == IVAS_CPE_MDCT ) )
            {
                int16_t igf;
                int16_t bw;
@@ -599,6 +608,9 @@ ivas_error ivas_cpe_enc(
                }
            }
        }
#ifdef FIX_1411_IGF_CRASH_BW_SWITCHING
    }
#endif

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