From 2d91a0bae2338a79d37d2142b0688f9c05f68adb Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 17 Jun 2025 15:06:09 +0200 Subject: [PATCH 1/3] port FIX_1052_EXT_OUTPUT --- lib_com/options.h | 1 + lib_dec/ivas_init_dec_fx.c | 43 +++++++++++++++++++++++++++++++++ lib_dec/ivas_jbm_dec_fx.c | 17 ++++++++----- lib_dec/ivas_masa_dec_fx.c | 24 ++++++++++++++++++ lib_dec/ivas_mc_param_dec_fx.c | 4 +++ lib_dec/ivas_mct_dec_fx.c | 4 +++ lib_dec/ivas_output_config_fx.c | 20 +++++++++++++++ lib_rend/ivas_output_init_fx.c | 4 +++ 8 files changed, 111 insertions(+), 6 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 4527c9c4b..80b1e41cd 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -128,6 +128,7 @@ #define FIX_998_UNUSED_FUNCTION /* FhG: issue 998: delete unused funtion ivas_dirac_dec_get_response_split_order */ #define NONBE_FIX_1014_1015_1016_OSBA_JBM_STEREO /* FhG: issues #1014, #1015, #1016: fix tc buffer info update in the discrete ism renderer */ #define NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING /* FhG: issue 987: solution b: downmix HOA3 to stereo a input for the reverberator */ +#define FIX_1052_EXT_OUTPUT /* VA: issue 1052: define EXT decoder output configuration for stereo and MC formats */ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_dec/ivas_init_dec_fx.c b/lib_dec/ivas_init_dec_fx.c index f00ea4676..82effe13e 100644 --- a/lib_dec/ivas_init_dec_fx.c +++ b/lib_dec/ivas_init_dec_fx.c @@ -1232,7 +1232,19 @@ ivas_error ivas_init_decoder_fx( IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) { +#ifdef FIX_1052_EXT_OUTPUT + IF( EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) ) + { + hDecoderConfig->nchan_out = CPE_CHANNELS; + } + ELSE IF( EQ_32( st_ivas->ivas_format, MC_FORMAT ) ) + { + hDecoderConfig->nchan_out = audioCfg2channels( st_ivas->transport_config ); + } + ELSE IF( EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) ) +#else IF( EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) ) +#endif { hDecoderConfig->nchan_out = audioCfg2channels( IVAS_AUDIO_CONFIG_HOA3 ); move16(); @@ -1260,7 +1272,22 @@ ivas_error ivas_init_decoder_fx( st_ivas->intern_config = output_config; move32(); + +#ifdef FIX_1052_EXT_OUTPUT + IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) && EQ_32( st_ivas->ivas_format, MC_FORMAT ) ) + { + ivas_output_init( &( st_ivas->hOutSetup ), st_ivas->transport_config ); + st_ivas->intern_config = st_ivas->transport_config; + move32(); + } + ELSE + { + ivas_output_init( &( st_ivas->hOutSetup ), output_config ); + } +#else ivas_output_init( &( st_ivas->hOutSetup ), output_config ); +#endif + test(); IF( EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) && EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) ) { @@ -3713,11 +3740,26 @@ static ivas_error doSanityChecks_IVAS( test(); test(); test(); +#ifdef FIX_1052_EXT_OUTPUT + test(); + IF( NE_32( output_config, IVAS_AUDIO_CONFIG_MONO ) && NE_32( output_config, IVAS_AUDIO_CONFIG_STEREO ) && NE_32( output_config, IVAS_AUDIO_CONFIG_5_1 ) && NE_32( output_config, IVAS_AUDIO_CONFIG_7_1 ) && NE_32( output_config, IVAS_AUDIO_CONFIG_5_1_2 ) && NE_32( output_config, IVAS_AUDIO_CONFIG_5_1_4 ) && NE_32( output_config, IVAS_AUDIO_CONFIG_7_1_4 ) && NE_32( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) && NE_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) +#else IF( NE_32( output_config, IVAS_AUDIO_CONFIG_MONO ) && NE_32( output_config, IVAS_AUDIO_CONFIG_STEREO ) && NE_32( output_config, IVAS_AUDIO_CONFIG_5_1 ) && NE_32( output_config, IVAS_AUDIO_CONFIG_7_1 ) && NE_32( output_config, IVAS_AUDIO_CONFIG_5_1_2 ) && NE_32( output_config, IVAS_AUDIO_CONFIG_5_1_4 ) && NE_32( output_config, IVAS_AUDIO_CONFIG_7_1_4 ) && NE_32( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) ) +#endif { return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Wrong output configuration specified for Stereo!" ); } } +#ifdef FIX_1052_EXT_OUTPUT + /* Verify output configuration for other formats */ + ELSE + { + IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_INVALID ) ) + { + return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified!" ); + } + } +#else ELSE IF( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) ) { /* Verify ISM output configuration */ @@ -3750,6 +3792,7 @@ static ivas_error doSanityChecks_IVAS( return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified for Multi-channel" ); } } +#endif IF( ( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) && NE_32( output_Fs, 48000 ) ) { diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index c7863bb98..d8c801101 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -1286,11 +1286,16 @@ ivas_error ivas_jbm_dec_tc_fx( test(); test(); test(); +#ifdef FIX_1052_EXT_OUTPUT test(); /* Delay the separated channel to sync with CLDFB delay of the DirAC synthesis, and synthesize the LFE signal. */ IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_5_1 ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_7_1 ) || - EQ_32( output_config, IVAS_AUDIO_CONFIG_5_1_4 ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_7_1_4 ) || - EQ_32( output_config, IVAS_AUDIO_CONFIG_5_1_2 ) || ( EQ_32( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) && st_ivas->hOutSetup.num_lfe > 0 ) ) + EQ_32( output_config, IVAS_AUDIO_CONFIG_5_1_4 ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_7_1_4 ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_5_1_2 ) || ( EQ_32( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) && st_ivas->hOutSetup.num_lfe > 0 ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) +#else + /* Delay the separated channel to sync with CLDFB delay of the DirAC synthesis, and synthesize the LFE signal. */ + IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_5_1 ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_7_1 ) || + EQ_32( output_config, IVAS_AUDIO_CONFIG_5_1_4 ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_7_1_4 ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_5_1_2 ) || ( EQ_32( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) && st_ivas->hOutSetup.num_lfe > 0 ) ) +#endif { ivas_lfe_synth_with_filters_fx( st_ivas->hMasa->hMasaLfeSynth, p_output_fx, output_frame, n, LFE_CHANNEL ); } @@ -1454,8 +1459,8 @@ ivas_error ivas_jbm_dec_tc_fx( } /*----------------------------------------------------------------* - * Write IVAS transport channels - *----------------------------------------------------------------*/ + * Write IVAS transport channels + *----------------------------------------------------------------*/ IF( EQ_16( st_ivas->hDecoderConfig->Opt_tsm, 1 ) ) { @@ -1469,8 +1474,8 @@ ivas_error ivas_jbm_dec_tc_fx( } /*----------------------------------------------------------------* - * Common updates - *----------------------------------------------------------------*/ + * Common updates + *----------------------------------------------------------------*/ IF( !st_ivas->bfi ) /* do not update if first frame(s) are lost or NO_DATA */ { diff --git a/lib_dec/ivas_masa_dec_fx.c b/lib_dec/ivas_masa_dec_fx.c index 8bf808ed6..0a87a4df7 100644 --- a/lib_dec/ivas_masa_dec_fx.c +++ b/lib_dec/ivas_masa_dec_fx.c @@ -498,7 +498,13 @@ ivas_error ivas_masa_decode_fx( hMasa->config.coherencePresent = !hQMetaData->all_coherence_zero; move16(); +#ifdef FIX_1052_EXT_OUTPUT + test(); + test(); + IF( EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) && ( EQ_32( ivas_format, MASA_FORMAT ) || EQ_32( ivas_format, MASA_ISM_FORMAT ) ) ) +#else IF( EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) +#endif { index_16bits_fx( hQMetaData, hMasa->data.sph_grid16 ); } @@ -768,7 +774,13 @@ ivas_error ivas_masa_dec_open_fx( move16(); /* Create spherical grid only for external output */ +#ifdef FIX_1052_EXT_OUTPUT + test(); + test(); + IF( EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) && ( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) || EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) ) ) +#else IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) +#endif { IF( ( hMasa->data.sph_grid16 = (SPHERICAL_GRID_DATA *) malloc( sizeof( SPHERICAL_GRID_DATA ) ) ) == NULL ) { @@ -1297,13 +1309,25 @@ static ivas_error init_lfe_synth_data_fx( test(); test(); test(); +#ifdef FIX_1052_EXT_OUTPUT + test(); IF( st_ivas->hOutSetup.separateChannelEnabled && ( EQ_16( output_config, IVAS_AUDIO_CONFIG_5_1 ) || EQ_16( output_config, IVAS_AUDIO_CONFIG_7_1 ) || EQ_16( output_config, IVAS_AUDIO_CONFIG_5_1_2 ) || EQ_16( output_config, IVAS_AUDIO_CONFIG_5_1_4 ) || EQ_16( output_config, IVAS_AUDIO_CONFIG_7_1_4 ) || + EQ_16( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) || EQ_16( output_config, IVAS_AUDIO_CONFIG_FOA ) || EQ_16( output_config, IVAS_AUDIO_CONFIG_HOA2 ) || EQ_16( output_config, IVAS_AUDIO_CONFIG_HOA3 ) || ( EQ_16( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) && ( st_ivas->hOutSetup.num_lfe > 0 ) ) ) ) +#else + IF( st_ivas->hOutSetup.separateChannelEnabled && + ( EQ_16( output_config, IVAS_AUDIO_CONFIG_5_1 ) || EQ_16( output_config, IVAS_AUDIO_CONFIG_7_1 ) || + EQ_16( output_config, IVAS_AUDIO_CONFIG_5_1_2 ) || + EQ_16( output_config, IVAS_AUDIO_CONFIG_5_1_4 ) || EQ_16( output_config, IVAS_AUDIO_CONFIG_7_1_4 ) || + EQ_16( output_config, IVAS_AUDIO_CONFIG_FOA ) || EQ_16( output_config, IVAS_AUDIO_CONFIG_HOA2 ) || + EQ_16( output_config, IVAS_AUDIO_CONFIG_HOA3 ) || + ( EQ_16( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) && ( st_ivas->hOutSetup.num_lfe > 0 ) ) ) ) +#endif { Word16 bufferSize; Word16 i; diff --git a/lib_dec/ivas_mc_param_dec_fx.c b/lib_dec/ivas_mc_param_dec_fx.c index 1ee6d6ced..3e770e4e2 100644 --- a/lib_dec/ivas_mc_param_dec_fx.c +++ b/lib_dec/ivas_mc_param_dec_fx.c @@ -165,7 +165,11 @@ ivas_error ivas_param_mc_dec_open_fx( test(); test(); test(); +#ifdef FIX_1052_EXT_OUTPUT + IF( EQ_32( st_ivas->renderer_type, RENDERER_SBA_LINEAR_ENC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_OBJECTS_TD ) || EQ_32( st_ivas->transport_config, output_config ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) +#else IF( EQ_32( st_ivas->renderer_type, RENDERER_SBA_LINEAR_ENC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_OBJECTS_TD ) || EQ_32( st_ivas->transport_config, output_config ) ) +#endif { hParamMC->synthesis_conf = PARAM_MC_SYNTH_DIRECT; move32(); diff --git a/lib_dec/ivas_mct_dec_fx.c b/lib_dec/ivas_mct_dec_fx.c index ed43b9991..881cf4678 100644 --- a/lib_dec/ivas_mct_dec_fx.c +++ b/lib_dec/ivas_mct_dec_fx.c @@ -906,7 +906,11 @@ ivas_error ivas_mc_dec_config_fx( IF( st_ivas->ini_frame != 0 ) { test(); +#ifdef FIX_1052_EXT_OUTPUT + IF( NE_32( st_ivas->hDecoderConfig->last_ivas_total_brate, st_ivas->hDecoderConfig->ivas_total_brate ) || last_mc_mode != st_ivas->mc_mode ) +#else IF( NE_32( st_ivas->hDecoderConfig->last_ivas_total_brate, st_ivas->hDecoderConfig->ivas_total_brate ) || st_ivas->transport_config != signaled_config || last_mc_mode != st_ivas->mc_mode ) +#endif { IF( st_ivas->hRenderConfig ) { diff --git a/lib_dec/ivas_output_config_fx.c b/lib_dec/ivas_output_config_fx.c index bdf7b67bc..275c66428 100644 --- a/lib_dec/ivas_output_config_fx.c +++ b/lib_dec/ivas_output_config_fx.c @@ -487,8 +487,14 @@ void ivas_renderer_select( { *internal_config = transport_config; move16(); + + test(); +#ifdef FIX_1052_EXT_OUTPUT test(); + IF( EQ_32( st_ivas->mc_mode, MC_MODE_MCT ) && NE_32( *internal_config, output_config ) && NE_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) +#else IF( EQ_32( st_ivas->mc_mode, MC_MODE_MCT ) && NE_32( *internal_config, output_config ) ) +#endif { test(); test(); @@ -507,7 +513,13 @@ void ivas_renderer_select( { *internal_config = transport_config; move16(); + +#ifdef FIX_1052_EXT_OUTPUT + test(); + IF( NE_32( *internal_config, output_config ) && NE_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) +#else IF( NE_32( *internal_config, output_config ) ) +#endif { test(); test(); @@ -539,8 +551,16 @@ void ivas_renderer_select( } ELSE IF( EQ_32( st_ivas->mc_mode, MC_MODE_MCMASA ) ) { +#ifdef FIX_1052_EXT_OUTPUT + if ( NE_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) + { + *internal_config = output_config; + move16(); + } +#else *internal_config = output_config; move16(); +#endif /* No rendering for 1TC to Mono or Stereo and 2TC to Stereo */ test(); diff --git a/lib_rend/ivas_output_init_fx.c b/lib_rend/ivas_output_init_fx.c index 5c19acb5f..fba20ff70 100644 --- a/lib_rend/ivas_output_init_fx.c +++ b/lib_rend/ivas_output_init_fx.c @@ -449,7 +449,11 @@ Word16 ivas_get_nchan_buffers_dec( { nchan_out_buff = s_max( nchan_out_buff, add( st_ivas->hOutSetup.nchan_out_woLFE, st_ivas->hOutSetup.num_lfe ) ); } +#ifdef FIX_1052_EXT_OUTPUT + ELSE IF( NE_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) +#else ELSE +#endif { nchan_out_buff = s_max( audioCfg2channels( st_ivas->transport_config ), audioCfg2channels( st_ivas->intern_config ) ); nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( output_config ) ); -- GitLab From 390e2bbbfd5f02fb503876436f556fc882e9e249 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 17 Jun 2025 15:19:16 +0200 Subject: [PATCH 2/3] clang-format --- lib_dec/ivas_jbm_dec_fx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index d8c801101..f296745f7 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -1459,8 +1459,8 @@ ivas_error ivas_jbm_dec_tc_fx( } /*----------------------------------------------------------------* - * Write IVAS transport channels - *----------------------------------------------------------------*/ + * Write IVAS transport channels + *----------------------------------------------------------------*/ IF( EQ_16( st_ivas->hDecoderConfig->Opt_tsm, 1 ) ) { @@ -1474,8 +1474,8 @@ ivas_error ivas_jbm_dec_tc_fx( } /*----------------------------------------------------------------* - * Common updates - *----------------------------------------------------------------*/ + * Common updates + *----------------------------------------------------------------*/ IF( !st_ivas->bfi ) /* do not update if first frame(s) are lost or NO_DATA */ { -- GitLab From ceed256e2f38279b1beeb64c6bc2274406909f5a Mon Sep 17 00:00:00 2001 From: vaclav Date: Sun, 27 Jul 2025 20:28:59 +0200 Subject: [PATCH 3/3] add FIX_1314_STEREO_TO_EXT --- lib_dec/ivas_out_setup_conversion_fx.c | 50 +++++++++++++++++--------- lib_dec/ivas_output_config_fx.c | 5 +++ 2 files changed, 38 insertions(+), 17 deletions(-) diff --git a/lib_dec/ivas_out_setup_conversion_fx.c b/lib_dec/ivas_out_setup_conversion_fx.c index 93a7c204e..e048043b1 100644 --- a/lib_dec/ivas_out_setup_conversion_fx.c +++ b/lib_dec/ivas_out_setup_conversion_fx.c @@ -276,9 +276,6 @@ static ivas_error get_ls_conversion_matrix_fx( Word16 index; Word32 value; const LS_CONVERSION_MATRIX_FX *conversion_matrix_fx; - ivas_error error; - - error = IVAS_ERR_OK; conversion_matrix_fx = NULL; @@ -319,7 +316,7 @@ static ivas_error get_ls_conversion_matrix_fx( } } } - return error; + return IVAS_ERR_OK; } ELSE { @@ -333,7 +330,7 @@ static ivas_error get_ls_conversion_matrix_fx( hLsSetUpConversion->dmxMtx_fx[k][k] = ONE_IN_Q30; move32(); } - return error; + return IVAS_ERR_OK; } ELSE { @@ -360,13 +357,15 @@ static ivas_error get_ls_conversion_matrix_fx( move32(); } } - return error; + return IVAS_ERR_OK; } } } return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "The conversion matrix between these formats is not defined!\n" ); } + + /*------------------------------------------------------------------------- * ivas_ls_setup_conversion_open() * @@ -381,8 +380,10 @@ ivas_error ivas_ls_setup_conversion_open_fx( Word16 chIdx, inChannels, outChannels; Word16 output_frame; Word32 output_Fs; - Word16 nchan_out; Word16 paramUpmixMonoStereo; +#ifdef FIX_1052_EXT_OUTPUT + ivas_error error; +#endif test(); test(); @@ -399,7 +400,7 @@ ivas_error ivas_ls_setup_conversion_open_fx( } output_Fs = st_ivas->hDecoderConfig->output_Fs; move32(); - nchan_out = st_ivas->hDecoderConfig->nchan_out; + outChannels = st_ivas->hDecoderConfig->nchan_out; move16(); output_frame = (Word16) ( output_Fs / FRAMES_PER_SEC ); @@ -409,10 +410,8 @@ ivas_error ivas_ls_setup_conversion_open_fx( return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LS configuration Conversion Handle \n" ) ); } - assert( LE_16( nchan_out, MAX_OUTPUT_CHANNELS ) ); + assert( LE_16( outChannels, MAX_OUTPUT_CHANNELS ) ); - outChannels = nchan_out; - move16(); IF( EQ_32( st_ivas->renderer_type, RENDERER_MC_PARAMMC ) ) { inChannels = add( st_ivas->hTransSetup.nchan_out_woLFE, st_ivas->hTransSetup.num_lfe ); @@ -511,16 +510,37 @@ ivas_error ivas_ls_setup_conversion_open_fx( { IF( EQ_16( paramUpmixMonoStereo, TRUE ) ) { +#ifdef FIX_1052_EXT_OUTPUT + IF( ( error = get_ls_conversion_matrix_fx( hLsSetUpConversion, IVAS_AUDIO_CONFIG_5_1_2, st_ivas->hDecoderConfig->output_config ) ) != IVAS_ERR_OK ) + { + return error; + } +#else get_ls_conversion_matrix_fx( hLsSetUpConversion, IVAS_AUDIO_CONFIG_5_1_2, st_ivas->hDecoderConfig->output_config ); +#endif } ELSE { +#ifdef FIX_1052_EXT_OUTPUT + IF( ( error = get_ls_conversion_matrix_fx( hLsSetUpConversion, st_ivas->transport_config, st_ivas->hDecoderConfig->output_config ) ) != IVAS_ERR_OK ) + { + return error; + } +#else get_ls_conversion_matrix_fx( hLsSetUpConversion, st_ivas->transport_config, st_ivas->hDecoderConfig->output_config ); +#endif } } ELSE { +#ifdef FIX_1052_EXT_OUTPUT + IF( ( error = get_ls_conversion_matrix_fx( hLsSetUpConversion, st_ivas->intern_config, st_ivas->hDecoderConfig->output_config ) ) != IVAS_ERR_OK ) + { + return error; + } +#else get_ls_conversion_matrix_fx( hLsSetUpConversion, st_ivas->intern_config, st_ivas->hDecoderConfig->output_config ); +#endif } } @@ -756,9 +776,7 @@ void ivas_ls_setup_conversion_process_mdct_fx( move32(); test(); - IF( - NE_16( chInIdx, LFE_CHANNEL ) && - NE_16( mct_chan_mode[chInIdx], MCT_CHAN_MODE_IGNORE ) ) + IF( NE_16( chInIdx, LFE_CHANNEL ) && NE_16( mct_chan_mode[chInIdx], MCT_CHAN_MODE_IGNORE ) ) { /* Step 1: Compute the target energy and DMX signal (possible since we have all signals in TCX20 resolution) */ IF( dmxCoeff ) @@ -906,9 +924,7 @@ void ivas_ls_setup_conversion_process_mdct_fx( FOR( chInIdx = 0; chInIdx < inChannels; chInIdx++ ) { test(); - IF( - NE_16( chInIdx, LFE_CHANNEL ) && - NE_16( mct_chan_mode[chInIdx], MCT_CHAN_MODE_IGNORE ) ) + IF( NE_16( chInIdx, LFE_CHANNEL ) && NE_16( mct_chan_mode[chInIdx], MCT_CHAN_MODE_IGNORE ) ) { IF( EQ_16( transform_type[chInIdx][0], TCX_20 ) ) { diff --git a/lib_dec/ivas_output_config_fx.c b/lib_dec/ivas_output_config_fx.c index 275c66428..69e70fb30 100644 --- a/lib_dec/ivas_output_config_fx.c +++ b/lib_dec/ivas_output_config_fx.c @@ -278,7 +278,12 @@ void ivas_renderer_select( ELSE IF( EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) ) { test(); +#ifdef FIX_1052_EXT_OUTPUT + test(); + IF( NE_32( output_config, IVAS_AUDIO_CONFIG_STEREO ) && NE_32( output_config, IVAS_AUDIO_CONFIG_MONO ) && NE_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) +#else IF( NE_32( output_config, IVAS_AUDIO_CONFIG_STEREO ) && NE_32( output_config, IVAS_AUDIO_CONFIG_MONO ) ) +#endif { *renderer_type = RENDERER_MC; move16(); -- GitLab