From 658e473fcd7fc3e3ff14029a35d2585f6d771bc0 Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 21 Nov 2025 19:51:46 +0100 Subject: [PATCH 01/13] fixes --- lib_dec/ivas_init_dec.c | 1 - lib_dec/ivas_jbm_dec.c | 36 +++++++++++++------------- lib_dec/ivas_output_config.c | 49 ++++++++++++++++-------------------- 3 files changed, 38 insertions(+), 48 deletions(-) diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index aa544ce6b8..6bfe4d0db5 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1647,7 +1647,6 @@ ivas_error ivas_init_decoder( #ifndef FIX_1419_MONO_STEREO_UMX /* already set now by renderer_select() */ st_ivas->intern_config = IVAS_AUDIO_CONFIG_STEREO; #endif - st_ivas->nSCE = 0; st_ivas->nCPE = 1; /* in stereo, there is always only one CPE */ cpe_id = 0; diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 7bf613e70a..5085fa940e 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -929,6 +929,10 @@ ivas_error ivas_jbm_dec_render( * Rendering *----------------------------------------------------------------*/ +#ifdef FIX_1419_MONO_STEREO_UMX + *nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); + +#endif if ( st_ivas->ivas_format == UNDEFINED_FORMAT ) { assert( 0 ); @@ -943,10 +947,6 @@ ivas_error ivas_jbm_dec_render( else if ( st_ivas->ivas_format == STEREO_FORMAT ) #endif { -#ifdef FIX_1419_MONO_STEREO_UMX - *nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); -#endif - /* Rendering */ if ( st_ivas->renderer_type == RENDERER_MC ) { @@ -958,20 +958,12 @@ ivas_error ivas_jbm_dec_render( #ifdef FIX_1419_MONO_STEREO_UMX else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) { - if ( st_ivas->ivas_format == MONO_FORMAT ) - { - /* routed to W */ - ivas_jbm_dec_tc_buffer_playout( st_ivas, nSamplesAskedLocal, nSamplesRendered, p_output ); - } - else if ( st_ivas->ivas_format == STEREO_FORMAT ) + for ( n = 0; n < *nSamplesRendered; n++ ) { - for ( n = 0; n < *nSamplesRendered; n++ ) - { - float tmp; - tmp = p_output[0][n]; - p_output[0][n] = 0.5f * ( tmp + p_output[1][n] ); /* W = 0.5 * ( L + R ) */ - p_output[1][n] = 0.5f * ( tmp - p_output[1][n] ); /* Y = 0.5 * ( L - R ) */ - } + float tmp; + tmp = p_output[0][n]; + p_output[0][n] = 0.5f * ( tmp + p_output[1][n] ); /* W = 0.5 * ( L + R ) */ + p_output[1][n] = 0.5f * ( tmp - p_output[1][n] ); /* Y = 0.5 * ( L - R ) */ } } #endif /* FIX_1419_MONO_STEREO_UMX */ @@ -998,8 +990,9 @@ ivas_error ivas_jbm_dec_render( } else /* ISM_MODE_DISC */ { +#ifndef FIX_1419_MONO_STEREO_UMX *nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); - +#endif /* Loudspeaker or Ambisonics rendering */ if ( st_ivas->renderer_type == RENDERER_TD_PANNING || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) { @@ -1116,8 +1109,9 @@ ivas_error ivas_jbm_dec_render( } else if ( st_ivas->renderer_type == RENDERER_OSBA_STEREO ) { +#ifndef FIX_1419_MONO_STEREO_UMX *nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); - +#endif /* shift SBA channels to avoid overwrite by ISM upmix in 1 object case and non-TSM unified channel memory*/ if ( st_ivas->nchan_ism == 1 && st_ivas->hDecoderConfig->Opt_tsm == 0 ) { @@ -1200,7 +1194,9 @@ ivas_error ivas_jbm_dec_render( if ( st_ivas->mc_mode == MC_MODE_MCT ) { int16_t crendInPlaceRotation = FALSE; +#ifndef FIX_1419_MONO_STEREO_UMX *nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); +#endif if ( st_ivas->transport_config != st_ivas->intern_config && ( st_ivas->intern_config == IVAS_AUDIO_CONFIG_FOA || st_ivas->intern_config == IVAS_AUDIO_CONFIG_HOA2 || st_ivas->intern_config == IVAS_AUDIO_CONFIG_HOA3 ) ) { if ( ( st_ivas->hTransSetup.nchan_out_woLFE + st_ivas->hTransSetup.num_lfe ) < ( st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe ) ) @@ -1234,7 +1230,9 @@ ivas_error ivas_jbm_dec_render( } else if ( st_ivas->renderer_type == RENDERER_MC ) { +#ifndef FIX_1419_MONO_STEREO_UMX *nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); +#endif ivas_ls_setup_conversion( st_ivas, st_ivas->nchan_transport, *nSamplesRendered, p_tc, p_output ); } else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index f5b4d577b1..f1fe77b1dc 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -41,28 +41,6 @@ #endif #include "wmc_auto.h" -#ifdef FIX_1419_MONO_STEREO_UMX - -static void ms_bin_upmix_renderer_select( - const IVAS_FORMAT ivas_format, /* i : Decoder format */ - IVAS_AUDIO_CONFIG *internal_config, /* o : Internal configuration for rendering */ - RENDERER_TYPE *renderer_type /* o : Selected renderer type */ -) -{ - - *internal_config = ( ivas_format == MONO_FORMAT ) ? IVAS_AUDIO_CONFIG_MONO : IVAS_AUDIO_CONFIG_STEREO; - - if ( ivas_format == MONO_FORMAT ) - { - *renderer_type = RENDERER_NON_DIEGETIC_DOWNMIX; - } - else - { - *renderer_type = RENDERER_DISABLE; - } - return; -} -#endif /*-------------------------------------------------------------------------* * ivas_renderer_select() @@ -107,9 +85,16 @@ void ivas_renderer_select( #ifdef FIX_1419_MONO_STEREO_UMX if ( st_ivas->ivas_format == MONO_FORMAT || st_ivas->ivas_format == STEREO_FORMAT ) { - ms_bin_upmix_renderer_select( st_ivas->ivas_format, - internal_config, - renderer_type ); + if ( st_ivas->ivas_format == MONO_FORMAT ) + { + *renderer_type = RENDERER_NON_DIEGETIC_DOWNMIX; + *internal_config = IVAS_AUDIO_CONFIG_MONO; + } + else + { + *renderer_type = RENDERER_DISABLE; + *internal_config = IVAS_AUDIO_CONFIG_STEREO; + } } else if ( st_ivas->ivas_format == ISM_FORMAT ) #else @@ -288,12 +273,20 @@ void ivas_renderer_select( else if ( st_ivas->ivas_format == MONO_FORMAT || st_ivas->ivas_format == STEREO_FORMAT ) { *internal_config = ( st_ivas->ivas_format == MONO_FORMAT ) ? IVAS_AUDIO_CONFIG_MONO : IVAS_AUDIO_CONFIG_STEREO; + switch ( output_config ) { case IVAS_AUDIO_CONFIG_FOA: case IVAS_AUDIO_CONFIG_HOA2: case IVAS_AUDIO_CONFIG_HOA3: - *renderer_type = RENDERER_SBA_LINEAR_ENC; + if ( st_ivas->ivas_format == MONO_FORMAT ) + { + *renderer_type = RENDERER_NON_DIEGETIC_DOWNMIX; + } + else + { + *renderer_type = RENDERER_SBA_LINEAR_ENC; + } break; case IVAS_AUDIO_CONFIG_5_1: case IVAS_AUDIO_CONFIG_7_1: @@ -304,14 +297,14 @@ void ivas_renderer_select( *renderer_type = RENDERER_MC; break; case IVAS_AUDIO_CONFIG_MONO: - if ( *internal_config == IVAS_AUDIO_CONFIG_STEREO ) + if ( st_ivas->ivas_format == STEREO_FORMAT ) { /* stereo to mono downmix */ *renderer_type = RENDERER_MC; } break; case IVAS_AUDIO_CONFIG_STEREO: - if ( *internal_config == IVAS_AUDIO_CONFIG_MONO ) + if ( st_ivas->ivas_format == MONO_FORMAT ) { /* mono to stereo upmix */ *renderer_type = RENDERER_NON_DIEGETIC_DOWNMIX; -- GitLab From 98d6a14e2287c864ee9c800c72ed3cdb005af16f Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 21 Nov 2025 20:06:38 +0100 Subject: [PATCH 02/13] fix --- lib_dec/ivas_output_config.c | 82 +++++++++++++----------------------- 1 file changed, 30 insertions(+), 52 deletions(-) diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index f1fe77b1dc..ab29568fb3 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -83,18 +83,15 @@ void ivas_renderer_select( if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { #ifdef FIX_1419_MONO_STEREO_UMX - if ( st_ivas->ivas_format == MONO_FORMAT || st_ivas->ivas_format == STEREO_FORMAT ) + if ( st_ivas->ivas_format == MONO_FORMAT ) { - if ( st_ivas->ivas_format == MONO_FORMAT ) - { - *renderer_type = RENDERER_NON_DIEGETIC_DOWNMIX; - *internal_config = IVAS_AUDIO_CONFIG_MONO; - } - else - { - *renderer_type = RENDERER_DISABLE; - *internal_config = IVAS_AUDIO_CONFIG_STEREO; - } + *renderer_type = RENDERER_NON_DIEGETIC_DOWNMIX; + *internal_config = IVAS_AUDIO_CONFIG_MONO; + } + else if ( st_ivas->ivas_format == STEREO_FORMAT ) + { + *internal_config = IVAS_AUDIO_CONFIG_STEREO; + *renderer_type = RENDERER_DISABLE; } else if ( st_ivas->ivas_format == ISM_FORMAT ) #else @@ -270,49 +267,30 @@ void ivas_renderer_select( *-----------------------------------------------------------------*/ #ifdef FIX_1419_MONO_STEREO_UMX - else if ( st_ivas->ivas_format == MONO_FORMAT || st_ivas->ivas_format == STEREO_FORMAT ) + else if ( st_ivas->ivas_format == MONO_FORMAT ) { - *internal_config = ( st_ivas->ivas_format == MONO_FORMAT ) ? IVAS_AUDIO_CONFIG_MONO : IVAS_AUDIO_CONFIG_STEREO; - - switch ( output_config ) + *internal_config = MONO_FORMAT; + + if ( output_config == IVAS_AUDIO_CONFIG_STEREO || output_config == IVAS_AUDIO_CONFIG_FOA || output_config == IVAS_AUDIO_CONFIG_HOA2 || output_config == IVAS_AUDIO_CONFIG_HOA3 ) { - case IVAS_AUDIO_CONFIG_FOA: - case IVAS_AUDIO_CONFIG_HOA2: - case IVAS_AUDIO_CONFIG_HOA3: - if ( st_ivas->ivas_format == MONO_FORMAT ) - { - *renderer_type = RENDERER_NON_DIEGETIC_DOWNMIX; - } - else - { - *renderer_type = RENDERER_SBA_LINEAR_ENC; - } - break; - case IVAS_AUDIO_CONFIG_5_1: - case IVAS_AUDIO_CONFIG_7_1: - case IVAS_AUDIO_CONFIG_5_1_2: - case IVAS_AUDIO_CONFIG_5_1_4: - case IVAS_AUDIO_CONFIG_7_1_4: - case IVAS_AUDIO_CONFIG_LS_CUSTOM: - *renderer_type = RENDERER_MC; - break; - case IVAS_AUDIO_CONFIG_MONO: - if ( st_ivas->ivas_format == STEREO_FORMAT ) - { - /* stereo to mono downmix */ - *renderer_type = RENDERER_MC; - } - break; - case IVAS_AUDIO_CONFIG_STEREO: - if ( st_ivas->ivas_format == MONO_FORMAT ) - { - /* mono to stereo upmix */ - *renderer_type = RENDERER_NON_DIEGETIC_DOWNMIX; - } - break; - default: - /* RENDERER_DISABLE already set by default */ - break; + *renderer_type = RENDERER_NON_DIEGETIC_DOWNMIX; + } + else if( output_config == IVAS_AUDIO_CONFIG_5_1 || output_config == IVAS_AUDIO_CONFIG_5_1_2 || output_config == IVAS_AUDIO_CONFIG_5_1_4 || output_config == IVAS_AUDIO_CONFIG_7_1 || output_config == IVAS_AUDIO_CONFIG_7_1_4 || output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) + { + *renderer_type = RENDERER_MC; + } + } + else if ( st_ivas->ivas_format == STEREO_FORMAT ) + { + *internal_config = IVAS_AUDIO_CONFIG_STEREO; + + if ( output_config == IVAS_AUDIO_CONFIG_FOA || output_config == IVAS_AUDIO_CONFIG_HOA2 || output_config == IVAS_AUDIO_CONFIG_HOA3 ) + { + *renderer_type = RENDERER_SBA_LINEAR_ENC; + } + else if ( output_config == IVAS_AUDIO_CONFIG_MONO || output_config == IVAS_AUDIO_CONFIG_5_1 || output_config == IVAS_AUDIO_CONFIG_5_1_2 || output_config == IVAS_AUDIO_CONFIG_5_1_4 || output_config == IVAS_AUDIO_CONFIG_7_1 || output_config == IVAS_AUDIO_CONFIG_7_1_4 || output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) + { + *renderer_type = RENDERER_MC; } } #else -- GitLab From 975388f44124dfa7611b5f1917447d5c15ee6de0 Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 21 Nov 2025 20:10:29 +0100 Subject: [PATCH 03/13] clang-format --- lib_dec/ivas_output_config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index ab29568fb3..826f508743 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -267,7 +267,7 @@ void ivas_renderer_select( *-----------------------------------------------------------------*/ #ifdef FIX_1419_MONO_STEREO_UMX - else if ( st_ivas->ivas_format == MONO_FORMAT ) + else if ( st_ivas->ivas_format == MONO_FORMAT ) { *internal_config = MONO_FORMAT; @@ -275,7 +275,7 @@ void ivas_renderer_select( { *renderer_type = RENDERER_NON_DIEGETIC_DOWNMIX; } - else if( output_config == IVAS_AUDIO_CONFIG_5_1 || output_config == IVAS_AUDIO_CONFIG_5_1_2 || output_config == IVAS_AUDIO_CONFIG_5_1_4 || output_config == IVAS_AUDIO_CONFIG_7_1 || output_config == IVAS_AUDIO_CONFIG_7_1_4 || output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) + else if ( output_config == IVAS_AUDIO_CONFIG_5_1 || output_config == IVAS_AUDIO_CONFIG_5_1_2 || output_config == IVAS_AUDIO_CONFIG_5_1_4 || output_config == IVAS_AUDIO_CONFIG_7_1 || output_config == IVAS_AUDIO_CONFIG_7_1_4 || output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { *renderer_type = RENDERER_MC; } -- GitLab From d6aa0e5286bd610573e00451c0b305f52fb4b275 Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 21 Nov 2025 20:39:00 +0100 Subject: [PATCH 04/13] fix --- lib_dec/ivas_output_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 826f508743..8cb73461d9 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -269,7 +269,7 @@ void ivas_renderer_select( #ifdef FIX_1419_MONO_STEREO_UMX else if ( st_ivas->ivas_format == MONO_FORMAT ) { - *internal_config = MONO_FORMAT; + *internal_config = IVAS_AUDIO_CONFIG_MONO; if ( output_config == IVAS_AUDIO_CONFIG_STEREO || output_config == IVAS_AUDIO_CONFIG_FOA || output_config == IVAS_AUDIO_CONFIG_HOA2 || output_config == IVAS_AUDIO_CONFIG_HOA3 ) { -- GitLab From 32751f56be40ca90d30ea7d27de1fde72321e2db Mon Sep 17 00:00:00 2001 From: vaclav Date: Sat, 22 Nov 2025 12:16:23 +0100 Subject: [PATCH 05/13] more cleaning + introduce the fix for mono -> FOA --- lib_dec/ivas_jbm_dec.c | 6 +++--- lib_dec/ivas_output_config.c | 8 +------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 5085fa940e..50439c02a0 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -961,9 +961,9 @@ ivas_error ivas_jbm_dec_render( for ( n = 0; n < *nSamplesRendered; n++ ) { float tmp; - tmp = p_output[0][n]; - p_output[0][n] = 0.5f * ( tmp + p_output[1][n] ); /* W = 0.5 * ( L + R ) */ - p_output[1][n] = 0.5f * ( tmp - p_output[1][n] ); /* Y = 0.5 * ( L - R ) */ + tmp = p_tc[0][n]; + p_output[0][n] = 0.5f * ( tmp + p_tc[1][n] ); /* W = 0.5 * ( L + R ) */ + p_output[1][n] = 0.5f * ( tmp - p_tc[1][n] ); /* Y = 0.5 * ( L - R ) */ } } #endif /* FIX_1419_MONO_STEREO_UMX */ diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 8cb73461d9..84cdfb23a3 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -86,11 +86,9 @@ void ivas_renderer_select( if ( st_ivas->ivas_format == MONO_FORMAT ) { *renderer_type = RENDERER_NON_DIEGETIC_DOWNMIX; - *internal_config = IVAS_AUDIO_CONFIG_MONO; } else if ( st_ivas->ivas_format == STEREO_FORMAT ) { - *internal_config = IVAS_AUDIO_CONFIG_STEREO; *renderer_type = RENDERER_DISABLE; } else if ( st_ivas->ivas_format == ISM_FORMAT ) @@ -269,9 +267,7 @@ void ivas_renderer_select( #ifdef FIX_1419_MONO_STEREO_UMX else if ( st_ivas->ivas_format == MONO_FORMAT ) { - *internal_config = IVAS_AUDIO_CONFIG_MONO; - - if ( output_config == IVAS_AUDIO_CONFIG_STEREO || output_config == IVAS_AUDIO_CONFIG_FOA || output_config == IVAS_AUDIO_CONFIG_HOA2 || output_config == IVAS_AUDIO_CONFIG_HOA3 ) + if ( output_config == IVAS_AUDIO_CONFIG_STEREO ) { *renderer_type = RENDERER_NON_DIEGETIC_DOWNMIX; } @@ -282,8 +278,6 @@ void ivas_renderer_select( } else if ( st_ivas->ivas_format == STEREO_FORMAT ) { - *internal_config = IVAS_AUDIO_CONFIG_STEREO; - if ( output_config == IVAS_AUDIO_CONFIG_FOA || output_config == IVAS_AUDIO_CONFIG_HOA2 || output_config == IVAS_AUDIO_CONFIG_HOA3 ) { *renderer_type = RENDERER_SBA_LINEAR_ENC; -- GitLab From 3afc01c0d6a3e721c7ac23ca9736b2adf7d650dc Mon Sep 17 00:00:00 2001 From: vaclav Date: Sat, 22 Nov 2025 12:55:26 +0100 Subject: [PATCH 06/13] add FIX_1435_MOVE_STEREO_PANNING --- lib_com/ivas_prot.h | 12 ++++++++++-- lib_com/options.h | 1 + lib_dec/ivas_jbm_dec.c | 18 ++++++++++------- lib_dec/ivas_mono_dmx_renderer.c | 8 ++++---- lib_dec/ivas_sba_rendering_internal.c | 28 +++++++++++++++++++++++++++ lib_dec/lib_dec.c | 3 ++- 6 files changed, 56 insertions(+), 14 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 3699782aa7..b0ae293708 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -802,8 +802,8 @@ void dtx_read_padding_bits( #endif void ivas_apply_non_diegetic_panning( - float *input_f, /* i : non-diegetic object */ - float *output_f[], /* o : core-coder transport mono channel/stereo output */ + float *input_f, /* i : non-diegetic object (mono channel) */ + float *output_f[], /* o : stereo output channels */ const float non_diegetic_pan_gain, /* i : non-diegetic panning gain */ const int16_t output_frame /* i : output frame length per channel */ ); @@ -5268,6 +5268,14 @@ void ivas_mc2sba( const int16_t sba_order, /* i : SBA order */ const float gain_lfe /* i : gain for LFE, 0=ignore LFE */ ); +#ifdef FIX_1419_MONO_STEREO_UMX + +void ivas_stereo2sba( + float *input_f[], /* i : core-coder transport stereo channels */ + float *output_f[], /* o : SBA output channels */ + const int16_t output_frame /* i : output frame length per channel */ +); +#endif void ivas_param_mc_mc2sba_cldfb( IVAS_OUTPUT_SETUP hTransSetup, /* i : transported MC Format */ diff --git a/lib_com/options.h b/lib_com/options.h index 9e2052b43b..87550421aa 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -182,6 +182,7 @@ #define RENDERER_MD_SYNC_DELAY_TO_INTEGER /* FhG: change data type of metadata sync delay in ext renderer to int16_t for better BASOP portability (and nicer code) */ #define FIX_1427_OBJ_EDITING_EXT_METADATA /* Eri: Add support for extended metadata in object editing */ #define FIX_1419_MONO_STEREO_UMX /* FhG: fix for issue 1419 : support upmix to all output formats for mono and stereo */ +#define FIX_1435_MOVE_STEREO_PANNING /* VA: issue 1435: do the EVS stereo panning in the renderer */ #define FIX_1437_LC3PLUS_EXTREND_HIRES /* FhG: fix external renderer split bitstream header writing causing a crash for LC3plus High-res mode */ #define FIX_1318_ROOM_SIZE_CMD_LINE /* Philips/Nokia: Default room sizes support */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 50439c02a0..86026a2a52 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -955,16 +955,16 @@ ivas_error ivas_jbm_dec_render( #endif ivas_ls_setup_conversion( st_ivas, st_ivas->nchan_transport, *nSamplesRendered, p_tc, p_output ); } +#ifdef FIX_1435_MOVE_STEREO_PANNING + else if ( st_ivas->renderer_type == RENDERER_NON_DIEGETIC_DOWNMIX ) + { + ivas_apply_non_diegetic_panning( p_tc[0], p_output, st_ivas->hDecoderConfig->non_diegetic_pan_gain, *nSamplesRendered ); + } +#endif #ifdef FIX_1419_MONO_STEREO_UMX else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) { - for ( n = 0; n < *nSamplesRendered; n++ ) - { - float tmp; - tmp = p_tc[0][n]; - p_output[0][n] = 0.5f * ( tmp + p_tc[1][n] ); /* W = 0.5 * ( L + R ) */ - p_output[1][n] = 0.5f * ( tmp - p_tc[1][n] ); /* Y = 0.5 * ( L - R ) */ - } + ivas_stereo2sba( p_tc, p_output, *nSamplesRendered ); } #endif /* FIX_1419_MONO_STEREO_UMX */ } @@ -2566,6 +2566,9 @@ TC_BUFFER_MODE ivas_jbm_dec_get_tc_buffer_mode( buffer_mode = TC_BUFFER_MODE_RENDERER; break; case RENDERER_NON_DIEGETIC_DOWNMIX: +#ifdef FIX_1435_MOVE_STEREO_PANNING + buffer_mode = TC_BUFFER_MODE_RENDERER; +#else if ( st_ivas->ivas_format == MONO_FORMAT ) { buffer_mode = TC_BUFFER_MODE_BUFFER; @@ -2574,6 +2577,7 @@ TC_BUFFER_MODE ivas_jbm_dec_get_tc_buffer_mode( { buffer_mode = TC_BUFFER_MODE_RENDERER; } +#endif break; case RENDERER_MC_PARAMMC: if ( st_ivas->hParamMC->synthesis_conf == PARAM_MC_SYNTH_MONO_STEREO ) diff --git a/lib_dec/ivas_mono_dmx_renderer.c b/lib_dec/ivas_mono_dmx_renderer.c index 40ae744154..0715e7568a 100644 --- a/lib_dec/ivas_mono_dmx_renderer.c +++ b/lib_dec/ivas_mono_dmx_renderer.c @@ -221,10 +221,10 @@ void ivas_mono_stereo_downmix_mcmasa( *------------------------------------------------------------------------*/ void ivas_apply_non_diegetic_panning( - float *input_f, /* i : non-diegetic object */ - float *output_f[], /* o : core-coder transport mono channel/stereo output */ - const float non_diegetic_pan_gain, /* i : non-diegetic panning gain */ - const int16_t output_frame /* i : output frame length per channel */ + float *input_f, /* i : non-diegetic object (mono channel) */ + float *output_f[], /* o : stereo output channels */ + const float non_diegetic_pan_gain, /* i : non-diegetic panning gain */ + const int16_t output_frame /* i : output frame length per channel */ ) { float pan_left, pan_right; diff --git a/lib_dec/ivas_sba_rendering_internal.c b/lib_dec/ivas_sba_rendering_internal.c index 8538411328..1939359a8e 100644 --- a/lib_dec/ivas_sba_rendering_internal.c +++ b/lib_dec/ivas_sba_rendering_internal.c @@ -209,6 +209,34 @@ void ivas_mc2sba( return; } +#ifdef FIX_1419_MONO_STEREO_UMX + +/*-------------------------------------------------------------------------* + * ivas_stereo2sba() + * + * mono signal is transformed into SBA in TD domain + *-------------------------------------------------------------------------*/ + +void ivas_stereo2sba( + float *input_f[], /* i : core-coder transport stereo channels */ + float *output_f[], /* o : SBA output channels */ + const int16_t output_frame /* i : output frame length per channel */ +) +{ + int16_t n; + float tmp; + + for ( n = 0; n < output_frame; n++ ) + { + tmp = input_f[0][n]; + output_f[0][n] = 0.5f * ( tmp + input_f[1][n] ); /* W = 0.5 * ( L + R ) */ + output_f[1][n] = 0.5f * ( tmp - input_f[1][n] ); /* Y = 0.5 * ( L - R ) */ + } + + return; +} + +#endif /*-------------------------------------------------------------------------* * ivas_param_mc_mc2sba_cldfb() diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index de95304301..cb7c546ddf 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -5238,6 +5238,7 @@ static ivas_error evs_dec_main( st_ivas->BER_detect = hCoreCoder[0]->BER_detect; +#ifndef FIX_1435_MOVE_STEREO_PANNING if ( st_ivas->renderer_type == RENDERER_NON_DIEGETIC_DOWNMIX ) { mixer_left = ( st_ivas->hDecoderConfig->non_diegetic_pan_gain + 1.f ) * 0.5f; @@ -5245,7 +5246,7 @@ static ivas_error evs_dec_main( v_multc( p_output[0], mixer_rigth, p_output[1], nOutSamples ); v_multc( p_output[0], mixer_left, p_output[0], nOutSamples ); } - +#endif #ifdef FIX_1419_MONO_STEREO_UMX if ( st_ivas->hDecoderConfig->Opt_tsm && st_ivas->hDecoderConfig->nchan_out == 1 ) #else -- GitLab From b97cffe167835f75c1cc91fee60eb4b1f46ddc8a Mon Sep 17 00:00:00 2001 From: vaclav Date: Sat, 22 Nov 2025 13:01:10 +0100 Subject: [PATCH 07/13] add one test-vector condition to test stereo->FOA --- scripts/config/self_test.prm | 5 +++++ scripts/config/self_test_ltv.prm | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index 588495b783..83196d65ce 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -1585,6 +1585,11 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_0.dat bit netsimoutput tracefile_sim 2 0 ../IVAS_dec -no_delay_cmp -Tracefile tracefile_dec -VOIP STEREO 32 netsimoutput testv/stvST48n.wav_stereo_32000_48-32_DTX_JBM0.tst +// stereo at 64 kbps, 48 kHz in, 48 kHz out, FOA out, JBM Prof 5 +../IVAS_cod -stereo 64000 48 testv/stvST48c.wav bit +networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 +../IVAS_dec -no_delay_cmp -Tracefile tracefile_dec -VOIP FOA 48 netsimoutput testv/stvST48c.wav_stereo_64000_48-48_FOA_JBM5.tst + // 4 ISm with metadata at 64 kbps, 48 kHz in, 48 kHz out, DTX on, EXT out, JBM Prof 0 ../IVAS_cod -dtx -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 64000 48 testv/stv4ISM48n.wav bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_0.dat bit netsimoutput tracefile_sim 2 0 diff --git a/scripts/config/self_test_ltv.prm b/scripts/config/self_test_ltv.prm index 5db028d50a..d53637b959 100644 --- a/scripts/config/self_test_ltv.prm +++ b/scripts/config/self_test_ltv.prm @@ -1568,7 +1568,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec 48 bit testv/ltv48_STEREO.wav_StereoDmxEVS_24400_48-48.tst - // EVS non-diegetic panning at 64 kbps, 48kHz in, 48kHz out, STEREO out ../IVAS_cod 64000 48 testv/ltv48_MONO.wav bit ../IVAS_dec -non_diegetic_pan -50 48 bit testv/ltv48_MONO.pcm_EVS_64000_48-48_STEREO_NON-DIEGETIC-PAN_-50.tst @@ -1578,12 +1577,16 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec -non_diegetic_pan 80 STEREO 48 bit testv/ltv48_1ISM.pcm_ISM_32000_48-48_STEREO_NON-DIEGETIC-PAN_80.tst - // stereo at 32 kbps, 48 kHz in, 32 kHz out, DTX on, JBM Prof 0 ../IVAS_cod -stereo -dtx 32000 48 testv/ltv48_STEREO.wav bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_0.dat bit netsimoutput tracefile_sim 2 0 ../IVAS_dec -no_delay_cmp -Tracefile tracefile_dec -VOIP STEREO 32 netsimoutput testv/ltv48_STEREO.wav_stereo_32000_48-32_DTX_JBM0.tst +// stereo at 64 kbps, 48 kHz in, 48 kHz out, FOA out, JBM Prof 5 +../IVAS_cod -stereo 64000 48 testv/ltv48_STEREO.wav bit +networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 +../IVAS_dec -no_delay_cmp -Tracefile tracefile_dec -VOIP FOA 48 netsimoutput testv/ltv48_STEREO.wav_stereo_64000_48-48_FOA_JBM5.tst + // 4 ISm with metadata at 64 kbps, 48 kHz in, 48 kHz out, DTX on, EXT out, JBM Prof 0 ../IVAS_cod -dtx -ism 4 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 64000 48 testv/ltv48_4ISM.wav bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_0.dat bit netsimoutput tracefile_sim 2 0 -- GitLab From dcd6b4dfac61dd6dce26e1cd7552d52e0687c395 Mon Sep 17 00:00:00 2001 From: vaclav Date: Sat, 22 Nov 2025 13:24:22 +0100 Subject: [PATCH 08/13] clang-format --- lib_dec/ivas_output_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 84cdfb23a3..0c68d1bd7d 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -267,7 +267,7 @@ void ivas_renderer_select( #ifdef FIX_1419_MONO_STEREO_UMX else if ( st_ivas->ivas_format == MONO_FORMAT ) { - if ( output_config == IVAS_AUDIO_CONFIG_STEREO ) + if ( output_config == IVAS_AUDIO_CONFIG_STEREO ) { *renderer_type = RENDERER_NON_DIEGETIC_DOWNMIX; } -- GitLab From a34ed96e88fdd6a477adbda260216426f530b11a Mon Sep 17 00:00:00 2001 From: vaclav Date: Sat, 22 Nov 2025 13:30:35 +0100 Subject: [PATCH 09/13] fix warning --- lib_dec/lib_dec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index cb7c546ddf..5310d10cc3 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -5163,7 +5163,9 @@ static ivas_error evs_dec_main( ) { DEC_CORE_HANDLE *hCoreCoder; +#ifndef FIX_1435_MOVE_STEREO_PANNING float mixer_left, mixer_rigth; +#endif #ifdef FIX_1419_MONO_STEREO_UMX /* required now that mono can render to a higher number of output channels */ float *p_output[MAX_TRANSPORT_CHANNELS]; #else -- GitLab From dd004cddc8fa2eddb46a944cb5944b8dc46f6170 Mon Sep 17 00:00:00 2001 From: vaclav Date: Sat, 22 Nov 2025 22:29:38 +0100 Subject: [PATCH 10/13] more optimization --- lib_dec/ivas_init_dec.c | 17 ++++++++++------- lib_dec/ivas_jbm_dec.c | 10 ++++++++++ lib_dec/lib_dec.c | 25 +++++++++++++++++++++---- 3 files changed, 41 insertions(+), 11 deletions(-) diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 6bfe4d0db5..5eb10081a9 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1487,6 +1487,16 @@ ivas_error ivas_init_decoder( st_ivas->intern_config = ivas_set_audio_config_from_sba_order( st_ivas->sba_order ); ivas_output_init( &( st_ivas->hOutSetup ), st_ivas->intern_config ); } +#ifdef FIX_1419_MONO_STEREO_UMX + else if ( st_ivas->ivas_format == MONO_FORMAT ) + { + st_ivas->intern_config = IVAS_AUDIO_CONFIG_MONO; + } + else if ( st_ivas->ivas_format == STEREO_FORMAT ) + { + st_ivas->intern_config = IVAS_AUDIO_CONFIG_STEREO; + } +#endif else { ivas_output_init( &( st_ivas->hOutSetup ), output_config ); @@ -1499,13 +1509,6 @@ ivas_error ivas_init_decoder( st_ivas->hOutSetup.output_config = st_ivas->intern_config; st_ivas->hOutSetup.nchan_out_woLFE = audioCfg2channels( st_ivas->intern_config ); } -#ifdef FIX_1419_MONO_STEREO_UMX - - if ( st_ivas->ivas_format == MONO_FORMAT || st_ivas->ivas_format == STEREO_FORMAT ) - { - st_ivas->transport_config = ( st_ivas->ivas_format == MONO_FORMAT ) ? IVAS_AUDIO_CONFIG_MONO : IVAS_AUDIO_CONFIG_STEREO; - } -#endif /* Only initialize transport setup if it is used */ if ( st_ivas->transport_config != IVAS_AUDIO_CONFIG_INVALID ) diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 86026a2a52..d4729f25c0 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1959,6 +1959,13 @@ int16_t ivas_jbm_dec_get_num_tc_channels( ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; +#ifdef FIX_1435_MOVE_STEREO_PANNING + if ( st_ivas->ivas_format == MONO_FORMAT ) + { + num_tc = 1; + } + else if ( st_ivas->ivas_format == STEREO_FORMAT && st_ivas->hDecoderConfig->nchan_out == 1 ) +#else #ifndef FIX_1419_MONO_STEREO_UMX /* since we support more output formats for mono, this is no longer sensible; leave it at the default from above */ if ( st_ivas->ivas_format == MONO_FORMAT ) { @@ -1967,6 +1974,7 @@ int16_t ivas_jbm_dec_get_num_tc_channels( else if ( st_ivas->ivas_format == STEREO_FORMAT && st_ivas->hDecoderConfig->nchan_out == 1 ) #else if ( st_ivas->ivas_format == STEREO_FORMAT && st_ivas->hDecoderConfig->nchan_out == 1 ) +#endif #endif { num_tc = 1; @@ -2075,10 +2083,12 @@ int16_t ivas_jbm_dec_get_num_tc_channels( } } } +#ifndef FIX_1435_MOVE_STEREO_PANNING else if ( st_ivas->ivas_format == MONO_FORMAT && st_ivas->renderer_type == RENDERER_NON_DIEGETIC_DOWNMIX ) { num_tc = MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN; } +#endif return num_tc; } diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 5310d10cc3..d57ad33137 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -2480,6 +2480,9 @@ static ivas_error ivas_dec_setup_all( if ( hIvasDec->mode == IVAS_DEC_MODE_EVS ) { +#ifdef FIX_1435_MOVE_STEREO_PANNING + *nTransportChannels = 1; +#else if ( hIvasDec->st_ivas->renderer_type == RENDERER_NON_DIEGETIC_DOWNMIX ) { *nTransportChannels = MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN; @@ -2488,6 +2491,7 @@ static ivas_error ivas_dec_setup_all( { *nTransportChannels = 1; } +#endif } else { @@ -5165,13 +5169,16 @@ static ivas_error evs_dec_main( DEC_CORE_HANDLE *hCoreCoder; #ifndef FIX_1435_MOVE_STEREO_PANNING float mixer_left, mixer_rigth; -#endif #ifdef FIX_1419_MONO_STEREO_UMX /* required now that mono can render to a higher number of output channels */ float *p_output[MAX_TRANSPORT_CHANNELS]; #else float *p_output[MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN]; #endif int16_t ch, nOutSamples; +#else + float *p_output[1]; + int16_t nOutSamples; +#endif ivas_error error; hCoreCoder = st_ivas->hSCE[0]->hCoreCoder; @@ -5180,6 +5187,9 @@ static ivas_error evs_dec_main( mdct_switching_dec( hCoreCoder[0] ); +#ifdef FIX_1435_MOVE_STEREO_PANNING + p_output[0] = st_ivas->p_output_f[0]; +#else #ifdef FIX_1419_MONO_STEREO_UMX for ( ch = 0; ch < MAX_TRANSPORT_CHANNELS; ch++ ) #else @@ -5194,6 +5204,7 @@ static ivas_error evs_dec_main( } #endif } +#endif /* run the main EVS decoding routine */ if ( hCoreCoder[0]->codec_mode == MODE1 ) @@ -5250,23 +5261,29 @@ static ivas_error evs_dec_main( } #endif #ifdef FIX_1419_MONO_STEREO_UMX - if ( st_ivas->hDecoderConfig->Opt_tsm && st_ivas->hDecoderConfig->nchan_out == 1 ) + if ( st_ivas->hDecoderConfig->Opt_tsm && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_MONO ) #else if ( st_ivas->hDecoderConfig->Opt_tsm ) #endif { /* BE workaround: in order to keep EVS bit-exact wrt. TS 26.443, convert 'float' output data to 'short' before the TSM */ int16_t pcm_buf_local[L_FRAME48k]; - +#ifdef FIX_1419_MONO_STEREO_UMX +#ifdef DEBUGGING + st_ivas->noClipping += +#endif + ivas_syn_output( &p_output[0], nOutSamples, 1, pcm_buf_local ); + mvs2r( pcm_buf_local, p_output[0], nOutSamples ); +#else for ( ch = 0; ch < st_ivas->hDecoderConfig->nchan_out; ch++ ) { #ifdef DEBUGGING st_ivas->noClipping += #endif ivas_syn_output( &p_output[ch], nOutSamples, 1, pcm_buf_local ); - mvs2r( pcm_buf_local, p_output[ch], nOutSamples ); } +#endif } return IVAS_ERR_OK; -- GitLab From ddf18e6b398251d8cfd5a45cbfeca530724a504d Mon Sep 17 00:00:00 2001 From: vaclav Date: Sun, 23 Nov 2025 11:51:16 +0100 Subject: [PATCH 11/13] remove obsolete parameter 'arg->evsMode' --- apps/decoder.c | 9 +-------- lib_dec/ivas_init_dec.c | 13 +------------ lib_dec/lib_dec.c | 3 +++ 3 files changed, 5 insertions(+), 20 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 9b20043786..b61ac6e6d7 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -159,9 +159,6 @@ typedef struct uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS]; bool objEditEnabled; char *objEditFileName; -#ifdef FIX_1419_MONO_STEREO_UMX - bool evsMode; -#endif #ifdef FIX_1318_ROOM_SIZE_CMD_LINE IVAS_ROOM_SIZE_T roomSize; #endif @@ -1097,9 +1094,6 @@ static bool parseCmdlIVAS_dec( arg->output_Fs = IVAS_MAX_SAMPLING_RATE; arg->outputConfig = IVAS_AUDIO_CONFIG_MONO; arg->decMode = IVAS_DEC_MODE_IVAS; -#ifdef FIX_1419_MONO_STEREO_UMX - arg->evsMode = false; -#endif arg->quietModeEnabled = false; arg->delayCompensationEnabled = true; arg->voipMode = false; @@ -1660,7 +1654,6 @@ static bool parseCmdlIVAS_dec( #ifdef FIX_1419_MONO_STEREO_UMX else if ( strcmp( argv_to_upper, "-EVS" ) == 0 ) { - arg->evsMode = true; arg->decMode = IVAS_DEC_MODE_EVS; i++; } @@ -1755,7 +1748,7 @@ static bool parseCmdlIVAS_dec( return false; } #ifdef FIX_1419_MONO_STEREO_UMX - else if ( arg->non_diegetic_pan_enabled && arg->outputConfig == IVAS_AUDIO_CONFIG_STEREO && arg->evsMode ) + else if ( arg->non_diegetic_pan_enabled && arg->outputConfig == IVAS_AUDIO_CONFIG_STEREO && arg->decMode == IVAS_DEC_MODE_EVS ) { fprintf( stderr, "Error: Both non-diegetic panning and stereo output specified!\n\n" ); usage_dec(); diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 5eb10081a9..7833380ede 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1487,16 +1487,6 @@ ivas_error ivas_init_decoder( st_ivas->intern_config = ivas_set_audio_config_from_sba_order( st_ivas->sba_order ); ivas_output_init( &( st_ivas->hOutSetup ), st_ivas->intern_config ); } -#ifdef FIX_1419_MONO_STEREO_UMX - else if ( st_ivas->ivas_format == MONO_FORMAT ) - { - st_ivas->intern_config = IVAS_AUDIO_CONFIG_MONO; - } - else if ( st_ivas->ivas_format == STEREO_FORMAT ) - { - st_ivas->intern_config = IVAS_AUDIO_CONFIG_STEREO; - } -#endif else { ivas_output_init( &( st_ivas->hOutSetup ), output_config ); @@ -1647,9 +1637,8 @@ ivas_error ivas_init_decoder( else if ( st_ivas->ivas_format == STEREO_FORMAT ) { st_ivas->nchan_transport = CPE_CHANNELS; -#ifndef FIX_1419_MONO_STEREO_UMX /* already set now by renderer_select() */ st_ivas->intern_config = IVAS_AUDIO_CONFIG_STEREO; -#endif + st_ivas->nSCE = 0; st_ivas->nCPE = 1; /* in stereo, there is always only one CPE */ cpe_id = 0; diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index d57ad33137..f82448bc91 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -904,6 +904,9 @@ ivas_error IVAS_DEC_FeedFrame_Serial( if ( hIvasDec->mode == IVAS_DEC_MODE_EVS ) { hIvasDec->st_ivas->hDecoderConfig->ivas_total_brate = ACELP_8k00; +#ifdef FIX_1419_MONO_STEREO_UMX + hIvasDec->st_ivas->transport_config = IVAS_AUDIO_CONFIG_MONO; +#endif if ( ( error = ivas_init_decoder( hIvasDec->st_ivas ) ) != IVAS_ERR_OK ) { -- GitLab From 0fa315651d7e6a42ee8a5ff3b903c6d4a1591368 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 24 Nov 2025 11:26:57 +0100 Subject: [PATCH 12/13] address reviewer's comments --- lib_dec/ivas_jbm_dec.c | 7 ++++--- lib_dec/ivas_sba_rendering_internal.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index d4729f25c0..0287e8455d 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -2558,6 +2558,9 @@ TC_BUFFER_MODE ivas_jbm_dec_get_tc_buffer_mode( case RENDERER_MONO_DOWNMIX: buffer_mode = TC_BUFFER_MODE_BUFFER; break; +#ifdef FIX_1435_MOVE_STEREO_PANNING + case RENDERER_NON_DIEGETIC_DOWNMIX: +#endif case RENDERER_TD_PANNING: case RENDERER_BINAURAL_OBJECTS_TD: case RENDERER_BINAURAL_FASTCONV: @@ -2575,10 +2578,8 @@ TC_BUFFER_MODE ivas_jbm_dec_get_tc_buffer_mode( case RENDERER_OSBA_LS: buffer_mode = TC_BUFFER_MODE_RENDERER; break; +#ifndef FIX_1435_MOVE_STEREO_PANNING case RENDERER_NON_DIEGETIC_DOWNMIX: -#ifdef FIX_1435_MOVE_STEREO_PANNING - buffer_mode = TC_BUFFER_MODE_RENDERER; -#else if ( st_ivas->ivas_format == MONO_FORMAT ) { buffer_mode = TC_BUFFER_MODE_BUFFER; diff --git a/lib_dec/ivas_sba_rendering_internal.c b/lib_dec/ivas_sba_rendering_internal.c index 1939359a8e..bd5a17d0b4 100644 --- a/lib_dec/ivas_sba_rendering_internal.c +++ b/lib_dec/ivas_sba_rendering_internal.c @@ -214,7 +214,7 @@ void ivas_mc2sba( /*-------------------------------------------------------------------------* * ivas_stereo2sba() * - * mono signal is transformed into SBA in TD domain + * stereo signal is transformed into SBA in TD domain *-------------------------------------------------------------------------*/ void ivas_stereo2sba( -- GitLab From e5e28289e157c13fd0e93d38eaef11d2c8cba31e Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 24 Nov 2025 16:24:55 +0100 Subject: [PATCH 13/13] fix: use *renderer_type = RENDERER_DISABLE; in stereo to mono --- lib_dec/ivas_output_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 0c68d1bd7d..548d4d4574 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -282,7 +282,7 @@ void ivas_renderer_select( { *renderer_type = RENDERER_SBA_LINEAR_ENC; } - else if ( output_config == IVAS_AUDIO_CONFIG_MONO || output_config == IVAS_AUDIO_CONFIG_5_1 || output_config == IVAS_AUDIO_CONFIG_5_1_2 || output_config == IVAS_AUDIO_CONFIG_5_1_4 || output_config == IVAS_AUDIO_CONFIG_7_1 || output_config == IVAS_AUDIO_CONFIG_7_1_4 || output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) + else if ( output_config == IVAS_AUDIO_CONFIG_5_1 || output_config == IVAS_AUDIO_CONFIG_5_1_2 || output_config == IVAS_AUDIO_CONFIG_5_1_4 || output_config == IVAS_AUDIO_CONFIG_7_1 || output_config == IVAS_AUDIO_CONFIG_7_1_4 || output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { *renderer_type = RENDERER_MC; } -- GitLab