diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index e7ee06648e3a5da6e4b2077718e1722bd3400acc..1918ce3f30fea189a73b96d56220e4622530008b 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -1288,18 +1288,7 @@ ivas_error ivas_jbm_dec_tc_fx( test(); IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_MONO ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_STEREO ) ) { - s = Q16 - Q11; - move16(); - s = sub( s, find_guarded_bits_fx( st_ivas->nchan_transport ) ); - FOR( i = 0; i < s_max( st_ivas->hDecoderConfig->nchan_out, st_ivas->nchan_transport ); ++i ) - { - Scale_sig32( p_output_fx[i], output_frame, s ); - } ivas_ls_setup_conversion_fx( st_ivas, st_ivas->nchan_transport, output_frame, p_output_fx, p_output_fx ); - FOR( i = 0; i < s_max( st_ivas->hDecoderConfig->nchan_out, st_ivas->nchan_transport ); ++i ) - { - Scale_sig32( p_output_fx[i], output_frame, negate( s ) ); - } } } ELSE IF( EQ_32( st_ivas->mc_mode, MC_MODE_MCMASA ) ) diff --git a/lib_dec/ivas_mc_param_dec_fx.c b/lib_dec/ivas_mc_param_dec_fx.c index db56ad03ed831adb2735e9d5c065fa29514107dd..b2a8bd30bdb46557bab2db346c3659d2ad50d556 100644 --- a/lib_dec/ivas_mc_param_dec_fx.c +++ b/lib_dec/ivas_mc_param_dec_fx.c @@ -123,7 +123,7 @@ ivas_error ivas_param_mc_dec_open_fx( Word16 nchan_out_transport; Word16 nchan_out_cov; Word32 proto_matrix_fx[MAX_CICP_CHANNELS * PARAM_MC_MAX_TRANSPORT_CHANS]; - Word32 proto_mtx_norm_fx; + Word32 proto_mtx_norm_fx, tmp32; Word16 frequency_axis_fx[CLDFB_NO_CHANNELS_MAX]; Word16 max_param_band_residual; UWord16 config_index; @@ -374,20 +374,27 @@ ivas_error ivas_param_mc_dec_open_fx( Scale_sig32( hParamMC->ls_conv_dmx_matrix_fx, imult1616( nchan_out_transport, nchan_out_cov ), 4 ); /*Q.26*/ IF( EQ_32( hParamMC->synthesis_conf, PARAM_MC_SYNTH_MONO_STEREO ) ) { - proto_mtx_norm_fx = ONE_IN_Q26; /*Q26*/ + tmp32 = ONE_IN_Q26; /*Q26*/ move32(); FOR( k = 0; k < nchan_transport * nchan_out_cov; k++ ) { - proto_mtx_norm_fx = L_max( L_abs( proto_mtx_norm_fx ), L_abs( proto_matrix_fx[k] ) ); /*Q.26*/ + tmp32 = L_max( L_abs( tmp32 ), L_abs( proto_matrix_fx[k] ) ); /*Q.26*/ } - proto_mtx_norm_fx = divide3232( ONE_IN_Q26, proto_mtx_norm_fx ); /*Q15*/ + proto_mtx_norm_fx = divide3232( ONE_IN_Q26, tmp32 ); /*Q15*/ /* transfer flattened proto_matrix to 2D in hLsSetupConversion->dmxMtx */ FOR( k = 0; k < nchan_transport; k++ ) { FOR( Word16 i = 0; i < nchan_out_cov; i++ ) { - st_ivas->hLsSetUpConversion->dmxMtx_fx[k][i] = L_shl( Mult_32_16( proto_matrix_fx[k * nchan_out_cov + i], extract_l( proto_mtx_norm_fx ) ), 4 ); /*Q.30*/ + IF( EQ_32( proto_matrix_fx[k * nchan_out_cov + i], tmp32 ) ) + { + st_ivas->hLsSetUpConversion->dmxMtx_fx[k][i] = ONE_IN_Q30; // Q30 + } + ELSE + { + st_ivas->hLsSetUpConversion->dmxMtx_fx[k][i] = L_shl( Mult_32_16( proto_matrix_fx[k * nchan_out_cov + i], extract_l( proto_mtx_norm_fx ) ), 4 ); /*Q.30*/ + } move32(); } } diff --git a/lib_dec/ivas_out_setup_conversion_fx.c b/lib_dec/ivas_out_setup_conversion_fx.c index c7bf0655d9ea765be0f1310a09229b8f553203a0..756eed60ef156f351e0e1cfb5721a2378293d137 100644 --- a/lib_dec/ivas_out_setup_conversion_fx.c +++ b/lib_dec/ivas_out_setup_conversion_fx.c @@ -586,14 +586,14 @@ void ivas_ls_setup_conversion_fx( Decoder_Struct *st_ivas, /* i : IVAS decoder structure */ const Word16 input_chans, /* i : number of input channels to the renderer */ const Word16 output_frame, /* i : frame length */ - Word32 *input[], /* i : LS input/output synthesis signal Q16*/ - Word32 *output[] /* i/o: LS input/output synthesis signal Q16*/ + Word32 *input[], /* i : LS input/output synthesis signal Qx*/ + Word32 *output[] /* i/o: LS input/output synthesis signal Qx*/ ) { Word16 chInIdx, chOutIdx, idx; LSSETUP_CONVERSION_HANDLE hLsSetUpConversion; Word32 dmxCoeff, tmpVal; - Word32 output_tmp[MAX_OUTPUT_CHANNELS][L_FRAME48k]; // Q16 + Word32 output_tmp[MAX_OUTPUT_CHANNELS][L_FRAME48k]; // Qx push_wmops( "LS_Renderer" );