From efa33dc3ba50a591ccf312ad841e981c52267e06 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 26 May 2025 11:35:28 +0200 Subject: [PATCH 01/13] fix compilation error with instrumented code --- lib_com/bitstream.c | 9 ++++++--- lib_com/prot.h | 11 ++++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index 4a2e4da58..6b37cdae8 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -2865,9 +2865,11 @@ ivas_error push_indice( * Push a new indice into the buffer at the next position *-------------------------------------------------------------------*/ -ivas_error push_next_indice_( #ifdef DBG_BITSTREAM_ANALYSIS +ivas_error push_next_indice_( const char *caller, +#else +ivas_error push_next_indice( #endif BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ uint16_t value, /* i : value of the quantized indice */ @@ -2930,10 +2932,11 @@ ivas_error push_next_indice_( * Push a bit buffer into the buffer at the next position *-------------------------------------------------------------------*/ - -ivas_error push_next_bits_( #ifdef DBG_BITSTREAM_ANALYSIS +ivas_error push_next_bits_( const char *caller, +#else +ivas_error push_next_bits( #endif BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ const uint16_t bits[], /* i : bit buffer to pack, sequence of single bits */ diff --git a/lib_com/prot.h b/lib_com/prot.h index 78f31c5a2..c3acc73e8 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -476,23 +476,24 @@ ivas_error push_indice( #ifdef DBG_BITSTREAM_ANALYSIS #define push_next_indice( ... ) push_next_indice_( __func__, __VA_ARGS__ ) #define push_next_bits( ... ) push_next_bits_( __func__, __VA_ARGS__ ); -#else -#define push_next_indice( ... ) push_next_indice_( __VA_ARGS__ ) -#define push_next_bits( ... ) push_next_bits_( __VA_ARGS__ ); #endif -ivas_error push_next_indice_( #ifdef DBG_BITSTREAM_ANALYSIS +ivas_error push_next_indice_( const char *caller, +#else +ivas_error push_next_indice( #endif BSTR_ENC_HANDLE hBstr, uint16_t value, /* i : value of the quantized indice */ int16_t nb_bits /* i : number of bits used to quantize the indice */ ); -ivas_error push_next_bits_( #ifdef DBG_BITSTREAM_ANALYSIS +ivas_error push_next_bits_( const char *caller, +#else +ivas_error push_next_bits( #endif BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ const uint16_t bits[], /* i : bit buffer to pack, sequence of single bits */ -- GitLab From 4b37cfd3803a146ded34378e249c50fa6e857287 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 26 May 2025 11:57:03 +0200 Subject: [PATCH 02/13] enable instrumented build on ivas-float-update --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1447d9d13..9ec43210b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -669,7 +669,7 @@ build-codec-linux-instrumented-make: rules: - if: $CI_PIPELINE_SOURCE == 'web' - if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" # only have MR pipelines for MRs to main + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' - if: $CI_PIPELINE_SOURCE == 'schedule' - if: $CI_PIPELINE_SOURCE == 'push' when: never -- GitLab From f8905d106bf6df36bbf39da16d35d97fb5a78ebf Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Tue, 3 Jun 2025 13:52:19 +0200 Subject: [PATCH 03/13] port MR 1223 from float repo fix for JBM control getting the wrong info for non-20ms rendering framesize --- apps/decoder.c | 95 +++++++++++++++++++++++++++++++++++++++++++++++ lib_com/options.h | 2 + lib_dec/lib_dec.c | 93 +++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 189 insertions(+), 1 deletion(-) diff --git a/apps/decoder.c b/apps/decoder.c index b54ad4b92..5525c46a0 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -2905,7 +2905,14 @@ static ivas_error decodeVoIP( } vec_pos_update = ( vec_pos_update + 1 ) % vec_pos_len; frame++; +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + if ( vec_pos_update == 0 ) + { + systemTime_ms += vec_pos_len * systemTimeInc_ms; + } +#else systemTime_ms += systemTimeInc_ms; +#endif #ifdef WMOPS update_mem(); @@ -2913,6 +2920,94 @@ static ivas_error decodeVoIP( #endif } + +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + int16_t nSamplesFlushed = 0; + + /* decode and get samples */ +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( ( error = IVAS_DEC_Flush( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, &nSamplesFlushed ) ) != IVAS_ERR_OK ) +#else + if ( ( error = IVAS_DEC_Flush( hIvasDec, nOutSamples, pcmBuf, &nSamplesFlushed ) ) != IVAS_ERR_OK ) +#endif + { + fprintf( stderr, "\nError in IVAS_DEC_VoIP_Flush: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + + if ( nSamplesFlushed ) + { + /* Write current frame */ + if ( ( error = AudioFileWriter_write( afWriter, pcmBuf, nSamplesFlushed * nOutChannels ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nOutput audio file writer error\n" ); + goto cleanup; + } + + /* Write ISm metadata to external file(s) */ + if ( decodedGoodFrame && arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL ) + { + if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_MASA_ISM || bsFormat == IVAS_DEC_BS_SBA_ISM ) + { + if ( ( error = IVAS_DEC_GetNumObjects( hIvasDec, &numObj ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError in IVAS_DEC_GetNumObjects: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + + for ( i = 0; i < numObj; ++i ) + { + IVAS_ISM_METADATA IsmMetadata; + + if ( ( error = IVAS_DEC_GetObjectMetadata( hIvasDec, &IsmMetadata, 0, i ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError in IVAS_DEC_GetObjectMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + + if ( ( IsmFileWriter_writeFrame( IsmMetadata, ismWriters[i] ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError writing ISM metadata to file %s\n", IsmFileWriter_getFilePath( ismWriters[i] ) ); + goto cleanup; + } + } + } + + if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM ) + { + IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; +#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT + int16_t fullDelayNumSamples[3]; + float delayMs; + + /* delayNumSamples is zeroed, and delayNumSamples_orig is updated only on first good frame, so need to re-fetch delay info */ + if ( ( error = IVAS_DEC_GetDelay( hIvasDec, fullDelayNumSamples, &delayTimeScale ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) ); + } +#endif + if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + +#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT + delayMs = (float) ( fullDelayNumSamples[0] ) / (float) ( delayTimeScale ); + if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK ) +#else + if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) +#endif + { + fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); + goto cleanup; + } + } + } + } +#endif + + /*------------------------------------------------------------------------------------------* * Add zeros at the end to have equal length of synthesized signals *------------------------------------------------------------------------------------------*/ diff --git a/lib_com/options.h b/lib_com/options.h index 16880c701..9b03463a1 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -143,6 +143,8 @@ /* ################### Start FIXES switches ########################### */ +#define NONBE_FIX_864_JBM_RENDER_FRAMESIZE /* FhG: issue #864: fix different behaviour of JBM TSM with different render frame sizes */ + /* #################### End FIXES switches ############################ */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index d7f3e5f6e..e8d51ca01 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -57,6 +57,9 @@ struct IVAS_DEC_VOIP uint16_t lastDecodedWasActive; JB4_DATAUNIT_HANDLE hCurrentDataUnit; /* Points to the currently processed data unit */ uint16_t *bs_conversion_buf; /* Buffer for bitstream conversion from packed to serial */ +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + int16_t nSamplesRendered20ms; /* how many samples have been rendered since the last 20ms render border*/ +#endif #ifdef SUPPORT_JBM_TRACEFILE IVAS_JBM_TRACE_DATA JbmTraceData; #endif @@ -77,6 +80,9 @@ struct IVAS_DEC int16_t bitstreamformat; /* Bitstream format flag (G.192/MIME/VOIP_G192_RTP/VOIP_RTPDUMP) */ bool Opt_VOIP; /* flag indicating VOIP mode with JBM */ int16_t tsm_scale; /* scale for TSM operation */ +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + int16_t timeScalingDone; /* have we done already one TSM in a 20ms frame? */ +#endif int16_t tsm_max_scaling; float tsm_quality; float *apaExecBuffer; /* Buffer for APA scaling */ @@ -112,6 +118,9 @@ static ivas_error IVAS_DEC_RendererFeedTcSamples( IVAS_DEC_HANDLE hIvasDec, cons static ivas_error IVAS_DEC_GetRenderedSamples( IVAS_DEC_HANDLE hIvasDec, const uint16_t nSamplesForRendering, uint16_t *nSamplesRendered, uint16_t *nSamplesAvailableNext, int16_t *pcmBuf ); static ivas_error IVAS_DEC_GetBufferedNumberOfSamples( IVAS_DEC_HANDLE hIvasDec, int16_t *nSamplesBuffered ); static int16_t get_render_frame_size_ms( IVAS_RENDER_FRAMESIZE render_framesize ); +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE +static void update_voip_rendered20ms( IVAS_DEC_HANDLE hIvasDec, const int16_t nSamplesRendered ); +#endif /*---------------------------------------------------------------------* @@ -149,6 +158,9 @@ ivas_error IVAS_DEC_Open( hIvasDec->tsm_scale = 100; hIvasDec->tsm_max_scaling = 0; hIvasDec->tsm_quality = 1.0f; +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + hIvasDec->timeScalingDone = 0; +#endif hIvasDec->needNewFrame = false; hIvasDec->nTransportChannelsOld = 0; hIvasDec->nSamplesAvailableNext = 0; @@ -651,6 +663,9 @@ ivas_error IVAS_DEC_EnableVoIP( hIvasDec->hVoIP->lastDecodedWasActive = 0; hIvasDec->hVoIP->hCurrentDataUnit = NULL; hIvasDec->hVoIP->nSamplesFrame = (uint16_t) ( hDecoderConfig->output_Fs / FRAMES_PER_SEC ); +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + hIvasDec->hVoIP->nSamplesRendered20ms = 0; +#endif #define WMC_TOOL_SKIP /* Bitstream conversion is not counted towards complexity and memory usage */ @@ -887,17 +902,26 @@ ivas_error IVAS_DEC_GetSamples( assert( nTimeScalerOutSamples <= APA_BUF ); nSamplesTcsScaled = nTimeScalerOutSamples / nTransportChannels; +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + hIvasDec->timeScalingDone = 1; +#endif } else { nSamplesTcsScaled = hIvasDec->nSamplesFrame; } +#ifdef DEBUG_MODE_JBM + dbgwrite( &nTimeScalerOutSamples, sizeof( uint16_t ), 1, 1, "./res/JBM_nTimeScaleOutSamples.dat" ); +#endif /* Feed decoded transport channels samples to the renderer */ if ( ( error = IVAS_DEC_RendererFeedTcSamples( hIvasDec, nSamplesTcsScaled, &nResidualSamples, hIvasDec->apaExecBuffer ) ) != IVAS_ERR_OK ) { return error; } +#ifdef DEBUG_MODE_JBM + dbgwrite( &nResidualSamples, sizeof( int16_t ), 1, 1, "./res/JBM_nResidualSamples.dat" ); +#endif if ( hIvasDec->st_ivas->hDecoderConfig->Opt_tsm ) { @@ -1131,6 +1155,9 @@ static ivas_error IVAS_DEC_GetBufferedNumberOfSamples( if ( hIvasDec->st_ivas->hTcBuffer != NULL ) { *nSamplesBuffered = hIvasDec->st_ivas->hTcBuffer->n_samples_buffered - hIvasDec->st_ivas->hTcBuffer->n_samples_rendered; +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + *nSamplesBuffered += hIvasDec->hVoIP->nSamplesRendered20ms; +#endif } return IVAS_ERR_OK; @@ -2117,6 +2144,9 @@ ivas_error IVAS_DEC_VoIP_GetSamples( uint32_t extBufferedTime_ms, scale, maxScaling; JB4_DATAUNIT_HANDLE dataUnit; uint16_t extBufferedSamples; +#ifndef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + int16_t timeScalingDone; +#endif int16_t timeScalingDone; int16_t result; ivas_error error; @@ -2126,6 +2156,9 @@ ivas_error IVAS_DEC_VoIP_GetSamples( st_ivas = hIvasDec->st_ivas; hDecoderConfig = st_ivas->hDecoderConfig; hVoIP = hIvasDec->hVoIP; +#ifndef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + timeScalingDone = 0; +#endif timeScalingDone = 0; nOutChannels = (uint8_t) st_ivas->hDecoderConfig->nchan_out; nSamplesRendered = 0; @@ -2150,7 +2183,11 @@ ivas_error IVAS_DEC_VoIP_GetSamples( } } +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + extBufferedSamples = nSamplesBuffered; +#else extBufferedSamples = nSamplesRendered + nSamplesBuffered; +#endif extBufferedTime_ms = extBufferedSamples * 1000 / hDecoderConfig->output_Fs; dataUnit = NULL; @@ -2162,17 +2199,30 @@ ivas_error IVAS_DEC_VoIP_GetSamples( } maxScaling = maxScaling * hDecoderConfig->output_Fs / 1000; +#ifdef DEBUG_MODE_JBM + dbgwrite( &extBufferedSamples, sizeof( uint16_t ), 1, 1, "./res/JBM_extBufferedSamples.dat" ); + dbgwrite( &systemTimestamp_ms, sizeof( uint32_t ), 1, 1, "./res/JBM_systemTimestamp.dat" ); + dbgwrite( &scale, sizeof( uint32_t ), 1, 1, "./res/JBM_scale.dat" ); + dbgwrite( &maxScaling, sizeof( uint32_t ), 1, 1, "./res/JBM_maxScale.dat" ); +#endif + /* avoid time scaling multiple times in one sound card slot */ if ( scale != 100U ) { +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + if ( hIvasDec->timeScalingDone ) +#else if ( timeScalingDone ) +#endif { scale = 100; } +#ifndef NONBE_FIX_864_JBM_RENDER_FRAMESIZE else { timeScalingDone = 1; } +#endif } /* limit scale to range supported by time scaler */ @@ -2257,6 +2307,9 @@ ivas_error IVAS_DEC_VoIP_GetSamples( nSamplesRendered += nSamplesToZero; hIvasDec->nSamplesRendered += nSamplesToZero; hIvasDec->nSamplesAvailableNext -= nSamplesToZero; +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + update_voip_rendered20ms( hIvasDec, nSamplesToZero ); +#endif } else { @@ -2271,12 +2324,38 @@ ivas_error IVAS_DEC_VoIP_GetSamples( } nSamplesRendered += nSamplesRendered_loop; +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + update_voip_rendered20ms( hIvasDec, nSamplesRendered_loop ); +#endif } } return IVAS_ERR_OK; } +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + +/*---------------------------------------------------------------------* + * update_voip_rendered20ms( ) + * + * Function to flush remaining audio in VoIP + *---------------------------------------------------------------------*/ + +static void update_voip_rendered20ms( + IVAS_DEC_HANDLE hIvasDec, + const int16_t nSamplesRendered ) +{ + int16_t nSamplesRenderedTotal; + nSamplesRenderedTotal = hIvasDec->hVoIP->nSamplesRendered20ms + nSamplesRendered; + /* we have crossed a 20ms border, reset the time scaling done flag */ + if ( nSamplesRenderedTotal >= hIvasDec->hVoIP->nSamplesFrame ) + { + hIvasDec->timeScalingDone = 0; + } + hIvasDec->hVoIP->nSamplesRendered20ms = nSamplesRenderedTotal % hIvasDec->hVoIP->nSamplesFrame; +} + +#endif /*---------------------------------------------------------------------* * IVAS_DEC_VoIP_Flush( ) @@ -2300,7 +2379,19 @@ ivas_error IVAS_DEC_Flush( nSamplesToRender = (uint16_t) *nSamplesFlushed; /* render IVAS frames */ - error = IVAS_DEC_GetRenderedSamples( hIvasDec, nSamplesToRender, &nSamplesFlushedLocal, &hIvasDec->nSamplesAvailableNext, pcmBuf ); +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + error = IVAS_ERR_OK; + if ( nSamplesToRender > 0 && hIvasDec->st_ivas->ivas_format != MONO_FORMAT ) + { +#endif + error = IVAS_DEC_GetRenderedSamples( hIvasDec, nSamplesToRender, &nSamplesFlushedLocal, &hIvasDec->nSamplesAvailableNext, pcmBuf ); +#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE + } + else + { + *nSamplesFlushed = 0; + } +#endif return error; } -- GitLab From 572c9813c9a2f94351989fe1e8a938bb965c868e Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Thu, 5 Jun 2025 10:00:09 +0200 Subject: [PATCH 04/13] Remove duplicate variable --- lib_dec/lib_dec.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index e8d51ca01..3a8253448 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -2147,7 +2147,6 @@ ivas_error IVAS_DEC_VoIP_GetSamples( #ifndef NONBE_FIX_864_JBM_RENDER_FRAMESIZE int16_t timeScalingDone; #endif - int16_t timeScalingDone; int16_t result; ivas_error error; int16_t nSamplesRendered; @@ -2159,7 +2158,6 @@ ivas_error IVAS_DEC_VoIP_GetSamples( #ifndef NONBE_FIX_864_JBM_RENDER_FRAMESIZE timeScalingDone = 0; #endif - timeScalingDone = 0; nOutChannels = (uint8_t) st_ivas->hDecoderConfig->nchan_out; nSamplesRendered = 0; -- GitLab From 89843a5f1d4498ab00b138bbf55f1cc4b047c706 Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Thu, 5 Jun 2025 10:00:31 +0200 Subject: [PATCH 05/13] Whitespace changes to minimise diff wrt original changes --- lib_dec/lib_dec.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 3a8253448..64f1baa80 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -80,10 +80,10 @@ struct IVAS_DEC int16_t bitstreamformat; /* Bitstream format flag (G.192/MIME/VOIP_G192_RTP/VOIP_RTPDUMP) */ bool Opt_VOIP; /* flag indicating VOIP mode with JBM */ int16_t tsm_scale; /* scale for TSM operation */ + int16_t tsm_max_scaling; #ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE int16_t timeScalingDone; /* have we done already one TSM in a 20ms frame? */ #endif - int16_t tsm_max_scaling; float tsm_quality; float *apaExecBuffer; /* Buffer for APA scaling */ PCMDSP_APA_HANDLE hTimeScaler; @@ -122,7 +122,6 @@ static int16_t get_render_frame_size_ms( IVAS_RENDER_FRAMESIZE render_framesize static void update_voip_rendered20ms( IVAS_DEC_HANDLE hIvasDec, const int16_t nSamplesRendered ); #endif - /*---------------------------------------------------------------------* * IVAS_DEC_Open() * @@ -910,19 +909,19 @@ ivas_error IVAS_DEC_GetSamples( { nSamplesTcsScaled = hIvasDec->nSamplesFrame; } + #ifdef DEBUG_MODE_JBM dbgwrite( &nTimeScalerOutSamples, sizeof( uint16_t ), 1, 1, "./res/JBM_nTimeScaleOutSamples.dat" ); #endif - /* Feed decoded transport channels samples to the renderer */ if ( ( error = IVAS_DEC_RendererFeedTcSamples( hIvasDec, nSamplesTcsScaled, &nResidualSamples, hIvasDec->apaExecBuffer ) ) != IVAS_ERR_OK ) { return error; } + #ifdef DEBUG_MODE_JBM dbgwrite( &nResidualSamples, sizeof( int16_t ), 1, 1, "./res/JBM_nResidualSamples.dat" ); #endif - if ( hIvasDec->st_ivas->hDecoderConfig->Opt_tsm ) { /* feed residual samples to TSM for the next call */ @@ -2189,6 +2188,7 @@ ivas_error IVAS_DEC_VoIP_GetSamples( extBufferedTime_ms = extBufferedSamples * 1000 / hDecoderConfig->output_Fs; dataUnit = NULL; + /* pop one access unit from the jitter buffer */ result = JB4_PopDataUnit( hVoIP->hJBM, systemTimestamp_ms, extBufferedTime_ms, &dataUnit, &scale, &maxScaling ); if ( result != 0 ) @@ -2332,7 +2332,6 @@ ivas_error IVAS_DEC_VoIP_GetSamples( } #ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE - /*---------------------------------------------------------------------* * update_voip_rendered20ms( ) * @@ -2390,7 +2389,6 @@ ivas_error IVAS_DEC_Flush( *nSamplesFlushed = 0; } #endif - return error; } -- GitLab From 7ef7709831bd8462338d93caff0dd3a3a732751c Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 11 Jun 2025 11:54:09 +0200 Subject: [PATCH 06/13] [renderer] add OSBA/OMASA CLI support and update printouts. see float MRs 1908 and 2146. --- apps/renderer.c | 149 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 100 insertions(+), 49 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index cf7f05b98..322f382ca 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -147,7 +147,7 @@ typedef struct int32_t sampleRate; InputConfig inConfig; OutputConfig outConfig; - char inMetadataFilePaths[RENDERER_MAX_ISM_INPUTS][RENDERER_MAX_CLI_ARG_LENGTH]; + char inMetadataFilePaths[RENDERER_MAX_ISM_INPUTS + RENDERER_MAX_MASA_INPUTS][RENDERER_MAX_CLI_ARG_LENGTH]; int16_t numInMetadataFiles; char headRotationFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; char referenceVectorFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; @@ -215,13 +215,13 @@ static const CmdLnParser_Option cliOptions[] = { .id = CmdLnOptionId_inputFormat, .match = "input_format", .matchShort = "if", - .description = "Audio format of input file (e.g. 5_1 or HOA3 or META, use -l for a list)", + .description = "Audio format of input file (e.g. 5_1 or HOA3 or META,\nuse -l for a list)", }, { .id = CmdLnOptionId_inputMetadata, .match = "input_metadata", .matchShort = "im", - .description = "Space-separated list of path to metadata files for ISM or MASA inputs", + .description = "Space-separated list of path to metadata files for ISM/MASA/OMASA/\nOSBA inputs. \nFor OMASA, ISM files must be specified first.", }, { .id = CmdLnOptionId_outputFile, @@ -239,57 +239,59 @@ static const CmdLnParser_Option cliOptions[] = { .id = CmdLnOptionId_sampleRate, .match = "sample_rate", .matchShort = "fs", - .description = "Input sampling rate in kHz (16, 32, 48) - required only with raw PCM inputs", + .description = "Input sampling rate in kHz (16, 32, 48) - required only with raw\nPCM inputs", }, { .id = CmdLnOptionId_trajFile, .match = "trajectory_file", .matchShort = "T", - .description = "Head rotation trajectory file for simulation of head tracking (only for binaural outputs)", + .description = "Head rotation trajectory file for simulation of head tracking\n(only for binaural outputs)", }, { .id = CmdLnOptionId_refRotFile, .match = "reference_rotation_file", .matchShort = "rf", - .description = "Reference rotation trajectory file for simulation of head tracking (only for binaural outputs)", + .description = "Reference rotation trajectory file for simulation of head tracking\n(only for binaural outputs)", }, { .id = CmdLnOptionId_customHrtfFile, .match = "custom_hrtf", .matchShort = "hrtf", - .description = "Custom HRTF file for binaural rendering (only for binaural outputs)", + .description = "Custom HRTF file for binaural rendering\n(only for binaural outputs)", }, { .id = CmdLnOptionId_renderConfigFile, .match = "render_config_parameters", .matchShort = "render_config", - .description = "Binaural renderer configuration parameters in file (only for binaural outputs)", + .description = "Binaural renderer configuration parameters in file\n(only for binaural outputs)", }, { .id = CmdLnOptionId_nonDiegeticPan, .match = "non_diegetic_panning", .matchShort = "non_diegetic_pan", - .description = "Panning mono non diegetic sound to stereo -90<= pan <= 90\nleft or l or 90->left, right or r or -90->right, center or c or 0 ->middle\n", + .description = "Panning mono non diegetic sound to stereo -90<= pan <= 90\nleft or l or 90->left, right or r or -90->right,\ncenter or c or 0 ->middle", }, { .id = CmdLnOptionId_orientationTracking, .match = "tracking_type", .matchShort = "otr", - .description = "Head orientation tracking type: 'none', 'ref', 'avg' or `ref_vec` or `ref_vec_lev` (only for binaural outputs)", + .description = "Head orientation tracking type: 'none', 'ref', 'avg' or `ref_vec`\nor `ref_vec_lev` (only for binaural outputs)", }, { .id = CmdlnOptionId_lfePosition, .match = "lfe_position", .matchShort = "lp", - .description = "Output LFE position. Comma-delimited triplet of [gain, azimuth, elevation] where gain is linear (like --gain, -g) and azimuth, elevation are in degrees.\nIf specified, overrides the default behavior which attempts to map input to output LFE channel(s)", + .description = "Output LFE position. Comma-delimited triplet of [gain, azimuth,\nelevation] where gain is linear (like --gain, -g) and azimuth,\nelevation are in degrees. If specified, overrides the default\nbehavior which attempts to map input to output LFE channel(s)", + }, + { + .id = CmdlnOptionId_lfeMatrix, + .match = "lfe_matrix", + .matchShort = "lm", + .description = "LFE panning matrix. File (CSV table) containing a matrix of\ndimensions [ num_input_lfe x num_output_channels ] with elements\nspecifying linear routing gain (like --gain, -g). If specified,\noverrides the output LFE position option and the default\nbehavior which attempts to map input to output LFE channel(s)", }, - { .id = CmdlnOptionId_lfeMatrix, - .match = "lfe_matrix", - .matchShort = "lm", - .description = "LFE panning matrix. File (CSV table) containing a matrix of dimensions [ num_input_lfe x num_output_channels ] with elements specifying linear routing gain (like --gain, -g). \nIf specified, overrides the output LFE position option and the default behavior which attempts to map input to output LFE channel(s)" }, { .id = CmdLnOptionId_noDelayCmp, - .match = "no_delay_comparison", + .match = "no_delay_compensation", .matchShort = "no_delay_cmp", .description = "[flag] Turn off delay compensation", }, @@ -297,7 +299,7 @@ static const CmdLnParser_Option cliOptions[] = { .id = CmdLnOptionId_complexityLevel, .match = "complexity_level", .matchShort = "level", - .description = "Complexity level, level = (1, 2, 3), will be defined after characterisation.", + .description = "Complexity level, level = (1, 2, 3), will be defined after\ncharacterisation.", }, { .id = CmdLnOptionId_quietModeEnabled, @@ -321,13 +323,13 @@ static const CmdLnParser_Option cliOptions[] = { .id = CmdLnOptionId_referenceVectorFile, .match = "reference_vector_file", .matchShort = "rvf", - .description = "Reference vector trajectory file for simulation of head tracking (only for binaural outputs)", + .description = "Reference vector trajectory file for simulation of head tracking\n(only for binaural outputs)", }, { .id = CmdLnOptionId_exteriorOrientationFile, .match = "exterior_orientation_file", .matchShort = "exof", - .description = "External orientation trajectory file for simulation of external orientations", + .description = "External orientation trajectory file for simulation of external\norientations", }, { .id = CmdLnOptionId_framing, @@ -339,19 +341,19 @@ static const CmdLnParser_Option cliOptions[] = { .id = CmdLnOptionId_syncMdDelay, .match = "sync_md_delay", .matchShort = "smd", - .description = "Metadata Synchronization Delay in ms, Default is 0. Quantized by 5ms subframes for TDRenderer (13ms -> 10ms -> 2subframes)", + .description = "Metadata Synchronization Delay in ms, Default is 0. Quantized by\n5ms subframes for TDRenderer (13ms -> 10ms -> 2subframes)", }, { .id = CmdLnOptionId_directivityPatternId, .match = "ism_directivity_pattern_id", .matchShort = "dpid", - .description = "Directivity pattern ID(s) = [ID1, ID2, ID3, ID4]. Space-separated list of up to 4 numbers (unsigned integers) can be specified for BINAURAL and BINAURAL_ROOM_REVERB output configuration.\nID1, ID2, ID3, ID4 specify the directivity pattern IDs used for ISMs 1,2,3 and 4 respectively.\nThis options needs to be accompanied by a render_config file, otherwise a default directivity pattern is used.", + .description = "Directivity pattern ID(s) = [ID1, ID2, ID3, ID4]. Space-separated\nlist of up to 4 numbers (unsigned integers) can be specified for\nBINAURAL and BINAURAL_ROOM_REVERB output.\nID1, ID2, ID3, ID4 specify the directivity pattern IDs used for\nISMs 1,2,3 and 4 respectively. \nThis option needs to be accompanied by a render_config file,\notherwise a default directivity pattern is used.", }, { .id = CmdLnOptionId_acousticEnvironmentId, .match = "acoustic_environment_id", .matchShort = "aeid", - .description = "Acoustic environment ID (number >= 0) for BINAURAL_ROOM_REVERB output configuration", + .description = "Acoustic environment ID (number >= 0) for BINAURAL_ROOM_REVERB output.", }, }; @@ -366,6 +368,8 @@ static IVAS_AUDIO_CONFIG ambisonicsOrderToEnum( const int16_t order ); static void parseSceneDescriptionFile( char *path, char *audioFilePath, InputConfig *inConfig, IsmPositionProvider *positionProvider, MasaFileReader **masaReaders, LfeRoutingConfig **lfeRoutingConfigs ); +static void parseCombinedFormatInput( InputConfig *inConfig, char **configString ); + static ivas_error parseCustomLayoutFile( const char *filePath, IVAS_CUSTOM_LS_DATA *pLsSetupCustom ); static CmdlnArgs parseCmdlnArgs( const int argc, char **argv ); @@ -525,25 +529,7 @@ static void setupWithSingleFormatInput( strncpy( audioFilePath, args.inputFilePath, FILENAME_MAX - 1 ); /* Depending on input format, prepare metadata reading for ISM or MASA */ - if ( args.inConfig.numMasaBuses != 0 ) - { - if ( args.inConfig.numMasaBuses != args.numInMetadataFiles ) - { - fprintf( stderr, "Error: all MASA inputs must have a corresponding metadata file" ); - exit( -1 ); - } - - for ( int16_t i = 0; i < args.numInMetadataFiles; ++i ) - { - masaReaders[i] = MasaFileReader_open( args.inMetadataFilePaths[i] ); - if ( masaReaders[i] == NULL ) - { - fprintf( stderr, "Could not open MASA metadata file %s\n", args.inMetadataFilePaths[i] ); - exit( -1 ); - } - } - } - else if ( args.inConfig.numAudioObjects != 0 ) + if ( args.inConfig.numAudioObjects != 0 ) { positionProvider->numObjects = args.inConfig.numAudioObjects; for ( int16_t i = 0; i < positionProvider->numObjects; ++i ) @@ -566,6 +552,26 @@ static void setupWithSingleFormatInput( } } } + if ( args.inConfig.numMasaBuses != 0 ) + { + if ( args.inConfig.numMasaBuses != ( args.numInMetadataFiles - args.inConfig.numAudioObjects ) ) + { + fprintf( stderr, "Error: all MASA inputs must have a corresponding metadata file" ); + exit( -1 ); + } + + int16_t reader_idx = 0; + for ( int16_t i = args.inConfig.numAudioObjects; i < args.numInMetadataFiles; ++i ) + { + reader_idx = i - args.inConfig.numAudioObjects; + masaReaders[reader_idx] = MasaFileReader_open( args.inMetadataFilePaths[i] ); + if ( masaReaders[reader_idx] == NULL ) + { + fprintf( stderr, "Could not open MASA metadata file %s\n", args.inMetadataFilePaths[i] ); + exit( -1 ); + } + } + } return; } @@ -1728,16 +1734,11 @@ static bool parseInConfig( inConfig->masaBuses[0].gain_dB = 0.0f; break; case IVAS_AUDIO_CONFIG_OBA: - /* If input format is objects, parse the characters after "ISM" to get number of objects */ + /* If input format is objects, parse the characters after "ISM" to get + * number of objects and check for combined formats. */ { char *ptr = NULL; inConfig->numAudioObjects = (uint16_t) strtol( inFormatStr + 3, &ptr, 10 ); - if ( ptr == NULL || *ptr != '\0' ) - { - /* Failed to parse string as a number */ - fprintf( stderr, "Cannot parse string \"%s\" as a valid input format", inFormatStr ); - return false; - } if ( inConfig->numAudioObjects > RENDERER_MAX_ISM_INPUTS ) { fprintf( stderr, "Too many objects at input. Max %d supported.", RENDERER_MAX_ISM_INPUTS ); @@ -1749,6 +1750,17 @@ static bool parseInConfig( inConfig->audioObjects[i].inputChannelIndex = i; inConfig->audioObjects[i].gain_dB = 0.0f; } + if ( *ptr != '\0' ) + { + /* Try to parse combined format */ + parseCombinedFormatInput( inConfig, &ptr ); + } + if ( ptr == NULL || *ptr != '\0' ) + { + /* Failed to parse string as a number */ + fprintf( stderr, "Cannot parse string \"%s\" as a valid input format", inFormatStr ); + return false; + } } break; case IVAS_AUDIO_CONFIG_INVALID: @@ -2179,7 +2191,7 @@ static void parseOption( } break; case CmdLnOptionId_inputMetadata: - assert( numOptionValues <= RENDERER_MAX_ISM_INPUTS ); + assert( numOptionValues <= RENDERER_MAX_ISM_INPUTS + RENDERER_MAX_MASA_INPUTS ); for ( int16_t i = 0; i < numOptionValues; ++i ) { strncpy( args->inMetadataFilePaths[i], optionValues[i], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); @@ -2994,6 +3006,41 @@ static void parseMasa( return; } +static void parseCombinedFormatInput( + InputConfig *inConfig, + char **configString ) +{ + IVAS_AUDIO_CONFIG audioConfig; + audioConfig = parseAudioConfig( *configString ); + + if ( audioConfig == IVAS_AUDIO_CONFIG_FOA || audioConfig == IVAS_AUDIO_CONFIG_HOA2 || audioConfig == IVAS_AUDIO_CONFIG_HOA3 ) + { + /* OSBA */ + inConfig->numAmbisonicsBuses = 1; + inConfig->ambisonicsBuses[0].audioConfig = audioConfig; + inConfig->ambisonicsBuses[0].inputChannelIndex = inConfig->numAudioObjects; + inConfig->ambisonicsBuses[0].gain_dB = -6.f; + *configString += 4; + + /* Modify input gain for objects too */ + for ( int16_t i = 0; i < inConfig->numAudioObjects; ++i ) + { + inConfig->audioObjects[i].gain_dB = -6.f; + } + } + else if ( audioConfig == IVAS_AUDIO_CONFIG_MASA1 || audioConfig == IVAS_AUDIO_CONFIG_MASA2 ) + { + /* OMASA */ + inConfig->numMasaBuses = 1; + inConfig->masaBuses[0].audioConfig = audioConfig; + inConfig->masaBuses[0].inputChannelIndex = inConfig->numAudioObjects; + inConfig->masaBuses[0].gain_dB = 0.0f; + *configString += 5; + } + + return; +} + static ivas_error parseCustomLayoutFile( const char *filePath, IVAS_CUSTOM_LS_DATA *pLsSetupCustom ) @@ -3210,10 +3257,13 @@ static void printSupportedAudioConfigs( void ) "HOA2", "HOA3", "ISMx (input only)", + "ISMxSBAy (OSBA, input only)", + "ISMxMASAy (OMASA, input only)", "MASAx", "BINAURAL (output only)", "BINAURAL_ROOM_IR (output only)", "BINAURAL_ROOM_REVERB (output only)", + "META (Scene description, input only)", }; fprintf( stdout, "Supported audio formats:\n" ); @@ -3221,6 +3271,7 @@ static void printSupportedAudioConfigs( void ) { fprintf( stdout, "%s\n", supportedFormats[i] ); } + fprintf( stdout, "\n" ); return; } -- GitLab From 8c67776d9ab6605fef3e294c8912abe9ae7e849f Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Thu, 12 Jun 2025 09:07:06 +0200 Subject: [PATCH 07/13] Fix for HRTF file loading in CI --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9ec43210b..c517b972b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -153,6 +153,7 @@ stages: - sed -i '/fetch/d' .git/config # Remove all fetch lines to clean out dead links - git remote set-branches --add origin $BASOP_CI_BRANCH_PC_REPO # Add currently used branch - git fetch + - git restore --staged . # Needed if HRTF model files were updated. - git restore . # Just as a precaution - git checkout $BASOP_CI_BRANCH_PC_REPO - git pull -- GitLab From e1c60fb0cf0b378ab1399d79ace94832de2a8778 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Thu, 12 Jun 2025 10:02:28 +0200 Subject: [PATCH 08/13] remove extra frame argument under DBG_BITSTRREAM_ANALYSIS --- apps/encoder.c | 7 +------ lib_com/bitstream.c | 22 ++-------------------- lib_com/prot.h | 4 ---- lib_enc/ivas_qmetadata_enc.c | 2 +- lib_enc/lib_enc.c | 22 ++-------------------- lib_enc/lib_enc.h | 8 -------- 6 files changed, 6 insertions(+), 59 deletions(-) diff --git a/apps/encoder.c b/apps/encoder.c index 55b36e935..dfd3da593 100644 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -785,12 +785,7 @@ int main( } /* *** Encode one frame *** */ - if ( ( error = IVAS_ENC_EncodeFrameToSerial( hIvasEnc, pcmBuf, pcmBufSize, bitStream, &numBits -#ifdef DBG_BITSTREAM_ANALYSIS - , - frame -#endif - ) ) != IVAS_ERR_OK ) + if ( ( error = IVAS_ENC_EncodeFrameToSerial( hIvasEnc, pcmBuf, pcmBufSize, bitStream, &numBits ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nencodeFrame failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) ); goto cleanup; diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index 6b37cdae8..85c77fcab 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -3388,10 +3388,6 @@ static ivas_error write_indices_element( uint16_t **pt_stream, /* i : pointer to bitstream buffer */ const int16_t is_SCE, /* i : flag to distingusih SCE and CPE */ const int16_t element_id /* i : id of the SCE or CPE */ -#ifdef DBG_BITSTREAM_ANALYSIS - , - int32_t frame -#endif ) { int16_t ch; @@ -3625,10 +3621,6 @@ ivas_error write_indices_ivas( Encoder_Struct *st_ivas, /* i/o: encoder state structure */ uint16_t *bit_stream, /* i/o: output bitstream */ uint16_t *num_bits /* i : number of indices written to output */ -#ifdef DBG_BITSTREAM_ANALYSIS - , - int32_t frame -#endif ) { int16_t i, n; @@ -3694,22 +3686,12 @@ ivas_error write_indices_ivas( for ( n = 0; n < st_ivas->nSCE; n++ ) { - write_indices_element( st_ivas, &pt_stream, 1, n -#ifdef DBG_BITSTREAM_ANALYSIS - , - frame -#endif - ); + write_indices_element( st_ivas, &pt_stream, 1, n ); } for ( n = 0; n < st_ivas->nCPE; n++ ) { - write_indices_element( st_ivas, &pt_stream, 0, n -#ifdef DBG_BITSTREAM_ANALYSIS - , - frame -#endif - ); + write_indices_element( st_ivas, &pt_stream, 0, n ); } *num_bits = (uint16_t) ( pt_stream - bit_stream ); diff --git a/lib_com/prot.h b/lib_com/prot.h index c3acc73e8..dd7965ad1 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -589,10 +589,6 @@ ivas_error write_indices_ivas( Encoder_Struct *st_ivas, /* i/o: encoder state structure */ uint16_t *bit_stream, /* i/o: output bitstream */ uint16_t *num_bits /* i/o: number of bits written to output */ -#ifdef DBG_BITSTREAM_ANALYSIS - , - int32_t frame -#endif ); Word16 rate2EVSmode( diff --git a/lib_enc/ivas_qmetadata_enc.c b/lib_enc/ivas_qmetadata_enc.c index 565b2642c..0fae21939 100644 --- a/lib_enc/ivas_qmetadata_enc.c +++ b/lib_enc/ivas_qmetadata_enc.c @@ -1290,7 +1290,7 @@ void reset_metadata_spatial( #endif hMetaData->nb_bits_tot += hMetaData->ind_list[j].nb_bits; hMetaData->ind_list[i].nb_bits = -1; -#ifdef BISTREAM_ANALYSIS +#ifdef DBG_BITSTREAM_ANALYSIS sprintf( hMetaData->ind_list[i].function_name, "RESET in reset_metadata_spatial" ); #endif } diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index 66331a3f6..070d344fd 100644 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -1143,10 +1143,6 @@ ivas_error IVAS_ENC_EncodeFrameToSerial( int16_t inputBufferSize, /* i : total number of samples in the input buffer. Related function: IVAS_ENC_GetInputBufferSize() */ uint16_t *outputBitStream, /* o : pointer to serial output bitstream. The array must already be allocated and be of size at least IVAS_MAX_BITS_PER_FRAME */ uint16_t *numOutBits /* o : number of bits written to output bitstream. Each bit is stored as a single uint16_t value */ -#ifdef DBG_BITSTREAM_ANALYSIS - , - int32_t frame -#endif ) { Encoder_Struct *st_ivas; @@ -1352,12 +1348,7 @@ ivas_error IVAS_ENC_EncodeFrameToSerial( } /* write indices into bitstream buffer */ - write_indices_ivas( st_ivas, outputBitStream, numOutBits -#ifdef DBG_BITSTREAM_ANALYSIS - , - frame -#endif - ); + write_indices_ivas( st_ivas, outputBitStream, numOutBits ); /* Reset switching flag before next call - can be set to "true" by some setters */ hIvasEnc->switchingActive = false; @@ -1378,21 +1369,12 @@ ivas_error IVAS_ENC_EncodeFrameToCompact( const int16_t inputBufferSize, /* i : total number of samples in the input buffer. Related function: IVAS_ENC_GetInputBufferSize() */ uint8_t *outputBitStream, /* o : pointer to compact output bitstream. The array must already be allocated. */ uint16_t *numOutBits /* o : number of bits written to output bitstream */ -#ifdef DBG_BITSTREAM_ANALYSIS - , - int32_t frame -#endif ) { ivas_error error; uint16_t bitstream[IVAS_MAX_BITS_PER_FRAME]; - if ( ( error = IVAS_ENC_EncodeFrameToSerial( hIvasEnc, inputBuffer, inputBufferSize, bitstream, numOutBits -#ifdef DBG_BITSTREAM_ANALYSIS - , - frame -#endif - ) ) != IVAS_ERR_OK ) + if ( ( error = IVAS_ENC_EncodeFrameToSerial( hIvasEnc, inputBuffer, inputBufferSize, bitstream, numOutBits ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_enc/lib_enc.h b/lib_enc/lib_enc.h index 043e4c271..5a42c3dad 100644 --- a/lib_enc/lib_enc.h +++ b/lib_enc/lib_enc.h @@ -298,10 +298,6 @@ ivas_error IVAS_ENC_EncodeFrameToSerial( int16_t inputBufferSize, /* i : total number of samples in the input buffer. Related function: IVAS_ENC_GetInputBufferSize() */ uint16_t *outputBitStream, /* o : pointer to serial output bitstream. The array must already be allocated and be of size at least IVAS_MAX_BITS_PER_FRAME */ uint16_t *numOutBits /* o : number of bits written to output bitstream. Each bit is stored as a single uint16_t value */ -#ifdef DBG_BITSTREAM_ANALYSIS - , - int32_t frame -#endif ); /*! r: error code */ @@ -311,10 +307,6 @@ ivas_error IVAS_ENC_EncodeFrameToCompact( const int16_t inputBufferSize, /* i : total number of samples in the input buffer. Related function: IVAS_ENC_GetInputBufferSize() */ uint8_t *outputBitStream, /* o : pointer to compact output bitstream. The array must already be allocated. */ uint16_t *numOutBits /* o : number of bits written to output bitstream */ -#ifdef DBG_BITSTREAM_ANALYSIS - , - int32_t frame -#endif ); /* Setter functions - apply changes to encoder configuration */ -- GitLab From 41bb709f910667e8cce9244955e5e33056900f99 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Thu, 12 Jun 2025 13:10:18 +0200 Subject: [PATCH 09/13] make all instances of DBG_BITSTREAM_ANALYSIS explicitly dependent on DEBUGGING --- lib_com/bitstream.c | 34 +++++++++++++-------------- lib_com/options.h | 2 +- lib_com/prot.h | 6 ++--- lib_enc/ivas_corecoder_enc_reconfig.c | 8 +++---- lib_enc/ivas_init_enc.c | 2 +- lib_enc/ivas_qmetadata_enc.c | 12 +++++----- lib_enc/ivas_spar_md_enc.c | 2 +- lib_enc/lib_enc.c | 2 +- lib_enc/stat_enc.h | 2 +- 9 files changed, 35 insertions(+), 35 deletions(-) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index 85c77fcab..989127e00 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -50,7 +50,7 @@ #include "ivas_cnst.h" #include "ivas_rom_com.h" #include "wmc_auto.h" -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) #include #endif @@ -212,7 +212,7 @@ ivas_error ind_list_realloc( { new_ind_list[i].id = old_ind_list[i].id; new_ind_list[i].value = old_ind_list[i].value; -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) strncpy( new_ind_list[i].function_name, old_ind_list[i].function_name, 100 ); #endif } @@ -223,7 +223,7 @@ ivas_error ind_list_realloc( for ( ; i < max_num_indices; i++ ) { new_ind_list[i].nb_bits = -1; -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) sprintf( new_ind_list[i].function_name, "RESET in ind_list_realloc" ); #endif } @@ -812,7 +812,7 @@ void move_indices( new_ind_list[i].value = old_ind_list[i].value; new_ind_list[i].nb_bits = old_ind_list[i].nb_bits; -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) strncpy( new_ind_list[i].function_name, old_ind_list[i].function_name, 100 ); #endif old_ind_list[i].nb_bits = -1; @@ -825,12 +825,12 @@ void move_indices( new_ind_list[i].id = old_ind_list[i].id; new_ind_list[i].value = old_ind_list[i].value; new_ind_list[i].nb_bits = old_ind_list[i].nb_bits; -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) strncpy( new_ind_list[i].function_name, old_ind_list[i].function_name, 100 ); #endif old_ind_list[i].nb_bits = -1; -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) sprintf( old_ind_list[i].function_name, "RESET in move_indices" ); #endif } @@ -909,7 +909,7 @@ ivas_error check_ind_list_limits( return error; } -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) const char *named_indices_table[] = { "IND_IVAS_FORMAT", "IND_SMODE_OMASA", @@ -2837,7 +2837,7 @@ ivas_error push_indice( hBstr->ind_list[j].id = hBstr->ind_list[j - 1].id; hBstr->ind_list[j].nb_bits = hBstr->ind_list[j - 1].nb_bits; hBstr->ind_list[j].value = hBstr->ind_list[j - 1].value; -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) strncpy( hBstr->ind_list[j].function_name, hBstr->ind_list[j - 1].function_name, 100 ); #endif } @@ -2848,7 +2848,7 @@ ivas_error push_indice( hBstr->ind_list[i].id = id; hBstr->ind_list[i].value = value; hBstr->ind_list[i].nb_bits = nb_bits; -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) strncpy( hBstr->ind_list[i].function_name, named_indices_table[id], 100 ); #endif @@ -2865,7 +2865,7 @@ ivas_error push_indice( * Push a new indice into the buffer at the next position *-------------------------------------------------------------------*/ -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) ivas_error push_next_indice_( const char *caller, #else @@ -2915,7 +2915,7 @@ ivas_error push_next_indice( hBstr->ind_list[hBstr->nb_ind_tot].value = value; hBstr->ind_list[hBstr->nb_ind_tot].nb_bits = nb_bits; -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) strncpy( hBstr->ind_list[hBstr->nb_ind_tot].function_name, caller, 100 ); #endif @@ -2932,7 +2932,7 @@ ivas_error push_next_indice( * Push a bit buffer into the buffer at the next position *-------------------------------------------------------------------*/ -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) ivas_error push_next_bits_( const char *caller, #else @@ -2978,7 +2978,7 @@ ivas_error push_next_bits( ptr->value = code; ptr->nb_bits = 16; ptr->id = prev_id; -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) strncpy( ptr->function_name, caller, 100 ); #endif hBstr->nb_ind_tot++; @@ -2997,7 +2997,7 @@ ivas_error push_next_bits( ptr->value = bits[i]; ptr->nb_bits = 1; ptr->id = prev_id; -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) strncpy( ptr->function_name, caller, 100 ); #endif hBstr->nb_ind_tot++; @@ -3069,7 +3069,7 @@ uint16_t delete_indice( hBstr->ind_list[j].id = hBstr->ind_list[i].id; hBstr->ind_list[j].value = hBstr->ind_list[i].value; hBstr->ind_list[j].nb_bits = hBstr->ind_list[i].nb_bits; -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) strncpy( hBstr->ind_list[j].function_name, hBstr->ind_list[i].function_name, 100 ); #endif } @@ -3083,7 +3083,7 @@ uint16_t delete_indice( { /* reset the shifted indices at the end of the list */ hBstr->ind_list[j].nb_bits = -1; -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) sprintf( hBstr->ind_list[j].function_name, "RESET in delete_indice" ); #endif } @@ -3509,7 +3509,7 @@ static ivas_error write_indices_element( } -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) if ( is_SCE ) /* EVS and SCE */ { static FILE *f1 = 0; diff --git a/lib_com/options.h b/lib_com/options.h index 16880c701..e9e87e225 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -48,7 +48,7 @@ /* ################### Start DEBUGGING switches ########################### */ #ifndef RELEASE -/*#define DEBUGGING*/ /* Activate debugging part of the code */ +#define DEBUGGING /* Activate debugging part of the code */ #endif /*#define WMOPS*/ /* Activate complexity and memory counters */ /*#define WMOPS_PER_FRAME*/ /* Output per-frame complexity (writes one float value per frame to the file "wmops_analysis") */ diff --git a/lib_com/prot.h b/lib_com/prot.h index dd7965ad1..30e895ccd 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -473,12 +473,12 @@ ivas_error push_indice( int16_t nb_bits /* i : number of bits used to quantize the indice */ ); -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) #define push_next_indice( ... ) push_next_indice_( __func__, __VA_ARGS__ ) #define push_next_bits( ... ) push_next_bits_( __func__, __VA_ARGS__ ); #endif -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) ivas_error push_next_indice_( const char *caller, #else @@ -489,7 +489,7 @@ ivas_error push_next_indice( int16_t nb_bits /* i : number of bits used to quantize the indice */ ); -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) ivas_error push_next_bits_( const char *caller, #else diff --git a/lib_enc/ivas_corecoder_enc_reconfig.c b/lib_enc/ivas_corecoder_enc_reconfig.c index f7b5a4dd7..b5339333d 100644 --- a/lib_enc/ivas_corecoder_enc_reconfig.c +++ b/lib_enc/ivas_corecoder_enc_reconfig.c @@ -40,7 +40,7 @@ #include #endif #include "wmc_auto.h" -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) #include #endif @@ -170,7 +170,7 @@ ivas_error ivas_corecoder_enc_reconfig( temp_ind_list[i].id = hBstr->ind_list[i].id; temp_ind_list[i].value = hBstr->ind_list[i].value; temp_ind_list[i].nb_bits = hBstr->ind_list[i].nb_bits; -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) strncpy( temp_ind_list[i].function_name, hBstr->ind_list[i].function_name, 100 ); #endif hBstr->ind_list[i].nb_bits = -1; @@ -376,7 +376,7 @@ ivas_error ivas_corecoder_enc_reconfig( st_ivas->hSCE[0]->hCoreCoder[0]->hBstr->ind_list[i].id = temp_ind_list[i].id; st_ivas->hSCE[0]->hCoreCoder[0]->hBstr->ind_list[i].value = temp_ind_list[i].value; st_ivas->hSCE[0]->hCoreCoder[0]->hBstr->ind_list[i].nb_bits = temp_ind_list[i].nb_bits; -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) strncpy( st_ivas->hSCE[0]->hCoreCoder[0]->hBstr->ind_list[i].function_name, temp_ind_list[i].function_name, 100 ); #endif } @@ -396,7 +396,7 @@ ivas_error ivas_corecoder_enc_reconfig( st_ivas->hCPE[0]->hCoreCoder[0]->hBstr->ind_list[i].id = temp_ind_list[i].id; st_ivas->hCPE[0]->hCoreCoder[0]->hBstr->ind_list[i].value = temp_ind_list[i].value; st_ivas->hCPE[0]->hCoreCoder[0]->hBstr->ind_list[i].nb_bits = temp_ind_list[i].nb_bits; -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) strncpy( st_ivas->hCPE[0]->hCoreCoder[0]->hBstr->ind_list[i].function_name, temp_ind_list[i].function_name, 100 ); #endif } diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index cd6a43f2b..6f2672cfc 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -42,7 +42,7 @@ #include "debug.h" #endif #include "wmc_auto.h" -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) #include #endif diff --git a/lib_enc/ivas_qmetadata_enc.c b/lib_enc/ivas_qmetadata_enc.c index 0fae21939..9508496e5 100644 --- a/lib_enc/ivas_qmetadata_enc.c +++ b/lib_enc/ivas_qmetadata_enc.c @@ -42,7 +42,7 @@ #include "wmc_auto.h" #include "prot.h" #include "basop_settings.h" -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) #include #endif @@ -1276,7 +1276,7 @@ void reset_metadata_spatial( for ( i = 0; i < next_ind_sid; i++ ) { hMetaData->ind_list[i].nb_bits = -1; -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) sprintf( hMetaData->ind_list[i].function_name, "RESET in reset_metadata_spatial" ); #endif } @@ -1285,12 +1285,12 @@ void reset_metadata_spatial( { hMetaData->ind_list[j].value = hMetaData->ind_list[i].value; hMetaData->ind_list[j].nb_bits = hMetaData->ind_list[i].nb_bits; -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) strncpy( hMetaData->ind_list[j].function_name, hMetaData->ind_list[i].function_name, 100 ); #endif hMetaData->nb_bits_tot += hMetaData->ind_list[j].nb_bits; hMetaData->ind_list[i].nb_bits = -1; -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) sprintf( hMetaData->ind_list[i].function_name, "RESET in reset_metadata_spatial" ); #endif } @@ -1317,7 +1317,7 @@ void reset_metadata_spatial( hMetaData->nb_ind_tot--; hMetaData->nb_bits_tot -= hMetaData->ind_list[hMetaData->nb_ind_tot].nb_bits; hMetaData->ind_list[hMetaData->nb_ind_tot].nb_bits = -1; -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) sprintf( hMetaData->ind_list[hMetaData->nb_ind_tot].function_name, "RESET in reset_metadata_spatial" ); #endif } @@ -1975,7 +1975,7 @@ void restore_metadata_buffer( for ( i = next_ind_start; i < hMetaData->nb_ind_tot; i++ ) { hMetaData->ind_list[i].nb_bits = -1; -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) sprintf( hMetaData->ind_list[i].function_name, "RESET in restore_metadata_buffer" ); #endif } diff --git a/lib_enc/ivas_spar_md_enc.c b/lib_enc/ivas_spar_md_enc.c index 514b093f3..f464de182 100644 --- a/lib_enc/ivas_spar_md_enc.c +++ b/lib_enc/ivas_spar_md_enc.c @@ -450,7 +450,7 @@ static void write_metadata_buffer( for ( i = 0; i < hMetaData_tmp->nb_ind_tot; i++ ) { -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) push_next_indice_( hMetaData_tmp->ind_list[i].function_name, hMetaData, hMetaData_tmp->ind_list[i].value, hMetaData_tmp->ind_list[i].nb_bits ); #else push_next_indice( hMetaData, hMetaData_tmp->ind_list[i].value, hMetaData_tmp->ind_list[i].nb_bits ); diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index 070d344fd..984dc90f7 100644 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -1240,7 +1240,7 @@ ivas_error IVAS_ENC_EncodeFrameToSerial( { st_ivas->ind_list[i].nb_bits = -1; } -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) for ( i = 0; i < st_ivas->ivas_max_num_indices; i++ ) { memset( st_ivas->ind_list[i].function_name, 'A', 100 * sizeof( char ) ); diff --git a/lib_enc/stat_enc.h b/lib_enc/stat_enc.h index a2a4fd06e..05e56ef4a 100644 --- a/lib_enc/stat_enc.h +++ b/lib_enc/stat_enc.h @@ -55,7 +55,7 @@ typedef struct int16_t id; /* id of the indice */ uint16_t value; /* value of the quantized indice */ int16_t nb_bits; /* number of bits used for the quantization of the indice */ -#ifdef DBG_BITSTREAM_ANALYSIS +#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) char function_name[100]; #endif } Indice, *INDICE_HANDLE; -- GitLab From a02a770695fac58d4d99a2321349aa64b3a6c586 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Thu, 26 Jun 2025 11:23:29 +0200 Subject: [PATCH 10/13] disable DEBUGGING --- lib_com/options.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 245469e55..9b03463a1 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -48,7 +48,7 @@ /* ################### Start DEBUGGING switches ########################### */ #ifndef RELEASE -#define DEBUGGING /* Activate debugging part of the code */ +/*#define DEBUGGING*/ /* Activate debugging part of the code */ #endif /*#define WMOPS*/ /* Activate complexity and memory counters */ /*#define WMOPS_PER_FRAME*/ /* Output per-frame complexity (writes one float value per frame to the file "wmops_analysis") */ -- GitLab From afabc246d31181e434b7f95c6a8c9c26c031f4e8 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Thu, 26 Jun 2025 11:28:11 +0200 Subject: [PATCH 11/13] fix includes in lib_com/bitstream.c --- lib_com/bitstream.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index 989127e00..7d10e5155 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -37,9 +37,6 @@ #include #include #include "options.h" -#ifdef DEBUGGING -#include "debug.h" -#endif #include "cnst.h" #include "prot.h" #include "stat_enc.h" @@ -50,9 +47,12 @@ #include "ivas_cnst.h" #include "ivas_rom_com.h" #include "wmc_auto.h" -#if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) +#ifdef DEBUGGING +#include "debug.h" +#ifdef DBG_BITSTREAM_ANALYSIS #include #endif +#endif #ifdef DEBUGGING -- GitLab From 0fc79a40c746dfa6b5cc90b03925a383f86b0087 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 2 Jul 2025 12:26:14 +0200 Subject: [PATCH 12/13] [fix] MASA number of output channels not set correctly for Custom LS output in external renderer --- lib_rend/lib_rend.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 26ac7c731..8a7a5a56e 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -6912,7 +6912,11 @@ static ivas_error initMasaExtRenderer( return error; } - if ( ( error = getAudioConfigNumChannels( outConfig, &hMasaExtRend->nchan_output ) ) != IVAS_ERR_OK ) + if ( outConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) + { + hMasaExtRend->nchan_output = inputMasa->base.ctx.pCustomLsOut->num_spk + inputMasa->base.ctx.pCustomLsOut->num_lfe; + } + else if ( ( error = getAudioConfigNumChannels( outConfig, &hMasaExtRend->nchan_output ) ) != IVAS_ERR_OK ) { return error; } -- GitLab From 7ef57f6143adc99754b2cee1364804a7c9ca1259 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Wed, 9 Jul 2025 11:34:10 +0200 Subject: [PATCH 13/13] fix build failures from merge --- apps/decoder.c | 4 ---- lib_dec/lib_dec.c | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 8350960f2..1df9c9353 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -3270,11 +3270,7 @@ static ivas_error decodeVoIP( int16_t nSamplesFlushed = 0; /* decode and get samples */ -#ifdef SPLIT_REND_WITH_HEAD_ROT if ( ( error = IVAS_DEC_Flush( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, &nSamplesFlushed ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_Flush( hIvasDec, nOutSamples, pcmBuf, &nSamplesFlushed ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nError in IVAS_DEC_VoIP_Flush: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 67645cbe2..e08b838e3 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -2744,7 +2744,7 @@ ivas_error IVAS_DEC_Flush( if ( nSamplesToRender > 0 && hIvasDec->st_ivas->ivas_format != MONO_FORMAT ) { #endif - error = IVAS_DEC_GetRenderedSamples( hIvasDec, nSamplesToRender, &nSamplesFlushedLocal, &hIvasDec->nSamplesAvailableNext, pcmBuf ); + error = IVAS_DEC_GetRenderedSamples( hIvasDec, nSamplesToRender, &nSamplesFlushedLocal, &hIvasDec->nSamplesAvailableNext, pcmType, pcmBuf ); #ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE } else -- GitLab