Loading Workspace_msvc/lib_com.vcxproj +0 −1 Original line number Diff line number Diff line Loading @@ -132,7 +132,6 @@ <ClCompile Include="..\lib_com\basop_util.c" /> <ClCompile Include="..\lib_com\bitallocsum_fx.c" /> <ClCompile Include="..\lib_com\bitalloc_fx.c" /> <ClCompile Include="..\lib_com\bitstream.c" /> <ClCompile Include="..\lib_com\bitstream_fx.c" /> <ClCompile Include="..\lib_com\bits_alloc_fx.c" /> <ClCompile Include="..\lib_com\cb_shape_fx.c" /> Loading Workspace_msvc/lib_com.vcxproj.filters +209 −638 File changed.Preview size limit exceeded, changes collapsed. Show changes apps/decoder.c +43 −45 Original line number Diff line number Diff line Loading @@ -431,7 +431,7 @@ int main( { if ( ( error = IVAS_DEC_EnableSplitRendering( hIvasDec ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); fprintf( stderr, "\nSplit rendering configure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } Loading Loading @@ -512,8 +512,7 @@ int main( goto cleanup; } #endif if ( ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) if ( ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { if ( asked_frame_size != IVAS_RENDER_FRAMESIZE_20MS && ( renderConfig.split_rend_config.poseCorrectionMode == ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE || Loading Loading @@ -563,6 +562,7 @@ int main( } renderConfig.roomAcoustics.override = true; } /* ISAR frame size is set from command line, not renderer config file. * This will be ignored if output format is not split rendering. */ renderConfig.split_rend_config.isar_frame_size_ms = (int16_t) arg.renderFramesize /* given in number of 5ms subframes */ * 5; Loading Loading @@ -1207,7 +1207,7 @@ static bool parseCmdlIVAS_dec( arg->outputMdFilename = argv[i + 1]; if ( arg->outputMdFilename[0] == '\0' ) { fprintf( stderr, "Error: output metadata file path not specified\n\n" ); fprintf( stderr, "Error: Split rendering output metadata file path not specified\n\n" ); usage_dec(); return false; } Loading Loading @@ -1632,6 +1632,7 @@ static ivas_error initOnFirstGoodFrame( uint16_t *pNumObj, /* o : */ SplitFileReadWrite **splitRendWriter ) { int16_t isSplitRend, isSplitCoded; ivas_error error = IVAS_ERR_UNKNOWN; /* Now delay, number of output channels and frame size are known */ Loading @@ -1641,7 +1642,19 @@ static ivas_error initOnFirstGoodFrame( return error; } if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) ) if ( ( error = IVAS_DEC_is_split_rendering_enabled( hIvasDec, &isSplitRend ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_is_split_rendering_enabled, code: %d\n", error ); return error; } if ( ( error = IVAS_DEC_is_split_rendering_coded_out( hIvasDec, &isSplitCoded ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_is_split_rendering_coded_out, code: %d\n", error ); return error; } if ( isSplitRend ) { pFullDelayNumSamples[0] = 0; } Loading @@ -1666,7 +1679,7 @@ static ivas_error initOnFirstGoodFrame( return error; } if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) ) if ( isSplitRend ) { /* Open split rendering metadata writer */ int16_t delayNumSamples_temp[3]; Loading @@ -1683,29 +1696,15 @@ static ivas_error initOnFirstGoodFrame( return error; } if ( ( error = IVAS_DEC_GetSplitRendBitstreamHeader( hIvasDec, &splitRendCodec, &poseCorrection, &splitRendIsarFrameSizeMs, &splitRendCodecFrameSizeMs, &lc3plusHighRes ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_DEC_GetSplitRendBitstreamHeader( hIvasDec, &splitRendCodec, &poseCorrection, &splitRendIsarFrameSizeMs, &splitRendCodecFrameSizeMs, &lc3plusHighRes ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nUnable to get split renderer bitstream header: %s\n", ivas_error_to_string( error ) ); return error; } if ( IVAS_DEC_is_split_rendering_coded_out( hIvasDec ) ) if ( isSplitCoded ) { if ( ( error = split_rend_writer_open( splitRendWriter, arg.outputWavFilename, delayNumSamples_temp[0], delayTimeScale_temp, splitRendCodec, poseCorrection, splitRendCodecFrameSizeMs, splitRendIsarFrameSizeMs, arg.output_Fs, lc3plusHighRes ) ) != IVAS_ERR_OK ) if ( ( error = split_rend_writer_open( splitRendWriter, arg.outputWavFilename, delayNumSamples_temp[0], delayTimeScale_temp, splitRendCodec, poseCorrection, splitRendCodecFrameSizeMs, splitRendIsarFrameSizeMs, arg.output_Fs, lc3plusHighRes ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nUnable to open output split rendering metadata file %s\n", arg.outputWavFilename ); return error; Loading @@ -1719,16 +1718,7 @@ static ivas_error initOnFirstGoodFrame( return IVAS_ERR_INVALID_SPLIT_REND_CONFIG; } if ( ( error = split_rend_writer_open( splitRendWriter, arg.outputMdFilename, delayNumSamples_temp[0], delayTimeScale_temp, splitRendCodec, poseCorrection, splitRendCodecFrameSizeMs, splitRendIsarFrameSizeMs, arg.output_Fs, lc3plusHighRes ) ) != IVAS_ERR_OK ) if ( ( error = split_rend_writer_open( splitRendWriter, arg.outputMdFilename, delayNumSamples_temp[0], delayTimeScale_temp, splitRendCodec, poseCorrection, splitRendCodecFrameSizeMs, splitRendIsarFrameSizeMs, arg.output_Fs, lc3plusHighRes ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nUnable to open output split rendering metadata file %s\n", arg.outputWavFilename ); return error; Loading @@ -1736,7 +1726,7 @@ static ivas_error initOnFirstGoodFrame( } } if ( IVAS_DEC_is_split_rendering_coded_out( hIvasDec ) == 0 ) if ( !isSplitCoded ) { /* Open audio writer and write all previously skipped bad frames now that frame size is known */ if ( ( error = AudioFileWriter_open( ppAfWriter, arg.outputWavFilename, arg.output_Fs, *pNumOutChannels ) ) != IVAS_ERR_OK ) Loading Loading @@ -1771,7 +1761,6 @@ static ivas_error initOnFirstGoodFrame( } else { if ( *pRemainingDelayNumSamples < *numOutSamples ) { if ( ( error = AudioFileWriter_write( *ppAfWriter, zeroBuf, *numOutSamples * *pNumOutChannels - ( *pRemainingDelayNumSamples * *pNumOutChannels ) ) ) != IVAS_ERR_OK ) Loading Loading @@ -1941,11 +1930,23 @@ static ivas_error decodeG192( IVAS_VECTOR3 Pos[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES] = { { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 } }; int16_t vec_pos_update, vec_pos_len; SplitFileReadWrite *splitRendWriter = NULL; int16_t isSplitRend, isSplitCoded; #ifdef FIX_1053_REVERB_RECONFIGURATION IVAS_RENDER_CONFIG_DATA renderConfig; RenderConfigReader *renderConfigReader = NULL; if ( ( error = IVAS_DEC_is_split_rendering_enabled( hIvasDec, &isSplitRend ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_is_split_rendering_enabled, code: %d\n", error ); return error; } if ( ( error = IVAS_DEC_is_split_rendering_coded_out( hIvasDec, &isSplitCoded ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_is_split_rendering_coded_out, code: %d\n", error ); return error; } if ( arg.renderConfigEnabled ) { if ( ( error = RenderConfigReader_open( arg.renderConfigFilename, &renderConfigReader ) ) != IVAS_ERR_OK ) Loading Loading @@ -1976,7 +1977,6 @@ static ivas_error decodeG192( /* we always start with needing a new frame */ needNewFrame = true; if ( !arg.quietModeEnabled ) { fprintf( stdout, "\n------ Running the decoder ------\n\n" ); Loading Loading @@ -2008,13 +2008,13 @@ static ivas_error decodeG192( return error; } /*------------------------------------------------------------------------------------------* * Loop for every packet (frame) of bitstream data * - Read the bitstream packet * - Run the decoder * - Write the synthesized signal into output file *------------------------------------------------------------------------------------------*/ while ( 1 ) { /* Read next frame if not enough samples availble */ Loading Loading @@ -2184,7 +2184,7 @@ static ivas_error decodeG192( } } if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) ) if ( isSplitRend ) { if ( ( error = IVAS_DEC_GetSplitBinauralBitstream( hIvasDec, (Word16 *) ( pcmBuf + nOutChannels * nSamplesRendered ), splitRendBits, &nSamplesRendered_loop, &needNewFrame ) ) != IVAS_ERR_OK ) { Loading Loading @@ -2249,7 +2249,7 @@ static ivas_error decodeG192( /* Write current frame */ if ( decodedGoodFrame ) { if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) ) if ( isSplitRend ) { if ( split_rend_write_bitstream_to_file( splitRendWriter, splitRendBits->bits_buf, &splitRendBits->bits_read, &splitRendBits->bits_written ) != IVAS_ERR_OK ) { Loading @@ -2258,7 +2258,7 @@ static ivas_error decodeG192( } } if ( IVAS_DEC_is_split_rendering_coded_out( hIvasDec ) == 0 ) if ( !isSplitCoded ) { if ( delayNumSamples < nOutSamples ) { Loading Loading @@ -2825,8 +2825,7 @@ static ivas_error decodeVoIP( { if ( ( error = HeadRotationFileReading( headRotReader, &Quaternions[i], &Pos[i] ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), RotationFileReader_getFilePath( headRotReader ) ); fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), RotationFileReader_getFilePath( headRotReader ) ); goto cleanup; } } Loading @@ -2834,8 +2833,7 @@ static ivas_error decodeVoIP( for ( i = 0; i < num_subframes; i++ ) { if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternions[i], Pos[i], i, DEFAULT_AXIS ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternions[i], Pos[i], i, DEFAULT_AXIS ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_FeedHeadTrackData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; Loading apps/isar_post_rend.c +36 −7 Original line number Diff line number Diff line Loading @@ -31,9 +31,6 @@ *******************************************************************************************************/ #include "lib_isar_post_rend.h" //#undef IVAS_FLOAT_FIXED #include <assert.h> #include <math.h> #include <string.h> Loading Loading @@ -268,9 +265,6 @@ static int16_t getTotalNumInChannels( return totalNumInChannels; } /*------------------------------------------------------------------------------------------* * Local functions *------------------------------------------------------------------------------------------*/ static const CmdLnParser_Option *findOptionById( const int32_t id ) Loading Loading @@ -433,6 +427,7 @@ static bool checkRequiredArgs( return !missingRequiredArg; } static CmdlnArgs defaultArgs( const char *executableName ) { Loading Loading @@ -463,6 +458,7 @@ static CmdlnArgs defaultArgs( return args; } static void parseOption( const int32_t optionId, char **optionValues, Loading Loading @@ -555,6 +551,7 @@ static void parseOption( return; } static CmdlnArgs parseCmdlnArgs( const int argc, char **argv ) Loading Loading @@ -631,6 +628,7 @@ static void convertInputBuffer( return; } /*--------------------------------------------------------------------------* * convertOutputBuffer() * Loading Loading @@ -672,6 +670,7 @@ static void convertOutputBuffer( return; } /*------------------------------------------------------------------------------------------* * main() * Loading Loading @@ -731,12 +730,20 @@ int main( bitsBuffer.config.isar_frame_size_ms = 20; bitsBuffer.config.lc3plusHighRes = 0; /*------------------------------------------------------------------------------------------* * Parse command-line arguments *------------------------------------------------------------------------------------------*/ CmdlnArgs args = parseCmdlnArgs( argc, argv ); convert_backslash( args.inputFilePath ); convert_backslash( args.outputFilePath ); convert_backslash( args.headRotationFilePath ); /*------------------------------------------------------------------------------------------* * Open head-rotation file *------------------------------------------------------------------------------------------*/ if ( !isEmptyString( args.headRotationFilePath ) ) { if ( RotationFileReader_open( args.headRotationFilePath, &headRotReader ) != IVAS_ERR_OK ) Loading @@ -746,6 +753,10 @@ int main( } } /*------------------------------------------------------------------------------------------* * Open BFI file *------------------------------------------------------------------------------------------*/ if ( !isEmptyString( args.splitRendBFIFilePath ) ) { convert_backslash( args.splitRendBFIFilePath ); Loading Loading @@ -844,6 +855,10 @@ int main( } } /*------------------------------------------------------------------------------------------* * Open ISAR handle *------------------------------------------------------------------------------------------*/ const int16_t frameSize_smpls = (int16_t) ( ( args.render_framesize ) * args.sampleRate * 5 / ( 1000 ) ); args.outConfig.audioConfig = IVAS_AUDIO_CONFIG_BINAURAL; if ( ( error = ISAR_POST_REND_open( &hIsarPostRend, args.sampleRate, args.outConfig.audioConfig, true, 0, 0, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK ) Loading @@ -852,7 +867,10 @@ int main( goto cleanup; } /* === Configure === */ /*------------------------------------------------------------------------------------------* * Configuration *------------------------------------------------------------------------------------------*/ if ( ( error = ISAR_POST_REND_InitConfig( hIsarPostRend, args.outConfig.audioConfig ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in Renderer Config Init: %s\n", ivas_error_to_string( error ) ); Loading Loading @@ -906,6 +924,10 @@ int main( goto cleanup; } /*------------------------------------------------------------------------------------------* * Allocate processing buffers *------------------------------------------------------------------------------------------*/ inBufferSize = frameSize_smpls * totalNumInChannels; outBufferSize = frameSize_smpls * numOutChannels; inpInt16Buffer = malloc( inBufferSize * sizeof( int16_t ) ); Loading Loading @@ -961,6 +983,13 @@ int main( fprintf( stdout, "\n\n-- Start the ISAR post renderer (quiet mode) --\n\n" ); } /*------------------------------------------------------------------------------------------* * Loop for every frame of data * - Read the input data * - Run the post-rendering * - Write the data into output file *------------------------------------------------------------------------------------------*/ while ( 1 ) { int16_t num_in_channels; Loading apps/renderer.c +19 −32 Original line number Diff line number Diff line Loading @@ -715,6 +715,7 @@ static int16_t get_cldfb_in_flag( return cldfb_in_flag; } static int16_t is_split_pre_rend_mode( CmdlnArgs *args ) { Loading Loading @@ -1471,12 +1472,11 @@ int main( if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) { IVAS_REND_GetSplitRendBitstreamHeader( hIvasRend, &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection, &bitsBuffer.config.codec_frame_size_ms, &bitsBuffer.config.isar_frame_size_ms ); if ( ( error = IVAS_REND_GetSplitRendBitstreamHeader( hIvasRend, &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection, &bitsBuffer.config.codec_frame_size_ms, &bitsBuffer.config.isar_frame_size_ms ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_REND_GetSplitRendBitstreamHeader(): %s!\n", ivas_error_to_string( error ) ); goto cleanup; } if ( IVAS_REND_GetDelay_fx( hIvasRend, &delayNumSamples_temp, &delayTimeScale_temp ) != IVAS_ERR_OK ) { Loading @@ -1484,16 +1484,7 @@ int main( goto cleanup; } if ( ( error = split_rend_writer_open( &hSplitRendFileReadWrite, args.outputFilePath, delayNumSamples_temp, delayTimeScale_temp, bitsBuffer.config.codec, bitsBuffer.config.poseCorrection, bitsBuffer.config.codec_frame_size_ms, bitsBuffer.config.isar_frame_size_ms, args.sampleRate, bitsBuffer.config.lc3plus_highres ) ) != IVAS_ERR_OK ) if ( ( error = split_rend_writer_open( &hSplitRendFileReadWrite, args.outputFilePath, delayNumSamples_temp, delayTimeScale_temp, bitsBuffer.config.codec, bitsBuffer.config.poseCorrection, bitsBuffer.config.codec_frame_size_ms, bitsBuffer.config.isar_frame_size_ms, args.sampleRate, bitsBuffer.config.lc3plus_highres ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nCould not open split rend metadata file %s\n", args.outputFilePath ); goto cleanup; Loading @@ -1504,12 +1495,11 @@ int main( { if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { IVAS_REND_GetSplitRendBitstreamHeader( hIvasRend, &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection, &bitsBuffer.config.codec_frame_size_ms, &bitsBuffer.config.isar_frame_size_ms ); if ( ( error = IVAS_REND_GetSplitRendBitstreamHeader( hIvasRend, &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection, &bitsBuffer.config.codec_frame_size_ms, &bitsBuffer.config.isar_frame_size_ms ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_REND_GetSplitRendBitstreamHeader(): %s!\n", ivas_error_to_string( error ) ); goto cleanup; } if ( IVAS_REND_GetDelay_fx( hIvasRend, &delayNumSamples_temp, &delayTimeScale_temp ) != IVAS_ERR_OK ) { Loading @@ -1517,16 +1507,7 @@ int main( goto cleanup; } if ( ( error = split_rend_writer_open( &hSplitRendFileReadWrite, args.outMetadataFilePath, delayNumSamples_temp, delayTimeScale_temp, bitsBuffer.config.codec, bitsBuffer.config.poseCorrection, bitsBuffer.config.codec_frame_size_ms, bitsBuffer.config.isar_frame_size_ms, args.sampleRate, bitsBuffer.config.lc3plus_highres ) ) != IVAS_ERR_OK ) if ( ( error = split_rend_writer_open( &hSplitRendFileReadWrite, args.outMetadataFilePath, delayNumSamples_temp, delayTimeScale_temp, bitsBuffer.config.codec, bitsBuffer.config.poseCorrection, bitsBuffer.config.codec_frame_size_ms, bitsBuffer.config.isar_frame_size_ms, args.sampleRate, bitsBuffer.config.lc3plus_highres ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nCould not open split rend metadata file %s\n", args.outMetadataFilePath ); goto cleanup; Loading Loading @@ -3698,14 +3679,20 @@ static void parseCombinedFormatInput( inConfig->numAmbisonicsBuses = 1; inConfig->ambisonicsBuses[0].audioConfig = audioConfig; inConfig->ambisonicsBuses[0].inputChannelIndex = inConfig->numAudioObjects; #ifdef NONBE_1352_HARMONIZE_OSBA_LOUDNESS inConfig->ambisonicsBuses[0].gain_dB = 0.f; #else inConfig->ambisonicsBuses[0].gain_dB = -6.f; #endif *configString += 4; /* Modify input gain for objects too */ #ifndef NONBE_1352_HARMONIZE_OSBA_LOUDNESS for ( int16_t i = 0; i < inConfig->numAudioObjects; ++i ) { inConfig->audioObjects[i].gain_dB = -6.f; } #endif } else if ( audioConfig == IVAS_AUDIO_CONFIG_MASA1 || audioConfig == IVAS_AUDIO_CONFIG_MASA2 ) { Loading Loading
Workspace_msvc/lib_com.vcxproj +0 −1 Original line number Diff line number Diff line Loading @@ -132,7 +132,6 @@ <ClCompile Include="..\lib_com\basop_util.c" /> <ClCompile Include="..\lib_com\bitallocsum_fx.c" /> <ClCompile Include="..\lib_com\bitalloc_fx.c" /> <ClCompile Include="..\lib_com\bitstream.c" /> <ClCompile Include="..\lib_com\bitstream_fx.c" /> <ClCompile Include="..\lib_com\bits_alloc_fx.c" /> <ClCompile Include="..\lib_com\cb_shape_fx.c" /> Loading
Workspace_msvc/lib_com.vcxproj.filters +209 −638 File changed.Preview size limit exceeded, changes collapsed. Show changes
apps/decoder.c +43 −45 Original line number Diff line number Diff line Loading @@ -431,7 +431,7 @@ int main( { if ( ( error = IVAS_DEC_EnableSplitRendering( hIvasDec ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); fprintf( stderr, "\nSplit rendering configure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } Loading Loading @@ -512,8 +512,7 @@ int main( goto cleanup; } #endif if ( ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) if ( ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { if ( asked_frame_size != IVAS_RENDER_FRAMESIZE_20MS && ( renderConfig.split_rend_config.poseCorrectionMode == ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE || Loading Loading @@ -563,6 +562,7 @@ int main( } renderConfig.roomAcoustics.override = true; } /* ISAR frame size is set from command line, not renderer config file. * This will be ignored if output format is not split rendering. */ renderConfig.split_rend_config.isar_frame_size_ms = (int16_t) arg.renderFramesize /* given in number of 5ms subframes */ * 5; Loading Loading @@ -1207,7 +1207,7 @@ static bool parseCmdlIVAS_dec( arg->outputMdFilename = argv[i + 1]; if ( arg->outputMdFilename[0] == '\0' ) { fprintf( stderr, "Error: output metadata file path not specified\n\n" ); fprintf( stderr, "Error: Split rendering output metadata file path not specified\n\n" ); usage_dec(); return false; } Loading Loading @@ -1632,6 +1632,7 @@ static ivas_error initOnFirstGoodFrame( uint16_t *pNumObj, /* o : */ SplitFileReadWrite **splitRendWriter ) { int16_t isSplitRend, isSplitCoded; ivas_error error = IVAS_ERR_UNKNOWN; /* Now delay, number of output channels and frame size are known */ Loading @@ -1641,7 +1642,19 @@ static ivas_error initOnFirstGoodFrame( return error; } if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) ) if ( ( error = IVAS_DEC_is_split_rendering_enabled( hIvasDec, &isSplitRend ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_is_split_rendering_enabled, code: %d\n", error ); return error; } if ( ( error = IVAS_DEC_is_split_rendering_coded_out( hIvasDec, &isSplitCoded ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_is_split_rendering_coded_out, code: %d\n", error ); return error; } if ( isSplitRend ) { pFullDelayNumSamples[0] = 0; } Loading @@ -1666,7 +1679,7 @@ static ivas_error initOnFirstGoodFrame( return error; } if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) ) if ( isSplitRend ) { /* Open split rendering metadata writer */ int16_t delayNumSamples_temp[3]; Loading @@ -1683,29 +1696,15 @@ static ivas_error initOnFirstGoodFrame( return error; } if ( ( error = IVAS_DEC_GetSplitRendBitstreamHeader( hIvasDec, &splitRendCodec, &poseCorrection, &splitRendIsarFrameSizeMs, &splitRendCodecFrameSizeMs, &lc3plusHighRes ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_DEC_GetSplitRendBitstreamHeader( hIvasDec, &splitRendCodec, &poseCorrection, &splitRendIsarFrameSizeMs, &splitRendCodecFrameSizeMs, &lc3plusHighRes ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nUnable to get split renderer bitstream header: %s\n", ivas_error_to_string( error ) ); return error; } if ( IVAS_DEC_is_split_rendering_coded_out( hIvasDec ) ) if ( isSplitCoded ) { if ( ( error = split_rend_writer_open( splitRendWriter, arg.outputWavFilename, delayNumSamples_temp[0], delayTimeScale_temp, splitRendCodec, poseCorrection, splitRendCodecFrameSizeMs, splitRendIsarFrameSizeMs, arg.output_Fs, lc3plusHighRes ) ) != IVAS_ERR_OK ) if ( ( error = split_rend_writer_open( splitRendWriter, arg.outputWavFilename, delayNumSamples_temp[0], delayTimeScale_temp, splitRendCodec, poseCorrection, splitRendCodecFrameSizeMs, splitRendIsarFrameSizeMs, arg.output_Fs, lc3plusHighRes ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nUnable to open output split rendering metadata file %s\n", arg.outputWavFilename ); return error; Loading @@ -1719,16 +1718,7 @@ static ivas_error initOnFirstGoodFrame( return IVAS_ERR_INVALID_SPLIT_REND_CONFIG; } if ( ( error = split_rend_writer_open( splitRendWriter, arg.outputMdFilename, delayNumSamples_temp[0], delayTimeScale_temp, splitRendCodec, poseCorrection, splitRendCodecFrameSizeMs, splitRendIsarFrameSizeMs, arg.output_Fs, lc3plusHighRes ) ) != IVAS_ERR_OK ) if ( ( error = split_rend_writer_open( splitRendWriter, arg.outputMdFilename, delayNumSamples_temp[0], delayTimeScale_temp, splitRendCodec, poseCorrection, splitRendCodecFrameSizeMs, splitRendIsarFrameSizeMs, arg.output_Fs, lc3plusHighRes ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nUnable to open output split rendering metadata file %s\n", arg.outputWavFilename ); return error; Loading @@ -1736,7 +1726,7 @@ static ivas_error initOnFirstGoodFrame( } } if ( IVAS_DEC_is_split_rendering_coded_out( hIvasDec ) == 0 ) if ( !isSplitCoded ) { /* Open audio writer and write all previously skipped bad frames now that frame size is known */ if ( ( error = AudioFileWriter_open( ppAfWriter, arg.outputWavFilename, arg.output_Fs, *pNumOutChannels ) ) != IVAS_ERR_OK ) Loading Loading @@ -1771,7 +1761,6 @@ static ivas_error initOnFirstGoodFrame( } else { if ( *pRemainingDelayNumSamples < *numOutSamples ) { if ( ( error = AudioFileWriter_write( *ppAfWriter, zeroBuf, *numOutSamples * *pNumOutChannels - ( *pRemainingDelayNumSamples * *pNumOutChannels ) ) ) != IVAS_ERR_OK ) Loading Loading @@ -1941,11 +1930,23 @@ static ivas_error decodeG192( IVAS_VECTOR3 Pos[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES] = { { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 } }; int16_t vec_pos_update, vec_pos_len; SplitFileReadWrite *splitRendWriter = NULL; int16_t isSplitRend, isSplitCoded; #ifdef FIX_1053_REVERB_RECONFIGURATION IVAS_RENDER_CONFIG_DATA renderConfig; RenderConfigReader *renderConfigReader = NULL; if ( ( error = IVAS_DEC_is_split_rendering_enabled( hIvasDec, &isSplitRend ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_is_split_rendering_enabled, code: %d\n", error ); return error; } if ( ( error = IVAS_DEC_is_split_rendering_coded_out( hIvasDec, &isSplitCoded ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_is_split_rendering_coded_out, code: %d\n", error ); return error; } if ( arg.renderConfigEnabled ) { if ( ( error = RenderConfigReader_open( arg.renderConfigFilename, &renderConfigReader ) ) != IVAS_ERR_OK ) Loading Loading @@ -1976,7 +1977,6 @@ static ivas_error decodeG192( /* we always start with needing a new frame */ needNewFrame = true; if ( !arg.quietModeEnabled ) { fprintf( stdout, "\n------ Running the decoder ------\n\n" ); Loading Loading @@ -2008,13 +2008,13 @@ static ivas_error decodeG192( return error; } /*------------------------------------------------------------------------------------------* * Loop for every packet (frame) of bitstream data * - Read the bitstream packet * - Run the decoder * - Write the synthesized signal into output file *------------------------------------------------------------------------------------------*/ while ( 1 ) { /* Read next frame if not enough samples availble */ Loading Loading @@ -2184,7 +2184,7 @@ static ivas_error decodeG192( } } if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) ) if ( isSplitRend ) { if ( ( error = IVAS_DEC_GetSplitBinauralBitstream( hIvasDec, (Word16 *) ( pcmBuf + nOutChannels * nSamplesRendered ), splitRendBits, &nSamplesRendered_loop, &needNewFrame ) ) != IVAS_ERR_OK ) { Loading Loading @@ -2249,7 +2249,7 @@ static ivas_error decodeG192( /* Write current frame */ if ( decodedGoodFrame ) { if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) ) if ( isSplitRend ) { if ( split_rend_write_bitstream_to_file( splitRendWriter, splitRendBits->bits_buf, &splitRendBits->bits_read, &splitRendBits->bits_written ) != IVAS_ERR_OK ) { Loading @@ -2258,7 +2258,7 @@ static ivas_error decodeG192( } } if ( IVAS_DEC_is_split_rendering_coded_out( hIvasDec ) == 0 ) if ( !isSplitCoded ) { if ( delayNumSamples < nOutSamples ) { Loading Loading @@ -2825,8 +2825,7 @@ static ivas_error decodeVoIP( { if ( ( error = HeadRotationFileReading( headRotReader, &Quaternions[i], &Pos[i] ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), RotationFileReader_getFilePath( headRotReader ) ); fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), RotationFileReader_getFilePath( headRotReader ) ); goto cleanup; } } Loading @@ -2834,8 +2833,7 @@ static ivas_error decodeVoIP( for ( i = 0; i < num_subframes; i++ ) { if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternions[i], Pos[i], i, DEFAULT_AXIS ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternions[i], Pos[i], i, DEFAULT_AXIS ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_FeedHeadTrackData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; Loading
apps/isar_post_rend.c +36 −7 Original line number Diff line number Diff line Loading @@ -31,9 +31,6 @@ *******************************************************************************************************/ #include "lib_isar_post_rend.h" //#undef IVAS_FLOAT_FIXED #include <assert.h> #include <math.h> #include <string.h> Loading Loading @@ -268,9 +265,6 @@ static int16_t getTotalNumInChannels( return totalNumInChannels; } /*------------------------------------------------------------------------------------------* * Local functions *------------------------------------------------------------------------------------------*/ static const CmdLnParser_Option *findOptionById( const int32_t id ) Loading Loading @@ -433,6 +427,7 @@ static bool checkRequiredArgs( return !missingRequiredArg; } static CmdlnArgs defaultArgs( const char *executableName ) { Loading Loading @@ -463,6 +458,7 @@ static CmdlnArgs defaultArgs( return args; } static void parseOption( const int32_t optionId, char **optionValues, Loading Loading @@ -555,6 +551,7 @@ static void parseOption( return; } static CmdlnArgs parseCmdlnArgs( const int argc, char **argv ) Loading Loading @@ -631,6 +628,7 @@ static void convertInputBuffer( return; } /*--------------------------------------------------------------------------* * convertOutputBuffer() * Loading Loading @@ -672,6 +670,7 @@ static void convertOutputBuffer( return; } /*------------------------------------------------------------------------------------------* * main() * Loading Loading @@ -731,12 +730,20 @@ int main( bitsBuffer.config.isar_frame_size_ms = 20; bitsBuffer.config.lc3plusHighRes = 0; /*------------------------------------------------------------------------------------------* * Parse command-line arguments *------------------------------------------------------------------------------------------*/ CmdlnArgs args = parseCmdlnArgs( argc, argv ); convert_backslash( args.inputFilePath ); convert_backslash( args.outputFilePath ); convert_backslash( args.headRotationFilePath ); /*------------------------------------------------------------------------------------------* * Open head-rotation file *------------------------------------------------------------------------------------------*/ if ( !isEmptyString( args.headRotationFilePath ) ) { if ( RotationFileReader_open( args.headRotationFilePath, &headRotReader ) != IVAS_ERR_OK ) Loading @@ -746,6 +753,10 @@ int main( } } /*------------------------------------------------------------------------------------------* * Open BFI file *------------------------------------------------------------------------------------------*/ if ( !isEmptyString( args.splitRendBFIFilePath ) ) { convert_backslash( args.splitRendBFIFilePath ); Loading Loading @@ -844,6 +855,10 @@ int main( } } /*------------------------------------------------------------------------------------------* * Open ISAR handle *------------------------------------------------------------------------------------------*/ const int16_t frameSize_smpls = (int16_t) ( ( args.render_framesize ) * args.sampleRate * 5 / ( 1000 ) ); args.outConfig.audioConfig = IVAS_AUDIO_CONFIG_BINAURAL; if ( ( error = ISAR_POST_REND_open( &hIsarPostRend, args.sampleRate, args.outConfig.audioConfig, true, 0, 0, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK ) Loading @@ -852,7 +867,10 @@ int main( goto cleanup; } /* === Configure === */ /*------------------------------------------------------------------------------------------* * Configuration *------------------------------------------------------------------------------------------*/ if ( ( error = ISAR_POST_REND_InitConfig( hIsarPostRend, args.outConfig.audioConfig ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in Renderer Config Init: %s\n", ivas_error_to_string( error ) ); Loading Loading @@ -906,6 +924,10 @@ int main( goto cleanup; } /*------------------------------------------------------------------------------------------* * Allocate processing buffers *------------------------------------------------------------------------------------------*/ inBufferSize = frameSize_smpls * totalNumInChannels; outBufferSize = frameSize_smpls * numOutChannels; inpInt16Buffer = malloc( inBufferSize * sizeof( int16_t ) ); Loading Loading @@ -961,6 +983,13 @@ int main( fprintf( stdout, "\n\n-- Start the ISAR post renderer (quiet mode) --\n\n" ); } /*------------------------------------------------------------------------------------------* * Loop for every frame of data * - Read the input data * - Run the post-rendering * - Write the data into output file *------------------------------------------------------------------------------------------*/ while ( 1 ) { int16_t num_in_channels; Loading
apps/renderer.c +19 −32 Original line number Diff line number Diff line Loading @@ -715,6 +715,7 @@ static int16_t get_cldfb_in_flag( return cldfb_in_flag; } static int16_t is_split_pre_rend_mode( CmdlnArgs *args ) { Loading Loading @@ -1471,12 +1472,11 @@ int main( if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) { IVAS_REND_GetSplitRendBitstreamHeader( hIvasRend, &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection, &bitsBuffer.config.codec_frame_size_ms, &bitsBuffer.config.isar_frame_size_ms ); if ( ( error = IVAS_REND_GetSplitRendBitstreamHeader( hIvasRend, &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection, &bitsBuffer.config.codec_frame_size_ms, &bitsBuffer.config.isar_frame_size_ms ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_REND_GetSplitRendBitstreamHeader(): %s!\n", ivas_error_to_string( error ) ); goto cleanup; } if ( IVAS_REND_GetDelay_fx( hIvasRend, &delayNumSamples_temp, &delayTimeScale_temp ) != IVAS_ERR_OK ) { Loading @@ -1484,16 +1484,7 @@ int main( goto cleanup; } if ( ( error = split_rend_writer_open( &hSplitRendFileReadWrite, args.outputFilePath, delayNumSamples_temp, delayTimeScale_temp, bitsBuffer.config.codec, bitsBuffer.config.poseCorrection, bitsBuffer.config.codec_frame_size_ms, bitsBuffer.config.isar_frame_size_ms, args.sampleRate, bitsBuffer.config.lc3plus_highres ) ) != IVAS_ERR_OK ) if ( ( error = split_rend_writer_open( &hSplitRendFileReadWrite, args.outputFilePath, delayNumSamples_temp, delayTimeScale_temp, bitsBuffer.config.codec, bitsBuffer.config.poseCorrection, bitsBuffer.config.codec_frame_size_ms, bitsBuffer.config.isar_frame_size_ms, args.sampleRate, bitsBuffer.config.lc3plus_highres ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nCould not open split rend metadata file %s\n", args.outputFilePath ); goto cleanup; Loading @@ -1504,12 +1495,11 @@ int main( { if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { IVAS_REND_GetSplitRendBitstreamHeader( hIvasRend, &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection, &bitsBuffer.config.codec_frame_size_ms, &bitsBuffer.config.isar_frame_size_ms ); if ( ( error = IVAS_REND_GetSplitRendBitstreamHeader( hIvasRend, &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection, &bitsBuffer.config.codec_frame_size_ms, &bitsBuffer.config.isar_frame_size_ms ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_REND_GetSplitRendBitstreamHeader(): %s!\n", ivas_error_to_string( error ) ); goto cleanup; } if ( IVAS_REND_GetDelay_fx( hIvasRend, &delayNumSamples_temp, &delayTimeScale_temp ) != IVAS_ERR_OK ) { Loading @@ -1517,16 +1507,7 @@ int main( goto cleanup; } if ( ( error = split_rend_writer_open( &hSplitRendFileReadWrite, args.outMetadataFilePath, delayNumSamples_temp, delayTimeScale_temp, bitsBuffer.config.codec, bitsBuffer.config.poseCorrection, bitsBuffer.config.codec_frame_size_ms, bitsBuffer.config.isar_frame_size_ms, args.sampleRate, bitsBuffer.config.lc3plus_highres ) ) != IVAS_ERR_OK ) if ( ( error = split_rend_writer_open( &hSplitRendFileReadWrite, args.outMetadataFilePath, delayNumSamples_temp, delayTimeScale_temp, bitsBuffer.config.codec, bitsBuffer.config.poseCorrection, bitsBuffer.config.codec_frame_size_ms, bitsBuffer.config.isar_frame_size_ms, args.sampleRate, bitsBuffer.config.lc3plus_highres ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nCould not open split rend metadata file %s\n", args.outMetadataFilePath ); goto cleanup; Loading Loading @@ -3698,14 +3679,20 @@ static void parseCombinedFormatInput( inConfig->numAmbisonicsBuses = 1; inConfig->ambisonicsBuses[0].audioConfig = audioConfig; inConfig->ambisonicsBuses[0].inputChannelIndex = inConfig->numAudioObjects; #ifdef NONBE_1352_HARMONIZE_OSBA_LOUDNESS inConfig->ambisonicsBuses[0].gain_dB = 0.f; #else inConfig->ambisonicsBuses[0].gain_dB = -6.f; #endif *configString += 4; /* Modify input gain for objects too */ #ifndef NONBE_1352_HARMONIZE_OSBA_LOUDNESS for ( int16_t i = 0; i < inConfig->numAudioObjects; ++i ) { inConfig->audioObjects[i].gain_dB = -6.f; } #endif } else if ( audioConfig == IVAS_AUDIO_CONFIG_MASA1 || audioConfig == IVAS_AUDIO_CONFIG_MASA2 ) { Loading