Loading Workspace_msvc/lib_lc3plus.vcxproj +9 −8 Original line number Diff line number Diff line Loading @@ -106,6 +106,7 @@ <ClCompile Include="..\lib_lc3plus\attack_detector.c" /> <ClCompile Include="..\lib_lc3plus\plc_compute_stab_fac.c" /> <ClCompile Include="..\lib_lc3plus\constants.c" /> <ClCompile Include="..\lib_lc3plus\com_entropy.c" /> <ClCompile Include="..\lib_lc3plus\cutoff_bandwidth.c" /> <ClCompile Include="..\lib_lc3plus\dct4.c" /> <ClCompile Include="..\lib_lc3plus\dec_entropy.c" /> Loading @@ -116,7 +117,7 @@ <ClCompile Include="..\lib_lc3plus\estimate_global_gain.c" /> <ClCompile Include="..\lib_lc3plus\lc3plus_fft.c" /> <ClCompile Include="..\lib_lc3plus\imdct.c" /> <ClCompile Include="..\lib_lc3plus\lc3.c" /> <ClCompile Include="..\lib_lc3plus\lc3plus.c" /> <ClCompile Include="..\lib_lc3plus\ltpf_coder.c" /> <ClCompile Include="..\lib_lc3plus\ltpf_decoder.c" /> <ClCompile Include="..\lib_lc3plus\mdct.c" /> Loading Loading @@ -153,9 +154,9 @@ <ClCompile Include="..\lib_lc3plus\resamp12k8.c" /> <ClCompile Include="..\lib_lc3plus\residual_coding.c" /> <ClCompile Include="..\lib_lc3plus\residual_decoding.c" /> <ClCompile Include="..\lib_lc3plus\setup_dec_lc3.c" /> <ClCompile Include="..\lib_lc3plus\setup_enc_lc3.c" /> <ClCompile Include="..\lib_lc3plus\setup_com_lc3.c" /> <ClCompile Include="..\lib_lc3plus\setup_dec_lc3plus.c" /> <ClCompile Include="..\lib_lc3plus\setup_enc_lc3plus.c" /> <ClCompile Include="..\lib_lc3plus\setup_com_lc3plus.c" /> <ClCompile Include="..\lib_lc3plus\sns_compute_scf.c" /> <ClCompile Include="..\lib_lc3plus\sns_interpolate_scf.c" /> <ClCompile Include="..\lib_lc3plus\sns_quantize_scf.c" /> Loading @@ -169,9 +170,9 @@ <ClInclude Include="..\lib_lc3plus\defines.h" /> <ClInclude Include="..\lib_lc3plus\file_io.h" /> <ClInclude Include="..\lib_lc3plus\functions.h" /> <ClInclude Include="..\lib_lc3plus\lc3.h" /> <ClInclude Include="..\lib_lc3plus\setup_dec_lc3.h" /> <ClInclude Include="..\lib_lc3plus\setup_enc_lc3.h" /> <ClInclude Include="..\lib_lc3plus\lc3plus.h" /> <ClInclude Include="..\lib_lc3plus\setup_dec_lc3plus.h" /> <ClInclude Include="..\lib_lc3plus\setup_enc_lc3plus.h" /> <ClInclude Include="..\lib_lc3plus\structs.h" /> <ClInclude Include="..\lib_lc3plus\tinywavein_c.h" /> <ClInclude Include="..\lib_lc3plus\tinywaveout_c.h" /> 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 −74 Original line number Diff line number Diff line Loading @@ -130,7 +130,6 @@ typedef struct bool tsmEnabled; IVAS_RENDER_FRAMESIZE renderFramesize; #ifdef DEBUGGING IVAS_DEC_FORCED_REND_MODE forcedRendMode; #ifdef DEBUG_FOA_AGC FILE *agcBitstream; /* temporary */ #endif Loading Loading @@ -174,12 +173,15 @@ 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 ); static int16_t app_own_random( int16_t *seed ); static IVAS_DEC_FORCED_REND_MODE parseForcedRendModeDec( char *forcedRendModeChar ); #endif static void do_object_editing( IVAS_EDITABLE_PARAMETERS *editableParameters, ObjectEditFileReader *objectEditFileReader ); Loading Loading @@ -536,28 +538,6 @@ int main( #endif } /*------------------------------------------------------------------------------------------* * Binaural rendering mode: set and print info *------------------------------------------------------------------------------------------*/ if ( arg.forcedRendMode != IVAS_DEC_FORCE_REND_UNFORCED ) { if ( ( error = IVAS_DEC_SetForcedRendMode( hIvasDec, arg.forcedRendMode ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError: Forcing binaural rendering mode failed (only TDREND and CLDFBREND are expected).\n\n" ); goto cleanup; } if ( arg.forcedRendMode == IVAS_DEC_FORCE_REND_TD_RENDERER ) { fprintf( stdout, "Forcing rendering to: TD renderer\n" ); } else if ( arg.forcedRendMode == IVAS_DEC_FORCE_REND_CLDFB_RENDERER ) { fprintf( stdout, "Forcing rendering to: CLDFB renderer\n" ); } } /*-----------------------------------------------------------------* * Open Error pattern file for simulation *-----------------------------------------------------------------*/ Loading Loading @@ -756,7 +736,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 @@ -962,7 +946,6 @@ static bool parseCmdlIVAS_dec( #ifdef DEBUGGING float ftmp; arg->forcedRendMode = IVAS_DEC_FORCE_REND_UNFORCED; #ifdef DEBUG_FOA_AGC arg->agcBitstream = NULL; #endif Loading Loading @@ -1132,17 +1115,6 @@ static bool parseCmdlIVAS_dec( } i += 2; } else if ( strcmp( argv_to_upper, "-FORCE" ) == 0 ) { i++; if ( i < argc - 3 ) { strncpy( argv_to_upper, argv[i], sizeof( argv_to_upper ) - 1 ); argv_to_upper[sizeof( argv_to_upper ) - 1] = '\0'; arg->forcedRendMode = parseForcedRendModeDec( argv_to_upper ); i++; } } #ifdef DEBUG_MODE_INFO #ifdef DEBUG_MODE_INFO_TWEAK /* Define additional subfolder for debug info output in ./res */ Loading Loading @@ -1952,7 +1924,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 +1946,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 +2160,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 +2499,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 +3053,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 +3105,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 +3419,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 +3444,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 +3526,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 +3550,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 +3576,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 +3666,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 +3741,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 +3798,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 Loading @@ -3856,31 +3931,6 @@ static void do_object_editing( return; } #ifdef DEBUGGING /*---------------------------------------------------------------------* * parseForcedRendModeDec() * * *---------------------------------------------------------------------*/ static IVAS_DEC_FORCED_REND_MODE parseForcedRendModeDec( char *forcedRendModeChar ) { if ( ( strcmp( to_upper( forcedRendModeChar ), "TDREND" ) == 0 ) ) { return IVAS_DEC_FORCE_REND_TD_RENDERER; } if ( ( strcmp( to_upper( forcedRendModeChar ), "CLDFBREND" ) == 0 ) ) { return IVAS_DEC_FORCE_REND_CLDFB_RENDERER; } return IVAS_DEC_FORCE_REND_UNDEFINED; } #endif /*---------------------------------------------------------------------* * load_hrtf_from_file() 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 Loading
Workspace_msvc/lib_lc3plus.vcxproj +9 −8 Original line number Diff line number Diff line Loading @@ -106,6 +106,7 @@ <ClCompile Include="..\lib_lc3plus\attack_detector.c" /> <ClCompile Include="..\lib_lc3plus\plc_compute_stab_fac.c" /> <ClCompile Include="..\lib_lc3plus\constants.c" /> <ClCompile Include="..\lib_lc3plus\com_entropy.c" /> <ClCompile Include="..\lib_lc3plus\cutoff_bandwidth.c" /> <ClCompile Include="..\lib_lc3plus\dct4.c" /> <ClCompile Include="..\lib_lc3plus\dec_entropy.c" /> Loading @@ -116,7 +117,7 @@ <ClCompile Include="..\lib_lc3plus\estimate_global_gain.c" /> <ClCompile Include="..\lib_lc3plus\lc3plus_fft.c" /> <ClCompile Include="..\lib_lc3plus\imdct.c" /> <ClCompile Include="..\lib_lc3plus\lc3.c" /> <ClCompile Include="..\lib_lc3plus\lc3plus.c" /> <ClCompile Include="..\lib_lc3plus\ltpf_coder.c" /> <ClCompile Include="..\lib_lc3plus\ltpf_decoder.c" /> <ClCompile Include="..\lib_lc3plus\mdct.c" /> Loading Loading @@ -153,9 +154,9 @@ <ClCompile Include="..\lib_lc3plus\resamp12k8.c" /> <ClCompile Include="..\lib_lc3plus\residual_coding.c" /> <ClCompile Include="..\lib_lc3plus\residual_decoding.c" /> <ClCompile Include="..\lib_lc3plus\setup_dec_lc3.c" /> <ClCompile Include="..\lib_lc3plus\setup_enc_lc3.c" /> <ClCompile Include="..\lib_lc3plus\setup_com_lc3.c" /> <ClCompile Include="..\lib_lc3plus\setup_dec_lc3plus.c" /> <ClCompile Include="..\lib_lc3plus\setup_enc_lc3plus.c" /> <ClCompile Include="..\lib_lc3plus\setup_com_lc3plus.c" /> <ClCompile Include="..\lib_lc3plus\sns_compute_scf.c" /> <ClCompile Include="..\lib_lc3plus\sns_interpolate_scf.c" /> <ClCompile Include="..\lib_lc3plus\sns_quantize_scf.c" /> Loading @@ -169,9 +170,9 @@ <ClInclude Include="..\lib_lc3plus\defines.h" /> <ClInclude Include="..\lib_lc3plus\file_io.h" /> <ClInclude Include="..\lib_lc3plus\functions.h" /> <ClInclude Include="..\lib_lc3plus\lc3.h" /> <ClInclude Include="..\lib_lc3plus\setup_dec_lc3.h" /> <ClInclude Include="..\lib_lc3plus\setup_enc_lc3.h" /> <ClInclude Include="..\lib_lc3plus\lc3plus.h" /> <ClInclude Include="..\lib_lc3plus\setup_dec_lc3plus.h" /> <ClInclude Include="..\lib_lc3plus\setup_enc_lc3plus.h" /> <ClInclude Include="..\lib_lc3plus\structs.h" /> <ClInclude Include="..\lib_lc3plus\tinywavein_c.h" /> <ClInclude Include="..\lib_lc3plus\tinywaveout_c.h" /> 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 −74 Original line number Diff line number Diff line Loading @@ -130,7 +130,6 @@ typedef struct bool tsmEnabled; IVAS_RENDER_FRAMESIZE renderFramesize; #ifdef DEBUGGING IVAS_DEC_FORCED_REND_MODE forcedRendMode; #ifdef DEBUG_FOA_AGC FILE *agcBitstream; /* temporary */ #endif Loading Loading @@ -174,12 +173,15 @@ 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 ); static int16_t app_own_random( int16_t *seed ); static IVAS_DEC_FORCED_REND_MODE parseForcedRendModeDec( char *forcedRendModeChar ); #endif static void do_object_editing( IVAS_EDITABLE_PARAMETERS *editableParameters, ObjectEditFileReader *objectEditFileReader ); Loading Loading @@ -536,28 +538,6 @@ int main( #endif } /*------------------------------------------------------------------------------------------* * Binaural rendering mode: set and print info *------------------------------------------------------------------------------------------*/ if ( arg.forcedRendMode != IVAS_DEC_FORCE_REND_UNFORCED ) { if ( ( error = IVAS_DEC_SetForcedRendMode( hIvasDec, arg.forcedRendMode ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError: Forcing binaural rendering mode failed (only TDREND and CLDFBREND are expected).\n\n" ); goto cleanup; } if ( arg.forcedRendMode == IVAS_DEC_FORCE_REND_TD_RENDERER ) { fprintf( stdout, "Forcing rendering to: TD renderer\n" ); } else if ( arg.forcedRendMode == IVAS_DEC_FORCE_REND_CLDFB_RENDERER ) { fprintf( stdout, "Forcing rendering to: CLDFB renderer\n" ); } } /*-----------------------------------------------------------------* * Open Error pattern file for simulation *-----------------------------------------------------------------*/ Loading Loading @@ -756,7 +736,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 @@ -962,7 +946,6 @@ static bool parseCmdlIVAS_dec( #ifdef DEBUGGING float ftmp; arg->forcedRendMode = IVAS_DEC_FORCE_REND_UNFORCED; #ifdef DEBUG_FOA_AGC arg->agcBitstream = NULL; #endif Loading Loading @@ -1132,17 +1115,6 @@ static bool parseCmdlIVAS_dec( } i += 2; } else if ( strcmp( argv_to_upper, "-FORCE" ) == 0 ) { i++; if ( i < argc - 3 ) { strncpy( argv_to_upper, argv[i], sizeof( argv_to_upper ) - 1 ); argv_to_upper[sizeof( argv_to_upper ) - 1] = '\0'; arg->forcedRendMode = parseForcedRendModeDec( argv_to_upper ); i++; } } #ifdef DEBUG_MODE_INFO #ifdef DEBUG_MODE_INFO_TWEAK /* Define additional subfolder for debug info output in ./res */ Loading Loading @@ -1952,7 +1924,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 +1946,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 +2160,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 +2499,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 +3053,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 +3105,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 +3419,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 +3444,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 +3526,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 +3550,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 +3576,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 +3666,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 +3741,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 +3798,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 Loading @@ -3856,31 +3931,6 @@ static void do_object_editing( return; } #ifdef DEBUGGING /*---------------------------------------------------------------------* * parseForcedRendModeDec() * * *---------------------------------------------------------------------*/ static IVAS_DEC_FORCED_REND_MODE parseForcedRendModeDec( char *forcedRendModeChar ) { if ( ( strcmp( to_upper( forcedRendModeChar ), "TDREND" ) == 0 ) ) { return IVAS_DEC_FORCE_REND_TD_RENDERER; } if ( ( strcmp( to_upper( forcedRendModeChar ), "CLDFBREND" ) == 0 ) ) { return IVAS_DEC_FORCE_REND_CLDFB_RENDERER; } return IVAS_DEC_FORCE_REND_UNDEFINED; } #endif /*---------------------------------------------------------------------* * load_hrtf_from_file() 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