From 3ebda6e78e814121f1e8e604824250bf66efb014 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 18 Mar 2026 13:54:54 +0100 Subject: [PATCH] acceptance of switches --- apps/decoder.c | 11 ----- lib_com/options.h | 6 +-- lib_enc/core_enc_2div.c | 2 - lib_rend/ivas_objectRenderer.c | 28 +++--------- lib_rend/ivas_prot_rend.h | 9 +--- lib_rend/ivas_stat_rend.h | 2 - lib_rend/lib_rend.c | 78 ++++------------------------------ 7 files changed, 17 insertions(+), 119 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 2772b39b4..e36297286 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -3371,10 +3371,8 @@ static ivas_error decodeVoIP( *phIvasDec = hIvasDec; /* Update for main()' s free */ ivasRtp.restartNeeded = false; -#ifdef FIX_1525_UNINIT_FORMAT_SWITCHING_DEC bitstreamReadDone = false; parametersAvailableForEditing = false; -#endif } /* reference vector */ @@ -3623,10 +3621,8 @@ static ivas_error decodeVoIP( goto cleanup; } *phIvasDec = hIvasDec; /* Update for main()' s free */ -#ifdef FIX_1525_UNINIT_FORMAT_SWITCHING_DEC bitstreamReadDone = false; parametersAvailableForEditing = false; -#endif } /* Placeholder for memory reallocation */ @@ -4385,13 +4381,6 @@ static ivas_error restartDecoder( } } -#ifndef FIX_1525_UNINIT_FORMAT_SWITCHING_DEC - if ( ( error = IVAS_DEC_PrintConfig( hIvasDec, 1, arg->voipMode ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nIVAS_DEC_PrintConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); - goto cleanup; - } -#endif /* ISAR frame size is set from command line, not renderer config file. * This will be ignored if output format is not split rendering. */ if ( renderConfig != NULL ) diff --git a/lib_com/options.h b/lib_com/options.h index 1182802d8..ed3aa3cdb 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,15 +161,13 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */ #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_FLOAT_1536_INIT_NO_PARAM_LPC /* FhG: make sure no_param_lpc is initialized in core_encode_twodiv() */ -#define FIX_1525_UNINIT_FORMAT_SWITCHING_DEC /* VA: float issue 1525: fix reading of uninitialized memory in format switching at the decoder */ + /* #################### End BE switches ################################## */ /* #################### Start NON-BE switches ############################ */ /* any switch which is non-be wrt. TS 26.258 V3.0 */ -#define FIX_BASOP_2436_REUSED_CLDFB_IN_OMASA_SR /* FhG: basop issue 2436 (related to basop 2283): fix garbage output for >1 object OMASA with extrend as ISAR prerenderer */ -#define FIX_FLOAT_1528_5MS_REND_ISM_META_DELAY_COMPENSATION /* Nokia: float issue 1528: Fixes incorrect compensation for ISM metadata delay in 5ms TD rendering */ + /* ##################### End NON-BE switches ########################### */ diff --git a/lib_enc/core_enc_2div.c b/lib_enc/core_enc_2div.c index 08f90e05e..22ac03277 100644 --- a/lib_enc/core_enc_2div.c +++ b/lib_enc/core_enc_2div.c @@ -83,9 +83,7 @@ void core_encode_twodiv( set_s( tnsSize, 0, 2 ); set_s( tnsBits, 0, 2 ); ltpBits = 0; -#ifdef FIX_FLOAT_1536_INIT_NO_PARAM_LPC no_param_lpc = 0; -#endif for ( i = 0; i < 3; i++ ) { diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 7353b2ce6..fea2357c7 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -313,15 +313,12 @@ ivas_error ivas_td_binaural_renderer_unwrap( const int16_t lfe_idx, /* i : LFE channel index */ const IVAS_FORMAT ivas_format, /* i : IVAS format */ ISM_METADATA_HANDLE *hIsmMetaData, /* i : ISM metadata handle */ - COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i/o: combined orientaton data handle */ + COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i/o: combined orientaton data handle */ const int16_t ism_md_subframe_update, /* i : Number of subframes to delay ism metadata to sync with audio */ float *output[], /* i/o: SCE channels / Binaural synthesis */ const int16_t output_frame, /* i : output frame length */ - const int16_t num_subframes /* i : number of subframes to render */ -#ifdef FIX_FLOAT_1528_5MS_REND_ISM_META_DELAY_COMPENSATION - , - int16_t *metaSfCounter /* i/o: subframe counter for metadata update */ -#endif + const int16_t num_subframes, /* i : number of subframes to render */ + int16_t *metaSfCounter /* i/o: subframe counter for metadata update */ ) { int16_t subframe_length; @@ -365,11 +362,7 @@ ivas_error ivas_td_binaural_renderer_unwrap( for ( subframe_idx = 0; subframe_idx < num_subframes; subframe_idx++ ) { -#ifdef FIX_FLOAT_1528_5MS_REND_ISM_META_DELAY_COMPENSATION if ( *metaSfCounter == ism_md_subframe_update ) -#else - if ( subframe_idx == ism_md_subframe_update ) -#endif { /* Update object position(s) */ if ( ( error = TDREND_Update_object_positions( hBinRendererTd, num_src, ivas_format, hIsmMetaData ) ) != IVAS_ERR_OK ) @@ -378,10 +371,8 @@ ivas_error ivas_td_binaural_renderer_unwrap( } } -#ifdef FIX_FLOAT_1528_5MS_REND_ISM_META_DELAY_COMPENSATION *metaSfCounter = ( *metaSfCounter + 1 ) % 4; -#endif /* Update the listener's location/orientation */ if ( ( error = TDREND_Update_listener_orientation( hBinRendererTd, ( enableCombinedOrientation != NULL ) ? enableCombinedOrientation[hCombinedOrientationData->subframe_idx] : 0, ( Quaternions != NULL ) ? &Quaternions[hCombinedOrientationData->subframe_idx] : NULL, ( Pos != NULL ) ? &Pos[hCombinedOrientationData->subframe_idx] : NULL ) ) != IVAS_ERR_OK ) { @@ -734,18 +725,14 @@ ivas_error ivas_td_binaural_open_ext( *---------------------------------------------------------------------*/ ivas_error ivas_td_binaural_renderer_ext( -#ifdef FIX_FLOAT_1528_5MS_REND_ISM_META_DELAY_COMPENSATION - TDREND_WRAPPER *pTDRend, /* i/o: TD Renderer wrapper structure */ -#else - const TDREND_WRAPPER *pTDRend, /* i : TD Renderer wrapper structure */ -#endif + TDREND_WRAPPER *pTDRend, /* i/o: TD Renderer wrapper structure */ const AUDIO_CONFIG inConfig, /* i : Input audio configuration */ const LSSETUP_CUSTOM_HANDLE customLsInput, /* i : Input custom loudspeaker layout */ const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData, /* i : Combined head and external orientations */ const IVAS_ISM_METADATA *currentPos, /* i : Object position */ const REVERB_HANDLE hReverb, /* i : Reverberator handle */ const int16_t ism_md_subframe_update_ext, /* i : Metadata Delay in subframes to sync with audio delay */ - const int32_t output_Fs, /* i : output sampling rate */ + const int32_t output_Fs, /* i : output sampling rate */ const int16_t output_frame, /* i : output frame length */ float output[][L_FRAME48k] /* i/o: SCE channels / Binaural synthesis */ ) @@ -806,13 +793,8 @@ ivas_error ivas_td_binaural_renderer_ext( hIsmMetaData[0]->non_diegetic_flag = currentPos->non_diegetic_flag; } -#ifdef FIX_FLOAT_1528_5MS_REND_ISM_META_DELAY_COMPENSATION if ( ( error = ivas_td_binaural_renderer_unwrap( hReverb, transport_config, pTDRend->hBinRendererTd, num_src, lfe_idx, ivas_format, hIsmMetaData, *hCombinedOrientationData, ism_md_subframe_update_ext, p_output, output_frame, (int16_t) ( ( output_frame * FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES ) / output_Fs ), &( pTDRend->metaSfCounter ) ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_td_binaural_renderer_unwrap( hReverb, transport_config, pTDRend->hBinRendererTd, num_src, lfe_idx, ivas_format, hIsmMetaData, *hCombinedOrientationData, - ism_md_subframe_update_ext, p_output, output_frame, (int16_t) ( ( output_frame * FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES ) / output_Fs ) ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index d33b372b9..a4241eb37 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -640,19 +640,12 @@ ivas_error ivas_td_binaural_renderer_unwrap( const int16_t ism_md_subframe_update, float *output[], /* i/o: SCE channels / Binaural synthesis */ const int16_t output_frame, /* i : output frame length */ - const int16_t num_subframes /* i : number of subframes to render */ -#ifdef FIX_FLOAT_1528_5MS_REND_ISM_META_DELAY_COMPENSATION - , + const int16_t num_subframes, /* i : number of subframes to render */ int16_t *metaSfCounter /* i/o: subframe counter for metadata update */ -#endif ); ivas_error ivas_td_binaural_renderer_ext( -#ifdef FIX_FLOAT_1528_5MS_REND_ISM_META_DELAY_COMPENSATION TDREND_WRAPPER *pTDRend, /* i/o: TD Renderer wrapper structure */ -#else - const TDREND_WRAPPER *pTDRend, /* i : TD Renderer wrapper structure */ -#endif const AUDIO_CONFIG inConfig, /* i : Input audio configuration */ const LSSETUP_CUSTOM_HANDLE customLsInput, /* i : Input custom loudspeaker layout */ const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData,/* i : Combined head and external orientations */ diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 815355d02..58bbff890 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -1141,9 +1141,7 @@ typedef struct int32_t binaural_latency_ns; BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd; TDREND_HRFILT_FiltSet_t **hHrtfTD; -#ifdef FIX_FLOAT_1528_5MS_REND_ISM_META_DELAY_COMPENSATION int16_t metaSfCounter; -#endif } TDREND_WRAPPER, *TDREND_WRAPPER_HANDLE; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index c668babb5..df8aaaf93 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -455,7 +455,6 @@ static void accumulate2dArrayToBuffer( } -#ifdef FIX_BASOP_2436_REUSED_CLDFB_IN_OMASA_SR /*-------------------------------------------------------------------* * audio_buffer_td_to_cldfb() * @@ -466,6 +465,7 @@ static void accumulate2dArrayToBuffer( * The number of valid CLDFB handles in cldfbAna must be a least equal to the number of channels * in the audio buffers. *-------------------------------------------------------------------*/ + static void audio_buffer_td_to_cldfb( IVAS_REND_AudioBuffer td_buffer, IVAS_REND_AudioBuffer cldfb_buffer, @@ -511,7 +511,6 @@ static void audio_buffer_td_to_cldfb( } } } -#endif /*-------------------------------------------------------------------* @@ -1313,9 +1312,7 @@ static TDREND_WRAPPER defaultTdRendWrapper( w.binaural_latency_ns = 0; w.hBinRendererTd = NULL; w.hHrtfTD = NULL; -#ifdef FIX_FLOAT_1528_5MS_REND_ISM_META_DELAY_COMPENSATION w.metaSfCounter = 0; -#endif return w; } @@ -5742,11 +5739,7 @@ static ivas_error rotateFrameSba( static ivas_error renderIsmToBinaural( -#ifdef FIX_FLOAT_1528_5MS_REND_ISM_META_DELAY_COMPENSATION input_ism *ismInput, -#else - const input_ism *ismInput, -#endif IVAS_REND_AudioBuffer outAudio ) { float tmpTDRendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; @@ -6132,22 +6125,15 @@ static ivas_error renderIsmToSplitBinaural( IVAS_QUATERNION originalHeadRot[MAX_PARAM_SPATIAL_SUBFRAMES]; int16_t i; float tmpBinaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][L_FRAME48k]; -#ifndef FIX_BASOP_2436_REUSED_CLDFB_IN_OMASA_SR - int16_t ch, slot_idx, num_bands; - float tmpBinaural_CldfbRe[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; - float tmpBinaural_CldfbIm[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; -#endif int16_t output_frame = ismInput->base.inputBuffer.config.numSamplesPerChannel; COMBINED_ORIENTATION_HANDLE pCombinedOrientationData; int16_t ism_md_subframe_update_ext; push_wmops( "renderIsmToSplitBinaural" ); -#ifdef FIX_BASOP_2436_REUSED_CLDFB_IN_OMASA_SR assert( !outAudio.config.is_cldfb && "ISM renderering only supports TD output. If CLDFB output was requested, " "we convert to CLDFB higher up the stack after rendering all ISMs" ); -#endif pSplitRendWrapper = ismInput->base.ctx.pSplitRendWrapper; pMultiBinPoseData = &pSplitRendWrapper->multiBinPoseData; @@ -6209,33 +6195,10 @@ static ivas_error renderIsmToSplitBinaural( return error; } -#ifndef FIX_BASOP_2436_REUSED_CLDFB_IN_OMASA_SR - if ( outAudio.config.is_cldfb ) - { - /* Perform CLDFB analysis on rendered audio, since the output buffer is CLDFB domain */ - num_bands = (int16_t) ( ( BINAURAL_MAXBANDS * *ismInput->base.ctx.pOutSampleRate ) / 48000 ); - for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - for ( slot_idx = 0; slot_idx < IVAS_CLDFB_NO_COL_MAX; slot_idx++ ) - { - cldfbAnalysis_ts( &tmpProcessing[ch][num_bands * slot_idx], - &tmpBinaural_CldfbRe[BINAURAL_CHANNELS * pos_idx + ch][slot_idx][0], - &tmpBinaural_CldfbIm[BINAURAL_CHANNELS * pos_idx + ch][slot_idx][0], - num_bands, - ismInput->base.ctx.pSplitRendWrapper->hCldfbHandles->cldfbAna[pos_idx + ch] ); - } - } - } - else - { -#endif - /* Copy rendered audio to tmp storage buffer. Copying directly to output would - * overwrite original audio, which is still needed for rendering next head pose. */ - mvr2r( tmpProcessing[0], tmpBinaural[BINAURAL_CHANNELS * pos_idx], output_frame ); - mvr2r( tmpProcessing[1], tmpBinaural[BINAURAL_CHANNELS * pos_idx + 1], output_frame ); -#ifndef FIX_BASOP_2436_REUSED_CLDFB_IN_OMASA_SR - } -#endif + /* Copy rendered audio to tmp storage buffer. Copying directly to output would + * overwrite original audio, which is still needed for rendering next head pose. */ + mvr2r( tmpProcessing[0], tmpBinaural[BINAURAL_CHANNELS * pos_idx], output_frame ); + mvr2r( tmpProcessing[1], tmpBinaural[BINAURAL_CHANNELS * pos_idx + 1], output_frame ); /* Overwrite processing buffer with original input audio again */ copyBufferTo2dArray( ismInput->base.inputBuffer, tmpProcessing ); @@ -6247,18 +6210,8 @@ static ivas_error renderIsmToSplitBinaural( pCombinedOrientationData->Quaternions[i] = originalHeadRot[i]; } -#ifndef FIX_BASOP_2436_REUSED_CLDFB_IN_OMASA_SR - if ( outAudio.config.is_cldfb ) - { - accumulateCLDFBArrayToBuffer( tmpBinaural_CldfbRe, tmpBinaural_CldfbIm, &outAudio ); - } - else - { -#endif - accumulate2dArrayToBuffer( tmpBinaural, &outAudio ); -#ifndef FIX_BASOP_2436_REUSED_CLDFB_IN_OMASA_SR - } -#endif + accumulate2dArrayToBuffer( tmpBinaural, &outAudio ); + pop_wmops(); /* Encoding to split rendering bitstream done at a higher level */ @@ -6365,7 +6318,6 @@ static ivas_error renderActiveInputsIsm( int16_t i; input_ism *pCurrentInput; ivas_error error; -#ifdef FIX_BASOP_2436_REUSED_CLDFB_IN_OMASA_SR int16_t num_active_inputs; IVAS_REND_AudioBuffer work_buffer; float tmp_td_binaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS * L_FRAME48k]; @@ -6400,7 +6352,6 @@ static ivas_error renderActiveInputsIsm( work_buffer.data = tmp_td_binaural; set_zero( tmp_td_binaural, MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS * L_FRAME48k ); } -#endif for ( i = 0, pCurrentInput = hIvasRend->inputsIsm; i < RENDERER_MAX_ISM_INPUTS; ++i, ++pCurrentInput ) { @@ -6410,27 +6361,16 @@ static ivas_error renderActiveInputsIsm( continue; } -#ifdef FIX_BASOP_2436_REUSED_CLDFB_IN_OMASA_SR - if ( ( error = renderInputIsm( pCurrentInput, - hIvasRend->outputConfig, - work_buffer ) ) != IVAS_ERR_OK ) -#else - if ( ( error = renderInputIsm( pCurrentInput, hIvasRend->outputConfig, outAudio ) ) != IVAS_ERR_OK ) -#endif + if ( ( error = renderInputIsm( pCurrentInput, hIvasRend->outputConfig, work_buffer ) ) != IVAS_ERR_OK ) { return error; } } -#ifdef FIX_BASOP_2436_REUSED_CLDFB_IN_OMASA_SR if ( outAudio.config.is_cldfb ) { - audio_buffer_td_to_cldfb( work_buffer, - outAudio, - hIvasRend->sampleRateOut, - hIvasRend->splitRendWrapper->hCldfbHandles->cldfbAna ); + audio_buffer_td_to_cldfb( work_buffer, outAudio, hIvasRend->sampleRateOut, hIvasRend->splitRendWrapper->hCldfbHandles->cldfbAna ); } -#endif return IVAS_ERR_OK; } -- GitLab