From 35ea3745f30c2b7c13732523c605179298e2b0bf Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 19 May 2025 13:30:07 +0200 Subject: [PATCH 01/10] [cleanup] accept FIX_955_FASTCONV_REND_IN_ISM --- lib_com/options.h | 1 - lib_dec/ivas_jbm_dec.c | 8 -------- 2 files changed, 9 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index d27993a6f..7885e1f9b 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -197,7 +197,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 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.c b/lib_dec/ivas_jbm_dec.c index 859a524df..8724bead2 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1073,7 +1073,6 @@ ivas_error ivas_jbm_dec_render( ivas_apply_non_diegetic_panning( p_output, st_ivas->hDecoderConfig->non_diegetic_pan_gain, *nSamplesRendered ); } -#ifdef FIX_955_FASTCONV_REND_IN_ISM #ifdef DEBUGGING else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ) #else @@ -1083,13 +1082,6 @@ ivas_error ivas_jbm_dec_render( /* Convert to Ambisonics */ ivas_ism2sba_sf( st_ivas->hTcBuffer->tc, p_output, st_ivas->hIsmRendererData, st_ivas->nchan_transport, *nSamplesRendered, st_ivas->hTcBuffer->n_samples_rendered, st_ivas->hIntSetup.ambisonics_order ); } -#else - else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ) - { - /* Convert to Ambisonics; used also for ISM->HOA3->binaural rendering */ - ivas_ism2sba_sf( st_ivas->hTcBuffer->tc, p_output, st_ivas->hIsmRendererData, st_ivas->nchan_transport, *nSamplesRendered, st_ivas->hTcBuffer->n_samples_rendered, st_ivas->hIntSetup.ambisonics_order ); - } -#endif /* Binaural rendering */ if ( st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD ) -- GitLab From 9c8fe047188a8feaed8af74dd0f5303cbea0e3ef Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 19 May 2025 13:30:09 +0200 Subject: [PATCH 02/10] [cleanup] accept FIX_969_USAN_IGF_ARITH --- lib_com/options.h | 1 - lib_dec/igf_scf_dec.c | 8 -------- 2 files changed, 9 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 7885e1f9b..4e50ad4e0 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -200,7 +200,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 FIX_969_USAN_IGF_ARITH /* FhG: issue 969: fix USAN error in igf_sce_dec; same issue as #962 */ #define FIX_959_MASA_LINEAR_REND /* VA: issue 959: remove unused calling of ivas_sba_linear_renderer() in MASA rendering */ #define NONBE_FIX_973_HODIRAC_BAND_GROUPING /* FhG: issue 973: empty parameter band in DirAC */ #define FIX_971_LOG2_IDX_GAIN_0 /* VA: prevent -Inf due to log2(ratio==0) */ diff --git a/lib_dec/igf_scf_dec.c b/lib_dec/igf_scf_dec.c index c0e7584a2..45e866086 100644 --- a/lib_dec/igf_scf_dec.c +++ b/lib_dec/igf_scf_dec.c @@ -211,12 +211,8 @@ static void decode_sfe_vector( | c b | e --> t */ -#ifdef FIX_969_USAN_IGF_ARITH int16_t pred; uint16_t pred_tmp; -#else - uint16_t pred; -#endif int16_t f, ctx, ctx_f, ctx_t; for ( f = 0; f < length; f++ ) @@ -226,12 +222,8 @@ static void decode_sfe_vector( if ( 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 ari_decode_14bits_s27_ext( st, &pred_tmp, &hPrivateData->acState, hPrivateData->cf_se00 ); pred = (int16_t) pred_tmp; -#else - ari_decode_14bits_s27_ext( st, &pred, &hPrivateData->acState, hPrivateData->cf_se00 ); -#endif x[f] = pred << 2; x[f] += arith_decode_bits( &hPrivateData->acState, st, 2 ); /* LSBs as 2 bit raw */ } -- GitLab From f0a85dce4f9d2f24b8b0aff4794774590b9d272d Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 19 May 2025 13:30:12 +0200 Subject: [PATCH 03/10] [cleanup] accept FIX_959_MASA_LINEAR_REND --- lib_com/options.h | 1 - lib_dec/ivas_jbm_dec.c | 17 ----------------- lib_dec/ivas_output_config.c | 4 ---- 3 files changed, 22 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 4e50ad4e0..716bfec71 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -200,7 +200,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 FIX_959_MASA_LINEAR_REND /* VA: issue 959: remove unused calling of ivas_sba_linear_renderer() in MASA rendering */ #define NONBE_FIX_973_HODIRAC_BAND_GROUPING /* FhG: issue 973: empty parameter band in DirAC */ #define FIX_971_LOG2_IDX_GAIN_0 /* VA: prevent -Inf due to log2(ratio==0) */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 8724bead2..b04d5a778 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1136,24 +1136,7 @@ ivas_error ivas_jbm_dec_render( } else if ( st_ivas->ivas_format == MASA_FORMAT ) { -#ifndef FIX_959_MASA_LINEAR_REND - if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_DEC ) - { - *nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); - for ( n = 0; n < nchan_remapped; n++ ) - { - mvr2r( st_ivas->hTcBuffer->tc[n] + st_ivas->hTcBuffer->n_samples_rendered, p_output[n], *nSamplesRendered ); - } - - if ( ( error = ivas_sba_linear_renderer( p_output, *nSamplesRendered, nchan_remapped, 0, output_config, st_ivas->hOutSetup ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else if ( st_ivas->renderer_type == RENDERER_DIRAC ) -#else if ( st_ivas->renderer_type == RENDERER_DIRAC ) -#endif { ivas_dirac_dec_render( st_ivas, nchan_remapped, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output ); } diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 5d04289c0..6ae31ecd4 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -372,11 +372,7 @@ void ivas_renderer_select( { *internal_config = IVAS_AUDIO_CONFIG_HOA3; } -#ifdef FIX_959_MASA_LINEAR_REND *renderer_type = RENDERER_SBA_LINEAR_DEC; -#else - st_ivas->renderer_type = RENDERER_SBA_LINEAR_DEC; -#endif } else if ( ( ivas_format == MASA_FORMAT && output_config == IVAS_AUDIO_CONFIG_MONO && st_ivas->nchan_transport == 1 ) || ( ivas_format == SBA_FORMAT && ( output_config == IVAS_AUDIO_CONFIG_STEREO || output_config == IVAS_AUDIO_CONFIG_MONO ) ) ) -- GitLab From ecc63d45156ea5324012e980d619b178656c72e7 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 19 May 2025 13:30:14 +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.c | 32 ---- lib_dec/lib_dec.h | 16 -- lib_rend/ivas_crend.c | 20 --- lib_rend/ivas_dirac_dec_binaural_functions.c | 2 - lib_rend/ivas_hrtf.c | 4 - lib_rend/ivas_objectRenderer.c | 4 - lib_rend/ivas_objectRenderer_mix.c | 11 -- lib_rend/ivas_stat_rend.h | 12 -- lib_rend/lib_rend.c | 155 ----------------- lib_rend/lib_rend.h | 4 - lib_util/hrtf_file_reader.c | 173 +------------------ lib_util/hrtf_file_reader.h | 14 -- 18 files changed, 6 insertions(+), 548 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 0eb53ab30..84bf97845 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -197,10 +197,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 DEBUGGING int32_t noClipping; int32_t cnt_frames_limited; @@ -728,16 +726,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 ) @@ -774,16 +768,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 ) @@ -792,16 +778,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 ) { @@ -809,7 +785,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 @@ -846,26 +821,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 ) @@ -878,26 +841,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 ) @@ -910,13 +861,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 } /*------------------------------------------------------------------------------------------* @@ -993,30 +937,16 @@ cleanup: #endif 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 d7aeef1d9..8e9812c30 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -672,12 +672,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; @@ -819,16 +817,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 ) ) { @@ -916,17 +904,12 @@ int main( const int16_t frameSize_smpls = (int16_t) ( ( args.render_framesize ) * args.sampleRate * 5 / ( 1000 ) ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, !isEmptyString( args.customHrtfFilePath ), args.nonDiegeticPan, args.nonDiegeticPanGain, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, args.nonDiegeticPan, args.nonDiegeticPanGain, (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 ) @@ -1072,7 +1055,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 ); @@ -2114,9 +2096,7 @@ int main( free( outInt16Buffer ); free( outFloatBuffer ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING cleanup: -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT if ( bitsBufferData != NULL ) @@ -2151,10 +2131,6 @@ cleanup: 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 ); @@ -2163,7 +2139,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 b8e880d02..5177af1e0 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1536,9 +1536,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 /* ----- Enums - TD Renderer ----- */ diff --git a/lib_com/ivas_error.h b/lib_com/ivas_error.h index 4c7a76742..2f824dce2 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, @@ -266,10 +264,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 716bfec71..2c3c4c17a 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -182,7 +182,6 @@ #endif #define NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM /* FhG: issue 1058: do not initialize EFAP when IntSetup is HOA3 */ -#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 004dfa572..6cdbd760a 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -2650,11 +2650,7 @@ void ivas_destroy_dec( { ivas_td_binaural_close( &st_ivas->hBinRendererTd ); } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( st_ivas->hHrtfTD != NULL ) -#else - else if ( st_ivas->hHrtfTD != NULL ) -#endif { BSplineModelEvalDealloc( &st_ivas->hHrtfTD->ModelParams, &st_ivas->hHrtfTD->ModelEval ); diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index a8073ca17..17fbc607b 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -1961,11 +1961,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 ) { if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hHrtfTD == NULL ) @@ -1973,11 +1969,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; } @@ -1991,11 +1983,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 ) { if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hSetOfHRTF == NULL ) @@ -2003,11 +1991,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; } @@ -2021,11 +2005,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 ) { if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hHrtfFastConv == NULL ) @@ -2033,11 +2013,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; } @@ -2051,11 +2027,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 ) { if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hHrtfParambin == NULL ) @@ -2063,11 +2035,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_dec/lib_dec.h b/lib_dec/lib_dec.h index 6b056a152..22d1e2c96 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -421,39 +421,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 ); /*! r: error code*/ diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index f6cdc433e..11b9202e8 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -99,9 +99,7 @@ ivas_error ivas_hrtf_init( hHrtf->pOut_to_bin_diffuse_im[j] = NULL; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hHrtf->init_from_rom = 1; -#endif return IVAS_ERR_OK; } @@ -220,7 +218,6 @@ static ivas_error ivas_rend_initCrend( return IVAS_ERR_INTERNAL_FATAL; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( hSetOfHRTF == NULL ) || ( ( hSetOfHRTF->hHRTF_hrir_combined == NULL ) && ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) && ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) || ( ( hSetOfHRTF->hHRTF_hrir_combined == NULL ) && ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) && ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL ) ) || @@ -228,13 +225,8 @@ static ivas_error ivas_rend_initCrend( ( ( 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; -#endif if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) { hHrtf->max_num_ir -= 1; /* subtract LFE */ @@ -802,9 +794,7 @@ static ivas_error ivas_rend_initCrend( } 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 -= 1; /* subtract LFE */ @@ -812,24 +802,20 @@ static ivas_error ivas_rend_initCrend( if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( hSetOfHRTF->hHRTF_brir_combined == NULL ) { return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters " ); } -#endif hHrtf->latency_s = hSetOfHRTF->hHRTF_brir_combined->latency_s; 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_UNEXPECTED_NULL_POINTER, "Invalid function parameters " ); } -#endif hHrtf->latency_s = hSetOfHRTF->hHRTF_hrir_combined->latency_s; hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_hrir_combined->max_num_iterations; hHrtf->index_frequency_max_diffuse = hSetOfHRTF->hHRTF_hrir_combined->index_frequency_max_diffuse; @@ -918,12 +904,10 @@ static ivas_error ivas_rend_initCrend( { if ( 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 = hSetOfHRTF->hHRTF_hrir_hoa3->latency_s; hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_hrir_hoa3->max_num_iterations; hHrtf->index_frequency_max_diffuse = hSetOfHRTF->hHRTF_hrir_hoa3->index_frequency_max_diffuse; @@ -955,12 +939,10 @@ static ivas_error ivas_rend_initCrend( } else if ( 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 = hSetOfHRTF->hHRTF_hrir_hoa2->latency_s; hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_hrir_hoa2->max_num_iterations; hHrtf->index_frequency_max_diffuse = hSetOfHRTF->hHRTF_hrir_hoa2->index_frequency_max_diffuse; @@ -992,12 +974,10 @@ static ivas_error ivas_rend_initCrend( } else if ( 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 = hSetOfHRTF->hHRTF_hrir_foa->latency_s; 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_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 4bed40428..396afca14 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -444,9 +444,7 @@ ivas_error ivas_dirac_dec_binaural_copy_hrtfs( mvr2r( parametricReverberationEneCorrections, hrtfParambin->parametricReverberationEneCorrections, CLDFB_NO_CHANNELS_MAX ); mvr2r( parametricEarlyPartEneCorrection, hrtfParambin->parametricEarlyPartEneCorrection, CLDFB_NO_CHANNELS_MAX ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hrtfParambin->allocatedFromFile = 0; -#endif *hHrtfParambin = hrtfParambin; } diff --git a/lib_rend/ivas_hrtf.c b/lib_rend/ivas_hrtf.c index 43323fee0..5e4e0bdf8 100644 --- a/lib_rend/ivas_hrtf.c +++ b/lib_rend/ivas_hrtf.c @@ -54,9 +54,7 @@ ivas_error ivas_HRTF_binary_open( 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; } @@ -187,9 +185,7 @@ ivas_error ivas_HRTF_parambin_binary_open( 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.c b/lib_rend/ivas_objectRenderer.c index 0a687335b..14ae95384 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -668,11 +668,7 @@ ivas_error ivas_td_binaural_open_ext( { directivity = hRendCfg->directivity; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING return ivas_td_binaural_open_unwrap( pTDRend->hHrtfTD, outFs, nchan_transport, ivas_format, transport_config, directivity, hTransSetup, &pTDRend->hBinRendererTd, &pTDRend->binaural_latency_ns ); -#else - return ivas_td_binaural_open_unwrap( &pTDRend->hHrtfTD, outFs, nchan_transport, ivas_format, transport_config, directivity, hTransSetup, &pTDRend->hBinRendererTd, &pTDRend->binaural_latency_ns ); -#endif } diff --git a/lib_rend/ivas_objectRenderer_mix.c b/lib_rend/ivas_objectRenderer_mix.c index e43422554..7088640c8 100644 --- a/lib_rend/ivas_objectRenderer_mix.c +++ b/lib_rend/ivas_objectRenderer_mix.c @@ -148,11 +148,7 @@ void TDREND_MIX_Dealloc( hBinRendererTd->Listener_p = NULL; } /* Dealloc HR filter set */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( *hBinRendererTd->pHrFiltSet_p != NULL ) && ( hBinRendererTd->HrFiltSet_p != NULL ) ) -#else - if ( hBinRendererTd->HrFiltSet_p != NULL ) -#endif { if ( hBinRendererTd->HrFiltSet_p->FilterMethod == TDREND_HRFILT_Method_BSplineModel ) { @@ -181,17 +177,12 @@ void TDREND_MIX_Dealloc( hBinRendererTd->HrFiltSet_p->RightFiltSet_p = NULL; } } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( 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; @@ -255,9 +246,7 @@ ivas_error TDREND_MIX_Init( hBinRendererTd->HrFiltSet_p = *hHrtfTD; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hBinRendererTd->pHrFiltSet_p = hHrtfTD; -#endif if ( hBinRendererTd->HrFiltSet_p->SampleRate != output_Fs ) { diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 26ff98bef..dbef7773a 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -1152,9 +1152,7 @@ typedef struct ivas_binaural_td_rendering_struct float Gain; /* Mixer gain */ 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; /* HR filter set */ -#endif int16_t UseCommonDistAttenModel; /* Use common dist atten model (TRUE/FALSE) */ int16_t DistAttenEnabled; /* (TRUE/FALSE) */ @@ -1166,11 +1164,7 @@ typedef struct { int32_t 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; @@ -1198,9 +1192,7 @@ typedef struct ivas_hrtfs_structure #else float inv_diffuse_weight[MAX_INTERN_CHANNELS]; /* inverse diffuse weights array, access one inverse weight by pInvDiffuseWeight[channel] */ #endif -#ifdef NONBE_FIX_BINARY_BINAURAL_READING int16_t init_from_rom; -#endif float gain_lfe; } HRTFS_DATA, *HRTFS_HANDLE; @@ -1601,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; float *hoa_dec_mtx; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index c14c7f4db..735dc82c8 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -53,11 +53,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 @@ -198,7 +194,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; @@ -206,7 +201,6 @@ typedef struct hrtf_handles IVAS_DEC_HRTF_PARAMBIN_HANDLE hHrtfParambin; IVAS_DEC_HRTF_HANDLE hHrtfTD; } hrtf_handles; -#endif struct IVAS_REND { @@ -243,14 +237,7 @@ struct IVAS_REND RENDER_CONFIG_DATA *hRendererConfig; /* Renderer config pointer */ int16_t 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 }; @@ -258,11 +245,7 @@ struct IVAS_REND * 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 ); @@ -1330,9 +1313,6 @@ static ivas_error initIsmMasaRendering( if ( inputIsm->tdRendWrapper.hBinRendererTd != NULL ) { ivas_td_binaural_close( &inputIsm->tdRendWrapper.hBinRendererTd ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - inputIsm->tdRendWrapper.hHrtfTD = NULL; -#endif } #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -1357,10 +1337,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; @@ -1399,20 +1377,14 @@ static ivas_error setRendInputActiveIsm( #ifdef SPLIT_REND_WITH_HEAD_ROT for ( i = 0; i < (int16_t) ( sizeof( inputIsm->splitTdRendWrappers ) / sizeof( *inputIsm->splitTdRendWrappers ) ); ++i ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING inputIsm->splitTdRendWrappers[i].hHrtfTD = &hrtfs->hHrtfTD; -#else - inputIsm->splitTdRendWrappers[i] = defaultTdRendWrapper(); -#endif } #endif inputIsm->hOMasa = NULL; error = IVAS_ERR_OK; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING inputIsm->tdRendWrapper.hHrtfTD = &hrtfs->hHrtfTD; -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) @@ -1421,11 +1393,7 @@ static ivas_error setRendInputActiveIsm( #endif { #ifndef SPLIT_REND_WITH_HEAD_ROT -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -1485,11 +1453,7 @@ static ivas_error setRendInputActiveIsm( } else if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( 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 ( ( 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; } @@ -1526,18 +1490,12 @@ static void clearInputIsm( if ( inputIsm->tdRendWrapper.hBinRendererTd != NULL ) { ivas_td_binaural_close( &inputIsm->tdRendWrapper.hBinRendererTd ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - inputIsm->tdRendWrapper.hHrtfTD = NULL; -#endif } #ifdef SPLIT_REND_WITH_HEAD_ROT for ( i = 0; i < (int16_t) ( sizeof( inputIsm->splitTdRendWrappers ) / sizeof( *inputIsm->splitTdRendWrappers ) ); ++i ) { ivas_td_binaural_close( &inputIsm->splitTdRendWrappers[i].hBinRendererTd ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - inputIsm->splitTdRendWrappers[i].hHrtfTD = NULL; -#endif } #endif @@ -2181,9 +2139,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; @@ -2214,9 +2170,6 @@ static ivas_error initMcBinauralRendering( if ( !reconfigureFlag || ( !useTDRend && inputMc->tdRendWrapper.hBinRendererTd != NULL ) ) { ivas_td_binaural_close( &inputMc->tdRendWrapper.hBinRendererTd ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - inputMc->tdRendWrapper.hHrtfTD = NULL; -#endif } #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -2227,9 +2180,6 @@ static ivas_error initMcBinauralRendering( if ( inputMc->splitTdRendWrappers[i].hBinRendererTd != NULL ) { ivas_td_binaural_close( &inputMc->splitTdRendWrappers[i].hBinRendererTd ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - inputMc->splitTdRendWrappers[i].hHrtfTD = NULL; -#endif } } } @@ -2297,20 +2247,12 @@ static ivas_error initMcBinauralRendering( /* open CREND */ #ifdef SPLIT_REND_WITH_HEAD_ROT if ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hMixconv -#else - NULL -#endif , 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 ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hMixconv -#else - NULL -#endif , outSampleRate ) ) != IVAS_ERR_OK ) #endif @@ -2351,9 +2293,6 @@ static ivas_error initMcMasaRendering( if ( inputMc->tdRendWrapper.hBinRendererTd != NULL ) { ivas_td_binaural_close( &inputMc->tdRendWrapper.hBinRendererTd ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - inputMc->tdRendWrapper.hHrtfTD = NULL; -#endif } #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -2442,10 +2381,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 @@ -2481,15 +2418,11 @@ static ivas_error setRendInputActiveMc( setZeroPanMatrix( inputMc->panGains ); inputMc->customLsInput = defaultCustomLs(); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( hrtfs->hHrtfTD ) { inputMc->tdRendWrapper.binaural_latency_ns = (int32_t) ( hrtfs->hHrtfTD->latency_s * 1000000000.f ); } inputMc->tdRendWrapper.hHrtfTD = &hrtfs->hHrtfTD; -#else - inputMc->tdRendWrapper = defaultTdRendWrapper(); -#endif inputMc->crendWrapper = NULL; inputMc->hReverb = NULL; inputMc->hMcMasa = NULL; @@ -2509,15 +2442,11 @@ static ivas_error setRendInputActiveMc( #ifdef SPLIT_REND_WITH_HEAD_ROT for ( i = 0; i < (int16_t) ( sizeof( inputMc->splitTdRendWrappers ) / sizeof( *inputMc->splitTdRendWrappers ) ); ++i ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( hrtfs->hHrtfTD ) { inputMc->splitTdRendWrappers[i].binaural_latency_ns = (int32_t) ( hrtfs->hHrtfTD->latency_s * 1000000000.f ); } inputMc->splitTdRendWrappers[i].hHrtfTD = &hrtfs->hHrtfTD; -#else - inputMc->splitTdRendWrappers[i] = defaultTdRendWrapper(); -#endif } if ( getAudioConfigType( outConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) @@ -2526,10 +2455,8 @@ static ivas_error setRendInputActiveMc( #endif { if ( ( error = initMcBinauralRendering( inputMc, inConfig, outConfig, hRendCfg -#ifdef NONBE_FIX_BINARY_BINAURAL_READING , hrtfs->hSetOfHRTF -#endif , FALSE ) ) != IVAS_ERR_OK ) { @@ -2585,9 +2512,6 @@ static void clearInputMc( if ( inputMc->tdRendWrapper.hBinRendererTd != NULL ) { ivas_td_binaural_close( &inputMc->tdRendWrapper.hBinRendererTd ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - inputMc->tdRendWrapper.hHrtfTD = NULL; -#endif } #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -2596,9 +2520,6 @@ static void clearInputMc( if ( inputMc->splitTdRendWrappers[i].hBinRendererTd != NULL ) { ivas_td_binaural_close( &inputMc->splitTdRendWrappers[i].hBinRendererTd ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - inputMc->splitTdRendWrappers[i].hHrtfTD = NULL; -#endif } } #endif @@ -2703,10 +2624,8 @@ static ivas_error updateSbaPanGains( input_sba *inputSba, const AUDIO_CONFIG outConfig, RENDER_CONFIG_DATA *hRendCfg -#ifdef NONBE_FIX_BINARY_BINAURAL_READING , IVAS_DEC_HRTF_CREND_HANDLE hMixconv -#endif ) { ivas_error error; @@ -2767,18 +2686,10 @@ static ivas_error updateSbaPanGains( else #endif { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING #ifdef SPLIT_REND_WITH_HEAD_ROT if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#endif -#else -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#endif #endif { return error; @@ -2792,18 +2703,10 @@ static ivas_error updateSbaPanGains( { return error; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING #ifdef SPLIT_REND_WITH_HEAD_ROT if ( ( 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 ( ( 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 ( ( 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 ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#endif #endif { return error; @@ -2856,10 +2759,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 ) { @@ -2903,9 +2804,7 @@ static ivas_error setRendInputActiveSba( { initRotGains( inputSba->rot_gains_prev[pos_idx] ); } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING inputSba->cldfbRendWrapper.hHrtfFastConv = hrtfs->hHrtfFastConv; -#endif #else inputSba->crendWrapper = NULL; inputSba->hDirAC = NULL; @@ -2920,11 +2819,7 @@ static ivas_error setRendInputActiveSba( } } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( error = updateSbaPanGains( inputSba, outConfig, hRendCfg, hrtfs->hSetOfHRTF ) ) != IVAS_ERR_OK ) -#else - if ( ( error = updateSbaPanGains( inputSba, outConfig, hRendCfg ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2967,10 +2862,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. */ { @@ -3011,11 +2904,7 @@ static ivas_error setRendInputActiveMasa( } else { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( error = initMasaExtRenderer( inputMasa, outConfig, hrtfs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = initMasaExtRenderer( inputMasa, outConfig ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -3055,9 +2944,7 @@ ivas_error IVAS_REND_Open( IVAS_REND_HANDLE *phIvasRend, const int32_t outputSampleRate, const AUDIO_CONFIG outConfig, -#ifdef NONBE_FIX_BINARY_BINAURAL_READING const bool asHrtfBinary, -#endif const int16_t nonDiegeticPan, const float nonDiegeticPanGain, const int16_t num_subframes ) @@ -3210,7 +3097,6 @@ ivas_error IVAS_REND_Open( hIvasRend->inputsMasa[i].hMasaExtRend = NULL; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hIvasRend->hHrtfs.hHrtfFastConv = NULL; hIvasRend->hHrtfs.hHrtfParambin = NULL; hIvasRend->hHrtfs.hHrtfTD = NULL; @@ -3234,7 +3120,6 @@ ivas_error IVAS_REND_Open( return error; } } -#endif return IVAS_ERR_OK; } @@ -3379,11 +3264,7 @@ ivas_error IVAS_REND_ConfigureCustomOutputLoudspeakerLayout( /* Input inactive, skip. */ continue; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( error = updateSbaPanGains( inputSba, hIvasRend->outputConfig, hIvasRend->hRendererConfig, NULL ) ) != IVAS_ERR_OK ) -#else - if ( ( error = updateSbaPanGains( inputSba, hIvasRend->outputConfig, hIvasRend->hRendererConfig ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -3733,11 +3614,7 @@ ivas_error IVAS_REND_AddInput( int32_t maxNumInputsOfType; void *inputsArray; int32_t 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 int32_t inputIndex; /* Validate function arguments */ @@ -3796,11 +3673,7 @@ ivas_error IVAS_REND_AddInput( } *inputId = makeInputId( inConfig, inputIndex ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( error = activateInput( (uint8_t *) inputsArray + inputStructSize * inputIndex, inConfig, *inputId, hIvasRend->hRendererConfig, &hIvasRend->hHrtfs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = activateInput( (uint8_t *) inputsArray + inputStructSize * inputIndex, inConfig, *inputId, hIvasRend->hRendererConfig ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -3869,9 +3742,7 @@ ivas_error IVAS_REND_ConfigureCustomInputLoudspeakerLayout( inputMc->base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hIvasRend->hHrtfs.hSetOfHRTF, -#endif FALSE ) ) != IVAS_ERR_OK ) { return error; @@ -4654,9 +4525,7 @@ ivas_error IVAS_REND_SetHeadRotation( hIvasRend->inputsMc[i].base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hIvasRend->hHrtfs.hSetOfHRTF, -#endif TRUE ) ) != IVAS_ERR_OK ) { return error; @@ -4721,9 +4590,7 @@ ivas_error IVAS_REND_DisableHeadRotation( hIvasRend->inputsMc[i].base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hIvasRend->hHrtfs.hSetOfHRTF, -#endif TRUE ) ) != IVAS_ERR_OK ) { @@ -8036,7 +7903,6 @@ void IVAS_REND_Close( ivas_external_orientation_close( &hIvasRend->hExternalOrientationData ); ivas_combined_orientation_close( &hIvasRend->hCombinedOrientationData ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING /* Fastconv HRTF memories */ ivas_binaural_hrtf_close( &hIvasRend->hHrtfs.hHrtfFastConv ); @@ -8045,7 +7911,6 @@ void IVAS_REND_Close( ivas_HRTF_CRend_binary_close( &( hIvasRend->hHrtfs.hSetOfHRTF ) ); ivas_HRTF_fastconv_binary_close( &( hIvasRend->hHrtfs.hHrtfFastConv ) ); ivas_HRTF_parambin_binary_close( &( hIvasRend->hHrtfs.hHrtfParambin ) ); -#endif free( hIvasRend ); *phIvasRend = NULL; @@ -8200,7 +8065,6 @@ int32_t IVAS_REND_GetCntFramesLimited( } #endif -#ifdef NONBE_FIX_BINARY_BINAURAL_READING /*---------------------------------------------------------------------* * IVAS_REND_GetHrtfHandle( ) * @@ -8287,7 +8151,6 @@ ivas_error IVAS_REND_GetHrtfParamBinHandle( return IVAS_ERR_OK; } -#endif static ivas_error ivas_masa_ext_rend_dirac_rend_init( input_masa *inputMasa ) @@ -8668,11 +8531,7 @@ static ivas_error ivas_masa_ext_rend_parambin_init( error = IVAS_ERR_OK; -#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 ); @@ -8805,10 +8664,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 ) { int16_t i; @@ -8837,11 +8694,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; @@ -8932,11 +8785,7 @@ static ivas_error initMasaExtRenderer( { if ( hMasaExtRend->renderer_type != RENDERER_STEREO_PARAMETRIC ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( error = ivas_dirac_dec_binaural_copy_hrtfs( inputMasa->hMasaExtRend->hHrtfParambin ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_dirac_dec_binaural_copy_hrtfs( &inputMasa->hMasaExtRend->hHrtfParambin ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -9030,11 +8879,7 @@ static void freeMasaExtRenderer( if ( hMasaExtRend->hHrtfParambin != NULL ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING ivas_HRTF_parambin_binary_close( hMasaExtRend->hHrtfParambin ); -#else - ivas_HRTF_parambin_binary_close( &hMasaExtRend->hHrtfParambin ); -#endif } if ( hMasaExtRend->hVBAPdata != NULL ) diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 6bc102a47..b25076ac8 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -114,9 +114,7 @@ ivas_error IVAS_REND_Open( IVAS_REND_HANDLE *phIvasRend, /* i/o: Pointer to renderer handle */ const int32_t 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 int16_t nonDiegeticPan, /* i : non-diegetic object flag */ const float nonDiegeticPanGain, /* i : non-diegetic panning gain */ const int16_t num_subframes /* i : number of subframes */ @@ -186,7 +184,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 */ @@ -208,7 +205,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 4a2009efc..f2483c5cb 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -678,11 +678,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; @@ -718,9 +714,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; @@ -729,15 +722,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 ); @@ -758,7 +746,6 @@ static ivas_error TDREND_MIX_LoadHRTF( } return header_check_result; -#endif } is_tdrend = FALSE; @@ -816,35 +803,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 } /*---------------------------------------------------------------------* @@ -925,7 +896,6 @@ static void HRTF_energy_sections_precalc( return; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING /*---------------------------------------------------------------------* * dealloc_HRTF_binary() * @@ -994,76 +964,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 ); - free( hHrtf->ModelParamsITD.azimKSeq_dyn ); - free( hHrtf->ModelParamsITD.W_dyn ); - free( hHrtf->ModelParamsITD.azimBsShape_dyn ); - free( hHrtf->ModelParamsITD.elevBsShape_dyn ); - } - free( hHrtf->ModelParams.elevKSeq_dyn ); - free( hHrtf->ModelParams.azim_start_idx_dyn ); - free( hHrtf->ModelParams.azimDim2_dyn ); - free( hHrtf->ModelParams.azimDim3_dyn ); - free( hHrtf->ModelParams.AlphaL_dyn ); - free( hHrtf->ModelParams.AlphaR_dyn ); - free( hHrtf->ModelParams.azimSegSamples_dyn ); - - free( hHrtf->ModelParams.azimShapeIdx_dyn ); - free( hHrtf->ModelParams.azimShapeSampFactor_dyn ); - free( hHrtf->ModelParams.elevBsShape_dyn ); - - for ( i = 0; i < hHrtf->ModelParams.num_unique_azim_splines; i++ ) - { - free( hHrtf->ModelParams.azimBsShape_dyn[i] ); - free( &hHrtf->ModelParams.azimBsShape_dyn[i] ); - } - - free( (void *) hHrtf->ModelParams.azimBsShape ); /* 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[i] ); - } - free( hHrtf->ModelParams.azimKSeq ); - - free( hHrtf->ModelParams.EL_dyn ); - free( hHrtf->ModelParams.ER_dyn ); - - free( hHrtf->ModelEval.hrfModL ); - free( hHrtf->ModelEval.hrfModR ); - - for ( i = 0; i < 3; i++ ) - { - free( hHrtf->lr_energy_and_iac_dyn[i] ); - } - } - - return error; -} -#endif /*---------------------------------------------------------------------* * create_HRTF_from_rawdata() @@ -1088,11 +988,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 ) @@ -1105,9 +1001,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 */ @@ -1368,7 +1262,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 ) ) ) { @@ -1387,7 +1281,7 @@ static ivas_error create_fastconv_HRTF_from_rawdata( ( *hHRTF )->FASTCONV_HRIR_latency_s = *( (float *) ( hrtf_data_rptr ) ); 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)" ); @@ -1450,7 +1344,7 @@ static ivas_error create_fastconv_HRTF_from_rawdata( ( *hHRTF )->FASTCONV_HOA3_latency_s = *( (float *) ( hrtf_data_rptr ) ); 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)" ); @@ -1512,7 +1406,7 @@ static ivas_error create_fastconv_HRTF_from_rawdata( ( *hHRTF )->FASTCONV_HOA2_latency_s = *( (float *) ( hrtf_data_rptr ) ); 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)" ); @@ -1575,7 +1469,7 @@ static ivas_error create_fastconv_HRTF_from_rawdata( ( *hHRTF )->FASTCONV_FOA_latency_s = *( (float *) ( hrtf_data_rptr ) ); 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)" ); @@ -1639,7 +1533,7 @@ static ivas_error create_fastconv_HRTF_from_rawdata( ( *hHRTF )->FASTCONV_BRIR_latency_s = *( (float *) ( hrtf_data_rptr ) ); 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)" ); @@ -1735,9 +1629,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; @@ -1787,9 +1679,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 { @@ -1798,7 +1688,6 @@ ivas_error load_fastconv_HRTF_from_binary( } free( hrtf_data ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( asFastconv ) { return IVAS_ERR_OK; @@ -1807,9 +1696,6 @@ ivas_error load_fastconv_HRTF_from_binary( { return IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA; } -#else - return IVAS_ERR_OK; -#endif } @@ -1901,9 +1787,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; @@ -1957,9 +1841,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 { @@ -1967,7 +1849,6 @@ ivas_error load_parambin_HRTF_from_binary( } } free( hrtf_data ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( asParam ) { return IVAS_ERR_OK; @@ -1976,9 +1857,6 @@ ivas_error load_parambin_HRTF_from_binary( { return IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA; } -#else - return IVAS_ERR_OK; -#endif } @@ -2095,15 +1973,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; } @@ -2114,22 +1983,14 @@ 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 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++ ) { @@ -2169,11 +2030,7 @@ static ivas_error destroy_HRTF *hHRTF = NULL; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING return; -#else - return IVAS_ERR_OK; -#endif } /*---------------------------------------------------------------------* @@ -2181,7 +2038,6 @@ static ivas_error destroy_HRTF * * Destroy the HRTF data set. *---------------------------------------------------------------------*/ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING #ifdef FIX_OLD_BINARY_FORMAT /*---------------------------------------------------------------------* * cleanup_SetOfHRTF() @@ -2259,20 +2115,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 a489e97924f770b184bbc1661c503f34853b20db Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 19 May 2025 13:30:16 +0200 Subject: [PATCH 05/10] [cleanup] accept NONBE_FIX_935_EARLY_REFLECTIONS_WRONG_ORDER --- lib_com/options.h | 1 - lib_rend/ivas_reflections.c | 8 -------- 2 files changed, 9 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 2c3c4c17a..9db6010b8 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -195,7 +195,6 @@ #endif #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*/ #define NONBE_FIX_935_SBA_REVERB /* FhG: issue 935: fix MSAN error for SBA related to BINAURAL_ROOM_REVERB */ diff --git a/lib_rend/ivas_reflections.c b/lib_rend/ivas_reflections.c index fdde56967..4423bfdd1 100644 --- a/lib_rend/ivas_reflections.c +++ b/lib_rend/ivas_reflections.c @@ -59,17 +59,9 @@ static uint16_t LC_mixing_7_1[7] = { 0, 1, 2, 3, 4, 3, 4 }; static uint16_t LC_mixing_5_1_2[7] = { 0, 1, 2, 3, 4, 0, 1 }; -#ifdef NONBE_FIX_935_EARLY_REFLECTIONS_WRONG_ORDER static uint16_t LC_mixing_5_1_4[9] = { 0, 1, 2, 3, 4, 0, 1, 3, 4 }; -#else -static uint16_t 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 uint16_t LC_mixing_7_1_4[11] = { 0, 1, 2, 3, 4, 3, 4, 0, 1, 3, 4 }; -#else -static uint16_t LC_mixing_7_1_4[11] = { 0, 1, 2, 3, 4, 3, 4, 0, 1, 2, 3 }; -#endif /*-----------------------------------------------------------------------------------------* -- GitLab From 5fc24a2232a19c160d174ca311ab0e1e10cd825a Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 19 May 2025 13:30:19 +0200 Subject: [PATCH 06/10] [cleanup] accept NONBE_FIX_935_SBA_REVERB --- lib_com/options.h | 1 - lib_dec/ivas_output_config.c | 4 ---- lib_dec/ivas_sba_dec.c | 4 ---- lib_dec/ivas_spar_decoder.c | 4 ---- 4 files changed, 13 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 9db6010b8..d0d40db03 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -197,7 +197,6 @@ #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*/ -#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 FIX_971_LOG2_IDX_GAIN_0 /* VA: prevent -Inf due to log2(ratio==0) */ diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 6ae31ecd4..d1e3d9e59 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -157,11 +157,7 @@ void ivas_renderer_select( { *internal_config = IVAS_AUDIO_CONFIG_HOA3; -#ifdef NONBE_FIX_935_SBA_REVERB if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL -#else - if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 516df6876..e3df315e0 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -194,11 +194,7 @@ ivas_error ivas_sba_dec_reconfigure( } else { -#ifdef NONBE_FIX_935_SBA_REVERB if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL -#else - if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index 6cc4bed27..f914993a5 100644 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -250,11 +250,7 @@ ivas_error ivas_spar_dec_open( } if ( st_ivas->ivas_format == SBA_ISM_FORMAT && -#ifdef NONBE_FIX_935_SBA_REVERB st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL && -#else - ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) && -#endif st_ivas->ism_mode == ISM_SBA_MODE_DISC ) { /* get correct granularity in case of binaural rendering of the discrete objects with the td obj renderer */ -- GitLab From 9a8530379feb544d79a729fafa7c55485e4a58e7 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 19 May 2025 13:30:21 +0200 Subject: [PATCH 07/10] [cleanup] accept NONBE_FIX_952_MC_PARAMUPMIX_5MS --- lib_com/options.h | 1 - lib_dec/ivas_mc_paramupmix_dec.c | 20 -------------------- 2 files changed, 21 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index d0d40db03..8300002bb 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -194,7 +194,6 @@ #define FIX_INV_DIFFUSE_WEIGHT /* Orange : Fix error in energy compensation in late binaural */ #endif #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*/ #define NONBE_FIX_973_HODIRAC_BAND_GROUPING /* FhG: issue 973: empty parameter band in DirAC */ diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index 318f95ded..405eeb47f 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -114,13 +114,11 @@ void ivas_mc_paramupmix_dec_read_BS( } } -#ifdef NONBE_FIX_952_MC_PARAMUPMIX_5MS for ( i = 0; i < MC_PARAMUPMIX_COMBINATIONS; i++ ) { mvr2r( hMCParamUpmix->alpha_prev[i], hMCParamUpmix->alpha_sf[i], IVAS_MAX_NUM_BANDS ); mvr2r( hMCParamUpmix->beta_prev[i], hMCParamUpmix->beta_sf[i], IVAS_MAX_NUM_BANDS ); } -#endif hMCParamUpmix->first_frame = 1; } @@ -140,7 +138,6 @@ void ivas_mc_paramupmix_dec_read_BS( st0->bits_frame = min( MAX_BITS_METADATA, last_bit_pos + 1 ); st0->total_brate = st_ivas->hDecoderConfig->ivas_total_brate; /* to avoid BER detect */ -#ifdef NONBE_FIX_952_MC_PARAMUPMIX_5MS if ( hMCParamUpmix->first_frame == 0 ) { for ( i = 0; i < MC_PARAMUPMIX_COMBINATIONS; i++ ) @@ -149,7 +146,6 @@ void ivas_mc_paramupmix_dec_read_BS( mvr2r( hMCParamUpmix->betas[i], hMCParamUpmix->beta_prev[i], IVAS_MAX_NUM_BANDS ); } } -#endif for ( i = 0; i < MC_PARAMUPMIX_COMBINATIONS; i++ ) { @@ -171,13 +167,11 @@ void ivas_mc_paramupmix_dec_read_BS( hMCParamUpmix->first_frame = 0; } -#ifdef NONBE_FIX_952_MC_PARAMUPMIX_5MS for ( i = 0; i < MC_PARAMUPMIX_COMBINATIONS; i++ ) { mvr2r( hMCParamUpmix->alpha_prev[i], hMCParamUpmix->alpha_sf[i], IVAS_MAX_NUM_BANDS ); mvr2r( hMCParamUpmix->beta_prev[i], hMCParamUpmix->beta_sf[i], IVAS_MAX_NUM_BANDS ); } -#endif } pop_wmops(); @@ -266,13 +260,6 @@ void ivas_mc_paramupmix_dec_render( assert( slots_to_render == 0 ); #endif { -#ifndef NONBE_FIX_952_MC_PARAMUPMIX_5MS - for ( ch = 0; ch < MC_PARAMUPMIX_COMBINATIONS; ch++ ) - { - mvr2r( hMCParamUpmix->alpha_prev[ch], hMCParamUpmix->alpha_sf[ch], IVAS_MAX_NUM_BANDS ); - mvr2r( hMCParamUpmix->beta_prev[ch], hMCParamUpmix->beta_sf[ch], IVAS_MAX_NUM_BANDS ); - } -#endif for ( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ ) { @@ -288,13 +275,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++ ) - { - mvr2r( hMCParamUpmix->alphas[ch], hMCParamUpmix->alpha_prev[ch], IVAS_MAX_NUM_BANDS ); - mvr2r( hMCParamUpmix->betas[ch], hMCParamUpmix->beta_prev[ch], IVAS_MAX_NUM_BANDS ); - } -#endif } *nSamplesAvailable = ( st_ivas->hTcBuffer->num_slots - st_ivas->hTcBuffer->slots_rendered ) * slot_size; -- GitLab From 2abfa4baec48e745ee6b65112b42f657b774c0d2 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 19 May 2025 13:30:23 +0200 Subject: [PATCH 08/10] [cleanup] accept NONBE_FIX_967_ISM_MONO_DMX --- lib_com/ivas_prot.h | 4 ---- lib_com/options.h | 1 - lib_dec/ivas_jbm_dec.c | 12 ------------ lib_dec/ivas_mono_dmx_renderer.c | 28 ---------------------------- 4 files changed, 45 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index d71ab33f4..2a79bf8af 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5492,11 +5492,7 @@ void ivas_mono_dmx_renderer_close( MONO_DOWNMIX_RENDERER_HANDLE *hMonoDmxRenderer /* i/ i/o: Mono downmix structure */ ); -#ifdef NONBE_FIX_967_ISM_MONO_DMX void ivas_ism_mono_dmx( -#else -void ivas_mono_downmix_render_passive( -#endif Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ float *output_f[], /* i/o: synthesized core-coder transport channels/mono output */ const int16_t output_frame /* i : output frame length */ diff --git a/lib_com/options.h b/lib_com/options.h index 8300002bb..07d74785a 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -194,7 +194,6 @@ #define FIX_INV_DIFFUSE_WEIGHT /* Orange : Fix error in energy compensation in late binaural */ #endif #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 */ #define FIX_971_LOG2_IDX_GAIN_0 /* VA: prevent -Inf due to log2(ratio==0) */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index b04d5a778..2d88afca5 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -196,11 +196,7 @@ ivas_error ivas_jbm_dec_tc( if ( st_ivas->renderer_type == RENDERER_MONO_DOWNMIX ) { -#ifdef NONBE_FIX_967_ISM_MONO_DMX ivas_ism_mono_dmx( st_ivas, p_output, output_frame ); -#else - ivas_mono_downmix_render_passive( st_ivas, p_output, output_frame ); -#endif } else if ( st_ivas->ism_mode == ISM_MODE_PARAM && ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) ) { @@ -392,11 +388,7 @@ ivas_error ivas_jbm_dec_tc( if ( st_ivas->renderer_type == RENDERER_MONO_DOWNMIX ) { -#ifdef NONBE_FIX_967_ISM_MONO_DMX ivas_ism_mono_dmx( st_ivas, p_output, output_frame ); -#else - ivas_mono_downmix_render_passive( st_ivas, p_output, output_frame ); -#endif } else if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { @@ -520,11 +512,7 @@ ivas_error ivas_jbm_dec_tc( } else if ( st_ivas->renderer_type == RENDERER_MONO_DOWNMIX && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) { -#ifdef NONBE_FIX_967_ISM_MONO_DMX ivas_ism_mono_dmx( st_ivas, p_output, output_frame ); -#else - ivas_mono_downmix_render_passive( st_ivas, p_output, output_frame ); -#endif /* add W */ for ( n = 0; n < nchan_out; n++ ) diff --git a/lib_dec/ivas_mono_dmx_renderer.c b/lib_dec/ivas_mono_dmx_renderer.c index a5845d775..2059ead6d 100644 --- a/lib_dec/ivas_mono_dmx_renderer.c +++ b/lib_dec/ivas_mono_dmx_renderer.c @@ -48,9 +48,6 @@ #define DOWNMIX_ALPHA 0.95f /* Smoothing coefficient */ #define DOWNMIX_MAX_GAIN 4.0f /* Maximum allowed gain */ -#ifndef NONBE_FIX_967_ISM_MONO_DMX -#define MONO_DOWNMIX_RENDERER_MAX_INPUT_CHANS 4 // FhG esr: this seems to be obsolete; not related to issue 967 -#endif /*------------------------------------------------------------------------- @@ -105,11 +102,7 @@ void ivas_mono_dmx_renderer_close( * * Downmix process *------------------------------------------------------------------------*/ -#ifdef NONBE_FIX_967_ISM_MONO_DMX void ivas_ism_mono_dmx( -#else -void ivas_mono_downmix_render_passive( -#endif Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ float *output_f[], /* i/o: synthesized core-coder transport channels/mono output */ const int16_t output_frame /* i : output frame length */ @@ -117,9 +110,7 @@ void ivas_mono_downmix_render_passive( { int16_t i, j, numInputChannels; float proto_signal[L_FRAME48k], eq; -#ifdef NONBE_FIX_967_ISM_MONO_DMX float inputEnergy_local, protoEnergy_local; -#endif MONO_DOWNMIX_RENDERER_HANDLE hDownmix; numInputChannels = st_ivas->nSCE; @@ -142,10 +133,8 @@ void ivas_mono_downmix_render_passive( hDownmix = st_ivas->hMonoDmxRenderer; set_zero( proto_signal, output_frame ); -#ifdef NONBE_FIX_967_ISM_MONO_DMX inputEnergy_local = 0; protoEnergy_local = 0; -#endif /* Compute the Proto Signal */ for ( i = 0; i < numInputChannels; i++ ) @@ -153,7 +142,6 @@ void ivas_mono_downmix_render_passive( v_add( output_f[i], proto_signal, proto_signal, output_frame ); } -#ifdef NONBE_FIX_967_ISM_MONO_DMX /* compute the input energy, proto energy */ for ( i = 0; i < output_frame; i++ ) { @@ -164,26 +152,10 @@ void ivas_mono_downmix_render_passive( inputEnergy_local += ( output_f[j][i] * output_f[j][i] ); } } -#else - /* compute the input energy, proto energy after smoothing */ - hDownmix->inputEnergy *= DOWNMIX_ALPHA; - hDownmix->protoEnergy *= DOWNMIX_ALPHA; - for ( i = 0; i < output_frame; i++ ) - { - hDownmix->protoEnergy += proto_signal[i] * proto_signal[i]; - - for ( j = 0; j < numInputChannels; j++ ) - { - hDownmix->inputEnergy += ( output_f[j][i] * output_f[j][i] ); - } - } -#endif -#ifdef NONBE_FIX_967_ISM_MONO_DMX hDownmix->inputEnergy *= DOWNMIX_ALPHA; hDownmix->protoEnergy *= DOWNMIX_ALPHA; hDownmix->inputEnergy += ( 1.0f - DOWNMIX_ALPHA ) * inputEnergy_local; hDownmix->protoEnergy += ( 1.0f - DOWNMIX_ALPHA ) * protoEnergy_local; -#endif /* compute the eq factor */ eq = min( DOWNMIX_MAX_GAIN, sqrtf( hDownmix->inputEnergy / ( EPSILON + hDownmix->protoEnergy ) ) ); -- GitLab From b4b2d63cdad88dcc7bc8d5799ff64cbd7cd5642f Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 19 May 2025 13:30:25 +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.c | 32 -------------------------------- 2 files changed, 33 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 07d74785a..14ce9128d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -194,7 +194,6 @@ #define FIX_INV_DIFFUSE_WEIGHT /* Orange : Fix error in energy compensation in late binaural */ #endif #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 FIX_971_LOG2_IDX_GAIN_0 /* VA: prevent -Inf due to log2(ratio==0) */ diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index 5e01f7e4c..58e4b4216 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -154,12 +154,9 @@ void ivas_ism_render_sf( float gain, prev_gain; float tc_local[MAX_NUM_OBJECTS][L_FRAME48k]; float *p_tc[MAX_NUM_OBJECTS]; -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX int16_t ism_md_subframe_update_jbm, slots_to_render, first_sf, last_sf, subframe_idx; int16_t n_samples_rendered_loop; -#endif -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX /* loop for synthesis, assume we always have to render in multiples of 5ms subframes with spills */ slots_to_render = min( st_ivas->hTcBuffer->num_slots - st_ivas->hTcBuffer->slots_rendered, n_samples_to_render / st_ivas->hTcBuffer->n_samples_granularity ); first_sf = st_ivas->hTcBuffer->subframes_rendered; @@ -171,7 +168,6 @@ void ivas_ism_render_sf( slots_to_render -= st_ivas->hTcBuffer->subframe_nbslots[last_sf]; last_sf++; } -#endif num_objects = st_ivas->nchan_transport; if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) @@ -184,7 +180,6 @@ void ivas_ism_render_sf( tc_offset = st_ivas->hTcBuffer->n_samples_rendered; interp_offset = st_ivas->hTcBuffer->n_samples_rendered; -#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 ) { @@ -194,7 +189,6 @@ void ivas_ism_render_sf( { ism_md_subframe_update_jbm = st_ivas->hTcBuffer->nb_subframes - 2; } -#endif if ( st_ivas->hDecoderConfig->Opt_tsm ) { @@ -217,21 +211,15 @@ void ivas_ism_render_sf( set_f( output_f[i], 0.0f, n_samples_to_render ); } -#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 if ( st_ivas->hCombinedOrientationData && 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( n_samples_in_subframe, n_samples_in_subframe, st_ivas->hIsmRendererData->interpolator ); -#else - ivas_jbm_dec_get_adapted_linear_interpolator( n_samples_to_render, n_samples_to_render, st_ivas->hIsmRendererData->interpolator ); -#endif interp_offset = 0; } @@ -240,7 +228,6 @@ void ivas_ism_render_sf( /* Combined rotation: rotate the object positions depending the head and external orientations */ if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] == 1 ) { -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX if ( subframe_idx >= ism_md_subframe_update_jbm ) { rotateAziEle( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat[st_ivas->hCombinedOrientationData->subframe_idx], st_ivas->hIntSetup.is_planar_setup ); @@ -249,9 +236,6 @@ void ivas_ism_render_sf( { rotateAziEle( st_ivas->hIsmMetaData[i]->last_azimuth, st_ivas->hIsmMetaData[i]->last_elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat[st_ivas->hCombinedOrientationData->subframe_idx], st_ivas->hIntSetup.is_planar_setup ); } -#else - rotateAziEle( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat[0], st_ivas->hIntSetup.is_planar_setup ); -#endif if ( st_ivas->hEFAPdata != NULL ) { efap_determine_gains( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains[i], azimuth, elevation, EFAP_MODE_EFAP ); @@ -272,18 +256,10 @@ void ivas_ism_render_sf( { g1 = &st_ivas->hIsmRendererData->interpolator[interp_offset]; tc = p_tc[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 = 1.0f - *g1; -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX output_f[j2][k + n_samples_rendered_loop] += ( *( g1++ ) * gain + g2 * prev_gain ) * *( tc++ ); -#else - output_f[j2][k] += ( *( g1++ ) * gain + g2 * prev_gain ) * *( tc++ ); -#endif } } @@ -293,19 +269,12 @@ void ivas_ism_render_sf( st_ivas->hIsmRendererData->prev_gains[i][j] = gain; } } -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX p_tc[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 += n_samples_in_subframe; if ( st_ivas->renderer_type == RENDERER_TD_PANNING ) { @@ -315,7 +284,6 @@ void ivas_ism_render_sf( tc_offset += n_samples_in_subframe; interp_offset += n_samples_in_subframe; } -#endif return; } -- GitLab From a8df9142a179bdff45d006acefb639dfab6fcbaf Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 19 May 2025 13:31:07 +0200 Subject: [PATCH 10/10] formatting --- lib_dec/ivas_mc_paramupmix_dec.c | 1 - lib_dec/lib_dec.c | 10 ++++---- lib_rend/ivas_stat_rend.h | 6 ++--- lib_rend/lib_rend.c | 44 +++++++++++--------------------- lib_util/hrtf_file_reader.c | 7 +++-- 5 files changed, 26 insertions(+), 42 deletions(-) diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index 405eeb47f..5f0ef7afc 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -274,7 +274,6 @@ void ivas_mc_paramupmix_dec_render( /* update combined orientation access index */ ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_sf ); } - } *nSamplesAvailable = ( st_ivas->hTcBuffer->num_slots - st_ivas->hTcBuffer->slots_rendered ) * slot_size; diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 17fbc607b..fd5f57385 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -1751,7 +1751,7 @@ ivas_error IVAS_DEC_FeedHeadTrackData( const int16_t subframe_idx, /* i : subframe index */ const ISAR_SPLIT_REND_ROT_AXIS rot_axis /* i : external control for rotation axis for split rendering */ #else - const int16_t subframe_idx /* i : subframe index */ + const int16_t subframe_idx /* i : subframe index */ #endif ) { @@ -1960,7 +1960,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 */ ) { @@ -1982,7 +1982,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 */ ) { @@ -2004,7 +2004,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 */ ) { @@ -2026,7 +2026,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 dbef7773a..2f5b7e0ac 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -1149,9 +1149,9 @@ typedef struct ivas_binaural_td_rendering_struct TDREND_SRC_t *Sources[MAX_NUM_TDREND_CHANNELS]; - float Gain; /* Mixer gain */ - TDREND_MIX_Listener_t *Listener_p; /* The virtual listener */ - TDREND_HRFILT_FiltSet_t *HrFiltSet_p; /* HR filter set */ + float Gain; /* Mixer gain */ + TDREND_MIX_Listener_t *Listener_p; /* The virtual listener */ + TDREND_HRFILT_FiltSet_t *HrFiltSet_p; /* HR filter set */ TDREND_HRFILT_FiltSet_t **pHrFiltSet_p; /* HR filter set */ int16_t UseCommonDistAttenModel; /* Use common dist atten model (TRUE/FALSE) */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 735dc82c8..3d1f9b518 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -52,7 +52,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 */ /*-------------------------------------------------------------------* @@ -1336,10 +1336,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; @@ -2247,13 +2245,11 @@ static ivas_error initMcBinauralRendering( /* open CREND */ #ifdef SPLIT_REND_WITH_HEAD_ROT if ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, - hMixconv - , + 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 ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, - hMixconv - , + hMixconv, outSampleRate ) ) != IVAS_ERR_OK ) #endif { @@ -2380,10 +2376,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 int16_t i; @@ -2454,10 +2448,8 @@ static ivas_error setRendInputActiveMc( if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) #endif { - if ( ( error = initMcBinauralRendering( inputMc, inConfig, outConfig, hRendCfg - , - hrtfs->hSetOfHRTF - , + if ( ( error = initMcBinauralRendering( inputMc, inConfig, outConfig, hRendCfg, + hrtfs->hSetOfHRTF, FALSE ) ) != IVAS_ERR_OK ) { return error; @@ -2623,10 +2615,8 @@ static ivas_error initSbaPanGainsForSbaOut( static ivas_error updateSbaPanGains( input_sba *inputSba, const AUDIO_CONFIG outConfig, - RENDER_CONFIG_DATA *hRendCfg - , - IVAS_DEC_HRTF_CREND_HANDLE hMixconv -) + RENDER_CONFIG_DATA *hRendCfg, + IVAS_DEC_HRTF_CREND_HANDLE hMixconv ) { ivas_error error; AUDIO_CONFIG inConfig; @@ -2758,8 +2748,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 ) @@ -2861,8 +2850,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. */ @@ -8663,10 +8651,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 ) { int16_t i; ivas_error error; diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index f2483c5cb..418c77306 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -1983,10 +1983,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