Commit 8b798f82 authored by eichenseer's avatar eichenseer
Browse files

Add infinite CNG fix (issue 553 follow-up) to JBM.

parent a6c09e4c
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -166,6 +166,7 @@
/* any switch which is non-be wrt operation points tested in selection */
/* all switches in this category should start with "CR_" */

#define CR_FIX_ISM_DTX_INFINITE_CNG_ON_TRAILING_SILENCE /* FhG: fix for cng in ISM DTX on sudden silence periods - JBM addon (issue 552) */

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

+21 −0
Original line number Diff line number Diff line
@@ -149,6 +149,16 @@ ivas_error ivas_jbm_dec_tc(
            {
                return error;
            }
#ifdef CR_FIX_ISM_DTX_INFINITE_CNG_ON_TRAILING_SILENCE

            /* decode dominant object first so the noise energy of the other objects can be limited */
            if ( ( error = ivas_sce_dec( st_ivas, st_ivas->hISMDTX.sce_id_dtx, &output[st_ivas->hISMDTX.sce_id_dtx], output_frame, nb_bits_metadata[st_ivas->hISMDTX.sce_id_dtx] ) ) != IVAS_ERR_OK )
            {
                return error;
            }

            ivas_ism_dtx_limit_noise_energy_for_near_silence( st_ivas->hSCE, st_ivas->hISMDTX.sce_id_dtx, st_ivas->nchan_transport );
#endif
        }
        else if ( st_ivas->ism_mode == ISM_MODE_PARAM )
        {
@@ -169,10 +179,21 @@ ivas_error ivas_jbm_dec_tc(

        for ( n = 0; n < st_ivas->nchan_transport; n++ )
        {
#ifdef CR_FIX_ISM_DTX_INFINITE_CNG_ON_TRAILING_SILENCE
            /* for DTX frames, dominant object has already been decoded before */
            if ( !( ( ivas_total_brate == IVAS_SID_5k2 || ivas_total_brate == FRAME_NO_DATA ) && n == st_ivas->hISMDTX.sce_id_dtx ) )
            {
                if ( ( error = ivas_sce_dec( st_ivas, n, &output[n], output_frame, nb_bits_metadata[n] ) ) != IVAS_ERR_OK )
                {
                    return error;
                }
            }
#else
            if ( ( error = ivas_sce_dec( st_ivas, n, &output[n], output_frame, nb_bits_metadata[n] ) ) != IVAS_ERR_OK )
            {
                return error;
            }
#endif

            /* HP filtering */
            hp20( output[n], output_frame, st_ivas->mem_hp20_out[n], output_Fs );