From 3301bfc817fbb9e4f2a87a4ce6fb4a886822d246 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 5 Nov 2025 09:58:40 +0100 Subject: [PATCH 1/7] add FIX_1419_MONO_STEREO_UMX - enable non spatial rendering for mono and stereo to all output formats --- apps/decoder.c | 20 ++++++++++ lib_com/ivas_cnst.h | 4 ++ lib_com/options.h | 4 ++ lib_dec/ivas_init_dec.c | 37 +++++++++++++++++- lib_dec/ivas_jbm_dec.c | 36 ++++++++++++++++++ lib_dec/ivas_output_config.c | 72 ++++++++++++++++++++++++++++++++++++ lib_dec/lib_dec.c | 27 ++++++++++++++ lib_rend/ivas_rom_rend.c | 24 +++++++++++- 8 files changed, 221 insertions(+), 3 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 6f7b929cd2..7b0647d8f5 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -155,6 +155,9 @@ typedef struct uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS]; bool objEditEnabled; char *objEditFileName; +#ifdef FIX_1419_MONO_STEREO_UMX + bool evsMode; +#endif } DecArguments; @@ -971,6 +974,9 @@ 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; @@ -1524,6 +1530,14 @@ static bool parseCmdlIVAS_dec( } i++; } +#ifdef FIX_1419_MONO_STEREO_UMX + else if ( strcmp( argv_to_upper, "-EVS" ) == 0 ) + { + arg->evsMode = true; + arg->decMode = IVAS_DEC_MODE_EVS; + i++; + } +#endif /*-----------------------------------------------------------------* * Option not recognized @@ -1666,6 +1680,9 @@ static bool parseCmdlIVAS_dec( static void usage_dec( void ) { fprintf( stdout, "Usage for EVS: IVAS_dec.exe [Options] Fs bitstream_file output_file\n" ); +#ifdef FIX_1419_MONO_STEREO_UMX + fprintf( stdout, " OR usage for IVAS (below) with -evs option and OutputConf\n" ); +#endif fprintf( stdout, "Usage for IVAS: IVAS_dec.exe [Options] OutputConf Fs bitstream_file output_file\n\n" ); fprintf( stdout, "Mandatory parameters:\n" ); @@ -1682,6 +1699,9 @@ static void usage_dec( void ) fprintf( stdout, "Options:\n" ); fprintf( stdout, "--------\n" ); +#ifdef FIX_1419_MONO_STEREO_UMX + fprintf( stdout, "-evs : Specify EVS mode for supplied bitstream\n" ); +#endif fprintf( stdout, "-VOIP : VoIP mode: RTP in G192\n" ); fprintf( stdout, "-VOIP_hf_only=0 : VoIP mode: EVS RTP Payload Format hf_only=0 in rtpdump\n" ); #ifdef IVAS_RTPDUMP diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 3e8521f47d..c169b7684a 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1251,7 +1251,11 @@ typedef enum *----------------------------------------------------------------------------------*/ #define MC_LS_SETUP_BITS 3 /* number of bits for writing the MC LS configuration */ +#ifdef FIX_1419_MONO_STEREO_UMX +#define LS_SETUP_CONVERSION_NUM_MAPPINGS 41 /* number of mappings for LS setup conversion */ +#else #define LS_SETUP_CONVERSION_NUM_MAPPINGS 35 /* number of mappings for LS setup conversion */ +#endif typedef enum { diff --git a/lib_com/options.h b/lib_com/options.h index a98f995caa..b8ea8c811e 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -171,6 +171,10 @@ #define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */ #define FIX_1413_IGF_INIT_PRINTOUT /* FhG: use correct variable for IGF initiliazation */ #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_1419_MONO_STEREO_UMX /* FhG: fix for issue 1419 : support upmix to all output formats for mono and stereo */ +#ifdef FIX_1419_MONO_STEREO_UMX +/* #define FIX_1419_SPATIAL_UMX */ /* FhG: issue 1419: enable spatial upmix for mono/stereo; configurable via renderer config */ +#endif /* #################### End BE switches ################################## */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 7e09074af0..71d89e77da 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1279,7 +1279,15 @@ ivas_error ivas_init_decoder( if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { +#ifdef FIX_1419_MONO_STEREO_UMX + if ( st_ivas->ivas_format == MONO_FORMAT ) + { + hDecoderConfig->nchan_out = 1; + } + else if ( st_ivas->ivas_format == STEREO_FORMAT ) +#else if ( st_ivas->ivas_format == STEREO_FORMAT ) +#endif { hDecoderConfig->nchan_out = CPE_CHANNELS; } @@ -1332,6 +1340,13 @@ 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 ) @@ -1414,7 +1429,9 @@ 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 */ @@ -2308,7 +2325,8 @@ ivas_error ivas_init_decoder( } /*-----------------------------------------------------------------* - * LFE handles for rendering after rendering to adjust LFE delay to filter delay + * LFE handles for rendering after rendering to adjust LFE delay to + * filter delay *-----------------------------------------------------------------*/ if ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) @@ -3140,6 +3158,7 @@ static ivas_error doSanityChecks_IVAS( return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Error: Non-diegetic panning not supported in this IVAS format" ); } +#ifndef FIX_1419_MONO_STEREO_UMX /* we now support basically everything for stereo */ /* Verify stereo output configuration */ if ( st_ivas->ivas_format == STEREO_FORMAT ) { @@ -3152,10 +3171,26 @@ static ivas_error doSanityChecks_IVAS( else { if ( output_config == IVAS_AUDIO_CONFIG_INVALID ) +#else /* exclude invalid configs instead of matching valid ones */ + if ( output_config == IVAS_AUDIO_CONFIG_INVALID || + output_config == IVAS_AUDIO_CONFIG_ISM1 || + output_config == IVAS_AUDIO_CONFIG_ISM2 || + output_config == IVAS_AUDIO_CONFIG_ISM3 || + output_config == IVAS_AUDIO_CONFIG_ISM4 || + output_config == IVAS_AUDIO_CONFIG_MASA1 || + output_config == IVAS_AUDIO_CONFIG_MASA2 ) +#endif { return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified!" ); } + if ( ( st_ivas->ivas_format == MONO_FORMAT || st_ivas->ivas_format == STEREO_FORMAT ) && + ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) + { + return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified!" ); + } +#ifndef FIX_1419_MONO_STEREO_UMX } +#endif if ( ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) && output_Fs != 48000 ) { diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index b19f0bdf7e..3e38ef6675 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -934,14 +934,42 @@ ivas_error ivas_jbm_dec_render( { ivas_jbm_dec_tc_buffer_playout( st_ivas, nSamplesAskedLocal, nSamplesRendered, p_output ); } +#ifdef FIX_1419_MONO_STEREO_UMX + else if ( st_ivas->ivas_format == MONO_FORMAT || st_ivas->ivas_format == STEREO_FORMAT ) +#else 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 ) { +#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 ); } +#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++ ) + { + p_output[0][n] = 0.5f * ( p_output[0][n] + p_output[1][n] ); /* W = 0.5 * ( L + R ) */ + p_output[1][n] = 0.5f * ( p_output[0][n] - p_output[1][n] ); /* Y = 0.5 * ( L - R ) */ + } + } + } +#endif /* FIX_1419_MONO_STEREO_UMX */ } else if ( st_ivas->ivas_format == ISM_FORMAT ) { @@ -1928,11 +1956,15 @@ int16_t ivas_jbm_dec_get_num_tc_channels( ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; +#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 ) { num_tc = st_ivas->hDecoderConfig->nchan_out; } 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 { num_tc = 1; } @@ -2800,7 +2832,11 @@ void ivas_dec_prepare_renderer( ivas_omasa_gain_masa_tc( st_ivas->hTcBuffer->tc, st_ivas->hMasaIsmData->gain_masa_edited, st_ivas->nchan_ism, st_ivas->hTcBuffer->n_samples_available ); } } +#ifdef FIX_1419_MONO_STEREO_UMX + else if ( st_ivas->ivas_format == MONO_FORMAT || st_ivas->ivas_format == STEREO_FORMAT ) +#else else if ( st_ivas->ivas_format == STEREO_FORMAT ) +#endif { ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); } diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index b4b241815d..f5b4d577b1 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -41,6 +41,28 @@ #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() @@ -82,7 +104,17 @@ 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 ) + { + ms_bin_upmix_renderer_select( st_ivas->ivas_format, + internal_config, + renderer_type ); + } + else if ( st_ivas->ivas_format == ISM_FORMAT ) +#else if ( st_ivas->ivas_format == ISM_FORMAT ) +#endif { if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { @@ -252,6 +284,45 @@ void ivas_renderer_select( * Non-binaural rendering configurations *-----------------------------------------------------------------*/ +#ifdef FIX_1419_MONO_STEREO_UMX + 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; + 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 ( *internal_config == IVAS_AUDIO_CONFIG_STEREO ) + { + /* stereo to mono downmix */ + *renderer_type = RENDERER_MC; + } + break; + case IVAS_AUDIO_CONFIG_STEREO: + if ( *internal_config == IVAS_AUDIO_CONFIG_MONO ) + { + /* mono to stereo upmix */ + *renderer_type = RENDERER_NON_DIEGETIC_DOWNMIX; + } + break; + default: + /* RENDERER_DISABLE already set by default */ + break; + } + } +#else else if ( st_ivas->ivas_format == MONO_FORMAT ) { if ( output_config == IVAS_AUDIO_CONFIG_STEREO ) @@ -266,6 +337,7 @@ void ivas_renderer_select( *renderer_type = RENDERER_MC; } } +#endif else if ( st_ivas->ivas_format == ISM_FORMAT ) { if ( ( output_config == IVAS_AUDIO_CONFIG_STEREO ) && ( st_ivas->hDecoderConfig->Opt_non_diegetic_pan ) ) diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index d8a602beb0..be69344904 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -474,8 +474,21 @@ ivas_error IVAS_DEC_Configure( return IVAS_ERR_WRONG_PARAMS; } +#ifdef FIX_1419_MONO_STEREO_UMX + if ( hIvasDec->mode == IVAS_DEC_MODE_EVS && + ( outputConfig == IVAS_AUDIO_CONFIG_INVALID || + outputConfig == IVAS_AUDIO_CONFIG_ISM1 || + outputConfig == IVAS_AUDIO_CONFIG_ISM2 || + outputConfig == IVAS_AUDIO_CONFIG_ISM3 || + outputConfig == IVAS_AUDIO_CONFIG_ISM4 || + outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || + outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM || + outputConfig == IVAS_AUDIO_CONFIG_MASA1 || + outputConfig == IVAS_AUDIO_CONFIG_MASA2 ) ) +#else /* we now support all output formats, so this validation is redundant */ if ( hIvasDec->mode == IVAS_DEC_MODE_EVS && !( ( outputConfig == IVAS_AUDIO_CONFIG_MONO && !non_diegetic_pan_enabled ) || ( outputConfig == IVAS_AUDIO_CONFIG_STEREO && non_diegetic_pan_enabled ) ) ) +#endif { return IVAS_ERR_WRONG_MODE; } @@ -4670,7 +4683,11 @@ static ivas_error evs_dec_main( { DEC_CORE_HANDLE *hCoreCoder; float mixer_left, mixer_rigth; +#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; ivas_error error; @@ -4680,9 +4697,19 @@ static ivas_error evs_dec_main( mdct_switching_dec( hCoreCoder[0] ); +#ifdef FIX_1419_MONO_STEREO_UMX + for ( ch = 0; ch < MAX_TRANSPORT_CHANNELS; ch++ ) +#else for ( ch = 0; ch < MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN; ch++ ) +#endif { p_output[ch] = st_ivas->p_output_f[ch]; +#ifdef FIX_1419_MONO_STEREO_UMX + if ( p_output[ch] != NULL ) + { + set_zero( p_output[ch], L_FRAME48k ); + } +#endif } /* run the main EVS decoding routine */ diff --git a/lib_rend/ivas_rom_rend.c b/lib_rend/ivas_rom_rend.c index 3f4b906bd6..0fad5fae2f 100644 --- a/lib_rend/ivas_rom_rend.c +++ b/lib_rend/ivas_rom_rend.c @@ -388,8 +388,8 @@ const float ivas_reverb_default_DSR[IVAS_REVERB_DEFAULT_N_BANDS] = *----------------------------------------------------------------------------------*/ /* CICP1 - Mono */ -const float ls_azimuth_CICP1[1] = { 0.0f }; -const float ls_elevation_CICP1[1] = { 0.0f }; +const float ls_azimuth_CICP1[1] = { 0.0f }; +const float ls_elevation_CICP1[1] = { 0.0f }; /*----------------------------------------------------------------------------------* @@ -619,6 +619,15 @@ const LS_CONVERSION_MATRIX ls_conversion_cicp19_cicp16[] = }; /* Upmix matrices */ +#ifdef FIX_1419_MONO_STEREO_UMX +const LS_CONVERSION_MATRIX ls_conversion_mono_cicpX[] = { + /* First row indicates the number of non-zero elements and the number of matrix columns */ + {1, 12.0f}, + /* Index of non-zero element, value of non-zero element*/ + {2, 1.0f}, +}; + +#endif const LS_CONVERSION_MATRIX ls_conversion_cicp12_cicp14[] = { /* First row indicates the number of non-zero elements and the number of matrix columns */ @@ -704,6 +713,9 @@ const LS_CONVERSION_MATRIX ls_conversion_cicp16_cicp19[] = const LS_CONVERSION_MAPPING ls_conversion_mapping[LS_SETUP_CONVERSION_NUM_MAPPINGS] = { /* Dowmix mappings - NULL is a special case for MONO / STEREO downmix */ +#ifdef FIX_1419_MONO_STEREO_UMX + {IVAS_AUDIO_CONFIG_STEREO, IVAS_AUDIO_CONFIG_MONO, NULL}, +#endif {IVAS_AUDIO_CONFIG_5_1, IVAS_AUDIO_CONFIG_MONO, NULL}, {IVAS_AUDIO_CONFIG_7_1, IVAS_AUDIO_CONFIG_MONO, NULL}, {IVAS_AUDIO_CONFIG_5_1_2, IVAS_AUDIO_CONFIG_MONO, NULL}, @@ -731,6 +743,14 @@ const LS_CONVERSION_MAPPING ls_conversion_mapping[LS_SETUP_CONVERSION_NUM_MAPPIN {IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_5_1_4, ls_conversion_cicp19_cicp16}, /* Upmix mappings - NULL implies a 1:1 upmix */ +#ifdef FIX_1419_MONO_STEREO_UMX + {IVAS_AUDIO_CONFIG_MONO, IVAS_AUDIO_CONFIG_5_1, ls_conversion_mono_cicpX}, + {IVAS_AUDIO_CONFIG_MONO, IVAS_AUDIO_CONFIG_7_1, ls_conversion_mono_cicpX}, + {IVAS_AUDIO_CONFIG_MONO, IVAS_AUDIO_CONFIG_5_1_2, ls_conversion_mono_cicpX}, + {IVAS_AUDIO_CONFIG_MONO, IVAS_AUDIO_CONFIG_5_1_4, ls_conversion_mono_cicpX}, + {IVAS_AUDIO_CONFIG_MONO, IVAS_AUDIO_CONFIG_7_1_4, ls_conversion_mono_cicpX}, + +#endif {IVAS_AUDIO_CONFIG_STEREO, IVAS_AUDIO_CONFIG_5_1, NULL}, {IVAS_AUDIO_CONFIG_STEREO, IVAS_AUDIO_CONFIG_7_1, NULL}, {IVAS_AUDIO_CONFIG_STEREO, IVAS_AUDIO_CONFIG_5_1_2, NULL}, -- GitLab From 71603aafc97ce5a6e797e7f626d6b1361b4340cb Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 5 Nov 2025 10:25:13 +0100 Subject: [PATCH 2/7] removed commented out switch --- lib_com/options.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index b8ea8c811e..efe5864382 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -172,9 +172,6 @@ #define FIX_1413_IGF_INIT_PRINTOUT /* FhG: use correct variable for IGF initiliazation */ #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_1419_MONO_STEREO_UMX /* FhG: fix for issue 1419 : support upmix to all output formats for mono and stereo */ -#ifdef FIX_1419_MONO_STEREO_UMX -/* #define FIX_1419_SPATIAL_UMX */ /* FhG: issue 1419: enable spatial upmix for mono/stereo; configurable via renderer config */ -#endif /* #################### End BE switches ################################## */ -- GitLab From 8ecb53006fa7af2b15535de25147821ea7624bc1 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 5 Nov 2025 12:28:47 +0100 Subject: [PATCH 3/7] [fix] bug in stereo to ambisonics rendering --- lib_dec/ivas_jbm_dec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 3e38ef6675..2f247ec70d 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -964,8 +964,10 @@ ivas_error ivas_jbm_dec_render( { for ( n = 0; n < *nSamplesRendered; n++ ) { - p_output[0][n] = 0.5f * ( p_output[0][n] + p_output[1][n] ); /* W = 0.5 * ( L + R ) */ - p_output[1][n] = 0.5f * ( p_output[0][n] - 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 ) */ } } } -- GitLab From e677d017c04477a20039fedfd6f1c6cb7b70f022 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Thu, 6 Nov 2025 11:44:20 +0100 Subject: [PATCH 4/7] update readme.txt --- readme.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/readme.txt b/readme.txt index 54b602c995..9b40e1233f 100644 --- a/readme.txt +++ b/readme.txt @@ -261,6 +261,7 @@ The usage of the "IVAS_dec" program is as follows: -------------------------------------------------- Usage for EVS: IVAS_dec.exe [Options] Fs bitstream_file output_file + OR usage for IVAS (below) with -evs option and OutputConf Usage for IVAS: IVAS_dec.exe [Options] OutputConf Fs bitstream_file output_file Mandatory parameters: @@ -278,6 +279,7 @@ output_file : Output audio filename Options: -------- +-evs : Specify EVS mode for supplied bitstream -VOIP : VoIP mode: RTP in G192 -VOIP_hf_only=0 : VoIP mode: EVS RTP Payload Format hf_only=0 in rtpdump -VOIP_hf_only=1 : VoIP mode: EVS or IVAS RTP Payload Format hf_only=1 in rtpdump -- GitLab From f349998c85c84e0b274de40658d3dce292b73d60 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Thu, 6 Nov 2025 15:36:01 +0100 Subject: [PATCH 5/7] [fix] update commandline usage and printouts --- apps/decoder.c | 2 +- lib_dec/lib_dec.c | 14 ++++++++++++++ readme.txt | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 7b0647d8f5..61332e7276 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -1700,7 +1700,7 @@ static void usage_dec( void ) fprintf( stdout, "Options:\n" ); fprintf( stdout, "--------\n" ); #ifdef FIX_1419_MONO_STEREO_UMX - fprintf( stdout, "-evs : Specify EVS mode for supplied bitstream\n" ); + fprintf( stdout, " -evs : Specify that the supplied bitstream is an EVS bitstream\n" ); #endif fprintf( stdout, "-VOIP : VoIP mode: RTP in G192\n" ); fprintf( stdout, "-VOIP_hf_only=0 : VoIP mode: EVS RTP Payload Format hf_only=0 in rtpdump\n" ); diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index be69344904..44134a15d5 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -4436,7 +4436,17 @@ static ivas_error printConfigInfo_dec( } else { +#ifdef FIX_1419_MONO_STEREO_UMX + output_config = st_ivas->hDecoderConfig->output_config; + fprintf( stdout, "Output configuration: mono EVS bit-exact decoding\n" ); + if ( output_config != IVAS_AUDIO_CONFIG_MONO ) + { + get_channel_config( output_config, &config_str[0] ); + fprintf( stdout, " rendering to %s\n", config_str ); + } +#else fprintf( stdout, "Output configuration: mono EVS bit-exact decoding\n" ); +#endif } } else @@ -4765,7 +4775,11 @@ static ivas_error evs_dec_main( v_multc( p_output[0], mixer_left, p_output[0], nOutSamples ); } +#ifdef FIX_1419_MONO_STEREO_UMX + if ( st_ivas->hDecoderConfig->Opt_tsm && st_ivas->hDecoderConfig->nchan_out == 1 ) +#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]; diff --git a/readme.txt b/readme.txt index 9b40e1233f..d30216d6cc 100644 --- a/readme.txt +++ b/readme.txt @@ -279,7 +279,7 @@ output_file : Output audio filename Options: -------- --evs : Specify EVS mode for supplied bitstream +-evs : Specify that the supplied bitstream is an EVS bitstream -VOIP : VoIP mode: RTP in G192 -VOIP_hf_only=0 : VoIP mode: EVS RTP Payload Format hf_only=0 in rtpdump -VOIP_hf_only=1 : VoIP mode: EVS or IVAS RTP Payload Format hf_only=1 in rtpdump -- GitLab From d66d77c6e1c3f14e0a87ad938486e1a714c1c9bc Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Fri, 7 Nov 2025 08:54:11 +0100 Subject: [PATCH 6/7] update decoder commandline printout --- lib_dec/lib_dec.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 44134a15d5..5c1f974bbe 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -4438,14 +4438,17 @@ static ivas_error printConfigInfo_dec( { #ifdef FIX_1419_MONO_STEREO_UMX output_config = st_ivas->hDecoderConfig->output_config; - fprintf( stdout, "Output configuration: mono EVS bit-exact decoding\n" ); if ( output_config != IVAS_AUDIO_CONFIG_MONO ) { get_channel_config( output_config, &config_str[0] ); - fprintf( stdout, " rendering to %s\n", config_str ); + fprintf( stdout, "Output configuration: mono EVS bit-exact decoding rendering to %s\n", config_str ); + } + else + { +#endif + fprintf( stdout, "Output configuration: mono EVS bit-exact decoding\n" ); +#ifdef FIX_1419_MONO_STEREO_UMX } -#else - fprintf( stdout, "Output configuration: mono EVS bit-exact decoding\n" ); #endif } } -- GitLab From 0ebed311af7b9b4f807102bfeab043289733dff1 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Fri, 7 Nov 2025 13:58:53 +0100 Subject: [PATCH 7/7] report an error if both non-diegetic panning and stereo output format specified on commandline --- apps/decoder.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/decoder.c b/apps/decoder.c index 61332e7276..ae8feb2e89 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -1588,6 +1588,14 @@ static bool parseCmdlIVAS_dec( usage_dec(); return false; } +#ifdef FIX_1419_MONO_STEREO_UMX + else if ( arg->non_diegetic_pan_enabled && arg->outputConfig == IVAS_AUDIO_CONFIG_STEREO && arg->evsMode ) + { + fprintf( stderr, "Error: Both non-diegetic panning and stereo output specified!\n\n" ); + usage_dec(); + return false; + } +#endif if ( arg->outputMdFilename != NULL && arg->outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { @@ -1700,7 +1708,7 @@ static void usage_dec( void ) fprintf( stdout, "Options:\n" ); fprintf( stdout, "--------\n" ); #ifdef FIX_1419_MONO_STEREO_UMX - fprintf( stdout, " -evs : Specify that the supplied bitstream is an EVS bitstream\n" ); + fprintf( stdout, "-evs : Specify that the supplied bitstream is an EVS bitstream\n" ); #endif fprintf( stdout, "-VOIP : VoIP mode: RTP in G192\n" ); fprintf( stdout, "-VOIP_hf_only=0 : VoIP mode: EVS RTP Payload Format hf_only=0 in rtpdump\n" ); -- GitLab