From 0c999e8bd9e909c51b282e251e1e5ca3416528ca Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 16 Apr 2024 11:44:24 +0200 Subject: [PATCH 01/12] Accept FIX_970_USAN_IN_NELP_SEED --- lib_com/nelp.c | 4 ---- lib_com/options.h | 1 - 2 files changed, 5 deletions(-) diff --git a/lib_com/nelp.c b/lib_com/nelp.c index b21740f5ca..bbe521a916 100644 --- a/lib_com/nelp.c +++ b/lib_com/nelp.c @@ -121,11 +121,7 @@ void generate_nelp_excitation( for ( j = 0; j < len; j++ ) { -#ifdef FIX_970_USAN_IN_NELP_SEED tmp[j] = ( ( *seed ) = (int16_t) ( 521 * ( *seed ) + 259 ) ) / PCM16_TO_FLT_FAC; -#else - tmp[j] = ( ( *seed ) = 521 * ( *seed ) + 259 ) / PCM16_TO_FLT_FAC; -#endif tmp1[j] = ABSVAL( tmp[j] ); I[j] = j; } diff --git a/lib_com/options.h b/lib_com/options.h index fe344ed7ab..54a2caf270 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -157,7 +157,6 @@ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ #define FIX_1038_OFFSET_TO_NULL_PTR_IN_EVS_TCX_BFI /* FhG: move setting of pointers for parameter decoding so they are skipped in lost frames when they are not needed */ -#define FIX_970_USAN_IN_NELP_SEED #define FIX_1044_ISM_REND_MEMORY /* VA: issue 1044: Lower the memory of the ISM renderer handle. */ #define FIX_1060_USAN_ARRAY_BOUNDS /* FhG: issue 1060: USAN array-bounds errors */ -- GitLab From 655bf075eeb972cab606214c0042d63349e89e29 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 16 Apr 2024 11:47:29 +0200 Subject: [PATCH 02/12] accept FIX_1038_OFFSET_TO_NULL_PTR_IN_EVS_TCX_BFI --- lib_com/options.h | 1 - lib_dec/dec_LPD.c | 8 -------- lib_dec/dec_tcx.c | 23 ++--------------------- 3 files changed, 2 insertions(+), 30 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 54a2caf270..a7575f6d6f 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -156,7 +156,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ -#define FIX_1038_OFFSET_TO_NULL_PTR_IN_EVS_TCX_BFI /* FhG: move setting of pointers for parameter decoding so they are skipped in lost frames when they are not needed */ #define FIX_1044_ISM_REND_MEMORY /* VA: issue 1044: Lower the memory of the ISM renderer handle. */ #define FIX_1060_USAN_ARRAY_BOUNDS /* FhG: issue 1060: USAN array-bounds errors */ diff --git a/lib_dec/dec_LPD.c b/lib_dec/dec_LPD.c index 331e93c3f9..a652f3724f 100644 --- a/lib_dec/dec_LPD.c +++ b/lib_dec/dec_LPD.c @@ -604,20 +604,12 @@ void decoder_LPD( for ( k = 0; k < 2; k++ ) { -#ifndef FIX_1038_OFFSET_TO_NULL_PTR_IN_EVS_TCX_BFI - /* Set pointer to parameters */ - prm = param + ( k * DEC_NPRM_DIV ); - - /* Stability Factor */ -#endif if ( !bfi ) { -#ifdef FIX_1038_OFFSET_TO_NULL_PTR_IN_EVS_TCX_BFI /* Set pointer to parameters */ prm = param + ( k * DEC_NPRM_DIV ); /* Stability Factor */ -#endif st->stab_fac = lsf_stab( &lsf[( k + 1 ) * M], &lsf[k * M], 0, st->L_frame ); } diff --git a/lib_dec/dec_tcx.c b/lib_dec/dec_tcx.c index 906baf3595..d8f4b17881 100644 --- a/lib_dec/dec_tcx.c +++ b/lib_dec/dec_tcx.c @@ -93,9 +93,7 @@ void decoder_tcx( tmp_concealment_method = 0; nf_seed = 0; fUseTns = 0; /* flag that is set if TNS data is present */ -#ifdef FIX_1038_OFFSET_TO_NULL_PTR_IN_EVS_TCX_BFI prm_sqQ = NULL; -#endif set_f( xn_buf, 0, L_MDCT_OVLP_MAX + L_FRAME_PLUS + L_MDCT_OVLP_MAX ); @@ -733,15 +731,12 @@ void decoder_tcx_invQ( TCX_CONFIG_HANDLE hTcxCfg = st->hTcxCfg; tnsSize = 0; -#ifndef FIX_1038_OFFSET_TO_NULL_PTR_IN_EVS_TCX_BFI - prm_target = NULL; /* just to suppress MSVC warnigs */ -#else + /* just to suppress MSVC warnigs */ prm_target = NULL; prm_ltp = NULL; prm_tns = NULL; prm_sqQ = NULL; -#endif /*-----------------------------------------------------------------* * Initializations @@ -761,11 +756,6 @@ void decoder_tcx_invQ( noiseFillingSize = st->hIGFDec->infoIGFStartLine; } -#ifndef FIX_1038_OFFSET_TO_NULL_PTR_IN_EVS_TCX_BFI - prm_ltp = &prm[1 + NOISE_FILL_RANGES]; - prm_tns = prm_ltp + LTPSIZE; -#endif - /*-----------------------------------------------------------* * Read TCX parameters * *-----------------------------------------------------------*/ @@ -775,10 +765,8 @@ void decoder_tcx_invQ( if ( !bfi ) { index = prm[0]; -#ifdef FIX_1038_OFFSET_TO_NULL_PTR_IN_EVS_TCX_BFI prm_ltp = &prm[1 + NOISE_FILL_RANGES]; prm_tns = prm_ltp + LTPSIZE; -#endif /* read noise level (fac_ns) */ st->hTcxDec->noise_filling_index[frame_cnt] = prm[1]; @@ -794,23 +782,16 @@ void decoder_tcx_invQ( *fUseTns = 0; } -#ifndef FIX_1038_OFFSET_TO_NULL_PTR_IN_EVS_TCX_BFI - prm_hm = prm_tns + tnsSize; - prm_sqQ = prm_hm + NPRM_CTX_HM; - *prm_sqQ1 = prm_sqQ; -#endif - /*-----------------------------------------------------------* * Spectrum data * *-----------------------------------------------------------*/ if ( !bfi ) { -#ifdef FIX_1038_OFFSET_TO_NULL_PTR_IN_EVS_TCX_BFI prm_hm = prm_tns + tnsSize; prm_sqQ = prm_hm + NPRM_CTX_HM; *prm_sqQ1 = prm_sqQ; -#endif + /*-----------------------------------------------------------* * Context HM * *-----------------------------------------------------------*/ -- GitLab From d27d48c21e9dfa17be233eeab7a0d1f47ac13d88 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 16 Apr 2024 11:48:09 +0200 Subject: [PATCH 03/12] accept FIX_1044_ISM_REND_MEMORY --- lib_com/options.h | 1 - lib_dec/ivas_stat_dec.h | 8 -------- 2 files changed, 9 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index a7575f6d6f..c0da750f27 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -156,7 +156,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ -#define FIX_1044_ISM_REND_MEMORY /* VA: issue 1044: Lower the memory of the ISM renderer handle. */ #define FIX_1060_USAN_ARRAY_BOUNDS /* FhG: issue 1060: USAN array-bounds errors */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index c2deed15fa..ac0a802257 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -804,18 +804,10 @@ typedef struct ivas_lfe_dec_data_structure typedef struct renderer_struct { -#ifdef FIX_1044_ISM_REND_MEMORY float prev_gains[MAX_NUM_OBJECTS][MAX_OUTPUT_CHANNELS]; -#else - float prev_gains[MAX_CICP_CHANNELS - 1][MAX_OUTPUT_CHANNELS]; -#endif float *interpolator; int16_t interpolator_length; -#ifdef FIX_1044_ISM_REND_MEMORY float gains[MAX_NUM_OBJECTS][MAX_OUTPUT_CHANNELS]; -#else - float gains[MAX_CICP_CHANNELS - 1][MAX_OUTPUT_CHANNELS]; -#endif } ISM_RENDERER_DATA, *ISM_RENDERER_HANDLE; -- GitLab From 617aa893ee1eb1e1558e0befa02c98962b0adcaa Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 16 Apr 2024 11:49:13 +0200 Subject: [PATCH 04/12] accept NON_BE_FIX_1041_USE_OLD_CNG_LSPS_IF_NONSTAB --- lib_com/options.h | 2 +- lib_dec/er_dec_tcx.c | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index c0da750f27..8185dd814a 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -158,13 +158,13 @@ #define FIX_1060_USAN_ARRAY_BOUNDS /* FhG: issue 1060: USAN array-bounds errors */ + /* #################### End BE switches ################################## */ /* #################### Start NON-BE switches ############################ */ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NON_BE_FIX_1041_USE_OLD_CNG_LSPS_IF_NONSTAB /* FhG: fix bug in TD MDCT-Stereo concealment */ #define NONBE_FIX_1075 /* FhG: fix segfault for bitrate switching + BINAURAL_ROOM_REVERB output in MC */ #define NON_BE_FIX_EVS_USAN_ERR_IN_WAVEADJUST /* FhG: address issue 1037 */ #define NON_BE_1055_RESET_LP_MEMORIES /* VA: issue 1055: Correctly reset LP filter MA and AR memories in bitrate switching */ diff --git a/lib_dec/er_dec_tcx.c b/lib_dec/er_dec_tcx.c index d7ece99b1d..4d658aa111 100644 --- a/lib_dec/er_dec_tcx.c +++ b/lib_dec/er_dec_tcx.c @@ -567,11 +567,7 @@ void con_tcx( alpha_inv = 1.0f - alpha_delayed; -#ifdef NON_BE_FIX_1041_USE_OLD_CNG_LSPS_IF_NONSTAB a2lsp_stab( A_local, lsp_local, st->lspold_cng ); -#else - a2lsp_stab( A_local, lsp_local, lsp_local ); -#endif for ( i = 0; i < M; i++ ) { -- GitLab From 110eef6cbfbb79a1cbb19e194ebd741505798a2c Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 16 Apr 2024 11:50:43 +0200 Subject: [PATCH 05/12] accept NONBE_FIX_1075 --- lib_com/options.h | 2 +- lib_dec/ivas_init_dec.c | 6 ++---- lib_dec/ivas_mct_dec.c | 3 +-- lib_dec/ivas_omasa_dec.c | 4 ++-- lib_dec/ivas_sba_dec.c | 3 +-- 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 8185dd814a..cec2987584 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -165,7 +165,7 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_1075 /* FhG: fix segfault for bitrate switching + BINAURAL_ROOM_REVERB output in MC */ + #define NON_BE_FIX_EVS_USAN_ERR_IN_WAVEADJUST /* FhG: address issue 1037 */ #define NON_BE_1055_RESET_LP_MEMORIES /* VA: issue 1055: Correctly reset LP filter MA and AR memories in bitrate switching */ #define NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM /* FhG: issue 1058: do not initialize EFAP when IntSetup is HOA3 */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 4fb2f78a2e..ba543f5fd5 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -2086,7 +2086,7 @@ ivas_error ivas_init_decoder( { return error; } -#ifdef NONBE_FIX_1075 + if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) @@ -2094,7 +2094,6 @@ ivas_error ivas_init_decoder( return error; } } -#endif /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ if ( ( error = ivas_omasa_separate_object_renderer_open( st_ivas ) ) != IVAS_ERR_OK ) @@ -2164,7 +2163,7 @@ ivas_error ivas_init_decoder( { return error; } -#ifdef NONBE_FIX_1075 + if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) @@ -2172,7 +2171,6 @@ ivas_error ivas_init_decoder( return error; } } -#endif } } diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index 61f00bb851..368f6e76b7 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -1251,7 +1251,7 @@ static ivas_error ivas_mc_dec_reconfig( { return error; } -#ifdef NONBE_FIX_1075 + if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) @@ -1259,7 +1259,6 @@ static ivas_error ivas_mc_dec_reconfig( return error; } } -#endif if ( st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index 5f6b7e6945..9b2e4293c6 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -384,7 +384,7 @@ ivas_error ivas_omasa_dec_config( { return error; } -#ifdef NONBE_FIX_1075 + if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) @@ -392,8 +392,8 @@ ivas_error ivas_omasa_dec_config( return error; } } -#endif } + /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ if ( ( error = ivas_omasa_separate_object_renderer_open( st_ivas ) ) != IVAS_ERR_OK ) { diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 3161d6920d..1b676b2a1b 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -503,7 +503,7 @@ ivas_error ivas_sba_dec_reconfigure( return error; } } -#ifdef NONBE_FIX_1075 + if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) @@ -511,7 +511,6 @@ ivas_error ivas_sba_dec_reconfigure( return error; } } -#endif } /* Allocate memory for OSBA delay buffer */ -- GitLab From 4673cbf62d1aa126f8b42224f9a0ba30865dc508 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 16 Apr 2024 11:51:17 +0200 Subject: [PATCH 06/12] accept NON_BE_FIX_EVS_USAN_ERR_IN_WAVEADJUST --- lib_com/options.h | 1 - lib_dec/waveadjust_fec_dec.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index cec2987584..8840a157a7 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -166,7 +166,6 @@ /* all switches in this category should start with "NONBE_" */ -#define NON_BE_FIX_EVS_USAN_ERR_IN_WAVEADJUST /* FhG: address issue 1037 */ #define NON_BE_1055_RESET_LP_MEMORIES /* VA: issue 1055: Correctly reset LP filter MA and AR memories in bitrate switching */ #define NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM /* FhG: issue 1058: do not initialize EFAP when IntSetup is HOA3 */ #define NONBE_FIX_1056_ISM_RATE_SWITCH /* FhG: Fix #1056: fix TC buffer udpate on a ISM rate switch */ diff --git a/lib_dec/waveadjust_fec_dec.c b/lib_dec/waveadjust_fec_dec.c index d5cf31cef8..6d979c8fab 100644 --- a/lib_dec/waveadjust_fec_dec.c +++ b/lib_dec/waveadjust_fec_dec.c @@ -742,13 +742,9 @@ void concealment_decode( /* sign randomization */ for ( i = 0; i < hPlcInfo->L_frameTCX; i++ ) { -#ifdef NON_BE_FIX_EVS_USAN_ERR_IN_WAVEADJUST int16_t rnd; rnd = own_random( seed ); sign = ( rnd >= 0 ) - ( rnd < 0 ); -#else - sign = ( ( own_random( seed ) >> 15 ) << 1 ) + 1; -#endif invkoef[i] *= sign; } } -- GitLab From 6d7ee4234c4b75909bb85f015c20b5c0f1dd8052 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 16 Apr 2024 11:52:05 +0200 Subject: [PATCH 07/12] accept NON_BE_1055_RESET_LP_MEMORIES --- lib_com/options.h | 1 - lib_dec/updt_dec.c | 4 ---- lib_enc/core_enc_updt.c | 4 ---- 3 files changed, 9 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 8840a157a7..e65b4a6c18 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -166,7 +166,6 @@ /* all switches in this category should start with "NONBE_" */ -#define NON_BE_1055_RESET_LP_MEMORIES /* VA: issue 1055: Correctly reset LP filter MA and AR memories in bitrate switching */ #define NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM /* FhG: issue 1058: do not initialize EFAP when IntSetup is HOA3 */ #define NONBE_FIX_1056_ISM_RATE_SWITCH /* FhG: Fix #1056: fix TC buffer udpate on a ISM rate switch */ #define NON_BE_FIX_1048_THRESHOLD_COH_BASOP /* Nokia: Fix 1048 replace comparison with 0 with comparison to threshold, to align with BASOP*/ diff --git a/lib_dec/updt_dec.c b/lib_dec/updt_dec.c index 17f19e1125..391e609b35 100644 --- a/lib_dec/updt_dec.c +++ b/lib_dec/updt_dec.c @@ -521,11 +521,7 @@ void updt_dec_common( st->stab_fac_smooth_lt = ENV_SMOOTH_FAC * st->stab_fac + ( 1.0f - ENV_SMOOTH_FAC ) * st->stab_fac_smooth_lt; } -#ifdef NON_BE_1055_RESET_LP_MEMORIES if ( ( st->core_brate <= SID_2k40 && st->cng_type == FD_CNG ) || ( st->tcxonly && ( st->codec_mode == MODE2 || st->element_mode > EVS_MONO ) ) ) -#else - if ( ( st->core_brate <= SID_2k40 && st->cng_type == FD_CNG ) || ( st->tcxonly && st->codec_mode == MODE2 ) ) -#endif { /* reset LP memories */ set_zero( st->mem_MA, M ); diff --git a/lib_enc/core_enc_updt.c b/lib_enc/core_enc_updt.c index a04f22fc59..32903f55ba 100644 --- a/lib_enc/core_enc_updt.c +++ b/lib_enc/core_enc_updt.c @@ -92,11 +92,7 @@ void core_encode_update( } } -#ifdef NON_BE_1055_RESET_LP_MEMORIES if ( ( st->Opt_DTX_ON && st->core_brate <= SID_2k40 && st->cng_type == FD_CNG ) || ( st->tcxonly && ( st->codec_mode == MODE2 || st->element_mode > EVS_MONO ) ) ) -#else - if ( ( st->Opt_DTX_ON && st->core_brate <= SID_2k40 && st->cng_type == FD_CNG ) || ( st->tcxonly && st->codec_mode == MODE2 ) ) -#endif { /* reset LP memories */ set_zero( st->mem_MA, M ); -- GitLab From 521996d611703fbeac15830c0aaccf3a36104480 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 16 Apr 2024 11:53:02 +0200 Subject: [PATCH 08/12] accept NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM --- lib_com/options.h | 2 -- lib_dec/ivas_binRenderer_internal.c | 11 +---------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index e65b4a6c18..a942b1cbfc 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -165,8 +165,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ - -#define NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM /* FhG: issue 1058: do not initialize EFAP when IntSetup is HOA3 */ #define NONBE_FIX_1056_ISM_RATE_SWITCH /* FhG: Fix #1056: fix TC buffer udpate on a ISM rate switch */ #define NON_BE_FIX_1048_THRESHOLD_COH_BASOP /* Nokia: Fix 1048 replace comparison with 0 with comparison to threshold, to align with BASOP*/ #define NONBE_FIX_1054_NEGATIVE_LVQ_INDEX /* Nokia: issue 1054: Input to decode_comb in deindex_lvq_SHB should be positive */ diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 59c15f6a04..0b005615dd 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -1261,9 +1261,7 @@ ivas_error ivas_binRenderer_open( } /* initialize the dmx matrix */ -#ifdef NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM if ( hBinRenderer->nInChannels != HOA3_CHANNELS ) -#endif { for ( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ ) { @@ -1280,17 +1278,10 @@ ivas_error ivas_binRenderer_open( } hBinRenderer->hEFAPdata = NULL; -#ifdef NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM + if ( hBinRenderer->hReverb != NULL && hBinRenderer->nInChannels != HOA3_CHANNELS ) -#else - if ( hBinRenderer->hReverb != NULL ) -#endif { -#ifdef NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM if ( hBinRenderer->hInputSetup->is_loudspeaker_setup == 0 ) -#else - if ( hBinRenderer->hInputSetup->is_loudspeaker_setup == 0 && hBinRenderer->nInChannels != HOA3_CHANNELS ) -#endif { for ( k = 0; k < 11; k++ ) { -- GitLab From 0ee92f6b2cc44358535d290c62a5fddc44412dbe Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 16 Apr 2024 11:53:54 +0200 Subject: [PATCH 09/12] accept NONBE_FIX_1056_ISM_RATE_SWITCH --- lib_com/options.h | 1 - lib_dec/ivas_ism_dec.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index a942b1cbfc..21fbdfd26f 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -165,7 +165,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_1056_ISM_RATE_SWITCH /* FhG: Fix #1056: fix TC buffer udpate on a ISM rate switch */ #define NON_BE_FIX_1048_THRESHOLD_COH_BASOP /* Nokia: Fix 1048 replace comparison with 0 with comparison to threshold, to align with BASOP*/ #define NONBE_FIX_1054_NEGATIVE_LVQ_INDEX /* Nokia: issue 1054: Input to decode_comb in deindex_lvq_SHB should be positive */ #define NONBE_FIX_1063_DIV_BY_ZERO_SUMNRG /* VoiceAge: issue 1063: division by zero for angle_rot feature in the UNCLR classifier */ diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index 92fe91e151..ef13d2463d 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -130,12 +130,8 @@ static ivas_error ivas_ism_bitrate_switching_dec( { /* transfer subframe info from DirAC or ParamMC to central tc buffer */ -#ifdef NONBE_FIX_1056_ISM_RATE_SWITCH /* only do this if we are not having done everything already in the TC decoding part and having only played out from the TC buffer */ if ( last_ism_mode == ISM_MODE_PARAM && st_ivas->hSpatParamRendCom != NULL && st_ivas->hTcBuffer->tc_buffer_mode != TC_BUFFER_MODE_BUFFER ) -#else - if ( last_ism_mode == ISM_MODE_PARAM && st_ivas->hSpatParamRendCom != NULL && ( st_ivas->renderer_type != RENDERER_MONO_DOWNMIX && st_ivas->renderer_type != RENDERER_DISABLE ) ) -#endif { st_ivas->hTcBuffer->nb_subframes = st_ivas->hSpatParamRendCom->nb_subframes; st_ivas->hTcBuffer->subframes_rendered = st_ivas->hSpatParamRendCom->subframes_rendered; -- GitLab From e2de8b588568590985a96f9fe147d821680d4cf1 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 16 Apr 2024 11:55:04 +0200 Subject: [PATCH 10/12] accept NON_BE_FIX_1048_THRESHOLD_COH_BASOP --- lib_com/ivas_cnst.h | 2 -- lib_com/options.h | 1 - lib_dec/ivas_qmetadata_dec.c | 6 ++---- lib_enc/ivas_qmetadata_enc.c | 7 +++---- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index dd01994e4c..8ebe56c185 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1197,10 +1197,8 @@ enum #define MASA_RATIO_TOLERANCE 0.1f #define MASA_RATIO_THRESHOLD 0.015f #define MASA_ANGLE_TOLERANCE 0.5f -#ifdef NON_BE_FIX_1048_THRESHOLD_COH_BASOP #define MASA_SUR_COH_THRESHOLD 1e-7f #define MASA_SUR_COH_PRECISION 1e7f -#endif #define MASA_LIMIT_NO_BANDS_SUR_COH 8 #define MINIMUM_BIT_BUDGET_NORMAL_META 100 #define DIFF_DFRATIO_2BIT_LIMIT_IDX_HODIRAC 4 diff --git a/lib_com/options.h b/lib_com/options.h index 21fbdfd26f..90b2d38016 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -165,7 +165,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NON_BE_FIX_1048_THRESHOLD_COH_BASOP /* Nokia: Fix 1048 replace comparison with 0 with comparison to threshold, to align with BASOP*/ #define NONBE_FIX_1054_NEGATIVE_LVQ_INDEX /* Nokia: issue 1054: Input to decode_comb in deindex_lvq_SHB should be positive */ #define NONBE_FIX_1063_DIV_BY_ZERO_SUMNRG /* VoiceAge: issue 1063: division by zero for angle_rot feature in the UNCLR classifier */ #define NONBE_FIX_1045_ISM_BITRATE_SWITCHING /* Eri: Difference between ROM/File HRTF in ISM bitrate switching */ diff --git a/lib_dec/ivas_qmetadata_dec.c b/lib_dec/ivas_qmetadata_dec.c index e28615dd45..bc895de45c 100644 --- a/lib_dec/ivas_qmetadata_dec.c +++ b/lib_dec/ivas_qmetadata_dec.c @@ -4070,9 +4070,7 @@ static int16_t read_surround_coherence_hr( IVAS_QDIRECTION *q_direction; int16_t min_index; int16_t d, idx; -#ifdef NON_BE_FIX_1048_THRESHOLD_COH_BASOP int32_t int_error_ratio_surr; -#endif coding_subbands = hQMetaData->q_direction[0].cfg.nbands; q_direction = hQMetaData->q_direction; @@ -4096,10 +4094,10 @@ static int16_t read_surround_coherence_hr( { error_ratio_surr = 1.0f - q_direction[0].band_data[j].energy_ratio[sf]; } -#ifdef NON_BE_FIX_1048_THRESHOLD_COH_BASOP + int_error_ratio_surr = (int32_t) ( MASA_SUR_COH_PRECISION * error_ratio_surr ); error_ratio_surr = (float) ( int_error_ratio_surr * MASA_SUR_COH_THRESHOLD ); -#endif + if ( error_ratio_surr <= 0 ) { error_ratio_surr = 0; diff --git a/lib_enc/ivas_qmetadata_enc.c b/lib_enc/ivas_qmetadata_enc.c index 9b8b2b7223..a875f14771 100644 --- a/lib_enc/ivas_qmetadata_enc.c +++ b/lib_enc/ivas_qmetadata_enc.c @@ -4926,9 +4926,8 @@ static int16_t encode_surround_coherence_hr( int16_t max_val = 0, nbits_max; int16_t no_cv_shift[MASA_MAXIMUM_CODING_SUBBANDS], min_idx; int16_t idx16; -#ifdef NON_BE_FIX_1048_THRESHOLD_COH_BASOP int32_t int_error_ratio_surr; -#endif + coding_subbands = hQMetaData->q_direction[0].cfg.nbands; all_coherence_zero = hQMetaData->all_coherence_zero; q_direction = &( hQMetaData->q_direction[0] ); @@ -4957,10 +4956,10 @@ static int16_t encode_surround_coherence_hr( { error_ratio_surr = 1.0f - q_direction[0].band_data[j].energy_ratio[sf]; } -#ifdef NON_BE_FIX_1048_THRESHOLD_COH_BASOP + int_error_ratio_surr = (int32_t) ( MASA_SUR_COH_PRECISION * error_ratio_surr ); error_ratio_surr = (float) ( int_error_ratio_surr * MASA_SUR_COH_THRESHOLD ); -#endif + if ( error_ratio_surr <= 0 ) { error_ratio_surr = 0; -- GitLab From 41d6eabbfaf14b8769c5abdb081f00ec095c6fc2 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 16 Apr 2024 11:55:40 +0200 Subject: [PATCH 11/12] accept NONBE_FIX_1054_NEGATIVE_LVQ_INDEX --- lib_com/mslvq_com.c | 4 ---- lib_com/options.h | 1 - 2 files changed, 5 deletions(-) diff --git a/lib_com/mslvq_com.c b/lib_com/mslvq_com.c index 282741fb0f..e6c01dcfeb 100644 --- a/lib_com/mslvq_com.c +++ b/lib_com/mslvq_com.c @@ -828,11 +828,7 @@ void deindex_lvq_SHB( /* find idx_leader */ i = 1; -#ifdef NONBE_FIX_1054_NEGATIVE_LVQ_INDEX while ( index > table_no_cv[i] ) -#else - while ( index >= table_no_cv[i] ) -#endif { i++; } diff --git a/lib_com/options.h b/lib_com/options.h index 90b2d38016..1960dc07f6 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -165,7 +165,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_1054_NEGATIVE_LVQ_INDEX /* Nokia: issue 1054: Input to decode_comb in deindex_lvq_SHB should be positive */ #define NONBE_FIX_1063_DIV_BY_ZERO_SUMNRG /* VoiceAge: issue 1063: division by zero for angle_rot feature in the UNCLR classifier */ #define NONBE_FIX_1045_ISM_BITRATE_SWITCHING /* Eri: Difference between ROM/File HRTF in ISM bitrate switching */ -- GitLab From a9afe5d48debb6bc670794cf7cfa216aa5989e50 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 16 Apr 2024 11:56:43 +0200 Subject: [PATCH 12/12] accept NONBE_FIX_1063_DIV_BY_ZERO_SUMNRG --- lib_com/options.h | 1 - lib_enc/ivas_stereo_dft_enc_itd.c | 9 --------- 2 files changed, 10 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 1960dc07f6..a390324e60 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -165,7 +165,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_1063_DIV_BY_ZERO_SUMNRG /* VoiceAge: issue 1063: division by zero for angle_rot feature in the UNCLR classifier */ #define NONBE_FIX_1045_ISM_BITRATE_SWITCHING /* Eri: Difference between ROM/File HRTF in ISM bitrate switching */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_enc/ivas_stereo_dft_enc_itd.c b/lib_enc/ivas_stereo_dft_enc_itd.c index 166db84c66..b54fd07a1a 100755 --- a/lib_enc/ivas_stereo_dft_enc_itd.c +++ b/lib_enc/ivas_stereo_dft_enc_itd.c @@ -641,9 +641,7 @@ void stereo_dft_enc_compute_itd( const float *dft_trigo32k; float trigo_enc[STEREO_DFT_N_32k_ENC / 2 + 1]; float cng_xcorr_filt; -#ifdef NONBE_FIX_1063_DIV_BY_ZERO_SUMNRG float sum_nrg_delta; -#endif int16_t prev_itd_max; int16_t itd_max_flip; @@ -729,9 +727,6 @@ void stereo_dft_enc_compute_itd( grand_dot_prod_img += xcorr[2 * i + 1]; xcorr_abs[i] = sqrtf( xcorr[2 * i] * xcorr[2 * i] + xcorr[2 * i + 1] * xcorr[2 * i + 1] ); -#ifndef NONBE_FIX_1063_DIV_BY_ZERO_SUMNRG - /* VM: prod_LL tends to overflow, better to replace with sum(log(prod_L)) and retrain the classifier */ -#endif prod_LL = prod_L; prod_RR = prod_R; @@ -788,7 +783,6 @@ void stereo_dft_enc_compute_itd( hStereoClassif->unclr_fv[E_gainIPD] = g_IPD; hStereoClassif->xtalk_fv[E_gainIPD] = g_IPD; -#ifdef NONBE_FIX_1063_DIV_BY_ZERO_SUMNRG if ( sum_nrg_L >= sum_nrg_R ) { sum_nrg_delta = max( sum_nrg_L - sum_nrg_R, 1.0f ); @@ -798,9 +792,6 @@ void stereo_dft_enc_compute_itd( sum_nrg_delta = min( sum_nrg_L - sum_nrg_R, -1.0f ); } angle_rot = fabsf( atanf( 2.0f * ( grand_dot_prod_real ) / sum_nrg_delta ) ); -#else - angle_rot = fabsf( atanf( 2.0f * ( grand_dot_prod_real ) / ( sum_nrg_L - sum_nrg_R + 1.0f ) ) ); -#endif hStereoClassif->unclr_fv[E_angle_rot] = angle_rot; hStereoClassif->xtalk_fv[E_angle_rot] = angle_rot; -- GitLab