Loading apps/decoder.c +53 −52 Original line number Diff line number Diff line Loading @@ -489,7 +489,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 @@ -671,8 +671,7 @@ int main( } #endif #ifdef SPLIT_REND_WITH_HEAD_ROT 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 @@ -722,6 +721,7 @@ int main( } renderConfig.roomAcoustics.override = true; } #ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS /* ISAR frame size is set from command line, not renderer config file. Loading Loading @@ -1477,7 +1477,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 @@ -1903,6 +1903,9 @@ static ivas_error initOnFirstGoodFrame( #endif ) { #ifdef SPLIT_REND_WITH_HEAD_ROT int16_t isSplitRend, isSplitCoded; #endif ivas_error error = IVAS_ERR_UNKNOWN; /* Now delay, number of output channels and frame size are known */ Loading @@ -1913,7 +1916,19 @@ static ivas_error initOnFirstGoodFrame( } #ifdef SPLIT_REND_WITH_HEAD_ROT 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 @@ -1940,7 +1955,7 @@ static ivas_error initOnFirstGoodFrame( } #ifdef SPLIT_REND_WITH_HEAD_ROT if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) ) if ( isSplitRend ) { /* Open split rendering metadata writer */ int16_t delayNumSamples_temp[3]; Loading @@ -1959,39 +1974,23 @@ static ivas_error initOnFirstGoodFrame( return error; } if ( ( error = IVAS_DEC_GetSplitRendBitstreamHeader( hIvasDec, &splitRendCodec, &poseCorrection, #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS &splitRendIsarFrameSizeMs, #endif &splitRendCodecFrameSizeMs #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS , &lc3plusHighRes if ( ( error = IVAS_DEC_GetSplitRendBitstreamHeader( hIvasDec, &splitRendCodec, &poseCorrection, &splitRendIsarFrameSizeMs, &splitRendCodecFrameSizeMs, &lc3plusHighRes ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_GetSplitRendBitstreamHeader( hIvasDec, &splitRendCodec, &poseCorrection, &splitRendCodecFrameSizeMs ) ) != IVAS_ERR_OK ) #endif ) ) != 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 #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS , splitRendIsarFrameSizeMs, arg.output_Fs, lc3plusHighRes 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 ) #else if ( ( error = split_rend_writer_open( splitRendWriter, arg.outputWavFilename, delayNumSamples_temp[0], delayTimeScale_temp, splitRendCodec, poseCorrection, splitRendCodecFrameSizeMs ) ) != IVAS_ERR_OK ) #endif ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nUnable to open output split rendering metadata file %s\n", arg.outputWavFilename ); return error; Loading @@ -2005,20 +2004,11 @@ 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 #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS , splitRendIsarFrameSizeMs, arg.output_Fs, lc3plusHighRes 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 ) #else if ( ( error = split_rend_writer_open( splitRendWriter, arg.outputMdFilename, delayNumSamples_temp[0], delayTimeScale_temp, splitRendCodec, poseCorrection, splitRendCodecFrameSizeMs ) ) != IVAS_ERR_OK ) #endif ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nUnable to open output split rendering metadata file %s\n", arg.outputWavFilename ); return error; Loading @@ -2026,7 +2016,7 @@ static ivas_error initOnFirstGoodFrame( } } if ( IVAS_DEC_is_split_rendering_coded_out( hIvasDec ) == 0 ) if ( !isSplitCoded ) { #endif /* Open audio writer and write all previously skipped bad frames now that frame size is known */ Loading Loading @@ -2264,6 +2254,19 @@ static ivas_error decodeG192( int16_t vec_pos_update, vec_pos_len; #ifdef SPLIT_REND_WITH_HEAD_ROT SplitFileReadWrite *splitRendWriter = NULL; int16_t isSplitRend, isSplitCoded; 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; } #endif #ifdef FIX_1053_REVERB_RECONFIGURATION Loading Loading @@ -2291,6 +2294,7 @@ static ivas_error decodeG192( } } #endif for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i ) { ismWriters[i] = NULL; Loading Loading @@ -2586,7 +2590,7 @@ static ivas_error decodeG192( } #ifdef SPLIT_REND_WITH_HEAD_ROT if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) ) if ( isSplitRend ) { if ( ( error = IVAS_DEC_GetSplitBinauralBitstream( hIvasDec, (void *) ( pcmBuf + nOutChannels * nSamplesRendered ), splitRendBits, &nSamplesRendered_loop, &needNewFrame ) ) != IVAS_ERR_OK ) { Loading @@ -2602,10 +2606,8 @@ static ivas_error decodeG192( #endif #ifdef SPLIT_REND_WITH_HEAD_ROT if ( ( error = IVAS_DEC_GetSamples( hIvasDec, nSamplesToRender, IVAS_DEC_PCM_INT16, (void *) ( pcmBuf + nOutChannels * nSamplesRendered ), &nSamplesRendered_loop, &needNewFrame ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_GetSamples( hIvasDec, nSamplesToRender, ( pcmBuf + nOutChannels * nSamplesRendered ), &nSamplesRendered_loop, &needNewFrame ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError in IVAS_DEC_GetSamples: %s\n", IVAS_DEC_GetErrorMessage( error ) ); Loading Loading @@ -2668,7 +2670,7 @@ static ivas_error decodeG192( if ( decodedGoodFrame ) { #ifdef SPLIT_REND_WITH_HEAD_ROT 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 @@ -2677,7 +2679,7 @@ static ivas_error decodeG192( } } if ( IVAS_DEC_is_split_rendering_coded_out( hIvasDec ) == 0 ) if ( !isSplitCoded ) { #endif if ( delayNumSamples < nOutSamples ) Loading Loading @@ -2950,6 +2952,7 @@ static ivas_error decodeG192( *------------------------------------------------------------------------------------------*/ memset( pcmBuf, 0, delayNumSamples_orig[0] * nOutChannels * sizeof( int16_t ) ); #ifdef SPLIT_REND_WITH_HEAD_ROT if ( afWriter != NULL ) { Loading Loading @@ -3360,12 +3363,11 @@ static ivas_error decodeVoIP( for ( i = 0; i < num_subframes; i++ ) { if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternions[i], Pos[i], i #ifdef SPLIT_REND_WITH_HEAD_ROT , DEFAULT_AXIS if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternions[i], Pos[i], i, DEFAULT_AXIS ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternions[i], Pos[i], i ) ) != IVAS_ERR_OK ) #endif ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_FeedHeadTrackData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; Loading Loading @@ -3452,7 +3454,6 @@ static ivas_error decodeVoIP( /* decode and get samples */ #ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SUPPORT_JBM_TRACEFILE if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, systemTime_ms, writeJbmTraceFileFrameWrapper, jbmTraceWriter ) ) != IVAS_ERR_OK ) Loading apps/isar_post_rend.c +46 −10 Original line number Diff line number Diff line Loading @@ -229,6 +229,7 @@ static IVAS_AUDIO_CONFIG parseAudioConfig( const char *configString ); static void convertOutputBuffer( const float *floatBuffer, const int16_t numSamplesPerChannel, const int16_t numChannels, int16_t *intBuffer ); /*------------------------------------------------------------------------------------------* * Local functions *------------------------------------------------------------------------------------------*/ Loading Loading @@ -275,10 +276,6 @@ static int16_t getTotalNumInChannels( return totalNumInChannels; } /*------------------------------------------------------------------------------------------* * Local functions *------------------------------------------------------------------------------------------*/ static const CmdLnParser_Option *findOptionById( const int32_t id ) { Loading Loading @@ -440,6 +437,7 @@ static bool checkRequiredArgs( return !missingRequiredArg; } static CmdlnArgs defaultArgs( const char *executableName ) { Loading Loading @@ -470,6 +468,7 @@ static CmdlnArgs defaultArgs( return args; } static void parseOption( const int32_t optionId, char **optionValues, Loading Loading @@ -562,6 +561,7 @@ static void parseOption( return; } static CmdlnArgs parseCmdlnArgs( const int argc, char **argv ) Loading Loading @@ -600,6 +600,7 @@ static void printSupportedAudioConfigs( void ) return; } /*--------------------------------------------------------------------------* * convertInputBuffer() * Loading Loading @@ -638,6 +639,7 @@ static void convertInputBuffer( return; } /*--------------------------------------------------------------------------* * convertOutputBuffer() * Loading Loading @@ -679,6 +681,7 @@ static void convertOutputBuffer( return; } /*------------------------------------------------------------------------------------------* * main() * Loading Loading @@ -738,6 +741,9 @@ int main( bitsBuffer.config.codec_frame_size_ms = 20; #endif /*------------------------------------------------------------------------------------------* * Parse command-line arguments *------------------------------------------------------------------------------------------*/ CmdlnArgs args = parseCmdlnArgs( argc, argv ); Loading @@ -745,6 +751,10 @@ int main( 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 @@ -754,12 +764,20 @@ int main( } } /*------------------------------------------------------------------------------------------* * Open BFI file *------------------------------------------------------------------------------------------*/ if ( !isEmptyString( args.splitRendBFIFilePath ) ) { convert_backslash( args.splitRendBFIFilePath ); SplitRendBFIFileReader_open( args.splitRendBFIFilePath, &splitRendBFIReader ); } /*------------------------------------------------------------------------------------------* * Open input files *------------------------------------------------------------------------------------------*/ #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS int32_t inFileSampleRate = 0; #endif Loading Loading @@ -867,6 +885,11 @@ int main( exit( -1 ); } } /*------------------------------------------------------------------------------------------* * 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.0, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK ) Loading @@ -875,7 +898,10 @@ int main( exit( -1 ); } /* === Configure === */ /*------------------------------------------------------------------------------------------* * Configuration *------------------------------------------------------------------------------------------*/ if ( ( error = ISAR_POST_REND_InitConfig( hIsarPostRend, args.outConfig.audioConfig ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error in Renderer Config Init: %s\n", ivas_error_to_string( error ) ); Loading @@ -900,9 +926,7 @@ int main( } } ISAR_POST_REND_InputId splitBinIds[RENDERER_MAX_BIN_INPUTS]; for ( i = 0; i < RENDERER_MAX_BIN_INPUTS; i++ ) { splitBinIds[i] = 0u; Loading @@ -918,7 +942,6 @@ int main( } const int16_t totalNumInChannels = getTotalNumInChannels( hIsarPostRend, splitBinIds ); if ( inFileNumChannels != 0 /* inFileNumChannels is 0 with raw PCM input */ && totalNumInChannels != inFileNumChannels ) { fprintf( stderr, "Number of channels in input file does not match selected configuration\n" ); Loading @@ -926,13 +949,16 @@ int main( } int16_t numOutChannels = 2; if ( AudioFileWriter_open( &audioWriter, args.outputFilePath, args.sampleRate, numOutChannels ) != IVAS_ERR_OK ) { fprintf( stderr, "Failed to open file: %s\n", args.outputFilePath ); exit( -1 ); } /*------------------------------------------------------------------------------------------* * Allocate processing buffers *------------------------------------------------------------------------------------------*/ inBufferSize = frameSize_smpls * totalNumInChannels; outBufferSize = frameSize_smpls * numOutChannels; inpInt16Buffer = malloc( inBufferSize * sizeof( int16_t ) ); Loading Loading @@ -985,6 +1011,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 Loading @@ -1215,7 +1248,10 @@ int main( } #endif /* === Close === */ /*------------------------------------------------------------------------------------------* * Close files and deallocate resources *------------------------------------------------------------------------------------------*/ free( inpInt16Buffer ); free( inFloatBuffer ); free( outInt16Buffer ); Loading apps/renderer.c +26 −44 File changed.Preview size limit exceeded, changes collapsed. Show changes lib_com/common_api_types.h +2 −1 Original line number Diff line number Diff line Loading @@ -277,7 +277,7 @@ typedef struct _ISAR_SPLIT_REND_CONFIG 2 - (2dof correction. By default YAW and PITCH correction) 3 - (3dof correction. By default YAW, PITCH and ROLL correction) */ int16_t codec_delay_ms; /*PLACEHOLDER (currently being ignored) : look ahead delay of the codec that is used to code BIN signal output of pre-renderer*/ int16_t codec_delay_ms; /* look ahead delay of the codec that is used to code BIN signal output of pre-renderer*/ #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS int16_t isar_frame_size_ms; /* ISAR bit stream frame size in milliseconds */ #endif Loading Loading @@ -348,6 +348,7 @@ typedef struct #ifdef SPLIT_REND_WITH_HEAD_ROT int16_t is_cldfb; #endif } IVAS_REND_AudioBufferConfig; typedef struct Loading lib_com/delay_comp.c +3 −3 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ int32_t get_delay( const IVAS_FORMAT ivas_format, /* i : IVAS format */ #ifdef SPLIT_REND_WITH_HEAD_ROT HANDLE_CLDFB_FILTER_BANK hCldfb, /* i : Handle of Cldfb analysis */ const AUDIO_CONFIG output_config /* i : decoder output config */ const int16_t flag_binaural_split_coded /* i : split rendering on/off flag */ #else HANDLE_CLDFB_FILTER_BANK hCldfb /* i : Handle of Cldfb analysis */ #endif Loading Loading @@ -103,7 +103,7 @@ int32_t get_delay( delay = IVAS_DEC_DELAY_NS; #ifdef SPLIT_REND_WITH_HEAD_ROT if ( output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) if ( !flag_binaural_split_coded ) { #endif if ( hCldfb != NULL ) Loading Loading
apps/decoder.c +53 −52 Original line number Diff line number Diff line Loading @@ -489,7 +489,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 @@ -671,8 +671,7 @@ int main( } #endif #ifdef SPLIT_REND_WITH_HEAD_ROT 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 @@ -722,6 +721,7 @@ int main( } renderConfig.roomAcoustics.override = true; } #ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS /* ISAR frame size is set from command line, not renderer config file. Loading Loading @@ -1477,7 +1477,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 @@ -1903,6 +1903,9 @@ static ivas_error initOnFirstGoodFrame( #endif ) { #ifdef SPLIT_REND_WITH_HEAD_ROT int16_t isSplitRend, isSplitCoded; #endif ivas_error error = IVAS_ERR_UNKNOWN; /* Now delay, number of output channels and frame size are known */ Loading @@ -1913,7 +1916,19 @@ static ivas_error initOnFirstGoodFrame( } #ifdef SPLIT_REND_WITH_HEAD_ROT 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 @@ -1940,7 +1955,7 @@ static ivas_error initOnFirstGoodFrame( } #ifdef SPLIT_REND_WITH_HEAD_ROT if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) ) if ( isSplitRend ) { /* Open split rendering metadata writer */ int16_t delayNumSamples_temp[3]; Loading @@ -1959,39 +1974,23 @@ static ivas_error initOnFirstGoodFrame( return error; } if ( ( error = IVAS_DEC_GetSplitRendBitstreamHeader( hIvasDec, &splitRendCodec, &poseCorrection, #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS &splitRendIsarFrameSizeMs, #endif &splitRendCodecFrameSizeMs #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS , &lc3plusHighRes if ( ( error = IVAS_DEC_GetSplitRendBitstreamHeader( hIvasDec, &splitRendCodec, &poseCorrection, &splitRendIsarFrameSizeMs, &splitRendCodecFrameSizeMs, &lc3plusHighRes ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_GetSplitRendBitstreamHeader( hIvasDec, &splitRendCodec, &poseCorrection, &splitRendCodecFrameSizeMs ) ) != IVAS_ERR_OK ) #endif ) ) != 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 #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS , splitRendIsarFrameSizeMs, arg.output_Fs, lc3plusHighRes 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 ) #else if ( ( error = split_rend_writer_open( splitRendWriter, arg.outputWavFilename, delayNumSamples_temp[0], delayTimeScale_temp, splitRendCodec, poseCorrection, splitRendCodecFrameSizeMs ) ) != IVAS_ERR_OK ) #endif ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nUnable to open output split rendering metadata file %s\n", arg.outputWavFilename ); return error; Loading @@ -2005,20 +2004,11 @@ 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 #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS , splitRendIsarFrameSizeMs, arg.output_Fs, lc3plusHighRes 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 ) #else if ( ( error = split_rend_writer_open( splitRendWriter, arg.outputMdFilename, delayNumSamples_temp[0], delayTimeScale_temp, splitRendCodec, poseCorrection, splitRendCodecFrameSizeMs ) ) != IVAS_ERR_OK ) #endif ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nUnable to open output split rendering metadata file %s\n", arg.outputWavFilename ); return error; Loading @@ -2026,7 +2016,7 @@ static ivas_error initOnFirstGoodFrame( } } if ( IVAS_DEC_is_split_rendering_coded_out( hIvasDec ) == 0 ) if ( !isSplitCoded ) { #endif /* Open audio writer and write all previously skipped bad frames now that frame size is known */ Loading Loading @@ -2264,6 +2254,19 @@ static ivas_error decodeG192( int16_t vec_pos_update, vec_pos_len; #ifdef SPLIT_REND_WITH_HEAD_ROT SplitFileReadWrite *splitRendWriter = NULL; int16_t isSplitRend, isSplitCoded; 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; } #endif #ifdef FIX_1053_REVERB_RECONFIGURATION Loading Loading @@ -2291,6 +2294,7 @@ static ivas_error decodeG192( } } #endif for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i ) { ismWriters[i] = NULL; Loading Loading @@ -2586,7 +2590,7 @@ static ivas_error decodeG192( } #ifdef SPLIT_REND_WITH_HEAD_ROT if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) ) if ( isSplitRend ) { if ( ( error = IVAS_DEC_GetSplitBinauralBitstream( hIvasDec, (void *) ( pcmBuf + nOutChannels * nSamplesRendered ), splitRendBits, &nSamplesRendered_loop, &needNewFrame ) ) != IVAS_ERR_OK ) { Loading @@ -2602,10 +2606,8 @@ static ivas_error decodeG192( #endif #ifdef SPLIT_REND_WITH_HEAD_ROT if ( ( error = IVAS_DEC_GetSamples( hIvasDec, nSamplesToRender, IVAS_DEC_PCM_INT16, (void *) ( pcmBuf + nOutChannels * nSamplesRendered ), &nSamplesRendered_loop, &needNewFrame ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_GetSamples( hIvasDec, nSamplesToRender, ( pcmBuf + nOutChannels * nSamplesRendered ), &nSamplesRendered_loop, &needNewFrame ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError in IVAS_DEC_GetSamples: %s\n", IVAS_DEC_GetErrorMessage( error ) ); Loading Loading @@ -2668,7 +2670,7 @@ static ivas_error decodeG192( if ( decodedGoodFrame ) { #ifdef SPLIT_REND_WITH_HEAD_ROT 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 @@ -2677,7 +2679,7 @@ static ivas_error decodeG192( } } if ( IVAS_DEC_is_split_rendering_coded_out( hIvasDec ) == 0 ) if ( !isSplitCoded ) { #endif if ( delayNumSamples < nOutSamples ) Loading Loading @@ -2950,6 +2952,7 @@ static ivas_error decodeG192( *------------------------------------------------------------------------------------------*/ memset( pcmBuf, 0, delayNumSamples_orig[0] * nOutChannels * sizeof( int16_t ) ); #ifdef SPLIT_REND_WITH_HEAD_ROT if ( afWriter != NULL ) { Loading Loading @@ -3360,12 +3363,11 @@ static ivas_error decodeVoIP( for ( i = 0; i < num_subframes; i++ ) { if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternions[i], Pos[i], i #ifdef SPLIT_REND_WITH_HEAD_ROT , DEFAULT_AXIS if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternions[i], Pos[i], i, DEFAULT_AXIS ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternions[i], Pos[i], i ) ) != IVAS_ERR_OK ) #endif ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_FeedHeadTrackData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; Loading Loading @@ -3452,7 +3454,6 @@ static ivas_error decodeVoIP( /* decode and get samples */ #ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SUPPORT_JBM_TRACEFILE if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, systemTime_ms, writeJbmTraceFileFrameWrapper, jbmTraceWriter ) ) != IVAS_ERR_OK ) Loading
apps/isar_post_rend.c +46 −10 Original line number Diff line number Diff line Loading @@ -229,6 +229,7 @@ static IVAS_AUDIO_CONFIG parseAudioConfig( const char *configString ); static void convertOutputBuffer( const float *floatBuffer, const int16_t numSamplesPerChannel, const int16_t numChannels, int16_t *intBuffer ); /*------------------------------------------------------------------------------------------* * Local functions *------------------------------------------------------------------------------------------*/ Loading Loading @@ -275,10 +276,6 @@ static int16_t getTotalNumInChannels( return totalNumInChannels; } /*------------------------------------------------------------------------------------------* * Local functions *------------------------------------------------------------------------------------------*/ static const CmdLnParser_Option *findOptionById( const int32_t id ) { Loading Loading @@ -440,6 +437,7 @@ static bool checkRequiredArgs( return !missingRequiredArg; } static CmdlnArgs defaultArgs( const char *executableName ) { Loading Loading @@ -470,6 +468,7 @@ static CmdlnArgs defaultArgs( return args; } static void parseOption( const int32_t optionId, char **optionValues, Loading Loading @@ -562,6 +561,7 @@ static void parseOption( return; } static CmdlnArgs parseCmdlnArgs( const int argc, char **argv ) Loading Loading @@ -600,6 +600,7 @@ static void printSupportedAudioConfigs( void ) return; } /*--------------------------------------------------------------------------* * convertInputBuffer() * Loading Loading @@ -638,6 +639,7 @@ static void convertInputBuffer( return; } /*--------------------------------------------------------------------------* * convertOutputBuffer() * Loading Loading @@ -679,6 +681,7 @@ static void convertOutputBuffer( return; } /*------------------------------------------------------------------------------------------* * main() * Loading Loading @@ -738,6 +741,9 @@ int main( bitsBuffer.config.codec_frame_size_ms = 20; #endif /*------------------------------------------------------------------------------------------* * Parse command-line arguments *------------------------------------------------------------------------------------------*/ CmdlnArgs args = parseCmdlnArgs( argc, argv ); Loading @@ -745,6 +751,10 @@ int main( 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 @@ -754,12 +764,20 @@ int main( } } /*------------------------------------------------------------------------------------------* * Open BFI file *------------------------------------------------------------------------------------------*/ if ( !isEmptyString( args.splitRendBFIFilePath ) ) { convert_backslash( args.splitRendBFIFilePath ); SplitRendBFIFileReader_open( args.splitRendBFIFilePath, &splitRendBFIReader ); } /*------------------------------------------------------------------------------------------* * Open input files *------------------------------------------------------------------------------------------*/ #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS int32_t inFileSampleRate = 0; #endif Loading Loading @@ -867,6 +885,11 @@ int main( exit( -1 ); } } /*------------------------------------------------------------------------------------------* * 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.0, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK ) Loading @@ -875,7 +898,10 @@ int main( exit( -1 ); } /* === Configure === */ /*------------------------------------------------------------------------------------------* * Configuration *------------------------------------------------------------------------------------------*/ if ( ( error = ISAR_POST_REND_InitConfig( hIsarPostRend, args.outConfig.audioConfig ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error in Renderer Config Init: %s\n", ivas_error_to_string( error ) ); Loading @@ -900,9 +926,7 @@ int main( } } ISAR_POST_REND_InputId splitBinIds[RENDERER_MAX_BIN_INPUTS]; for ( i = 0; i < RENDERER_MAX_BIN_INPUTS; i++ ) { splitBinIds[i] = 0u; Loading @@ -918,7 +942,6 @@ int main( } const int16_t totalNumInChannels = getTotalNumInChannels( hIsarPostRend, splitBinIds ); if ( inFileNumChannels != 0 /* inFileNumChannels is 0 with raw PCM input */ && totalNumInChannels != inFileNumChannels ) { fprintf( stderr, "Number of channels in input file does not match selected configuration\n" ); Loading @@ -926,13 +949,16 @@ int main( } int16_t numOutChannels = 2; if ( AudioFileWriter_open( &audioWriter, args.outputFilePath, args.sampleRate, numOutChannels ) != IVAS_ERR_OK ) { fprintf( stderr, "Failed to open file: %s\n", args.outputFilePath ); exit( -1 ); } /*------------------------------------------------------------------------------------------* * Allocate processing buffers *------------------------------------------------------------------------------------------*/ inBufferSize = frameSize_smpls * totalNumInChannels; outBufferSize = frameSize_smpls * numOutChannels; inpInt16Buffer = malloc( inBufferSize * sizeof( int16_t ) ); Loading Loading @@ -985,6 +1011,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 Loading @@ -1215,7 +1248,10 @@ int main( } #endif /* === Close === */ /*------------------------------------------------------------------------------------------* * Close files and deallocate resources *------------------------------------------------------------------------------------------*/ free( inpInt16Buffer ); free( inFloatBuffer ); free( outInt16Buffer ); Loading
lib_com/common_api_types.h +2 −1 Original line number Diff line number Diff line Loading @@ -277,7 +277,7 @@ typedef struct _ISAR_SPLIT_REND_CONFIG 2 - (2dof correction. By default YAW and PITCH correction) 3 - (3dof correction. By default YAW, PITCH and ROLL correction) */ int16_t codec_delay_ms; /*PLACEHOLDER (currently being ignored) : look ahead delay of the codec that is used to code BIN signal output of pre-renderer*/ int16_t codec_delay_ms; /* look ahead delay of the codec that is used to code BIN signal output of pre-renderer*/ #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS int16_t isar_frame_size_ms; /* ISAR bit stream frame size in milliseconds */ #endif Loading Loading @@ -348,6 +348,7 @@ typedef struct #ifdef SPLIT_REND_WITH_HEAD_ROT int16_t is_cldfb; #endif } IVAS_REND_AudioBufferConfig; typedef struct Loading
lib_com/delay_comp.c +3 −3 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ int32_t get_delay( const IVAS_FORMAT ivas_format, /* i : IVAS format */ #ifdef SPLIT_REND_WITH_HEAD_ROT HANDLE_CLDFB_FILTER_BANK hCldfb, /* i : Handle of Cldfb analysis */ const AUDIO_CONFIG output_config /* i : decoder output config */ const int16_t flag_binaural_split_coded /* i : split rendering on/off flag */ #else HANDLE_CLDFB_FILTER_BANK hCldfb /* i : Handle of Cldfb analysis */ #endif Loading Loading @@ -103,7 +103,7 @@ int32_t get_delay( delay = IVAS_DEC_DELAY_NS; #ifdef SPLIT_REND_WITH_HEAD_ROT if ( output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) if ( !flag_binaural_split_coded ) { #endif if ( hCldfb != NULL ) Loading