diff --git a/lib_com/options.h b/lib_com/options.h index dc1b88d11db2b3a435f4102746666d6ecbd9e4a7..e237e1f1efea4c1550de2063dbee6518052bc03c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,7 +161,7 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define TMP_FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add error check for unsupported config: split rendering with VoIP mode */ #define UNIFIED_DECODING_PATHS_LEFTOVERS /* VA: issue 880: remove leftovers after NONBE_UNIFIED_DECODING_PATHS */ - +#define FIX_1314_STEREO_TO_EXT /* VA: issue 1314: set RENDERER_DISABLE for stereo to EXT output */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/ivas_out_setup_conversion.c b/lib_dec/ivas_out_setup_conversion.c index 699343c1da5f80a7bd03e883f9f31dc7b4a9d404..90473903d9e140a22759dcb0015051026e92d56b 100644 --- a/lib_dec/ivas_out_setup_conversion.c +++ b/lib_dec/ivas_out_setup_conversion.c @@ -223,9 +223,6 @@ static ivas_error get_ls_conversion_matrix( int16_t index; float value; const LS_CONVERSION_MATRIX *conversion_matrix; - ivas_error error; - - error = IVAS_ERR_OK; conversion_matrix = NULL; @@ -260,7 +257,7 @@ static ivas_error get_ls_conversion_matrix( } } } - return error; + return IVAS_ERR_OK; } else { @@ -273,7 +270,7 @@ static ivas_error get_ls_conversion_matrix( { hLsSetUpConversion->dmxMtx[k][k] = 1.0f; } - return error; + return IVAS_ERR_OK; } else { @@ -288,7 +285,7 @@ static ivas_error get_ls_conversion_matrix( hLsSetUpConversion->dmxMtx[ch_in][ch_out] = value; } } - return error; + return IVAS_ERR_OK; } } } @@ -311,8 +308,10 @@ ivas_error ivas_ls_setup_conversion_open( int16_t chIdx, inChannels, outChannels; int16_t output_frame; int32_t output_Fs; - int16_t nchan_out; int16_t paramUpmixMonoStereo; +#ifdef FIX_1314_STEREO_TO_EXT + ivas_error error; +#endif if ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_PARAMUPMIX && ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_MONO || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO ) ) { @@ -323,7 +322,7 @@ ivas_error ivas_ls_setup_conversion_open( paramUpmixMonoStereo = FALSE; } output_Fs = st_ivas->hDecoderConfig->output_Fs; - nchan_out = st_ivas->hDecoderConfig->nchan_out; + outChannels = st_ivas->hDecoderConfig->nchan_out; output_frame = (int16_t) ( output_Fs / FRAMES_PER_SEC ); /* Allocate memory to the handle */ @@ -332,9 +331,8 @@ ivas_error ivas_ls_setup_conversion_open( return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LS configuration Conversion Handle \n" ) ); } - assert( nchan_out <= MAX_OUTPUT_CHANNELS ); + assert( outChannels <= MAX_OUTPUT_CHANNELS ); - outChannels = nchan_out; if ( st_ivas->renderer_type == RENDERER_MC_PARAMMC ) { inChannels = st_ivas->hTransSetup.nchan_out_woLFE + st_ivas->hTransSetup.num_lfe; @@ -423,16 +421,37 @@ ivas_error ivas_ls_setup_conversion_open( { if ( paramUpmixMonoStereo == TRUE ) { +#ifdef FIX_1314_STEREO_TO_EXT + if ( ( error = get_ls_conversion_matrix( hLsSetUpConversion, IVAS_AUDIO_CONFIG_5_1_2, st_ivas->hDecoderConfig->output_config ) ) != IVAS_ERR_OK ) + { + return error; + } +#else get_ls_conversion_matrix( hLsSetUpConversion, IVAS_AUDIO_CONFIG_5_1_2, st_ivas->hDecoderConfig->output_config ); +#endif } else { +#ifdef FIX_1314_STEREO_TO_EXT + if ( ( error = get_ls_conversion_matrix( hLsSetUpConversion, st_ivas->transport_config, st_ivas->hDecoderConfig->output_config ) ) != IVAS_ERR_OK ) + { + return error; + } +#else get_ls_conversion_matrix( hLsSetUpConversion, st_ivas->transport_config, st_ivas->hDecoderConfig->output_config ); +#endif } } else { +#ifdef FIX_1314_STEREO_TO_EXT + if ( ( error = get_ls_conversion_matrix( hLsSetUpConversion, st_ivas->intern_config, st_ivas->hDecoderConfig->output_config ) ) != IVAS_ERR_OK ) + { + return error; + } +#else get_ls_conversion_matrix( hLsSetUpConversion, st_ivas->intern_config, st_ivas->hDecoderConfig->output_config ); +#endif } } @@ -633,9 +652,7 @@ void ivas_ls_setup_conversion_process_mdct( { dmxCoeff = hLsSetUpConversion->dmxMtx[chInIdx][chOutIdx]; - if ( - chInIdx != LFE_CHANNEL && - mct_chan_mode[chInIdx] != MCT_CHAN_MODE_IGNORE ) + if ( chInIdx != LFE_CHANNEL && 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 ) @@ -728,9 +745,7 @@ void ivas_ls_setup_conversion_process_mdct( /* Step 4: Perform equalization */ for ( chInIdx = 0; chInIdx < inChannels; chInIdx++ ) { - if ( - chInIdx != LFE_CHANNEL && - mct_chan_mode[chInIdx] != MCT_CHAN_MODE_IGNORE ) + if ( chInIdx != LFE_CHANNEL && mct_chan_mode[chInIdx] != MCT_CHAN_MODE_IGNORE ) { if ( transform_type[chInIdx][0] == TCX_20 ) { diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 430b57afa20dbbe874fe3b7c78638efa2e1d7c97..5df52f8287f22315dc4dfdf4d2548a53cf84ea43 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -262,7 +262,11 @@ void ivas_renderer_select( } else if ( st_ivas->ivas_format == STEREO_FORMAT ) { +#ifdef FIX_1314_STEREO_TO_EXT + if ( output_config != IVAS_AUDIO_CONFIG_STEREO && output_config != IVAS_AUDIO_CONFIG_MONO && output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) +#else if ( output_config != IVAS_AUDIO_CONFIG_STEREO && output_config != IVAS_AUDIO_CONFIG_MONO ) +#endif { *renderer_type = RENDERER_MC; }