Loading lib_dec/ivas_stereo_mdct_core_dec_fx.c +8 −10 Original line number Original line Diff line number Diff line Loading @@ -987,7 +987,7 @@ static void run_min_stats_fx( { { Word16 ch, will_estimate_noise_on_channel[CPE_CHANNELS], save_VAD[CPE_CHANNELS]; Word16 ch, will_estimate_noise_on_channel[CPE_CHANNELS], save_VAD[CPE_CHANNELS]; Word32 power_spec[L_FRAME16k]; Word32 power_spec[L_FRAME16k]; Word16 power_spec_e = 0; Word16 power_spec_q = 0; move16(); move16(); Word32 *spec_in; Word32 *spec_in; Word16 spec_e; Word16 spec_e; Loading Loading @@ -1047,25 +1047,23 @@ static void run_min_stats_fx( Word32 power_spec_scale_fac; Word32 power_spec_scale_fac; /* calculate power spectrum from MDCT coefficients and estimated MDST coeffs */ /* calculate power spectrum from MDCT coefficients and estimated MDST coeffs */ power_spec_scale_fac = 20792; /* 1.f / ( L_FRAME16k * L_FRAME16k ) in Q31 */ power_spec_scale_fac = 20792; // 1.f / ( L_FRAME16k * L_FRAME16k ) in Q31 move32(); spec_power = W_shl( W_mult_32_32( spec_in[0], spec_in[0] ), 2 * tmp16 ); spec_power = W_shl( W_mult_32_32( spec_in[0], spec_in[0] ), shl( tmp16, 1 ) ); power_spec[0] = W_extract_l( W_shr( W_mult_32_32( W_extract_h( spec_power ), power_spec_scale_fac ), 16 ) ); /* 2 * (Q31 - x_e + tmp16) + 1 - Q16 */ power_spec[0] = W_extract_l( W_shr( W_mult_32_32( W_extract_h( spec_power ), power_spec_scale_fac ), 16 ) ); /* 2 * (Q31 - x_e + tmp16) + 1 - Q16 */ move32(); move32(); spec_power = W_shl( W_mult_32_32( spec_in[L_FRAME16k - 1], spec_in[L_FRAME16k - 1] ), shl( tmp16, 1 ) ); spec_power = W_shl( W_mult_32_32( spec_in[L_FRAME16k - 1], spec_in[L_FRAME16k - 1] ), 2 * tmp16 ); power_spec[L_FRAME16k - 1] = W_extract_l( W_shr( W_mult_32_32( W_extract_h( spec_power ), power_spec_scale_fac ), 16 ) ); /* 2 * (Q31 - x_e + tmp16) + 1 - Q16 */ power_spec[L_FRAME16k - 1] = W_extract_l( W_shr( W_mult_32_32( W_extract_h( spec_power ), power_spec_scale_fac ), 16 ) ); /* 2 * (Q31 - x_e + tmp16) + 1 - Q16 */ move32(); move32(); FOR( Word16 i = 1; i < L_FRAME16k - 1; i++ ) FOR( Word16 i = 1; i < L_FRAME16k - 1; i++ ) { { Word32 mdst; Word32 mdst; mdst = L_sub( spec_in[i + 1], spec_in[i - 1] ); /* Q31 - x_e */ mdst = L_sub( spec_in[i + 1], spec_in[i - 1] ); /* Q31 - x_e */ spec_power = W_shl( W_add( W_mult_32_32( spec_in[i], spec_in[i] ), W_mult_32_32( mdst, mdst ) ), 2 * tmp16 ); spec_power = W_shl( W_add( W_mult_32_32( spec_in[i], spec_in[i] ), W_mult_32_32( mdst, mdst ) ), shl( tmp16, 1 ) ); power_spec[i] = W_extract_l( W_shr( W_mult_32_32( W_extract_h( spec_power ), power_spec_scale_fac ), 16 ) ); /* 2 * (Q31 - x_e + tmp16) + 1 - Q16 */ power_spec[i] = W_extract_l( W_shr( W_mult_32_32( W_extract_h( spec_power ), power_spec_scale_fac ), 16 ) ); /* 2 * (Q31 - x_e + tmp16) + 1 - Q16 */ move32(); move32(); } } power_spec_e = 2 * ( 31 - spec_e + tmp16 ) + 1 - 16; power_spec_q = add( shl( add( sub( 31, spec_e ), tmp16 ), 1 ), 1 - 16 ); } } } } Loading Loading @@ -1095,7 +1093,7 @@ static void run_min_stats_fx( { { arr_tmp = power_spec; arr_tmp = power_spec; } } ApplyFdCng_ivas_fx( NULL, 0, arr_tmp, power_spec_e, NULL, NULL, NULL, st, st->bfi, 0 ); ApplyFdCng_ivas_fx( NULL, 0, arr_tmp, power_spec_q, NULL, NULL, NULL, st, st->bfi, 0 ); /*=================================================*/ /*=================================================*/ } } Loading Loading
lib_dec/ivas_stereo_mdct_core_dec_fx.c +8 −10 Original line number Original line Diff line number Diff line Loading @@ -987,7 +987,7 @@ static void run_min_stats_fx( { { Word16 ch, will_estimate_noise_on_channel[CPE_CHANNELS], save_VAD[CPE_CHANNELS]; Word16 ch, will_estimate_noise_on_channel[CPE_CHANNELS], save_VAD[CPE_CHANNELS]; Word32 power_spec[L_FRAME16k]; Word32 power_spec[L_FRAME16k]; Word16 power_spec_e = 0; Word16 power_spec_q = 0; move16(); move16(); Word32 *spec_in; Word32 *spec_in; Word16 spec_e; Word16 spec_e; Loading Loading @@ -1047,25 +1047,23 @@ static void run_min_stats_fx( Word32 power_spec_scale_fac; Word32 power_spec_scale_fac; /* calculate power spectrum from MDCT coefficients and estimated MDST coeffs */ /* calculate power spectrum from MDCT coefficients and estimated MDST coeffs */ power_spec_scale_fac = 20792; /* 1.f / ( L_FRAME16k * L_FRAME16k ) in Q31 */ power_spec_scale_fac = 20792; // 1.f / ( L_FRAME16k * L_FRAME16k ) in Q31 move32(); spec_power = W_shl( W_mult_32_32( spec_in[0], spec_in[0] ), 2 * tmp16 ); spec_power = W_shl( W_mult_32_32( spec_in[0], spec_in[0] ), shl( tmp16, 1 ) ); power_spec[0] = W_extract_l( W_shr( W_mult_32_32( W_extract_h( spec_power ), power_spec_scale_fac ), 16 ) ); /* 2 * (Q31 - x_e + tmp16) + 1 - Q16 */ power_spec[0] = W_extract_l( W_shr( W_mult_32_32( W_extract_h( spec_power ), power_spec_scale_fac ), 16 ) ); /* 2 * (Q31 - x_e + tmp16) + 1 - Q16 */ move32(); move32(); spec_power = W_shl( W_mult_32_32( spec_in[L_FRAME16k - 1], spec_in[L_FRAME16k - 1] ), shl( tmp16, 1 ) ); spec_power = W_shl( W_mult_32_32( spec_in[L_FRAME16k - 1], spec_in[L_FRAME16k - 1] ), 2 * tmp16 ); power_spec[L_FRAME16k - 1] = W_extract_l( W_shr( W_mult_32_32( W_extract_h( spec_power ), power_spec_scale_fac ), 16 ) ); /* 2 * (Q31 - x_e + tmp16) + 1 - Q16 */ power_spec[L_FRAME16k - 1] = W_extract_l( W_shr( W_mult_32_32( W_extract_h( spec_power ), power_spec_scale_fac ), 16 ) ); /* 2 * (Q31 - x_e + tmp16) + 1 - Q16 */ move32(); move32(); FOR( Word16 i = 1; i < L_FRAME16k - 1; i++ ) FOR( Word16 i = 1; i < L_FRAME16k - 1; i++ ) { { Word32 mdst; Word32 mdst; mdst = L_sub( spec_in[i + 1], spec_in[i - 1] ); /* Q31 - x_e */ mdst = L_sub( spec_in[i + 1], spec_in[i - 1] ); /* Q31 - x_e */ spec_power = W_shl( W_add( W_mult_32_32( spec_in[i], spec_in[i] ), W_mult_32_32( mdst, mdst ) ), 2 * tmp16 ); spec_power = W_shl( W_add( W_mult_32_32( spec_in[i], spec_in[i] ), W_mult_32_32( mdst, mdst ) ), shl( tmp16, 1 ) ); power_spec[i] = W_extract_l( W_shr( W_mult_32_32( W_extract_h( spec_power ), power_spec_scale_fac ), 16 ) ); /* 2 * (Q31 - x_e + tmp16) + 1 - Q16 */ power_spec[i] = W_extract_l( W_shr( W_mult_32_32( W_extract_h( spec_power ), power_spec_scale_fac ), 16 ) ); /* 2 * (Q31 - x_e + tmp16) + 1 - Q16 */ move32(); move32(); } } power_spec_e = 2 * ( 31 - spec_e + tmp16 ) + 1 - 16; power_spec_q = add( shl( add( sub( 31, spec_e ), tmp16 ), 1 ), 1 - 16 ); } } } } Loading Loading @@ -1095,7 +1093,7 @@ static void run_min_stats_fx( { { arr_tmp = power_spec; arr_tmp = power_spec; } } ApplyFdCng_ivas_fx( NULL, 0, arr_tmp, power_spec_e, NULL, NULL, NULL, st, st->bfi, 0 ); ApplyFdCng_ivas_fx( NULL, 0, arr_tmp, power_spec_q, NULL, NULL, NULL, st, st->bfi, 0 ); /*=================================================*/ /*=================================================*/ } } Loading