Loading Workspace_msvc/lib_rend.vcxproj +2 −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 Loading @@ -175,6 +176,7 @@ <ClCompile Include="..\lib_rend\ivas_rom_rend.c" /> <ClCompile Include="..\lib_rend\ivas_shoebox.c" /> <ClCompile Include="..\lib_rend\ivas_td_decorr.c" /> <ClCompile Include="..\lib_rend\ivas_td_ring_buffer.c" /> <ClCompile Include="..\lib_rend\ivas_vbap.c" /> <ClCompile Include="..\lib_rend\lib_rend.c" /> </ItemGroup> Loading Workspace_msvc/lib_rend.vcxproj.filters +3 −0 Original line number Diff line number Diff line Loading @@ -116,6 +116,9 @@ <ClCompile Include="..\lib_rend\ivas_td_decorr.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 @@ -174,7 +174,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 *hHrtfBinary, 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 *hHrtfBinary, 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 @@ -756,7 +760,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 @@ -1952,7 +1960,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 @@ -1970,7 +1982,12 @@ static ivas_error initOnFirstGoodFrame( return error; } } #ifdef FIX_1119_SPLIT_RENDERING_VOIP if ( !isSplitCoded ) #else else #endif { if ( *pRemainingDelayNumSamples < *numOutSamples ) { Loading Loading @@ -2179,6 +2196,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 @@ -2510,7 +2535,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 @@ -3060,6 +3089,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 @@ -3109,6 +3141,29 @@ static ivas_error decodeVoIP( bool parametersAvailableForEditing = false; uint16_t nSamplesRendered; #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 @@ -3400,6 +3455,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 @@ -3409,6 +3480,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 @@ -3488,9 +3562,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 @@ -3506,6 +3586,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 @@ -3519,6 +3612,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 @@ -3606,7 +3702,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 @@ -3677,11 +3777,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 @@ -3726,6 +3834,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 @@ -1068,6 +1068,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 lib_com/ivas_prot.h +37 −0 Original line number Diff line number Diff line Loading @@ -5217,6 +5217,43 @@ void ivas_binaural_add_LFE( float *output_f[] /* o : synthesized core-coder transport channels/DirAC output */ ); #ifdef FIX_1119_SPLIT_RENDERING_VOIP /*---------------------------------------------------------------------------------* * Multi-pose ring buffer Prototypes *-----------------------------------------------------------------------------------*/ ivas_error ivas_CLDFB_RINGBUF_Open( ISAR_CLDFB_RINGBUF_HANDLE *ph, const int16_t capacity_columns ); void ivas_CLDFB_RINGBUF_Close( ISAR_CLDFB_RINGBUF_HANDLE *ph ); void ivas_CLDFB_RINGBUF_Push( ISAR_CLDFB_RINGBUF_HANDLE h, const float *real, const float *imag, const int16_t num_bands ); void ivas_CLDFB_RINGBUF_Pop( ISAR_CLDFB_RINGBUF_HANDLE h, float *real, float *imag, const int16_t num_bands ); void ivas_CLDFB_RINGBUF_GetByIdx( ISAR_CLDFB_RINGBUF_HANDLE h, float **p_real, float **p_imag, const int16_t idx ); #endif /*----------------------------------------------------------------------------------* * renderer prototypes Loading Loading
Workspace_msvc/lib_rend.vcxproj +2 −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 Loading @@ -175,6 +176,7 @@ <ClCompile Include="..\lib_rend\ivas_rom_rend.c" /> <ClCompile Include="..\lib_rend\ivas_shoebox.c" /> <ClCompile Include="..\lib_rend\ivas_td_decorr.c" /> <ClCompile Include="..\lib_rend\ivas_td_ring_buffer.c" /> <ClCompile Include="..\lib_rend\ivas_vbap.c" /> <ClCompile Include="..\lib_rend\lib_rend.c" /> </ItemGroup> Loading
Workspace_msvc/lib_rend.vcxproj.filters +3 −0 Original line number Diff line number Diff line Loading @@ -116,6 +116,9 @@ <ClCompile Include="..\lib_rend\ivas_td_decorr.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 @@ -174,7 +174,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 *hHrtfBinary, 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 *hHrtfBinary, 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 @@ -756,7 +760,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 @@ -1952,7 +1960,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 @@ -1970,7 +1982,12 @@ static ivas_error initOnFirstGoodFrame( return error; } } #ifdef FIX_1119_SPLIT_RENDERING_VOIP if ( !isSplitCoded ) #else else #endif { if ( *pRemainingDelayNumSamples < *numOutSamples ) { Loading Loading @@ -2179,6 +2196,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 @@ -2510,7 +2535,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 @@ -3060,6 +3089,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 @@ -3109,6 +3141,29 @@ static ivas_error decodeVoIP( bool parametersAvailableForEditing = false; uint16_t nSamplesRendered; #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 @@ -3400,6 +3455,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 @@ -3409,6 +3480,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 @@ -3488,9 +3562,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 @@ -3506,6 +3586,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 @@ -3519,6 +3612,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 @@ -3606,7 +3702,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 @@ -3677,11 +3777,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 @@ -3726,6 +3834,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 @@ -1068,6 +1068,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
lib_com/ivas_prot.h +37 −0 Original line number Diff line number Diff line Loading @@ -5217,6 +5217,43 @@ void ivas_binaural_add_LFE( float *output_f[] /* o : synthesized core-coder transport channels/DirAC output */ ); #ifdef FIX_1119_SPLIT_RENDERING_VOIP /*---------------------------------------------------------------------------------* * Multi-pose ring buffer Prototypes *-----------------------------------------------------------------------------------*/ ivas_error ivas_CLDFB_RINGBUF_Open( ISAR_CLDFB_RINGBUF_HANDLE *ph, const int16_t capacity_columns ); void ivas_CLDFB_RINGBUF_Close( ISAR_CLDFB_RINGBUF_HANDLE *ph ); void ivas_CLDFB_RINGBUF_Push( ISAR_CLDFB_RINGBUF_HANDLE h, const float *real, const float *imag, const int16_t num_bands ); void ivas_CLDFB_RINGBUF_Pop( ISAR_CLDFB_RINGBUF_HANDLE h, float *real, float *imag, const int16_t num_bands ); void ivas_CLDFB_RINGBUF_GetByIdx( ISAR_CLDFB_RINGBUF_HANDLE h, float **p_real, float **p_imag, const int16_t idx ); #endif /*----------------------------------------------------------------------------------* * renderer prototypes Loading