From 045831118042045062a1ae656ea51451aed2a72a Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 19 May 2025 13:32:04 +0200 Subject: [PATCH 01/10] [cleanup] accept FIX_955_FASTCONV_REND_IN_ISM --- lib_com/options.h | 1 - lib_dec/ivas_jbm_dec_fx.c | 6 ------ 2 files changed, 7 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index e764bc83b..1e87603ff 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -96,7 +96,6 @@ #define FIX_963_USAN_ERROR /* Eri: Issue 963: USAN error in Stereo CNG, division by zero */ #define NONBE_FIX_952_MC_PARAMUPMIX_5MS /* Dlb : issue 952 : Differences between 5ms and 20ms rendering for ParamUpmix*/ #define NONBE_FIX_935_EARLY_REFLECTIONS_WRONG_ORDER /* Qualcomm: issue 953: fix order or ER channels in LC mode*/ -#define FIX_955_FASTCONV_REND_IN_ISM /* VA: put FastConv rendering call under DEBUGGING */ #define NONBE_FIX_967_ISM_MONO_DMX /* FhG: issue 967: accumulating energies in ISM mono DMX */ #define FIX_959_MASA_LINEAR_REND /* VA: issue 959: remove unused calling of ivas_sba_linear_renderer() in MASA rendering */ diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index fa0a1e630..2d22849f2 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -1984,7 +1984,6 @@ ivas_error ivas_jbm_dec_render_fx( { ivas_apply_non_diegetic_panning_fx( p_output_fx, st_ivas->hDecoderConfig->non_diegetic_pan_gain_fx, *nSamplesRendered ); } -#ifdef FIX_955_FASTCONV_REND_IN_ISM #ifdef DEBUGGING ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_SBA_LINEAR_ENC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV ) ) #else @@ -1992,11 +1991,6 @@ ivas_error ivas_jbm_dec_render_fx( #endif { /* Convert to Ambisonics */ -#else - ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_SBA_LINEAR_ENC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV ) ) - { -/* Convert to Ambisonics; used also for ISM->HOA3->binaural rendering */ -#endif FOR( i = 0; i < st_ivas->nchan_transport; i++ ) { FOR( j = 0; j < HOA3_CHANNELS; j++ ) -- GitLab From 15a67f9dad66484503a905f0d271af2e0d2e274c Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 19 May 2025 13:32:07 +0200 Subject: [PATCH 02/10] [cleanup] accept FIX_969_USAN_IGF_ARITH --- lib_com/options.h | 1 - lib_dec/igf_scf_dec_fx.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 1e87603ff..d92201a15 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -101,7 +101,6 @@ #define NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX /* FhG : issue #968: differences between 5ms and 20ms rendering for discrete ISM with BRIR and head rotation*/ #define NONBE_FIX_935_SBA_REVERB /* FhG: issue 935: fix MSAN error for SBA related to BINAURAL_ROOM_REVERB */ -#define FIX_969_USAN_IGF_ARITH /* FhG: issue 969: fix USAN error in igf_sce_dec; same issue as #962 */ #define NONBE_FIX_973_HODIRAC_BAND_GROUPING /* FhG: issue 973: empty parameter band in DirAC */ #define NONBE_FIX_BINARY_BINAURAL_READING /* Orange: Add support for reading binaural binary file */ diff --git a/lib_dec/igf_scf_dec_fx.c b/lib_dec/igf_scf_dec_fx.c index 3db6581da..6478b3f92 100644 --- a/lib_dec/igf_scf_dec_fx.c +++ b/lib_dec/igf_scf_dec_fx.c @@ -189,9 +189,7 @@ static void decode_sfe_vector_fx( { /* (t == 0) && (f == 0) */ /* decode one of the IGF_SYMBOLS_IN_TABLE == 27 alphabet symbols using the new raw AC function */ -#ifdef FIX_969_USAN_IGF_ARITH /* NOTE: the float equivalent uses a tmp variable + explicit cast here to avoid undefined behaviour here. This BASOP version does not need it as it already uses signed Word16 return value here. */ -#endif res = ari_decode_14bits_s27_ext_fx( st, &hPrivateData->acState, (const UWord16 *) hPrivateData->cf_se00 ); pred = arith_decode_bits_fx( hPrivateData, st, 2 ); /* LSBs as 2 bit raw */ -- GitLab From a5680fbef0997f729ab9387387ffbac80c9fe52d Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 19 May 2025 13:32:10 +0200 Subject: [PATCH 03/10] [cleanup] accept FIX_959_MASA_LINEAR_REND --- lib_com/options.h | 1 - lib_dec/ivas_jbm_dec_fx.c | 17 ----------------- lib_dec/ivas_output_config_fx.c | 4 ---- 3 files changed, 22 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index d92201a15..4c0d6034f 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -97,7 +97,6 @@ #define NONBE_FIX_952_MC_PARAMUPMIX_5MS /* Dlb : issue 952 : Differences between 5ms and 20ms rendering for ParamUpmix*/ #define NONBE_FIX_935_EARLY_REFLECTIONS_WRONG_ORDER /* Qualcomm: issue 953: fix order or ER channels in LC mode*/ #define NONBE_FIX_967_ISM_MONO_DMX /* FhG: issue 967: accumulating energies in ISM mono DMX */ -#define FIX_959_MASA_LINEAR_REND /* VA: issue 959: remove unused calling of ivas_sba_linear_renderer() in MASA rendering */ #define NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX /* FhG : issue #968: differences between 5ms and 20ms rendering for discrete ISM with BRIR and head rotation*/ #define NONBE_FIX_935_SBA_REVERB /* FhG: issue 935: fix MSAN error for SBA related to BINAURAL_ROOM_REVERB */ diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index 2d22849f2..8ae516d7c 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -2102,24 +2102,7 @@ ivas_error ivas_jbm_dec_render_fx( } ELSE IF( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) ) { -#ifndef FIX_959_MASA_LINEAR_REND - IF( EQ_32( st_ivas->renderer_type, RENDERER_SBA_LINEAR_DEC ) ) - { - *nSamplesRendered = s_min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); - move16(); - FOR( n = 0; n < nchan_remapped; n++ ) - { - Copy32( st_ivas->hTcBuffer->tc_fx[n] + st_ivas->hTcBuffer->n_samples_rendered, p_output_fx[n], *nSamplesRendered ); - } - IF( NE_32( ( error = ivas_sba_linear_renderer_fx( p_output_fx, *nSamplesRendered, nchan_remapped, 0, output_config, st_ivas->hOutSetup ) ), IVAS_ERR_OK ) ) - { - return error; - } - } - ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_DIRAC ) ) -#else IF( EQ_32( st_ivas->renderer_type, RENDERER_DIRAC ) ) -#endif { ivas_dirac_dec_render_fx( st_ivas, nchan_remapped, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output_fx ); } diff --git a/lib_dec/ivas_output_config_fx.c b/lib_dec/ivas_output_config_fx.c index 94a1869f4..8afd003be 100644 --- a/lib_dec/ivas_output_config_fx.c +++ b/lib_dec/ivas_output_config_fx.c @@ -453,11 +453,7 @@ void ivas_renderer_select( *internal_config = IVAS_AUDIO_CONFIG_HOA3; move16(); } -#ifdef FIX_959_MASA_LINEAR_REND *renderer_type = RENDERER_SBA_LINEAR_DEC; -#else - st_ivas->renderer_type = RENDERER_SBA_LINEAR_DEC; -#endif move16(); } ELSE IF( ( EQ_32( ivas_format, MASA_FORMAT ) && EQ_32( output_config, IVAS_AUDIO_CONFIG_MONO ) && EQ_16( st_ivas->nchan_transport, 1 ) ) || -- GitLab From 35850efa8640a21d6ac814ee61f8d456a813b3e0 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 19 May 2025 13:32:13 +0200 Subject: [PATCH 04/10] [cleanup] accept NONBE_FIX_BINARY_BINAURAL_READING --- apps/decoder.c | 70 ---------- apps/renderer.c | 25 ---- lib_com/ivas_cnst.h | 3 - lib_com/ivas_error.h | 4 - lib_com/options.h | 1 - lib_dec/ivas_init_dec.c | 4 - lib_dec/lib_dec.h | 16 --- lib_dec/lib_dec_fx.c | 32 ----- lib_rend/ivas_crend_fx.c | 18 --- lib_rend/ivas_hrtf_fx.c | 4 - lib_rend/ivas_objectRenderer_fx.c | 4 - lib_rend/ivas_objectRenderer_mix_fx.c | 11 -- lib_rend/ivas_stat_rend.h | 14 -- lib_rend/lib_rend.c | 185 -------------------------- lib_rend/lib_rend.h | 4 - lib_util/hrtf_file_reader.c | 184 +------------------------ lib_util/hrtf_file_reader.h | 14 -- 17 files changed, 6 insertions(+), 587 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 64f131206..a59bc5fac 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -174,10 +174,8 @@ int main( RenderConfigReader *renderConfigReader = NULL; int16_t *pcmBuf = NULL; IVAS_RENDER_FRAMESIZE asked_frame_size; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_HANDLE *hHrtfTD = NULL; IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF = NULL; -#endif #ifdef WMOPS reset_wmops(); @@ -603,16 +601,12 @@ int main( if ( arg.hrtfReaderEnabled ) { -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - IVAS_DEC_HRTF_HANDLE hHrtfTD = NULL; -#endif if ( ( error = IVAS_DEC_GetHrtfHandle( hIvasDec, &hHrtfTD ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetHrtfHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( error = load_HRTF_binary( *hHrtfTD, hrtfReader ) ) != IVAS_ERR_OK ) { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) @@ -649,16 +643,8 @@ int main( destroy_td_hrtf( hHrtfTD ); } } -#else - if ( ( error = load_HRTF_binary( hHrtfTD, hrtfReader ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); - goto cleanup; - } -#endif #ifdef FIX_638_ENERGIE_IAC_ROM_TABLES -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( *hHrtfTD != NULL ) && ( error = load_reverb_binary( *hHrtfTD, hrtfReader ) ) != IVAS_ERR_OK ) { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) @@ -667,16 +653,6 @@ int main( goto cleanup; } } -#else - if ( ( hHrtfTD != NULL ) && ( error = load_reverb_binary( hHrtfTD, hrtfReader ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); - goto cleanup; - } -#endif -#endif -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF = NULL; #endif if ( ( error = IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hSetOfHRTF ) ) != IVAS_ERR_OK ) { @@ -684,7 +660,6 @@ int main( goto cleanup; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( error = create_SetOfHRTF_from_binary( *hSetOfHRTF, hrtfReader, arg.output_Fs ) ) != IVAS_ERR_OK ) { #ifdef FIX_OLD_BINARY_FORMAT @@ -721,26 +696,14 @@ int main( } #endif } -#else - if ( ( error = create_SetOfHRTF_from_binary( hSetOfHRTF, hrtfReader, arg.output_Fs ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nError in loading HRTF binary file %s for CRend \n\n", arg.hrtfFileName ); - goto cleanup; - } -#endif -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv = NULL; -#else - IVAS_DEC_HRTF_FASTCONV_HANDLE hHrtfFastConv = NULL; -#endif if ( ( error = IVAS_DEC_GetHrtfFastConvHandle( hIvasDec, &hHrtfFastConv ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetHrtfFastConvHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, hrtfReader ) ) != IVAS_ERR_OK ) { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) @@ -753,26 +716,14 @@ int main( destroy_fastconv_hrtf( hHrtfFastConv ); } } -#else - if ( ( error = load_fastconv_HRTF_from_binary( hHrtfFastConv, hrtfReader ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nError in loading HRTF binary file %s for FastConv \n\n", arg.hrtfFileName ); - goto cleanup; - } -#endif -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_PARAMBIN_HANDLE *hHrtfParambin = NULL; -#else - IVAS_DEC_HRTF_PARAMBIN_HANDLE hHrtfParambin = NULL; -#endif if ( ( error = IVAS_DEC_GetHrtfParamBinHandle( hIvasDec, &hHrtfParambin ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetHrtfParamBinHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( error = load_parambin_HRTF_from_binary( *hHrtfParambin, hrtfReader ) ) != IVAS_ERR_OK ) { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) @@ -785,13 +736,6 @@ int main( destroy_parambin_hrtf( hHrtfParambin ); } } -#else - if ( ( error = load_parambin_HRTF_from_binary( hHrtfParambin, hrtfReader ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nError in loading HRTF binary file %s for parametric binauralizer \n\n", arg.hrtfFileName ); - goto cleanup; - } -#endif } /*------------------------------------------------------------------------------------------* @@ -854,30 +798,16 @@ cleanup: if ( arg.hrtfReaderEnabled ) { -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - IVAS_DEC_HRTF_HANDLE hHrtfTD = NULL; -#endif IVAS_DEC_GetHrtfHandle( hIvasDec, &hHrtfTD ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( hHrtfTD != NULL ) { destroy_td_hrtf( hHrtfTD ); } -#else - dealloc_HRTF_binary( hHrtfTD ); -#endif -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF = NULL; -#endif IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hSetOfHRTF ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( hSetOfHRTF != NULL ) { destroy_SetOfHRTF( hSetOfHRTF ); } -#else - destroy_SetOfHRTF( hSetOfHRTF ); -#endif } IVAS_DEC_Close( &hIvasDec ); diff --git a/apps/renderer.c b/apps/renderer.c index 1ef7473c5..64ef2e5d6 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -762,12 +762,10 @@ int main( #endif Vector3PairFileReader *referenceVectorReader = NULL; hrtfFileReader *hrtfFileReader = NULL; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF = NULL; IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv = NULL; IVAS_DEC_HRTF_PARAMBIN_HANDLE *hHrtfParambin = NULL; IVAS_DEC_HRTF_HANDLE *hHrtfTD = NULL; -#endif IsmPositionProvider *positionProvider; LfeRoutingConfig *lfeRoutingConfigs[RENDERER_MAX_MC_INPUTS]; RenderConfigReader *renderConfigReader = NULL; @@ -912,16 +910,6 @@ int main( } } -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - if ( !isEmptyString( args.customHrtfFilePath ) ) - { - if ( hrtfFileReader_open( args.customHrtfFilePath, &hrtfFileReader ) != IVAS_ERR_OK ) - { - fprintf( stderr, "Error opening file: %s\n", args.customHrtfFilePath ); - exit( -1 ); - } - } -#endif if ( !isEmptyString( args.renderConfigFilePath ) ) { @@ -1009,17 +997,12 @@ int main( Word32 nonDiegeticPanGain_fx = ( args.nonDiegeticPanGain == 1.0f ) ? ONE_IN_Q31 : ( args.nonDiegeticPanGain == -1.0f ) ? L_negate( ONE_IN_Q31 ) : (Word32) ( args.nonDiegeticPanGain * ( 1LL << Q31 ) ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IF( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, !isEmptyString( args.customHrtfFilePath ), args.nonDiegeticPan, nonDiegeticPanGain_fx, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK ) -#else - IF( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, args.nonDiegeticPan, nonDiegeticPanGain_fx, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "Error opening renderer handle: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( !isEmptyString( args.customHrtfFilePath ) ) { if ( hrtfFileReader_open( args.customHrtfFilePath, &hrtfFileReader ) != IVAS_ERR_OK ) @@ -1165,7 +1148,6 @@ int main( hrtfFileReader_close( &hrtfFileReader ); } -#endif fprintf( stdout, "Input audio file: %s\n", args.inputFilePath ); fprintf( stdout, "Output audio file: %s\n\n", args.outputFilePath ); @@ -2234,9 +2216,7 @@ int main( free( outFloatBuffer ); free( outInt32Buffer ); free( inInt32Buffer ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING cleanup: -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT if ( bitsBufferData != NULL ) @@ -2270,10 +2250,6 @@ cleanup: RotationFileReader_close( &externalOrientationFileReader ); RotationFileReader_close( &referenceRotReader ); Vector3PairFileReader_close( &referenceVectorReader ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - hrtfFileReader_close( &hrtfFileReader ); -#endif -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( hSetOfHRTF != NULL && *hSetOfHRTF != NULL ) { destroy_SetOfHRTF( hSetOfHRTF ); @@ -2282,7 +2258,6 @@ cleanup: { destroy_td_hrtf( hHrtfTD ); } -#endif IVAS_REND_Close( &hIvasRend ); IsmPositionProvider_close( positionProvider ); RenderConfigReader_close( &renderConfigReader ); diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index ee34014df..97602e73d 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1683,9 +1683,6 @@ typedef enum #define MAX_ANGULAR_STEP_INV ( 1.0f / MAX_ANGULAR_STEP ) #define MAX_INTERPOLATION_STEPS 12 -#ifndef NONBE_FIX_BINARY_BINAURAL_READING -#define LR_IAC_LENGTH_NR_FC ( RV_LENGTH_NR_FC ) -#endif #define DEG_360_IN_Q22 ( 360 << Q22 ) // Q22 #define DEG_180_IN_Q22 ( 180 << Q22 ) // Q22 diff --git a/lib_com/ivas_error.h b/lib_com/ivas_error.h index 4955c7e2c..14c37a593 100644 --- a/lib_com/ivas_error.h +++ b/lib_com/ivas_error.h @@ -78,9 +78,7 @@ typedef enum IVAS_ERR_DIRECTIVITY_NOT_SUPPORTED, IVAS_ERR_ACOUSTIC_ENVIRONMENT_NOT_SUPPORTED, IVAS_ERR_INVALID_HRTF, -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA, -#endif IVAS_ERR_INVALID_INPUT_FORMAT, IVAS_ERR_INVALID_INDEX, IVAS_ERR_NOT_SUPPORTED_OPTION, @@ -260,10 +258,8 @@ static inline const char *ivas_error_to_string( ivas_error error_code ) return "Acoustic environment not supported"; case IVAS_ERR_INVALID_HRTF: return "Unsupported HRTF filter set"; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING case IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA: return "Renderer data missing in HRTF binary file"; -#endif case IVAS_ERR_INVALID_INPUT_FORMAT: return "Invalid input format"; case IVAS_ERR_INVALID_INDEX: diff --git a/lib_com/options.h b/lib_com/options.h index 4c0d6034f..f19e13466 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -102,7 +102,6 @@ #define NONBE_FIX_935_SBA_REVERB /* FhG: issue 935: fix MSAN error for SBA related to BINAURAL_ROOM_REVERB */ #define NONBE_FIX_973_HODIRAC_BAND_GROUPING /* FhG: issue 973: empty parameter band in DirAC */ -#define NONBE_FIX_BINARY_BINAURAL_READING /* Orange: Add support for reading binaural binary file */ //#define USE_NEW_HRTF_BINARY_FILE_FORMAT /* Orange: to activate when decided to change the hrtf binary file format */ #ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT #define FIX_638_ENERGIE_IAC_ROM_TABLES /* Orange: Missing left/right and coherence late reverb tables in binary format*/ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 69e246164..b4af0ed06 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -3078,11 +3078,7 @@ void ivas_destroy_dec_fx( { ivas_td_binaural_close_fx( &st_ivas->hBinRendererTd ); } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IF( st_ivas->hHrtfTD != NULL ) -#else - ELSE IF( st_ivas->hHrtfTD != NULL ) -#endif { BSplineModelEvalDealloc_fx( &st_ivas->hHrtfTD->ModelParams, &st_ivas->hHrtfTD->ModelEval ); ivas_HRTF_binary_close_fx( &st_ivas->hHrtfTD ); diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index f2281b779..b6ce35d90 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -360,39 +360,23 @@ ivas_error IVAS_DEC_FeedCustomLsData( /*! r: error code */ ivas_error IVAS_DEC_GetHrtfHandle( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_HANDLE **hHrtfTD /* o : HRTF handle */ -#else - IVAS_DEC_HRTF_HANDLE *hHrtfTD /* o : HRTF handle */ -#endif ); /*! r: error code */ ivas_error IVAS_DEC_GetHrtfCRendHandle( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - #ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_CREND_HANDLE **hSetOfHRTF /* o : Set of HRTF handle */ -#else - IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF /* o : Set of HRTF handle */ -#endif ); ivas_error IVAS_DEC_GetHrtfFastConvHandle( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_FASTCONV_HANDLE **hHrtfFastConv /* o : FASTCONV HRTF handle */ -#else - IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv /* o : FASTCONV HRTF handle */ -#endif ); ivas_error IVAS_DEC_GetHrtfParamBinHandle( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_PARAMBIN_HANDLE **hHrtfParambin /* o : Parametric binauralizer HRTF handle */ -#else - IVAS_DEC_HRTF_PARAMBIN_HANDLE *hHrtfParambin /* o : Parametric binauralizer HRTF handle */ -#endif ); diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index e2bd37600..7ead34cca 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -2512,11 +2512,7 @@ ivas_error IVAS_DEC_FeedCustomLsData( ivas_error IVAS_DEC_GetHrtfHandle( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_HANDLE **hHrtfTD /* o : HRTF handle */ -#else - IVAS_DEC_HRTF_HANDLE *hHrtfTD /* o : HRTF handle */ -#endif ) { test(); @@ -2526,11 +2522,7 @@ ivas_error IVAS_DEC_GetHrtfHandle( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING *hHrtfTD = &hIvasDec->st_ivas->hHrtfTD; -#else - *hHrtfTD = hIvasDec->st_ivas->hHrtfTD; -#endif return IVAS_ERR_OK; } @@ -2544,11 +2536,7 @@ ivas_error IVAS_DEC_GetHrtfHandle( ivas_error IVAS_DEC_GetHrtfCRendHandle( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_CREND_HANDLE **hSetOfHRTF /* o : Set of HRTF handle */ -#else - IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF /* o : Set of HRTF handle */ -#endif ) { test(); @@ -2558,11 +2546,7 @@ ivas_error IVAS_DEC_GetHrtfCRendHandle( return IVAS_ERR_WRONG_PARAMS; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING *hSetOfHRTF = &hIvasDec->st_ivas->hSetOfHRTF; -#else - *hSetOfHRTF = hIvasDec->st_ivas->hSetOfHRTF; -#endif return IVAS_ERR_OK; } @@ -2576,11 +2560,7 @@ ivas_error IVAS_DEC_GetHrtfCRendHandle( ivas_error IVAS_DEC_GetHrtfFastConvHandle( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_FASTCONV_HANDLE **hHrtfFastConv /* o : FASTCONV HRTF handle */ -#else - IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv /* o : FASTCONV HRTF handle */ -#endif ) { test(); @@ -2590,11 +2570,7 @@ ivas_error IVAS_DEC_GetHrtfFastConvHandle( return IVAS_ERR_WRONG_PARAMS; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING *hHrtfFastConv = &hIvasDec->st_ivas->hHrtfFastConv; -#else - *hHrtfFastConv = hIvasDec->st_ivas->hHrtfFastConv; -#endif return IVAS_ERR_OK; } @@ -2608,11 +2584,7 @@ ivas_error IVAS_DEC_GetHrtfFastConvHandle( ivas_error IVAS_DEC_GetHrtfParamBinHandle( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_PARAMBIN_HANDLE **hHrtfParambin /* o : Parametric binauralizer HRTF handle */ -#else - IVAS_DEC_HRTF_PARAMBIN_HANDLE *hHrtfParambin /* o : Parametric binauralizer HRTF handle */ -#endif ) { test(); @@ -2622,11 +2594,7 @@ ivas_error IVAS_DEC_GetHrtfParamBinHandle( return IVAS_ERR_WRONG_PARAMS; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING *hHrtfParambin = &hIvasDec->st_ivas->hHrtfParambin; -#else - *hHrtfParambin = hIvasDec->st_ivas->hHrtfParambin; -#endif return IVAS_ERR_OK; } diff --git a/lib_rend/ivas_crend_fx.c b/lib_rend/ivas_crend_fx.c index 134d02996..36965fc61 100644 --- a/lib_rend/ivas_crend_fx.c +++ b/lib_rend/ivas_crend_fx.c @@ -235,7 +235,6 @@ static ivas_error ivas_rend_initCrend_fx( return IVAS_ERR_INTERNAL_FATAL; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING test(); test(); test(); @@ -258,14 +257,9 @@ static ivas_error ivas_rend_initCrend_fx( ( ( hSetOfHRTF->hHRTF_hrir_foa == NULL ) && ( inConfig == IVAS_AUDIO_CONFIG_FOA ) ) || ( ( hSetOfHRTF->hHRTF_hrir_hoa2 == NULL ) && ( inConfig == IVAS_AUDIO_CONFIG_HOA2 ) ) || ( ( hSetOfHRTF->hHRTF_hrir_hoa3 == NULL ) && ( inConfig == IVAS_AUDIO_CONFIG_HOA3 ) ) ) -#else - IF( hSetOfHRTF == NULL ) -#endif { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hHrtf->init_from_rom = 1; move16(); -#endif IF( EQ_32( inConfigType, IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) ) { hHrtf->max_num_ir = sub( hHrtf->max_num_ir, 1 ); /* subtract LFE */ @@ -1014,9 +1008,7 @@ static ivas_error ivas_rend_initCrend_fx( } ELSE { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hHrtf->init_from_rom = 0; -#endif IF( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) { hHrtf->max_num_ir = sub( hHrtf->max_num_ir, 1 ); /* subtract LFE */ @@ -1026,24 +1018,20 @@ static ivas_error ivas_rend_initCrend_fx( IF( EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IF( hSetOfHRTF->hHRTF_brir_combined == NULL ) { return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Invalid command wrong output format" ); } -#endif hHrtf->latency_s_fx = hSetOfHRTF->hHRTF_brir_combined->latency_s_fx; // Q31 hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_brir_combined->max_num_iterations; hHrtf->index_frequency_max_diffuse = hSetOfHRTF->hHRTF_brir_combined->index_frequency_max_diffuse; } ELSE { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IF( hSetOfHRTF->hHRTF_hrir_combined == NULL ) { return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Invalid command wrong output format" ); } -#endif hHrtf->latency_s_fx = hSetOfHRTF->hHRTF_hrir_combined->latency_s_fx; // Q31 hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_hrir_combined->max_num_iterations; hHrtf->index_frequency_max_diffuse = hSetOfHRTF->hHRTF_hrir_combined->index_frequency_max_diffuse; @@ -1152,12 +1140,10 @@ static ivas_error ivas_rend_initCrend_fx( { IF( EQ_16( inConfig, IVAS_AUDIO_CONFIG_HOA3 ) ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IF( hSetOfHRTF->hHRTF_hrir_hoa3 == NULL ) { return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters " ); } -#endif hHrtf->latency_s_fx = hSetOfHRTF->hHRTF_hrir_hoa3->latency_s_fx; // Q31 hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_hrir_hoa3->max_num_iterations; hHrtf->index_frequency_max_diffuse = hSetOfHRTF->hHRTF_hrir_hoa3->index_frequency_max_diffuse; @@ -1203,12 +1189,10 @@ static ivas_error ivas_rend_initCrend_fx( } ELSE IF( EQ_16( inConfig, IVAS_AUDIO_CONFIG_HOA2 ) ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IF( hSetOfHRTF->hHRTF_hrir_hoa2 == NULL ) { return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters " ); } -#endif hHrtf->latency_s_fx = hSetOfHRTF->hHRTF_hrir_hoa2->latency_s_fx; // Q31 hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_hrir_hoa2->max_num_iterations; hHrtf->index_frequency_max_diffuse = hSetOfHRTF->hHRTF_hrir_hoa2->index_frequency_max_diffuse; @@ -1254,12 +1238,10 @@ static ivas_error ivas_rend_initCrend_fx( } ELSE IF( EQ_16( inConfig, IVAS_AUDIO_CONFIG_FOA ) ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IF( hSetOfHRTF->hHRTF_hrir_foa == NULL ) { return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters " ); } -#endif hHrtf->latency_s_fx = hSetOfHRTF->hHRTF_hrir_foa->latency_s_fx; // Q31 hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_hrir_foa->max_num_iterations; hHrtf->index_frequency_max_diffuse = hSetOfHRTF->hHRTF_hrir_foa->index_frequency_max_diffuse; diff --git a/lib_rend/ivas_hrtf_fx.c b/lib_rend/ivas_hrtf_fx.c index a9167f95b..0cb8ae505 100644 --- a/lib_rend/ivas_hrtf_fx.c +++ b/lib_rend/ivas_hrtf_fx.c @@ -54,9 +54,7 @@ ivas_error ivas_HRTF_binary_open_fx( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HRTF binary!" ); } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING set_c( (int8_t *) ( *hHrtfTD ), 0, (int32_t) sizeof( TDREND_HRFILT_FiltSet_t ) ); -#endif return IVAS_ERR_OK; } @@ -188,9 +186,7 @@ ivas_error ivas_HRTF_parambin_binary_open_fx( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for parametric binauralizer HRTF tables!" ); } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING set_c( (int8_t *) ( *hHrtfParambin ), 0, (int32_t) sizeof( HRTFS_PARAMBIN ) ); -#endif return IVAS_ERR_OK; } diff --git a/lib_rend/ivas_objectRenderer_fx.c b/lib_rend/ivas_objectRenderer_fx.c index 8b11d1f7a..da2c3cce9 100644 --- a/lib_rend/ivas_objectRenderer_fx.c +++ b/lib_rend/ivas_objectRenderer_fx.c @@ -802,11 +802,7 @@ ivas_error ivas_td_binaural_open_ext_fx( { directivity_fx = hRendCfg->directivity_fx; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING return ivas_td_binaural_open_unwrap_fx( pTDRend->hHrtfTD, outFs, nchan_transport, ivas_format, transport_config, directivity_fx, hTransSetup, &pTDRend->hBinRendererTd, &pTDRend->binaural_latency_ns, SrcInd ); -#else - return ivas_td_binaural_open_unwrap_fx( &pTDRend->hHrtfTD, outFs, *num_src, ivas_format, transport_config, directivity_fx, hTransSetup, &pTDRend->hBinRendererTd, &pTDRend->binaural_latency_ns, SrcInd ); -#endif } /*---------------------------------------------------------------------* * ivas_td_binaural_renderer_ext() diff --git a/lib_rend/ivas_objectRenderer_mix_fx.c b/lib_rend/ivas_objectRenderer_mix_fx.c index 589baf509..72042975b 100644 --- a/lib_rend/ivas_objectRenderer_mix_fx.c +++ b/lib_rend/ivas_objectRenderer_mix_fx.c @@ -156,12 +156,8 @@ void TDREND_MIX_Dealloc_fx( hBinRendererTd->Listener_p = NULL; } /* Dealloc HR filter set */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING test(); IF( ( *hBinRendererTd->pHrFiltSet_p != NULL ) && ( hBinRendererTd->HrFiltSet_p != NULL ) ) -#else - IF( hBinRendererTd->HrFiltSet_p != NULL ) -#endif { IF( EQ_16( hBinRendererTd->HrFiltSet_p->FilterMethod, TDREND_HRFILT_Method_BSplineModel ) ) { @@ -191,17 +187,12 @@ void TDREND_MIX_Dealloc_fx( } } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IF( EQ_16( hBinRendererTd->HrFiltSet_p->ModelParams.modelROM, 1 ) ) { free( hBinRendererTd->HrFiltSet_p ); hBinRendererTd->HrFiltSet_p = NULL; *hBinRendererTd->pHrFiltSet_p = NULL; } -#else - free( hBinRendererTd->HrFiltSet_p ); - hBinRendererTd->HrFiltSet_p = NULL; -#endif } return; @@ -266,9 +257,7 @@ ivas_error TDREND_MIX_Init_fx( hBinRendererTd->HrFiltSet_p = *hHrtfTD; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hBinRendererTd->pHrFiltSet_p = hHrtfTD; -#endif IF( NE_32( hBinRendererTd->HrFiltSet_p->SampleRate, output_Fs ) ) { diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 8cdb3d007..69351bae8 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -1296,9 +1296,7 @@ typedef struct ivas_binaural_td_rendering_struct TDREND_MIX_Listener_t *Listener_p; /* The virtual listener */ TDREND_HRFILT_FiltSet_t *HrFiltSet_p; /* HR filter set */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING TDREND_HRFILT_FiltSet_t **pHrFiltSet_p; /* pointer to HR filter set */ -#endif Word16 UseCommonDistAttenModel; /* Use common dist atten model (TRUE/FALSE) */ Word16 DistAttenEnabled; /* (TRUE/FALSE) */ @@ -1310,11 +1308,7 @@ typedef struct { Word32 binaural_latency_ns; BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING TDREND_HRFILT_FiltSet_t **hHrtfTD; -#else - TDREND_HRFILT_FiltSet_t *hHrtfTD; -#endif } TDREND_WRAPPER, *TDREND_WRAPPER_HANDLE; @@ -1341,9 +1335,7 @@ typedef struct ivas_hrtfs_structure Word16 inv_diffuse_weight_fx[MAX_INTERN_CHANNELS]; /* inverse diffuse weights array, access one inverse weight by pInvDiffuseWeight[channel] Q15 */ #endif Word32 latency_s_fx; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING Word16 init_from_rom; -#endif Word16 gain_lfe_fx; // Q14 } HRTFS_DATA, *HRTFS_HANDLE; /* Main Crend structure */ @@ -1478,9 +1470,7 @@ typedef struct ivas_hrtfs_parambin_struct Word32 parametricReverberationEneCorrections_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ Word32 parametricEarlyPartEneCorrection_fx[CLDFB_NO_CHANNELS_MAX]; /* Q28 */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING Word16 allocatedFromFile; -#endif } HRTFS_PARAMBIN, *HRTFS_PARAMBIN_HANDLE; @@ -1603,11 +1593,7 @@ typedef struct ivas_masa_external_rendering_struct #endif REVERB_STRUCT_HANDLE hReverb; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING HRTFS_PARAMBIN_HANDLE *hHrtfParambin; -#else - HRTFS_PARAMBIN_HANDLE hHrtfParambin; -#endif VBAP_HANDLE hVBAPdata; Word32 *hoa_dec_mtx; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index c3be6c73b..7c64d0e26 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -57,11 +57,7 @@ /* Maximum buffer length (total) in samples. */ #define MAX_BUFFER_LENGTH ( MAX_BUFFER_LENGTH_PER_CHANNEL * MAX_INPUT_CHANNELS ) -#ifdef NONBE_FIX_BINARY_BINAURAL_READING #define MAX_BIN_DELAY_SAMPLES 150 /* Maximum supported rendering latency for binaural IRs */ -#else -#define MAX_BIN_DELAY_SAMPLES 50 /* Maximum supported rendering latency for binaural IRs */ -#endif /*-------------------------------------------------------------------* * Local types @@ -210,7 +206,6 @@ typedef struct MASA_PREREND_HANDLE hMasaPrerend; } input_masa; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING typedef struct hrtf_handles { IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF; @@ -218,7 +213,6 @@ typedef struct hrtf_handles IVAS_DEC_HRTF_PARAMBIN_HANDLE hHrtfParambin; IVAS_DEC_HRTF_HANDLE hHrtfTD; } hrtf_handles; -#endif struct IVAS_REND { @@ -251,25 +245,14 @@ struct IVAS_REND RENDER_CONFIG_DATA *hRendererConfig; /* Renderer config pointer */ Word16 num_subframes; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hrtf_handles hHrtfs; -#else - IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF; - IVAS_DEC_HRTF_FASTCONV_HANDLE hHrtfFastConv; - IVAS_DEC_HRTF_PARAMBIN_HANDLE hHrtfParambin; - IVAS_DEC_HRTF_HANDLE hHrtfTD; -#endif }; /*-------------------------------------------------------------------* * Local function prototypes *-------------------------------------------------------------------*/ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING static ivas_error initMasaExtRenderer( input_masa *inputMasa, const AUDIO_CONFIG outConfig, hrtf_handles *hHrtfs ); -#else -static ivas_error initMasaExtRenderer( input_masa *inputMasa, const AUDIO_CONFIG outConfig ); -#endif static void freeMasaExtRenderer( MASA_EXT_REND_HANDLE *hMasaExtRendOut ); static void intermidiate_ext_dirac_render( @@ -1442,9 +1425,6 @@ static ivas_error initIsmMasaRendering( IF( inputIsm->tdRendWrapper.hBinRendererTd != NULL ) { ivas_td_binaural_close_fx( &inputIsm->tdRendWrapper.hBinRendererTd ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - inputIsm->tdRendWrapper.hHrtfTD = NULL; -#endif } #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -1468,10 +1448,8 @@ static ivas_error setRendInputActiveIsm( const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, RENDER_CONFIG_DATA *hRendCfg -#ifdef NONBE_FIX_BINARY_BINAURAL_READING , hrtf_handles *hrtfs -#endif ) { ivas_error error; @@ -1525,11 +1503,7 @@ static ivas_error setRendInputActiveIsm( #ifdef SPLIT_REND_WITH_HEAD_ROT FOR( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING inputIsm->splitTdRendWrappers[i].hHrtfTD = &hrtfs->hHrtfTD; -#else - inputIsm->splitTdRendWrappers[i] = defaultTdRendWrapper(); -#endif } #endif @@ -1538,9 +1512,7 @@ static ivas_error setRendInputActiveIsm( error = IVAS_ERR_OK; move32(); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING inputIsm->tdRendWrapper.hHrtfTD = &hrtfs->hHrtfTD; -#endif test(); #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -1552,11 +1524,7 @@ static ivas_error setRendInputActiveIsm( #endif { #ifndef SPLIT_REND_WITH_HEAD_ROT -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IF( NE_32( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, *rendCtx.pOutSampleRate ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -1706,11 +1674,7 @@ static ivas_error setRendInputActiveIsm( } ELSE IF( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IF( NE_32( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -1747,18 +1711,12 @@ static void clearInputIsm( IF( inputIsm->tdRendWrapper.hBinRendererTd != NULL ) { ivas_td_binaural_close_fx( &inputIsm->tdRendWrapper.hBinRendererTd ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - inputIsm->tdRendWrapper.hHrtfTD = NULL; -#endif } #ifdef SPLIT_REND_WITH_HEAD_ROT FOR( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) { ivas_td_binaural_close_fx( &inputIsm->splitTdRendWrappers[i].hBinRendererTd ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - inputIsm->splitTdRendWrappers[i].hHrtfTD = NULL; -#endif } #endif @@ -2537,9 +2495,7 @@ static ivas_error initMcBinauralRendering( const AUDIO_CONFIG inConfig, const AUDIO_CONFIG outConfig, RENDER_CONFIG_DATA *hRendCfg, -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_CREND_HANDLE hMixconv, -#endif uint8_t reconfigureFlag ) { ivas_error error; @@ -2577,9 +2533,6 @@ static ivas_error initMcBinauralRendering( IF( !reconfigureFlag || ( !useTDRend && inputMc->tdRendWrapper.hBinRendererTd != NULL ) ) { ivas_td_binaural_close_fx( &inputMc->tdRendWrapper.hBinRendererTd ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - inputMc->tdRendWrapper.hHrtfTD = NULL; -#endif } #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -2590,9 +2543,6 @@ static ivas_error initMcBinauralRendering( IF( inputMc->splitTdRendWrappers[i].hBinRendererTd != NULL ) { ivas_td_binaural_close_fx( &inputMc->splitTdRendWrappers[i].hBinRendererTd ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - inputMc->splitTdRendWrappers[i].hHrtfTD = NULL; -#endif } } } @@ -2715,30 +2665,15 @@ static ivas_error initMcBinauralRendering( { /* open CREND */ #ifdef SPLIT_REND_WITH_HEAD_ROT -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IF( NE_32( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( EQ_16( inConfig, IVAS_AUDIO_CONFIG_LS_CUSTOM ) ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, hMixconv, outSampleRate, ( ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ), IVAS_ERR_OK ) ) #else - IF( NE_32( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( EQ_16( inConfig, IVAS_AUDIO_CONFIG_LS_CUSTOM ) ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, - NULL, - outSampleRate, ( ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ), - IVAS_ERR_OK ) ) -#endif -#else -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IF( NE_32( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( EQ_16( inConfig, IVAS_AUDIO_CONFIG_LS_CUSTOM ) ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, hMixconv, outSampleRate ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( EQ_16( inConfig, IVAS_AUDIO_CONFIG_LS_CUSTOM ) ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, - NULL, - outSampleRate ) ), - IVAS_ERR_OK ) ) - -#endif #endif { return error; @@ -2795,9 +2730,6 @@ static ivas_error initMcMasaRendering( IF( inputMc->tdRendWrapper.hBinRendererTd != NULL ) { ivas_td_binaural_close_fx( &inputMc->tdRendWrapper.hBinRendererTd ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - inputMc->tdRendWrapper.hHrtfTD = NULL; -#endif } #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -2889,10 +2821,8 @@ static ivas_error setRendInputActiveMc( const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, RENDER_CONFIG_DATA *hRendCfg -#ifdef NONBE_FIX_BINARY_BINAURAL_READING , hrtf_handles *hrtfs -#endif ) { #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -2928,15 +2858,11 @@ static ivas_error setRendInputActiveMc( setZeroPanMatrix_fx( inputMc->panGains_fx ); inputMc->customLsInput = defaultCustomLs(); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( hrtfs->hHrtfTD ) { inputMc->tdRendWrapper.binaural_latency_ns = Mult_32_32( hrtfs->hHrtfTD->latency_s_fx, 1000000000 ); } inputMc->tdRendWrapper.hHrtfTD = &hrtfs->hHrtfTD; -#else - inputMc->tdRendWrapper = defaultTdRendWrapper(); -#endif inputMc->crendWrapper = NULL; inputMc->hReverb = NULL; inputMc->hMcMasa = NULL; @@ -2959,15 +2885,11 @@ static ivas_error setRendInputActiveMc( #ifdef SPLIT_REND_WITH_HEAD_ROT FOR( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( hrtfs->hHrtfTD ) { inputMc->splitTdRendWrappers[i].binaural_latency_ns = Mult_32_32( hrtfs->hHrtfTD->latency_s_fx, 1000000000 ); } inputMc->splitTdRendWrappers[i].hHrtfTD = &hrtfs->hHrtfTD; -#else - inputMc->splitTdRendWrappers[i] = defaultTdRendWrapper(); -#endif } IF( EQ_32( getAudioConfigType( outConfig ), IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) ) @@ -2975,15 +2897,10 @@ static ivas_error setRendInputActiveMc( IF( EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) #endif { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IF( NE_32( ( error = initMcBinauralRendering( inputMc, inConfig, outConfig, hRendCfg, hrtfs->hSetOfHRTF, FALSE ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = initMcBinauralRendering( inputMc, inConfig, outConfig, hRendCfg, FALSE ) ), - IVAS_ERR_OK ) ) -#endif { return error; } @@ -3035,26 +2952,16 @@ static void clearInputMc( IF( inputMc->tdRendWrapper.hBinRendererTd != NULL ) { ivas_td_binaural_close_fx( &inputMc->tdRendWrapper.hBinRendererTd ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - inputMc->tdRendWrapper.hHrtfTD = NULL; -#endif } #ifdef SPLIT_REND_WITH_HEAD_ROT FOR( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IF( inputMc->splitTdRendWrappers[i].hBinRendererTd != NULL ) { ivas_td_binaural_close_fx( &inputMc->splitTdRendWrappers[i].hBinRendererTd ); inputMc->splitTdRendWrappers[i].hHrtfTD = NULL; } -#else - IF( inputMc->splitTdRendWrappers[i].hBinRendererTd != NULL ) - { - ivas_td_binaural_close_fx( &inputMc->splitTdRendWrappers[i].hBinRendererTd ); - } -#endif } #endif @@ -3152,18 +3059,11 @@ static ivas_error initSbaPanGainsForSbaOut( return error; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING static ivas_error updateSbaPanGains( input_sba *inputSba, const AUDIO_CONFIG outConfig, RENDER_CONFIG_DATA *hRendCfg, IVAS_DEC_HRTF_CREND_HANDLE hMixconv ) -#else -static ivas_error updateSbaPanGains( - input_sba *inputSba, - const AUDIO_CONFIG outConfig, - RENDER_CONFIG_DATA *hRendCfg ) -#endif { ivas_error error; AUDIO_CONFIG inConfig; @@ -3225,21 +3125,12 @@ static ivas_error updateSbaPanGains( else #endif { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING #ifdef SPLIT_REND_WITH_HEAD_ROT IF( NE_32( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ), IVAS_ERR_OK ) ) #else IF( NE_32( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, *rendCtx.pOutSampleRate ) ), IVAS_ERR_OK ) ) -#endif -#else -#ifdef SPLIT_REND_WITH_HEAD_ROT - IF( NE_32( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ), IVAS_ERR_OK ) ) -#endif - #endif { return error; @@ -3253,18 +3144,10 @@ static ivas_error updateSbaPanGains( { return error; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING #ifdef SPLIT_REND_WITH_HEAD_ROT IF( NE_32( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ), IVAS_ERR_OK ) ) #else IF( NE_32( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, *rendCtx.pOutSampleRate ) ), IVAS_ERR_OK ) ) -#endif -#else -#ifdef SPLIT_REND_WITH_HEAD_ROT - IF( NE_32( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ), IVAS_ERR_OK ) ) -#endif #endif { return error; @@ -3316,10 +3199,8 @@ static ivas_error setRendInputActiveSba( const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, RENDER_CONFIG_DATA *hRendCfg -#ifdef NONBE_FIX_BINARY_BINAURAL_READING , hrtf_handles *hrtfs -#endif ) { @@ -3368,9 +3249,7 @@ static ivas_error setRendInputActiveSba( { initRotGains_fx( inputSba->rot_gains_prev_fx[pos_idx] ); } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING inputSba->cldfbRendWrapper.hHrtfFastConv = hrtfs->hHrtfFastConv; -#endif #else initRotGains_fx( inputSba->rot_gains_prev_fx ); #endif @@ -3383,11 +3262,7 @@ static ivas_error setRendInputActiveSba( return error; } } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IF( NE_32( ( error = updateSbaPanGains( inputSba, outConfig, hRendCfg, hrtfs->hSetOfHRTF ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = updateSbaPanGains( inputSba, outConfig, hRendCfg ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -3427,10 +3302,8 @@ static ivas_error setRendInputActiveMasa( const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, RENDER_CONFIG_DATA *hRendCfg -#ifdef NONBE_FIX_BINARY_BINAURAL_READING , hrtf_handles *hrtfs -#endif ) /* Todo: This is not used at all within MASA. Support might be better to do after refactoring. */ { @@ -3483,11 +3356,7 @@ static ivas_error setRendInputActiveMasa( } ELSE { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IF( NE_32( ( error = initMasaExtRenderer( inputMasa, outConfig, hrtfs ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = initMasaExtRenderer( inputMasa, outConfig ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -3527,9 +3396,7 @@ ivas_error IVAS_REND_Open( IVAS_REND_HANDLE *phIvasRend, const Word32 outputSampleRate, const AUDIO_CONFIG outConfig, -#ifdef NONBE_FIX_BINARY_BINAURAL_READING const bool asHrtfBinary, -#endif const Word16 nonDiegeticPan, const Word32 nonDiegeticPanGain, /* Q31 */ const Word16 num_subframes ) @@ -3681,7 +3548,6 @@ ivas_error IVAS_REND_Open( move16(); } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hIvasRend->hHrtfs.hHrtfFastConv = NULL; hIvasRend->hHrtfs.hHrtfParambin = NULL; hIvasRend->hHrtfs.hHrtfTD = NULL; @@ -3705,7 +3571,6 @@ ivas_error IVAS_REND_Open( return error; } } -#endif return IVAS_ERR_OK; } @@ -3852,11 +3717,7 @@ ivas_error IVAS_REND_ConfigureCustomOutputLoudspeakerLayout( /* Input inactive, skip. */ CONTINUE; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IF( NE_32( ( error = updateSbaPanGains( inputSba, hIvasRend->outputConfig, hIvasRend->hRendererConfig, NULL ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = updateSbaPanGains( inputSba, hIvasRend->outputConfig, hIvasRend->hRendererConfig ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -4237,11 +4098,7 @@ ivas_error IVAS_REND_AddInput_fx( Word32 maxNumInputsOfType; void *inputsArray; Word32 inputStructSize; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING ivas_error ( *activateInput )( void *, AUDIO_CONFIG, IVAS_REND_InputId, RENDER_CONFIG_DATA *, hrtf_handles *hrtfs ); -#else - ivas_error ( *activateInput )( void *, AUDIO_CONFIG, IVAS_REND_InputId, RENDER_CONFIG_DATA * ); -#endif Word32 inputIndex; /* Validate function arguments */ @@ -4311,11 +4168,7 @@ ivas_error IVAS_REND_AddInput_fx( *inputId = makeInputId( inConfig, inputIndex ); move16(); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IF( NE_32( ( error = activateInput( (uint8_t *) inputsArray + inputStructSize * inputIndex, inConfig, *inputId, hIvasRend->hRendererConfig, &hIvasRend->hHrtfs ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = activateInput( (UWord8 *) inputsArray + inputStructSize * inputIndex, inConfig, *inputId, hIvasRend->hRendererConfig ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -4381,15 +4234,10 @@ ivas_error IVAS_REND_ConfigureCustomInputLoudspeakerLayout( IF( EQ_16( hIvasRend->outputConfig, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_16( hIvasRend->outputConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_16( hIvasRend->outputConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) #endif { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IF( NE_32( ( error = initMcBinauralRendering( inputMc, inputMc->base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, hIvasRend->hHrtfs.hSetOfHRTF, FALSE ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = initMcBinauralRendering( inputMc, inputMc->base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, FALSE ) ), - IVAS_ERR_OK ) ) -#endif { return error; } @@ -5220,15 +5068,10 @@ ivas_error IVAS_REND_SetHeadRotation( { IF( NE_32( hIvasRend->inputsMc[i].base.inConfig, IVAS_AUDIO_CONFIG_INVALID ) ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IF( NE_32( ( error = initMcBinauralRendering( &hIvasRend->inputsMc[i], hIvasRend->inputsMc[i].base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, hIvasRend->hHrtfs.hSetOfHRTF, TRUE ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = initMcBinauralRendering( &hIvasRend->inputsMc[i], hIvasRend->inputsMc[i].base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, TRUE ) ), - IVAS_ERR_OK ) ) -#endif { return error; } @@ -5332,16 +5175,10 @@ ivas_error IVAS_REND_DisableHeadRotation( { IF( NE_32( hIvasRend->inputsMc[i].base.inConfig, IVAS_AUDIO_CONFIG_INVALID ) ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IF( NE_32( ( error = initMcBinauralRendering( &hIvasRend->inputsMc[i], hIvasRend->inputsMc[i].base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, hIvasRend->hHrtfs.hSetOfHRTF, TRUE ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = initMcBinauralRendering( &hIvasRend->inputsMc[i], hIvasRend->inputsMc[i].base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, TRUE ) ), - IVAS_ERR_OK ) ) - -#endif { return error; @@ -9498,7 +9335,6 @@ void IVAS_REND_Close( ivas_external_orientation_close_fx( &hIvasRend->hExternalOrientationData ); ivas_combined_orientation_close_fx( &hIvasRend->hCombinedOrientationData ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING /* Fastconv HRTF memories */ ivas_binaural_hrtf_close( &hIvasRend->hHrtfs.hHrtfFastConv ); @@ -9507,7 +9343,6 @@ void IVAS_REND_Close( ivas_HRTF_CRend_binary_close_fx( &( hIvasRend->hHrtfs.hSetOfHRTF ) ); ivas_HRTF_fastconv_binary_close_fx( &( hIvasRend->hHrtfs.hHrtfFastConv ) ); ivas_HRTF_parambin_binary_close_fx( &( hIvasRend->hHrtfs.hHrtfParambin ) ); -#endif free( hIvasRend ); *phIvasRend = NULL; @@ -9653,7 +9488,6 @@ void IVAS_REND_cldfbSynthesis_wrapper( #endif -#ifdef NONBE_FIX_BINARY_BINAURAL_READING /*---------------------------------------------------------------------* * IVAS_REND_GetHrtfHandle( ) * @@ -9740,7 +9574,6 @@ ivas_error IVAS_REND_GetHrtfParamBinHandle( return IVAS_ERR_OK; } -#endif static ivas_error ivas_masa_ext_rend_dirac_rend_init( input_masa *inputMasa ) @@ -10195,11 +10028,7 @@ static ivas_error ivas_masa_ext_rend_parambin_init( error = IVAS_ERR_OK; move32(); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hHrtfParambin = *( inputMasa->hMasaExtRend->hHrtfParambin ); -#else - hHrtfParambin = inputMasa->hMasaExtRend->hHrtfParambin; -#endif /* Set common variables and defaults */ output_Fs = *( inputMasa->base.ctx.pOutSampleRate ); move32(); @@ -10374,10 +10203,8 @@ static ivas_error ivas_masa_ext_rend_parambin_init( static ivas_error initMasaExtRenderer( input_masa *inputMasa, const AUDIO_CONFIG outConfig -#ifdef NONBE_FIX_BINARY_BINAURAL_READING , hrtf_handles *hrtfs -#endif ) { Word16 i; @@ -10408,11 +10235,7 @@ static ivas_error initMasaExtRenderer( hMasaExtRend->hDiracDecBin = NULL; #endif hMasaExtRend->hReverb = NULL; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hMasaExtRend->hHrtfParambin = &hrtfs->hHrtfParambin; -#else - hMasaExtRend->hHrtfParambin = NULL; -#endif hMasaExtRend->hVBAPdata = NULL; hMasaExtRend->hoa_dec_mtx = NULL; @@ -10511,11 +10334,7 @@ static ivas_error initMasaExtRenderer( { IF( NE_16( hMasaExtRend->renderer_type, RENDERER_STEREO_PARAMETRIC ) ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IF( NE_32( ( error = ivas_dirac_dec_binaural_copy_hrtfs_fx( inputMasa->hMasaExtRend->hHrtfParambin ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_dirac_dec_binaural_copy_hrtfs_fx( &inputMasa->hMasaExtRend->hHrtfParambin ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -10609,11 +10428,7 @@ static void freeMasaExtRenderer( IF( hMasaExtRend->hHrtfParambin != NULL ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING ivas_HRTF_parambin_binary_close_fx( hMasaExtRend->hHrtfParambin ); -#else - ivas_HRTF_parambin_binary_close_fx( &hMasaExtRend->hHrtfParambin ); -#endif } IF( hMasaExtRend->hVBAPdata != NULL ) diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index eea8a9548..50663f936 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -116,9 +116,7 @@ ivas_error IVAS_REND_Open( IVAS_REND_HANDLE *phIvasRend, /* i/o: Pointer to renderer handle */ const Word32 outputSampleRate, /* i : output sampling rate */ const IVAS_AUDIO_CONFIG outConfig, /* i : output audio config */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING const bool asHrtfBinary, /* i : load hrtf binary file */ -#endif const Word16 nonDiegeticPan, /* i : non-diegetic object flag */ const Word32 nonDiegeticPanGain, /* i : non-diegetic panning gain Q31 */ const Word16 num_subframes /* i : number of subframes */ @@ -193,7 +191,6 @@ ivas_error IVAS_REND_GetDelay( int32_t *timeScale /* o : Time scale of the delay, equal to renderer output sampling rate */ ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING /*! r: error code */ ivas_error IVAS_REND_GetHrtfHandle( IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ @@ -215,7 +212,6 @@ ivas_error IVAS_REND_GetHrtfParamBinHandle( IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ IVAS_DEC_HRTF_PARAMBIN_HANDLE **hHrtfParambin /* o : Parametric binauralizer HRTF handle */ ); -#endif /* Functions to be called during rendering */ diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index 34f644c90..c99e19183 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -824,11 +824,7 @@ static ivas_error load_reverb_from_binary( return header_check_result; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING return IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA; -#else - return IVAS_ERR_FAILED_FILE_READ; -#endif } return IVAS_ERR_OK; @@ -863,9 +859,6 @@ static ivas_error TDREND_MIX_LoadHRTF( ) { int16_t tmp; -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - ivas_error error; -#endif bool is_tdrend; ivas_error header_check_result; ivas_hrtfs_file_header_t hrtfs_file_header; @@ -874,15 +867,10 @@ static ivas_error TDREND_MIX_LoadHRTF( int32_t hrtf_data_size_max; char *hrtf_data; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING header_check_result = IVAS_ERR_OK; -#else - error = IVAS_ERR_OK; -#endif if ( ( header_check_result = read_and_check_hrtf_binary_file_header( &hrtfs_file_header, f_hrtf ) ) != IVAS_ERR_OK ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING /* try if it is old format for BE tests*/ fseek( f_hrtf, 0, SEEK_SET ); @@ -903,7 +891,6 @@ static ivas_error TDREND_MIX_LoadHRTF( } return header_check_result; -#endif } is_tdrend = FALSE; @@ -961,35 +948,19 @@ static ivas_error TDREND_MIX_LoadHRTF( if ( HrFiltSet_p->FilterMethod != TDREND_HRFILT_Method_BSplineModel ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING header_check_result = IVAS_ERROR( IVAS_ERR_INVALID_HRTF, "The HR filter set file is not a supported type." ); -#else - error = IVAS_ERROR( IVAS_ERR_INVALID_HRTF, "The HR filter set file is not a supported type." ); -#endif } else { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING header_check_result = LoadBSplineBinary( HrFiltSet_p, f_hrtf ); -#else - error = LoadBSplineBinary( HrFiltSet_p, f_hrtf ); -#endif } } else { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING return IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA; -#else - return IVAS_ERROR( IVAS_ERR_INVALID_HRTF, "HR filter not found in binary file." ); -#endif } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING return header_check_result; -#else - return error; -#endif } @@ -1080,7 +1051,6 @@ static void HRTF_energy_sections_precalc( return; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING /*---------------------------------------------------------------------* * dealloc_HRTF_binary() * @@ -1161,87 +1131,6 @@ void destroy_td_hrtf( return; } -#else -/*---------------------------------------------------------------------* - * dealloc_HRTF_binary() - * - * Deallocated memory allocated by load_HRTF_binary - *---------------------------------------------------------------------*/ - -ivas_error dealloc_HRTF_binary( - IVAS_DEC_HRTF_HANDLE hHrtf /* i/o: HRTF handle */ -) -{ - int16_t i; - ivas_error error; - error = IVAS_ERR_OK; - - if ( hHrtf == NULL ) - { - return error; - } - - if ( !hHrtf->ModelParams.modelROM ) - { - if ( hHrtf->ModelParams.UseItdModel ) - { - free( hHrtf->ModelParamsITD.elevKSeq_dyn_fx ); - free( hHrtf->ModelParamsITD.azimKSeq_dyn_fx ); - free( hHrtf->ModelParamsITD.W_dyn_fx ); - free( hHrtf->ModelParamsITD.azimBsShape_dyn_fx ); - free( hHrtf->ModelParamsITD.elevBsShape_dyn_fx ); - } - free( hHrtf->ModelParams.elevKSeq_dyn_fx ); - free( hHrtf->ModelParams.azim_start_idx_dyn ); - free( hHrtf->ModelParams.azimDim2_dyn ); - free( hHrtf->ModelParams.azimDim3_dyn ); - free( hHrtf->ModelParams.AlphaL_dyn_fx ); - free( hHrtf->ModelParams.AlphaR_dyn_fx ); - free( hHrtf->ModelParams.azimSegSamples_dyn ); - - free( hHrtf->ModelParams.azimShapeIdx_dyn ); - free( hHrtf->ModelParams.azimShapeSampFactor_dyn ); - free( hHrtf->ModelParams.elevBsShape_dyn_fx ); - - for ( i = 0; i < hHrtf->ModelParams.num_unique_azim_splines; i++ ) - { - free( hHrtf->ModelParams.azimBsShape_dyn_fx[i] ); - free( &hHrtf->ModelParams.azimBsShape_dyn_fx[i] ); - } - - free( (void *) hHrtf->ModelParams.azimBsShape_fx ); /* void* cast needed to please both gcc and Visual studio compilers. Deallocating const float** should be fine and gcc agrees, but Visual studio complains. */ - FOR( i = 0; i < hHrtf->ModelParams.elevDim3; i++ ) - { - free( hHrtf->ModelParams.azimKSeq_fx[i] ); - } - free( hHrtf->ModelParams.azimKSeq_fx ); - - free( hHrtf->ModelParams.EL_dyn_fx ); - free( hHrtf->ModelParams.ER_dyn_fx ); - free( hHrtf->ModelEval.hrfModL_fx ); - free( hHrtf->ModelEval.hrfModR_fx ); - - for ( i = 0; i < 3; i++ ) - { - free( hHrtf->lr_energy_and_iac_dyn_fx[i] ); - } - } -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB - else - { - for ( i = 0; i < 3; i++ ) - { - if ( ( *hHrtf )->lr_energy_and_iac_dyn_fx[i] ) - { - free( ( *hHrtf )->lr_energy_and_iac_dyn_fx[i] ); - } - } - } -#endif - - return error; -} -#endif /*---------------------------------------------------------------------* * create_HRTF_from_rawdata() @@ -1266,11 +1155,7 @@ static ivas_error create_HRTF_from_rawdata( { if ( ( ( *hHRTF ) = (HRTFS_HANDLE) malloc( sizeof( HRTFS_DATA ) ) ) == NULL ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HRTF binary data\n" ); -#else - return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Can not allocate memory for HRTF binary data\n" ); -#endif } if ( ( error = ivas_hrtf_init( *hHRTF ) ) != IVAS_ERR_OK ) @@ -1283,9 +1168,7 @@ static ivas_error create_HRTF_from_rawdata( return IVAS_ERR_INTERNAL; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING ( *hHRTF )->init_from_rom = 0; -#endif hrtf_data_rptr = hrtf_data; /* latency_s */ @@ -1573,7 +1456,7 @@ static ivas_error create_fastconv_HRTF_from_rawdata( hrtf_data_rptr = hrtf_data; -#if !defined NONBE_FIX_BINARY_BINAURAL_READING || !defined USE_NEW_HRTF_BINARY_FILE_FORMAT +#if !defined USE_NEW_HRTF_BINARY_FILE_FORMAT /* BINAURAL_CONVBANDS */ if ( BINAURAL_CONVBANDS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { @@ -1592,7 +1475,7 @@ static ivas_error create_fastconv_HRTF_from_rawdata( f_tmp = *( (float *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( float ); ( *hHRTF )->FASTCONV_HRIR_latency_s_fx = (Word32) ( f_tmp * 1000000000 ); -#if defined NONBE_FIX_BINARY_BINAURAL_READING && defined USE_NEW_HRTF_BINARY_FILE_FORMAT +#if defined USE_NEW_HRTF_BINARY_FILE_FORMAT if ( BINAURAL_CONVBANDS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_CONVBANDS)" ); @@ -1660,7 +1543,7 @@ static ivas_error create_fastconv_HRTF_from_rawdata( ( *hHRTF )->FASTCONV_HOA3_latency_s_fx = (Word32) ( f_tmp * 1000000000 ); hrtf_data_rptr += sizeof( float ); -#if defined NONBE_FIX_BINARY_BINAURAL_READING && defined USE_NEW_HRTF_BINARY_FILE_FORMAT +#if defined USE_NEW_HRTF_BINARY_FILE_FORMAT if ( BINAURAL_CONVBANDS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_CONVBANDS)" ); @@ -1727,7 +1610,7 @@ static ivas_error create_fastconv_HRTF_from_rawdata( ( *hHRTF )->FASTCONV_HOA2_latency_s_fx = (Word32) ( f_tmp * 1000000000 ); hrtf_data_rptr += sizeof( float ); -#if defined NONBE_FIX_BINARY_BINAURAL_READING && defined USE_NEW_HRTF_BINARY_FILE_FORMAT +#if defined USE_NEW_HRTF_BINARY_FILE_FORMAT if ( BINAURAL_CONVBANDS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_CONVBANDS)" ); @@ -1795,7 +1678,7 @@ static ivas_error create_fastconv_HRTF_from_rawdata( ( *hHRTF )->FASTCONV_FOA_latency_s_fx = (Word32) ( f_tmp * 1000000000 ); hrtf_data_rptr += sizeof( float ); -#if defined NONBE_FIX_BINARY_BINAURAL_READING && defined USE_NEW_HRTF_BINARY_FILE_FORMAT +#if defined USE_NEW_HRTF_BINARY_FILE_FORMAT if ( BINAURAL_CONVBANDS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_CONVBANDS)" ); @@ -1863,7 +1746,7 @@ static ivas_error create_fastconv_HRTF_from_rawdata( ( *hHRTF )->FASTCONV_BRIR_latency_s_fx = (Word32) ( f_tmp * 1000000000 ); hrtf_data_rptr += sizeof( float ); -#if defined NONBE_FIX_BINARY_BINAURAL_READING && defined USE_NEW_HRTF_BINARY_FILE_FORMAT +#if defined USE_NEW_HRTF_BINARY_FILE_FORMAT if ( BINAURAL_CONVBANDS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_CONVBANDS)" ); @@ -1969,9 +1852,7 @@ ivas_error load_fastconv_HRTF_from_binary( ivas_error header_check_result; ivas_hrtfs_file_header_t hrtfs_file_header; int16_t hrtf_id; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING int16_t asFastconv = 0; -#endif f_hrtf = hrtfReader->file; @@ -2021,9 +1902,7 @@ ivas_error load_fastconv_HRTF_from_binary( free( hrtf_data ); return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Could not create HRTF from binary file" ); } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING asFastconv = 1; -#endif } else { @@ -2032,7 +1911,6 @@ ivas_error load_fastconv_HRTF_from_binary( } free( hrtf_data ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( asFastconv ) { return IVAS_ERR_OK; @@ -2041,9 +1919,6 @@ ivas_error load_fastconv_HRTF_from_binary( { return IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA; } -#else - return IVAS_ERR_OK; -#endif } @@ -2147,9 +2022,7 @@ ivas_error load_parambin_HRTF_from_binary( ivas_error header_check_result; ivas_hrtfs_file_header_t hrtfs_file_header; int16_t hrtf_id; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING int16_t asParam = 0; -#endif f_hrtf = hrtfReader->file; @@ -2203,9 +2076,7 @@ ivas_error load_parambin_HRTF_from_binary( free( hrtf_data ); return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Could not create HRTF from binary file" ); } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING asParam = 1; -#endif } else { @@ -2213,7 +2084,6 @@ ivas_error load_parambin_HRTF_from_binary( } } free( hrtf_data ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( asParam ) { return IVAS_ERR_OK; @@ -2222,9 +2092,6 @@ ivas_error load_parambin_HRTF_from_binary( { return IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA; } -#else - return IVAS_ERR_OK; -#endif } @@ -2338,15 +2205,6 @@ ivas_error create_SetOfHRTF_from_binary( } free( hrtf_data ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - if ( ( ( *hSetOfHRTF ).hHRTF_hrir_combined == NULL ) || ( ( *hSetOfHRTF ).hHRTF_brir_combined == NULL ) || ( ( *hSetOfHRTF ).hHRTF_hrir_foa == NULL ) || ( ( *hSetOfHRTF ).hHRTF_hrir_hoa2 == NULL ) || ( ( *hSetOfHRTF ).hHRTF_hrir_hoa3 == NULL ) ) - { - if ( destroy_SetOfHRTF( hSetOfHRTF ) != IVAS_ERR_OK ) - { - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Could not create all the HRTF from binary file" ); - } - } -#endif return IVAS_ERR_OK; } @@ -2356,24 +2214,16 @@ ivas_error create_SetOfHRTF_from_binary( * Destroy the HRTF CRend handle *---------------------------------------------------------------------*/ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING static void destroy_HRTF -#else -static ivas_error destroy_HRTF -#endif ( HRTFS_HANDLE *hHRTF /* i/o: HRTF CRend handle */ ) { uint16_t i, j; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING test(); test(); IF( *hHRTF != NULL && hHRTF != NULL && ( *hHRTF )->init_from_rom == 0 ) -#else - IF( *hHRTF != NULL && hHRTF != NULL ) -#endif { FOR( i = 0; i < MAX_INTERN_CHANNELS; i++ ) { @@ -2413,11 +2263,7 @@ static ivas_error destroy_HRTF *hHRTF = NULL; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING return; -#else - return IVAS_ERR_OK; -#endif } #ifdef FIX_OLD_BINARY_FORMAT @@ -2449,7 +2295,6 @@ void cleanup_SetOfHRTF( * * Destroy the HRTF data set. *---------------------------------------------------------------------*/ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING void destroy_SetOfHRTF( HRTFS_CREND_HANDLE *hSetOfHRTF /* i/o: Set of HRTF CRend handle */ ) @@ -2504,20 +2349,3 @@ void destroy_parambin_hrtf( return; } -#else -ivas_error destroy_SetOfHRTF( - HRTFS_CREND_HANDLE hSetOfHRTF /* i/o: Set of HRTF CRend handle */ -) -{ - if ( hSetOfHRTF != NULL ) - { - destroy_HRTF( &( hSetOfHRTF->hHRTF_hrir_combined ) ); - destroy_HRTF( &( hSetOfHRTF->hHRTF_hrir_hoa3 ) ); - destroy_HRTF( &( hSetOfHRTF->hHRTF_hrir_hoa2 ) ); - destroy_HRTF( &( hSetOfHRTF->hHRTF_hrir_foa ) ); - destroy_HRTF( &( hSetOfHRTF->hHRTF_brir_combined ) ); - } - - return IVAS_ERR_OK; -} -#endif diff --git a/lib_util/hrtf_file_reader.h b/lib_util/hrtf_file_reader.h index d1abd9b75..9a06a4e3b 100644 --- a/lib_util/hrtf_file_reader.h +++ b/lib_util/hrtf_file_reader.h @@ -138,15 +138,9 @@ void cleanup_SetOfHRTF( *---------------------------------------------------------------------*/ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING void destroy_SetOfHRTF( IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF /* i/o: Set of HRTF CRend handle */ ); -#else -ivas_error destroy_SetOfHRTF( - IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF /* i/o: Set of HRTF CRend handle */ -); -#endif /*---------------------------------------------------------------------* * load_fastconv_HRTF_from_binary() @@ -159,7 +153,6 @@ ivas_error load_fastconv_HRTF_from_binary( const hrtfFileReader *hrtfReader /* i : pointer to hrtfFileReader handle */ ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING /*---------------------------------------------------------------------* * destroy_fastconv_hrtf() * @@ -169,7 +162,6 @@ ivas_error load_fastconv_HRTF_from_binary( void destroy_fastconv_hrtf( IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv /* i/o: FastConv HRTF handle */ ); -#endif /*---------------------------------------------------------------------* * load_parambin_HRTF_from_binary() @@ -188,7 +180,6 @@ ivas_error load_parambin_HRTF_from_binary( * * Deallocated memory allocated by load_HRTF_binary *---------------------------------------------------------------------*/ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING /*---------------------------------------------------------------------* * destroy_parambin_hrtf() * @@ -209,9 +200,4 @@ void destroy_td_hrtf( IVAS_DEC_HRTF_HANDLE *hHRTF /* i/o: HRTF handle */ ); -#else -ivas_error dealloc_HRTF_binary( - IVAS_DEC_HRTF_HANDLE hHrtf /* i/o: HRTF handle */ -); -#endif #endif /* IVAS_HRTF_FILE_READER_H */ -- GitLab From 66e7be5f895ff35a1aa115a4cea7428f1b921754 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 19 May 2025 13:32:16 +0200 Subject: [PATCH 05/10] [cleanup] accept NONBE_FIX_935_EARLY_REFLECTIONS_WRONG_ORDER --- lib_com/options.h | 1 - lib_rend/ivas_reflections_fx.c | 8 -------- 2 files changed, 9 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index f19e13466..ee3052ee1 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -95,7 +95,6 @@ #define NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM /* FhG: issue 1058: do not initialize EFAP when IntSetup is HOA3 */ #define FIX_963_USAN_ERROR /* Eri: Issue 963: USAN error in Stereo CNG, division by zero */ #define NONBE_FIX_952_MC_PARAMUPMIX_5MS /* Dlb : issue 952 : Differences between 5ms and 20ms rendering for ParamUpmix*/ -#define NONBE_FIX_935_EARLY_REFLECTIONS_WRONG_ORDER /* Qualcomm: issue 953: fix order or ER channels in LC mode*/ #define NONBE_FIX_967_ISM_MONO_DMX /* FhG: issue 967: accumulating energies in ISM mono DMX */ #define NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX /* FhG : issue #968: differences between 5ms and 20ms rendering for discrete ISM with BRIR and head rotation*/ diff --git a/lib_rend/ivas_reflections_fx.c b/lib_rend/ivas_reflections_fx.c index 9344a5872..fb3e86585 100644 --- a/lib_rend/ivas_reflections_fx.c +++ b/lib_rend/ivas_reflections_fx.c @@ -56,17 +56,9 @@ static UWord16 LC_mixing_7_1[7] = { 0, 1, 2, 3, 4, 3, 4 }; static UWord16 LC_mixing_5_1_2[7] = { 0, 1, 2, 3, 4, 0, 1 }; -#ifdef NONBE_FIX_935_EARLY_REFLECTIONS_WRONG_ORDER static UWord16 LC_mixing_5_1_4[9] = { 0, 1, 2, 3, 4, 0, 1, 3, 4 }; -#else -static UWord16 LC_mixing_5_1_4[9] = { 0, 1, 2, 3, 4, 0, 1, 2, 3 }; -#endif -#ifdef NONBE_FIX_935_EARLY_REFLECTIONS_WRONG_ORDER static UWord16 LC_mixing_7_1_4[11] = { 0, 1, 2, 3, 4, 3, 4, 0, 1, 3, 4 }; -#else -static UWord16 LC_mixing_7_1_4[11] = { 0, 1, 2, 3, 4, 3, 4, 0, 1, 2, 3 }; -#endif /*-----------------------------------------------------------------------------------------* -- GitLab From 6bc30f24638970b35f9b57898c4d8d1259e063aa Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 19 May 2025 13:32:19 +0200 Subject: [PATCH 06/10] [cleanup] accept NONBE_FIX_935_SBA_REVERB --- lib_com/options.h | 1 - lib_dec/ivas_output_config_fx.c | 8 -------- lib_dec/ivas_sba_dec_fx.c | 8 -------- lib_dec/ivas_spar_decoder_fx.c | 6 ------ 4 files changed, 23 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index ee3052ee1..133713018 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -98,7 +98,6 @@ #define NONBE_FIX_967_ISM_MONO_DMX /* FhG: issue 967: accumulating energies in ISM mono DMX */ #define NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX /* FhG : issue #968: differences between 5ms and 20ms rendering for discrete ISM with BRIR and head rotation*/ -#define NONBE_FIX_935_SBA_REVERB /* FhG: issue 935: fix MSAN error for SBA related to BINAURAL_ROOM_REVERB */ #define NONBE_FIX_973_HODIRAC_BAND_GROUPING /* FhG: issue 973: empty parameter band in DirAC */ //#define USE_NEW_HRTF_BINARY_FILE_FORMAT /* Orange: to activate when decided to change the hrtf binary file format */ diff --git a/lib_dec/ivas_output_config_fx.c b/lib_dec/ivas_output_config_fx.c index 8afd003be..bd30680da 100644 --- a/lib_dec/ivas_output_config_fx.c +++ b/lib_dec/ivas_output_config_fx.c @@ -158,19 +158,11 @@ void ivas_renderer_select( move16(); test(); -#ifdef NONBE_FIX_935_SBA_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) #else IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) ) #endif -#else -#ifdef SPLIT_REND_WITH_HEAD_ROT - IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) -#else - IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) -#endif -#endif /* NONBE_FIX_935_SBA_REVERB */ { *renderer_type = RENDERER_BINAURAL_FASTCONV; move16(); diff --git a/lib_dec/ivas_sba_dec_fx.c b/lib_dec/ivas_sba_dec_fx.c index cc78652e6..24abcb667 100644 --- a/lib_dec/ivas_sba_dec_fx.c +++ b/lib_dec/ivas_sba_dec_fx.c @@ -216,19 +216,11 @@ ivas_error ivas_sba_dec_reconfigure_fx( ELSE { test(); -#ifdef NONBE_FIX_935_SBA_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) #else IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL ) ) #endif -#else -#ifdef SPLIT_REND_WITH_HEAD_ROT - IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) -#else - IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) -#endif -#endif /* NONBE_FIX_935_SBA_REVERB */ { renderer_type_new = RENDERER_BINAURAL_FASTCONV; move16(); diff --git a/lib_dec/ivas_spar_decoder_fx.c b/lib_dec/ivas_spar_decoder_fx.c index b95a93678..2c425ad72 100644 --- a/lib_dec/ivas_spar_decoder_fx.c +++ b/lib_dec/ivas_spar_decoder_fx.c @@ -294,14 +294,8 @@ ivas_error ivas_spar_dec_open_fx( test(); test(); -#ifdef NONBE_FIX_935_SBA_REVERB IF( EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) && EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL ) && EQ_32( st_ivas->ism_mode, ISM_SBA_MODE_DISC ) ) -#else - test(); - - IF( EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) && ( EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) && EQ_32( st_ivas->ism_mode, ISM_SBA_MODE_DISC ) ) -#endif { /* get correct granularity in case of binaural rendering of the discrete objects with the td obj renderer */ Word32 quo, rem; -- GitLab From 0a4741371d4a5b204ed2d5bbcea673ee306cc028 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 19 May 2025 13:32:22 +0200 Subject: [PATCH 07/10] [cleanup] accept NONBE_FIX_952_MC_PARAMUPMIX_5MS --- lib_com/options.h | 1 - lib_dec/ivas_mc_paramupmix_dec_fx.c | 20 -------------------- 2 files changed, 21 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 133713018..3ec7754da 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -94,7 +94,6 @@ #endif #define NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM /* FhG: issue 1058: do not initialize EFAP when IntSetup is HOA3 */ #define FIX_963_USAN_ERROR /* Eri: Issue 963: USAN error in Stereo CNG, division by zero */ -#define NONBE_FIX_952_MC_PARAMUPMIX_5MS /* Dlb : issue 952 : Differences between 5ms and 20ms rendering for ParamUpmix*/ #define NONBE_FIX_967_ISM_MONO_DMX /* FhG: issue 967: accumulating energies in ISM mono DMX */ #define NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX /* FhG : issue #968: differences between 5ms and 20ms rendering for discrete ISM with BRIR and head rotation*/ diff --git a/lib_dec/ivas_mc_paramupmix_dec_fx.c b/lib_dec/ivas_mc_paramupmix_dec_fx.c index 0cb6a5796..d05912e6e 100644 --- a/lib_dec/ivas_mc_paramupmix_dec_fx.c +++ b/lib_dec/ivas_mc_paramupmix_dec_fx.c @@ -119,13 +119,11 @@ void ivas_mc_paramupmix_dec_read_BS( } } -#ifdef NONBE_FIX_952_MC_PARAMUPMIX_5MS FOR( i = 0; i < MC_PARAMUPMIX_COMBINATIONS; i++ ) { Copy32( hMCParamUpmix->alpha_prev_fx[i], hMCParamUpmix->alpha_sf_fx[i], IVAS_MAX_NUM_BANDS ); Copy32( hMCParamUpmix->beta_prev_fx[i], hMCParamUpmix->beta_sf_fx[i], IVAS_MAX_NUM_BANDS ); } -#endif hMCParamUpmix->first_frame = 1; move16(); @@ -155,7 +153,6 @@ void ivas_mc_paramupmix_dec_read_BS( move32(); -#ifdef NONBE_FIX_952_MC_PARAMUPMIX_5MS IF( EQ_16( hMCParamUpmix->first_frame, 0 ) ) { FOR( i = 0; i < MC_PARAMUPMIX_COMBINATIONS; i++ ) @@ -164,7 +161,6 @@ void ivas_mc_paramupmix_dec_read_BS( Copy32( hMCParamUpmix->betas_fx[i], hMCParamUpmix->beta_prev_fx[i], IVAS_MAX_NUM_BANDS ); } } -#endif FOR( i = 0; i < MC_PARAMUPMIX_COMBINATIONS; i++ ) { @@ -189,13 +185,11 @@ void ivas_mc_paramupmix_dec_read_BS( move16(); } -#ifdef NONBE_FIX_952_MC_PARAMUPMIX_5MS FOR( i = 0; i < MC_PARAMUPMIX_COMBINATIONS; i++ ) { Copy32( hMCParamUpmix->alpha_prev_fx[i], hMCParamUpmix->alpha_sf_fx[i], IVAS_MAX_NUM_BANDS ); Copy32( hMCParamUpmix->beta_prev_fx[i], hMCParamUpmix->beta_sf_fx[i], IVAS_MAX_NUM_BANDS ); } -#endif } pop_wmops(); @@ -286,13 +280,6 @@ void ivas_mc_paramupmix_dec_render( } { -#ifndef NONBE_FIX_952_MC_PARAMUPMIX_5MS - FOR( ch = 0; ch < MC_PARAMUPMIX_COMBINATIONS; ch++ ) - { - Copy32( hMCParamUpmix->alpha_prev_fx[ch], hMCParamUpmix->alpha_sf_fx[ch], IVAS_MAX_NUM_BANDS ); - Copy32( hMCParamUpmix->beta_prev_fx[ch], hMCParamUpmix->beta_sf_fx[ch], IVAS_MAX_NUM_BANDS ); - } -#endif FOR( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ ) { @@ -310,13 +297,6 @@ void ivas_mc_paramupmix_dec_render( ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_sf ); } -#ifndef NONBE_FIX_952_MC_PARAMUPMIX_5MS - FOR( ch = 0; ch < MC_PARAMUPMIX_COMBINATIONS; ch++ ) - { - Copy32( hMCParamUpmix->alphas_fx[ch], hMCParamUpmix->alpha_prev_fx[ch], IVAS_MAX_NUM_BANDS ); - Copy32( hMCParamUpmix->betas_fx[ch], hMCParamUpmix->beta_prev_fx[ch], IVAS_MAX_NUM_BANDS ); - } -#endif } *nSamplesAvailable = imult1616( sub( st_ivas->hTcBuffer->num_slots, st_ivas->hTcBuffer->slots_rendered ), (Word16) slot_size ); -- GitLab From a3fa5fa44bbf894fb2d731cb8d25968accabcb4f Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 19 May 2025 13:32:25 +0200 Subject: [PATCH 08/10] [cleanup] accept NONBE_FIX_967_ISM_MONO_DMX --- lib_com/ivas_prot_fx.h | 4 ---- lib_com/options.h | 1 - lib_dec/ivas_jbm_dec_fx.c | 12 ------------ lib_dec/ivas_mono_dmx_renderer_fx.c | 18 ------------------ 4 files changed, 35 deletions(-) diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index 1d593881a..4edcf0480 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -1160,11 +1160,7 @@ void ivas_apply_non_diegetic_panning_fx( const Word16 output_frame /* i : output frame length per channel */ ); -#ifdef NONBE_FIX_967_ISM_MONO_DMX void ivas_ism_mono_dmx_fx( -#else -void ivas_mono_downmix_render_passive_fx( -#endif Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ Word32 *output_f_fx[], /* i/o: synthesized core-coder transport channels/mono output */ const Word16 output_frame /* i : output frame length */ diff --git a/lib_com/options.h b/lib_com/options.h index 3ec7754da..92da4f161 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -94,7 +94,6 @@ #endif #define NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM /* FhG: issue 1058: do not initialize EFAP when IntSetup is HOA3 */ #define FIX_963_USAN_ERROR /* Eri: Issue 963: USAN error in Stereo CNG, division by zero */ -#define NONBE_FIX_967_ISM_MONO_DMX /* FhG: issue 967: accumulating energies in ISM mono DMX */ #define NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX /* FhG : issue #968: differences between 5ms and 20ms rendering for discrete ISM with BRIR and head rotation*/ #define NONBE_FIX_973_HODIRAC_BAND_GROUPING /* FhG: issue 973: empty parameter band in DirAC */ diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index 8ae516d7c..9038dfb4b 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -265,11 +265,7 @@ ivas_error ivas_jbm_dec_tc_fx( test(); IF( EQ_32( st_ivas->renderer_type, RENDERER_MONO_DOWNMIX ) ) { -#ifdef NONBE_FIX_967_ISM_MONO_DMX ivas_ism_mono_dmx_fx( st_ivas, p_output_fx, output_frame ); -#else - ivas_mono_downmix_render_passive_fx( st_ivas, p_output_fx, output_frame ); -#endif Scale_sig32( p_output_fx[0], L_FRAME48k, 3 ); } @@ -798,11 +794,7 @@ ivas_error ivas_jbm_dec_tc_fx( move16(); IF( EQ_32( st_ivas->renderer_type, RENDERER_MONO_DOWNMIX ) ) { -#ifdef NONBE_FIX_967_ISM_MONO_DMX ivas_ism_mono_dmx_fx( st_ivas, p_output_fx, output_frame ); -#else - ivas_mono_downmix_render_passive_fx( st_ivas, p_output_fx, output_frame ); -#endif output_q = 8; move16(); @@ -1090,11 +1082,7 @@ ivas_error ivas_jbm_dec_tc_fx( } ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_MONO_DOWNMIX ) && EQ_32( st_ivas->ism_mode, ISM_SBA_MODE_DISC ) ) { -#ifdef NONBE_FIX_967_ISM_MONO_DMX ivas_ism_mono_dmx_fx( st_ivas, p_output_fx, output_frame ); -#else - ivas_mono_downmix_render_passive_fx( st_ivas, p_output_fx, output_frame ); -#endif Scale_sig32( p_output_fx[0], L_FRAME48k, Q11 - Q8 ); // Q11 diff --git a/lib_dec/ivas_mono_dmx_renderer_fx.c b/lib_dec/ivas_mono_dmx_renderer_fx.c index 1d24e0153..52940fc98 100644 --- a/lib_dec/ivas_mono_dmx_renderer_fx.c +++ b/lib_dec/ivas_mono_dmx_renderer_fx.c @@ -46,12 +46,7 @@ * Local constants *------------------------------------------------------------------------*/ #define DOWNMIX_ALPHA_FX 31130 /* Smoothing coefficient alpha */ -#ifdef NONBE_FIX_967_ISM_MONO_DMX #define DOWNMIX_ONE_MINUS_ALPHA_FX 1638 /* Smoothing coefficient (1 - alpha) */ -#endif -#ifndef NONBE_FIX_967_ISM_MONO_DMX -#define MONO_DOWNMIX_RENDERER_MAX_INPUT_CHANS 4 -#endif /*------------------------------------------------------------------------- * ivas_mono_dmx_renderer_open() @@ -111,11 +106,7 @@ void ivas_mono_dmx_renderer_close( * * Downmix process *------------------------------------------------------------------------*/ -#ifdef NONBE_FIX_967_ISM_MONO_DMX void ivas_ism_mono_dmx_fx( -#else -void ivas_mono_downmix_render_passive_fx( -#endif Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ Word32 *output_f_fx[], /* i/o: synthesized core-coder transport channels/mono output Qin = 11/ Qout = 8*/ const Word16 output_frame /* i : output frame length */ @@ -170,13 +161,6 @@ void ivas_mono_downmix_render_passive_fx( v_add_32( output_shr, proto_signal_fx, proto_signal_fx, output_frame ); } -#ifndef NONBE_FIX_967_ISM_MONO_DMX - /* compute the input energy, proto energy after smoothing */ - hDownmix->inputEnergy_fx = Mpy_32_16_1( hDownmix->inputEnergy_fx, DOWNMIX_ALPHA_FX ); - move32(); - hDownmix->protoEnergy_fx = Mpy_32_16_1( hDownmix->protoEnergy_fx, DOWNMIX_ALPHA_FX ); - move32(); -#endif proto_norm = L_norm_arr( proto_signal_fx, output_frame ); @@ -197,7 +181,6 @@ void ivas_mono_downmix_render_passive_fx( } } -#ifdef NONBE_FIX_967_ISM_MONO_DMX hDownmix->inputEnergy_fx = Mpy_32_16_1( hDownmix->inputEnergy_fx, DOWNMIX_ALPHA_FX ); move32(); hDownmix->protoEnergy_fx = Mpy_32_16_1( hDownmix->protoEnergy_fx, DOWNMIX_ALPHA_FX ); @@ -205,7 +188,6 @@ void ivas_mono_downmix_render_passive_fx( protoEner_pre = Mpy_32_16_1( protoEner_pre, DOWNMIX_ONE_MINUS_ALPHA_FX ); inputEner_pre = Mpy_32_16_1( inputEner_pre, DOWNMIX_ONE_MINUS_ALPHA_FX ); -#endif /* compute the eq factor */ -- GitLab From 99cb359a6df468e553a012f76fe736a2b030dcb7 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 19 May 2025 13:32:28 +0200 Subject: [PATCH 09/10] [cleanup] accept NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX --- lib_com/options.h | 1 - lib_dec/ivas_ism_renderer_fx.c | 30 ------------------------------ 2 files changed, 31 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 92da4f161..53cac6f84 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -95,7 +95,6 @@ #define NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM /* FhG: issue 1058: do not initialize EFAP when IntSetup is HOA3 */ #define FIX_963_USAN_ERROR /* Eri: Issue 963: USAN error in Stereo CNG, division by zero */ -#define NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX /* FhG : issue #968: differences between 5ms and 20ms rendering for discrete ISM with BRIR and head rotation*/ #define NONBE_FIX_973_HODIRAC_BAND_GROUPING /* FhG: issue 973: empty parameter band in DirAC */ //#define USE_NEW_HRTF_BINARY_FILE_FORMAT /* Orange: to activate when decided to change the hrtf binary file format */ diff --git a/lib_dec/ivas_ism_renderer_fx.c b/lib_dec/ivas_ism_renderer_fx.c index 7f4f32731..7fcb10635 100644 --- a/lib_dec/ivas_ism_renderer_fx.c +++ b/lib_dec/ivas_ism_renderer_fx.c @@ -171,7 +171,6 @@ void ivas_ism_render_sf_fx( Word32 gain_fx, prev_gain_fx; Word32 tc_local_fx[MAX_NUM_OBJECTS][L_FRAME48k]; Word32 *p_tc_fx[MAX_NUM_OBJECTS]; -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX Word16 ism_md_subframe_update_jbm, slots_to_render, first_sf, last_sf, subframe_idx; Word16 n_samples_rendered_loop; @@ -189,7 +188,6 @@ void ivas_ism_render_sf_fx( slots_to_render = sub( slots_to_render, st_ivas->hTcBuffer->subframe_nbslots[last_sf] ); last_sf = add( last_sf, 1 ); } -#endif num_objects = st_ivas->nchan_transport; move16(); @@ -207,7 +205,6 @@ void ivas_ism_render_sf_fx( interp_offset = st_ivas->hTcBuffer->n_samples_rendered; move16(); -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX /* Number of subframes to delay metadata to sync with audio */ IF( st_ivas->hDecoderConfig->Opt_delay_comp ) { @@ -217,7 +214,6 @@ void ivas_ism_render_sf_fx( { ism_md_subframe_update_jbm = sub( st_ivas->hTcBuffer->nb_subframes, 2 ); } -#endif IF( st_ivas->hDecoderConfig->Opt_tsm ) { @@ -241,21 +237,15 @@ void ivas_ism_render_sf_fx( } -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX FOR( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ ) { int16_t n_samples_in_subframe; n_samples_in_subframe = st_ivas->hTcBuffer->n_samples_granularity * st_ivas->hTcBuffer->subframe_nbslots[subframe_idx]; -#endif test(); IF( st_ivas->hCombinedOrientationData && EQ_16( st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx], 1 ) ) { -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX ivas_jbm_dec_get_adapted_linear_interpolator_fx( n_samples_in_subframe, n_samples_in_subframe, st_ivas->hIsmRendererData->interpolator_fx ); -#else - ivas_jbm_dec_get_adapted_linear_interpolator_fx( n_samples_to_render, n_samples_to_render, st_ivas->hIsmRendererData->interpolator_fx ); -#endif interp_offset = 0; move16(); } @@ -266,7 +256,6 @@ void ivas_ism_render_sf_fx( test(); IF( st_ivas->hCombinedOrientationData != NULL && EQ_16( st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx], 1 ) ) { -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX if ( GE_16( subframe_idx, ism_md_subframe_update_jbm ) ) { rotateAziEle_fx( extract_l( L_shr( st_ivas->hIsmMetaData[i]->azimuth_fx, 22 ) ), extract_l( L_shr( st_ivas->hIsmMetaData[i]->elevation_fx, 22 ) ), &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat_fx[st_ivas->hCombinedOrientationData->subframe_idx], st_ivas->hIntSetup.is_planar_setup ); @@ -275,9 +264,6 @@ void ivas_ism_render_sf_fx( { rotateAziEle_fx( extract_l( L_shr( st_ivas->hIsmMetaData[i]->last_azimuth_fx, 22 ) ), extract_l( L_shr( st_ivas->hIsmMetaData[i]->last_elevation_fx, 22 ) ), &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat_fx[st_ivas->hCombinedOrientationData->subframe_idx], st_ivas->hIntSetup.is_planar_setup ); } -#else - rotateAziEle_fx( extract_l( L_shr( st_ivas->hIsmMetaData[i]->azimuth_fx, 22 ) ), extract_l( L_shr( st_ivas->hIsmMetaData[i]->elevation_fx, 22 ) ), &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat_fx[0], st_ivas->hIntSetup.is_planar_setup ); -#endif IF( st_ivas->hEFAPdata != NULL ) { @@ -313,18 +299,10 @@ void ivas_ism_render_sf_fx( { g1_fx = &st_ivas->hIsmRendererData->interpolator_fx[interp_offset]; tc_fx = p_tc_fx[i]; -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX FOR( k = 0; k < n_samples_in_subframe; k++ ) -#else - FOR( k = 0; k < n_samples_to_render; k++ ) -#endif { g2_fx = sub( 32767, *g1_fx ); // 32767 = (1.0f in Q15) - 1 -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX output_fx[j2][k + n_samples_rendered_loop] = L_add( output_fx[j2][k + n_samples_rendered_loop], L_shl( Mpy_32_32( L_add( Mpy_32_16_1( gain_fx, *( g1_fx++ ) ), Mpy_32_16_1( prev_gain_fx, g2_fx ) ), *( tc_fx++ ) ), 1 ) ); // Q11( (30+15+1-16) + 11 -31 +1) -#else - output_fx[j2][k] = L_add( output_fx[j2][k], L_shl( Mpy_32_32( L_add( Mpy_32_16_1( gain_fx, *( g1_fx++ ) ), Mpy_32_16_1( prev_gain_fx, g2_fx ) ), *( tc_fx++ ) ), 1 ) ); // Q11( (30+15+1-16) + 11 -31 +1) -#endif move16(); } } @@ -337,19 +315,12 @@ void ivas_ism_render_sf_fx( move32(); } } -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX p_tc_fx[i] += n_samples_in_subframe; -#endif } /* update combined orientation access index */ -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_in_subframe ); -#else - ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_to_render ); -#endif -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX n_samples_rendered_loop = add( n_samples_rendered_loop, n_samples_in_subframe ); IF( EQ_16( st_ivas->renderer_type, RENDERER_TD_PANNING ) ) { @@ -359,7 +330,6 @@ void ivas_ism_render_sf_fx( tc_offset = add( tc_offset, n_samples_in_subframe ); interp_offset = add( interp_offset, n_samples_in_subframe ); } -#endif return; } -- GitLab From 8eff3c5b4fe85d4340212e7ee19ccc8d98f6dd18 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 19 May 2025 13:34:54 +0200 Subject: [PATCH 10/10] formatting --- lib_dec/ivas_ism_renderer_fx.c | 2 +- lib_dec/ivas_mc_paramupmix_dec_fx.c | 1 - lib_dec/ivas_mono_dmx_renderer_fx.c | 4 ++-- lib_dec/lib_dec_fx.c | 8 ++++---- lib_rend/ivas_stat_rend.h | 6 +++--- lib_rend/lib_rend.c | 26 +++++++++----------------- lib_util/hrtf_file_reader.c | 7 +++---- 7 files changed, 22 insertions(+), 32 deletions(-) diff --git a/lib_dec/ivas_ism_renderer_fx.c b/lib_dec/ivas_ism_renderer_fx.c index 7fcb10635..1a3fc4164 100644 --- a/lib_dec/ivas_ism_renderer_fx.c +++ b/lib_dec/ivas_ism_renderer_fx.c @@ -301,7 +301,7 @@ void ivas_ism_render_sf_fx( tc_fx = p_tc_fx[i]; FOR( k = 0; k < n_samples_in_subframe; k++ ) { - g2_fx = sub( 32767, *g1_fx ); // 32767 = (1.0f in Q15) - 1 + g2_fx = sub( 32767, *g1_fx ); // 32767 = (1.0f in Q15) - 1 output_fx[j2][k + n_samples_rendered_loop] = L_add( output_fx[j2][k + n_samples_rendered_loop], L_shl( Mpy_32_32( L_add( Mpy_32_16_1( gain_fx, *( g1_fx++ ) ), Mpy_32_16_1( prev_gain_fx, g2_fx ) ), *( tc_fx++ ) ), 1 ) ); // Q11( (30+15+1-16) + 11 -31 +1) move16(); } diff --git a/lib_dec/ivas_mc_paramupmix_dec_fx.c b/lib_dec/ivas_mc_paramupmix_dec_fx.c index d05912e6e..eab782f8b 100644 --- a/lib_dec/ivas_mc_paramupmix_dec_fx.c +++ b/lib_dec/ivas_mc_paramupmix_dec_fx.c @@ -296,7 +296,6 @@ void ivas_mc_paramupmix_dec_render( /* update combined orientation access index */ ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_sf ); } - } *nSamplesAvailable = imult1616( sub( st_ivas->hTcBuffer->num_slots, st_ivas->hTcBuffer->slots_rendered ), (Word16) slot_size ); diff --git a/lib_dec/ivas_mono_dmx_renderer_fx.c b/lib_dec/ivas_mono_dmx_renderer_fx.c index 52940fc98..66b14cc56 100644 --- a/lib_dec/ivas_mono_dmx_renderer_fx.c +++ b/lib_dec/ivas_mono_dmx_renderer_fx.c @@ -45,8 +45,8 @@ /*------------------------------------------------------------------------- * Local constants *------------------------------------------------------------------------*/ -#define DOWNMIX_ALPHA_FX 31130 /* Smoothing coefficient alpha */ -#define DOWNMIX_ONE_MINUS_ALPHA_FX 1638 /* Smoothing coefficient (1 - alpha) */ +#define DOWNMIX_ALPHA_FX 31130 /* Smoothing coefficient alpha */ +#define DOWNMIX_ONE_MINUS_ALPHA_FX 1638 /* Smoothing coefficient (1 - alpha) */ /*------------------------------------------------------------------------- * ivas_mono_dmx_renderer_open() diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index 7ead34cca..63f0ab53f 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -2511,7 +2511,7 @@ ivas_error IVAS_DEC_FeedCustomLsData( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_GetHrtfHandle( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IVAS_DEC_HRTF_HANDLE **hHrtfTD /* o : HRTF handle */ ) { @@ -2535,7 +2535,7 @@ ivas_error IVAS_DEC_GetHrtfHandle( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_GetHrtfCRendHandle( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IVAS_DEC_HRTF_CREND_HANDLE **hSetOfHRTF /* o : Set of HRTF handle */ ) { @@ -2559,7 +2559,7 @@ ivas_error IVAS_DEC_GetHrtfCRendHandle( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_GetHrtfFastConvHandle( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IVAS_DEC_HRTF_FASTCONV_HANDLE **hHrtfFastConv /* o : FASTCONV HRTF handle */ ) { @@ -2583,7 +2583,7 @@ ivas_error IVAS_DEC_GetHrtfFastConvHandle( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_GetHrtfParamBinHandle( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IVAS_DEC_HRTF_PARAMBIN_HANDLE **hHrtfParambin /* o : Parametric binauralizer HRTF handle */ ) { diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 69351bae8..cc1565943 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -847,7 +847,7 @@ typedef struct ivas_combined_orientation_struct #ifdef SPLIT_REND_WITH_HEAD_ROT Word32 Rmat_prev_fx[MAX_HEAD_ROT_POSES][3][3]; #else - Word32 Rmat_prev_fx[3][3]; /* Q30 */ + Word32 Rmat_prev_fx[3][3]; /* Q30 */ #endif Word32 chEneIIR_fx[2][MASA_FREQUENCY_BANDS]; /* independent of the format. MASA bands are suitable for the task and readily available in ROM. */ /* Q(q_chEneIIR) */ Word16 q_chEneIIR; @@ -1294,8 +1294,8 @@ typedef struct ivas_binaural_td_rendering_struct TDREND_SRC_t *Sources[MAX_NUM_TDREND_CHANNELS]; Word16 Gain_fx; /* Q14 */ - TDREND_MIX_Listener_t *Listener_p; /* The virtual listener */ - TDREND_HRFILT_FiltSet_t *HrFiltSet_p; /* HR filter set */ + TDREND_MIX_Listener_t *Listener_p; /* The virtual listener */ + TDREND_HRFILT_FiltSet_t *HrFiltSet_p; /* HR filter set */ TDREND_HRFILT_FiltSet_t **pHrFiltSet_p; /* pointer to HR filter set */ Word16 UseCommonDistAttenModel; /* Use common dist atten model (TRUE/FALSE) */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 7c64d0e26..12fb2c524 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -56,7 +56,7 @@ *-------------------------------------------------------------------*/ /* Maximum buffer length (total) in samples. */ -#define MAX_BUFFER_LENGTH ( MAX_BUFFER_LENGTH_PER_CHANNEL * MAX_INPUT_CHANNELS ) +#define MAX_BUFFER_LENGTH ( MAX_BUFFER_LENGTH_PER_CHANNEL * MAX_INPUT_CHANNELS ) #define MAX_BIN_DELAY_SAMPLES 150 /* Maximum supported rendering latency for binaural IRs */ /*-------------------------------------------------------------------* @@ -1447,10 +1447,8 @@ static ivas_error setRendInputActiveIsm( void *input, const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, - RENDER_CONFIG_DATA *hRendCfg - , - hrtf_handles *hrtfs -) + RENDER_CONFIG_DATA *hRendCfg, + hrtf_handles *hrtfs ) { ivas_error error; rendering_context rendCtx; @@ -2820,10 +2818,8 @@ static ivas_error setRendInputActiveMc( void *input, const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, - RENDER_CONFIG_DATA *hRendCfg - , - hrtf_handles *hrtfs -) + RENDER_CONFIG_DATA *hRendCfg, + hrtf_handles *hrtfs ) { #ifdef SPLIT_REND_WITH_HEAD_ROT Word16 i; @@ -3198,8 +3194,7 @@ static ivas_error setRendInputActiveSba( void *input, const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, - RENDER_CONFIG_DATA *hRendCfg - , + RENDER_CONFIG_DATA *hRendCfg, hrtf_handles *hrtfs ) @@ -3301,8 +3296,7 @@ static ivas_error setRendInputActiveMasa( void *input, const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, - RENDER_CONFIG_DATA *hRendCfg - , + RENDER_CONFIG_DATA *hRendCfg, hrtf_handles *hrtfs ) /* Todo: This is not used at all within MASA. Support might be better to do after refactoring. */ @@ -10202,10 +10196,8 @@ static ivas_error ivas_masa_ext_rend_parambin_init( static ivas_error initMasaExtRenderer( input_masa *inputMasa, - const AUDIO_CONFIG outConfig - , - hrtf_handles *hrtfs -) + const AUDIO_CONFIG outConfig, + hrtf_handles *hrtfs ) { Word16 i; ivas_error error; diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index c99e19183..ee103db2d 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -2214,10 +2214,9 @@ ivas_error create_SetOfHRTF_from_binary( * Destroy the HRTF CRend handle *---------------------------------------------------------------------*/ -static void destroy_HRTF - ( - HRTFS_HANDLE *hHRTF /* i/o: HRTF CRend handle */ - ) +static void destroy_HRTF( + HRTFS_HANDLE *hHRTF /* i/o: HRTF CRend handle */ +) { uint16_t i, j; -- GitLab