From 270cae4d2681e4d80660febd65f219d1c2ea3346 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 5 Nov 2025 12:26:21 +0100 Subject: [PATCH 1/5] port MR 2346 from float - add FIX_1419_MONO_STEREO_UMX --- apps/decoder.c | 20 ++++++++ lib_com/ivas_cnst.h | 4 ++ lib_com/options.h | 1 + lib_dec/ivas_init_dec_fx.c | 50 +++++++++++++++++++- lib_dec/ivas_jbm_dec_fx.c | 39 ++++++++++++++++ lib_dec/ivas_output_config_fx.c | 81 +++++++++++++++++++++++++++++++++ lib_dec/lib_dec_fx.c | 36 +++++++++++++++ lib_rend/ivas_rom_rend_fx.c | 20 ++++++++ 8 files changed, 250 insertions(+), 1 deletion(-) diff --git a/apps/decoder.c b/apps/decoder.c index 94bfab14d..46cfd7da4 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -129,6 +129,9 @@ typedef struct uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS]; bool objEditEnabled; char *objEditFileName; +#ifdef FIX_1419_MONO_STEREO_UMX + bool evsMode; +#endif } DecArguments; @@ -834,6 +837,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; @@ -1360,6 +1366,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 @@ -1501,6 +1515,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" ); @@ -1517,6 +1534,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" ); fprintf( stdout, "-VOIP_hf_only=1 : VoIP mode: EVS RTP Payload Format hf_only=1 in rtpdump\n" ); diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index c445d0299..5274a2339 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1295,7 +1295,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 f658a0ace..036d26258 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -139,6 +139,7 @@ #define FIX_1330_JBM_MEMORY /* VA: issue 1330: memory savings in the JBM decoder */ #define FIX_1330_JBM_MEMORY_FIX /* VA: basop issue: 2179 fix non-BE difference in FIX_1330_JBM_MEMORY */ #define FIX_1411_IGF_CRASH_BW_SWITCHING /* FhG: Fix for issue 1411: fixes crash that can happen for IGF with BW switching and DTX*/ +#define FIX_1419_MONO_STEREO_UMX /* FhG: fix for issue 1419 : support upmix to all output formats for mono and stereo */ #define NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG /* FhG: Fix MDCT-Stereo comfort noise for certain noise types */ #define NONBE_1344_REND_MASA_LOW_FS /* Nokia: Issue 1344: Fix sanitizer errors when using IVAS_rend to render MASA with lower sampling rates */ #define NONBE_1412_AVOID_ROUNDING_AZ_ELEV /* FhG: Avoid rounding when passing azimuth and elevation to efap_determine_gains() */ diff --git a/lib_dec/ivas_init_dec_fx.c b/lib_dec/ivas_init_dec_fx.c index dff92f4e4..d242298d7 100644 --- a/lib_dec/ivas_init_dec_fx.c +++ b/lib_dec/ivas_init_dec_fx.c @@ -1531,7 +1531,16 @@ ivas_error ivas_init_decoder_fx( IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) { test(); +#ifdef FIX_1419_MONO_STEREO_UMX + IF( EQ_32( st_ivas->ivas_format, MONO_FORMAT ) ) + { + hDecoderConfig->nchan_out = 1; + move16(); + } + ELSE IF( EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) ) +#else IF( EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) ) +#endif { hDecoderConfig->nchan_out = CPE_CHANNELS; } @@ -1598,6 +1607,14 @@ ivas_error ivas_init_decoder_fx( st_ivas->hOutSetup.nchan_out_woLFE = audioCfg2channels( st_ivas->intern_config ); move16(); } +#ifdef FIX_1419_MONO_STEREO_UMX + + test(); + IF( EQ_32( st_ivas->ivas_format, MONO_FORMAT ) || EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) ) + { + st_ivas->transport_config = EQ_32( st_ivas->ivas_format, MONO_FORMAT ) ? IVAS_AUDIO_CONFIG_MONO : IVAS_AUDIO_CONFIG_STEREO; + } +#endif /* Only initialize transport setup if it is used */ IF( NE_32( st_ivas->transport_config, IVAS_AUDIO_CONFIG_INVALID ) ) @@ -1705,8 +1722,10 @@ ivas_error ivas_init_decoder_fx( { st_ivas->nchan_transport = CPE_CHANNELS; move16(); +#ifndef FIX_1419_MONO_STEREO_UMX /* already set now by renderer_select() */ st_ivas->intern_config = IVAS_AUDIO_CONFIG_STEREO; move32(); +#endif st_ivas->nSCE = 0; move16(); @@ -2832,7 +2851,8 @@ ivas_error ivas_init_decoder_fx( } /*-----------------------------------------------------------------* - * 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 *-----------------------------------------------------------------*/ test(); @@ -3773,6 +3793,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( EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) ) { @@ -3793,10 +3814,37 @@ static ivas_error doSanityChecks_IVAS( ELSE { IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_INVALID ) ) +#else /* exclude invalid configs instead of matching valid ones */ + test(); + test(); + test(); + test(); + test(); + test(); + IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_INVALID ) || + EQ_32( output_config, IVAS_AUDIO_CONFIG_ISM1 ) || + EQ_32( output_config, IVAS_AUDIO_CONFIG_ISM2 ) || + EQ_32( output_config, IVAS_AUDIO_CONFIG_ISM3 ) || + EQ_32( output_config, IVAS_AUDIO_CONFIG_ISM4 ) || + EQ_32( output_config, IVAS_AUDIO_CONFIG_MASA1 ) || + EQ_32( output_config, IVAS_AUDIO_CONFIG_MASA2 ) ) +#endif { return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified!" ); } +#ifdef FIX_1419_MONO_STEREO_UMX + test(); + test(); + IF( ( EQ_32( st_ivas->ivas_format, MONO_FORMAT ) || EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) ) && + ( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) ) + { + return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified!" ); + } +#endif +#ifndef FIX_1419_MONO_STEREO_UMX } +#endif + test(); test(); diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index 7eab2caf8..42270d50d 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -1815,16 +1815,47 @@ ivas_error ivas_jbm_dec_render_fx( ivas_jbm_dec_tc_buffer_playout_fx( st_ivas, nSamplesAskedLocal, nSamplesRendered, p_output_fx ); } +#ifdef FIX_1419_MONO_STEREO_UMX + ELSE IF( EQ_32( st_ivas->ivas_format, MONO_FORMAT ) || EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) ) +#else ELSE IF( EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) ) +#endif { +#ifdef FIX_1419_MONO_STEREO_UMX + *nSamplesRendered = s_min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); + move16(); +#endif + /* Rendering */ IF( EQ_32( st_ivas->renderer_type, RENDERER_MC ) ) { +#ifndef FIX_1419_MONO_STEREO_UMX *nSamplesRendered = s_min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); move16(); +#endif ivas_ls_setup_conversion_fx( st_ivas, st_ivas->nchan_transport, *nSamplesRendered, p_tc_fx, p_output_fx ); } +#ifdef FIX_1419_MONO_STEREO_UMX + ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_SBA_LINEAR_ENC ) ) + { + IF( EQ_32( st_ivas->ivas_format, MONO_FORMAT ) ) + { + /* routed to W */ + ivas_jbm_dec_tc_buffer_playout_fx( st_ivas, nSamplesAskedLocal, nSamplesRendered, p_output_fx ); + } + ELSE IF( EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) ) + { + FOR( n = 0; n < *nSamplesRendered; n++ ) + { + Word32 tmp; + tmp = p_output_fx[0][n]; + p_output_fx[0][n] = L_shr( L_add( tmp, p_output_fx[1][n] ), 1 ); /* W = 0.5 * ( L + R ) */ + p_output_fx[1][n] = L_shr( L_sub( tmp, p_output_fx[1][n] ), 1 ); /* Y = 0.5 * ( L - R ) */ + } + } + } +#endif /* FIX_1419_MONO_STEREO_UMX */ } ELSE IF( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) ) { @@ -3227,12 +3258,16 @@ Word16 ivas_jbm_dec_get_num_tc_channels_fx( test(); test(); test(); +#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( EQ_16( st_ivas->ivas_format, MONO_FORMAT ) ) { num_tc = st_ivas->hDecoderConfig->nchan_out; move16(); } ELSE IF( EQ_16( st_ivas->ivas_format, STEREO_FORMAT ) && EQ_16( st_ivas->hDecoderConfig->nchan_out, 1 ) ) +#else + IF( EQ_16( st_ivas->ivas_format, STEREO_FORMAT ) && EQ_16( st_ivas->hDecoderConfig->nchan_out, 1 ) ) +#endif { num_tc = 1; move16(); @@ -4437,7 +4472,11 @@ void ivas_dec_prepare_renderer_fx( ivas_omasa_gain_masa_tc_fx( st_ivas->hTcBuffer->tc_fx, st_ivas->hMasaIsmData->gain_masa_edited_fx, st_ivas->nchan_ism, st_ivas->hTcBuffer->n_samples_available ); } } +#ifdef FIX_1419_MONO_STEREO_UMX + ELSE IF( EQ_16( st_ivas->ivas_format, MONO_FORMAT ) || EQ_16( st_ivas->ivas_format, STEREO_FORMAT ) ) +#else ELSE IF( EQ_16( st_ivas->ivas_format, STEREO_FORMAT ) ) +#endif { ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); } diff --git a/lib_dec/ivas_output_config_fx.c b/lib_dec/ivas_output_config_fx.c index 1958cea41..cace50215 100644 --- a/lib_dec/ivas_output_config_fx.c +++ b/lib_dec/ivas_output_config_fx.c @@ -37,6 +37,30 @@ #include "wmc_auto.h" #include "ivas_prot_fx.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 = EQ_32( ivas_format, MONO_FORMAT ) ? IVAS_AUDIO_CONFIG_MONO : IVAS_AUDIO_CONFIG_STEREO; + + IF( EQ_32( ivas_format, MONO_FORMAT ) ) + { + *renderer_type = RENDERER_NON_DIEGETIC_DOWNMIX; + move16(); + } + ELSE + { + *renderer_type = RENDERER_DISABLE; + move16(); + } + return; +} + +#endif /*-------------------------------------------------------------------------* * ivas_renderer_select() @@ -87,7 +111,17 @@ void ivas_renderer_select( test(); test(); test(); +#ifdef FIX_1419_MONO_STEREO_UMX + IF( EQ_32( st_ivas->ivas_format, MONO_FORMAT ) || EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) ) + { + ms_bin_upmix_renderer_select( st_ivas->ivas_format, + internal_config, + renderer_type ); + } + ELSE IF( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) ) +#else IF( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) ) +#endif { IF( EQ_32( st_ivas->ism_mode, ISM_MODE_PARAM ) ) { @@ -268,6 +302,52 @@ void ivas_renderer_select( * Non-binaural rendering configurations *-----------------------------------------------------------------*/ +#ifdef FIX_1419_MONO_STEREO_UMX + test(); + IF( EQ_32( st_ivas->ivas_format, MONO_FORMAT ) || EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) ) + { + *internal_config = EQ_32( st_ivas->ivas_format, MONO_FORMAT ) ? IVAS_AUDIO_CONFIG_MONO : IVAS_AUDIO_CONFIG_STEREO; + move16(); + + SWITCH( output_config ) + { + case IVAS_AUDIO_CONFIG_FOA: + case IVAS_AUDIO_CONFIG_HOA2: + case IVAS_AUDIO_CONFIG_HOA3: + *renderer_type = RENDERER_SBA_LINEAR_ENC; + move16(); + 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; + move16(); + BREAK; + case IVAS_AUDIO_CONFIG_MONO: + IF( EQ_32( *internal_config, IVAS_AUDIO_CONFIG_STEREO ) ) + { + /* stereo to mono downmix */ + *renderer_type = RENDERER_MC; + move16(); + } + BREAK; + case IVAS_AUDIO_CONFIG_STEREO: + IF( EQ_32( *internal_config, IVAS_AUDIO_CONFIG_MONO ) ) + { + /* mono to stereo upmix */ + *renderer_type = RENDERER_NON_DIEGETIC_DOWNMIX; + move16(); + } + BREAK; + default: + /* RENDERER_DISABLE already set by default */ + BREAK; + } + } +#else ELSE IF( EQ_32( st_ivas->ivas_format, MONO_FORMAT ) ) { IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_STEREO ) ) @@ -286,6 +366,7 @@ void ivas_renderer_select( move16(); } } +#endif ELSE IF( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) ) { test(); diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index ae2027e10..945894723 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -543,12 +543,34 @@ ivas_error IVAS_DEC_Configure( return IVAS_ERR_WRONG_PARAMS; } +#ifdef FIX_1419_MONO_STEREO_UMX + test(); + test(); + test(); + test(); + test(); + test(); + test(); + test(); + test(); + IF( EQ_16( hIvasDec->mode, IVAS_DEC_MODE_EVS ) && + ( EQ_16( outputConfig, IVAS_AUDIO_CONFIG_INVALID ) || + EQ_16( outputConfig, IVAS_AUDIO_CONFIG_ISM1 ) || + EQ_16( outputConfig, IVAS_AUDIO_CONFIG_ISM2 ) || + EQ_16( outputConfig, IVAS_AUDIO_CONFIG_ISM3 ) || + EQ_16( outputConfig, IVAS_AUDIO_CONFIG_ISM4 ) || + EQ_16( outputConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || + EQ_16( outputConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || + EQ_16( outputConfig, IVAS_AUDIO_CONFIG_MASA1 ) || + EQ_16( outputConfig, IVAS_AUDIO_CONFIG_MASA2 ) ) ) +#else /* we now support all output formats, so this validation is redundant */ test(); test(); test(); test(); IF( EQ_16( hIvasDec->mode, IVAS_DEC_MODE_EVS ) && !( ( EQ_16( outputConfig, IVAS_AUDIO_CONFIG_MONO ) && non_diegetic_pan_enabled == false ) || ( EQ_16( outputConfig, IVAS_AUDIO_CONFIG_STEREO ) && non_diegetic_pan_enabled ) ) ) +#endif { return IVAS_ERR_WRONG_MODE; } @@ -5526,7 +5548,11 @@ static ivas_error evs_dec_main_fx( { DEC_CORE_HANDLE *hCoreCoder; Word16 mixer_left_fx, mixer_right_fx; +#ifdef FIX_1419_MONO_STEREO_UMX + Word32 *p_output_fx[MAX_TRANSPORT_CHANNELS]; +#else Word32 *p_output_fx[MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN]; +#endif Word16 ch, i, nOutSamples; Word16 output_16[L_FRAME48k]; ivas_error error; @@ -5541,9 +5567,19 @@ static ivas_error evs_dec_main_fx( mdct_switching_dec_fx( 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_fx[ch] = st_ivas->p_output_fx[ch]; // Q0 +#ifdef FIX_1419_MONO_STEREO_UMX + IF( p_output_fx[ch] != NULL ) + { + set_zero_fx( p_output_fx[ch], L_FRAME48k ); + } +#endif } /* run the main EVS decoding routine */ diff --git a/lib_rend/ivas_rom_rend_fx.c b/lib_rend/ivas_rom_rend_fx.c index f3f034c4d..ec49c3937 100644 --- a/lib_rend/ivas_rom_rend_fx.c +++ b/lib_rend/ivas_rom_rend_fx.c @@ -517,6 +517,16 @@ const LS_CONVERSION_MATRIX_FX ls_conversion_cicp19_cicp16_fx[] = // Q30 }; /* Upmix matrices */ +#ifdef FIX_1419_MONO_STEREO_UMX +const LS_CONVERSION_MATRIX_FX ls_conversion_mono_cicpX_fx[] = // Q30 +{ + /* First row indicates the number of non-zero elements and the number of matrix columns */ + {1, 12}, + /* Index of non-zero element, value of non-zero element*/ + {2, 1073741824}, +}; + +#endif const LS_CONVERSION_MATRIX_FX ls_conversion_cicp12_cicp14_fx[] = // Q30 { /* First row indicates the number of non-zero elements and the number of matrix columns */ @@ -602,6 +612,9 @@ const LS_CONVERSION_MATRIX_FX ls_conversion_cicp16_cicp19_fx[] = // Q30 const LS_CONVERSION_MAPPING_FX ls_conversion_mapping_fx[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}, @@ -629,6 +642,13 @@ const LS_CONVERSION_MAPPING_FX ls_conversion_mapping_fx[LS_SETUP_CONVERSION_NUM_ {IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_5_1_4, ls_conversion_cicp19_cicp16_fx}, /* 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_fx}, + {IVAS_AUDIO_CONFIG_MONO, IVAS_AUDIO_CONFIG_7_1, ls_conversion_mono_cicpX_fx}, + {IVAS_AUDIO_CONFIG_MONO, IVAS_AUDIO_CONFIG_5_1_2, ls_conversion_mono_cicpX_fx}, + {IVAS_AUDIO_CONFIG_MONO, IVAS_AUDIO_CONFIG_5_1_4, ls_conversion_mono_cicpX_fx}, + {IVAS_AUDIO_CONFIG_MONO, IVAS_AUDIO_CONFIG_7_1_4, ls_conversion_mono_cicpX_fx}, +#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 e2a16f744f0e647999a364cf5120629ebb69b682 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 5 Nov 2025 16:37:58 +0100 Subject: [PATCH 2/5] [fix] skip conversion to short if upmixing EVS JBM --- apps/decoder.c | 2 +- lib_dec/lib_dec_fx.c | 20 +++++++++++++++++++- readme.txt | 6 ++++-- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 46cfd7da4..79e22b1c0 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -1535,7 +1535,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_fx.c b/lib_dec/lib_dec_fx.c index 945894723..4ccc753cd 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -5364,7 +5364,21 @@ static ivas_error printConfigInfo_dec( } ELSE { - fprintf( stdout, "Output configuration: mono EVS bit-exact decoding\n" ); +#ifdef FIX_1419_MONO_STEREO_UMX + output_config = st_ivas->hDecoderConfig->output_config; + IF( NE_16( (Word16) output_config, IVAS_AUDIO_CONFIG_MONO ) ) + { + get_channel_config( output_config, &config_str[0] ); + 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 + } +#endif + ; } } ELSE @@ -5641,7 +5655,11 @@ static ivas_error evs_dec_main_fx( v_multc_fx_16( p_output_fx[0], mixer_left_fx, p_output_fx[0], nOutSamples ); /* Q11 */ } +#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 */ // TODO: verify if it is still needed and if it works well for EVS stereo panning output #ifdef JBM_MEMORY_OPT diff --git a/readme.txt b/readme.txt index d272f7a8c..684c8162e 100644 --- a/readme.txt +++ b/readme.txt @@ -257,13 +257,14 @@ 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: --------------------- OutputConf : Output configuration: MONO, STEREO, 5_1, 7_1, 5_1_2, 5_1_4, 7_1_4, FOA, - HOA2, HOA3, BINAURAL, BINAURAL_ROOM_IR, BINAURAL_ROOM_REVERB, - BINAURAL_SPLIT_CODED, BINAURAL_SPLIT_PCM, EXT + HOA2, HOA3, BINAURAL, BINAURAL_ROOM_IR, BINAURAL_ROOM_REVERB, + BINAURAL_SPLIT_CODED, BINAURAL_SPLIT_PCM, EXT By default, channel order and loudspeaker positions are equal to the encoder. For loudspeaker outputs, OutputConf can be a custom loudspeaker layout file. See below for details. @@ -274,6 +275,7 @@ output_file : Output audio filename Options: -------- +-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 RTP Payload Format hf_only=1 in rtpdump -- GitLab From 637f5534b25e9d6c90351e8da3ebb734657b194b Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Fri, 7 Nov 2025 13:41:13 +0100 Subject: [PATCH 3/5] [fix] missing instrumentation in port --- lib_dec/lib_dec_fx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index 4ccc753cd..d024de80f 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -5378,7 +5378,6 @@ static ivas_error printConfigInfo_dec( #ifdef FIX_1419_MONO_STEREO_UMX } #endif - ; } } ELSE @@ -5656,7 +5655,8 @@ static ivas_error evs_dec_main_fx( } #ifdef FIX_1419_MONO_STEREO_UMX - IF( st_ivas->hDecoderConfig->Opt_tsm && st_ivas->hDecoderConfig->nchan_out == 1 ) + test(); + IF( st_ivas->hDecoderConfig->Opt_tsm && EQ_16( st_ivas->hDecoderConfig->nchan_out, 1 ) ) #else IF( st_ivas->hDecoderConfig->Opt_tsm ) #endif -- GitLab From 1d57306ebe0b98c48f42d881f98088e47d8b33df Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Fri, 7 Nov 2025 13:55:15 +0100 Subject: [PATCH 4/5] [fix] missing ELSE --- lib_dec/ivas_output_config_fx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib_dec/ivas_output_config_fx.c b/lib_dec/ivas_output_config_fx.c index cace50215..f20d9f312 100644 --- a/lib_dec/ivas_output_config_fx.c +++ b/lib_dec/ivas_output_config_fx.c @@ -303,8 +303,7 @@ void ivas_renderer_select( *-----------------------------------------------------------------*/ #ifdef FIX_1419_MONO_STEREO_UMX - test(); - IF( EQ_32( st_ivas->ivas_format, MONO_FORMAT ) || EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) ) + ELSE IF( EQ_32( st_ivas->ivas_format, MONO_FORMAT ) || EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) ) { *internal_config = EQ_32( st_ivas->ivas_format, MONO_FORMAT ) ? IVAS_AUDIO_CONFIG_MONO : IVAS_AUDIO_CONFIG_STEREO; move16(); -- GitLab From 817f497ac3577d77067cf4074ab1a146c5e1d3d9 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Fri, 7 Nov 2025 13:58:49 +0100 Subject: [PATCH 5/5] report an error if both non-diegetic panning and stereo output format specified on commandline --- apps/decoder.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/decoder.c b/apps/decoder.c index 79e22b1c0..f40e1ae5e 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -1424,6 +1424,15 @@ 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 ) { fprintf( stderr, "Error: Output split rendering metadata file is supported for BINAURAL_SPLIT_PCM output config. only\n\n" ); -- GitLab