From 53cf1b85f3732e1f1e50dda2aa63503e7680931f Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Thu, 7 Aug 2025 09:50:15 +0200 Subject: [PATCH 1/4] use i_mult() instead of mult() --- lib_rend/lib_rend_fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index ae4b2ef02..636a1c805 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -10379,7 +10379,7 @@ static ivas_error printConfigInfo_rend( EQ_16( hIvasRend->outputConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( hIvasRend->outputConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { - fprintf( stdout, "Render framesize: %dms\n", mult( hIvasRend->num_subframes, 5 ) ); + fprintf( stdout, "Render framesize: %dms\n", i_mult( hIvasRend->num_subframes, 5 ) ); } return IVAS_ERR_OK; -- GitLab From f93b8d519d705a02bdf2f10c1d2f8c5176435c45 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 7 Aug 2025 11:34:00 +0200 Subject: [PATCH 2/4] replace numbers by macros --- apps/decoder.c | 4 ++-- apps/isar_post_rend.c | 4 ++-- apps/renderer.c | 6 +++--- lib_dec/lib_dec_fx.c | 2 +- lib_rend/ivas_render_config_fx.c | 2 +- lib_rend/lib_rend_fx.c | 9 ++++++--- 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 179ad3273..877804f07 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -565,7 +565,7 @@ int main( } /* ISAR frame size is set from command line, not renderer config file. * This will be ignored if output format is not split rendering. */ - renderConfig.split_rend_config.isar_frame_size_ms = (int16_t) arg.renderFramesize /* given in number of 5ms subframes */ * 5; + renderConfig.split_rend_config.isar_frame_size_ms = (int16_t) arg.renderFramesize /* given in number of 5ms subframes */ * BINAURAL_RENDERING_FRAME_SIZE_MS; if ( ( error = IVAS_DEC_FeedRenderConfig( hIvasDec, renderConfig ) ) != IVAS_ERR_OK ) { @@ -1761,7 +1761,7 @@ static ivas_error initOnFirstGoodFrame( splitRendBitsZero.codec = ISAR_SPLIT_REND_CODEC_DEFAULT; splitRendBitsZero.pose_correction = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE; splitRendBitsZero.codec_frame_size_ms = 0; - splitRendBitsZero.isar_frame_size_ms = 20; + splitRendBitsZero.isar_frame_size_ms = 1000 / IVAS_NUM_FRAMES_PER_SEC; if ( split_rend_write_bitstream_to_file( *splitRendWriter, splitRendBitsZero.bits_buf, &splitRendBitsZero.bits_read, &splitRendBitsZero.bits_written ) != IVAS_ERR_OK ) { diff --git a/apps/isar_post_rend.c b/apps/isar_post_rend.c index b4ff098ba..6c5369e0d 100644 --- a/apps/isar_post_rend.c +++ b/apps/isar_post_rend.c @@ -727,8 +727,8 @@ int main( bitsBuffer.config.bufLenInBytes = 0; bitsBuffer.config.codec = ISAR_SPLIT_REND_CODEC_DEFAULT; bitsBuffer.config.poseCorrection = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE; - bitsBuffer.config.codec_frame_size_ms = 5; - bitsBuffer.config.isar_frame_size_ms = 20; + bitsBuffer.config.codec_frame_size_ms = BINAURAL_RENDERING_FRAME_SIZE_MS; + bitsBuffer.config.isar_frame_size_ms = 1000 / IVAS_NUM_FRAMES_PER_SEC; bitsBuffer.config.lc3plusHighRes = 0; CmdlnArgs args = parseCmdlnArgs( argc, argv ); diff --git a/apps/renderer.c b/apps/renderer.c index 242b80fbf..542b5747a 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -813,8 +813,8 @@ int main( bitsBuffer.config.bufLenInBytes = 0; bitsBuffer.config.codec = ISAR_SPLIT_REND_CODEC_DEFAULT; bitsBuffer.config.poseCorrection = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE; - bitsBuffer.config.codec_frame_size_ms = 5; - bitsBuffer.config.isar_frame_size_ms = 20; + bitsBuffer.config.codec_frame_size_ms = BINAURAL_RENDERING_FRAME_SIZE_MS; + bitsBuffer.config.isar_frame_size_ms = 1000 / IVAS_NUM_FRAMES_PER_SEC; bitsBuffer.config.lc3plus_highres = 0; for ( i = 0; i < RENDERER_MAX_MC_INPUTS; ++i ) { @@ -1195,7 +1195,7 @@ int main( /* ISAR frame size is set from command line, not renderer config file. * This will be ignored if output format is not split rendering. */ - renderConfig.split_rend_config.isar_frame_size_ms = (int16_t) args.render_framesize /* given in number of 5ms subframes */ * 5; + renderConfig.split_rend_config.isar_frame_size_ms = (int16_t) args.render_framesize /* given in number of 5ms subframes */ * BINAURAL_RENDERING_FRAME_SIZE_MS; if ( ( error = IVAS_REND_FeedRenderConfig( hIvasRend, renderConfig ) ) != IVAS_ERR_OK ) { diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index cc985f288..0f031ed25 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -2708,7 +2708,7 @@ static ivas_error copyRendererConfigStruct( hRCout->split_rend_config.dof = 3; hRCout->split_rend_config.hq_mode = 0; hRCout->split_rend_config.codec_delay_ms = 0; - hRCout->split_rend_config.isar_frame_size_ms = 20; + hRCout->split_rend_config.isar_frame_size_ms = 1000 / IVAS_NUM_FRAMES_PER_SEC; move16(); hRCout->split_rend_config.codec_frame_size_ms = 0; /* 0 means "use default for selected codec" */ hRCout->split_rend_config.codec = ISAR_SPLIT_REND_CODEC_DEFAULT; diff --git a/lib_rend/ivas_render_config_fx.c b/lib_rend/ivas_render_config_fx.c index 14e2c2a5d..5232f9a04 100644 --- a/lib_rend/ivas_render_config_fx.c +++ b/lib_rend/ivas_render_config_fx.c @@ -152,7 +152,7 @@ ivas_error ivas_render_config_init_from_rom_fx( move16(); ( *hRenderConfig )->split_rend_config.codec_delay_ms = 0; move16(); - ( *hRenderConfig )->split_rend_config.isar_frame_size_ms = 20; + ( *hRenderConfig )->split_rend_config.isar_frame_size_ms = 1000 / IVAS_NUM_FRAMES_PER_SEC; move16(); ( *hRenderConfig )->split_rend_config.codec_frame_size_ms = 0; /* 0 means "use default for selected codec" */ move16(); diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index 636a1c805..c8b7a6a20 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -4704,14 +4704,13 @@ Word16 IVAS_REND_GetRenderConfig( hRCout->split_rend_config.dof = 3; hRCout->split_rend_config.hq_mode = 0; hRCout->split_rend_config.codec_delay_ms = 0; - hRCout->split_rend_config.isar_frame_size_ms = 20; + hRCout->split_rend_config.isar_frame_size_ms = 1000 / IVAS_NUM_FRAMES_PER_SEC; hRCout->split_rend_config.codec_frame_size_ms = 0; /* 0 means "use default for selected codec" */ hRCout->split_rend_config.codec = ISAR_SPLIT_REND_CODEC_DEFAULT; hRCout->split_rend_config.poseCorrectionMode = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB; hRCout->split_rend_config.rendererSelection = hRCin->split_rend_config.rendererSelection; hRCout->split_rend_config.lc3plus_highres = 0; - hRCout->roomAcoustics.use_er = hRCin->roomAcoustics.use_er; hRCout->roomAcoustics.lowComplexity = hRCin->roomAcoustics.lowComplexity; move16(); @@ -10373,13 +10372,17 @@ static ivas_error printConfigInfo_rend( fprintf( stdout, "Head-tracking: ON\n" ); } + test(); + test(); + test(); + test(); IF( EQ_16( hIvasRend->outputConfig, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_16( hIvasRend->outputConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_16( hIvasRend->outputConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || EQ_16( hIvasRend->outputConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( hIvasRend->outputConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { - fprintf( stdout, "Render framesize: %dms\n", i_mult( hIvasRend->num_subframes, 5 ) ); + fprintf( stdout, "Render framesize: %d ms\n", i_mult( hIvasRend->num_subframes, BINAURAL_RENDERING_FRAME_SIZE_MS ) ); } return IVAS_ERR_OK; -- GitLab From 0247a5c550948e6aff78556dce6eab78682435bb Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 7 Aug 2025 11:52:27 +0200 Subject: [PATCH 3/4] Revert "replace numbers by macros" This reverts commit f93b8d519d705a02bdf2f10c1d2f8c5176435c45. --- apps/decoder.c | 4 ++-- apps/isar_post_rend.c | 4 ++-- apps/renderer.c | 6 +++--- lib_dec/lib_dec_fx.c | 2 +- lib_rend/ivas_render_config_fx.c | 2 +- lib_rend/lib_rend_fx.c | 7 ++++--- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 877804f07..179ad3273 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -565,7 +565,7 @@ int main( } /* ISAR frame size is set from command line, not renderer config file. * This will be ignored if output format is not split rendering. */ - renderConfig.split_rend_config.isar_frame_size_ms = (int16_t) arg.renderFramesize /* given in number of 5ms subframes */ * BINAURAL_RENDERING_FRAME_SIZE_MS; + renderConfig.split_rend_config.isar_frame_size_ms = (int16_t) arg.renderFramesize /* given in number of 5ms subframes */ * 5; if ( ( error = IVAS_DEC_FeedRenderConfig( hIvasDec, renderConfig ) ) != IVAS_ERR_OK ) { @@ -1761,7 +1761,7 @@ static ivas_error initOnFirstGoodFrame( splitRendBitsZero.codec = ISAR_SPLIT_REND_CODEC_DEFAULT; splitRendBitsZero.pose_correction = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE; splitRendBitsZero.codec_frame_size_ms = 0; - splitRendBitsZero.isar_frame_size_ms = 1000 / IVAS_NUM_FRAMES_PER_SEC; + splitRendBitsZero.isar_frame_size_ms = 20; if ( split_rend_write_bitstream_to_file( *splitRendWriter, splitRendBitsZero.bits_buf, &splitRendBitsZero.bits_read, &splitRendBitsZero.bits_written ) != IVAS_ERR_OK ) { diff --git a/apps/isar_post_rend.c b/apps/isar_post_rend.c index 6c5369e0d..b4ff098ba 100644 --- a/apps/isar_post_rend.c +++ b/apps/isar_post_rend.c @@ -727,8 +727,8 @@ int main( bitsBuffer.config.bufLenInBytes = 0; bitsBuffer.config.codec = ISAR_SPLIT_REND_CODEC_DEFAULT; bitsBuffer.config.poseCorrection = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE; - bitsBuffer.config.codec_frame_size_ms = BINAURAL_RENDERING_FRAME_SIZE_MS; - bitsBuffer.config.isar_frame_size_ms = 1000 / IVAS_NUM_FRAMES_PER_SEC; + bitsBuffer.config.codec_frame_size_ms = 5; + bitsBuffer.config.isar_frame_size_ms = 20; bitsBuffer.config.lc3plusHighRes = 0; CmdlnArgs args = parseCmdlnArgs( argc, argv ); diff --git a/apps/renderer.c b/apps/renderer.c index 542b5747a..242b80fbf 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -813,8 +813,8 @@ int main( bitsBuffer.config.bufLenInBytes = 0; bitsBuffer.config.codec = ISAR_SPLIT_REND_CODEC_DEFAULT; bitsBuffer.config.poseCorrection = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE; - bitsBuffer.config.codec_frame_size_ms = BINAURAL_RENDERING_FRAME_SIZE_MS; - bitsBuffer.config.isar_frame_size_ms = 1000 / IVAS_NUM_FRAMES_PER_SEC; + bitsBuffer.config.codec_frame_size_ms = 5; + bitsBuffer.config.isar_frame_size_ms = 20; bitsBuffer.config.lc3plus_highres = 0; for ( i = 0; i < RENDERER_MAX_MC_INPUTS; ++i ) { @@ -1195,7 +1195,7 @@ int main( /* ISAR frame size is set from command line, not renderer config file. * This will be ignored if output format is not split rendering. */ - renderConfig.split_rend_config.isar_frame_size_ms = (int16_t) args.render_framesize /* given in number of 5ms subframes */ * BINAURAL_RENDERING_FRAME_SIZE_MS; + renderConfig.split_rend_config.isar_frame_size_ms = (int16_t) args.render_framesize /* given in number of 5ms subframes */ * 5; if ( ( error = IVAS_REND_FeedRenderConfig( hIvasRend, renderConfig ) ) != IVAS_ERR_OK ) { diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index 0f031ed25..cc985f288 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -2708,7 +2708,7 @@ static ivas_error copyRendererConfigStruct( hRCout->split_rend_config.dof = 3; hRCout->split_rend_config.hq_mode = 0; hRCout->split_rend_config.codec_delay_ms = 0; - hRCout->split_rend_config.isar_frame_size_ms = 1000 / IVAS_NUM_FRAMES_PER_SEC; + hRCout->split_rend_config.isar_frame_size_ms = 20; move16(); hRCout->split_rend_config.codec_frame_size_ms = 0; /* 0 means "use default for selected codec" */ hRCout->split_rend_config.codec = ISAR_SPLIT_REND_CODEC_DEFAULT; diff --git a/lib_rend/ivas_render_config_fx.c b/lib_rend/ivas_render_config_fx.c index 5232f9a04..14e2c2a5d 100644 --- a/lib_rend/ivas_render_config_fx.c +++ b/lib_rend/ivas_render_config_fx.c @@ -152,7 +152,7 @@ ivas_error ivas_render_config_init_from_rom_fx( move16(); ( *hRenderConfig )->split_rend_config.codec_delay_ms = 0; move16(); - ( *hRenderConfig )->split_rend_config.isar_frame_size_ms = 1000 / IVAS_NUM_FRAMES_PER_SEC; + ( *hRenderConfig )->split_rend_config.isar_frame_size_ms = 20; move16(); ( *hRenderConfig )->split_rend_config.codec_frame_size_ms = 0; /* 0 means "use default for selected codec" */ move16(); diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index c8b7a6a20..708a8b739 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -4704,13 +4704,14 @@ Word16 IVAS_REND_GetRenderConfig( hRCout->split_rend_config.dof = 3; hRCout->split_rend_config.hq_mode = 0; hRCout->split_rend_config.codec_delay_ms = 0; - hRCout->split_rend_config.isar_frame_size_ms = 1000 / IVAS_NUM_FRAMES_PER_SEC; + hRCout->split_rend_config.isar_frame_size_ms = 20; hRCout->split_rend_config.codec_frame_size_ms = 0; /* 0 means "use default for selected codec" */ hRCout->split_rend_config.codec = ISAR_SPLIT_REND_CODEC_DEFAULT; hRCout->split_rend_config.poseCorrectionMode = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB; hRCout->split_rend_config.rendererSelection = hRCin->split_rend_config.rendererSelection; hRCout->split_rend_config.lc3plus_highres = 0; + hRCout->roomAcoustics.use_er = hRCin->roomAcoustics.use_er; hRCout->roomAcoustics.lowComplexity = hRCin->roomAcoustics.lowComplexity; move16(); @@ -8794,7 +8795,7 @@ static ivas_error getSamplesInternal( if ( ( error = ISAR_PRE_REND_MultiBinToSplitBinaural( &hIvasRend->splitRendWrapper, hIvasRend->headRotData.headPositions[0], hIvasRend->hRendererConfig->split_rend_config.splitRendBitRate, hIvasRend->hRendererConfig->split_rend_config.codec, hIvasRend->hRendererConfig->split_rend_config.isar_frame_size_ms, hIvasRend->hRendererConfig->split_rend_config.codec_frame_size_ms, - &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, ( const int16_t )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0, ro_md_flag, Q_buff, &Q_out[0] ) ) != IVAS_ERR_OK ) + &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, (const int16_t) ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0, ro_md_flag, Q_buff, &Q_out[0] ) ) != IVAS_ERR_OK ) { return error; } @@ -10382,7 +10383,7 @@ static ivas_error printConfigInfo_rend( EQ_16( hIvasRend->outputConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( hIvasRend->outputConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { - fprintf( stdout, "Render framesize: %d ms\n", i_mult( hIvasRend->num_subframes, BINAURAL_RENDERING_FRAME_SIZE_MS ) ); + fprintf( stdout, "Render framesize: %dms\n", i_mult( hIvasRend->num_subframes, 5 ) ); } return IVAS_ERR_OK; -- GitLab From 70707ed3a57ec1eda80683a5ed0b906acabd7602 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 7 Aug 2025 12:00:36 +0200 Subject: [PATCH 4/4] clang-format --- lib_rend/lib_rend_fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index 708a8b739..aca43778a 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -8795,7 +8795,7 @@ static ivas_error getSamplesInternal( if ( ( error = ISAR_PRE_REND_MultiBinToSplitBinaural( &hIvasRend->splitRendWrapper, hIvasRend->headRotData.headPositions[0], hIvasRend->hRendererConfig->split_rend_config.splitRendBitRate, hIvasRend->hRendererConfig->split_rend_config.codec, hIvasRend->hRendererConfig->split_rend_config.isar_frame_size_ms, hIvasRend->hRendererConfig->split_rend_config.codec_frame_size_ms, - &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, (const int16_t) ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0, ro_md_flag, Q_buff, &Q_out[0] ) ) != IVAS_ERR_OK ) + &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, ( const int16_t )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0, ro_md_flag, Q_buff, &Q_out[0] ) ) != IVAS_ERR_OK ) { return error; } -- GitLab