diff --git a/apps/decoder.c b/apps/decoder.c index 4db62d0f1e8517f266aa0fb8f3de33bab0295c74..e0d4ab22c6dfcaae7c682ded13abd5e16135fcd8 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -160,9 +160,6 @@ typedef struct char *hrtfFileName; IVAS_DEC_HRTF_HANDLE *hHrtfTD; -#ifndef FIX_1227_Crend_HRTF_LOADING_OPTIM - IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF; -#endif IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics; @@ -171,12 +168,7 @@ typedef struct IVAS_BIN_RENDERER_TYPE binaural_renderer_sec; IVAS_BIN_RENDERER_TYPE binaural_renderer_sec_old; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM IVAS_AUDIO_CONFIG hrtf_set_audio_cfg; -#else - IVAS_AUDIO_CONFIG intern_audio_config; - int16_t room_reverb_flag; -#endif } IVAS_DEC_HRTF_BINARY_WRAPPER; @@ -189,11 +181,7 @@ static bool parseCmdlIVAS_dec( int16_t argc, char **argv, DecArguments *arg ); static void usage_dec( void ); static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec ); -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM static ivas_error load_hrtf_from_file( IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, IVAS_DEC_HANDLE hIvasDec, const IVAS_AUDIO_CONFIG OutputConfig, const int32_t output_Fs ); -#else -static ivas_error IVAS_DEC_LoadHrtfFromFile( IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, IVAS_DEC_HANDLE hIvasDec, const int32_t output_Fs ); -#endif #ifdef DEBUGGING static ivas_error printBitstreamInfoVoip( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HANDLE hIvasDec ); static int16_t app_own_random( int16_t *seed ); @@ -247,10 +235,7 @@ int main( reset_mem( USE_BYTES ); #endif - hHrtfBinary.hHrtfTD = NULL; /* just to avoid compilation warning */ -#ifndef FIX_1227_Crend_HRTF_LOADING_OPTIM - hHrtfBinary.hSetOfHRTF = NULL; /* just to avoid compilation warning */ -#endif + hHrtfBinary.hHrtfTD = NULL; /* just to avoid compilation warning */ hHrtfBinary.hHrtfStatistics = NULL; /* just to avoid compilation warning */ splitRendBits.bits_buf = splitRendBitsBuf; @@ -734,12 +719,7 @@ int main( hHrtfBinary.hrtfFileName = arg.hrtfFileName; hHrtfBinary.binaural_renderer = IVAS_BIN_RENDERER_TYPE_NONE; hHrtfBinary.binaural_renderer_sec = IVAS_BIN_RENDERER_TYPE_NONE; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM hHrtfBinary.hrtf_set_audio_cfg = IVAS_AUDIO_CONFIG_INVALID; -#else - hHrtfBinary.room_reverb_flag = 0; - hHrtfBinary.intern_audio_config = IVAS_AUDIO_CONFIG_INVALID; -#endif } /*------------------------------------------------------------------------------------------* @@ -818,9 +798,6 @@ cleanup: if ( arg.hrtfReaderEnabled ) { destroy_td_hrtf( hHrtfBinary.hHrtfTD ); -#ifndef FIX_1227_Crend_HRTF_LOADING_OPTIM - destroy_SetOfHRTF( hHrtfBinary.hSetOfHRTF ); -#endif destroy_hrtf_statistics( hHrtfBinary.hHrtfStatistics ); } @@ -2372,11 +2349,7 @@ static ivas_error decodeG192( /* Read main parameters from the bitstream to set-up the decoder */ hHrtfBinary->binaural_renderer_old = hHrtfBinary->binaural_renderer; hHrtfBinary->binaural_renderer_sec_old = hHrtfBinary->binaural_renderer_sec; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( ( error = IVAS_DEC_ReadFormat( hIvasDec, &hHrtfBinary->binaural_renderer, &hHrtfBinary->binaural_renderer_sec, &hHrtfBinary->hrtf_set_audio_cfg ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_ReadFormat( hIvasDec, &hHrtfBinary->binaural_renderer, &hHrtfBinary->binaural_renderer_sec, &hHrtfBinary->room_reverb_flag, &hHrtfBinary->intern_audio_config ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2387,11 +2360,7 @@ static ivas_error decodeG192( /* Load HRTF binary file data */ if ( arg.hrtfReaderEnabled ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( ( error = load_hrtf_from_file( hHrtfBinary, hIvasDec, arg.outputConfig, arg.output_Fs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_LoadHrtfFromFile( hHrtfBinary, hIvasDec, arg.output_Fs ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nIVAS_DEC_LoadHrtfFromFile failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; @@ -3287,11 +3256,7 @@ static ivas_error decodeVoIP( /* Read main parameters from the bitstream to set-up the decoder */ hHrtf->binaural_renderer_old = hHrtf->binaural_renderer; hHrtf->binaural_renderer_sec_old = hHrtf->binaural_renderer_sec; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( ( error = IVAS_DEC_ReadFormat( hIvasDec, &hHrtf->binaural_renderer, &hHrtf->binaural_renderer_sec, &hHrtf->hrtf_set_audio_cfg ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_ReadFormat( hIvasDec, &hHrtf->binaural_renderer, &hHrtf->binaural_renderer_sec, &hHrtf->room_reverb_flag, &hHrtf->intern_audio_config ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -3302,11 +3267,7 @@ static ivas_error decodeVoIP( /* Load HRTF binary file data */ if ( arg.hrtfReaderEnabled ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( ( error = load_hrtf_from_file( hHrtf, hIvasDec, arg.outputConfig, arg.output_Fs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_LoadHrtfFromFile( hHrtf, hIvasDec, arg.output_Fs ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nIVAS_DEC_LoadHrtfFromFile failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; @@ -3697,7 +3658,6 @@ static IVAS_DEC_FORCED_REND_MODE parseForcedRendModeDec( #endif -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM /*---------------------------------------------------------------------* * load_hrtf_from_file() * @@ -3710,18 +3670,6 @@ static ivas_error load_hrtf_from_file( const IVAS_AUDIO_CONFIG OutputConfig, /* i : output audio configuration */ const int32_t output_Fs /* i : output sampling rate */ ) -#else -/*---------------------------------------------------------------------* - * IVAS_DEC_LoadHrtfFromFile() - * - * - *---------------------------------------------------------------------*/ - -static ivas_error IVAS_DEC_LoadHrtfFromFile( - IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, - IVAS_DEC_HANDLE hIvasDec, - const int32_t output_Fs ) -#endif { ivas_error error; IVAS_BIN_RENDERER_TYPE binaural_renderer, binaural_renderer_sec; @@ -3747,13 +3695,6 @@ static ivas_error IVAS_DEC_LoadHrtfFromFile( destroy_td_hrtf( hHrtfBinary->hHrtfTD ); } -#ifndef FIX_1227_Crend_HRTF_LOADING_OPTIM - if ( !( binaural_renderer == IVAS_BIN_RENDERER_TYPE_CREND || binaural_renderer == IVAS_BIN_RENDERER_TYPE_DEFAULT ) && hHrtfBinary->hSetOfHRTF != NULL ) - { - destroy_SetOfHRTF( hHrtfBinary->hSetOfHRTF ); - } - -#endif if ( ( error = IVAS_DEC_HRTF_binary_close( hIvasDec, hHrtfBinary->binaural_renderer_old ) ) != IVAS_ERR_OK ) { return error; @@ -3801,22 +3742,14 @@ static ivas_error IVAS_DEC_LoadHrtfFromFile( if ( binaural_renderer == IVAS_BIN_RENDERER_TYPE_CREND || binaural_renderer == IVAS_BIN_RENDERER_TYPE_DEFAULT ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM IVAS_DEC_HRTF_CREND_HANDLE *hHrtfCrend = NULL; if ( ( error = IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hHrtfCrend ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hHrtfBinary->hSetOfHRTF ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nIVAS_DEC_GetHrtfCRendHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); return error; } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = load_Crend_HRTF_from_binary( *hHrtfCrend, hHrtfBinary->hrtfReader, OutputConfig, hHrtfBinary->hrtf_set_audio_cfg, output_Fs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = create_SetOfHRTF_from_binary( *hHrtfBinary->hSetOfHRTF, hHrtfBinary->hrtfReader, output_Fs ) ) != IVAS_ERR_OK ) -#endif { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { @@ -3825,11 +3758,7 @@ static ivas_error IVAS_DEC_LoadHrtfFromFile( } else { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM destroy_crend_hrtf( hHrtfCrend ); -#else - destroy_SetOfHRTF( hHrtfBinary->hSetOfHRTF ); -#endif } } } @@ -3843,11 +3772,7 @@ static ivas_error IVAS_DEC_LoadHrtfFromFile( return error; } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, OutputConfig, hHrtfBinary->hrtf_set_audio_cfg, hHrtfBinary->hrtfReader ) ) != IVAS_ERR_OK ) -#else - if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, hHrtfBinary->room_reverb_flag, hHrtfBinary->intern_audio_config, hHrtfBinary->hrtfReader ) ) != IVAS_ERR_OK ) -#endif { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { diff --git a/apps/renderer.c b/apps/renderer.c index 22ffa4838dbae98e8a31691f9d806c2d1b8ab20f..5df4cc9b4f6379120f5f2b8330648bb4b3270971 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -665,11 +665,7 @@ int main( SplitRendBFIFileReader *splitRendBFIReader = NULL; Vector3PairFileReader *referenceVectorReader = NULL; hrtfFileReader *hrtfFileReader = NULL; -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM IVAS_DEC_HRTF_CREND_HANDLE *hHrtfCrend = NULL; -#else - IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF = NULL; -#endif IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv = NULL; IVAS_DEC_HRTF_PARAMBIN_HANDLE *hHrtfParambin = NULL; IVAS_DEC_HRTF_HANDLE *hHrtfTD = NULL; @@ -928,17 +924,12 @@ int main( } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = IVAS_REND_GetHrtfCRendHandle( hIvasRend, &hHrtfCrend ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_REND_GetHrtfCRendHandle( hIvasRend, &hSetOfHRTF ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nIVAS_Rend_GetHrtfCRendHandle failed: %s\n\n", ivas_error_to_string( error ) ); goto cleanup; } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM IVAS_AUDIO_CONFIG hrtf_set_audio_cfg = IVAS_AUDIO_CONFIG_7_1_4; if ( args.inConfig.ambisonicsBuses->audioConfig != IVAS_AUDIO_CONFIG_INVALID && args.outConfig.audioConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { @@ -946,9 +937,6 @@ int main( } if ( ( error = load_Crend_HRTF_from_binary( *hHrtfCrend, hrtfFileReader, args.outConfig.audioConfig, hrtf_set_audio_cfg, args.sampleRate ) ) != IVAS_ERR_OK ) -#else - if ( ( error = create_SetOfHRTF_from_binary( *hSetOfHRTF, hrtfFileReader, args.sampleRate ) ) != IVAS_ERR_OK ) -#endif { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { @@ -957,11 +945,7 @@ int main( } else { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM destroy_crend_hrtf( hHrtfCrend ); -#else - destroy_SetOfHRTF( hSetOfHRTF ); -#endif } } @@ -971,11 +955,7 @@ int main( goto cleanup; } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, args.outConfig.audioConfig, args.inConfig.ambisonicsBuses->audioConfig, hrtfFileReader ) ) != IVAS_ERR_OK ) -#else - if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, 0, IVAS_AUDIO_CONFIG_INVALID, hrtfFileReader ) ) != IVAS_ERR_OK ) -#endif { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { @@ -1982,9 +1962,6 @@ cleanup: Vector3PairFileReader_close( &referenceVectorReader ); destroy_td_hrtf( hHrtfTD ); -#ifndef FIX_1227_Crend_HRTF_LOADING_OPTIM - destroy_SetOfHRTF( hSetOfHRTF ); -#endif destroy_hrtf_statistics( hHrtfStatistics ); IVAS_REND_Close( &hIvasRend ); IsmPositionProvider_close( positionProvider ); @@ -2527,9 +2504,7 @@ static CmdlnArgs defaultArgs( args.outConfig.audioConfig = IVAS_AUDIO_CONFIG_INVALID; args.outConfig.outSetupCustom.num_spk = 0; args.outConfig.outSetupCustom.num_lfe = 0; -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM args.inConfig.ambisonicsBuses->audioConfig = IVAS_AUDIO_CONFIG_INVALID; -#endif for ( int32_t i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) { diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index 16614a929aac45f348d23167a627eadb570bf3d7..aeeb3dda6a6cc18b6025d44aecdf3caa2252b597 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -175,11 +175,7 @@ typedef struct ivas_masa_metadata_frame_struct *IVAS_MASA_METADATA_HANDLE; typedef struct ivas_masa_decoder_ext_out_meta_struct *IVAS_MASA_DECODER_EXT_OUT_META_HANDLE; typedef struct TDREND_HRFILT_FiltSet_struct *IVAS_DEC_HRTF_HANDLE; -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM typedef struct ivas_hrtf_crend_structure *IVAS_DEC_HRTF_CREND_HANDLE; -#else -typedef struct ivas_hrtfs_crend_structure *IVAS_DEC_HRTF_CREND_HANDLE; -#endif typedef struct ivas_hrtfs_fastconv_struct *IVAS_DEC_HRTF_FASTCONV_HANDLE; typedef struct ivas_hrtfs_parambin_struct *IVAS_DEC_HRTF_PARAMBIN_HANDLE; typedef struct ivas_hrtfs_statistics_struct *IVAS_DEC_HRTF_STATISTICS_HANDLE; diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 786a6d436b0665309802221619a0be173a179bb9..f12ee0330adffd7ebfd290ff5bbeb913e5680c52 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1495,19 +1495,6 @@ typedef enum #define BINAURAL_COHERENCE_DIFFERENCE_BINS 9 /* Number of bins for direction-dependent diffuse-field binaural coherence */ -#ifndef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM -typedef enum -{ - BINAURAL_INPUT_AUDIO_CONFIG_INVALID, - BINAURAL_INPUT_AUDIO_CONFIG_COMBINED, /* 5_1, 5_1_2, 5_1_4, 7_1, 7_1_4 */ - BINAURAL_INPUT_AUDIO_CONFIG_HOA3, /* HOA3 */ - BINAURAL_INPUT_AUDIO_CONFIG_HOA2, /* HOA2 */ - BINAURAL_INPUT_AUDIO_CONFIG_FOA, /* FOA */ - BINAURAL_INPUT_AUDIO_CONFIG_UNDEFINED /* Not used */ - -} BINAURAL_INPUT_AUDIO_CONFIG; - -#endif #define HEADROT_ORDER 3 #define HEADROT_SHMAT_DIM ( ( HEADROT_ORDER + 1 ) * ( HEADROT_ORDER + 1 ) ) #define HEADROT_SHMAT_DIM2 ( HEADROT_SHMAT_DIM * HEADROT_SHMAT_DIM ) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 3513df00a49118ac63ae8764156448142edb4ce6..6fea944d4f02b1ab1b03b9ce65dd52ebf75b8a56 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5136,13 +5136,7 @@ void ivas_init_binaural_hrtf( ivas_error ivas_allocate_binaural_hrtf( HRTFS_FASTCONV *HrtfFastConv, /* i/o: FASTCONV HRTF structure */ -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM const int16_t n_channels, /* i : number of input channels */ -#else - const AUDIO_CONFIG input_config, /* i : input audio configuration */ - const BINAURAL_INPUT_AUDIO_CONFIG bin_input_config, /* i : binaural input audio config */ - const RENDERER_TYPE renderer_type, /* i : renderer type */ -#endif const int16_t allocate_init_flag /* i : Memory allocation flag */ ); diff --git a/lib_com/options.h b/lib_com/options.h index 059877b9b26b50818d4ccfbb5e5bb63a4bfdcd37..e31bf15805674a6ce7de8813d7bbb0975d0ce091 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -160,9 +160,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define TMP_FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add error check for unsupported config: split rendering with VoIP mode */ -#define FIX_1226_FASTCONV_HRTF_LOADING_OPTIM /* VA: issue 1226: for FastConv binaural renderer in decoder, load only HTRT coefficient set that is needed */ -#define FIX_1227_Crend_HRTF_LOADING_OPTIM /* VA: issue 1227: for Crend binaural renderer in decoder, load only HTRT coefficient set that is needed */ -#define FIX_1222_OMASA_DEC_CHANNEL_BUFFERS /* VA: issue 1222: Reduction of the number of channel buffers in OMASA decoder */ #define FIX_1228_SAMPLING_RATE_MISMATCH_IN_HRTF_FILE /* VA: issue 1228: Exit the processing when a HRTF binary file with wrong sampling rate is provided */ @@ -174,10 +171,6 @@ /* all switches in this category should start with "NONBE_" */ #define NONBE_FIX_1176_OSBA_REVERB_JBM_ASAN_ERROR /* Ericsson: Issue 1176, fix in TDREND_firfilt for subframes shorter than the filter length */ -#define NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION /* Ericsson: Issue 1196, Always apply filter interpolation for each subframe */ -#define NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH /* VA: issue 1220: fix bug in renderer flush in OMASA 1ISM JBM bitrate switching */ -#define NONBE_1229_FIX_ISM1_DPID /* Eri: issue 1229: fix bug causing ISM 1 to use default -dpid instead of the specified one */ -#define NONBE_1233_HQ_CLASSIFIER_DIV_BY_ZERO /* Eri: issue 1233: Address possible division by zero in hf_spectrum_sparseness() */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index a9075b1f0dcb257079e210f1ed52266eb3642695..0f195330a0ffa239c1af88159281c65e92d55f85 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -165,16 +165,10 @@ static ivas_error ivas_binRenderer_convModuleOpen( hBinRenderer->nInChannels = ( audioCfg2channels( input_config ) - isLoudspeaker ); } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM hBinRenConvModule->numTaps = hHrtf->ntaps; -#endif if ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { -#ifndef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - hBinRenConvModule->numTaps = hHrtf->ntaps_brir; - -#endif /* Use variable order filtering */ bandIdx = 0; for ( ; bandIdx < 5; bandIdx++ ) @@ -200,32 +194,6 @@ static ivas_error ivas_binRenderer_convModuleOpen( } else { -#ifndef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - if ( hBinRenderer->ivas_format == SBA_FORMAT ) - { - if ( input_config == IVAS_AUDIO_CONFIG_HOA3 ) - { - hBinRenConvModule->numTaps = hHrtf->ntaps_hrir_hoa3; - } - else if ( input_config == IVAS_AUDIO_CONFIG_HOA2 ) - { - hBinRenConvModule->numTaps = hHrtf->ntaps_hrir_hoa2; - } - else if ( input_config == IVAS_AUDIO_CONFIG_FOA ) - { - hBinRenConvModule->numTaps = hHrtf->ntaps_hrir_foa; - } - else - { - return IVAS_ERR_INVALID_INPUT_FORMAT; - } - } - else - { - hBinRenConvModule->numTaps = hHrtf->ntaps_hrir; - } - -#endif /* Use fixed order filtering */ bandIdx = 0; for ( ; bandIdx < hBinRenderer->conv_band; bandIdx++ ) @@ -334,9 +302,7 @@ static ivas_error ivas_binRenderer_convModuleOpen( { int16_t tmp = 0; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM tmp = chIdx; -#endif if ( isLoudspeaker ) { if ( input_config == IVAS_AUDIO_CONFIG_5_1 ) @@ -367,72 +333,10 @@ static ivas_error ivas_binRenderer_convModuleOpen( #endif } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM hBinRenConvModule->filterTapsLeftReal[bandIdx][chIdx] = hHrtf->leftReal[bandIdx][tmp]; hBinRenConvModule->filterTapsLeftImag[bandIdx][chIdx] = hHrtf->leftImag[bandIdx][tmp]; hBinRenConvModule->filterTapsRightReal[bandIdx][chIdx] = hHrtf->rightReal[bandIdx][tmp]; hBinRenConvModule->filterTapsRightImag[bandIdx][chIdx] = hHrtf->rightImag[bandIdx][tmp]; -#else - if ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) - { - - if ( isLoudspeaker ) - { - hBinRenConvModule->filterTapsLeftReal[bandIdx][chIdx] = hHrtf->leftBRIRReal[bandIdx][tmp]; - hBinRenConvModule->filterTapsLeftImag[bandIdx][chIdx] = hHrtf->leftBRIRImag[bandIdx][tmp]; - hBinRenConvModule->filterTapsRightReal[bandIdx][chIdx] = hHrtf->rightBRIRReal[bandIdx][tmp]; - hBinRenConvModule->filterTapsRightImag[bandIdx][chIdx] = hHrtf->rightBRIRImag[bandIdx][tmp]; - } -#ifdef DEBUGGING - else - { - /* HOA3 filter coefficients */ - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error: The tables corresponding to HOA3 for BRIR are missing \n\n" ); - } -#endif - } - else - { - if ( isLoudspeaker ) - { - hBinRenConvModule->filterTapsLeftReal[bandIdx][chIdx] = hHrtf->leftHRIRReal[bandIdx][tmp]; - hBinRenConvModule->filterTapsLeftImag[bandIdx][chIdx] = hHrtf->leftHRIRImag[bandIdx][tmp]; - hBinRenConvModule->filterTapsRightReal[bandIdx][chIdx] = hHrtf->rightHRIRReal[bandIdx][tmp]; - hBinRenConvModule->filterTapsRightImag[bandIdx][chIdx] = hHrtf->rightHRIRImag[bandIdx][tmp]; - } - else - { - if ( input_config == IVAS_AUDIO_CONFIG_HOA3 ) - { - /* HOA3 filter coefficients */ - hBinRenConvModule->filterTapsLeftReal[bandIdx][chIdx] = hHrtf->leftHRIRReal_HOA3[bandIdx][chIdx]; - hBinRenConvModule->filterTapsLeftImag[bandIdx][chIdx] = hHrtf->leftHRIRImag_HOA3[bandIdx][chIdx]; - hBinRenConvModule->filterTapsRightReal[bandIdx][chIdx] = hHrtf->rightHRIRReal_HOA3[bandIdx][chIdx]; - hBinRenConvModule->filterTapsRightImag[bandIdx][chIdx] = hHrtf->rightHRIRImag_HOA3[bandIdx][chIdx]; - } - else if ( input_config == IVAS_AUDIO_CONFIG_HOA2 ) - { - /* HOA2 filter coefficients */ - hBinRenConvModule->filterTapsLeftReal[bandIdx][chIdx] = hHrtf->leftHRIRReal_HOA2[bandIdx][chIdx]; - hBinRenConvModule->filterTapsLeftImag[bandIdx][chIdx] = hHrtf->leftHRIRImag_HOA2[bandIdx][chIdx]; - hBinRenConvModule->filterTapsRightReal[bandIdx][chIdx] = hHrtf->rightHRIRReal_HOA2[bandIdx][chIdx]; - hBinRenConvModule->filterTapsRightImag[bandIdx][chIdx] = hHrtf->rightHRIRImag_HOA2[bandIdx][chIdx]; - } - else if ( input_config == IVAS_AUDIO_CONFIG_FOA ) - { - /* FOA filter coefficients */ - hBinRenConvModule->filterTapsLeftReal[bandIdx][chIdx] = hHrtf->leftHRIRReal_FOA[bandIdx][chIdx]; - hBinRenConvModule->filterTapsLeftImag[bandIdx][chIdx] = hHrtf->leftHRIRImag_FOA[bandIdx][chIdx]; - hBinRenConvModule->filterTapsRightReal[bandIdx][chIdx] = hHrtf->rightHRIRReal_FOA[bandIdx][chIdx]; - hBinRenConvModule->filterTapsRightImag[bandIdx][chIdx] = hHrtf->rightHRIRImag_FOA[bandIdx][chIdx]; - } - else - { - return IVAS_ERR_INVALID_INPUT_FORMAT; - } - } - } -#endif } } @@ -467,7 +371,6 @@ void ivas_init_binaural_hrtf( { int16_t i; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->leftReal = NULL; HrtfFastConv->leftImag = NULL; HrtfFastConv->rightReal = NULL; @@ -477,44 +380,6 @@ void ivas_init_binaural_hrtf( HrtfFastConv->n_channels = 0; HrtfFastConv->allocate_init_flag = 0x00; HrtfFastConv->ntaps = 0; -#else - HrtfFastConv->leftHRIRReal_HOA3 = NULL; - HrtfFastConv->leftHRIRImag_HOA3 = NULL; - HrtfFastConv->rightHRIRReal_HOA3 = NULL; - HrtfFastConv->rightHRIRImag_HOA3 = NULL; - HrtfFastConv->FASTCONV_HOA3_latency_s = 0x00; - - HrtfFastConv->leftHRIRReal = NULL; - HrtfFastConv->leftHRIRImag = NULL; - HrtfFastConv->rightHRIRReal = NULL; - HrtfFastConv->rightHRIRImag = NULL; - HrtfFastConv->FASTCONV_HRIR_latency_s = 0x00; - - HrtfFastConv->leftBRIRReal = NULL; - HrtfFastConv->leftBRIRImag = NULL; - HrtfFastConv->rightBRIRReal = NULL; - HrtfFastConv->rightBRIRImag = NULL; - HrtfFastConv->FASTCONV_BRIR_latency_s = 0x00; - - HrtfFastConv->leftHRIRReal_HOA2 = NULL; - HrtfFastConv->leftHRIRImag_HOA2 = NULL; - HrtfFastConv->rightHRIRReal_HOA2 = NULL; - HrtfFastConv->rightHRIRImag_HOA2 = NULL; - HrtfFastConv->FASTCONV_HOA2_latency_s = 0x00; - - HrtfFastConv->leftHRIRReal_FOA = NULL; - HrtfFastConv->leftHRIRImag_FOA = NULL; - HrtfFastConv->rightHRIRReal_FOA = NULL; - HrtfFastConv->rightHRIRImag_FOA = NULL; - HrtfFastConv->FASTCONV_FOA_latency_s = 0x00; - - HrtfFastConv->allocate_init_flag = 0x00; - HrtfFastConv->ntaps_hrir = BINAURAL_NTAPS; - HrtfFastConv->ntaps_hrir_foa = BINAURAL_NTAPS_SBA; - HrtfFastConv->ntaps_hrir_hoa2 = BINAURAL_NTAPS_SBA; - HrtfFastConv->ntaps_hrir_hoa3 = BINAURAL_NTAPS_SBA; - HrtfFastConv->ntaps_brir = BINAURAL_NTAPS_MAX; -#endif for ( i = 0; i < CLDFB_NO_CHANNELS_MAX; i++ ) { @@ -578,18 +443,11 @@ static ivas_error ivas_alloc_pppMem( *-------------------------------------------------------------------------*/ ivas_error ivas_allocate_binaural_hrtf( - HRTFS_FASTCONV *HrtfFastConv, /* i/o: FASTCONV HRTF structure */ -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - const int16_t n_channels, /* i : number of input channels */ -#else - const AUDIO_CONFIG input_config, /* i : input audio configuration */ - const BINAURAL_INPUT_AUDIO_CONFIG bin_input_config, /* i : binaural input audio config */ - const RENDERER_TYPE renderer_type, /* i : renderer type */ -#endif + HRTFS_FASTCONV *HrtfFastConv, /* i/o: FASTCONV HRTF structure */ + const int16_t n_channels, /* i : number of input channels */ const int16_t allocate_init_flag /* i : Memory allocation flag */ ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->n_channels = n_channels; if ( ( HrtfFastConv->leftReal != NULL ) && ( HrtfFastConv->leftImag != NULL ) && ( HrtfFastConv->rightReal != NULL ) && ( HrtfFastConv->rightImag != NULL ) ) @@ -615,134 +473,6 @@ ivas_error ivas_allocate_binaural_hrtf( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HrtfFastConv->rightImag" ); } } -#else - if ( input_config == IVAS_AUDIO_CONFIG_HOA3 || bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_HOA3 ) - { - if ( ( HrtfFastConv->leftHRIRReal_HOA3 != NULL ) && ( HrtfFastConv->leftHRIRImag_HOA3 != NULL ) && ( HrtfFastConv->rightHRIRReal_HOA3 != NULL ) && ( HrtfFastConv->rightHRIRImag_HOA3 != NULL ) ) - { - return IVAS_ERR_OK; - } - else - { - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftHRIRReal_HOA3, BINAURAL_CONVBANDS, HOA3_CHANNELS, HrtfFastConv->ntaps_hrir_hoa3, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for leftHRIRReal_HOA3" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftHRIRImag_HOA3, BINAURAL_CONVBANDS, HOA3_CHANNELS, HrtfFastConv->ntaps_hrir_hoa3, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for leftHRIRImag_HOA3" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->rightHRIRReal_HOA3, BINAURAL_CONVBANDS, HOA3_CHANNELS, HrtfFastConv->ntaps_hrir_hoa3, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for rightHRIRReal_HOA3" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->rightHRIRImag_HOA3, BINAURAL_CONVBANDS, HOA3_CHANNELS, HrtfFastConv->ntaps_hrir_hoa3, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for rightHRIRImag_HOA3" ); - } - } - } - - if ( input_config == IVAS_AUDIO_CONFIG_HOA2 || bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_HOA2 ) - { - if ( ( HrtfFastConv->leftHRIRReal_HOA2 != NULL ) && ( HrtfFastConv->leftHRIRImag_HOA2 != NULL ) && ( HrtfFastConv->rightHRIRReal_HOA2 != NULL ) && ( HrtfFastConv->rightHRIRImag_HOA2 != NULL ) ) - { - return IVAS_ERR_OK; - } - else - { - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftHRIRReal_HOA2, BINAURAL_CONVBANDS, HOA2_CHANNELS, HrtfFastConv->ntaps_hrir_hoa2, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for leftHRIRReal_HOA2" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftHRIRImag_HOA2, BINAURAL_CONVBANDS, HOA2_CHANNELS, HrtfFastConv->ntaps_hrir_hoa2, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for leftHRIRImag_HOA2" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->rightHRIRReal_HOA2, BINAURAL_CONVBANDS, HOA2_CHANNELS, HrtfFastConv->ntaps_hrir_hoa2, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for rightHRIRReal_HOA2" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->rightHRIRImag_HOA2, BINAURAL_CONVBANDS, HOA2_CHANNELS, HrtfFastConv->ntaps_hrir_hoa2, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for rightHRIRImag_HOA2" ); - } - } - } - - if ( input_config == IVAS_AUDIO_CONFIG_FOA || bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_FOA ) - { - if ( ( HrtfFastConv->leftHRIRReal_FOA != NULL ) && ( HrtfFastConv->leftHRIRImag_FOA != NULL ) && ( HrtfFastConv->rightHRIRReal_FOA != NULL ) && ( HrtfFastConv->rightHRIRImag_FOA != NULL ) ) - { - return IVAS_ERR_OK; - } - else - { - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftHRIRReal_FOA, BINAURAL_CONVBANDS, FOA_CHANNELS, HrtfFastConv->ntaps_hrir_foa, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for leftHRIRReal_FOA" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftHRIRImag_FOA, BINAURAL_CONVBANDS, FOA_CHANNELS, HrtfFastConv->ntaps_hrir_foa, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for leftHRIRImag_FOA" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->rightHRIRReal_FOA, BINAURAL_CONVBANDS, FOA_CHANNELS, HrtfFastConv->ntaps_hrir_foa, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for rightHRIRReal_FOA" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->rightHRIRImag_FOA, BINAURAL_CONVBANDS, FOA_CHANNELS, HrtfFastConv->ntaps_hrir_foa, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for rightHRIRImag_FOA" ); - } - } - } - - else if ( ( renderer_type == RENDERER_BINAURAL_FASTCONV && bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) || ( renderer_type == RENDERER_BINAURAL_FASTCONV && input_config != IVAS_AUDIO_CONFIG_INVALID ) ) - { - if ( ( HrtfFastConv->leftHRIRReal == NULL ) && ( HrtfFastConv->leftHRIRImag == NULL ) && ( HrtfFastConv->rightHRIRReal == NULL ) && ( HrtfFastConv->rightHRIRImag == NULL ) ) - { - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftHRIRReal, BINAURAL_CONVBANDS, HRTF_LS_CHANNELS, HrtfFastConv->ntaps_hrir, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for leftHRIRReal" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftHRIRImag, BINAURAL_CONVBANDS, HRTF_LS_CHANNELS, HrtfFastConv->ntaps_hrir, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for leftHRIRImag" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->rightHRIRReal, BINAURAL_CONVBANDS, HRTF_LS_CHANNELS, HrtfFastConv->ntaps_hrir, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for rightHRIRReal" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->rightHRIRImag, BINAURAL_CONVBANDS, HRTF_LS_CHANNELS, HrtfFastConv->ntaps_hrir, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for rightHRIRImag" ); - } - } - } - - else if ( ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) || ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && input_config != IVAS_AUDIO_CONFIG_INVALID ) ) - { - if ( ( HrtfFastConv->leftBRIRReal == NULL ) && ( HrtfFastConv->leftBRIRImag == NULL ) && ( HrtfFastConv->rightBRIRReal == NULL ) && ( HrtfFastConv->rightBRIRImag == NULL ) ) - { - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftBRIRReal, BINAURAL_CONVBANDS, HRTF_LS_CHANNELS, HrtfFastConv->ntaps_brir, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for leftBRIRReal" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftBRIRImag, BINAURAL_CONVBANDS, HRTF_LS_CHANNELS, HrtfFastConv->ntaps_brir, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for leftBRIRImag" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->rightBRIRReal, BINAURAL_CONVBANDS, HRTF_LS_CHANNELS, HrtfFastConv->ntaps_brir, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for rightBRIRReal" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->rightBRIRImag, BINAURAL_CONVBANDS, HRTF_LS_CHANNELS, HrtfFastConv->ntaps_brir, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for rightBRIRImag" ); - } - } - } -#endif return IVAS_ERR_OK; } @@ -762,9 +492,7 @@ static ivas_error ivas_binaural_hrtf_open( { int16_t i, j; ivas_error error; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM int16_t n_channels; -#endif if ( hHrtfFastConv != NULL && *hHrtfFastConv != NULL ) { @@ -785,53 +513,32 @@ static ivas_error ivas_binaural_hrtf_open( if ( input_config == IVAS_AUDIO_CONFIG_BINAURAL || renderer_type == RENDERER_BINAURAL_FASTCONV ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->FASTCONV_latency_s = FASTCONV_HRIR_latency_s; HrtfFastConv->ntaps = BINAURAL_NTAPS; -#else - HrtfFastConv->FASTCONV_HRIR_latency_s = FASTCONV_HRIR_latency_s; -#endif } if ( input_config == IVAS_AUDIO_CONFIG_HOA2 ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->FASTCONV_latency_s = FASTCONV_HOA2_latency_s; HrtfFastConv->ntaps = BINAURAL_NTAPS_SBA; -#else - HrtfFastConv->FASTCONV_HOA2_latency_s = FASTCONV_HOA2_latency_s; -#endif } if ( input_config == IVAS_AUDIO_CONFIG_HOA3 ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->FASTCONV_latency_s = FASTCONV_HOA3_latency_s; HrtfFastConv->ntaps = BINAURAL_NTAPS_SBA; -#else - HrtfFastConv->FASTCONV_HOA3_latency_s = FASTCONV_HOA3_latency_s; -#endif } if ( input_config == IVAS_AUDIO_CONFIG_FOA ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->FASTCONV_latency_s = FASTCONV_FOA_latency_s; HrtfFastConv->ntaps = BINAURAL_NTAPS_SBA; -#else - HrtfFastConv->FASTCONV_FOA_latency_s = FASTCONV_FOA_latency_s; -#endif } if ( input_config == IVAS_AUDIO_CONFIG_BINAURAL || renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->FASTCONV_latency_s = FASTCONV_BRIR_latency_s; HrtfFastConv->ntaps = BINAURAL_NTAPS_MAX; -#else - HrtfFastConv->FASTCONV_BRIR_latency_s = FASTCONV_BRIR_latency_s; -#endif } HrtfFastConv->allocate_init_flag = 1; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM n_channels = 0; if ( ( renderer_type == RENDERER_BINAURAL_FASTCONV || renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) && input_config != IVAS_AUDIO_CONFIG_INVALID ) { @@ -855,125 +562,65 @@ static ivas_error ivas_binaural_hrtf_open( } if ( ( error = ivas_allocate_binaural_hrtf( HrtfFastConv, n_channels, HrtfFastConv->allocate_init_flag ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_allocate_binaural_hrtf( HrtfFastConv, input_config, BINAURAL_INPUT_AUDIO_CONFIG_INVALID, renderer_type, HrtfFastConv->allocate_init_flag ) ) != IVAS_ERR_OK ) -#endif { return error; } for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( renderer_type == RENDERER_BINAURAL_FASTCONV && HrtfFastConv->n_channels == HRTF_LS_CHANNELS ) -#else - if ( renderer_type == RENDERER_BINAURAL_FASTCONV ) -#endif { for ( j = 0; j < HRTF_LS_CHANNELS; j++ ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->leftReal[i][j] = leftHRIRReal[i][j]; HrtfFastConv->leftImag[i][j] = leftHRIRImag[i][j]; HrtfFastConv->rightReal[i][j] = rightHRIRReal[i][j]; HrtfFastConv->rightImag[i][j] = rightHRIRImag[i][j]; -#else - HrtfFastConv->leftHRIRReal[i][j] = leftHRIRReal[i][j]; - HrtfFastConv->leftHRIRImag[i][j] = leftHRIRImag[i][j]; - HrtfFastConv->rightHRIRReal[i][j] = rightHRIRReal[i][j]; - HrtfFastConv->rightHRIRImag[i][j] = rightHRIRImag[i][j]; -#endif } } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM else if ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && HrtfFastConv->n_channels == HRTF_LS_CHANNELS ) -#else - else if ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) -#endif { for ( j = 0; j < HRTF_LS_CHANNELS; j++ ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->leftReal[i][j] = leftBRIRReal[i][j]; HrtfFastConv->leftImag[i][j] = leftBRIRImag[i][j]; HrtfFastConv->rightReal[i][j] = rightBRIRReal[i][j]; HrtfFastConv->rightImag[i][j] = rightBRIRImag[i][j]; -#else - HrtfFastConv->leftBRIRReal[i][j] = leftBRIRReal[i][j]; - HrtfFastConv->leftBRIRImag[i][j] = leftBRIRImag[i][j]; - HrtfFastConv->rightBRIRReal[i][j] = rightBRIRReal[i][j]; - HrtfFastConv->rightBRIRImag[i][j] = rightBRIRImag[i][j]; -#endif } } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( input_config == IVAS_AUDIO_CONFIG_HOA3 && HrtfFastConv->n_channels == HOA3_CHANNELS ) -#else - if ( input_config == IVAS_AUDIO_CONFIG_HOA3 ) -#endif { for ( j = 0; j < HOA3_CHANNELS; j++ ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->leftReal[i][j] = leftHRIRReal_HOA3[i][j]; HrtfFastConv->leftImag[i][j] = leftHRIRImag_HOA3[i][j]; HrtfFastConv->rightReal[i][j] = rightHRIRReal_HOA3[i][j]; HrtfFastConv->rightImag[i][j] = rightHRIRImag_HOA3[i][j]; -#else - HrtfFastConv->leftHRIRReal_HOA3[i][j] = leftHRIRReal_HOA3[i][j]; - HrtfFastConv->leftHRIRImag_HOA3[i][j] = leftHRIRImag_HOA3[i][j]; - HrtfFastConv->rightHRIRReal_HOA3[i][j] = rightHRIRReal_HOA3[i][j]; - HrtfFastConv->rightHRIRImag_HOA3[i][j] = rightHRIRImag_HOA3[i][j]; -#endif } } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM /* Note: IVAS_AUDIO_CONFIG_HOA2 and IVAS_AUDIO_CONFIG_FOA input configs. are not relevant in internal renderer as SBA to binaural always synthesizes HOA3 output for binauralization. However, the external renderer can use them. */ -#endif -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( input_config == IVAS_AUDIO_CONFIG_HOA2 && HrtfFastConv->n_channels == HOA2_CHANNELS ) -#else - if ( input_config == IVAS_AUDIO_CONFIG_HOA2 ) -#endif { for ( j = 0; j < HOA2_CHANNELS; j++ ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->leftReal[i][j] = leftHRIRReal_HOA2[i][j]; HrtfFastConv->leftImag[i][j] = leftHRIRImag_HOA2[i][j]; HrtfFastConv->rightReal[i][j] = rightHRIRReal_HOA2[i][j]; HrtfFastConv->rightImag[i][j] = rightHRIRImag_HOA2[i][j]; -#else - HrtfFastConv->leftHRIRReal_HOA2[i][j] = leftHRIRReal_HOA2[i][j]; - HrtfFastConv->leftHRIRImag_HOA2[i][j] = leftHRIRImag_HOA2[i][j]; - HrtfFastConv->rightHRIRReal_HOA2[i][j] = rightHRIRReal_HOA2[i][j]; - HrtfFastConv->rightHRIRImag_HOA2[i][j] = rightHRIRImag_HOA2[i][j]; -#endif } } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( input_config == IVAS_AUDIO_CONFIG_FOA && HrtfFastConv->n_channels == FOA_CHANNELS ) -#else - if ( input_config == IVAS_AUDIO_CONFIG_FOA ) -#endif { for ( j = 0; j < FOA_CHANNELS; j++ ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->leftReal[i][j] = leftHRIRReal_FOA[i][j]; HrtfFastConv->leftImag[i][j] = leftHRIRImag_FOA[i][j]; HrtfFastConv->rightReal[i][j] = rightHRIRReal_FOA[i][j]; HrtfFastConv->rightImag[i][j] = rightHRIRImag_FOA[i][j]; -#else - HrtfFastConv->leftHRIRReal_FOA[i][j] = leftHRIRReal_FOA[i][j]; - HrtfFastConv->leftHRIRImag_FOA[i][j] = leftHRIRImag_FOA[i][j]; - HrtfFastConv->rightHRIRReal_FOA[i][j] = rightHRIRReal_FOA[i][j]; - HrtfFastConv->rightHRIRImag_FOA[i][j] = rightHRIRImag_FOA[i][j]; -#endif } } } @@ -1212,27 +859,7 @@ ivas_error ivas_rend_openCldfbRend( return error; } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM pCldfbRend->binaural_latency_ns = (int32_t) ( pCldfbRend->hHrtfFastConv->FASTCONV_latency_s * 1000000000.f ); -#else - if ( inConfig == IVAS_AUDIO_CONFIG_FOA ) - { - pCldfbRend->binaural_latency_ns = (int32_t) ( pCldfbRend->hHrtfFastConv->FASTCONV_FOA_latency_s * 1000000000.f ); - } - else if ( inConfig == IVAS_AUDIO_CONFIG_HOA2 ) - { - pCldfbRend->binaural_latency_ns = (int32_t) ( pCldfbRend->hHrtfFastConv->FASTCONV_HOA2_latency_s * 1000000000.f ); - } - else if ( inConfig == IVAS_AUDIO_CONFIG_HOA3 ) - { - pCldfbRend->binaural_latency_ns = (int32_t) ( pCldfbRend->hHrtfFastConv->FASTCONV_HOA3_latency_s * 1000000000.f ); - } - else - { - /* should never happen for SBA */ - return IVAS_ERR_INVALID_OUTPUT_FORMAT; - } -#endif hBinRenderer->hReverb = NULL; hBinRenderer->hEFAPdata = NULL; @@ -1355,11 +982,7 @@ ivas_error ivas_binRenderer_open( } hBinRenderer->hoa_dec_mtx = st_ivas->hoa_dec_mtx; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtfFastConv->FASTCONV_latency_s * 1000000000.f ); -#else - st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtfFastConv->FASTCONV_BRIR_latency_s * 1000000000.f ); -#endif } else { @@ -1369,41 +992,7 @@ ivas_error ivas_binRenderer_open( return error; } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtfFastConv->FASTCONV_latency_s * 1000000000.f ); -#else - if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ) - { - if ( hBinRenderer->ivas_format == MC_FORMAT ) - { - st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtfFastConv->FASTCONV_HRIR_latency_s * 1000000000.f ); - } - else - { - if ( hBinRenderer->nInChannels == HOA3_CHANNELS ) - { - st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtfFastConv->FASTCONV_HOA3_latency_s * 1000000000.f ); - } - else if ( hBinRenderer->nInChannels == HOA2_CHANNELS ) - { - st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtfFastConv->FASTCONV_HOA2_latency_s * 1000000000.f ); - } - else if ( hBinRenderer->nInChannels == FOA_CHANNELS ) - { - st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtfFastConv->FASTCONV_FOA_latency_s * 1000000000.f ); - } - else - { - return IVAS_ERR_INVALID_INPUT_FORMAT; - } - } - } - else - { - /* same value for MC or HOA both use MC BRIR*/ - st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtfFastConv->FASTCONV_BRIR_latency_s * 1000000000.f ); - } -#endif } /* Allocate memories needed for reverb module */ @@ -1625,9 +1214,7 @@ void ivas_binaural_hrtf_close( ) { int16_t allocate_init_flag; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM int16_t n_channels; -#endif if ( hHrtfFastConv == NULL || *hHrtfFastConv == NULL ) { @@ -1635,40 +1222,12 @@ void ivas_binaural_hrtf_close( } allocate_init_flag = ( *hHrtfFastConv )->allocate_init_flag; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM n_channels = ( *hHrtfFastConv )->n_channels; ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftReal, n_channels, allocate_init_flag ); ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftImag, n_channels, allocate_init_flag ); ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightReal, n_channels, allocate_init_flag ); ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightImag, n_channels, allocate_init_flag ); -#else - - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftHRIRReal, HRTF_LS_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftHRIRImag, HRTF_LS_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightHRIRReal, HRTF_LS_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightHRIRImag, HRTF_LS_CHANNELS, allocate_init_flag ); - - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftBRIRReal, HRTF_LS_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftBRIRImag, HRTF_LS_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightBRIRReal, HRTF_LS_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightBRIRImag, HRTF_LS_CHANNELS, allocate_init_flag ); - - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftHRIRReal_HOA3, HOA3_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftHRIRImag_HOA3, HOA3_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightHRIRReal_HOA3, HOA3_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightHRIRImag_HOA3, HOA3_CHANNELS, allocate_init_flag ); - - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftHRIRReal_HOA2, HOA2_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftHRIRImag_HOA2, HOA2_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightHRIRReal_HOA2, HOA2_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightHRIRImag_HOA2, HOA2_CHANNELS, allocate_init_flag ); - - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftHRIRReal_FOA, FOA_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftHRIRImag_FOA, FOA_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightHRIRReal_FOA, FOA_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightHRIRImag_FOA, FOA_CHANNELS, allocate_init_flag ); -#endif return; } diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index fff019e028ece9d4b1f923a759a0bdcc8ffd1835..cb5dfc379a5312005ecb5c92d8ad6534b4750f07 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -2175,13 +2175,8 @@ ivas_error ivas_init_decoder( } } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hHrtfCrend, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, 0, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, - st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2661,11 +2656,7 @@ void ivas_initialize_handles_dec( st_ivas->hMonoDmxRenderer = NULL; st_ivas->hCrendWrapper = NULL; st_ivas->hReverb = NULL; -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM st_ivas->hHrtfCrend = NULL; -#else - st_ivas->hSetOfHRTF = NULL; -#endif st_ivas->hHrtfFastConv = NULL; st_ivas->hHrtfParambin = NULL; st_ivas->hHrtfStatistics = NULL; @@ -2883,11 +2874,7 @@ void ivas_destroy_dec( } /* CRend binaural renderer handle */ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM ivas_HRTF_CRend_binary_close( &st_ivas->hHrtfCrend ); -#else - ivas_HRTF_CRend_binary_close( &st_ivas->hSetOfHRTF ); -#endif /* Fastconv HRTF memories */ ivas_binaural_hrtf_close( &st_ivas->hHrtfFastConv ); diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index cf215d34c7376fb26903e2344dfc7d0ffbd6a8af..73730532c7eb817381e9f9e80e9e68fe58d71b77 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -199,11 +199,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( ivas_omasa_data_close( &st_ivas->hMasaIsmData ); /* Open Crend Binaural renderer */ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hRenderConfig, st_ivas->hHrtfCrend, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, 0, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 462ee2ad329431b6d67b3c0f6c18a8b8b53d7343..3fd629a6853fa337568ac029270ecfbf079e496c 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1517,11 +1517,7 @@ ivas_error ivas_jbm_dec_flush_renderer( { if ( ism_mode_old == ISM_MASA_MODE_DISC ) { -#ifdef NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH float *tc_local[MAX_NUM_OBJECTS]; -#else - float *tc_local[MAX_TRANSPORT_CHANNELS]; -#endif for ( ch_idx = 0; ch_idx < st_ivas->nchan_ism; ch_idx++ ) { @@ -1529,29 +1525,10 @@ ivas_error ivas_jbm_dec_flush_renderer( mvr2r( st_ivas->hMasaIsmData->delayBuffer[ch_idx], tc_local[ch_idx], st_ivas->hMasaIsmData->delayBuffer_size ); } -#ifdef NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH if ( ( error = ivas_td_binaural_renderer_sf( st_ivas, p_output, hTcBuffer->n_samples_granularity ) ) != IVAS_ERR_OK ) { return error; } -#else - if ( st_ivas->nchan_ism > 0 ) - { - if ( ( error = ivas_td_binaural_renderer_sf( st_ivas, p_output, hTcBuffer->n_samples_granularity ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else - { - for ( ch_idx = 0; ch_idx < st_ivas->hDecoderConfig->nchan_out; ch_idx++ ) - { - set_zero( p_output[ch_idx], (int16_t) ( *nSamplesRendered ) ); - } - st_ivas->hTcBuffer->slots_rendered += 1; - st_ivas->hTcBuffer->subframes_rendered += 1; - } -#endif } } else if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index e0b12fd9627a9ef72629e19b9de36c24a6d158c5..f0cb1b4563b173d574924494f6a502a395149fb7 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -1483,11 +1483,7 @@ ivas_error ivas_masa_dec_reconfigure( { if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { -#ifdef FIX_1222_OMASA_DEC_CHANNEL_BUFFERS tc_nchan_to_allocate = BINAURAL_CHANNELS + st_ivas->nchan_ism; -#else - tc_nchan_to_allocate = 2 * BINAURAL_CHANNELS + 2; -#endif } else { diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index b7c539301398e9a4e1e21131ffdf4ad7d7740f00..1479ba3c25bfb5b333ce319b1aa84f8282c51949 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -1241,11 +1241,7 @@ static ivas_error ivas_mc_dec_reconfig( } else if ( st_ivas->hCrendWrapper == NULL && ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hHrtfCrend, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, 0, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index 4dc1732dbed7622402cdb584fa0234d66adbdd1b..9d19ab44f6b7184aa8144f8923fa19f2cadf7298 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -99,11 +99,7 @@ ivas_error ivas_td_binaural_renderer_sf( int16_t nchan_ism_internal, nchan_ism, ch_offset; /* Set the number of ISMs */ -#ifdef NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH if ( st_ivas->ivas_format == MASA_ISM_FORMAT || ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->nchan_ism > 0 ) ) -#else - if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) -#endif { nchan_ism_internal = st_ivas->nchan_ism; nchan_ism = st_ivas->nchan_ism; @@ -235,11 +231,7 @@ ivas_error ivas_td_binaural_renderer_sf( /* Render subframe */ /* ism_md_subframe_update_jbm != subframe_idx: trigger update only for ism_md_subframe_update_jbm == subframe_idx, where then the two TDREND_GetMix()-arguments subframe_idx and ism_md_subframe_update are equal, and we want to enforce the update inside TDREND_GetMix to use subframe_idx == 0 */ -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION if ( ( error = TDREND_GetMix( st_ivas->hBinRendererTd, output_f_local, output_frame, 0 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = TDREND_GetMix( st_ivas->hBinRendererTd, output_f_local, output_frame, 0, ism_md_subframe_update_jbm != subframe_idx ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index c6731720441adb72f2597e93e0a97d7c8c4b806e..27ce47fbba167a2b5c40842d45cdb7279802e49b 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -748,26 +748,14 @@ ivas_error ivas_omasa_dirac_td_binaural_jbm( ) { int16_t n; -#ifdef NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH float data_separated_objects[BINAURAL_CHANNELS][L_FRAME48k]; -#else - float data_separated_objects[MAX_NUM_OBJECTS][L_FRAME48k]; -#endif ivas_error error; -#ifdef NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH float *p_sepobj[BINAURAL_CHANNELS]; -#else - float *p_sepobj[MAX_NUM_OBJECTS]; -#endif int16_t slot_idx_start; slot_idx_start = st_ivas->hSpatParamRendCom->slots_rendered; -#ifdef NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH for ( n = 0; n < BINAURAL_CHANNELS; n++ ) -#else - for ( n = 0; n < MAX_NUM_OBJECTS; n++ ) -#endif { p_sepobj[n] = &data_separated_objects[n][0]; } diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 4dce5c64ce35288219a5a063eb16572bb1ae5607..ae68c9abca9a1017abd7bb9b34cb40b8fafa4322 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1100,11 +1100,7 @@ typedef struct Decoder_Struct MONO_DOWNMIX_RENDERER_HANDLE hMonoDmxRenderer; /* Mono downmix structure */ CREND_WRAPPER_HANDLE hCrendWrapper; /* Crend handle */ REVERB_HANDLE hReverb; /* Reverb handle */ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM HRTFS_CREND_HANDLE hHrtfCrend; /* HRTF tables for CRend binaural renderer */ -#else - HRTFS_CREND_HANDLE hSetOfHRTF; /* Set of HRTFs handle (CRend) */ -#endif HRTFS_FASTCONV_HANDLE hHrtfFastConv; /* FASTCONV HRTF tables for binaural rendering */ HRTFS_PARAMBIN_HANDLE hHrtfParambin; /* HRTF tables for parametric binauralizer */ HRTFS_STATISTICS_HANDLE hHrtfStatistics; /* HRTF statistics handle */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 8ac62b87c37a3df1b59dccb66380e8af88c048c2..0208a4d76177b8831470890b770033283b6d1fd2 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -909,12 +909,7 @@ ivas_error IVAS_DEC_ReadFormat( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IVAS_BIN_RENDERER_TYPE *binaural_renderer, /* o : binaural renderer type */ IVAS_BIN_RENDERER_TYPE *binaural_renderer_sec, /* o : secondary binaural renderer type */ -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - IVAS_AUDIO_CONFIG *hrtf_set_audio_cfg /* o : HRTF set audio config. */ -#else - int16_t *room_reverb_flag, /* o : room reverb flag */ - IVAS_AUDIO_CONFIG *intern_audio_config /* o : internal audio configuration */ -#endif + IVAS_AUDIO_CONFIG *hrtf_set_audio_cfg /* o : HRTF set audio config. */ ) { ivas_error error; @@ -923,11 +918,7 @@ ivas_error IVAS_DEC_ReadFormat( ISM_MODE ism_mode_old; MC_MODE mc_mode_old; int16_t nchan_transport_old; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM AUDIO_CONFIG intern_config_old, transport_config_old, output_config; -#else - AUDIO_CONFIG intern_config_old, transport_config_old; -#endif RENDERER_TYPE renderer_type_old; if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) @@ -944,10 +935,8 @@ ivas_error IVAS_DEC_ReadFormat( transport_config_old = st_ivas->transport_config; renderer_type_old = st_ivas->renderer_type; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM output_config = st_ivas->hDecoderConfig->output_config; -#endif if ( st_ivas->ivas_format == MONO_FORMAT ) { @@ -979,18 +968,9 @@ ivas_error IVAS_DEC_ReadFormat( break; case RENDERER_BINAURAL_FASTCONV: *binaural_renderer = IVAS_BIN_RENDERER_TYPE_FASTCONV; -#ifndef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) - { - *room_reverb_flag = 1; - } -#endif break; case RENDERER_BINAURAL_FASTCONV_ROOM: *binaural_renderer = IVAS_BIN_RENDERER_TYPE_FASTCONV; -#ifndef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - *room_reverb_flag = 1; -#endif break; case RENDERER_BINAURAL_PARAMETRIC: case RENDERER_BINAURAL_PARAMETRIC_ROOM: @@ -1002,16 +982,11 @@ ivas_error IVAS_DEC_ReadFormat( } *binaural_renderer_sec = IVAS_BIN_RENDERER_TYPE_NONE; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC && output_config == IVAS_AUDIO_CONFIG_BINAURAL ) -#else - if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL ) -#endif { *binaural_renderer_sec = IVAS_BIN_RENDERER_TYPE_TDREND; } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM *hrtf_set_audio_cfg = IVAS_AUDIO_CONFIG_INVALID; if ( *binaural_renderer == IVAS_BIN_RENDERER_TYPE_FASTCONV ) { @@ -1039,7 +1014,6 @@ ivas_error IVAS_DEC_ReadFormat( } } } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM else if ( *binaural_renderer == IVAS_BIN_RENDERER_TYPE_CREND ) { if ( st_ivas->ivas_format == ISM_FORMAT ) @@ -1059,10 +1033,6 @@ ivas_error IVAS_DEC_ReadFormat( } } } -#endif -#else - *intern_audio_config = st_ivas->intern_config; -#endif if ( ( renderer_type_old != st_ivas->renderer_type && renderer_type_old != RENDERER_DISABLE ) || ( st_ivas->ini_active_frame > 0 && ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ism_mode != ISM_MASA_MODE_DISC ) ) @@ -2707,29 +2677,16 @@ ivas_error IVAS_DEC_GetHrtfTDrendHandle( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_GetHrtfCRendHandle( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IVAS_DEC_HRTF_CREND_HANDLE **hHrtfCrend /* o : Crend HRTF handle */ -#else - IVAS_DEC_HRTF_CREND_HANDLE **hSetOfHRTF /* o : Set of HRTF handle */ -#endif ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hHrtfCrend == NULL ) { return IVAS_ERR_WRONG_PARAMS; } *hHrtfCrend = &hIvasDec->st_ivas->hHrtfCrend; -#else - if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hSetOfHRTF == NULL ) - { - return IVAS_ERR_WRONG_PARAMS; - } - - *hSetOfHRTF = &hIvasDec->st_ivas->hSetOfHRTF; -#endif return IVAS_ERR_OK; } @@ -2833,17 +2790,9 @@ ivas_error IVAS_DEC_HRTF_binary_open( } /* Crend binaural renderer */ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( binaural_renderer == IVAS_BIN_RENDERER_TYPE_CREND || binaural_renderer == IVAS_BIN_RENDERER_TYPE_DEFAULT ) && st_ivas->hHrtfCrend == NULL ) -#else - if ( ( binaural_renderer == IVAS_BIN_RENDERER_TYPE_CREND || binaural_renderer == IVAS_BIN_RENDERER_TYPE_DEFAULT ) && st_ivas->hSetOfHRTF == NULL ) -#endif { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_HRTF_CRend_binary_open( &( st_ivas->hHrtfCrend ) ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_HRTF_CRend_binary_open( &( st_ivas->hSetOfHRTF ) ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2916,11 +2865,7 @@ ivas_error IVAS_DEC_HRTF_binary_close( if ( !( binaural_renderer_old == IVAS_BIN_RENDERER_TYPE_CREND || binaural_renderer_old == IVAS_BIN_RENDERER_TYPE_DEFAULT ) ) { /* CRend binaural renderer handle */ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM ivas_HRTF_CRend_binary_close( &st_ivas->hHrtfCrend ); -#else - ivas_HRTF_CRend_binary_close( &st_ivas->hSetOfHRTF ); -#endif } if ( !( binaural_renderer_old == IVAS_BIN_RENDERER_TYPE_FASTCONV || binaural_renderer_old == IVAS_BIN_RENDERER_TYPE_DEFAULT ) ) diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 43dcfb33ba6b4df0207022722164ca489050c1b7..0fa179768a962a09f3ff17231e58956c5203d5a1 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -157,12 +157,7 @@ ivas_error IVAS_DEC_ReadFormat( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IVAS_BIN_RENDERER_TYPE *binaural_renderer, /* o : binaural renderer type */ IVAS_BIN_RENDERER_TYPE *binaural_renderer_sec,/* o: secondary binaural renderer type */ -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM IVAS_AUDIO_CONFIG *hrtf_set_audio_cfg /* o : HRTF set audio config. */ -#else - int16_t *room_reverb_flag, /* o : room reverb flag */ - IVAS_AUDIO_CONFIG *intern_audio_config /* o : internal audio configuration */ -#endif ); /*! r: decoder error code */ @@ -444,11 +439,7 @@ ivas_error IVAS_DEC_GetHrtfTDrendHandle( /*! r: error code */ ivas_error IVAS_DEC_GetHrtfCRendHandle( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM IVAS_DEC_HRTF_CREND_HANDLE **hHrtfCrend /* o : Crend HRTF handle */ -#else - IVAS_DEC_HRTF_CREND_HANDLE **hSetOfHRTF /* o : Set of HRTF handle */ -#endif ); ivas_error IVAS_DEC_GetHrtfFastConvHandle( diff --git a/lib_enc/hq_classifier_enc.c b/lib_enc/hq_classifier_enc.c index b0ef15969b11166728597de7441b65613882d699..d895cbc707b062cc07ffcab156565f4e08e37ea3 100644 --- a/lib_enc/hq_classifier_enc.c +++ b/lib_enc/hq_classifier_enc.c @@ -573,7 +573,6 @@ static int16_t hf_spectrum_sparseness( inv_rms = 0.0f; crest_mod = 0.0f; maximum( A, L_SPEC_HB, &Amax ); -#ifdef NONBE_1233_HQ_CLASSIFIER_DIV_BY_ZERO if ( Amax == 0 ) { /* For all-zero input the crest is 1.0 */ @@ -626,50 +625,6 @@ static int16_t hf_spectrum_sparseness( crest = Amax * inv_rms; crest_mod = crest_mod * inv_rms; } -#else - thr = Amax * PEAK_THRESHOLD; - movmean = 0.0f; /* avoid uninitialized warning */ - p_num = &inv_tbl[HALF_WIN_LENGTH + 1]; /* Table for division 1./(11:21) */ - for ( i = 0; i < L_SPEC_HB; i++ ) - { - inv_rms += A[i] * A[i]; - if ( A[i] < thr ) - { - low_count += 1; - } - if ( i <= HALF_WIN_LENGTH ) - { - if ( i == 0 ) - { - movmean = sum_f( &A[0], i + HALF_WIN_LENGTH + 1 ) * ( *p_num ); - } - else - { - p_num++; - movmean = movmean + ( A[i + HALF_WIN_LENGTH] - movmean ) * ( *p_num ); - } - } - else - { - if ( L_SPEC_HB <= i + HALF_WIN_LENGTH ) - { - p_num--; - movmean = movmean + ( movmean - A[i - HALF_WIN_LENGTH - 1] ) * ( *p_num ); - } - else - { - movmean = movmean + ( A[i + HALF_WIN_LENGTH] - A[i - HALF_WIN_LENGTH - 1] ) * ( *p_num ); - } - } - if ( crest_mod < movmean ) - { - crest_mod = movmean; - } - } - inv_rms = 1.0f / (float) sqrtf( inv_rms / L_SPEC_HB ); - crest = Amax * inv_rms; - crest_mod = crest_mod * inv_rms; -#endif *crest_lp = HQ_CREST_FAC_SM * ( *crest_lp ) + ( 1.0f - HQ_CREST_FAC_SM ) * crest; *crest_mod_lp = HQ_CREST_FAC_SM * ( *crest_mod_lp ) + ( 1.0f - HQ_CREST_FAC_SM ) * crest_mod; diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index 555351a985fb79475d7be91e4a82245bcd15cbe0..6ff135bbd3369d46dfa019c5bb733d12cce589d0 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -53,15 +53,9 @@ * Initialize hHrtf handle *------------------------------------------------------------------------*/ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM ivas_error ivas_Crend_hrtf_init( HRTFS_CREND_DATA *hHrtf /* i/o: HRTF handle */ ) -#else -ivas_error ivas_hrtf_init( - HRTFS_DATA *hHrtf /* i/o: HRTF handle */ -) -#endif { int16_t i, j; @@ -123,11 +117,7 @@ static ivas_error ivas_hrtf_open( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend HRTFS Handle\n" ); } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_Crend_hrtf_init( hHrtf ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_hrtf_init( hHrtf ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -175,19 +165,11 @@ static ivas_error ivas_rend_initCrend( CREND_WRAPPER *pCrend, const AUDIO_CONFIG inConfig, const AUDIO_CONFIG outConfig, -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM HRTFS_CREND_HANDLE hHrtfCrend, const int16_t ext_rend_flag, -#else - HRTFS_CREND_HANDLE hSetOfHRTF, -#endif const int32_t output_Fs ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM int16_t i, j, tmp, tmp2; -#else - int16_t i, j, tmp; -#endif int16_t nchan_in; IVAS_REND_AudioConfigType inConfigType; HRTFS_HANDLE hHrtf; @@ -209,7 +191,6 @@ static ivas_error ivas_rend_initCrend( if ( hHrtf == NULL ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( hHrtfCrend != NULL && ext_rend_flag == 0 ) { /* HRTF set loaded from binary file */ @@ -230,13 +211,6 @@ static ivas_error ivas_rend_initCrend( hHrtf->init_from_rom = 0; } } -#else - if ( ivas_hrtf_open( &hHrtf ) != IVAS_ERR_OK ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for HRTF handle" ); - } - -#endif } if ( ( error = getAudioConfigNumChannels( inConfig, &nchan_in ) ) != IVAS_ERR_OK ) @@ -250,21 +224,8 @@ static ivas_error ivas_rend_initCrend( return IVAS_ERR_INTERNAL_FATAL; } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( hHrtf->init_from_rom ) -#else - 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 ) ) || - ( ( hSetOfHRTF->hHRTF_brir_combined == NULL ) && ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) && ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) ) || - ( ( 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 ) ) ) -#endif { -#ifndef FIX_1227_Crend_HRTF_LOADING_OPTIM - hHrtf->init_from_rom = 1; -#endif if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) { hHrtf->max_num_ir -= 1; /* subtract LFE */ @@ -740,7 +701,6 @@ static ivas_error ivas_rend_initCrend( } else { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) { hHrtf->max_num_ir -= 1; /* subtract LFE */ @@ -848,195 +808,6 @@ static ivas_error ivas_rend_initCrend( } } } -#else - hHrtf->init_from_rom = 0; - if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) - { - hHrtf->max_num_ir -= 1; /* subtract LFE */ - hHrtf->gain_lfe = GAIN_LFE; - - if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) - { - if ( hSetOfHRTF->hHRTF_brir_combined == NULL ) - { - return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters " ); - } - 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 - { - if ( hSetOfHRTF->hHRTF_hrir_combined == NULL ) - { - return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters" ); - } - 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; - } - - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) - { - hHrtf->num_iterations_diffuse[j] = hSetOfHRTF->hHRTF_brir_combined->num_iterations_diffuse[j]; - hHrtf->pIndex_frequency_max_diffuse[j] = hSetOfHRTF->hHRTF_brir_combined->pIndex_frequency_max_diffuse[j]; - hHrtf->pOut_to_bin_diffuse_re[j] = hSetOfHRTF->hHRTF_brir_combined->pOut_to_bin_diffuse_re[j]; - hHrtf->pOut_to_bin_diffuse_im[j] = hSetOfHRTF->hHRTF_brir_combined->pOut_to_bin_diffuse_im[j]; - } - else - { - hHrtf->num_iterations_diffuse[j] = hSetOfHRTF->hHRTF_hrir_combined->num_iterations_diffuse[j]; - hHrtf->pIndex_frequency_max_diffuse[j] = hSetOfHRTF->hHRTF_hrir_combined->pIndex_frequency_max_diffuse[j]; - hHrtf->pOut_to_bin_diffuse_re[j] = hSetOfHRTF->hHRTF_hrir_combined->pOut_to_bin_diffuse_re[j]; - hHrtf->pOut_to_bin_diffuse_im[j] = hSetOfHRTF->hHRTF_hrir_combined->pOut_to_bin_diffuse_im[j]; - } - } - - for ( i = 0; i < hHrtf->max_num_ir; i++ ) - { - if ( inConfig == IVAS_AUDIO_CONFIG_5_1 ) - { - tmp = channelIndex_CICP6[i]; - } - else if ( inConfig == IVAS_AUDIO_CONFIG_7_1 ) - { - tmp = channelIndex_CICP12[i]; - } - else if ( inConfig == IVAS_AUDIO_CONFIG_5_1_2 ) - { - tmp = channelIndex_CICP14[i]; - } - else if ( inConfig == IVAS_AUDIO_CONFIG_5_1_4 ) - { - tmp = channelIndex_CICP16[i]; - } - else if ( inConfig == IVAS_AUDIO_CONFIG_7_1_4 ) - { - tmp = channelIndex_CICP19[i]; - } - else - { - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error: Channel configuration not specified!\n\n" ); - } - - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) - { - hHrtf->inv_diffuse_weight[j][i] = hSetOfHRTF->hHRTF_brir_combined->inv_diffuse_weight[j][tmp]; - hHrtf->num_iterations[i][j] = hSetOfHRTF->hHRTF_brir_combined->num_iterations[tmp][j]; - hHrtf->pIndex_frequency_max[i][j] = hSetOfHRTF->hHRTF_brir_combined->pIndex_frequency_max[tmp][j]; - hHrtf->pOut_to_bin_re[i][j] = hSetOfHRTF->hHRTF_brir_combined->pOut_to_bin_re[tmp][j]; - hHrtf->pOut_to_bin_im[i][j] = hSetOfHRTF->hHRTF_brir_combined->pOut_to_bin_im[tmp][j]; - } - else - { - hHrtf->inv_diffuse_weight[j][i] = hSetOfHRTF->hHRTF_hrir_combined->inv_diffuse_weight[j][tmp]; - hHrtf->num_iterations[i][j] = hSetOfHRTF->hHRTF_hrir_combined->num_iterations[tmp][j]; - hHrtf->pIndex_frequency_max[i][j] = hSetOfHRTF->hHRTF_hrir_combined->pIndex_frequency_max[tmp][j]; - hHrtf->pOut_to_bin_re[i][j] = hSetOfHRTF->hHRTF_hrir_combined->pOut_to_bin_re[tmp][j]; - hHrtf->pOut_to_bin_im[i][j] = hSetOfHRTF->hHRTF_hrir_combined->pOut_to_bin_im[tmp][j]; - } - } - } - } - else if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS ) - { - if ( inConfig == IVAS_AUDIO_CONFIG_HOA3 ) - { - if ( hSetOfHRTF->hHRTF_hrir_hoa3 == NULL ) - { - return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters" ); - } - 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; - - for ( i = 0; i < hHrtf->max_num_ir; i++ ) - { - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->inv_diffuse_weight[j][i] = hSetOfHRTF->hHRTF_hrir_hoa3->inv_diffuse_weight[j][i]; - hHrtf->num_iterations[i][j] = hSetOfHRTF->hHRTF_hrir_hoa3->num_iterations[i][j]; - hHrtf->pIndex_frequency_max[i][j] = hSetOfHRTF->hHRTF_hrir_hoa3->pIndex_frequency_max[i][j]; - hHrtf->pOut_to_bin_re[i][j] = hSetOfHRTF->hHRTF_hrir_hoa3->pOut_to_bin_re[i][j]; - hHrtf->pOut_to_bin_im[i][j] = hSetOfHRTF->hHRTF_hrir_hoa3->pOut_to_bin_im[i][j]; - } - } - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->num_iterations_diffuse[j] = hSetOfHRTF->hHRTF_hrir_hoa3->num_iterations_diffuse[j]; - hHrtf->pIndex_frequency_max_diffuse[j] = hSetOfHRTF->hHRTF_hrir_hoa3->pIndex_frequency_max_diffuse[j]; - hHrtf->pOut_to_bin_diffuse_re[j] = hSetOfHRTF->hHRTF_hrir_hoa3->pOut_to_bin_diffuse_re[j]; - hHrtf->pOut_to_bin_diffuse_im[j] = hSetOfHRTF->hHRTF_hrir_hoa3->pOut_to_bin_diffuse_im[j]; - } - } - else if ( inConfig == IVAS_AUDIO_CONFIG_HOA2 ) - { - if ( hSetOfHRTF->hHRTF_hrir_hoa2 == NULL ) - { - return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters" ); - } - 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; - - for ( i = 0; i < hHrtf->max_num_ir; i++ ) - { - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->inv_diffuse_weight[j][i] = hSetOfHRTF->hHRTF_hrir_hoa2->inv_diffuse_weight[j][i]; - hHrtf->num_iterations[i][j] = hSetOfHRTF->hHRTF_hrir_hoa2->num_iterations[i][j]; - hHrtf->pIndex_frequency_max[i][j] = hSetOfHRTF->hHRTF_hrir_hoa2->pIndex_frequency_max[i][j]; - hHrtf->pOut_to_bin_re[i][j] = hSetOfHRTF->hHRTF_hrir_hoa2->pOut_to_bin_re[i][j]; - hHrtf->pOut_to_bin_im[i][j] = hSetOfHRTF->hHRTF_hrir_hoa2->pOut_to_bin_im[i][j]; - } - } - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->num_iterations_diffuse[j] = hSetOfHRTF->hHRTF_hrir_hoa2->num_iterations_diffuse[j]; - hHrtf->pIndex_frequency_max_diffuse[j] = hSetOfHRTF->hHRTF_hrir_hoa2->pIndex_frequency_max_diffuse[j]; - hHrtf->pOut_to_bin_diffuse_re[j] = hSetOfHRTF->hHRTF_hrir_hoa2->pOut_to_bin_diffuse_re[j]; - hHrtf->pOut_to_bin_diffuse_im[j] = hSetOfHRTF->hHRTF_hrir_hoa2->pOut_to_bin_diffuse_im[j]; - } - } - else if ( inConfig == IVAS_AUDIO_CONFIG_FOA ) - { - if ( hSetOfHRTF->hHRTF_hrir_foa == NULL ) - { - return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters" ); - } - 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; - - for ( i = 0; i < hHrtf->max_num_ir; i++ ) - { - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->inv_diffuse_weight[j][i] = hSetOfHRTF->hHRTF_hrir_foa->inv_diffuse_weight[j][i]; - hHrtf->num_iterations[i][j] = hSetOfHRTF->hHRTF_hrir_foa->num_iterations[i][j]; - hHrtf->pIndex_frequency_max[i][j] = hSetOfHRTF->hHRTF_hrir_foa->pIndex_frequency_max[i][j]; - hHrtf->pOut_to_bin_re[i][j] = hSetOfHRTF->hHRTF_hrir_foa->pOut_to_bin_re[i][j]; - hHrtf->pOut_to_bin_im[i][j] = hSetOfHRTF->hHRTF_hrir_foa->pOut_to_bin_im[i][j]; - } - } - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->num_iterations_diffuse[j] = hSetOfHRTF->hHRTF_hrir_foa->num_iterations_diffuse[j]; - hHrtf->pIndex_frequency_max_diffuse[j] = hSetOfHRTF->hHRTF_hrir_foa->pIndex_frequency_max_diffuse[j]; - hHrtf->pOut_to_bin_diffuse_re[j] = hSetOfHRTF->hHRTF_hrir_foa->pOut_to_bin_diffuse_re[j]; - hHrtf->pOut_to_bin_diffuse_im[j] = hSetOfHRTF->hHRTF_hrir_foa->pOut_to_bin_diffuse_im[j]; - } - } - else - { - return IVAS_ERROR( IVAS_ERR_INTERNAL, "Unsupported renderer type in Crend" ); - } - } -#endif } hHrtf->same_inv_diffuse_weight = 1; @@ -1359,11 +1130,7 @@ ivas_error ivas_rend_openMultiBinCrend( const MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, const int32_t output_Fs ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM return ivas_rend_openCrend( pCrend, inConfig, outConfig, NULL /*hRendCfg*/, NULL, NULL /* hHrtfStatistics */, output_Fs, 0, pMultiBinPoseData->num_poses ); -#else - return ivas_rend_openCrend( pCrend, inConfig, outConfig, NULL /*hRendCfg*/, NULL, NULL /* hHrtfStatistics */, output_Fs, pMultiBinPoseData->num_poses ); -#endif } @@ -1378,16 +1145,10 @@ ivas_error ivas_rend_openCrend( const AUDIO_CONFIG inConfig, const AUDIO_CONFIG outConfig, RENDER_CONFIG_DATA *hRendCfg, -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM HRTFS_CREND_HANDLE hHrtfCrend, -#else - HRTFS_CREND_HANDLE hSetOfHRTF, -#endif HRTFS_STATISTICS_HANDLE hHrtfStatistics, const int32_t output_Fs, -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM const int16_t ext_rend_flag, -#endif const int16_t num_poses ) { int16_t i, subframe_length; @@ -1408,11 +1169,7 @@ ivas_error ivas_rend_openCrend( if ( ( *pCrend )->hHrtfCrend == NULL ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_rend_initCrend( *pCrend, inConfig, outConfig, hHrtfCrend, ext_rend_flag, output_Fs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_initCrend( *pCrend, inConfig, outConfig, hSetOfHRTF, output_Fs ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -1595,11 +1352,7 @@ void ivas_rend_closeCrend( return; } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( *pCrend )->hHrtfCrend != NULL && ( *pCrend )->hHrtfCrend->init_from_rom ) -#else - if ( ( *pCrend )->hHrtfCrend != NULL && ( *pCrend )->hHrtfCrend->init_from_rom ) -#endif { ivas_hrtf_close( &( *pCrend )->hHrtfCrend ); } diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index dc617485458ca9ba557a92de19fb10cc13f4efe0..cad8923ce2602e22a4bfd7bdb8c62ebdf8935c2f 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -321,11 +321,7 @@ ivas_error ivas_dirac_dec_init_binaural_data( nchan_to_allocate = 2 * BINAURAL_CHANNELS; if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { -#ifdef FIX_1222_OMASA_DEC_CHANNEL_BUFFERS nchan_to_allocate = BINAURAL_CHANNELS + st_ivas->nchan_ism; -#else - nchan_to_allocate = 2 * BINAURAL_CHANNELS + 2; -#endif } n_samples_granularity = NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ); diff --git a/lib_rend/ivas_hrtf.c b/lib_rend/ivas_hrtf.c index 815ff89ea4702ffa24a4c8d6170baf51373a86ee..58fdf3dc10e9935300472095c0b9b2f4e4423c62 100644 --- a/lib_rend/ivas_hrtf.c +++ b/lib_rend/ivas_hrtf.c @@ -88,7 +88,6 @@ void ivas_HRTF_binary_close( * Allocate HRTF binary handle for Crend renderer *-----------------------------------------------------------------------*/ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM ivas_error ivas_HRTF_CRend_binary_open( HRTFS_CREND_DATA **hHrtfCrend ) { @@ -106,28 +105,7 @@ ivas_error ivas_HRTF_CRend_binary_open( return IVAS_ERR_OK; } -#else -ivas_error ivas_HRTF_CRend_binary_open( - HRTFS_CREND **hSetOfHRTF ) -{ - /* Allocate HR filter set for headphones configuration */ - *hSetOfHRTF = (HRTFS_CREND *) malloc( sizeof( HRTFS_CREND ) ); - if ( *hSetOfHRTF == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for set of HRTF binary!" ); - } - - ( *hSetOfHRTF )->hHRTF_hrir_combined = NULL; - ( *hSetOfHRTF )->hHRTF_hrir_hoa3 = NULL; - ( *hSetOfHRTF )->hHRTF_hrir_hoa2 = NULL; - ( *hSetOfHRTF )->hHRTF_hrir_foa = NULL; - ( *hSetOfHRTF )->hHRTF_brir_combined = NULL; - - return IVAS_ERR_OK; -} -#endif -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM /*-----------------------------------------------------------------------* * ivas_HRTF_CRend_binary_open_buffers_uint16() @@ -172,7 +150,6 @@ ivas_error ivas_HRTF_CRend_binary_open_buffers_float( return IVAS_ERR_OK; } -#endif /*-------------------------------------------------------------------* * ivas_HRTF_CRend_binary_close() @@ -180,7 +157,6 @@ ivas_error ivas_HRTF_CRend_binary_open_buffers_float( * Close HRTF CRend binary handle for Crend renderer *-------------------------------------------------------------------*/ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM void ivas_HRTF_CRend_binary_close( HRTFS_CREND_DATA **hHrtfCrend ) { @@ -230,21 +206,6 @@ void ivas_HRTF_CRend_binary_close( return; } -#else -void ivas_HRTF_CRend_binary_close( - HRTFS_CREND **hSetOfHRTF ) -{ - if ( hSetOfHRTF == NULL || *hSetOfHRTF == NULL ) - { - return; - } - - free( *hSetOfHRTF ); - *hSetOfHRTF = NULL; - - return; -} -#endif /*-----------------------------------------------------------------------* diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 0a44305f064ee7257d0548044fb98c840a7d2d9c..fcbdee32a345168622cc994ffc9272b43c690109 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -384,11 +384,7 @@ ivas_error ivas_td_binaural_renderer_unwrap( } /* Render subframe */ -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION if ( ( error = TDREND_GetMix( hBinRendererTd, output, subframe_length, subframe_idx ) ) != IVAS_ERR_OK ) -#else - if ( ( error = TDREND_GetMix( hBinRendererTd, output, subframe_length, subframe_idx, ism_md_subframe_update ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -429,12 +425,7 @@ ivas_error TDREND_GetMix( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ float *output[], /* i/o: ISM object synth / rendered output in 0,1 */ const int16_t subframe_length, /* i/o: subframe length */ -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION - const int16_t subframe_idx /* i : Subframe index to 5 ms subframe */ -#else - const int16_t subframe_idx, /* i : Subframe index to 5 ms subframe */ - const int16_t ism_md_subframe_update /* i : Number of subframes to delay ism metadata to sync with audio */ -#endif + const int16_t subframe_idx /* i : Subframe index to 5 ms subframe */ ) { int16_t i; @@ -446,11 +437,6 @@ ivas_error TDREND_GetMix( float hrf_left_delta[SFX_SPAT_BIN_MAX_FILTER_LENGTH]; float hrf_right_delta[SFX_SPAT_BIN_MAX_FILTER_LENGTH]; int16_t intp_count; -#ifndef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION - int16_t subframe_update_flag; - - subframe_update_flag = subframe_idx == ism_md_subframe_update; -#endif error = IVAS_ERR_OK; @@ -474,13 +460,8 @@ ivas_error TDREND_GetMix( /* Update rendering params if needed */ if ( ( SrcRend_p->PlayStatus == TDREND_PLAYSTATUS_PLAYING ) && ( hBinRendererTd->Listener_p->PoseUpdated || SrcSpatial_p->Updated ) ) { -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION TDREND_SRC_REND_UpdateFiltersFromSpatialParams( hBinRendererTd, SrcRend_p, SrcSpatial_p, Src_p->hrf_left_prev, Src_p->hrf_right_prev, hrf_left_delta, hrf_right_delta, &intp_count, &Src_p->filterlength, &Src_p->itd, &Src_p->Gain, Src_p ); -#else - TDREND_SRC_REND_UpdateFiltersFromSpatialParams( hBinRendererTd, SrcRend_p, SrcSpatial_p, Src_p->hrf_left_prev, - Src_p->hrf_right_prev, hrf_left_delta, hrf_right_delta, &intp_count, &Src_p->filterlength, &Src_p->itd, &Src_p->Gain, Src_p, subframe_update_flag ); -#endif } /* Render source if needed */ diff --git a/lib_rend/ivas_objectRenderer_sources.c b/lib_rend/ivas_objectRenderer_sources.c index 0307a058eb2f4dc7b50de9705ba9822be0faf336..27f594ce9bcf5fc6018a67ca52236bf2b2a89f3b 100644 --- a/lib_rend/ivas_objectRenderer_sources.c +++ b/lib_rend/ivas_objectRenderer_sources.c @@ -305,13 +305,8 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( int16_t *filterlength, /* o : Length of filters */ int16_t *itd, /* o : ITD value */ float *Gain, /* o : Gain value */ -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION - TDREND_SRC_t *Src_p /* i/o: Source pointer */ + TDREND_SRC_t *Src_p /* i/o: Source pointer */ ) -#else - TDREND_SRC_t *Src_p, /* i/o: Source pointer */ - const int16_t subframe_update_flag ) -#endif { TDREND_MIX_Listener_t *Listener_p; TDREND_HRFILT_FiltSet_t *HrFiltSet_p; @@ -402,11 +397,7 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( Src_p->azim_prev = 360.0f; /* Dummy angle -- sets max interpolation if switching to TDREND_POSTYPE_ABSOLUTE */ } -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION if ( ( *intp_count > 0 ) ) -#else - if ( ( *intp_count > 0 ) && subframe_update_flag ) -#endif { /* Set deltas for interpolation */ v_sub( hrf_left, hrf_left_prev, hrf_left_delta, *filterlength ); diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index 46025d48293fd8a3303a54677715ce9fc556189f..939c13b93b8a7747690682f1c94ac419977ae3be 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -344,11 +344,7 @@ int16_t ivas_get_nchan_buffers_dec( } else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) { -#ifdef FIX_1222_OMASA_DEC_CHANNEL_BUFFERS nchan_out_buff = max( nchan_out_buff, BINAURAL_CHANNELS + st_ivas->nchan_ism ); -#else - nchan_out_buff = max( nchan_out_buff, 2 * BINAURAL_CHANNELS + 2 ); -#endif } else if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) { diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index d4a75254a3ddc384f840cf01933ba5e99b4626eb..5c488c88c2cade02796cd424303a178ca1c4a4a7 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -576,14 +576,9 @@ void ivas_HRTF_parambin_binary_close( ); ivas_error ivas_HRTF_CRend_binary_open( -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM HRTFS_CREND_DATA **hHrtfCrend /* i/o: Crend HRTF handle */ -#else - HRTFS_CREND **hSetOfHRTF /* i/o: Set of HRTF handle */ -#endif ); -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM ivas_error ivas_HRTF_CRend_binary_open_buffers_uint16( uint16_t **buffer, /* o : buffer to allocate */ const uint32_t mem_size /* i : size of buffer */ @@ -594,13 +589,8 @@ ivas_error ivas_HRTF_CRend_binary_open_buffers_float( const uint32_t mem_size /* i : size of buffer */ ); -#endif void ivas_HRTF_CRend_binary_close( -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM HRTFS_CREND_DATA **hHrtfCrend /* i/o: Crend HRTF handle */ -#else - HRTFS_CREND **hSetOfHRTF /* i/o: Set of HRTF handle */ -#endif ); ivas_error ivas_HRTF_statistics_init( @@ -678,12 +668,7 @@ ivas_error TDREND_GetMix( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ float *output[], /* i/o: ISM object synth/rendered output in 0,1 */ const int16_t subframe_length, /* i/o: subframe length */ -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION const int16_t subframe_idx /* i : Subframe index to 5 ms subframe */ -#else - const int16_t subframe_idx, /* i : Subframe index to 5 ms subframe */ - const int16_t ism_md_subframe_update /* i : Number of subframes to delay metadata to sync with audio */ -#endif ); ivas_error TDREND_Update_listener_orientation( @@ -784,12 +769,7 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( int16_t *filterlength, /* o : Length of filters */ int16_t *itd, /* o : ITD value */ float *Gain, /* o : Gain value */ -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION TDREND_SRC_t *Src_p /* i/o: Source pointer */ -#else - TDREND_SRC_t *Src_p, - const int16_t subframe_update_flag /* i : Flag to determine update subframe idx */ -#endif ); ivas_error TDREND_SRC_Alloc( @@ -912,16 +892,10 @@ ivas_error ivas_rend_openCrend( const AUDIO_CONFIG inConfig, const AUDIO_CONFIG outConfig, RENDER_CONFIG_DATA *hRendCfg, -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM HRTFS_CREND_HANDLE hHrtfCrend, -#else - HRTFS_CREND_HANDLE hSetOfHRTF, -#endif HRTFS_STATISTICS_HANDLE hHrtfStatistics, const int32_t output_Fs, -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM const int16_t ext_rend_flag, -#endif const int16_t num_poses ); @@ -930,15 +904,9 @@ void ivas_rend_closeCrend( const int16_t num_poses ); -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM ivas_error ivas_Crend_hrtf_init( HRTFS_CREND_DATA *hHrtf /* i/o: Crend HRTF handle */ ); -#else -ivas_error ivas_hrtf_init( - HRTFS_DATA *hHrtf /* i/o: HRTF handle */ -); -#endif ivas_error ivas_rend_initCrendWrapper( CREND_WRAPPER_HANDLE *pCrend, diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index eaa1dcad36c0fe3d611bf91b85fe657afa4b34df..e737d4a7e2668179a91f7d589149dda47b57e9a7 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -1157,11 +1157,7 @@ typedef struct * Crend structures *------------------------------------------------------------------------------------------*/ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM typedef struct ivas_hrtf_crend_structure -#else -typedef struct ivas_hrtfs_structure -#endif { const float *pOut_to_bin_re[MAX_INTERN_CHANNELS][BINAURAL_CHANNELS]; const float *pOut_to_bin_im[MAX_INTERN_CHANNELS][BINAURAL_CHANNELS]; @@ -1186,11 +1182,7 @@ typedef struct ivas_hrtfs_structure uint16_t *pIndex_frequency_max_dyn[MAX_INTERN_CHANNELS][BINAURAL_CHANNELS]; uint16_t *pIndex_frequency_max_diffuse_dyn[BINAURAL_CHANNELS]; -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM } HRTFS_DATA, *HRTFS_HANDLE, HRTFS_CREND_DATA, *HRTFS_CREND_HANDLE; // VE: all instance of HRTFS_DATAand *HRTFS_HANDLE should be renamed to HRTFS_CREND_DATA and *HRTFS_CREND_HANDLE -#else -} HRTFS_DATA, *HRTFS_HANDLE; -#endif /* Main Crend structure */ typedef struct ivas_crend_state_t @@ -1252,70 +1244,18 @@ typedef struct ivas_binaural_rendering_struct * HRTF structures - hrtfs from binary files *------------------------------------------------------------------------------------------*/ -#ifndef FIX_1227_Crend_HRTF_LOADING_OPTIM -typedef struct ivas_hrtfs_crend_structure -{ - HRTFS_DATA *hHRTF_hrir_combined; - HRTFS_DATA *hHRTF_hrir_hoa3; - HRTFS_DATA *hHRTF_hrir_hoa2; - HRTFS_DATA *hHRTF_hrir_foa; - HRTFS_DATA *hHRTF_brir_combined; - -} HRTFS_CREND, *HRTFS_CREND_HANDLE; - -#endif /* Fastconv binaural data structure */ typedef struct ivas_hrtfs_fastconv_struct { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM float FASTCONV_latency_s; float ***leftReal; float ***leftImag; float ***rightReal; float ***rightImag; int16_t n_channels; -#else - float FASTCONV_HOA3_latency_s; - float ***leftHRIRReal_HOA3; - float ***leftHRIRImag_HOA3; - float ***rightHRIRReal_HOA3; - float ***rightHRIRImag_HOA3; - - float FASTCONV_HRIR_latency_s; - float ***leftHRIRReal; - float ***leftHRIRImag; - float ***rightHRIRReal; - float ***rightHRIRImag; - - float ***leftBRIRReal; - float ***leftBRIRImag; - float ***rightBRIRReal; - float ***rightBRIRImag; - float FASTCONV_BRIR_latency_s; - - float ***leftHRIRReal_HOA2; - float ***leftHRIRImag_HOA2; - float ***rightHRIRReal_HOA2; - float ***rightHRIRImag_HOA2; - float FASTCONV_HOA2_latency_s; - - float ***leftHRIRReal_FOA; - float ***leftHRIRImag_FOA; - float ***rightHRIRReal_FOA; - float ***rightHRIRImag_FOA; - float FASTCONV_FOA_latency_s; -#endif int16_t allocate_init_flag; /*Memory allocation flag 0: if the hrtf pointers are allocated at application level , 1: of allocated at ivas_binaural_hrtf_open() */ -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM uint16_t ntaps; -#else - uint16_t ntaps_hrir; - uint16_t ntaps_hrir_hoa3; - uint16_t ntaps_hrir_hoa2; - uint16_t ntaps_hrir_foa; - uint16_t ntaps_brir; -#endif float fastconvReverberationTimes[CLDFB_NO_CHANNELS_MAX]; float fastconvReverberationEneCorrections[CLDFB_NO_CHANNELS_MAX]; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index e9a13a9aa0e7ab41ea4ab7c24812823b34bba373..e73dfd9001818ea2075cef8fde44eb584e5657e4 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -1367,11 +1367,7 @@ static ivas_error setRendInputActiveIsm( } else if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics, *rendCtx.pOutSampleRate, 1, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2143,13 +2139,8 @@ static ivas_error initMcBinauralRendering( else if ( !useTDRend && inputMc->crendWrapper == NULL ) { /* open CREND */ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, outSampleRate, 1, ( ( 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, hHrtfStatistics, - outSampleRate, ( ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2547,11 +2538,7 @@ static ivas_error updateSbaPanGains( } else { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, 1, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2563,11 +2550,7 @@ static ivas_error updateSbaPanGains( return error; } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, 1, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -7669,9 +7652,7 @@ void IVAS_REND_Close( for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; ++i ) { clearInputSba( &hIvasRend->inputsSba[i] ); -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM hIvasRend->hHrtfs.hHrtfFastConv = NULL; -#endif } for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i ) { diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index f3517edd3091ce3f1babb7d8b03c8dcd5893b2f6..6b0f36c49c092ee34659642ed9988928aaae0bc2 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -242,7 +242,6 @@ static ivas_error read_hrtf_binary_header( return IVAS_ERR_END_OF_FILE; } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM /*-------------------------------------------------------------------* * audio_cfg_2_binaural_cfg() @@ -278,7 +277,6 @@ static BINAURAL_INPUT_AUDIO_CONFIG audio_cfg_2_binaural_cfg( return hrtf_set_binaural_cfg; } -#endif /*-------------------------------------------------------------------* * TDREND_LoadBSplineBinaryITD() @@ -1120,11 +1118,7 @@ void destroy_td_hrtf( * Create HRTF from the raw data (to the HRTF CRend handle) *---------------------------------------------------------------------*/ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM static ivas_error create_Crend_HRTF_from_rawdata( -#else -static ivas_error create_HRTF_from_rawdata( -#endif HRTFS_HANDLE *hHRTF, /* i/o: HRTF CRend handle */ char *hrtf_data /* i : pointer to binary file */ ) @@ -1132,34 +1126,12 @@ static ivas_error create_HRTF_from_rawdata( int16_t i, j, k; int16_t max_num_iterations_diffuse; uint32_t max_total_num_fsamp_per_iteration, max_total_num_fsamp_per_iteration_diff; -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM uint32_t mem_size, mem_size_buf, l; -#else - uint32_t mem_size, l; -#endif char *hrtf_data_rptr; float *pOut_to_bin_wptr; ivas_error error; Word16 factorQ; -#ifndef FIX_1227_Crend_HRTF_LOADING_OPTIM - if ( *hHRTF == NULL ) - { - if ( ( ( *hHRTF ) = (HRTFS_HANDLE) malloc( sizeof( HRTFS_DATA ) ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HRTF binary data\n" ); - } - - if ( ( error = ivas_hrtf_init( *hHRTF ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else - { - return IVAS_ERR_INTERNAL; - } -#endif if ( hrtf_data == NULL ) { @@ -1202,28 +1174,17 @@ static ivas_error create_HRTF_from_rawdata( } } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM mem_size = ( *hHRTF )->max_num_iterations * sizeof( uint16_t ); -#endif /* pIndex_frequency_max */ for ( i = 0; i < ( *hHRTF )->max_num_ir; i++ ) { for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_HRTF_CRend_binary_open_buffers_uint16( &( *hHRTF )->pIndex_frequency_max_dyn[i][j], mem_size ) ) != IVAS_ERR_OK ) { return error; } -#else - mem_size = ( *hHRTF )->max_num_iterations * sizeof( uint16_t ); - ( *hHRTF )->pIndex_frequency_max_dyn[i][j] = (uint16_t *) malloc( mem_size ); - if ( ( *hHRTF )->pIndex_frequency_max_dyn[i][j] == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for pIndex_frequency_max" ); - } -#endif memcpy( ( *hHRTF )->pIndex_frequency_max_dyn[i][j], hrtf_data_rptr, mem_size ); ( *hHRTF )->pIndex_frequency_max[i][j] = ( *hHRTF )->pIndex_frequency_max_dyn[i][j]; hrtf_data_rptr += mem_size; @@ -1247,18 +1208,10 @@ static ivas_error create_HRTF_from_rawdata( for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { mem_size = ( *hHRTF )->num_iterations_diffuse[j] * sizeof( uint16_t ); -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_HRTF_CRend_binary_open_buffers_uint16( &( *hHRTF )->pIndex_frequency_max_diffuse_dyn[j], mem_size ) ) != IVAS_ERR_OK ) { return error; } -#else - ( *hHRTF )->pIndex_frequency_max_diffuse_dyn[j] = (uint16_t *) malloc( mem_size ); - if ( ( *hHRTF )->pIndex_frequency_max_diffuse_dyn[j] == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for pIndex_frequency_max_diffuse" ); - } -#endif memcpy( ( *hHRTF )->pIndex_frequency_max_diffuse_dyn[j], hrtf_data_rptr, mem_size ); ( *hHRTF )->pIndex_frequency_max_diffuse[j] = ( *hHRTF )->pIndex_frequency_max_diffuse_dyn[j]; hrtf_data_rptr += mem_size; @@ -1292,30 +1245,18 @@ static ivas_error create_HRTF_from_rawdata( factorQ = *( (Word16 *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( Word16 ); -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM mem_size_buf = max_total_num_fsamp_per_iteration * sizeof( float ); -#endif /* coeff_re (the size depends on pIndex_frequency_max) */ for ( i = 0; i < ( *hHRTF )->max_num_ir; i++ ) { for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_HRTF_CRend_binary_open_buffers_float( &( *hHRTF )->pOut_to_bin_re_dyn[i][j], mem_size_buf ) ) != IVAS_ERR_OK ) { return error; } memset( ( *hHRTF )->pOut_to_bin_re_dyn[i][j], 0x00, mem_size_buf ); -#else - mem_size = max_total_num_fsamp_per_iteration * sizeof( float ); - ( *hHRTF )->pOut_to_bin_re_dyn[i][j] = (float *) malloc( mem_size ); - if ( ( *hHRTF )->pOut_to_bin_re_dyn[i][j] == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for Out_to_bin_re" ); - } - memset( ( *hHRTF )->pOut_to_bin_re_dyn[i][j], 0x00, mem_size ); -#endif ( *hHRTF )->pOut_to_bin_re[i][j] = ( *hHRTF )->pOut_to_bin_re_dyn[i][j]; pOut_to_bin_wptr = ( *hHRTF )->pOut_to_bin_re_dyn[i][j]; @@ -1339,21 +1280,11 @@ static ivas_error create_HRTF_from_rawdata( { for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_HRTF_CRend_binary_open_buffers_float( &( *hHRTF )->pOut_to_bin_im_dyn[i][j], mem_size_buf ) ) != IVAS_ERR_OK ) { return error; } memset( ( *hHRTF )->pOut_to_bin_im_dyn[i][j], 0x00, mem_size_buf ); -#else - mem_size = max_total_num_fsamp_per_iteration * sizeof( float ); - ( *hHRTF )->pOut_to_bin_im_dyn[i][j] = (float *) malloc( mem_size ); - if ( ( *hHRTF )->pOut_to_bin_im_dyn[i][j] == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for Out_to_bin_im" ); - } - memset( ( *hHRTF )->pOut_to_bin_im_dyn[i][j], 0x00, mem_size ); -#endif ( *hHRTF )->pOut_to_bin_im[i][j] = ( *hHRTF )->pOut_to_bin_im_dyn[i][j]; pOut_to_bin_wptr = ( *hHRTF )->pOut_to_bin_im_dyn[i][j]; @@ -1375,10 +1306,8 @@ static ivas_error create_HRTF_from_rawdata( max_total_num_fsamp_per_iteration_diff = *( (uint32_t *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( uint32_t ); -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM mem_size_buf = max_total_num_fsamp_per_iteration_diff * sizeof( float ); -#endif if ( max_total_num_fsamp_per_iteration_diff != 0 ) { /* factorQ = *( (Word16 *) ( hrtf_data_rptr ) ); */ @@ -1386,21 +1315,11 @@ static ivas_error create_HRTF_from_rawdata( /* coeff_diffuse_re : The size depends on pIndex_frequency_max_diffuse */ for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_HRTF_CRend_binary_open_buffers_float( &( *hHRTF )->pOut_to_bin_diffuse_re_dyn[j], mem_size_buf ) ) != IVAS_ERR_OK ) { return error; } memset( ( *hHRTF )->pOut_to_bin_diffuse_re_dyn[j], 0x00, mem_size_buf ); -#else - mem_size = max_total_num_fsamp_per_iteration_diff * sizeof( float ); - ( *hHRTF )->pOut_to_bin_diffuse_re_dyn[j] = (float *) malloc( mem_size ); - if ( ( *hHRTF )->pOut_to_bin_diffuse_re_dyn[j] == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for pOut_to_bin_diffuse_re" ); - } - memset( ( *hHRTF )->pOut_to_bin_diffuse_re_dyn[j], 0x00, mem_size ); -#endif ( *hHRTF )->pOut_to_bin_diffuse_re[j] = ( *hHRTF )->pOut_to_bin_diffuse_re_dyn[j]; pOut_to_bin_wptr = ( *hHRTF )->pOut_to_bin_diffuse_re_dyn[j]; @@ -1421,21 +1340,11 @@ static ivas_error create_HRTF_from_rawdata( /* coeff_diffuse_im : The size depends on pIndex_frequency_max_diffuse */ for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_HRTF_CRend_binary_open_buffers_float( &( *hHRTF )->pOut_to_bin_diffuse_im_dyn[j], mem_size_buf ) ) != IVAS_ERR_OK ) { return error; } memset( ( *hHRTF )->pOut_to_bin_diffuse_im_dyn[j], 0x00, mem_size_buf ); -#else - mem_size = max_total_num_fsamp_per_iteration_diff * sizeof( float ); - ( *hHRTF )->pOut_to_bin_diffuse_im_dyn[j] = (float *) malloc( mem_size ); - if ( ( *hHRTF )->pOut_to_bin_diffuse_im_dyn[j] == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for pOut_to_bin_diffuse_im" ); - } - memset( ( *hHRTF )->pOut_to_bin_diffuse_im_dyn[j], 0x00, mem_size ); -#endif ( *hHRTF )->pOut_to_bin_diffuse_im[j] = ( *hHRTF )->pOut_to_bin_diffuse_im_dyn[j]; pOut_to_bin_wptr = ( *hHRTF )->pOut_to_bin_diffuse_im_dyn[j]; @@ -1509,12 +1418,10 @@ static ivas_error create_fastconv_HRTF_from_rawdata( ntaps = *( (uint16_t *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( uint16_t ); -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM ( *hHRTF )->ntaps = ntaps; ( *hHRTF )->FASTCONV_latency_s = latency_s; ( *hHRTF )->n_channels = nbchan; -#endif if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) { @@ -1522,10 +1429,6 @@ static ivas_error create_fastconv_HRTF_from_rawdata( { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (HRTF_LS_CHANNELS)" ); } -#ifndef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - ( *hHRTF )->ntaps_hrir = ntaps; - ( *hHRTF )->FASTCONV_HRIR_latency_s = latency_s; -#endif } else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA3 ) { @@ -1533,10 +1436,6 @@ static ivas_error create_fastconv_HRTF_from_rawdata( { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (HOA3_CHANNELS)" ); } -#ifndef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - ( *hHRTF )->ntaps_hrir_hoa3 = ntaps; - ( *hHRTF )->FASTCONV_HOA3_latency_s = latency_s; -#endif } else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA2 ) { @@ -1544,10 +1443,6 @@ static ivas_error create_fastconv_HRTF_from_rawdata( { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (HOA2_CHANNELS)" ); } -#ifndef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - ( *hHRTF )->ntaps_hrir_hoa2 = ntaps; - ( *hHRTF )->FASTCONV_HOA2_latency_s = latency_s; -#endif } else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_FOA ) { @@ -1555,10 +1450,6 @@ static ivas_error create_fastconv_HRTF_from_rawdata( { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (FOA_CHANNELS)" ); } -#ifndef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - ( *hHRTF )->ntaps_hrir_foa = ntaps; - ( *hHRTF )->FASTCONV_FOA_latency_s = latency_s; -#endif } else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) { @@ -1566,10 +1457,6 @@ static ivas_error create_fastconv_HRTF_from_rawdata( { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (HRTF_LS_CHANNELS)" ); } -#ifndef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - ( *hHRTF )->ntaps_brir = ntaps; - ( *hHRTF )->FASTCONV_BRIR_latency_s = latency_s; -#endif } else { @@ -1578,22 +1465,14 @@ static ivas_error create_fastconv_HRTF_from_rawdata( if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( ( error = ivas_allocate_binaural_hrtf( *hHRTF, nbchan, ( *hHRTF )->allocate_init_flag ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_allocate_binaural_hrtf( *hHRTF, IVAS_AUDIO_CONFIG_INVALID, input_cfg, RENDERER_BINAURAL_FASTCONV, ( *hHRTF )->allocate_init_flag ) ) != IVAS_ERR_OK ) -#endif { return error; } } else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( ( error = ivas_allocate_binaural_hrtf( *hHRTF, nbchan, ( *hHRTF )->allocate_init_flag ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_allocate_binaural_hrtf( *hHRTF, IVAS_AUDIO_CONFIG_INVALID, input_cfg, RENDERER_BINAURAL_FASTCONV_ROOM, ( *hHRTF )->allocate_init_flag ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -1603,7 +1482,6 @@ static ivas_error create_fastconv_HRTF_from_rawdata( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "renderer type not compliant" ); } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM /* HRIR/BRIR Q factor*/ factorQ = *( (Word16 *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( Word16 ); @@ -1661,294 +1539,6 @@ static ivas_error create_fastconv_HRTF_from_rawdata( /* BRIR */ if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) { -#else - /* HRIR */ - if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) - { - - /* HRIR Q factor*/ - factorQ = *( (Word16 *) ( hrtf_data_rptr ) ); - hrtf_data_rptr += sizeof( Word16 ); - scaleFactor = powf( 2.f, -1.f * factorQ ); - - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HRTF_LS_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir; k++ ) - { - ( *hHRTF )->leftHRIRReal[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HRTF_LS_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir; k++ ) - { - ( *hHRTF )->leftHRIRImag[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HRTF_LS_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir; k++ ) - { - ( *hHRTF )->rightHRIRReal[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HRTF_LS_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir; k++ ) - { - ( *hHRTF )->rightHRIRImag[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir * sizeof( Word16 ); - } - } - } - else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA3 ) - { - - /* HRIR Q factor*/ - factorQ = *( (Word16 *) ( hrtf_data_rptr ) ); - hrtf_data_rptr += sizeof( Word16 ); - scaleFactor = powf( 2.f, -1.f * factorQ ); - - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HOA3_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_hoa3; k++ ) - { - ( *hHRTF )->leftHRIRReal_HOA3[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_hoa3 * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HOA3_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_hoa3; k++ ) - { - ( *hHRTF )->leftHRIRImag_HOA3[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_hoa3 * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HOA3_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_hoa3; k++ ) - { - ( *hHRTF )->rightHRIRReal_HOA3[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_hoa3 * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HOA3_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_hoa3; k++ ) - { - ( *hHRTF )->rightHRIRImag_HOA3[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_hoa3 * sizeof( Word16 ); - } - } - } - else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA2 ) - { - - /* HRIR Q factor*/ - factorQ = *( (Word16 *) ( hrtf_data_rptr ) ); - hrtf_data_rptr += sizeof( Word16 ); - scaleFactor = powf( 2.f, -1.f * factorQ ); - - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HOA2_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_hoa2; k++ ) - { - ( *hHRTF )->leftHRIRReal_HOA2[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_hoa2 * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HOA2_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_hoa2; k++ ) - { - ( *hHRTF )->leftHRIRImag_HOA2[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_hoa2 * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HOA2_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_hoa2; k++ ) - { - ( *hHRTF )->rightHRIRReal_HOA2[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_hoa2 * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HOA2_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_hoa2; k++ ) - { - ( *hHRTF )->rightHRIRImag_HOA2[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_hoa2 * sizeof( Word16 ); - } - } - } - else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_FOA ) - { - - /* HRIR Q factor*/ - factorQ = *( (Word16 *) ( hrtf_data_rptr ) ); - hrtf_data_rptr += sizeof( Word16 ); - scaleFactor = powf( 2.f, -1.f * factorQ ); - - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < FOA_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_foa; k++ ) - { - ( *hHRTF )->leftHRIRReal_FOA[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_foa * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < FOA_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_foa; k++ ) - { - ( *hHRTF )->leftHRIRImag_FOA[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_foa * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < FOA_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_foa; k++ ) - { - ( *hHRTF )->rightHRIRReal_FOA[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_foa * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < FOA_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_foa; k++ ) - { - ( *hHRTF )->rightHRIRImag_FOA[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_foa * sizeof( Word16 ); - } - } - } - /* BRIR */ - else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) - { - - /* BRIR Q factor*/ - factorQ = *( (Word16 *) ( hrtf_data_rptr ) ); - hrtf_data_rptr += sizeof( Word16 ); - scaleFactor = powf( 2.f, -1.f * factorQ ); - - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HRTF_LS_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_brir; k++ ) - { - ( *hHRTF )->leftBRIRReal[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_brir * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HRTF_LS_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_brir; k++ ) - { - ( *hHRTF )->leftBRIRImag[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_brir * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HRTF_LS_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_brir; k++ ) - { - ( *hHRTF )->rightBRIRReal[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_brir * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HRTF_LS_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_brir; k++ ) - { - ( *hHRTF )->rightBRIRImag[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_brir * sizeof( Word16 ); - } - } -#endif /* Reverb Parameters */ if ( CLDFB_NO_CHANNELS_MAX != *( (uint16_t *) ( hrtf_data_rptr ) ) ) @@ -2112,14 +1702,9 @@ static ivas_error create_parambin_HRTF_from_rawdata( ivas_error load_fastconv_HRTF_from_binary( IVAS_DEC_HRTF_FASTCONV_HANDLE hHrtfFastConv, /* i/o: FastConv HRTF handle */ -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - const IVAS_AUDIO_CONFIG OutputConfig, /* i : output audio configuration */ - const IVAS_AUDIO_CONFIG hrtf_set_audio_cfg, /* i : HRTF set audio config. */ -#else - const int16_t room_reverb_flag, /* i : room reverb flag */ - const IVAS_AUDIO_CONFIG intern_audio_config, /* i : internal audio configuration */ -#endif - const hrtfFileReader *hrtfReader /* i : pointer to hrtfFileReader handle */ + const IVAS_AUDIO_CONFIG OutputConfig, /* i : output audio configuration */ + const IVAS_AUDIO_CONFIG hrtf_set_audio_cfg, /* i : HRTF set audio config. */ + const hrtfFileReader *hrtfReader /* i : pointer to hrtfFileReader handle */ ) { FILE *f_hrtf; @@ -2130,13 +1715,11 @@ ivas_error load_fastconv_HRTF_from_binary( ivas_hrtfs_file_header_t hrtfs_file_header; int16_t hrtf_id; int16_t asFastconv = 0; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM bool load = false; BINAURAL_INPUT_AUDIO_CONFIG hrtf_set_binaural_cfg; /* convert audio config. to HRTF binaural config */ hrtf_set_binaural_cfg = audio_cfg_2_binaural_cfg( hrtf_set_audio_cfg ); -#endif if ( hrtfReader == NULL || hrtfReader->file == NULL ) { @@ -2174,7 +1757,6 @@ ivas_error load_fastconv_HRTF_from_binary( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "HRTF binary file not compliant (number of HRTF)" ); } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && /* HRIRs */ ( OutputConfig == IVAS_AUDIO_CONFIG_BINAURAL || OutputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) || ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM && /* BRIRs */ @@ -2185,15 +1767,6 @@ ivas_error load_fastconv_HRTF_from_binary( } if ( load ) -#else - if ( ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && - ( ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA3 && intern_audio_config == IVAS_AUDIO_CONFIG_HOA3 ) || - ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA2 && intern_audio_config == IVAS_AUDIO_CONFIG_HOA2 ) || - ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_FOA && intern_audio_config == IVAS_AUDIO_CONFIG_FOA ) || - ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) ) ) || - ( ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV || hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM ) && room_reverb_flag == 1 ) || - ( ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV || hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM ) && intern_audio_config == IVAS_AUDIO_CONFIG_INVALID ) ) -#endif { #ifdef FIX_1228_SAMPLING_RATE_MISMATCH_IN_HRTF_FILE if ( hrtf_header.frequency != 48000 ) /* note: Parametric renderer data are always stored at 48 kHz */ @@ -2214,9 +1787,7 @@ ivas_error load_fastconv_HRTF_from_binary( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Could not create FastConv HRTF from binary file" ); } asFastconv = 1; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM break; /* read just one set */ -#endif } else { @@ -2341,7 +1912,6 @@ ivas_error load_parambin_HRTF_from_binary( * Create the Crend HRTF data set from the binary file *---------------------------------------------------------------------*/ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM ivas_error load_Crend_HRTF_from_binary( IVAS_DEC_HRTF_CREND_HANDLE hHrtfCrend, /* i/o: HRTF CRend handle */ const hrtfFileReader *hrtfReader, /* i : pointer to hrtfFileReader handle */ @@ -2349,31 +1919,19 @@ ivas_error load_Crend_HRTF_from_binary( const IVAS_AUDIO_CONFIG hrtf_set_audio_cfg, /* i : HRTF set audio config. */ const int32_t sampleRate /* i : sample rate */ ) -#else -ivas_error create_SetOfHRTF_from_binary( - IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF, /* i/o: HRTF CRend handle */ - const hrtfFileReader *hrtfReader, /* i : pointer to hrtfFileReader handle */ - const int32_t output_Fs /* i : Output sampling frequency */ -) -#endif { FILE *f_hrtf; int32_t hrtf_data_size_max; char *hrtf_data; ivas_hrtfs_header_t hrtf_header; -#ifndef FIX_1227_Crend_HRTF_LOADING_OPTIM - HRTFS_DATA **hHRTF; -#endif ivas_error header_check_result; ivas_hrtfs_file_header_t hrtfs_file_header; int16_t hrtf_id; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM bool load = false; BINAURAL_INPUT_AUDIO_CONFIG hrtf_set_binaural_cfg; /* convert audio config. to HRTF binaural config */ hrtf_set_binaural_cfg = audio_cfg_2_binaural_cfg( hrtf_set_audio_cfg ); -#endif if ( hrtfReader == NULL || hrtfReader->file == NULL ) { @@ -2404,14 +1962,10 @@ ivas_error create_SetOfHRTF_from_binary( /* Read & load */ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( hHrtfCrend == NULL ) { return IVAS_ERROR( IVAS_ERR_INTERNAL, "Crend HRTF binary handle not allocated!\n" ); } -#else - memset( hSetOfHRTF, 0x00, sizeof( HRTFS_CREND ) ); -#endif for ( hrtf_id = 0; hrtf_id < hrtfs_file_header.nb_hrtf; hrtf_id++ ) { @@ -2421,7 +1975,6 @@ ivas_error create_SetOfHRTF_from_binary( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "HRTF binary file not compliant (number of HRTF)" ); } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_MIXER_CONV && /* HRIRs */ ( OutputConfig == IVAS_AUDIO_CONFIG_BINAURAL || OutputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) || ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_MIXER_CONV_ROOM && /* BRIRs */ @@ -2433,39 +1986,6 @@ ivas_error create_SetOfHRTF_from_binary( if ( load ) { -#else - hHRTF = NULL; - - if ( hrtf_header.frequency == output_Fs ) - { - if ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_MIXER_CONV ) - { - if ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) - { - hHRTF = &( ( *hSetOfHRTF ).hHRTF_hrir_combined ); - } - else if ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA3 ) - { - hHRTF = &( ( *hSetOfHRTF ).hHRTF_hrir_hoa3 ); - } - else if ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA2 ) - { - hHRTF = &( ( *hSetOfHRTF ).hHRTF_hrir_hoa2 ); - } - else if ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_FOA ) - { - hHRTF = &( ( *hSetOfHRTF ).hHRTF_hrir_foa ); - } - } - else if ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_MIXER_CONV_ROOM ) - { - if ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) - { - hHRTF = &( ( *hSetOfHRTF ).hHRTF_brir_combined ); - } - } - } -#endif #ifdef FIX_1228_SAMPLING_RATE_MISMATCH_IN_HRTF_FILE if ( hrtf_header.frequency != sampleRate ) { @@ -2479,7 +1999,6 @@ ivas_error create_SetOfHRTF_from_binary( return IVAS_ERROR( IVAS_ERR_FAILED_FILE_READ, "Error in HRTF file reading" ); } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM #ifndef FIX_1228_SAMPLING_RATE_MISMATCH_IN_HRTF_FILE if ( hrtf_header.frequency != output_Fs ) { @@ -2499,16 +2018,6 @@ ivas_error create_SetOfHRTF_from_binary( { fseek( f_hrtf, hrtf_header.data_size, SEEK_CUR ); } -#else - if ( hHRTF != NULL ) - { - if ( ( create_HRTF_from_rawdata( hHRTF, hrtf_data ) ) != IVAS_ERR_OK ) - { - free( hrtf_data ); - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Could not create HRTF from binary file" ); - } - } -#endif } free( hrtf_data ); @@ -2517,7 +2026,6 @@ ivas_error create_SetOfHRTF_from_binary( } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM /*---------------------------------------------------------------------* * destroy_crend_hrtf() * @@ -2572,87 +2080,6 @@ void destroy_crend_hrtf( return; } -#else -/*---------------------------------------------------------------------* - * destroy_HRTF() - * - * Destroy the HRTF CRend handle - *---------------------------------------------------------------------*/ - -static void destroy_HRTF( - HRTFS_HANDLE *hHRTF /* i/o: HRTF CRend handle */ -) -{ - uint16_t i, j; - - if ( *hHRTF != NULL && hHRTF != NULL && ( *hHRTF )->init_from_rom == 0 ) - { - for ( i = 0; i < MAX_INTERN_CHANNELS; i++ ) - { - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - if ( ( *hHRTF )->pIndex_frequency_max[i][j] != NULL ) - { - free( ( *hHRTF )->pIndex_frequency_max_dyn[i][j] ); - } - if ( ( *hHRTF )->pOut_to_bin_re[i][j] != NULL ) - { - free( ( *hHRTF )->pOut_to_bin_re_dyn[i][j] ); - } - if ( ( *hHRTF )->pOut_to_bin_im[i][j] != NULL ) - { - free( ( *hHRTF )->pOut_to_bin_im_dyn[i][j] ); - } - } - } - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - if ( ( *hHRTF )->pIndex_frequency_max_diffuse[j] != NULL ) - { - free( ( *hHRTF )->pIndex_frequency_max_diffuse_dyn[j] ); - } - if ( ( *hHRTF )->pOut_to_bin_diffuse_re[j] != NULL ) - { - free( ( *hHRTF )->pOut_to_bin_diffuse_re_dyn[j] ); - } - if ( ( *hHRTF )->pOut_to_bin_diffuse_im[j] != NULL ) - { - free( ( *hHRTF )->pOut_to_bin_diffuse_im_dyn[j] ); - } - } - - free( *hHRTF ); - *hHRTF = NULL; - } - - return; -} - - -/*---------------------------------------------------------------------* - * destroy_SetOfHRTF() - * - * Destroy the HRTF data set for Crend renderer - *---------------------------------------------------------------------*/ - -void destroy_SetOfHRTF( - HRTFS_CREND_HANDLE *hSetOfHRTF /* i/o: Set of HRTF CRend handle */ -) -{ - if ( ( hSetOfHRTF != NULL ) && ( *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 ) ); - } - - ivas_HRTF_CRend_binary_close( hSetOfHRTF ); - - return; -} -#endif /*---------------------------------------------------------------------* diff --git a/lib_util/hrtf_file_reader.h b/lib_util/hrtf_file_reader.h index b27a42cf9f4e088fac4ebfb3264a2f3c05c85791..5a8680638018c28ecd0e6b3611e85f21eabd5b0e 100644 --- a/lib_util/hrtf_file_reader.h +++ b/lib_util/hrtf_file_reader.h @@ -51,7 +51,6 @@ typedef enum } HRTF_READER_RENDERER_TYPE; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM typedef enum { BINAURAL_INPUT_AUDIO_CONFIG_INVALID, @@ -63,7 +62,6 @@ typedef enum } BINAURAL_INPUT_AUDIO_CONFIG; -#endif typedef struct ivas_hrtfs_header_t { int32_t rend_type; @@ -130,7 +128,6 @@ ivas_error load_reverb_binary( * Create the Crend HRTF data set from the binary file *---------------------------------------------------------------------*/ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM ivas_error load_Crend_HRTF_from_binary( IVAS_DEC_HRTF_CREND_HANDLE hHrtfCrend, /* i/o: HRTF CRend handle */ const hrtfFileReader *hrtfReader, /* i : pointer to hrtfFileReader handle */ @@ -138,15 +135,7 @@ ivas_error load_Crend_HRTF_from_binary( const IVAS_AUDIO_CONFIG hrtf_set_audio_cfg, /* i : HRTF set audio config. */ const int32_t sampleRate /* i : sample rate */ ); -#else -ivas_error create_SetOfHRTF_from_binary( - IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF, /* i/o: Set of HRTF CRend handle */ - const hrtfFileReader *hrtfReader, /* i : pointer to hrtfFileReader handle */ - const int32_t output_Fs /* i : Output sampling frequency */ -); -#endif -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM /*---------------------------------------------------------------------* * destroy_crend_hrtf() * @@ -156,17 +145,6 @@ ivas_error create_SetOfHRTF_from_binary( void destroy_crend_hrtf( IVAS_DEC_HRTF_CREND_HANDLE *hHrtfCrend /* i/o: Crend HRTF handle */ ); -#else -/*---------------------------------------------------------------------* - * destroy_SetOfHRTF() - * - * Destroy the HRTF data set. - *---------------------------------------------------------------------*/ - -void destroy_SetOfHRTF( - IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF /* i/o: Set of HRTF CRend handle */ -); -#endif /*---------------------------------------------------------------------* * load_fastconv_HRTF_from_binary() @@ -176,14 +154,9 @@ void destroy_SetOfHRTF( ivas_error load_fastconv_HRTF_from_binary( IVAS_DEC_HRTF_FASTCONV_HANDLE hHrtfFastConv, /* i/o: FastConv HRTF handle */ -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - const IVAS_AUDIO_CONFIG OutputConfig, /* i : output audio configuration */ - const IVAS_AUDIO_CONFIG hrtf_set_audio_cfg, /* i : HRTF set audio config. */ -#else - const int16_t room_reverb_flag, /* i : room reverb flag */ - IVAS_AUDIO_CONFIG intern_audio_config, /* i : internal audio configuration */ -#endif - const hrtfFileReader *hrtfReader /* i : pointer to hrtfFileReader handle */ + const IVAS_AUDIO_CONFIG OutputConfig, /* i : output audio configuration */ + const IVAS_AUDIO_CONFIG hrtf_set_audio_cfg, /* i : HRTF set audio config. */ + const hrtfFileReader *hrtfReader /* i : pointer to hrtfFileReader handle */ ); /*---------------------------------------------------------------------* diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index 2e8b426ca6297a8a3885418c239dd9ee598073ee..14ec980eeea62017122c12d6e89b414967e24de4 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -3034,11 +3034,7 @@ ivas_error RenderConfigReader_getDirectivity( } } /* case when -dpid is not specified, select first directivity pattern from config file */ -#ifdef NONBE_1229_FIX_ISM1_DPID if ( last_specified_id == 65535 ) -#else - if ( n == 0 ) -#endif { last_specified_id = (uint16_t) pRenderConfigReader->pDP[0].id; }