Loading .gitlab-ci.yml +23 −1 Original line number Diff line number Diff line Loading @@ -550,7 +550,7 @@ renderer-smoke-test: - .rules-merge-request-to-main needs: ["build-codec-linux-cmake"] stage: test timeout: "1 hour" timeout: "90 minutes" artifacts: name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results" expire_in: 1 week Loading Loading @@ -681,6 +681,28 @@ split-rendering-smoke-test: junit: - report-junit.xml # test split rendering in VoIP mode against BINAURAL output split-rendering-voip-be-to-binaural: extends: - .test-job-linux - .rules-merge-request-to-main needs: ["build-codec-linux-make"] stage: test script: - make -j - testcase_timeout=30 - python3 -m pytest -q -n auto -rA --junit-xml=report-junit.xml tests/split_rendering/test_voip_be_splitrend_vs_binaural.py --testcase_timeout=$testcase_timeout artifacts: name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results" expire_in: 1 week when: always paths: - report-junit.xml expose_as: "VoIP split rendering vs BINAURAL make pytest results" reports: junit: - report-junit.xml lc3-wrapper-unit-test: extends: - .test-job-linux Loading Workspace_msvc/lib_rend.vcxproj +1 −0 Original line number Diff line number Diff line Loading @@ -138,6 +138,7 @@ </Lib> </ItemDefinitionGroup> <ItemGroup> <ClCompile Include="..\lib_rend\ivas_cldfb_ring_buffer.c" /> <ClCompile Include="..\lib_rend\ivas_dirac_decorr_dec.c" /> <ClCompile Include="..\lib_rend\ivas_dirac_dec_binaural_functions.c" /> <ClCompile Include="..\lib_rend\ivas_dirac_onsets_dec.c" /> Loading Workspace_msvc/lib_rend.vcxproj.filters +3 −0 Original line number Diff line number Diff line Loading @@ -119,6 +119,9 @@ <ClCompile Include="..\lib_rend\ivas_td_ring_buffer.c"> <Filter>rend_c</Filter> </ClCompile> <ClCompile Include="..\lib_rend\ivas_cldfb_ring_buffer.c"> <Filter>rend_c</Filter> </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\lib_rend\lib_rend.h" /> Loading apps/decoder.c +124 −13 Original line number Diff line number Diff line Loading @@ -171,7 +171,11 @@ 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 *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); #ifdef FIX_1119_SPLIT_RENDERING_VOIP static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); #else static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); #endif static ivas_error load_hrtf_from_file( IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, IVAS_DEC_HANDLE hIvasDec, const IVAS_AUDIO_CONFIG OutputConfig, const int32_t output_Fs ); #ifdef DEBUGGING static ivas_error printBitstreamInfoVoip( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HANDLE hIvasDec ); Loading Loading @@ -752,7 +756,11 @@ int main( if ( arg.voipMode ) { #ifdef FIX_1119_SPLIT_RENDERING_VOIP error = decodeVoIP( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, objectEditFileReader, &splitRendBits, hIvasDec, pcmBuf ); #else error = decodeVoIP( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, objectEditFileReader, hIvasDec, pcmBuf ); #endif } else { Loading Loading @@ -1881,7 +1889,11 @@ static ivas_error initOnFirstGoodFrame( for ( int16_t i = 0; i < numInitialBadFrames; ++i ) { #ifdef FIX_1119_SPLIT_RENDERING_VOIP if ( isSplitRend ) #else if ( *splitRendWriter != NULL ) #endif { ISAR_SPLIT_REND_BITS_DATA splitRendBitsZero; splitRendBitsZero.bits_buf = NULL; Loading @@ -1899,7 +1911,12 @@ static ivas_error initOnFirstGoodFrame( return error; } } #ifdef FIX_1119_SPLIT_RENDERING_VOIP if ( !isSplitCoded ) #else else #endif { if ( *pRemainingDelayNumSamples < *numOutSamples ) { Loading Loading @@ -2106,6 +2123,14 @@ static ivas_error decodeG192( return error; } #ifdef FIX_1119_SPLIT_RENDERING_VOIP if ( !isSplitRend ) { /* Ensure split rendering output struct is not used when not outputting to a split rendering output configuration */ splitRendBits = NULL; } #endif 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 ); Loading Loading @@ -2441,7 +2466,11 @@ static ivas_error decodeG192( } /* decode transport channels, do TSM and feed to renderer */ #ifdef FIX_1119_SPLIT_RENDERING_VOIP if ( ( error = IVAS_DEC_GetSamplesDecoder( hIvasDec, splitRendBits ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_GetSamplesDecoder( hIvasDec, isSplitRend, splitRendBits ) ) != IVAS_ERR_OK ) #endif { return error; } Loading Loading @@ -2992,6 +3021,9 @@ static ivas_error decodeVoIP( RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, #ifdef FIX_1119_SPLIT_RENDERING_VOIP ISAR_SPLIT_REND_BITS_DATA *splitRendBits, #endif IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ) { Loading Loading @@ -3043,6 +3075,29 @@ static ivas_error decodeVoIP( bool parametersAvailableForEditing = false; uint16_t nSamplesRendered = 0; #ifdef FIX_1119_SPLIT_RENDERING_VOIP 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 ( !isSplitRend ) { /* Ensure split rendering output struct is not used when not outputting to a split rendering format */ splitRendBits = NULL; } 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 vec_pos_update = 0; if ( ( error = IVAS_DEC_GetRenderFramesizeMs( hIvasDec, &systemTimeInc_ms ) ) != IVAS_ERR_OK ) { Loading Loading @@ -3333,6 +3388,22 @@ static ivas_error decodeVoIP( /* decode and get samples */ while ( nSamplesRendered < nOutSamples ) { #ifdef FIX_1119_SPLIT_RENDERING_VOIP if ( isSplitRend ) { #ifdef SUPPORT_JBM_TRACEFILE if ( ( error = IVAS_DEC_VoIP_GetSplitBinauralBitstream( hIvasDec, (void *) pcmBuf, splitRendBits, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &bitstreamReadDone, &nSamplesRendered, ¶metersAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_VoIP_GetSplitBinauralBitstream( hIvasDec, (void *) pcmBuf, splitRendBits, &bitstreamReadDone, &nSamplesRendered, ¶metersAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError in IVAS_DEC_VoIP_GetSplitBinauralBitstream: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } } else { #endif #ifdef SUPPORT_JBM_TRACEFILE if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &bitstreamReadDone, &nSamplesRendered, ¶metersAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK ) #else Loading @@ -3342,6 +3413,9 @@ static ivas_error decodeVoIP( fprintf( stderr, "\nError in IVAS_DEC_VoIP_GetSamples: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #ifdef FIX_1119_SPLIT_RENDERING_VOIP } #endif if ( bitstreamReadDone == true ) { Loading Loading @@ -3421,9 +3495,15 @@ static ivas_error decodeVoIP( /* Once good frame decoded, catch up */ if ( decodedGoodFrame ) { #ifndef FIX_1119_SPLIT_RENDERING_VOIP SplitFileReadWrite *splitRendWriter = NULL; #endif #ifdef FIX_1119_SPLIT_RENDERING_VOIP if ( ( error = initOnFirstGoodFrame( hIvasDec, arg, numInitialBadFrames, &nOutSamples, &vec_pos_len, delayNumSamples_orig, &delayNumSamples, &delayTimeScale, #else if ( ( error = initOnFirstGoodFrame( hIvasDec, arg, numInitialBadFrames, &nOutSamples, NULL, delayNumSamples_orig, &delayNumSamples, &delayTimeScale, #endif &bsFormat, &afWriter, &masaWriter, ismWriters, &nOutChannels, &numObj, &splitRendWriter ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error in initOnFirstGoodFrame(): %s\n", IVAS_DEC_GetErrorMessage( error ) ); Loading @@ -3439,6 +3519,19 @@ static ivas_error decodeVoIP( /* Write current frame */ if ( decodedGoodFrame ) { #ifdef FIX_1119_SPLIT_RENDERING_VOIP if ( isSplitRend ) { if ( split_rend_write_bitstream_to_file( splitRendWriter, splitRendBits->bits_buf, &splitRendBits->bits_read, &splitRendBits->bits_written ) != IVAS_ERR_OK ) { fprintf( stderr, "\nUnable to write to bitstream file!\n" ); goto cleanup; } } if ( !isSplitCoded ) { #endif if ( delayNumSamples < nOutSamples ) { if ( ( error = AudioFileWriter_write( afWriter, &pcmBuf[delayNumSamples * nOutChannels], nOutSamples * nOutChannels - ( delayNumSamples * nOutChannels ) ) ) != IVAS_ERR_OK ) Loading @@ -3452,6 +3545,9 @@ static ivas_error decodeVoIP( { delayNumSamples -= nOutSamples; } #ifdef FIX_1119_SPLIT_RENDERING_VOIP } #endif /* Write ISM metadata to external file(s) */ if ( decodedGoodFrame && arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL ) Loading Loading @@ -3540,7 +3636,11 @@ static ivas_error decodeVoIP( goto cleanup; } #ifdef FIX_1119_SPLIT_RENDERING_VOIP if ( nSamplesFlushed && !isSplitCoded ) #else if ( nSamplesFlushed ) #endif { /* Write current frame */ if ( ( error = AudioFileWriter_write( afWriter, pcmBuf, nSamplesFlushed * nOutChannels ) ) != IVAS_ERR_OK ) Loading Loading @@ -3610,11 +3710,19 @@ static ivas_error decodeVoIP( *------------------------------------------------------------------------------------------*/ memset( pcmBuf, 0, delayNumSamples_orig[0] * nOutChannels * sizeof( int16_t ) ); #ifdef FIX_1119_SPLIT_RENDERING_VOIP if ( afWriter != NULL ) { #endif if ( ( error = AudioFileWriter_write( afWriter, pcmBuf, delayNumSamples_orig[0] * nOutChannels ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError writing output file: %s\n", ivas_error_to_string( error ) ); goto cleanup; } #ifdef FIX_1119_SPLIT_RENDERING_VOIP } #endif /*------------------------------------------------------------------------------------------* * Printouts after decoding has finished Loading Loading @@ -3659,6 +3767,9 @@ cleanup: EVS_RTPDUMP_DEPACKER_close( &rtpdumpDepacker ); AudioFileWriter_close( &afWriter ); #ifdef FIX_1119_SPLIT_RENDERING_VOIP split_rend_reader_writer_close( &splitRendWriter ); #endif JbmOffsetFileWriter_close( &jbmOffsetWriter ); #ifdef SUPPORT_JBM_TRACEFILE JbmTraceFileWriter_close( &jbmTraceWriter ); Loading apps/isar_post_rend.c +13 −0 Original line number Diff line number Diff line Loading @@ -1104,6 +1104,19 @@ int main( fprintf( stderr, "\nISAR_POST_REND_FeedSplitBinauralBitstream failed: %s\n", ivas_error_to_string( error ) ); goto cleanup; } #ifdef FIX_1119_SPLIT_RENDERING_VOIP /* Set BFI if frame is empty */ int16_t frameEmpty = (int16_t) ( bitsBuffer.config.bitsWritten == 0 ); if ( frameEmpty ) { if ( ( error = ISAR_POST_REND_SetSplitRendBFI( hIsarPostRend, 1 ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error in ISAR_POST_REND_SetSplitRendBFI(): %s\n", ivas_error_to_string( error ) ); goto cleanup; } } #endif } } Loading Loading
.gitlab-ci.yml +23 −1 Original line number Diff line number Diff line Loading @@ -550,7 +550,7 @@ renderer-smoke-test: - .rules-merge-request-to-main needs: ["build-codec-linux-cmake"] stage: test timeout: "1 hour" timeout: "90 minutes" artifacts: name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results" expire_in: 1 week Loading Loading @@ -681,6 +681,28 @@ split-rendering-smoke-test: junit: - report-junit.xml # test split rendering in VoIP mode against BINAURAL output split-rendering-voip-be-to-binaural: extends: - .test-job-linux - .rules-merge-request-to-main needs: ["build-codec-linux-make"] stage: test script: - make -j - testcase_timeout=30 - python3 -m pytest -q -n auto -rA --junit-xml=report-junit.xml tests/split_rendering/test_voip_be_splitrend_vs_binaural.py --testcase_timeout=$testcase_timeout artifacts: name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results" expire_in: 1 week when: always paths: - report-junit.xml expose_as: "VoIP split rendering vs BINAURAL make pytest results" reports: junit: - report-junit.xml lc3-wrapper-unit-test: extends: - .test-job-linux Loading
Workspace_msvc/lib_rend.vcxproj +1 −0 Original line number Diff line number Diff line Loading @@ -138,6 +138,7 @@ </Lib> </ItemDefinitionGroup> <ItemGroup> <ClCompile Include="..\lib_rend\ivas_cldfb_ring_buffer.c" /> <ClCompile Include="..\lib_rend\ivas_dirac_decorr_dec.c" /> <ClCompile Include="..\lib_rend\ivas_dirac_dec_binaural_functions.c" /> <ClCompile Include="..\lib_rend\ivas_dirac_onsets_dec.c" /> Loading
Workspace_msvc/lib_rend.vcxproj.filters +3 −0 Original line number Diff line number Diff line Loading @@ -119,6 +119,9 @@ <ClCompile Include="..\lib_rend\ivas_td_ring_buffer.c"> <Filter>rend_c</Filter> </ClCompile> <ClCompile Include="..\lib_rend\ivas_cldfb_ring_buffer.c"> <Filter>rend_c</Filter> </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\lib_rend\lib_rend.h" /> Loading
apps/decoder.c +124 −13 Original line number Diff line number Diff line Loading @@ -171,7 +171,11 @@ 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 *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); #ifdef FIX_1119_SPLIT_RENDERING_VOIP static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); #else static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); #endif static ivas_error load_hrtf_from_file( IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, IVAS_DEC_HANDLE hIvasDec, const IVAS_AUDIO_CONFIG OutputConfig, const int32_t output_Fs ); #ifdef DEBUGGING static ivas_error printBitstreamInfoVoip( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HANDLE hIvasDec ); Loading Loading @@ -752,7 +756,11 @@ int main( if ( arg.voipMode ) { #ifdef FIX_1119_SPLIT_RENDERING_VOIP error = decodeVoIP( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, objectEditFileReader, &splitRendBits, hIvasDec, pcmBuf ); #else error = decodeVoIP( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, objectEditFileReader, hIvasDec, pcmBuf ); #endif } else { Loading Loading @@ -1881,7 +1889,11 @@ static ivas_error initOnFirstGoodFrame( for ( int16_t i = 0; i < numInitialBadFrames; ++i ) { #ifdef FIX_1119_SPLIT_RENDERING_VOIP if ( isSplitRend ) #else if ( *splitRendWriter != NULL ) #endif { ISAR_SPLIT_REND_BITS_DATA splitRendBitsZero; splitRendBitsZero.bits_buf = NULL; Loading @@ -1899,7 +1911,12 @@ static ivas_error initOnFirstGoodFrame( return error; } } #ifdef FIX_1119_SPLIT_RENDERING_VOIP if ( !isSplitCoded ) #else else #endif { if ( *pRemainingDelayNumSamples < *numOutSamples ) { Loading Loading @@ -2106,6 +2123,14 @@ static ivas_error decodeG192( return error; } #ifdef FIX_1119_SPLIT_RENDERING_VOIP if ( !isSplitRend ) { /* Ensure split rendering output struct is not used when not outputting to a split rendering output configuration */ splitRendBits = NULL; } #endif 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 ); Loading Loading @@ -2441,7 +2466,11 @@ static ivas_error decodeG192( } /* decode transport channels, do TSM and feed to renderer */ #ifdef FIX_1119_SPLIT_RENDERING_VOIP if ( ( error = IVAS_DEC_GetSamplesDecoder( hIvasDec, splitRendBits ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_GetSamplesDecoder( hIvasDec, isSplitRend, splitRendBits ) ) != IVAS_ERR_OK ) #endif { return error; } Loading Loading @@ -2992,6 +3021,9 @@ static ivas_error decodeVoIP( RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, #ifdef FIX_1119_SPLIT_RENDERING_VOIP ISAR_SPLIT_REND_BITS_DATA *splitRendBits, #endif IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ) { Loading Loading @@ -3043,6 +3075,29 @@ static ivas_error decodeVoIP( bool parametersAvailableForEditing = false; uint16_t nSamplesRendered = 0; #ifdef FIX_1119_SPLIT_RENDERING_VOIP 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 ( !isSplitRend ) { /* Ensure split rendering output struct is not used when not outputting to a split rendering format */ splitRendBits = NULL; } 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 vec_pos_update = 0; if ( ( error = IVAS_DEC_GetRenderFramesizeMs( hIvasDec, &systemTimeInc_ms ) ) != IVAS_ERR_OK ) { Loading Loading @@ -3333,6 +3388,22 @@ static ivas_error decodeVoIP( /* decode and get samples */ while ( nSamplesRendered < nOutSamples ) { #ifdef FIX_1119_SPLIT_RENDERING_VOIP if ( isSplitRend ) { #ifdef SUPPORT_JBM_TRACEFILE if ( ( error = IVAS_DEC_VoIP_GetSplitBinauralBitstream( hIvasDec, (void *) pcmBuf, splitRendBits, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &bitstreamReadDone, &nSamplesRendered, ¶metersAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_VoIP_GetSplitBinauralBitstream( hIvasDec, (void *) pcmBuf, splitRendBits, &bitstreamReadDone, &nSamplesRendered, ¶metersAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError in IVAS_DEC_VoIP_GetSplitBinauralBitstream: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } } else { #endif #ifdef SUPPORT_JBM_TRACEFILE if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &bitstreamReadDone, &nSamplesRendered, ¶metersAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK ) #else Loading @@ -3342,6 +3413,9 @@ static ivas_error decodeVoIP( fprintf( stderr, "\nError in IVAS_DEC_VoIP_GetSamples: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #ifdef FIX_1119_SPLIT_RENDERING_VOIP } #endif if ( bitstreamReadDone == true ) { Loading Loading @@ -3421,9 +3495,15 @@ static ivas_error decodeVoIP( /* Once good frame decoded, catch up */ if ( decodedGoodFrame ) { #ifndef FIX_1119_SPLIT_RENDERING_VOIP SplitFileReadWrite *splitRendWriter = NULL; #endif #ifdef FIX_1119_SPLIT_RENDERING_VOIP if ( ( error = initOnFirstGoodFrame( hIvasDec, arg, numInitialBadFrames, &nOutSamples, &vec_pos_len, delayNumSamples_orig, &delayNumSamples, &delayTimeScale, #else if ( ( error = initOnFirstGoodFrame( hIvasDec, arg, numInitialBadFrames, &nOutSamples, NULL, delayNumSamples_orig, &delayNumSamples, &delayTimeScale, #endif &bsFormat, &afWriter, &masaWriter, ismWriters, &nOutChannels, &numObj, &splitRendWriter ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error in initOnFirstGoodFrame(): %s\n", IVAS_DEC_GetErrorMessage( error ) ); Loading @@ -3439,6 +3519,19 @@ static ivas_error decodeVoIP( /* Write current frame */ if ( decodedGoodFrame ) { #ifdef FIX_1119_SPLIT_RENDERING_VOIP if ( isSplitRend ) { if ( split_rend_write_bitstream_to_file( splitRendWriter, splitRendBits->bits_buf, &splitRendBits->bits_read, &splitRendBits->bits_written ) != IVAS_ERR_OK ) { fprintf( stderr, "\nUnable to write to bitstream file!\n" ); goto cleanup; } } if ( !isSplitCoded ) { #endif if ( delayNumSamples < nOutSamples ) { if ( ( error = AudioFileWriter_write( afWriter, &pcmBuf[delayNumSamples * nOutChannels], nOutSamples * nOutChannels - ( delayNumSamples * nOutChannels ) ) ) != IVAS_ERR_OK ) Loading @@ -3452,6 +3545,9 @@ static ivas_error decodeVoIP( { delayNumSamples -= nOutSamples; } #ifdef FIX_1119_SPLIT_RENDERING_VOIP } #endif /* Write ISM metadata to external file(s) */ if ( decodedGoodFrame && arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL ) Loading Loading @@ -3540,7 +3636,11 @@ static ivas_error decodeVoIP( goto cleanup; } #ifdef FIX_1119_SPLIT_RENDERING_VOIP if ( nSamplesFlushed && !isSplitCoded ) #else if ( nSamplesFlushed ) #endif { /* Write current frame */ if ( ( error = AudioFileWriter_write( afWriter, pcmBuf, nSamplesFlushed * nOutChannels ) ) != IVAS_ERR_OK ) Loading Loading @@ -3610,11 +3710,19 @@ static ivas_error decodeVoIP( *------------------------------------------------------------------------------------------*/ memset( pcmBuf, 0, delayNumSamples_orig[0] * nOutChannels * sizeof( int16_t ) ); #ifdef FIX_1119_SPLIT_RENDERING_VOIP if ( afWriter != NULL ) { #endif if ( ( error = AudioFileWriter_write( afWriter, pcmBuf, delayNumSamples_orig[0] * nOutChannels ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError writing output file: %s\n", ivas_error_to_string( error ) ); goto cleanup; } #ifdef FIX_1119_SPLIT_RENDERING_VOIP } #endif /*------------------------------------------------------------------------------------------* * Printouts after decoding has finished Loading Loading @@ -3659,6 +3767,9 @@ cleanup: EVS_RTPDUMP_DEPACKER_close( &rtpdumpDepacker ); AudioFileWriter_close( &afWriter ); #ifdef FIX_1119_SPLIT_RENDERING_VOIP split_rend_reader_writer_close( &splitRendWriter ); #endif JbmOffsetFileWriter_close( &jbmOffsetWriter ); #ifdef SUPPORT_JBM_TRACEFILE JbmTraceFileWriter_close( &jbmTraceWriter ); Loading
apps/isar_post_rend.c +13 −0 Original line number Diff line number Diff line Loading @@ -1104,6 +1104,19 @@ int main( fprintf( stderr, "\nISAR_POST_REND_FeedSplitBinauralBitstream failed: %s\n", ivas_error_to_string( error ) ); goto cleanup; } #ifdef FIX_1119_SPLIT_RENDERING_VOIP /* Set BFI if frame is empty */ int16_t frameEmpty = (int16_t) ( bitsBuffer.config.bitsWritten == 0 ); if ( frameEmpty ) { if ( ( error = ISAR_POST_REND_SetSplitRendBFI( hIsarPostRend, 1 ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error in ISAR_POST_REND_SetSplitRendBFI(): %s\n", ivas_error_to_string( error ) ); goto cleanup; } } #endif } } Loading