Loading CMakeLists.txt +10 −3 Original line number Diff line number Diff line Loading @@ -63,9 +63,16 @@ if(UNIX) # to be uncommented in CI # set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") # don't override CMAKE_C_COMPILER if it's already set if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR AND NOT CMAKE_C_COMPILER) # set C compiler find_program(cc NAMES clang-18 clang REQUIRED) set(CMAKE_C_COMPILER "${cc}" CACHE STRING "") find_program(cc NAMES clang-18 clang) if(cc) set(CMAKE_C_COMPILER "${cc}" CACHE FILEPATH "") else() message(WARNING "clang compiler not found - falling back to system default") endif() endif() # CLANG if(CLANG) Loading apps/decoder.c +0 −315 Original line number Diff line number Diff line Loading @@ -180,20 +180,13 @@ static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS #else static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); #endif #ifdef FIX_FMSW_DEC static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE *phIvasDec, int16_t *pcmBuf ); #else static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_RENDER_CONFIG_DATA *renderConfig, IVAS_DEC_HANDLE *phIvasDec, int16_t *pcmBuf ); #endif 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 ); #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 ); #endif static void do_object_editing( IVAS_EDITABLE_PARAMETERS *editableParameters, ObjectEditFileReader *objectEditFileReader ); #ifndef FIX_FMSW_DEC static ivas_error restartDecoder( IVAS_DEC_HANDLE *phIvasDec, const IVAS_DEC_MODE decMode, DecArguments *arg, IVAS_RENDER_CONFIG_DATA *renderConfig, IVAS_CUSTOM_LS_DATA *hLsCustomData ); #endif /*------------------------------------------------------------------------------------------* Loading Loading @@ -498,98 +491,6 @@ int main( } } #ifndef FIX_1550_WRONG_RENDER_FRAMESIZE_PRINTOUT #ifdef DEBUGGING /*-----------------------------------------------------------------* * Preview bitstream and print config information *-----------------------------------------------------------------*/ if ( arg.voipMode ) { if ( ( error = printBitstreamInfoVoip( arg, hBsReader, hIvasDec ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error while previewing VoIP bitstream: %s\n", ivas_error_to_string( error ) ); goto cleanup; } } else { uint16_t bit_stream[IVAS_MAX_BITS_PER_FRAME + 4 * 8]; int16_t num_bits; int16_t bfi = 0; do { if ( BS_Reader_ReadFrame_short( hBsReader, bit_stream, &num_bits, &bfi ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError: input bitstream file %s couldn't be read\n\n", arg.inputBitstreamFilename ); goto cleanup; } } while ( bfi || num_bits < MIN_NUM_BITS_ACTIVE_FRAME || num_bits == NUM_BITS_SID_IVAS_5K2 ); BS_Reader_Rewind( hBsReader ); IVAS_DEC_PrintConfigWithBitstream( hIvasDec, arg.quietModeEnabled, bit_stream, num_bits ); #ifdef VARIABLE_SPEED_DECODING if ( arg.tsmEnabled ) { if ( arg.tsmScaleFileEnabled ) { fprintf( stdout, "Variable speed file: %s\n", arg.tsmScaleFileName ); } else { fprintf( stdout, "Variable speed factor: %i\n", arg.tsmScale ); } } #endif } /*-----------------------------------------------------------------* * Open Error pattern file for simulation *-----------------------------------------------------------------*/ if ( arg.FEPatternFileName != NULL ) { if ( ( FEC_pattern = fopen( arg.FEPatternFileName, "rb" ) ) == NULL ) { fprintf( stderr, "Error: Missing or incorrect FEC filename specification\n\n" ); usage_dec(); goto cleanup; } } #ifdef DEBUG_SBA_AUDIO_DUMP ivas_open_sba_decoder_debug_files( arg.output_Fs, 1, 1 ); #endif /*-----------------------------------------------------------------* * Print information about FEC *-----------------------------------------------------------------*/ if ( !arg.voipMode && ( arg.FEPatternFileName != NULL || arg.FER > 0 ) ) { if ( arg.FEPatternFileName != NULL ) { fprintf( stdout, "FEC: %s\n", arg.FEPatternFileName ); } else { fprintf( stdout, "FEC: %.2f %%\n", arg.FER ); } } #else /*-----------------------------------------------------------------* * Print config information *-----------------------------------------------------------------*/ if ( ( error = IVAS_DEC_PrintConfig( hIvasDec, 1, arg.voipMode ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_PrintConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #endif #endif /*-------------------------------------------------------------------* * Load renderer configuration from file Loading Loading @@ -623,13 +524,11 @@ int main( goto cleanup; } #ifdef FIX_2500_RENDCONF_REFACTOR if ( RenderConfigReader_checkValues( renderConfigReader ) != IVAS_ERR_OK ) { fprintf( stderr, "Invalid renderer configuration parameters\n\n" ); goto cleanup; } #endif aeCount = RenderConfigReader_getAcousticEnvironmentCount( renderConfigReader ); if ( aeCount > 0 ) Loading Loading @@ -710,27 +609,11 @@ int main( if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { #ifdef FIX_2500_RENDCONF_REFACTOR if ( ( error = IVAS_DEC_GetAcousticEnvironment( hIvasDec, aeID, &renderConfig.roomAcoustics ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", aeID ); goto cleanup; } #else if ( ( error = IVAS_DEC_GetAcousticEnvironment( hIvasDec, aeID, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK ) { if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK ) { fprintf( stderr, "Invalid reverberation configuration parameters\n\n" ); goto cleanup; } } else { fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", aeID ); goto cleanup; } #endif } /* ISAR frame size is set from command line, not renderer config file. Loading Loading @@ -779,7 +662,6 @@ int main( hHrtfBinary.hrtf_set_audio_cfg = IVAS_AUDIO_CONFIG_INVALID; } #ifdef FIX_1550_WRONG_RENDER_FRAMESIZE_PRINTOUT #ifdef DEBUGGING /*-----------------------------------------------------------------* * Preview bitstream and print config information Loading Loading @@ -869,7 +751,6 @@ int main( fprintf( stderr, "\nIVAS_DEC_PrintConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #endif #endif /*------------------------------------------------------------------------------------------* Loading @@ -896,11 +777,7 @@ int main( if ( arg.voipMode ) { #ifdef FIX_FMSW_DEC error = decodeVoIP( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, objectEditFileReader, &splitRendBits, &hIvasDec, pcmBuf ); #else error = decodeVoIP( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, objectEditFileReader, &splitRendBits, &renderConfig, &hIvasDec, pcmBuf ); #endif } else { Loading Loading @@ -2456,13 +2333,11 @@ static ivas_error decodeG192( goto cleanup; } #ifdef FIX_2500_RENDCONF_REFACTOR if ( RenderConfigReader_checkValues( renderConfigReader ) != IVAS_ERR_OK ) { fprintf( stderr, "Invalid renderer configuration parameters\n\n" ); goto cleanup; } #endif } for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i ) Loading Loading @@ -2662,27 +2537,11 @@ static ivas_error decodeG192( arg.aeSequence.selected = 0; } arg.aeSequence.frameCounter = 0; #ifdef FIX_2500_RENDCONF_REFACTOR if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, arg.aeSequence.pID[arg.aeSequence.selected], &renderConfig.roomAcoustics ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Failed to get acoustic environment with ID %d\n\n", arg.aeSequence.pID[arg.aeSequence.selected] ); goto cleanup; } #else if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, arg.aeSequence.pID[arg.aeSequence.selected], &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK ) { if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK ) { fprintf( stderr, "Invalid acoustic environment configuratoin parameters\n\n" ); goto cleanup; } } else { fprintf( stderr, "Failed to get acoustic environment with ID %d\n\n", arg.aeSequence.pID[arg.aeSequence.selected] ); goto cleanup; } #endif if ( ( error = IVAS_DEC_FeedRenderConfig( hIvasDec, renderConfig ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_FeedRenderConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); Loading Loading @@ -2758,34 +2617,11 @@ static ivas_error decodeG192( if ( restartNeeded ) { #ifdef FIX_FMSW_DEC if ( ( error = IVAS_DEC_Restart( hIvasDec, IVAS_DEC_MODE_IVAS ) ) != IVAS_ERR_OK ) /* note: only switching within IVAS formats is supported in G.192 */ { fprintf( stderr, "\nIVAS_DEC_Restart restart failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #else IVAS_DEC_BS_FORMAT tempFormat; if ( ( error = IVAS_DEC_GetFormat( hIvasDec, &tempFormat ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetFormat, code: %d\n", error ); goto cleanup; } IVAS_DEC_MODE codecMode = ( tempFormat == IVAS_DEC_BS_MONO ) ? IVAS_DEC_MODE_EVS : IVAS_DEC_MODE_IVAS; error = restartDecoder( &hIvasDec, codecMode, &arg, NULL, /* ToDo : Provide rendererConfig */ NULL /* ToDo : Provide LS Custom Data */ ); if ( error != IVAS_ERR_OK ) { fprintf( stderr, "\nFailed to restart decoder\n" ); goto cleanup; } *phIvasDec = hIvasDec; /* Update for main()' s free */ #endif } #endif Loading Loading @@ -3360,9 +3196,6 @@ static ivas_error decodeVoIP( Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, #ifndef FIX_FMSW_DEC IVAS_RENDER_CONFIG_DATA *renderConfig, #endif IVAS_DEC_HANDLE *phIvasDec, int16_t *pcmBuf ) { Loading Loading @@ -3521,14 +3354,12 @@ static ivas_error decodeVoIP( /* EVS RTP payload format has timescale 16000, JBM uses 1000 internally */ rtpTimeStamp = rtpTimeStamp / 16; #ifdef FIX_FMSW_DEC_2 arg.decMode = ( ivasRtp.codecId == IVAS_RTP_EVS ) ? IVAS_DEC_MODE_EVS : IVAS_DEC_MODE_IVAS; if ( ( error = IVAS_DEC_Restart( hIvasDec, arg.decMode ) ) != IVAS_ERR_OK ) /* note: when the RTP bitstream starts with EVS, do the restart */ { fprintf( stderr, "\nIVAS_DEC_Restart restart failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #endif } if ( error != IVAS_ERR_OK ) { Loading Loading @@ -3562,29 +3393,12 @@ static ivas_error decodeVoIP( /* restart decoder in case of format switching */ if ( ivasRtp.restartNeeded ) { #ifdef FIX_FMSW_DEC arg.decMode = ( ivasRtp.codecId == IVAS_RTP_EVS ) ? IVAS_DEC_MODE_EVS : IVAS_DEC_MODE_IVAS; if ( ( error = IVAS_DEC_Restart( hIvasDec, arg.decMode ) ) != IVAS_ERR_OK ) /* note: switching between EVS and IVAS is supported in RTP */ { fprintf( stderr, "\nIVAS_DEC_Restart restart failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #else IVAS_DEC_MODE newDecModeInPacket = ( ivasRtp.codecId == IVAS_RTP_EVS ) ? IVAS_DEC_MODE_EVS : IVAS_DEC_MODE_IVAS; if ( ( error = restartDecoder( &hIvasDec, newDecModeInPacket, &arg, renderConfig, NULL /* ToDo : Provide LS Custom Data */ ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nFailed to restart decoder from %d to %d\n", arg.decMode, newDecModeInPacket ); goto cleanup; } *phIvasDec = hIvasDec; /* Update for main()' s free */ #endif ivasRtp.restartNeeded = false; bitstreamReadDone = false; parametersAvailableForEditing = false; Loading Loading @@ -3816,34 +3630,11 @@ static ivas_error decodeVoIP( if ( restartNeeded ) { #ifdef FIX_FMSW_DEC if ( ( error = IVAS_DEC_Restart( hIvasDec, IVAS_DEC_MODE_IVAS ) ) != IVAS_ERR_OK ) /* note: only switching within IVAS formats is supported in non-RTP VoIP */ { fprintf( stderr, "\nIVAS_DEC_Restart restart failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #else IVAS_DEC_BS_FORMAT tempBsFormat; if ( ( error = IVAS_DEC_GetFormat( hIvasDec, &tempBsFormat ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetFormat, code: %d\n", error ); goto cleanup; } IVAS_DEC_MODE newDecModeInPacket = ( tempBsFormat == IVAS_DEC_BS_MONO ) ? IVAS_DEC_MODE_EVS : IVAS_DEC_MODE_IVAS; if ( ( error = restartDecoder( &hIvasDec, newDecModeInPacket, &arg, NULL, /* ToDo : Provide rendererConfig */ NULL /* ToDo : Provide LS Custom Data */ ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nFailed to restart decoder\n" ); goto cleanup; } *phIvasDec = hIvasDec; /* Update for main()' s free */ #endif bitstreamReadDone = false; parametersAvailableForEditing = false; } Loading Loading @@ -4531,110 +4322,4 @@ static ivas_error load_hrtf_from_file( return IVAS_ERR_OK; } #ifndef FIX_FMSW_DEC /*---------------------------------------------------------------------* * restartDecoder() * * Restart decoder in case of IVAS format switching *---------------------------------------------------------------------*/ static ivas_error restartDecoder( IVAS_DEC_HANDLE *phIvasDec, const IVAS_DEC_MODE decMode, DecArguments *arg, IVAS_RENDER_CONFIG_DATA *renderConfig, IVAS_CUSTOM_LS_DATA *hLsCustomData ) { ivas_error error = IVAS_ERR_OK; IVAS_DEC_HANDLE hIvasDec; if ( phIvasDec == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } if ( NULL != *phIvasDec ) { IVAS_DEC_Close( phIvasDec ); } if ( ( error = IVAS_DEC_Open( phIvasDec, decMode ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Open failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } arg->decMode = decMode; hIvasDec = *phIvasDec; uint16_t aeID = arg->aeSequence.count > 0 ? arg->aeSequence.pID[0] : IVAS_DEFAULT_AEID; IVAS_AUDIO_CONFIG outputConfig = ( decMode == IVAS_DEC_MODE_IVAS ) ? arg->outputConfig : IVAS_AUDIO_CONFIG_MONO; if ( ( error = IVAS_DEC_Configure( hIvasDec, arg->output_Fs, outputConfig, arg->render_num_subframes, arg->customLsOutputEnabled, arg->hrtfReaderEnabled, arg->enableHeadRotation, arg->enableExternalOrientation, arg->orientation_tracking, arg->renderConfigEnabled, arg->roomSize, arg->non_diegetic_pan_enabled, arg->non_diegetic_pan_gain, arg->dpidEnabled, aeID, arg->objEditEnabled, arg->delayCompensationEnabled ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } if ( arg->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { if ( ( error = IVAS_DEC_EnableSplitRendering( hIvasDec ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nSplit rendering configure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } } if ( ( error = IVAS_DEC_GetRenderNumSubfr( hIvasDec, &arg->render_num_subframes ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetRenderNumSubfr failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } if ( arg->voipMode ) { if ( ( error = IVAS_DEC_EnableVoIP( hIvasDec, 60, arg->inputFormat ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nCould not enable VOIP: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } } /* ISAR frame size is set from command line, not renderer config file. * This will be ignored if output format is not split rendering. */ if ( renderConfig != NULL ) { renderConfig->split_rend_config.isar_frame_size_ms = (int16_t) arg->render_num_subframes * 5; } if ( arg->renderConfigEnabled && renderConfig != NULL ) { if ( ( error = IVAS_DEC_FeedRenderConfig( hIvasDec, *renderConfig ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_FeedRenderConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } } if ( arg->customLsOutputEnabled && hLsCustomData != NULL ) { if ( ( error = IVAS_DEC_FeedCustomLsData( hIvasDec, *hLsCustomData ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_FeedCustomLsData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } } return IVAS_ERR_OK; cleanup: IVAS_DEC_Close( phIvasDec ); return error; } #endif #undef WMC_TOOL_SKIP apps/encoder.c +0 −17 Original line number Diff line number Diff line Loading @@ -367,7 +367,6 @@ int main( } } #ifdef FIX_FMSW_DEC /*------------------------------------------------------------------------------------------* * Open remote requests file for rtp packing (E-bytes) *------------------------------------------------------------------------------------------*/ Loading @@ -387,7 +386,6 @@ int main( goto cleanup; } } #endif /*------------------------------------------------------------------------------------------* * Handle Channel-aware mode Loading Loading @@ -682,21 +680,6 @@ int main( } } #ifndef FIX_FMSW_DEC #ifdef FIX_1527_CMR_BITRATE_IDX /*------------------------------------------------------------------------------------------* * Open remote requests file for rtp packing (E-bytes) *------------------------------------------------------------------------------------------*/ if ( arg.requestsFileName != NULL ) { if ( ( error = RequestsFileReader_open( arg.requestsFileName, &requestsFileReader ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError: Can't open requests file %s \n\n", arg.requestsFileName ); goto cleanup; } } #endif #endif /*------------------------------------------------------------------------------------------* * Run the encoder *------------------------------------------------------------------------------------------*/ Loading apps/renderer.c +0 −42 File changed.Preview size limit exceeded, changes collapsed. Show changes lib_com/common_api_types.h +1 −3 Original line number Diff line number Diff line Loading @@ -61,9 +61,7 @@ #define IVAS_REVERB_PREDELAY_MAX 20 /* Max input delay for reverb module */ #define IVAS_ER_LIST_HEIGHT 1.6f #define IVAS_DEFAULT_AEID 65535 #ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION #define IVAS_LISTENER_POSITION_MAX 327.67f #endif /* JBM constants for adaptive-playout */ Loading Loading
CMakeLists.txt +10 −3 Original line number Diff line number Diff line Loading @@ -63,9 +63,16 @@ if(UNIX) # to be uncommented in CI # set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") # don't override CMAKE_C_COMPILER if it's already set if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR AND NOT CMAKE_C_COMPILER) # set C compiler find_program(cc NAMES clang-18 clang REQUIRED) set(CMAKE_C_COMPILER "${cc}" CACHE STRING "") find_program(cc NAMES clang-18 clang) if(cc) set(CMAKE_C_COMPILER "${cc}" CACHE FILEPATH "") else() message(WARNING "clang compiler not found - falling back to system default") endif() endif() # CLANG if(CLANG) Loading
apps/decoder.c +0 −315 Original line number Diff line number Diff line Loading @@ -180,20 +180,13 @@ static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS #else static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); #endif #ifdef FIX_FMSW_DEC static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE *phIvasDec, int16_t *pcmBuf ); #else static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_RENDER_CONFIG_DATA *renderConfig, IVAS_DEC_HANDLE *phIvasDec, int16_t *pcmBuf ); #endif 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 ); #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 ); #endif static void do_object_editing( IVAS_EDITABLE_PARAMETERS *editableParameters, ObjectEditFileReader *objectEditFileReader ); #ifndef FIX_FMSW_DEC static ivas_error restartDecoder( IVAS_DEC_HANDLE *phIvasDec, const IVAS_DEC_MODE decMode, DecArguments *arg, IVAS_RENDER_CONFIG_DATA *renderConfig, IVAS_CUSTOM_LS_DATA *hLsCustomData ); #endif /*------------------------------------------------------------------------------------------* Loading Loading @@ -498,98 +491,6 @@ int main( } } #ifndef FIX_1550_WRONG_RENDER_FRAMESIZE_PRINTOUT #ifdef DEBUGGING /*-----------------------------------------------------------------* * Preview bitstream and print config information *-----------------------------------------------------------------*/ if ( arg.voipMode ) { if ( ( error = printBitstreamInfoVoip( arg, hBsReader, hIvasDec ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error while previewing VoIP bitstream: %s\n", ivas_error_to_string( error ) ); goto cleanup; } } else { uint16_t bit_stream[IVAS_MAX_BITS_PER_FRAME + 4 * 8]; int16_t num_bits; int16_t bfi = 0; do { if ( BS_Reader_ReadFrame_short( hBsReader, bit_stream, &num_bits, &bfi ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError: input bitstream file %s couldn't be read\n\n", arg.inputBitstreamFilename ); goto cleanup; } } while ( bfi || num_bits < MIN_NUM_BITS_ACTIVE_FRAME || num_bits == NUM_BITS_SID_IVAS_5K2 ); BS_Reader_Rewind( hBsReader ); IVAS_DEC_PrintConfigWithBitstream( hIvasDec, arg.quietModeEnabled, bit_stream, num_bits ); #ifdef VARIABLE_SPEED_DECODING if ( arg.tsmEnabled ) { if ( arg.tsmScaleFileEnabled ) { fprintf( stdout, "Variable speed file: %s\n", arg.tsmScaleFileName ); } else { fprintf( stdout, "Variable speed factor: %i\n", arg.tsmScale ); } } #endif } /*-----------------------------------------------------------------* * Open Error pattern file for simulation *-----------------------------------------------------------------*/ if ( arg.FEPatternFileName != NULL ) { if ( ( FEC_pattern = fopen( arg.FEPatternFileName, "rb" ) ) == NULL ) { fprintf( stderr, "Error: Missing or incorrect FEC filename specification\n\n" ); usage_dec(); goto cleanup; } } #ifdef DEBUG_SBA_AUDIO_DUMP ivas_open_sba_decoder_debug_files( arg.output_Fs, 1, 1 ); #endif /*-----------------------------------------------------------------* * Print information about FEC *-----------------------------------------------------------------*/ if ( !arg.voipMode && ( arg.FEPatternFileName != NULL || arg.FER > 0 ) ) { if ( arg.FEPatternFileName != NULL ) { fprintf( stdout, "FEC: %s\n", arg.FEPatternFileName ); } else { fprintf( stdout, "FEC: %.2f %%\n", arg.FER ); } } #else /*-----------------------------------------------------------------* * Print config information *-----------------------------------------------------------------*/ if ( ( error = IVAS_DEC_PrintConfig( hIvasDec, 1, arg.voipMode ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_PrintConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #endif #endif /*-------------------------------------------------------------------* * Load renderer configuration from file Loading Loading @@ -623,13 +524,11 @@ int main( goto cleanup; } #ifdef FIX_2500_RENDCONF_REFACTOR if ( RenderConfigReader_checkValues( renderConfigReader ) != IVAS_ERR_OK ) { fprintf( stderr, "Invalid renderer configuration parameters\n\n" ); goto cleanup; } #endif aeCount = RenderConfigReader_getAcousticEnvironmentCount( renderConfigReader ); if ( aeCount > 0 ) Loading Loading @@ -710,27 +609,11 @@ int main( if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { #ifdef FIX_2500_RENDCONF_REFACTOR if ( ( error = IVAS_DEC_GetAcousticEnvironment( hIvasDec, aeID, &renderConfig.roomAcoustics ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", aeID ); goto cleanup; } #else if ( ( error = IVAS_DEC_GetAcousticEnvironment( hIvasDec, aeID, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK ) { if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK ) { fprintf( stderr, "Invalid reverberation configuration parameters\n\n" ); goto cleanup; } } else { fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", aeID ); goto cleanup; } #endif } /* ISAR frame size is set from command line, not renderer config file. Loading Loading @@ -779,7 +662,6 @@ int main( hHrtfBinary.hrtf_set_audio_cfg = IVAS_AUDIO_CONFIG_INVALID; } #ifdef FIX_1550_WRONG_RENDER_FRAMESIZE_PRINTOUT #ifdef DEBUGGING /*-----------------------------------------------------------------* * Preview bitstream and print config information Loading Loading @@ -869,7 +751,6 @@ int main( fprintf( stderr, "\nIVAS_DEC_PrintConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #endif #endif /*------------------------------------------------------------------------------------------* Loading @@ -896,11 +777,7 @@ int main( if ( arg.voipMode ) { #ifdef FIX_FMSW_DEC error = decodeVoIP( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, objectEditFileReader, &splitRendBits, &hIvasDec, pcmBuf ); #else error = decodeVoIP( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, objectEditFileReader, &splitRendBits, &renderConfig, &hIvasDec, pcmBuf ); #endif } else { Loading Loading @@ -2456,13 +2333,11 @@ static ivas_error decodeG192( goto cleanup; } #ifdef FIX_2500_RENDCONF_REFACTOR if ( RenderConfigReader_checkValues( renderConfigReader ) != IVAS_ERR_OK ) { fprintf( stderr, "Invalid renderer configuration parameters\n\n" ); goto cleanup; } #endif } for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i ) Loading Loading @@ -2662,27 +2537,11 @@ static ivas_error decodeG192( arg.aeSequence.selected = 0; } arg.aeSequence.frameCounter = 0; #ifdef FIX_2500_RENDCONF_REFACTOR if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, arg.aeSequence.pID[arg.aeSequence.selected], &renderConfig.roomAcoustics ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Failed to get acoustic environment with ID %d\n\n", arg.aeSequence.pID[arg.aeSequence.selected] ); goto cleanup; } #else if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, arg.aeSequence.pID[arg.aeSequence.selected], &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK ) { if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK ) { fprintf( stderr, "Invalid acoustic environment configuratoin parameters\n\n" ); goto cleanup; } } else { fprintf( stderr, "Failed to get acoustic environment with ID %d\n\n", arg.aeSequence.pID[arg.aeSequence.selected] ); goto cleanup; } #endif if ( ( error = IVAS_DEC_FeedRenderConfig( hIvasDec, renderConfig ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_FeedRenderConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); Loading Loading @@ -2758,34 +2617,11 @@ static ivas_error decodeG192( if ( restartNeeded ) { #ifdef FIX_FMSW_DEC if ( ( error = IVAS_DEC_Restart( hIvasDec, IVAS_DEC_MODE_IVAS ) ) != IVAS_ERR_OK ) /* note: only switching within IVAS formats is supported in G.192 */ { fprintf( stderr, "\nIVAS_DEC_Restart restart failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #else IVAS_DEC_BS_FORMAT tempFormat; if ( ( error = IVAS_DEC_GetFormat( hIvasDec, &tempFormat ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetFormat, code: %d\n", error ); goto cleanup; } IVAS_DEC_MODE codecMode = ( tempFormat == IVAS_DEC_BS_MONO ) ? IVAS_DEC_MODE_EVS : IVAS_DEC_MODE_IVAS; error = restartDecoder( &hIvasDec, codecMode, &arg, NULL, /* ToDo : Provide rendererConfig */ NULL /* ToDo : Provide LS Custom Data */ ); if ( error != IVAS_ERR_OK ) { fprintf( stderr, "\nFailed to restart decoder\n" ); goto cleanup; } *phIvasDec = hIvasDec; /* Update for main()' s free */ #endif } #endif Loading Loading @@ -3360,9 +3196,6 @@ static ivas_error decodeVoIP( Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, #ifndef FIX_FMSW_DEC IVAS_RENDER_CONFIG_DATA *renderConfig, #endif IVAS_DEC_HANDLE *phIvasDec, int16_t *pcmBuf ) { Loading Loading @@ -3521,14 +3354,12 @@ static ivas_error decodeVoIP( /* EVS RTP payload format has timescale 16000, JBM uses 1000 internally */ rtpTimeStamp = rtpTimeStamp / 16; #ifdef FIX_FMSW_DEC_2 arg.decMode = ( ivasRtp.codecId == IVAS_RTP_EVS ) ? IVAS_DEC_MODE_EVS : IVAS_DEC_MODE_IVAS; if ( ( error = IVAS_DEC_Restart( hIvasDec, arg.decMode ) ) != IVAS_ERR_OK ) /* note: when the RTP bitstream starts with EVS, do the restart */ { fprintf( stderr, "\nIVAS_DEC_Restart restart failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #endif } if ( error != IVAS_ERR_OK ) { Loading Loading @@ -3562,29 +3393,12 @@ static ivas_error decodeVoIP( /* restart decoder in case of format switching */ if ( ivasRtp.restartNeeded ) { #ifdef FIX_FMSW_DEC arg.decMode = ( ivasRtp.codecId == IVAS_RTP_EVS ) ? IVAS_DEC_MODE_EVS : IVAS_DEC_MODE_IVAS; if ( ( error = IVAS_DEC_Restart( hIvasDec, arg.decMode ) ) != IVAS_ERR_OK ) /* note: switching between EVS and IVAS is supported in RTP */ { fprintf( stderr, "\nIVAS_DEC_Restart restart failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #else IVAS_DEC_MODE newDecModeInPacket = ( ivasRtp.codecId == IVAS_RTP_EVS ) ? IVAS_DEC_MODE_EVS : IVAS_DEC_MODE_IVAS; if ( ( error = restartDecoder( &hIvasDec, newDecModeInPacket, &arg, renderConfig, NULL /* ToDo : Provide LS Custom Data */ ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nFailed to restart decoder from %d to %d\n", arg.decMode, newDecModeInPacket ); goto cleanup; } *phIvasDec = hIvasDec; /* Update for main()' s free */ #endif ivasRtp.restartNeeded = false; bitstreamReadDone = false; parametersAvailableForEditing = false; Loading Loading @@ -3816,34 +3630,11 @@ static ivas_error decodeVoIP( if ( restartNeeded ) { #ifdef FIX_FMSW_DEC if ( ( error = IVAS_DEC_Restart( hIvasDec, IVAS_DEC_MODE_IVAS ) ) != IVAS_ERR_OK ) /* note: only switching within IVAS formats is supported in non-RTP VoIP */ { fprintf( stderr, "\nIVAS_DEC_Restart restart failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #else IVAS_DEC_BS_FORMAT tempBsFormat; if ( ( error = IVAS_DEC_GetFormat( hIvasDec, &tempBsFormat ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetFormat, code: %d\n", error ); goto cleanup; } IVAS_DEC_MODE newDecModeInPacket = ( tempBsFormat == IVAS_DEC_BS_MONO ) ? IVAS_DEC_MODE_EVS : IVAS_DEC_MODE_IVAS; if ( ( error = restartDecoder( &hIvasDec, newDecModeInPacket, &arg, NULL, /* ToDo : Provide rendererConfig */ NULL /* ToDo : Provide LS Custom Data */ ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nFailed to restart decoder\n" ); goto cleanup; } *phIvasDec = hIvasDec; /* Update for main()' s free */ #endif bitstreamReadDone = false; parametersAvailableForEditing = false; } Loading Loading @@ -4531,110 +4322,4 @@ static ivas_error load_hrtf_from_file( return IVAS_ERR_OK; } #ifndef FIX_FMSW_DEC /*---------------------------------------------------------------------* * restartDecoder() * * Restart decoder in case of IVAS format switching *---------------------------------------------------------------------*/ static ivas_error restartDecoder( IVAS_DEC_HANDLE *phIvasDec, const IVAS_DEC_MODE decMode, DecArguments *arg, IVAS_RENDER_CONFIG_DATA *renderConfig, IVAS_CUSTOM_LS_DATA *hLsCustomData ) { ivas_error error = IVAS_ERR_OK; IVAS_DEC_HANDLE hIvasDec; if ( phIvasDec == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } if ( NULL != *phIvasDec ) { IVAS_DEC_Close( phIvasDec ); } if ( ( error = IVAS_DEC_Open( phIvasDec, decMode ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Open failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } arg->decMode = decMode; hIvasDec = *phIvasDec; uint16_t aeID = arg->aeSequence.count > 0 ? arg->aeSequence.pID[0] : IVAS_DEFAULT_AEID; IVAS_AUDIO_CONFIG outputConfig = ( decMode == IVAS_DEC_MODE_IVAS ) ? arg->outputConfig : IVAS_AUDIO_CONFIG_MONO; if ( ( error = IVAS_DEC_Configure( hIvasDec, arg->output_Fs, outputConfig, arg->render_num_subframes, arg->customLsOutputEnabled, arg->hrtfReaderEnabled, arg->enableHeadRotation, arg->enableExternalOrientation, arg->orientation_tracking, arg->renderConfigEnabled, arg->roomSize, arg->non_diegetic_pan_enabled, arg->non_diegetic_pan_gain, arg->dpidEnabled, aeID, arg->objEditEnabled, arg->delayCompensationEnabled ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } if ( arg->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { if ( ( error = IVAS_DEC_EnableSplitRendering( hIvasDec ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nSplit rendering configure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } } if ( ( error = IVAS_DEC_GetRenderNumSubfr( hIvasDec, &arg->render_num_subframes ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetRenderNumSubfr failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } if ( arg->voipMode ) { if ( ( error = IVAS_DEC_EnableVoIP( hIvasDec, 60, arg->inputFormat ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nCould not enable VOIP: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } } /* ISAR frame size is set from command line, not renderer config file. * This will be ignored if output format is not split rendering. */ if ( renderConfig != NULL ) { renderConfig->split_rend_config.isar_frame_size_ms = (int16_t) arg->render_num_subframes * 5; } if ( arg->renderConfigEnabled && renderConfig != NULL ) { if ( ( error = IVAS_DEC_FeedRenderConfig( hIvasDec, *renderConfig ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_FeedRenderConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } } if ( arg->customLsOutputEnabled && hLsCustomData != NULL ) { if ( ( error = IVAS_DEC_FeedCustomLsData( hIvasDec, *hLsCustomData ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_FeedCustomLsData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } } return IVAS_ERR_OK; cleanup: IVAS_DEC_Close( phIvasDec ); return error; } #endif #undef WMC_TOOL_SKIP
apps/encoder.c +0 −17 Original line number Diff line number Diff line Loading @@ -367,7 +367,6 @@ int main( } } #ifdef FIX_FMSW_DEC /*------------------------------------------------------------------------------------------* * Open remote requests file for rtp packing (E-bytes) *------------------------------------------------------------------------------------------*/ Loading @@ -387,7 +386,6 @@ int main( goto cleanup; } } #endif /*------------------------------------------------------------------------------------------* * Handle Channel-aware mode Loading Loading @@ -682,21 +680,6 @@ int main( } } #ifndef FIX_FMSW_DEC #ifdef FIX_1527_CMR_BITRATE_IDX /*------------------------------------------------------------------------------------------* * Open remote requests file for rtp packing (E-bytes) *------------------------------------------------------------------------------------------*/ if ( arg.requestsFileName != NULL ) { if ( ( error = RequestsFileReader_open( arg.requestsFileName, &requestsFileReader ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError: Can't open requests file %s \n\n", arg.requestsFileName ); goto cleanup; } } #endif #endif /*------------------------------------------------------------------------------------------* * Run the encoder *------------------------------------------------------------------------------------------*/ Loading
lib_com/common_api_types.h +1 −3 Original line number Diff line number Diff line Loading @@ -61,9 +61,7 @@ #define IVAS_REVERB_PREDELAY_MAX 20 /* Max input delay for reverb module */ #define IVAS_ER_LIST_HEIGHT 1.6f #define IVAS_DEFAULT_AEID 65535 #ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION #define IVAS_LISTENER_POSITION_MAX 327.67f #endif /* JBM constants for adaptive-playout */ Loading