diff --git a/lib_com/fft_fx_evs.c b/lib_com/fft_fx_evs.c index cf27583ae412ffd9673dee345a76c4828cac4eae..41a70b20c9776b831574299b51601fb5921e2e6e 100644 --- a/lib_com/fft_fx_evs.c +++ b/lib_com/fft_fx_evs.c @@ -2322,20 +2322,36 @@ void fft3_fx( const Word16 X[] /*Qx*/, Word16 Y[] /*Qx*/, const Word16 n ) l = sub( shr( n, 3 ), 1 ); /* (3*m/8) - 1 = (n/8) - 1 */ FOR( i = 0; i < l; i++ ) { - acc = L_shl( *RZ0++, 15 ); /* Align with the following non-fractional mode so as to gain 1 more bit headroom. Q15 + Qx*/ - acc = L_mac0( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/ - acc = L_mac0( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx - acc = L_mac0( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx - acc = L_mac0( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx - *RY++ = round_fx( acc ); /* bit growth = 1 (compensated by non-fractional mode MAC). Qx - 1*/ - move16(); - +#ifdef FIX_2170_ASSERT_IN_FFT3 + acc = L_shl_sat( *RZ0++, 15 ); /* Align with the following non-fractional mode so as to gain 1 more bit headroom. Q15 + Qx*/ + acc = L_mac0_sat( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/ + acc = L_mac0_sat( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx + acc = L_mac0_sat( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx + acc = L_mac0_sat( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx +#else + acc = L_shl( *RZ0++, 15 ); /* Align with the following non-fractional mode so as to gain 1 more bit headroom. Q15 + Qx*/ + acc = L_mac0( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/ + acc = L_mac0( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx + acc = L_mac0( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx + acc = L_mac0( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx +#endif + *RY++ = round_fx( acc ); /* bit growth = 1 (compensated by non-fractional mode MAC). Qx - 1*/ + move16(); + +#ifdef FIX_2170_ASSERT_IN_FFT3 + acc = L_shl_sat( *IZ0--, 15 ); // Q15 + Qx + acc = L_msu0_sat( acc, *RZ1++, t_sin[s1_ind] ); // Q15 + Qx + acc = L_mac0_sat( acc, *IZ1--, t_sin[c1_ind] ); // Q15 + Qx + acc = L_msu0_sat( acc, *RZ2++, t_sin[s2_ind] ); // Q15 + Qx + acc = L_mac0_sat( acc, *IZ2--, t_sin[c2_ind] ); // Q15 + Qx +#else acc = L_shl( *IZ0--, 15 ); // Q15 + Qx acc = L_msu0( acc, *RZ1++, t_sin[s1_ind] ); // Q15 + Qx acc = L_mac0( acc, *IZ1--, t_sin[c1_ind] ); // Q15 + Qx acc = L_msu0( acc, *RZ2++, t_sin[s2_ind] ); // Q15 + Qx acc = L_mac0( acc, *IZ2--, t_sin[c2_ind] ); // Q15 + Qx - *IY-- = round_fx( acc ); // Qx - 1 +#endif + *IY-- = round_fx( acc ); // Qx - 1 move16(); c1_ind = add( c1_ind, c1_step ); @@ -2348,20 +2364,36 @@ void fft3_fx( const Word16 X[] /*Qx*/, Word16 Y[] /*Qx*/, const Word16 n ) l = shr( m, 3 ); /* (4*m/8) - (3*m/8) = m/8 */ FOR( i = 0; i < l; i++ ) { - acc = L_shl( *RZ0++, 15 ); // Q15 + Qx - acc = L_mac0( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/ - acc = L_mac0( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx - acc = L_msu0( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx - acc = L_mac0( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx - *RY++ = round_fx( acc ); // Qx - 1 - move16(); - +#ifdef FIX_2170_ASSERT_IN_FFT3 + acc = L_shl_sat( *RZ0++, 15 ); // Q15 + Qx + acc = L_mac0_sat( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/ + acc = L_mac0_sat( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx + acc = L_msu0_sat( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx + acc = L_mac0_sat( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx +#else + acc = L_shl( *RZ0++, 15 ); // Q15 + Qx + acc = L_mac0( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/ + acc = L_mac0( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx + acc = L_msu0( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx + acc = L_mac0( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx +#endif + *RY++ = round_fx( acc ); // Qx - 1 + move16(); + +#ifdef FIX_2170_ASSERT_IN_FFT3 + acc = L_shl_sat( *IZ0--, 15 ); // Q15 + Qx + acc = L_msu0_sat( acc, *RZ1++, t_sin[s1_ind] ); // Q15 + Qx + acc = L_mac0_sat( acc, *IZ1--, t_sin[c1_ind] ); // Q15 + Qx + acc = L_msu0_sat( acc, *RZ2++, t_sin[s2_ind] ); // Q15 + Qx + acc = L_msu0_sat( acc, *IZ2--, t_sin[c2_ind] ); // Q15 + Qx +#else acc = L_shl( *IZ0--, 15 ); // Q15 + Qx acc = L_msu0( acc, *RZ1++, t_sin[s1_ind] ); // Q15 + Qx acc = L_mac0( acc, *IZ1--, t_sin[c1_ind] ); // Q15 + Qx acc = L_msu0( acc, *RZ2++, t_sin[s2_ind] ); // Q15 + Qx acc = L_msu0( acc, *IZ2--, t_sin[c2_ind] ); // Q15 + Qx - *IY-- = round_fx( acc ); // Qx - 1 +#endif + *IY-- = round_fx( acc ); // Qx - 1 move16(); c1_ind = add( c1_ind, c1_step ); @@ -2371,10 +2403,16 @@ void fft3_fx( const Word16 X[] /*Qx*/, Word16 Y[] /*Qx*/, const Word16 n ) } /* special case: i = m/2 i.e. 1/3 */ - acc = L_shl( *RZ0--, 15 ); // Q15 + Qx - acc = L_mac0( acc, *RZ1, t_sin[c1_ind] ); // Q15 + Qx - acc = L_msu0( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx - *RY++ = round_fx( acc ); // Qx - 1 +#ifdef FIX_2170_ASSERT_IN_FFT3 + acc = L_shl_sat( *RZ0--, 15 ); // Q15 + Qx + acc = L_mac0_sat( acc, *RZ1, t_sin[c1_ind] ); // Q15 + Qx + acc = L_msu0_sat( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx +#else + acc = L_shl( *RZ0--, 15 ); // Q15 + Qx + acc = L_mac0( acc, *RZ1, t_sin[c1_ind] ); // Q15 + Qx + acc = L_msu0( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx +#endif + *RY++ = round_fx( acc ); // Qx - 1 move16(); acc = 0; @@ -2396,20 +2434,35 @@ void fft3_fx( const Word16 X[] /*Qx*/, Word16 Y[] /*Qx*/, const Word16 n ) l = sub( shr( m, 2 ), 1 ); /* (6*m/8) - ((m/2)+1) = m/4 - 1 */ FOR( i = 0; i < l; i++ ) { - acc = L_shl( *RZ0--, 15 ); // Q15 + Qx - acc = L_mac0( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/ - acc = L_msu0( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx - acc = L_msu0( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx - acc = L_msu0( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx - *RY++ = round_fx( acc ); // Qx - 1 - move16(); - - acc = L_mult0( *IZ0++, -32768 ); // Q15 + Qx +#ifdef FIX_2170_ASSERT_IN_FFT3 + acc = L_shl_sat( *RZ0--, 15 ); // Q15 + Qx + acc = L_mac0_sat( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/ + acc = L_msu0_sat( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx + acc = L_msu0_sat( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx + acc = L_msu0_sat( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx +#else + acc = L_shl( *RZ0--, 15 ); // Q15 + Qx + acc = L_mac0( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/ + acc = L_msu0( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx + acc = L_msu0( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx + acc = L_msu0( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx +#endif + *RY++ = round_fx( acc ); // Qx - 1 + move16(); + + acc = L_mult0( *IZ0++, -32768 ); // Q15 + Qx +#ifdef FIX_2170_ASSERT_IN_FFT3 + acc = L_msu0_sat( acc, *RZ1--, t_sin[s1_ind] ); // Q15 + Qx + acc = L_msu0_sat( acc, *IZ1++, t_sin[c1_ind] ); // Q15 + Qx + acc = L_msu0_sat( acc, *RZ2--, t_sin[s2_ind] ); // Q15 + Qx + acc = L_mac0_sat( acc, *IZ2++, t_sin[c2_ind] ); // Q15 + Qx +#else acc = L_msu0( acc, *RZ1--, t_sin[s1_ind] ); // Q15 + Qx acc = L_msu0( acc, *IZ1++, t_sin[c1_ind] ); // Q15 + Qx acc = L_msu0( acc, *RZ2--, t_sin[s2_ind] ); // Q15 + Qx acc = L_mac0( acc, *IZ2++, t_sin[c2_ind] ); // Q15 + Qx - *IY-- = round_fx( acc ); // Qx - 1 +#endif + *IY-- = round_fx( acc ); // Qx - 1 move16(); c1_ind = add( c1_ind, c1_step ); @@ -2423,20 +2476,35 @@ void fft3_fx( const Word16 X[] /*Qx*/, Word16 Y[] /*Qx*/, const Word16 n ) l = shr( m, 2 ); FOR( i = 0; i < l; i++ ) { - acc = L_shl( *RZ0--, 15 ); // Q15 + Qx - acc = L_msu0( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/ - acc = L_msu0( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx - acc = L_msu0( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx - acc = L_mac0( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx - *RY++ = round_fx( acc ); // Qx - 1 - move16(); - - acc = L_mult0( *IZ0++, -32768 ); // Q15 + Qx +#ifdef FIX_2170_ASSERT_IN_FFT3 + acc = L_shl_sat( *RZ0--, 15 ); // Q15 + Qx + acc = L_msu0_sat( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/ + acc = L_msu0_sat( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx + acc = L_msu0_sat( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx + acc = L_mac0_sat( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx +#else + acc = L_shl( *RZ0--, 15 ); // Q15 + Qx + acc = L_msu0( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/ + acc = L_msu0( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx + acc = L_msu0( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx + acc = L_mac0( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx +#endif + *RY++ = round_fx( acc ); // Qx - 1 + move16(); + + acc = L_mult0( *IZ0++, -32768 ); // Q15 + Qx +#ifdef FIX_2170_ASSERT_IN_FFT3 + acc = L_msu0_sat( acc, *RZ1--, t_sin[s1_ind] ); // Q15 + Qx + acc = L_mac0_sat( acc, *IZ1++, t_sin[c1_ind] ); // Q15 + Qx + acc = L_mac0_sat( acc, *RZ2--, t_sin[s2_ind] ); // Q15 + Qx + acc = L_mac0_sat( acc, *IZ2++, t_sin[c2_ind] ); // Q15 + Qx +#else acc = L_msu0( acc, *RZ1--, t_sin[s1_ind] ); // Q15 + Qx acc = L_mac0( acc, *IZ1++, t_sin[c1_ind] ); // Q15 + Qx acc = L_mac0( acc, *RZ2--, t_sin[s2_ind] ); // Q15 + Qx acc = L_mac0( acc, *IZ2++, t_sin[c2_ind] ); // Q15 + Qx - *IY-- = round_fx( acc ); // Qx - 1 +#endif + *IY-- = round_fx( acc ); // Qx - 1 move16(); c1_ind = sub( c1_ind, c1_step ); @@ -2446,16 +2514,27 @@ void fft3_fx( const Word16 X[] /*Qx*/, Word16 Y[] /*Qx*/, const Word16 n ) } /* special case: i = m, i.e 2/3 */ - acc = L_shl( *RZ0++, 15 ); // Q15 + Qx - acc = L_msu0( acc, *RZ1, t_sin[c1_ind] ); // Q15 + Qx - acc = L_msu0( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx - *RY++ = round_fx( acc ); // Qx - 1 +#ifdef FIX_2170_ASSERT_IN_FFT3 + acc = L_shl_sat( *RZ0++, 15 ); // Q15 + Qx + acc = L_msu0_sat( acc, *RZ1, t_sin[c1_ind] ); // Q15 + Qx + acc = L_msu0_sat( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx +#else + acc = L_shl( *RZ0++, 15 ); // Q15 + Qx + acc = L_msu0( acc, *RZ1, t_sin[c1_ind] ); // Q15 + Qx + acc = L_msu0( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx +#endif + *RY++ = round_fx( acc ); // Qx - 1 move16(); acc = L_deposit_l( 0 ); - acc = L_msu0( acc, *RZ1++, t_sin[s1_ind] ); // Q15 + Qx - acc = L_mac0( acc, *RZ2++, t_sin[s2_ind] ); // Q15 + Qx - *IY-- = round_fx( acc ); // Qx - 1 +#ifdef FIX_2170_ASSERT_IN_FFT3 + acc = L_msu0_sat( acc, *RZ1++, t_sin[s1_ind] ); // Q15 + Qx + acc = L_mac0_sat( acc, *RZ2++, t_sin[s2_ind] ); // Q15 + Qx +#else + acc = L_msu0( acc, *RZ1++, t_sin[s1_ind] ); // Q15 + Qx + acc = L_mac0( acc, *RZ2++, t_sin[s2_ind] ); // Q15 + Qx +#endif + *IY-- = round_fx( acc ); // Qx - 1 move16(); IZ0--; /* Just decrement the address counter */ IZ1--; @@ -2470,20 +2549,36 @@ void fft3_fx( const Word16 X[] /*Qx*/, Word16 Y[] /*Qx*/, const Word16 n ) l = sub( shr( m, 3 ), 1 ); /* (9*m/8) - (m +1) = m/8 - 1 */ FOR( i = 0; i < l; i++ ) { - acc = L_shl( *RZ0++, 15 ); // Q15 + Qx - acc = L_msu0( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/ - acc = L_mac0( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx - acc = L_msu0( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx - acc = L_msu0( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx - *RY++ = round_fx( acc ); // Qx - 1 - move16(); - +#ifdef FIX_2170_ASSERT_IN_FFT3 + acc = L_shl_sat( *RZ0++, 15 ); // Q15 + Qx + acc = L_msu0_sat( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/ + acc = L_mac0_sat( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx + acc = L_msu0_sat( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx + acc = L_msu0_sat( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx +#else + acc = L_shl( *RZ0++, 15 ); // Q15 + Qx + acc = L_msu0( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/ + acc = L_mac0( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx + acc = L_msu0( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx + acc = L_msu0( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx +#endif + *RY++ = round_fx( acc ); // Qx - 1 + move16(); + +#ifdef FIX_2170_ASSERT_IN_FFT3 + acc = L_shl_sat( *IZ0--, 15 ); // Q15 + Qx + acc = L_msu0_sat( acc, *RZ1++, t_sin[s1_ind] ); // Q15 + Qx + acc = L_msu0_sat( acc, *IZ1--, t_sin[c1_ind] ); // Q15 + Qx + acc = L_mac0_sat( acc, *RZ2++, t_sin[s2_ind] ); // Q15 + Qx + acc = L_msu0_sat( acc, *IZ2--, t_sin[c2_ind] ); // Q15 + Qx +#else acc = L_shl( *IZ0--, 15 ); // Q15 + Qx acc = L_msu0( acc, *RZ1++, t_sin[s1_ind] ); // Q15 + Qx acc = L_msu0( acc, *IZ1--, t_sin[c1_ind] ); // Q15 + Qx acc = L_mac0( acc, *RZ2++, t_sin[s2_ind] ); // Q15 + Qx acc = L_msu0( acc, *IZ2--, t_sin[c2_ind] ); // Q15 + Qx - *IY-- = round_fx( acc ); // Qx - 1 +#endif + *IY-- = round_fx( acc ); // Qx - 1 move16(); c1_ind = sub( c1_ind, c1_step ); @@ -2496,20 +2591,36 @@ void fft3_fx( const Word16 X[] /*Qx*/, Word16 Y[] /*Qx*/, const Word16 n ) l = shr( n, 3 ); /* (12*m/8) - (9*m/8) = 3*m/8 = n/8 */ FOR( i = 0; i < l; i++ ) { - acc = L_shl( *RZ0++, 15 ); // Q15 + Qx - acc = L_msu0( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/ - acc = L_mac0( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx - acc = L_mac0( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx - acc = L_msu0( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx - *RY++ = round_fx( acc ); // Qx - 1 - move16(); - +#ifdef FIX_2170_ASSERT_IN_FFT3 + acc = L_shl_sat( *RZ0++, 15 ); // Q15 + Qx + acc = L_msu0_sat( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/ + acc = L_mac0_sat( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx + acc = L_mac0_sat( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx + acc = L_msu0_sat( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx +#else + acc = L_shl( *RZ0++, 15 ); // Q15 + Qx + acc = L_msu0( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/ + acc = L_mac0( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx + acc = L_mac0( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx + acc = L_msu0( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx +#endif + *RY++ = round_fx( acc ); // Qx - 1 + move16(); + +#ifdef FIX_2170_ASSERT_IN_FFT3 + acc = L_shl_sat( *IZ0--, 15 ); // Q15 + Qx + acc = L_msu0_sat( acc, *RZ1++, t_sin[s1_ind] ); // Q15 + Qx + acc = L_msu0_sat( acc, *IZ1--, t_sin[c1_ind] ); // Q15 + Qx + acc = L_mac0_sat( acc, *RZ2++, t_sin[s2_ind] ); // Q15 + Qx + acc = L_mac0_sat( acc, *IZ2--, t_sin[c2_ind] ); // Q15 + Qx +#else acc = L_shl( *IZ0--, 15 ); // Q15 + Qx acc = L_msu0( acc, *RZ1++, t_sin[s1_ind] ); // Q15 + Qx acc = L_msu0( acc, *IZ1--, t_sin[c1_ind] ); // Q15 + Qx acc = L_mac0( acc, *RZ2++, t_sin[s2_ind] ); // Q15 + Qx acc = L_mac0( acc, *IZ2--, t_sin[c2_ind] ); // Q15 + Qx - *IY-- = round_fx( acc ); // Qx - 1 +#endif + *IY-- = round_fx( acc ); // Qx - 1 move16(); c1_ind = sub( c1_ind, c1_step ); @@ -2519,10 +2630,16 @@ void fft3_fx( const Word16 X[] /*Qx*/, Word16 Y[] /*Qx*/, const Word16 n ) } /* special case: i = 3*m/2 */ - acc = L_shl( *RZ0, 15 ); // Q15 + Qx - acc = L_msu0( acc, *RZ1, t_sin[c1_ind] ); // Q15 + Qx - acc = L_mac0( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx - *RY = round_fx( acc ); // Qx - 1 +#ifdef FIX_2170_ASSERT_IN_FFT3 + acc = L_shl_sat( *RZ0, 15 ); // Q15 + Qx + acc = L_msu0_sat( acc, *RZ1, t_sin[c1_ind] ); // Q15 + Qx + acc = L_mac0_sat( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx +#else + acc = L_shl( *RZ0, 15 ); // Q15 + Qx + acc = L_msu0( acc, *RZ1, t_sin[c1_ind] ); // Q15 + Qx + acc = L_mac0( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx +#endif + *RY = round_fx( acc ); // Qx - 1 move16(); return; diff --git a/lib_com/options.h b/lib_com/options.h index 7cf668641d71d3b1400de92b5fb78ee63547fd96..e454fcc18f5e6eb12e885994212b8dd6611a19f2 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -87,10 +87,12 @@ #define FIX_2166_ASSERT_OSBA_PLC_STEREO_OUT /* FhG: fix for issue 2166 - add missing averaging factor 0.5 in for the sum of energies in function stereo_dft_dmx_swb_nrg_fx()*/ #define FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE /* FhG: Use dynamic Q factor for synth_fx and synthFB_fx to prevent overflow */ +#define FIX_2170_ASSERT_IN_FFT3 /* Eri: Assert in fft3_fx from EVS, adding _sat */ #define FIX_2082_FP_LEFTOVERS_OMASA_DEC /* Nokia: fix for issue 2082, cleaning remaining floating point code */ #define FIX_2174_JBM_BASOP_ALIGNMENT /* VoiceAge, Nokia: Fixes to JBM BASOP implementation and alignment to float */ #define FIX_2176_ASSERT_DEC_MAP_PARAMS_DIRAC2STEREO /* FhG: Reduce hStereoDft->q_smooth_buf_fx by one to prevent overflow in the subframe_band_nrg[][] calculation */ + /* ################### End FIXES switches ########################### */ /* #################### Start BASOP porting switches ############################ */ diff --git a/lib_dec/FEC_HQ_phase_ecu_fx.c b/lib_dec/FEC_HQ_phase_ecu_fx.c index dd44f50b9cfbaae3247da01a39b0e85a3ee334b4..4ad39acf07dc69641254ba62662576843789d78e 100644 --- a/lib_dec/FEC_HQ_phase_ecu_fx.c +++ b/lib_dec/FEC_HQ_phase_ecu_fx.c @@ -2142,7 +2142,11 @@ static void ivas_subst_spec_fx( im = *pImX; move16(); tmp = sub_sat( mult_r( re, cos_F ), mult_r( im, sin_F ) ); +#ifdef FIX_2170_ASSERT_IN_FFT3 + im = add_sat( mult_r( re, sin_F ), mult_r( im, cos_F ) ); +#else im = add( mult_r( re, sin_F ), mult_r( im, cos_F ) ); +#endif IF( LT_16( alpha[k], 32766 ) ) { alpha_local = mag_chg_local;