Loading apps/decoder.c +7 −182 Original line number Diff line number Diff line Loading @@ -156,7 +156,6 @@ typedef struct } DecArguments; #ifdef FIX_CREND_SIMPLIFY_CODE typedef struct { hrtfFileReader *hrtfReader; Loading @@ -174,7 +173,7 @@ typedef struct IVAS_AUDIO_CONFIG hrtf_set_audio_cfg; } IVAS_DEC_HRTF_BINARY_WRAPPER; #endif /*------------------------------------------------------------------------------------------* * Local functions prototypes Loading @@ -182,14 +181,9 @@ typedef struct static bool parseCmdlIVAS_dec( int16_t argc, char **argv, DecArguments *arg ); static void usage_dec( void ); #ifdef FIX_CREND_SIMPLIFY_CODE static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, 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 *hHrtfBinary, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec ); 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 decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, 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, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec ); #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 ); Loading Loading @@ -224,13 +218,7 @@ int main( RenderConfigReader *renderConfigReader = NULL; int16_t *pcmBuf = NULL; IVAS_RENDER_FRAMESIZE asked_frame_size; #ifdef FIX_CREND_SIMPLIFY_CODE IVAS_DEC_HRTF_BINARY_WRAPPER hHrtfBinary; #else IVAS_DEC_HRTF_HANDLE *hHrtfTD = NULL; IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF = NULL; IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics = NULL; #endif #ifdef DEBUGGING int32_t noClipping; int32_t cnt_frames_limited; Loading @@ -247,10 +235,8 @@ int main( reset_mem( USE_BYTES ); #endif #ifdef FIX_CREND_SIMPLIFY_CODE hHrtfBinary.hHrtfTD = NULL; /* just to avoid compilation warning */ hHrtfBinary.hHrtfStatistics = NULL; /* just to avoid compilation warning */ #endif splitRendBits.bits_buf = splitRendBitsBuf; Loading Loading @@ -731,115 +717,11 @@ int main( if ( arg.hrtfReaderEnabled ) { #ifdef FIX_CREND_SIMPLIFY_CODE hHrtfBinary.hrtfReader = hrtfReader; hHrtfBinary.hrtfFileName = arg.hrtfFileName; hHrtfBinary.binaural_renderer = IVAS_BIN_RENDERER_TYPE_NONE; hHrtfBinary.binaural_renderer_sec = IVAS_BIN_RENDERER_TYPE_NONE; hHrtfBinary.hrtf_set_audio_cfg = IVAS_AUDIO_CONFIG_INVALID; #else if ( ( error = IVAS_DEC_GetHrtfHandle( hIvasDec, &hHrtfTD ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetHrtfHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #ifdef FIX_989_TD_REND_ROM if ( ( error = load_TDrend_HRTF_binary( *hHrtfTD, arg.output_Fs, hrtfReader ) ) != IVAS_ERR_OK ) #else if ( ( error = load_HRTF_binary( *hHrtfTD, hrtfReader ) ) != IVAS_ERR_OK ) #endif { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); goto cleanup; } else { destroy_td_hrtf( hHrtfTD ); } } if ( ( error = IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hSetOfHRTF ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetHrtfCRendHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } if ( ( error = create_SetOfHRTF_from_binary( *hSetOfHRTF, hrtfReader, arg.output_Fs ) ) != IVAS_ERR_OK ) { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); goto cleanup; } else { destroy_SetOfHRTF( hSetOfHRTF ); } } IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv = NULL; if ( ( error = IVAS_DEC_GetHrtfFastConvHandle( hIvasDec, &hHrtfFastConv ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetHrtfFastConvHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, hrtfReader ) ) != IVAS_ERR_OK ) { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); goto cleanup; } else { destroy_fastconv_hrtf( hHrtfFastConv ); } } IVAS_DEC_HRTF_PARAMBIN_HANDLE *hHrtfParambin = NULL; if ( ( error = IVAS_DEC_GetHrtfParamBinHandle( hIvasDec, &hHrtfParambin ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetHrtfParamBinHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } if ( ( error = load_parambin_HRTF_from_binary( *hHrtfParambin, hrtfReader ) ) != IVAS_ERR_OK ) { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); goto cleanup; } else { destroy_parambin_hrtf( hHrtfParambin ); } } if ( ( error = IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetHrtfHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } if ( ( error = load_reverb_binary( *hHrtfStatistics, arg.output_Fs, hrtfReader ) ) != IVAS_ERR_OK ) { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); goto cleanup; } else { destroy_hrtf_statistics( hHrtfStatistics ); } } #endif } /*------------------------------------------------------------------------------------------* Loading @@ -854,32 +736,23 @@ int main( } pcmBuf = malloc( pcmBufSize * sizeof( int16_t ) ); #ifdef FIX_CREND_SIMPLIFY_CODE if ( pcmBuf == NULL ) { fprintf( stdout, "Error: Unable to allocate memory for output buffer.\n" ); goto cleanup; } #endif /*-----------------------------------------------------------------* * Decoding *-----------------------------------------------------------------*/ if ( arg.voipMode ) { #ifdef FIX_CREND_SIMPLIFY_CODE error = decodeVoIP( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, hIvasDec ); #else error = decodeVoIP( arg, hBsReader, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, hIvasDec ); #endif } else { #ifdef FIX_CREND_SIMPLIFY_CODE error = decodeG192( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, &splitRendBits, hIvasDec, pcmBuf ); #else error = decodeG192( arg, hBsReader, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, &splitRendBits, hIvasDec, pcmBuf ); #endif } if ( error == IVAS_ERR_OK || error == IVAS_ERR_END_OF_FILE ) Loading @@ -895,11 +768,7 @@ int main( } else { #ifdef FIX_CREND_SIMPLIFY_CODE fprintf( stderr, "\nDecoding finished prematurely: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); #else fprintf( stdout, "Decoding finished prematurely\n\n" ); #endif goto cleanup; } Loading Loading @@ -936,23 +805,8 @@ cleanup: #endif if ( arg.hrtfReaderEnabled ) { #ifdef FIX_CREND_SIMPLIFY_CODE destroy_td_hrtf( hHrtfBinary.hHrtfTD ); destroy_hrtf_statistics( hHrtfBinary.hHrtfStatistics ); #else IVAS_DEC_GetHrtfHandle( hIvasDec, &hHrtfTD ); if ( hHrtfTD != NULL ) { destroy_td_hrtf( hHrtfTD ); } IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hSetOfHRTF ); if ( hSetOfHRTF != NULL ) { destroy_SetOfHRTF( hSetOfHRTF ); } IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics ); destroy_hrtf_statistics( hHrtfStatistics ); #endif } IVAS_DEC_Close( &hIvasDec ); Loading Loading @@ -2212,9 +2066,7 @@ static ivas_error initOnFirstGoodFrame( static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, #ifdef FIX_CREND_SIMPLIFY_CODE IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, #endif RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Loading Loading @@ -2575,7 +2427,6 @@ static ivas_error decodeG192( goto cleanup; } #ifdef FIX_CREND_SIMPLIFY_CODE /* 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; Loading @@ -2596,16 +2447,13 @@ static ivas_error decodeG192( goto cleanup; } } #endif #ifdef FIX_HRTF_LOAD_API /* decode transport channels, do TSM and feed to renderer */ if ( ( error = IVAS_DEC_GetSamplesDecoder( hIvasDec, isSplitRend, splitRendBits ) ) != IVAS_ERR_OK ) { return error; } #endif #ifdef OBJ_EDITING_API /* Do the final preparations needed for rendering */ if ( ( error = IVAS_DEC_PrepareRenderer( hIvasDec ) ) != IVAS_ERR_OK ) Loading Loading @@ -3116,9 +2964,7 @@ static ivas_error writeJbmTraceFileFrameWrapper( const void *data, void *writer static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, #ifdef FIX_CREND_SIMPLIFY_CODE IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, #endif RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Loading Loading @@ -3168,13 +3014,11 @@ static ivas_error decodeVoIP( IVAS_VECTOR3 Pos[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES] = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }; int16_t vec_pos_update, vec_pos_len; int16_t nOutSamples = 0; #ifdef FIX_CREND_SIMPLIFY_CODE bool bitstreamReadDone = false; #ifdef OBJ_EDITING_API bool parameterAvailableForEditing = false; #endif uint16_t nSamplesRendered; #endif vec_pos_update = 0; if ( ( error = IVAS_DEC_GetRenderFramesizeMs( hIvasDec, &systemTimeInc_ms ) ) != IVAS_ERR_OK ) Loading Loading @@ -3292,9 +3136,7 @@ static ivas_error decodeVoIP( while ( 1 ) { #ifdef FIX_CREND_SIMPLIFY_CODE nSamplesRendered = 0; #endif /* reference vector */ if ( arg.enableReferenceVectorTracking && vec_pos_update == 0 ) Loading Loading @@ -3458,37 +3300,26 @@ static ivas_error decodeVoIP( /* decode and get samples */ #ifdef FIX_HRTF_LOAD while ( nSamplesRendered < nOutSamples ) { #endif #ifdef SUPPORT_JBM_TRACEFILE #ifdef FIX_CREND_SIMPLIFY_CODE #ifdef OBJ_EDITING_API if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &bitstreamReadDone, &nSamplesRendered, ¶meterAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &bitstreamReadDone, &nSamplesRendered, systemTime_ms ) ) != IVAS_ERR_OK ) #endif #else if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, writeJbmTraceFileFrameWrapper, jbmTraceWriter, systemTime_ms ) ) != IVAS_ERR_OK ) #endif #else #ifdef FIX_CREND_SIMPLIFY_CODE #ifdef OBJ_EDITING_API if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, &bitstreamReadDone, ¶meterAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, &bitstreamReadDone, systemTime_ms ) ) != IVAS_ERR_OK ) #endif #else if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, systemTime_ms ) ) != IVAS_ERR_OK ) #endif #endif { fprintf( stderr, "\nError in IVAS_DEC_VoIP_GetSamples: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #ifdef FIX_CREND_SIMPLIFY_CODE if ( bitstreamReadDone == true ) { /* Read main parameters from the bitstream to set-up the decoder */ Loading @@ -3512,16 +3343,14 @@ static ivas_error decodeVoIP( } } } #endif #ifdef OBJ_EDITING_API if ( parameterAvailableForEditing == true ) { /* do the object editing here */ } #endif #ifdef FIX_HRTF_LOAD } /* while ( nSamplesRendered < nOutSamples ) */ #endif /* write JBM Offset file entry */ if ( jbmOffsetWriter != NULL ) Loading Loading @@ -3829,7 +3658,7 @@ static IVAS_DEC_FORCED_REND_MODE parseForcedRendModeDec( #endif #ifdef FIX_CREND_SIMPLIFY_CODE /*---------------------------------------------------------------------* * load_hrtf_from_file() * Loading Loading @@ -3894,11 +3723,7 @@ static ivas_error load_hrtf_from_file( return error; } #ifdef FIX_989_TD_REND_ROM if ( ( error = load_TDrend_HRTF_binary( *hHrtfBinary->hHrtfTD, output_Fs, hHrtfBinary->hrtfReader ) ) != IVAS_ERR_OK ) #else if ( ( error = load_HRTF_binary( *hHrtfBinary->hHrtfTD, hHrtfBinary->hrtfReader ) ) != IVAS_ERR_OK ) #endif { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { Loading Loading @@ -4006,5 +3831,5 @@ static ivas_error load_hrtf_from_file( return IVAS_ERR_OK; } #endif #undef WMC_TOOL_SKIP apps/renderer.c +0 −56 Original line number Diff line number Diff line Loading @@ -639,11 +639,7 @@ static int16_t get_cldfb_in_flag( int16_t cldfb_in_flag; cldfb_in_flag = 0; #ifdef FIX_HRTF_LOAD if ( renderConfig->split_rend_config.rendererSelection == IVAS_BIN_RENDERER_TYPE_FASTCONV ) #else if ( renderConfig->split_rend_config.rendererSelection == ISAR_SPLIT_REND_RENDERER_SELECTION_FASTCONV ) #endif { #ifdef DEBUGGING cldfb_in_flag = 1; Loading Loading @@ -692,11 +688,7 @@ int main( SplitRendBFIFileReader *splitRendBFIReader = NULL; Vector3PairFileReader *referenceVectorReader = NULL; hrtfFileReader *hrtfFileReader = NULL; #ifdef FIX_CREND_SIMPLIFY_CODE 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; Loading Loading @@ -982,11 +974,7 @@ int main( goto cleanup; } #ifdef FIX_989_TD_REND_ROM if ( ( error = load_TDrend_HRTF_binary( *hHrtfTD, args.sampleRate, hrtfFileReader ) ) != IVAS_ERR_OK ) #else if ( ( error = load_HRTF_binary( *hHrtfTD, hrtfFileReader ) ) != IVAS_ERR_OK ) #endif { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { Loading @@ -999,7 +987,6 @@ int main( } } #ifdef FIX_CREND_SIMPLIFY_CODE if ( ( error = IVAS_REND_GetHrtfCRendHandle( hIvasRend, &hHrtfCrend ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_Rend_GetHrtfCRendHandle failed: %s\n\n", ivas_error_to_string( error ) ); Loading @@ -1012,15 +999,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 = IVAS_REND_GetHrtfCRendHandle( hIvasRend, &hSetOfHRTF ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_Rend_GetHrtfCRendHandle failed: %s\n\n", ivas_error_to_string( error ) ); goto cleanup; } if ( ( error = create_SetOfHRTF_from_binary( *hSetOfHRTF, hrtfFileReader, args.sampleRate ) ) != IVAS_ERR_OK ) #endif { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { Loading @@ -1029,11 +1007,7 @@ int main( } else { #ifdef FIX_CREND_SIMPLIFY_CODE destroy_crend_hrtf( hHrtfCrend ); #else destroy_SetOfHRTF( hSetOfHRTF ); #endif } } Loading @@ -1043,11 +1017,7 @@ int main( goto cleanup; } #ifdef FIX_CREND_SIMPLIFY_CODE 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, hrtfFileReader ) ) != IVAS_ERR_OK ) #endif { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { Loading Loading @@ -2080,20 +2050,8 @@ cleanup: RotationFileReader_close( &headRotReader ); RotationFileReader_close( &externalOrientationFileReader ); RotationFileReader_close( &referenceRotReader ); Vector3PairFileReader_close( &referenceVectorReader ); #ifdef FIX_CREND_SIMPLIFY_CODE destroy_td_hrtf( hHrtfTD ); #else if ( hSetOfHRTF != NULL && *hSetOfHRTF != NULL ) { destroy_SetOfHRTF( hSetOfHRTF ); } if ( hHrtfTD != NULL && *hHrtfTD != NULL ) { destroy_td_hrtf( hHrtfTD ); } #endif destroy_hrtf_statistics( hHrtfStatistics ); IVAS_REND_Close( &hIvasRend ); IsmPositionProvider_close( positionProvider ); Loading Loading @@ -2687,9 +2645,7 @@ static CmdlnArgs defaultArgs( const char *executableName ) { CmdlnArgs args; #ifdef FIX_CREND_SIMPLIFY_CODE int16_t i; #endif strncpy( args.executableName, executableName, RENDERER_MAX_CLI_ARG_LENGTH ); clearString( args.inputFilePath ); Loading @@ -2706,20 +2662,12 @@ static CmdlnArgs defaultArgs( args.outConfig.audioConfig = IVAS_AUDIO_CONFIG_INVALID; args.outConfig.outSetupCustom.num_spk = 0; args.outConfig.outSetupCustom.num_lfe = 0; #ifdef FIX_CREND_SIMPLIFY_CODE for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; ++i ) { args.inConfig.ambisonicsBuses[i].audioConfig = IVAS_AUDIO_CONFIG_INVALID; } #else args.inConfig.ambisonicsBuses->audioConfig = IVAS_AUDIO_CONFIG_INVALID; #endif #ifdef FIX_CREND_SIMPLIFY_CODE for ( i = 0; i < RENDERER_MAX_ISM_INPUTS + RENDERER_MAX_MASA_INPUTS; ++i ) #else for ( int32_t i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) #endif { clearString( args.inMetadataFilePaths[i] ); } Loading Loading @@ -2757,11 +2705,7 @@ static CmdlnArgs defaultArgs( args.render_framesize = IVAS_RENDER_FRAMESIZE_20MS; args.syncMdDelay = 0; #ifdef FIX_CREND_SIMPLIFY_CODE for ( i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) #else for ( int32_t i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) #endif { args.directivityPatternId[i] = 65535; } Loading lib_com/common_api_types.h +0 −25 Original line number Diff line number Diff line Loading @@ -177,19 +177,11 @@ typedef enum 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; #ifdef FIX_CREND_SIMPLIFY_CODE typedef struct ivas_hrtf_TDREND_HRFILT_FiltSet_struct *IVAS_DEC_HRTF_HANDLE; typedef struct ivas_hrtf_crend_structure *IVAS_DEC_HRTF_CREND_HANDLE; typedef struct ivas_hrtf_fastconv_struct *IVAS_DEC_HRTF_FASTCONV_HANDLE; typedef struct ivas_hrtf_parambin_struct *IVAS_DEC_HRTF_PARAMBIN_HANDLE; typedef struct ivas_hrtf_statistics_struct *IVAS_DEC_HRTF_STATISTICS_HANDLE; #else typedef struct TDREND_HRFILT_FiltSet_struct *IVAS_DEC_HRTF_HANDLE; typedef struct ivas_hrtfs_crend_structure *IVAS_DEC_HRTF_CREND_HANDLE; 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; #endif typedef struct cldfb_filter_bank_struct *IVAS_CLDFB_FILTER_BANK_HANDLE; typedef struct ivas_LS_setup_custom *IVAS_LSSETUP_CUSTOM_HANDLE; Loading Loading @@ -221,7 +213,6 @@ typedef struct _IVAS_JBM_TRACE_DATA } IVAS_JBM_TRACE_DATA; #ifdef FIX_CREND_SIMPLIFY_CODE typedef enum _ivas_binaural_renderer_type { IVAS_BIN_RENDERER_TYPE_NONE, Loading @@ -232,7 +223,6 @@ typedef enum _ivas_binaural_renderer_type IVAS_BIN_RENDERER_TYPE_DEFAULT, } IVAS_BIN_RENDERER_TYPE; #endif /*----------------------------------------------------------------------------------* * Split rendering API constants, structures, and enums Loading Loading @@ -271,17 +261,6 @@ typedef enum } ISAR_SPLIT_REND_CODEC; #ifndef FIX_HRTF_LOAD typedef enum { ISAR_SPLIT_REND_RENDERER_SELECTION_CREND, ISAR_SPLIT_REND_RENDERER_SELECTION_FASTCONV, ISAR_SPLIT_REND_RENDERER_SELECTION_PARAMBIN, ISAR_SPLIT_REND_RENDERER_SELECTION_TDREND, ISAR_SPLIT_REND_RENDERER_SELECTION_DEFAULT, } ISAR_SPLIT_REND_RENDERER_SELECTION; #endif typedef struct _ISAR_SPLIT_REND_BITS_DATA { uint8_t *bits_buf; Loading Loading @@ -312,11 +291,7 @@ typedef struct _ISAR_SPLIT_REND_CONFIG int16_t codec_frame_size_ms; /* Codec frame size in milliseconds, only relevant with LC3plus */ ISAR_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode; ISAR_SPLIT_REND_CODEC codec; #ifdef FIX_HRTF_LOAD IVAS_BIN_RENDERER_TYPE rendererSelection; #else ISAR_SPLIT_REND_RENDERER_SELECTION rendererSelection; #endif int16_t lc3plus_highres; } ISAR_SPLIT_REND_CONFIG_DATA, *ISAR_SPLIT_REND_CONFIG_HANDLE; Loading lib_com/ivas_cnst.h +0 −2 Original line number Diff line number Diff line Loading @@ -1531,10 +1531,8 @@ typedef enum #define MAX_ANGULAR_STEP_INV ( 1.0f / MAX_ANGULAR_STEP ) #define MAX_INTERPOLATION_STEPS 12 #ifdef FIX_989_TD_REND_ROM #define RESAMPLE_FACTOR_16_48 ( 16.0f / 48.0f ) #define RESAMPLE_FACTOR_32_48 ( 32.0f / 48.0f ) #endif /* ----- Enums - TD Renderer ----- */ Loading lib_com/ivas_error.h +0 −4 Original line number Diff line number Diff line Loading @@ -78,9 +78,7 @@ typedef enum IVAS_ERR_DIRECTIVITY_NOT_SUPPORTED, IVAS_ERR_ACOUSTIC_ENVIRONMENT_NOT_SUPPORTED, IVAS_ERR_INVALID_HRTF, #if defined FIX_CREND_SIMPLIFY_CODE || defined FIX_989_TD_REND_ROM IVAS_ERR_INVALID_HRTF_SAMPLING_RATE, #endif IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA, IVAS_ERR_INVALID_INPUT_FORMAT, IVAS_ERR_INVALID_INDEX, Loading Loading @@ -259,10 +257,8 @@ static inline const char *ivas_error_to_string( ivas_error error_code ) return "Acoustic environment not supported"; case IVAS_ERR_INVALID_HRTF: return "Unsupported HRTF filter set"; #if defined FIX_CREND_SIMPLIFY_CODE || defined FIX_989_TD_REND_ROM case IVAS_ERR_INVALID_HRTF_SAMPLING_RATE: return "Wrong sampling rate in HRTF binary file"; #endif case IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA: return "Renderer data missing in HRTF binary file"; case IVAS_ERR_INVALID_INPUT_FORMAT: Loading Loading
apps/decoder.c +7 −182 Original line number Diff line number Diff line Loading @@ -156,7 +156,6 @@ typedef struct } DecArguments; #ifdef FIX_CREND_SIMPLIFY_CODE typedef struct { hrtfFileReader *hrtfReader; Loading @@ -174,7 +173,7 @@ typedef struct IVAS_AUDIO_CONFIG hrtf_set_audio_cfg; } IVAS_DEC_HRTF_BINARY_WRAPPER; #endif /*------------------------------------------------------------------------------------------* * Local functions prototypes Loading @@ -182,14 +181,9 @@ typedef struct static bool parseCmdlIVAS_dec( int16_t argc, char **argv, DecArguments *arg ); static void usage_dec( void ); #ifdef FIX_CREND_SIMPLIFY_CODE static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, 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 *hHrtfBinary, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec ); 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 decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, 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, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec ); #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 ); Loading Loading @@ -224,13 +218,7 @@ int main( RenderConfigReader *renderConfigReader = NULL; int16_t *pcmBuf = NULL; IVAS_RENDER_FRAMESIZE asked_frame_size; #ifdef FIX_CREND_SIMPLIFY_CODE IVAS_DEC_HRTF_BINARY_WRAPPER hHrtfBinary; #else IVAS_DEC_HRTF_HANDLE *hHrtfTD = NULL; IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF = NULL; IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics = NULL; #endif #ifdef DEBUGGING int32_t noClipping; int32_t cnt_frames_limited; Loading @@ -247,10 +235,8 @@ int main( reset_mem( USE_BYTES ); #endif #ifdef FIX_CREND_SIMPLIFY_CODE hHrtfBinary.hHrtfTD = NULL; /* just to avoid compilation warning */ hHrtfBinary.hHrtfStatistics = NULL; /* just to avoid compilation warning */ #endif splitRendBits.bits_buf = splitRendBitsBuf; Loading Loading @@ -731,115 +717,11 @@ int main( if ( arg.hrtfReaderEnabled ) { #ifdef FIX_CREND_SIMPLIFY_CODE hHrtfBinary.hrtfReader = hrtfReader; hHrtfBinary.hrtfFileName = arg.hrtfFileName; hHrtfBinary.binaural_renderer = IVAS_BIN_RENDERER_TYPE_NONE; hHrtfBinary.binaural_renderer_sec = IVAS_BIN_RENDERER_TYPE_NONE; hHrtfBinary.hrtf_set_audio_cfg = IVAS_AUDIO_CONFIG_INVALID; #else if ( ( error = IVAS_DEC_GetHrtfHandle( hIvasDec, &hHrtfTD ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetHrtfHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #ifdef FIX_989_TD_REND_ROM if ( ( error = load_TDrend_HRTF_binary( *hHrtfTD, arg.output_Fs, hrtfReader ) ) != IVAS_ERR_OK ) #else if ( ( error = load_HRTF_binary( *hHrtfTD, hrtfReader ) ) != IVAS_ERR_OK ) #endif { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); goto cleanup; } else { destroy_td_hrtf( hHrtfTD ); } } if ( ( error = IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hSetOfHRTF ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetHrtfCRendHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } if ( ( error = create_SetOfHRTF_from_binary( *hSetOfHRTF, hrtfReader, arg.output_Fs ) ) != IVAS_ERR_OK ) { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); goto cleanup; } else { destroy_SetOfHRTF( hSetOfHRTF ); } } IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv = NULL; if ( ( error = IVAS_DEC_GetHrtfFastConvHandle( hIvasDec, &hHrtfFastConv ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetHrtfFastConvHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, hrtfReader ) ) != IVAS_ERR_OK ) { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); goto cleanup; } else { destroy_fastconv_hrtf( hHrtfFastConv ); } } IVAS_DEC_HRTF_PARAMBIN_HANDLE *hHrtfParambin = NULL; if ( ( error = IVAS_DEC_GetHrtfParamBinHandle( hIvasDec, &hHrtfParambin ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetHrtfParamBinHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } if ( ( error = load_parambin_HRTF_from_binary( *hHrtfParambin, hrtfReader ) ) != IVAS_ERR_OK ) { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); goto cleanup; } else { destroy_parambin_hrtf( hHrtfParambin ); } } if ( ( error = IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetHrtfHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } if ( ( error = load_reverb_binary( *hHrtfStatistics, arg.output_Fs, hrtfReader ) ) != IVAS_ERR_OK ) { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); goto cleanup; } else { destroy_hrtf_statistics( hHrtfStatistics ); } } #endif } /*------------------------------------------------------------------------------------------* Loading @@ -854,32 +736,23 @@ int main( } pcmBuf = malloc( pcmBufSize * sizeof( int16_t ) ); #ifdef FIX_CREND_SIMPLIFY_CODE if ( pcmBuf == NULL ) { fprintf( stdout, "Error: Unable to allocate memory for output buffer.\n" ); goto cleanup; } #endif /*-----------------------------------------------------------------* * Decoding *-----------------------------------------------------------------*/ if ( arg.voipMode ) { #ifdef FIX_CREND_SIMPLIFY_CODE error = decodeVoIP( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, hIvasDec ); #else error = decodeVoIP( arg, hBsReader, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, hIvasDec ); #endif } else { #ifdef FIX_CREND_SIMPLIFY_CODE error = decodeG192( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, &splitRendBits, hIvasDec, pcmBuf ); #else error = decodeG192( arg, hBsReader, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, &splitRendBits, hIvasDec, pcmBuf ); #endif } if ( error == IVAS_ERR_OK || error == IVAS_ERR_END_OF_FILE ) Loading @@ -895,11 +768,7 @@ int main( } else { #ifdef FIX_CREND_SIMPLIFY_CODE fprintf( stderr, "\nDecoding finished prematurely: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); #else fprintf( stdout, "Decoding finished prematurely\n\n" ); #endif goto cleanup; } Loading Loading @@ -936,23 +805,8 @@ cleanup: #endif if ( arg.hrtfReaderEnabled ) { #ifdef FIX_CREND_SIMPLIFY_CODE destroy_td_hrtf( hHrtfBinary.hHrtfTD ); destroy_hrtf_statistics( hHrtfBinary.hHrtfStatistics ); #else IVAS_DEC_GetHrtfHandle( hIvasDec, &hHrtfTD ); if ( hHrtfTD != NULL ) { destroy_td_hrtf( hHrtfTD ); } IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hSetOfHRTF ); if ( hSetOfHRTF != NULL ) { destroy_SetOfHRTF( hSetOfHRTF ); } IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics ); destroy_hrtf_statistics( hHrtfStatistics ); #endif } IVAS_DEC_Close( &hIvasDec ); Loading Loading @@ -2212,9 +2066,7 @@ static ivas_error initOnFirstGoodFrame( static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, #ifdef FIX_CREND_SIMPLIFY_CODE IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, #endif RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Loading Loading @@ -2575,7 +2427,6 @@ static ivas_error decodeG192( goto cleanup; } #ifdef FIX_CREND_SIMPLIFY_CODE /* 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; Loading @@ -2596,16 +2447,13 @@ static ivas_error decodeG192( goto cleanup; } } #endif #ifdef FIX_HRTF_LOAD_API /* decode transport channels, do TSM and feed to renderer */ if ( ( error = IVAS_DEC_GetSamplesDecoder( hIvasDec, isSplitRend, splitRendBits ) ) != IVAS_ERR_OK ) { return error; } #endif #ifdef OBJ_EDITING_API /* Do the final preparations needed for rendering */ if ( ( error = IVAS_DEC_PrepareRenderer( hIvasDec ) ) != IVAS_ERR_OK ) Loading Loading @@ -3116,9 +2964,7 @@ static ivas_error writeJbmTraceFileFrameWrapper( const void *data, void *writer static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, #ifdef FIX_CREND_SIMPLIFY_CODE IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, #endif RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Loading Loading @@ -3168,13 +3014,11 @@ static ivas_error decodeVoIP( IVAS_VECTOR3 Pos[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES] = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }; int16_t vec_pos_update, vec_pos_len; int16_t nOutSamples = 0; #ifdef FIX_CREND_SIMPLIFY_CODE bool bitstreamReadDone = false; #ifdef OBJ_EDITING_API bool parameterAvailableForEditing = false; #endif uint16_t nSamplesRendered; #endif vec_pos_update = 0; if ( ( error = IVAS_DEC_GetRenderFramesizeMs( hIvasDec, &systemTimeInc_ms ) ) != IVAS_ERR_OK ) Loading Loading @@ -3292,9 +3136,7 @@ static ivas_error decodeVoIP( while ( 1 ) { #ifdef FIX_CREND_SIMPLIFY_CODE nSamplesRendered = 0; #endif /* reference vector */ if ( arg.enableReferenceVectorTracking && vec_pos_update == 0 ) Loading Loading @@ -3458,37 +3300,26 @@ static ivas_error decodeVoIP( /* decode and get samples */ #ifdef FIX_HRTF_LOAD while ( nSamplesRendered < nOutSamples ) { #endif #ifdef SUPPORT_JBM_TRACEFILE #ifdef FIX_CREND_SIMPLIFY_CODE #ifdef OBJ_EDITING_API if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &bitstreamReadDone, &nSamplesRendered, ¶meterAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &bitstreamReadDone, &nSamplesRendered, systemTime_ms ) ) != IVAS_ERR_OK ) #endif #else if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, writeJbmTraceFileFrameWrapper, jbmTraceWriter, systemTime_ms ) ) != IVAS_ERR_OK ) #endif #else #ifdef FIX_CREND_SIMPLIFY_CODE #ifdef OBJ_EDITING_API if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, &bitstreamReadDone, ¶meterAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, &bitstreamReadDone, systemTime_ms ) ) != IVAS_ERR_OK ) #endif #else if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, systemTime_ms ) ) != IVAS_ERR_OK ) #endif #endif { fprintf( stderr, "\nError in IVAS_DEC_VoIP_GetSamples: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #ifdef FIX_CREND_SIMPLIFY_CODE if ( bitstreamReadDone == true ) { /* Read main parameters from the bitstream to set-up the decoder */ Loading @@ -3512,16 +3343,14 @@ static ivas_error decodeVoIP( } } } #endif #ifdef OBJ_EDITING_API if ( parameterAvailableForEditing == true ) { /* do the object editing here */ } #endif #ifdef FIX_HRTF_LOAD } /* while ( nSamplesRendered < nOutSamples ) */ #endif /* write JBM Offset file entry */ if ( jbmOffsetWriter != NULL ) Loading Loading @@ -3829,7 +3658,7 @@ static IVAS_DEC_FORCED_REND_MODE parseForcedRendModeDec( #endif #ifdef FIX_CREND_SIMPLIFY_CODE /*---------------------------------------------------------------------* * load_hrtf_from_file() * Loading Loading @@ -3894,11 +3723,7 @@ static ivas_error load_hrtf_from_file( return error; } #ifdef FIX_989_TD_REND_ROM if ( ( error = load_TDrend_HRTF_binary( *hHrtfBinary->hHrtfTD, output_Fs, hHrtfBinary->hrtfReader ) ) != IVAS_ERR_OK ) #else if ( ( error = load_HRTF_binary( *hHrtfBinary->hHrtfTD, hHrtfBinary->hrtfReader ) ) != IVAS_ERR_OK ) #endif { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { Loading Loading @@ -4006,5 +3831,5 @@ static ivas_error load_hrtf_from_file( return IVAS_ERR_OK; } #endif #undef WMC_TOOL_SKIP
apps/renderer.c +0 −56 Original line number Diff line number Diff line Loading @@ -639,11 +639,7 @@ static int16_t get_cldfb_in_flag( int16_t cldfb_in_flag; cldfb_in_flag = 0; #ifdef FIX_HRTF_LOAD if ( renderConfig->split_rend_config.rendererSelection == IVAS_BIN_RENDERER_TYPE_FASTCONV ) #else if ( renderConfig->split_rend_config.rendererSelection == ISAR_SPLIT_REND_RENDERER_SELECTION_FASTCONV ) #endif { #ifdef DEBUGGING cldfb_in_flag = 1; Loading Loading @@ -692,11 +688,7 @@ int main( SplitRendBFIFileReader *splitRendBFIReader = NULL; Vector3PairFileReader *referenceVectorReader = NULL; hrtfFileReader *hrtfFileReader = NULL; #ifdef FIX_CREND_SIMPLIFY_CODE 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; Loading Loading @@ -982,11 +974,7 @@ int main( goto cleanup; } #ifdef FIX_989_TD_REND_ROM if ( ( error = load_TDrend_HRTF_binary( *hHrtfTD, args.sampleRate, hrtfFileReader ) ) != IVAS_ERR_OK ) #else if ( ( error = load_HRTF_binary( *hHrtfTD, hrtfFileReader ) ) != IVAS_ERR_OK ) #endif { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { Loading @@ -999,7 +987,6 @@ int main( } } #ifdef FIX_CREND_SIMPLIFY_CODE if ( ( error = IVAS_REND_GetHrtfCRendHandle( hIvasRend, &hHrtfCrend ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_Rend_GetHrtfCRendHandle failed: %s\n\n", ivas_error_to_string( error ) ); Loading @@ -1012,15 +999,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 = IVAS_REND_GetHrtfCRendHandle( hIvasRend, &hSetOfHRTF ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_Rend_GetHrtfCRendHandle failed: %s\n\n", ivas_error_to_string( error ) ); goto cleanup; } if ( ( error = create_SetOfHRTF_from_binary( *hSetOfHRTF, hrtfFileReader, args.sampleRate ) ) != IVAS_ERR_OK ) #endif { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { Loading @@ -1029,11 +1007,7 @@ int main( } else { #ifdef FIX_CREND_SIMPLIFY_CODE destroy_crend_hrtf( hHrtfCrend ); #else destroy_SetOfHRTF( hSetOfHRTF ); #endif } } Loading @@ -1043,11 +1017,7 @@ int main( goto cleanup; } #ifdef FIX_CREND_SIMPLIFY_CODE 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, hrtfFileReader ) ) != IVAS_ERR_OK ) #endif { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { Loading Loading @@ -2080,20 +2050,8 @@ cleanup: RotationFileReader_close( &headRotReader ); RotationFileReader_close( &externalOrientationFileReader ); RotationFileReader_close( &referenceRotReader ); Vector3PairFileReader_close( &referenceVectorReader ); #ifdef FIX_CREND_SIMPLIFY_CODE destroy_td_hrtf( hHrtfTD ); #else if ( hSetOfHRTF != NULL && *hSetOfHRTF != NULL ) { destroy_SetOfHRTF( hSetOfHRTF ); } if ( hHrtfTD != NULL && *hHrtfTD != NULL ) { destroy_td_hrtf( hHrtfTD ); } #endif destroy_hrtf_statistics( hHrtfStatistics ); IVAS_REND_Close( &hIvasRend ); IsmPositionProvider_close( positionProvider ); Loading Loading @@ -2687,9 +2645,7 @@ static CmdlnArgs defaultArgs( const char *executableName ) { CmdlnArgs args; #ifdef FIX_CREND_SIMPLIFY_CODE int16_t i; #endif strncpy( args.executableName, executableName, RENDERER_MAX_CLI_ARG_LENGTH ); clearString( args.inputFilePath ); Loading @@ -2706,20 +2662,12 @@ static CmdlnArgs defaultArgs( args.outConfig.audioConfig = IVAS_AUDIO_CONFIG_INVALID; args.outConfig.outSetupCustom.num_spk = 0; args.outConfig.outSetupCustom.num_lfe = 0; #ifdef FIX_CREND_SIMPLIFY_CODE for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; ++i ) { args.inConfig.ambisonicsBuses[i].audioConfig = IVAS_AUDIO_CONFIG_INVALID; } #else args.inConfig.ambisonicsBuses->audioConfig = IVAS_AUDIO_CONFIG_INVALID; #endif #ifdef FIX_CREND_SIMPLIFY_CODE for ( i = 0; i < RENDERER_MAX_ISM_INPUTS + RENDERER_MAX_MASA_INPUTS; ++i ) #else for ( int32_t i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) #endif { clearString( args.inMetadataFilePaths[i] ); } Loading Loading @@ -2757,11 +2705,7 @@ static CmdlnArgs defaultArgs( args.render_framesize = IVAS_RENDER_FRAMESIZE_20MS; args.syncMdDelay = 0; #ifdef FIX_CREND_SIMPLIFY_CODE for ( i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) #else for ( int32_t i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) #endif { args.directivityPatternId[i] = 65535; } Loading
lib_com/common_api_types.h +0 −25 Original line number Diff line number Diff line Loading @@ -177,19 +177,11 @@ typedef enum 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; #ifdef FIX_CREND_SIMPLIFY_CODE typedef struct ivas_hrtf_TDREND_HRFILT_FiltSet_struct *IVAS_DEC_HRTF_HANDLE; typedef struct ivas_hrtf_crend_structure *IVAS_DEC_HRTF_CREND_HANDLE; typedef struct ivas_hrtf_fastconv_struct *IVAS_DEC_HRTF_FASTCONV_HANDLE; typedef struct ivas_hrtf_parambin_struct *IVAS_DEC_HRTF_PARAMBIN_HANDLE; typedef struct ivas_hrtf_statistics_struct *IVAS_DEC_HRTF_STATISTICS_HANDLE; #else typedef struct TDREND_HRFILT_FiltSet_struct *IVAS_DEC_HRTF_HANDLE; typedef struct ivas_hrtfs_crend_structure *IVAS_DEC_HRTF_CREND_HANDLE; 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; #endif typedef struct cldfb_filter_bank_struct *IVAS_CLDFB_FILTER_BANK_HANDLE; typedef struct ivas_LS_setup_custom *IVAS_LSSETUP_CUSTOM_HANDLE; Loading Loading @@ -221,7 +213,6 @@ typedef struct _IVAS_JBM_TRACE_DATA } IVAS_JBM_TRACE_DATA; #ifdef FIX_CREND_SIMPLIFY_CODE typedef enum _ivas_binaural_renderer_type { IVAS_BIN_RENDERER_TYPE_NONE, Loading @@ -232,7 +223,6 @@ typedef enum _ivas_binaural_renderer_type IVAS_BIN_RENDERER_TYPE_DEFAULT, } IVAS_BIN_RENDERER_TYPE; #endif /*----------------------------------------------------------------------------------* * Split rendering API constants, structures, and enums Loading Loading @@ -271,17 +261,6 @@ typedef enum } ISAR_SPLIT_REND_CODEC; #ifndef FIX_HRTF_LOAD typedef enum { ISAR_SPLIT_REND_RENDERER_SELECTION_CREND, ISAR_SPLIT_REND_RENDERER_SELECTION_FASTCONV, ISAR_SPLIT_REND_RENDERER_SELECTION_PARAMBIN, ISAR_SPLIT_REND_RENDERER_SELECTION_TDREND, ISAR_SPLIT_REND_RENDERER_SELECTION_DEFAULT, } ISAR_SPLIT_REND_RENDERER_SELECTION; #endif typedef struct _ISAR_SPLIT_REND_BITS_DATA { uint8_t *bits_buf; Loading Loading @@ -312,11 +291,7 @@ typedef struct _ISAR_SPLIT_REND_CONFIG int16_t codec_frame_size_ms; /* Codec frame size in milliseconds, only relevant with LC3plus */ ISAR_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode; ISAR_SPLIT_REND_CODEC codec; #ifdef FIX_HRTF_LOAD IVAS_BIN_RENDERER_TYPE rendererSelection; #else ISAR_SPLIT_REND_RENDERER_SELECTION rendererSelection; #endif int16_t lc3plus_highres; } ISAR_SPLIT_REND_CONFIG_DATA, *ISAR_SPLIT_REND_CONFIG_HANDLE; Loading
lib_com/ivas_cnst.h +0 −2 Original line number Diff line number Diff line Loading @@ -1531,10 +1531,8 @@ typedef enum #define MAX_ANGULAR_STEP_INV ( 1.0f / MAX_ANGULAR_STEP ) #define MAX_INTERPOLATION_STEPS 12 #ifdef FIX_989_TD_REND_ROM #define RESAMPLE_FACTOR_16_48 ( 16.0f / 48.0f ) #define RESAMPLE_FACTOR_32_48 ( 32.0f / 48.0f ) #endif /* ----- Enums - TD Renderer ----- */ Loading
lib_com/ivas_error.h +0 −4 Original line number Diff line number Diff line Loading @@ -78,9 +78,7 @@ typedef enum IVAS_ERR_DIRECTIVITY_NOT_SUPPORTED, IVAS_ERR_ACOUSTIC_ENVIRONMENT_NOT_SUPPORTED, IVAS_ERR_INVALID_HRTF, #if defined FIX_CREND_SIMPLIFY_CODE || defined FIX_989_TD_REND_ROM IVAS_ERR_INVALID_HRTF_SAMPLING_RATE, #endif IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA, IVAS_ERR_INVALID_INPUT_FORMAT, IVAS_ERR_INVALID_INDEX, Loading Loading @@ -259,10 +257,8 @@ static inline const char *ivas_error_to_string( ivas_error error_code ) return "Acoustic environment not supported"; case IVAS_ERR_INVALID_HRTF: return "Unsupported HRTF filter set"; #if defined FIX_CREND_SIMPLIFY_CODE || defined FIX_989_TD_REND_ROM case IVAS_ERR_INVALID_HRTF_SAMPLING_RATE: return "Wrong sampling rate in HRTF binary file"; #endif case IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA: return "Renderer data missing in HRTF binary file"; case IVAS_ERR_INVALID_INPUT_FORMAT: Loading