diff --git a/lib_dec/ivas_core_dec_fx.c b/lib_dec/ivas_core_dec_fx.c index 03f0e4b40a7904afa92be4f0e71e70df0845e214..320d9d4bca0416271257ad1e1981194df2d7760c 100644 --- a/lib_dec/ivas_core_dec_fx.c +++ b/lib_dec/ivas_core_dec_fx.c @@ -266,11 +266,7 @@ ivas_error ivas_core_dec_fx( test(); test(); test(); -#ifdef NONBE_MDCT_ST_PLC_DO_NOT_SCALE_OLD_OUT_IF_FIRST_GOOD_IS_SID IF( !st->bfi && st->prev_bfi && GT_32( st->total_brate, SID_2k40 ) && ( EQ_16( st->last_core_bfi, TCX_20_CORE ) || EQ_16( st->last_core_bfi, TCX_10_CORE ) ) && st->hTcxDec != NULL ) -#else - IF( !st->bfi && st->prev_bfi && ( EQ_16( st->last_core_bfi, TCX_20_CORE ) || EQ_16( st->last_core_bfi, TCX_10_CORE ) ) && st->hTcxDec != NULL ) -#endif { conceal_eof_gain32 = L_shr_sat( st->hTcxDec->conceal_eof_gain32, sub( 16, st->hTcxDec->conceal_eof_gain_e ) ); // e = 31 - Q , 16 - e => 16 - (31 - Q) => Q - 15, // shr(16 -e ) = shr(Q -15) => 15 - Q ==> Q15 @@ -604,7 +600,7 @@ ivas_error ivas_core_dec_fx( st->hHQ_core->Q_old_wtda_LB = st->hHQ_core->Q_old_wtda; move16(); - Copy_Scale_sig_16_32_DEPREC( output_16_fx[n], output_32_fx[n], L_FRAME48k, Q11 ); // Q11 + Copy_Scale_sig_16_32_DEPREC( output_16_fx[n], output_32_fx[n], output_frame, Q11 ); // Q11 IF( st->hTcxDec ) { @@ -771,13 +767,8 @@ ivas_error ivas_core_dec_fx( test(); test(); -#ifdef NONBE_MDCT_ST_DTX_SKIP_DEWHITENING_OF_NOISE_SHAPES_ON_SID_FRAMES /* On first good active frame after frameloss undo the whitening of the bg noise shape */ IF( GT_32( sts[0]->core_brate, SID_2k40 ) && sts[0]->bfi == 0 && EQ_16( sts[0]->prev_bfi, 1 ) ) -#else - IF( sts[0]->bfi == 0 && EQ_16( sts[0]->prev_bfi, 1 ) ) - /* On first good frame after frameloss undo the whitening of the bg noise shape */ -#endif { FOR( n = 0; n < n_channels; ++n ) { diff --git a/lib_dec/ivas_dirac_dec_fx.c b/lib_dec/ivas_dirac_dec_fx.c index 37b0bf1bac3fee8a6880d01cb19f3585122365cf..403e11f00b2e5363167bb385cea81c13b83be6f7 100644 --- a/lib_dec/ivas_dirac_dec_fx.c +++ b/lib_dec/ivas_dirac_dec_fx.c @@ -1446,10 +1446,27 @@ void ivas_qmetadata_to_dirac_fx( { FOR( b = MASA_band_grouping_24[band_mapping[band]]; b < MASA_band_grouping_24[band_mapping[band + 1]]; ++b ) { - hSpatParamRendCom->azimuth[meta_write_index][b] = extract_h( L_shr( q_direction->band_data[band].azimuth_fx[block], 6 ) ); + /* Right shifting -1 -> -1, Hence this change is done */ + Word32 L_tmp = L_abs( q_direction->band_data[band].azimuth_fx[block] ); + hSpatParamRendCom->azimuth[meta_write_index][b] = extract_h( L_shr( L_tmp, 6 ) ); move16(); - hSpatParamRendCom->elevation[meta_write_index][b] = extract_h( L_shr( q_direction->band_data[band].elevation_fx[block], 6 ) ); + + IF( q_direction->band_data[band].azimuth_fx[block] < 0 ) + { + hSpatParamRendCom->azimuth[meta_write_index][b] = negate( hSpatParamRendCom->azimuth[meta_write_index][b] ); + move16(); + } + + L_tmp = L_abs( q_direction->band_data[band].elevation_fx[block] ); + hSpatParamRendCom->elevation[meta_write_index][b] = extract_h( L_shr( L_tmp, 6 ) ); move16(); + + IF( q_direction->band_data[band].elevation_fx[block] < 0 ) + { + hSpatParamRendCom->elevation[meta_write_index][b] = negate( hSpatParamRendCom->elevation[meta_write_index][b] ); + move16(); + } + hSpatParamRendCom->energy_ratio1_fx[meta_write_index][b] = q_direction->band_data[band].energy_ratio_fx[block]; move32(); hSpatParamRendCom->diffuseness_vector_fx[meta_write_index][b] = L_sub( ONE_IN_Q30, q_direction->band_data[band].energy_ratio_fx[block] ); diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index ad84c92e99851ea6415610e5b5b38ba7108870e6..e39b9a61e5e69fad68e535a1ef6ce72e23023fe8 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -8511,13 +8511,16 @@ static void intermidiate_ext_dirac_render( move16(); #endif } + IF( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_fx != NULL ) + { - tmp = L_norm_arr( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_fx, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_len ); - scale_sig32( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_fx, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_len, tmp ); /* Q(hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q + tmp) */ - hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q = add( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q, tmp ); - move16(); + tmp = L_norm_arr( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_fx, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_len ); + scale_sig32( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_fx, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_len, tmp ); /* Q(hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q + tmp) */ + hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q = add( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q, tmp ); + move16(); + } - IF( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_fx != 0 ) + IF( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_fx != NULL ) { tmp = L_norm_arr( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_fx, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_len ); scale_sig32( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_fx, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_len, tmp ); /* Q(hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q + tmp) */