From 5182446781d5c99c0c4161a19dc78d0fb9ae4fa5 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Wed, 7 Jan 2026 13:29:31 +0100 Subject: [PATCH 1/5] - add warning message when renderer frame size is modififed in ISAR - simplify logic around ivas_limiter_dec() --- apps/decoder.c | 8 ++++++++ lib_com/options.h | 1 + lib_dec/lib_dec_fx.c | 13 +++++++++++++ 3 files changed, 22 insertions(+) diff --git a/apps/decoder.c b/apps/decoder.c index 401a26761..2060094bf 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -452,6 +452,14 @@ int main( fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } + +#ifdef FIX_1449_RENDERER_FRAME_SIZE_UNCLEAR_IN_ISAR + if ( !arg.renderConfigEnabled && ( arg.renderFramesize != asked_frame_size ) ) + { + fprintf( stderr, "\nChanged render framesize, only 20ms are allowed for non-0dof split rendering!\n" ); + } +#endif + } /*------------------------------------------------------------------------------------------* diff --git a/lib_com/options.h b/lib_com/options.h index 2c70dd14f..25037c799 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -103,6 +103,7 @@ #define FIX_1904_HARM_GSC_ENC /* VA: #1904 Harmonization of EVS and IVAS GSC code */ #define FIX_2271_OOB_INDEXING_IN_PIT_OL2 /* VA: Fix for issue 2271, to silence clang18 */ #define FIX_2273_OOB_INDEXING_IN_PIT_FR4 /* VA: Fix to silence clang on ptr init */ +#define FIX_1449_RENDERER_FRAME_SIZE_UNCLEAR_IN_ISAR /* Dolby: Fix for issue 1449: renderer frame size unclear in ISAR */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index 26f0f52e7..e1dc9a13c 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -1632,6 +1632,12 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( { scale_sig32( p_head_pose_buf[i], numSamplesPerChannelToOutput, sub( Q11, Q_out[i] ) ); // Q11 } + +#ifdef FIX_1449_RENDERER_FRAME_SIZE_UNCLEAR_IN_ISAR +#ifndef DISABLE_LIMITER + ivas_limiter_dec_fx( st_ivas->hLimiter, p_head_pose_buf, st_ivas->hDecoderConfig->nchan_out, numSamplesPerChannelToOutput, st_ivas->BER_detect, Q11 ); +#endif +#else IF( EQ_32( st_ivas->hDecoderConfig->render_framesize, IVAS_RENDER_FRAMESIZE_5MS ) ) { #ifndef DISABLE_LIMITER @@ -1642,6 +1648,7 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( { ivas_limiter_dec_fx( st_ivas->hLimiter, p_head_pose_buf, st_ivas->hDecoderConfig->nchan_out, numSamplesPerChannelToOutput, st_ivas->BER_detect, Q11 ); } +#endif ivas_syn_output_fx( p_head_pose_buf, Q11, numSamplesPerChannelToOutput, st_ivas->hDecoderConfig->nchan_out, pcmBuf_out ); } @@ -4990,6 +4997,11 @@ IF( hIvasDec->hasDecodedFirstGoodFrame &&splitRendBits != NULL ) scale_sig32( p_head_pose_buf[i], *nSamplesRendered, sub( Q11, Q_out[i] ) ); // Q11 } +#ifdef FIX_1449_RENDERER_FRAME_SIZE_UNCLEAR_IN_ISAR +#ifndef DISABLE_LIMITER + ivas_limiter_dec_fx( st_ivas->hLimiter, p_head_pose_buf, st_ivas->hDecoderConfig->nchan_out, *nSamplesRendered, st_ivas->BER_detect, Q11 ); +#endif +#else IF( EQ_32( st_ivas->hDecoderConfig->render_framesize, IVAS_RENDER_FRAMESIZE_5MS ) ) { #ifndef DISABLE_LIMITER @@ -5003,6 +5015,7 @@ IF( hIvasDec->hasDecodedFirstGoodFrame &&splitRendBits != NULL ) ivas_syn_output_fx( p_head_pose_buf, Q11, *nSamplesRendered, st_ivas->hDecoderConfig->nchan_out, pcmBuf ); } +#endif } return IVAS_ERR_OK; -- GitLab From db51476e65b2cea886a6a08de554467c32b59ac9 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Wed, 7 Jan 2026 13:33:56 +0100 Subject: [PATCH 2/5] clang format --- apps/decoder.c | 1 - lib_dec/lib_dec_fx.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 2060094bf..978257800 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -459,7 +459,6 @@ int main( fprintf( stderr, "\nChanged render framesize, only 20ms are allowed for non-0dof split rendering!\n" ); } #endif - } /*------------------------------------------------------------------------------------------* diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index e1dc9a13c..f26c769c5 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -5016,9 +5016,9 @@ IF( hIvasDec->hasDecodedFirstGoodFrame &&splitRendBits != NULL ) ivas_syn_output_fx( p_head_pose_buf, Q11, *nSamplesRendered, st_ivas->hDecoderConfig->nchan_out, pcmBuf ); } #endif -} + } -return IVAS_ERR_OK; + return IVAS_ERR_OK; } -- GitLab From 591f04b229c21a509fc8471bba5a4a150638c700 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Wed, 7 Jan 2026 15:03:57 +0100 Subject: [PATCH 3/5] fix wrong placement of #endif --- lib_dec/lib_dec_fx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index f26c769c5..dc7083799 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -5012,11 +5012,10 @@ IF( hIvasDec->hasDecodedFirstGoodFrame &&splitRendBits != NULL ) { ivas_limiter_dec_fx( st_ivas->hLimiter, p_head_pose_buf, st_ivas->hDecoderConfig->nchan_out, *nSamplesRendered, st_ivas->BER_detect, Q11 ); } +#endif ivas_syn_output_fx( p_head_pose_buf, Q11, *nSamplesRendered, st_ivas->hDecoderConfig->nchan_out, pcmBuf ); } -#endif - } return IVAS_ERR_OK; } -- GitLab From 330e4f47dbe8932e27d2b76876a8989662432c3e Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Wed, 7 Jan 2026 15:14:53 +0100 Subject: [PATCH 4/5] correct indentation --- lib_dec/lib_dec_fx.c | 65 +++++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 31 deletions(-) diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index dc7083799..1e97c9ca8 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -4966,55 +4966,58 @@ static ivas_error ivas_dec_voip_get_samples_common return error; } } - ELSE{ + ELSE + { /* render IVAS frames directly to the output buffer */ - IF( NE_32( ( error = IVAS_DEC_GetSamplesRenderer( hIvasDec, nSamplesToRender, pcmBuf + imult1616( *nSamplesRendered, nOutChannels ), &nSamplesRendered_loop, &tmp ) ), IVAS_ERR_OK ) ){ + IF( NE_32( ( error = IVAS_DEC_GetSamplesRenderer( hIvasDec, nSamplesToRender, pcmBuf + imult1616( *nSamplesRendered, nOutChannels ), &nSamplesRendered_loop, &tmp ) ), IVAS_ERR_OK ) ) + { return error; + } + } + + *nSamplesRendered = add( *nSamplesRendered, nSamplesRendered_loop ); + update_voip_rendered20ms( hIvasDec, nSamplesRendered_loop ); } } - *nSamplesRendered = add( *nSamplesRendered, nSamplesRendered_loop ); - update_voip_rendered20ms( hIvasDec, nSamplesRendered_loop ); -} -} - -IF( hIvasDec->hasDecodedFirstGoodFrame &&splitRendBits != NULL ) -{ - Word16 Q_out[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS]; - Word16 i; - - /* Analyse head poses over entire frame, generate ISAR metadata and maybe encode if split coded */ - IF( NE_32( ( error = isar_generate_metadata_and_bitstream( st_ivas, p_head_pose_buf, *nSamplesRendered, splitRendBits, Q_out ) ), IVAS_ERR_OK ) ) + IF( hIvasDec->hasDecodedFirstGoodFrame &&splitRendBits != NULL ) { - return error; - } + Word16 Q_out[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS]; + Word16 i; - /* Synthesise PCM output if split PCM */ - IF( EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) - { - FOR( i = 0; i < BINAURAL_CHANNELS; i++ ) + /* Analyse head poses over entire frame, generate ISAR metadata and maybe encode if split coded */ + IF( NE_32( ( error = isar_generate_metadata_and_bitstream( st_ivas, p_head_pose_buf, *nSamplesRendered, splitRendBits, Q_out ) ), IVAS_ERR_OK ) ) { - scale_sig32( p_head_pose_buf[i], *nSamplesRendered, sub( Q11, Q_out[i] ) ); // Q11 + return error; } + /* Synthesise PCM output if split PCM */ + IF( EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) + { + FOR( i = 0; i < BINAURAL_CHANNELS; i++ ) + { + scale_sig32( p_head_pose_buf[i], *nSamplesRendered, sub( Q11, Q_out[i] ) ); // Q11 + } + #ifdef FIX_1449_RENDERER_FRAME_SIZE_UNCLEAR_IN_ISAR #ifndef DISABLE_LIMITER - ivas_limiter_dec_fx( st_ivas->hLimiter, p_head_pose_buf, st_ivas->hDecoderConfig->nchan_out, *nSamplesRendered, st_ivas->BER_detect, Q11 ); + ivas_limiter_dec_fx( st_ivas->hLimiter, p_head_pose_buf, st_ivas->hDecoderConfig->nchan_out, *nSamplesRendered, st_ivas->BER_detect, Q11 ); #endif #else - IF( EQ_32( st_ivas->hDecoderConfig->render_framesize, IVAS_RENDER_FRAMESIZE_5MS ) ) - { + IF( EQ_32( st_ivas->hDecoderConfig->render_framesize, IVAS_RENDER_FRAMESIZE_5MS ) ) + { #ifndef DISABLE_LIMITER - ivas_limiter_dec_fx( st_ivas->hLimiter, p_head_pose_buf, st_ivas->hDecoderConfig->nchan_out, *nSamplesRendered, st_ivas->BER_detect, Q11 ); + ivas_limiter_dec_fx( st_ivas->hLimiter, p_head_pose_buf, st_ivas->hDecoderConfig->nchan_out, *nSamplesRendered, st_ivas->BER_detect, Q11 ); #endif - } - ELSE - { - ivas_limiter_dec_fx( st_ivas->hLimiter, p_head_pose_buf, st_ivas->hDecoderConfig->nchan_out, *nSamplesRendered, st_ivas->BER_detect, Q11 ); - } + } + ELSE + { + ivas_limiter_dec_fx( st_ivas->hLimiter, p_head_pose_buf, st_ivas->hDecoderConfig->nchan_out, *nSamplesRendered, st_ivas->BER_detect, Q11 ); + } #endif - ivas_syn_output_fx( p_head_pose_buf, Q11, *nSamplesRendered, st_ivas->hDecoderConfig->nchan_out, pcmBuf ); + ivas_syn_output_fx( p_head_pose_buf, Q11, *nSamplesRendered, st_ivas->hDecoderConfig->nchan_out, pcmBuf ); + } } return IVAS_ERR_OK; -- GitLab From a65cbf68faea5a12e0659c3faa20780f35b3a28e Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Wed, 7 Jan 2026 15:18:53 +0100 Subject: [PATCH 5/5] clang format --- lib_dec/lib_dec_fx.c | 68 +++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 35 deletions(-) diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index 1e97c9ca8..e6124911e 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -4966,61 +4966,59 @@ static ivas_error ivas_dec_voip_get_samples_common return error; } } - ELSE - { + ELSE{ /* render IVAS frames directly to the output buffer */ - IF( NE_32( ( error = IVAS_DEC_GetSamplesRenderer( hIvasDec, nSamplesToRender, pcmBuf + imult1616( *nSamplesRendered, nOutChannels ), &nSamplesRendered_loop, &tmp ) ), IVAS_ERR_OK ) ) - { + IF( NE_32( ( error = IVAS_DEC_GetSamplesRenderer( hIvasDec, nSamplesToRender, pcmBuf + imult1616( *nSamplesRendered, nOutChannels ), &nSamplesRendered_loop, &tmp ) ), IVAS_ERR_OK ) ){ return error; - } - } - - *nSamplesRendered = add( *nSamplesRendered, nSamplesRendered_loop ); - update_voip_rendered20ms( hIvasDec, nSamplesRendered_loop ); } } - IF( hIvasDec->hasDecodedFirstGoodFrame &&splitRendBits != NULL ) + *nSamplesRendered = add( *nSamplesRendered, nSamplesRendered_loop ); + update_voip_rendered20ms( hIvasDec, nSamplesRendered_loop ); +} +} + +IF( hIvasDec->hasDecodedFirstGoodFrame &&splitRendBits != NULL ) +{ + Word16 Q_out[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS]; + Word16 i; + + /* Analyse head poses over entire frame, generate ISAR metadata and maybe encode if split coded */ + IF( NE_32( ( error = isar_generate_metadata_and_bitstream( st_ivas, p_head_pose_buf, *nSamplesRendered, splitRendBits, Q_out ) ), IVAS_ERR_OK ) ) { - Word16 Q_out[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS]; - Word16 i; + return error; + } - /* Analyse head poses over entire frame, generate ISAR metadata and maybe encode if split coded */ - IF( NE_32( ( error = isar_generate_metadata_and_bitstream( st_ivas, p_head_pose_buf, *nSamplesRendered, splitRendBits, Q_out ) ), IVAS_ERR_OK ) ) + /* Synthesise PCM output if split PCM */ + IF( EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) + { + FOR( i = 0; i < BINAURAL_CHANNELS; i++ ) { - return error; + scale_sig32( p_head_pose_buf[i], *nSamplesRendered, sub( Q11, Q_out[i] ) ); // Q11 } - /* Synthesise PCM output if split PCM */ - IF( EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) - { - FOR( i = 0; i < BINAURAL_CHANNELS; i++ ) - { - scale_sig32( p_head_pose_buf[i], *nSamplesRendered, sub( Q11, Q_out[i] ) ); // Q11 - } - #ifdef FIX_1449_RENDERER_FRAME_SIZE_UNCLEAR_IN_ISAR #ifndef DISABLE_LIMITER - ivas_limiter_dec_fx( st_ivas->hLimiter, p_head_pose_buf, st_ivas->hDecoderConfig->nchan_out, *nSamplesRendered, st_ivas->BER_detect, Q11 ); + ivas_limiter_dec_fx( st_ivas->hLimiter, p_head_pose_buf, st_ivas->hDecoderConfig->nchan_out, *nSamplesRendered, st_ivas->BER_detect, Q11 ); #endif #else - IF( EQ_32( st_ivas->hDecoderConfig->render_framesize, IVAS_RENDER_FRAMESIZE_5MS ) ) - { + IF( EQ_32( st_ivas->hDecoderConfig->render_framesize, IVAS_RENDER_FRAMESIZE_5MS ) ) + { #ifndef DISABLE_LIMITER - ivas_limiter_dec_fx( st_ivas->hLimiter, p_head_pose_buf, st_ivas->hDecoderConfig->nchan_out, *nSamplesRendered, st_ivas->BER_detect, Q11 ); + ivas_limiter_dec_fx( st_ivas->hLimiter, p_head_pose_buf, st_ivas->hDecoderConfig->nchan_out, *nSamplesRendered, st_ivas->BER_detect, Q11 ); #endif - } - ELSE - { - ivas_limiter_dec_fx( st_ivas->hLimiter, p_head_pose_buf, st_ivas->hDecoderConfig->nchan_out, *nSamplesRendered, st_ivas->BER_detect, Q11 ); - } + } + ELSE + { + ivas_limiter_dec_fx( st_ivas->hLimiter, p_head_pose_buf, st_ivas->hDecoderConfig->nchan_out, *nSamplesRendered, st_ivas->BER_detect, Q11 ); + } #endif - ivas_syn_output_fx( p_head_pose_buf, Q11, *nSamplesRendered, st_ivas->hDecoderConfig->nchan_out, pcmBuf ); - } + ivas_syn_output_fx( p_head_pose_buf, Q11, *nSamplesRendered, st_ivas->hDecoderConfig->nchan_out, pcmBuf ); } +} - return IVAS_ERR_OK; +return IVAS_ERR_OK; } -- GitLab