Loading lib_com/ivas_prot.h +7 −0 Original line number Diff line number Diff line Loading @@ -1205,6 +1205,13 @@ void ivas_get_ism_sid_quan_bitbudget( int16_t *nBits_sce_id /* o : number of Q bits for sce_id_dtx */ ); #ifdef CR_FIX_ISM_DTX_INFINITE_CNG_ON_TRAILING_SILENCE void ivas_ism_dtx_limit_noise_energy_for_near_silence( SCE_DEC_HANDLE hSCE[], /* i/o: SCE encoder structures */ const int16_t sce_id_dtx, /* i : SCE DTX ID */ const int16_t nchan_transport /* i : number of transport channels */ ); #endif /*----------------------------------------------------------------------------------* * DFT Stereo prototypes Loading lib_com/options.h +1 −1 Original line number Diff line number Diff line Loading @@ -234,10 +234,10 @@ /* any switch which is non-be wrt operation points tested in selection */ /* all switches in this category should start with "CR_" */ #define CR_FIX_585_MASA_2TC_DTX_EXT /* Nokia: issue 585: fixes transition artifacts in MASA 2TC DTX by applying correct condition */ #define CR_FIX_ISM_DTX_INFINITE_CNG_ON_TRAILING_SILENCE /* FhG: fix for cng in ISM DTX on sudden silence periods */ /* ##################### End NON-BE CR switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ Loading lib_dec/ivas_dec.c +21 −0 Original line number Diff line number Diff line Loading @@ -218,6 +218,16 @@ ivas_error ivas_dec( { 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 ) { Loading Loading @@ -246,10 +256,21 @@ ivas_error ivas_dec( 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 ); Loading lib_dec/ivas_ism_dtx_dec.c +49 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ *******************************************************************************************************/ #include <stdint.h> #include <math.h> #include "options.h" #include "ivas_prot.h" #include "prot.h" Loading Loading @@ -156,3 +157,51 @@ ivas_error ivas_ism_dtx_dec( return IVAS_ERR_OK; } #ifdef CR_FIX_ISM_DTX_INFINITE_CNG_ON_TRAILING_SILENCE /*-------------------------------------------------------------------* * ivs_ism_dtx_limit_noise_energy_for_near_silence() * * for DTX frames where the energy of the sent noise estimate of the dominant object * is near silence, limit the other objects CNG energies to the same level *-------------------------------------------------------------------*/ void ivas_ism_dtx_limit_noise_energy_for_near_silence( SCE_DEC_HANDLE hSCE[], /* i/o: SCE encoder structures */ const int16_t sce_id_dtx, /* i : SCE DTX ID */ const int16_t nchan_transport /* i : number of transport channels */ ) { float fac, cng_noise_nrg_obj, cng_noise_nrg_dominant; int16_t ch, cng_noise_level_len; HANDLE_FD_CNG_COM hFdCngCom; hFdCngCom = hSCE[sce_id_dtx]->hCoreCoder[0]->hFdCngDec->hFdCngCom; cng_noise_level_len = hFdCngCom->stopFFTbin - hFdCngCom->startBand; cng_noise_nrg_dominant = dotp( hFdCngCom->cngNoiseLevel, hFdCngCom->cngNoiseLevel, cng_noise_level_len ); if ( cng_noise_nrg_dominant < 1.f ) { for ( ch = 0; ch < nchan_transport; ch++ ) { if ( ch == sce_id_dtx ) { continue; } hFdCngCom = hSCE[ch]->hCoreCoder[0]->hFdCngDec->hFdCngCom; cng_noise_level_len = hFdCngCom->stopFFTbin - hFdCngCom->startBand; cng_noise_nrg_obj = dotp( hFdCngCom->cngNoiseLevel, hFdCngCom->cngNoiseLevel, cng_noise_level_len ); if ( cng_noise_nrg_obj > cng_noise_nrg_dominant ) { fac = sqrtf( cng_noise_nrg_dominant / cng_noise_nrg_obj ); v_multc( hFdCngCom->cngNoiseLevel, fac, hFdCngCom->cngNoiseLevel, cng_noise_level_len ); } } } return; } #endif lib_enc/ivas_ism_dtx_enc.c +0 −1 Original line number Diff line number Diff line Loading @@ -312,7 +312,6 @@ void ivas_ism_get_sce_id_dtx( SCE_ENC_HANDLE hSCE[MAX_SCE], /* i/o: SCE encoder structure */ const int16_t nchan_transport, /* i : number of transport channels */ const int16_t input_frame /* i : input frame length per channel */ ) { float tmp_energy[MAX_NUM_OBJECTS]; Loading Loading
lib_com/ivas_prot.h +7 −0 Original line number Diff line number Diff line Loading @@ -1205,6 +1205,13 @@ void ivas_get_ism_sid_quan_bitbudget( int16_t *nBits_sce_id /* o : number of Q bits for sce_id_dtx */ ); #ifdef CR_FIX_ISM_DTX_INFINITE_CNG_ON_TRAILING_SILENCE void ivas_ism_dtx_limit_noise_energy_for_near_silence( SCE_DEC_HANDLE hSCE[], /* i/o: SCE encoder structures */ const int16_t sce_id_dtx, /* i : SCE DTX ID */ const int16_t nchan_transport /* i : number of transport channels */ ); #endif /*----------------------------------------------------------------------------------* * DFT Stereo prototypes Loading
lib_com/options.h +1 −1 Original line number Diff line number Diff line Loading @@ -234,10 +234,10 @@ /* any switch which is non-be wrt operation points tested in selection */ /* all switches in this category should start with "CR_" */ #define CR_FIX_585_MASA_2TC_DTX_EXT /* Nokia: issue 585: fixes transition artifacts in MASA 2TC DTX by applying correct condition */ #define CR_FIX_ISM_DTX_INFINITE_CNG_ON_TRAILING_SILENCE /* FhG: fix for cng in ISM DTX on sudden silence periods */ /* ##################### End NON-BE CR switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ Loading
lib_dec/ivas_dec.c +21 −0 Original line number Diff line number Diff line Loading @@ -218,6 +218,16 @@ ivas_error ivas_dec( { 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 ) { Loading Loading @@ -246,10 +256,21 @@ ivas_error ivas_dec( 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 ); Loading
lib_dec/ivas_ism_dtx_dec.c +49 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ *******************************************************************************************************/ #include <stdint.h> #include <math.h> #include "options.h" #include "ivas_prot.h" #include "prot.h" Loading Loading @@ -156,3 +157,51 @@ ivas_error ivas_ism_dtx_dec( return IVAS_ERR_OK; } #ifdef CR_FIX_ISM_DTX_INFINITE_CNG_ON_TRAILING_SILENCE /*-------------------------------------------------------------------* * ivs_ism_dtx_limit_noise_energy_for_near_silence() * * for DTX frames where the energy of the sent noise estimate of the dominant object * is near silence, limit the other objects CNG energies to the same level *-------------------------------------------------------------------*/ void ivas_ism_dtx_limit_noise_energy_for_near_silence( SCE_DEC_HANDLE hSCE[], /* i/o: SCE encoder structures */ const int16_t sce_id_dtx, /* i : SCE DTX ID */ const int16_t nchan_transport /* i : number of transport channels */ ) { float fac, cng_noise_nrg_obj, cng_noise_nrg_dominant; int16_t ch, cng_noise_level_len; HANDLE_FD_CNG_COM hFdCngCom; hFdCngCom = hSCE[sce_id_dtx]->hCoreCoder[0]->hFdCngDec->hFdCngCom; cng_noise_level_len = hFdCngCom->stopFFTbin - hFdCngCom->startBand; cng_noise_nrg_dominant = dotp( hFdCngCom->cngNoiseLevel, hFdCngCom->cngNoiseLevel, cng_noise_level_len ); if ( cng_noise_nrg_dominant < 1.f ) { for ( ch = 0; ch < nchan_transport; ch++ ) { if ( ch == sce_id_dtx ) { continue; } hFdCngCom = hSCE[ch]->hCoreCoder[0]->hFdCngDec->hFdCngCom; cng_noise_level_len = hFdCngCom->stopFFTbin - hFdCngCom->startBand; cng_noise_nrg_obj = dotp( hFdCngCom->cngNoiseLevel, hFdCngCom->cngNoiseLevel, cng_noise_level_len ); if ( cng_noise_nrg_obj > cng_noise_nrg_dominant ) { fac = sqrtf( cng_noise_nrg_dominant / cng_noise_nrg_obj ); v_multc( hFdCngCom->cngNoiseLevel, fac, hFdCngCom->cngNoiseLevel, cng_noise_level_len ); } } } return; } #endif
lib_enc/ivas_ism_dtx_enc.c +0 −1 Original line number Diff line number Diff line Loading @@ -312,7 +312,6 @@ void ivas_ism_get_sce_id_dtx( SCE_ENC_HANDLE hSCE[MAX_SCE], /* i/o: SCE encoder structure */ const int16_t nchan_transport, /* i : number of transport channels */ const int16_t input_frame /* i : input frame length per channel */ ) { float tmp_energy[MAX_NUM_OBJECTS]; Loading