From a9d3f90549754fa227ee6cec55c047e0abf00919 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 16 Oct 2025 09:47:10 +0200 Subject: [PATCH] port float MR 2075 --- lib_com/options.h | 5 ----- lib_dec/FEC_HQ_phase_ecu.c | 32 +++++++++--------------------- lib_dec/ivas_jbm_dec.c | 17 +--------------- lib_dec/ivas_sba_dec.c | 4 ---- lib_dec/jbm_jb4sb.c | 7 ------- lib_dec/lib_dec.c | 5 ----- lib_rend/ivas_objectRenderer_sfx.c | 3 --- 7 files changed, 10 insertions(+), 63 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index bf949b6e2..1f85a54de 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -179,21 +179,16 @@ #define FIX_1113_EXTREND_ISAR /* FhG: issue 1113: fix external renderer asserts for FOA/HOA2 and CLDFB config */ #define FIX_1166_TDREND_DIV0 /* FhG,Eri: issue 1166: potential divide by zero in TD Renderer */ #define NONBE_1203_MDCT2DFT_SWITCHING /* VA: issue 1203: fix severe artifacts during MDCT to DFT stereo switching when MDCT ITD is not used */ -#define NONBE_1122_JBM_FIX_PLAYOUT_DELAY_IN_DTX /* FhG: Avoid JBM ignoring safety margin and setting playout delay to 0 during DTX */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ #define FIX_938_COMPILER_WARNING /* FhG: Fix compiler warning in ivas_mdct_core_reconstruct() */ #define FIX_1376_MISSING_ISM_METADATA /* FhG: IVAS_rend: throw error if there exists an ISM input without a corresponding metadata file path */ #define FIX_1385_INIT_IGF_STOP_FREQ /* FhG: Initialize infoIGFStopFreq in init_igf_dec() */ #define FIX_1387_INIT_PRM_SQQ /* FhG: initialize pointer prm_sqQ, which might be uninitialized in case of bfi == 1 */ -#define NONBE_1296_TDREND_ITD_OUT_OF_BOUNDS_ACCESS /* Eri: issue 1296: ITD resampling can occasionally read out of bounds, especially when the requested subframes are short (1.25 ms). Seen for headtracking+JBM. */ #define FIX_1349_TNS_CRASH /* FhG: Fix crash in TNS entropy coding, in case order of joint TNS coding is reduced to 0 */ -#define NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING /* Ericsson: issue 1180, corrected long term mute loop attnuation after 200ms in PhECU-PLC */ #define NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH /* VA: issue 1199: fix bug in renderer flush in OMASA JBM bitrate switching */ #define NONBE_1200_ISM_JBM_BRATE_SW_FLUSH /* VA: issue 1200: fix bug in renderer flush in ISM JBM bitrate switching */ #define NONBE_1293_CRASH_FIRST_FRAME_LOST /* VA: issue 1293: fix G.192 decoder crash when first frame is lost */ #define FIX_1384_MSAN_stereo_tcx_core_enc /* VA: issue 1384: fix use-of-uninitialized value in stereo_tcx_core_enc() */ -#define NONBE_FIX_1297_SPAR_JBM_MEM_SAN /* Dolby: issue 1297, SPAR + JBM + BR switch memory sanitizer */ -#define NONBE_1303_GRANULARITY_OSBA_REND /* VA: issue 1303: Correctly set the granularity in OSBA, Disc mode, and BINAURAL_ROOM_REVERB output */ #define NONBE_1303_REND_GRANULARITY /* VA: issue 1303: Renderer granularity revision */ // object-editing feature porting diff --git a/lib_dec/FEC_HQ_phase_ecu.c b/lib_dec/FEC_HQ_phase_ecu.c index da65786dc..4470b677c 100644 --- a/lib_dec/FEC_HQ_phase_ecu.c +++ b/lib_dec/FEC_HQ_phase_ecu.c @@ -263,13 +263,11 @@ static void trans_ana( const int16_t time_offs, /* i : Time offset */ const float est_mus_content, /* i : 0.0=speech_like ... 1.0=Music (==st->env_stab ) */ const int16_t last_fec, /* i : signal that previous frame was concealed with fec_alg*/ -#ifdef NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING - const int16_t element_mode, /* i : element_mode req to handle EVS_MONO specific BE path */ -#endif - float *alpha, /* o : Magnitude modification factors for fade to average */ - float *beta, /* o : Magnitude modification factors for fade to average */ - float *beta_mute, /* o : Factor for long-term mute */ - float Xavg[LGW_MAX] /* o : Frequency group average gain to fade to */ + const int16_t element_mode, /* i : element_mode req to handle EVS_MONO specific BE path */ + float *alpha, /* o : Magnitude modification factors for fade to average */ + float *beta, /* o : Magnitude modification factors for fade to average */ + float *beta_mute, /* o : Factor for long-term mute */ + float Xavg[LGW_MAX] /* o : Frequency group average gain to fade to */ ) { const float *w_hamm; @@ -420,7 +418,6 @@ static void trans_ana( mag_chg[k] = 0; } -#ifdef NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING if ( element_mode != EVS_MONO ) { if ( k == 0 && burst_len > BETA_MUTE_THR ) /* beta_mute final long term attenuation adjusted only once per frame in the first sub-band, Ref Eq(184) in 26.447 */ @@ -435,12 +432,7 @@ static void trans_ana( *beta_mute *= BETA_MUTE_FAC; } } -#else - if ( burst_len > BETA_MUTE_THR ) - { - *beta_mute *= BETA_MUTE_FAC; - } -#endif + alpha[k] = mag_chg[k]; beta[k] = (float) ( sqrt( 1.0f - SQR( alpha[k] ) ) * *beta_mute ); if ( k >= LGW32k - 1 ) @@ -2125,11 +2117,9 @@ static void hq_phase_ecu( *time_offs = 0; } #endif -#ifdef NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING + trans_ana( prevsynth + 2 * output_frame - Lprot - *time_offs + ph_ecu_lookahead, mag_chg, &ph_dith, mag_chg_1st, output_frame, *time_offs, env_stab, *last_fec, element_mode, alpha, beta, beta_mute, Xavg ); -#else - trans_ana( prevsynth + 2 * output_frame - Lprot - *time_offs + ph_ecu_lookahead, mag_chg, &ph_dith, mag_chg_1st, output_frame, *time_offs, env_stab, *last_fec, alpha, beta, beta_mute, Xavg ); -#endif + spec_ana( prevsynth + 2 * output_frame - Lprot - *time_offs + ph_ecu_lookahead, plocs, plocsi, num_p, X_sav, output_frame, bwidth, element_mode, &noise_fac, pcorr ); if ( prev_bfi && *last_fec ) @@ -2166,15 +2156,11 @@ static void hq_phase_ecu( #ifdef FIX_1179_USAN_PHASEECU *time_offs = (int16_t) INT16_MAX; /* high value --> continued muting will ensure that the now saturated seed is not creating tones */ #else - *time_offs = MAX16B; /* continued muting will ensure that the now fixed seeds are not creating tones */ + *time_offs = MAX16B; /* continued muting will ensure that the now fixed seeds are not creating tones */ #endif } -#ifdef NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING trans_ana( prevsynth + 2 * output_frame - Lprot, mag_chg, &ph_dith, mag_chg_1st, output_frame, *time_offs, env_stab, 0, element_mode, alpha, beta, beta_mute, Xavg ); /* 1.0 stable-music, 0.0 speech-like */ -#else - trans_ana( prevsynth + 2 * output_frame - Lprot, mag_chg, &ph_dith, mag_chg_1st, output_frame, *time_offs, env_stab, 0, alpha, beta, beta_mute, Xavg ); /* 1.0 stable-music, 0.0 speech-like */ -#endif } mvr2r( X_sav, X, Lprot ); diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index a22a18a02..b1b9365cc 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1749,15 +1749,12 @@ ivas_error ivas_jbm_dec_flush_renderer( } else if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { -#ifdef NONBE_FIX_1297_SPAR_JBM_MEM_SAN if ( ism_mode_old == ISM_SBA_MODE_DISC ) { -#endif float *tc_local[MAX_TRANSPORT_CHANNELS]; int16_t last_spar_md_idx; int16_t last_dirac_md_idx; uint16_t nSamplesAvailableNext; -#ifdef NONBE_FIX_1297_SPAR_JBM_MEM_SAN ISM_MODE ism_mode_orig; RENDERER_TYPE renderer_type_orig; int32_t ivas_total_brate; @@ -1767,27 +1764,16 @@ ivas_error ivas_jbm_dec_flush_renderer( st_ivas->ism_mode = ism_mode_old; st_ivas->renderer_type = renderer_type_old; st_ivas->hDecoderConfig->ivas_total_brate = st_ivas->hDecoderConfig->last_ivas_total_brate; -#endif last_spar_md_idx = st_ivas->hSpar->render_to_md_map[st_ivas->hSpar->slots_rendered - 1]; last_dirac_md_idx = st_ivas->hSpatParamRendCom->render_to_md_map[st_ivas->hSpatParamRendCom->slots_rendered - 1]; -#ifdef NONBE_FIX_1297_SPAR_JBM_MEM_SAN #ifdef DEBUGGING assert( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ); -#endif -#else -#ifdef DEBUGGING - assert( ism_mode_old == ISM_SBA_MODE_DISC && st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ); -#endif #endif /* copy from ISM delay buffer to the correct place in tcs */ for ( ch_idx = 0; ch_idx < st_ivas->nchan_ism; ch_idx++ ) { -#ifdef NONBE_FIX_1297_SPAR_JBM_MEM_SAN tc_local[ch_idx] = &st_ivas->hTcBuffer->tc[ch_idx][hTcBuffer->n_samples_rendered]; -#else - tc_local[ch_idx] = &st_ivas->hTcBuffer->tc[ch_idx + 2][hTcBuffer->n_samples_rendered]; -#endif mvr2r( st_ivas->hSbaIsmData->delayBuffer[ch_idx], tc_local[ch_idx], st_ivas->hSbaIsmData->delayBuffer_size ); } @@ -1812,12 +1798,11 @@ ivas_error ivas_jbm_dec_flush_renderer( { return error; } -#ifdef NONBE_FIX_1297_SPAR_JBM_MEM_SAN + st_ivas->ism_mode = ism_mode_orig; st_ivas->renderer_type = renderer_type_orig; st_ivas->hDecoderConfig->ivas_total_brate = ivas_total_brate; } -#endif } else { diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 398032da9..2f96d59a4 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -184,11 +184,7 @@ ivas_error ivas_sba_dec_reconfigure( } else { -#ifdef NONBE_1303_GRANULARITY_OSBA_REND if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) -#else - if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) -#endif { renderer_type_new = RENDERER_BINAURAL_FASTCONV; } diff --git a/lib_dec/jbm_jb4sb.c b/lib_dec/jbm_jb4sb.c index ad3ba459a..6f6844f3a 100644 --- a/lib_dec/jbm_jb4sb.c +++ b/lib_dec/jbm_jb4sb.c @@ -683,7 +683,6 @@ static void JB4_targetPlayoutDelay( *targetStartUp = ( *targetMin + *targetMax ) / 2; } -#ifdef NONBE_1122_JBM_FIX_PLAYOUT_DELAY_IN_DTX #ifdef NONBE_1122_KEEP_EVS_MODE_UNCHANGED if ( !h->evsMode ) { @@ -693,12 +692,6 @@ static void JB4_targetPlayoutDelay( } #endif *targetStartUp = JB4_MAX( *targetStartUp, (uint32_t) h->safetyMargin ); -#else - if ( *targetStartUp < 60 ) - { - *targetStartUp = 60; - } -#endif return; } diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index abba30ea6..a996a3900 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -1114,15 +1114,10 @@ ivas_error IVAS_DEC_ReadFormat( } } #else -#ifdef NONBE_FIX_1297_SPAR_JBM_MEM_SAN if ( ( renderer_type_old != st_ivas->renderer_type && renderer_type_old != RENDERER_DISABLE ) || ( st_ivas->ini_active_frame > 0 && ( ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ism_mode != ISM_MASA_MODE_DISC ) || ( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->ism_mode != ISM_SBA_MODE_DISC ) ) ) ) -#else - if ( ( renderer_type_old != st_ivas->renderer_type && renderer_type_old != RENDERER_DISABLE ) || - ( st_ivas->ini_active_frame > 0 && ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ism_mode != ISM_MASA_MODE_DISC ) ) -#endif { /* JBM: when granularity goes down (e.g. Discrete ISM with TD Obj Renderer -> ParamISM with binaural fastconv render what still fits in the new granularity */ diff --git a/lib_rend/ivas_objectRenderer_sfx.c b/lib_rend/ivas_objectRenderer_sfx.c index 713a0b790..1f774bb0f 100644 --- a/lib_rend/ivas_objectRenderer_sfx.c +++ b/lib_rend/ivas_objectRenderer_sfx.c @@ -216,9 +216,6 @@ static void sincResample( p_forward++; p_backward--; } -#ifndef NONBE_1296_TDREND_ITD_OUT_OF_BOUNDS_ACCESS - tmp += ( *p_forward ) * ( *p_sinc_forward ); /* Integer index always rounded down --> 4 steps backward, 5 steps forward */ -#endif output[i] = tmp; /* Advance fractional time */ -- GitLab