Loading CMakeLists.txt +2 −2 Original line number Diff line number Diff line Loading @@ -174,7 +174,7 @@ file(GLOB libDecSrcs "lib_dec/*.c") file(GLOB libDecHeaders "lib_dec/*.h") add_library(lib_dec ${libDecSrcs} ${libDecHeaders}) target_link_libraries(lib_dec lib_com lib_basop lib_rend lib_debug lib_isar) target_include_directories(lib_dec PUBLIC lib_dec lib_rend PRIVATE lib_basop lib_enc lib_isar lib_util) target_include_directories(lib_dec PUBLIC lib_dec lib_rend PRIVATE lib_basop lib_enc lib_isar) file(GLOB libUtilSrcs "lib_util/*.c") file(GLOB libUtilHeaders "lib_util/*.h") Loading @@ -184,7 +184,7 @@ target_include_directories(lib_util PRIVATE lib_lc3plus lib_isar) if(NOT WMOPS) add_executable(ivas_lc3plus_unit_test ${CMAKE_SOURCE_DIR}/scripts/split_rendering/lc3plus_basop/ivas_lc3plus_unit_test.c) target_link_libraries(ivas_lc3plus_unit_test lib_rend lib_dec lib_util lib_com lib_basop lib_debug lib_isar) target_link_libraries(ivas_lc3plus_unit_test lib_rend lib_dec lib_com lib_basop lib_debug lib_isar) endif() file(GLOB libISARSrcs "lib_isar/*.c") Loading Workspace_msvc/lib_dec.vcxproj +2 −2 Original line number Diff line number Diff line Loading @@ -68,7 +68,7 @@ </Midl> <ClCompile> <Optimization>Disabled</Optimization> <AdditionalIncludeDirectories>..\lib_basop;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_isar;..\lib_rend;..\lib_lc3plus;..\lib_util;.%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\lib_basop;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_isar;..\lib_lc3plus;.%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions> <ExceptionHandling /> <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> Loading Loading @@ -109,7 +109,7 @@ <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed> <OmitFramePointers>false</OmitFramePointers> <EnableFiberSafeOptimizations>false</EnableFiberSafeOptimizations> <AdditionalIncludeDirectories>..\lib_basop;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_isar;..\lib_rend;..\lib_lc3plus;..\lib_util;.%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\lib_basop;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_isar;..\lib_lc3plus;.%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions> <StringPooling>true</StringPooling> <ExceptionHandling /> Loading apps/decoder.c +20 −54 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ #include "bitstream_reader.h" #include "evs_rtp_payload.h" #include "ism_file_writer.h" #include "ivas_rtp_file.h" #include "jbm_file_writer.h" #include "hrtf_file_reader.h" #include "ls_custom_file_reader.h" Loading @@ -50,7 +51,6 @@ #include "vector3_pair_file_reader.h" #include "wmc_auto.h" #include "stl.h" #include "ivas_rtp_file.h" #define WMC_TOOL_SKIP Loading Loading @@ -133,7 +133,6 @@ typedef struct bool applyPiData; char *piOutputFilename; bool rtpOutSR; bool evsMode; IVAS_ROOM_SIZE_T roomSize; } DecArguments; Loading Loading @@ -164,19 +163,7 @@ typedef struct 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 *hHrtfBinary, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, 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, ObjectEditFileReader *objectEditFileReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_RENDER_CONFIG_DATA *renderConfig, IVAS_DEC_HANDLE *phIvasDec, 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, ObjectEditFileReader *objectEditFileReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_RENDER_CONFIG_DATA *renderConfig, IVAS_DEC_HANDLE *phIvasDec, int16_t *pcmBuf ); 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 ); static void do_object_editing_fx( IVAS_EDITABLE_PARAMETERS *editableParameters, ObjectEditFileReader *objectEditFileReader ); 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 ); Loading Loading @@ -426,7 +413,6 @@ int main( asked_frame_size = arg.renderFramesize; uint16_t aeID = arg.aeSequence.count > 0 ? arg.aeSequence.pID[0] : IVAS_DEFAULT_AEID; arg.enableHeadRotation = arg.enableHeadRotation || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM; if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, Loading Loading @@ -497,7 +483,6 @@ int main( if ( arg.renderConfigEnabled ) { /* sanity check */ if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM && Loading Loading @@ -564,6 +549,7 @@ int main( } } } if ( ( error = RenderConfigReader_getDirectivity( renderConfigReader, arg.directivityPatternId, renderConfig.directivity_fx ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Failed to get directivity patterns for one or more of IDs: %d %d %d %d\n\n", arg.directivityPatternId[0], arg.directivityPatternId[1], arg.directivityPatternId[2], arg.directivityPatternId[3] ); Loading Loading @@ -691,11 +677,7 @@ int main( if ( arg.voipMode ) { error = decodeVoIP( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, objectEditFileReader, &splitRendBits, &renderConfig, &hIvasDec, pcmBuf ); error = decodeVoIP( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, objectEditFileReader, &splitRendBits, &renderConfig, &hIvasDec, pcmBuf ); } else { Loading Loading @@ -901,7 +883,6 @@ static bool parseCmdlIVAS_dec( arg->output_Fs = IVAS_MAX_SAMPLING_RATE; arg->outputConfig = IVAS_AUDIO_CONFIG_MONO; arg->decMode = IVAS_DEC_MODE_IVAS; arg->evsMode = false; arg->quietModeEnabled = false; arg->delayCompensationEnabled = true; arg->voipMode = false; Loading Loading @@ -1395,7 +1376,6 @@ static bool parseCmdlIVAS_dec( } else if ( strcmp( argv_to_upper, "-EVS" ) == 0 ) { arg->evsMode = true; arg->decMode = IVAS_DEC_MODE_EVS; i++; } Loading Loading @@ -1486,7 +1466,7 @@ static bool parseCmdlIVAS_dec( usage_dec(); return false; } else if ( arg->non_diegetic_pan_enabled && arg->outputConfig == IVAS_AUDIO_CONFIG_STEREO && arg->evsMode ) else if ( arg->non_diegetic_pan_enabled && arg->outputConfig == IVAS_AUDIO_CONFIG_STEREO && arg->decMode == IVAS_DEC_MODE_EVS ) { fprintf( stderr, "Error: Both non-diegetic panning and stereo output specified!\n\n" ); usage_dec(); Loading Loading @@ -2796,6 +2776,7 @@ static ivas_error decodeVoIP( int32_t delayTimeScale = -1; int16_t i; IVAS_DEC_HANDLE hIvasDec = *phIvasDec; bool restartNeeded; IVAS_RTP ivasRtp = { 0 }; IVAS_RTP srRtp = { 0 }; Loading Loading @@ -2876,7 +2857,6 @@ static ivas_error decodeVoIP( goto cleanup; } #ifdef SUPPORT_JBM_TRACEFILE if ( arg.jbmTraceFilename != NULL ) { Loading Loading @@ -2908,7 +2888,9 @@ static ivas_error decodeVoIP( else { auPtr = au; /* might have been set to RTP packet in prev call */ error = IVAS_RTP_ReadNextFrame( &ivasRtp, auPtr, &auSize, &rtpTimeStamp, &rtpSequenceNumber, &nextPacketRcvTime_ms, NULL, &qBit ); initialTsOffsetSystemAndRTP = rtpTimeStamp - systemTime_ms * 16; /* For time mapping */ /* EVS RTP payload format has timescale 16000, JBM uses 1000 internally */ Loading Loading @@ -3105,6 +3087,7 @@ static ivas_error decodeVoIP( else { auPtr = au; /* might have been set to RTP packet in prev call */ error = IVAS_RTP_ReadNextFrame( &ivasRtp, au, &auSize, &rtpTimeStamp, &rtpSequenceNumber, &nextPacketRcvTime_ms, NULL, &qBit ); /* IVAS RTP payload format has timescale 16000, JBM uses 1000 internally */ Loading Loading @@ -3294,22 +3277,8 @@ static ivas_error decodeVoIP( /* Once good frame decoded, catch up */ if ( decodedGoodFrame ) { if ( ( error = initOnFirstGoodFrame( hIvasDec, arg, numInitialBadFrames, &nOutSamples, &vec_pos_len, delayNumSamples_orig, &delayNumSamples, &delayTimeScale, &bsFormat, &afWriter, &masaWriter, ismWriters, &nOutChannels, &numObj, &srRtp, &splitRendWriter ) ) != IVAS_ERR_OK ) if ( ( error = initOnFirstGoodFrame( hIvasDec, arg, numInitialBadFrames, &nOutSamples, &vec_pos_len, delayNumSamples_orig, &delayNumSamples, &delayTimeScale, &bsFormat, &afWriter, &masaWriter, ismWriters, &nOutChannels, &numObj, &srRtp, &splitRendWriter ) ) != IVAS_ERR_OK ) { goto cleanup; } Loading Loading @@ -3411,6 +3380,7 @@ static ivas_error decodeVoIP( srInfo.bitrateKbps = splitRendBits->bits_written * 1000 / splitRendBits->codec_frame_size_ms; srInfo.codec = ( splitRendBits->codec == ISAR_SPLIT_REND_CODEC_LC3PLUS ) ? IVAS_SR_TRANSPORT_LC3PLUS : IVAS_SR_TRANSPORT_LCLD; srInfo.codecFrameSizeMs = (uint32_t) splitRendBits->codec_frame_size_ms; if ( ( error = IVAS_RTP_WriteNextFrame( &srRtp, splitRendBits->bits_buf, &srInfo, (int16_t) splitRendBits->bits_written, false, false ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError %s while pushing SR audio bitstream to RTP pack\n", ivas_error_to_string( error ) ); Loading Loading @@ -3661,7 +3631,8 @@ static void do_object_editing_fx( editableParameters->ism_metadata[obj_idx].elevation_fx = (Word32) ( readInfo->obj_ele[obj_idx] * 4194304 ); /* Q22 */ } } /* object direction editing only for diegetic objects */ /* object orientation editing only for diegetic objects */ if ( readInfo->obj_yaw_edited[obj_idx] ) { if ( readInfo->obj_yaw_relative[obj_idx] ) Loading Loading @@ -3692,12 +3663,8 @@ static void do_object_editing_fx( if ( readInfo->obj_radius_relative[obj_idx] ) { /* radius: apply relative edit + saturation */ #define SQ 9 #define SHIFT_DUE_TO_SQxSQ ( SQ - ( SQ + SQ + 1 - 16 ) ) /* ^shift by 6 == mult by 2^6 = 64.0 */ Word32 L_tmp1 = L_mult( editableParameters->ism_metadata[obj_idx].radius_fx, (Word16) ( readInfo->obj_radius[obj_idx] * ( 1L << ( SQ ) ) ) ); /*SQ*SQ*/ Word32 L_tmp2 = L_shl_sat( L_tmp1, SHIFT_DUE_TO_SQxSQ ); /*shift back to Q(9+16)*/ Word32 L_tmp1 = L_mult( editableParameters->ism_metadata[obj_idx].radius_fx, (Word16) ( readInfo->obj_radius[obj_idx] * ( 1L << ( 9 ) ) ) ); /*SQ*SQ where SQ=9*/ Word32 L_tmp2 = L_shl_sat( L_tmp1, ( 9 - ( 9 + 9 + 1 - 16 ) ) /* ^shift by 6 == mult by 2^6 = 64.0 */ ); /*shift back to Q(9+16)*/ Word16 temp_radius = round_fx( L_tmp2 ); /* Q25 -> Q9 */ temp_radius = s_max( s_min( temp_radius, OBJ_EDIT_RADIUS_MAX_FX ), 0 ); Loading Loading @@ -3968,9 +3935,10 @@ static ivas_error restartDecoder( hIvasDec = *phIvasDec; uint16_t aeID = arg->aeSequence.count > 0 ? arg->aeSequence.pID[0] : 65535; 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->renderFramesize, 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_fx, arg->dpidEnabled, aeID, arg->objEditEnabled, arg->delayCompensationEnabled ) ) != IVAS_ERR_OK ) Loading @@ -3985,7 +3953,6 @@ static ivas_error restartDecoder( goto cleanup; } if ( arg->voipMode ) { if ( ( error = IVAS_DEC_EnableVoIP( hIvasDec, 60, arg->inputFormat ) ) != IVAS_ERR_OK ) Loading Loading @@ -4034,5 +4001,4 @@ cleanup: return error; } #undef WMC_TOOL_SKIP apps/encoder.c +6 −6 Original line number Diff line number Diff line Loading @@ -43,9 +43,10 @@ #include "ism_file_reader.h" #include "jbm_file_reader.h" #include "masa_file_reader.h" #include "wmc_auto.h" #include "rotation_file_reader.h" #include "ivas_rtp_file.h" #include "wmc_auto.h" #ifdef DEBUG_FORCE_DIR /* Windows does not define the S_ISREG and S_ISDIR macros in stat.h, so we do. Loading Loading @@ -828,10 +829,10 @@ int main( /* scene orientation */ if ( sceneOrientationFileReader ) { PIDATA_TS *piDataTs = &ivasRtp.piData[ivasRtp.nWrittenPiData++]; IVAS_PIDATA_TS *piDataTs = &ivasRtp.piData[ivasRtp.nWrittenPiData++]; IVAS_PIDATA_ORIENTATION *scene = &piDataTs->data.scene; memset( piDataTs, 0, sizeof( PIDATA_TS ) ); memset( piDataTs, 0, sizeof( IVAS_PIDATA_TS ) ); scene->size = sizeof( IVAS_PIDATA_ORIENTATION ); scene->piDataType = IVAS_PI_SCENE_ORIENTATION; Loading @@ -845,10 +846,10 @@ int main( /* device orientation */ if ( deviceOrientationFileReader ) { PIDATA_TS *piDataTs = &ivasRtp.piData[ivasRtp.nWrittenPiData++]; IVAS_PIDATA_TS *piDataTs = &ivasRtp.piData[ivasRtp.nWrittenPiData++]; IVAS_PIDATA_ORIENTATION *device = &piDataTs->data.deviceUnCompensated; memset( piDataTs, 0, sizeof( PIDATA_TS ) ); memset( piDataTs, 0, sizeof( IVAS_PIDATA_TS ) ); device->size = sizeof( IVAS_PIDATA_ORIENTATION ); device->piDataType = IVAS_PI_DEVICE_ORIENTATION_COMPENSATED; Loading Loading @@ -1867,7 +1868,6 @@ static bool parseCmdlIVAS_enc( i++; } /*-----------------------------------------------------------------* * Option not recognized *-----------------------------------------------------------------*/ Loading apps/encoder_fmtsw.c +8 −6 Original line number Diff line number Diff line Loading @@ -43,9 +43,10 @@ #include "ism_file_reader.h" #include "jbm_file_reader.h" #include "masa_file_reader.h" #include "wmc_auto.h" #include "rotation_file_reader.h" #include "ivas_rtp_file.h" #include "wmc_auto.h" #ifdef DEBUG_FORCE_DIR /* Windows does not define the S_ISREG and S_ISDIR macros in stat.h, so we do. Loading Loading @@ -185,6 +186,7 @@ static IVAS_ENC_FORCED_MODE parseForcedMode( char *forcedModeChar ); static void str2arg( char *str, int *argc_local, char *argv_local[] ); static int encoder_main( int argc, char *argv[], IVAS_RTP *ivasRtp, int init_RtpWriter ); /*------------------------------------------------------------------------------------------* * main() * Loading Loading @@ -263,6 +265,7 @@ int main( cleanup: IVAS_RTP_Term( &ivasRtp ); if ( FmtSWFile ) { fclose( FmtSWFile ); Loading Loading @@ -935,10 +938,10 @@ int encoder_main( /* scene orientation */ if ( sceneOrientationFileReader ) { PIDATA_TS *piDataTs = &ivasRtp->piData[ivasRtp->nWrittenPiData++]; IVAS_PIDATA_TS *piDataTs = &ivasRtp->piData[ivasRtp->nWrittenPiData++]; IVAS_PIDATA_ORIENTATION *scene = &piDataTs->data.scene; memset( piDataTs, 0, sizeof( PIDATA_TS ) ); memset( piDataTs, 0, sizeof( IVAS_PIDATA_TS ) ); scene->size = sizeof( IVAS_PIDATA_ORIENTATION ); scene->piDataType = IVAS_PI_SCENE_ORIENTATION; Loading @@ -952,10 +955,10 @@ int encoder_main( /* device orientation */ if ( deviceOrientationFileReader ) { PIDATA_TS *piDataTs = &ivasRtp->piData[ivasRtp->nWrittenPiData++]; IVAS_PIDATA_TS *piDataTs = &ivasRtp->piData[ivasRtp->nWrittenPiData++]; IVAS_PIDATA_ORIENTATION *device = &piDataTs->data.deviceUnCompensated; memset( piDataTs, 0, sizeof( PIDATA_TS ) ); memset( piDataTs, 0, sizeof( IVAS_PIDATA_TS ) ); device->size = sizeof( IVAS_PIDATA_ORIENTATION ); device->piDataType = IVAS_PI_DEVICE_ORIENTATION_COMPENSATED; Loading Loading @@ -1968,7 +1971,6 @@ static bool parseCmdlIVAS_enc( i++; } /*-----------------------------------------------------------------* * Option not recognized *-----------------------------------------------------------------*/ Loading Loading
CMakeLists.txt +2 −2 Original line number Diff line number Diff line Loading @@ -174,7 +174,7 @@ file(GLOB libDecSrcs "lib_dec/*.c") file(GLOB libDecHeaders "lib_dec/*.h") add_library(lib_dec ${libDecSrcs} ${libDecHeaders}) target_link_libraries(lib_dec lib_com lib_basop lib_rend lib_debug lib_isar) target_include_directories(lib_dec PUBLIC lib_dec lib_rend PRIVATE lib_basop lib_enc lib_isar lib_util) target_include_directories(lib_dec PUBLIC lib_dec lib_rend PRIVATE lib_basop lib_enc lib_isar) file(GLOB libUtilSrcs "lib_util/*.c") file(GLOB libUtilHeaders "lib_util/*.h") Loading @@ -184,7 +184,7 @@ target_include_directories(lib_util PRIVATE lib_lc3plus lib_isar) if(NOT WMOPS) add_executable(ivas_lc3plus_unit_test ${CMAKE_SOURCE_DIR}/scripts/split_rendering/lc3plus_basop/ivas_lc3plus_unit_test.c) target_link_libraries(ivas_lc3plus_unit_test lib_rend lib_dec lib_util lib_com lib_basop lib_debug lib_isar) target_link_libraries(ivas_lc3plus_unit_test lib_rend lib_dec lib_com lib_basop lib_debug lib_isar) endif() file(GLOB libISARSrcs "lib_isar/*.c") Loading
Workspace_msvc/lib_dec.vcxproj +2 −2 Original line number Diff line number Diff line Loading @@ -68,7 +68,7 @@ </Midl> <ClCompile> <Optimization>Disabled</Optimization> <AdditionalIncludeDirectories>..\lib_basop;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_isar;..\lib_rend;..\lib_lc3plus;..\lib_util;.%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\lib_basop;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_isar;..\lib_lc3plus;.%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions> <ExceptionHandling /> <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> Loading Loading @@ -109,7 +109,7 @@ <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed> <OmitFramePointers>false</OmitFramePointers> <EnableFiberSafeOptimizations>false</EnableFiberSafeOptimizations> <AdditionalIncludeDirectories>..\lib_basop;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_isar;..\lib_rend;..\lib_lc3plus;..\lib_util;.%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\lib_basop;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_isar;..\lib_lc3plus;.%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions> <StringPooling>true</StringPooling> <ExceptionHandling /> Loading
apps/decoder.c +20 −54 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ #include "bitstream_reader.h" #include "evs_rtp_payload.h" #include "ism_file_writer.h" #include "ivas_rtp_file.h" #include "jbm_file_writer.h" #include "hrtf_file_reader.h" #include "ls_custom_file_reader.h" Loading @@ -50,7 +51,6 @@ #include "vector3_pair_file_reader.h" #include "wmc_auto.h" #include "stl.h" #include "ivas_rtp_file.h" #define WMC_TOOL_SKIP Loading Loading @@ -133,7 +133,6 @@ typedef struct bool applyPiData; char *piOutputFilename; bool rtpOutSR; bool evsMode; IVAS_ROOM_SIZE_T roomSize; } DecArguments; Loading Loading @@ -164,19 +163,7 @@ typedef struct 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 *hHrtfBinary, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, 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, ObjectEditFileReader *objectEditFileReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_RENDER_CONFIG_DATA *renderConfig, IVAS_DEC_HANDLE *phIvasDec, 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, ObjectEditFileReader *objectEditFileReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_RENDER_CONFIG_DATA *renderConfig, IVAS_DEC_HANDLE *phIvasDec, int16_t *pcmBuf ); 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 ); static void do_object_editing_fx( IVAS_EDITABLE_PARAMETERS *editableParameters, ObjectEditFileReader *objectEditFileReader ); 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 ); Loading Loading @@ -426,7 +413,6 @@ int main( asked_frame_size = arg.renderFramesize; uint16_t aeID = arg.aeSequence.count > 0 ? arg.aeSequence.pID[0] : IVAS_DEFAULT_AEID; arg.enableHeadRotation = arg.enableHeadRotation || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM; if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, Loading Loading @@ -497,7 +483,6 @@ int main( if ( arg.renderConfigEnabled ) { /* sanity check */ if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM && Loading Loading @@ -564,6 +549,7 @@ int main( } } } if ( ( error = RenderConfigReader_getDirectivity( renderConfigReader, arg.directivityPatternId, renderConfig.directivity_fx ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Failed to get directivity patterns for one or more of IDs: %d %d %d %d\n\n", arg.directivityPatternId[0], arg.directivityPatternId[1], arg.directivityPatternId[2], arg.directivityPatternId[3] ); Loading Loading @@ -691,11 +677,7 @@ int main( if ( arg.voipMode ) { error = decodeVoIP( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, objectEditFileReader, &splitRendBits, &renderConfig, &hIvasDec, pcmBuf ); error = decodeVoIP( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, objectEditFileReader, &splitRendBits, &renderConfig, &hIvasDec, pcmBuf ); } else { Loading Loading @@ -901,7 +883,6 @@ static bool parseCmdlIVAS_dec( arg->output_Fs = IVAS_MAX_SAMPLING_RATE; arg->outputConfig = IVAS_AUDIO_CONFIG_MONO; arg->decMode = IVAS_DEC_MODE_IVAS; arg->evsMode = false; arg->quietModeEnabled = false; arg->delayCompensationEnabled = true; arg->voipMode = false; Loading Loading @@ -1395,7 +1376,6 @@ static bool parseCmdlIVAS_dec( } else if ( strcmp( argv_to_upper, "-EVS" ) == 0 ) { arg->evsMode = true; arg->decMode = IVAS_DEC_MODE_EVS; i++; } Loading Loading @@ -1486,7 +1466,7 @@ static bool parseCmdlIVAS_dec( usage_dec(); return false; } else if ( arg->non_diegetic_pan_enabled && arg->outputConfig == IVAS_AUDIO_CONFIG_STEREO && arg->evsMode ) else if ( arg->non_diegetic_pan_enabled && arg->outputConfig == IVAS_AUDIO_CONFIG_STEREO && arg->decMode == IVAS_DEC_MODE_EVS ) { fprintf( stderr, "Error: Both non-diegetic panning and stereo output specified!\n\n" ); usage_dec(); Loading Loading @@ -2796,6 +2776,7 @@ static ivas_error decodeVoIP( int32_t delayTimeScale = -1; int16_t i; IVAS_DEC_HANDLE hIvasDec = *phIvasDec; bool restartNeeded; IVAS_RTP ivasRtp = { 0 }; IVAS_RTP srRtp = { 0 }; Loading Loading @@ -2876,7 +2857,6 @@ static ivas_error decodeVoIP( goto cleanup; } #ifdef SUPPORT_JBM_TRACEFILE if ( arg.jbmTraceFilename != NULL ) { Loading Loading @@ -2908,7 +2888,9 @@ static ivas_error decodeVoIP( else { auPtr = au; /* might have been set to RTP packet in prev call */ error = IVAS_RTP_ReadNextFrame( &ivasRtp, auPtr, &auSize, &rtpTimeStamp, &rtpSequenceNumber, &nextPacketRcvTime_ms, NULL, &qBit ); initialTsOffsetSystemAndRTP = rtpTimeStamp - systemTime_ms * 16; /* For time mapping */ /* EVS RTP payload format has timescale 16000, JBM uses 1000 internally */ Loading Loading @@ -3105,6 +3087,7 @@ static ivas_error decodeVoIP( else { auPtr = au; /* might have been set to RTP packet in prev call */ error = IVAS_RTP_ReadNextFrame( &ivasRtp, au, &auSize, &rtpTimeStamp, &rtpSequenceNumber, &nextPacketRcvTime_ms, NULL, &qBit ); /* IVAS RTP payload format has timescale 16000, JBM uses 1000 internally */ Loading Loading @@ -3294,22 +3277,8 @@ static ivas_error decodeVoIP( /* Once good frame decoded, catch up */ if ( decodedGoodFrame ) { if ( ( error = initOnFirstGoodFrame( hIvasDec, arg, numInitialBadFrames, &nOutSamples, &vec_pos_len, delayNumSamples_orig, &delayNumSamples, &delayTimeScale, &bsFormat, &afWriter, &masaWriter, ismWriters, &nOutChannels, &numObj, &srRtp, &splitRendWriter ) ) != IVAS_ERR_OK ) if ( ( error = initOnFirstGoodFrame( hIvasDec, arg, numInitialBadFrames, &nOutSamples, &vec_pos_len, delayNumSamples_orig, &delayNumSamples, &delayTimeScale, &bsFormat, &afWriter, &masaWriter, ismWriters, &nOutChannels, &numObj, &srRtp, &splitRendWriter ) ) != IVAS_ERR_OK ) { goto cleanup; } Loading Loading @@ -3411,6 +3380,7 @@ static ivas_error decodeVoIP( srInfo.bitrateKbps = splitRendBits->bits_written * 1000 / splitRendBits->codec_frame_size_ms; srInfo.codec = ( splitRendBits->codec == ISAR_SPLIT_REND_CODEC_LC3PLUS ) ? IVAS_SR_TRANSPORT_LC3PLUS : IVAS_SR_TRANSPORT_LCLD; srInfo.codecFrameSizeMs = (uint32_t) splitRendBits->codec_frame_size_ms; if ( ( error = IVAS_RTP_WriteNextFrame( &srRtp, splitRendBits->bits_buf, &srInfo, (int16_t) splitRendBits->bits_written, false, false ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError %s while pushing SR audio bitstream to RTP pack\n", ivas_error_to_string( error ) ); Loading Loading @@ -3661,7 +3631,8 @@ static void do_object_editing_fx( editableParameters->ism_metadata[obj_idx].elevation_fx = (Word32) ( readInfo->obj_ele[obj_idx] * 4194304 ); /* Q22 */ } } /* object direction editing only for diegetic objects */ /* object orientation editing only for diegetic objects */ if ( readInfo->obj_yaw_edited[obj_idx] ) { if ( readInfo->obj_yaw_relative[obj_idx] ) Loading Loading @@ -3692,12 +3663,8 @@ static void do_object_editing_fx( if ( readInfo->obj_radius_relative[obj_idx] ) { /* radius: apply relative edit + saturation */ #define SQ 9 #define SHIFT_DUE_TO_SQxSQ ( SQ - ( SQ + SQ + 1 - 16 ) ) /* ^shift by 6 == mult by 2^6 = 64.0 */ Word32 L_tmp1 = L_mult( editableParameters->ism_metadata[obj_idx].radius_fx, (Word16) ( readInfo->obj_radius[obj_idx] * ( 1L << ( SQ ) ) ) ); /*SQ*SQ*/ Word32 L_tmp2 = L_shl_sat( L_tmp1, SHIFT_DUE_TO_SQxSQ ); /*shift back to Q(9+16)*/ Word32 L_tmp1 = L_mult( editableParameters->ism_metadata[obj_idx].radius_fx, (Word16) ( readInfo->obj_radius[obj_idx] * ( 1L << ( 9 ) ) ) ); /*SQ*SQ where SQ=9*/ Word32 L_tmp2 = L_shl_sat( L_tmp1, ( 9 - ( 9 + 9 + 1 - 16 ) ) /* ^shift by 6 == mult by 2^6 = 64.0 */ ); /*shift back to Q(9+16)*/ Word16 temp_radius = round_fx( L_tmp2 ); /* Q25 -> Q9 */ temp_radius = s_max( s_min( temp_radius, OBJ_EDIT_RADIUS_MAX_FX ), 0 ); Loading Loading @@ -3968,9 +3935,10 @@ static ivas_error restartDecoder( hIvasDec = *phIvasDec; uint16_t aeID = arg->aeSequence.count > 0 ? arg->aeSequence.pID[0] : 65535; 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->renderFramesize, 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_fx, arg->dpidEnabled, aeID, arg->objEditEnabled, arg->delayCompensationEnabled ) ) != IVAS_ERR_OK ) Loading @@ -3985,7 +3953,6 @@ static ivas_error restartDecoder( goto cleanup; } if ( arg->voipMode ) { if ( ( error = IVAS_DEC_EnableVoIP( hIvasDec, 60, arg->inputFormat ) ) != IVAS_ERR_OK ) Loading Loading @@ -4034,5 +4001,4 @@ cleanup: return error; } #undef WMC_TOOL_SKIP
apps/encoder.c +6 −6 Original line number Diff line number Diff line Loading @@ -43,9 +43,10 @@ #include "ism_file_reader.h" #include "jbm_file_reader.h" #include "masa_file_reader.h" #include "wmc_auto.h" #include "rotation_file_reader.h" #include "ivas_rtp_file.h" #include "wmc_auto.h" #ifdef DEBUG_FORCE_DIR /* Windows does not define the S_ISREG and S_ISDIR macros in stat.h, so we do. Loading Loading @@ -828,10 +829,10 @@ int main( /* scene orientation */ if ( sceneOrientationFileReader ) { PIDATA_TS *piDataTs = &ivasRtp.piData[ivasRtp.nWrittenPiData++]; IVAS_PIDATA_TS *piDataTs = &ivasRtp.piData[ivasRtp.nWrittenPiData++]; IVAS_PIDATA_ORIENTATION *scene = &piDataTs->data.scene; memset( piDataTs, 0, sizeof( PIDATA_TS ) ); memset( piDataTs, 0, sizeof( IVAS_PIDATA_TS ) ); scene->size = sizeof( IVAS_PIDATA_ORIENTATION ); scene->piDataType = IVAS_PI_SCENE_ORIENTATION; Loading @@ -845,10 +846,10 @@ int main( /* device orientation */ if ( deviceOrientationFileReader ) { PIDATA_TS *piDataTs = &ivasRtp.piData[ivasRtp.nWrittenPiData++]; IVAS_PIDATA_TS *piDataTs = &ivasRtp.piData[ivasRtp.nWrittenPiData++]; IVAS_PIDATA_ORIENTATION *device = &piDataTs->data.deviceUnCompensated; memset( piDataTs, 0, sizeof( PIDATA_TS ) ); memset( piDataTs, 0, sizeof( IVAS_PIDATA_TS ) ); device->size = sizeof( IVAS_PIDATA_ORIENTATION ); device->piDataType = IVAS_PI_DEVICE_ORIENTATION_COMPENSATED; Loading Loading @@ -1867,7 +1868,6 @@ static bool parseCmdlIVAS_enc( i++; } /*-----------------------------------------------------------------* * Option not recognized *-----------------------------------------------------------------*/ Loading
apps/encoder_fmtsw.c +8 −6 Original line number Diff line number Diff line Loading @@ -43,9 +43,10 @@ #include "ism_file_reader.h" #include "jbm_file_reader.h" #include "masa_file_reader.h" #include "wmc_auto.h" #include "rotation_file_reader.h" #include "ivas_rtp_file.h" #include "wmc_auto.h" #ifdef DEBUG_FORCE_DIR /* Windows does not define the S_ISREG and S_ISDIR macros in stat.h, so we do. Loading Loading @@ -185,6 +186,7 @@ static IVAS_ENC_FORCED_MODE parseForcedMode( char *forcedModeChar ); static void str2arg( char *str, int *argc_local, char *argv_local[] ); static int encoder_main( int argc, char *argv[], IVAS_RTP *ivasRtp, int init_RtpWriter ); /*------------------------------------------------------------------------------------------* * main() * Loading Loading @@ -263,6 +265,7 @@ int main( cleanup: IVAS_RTP_Term( &ivasRtp ); if ( FmtSWFile ) { fclose( FmtSWFile ); Loading Loading @@ -935,10 +938,10 @@ int encoder_main( /* scene orientation */ if ( sceneOrientationFileReader ) { PIDATA_TS *piDataTs = &ivasRtp->piData[ivasRtp->nWrittenPiData++]; IVAS_PIDATA_TS *piDataTs = &ivasRtp->piData[ivasRtp->nWrittenPiData++]; IVAS_PIDATA_ORIENTATION *scene = &piDataTs->data.scene; memset( piDataTs, 0, sizeof( PIDATA_TS ) ); memset( piDataTs, 0, sizeof( IVAS_PIDATA_TS ) ); scene->size = sizeof( IVAS_PIDATA_ORIENTATION ); scene->piDataType = IVAS_PI_SCENE_ORIENTATION; Loading @@ -952,10 +955,10 @@ int encoder_main( /* device orientation */ if ( deviceOrientationFileReader ) { PIDATA_TS *piDataTs = &ivasRtp->piData[ivasRtp->nWrittenPiData++]; IVAS_PIDATA_TS *piDataTs = &ivasRtp->piData[ivasRtp->nWrittenPiData++]; IVAS_PIDATA_ORIENTATION *device = &piDataTs->data.deviceUnCompensated; memset( piDataTs, 0, sizeof( PIDATA_TS ) ); memset( piDataTs, 0, sizeof( IVAS_PIDATA_TS ) ); device->size = sizeof( IVAS_PIDATA_ORIENTATION ); device->piDataType = IVAS_PI_DEVICE_ORIENTATION_COMPENSATED; Loading Loading @@ -1968,7 +1971,6 @@ static bool parseCmdlIVAS_enc( i++; } /*-----------------------------------------------------------------* * Option not recognized *-----------------------------------------------------------------*/ Loading