diff --git a/lib_dec/ivas_core_dec_fx.c b/lib_dec/ivas_core_dec_fx.c index 320d9d4bca0416271257ad1e1981194df2d7760c..38ec5b943407e373e2c2ad240e48d8987892cf30 100644 --- a/lib_dec/ivas_core_dec_fx.c +++ b/lib_dec/ivas_core_dec_fx.c @@ -1030,7 +1030,7 @@ ivas_error ivas_core_dec_fx( /* Memories Re-Scaling */ Copy_Scale_sig_16_32_no_sat( hb_synth_16_fx[n], hb_synth_32_fx[n], L_FRAME48k, sub( Q11, Q_hb_synth_fx ) ); // Q11 Copy_Scale_sig_16_32_no_sat( output_16_fx[n], output_32_fx[n], L_FRAME48k, sub( Q11, Q_input ) ); // Q11 // Q_input can get value <= -5 - Copy_Scale_sig_16_32_no_sat( synth_16_fx[n], synth_32_fx[n], L_FRAME48k, sub( Q11, Q_synth_fx ) ); // Q11 + Copy_Scale_sig_16_32_no_sat( synth_16_fx[n], synth_32_fx[n], output_frame, sub( Q11, Q_synth_fx ) ); // Q11 IF( hBWE_FD != NULL ) { diff --git a/lib_dec/ivas_dirac_dec_fx.c b/lib_dec/ivas_dirac_dec_fx.c index 403e11f00b2e5363167bb385cea81c13b83be6f7..7fecb7ca7042e0d0cf4fb8ad6038c963d51f42e4 100644 --- a/lib_dec/ivas_dirac_dec_fx.c +++ b/lib_dec/ivas_dirac_dec_fx.c @@ -1511,10 +1511,25 @@ 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->azimuth2[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->azimuth2[meta_write_index][b] = extract_h( L_shr( L_tmp, 6 ) ); move16(); - hSpatParamRendCom->elevation2[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->azimuth2[meta_write_index][b] = negate( hSpatParamRendCom->azimuth2[meta_write_index][b] ); + move16(); + } + + L_tmp = L_abs( q_direction->band_data[band].elevation_fx[block] ); + hSpatParamRendCom->elevation2[meta_write_index][b] = extract_h( L_shr( L_tmp, 6 ) ); move16(); + IF( q_direction->band_data[band].elevation_fx[block] < 0 ) + { + hSpatParamRendCom->elevation2[meta_write_index][b] = negate( hSpatParamRendCom->elevation2[meta_write_index][b] ); + move16(); + } + hSpatParamRendCom->energy_ratio2_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( hSpatParamRendCom->diffuseness_vector_fx[meta_write_index][b], q_direction->band_data[band].energy_ratio_fx[block] );