diff --git a/lib_com/ivas_rom_com_fx.c b/lib_com/ivas_rom_com_fx.c index 1cfe1ff6caab503e1a58c6e960c3b26642670790..b64ac56355f75a774b68ff2c488e17443c0a1328 100644 --- a/lib_com/ivas_rom_com_fx.c +++ b/lib_com/ivas_rom_com_fx.c @@ -483,20 +483,8 @@ const Word32 dft_res_gains_q_fx[][2] = { }; -// Q13 -const Word16 McMASA_LFEGain_vectors_fx_q13[64] = { - 3113, 2703, 1556, 1638, -1311, -1802, -2867, -2785, - 4096, 4096, 4096, 4096, -6554, -3277, 8356, 819, - -4096, -4096, -4096, -4096, -4588, -983, -6390, 11141, - -8356, 9667, -4669, 2703, 5898, -9257, 7946, -5079, - -7455, 7619, 8192, -9011, 14172, -1884, -6390, -6881, - 7782, -13107, -2785, 7619, 7127, 3850, -15565, 4260, - 5489, 11633, -7946, -10158, 6799, 4751, 4997, -16712, - -6554, -12943, 6717, 11633, -17531, 2130, 6881, 8356 -}; - // Q25 -const Word32 McMASA_LFEGain_vectors_fx_q25[64] = { +const Word32 McMASA_LFEGain_vectors_fx[64] = { 12750684, 11072963, 6375342, 6710886, /* 1st bit */ -5368709, -7381975, -11744051, -11408507, 16777216, 16777216, 16777216, 16777216, /* 2nd bit*/ diff --git a/lib_com/ivas_rom_com_fx.h b/lib_com/ivas_rom_com_fx.h index 3344a35d208b8ed225895c9bab0f66db88ac7978..2619a3f26d30045d4895a7dff0a07087c7f9144a 100644 --- a/lib_com/ivas_rom_com_fx.h +++ b/lib_com/ivas_rom_com_fx.h @@ -56,8 +56,7 @@ extern const Word16 dft_trigo_12k8_fx[STEREO_DFT_N_12k8_ENC / 4 + 1]; extern const Word16 dft_trigo_32k_fx[STEREO_DFT_N_32k_ENC / 4 + 1]; extern const Word16 dft_trigo_48k_fx[STEREO_DFT_N_MAX_ENC / 4 + 1]; extern const Word16 gridEq_Table[NO_THETA16_MAX]; -extern const Word16 McMASA_LFEGain_vectors_fx_q13[64]; -extern const Word32 McMASA_LFEGain_vectors_fx_q25[64]; +extern const Word32 McMASA_LFEGain_vectors_fx[64]; /* Q25 */ extern const Word16 ivas_divde_255[256]; diff --git a/lib_dec/ivas_masa_dec_fx.c b/lib_dec/ivas_masa_dec_fx.c index 457c040c3e652a11160a36ef21e71c49665e23d5..6363bdf743d35785ed33cbbd059f797026b16380 100644 --- a/lib_dec/ivas_masa_dec_fx.c +++ b/lib_dec/ivas_masa_dec_fx.c @@ -1533,11 +1533,11 @@ static Word16 decode_lfe_to_total_energy_ratio_fx( } ELSE { - tmp16 = shr( McMASA_LFEGain_vectors_fx_q13[4 * lfeToTotalEnergyRatioIndices[2] + i], 1 ); /* Q12 */ - tmp16 = add( log2LFEaverage_fx, tmp16 ); /* Q12 */ - tmp32 = BASOP_util_Pow2( L_deposit_h( tmp16 ), 15 - Q12, &exp ); /* Q(31 - exp) */ - tmp16 = round_fx( tmp32 ); /* Q(31-exp) -> Q(15 - exp) */ - hMasaLfeSynth->lfeToTotalEnergyRatio_fx[i] = shr_sat( tmp16, sub( 1, exp ) ); /* should saturate. Q(15 - exp) - (1 - exp) -> Q14 */ + tmp16 = shr( extract_l( L_shr_r( McMASA_LFEGain_vectors_fx[4 * lfeToTotalEnergyRatioIndices[2] + i], Q12 ) ), 1 ); /* Q12 */ + tmp16 = add( log2LFEaverage_fx, tmp16 ); /* Q12 */ + tmp32 = BASOP_util_Pow2( L_deposit_h( tmp16 ), 15 - Q12, &exp ); /* Q(31 - exp) */ + tmp16 = round_fx( tmp32 ); /* Q(31-exp) -> Q(15 - exp) */ + hMasaLfeSynth->lfeToTotalEnergyRatio_fx[i] = shr_sat( tmp16, sub( 1, exp ) ); /* should saturate. Q(15 - exp) - (1 - exp) -> Q14 */ move16(); } diff --git a/lib_enc/ivas_masa_enc_fx.c b/lib_enc/ivas_masa_enc_fx.c index 35c57c42b59620e70181d62cad145fe528bb0db7..b87bcf88b0a6ef1c74d59fb5c8c880df6f85203d 100644 --- a/lib_enc/ivas_masa_enc_fx.c +++ b/lib_enc/ivas_masa_enc_fx.c @@ -2842,7 +2842,7 @@ static Word16 encode_lfe_to_total_energy_ratio_fx( IF( VQLevels > 0 ) { - lfeToTotalEnergyRatioIndices[2] = vquant_ivas_fx( log2LFEratio, 0, xqv, McMASA_LFEGain_vectors_fx_q25, 4, VQLevels ); + lfeToTotalEnergyRatioIndices[2] = vquant_ivas_fx( log2LFEratio, 0, xqv, McMASA_LFEGain_vectors_fx, 4, VQLevels ); move16(); } }