From 9d01b941e38b1eed54df0b6cc39721782820c6fd Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 5 Nov 2025 10:44:28 +0100 Subject: [PATCH 1/3] port MR 2346 from float: FIX_1419_MONO_STEREO_UMX --- apps/decoder.c | 22 +++++++++++ lib_com/ivas_cnst.h | 4 ++ lib_com/options.h | 1 + lib_dec/ivas_init_dec.c | 52 +++++++++++++++++++++++--- lib_dec/ivas_jbm_dec.c | 38 +++++++++++++++++++ lib_dec/ivas_output_config.c | 72 ++++++++++++++++++++++++++++++++++++ lib_dec/lib_dec.c | 47 ++++++++++++++++++++++- lib_rend/ivas_rom_rend.c | 25 ++++++++++++- readme.txt | 2 + 9 files changed, 255 insertions(+), 8 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 871738ec0..5bbe38e6a 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -144,6 +144,9 @@ typedef struct uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS]; bool objEditEnabled; char *objEditFileName; +#ifdef FIX_1419_MONO_STEREO_UMX + bool evsMode; +#endif } DecArguments; @@ -953,6 +956,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; @@ -1537,6 +1543,15 @@ 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 @@ -1678,6 +1693,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" ); @@ -1694,6 +1712,10 @@ 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" ); +#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 23802a3b1..4efb14a8f 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1256,7 +1256,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 934e7552d..2d2cc0092 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -196,6 +196,7 @@ #define NONBE_1362_FIX_OMASA_TO_MASA1_RENDERING /* Nokia: Fix OMASA to MASA1 rendering in IVAS_rend */ #define FIX_1383_HEAD_TRACK_SANITIZER /* Nok: issue 1383: Fix head tracking struc values reading in renderer */ #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.c b/lib_dec/ivas_init_dec.c index c8b426043..e208f6a85 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1286,7 +1286,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; } @@ -1339,6 +1347,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 ) @@ -1421,7 +1436,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 */ @@ -2309,7 +2326,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 ) @@ -3165,6 +3183,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 ) { @@ -3173,12 +3192,35 @@ static ivas_error doSanityChecks_IVAS( return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Wrong output configuration specified for Stereo!" ); } } - if ( output_config != IVAS_AUDIO_CONFIG_MONO && output_config != IVAS_AUDIO_CONFIG_STEREO && output_config != IVAS_AUDIO_CONFIG_5_1 && output_config != IVAS_AUDIO_CONFIG_7_1 && output_config != IVAS_AUDIO_CONFIG_5_1_2 && output_config != IVAS_AUDIO_CONFIG_5_1_4 && output_config != IVAS_AUDIO_CONFIG_7_1_4 && output_config != IVAS_AUDIO_CONFIG_LS_CUSTOM && output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) - - if ( ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) && output_Fs != 48000 ) + /* Verify output configuration for other formats */ + 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_SAMPLING_RATE, "Error: Only 48kHz output sampling rate is supported for split rendering." ); + 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 ) + { + return IVAS_ERROR( IVAS_ERR_INVALID_SAMPLING_RATE, "Error: Only 48kHz output sampling rate is supported for split rendering." ); + } if ( st_ivas->hDecoderConfig->Opt_Headrotation ) { diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index d0f43781b..11892ffc0 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1003,14 +1003,44 @@ 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++ ) + { + 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 */ } else if ( st_ivas->ivas_format == ISM_FORMAT ) { @@ -2027,11 +2057,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; } @@ -3070,7 +3104,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 0c147185c..6c7701042 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() @@ -78,7 +100,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 ) { @@ -236,6 +268,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 ) @@ -250,6 +321,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 57e3ad030..e74b1cd97 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -483,8 +483,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; } @@ -4450,7 +4463,20 @@ 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 ( 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 @@ -4685,7 +4711,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; @@ -4695,9 +4725,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 */ @@ -4753,7 +4793,12 @@ 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/lib_rend/ivas_rom_rend.c b/lib_rend/ivas_rom_rend.c index b14a5303a..fc477be61 100644 --- a/lib_rend/ivas_rom_rend.c +++ b/lib_rend/ivas_rom_rend.c @@ -391,8 +391,9 @@ 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 }; + /*----------------------------------------------------------------------------------* * EFAP ROM tables @@ -621,6 +622,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 */ @@ -706,6 +716,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}, @@ -733,6 +746,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}, diff --git a/readme.txt b/readme.txt index 9a8cefd81..684442153 100644 --- a/readme.txt +++ b/readme.txt @@ -262,6 +262,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: @@ -279,6 +280,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 or IVAS RTP Payload Format hf_only=1 in rtpdump -- GitLab From 1b30b1ed1949cf50866ffa19d1866404987669fd Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Fri, 7 Nov 2025 12:20:35 +0100 Subject: [PATCH 2/3] clang-format --- apps/decoder.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 5bbe38e6a..432ddcbcc 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -1693,7 +1693,7 @@ 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 +#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" ); @@ -1712,7 +1712,6 @@ 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" ); #endif -- GitLab From cd58f53088bc9b17c1f78e55b2b1f0f85a0823ca Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Fri, 7 Nov 2025 13:59:44 +0100 Subject: [PATCH 3/3] 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 432ddcbcc..52db79616 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -1602,6 +1602,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