Commit c9464483 authored by vaclav's avatar vaclav
Browse files

issue 396 - alternative fix for bw changes on CNG frames in ISM DTX for...

issue 396 - alternative fix for bw changes on CNG frames in ISM DTX for objects that use the decoder-side noise estimation; under FIX_ISM_DTX_CNG_BWIDTH_ALT
parent 01f89d09
Loading
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -164,8 +164,9 @@
#define FIX_390_EXT_REND_MASA_META_COPY                 /* Nokia: Issue 390: Fixes MASA metadata copying to renderer. */
#define FIX_392_LATE_REVERB                             /* DLB : Issue 392: keep late reverb by default off when output config is not BINAURAL_ROOM*/

#define FIX_ISM_DTX_CLICKS                              /* FhG: fix for clicks in ISM DTX for inactive to active TCX transitions */
#define FIX_ISM_DTX_CNG_BWIDTH                          /* FhG: fix for bw changes on CNG frames in ISM DTX for objects that use the decoder-side noise estimation */
#define FIX_ISM_DTX_CLICKS                              /* FhG: issue 394 - fix for clicks in ISM DTX for inactive to active TCX transitions */
//#define FIX_ISM_DTX_CNG_BWIDTH                          /* FhG: issue 396 - fix for bw changes on CNG frames in ISM DTX for objects that use the decoder-side noise estimation */
#define FIX_ISM_DTX_CNG_BWIDTH_ALT                      /* VA: issue 396 - alternative fix for bw changes on CNG frames in ISM DTX for objects that use the decoder-side noise estimation */

/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
+25 −3
Original line number Diff line number Diff line
@@ -91,14 +91,25 @@ ivas_error ivas_sce_dec(
     *-----------------------------------------------------------------*/

    /* set total_brate - needed in DTX */
    if ( !st_ivas->bfi && ( ivas_total_brate == IVAS_SID_5k2 ) )
    if ( !st_ivas->bfi && ivas_total_brate == IVAS_SID_5k2 )
    {
        st->total_brate = ivas_total_brate - nb_bits_metadata * FRAMES_PER_SEC;
        assert( st->total_brate == SID_2k40 && "SCE SID must be 2.4kbps!" );

#ifdef FIX_ISM_DTX_CNG_BWIDTH_ALT
        if ( st_ivas->ivas_format == ISM_FORMAT && st->read_sid_info == 0 )
        {
            st->total_brate = FRAME_NO_DATA;
        }
#endif
    }
#ifdef FIX_ISM_DTX_CNG_BWIDTH_ALT
    else if ( !st_ivas->bfi && ivas_total_brate == FRAME_NO_DATA )
#else
    else if ( !st_ivas->bfi && ivas_total_brate <= SID_2k40 )
#endif
    {
        st->total_brate = ivas_total_brate;
        st->total_brate = FRAME_NO_DATA;
    }
#ifdef DISCRETE_ISM_DTX_CNG
    else if ( !st_ivas->bfi && st_ivas->ivas_format != ISM_FORMAT && last_ivas_total_brate <= IVAS_SID_5k2 )
@@ -181,11 +192,22 @@ ivas_error ivas_sce_dec(
    }

    /* set "total_brate" */
    if ( !st_ivas->bfi && ( ivas_total_brate == IVAS_SID_5k2 ) )
    if ( !st_ivas->bfi && ivas_total_brate == IVAS_SID_5k2 )
    {
        st->total_brate = ivas_total_brate - nb_bits_metadata * FRAMES_PER_SEC;

#ifdef FIX_ISM_DTX_CNG_BWIDTH_ALT
        if ( st_ivas->ivas_format == ISM_FORMAT && st->read_sid_info == 0 )
        {
            st->total_brate = FRAME_NO_DATA;
        }
#endif
    }
#ifdef FIX_ISM_DTX_CNG_BWIDTH_ALT
    else if ( !st_ivas->bfi && ivas_total_brate == FRAME_NO_DATA )
#else
    else if ( !st_ivas->bfi && ivas_total_brate <= SID_2k40 )
#endif
    {
        st->total_brate = ivas_total_brate;
    }