Loading lib_com/fft_fx.c +334 −0 Original line number Diff line number Diff line Loading @@ -4727,6 +4727,16 @@ static void fft_len16( cmplx t[4]; cmplx y[16]; #ifdef OPT_STEREO_32KBPS_V1 s[0] = x[0]; // Qx move64(); s[1] = x[4]; // Qx move64(); s[2] = x[8]; // Qx move64(); s[3] = x[12]; // Qx move64(); #else /* OPT_STEREO_32KBPS_V1 */ s[0] = CL_shr( x[0], SCALEFACTOR16 ); // Qx move64(); s[1] = CL_shr( x[4], SCALEFACTOR16 ); // Qx Loading @@ -4735,6 +4745,7 @@ static void fft_len16( move64(); s[3] = CL_shr( x[12], SCALEFACTOR16 ); // Qx move64(); #endif /* OPT_STEREO_32KBPS_V1 */ t[0] = CL_add( s[0], s[2] ); move64(); Loading @@ -4754,6 +4765,16 @@ static void fft_len16( y[3] = CL_add( t[1], t[3] ); move64(); #ifdef OPT_STEREO_32KBPS_V1 s[0] = x[1]; // Qx move64(); s[1] = x[5]; // Qx move64(); s[2] = x[9]; // Qx move64(); s[3] = x[13]; // Qx move64(); #else /* OPT_STEREO_32KBPS_V1 */ s[0] = CL_shr( x[1], SCALEFACTOR16 ); // Qx move64(); s[1] = CL_shr( x[5], SCALEFACTOR16 ); // Qx Loading @@ -4762,6 +4783,7 @@ static void fft_len16( move64(); s[3] = CL_shr( x[13], SCALEFACTOR16 ); // Qx move64(); #endif /* OPT_STEREO_32KBPS_V1 */ t[0] = CL_add( s[0], s[2] ); move64(); Loading @@ -4781,6 +4803,16 @@ static void fft_len16( y[7] = CL_add( t[1], t[3] ); move64(); #ifdef OPT_STEREO_32KBPS_V1 s[0] = x[2]; // Qx move64(); s[1] = x[6]; // Qx move64(); s[2] = x[10]; // Qx move64(); s[3] = x[14]; // Qx move64(); #else /* OPT_STEREO_32KBPS_V1 */ s[0] = CL_shr( x[2], SCALEFACTOR16 ); // Qx move64(); s[1] = CL_shr( x[6], SCALEFACTOR16 ); // Qx Loading @@ -4789,6 +4821,7 @@ static void fft_len16( move64(); s[3] = CL_shr( x[14], SCALEFACTOR16 ); // Qx move64(); #endif /* OPT_STEREO_32KBPS_V1 */ t[0] = CL_add( s[0], s[2] ); move64(); Loading @@ -4810,6 +4843,16 @@ static void fft_len16( y[11] = CL_add( t[1], t[3] ); move64(); #ifdef OPT_STEREO_32KBPS_V1 s[0] = x[3]; // Qx move64(); s[1] = x[7]; // Qx move64(); s[2] = x[11]; // Qx move64(); s[3] = x[15]; // Qx move64(); #else /* OPT_STEREO_32KBPS_V1 */ s[0] = CL_shr( x[3], SCALEFACTOR16 ); // Qx move64(); s[1] = CL_shr( x[7], SCALEFACTOR16 ); // Qx Loading @@ -4818,6 +4861,7 @@ static void fft_len16( move64(); s[3] = CL_shr( x[15], SCALEFACTOR16 ); // Qx move64(); #endif /* OPT_STEREO_32KBPS_V1 */ t[0] = CL_add( s[0], s[2] ); move64(); Loading Loading @@ -4978,6 +5022,18 @@ static void fft_len20_fx( cmplx tt[4]; cmplx y[20]; #ifdef OPT_STEREO_32KBPS_V1 xx[0] = x[0]; // Qx move64(); xx[1] = x[16]; // Qx move64(); xx[2] = x[12]; // Qx move64(); xx[3] = x[8]; // Qx move64(); xx[4] = x[4]; // Qx move64(); #else /* OPT_STEREO_32KBPS_V1 */ xx[0] = CL_shr( x[0], SCALEFACTOR20 ); // Qx move64(); xx[1] = CL_shr( x[16], SCALEFACTOR20 ); // Qx Loading @@ -4988,6 +5044,7 @@ static void fft_len20_fx( move64(); xx[4] = CL_shr( x[4], SCALEFACTOR20 ); // Qx move64(); #endif /* OPT_STEREO_32KBPS_V1 */ s[0] = CL_add( xx[1], xx[4] ); move64(); Loading Loading @@ -5023,6 +5080,18 @@ static void fft_len20_fx( y[12] = CL_msu_j( s[2], s[3] ); move64(); #ifdef OPT_STEREO_32KBPS_V1 xx[0] = x[5]; move64(); xx[1] = x[1]; move64(); xx[2] = x[17]; move64(); xx[3] = x[13]; move64(); xx[4] = x[9]; move64(); #else /* OPT_STEREO_32KBPS_V1 */ xx[0] = CL_shr( x[5], SCALEFACTOR20 ); move64(); xx[1] = CL_shr( x[1], SCALEFACTOR20 ); Loading @@ -5033,6 +5102,7 @@ static void fft_len20_fx( move64(); xx[4] = CL_shr( x[9], SCALEFACTOR20 ); move64(); #endif /* OPT_STEREO_32KBPS_V1 */ s[0] = CL_add( xx[1], xx[4] ); move64(); Loading Loading @@ -5068,6 +5138,18 @@ static void fft_len20_fx( y[13] = CL_msu_j( s[2], s[3] ); move64(); #ifdef OPT_STEREO_32KBPS_V1 xx[0] = x[10]; move64(); xx[1] = x[6]; move64(); xx[2] = x[2]; move64(); xx[3] = x[18]; move64(); xx[4] = x[14]; move64(); #else /* OPT_STEREO_32KBPS_V1 */ xx[0] = CL_shr( x[10], SCALEFACTOR20 ); move64(); xx[1] = CL_shr( x[6], SCALEFACTOR20 ); Loading @@ -5078,6 +5160,7 @@ static void fft_len20_fx( move64(); xx[4] = CL_shr( x[14], SCALEFACTOR20 ); move64(); #endif /* OPT_STEREO_32KBPS_V1 */ s[0] = CL_add( xx[1], xx[4] ); move64(); Loading Loading @@ -5113,6 +5196,18 @@ static void fft_len20_fx( y[14] = CL_msu_j( s[2], s[3] ); move64(); #ifdef OPT_STEREO_32KBPS_V1 xx[0] = x[15]; move64(); xx[1] = x[11]; move64(); xx[2] = x[7]; move64(); xx[3] = x[3]; move64(); xx[4] = x[19]; move64(); #else /* OPT_STEREO_32KBPS_V1 */ xx[0] = CL_shr( x[15], SCALEFACTOR20 ); move64(); xx[1] = CL_shr( x[11], SCALEFACTOR20 ); Loading @@ -5123,6 +5218,7 @@ static void fft_len20_fx( move64(); xx[4] = CL_shr( x[19], SCALEFACTOR20 ); move64(); #endif /* OPT_STEREO_32KBPS_V1 */ s[0] = CL_add( xx[1], xx[4] ); move64(); Loading Loading @@ -6501,6 +6597,239 @@ static void fft_lenN( cmplx s[8]; cmplx y[8]; #ifdef OPT_STEREO_32KBPS_V1 y[1] = xx[1 * dim1]; move64(); y[2] = xx[2 * dim1]; move64(); y[3] = xx[3 * dim1]; move64(); y[4] = xx[4 * dim1]; move64(); y[5] = xx[5 * dim1]; move64(); y[6] = xx[6 * dim1]; move64(); y[7] = xx[7 * dim1]; move64(); test(); test(); IF( EQ_16( dim1, 8 ) || EQ_16( dim1, 16 ) || EQ_16( dim1, 32 ) ) { FOR( i = 0; i < dim1; i++ ) { { y[0] = xx[i]; move64(); }; IF( i > 0 ) { { y[1] = CL_mac_j( CL_scale( xx[( i + ( 1 * dim1 ) )], W[( ( ( sc * i ) + ( ( sc * 1 ) * dim1 ) ) - Woff )] ), CL_scale( xx[( i + ( 1 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( sc * 1 ) * dim1 ) ) + 1 ) - Woff )] ) ); // Qx move64(); }; { y[2] = CL_mac_j( CL_scale( xx[( i + ( 2 * dim1 ) )], W[( ( ( sc * i ) + ( ( sc * 2 ) * dim1 ) ) - Woff )] ), CL_scale( xx[( i + ( 2 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( sc * 2 ) * dim1 ) ) + 1 ) - Woff )] ) ); // Qx move64(); }; { y[3] = CL_mac_j( CL_scale( xx[( i + ( 3 * dim1 ) )], W[( ( ( sc * i ) + ( ( sc * 3 ) * dim1 ) ) - Woff )] ), CL_scale( xx[( i + ( 3 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( sc * 3 ) * dim1 ) ) + 1 ) - Woff )] ) ); // Qx move64(); }; { y[4] = CL_mac_j( CL_scale( xx[( i + ( 4 * dim1 ) )], W[( ( ( sc * i ) + ( ( sc * 4 ) * dim1 ) ) - Woff )] ), CL_scale( xx[( i + ( 4 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( sc * 4 ) * dim1 ) ) + 1 ) - Woff )] ) ); // Qx move64(); }; { y[5] = CL_mac_j( CL_scale( xx[( i + ( 5 * dim1 ) )], W[( ( ( sc * i ) + ( ( sc * 5 ) * dim1 ) ) - Woff )] ), CL_scale( xx[( i + ( 5 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( sc * 5 ) * dim1 ) ) + 1 ) - Woff )] ) ); // Qx move64(); }; { y[6] = CL_mac_j( CL_scale( xx[( i + ( 6 * dim1 ) )], W[( ( ( sc * i ) + ( ( sc * 6 ) * dim1 ) ) - Woff )] ), CL_scale( xx[( i + ( 6 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( sc * 6 ) * dim1 ) ) + 1 ) - Woff )] ) ); // Qx move64(); }; { y[7] = CL_mac_j( CL_scale( xx[( i + ( 7 * dim1 ) )], W[( ( ( sc * i ) + ( ( sc * 7 ) * dim1 ) ) - Woff )] ), CL_scale( xx[( i + ( 7 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( sc * 7 ) * dim1 ) ) + 1 ) - Woff )] ) ); // Qx move64(); }; } t[0] = CL_add( y[0], y[4] ); move64(); t[1] = CL_sub( y[0], y[4] ); move64(); t[2] = CL_add( y[1], y[5] ); move64(); t[3] = CL_sub( y[1], y[5] ); move64(); t[4] = CL_add( y[2], y[6] ); move64(); t[5] = CL_sub( y[2], y[6] ); move64(); t[6] = CL_add( y[3], y[7] ); move64(); t[7] = CL_sub( y[3], y[7] ); move64(); s[0] = CL_add( t[0], t[4] ); move64(); s[2] = CL_sub( t[0], t[4] ); move64(); s[4] = CL_mac_j( t[1], t[5] ); move64(); s[5] = CL_msu_j( t[1], t[5] ); move64(); s[1] = CL_add( t[2], t[6] ); move64(); s[3] = CL_swap_real_imag( CL_sub( CL_conjugate( t[2] ), CL_conjugate( t[6] ) ) ); move64(); t[0] = CL_swap_real_imag( CL_add( t[3], t[7] ) ); move64(); t[1] = CL_sub( t[3], t[7] ); move64(); s[6] = CL_scale( CL_add( CL_conjugate( t[0] ), t[1] ), FFT_C81 ); // Qx move64(); s[7] = CL_scale( CL_sub( t[0], CL_conjugate( t[1] ) ), FFT_C81 ); // Qx move64(); s[7] = CL_conjugate( s[7] ); move64(); x[i] = CL_add( s[0], s[1] ); move64(); x[( i + ( 1 * dim1 ) )] = CL_add( s[5], s[6] ); move64(); x[( i + ( 2 * dim1 ) )] = CL_sub( s[2], s[3] ); move64(); x[( i + ( 3 * dim1 ) )] = CL_add( s[4], s[7] ); move64(); x[( i + ( 4 * dim1 ) )] = CL_sub( s[0], s[1] ); move64(); x[( i + ( 5 * dim1 ) )] = CL_sub( s[5], s[6] ); move64(); x[( i + ( 6 * dim1 ) )] = CL_add( s[2], s[3] ); move64(); x[( i + ( 7 * dim1 ) )] = CL_sub( s[4], s[7] ); move64(); } } ELSE { FOR( i = 0; i < dim1; i++ ) { { y[0] = xx[i]; move64(); }; IF( i > 0 ) { { y[1] = CL_mac_j( CL_scale( xx[( i + ( 1 * dim1 ) )], W[( ( ( sc * i ) + ( ( ( sc * 1 ) * dim1 ) << 1 ) ) - Woff )] ), CL_scale( xx[( i + ( 1 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( ( sc * 1 ) * dim1 ) << 1 ) ) + 1 ) - Woff )] ) ); // Qx move64(); }; { y[2] = CL_mac_j( CL_scale( xx[( i + ( 2 * dim1 ) )], W[( ( ( sc * i ) + ( ( ( sc * 2 ) * dim1 ) << 1 ) ) - Woff )] ), CL_scale( xx[( i + ( 2 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( ( sc * 2 ) * dim1 ) << 1 ) ) + 1 ) - Woff )] ) ); // Qx move64(); }; { y[3] = CL_mac_j( CL_scale( xx[( i + ( 3 * dim1 ) )], W[( ( ( sc * i ) + ( ( ( sc * 3 ) * dim1 ) << 1 ) ) - Woff )] ), CL_scale( xx[( i + ( 3 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( ( sc * 3 ) * dim1 ) << 1 ) ) + 1 ) - Woff )] ) ); // Qx move64(); }; { y[4] = CL_mac_j( CL_scale( xx[( i + ( 4 * dim1 ) )], W[( ( ( sc * i ) + ( ( ( sc * 4 ) * dim1 ) << 1 ) ) - Woff )] ), CL_scale( xx[( i + ( 4 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( ( sc * 4 ) * dim1 ) << 1 ) ) + 1 ) - Woff )] ) ); // Qx move64(); }; { y[5] = CL_mac_j( CL_scale( xx[( i + ( 5 * dim1 ) )], W[( ( ( sc * i ) + ( ( ( sc * 5 ) * dim1 ) << 1 ) ) - Woff )] ), CL_scale( xx[( i + ( 5 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( ( sc * 5 ) * dim1 ) << 1 ) ) + 1 ) - Woff )] ) ); // Qx move64(); }; { y[6] = CL_mac_j( CL_scale( xx[( i + ( 6 * dim1 ) )], W[( ( ( sc * i ) + ( ( ( sc * 6 ) * dim1 ) << 1 ) ) - Woff )] ), CL_scale( xx[( i + ( 6 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( ( sc * 6 ) * dim1 ) << 1 ) ) + 1 ) - Woff )] ) ); // Qx move64(); }; { y[7] = CL_mac_j( CL_scale( xx[( i + ( 7 * dim1 ) )], W[( ( ( sc * i ) + ( ( ( sc * 7 ) * dim1 ) << 1 ) ) - Woff )] ), CL_scale( xx[( i + ( 7 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( ( sc * 7 ) * dim1 ) << 1 ) ) + 1 ) - Woff )] ) ); // Qx move64(); }; } t[0] = CL_add( y[0], y[4] ); move64(); t[1] = CL_sub( y[0], y[4] ); move64(); t[2] = CL_add( y[1], y[5] ); move64(); t[3] = CL_sub( y[1], y[5] ); move64(); t[4] = CL_add( y[2], y[6] ); move64(); t[5] = CL_sub( y[2], y[6] ); move64(); t[6] = CL_add( y[3], y[7] ); move64(); t[7] = CL_sub( y[3], y[7] ); move64(); s[0] = CL_add( t[0], t[4] ); move64(); s[2] = CL_sub( t[0], t[4] ); move64(); s[4] = CL_mac_j( t[1], t[5] ); move64(); s[5] = CL_msu_j( t[1], t[5] ); move64(); s[1] = CL_add( t[2], t[6] ); move64(); s[3] = CL_swap_real_imag( CL_sub( CL_conjugate( t[2] ), CL_conjugate( t[6] ) ) ); move64(); t[0] = CL_swap_real_imag( CL_add( t[3], t[7] ) ); move64(); t[1] = CL_sub( t[3], t[7] ); move64(); s[6] = CL_scale( CL_add( CL_conjugate( t[0] ), t[1] ), FFT_C81 ); // Qx move64(); s[7] = CL_scale( CL_sub( t[0], CL_conjugate( t[1] ) ), FFT_C81 ); // Qx move64(); s[7] = CL_conjugate( s[7] ); move64(); x[i] = CL_add( s[0], s[1] ); move64(); x[( i + ( 1 * dim1 ) )] = CL_add( s[5], s[6] ); move64(); x[( i + ( 2 * dim1 ) )] = CL_sub( s[2], s[3] ); move64(); x[( i + ( 3 * dim1 ) )] = CL_add( s[4], s[7] ); move64(); x[( i + ( 4 * dim1 ) )] = CL_sub( s[0], s[1] ); move64(); x[( i + ( 5 * dim1 ) )] = CL_sub( s[5], s[6] ); move64(); x[( i + ( 6 * dim1 ) )] = CL_add( s[2], s[3] ); move64(); x[( i + ( 7 * dim1 ) )] = CL_sub( s[4], s[7] ); move64(); } } #else /* OPT_STEREO_32KBPS_V1 */ test(); test(); test(); Loading Loading @@ -6781,6 +7110,7 @@ static void fft_lenN( move64(); } } #endif /* OPT_STEREO_32KBPS_V1 */ BREAK; } Loading Loading @@ -7173,7 +7503,11 @@ void rfft_fx( move32(); x[( length - ( i << 1 ) )] = Mpy_32_16_1( L_add( t1, t3 ), 16384 /*0.5.Q15*/ ); move32(); #ifdef OPT_STEREO_32KBPS_V1 x[( ( length - ( i << 1 ) ) + 1 )] = Mpy_32_16_1( L_add( t2, t4 ), -16384 /*0.5.Q15*/ ); #else /* OPT_STEREO_32KBPS_V1 */ x[( ( length - ( i << 1 ) ) + 1 )] = Mpy_32_16_1( L_negate( L_add( t2, t4 ) ), 16384 /*0.5.Q15*/ ); #endif /* OPT_STEREO_32KBPS_V1 */ move32(); } Loading lib_com/hp50_fx.c +66 −0 Original line number Diff line number Diff line Loading @@ -469,8 +469,14 @@ void hp20_fx_32( { Word16 i; Word32 a1_fx, a2_fx, b1_fx, b2_fx; #ifdef OPT_STEREO_32KBPS_V1 Word16 Qy1, Qy2, Qmin; Word64 y0_fx64, y1_fx64, y2_fx64; Word32 x0, x1, x2; #else /* OPT_STEREO_32KBPS_V1 */ Word16 Qx0, Qx1, Qx2, Qy1, Qprev_y1, Qy2, Qprev_y2, Qmin; Word64 x0_fx64, x1_fx64, x2_fx64, y0_fx64, y1_fx64, y2_fx64, R1, R2, R3, R4, R5; #endif /* OPT_STEREO_32KBPS_V1 */ IF( EQ_32( Fs, 8000 ) ) { Loading Loading @@ -521,15 +527,64 @@ void hp20_fx_32( move32(); move32(); #ifdef OPT_STEREO_32KBPS_V1 y1_fx64 = W_add( W_deposit32_l( mem_fx[0] ), W_deposit32_h( mem_fx[1] ) ); y2_fx64 = W_add( W_deposit32_l( mem_fx[2] ), W_deposit32_h( mem_fx[3] ) ); x0 = mem_fx[4]; move32(); x1 = mem_fx[5]; move32(); #else /* OPT_STEREO_32KBPS_V1 */ Qprev_y1 = extract_l( mem_fx[4] ); Qprev_y2 = extract_l( mem_fx[5] ); y1_fx64 = W_deposit32_l( mem_fx[0] ); y2_fx64 = W_deposit32_l( mem_fx[1] ); x0_fx64 = W_deposit32_l( mem_fx[2] ); x1_fx64 = W_deposit32_l( mem_fx[3] ); #endif /* OPT_STEREO_32KBPS_V1 */ FOR( i = 0; i < lg; i++ ) { #ifdef OPT_STEREO_32KBPS_V1 x2 = x1; move32(); x1 = x0; move32(); x0 = signal_fx[i]; move32(); Qy1 = W_norm( y1_fx64 ); if ( y1_fx64 == 0 ) { Qy1 = 62; move16(); } Qy2 = W_norm( y2_fx64 ); if ( y2_fx64 == 0 ) { Qy2 = 62; move16(); } Qmin = s_min( Qy1, Qy2 ); Qmin = sub( Qmin, 34 ); y0_fx64 = W_mac_32_32( W_mult_32_32( W_shl_sat_l( y1_fx64, Qmin ), a1_fx ), W_shl_sat_l( y2_fx64, Qmin ), a2_fx ); // Qmin + Q29 + Q30 + 1 Word64 temp = W_mac_32_32( W_mac_32_32( W_mult_32_32( x2, b2_fx ), x1, b1_fx ), x0, b2_fx ); // Q30 Word64 y0_fx = W_shr( y0_fx64, add( Qmin, Q30 ) ); // Q30 y0_fx64 = W_add( temp, y0_fx ); // Q30 signal_fx[i] = W_shl_sat_l( y0_fx64, -Q30 ); move32(); y2_fx64 = y1_fx64; move64(); y1_fx64 = y0_fx64; move64(); #else /* OPT_STEREO_32KBPS_V1 */ x2_fx64 = x1_fx64; move64(); x1_fx64 = x0_fx64; Loading Loading @@ -611,8 +666,17 @@ void hp20_fx_32( move64(); move16(); move16(); #endif /* OPT_STEREO_32KBPS_V1 */ } #ifdef OPT_STEREO_32KBPS_V1 mem_fx[0] = W_extract_l( y1_fx64 ); mem_fx[1] = W_extract_h( y1_fx64 ); mem_fx[2] = W_extract_l( y2_fx64 ); mem_fx[3] = W_extract_h( y2_fx64 ); mem_fx[4] = x0; mem_fx[5] = x1; #else /* OPT_STEREO_32KBPS_V1 */ Qy1 = W_norm( y1_fx64 ); test(); IF( y1_fx64 != 0 && LT_16( Qy1, 32 ) ) Loading @@ -635,6 +699,8 @@ void hp20_fx_32( mem_fx[3] = W_extract_l( x1_fx64 ); mem_fx[4] = Qprev_y1; mem_fx[5] = Qprev_y2; #endif /* OPT_STEREO_32KBPS_V1 */ move32(); move32(); move32(); Loading lib_com/modif_fs.c +94 −0 File changed.Preview size limit exceeded, changes collapsed. Show changes lib_com/mslvq_com_fx.c +50 −0 Original line number Diff line number Diff line Loading @@ -122,9 +122,33 @@ void init_lvq_fx( ) { Word16 i, j; #ifdef OPT_STEREO_32KBPS_V1 Word16 k; #endif /* OPT_STEREO_32KBPS_V1 */ /* safety-net mode */ FOR( i = 0; i < MAX_NO_MODES; i++ ) { #ifdef OPT_STEREO_32KBPS_V1 FOR( ( j = 0, k = 0 ); j < MAX_NO_SCALES; ( j++, k++ ) ) { if ( ( no_lead_fx[i][j] <= 0 ) ) { j = MAX_NO_SCALES; } } no_scales[i][0] = k; move16(); FOR( k = 0; j < MAX_NO_SCALES << 1; ( j++, k++ ) ) { if ( no_lead_fx[i][j] <= 0 ) { j = MAX_NO_SCALES << 1; } } no_scales[i][1] = k; move16(); #else /* OPT_STEREO_32KBPS_V1 */ j = 0; move16(); test(); Loading @@ -143,10 +167,35 @@ void init_lvq_fx( } no_scales[i][1] = sub( j, MAX_NO_SCALES ); move16(); #endif /* OPT_STEREO_32KBPS_V1 */ } /* predictive mode */ FOR( i = 0; i < MAX_NO_MODES_p; i++ ) { #ifdef OPT_STEREO_32KBPS_V1 FOR( ( j = 0, k = 0 ); j < MAX_NO_SCALES; ( j++, k++ ) ) { if ( ( no_lead_p_fx[i][j] <= 0 ) ) { j = MAX_NO_SCALES; } } no_scales_p[i][0] = k; move16(); FOR( k = 0; j < MAX_NO_SCALES << 1; ( j++, k++ ) ) { if ( ( no_lead_p_fx[i][j] <= 0 ) ) { j = MAX_NO_SCALES << 1; } } no_scales_p[i][1] = k; move16(); #else /* OPT_STEREO_32KBPS_V1 */ j = 0; move16(); WHILE( ( LT_16( j, MAX_NO_SCALES ) ) && ( no_lead_p_fx[i][j] > 0 ) ) Loading @@ -165,6 +214,7 @@ void init_lvq_fx( } no_scales_p[i][1] = sub( j, MAX_NO_SCALES ); move16(); #endif /* OPT_STEREO_32KBPS_V1 */ } /* index offsets for each truncation */ init_offset_fx( offset_scale1, offset_scale2, offset_scale1_p, offset_scale2_p, no_scales, no_scales_p ); Loading lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -172,4 +172,5 @@ #define FIX_1301_CORRECT_TD_CNST /* VA: Fix 1301, correct wrong constant in TD stereo */ #define NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD /* VA/Eri: FLP issue 1277: Fix Mismatch in DTX high-rate threshold between EVS float and BASOP */ #define NONBE_FIX_708_OSBA_BR_SWITCHING_CRASH /* FhG: issue 708: fix crash in OSBA BR switching with long test vectors */ //#define OPT_STEREO_32KBPS_V1 /* Optimization made in stereo decoding path for 32kbps decoding */ #endif Loading
lib_com/fft_fx.c +334 −0 Original line number Diff line number Diff line Loading @@ -4727,6 +4727,16 @@ static void fft_len16( cmplx t[4]; cmplx y[16]; #ifdef OPT_STEREO_32KBPS_V1 s[0] = x[0]; // Qx move64(); s[1] = x[4]; // Qx move64(); s[2] = x[8]; // Qx move64(); s[3] = x[12]; // Qx move64(); #else /* OPT_STEREO_32KBPS_V1 */ s[0] = CL_shr( x[0], SCALEFACTOR16 ); // Qx move64(); s[1] = CL_shr( x[4], SCALEFACTOR16 ); // Qx Loading @@ -4735,6 +4745,7 @@ static void fft_len16( move64(); s[3] = CL_shr( x[12], SCALEFACTOR16 ); // Qx move64(); #endif /* OPT_STEREO_32KBPS_V1 */ t[0] = CL_add( s[0], s[2] ); move64(); Loading @@ -4754,6 +4765,16 @@ static void fft_len16( y[3] = CL_add( t[1], t[3] ); move64(); #ifdef OPT_STEREO_32KBPS_V1 s[0] = x[1]; // Qx move64(); s[1] = x[5]; // Qx move64(); s[2] = x[9]; // Qx move64(); s[3] = x[13]; // Qx move64(); #else /* OPT_STEREO_32KBPS_V1 */ s[0] = CL_shr( x[1], SCALEFACTOR16 ); // Qx move64(); s[1] = CL_shr( x[5], SCALEFACTOR16 ); // Qx Loading @@ -4762,6 +4783,7 @@ static void fft_len16( move64(); s[3] = CL_shr( x[13], SCALEFACTOR16 ); // Qx move64(); #endif /* OPT_STEREO_32KBPS_V1 */ t[0] = CL_add( s[0], s[2] ); move64(); Loading @@ -4781,6 +4803,16 @@ static void fft_len16( y[7] = CL_add( t[1], t[3] ); move64(); #ifdef OPT_STEREO_32KBPS_V1 s[0] = x[2]; // Qx move64(); s[1] = x[6]; // Qx move64(); s[2] = x[10]; // Qx move64(); s[3] = x[14]; // Qx move64(); #else /* OPT_STEREO_32KBPS_V1 */ s[0] = CL_shr( x[2], SCALEFACTOR16 ); // Qx move64(); s[1] = CL_shr( x[6], SCALEFACTOR16 ); // Qx Loading @@ -4789,6 +4821,7 @@ static void fft_len16( move64(); s[3] = CL_shr( x[14], SCALEFACTOR16 ); // Qx move64(); #endif /* OPT_STEREO_32KBPS_V1 */ t[0] = CL_add( s[0], s[2] ); move64(); Loading @@ -4810,6 +4843,16 @@ static void fft_len16( y[11] = CL_add( t[1], t[3] ); move64(); #ifdef OPT_STEREO_32KBPS_V1 s[0] = x[3]; // Qx move64(); s[1] = x[7]; // Qx move64(); s[2] = x[11]; // Qx move64(); s[3] = x[15]; // Qx move64(); #else /* OPT_STEREO_32KBPS_V1 */ s[0] = CL_shr( x[3], SCALEFACTOR16 ); // Qx move64(); s[1] = CL_shr( x[7], SCALEFACTOR16 ); // Qx Loading @@ -4818,6 +4861,7 @@ static void fft_len16( move64(); s[3] = CL_shr( x[15], SCALEFACTOR16 ); // Qx move64(); #endif /* OPT_STEREO_32KBPS_V1 */ t[0] = CL_add( s[0], s[2] ); move64(); Loading Loading @@ -4978,6 +5022,18 @@ static void fft_len20_fx( cmplx tt[4]; cmplx y[20]; #ifdef OPT_STEREO_32KBPS_V1 xx[0] = x[0]; // Qx move64(); xx[1] = x[16]; // Qx move64(); xx[2] = x[12]; // Qx move64(); xx[3] = x[8]; // Qx move64(); xx[4] = x[4]; // Qx move64(); #else /* OPT_STEREO_32KBPS_V1 */ xx[0] = CL_shr( x[0], SCALEFACTOR20 ); // Qx move64(); xx[1] = CL_shr( x[16], SCALEFACTOR20 ); // Qx Loading @@ -4988,6 +5044,7 @@ static void fft_len20_fx( move64(); xx[4] = CL_shr( x[4], SCALEFACTOR20 ); // Qx move64(); #endif /* OPT_STEREO_32KBPS_V1 */ s[0] = CL_add( xx[1], xx[4] ); move64(); Loading Loading @@ -5023,6 +5080,18 @@ static void fft_len20_fx( y[12] = CL_msu_j( s[2], s[3] ); move64(); #ifdef OPT_STEREO_32KBPS_V1 xx[0] = x[5]; move64(); xx[1] = x[1]; move64(); xx[2] = x[17]; move64(); xx[3] = x[13]; move64(); xx[4] = x[9]; move64(); #else /* OPT_STEREO_32KBPS_V1 */ xx[0] = CL_shr( x[5], SCALEFACTOR20 ); move64(); xx[1] = CL_shr( x[1], SCALEFACTOR20 ); Loading @@ -5033,6 +5102,7 @@ static void fft_len20_fx( move64(); xx[4] = CL_shr( x[9], SCALEFACTOR20 ); move64(); #endif /* OPT_STEREO_32KBPS_V1 */ s[0] = CL_add( xx[1], xx[4] ); move64(); Loading Loading @@ -5068,6 +5138,18 @@ static void fft_len20_fx( y[13] = CL_msu_j( s[2], s[3] ); move64(); #ifdef OPT_STEREO_32KBPS_V1 xx[0] = x[10]; move64(); xx[1] = x[6]; move64(); xx[2] = x[2]; move64(); xx[3] = x[18]; move64(); xx[4] = x[14]; move64(); #else /* OPT_STEREO_32KBPS_V1 */ xx[0] = CL_shr( x[10], SCALEFACTOR20 ); move64(); xx[1] = CL_shr( x[6], SCALEFACTOR20 ); Loading @@ -5078,6 +5160,7 @@ static void fft_len20_fx( move64(); xx[4] = CL_shr( x[14], SCALEFACTOR20 ); move64(); #endif /* OPT_STEREO_32KBPS_V1 */ s[0] = CL_add( xx[1], xx[4] ); move64(); Loading Loading @@ -5113,6 +5196,18 @@ static void fft_len20_fx( y[14] = CL_msu_j( s[2], s[3] ); move64(); #ifdef OPT_STEREO_32KBPS_V1 xx[0] = x[15]; move64(); xx[1] = x[11]; move64(); xx[2] = x[7]; move64(); xx[3] = x[3]; move64(); xx[4] = x[19]; move64(); #else /* OPT_STEREO_32KBPS_V1 */ xx[0] = CL_shr( x[15], SCALEFACTOR20 ); move64(); xx[1] = CL_shr( x[11], SCALEFACTOR20 ); Loading @@ -5123,6 +5218,7 @@ static void fft_len20_fx( move64(); xx[4] = CL_shr( x[19], SCALEFACTOR20 ); move64(); #endif /* OPT_STEREO_32KBPS_V1 */ s[0] = CL_add( xx[1], xx[4] ); move64(); Loading Loading @@ -6501,6 +6597,239 @@ static void fft_lenN( cmplx s[8]; cmplx y[8]; #ifdef OPT_STEREO_32KBPS_V1 y[1] = xx[1 * dim1]; move64(); y[2] = xx[2 * dim1]; move64(); y[3] = xx[3 * dim1]; move64(); y[4] = xx[4 * dim1]; move64(); y[5] = xx[5 * dim1]; move64(); y[6] = xx[6 * dim1]; move64(); y[7] = xx[7 * dim1]; move64(); test(); test(); IF( EQ_16( dim1, 8 ) || EQ_16( dim1, 16 ) || EQ_16( dim1, 32 ) ) { FOR( i = 0; i < dim1; i++ ) { { y[0] = xx[i]; move64(); }; IF( i > 0 ) { { y[1] = CL_mac_j( CL_scale( xx[( i + ( 1 * dim1 ) )], W[( ( ( sc * i ) + ( ( sc * 1 ) * dim1 ) ) - Woff )] ), CL_scale( xx[( i + ( 1 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( sc * 1 ) * dim1 ) ) + 1 ) - Woff )] ) ); // Qx move64(); }; { y[2] = CL_mac_j( CL_scale( xx[( i + ( 2 * dim1 ) )], W[( ( ( sc * i ) + ( ( sc * 2 ) * dim1 ) ) - Woff )] ), CL_scale( xx[( i + ( 2 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( sc * 2 ) * dim1 ) ) + 1 ) - Woff )] ) ); // Qx move64(); }; { y[3] = CL_mac_j( CL_scale( xx[( i + ( 3 * dim1 ) )], W[( ( ( sc * i ) + ( ( sc * 3 ) * dim1 ) ) - Woff )] ), CL_scale( xx[( i + ( 3 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( sc * 3 ) * dim1 ) ) + 1 ) - Woff )] ) ); // Qx move64(); }; { y[4] = CL_mac_j( CL_scale( xx[( i + ( 4 * dim1 ) )], W[( ( ( sc * i ) + ( ( sc * 4 ) * dim1 ) ) - Woff )] ), CL_scale( xx[( i + ( 4 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( sc * 4 ) * dim1 ) ) + 1 ) - Woff )] ) ); // Qx move64(); }; { y[5] = CL_mac_j( CL_scale( xx[( i + ( 5 * dim1 ) )], W[( ( ( sc * i ) + ( ( sc * 5 ) * dim1 ) ) - Woff )] ), CL_scale( xx[( i + ( 5 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( sc * 5 ) * dim1 ) ) + 1 ) - Woff )] ) ); // Qx move64(); }; { y[6] = CL_mac_j( CL_scale( xx[( i + ( 6 * dim1 ) )], W[( ( ( sc * i ) + ( ( sc * 6 ) * dim1 ) ) - Woff )] ), CL_scale( xx[( i + ( 6 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( sc * 6 ) * dim1 ) ) + 1 ) - Woff )] ) ); // Qx move64(); }; { y[7] = CL_mac_j( CL_scale( xx[( i + ( 7 * dim1 ) )], W[( ( ( sc * i ) + ( ( sc * 7 ) * dim1 ) ) - Woff )] ), CL_scale( xx[( i + ( 7 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( sc * 7 ) * dim1 ) ) + 1 ) - Woff )] ) ); // Qx move64(); }; } t[0] = CL_add( y[0], y[4] ); move64(); t[1] = CL_sub( y[0], y[4] ); move64(); t[2] = CL_add( y[1], y[5] ); move64(); t[3] = CL_sub( y[1], y[5] ); move64(); t[4] = CL_add( y[2], y[6] ); move64(); t[5] = CL_sub( y[2], y[6] ); move64(); t[6] = CL_add( y[3], y[7] ); move64(); t[7] = CL_sub( y[3], y[7] ); move64(); s[0] = CL_add( t[0], t[4] ); move64(); s[2] = CL_sub( t[0], t[4] ); move64(); s[4] = CL_mac_j( t[1], t[5] ); move64(); s[5] = CL_msu_j( t[1], t[5] ); move64(); s[1] = CL_add( t[2], t[6] ); move64(); s[3] = CL_swap_real_imag( CL_sub( CL_conjugate( t[2] ), CL_conjugate( t[6] ) ) ); move64(); t[0] = CL_swap_real_imag( CL_add( t[3], t[7] ) ); move64(); t[1] = CL_sub( t[3], t[7] ); move64(); s[6] = CL_scale( CL_add( CL_conjugate( t[0] ), t[1] ), FFT_C81 ); // Qx move64(); s[7] = CL_scale( CL_sub( t[0], CL_conjugate( t[1] ) ), FFT_C81 ); // Qx move64(); s[7] = CL_conjugate( s[7] ); move64(); x[i] = CL_add( s[0], s[1] ); move64(); x[( i + ( 1 * dim1 ) )] = CL_add( s[5], s[6] ); move64(); x[( i + ( 2 * dim1 ) )] = CL_sub( s[2], s[3] ); move64(); x[( i + ( 3 * dim1 ) )] = CL_add( s[4], s[7] ); move64(); x[( i + ( 4 * dim1 ) )] = CL_sub( s[0], s[1] ); move64(); x[( i + ( 5 * dim1 ) )] = CL_sub( s[5], s[6] ); move64(); x[( i + ( 6 * dim1 ) )] = CL_add( s[2], s[3] ); move64(); x[( i + ( 7 * dim1 ) )] = CL_sub( s[4], s[7] ); move64(); } } ELSE { FOR( i = 0; i < dim1; i++ ) { { y[0] = xx[i]; move64(); }; IF( i > 0 ) { { y[1] = CL_mac_j( CL_scale( xx[( i + ( 1 * dim1 ) )], W[( ( ( sc * i ) + ( ( ( sc * 1 ) * dim1 ) << 1 ) ) - Woff )] ), CL_scale( xx[( i + ( 1 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( ( sc * 1 ) * dim1 ) << 1 ) ) + 1 ) - Woff )] ) ); // Qx move64(); }; { y[2] = CL_mac_j( CL_scale( xx[( i + ( 2 * dim1 ) )], W[( ( ( sc * i ) + ( ( ( sc * 2 ) * dim1 ) << 1 ) ) - Woff )] ), CL_scale( xx[( i + ( 2 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( ( sc * 2 ) * dim1 ) << 1 ) ) + 1 ) - Woff )] ) ); // Qx move64(); }; { y[3] = CL_mac_j( CL_scale( xx[( i + ( 3 * dim1 ) )], W[( ( ( sc * i ) + ( ( ( sc * 3 ) * dim1 ) << 1 ) ) - Woff )] ), CL_scale( xx[( i + ( 3 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( ( sc * 3 ) * dim1 ) << 1 ) ) + 1 ) - Woff )] ) ); // Qx move64(); }; { y[4] = CL_mac_j( CL_scale( xx[( i + ( 4 * dim1 ) )], W[( ( ( sc * i ) + ( ( ( sc * 4 ) * dim1 ) << 1 ) ) - Woff )] ), CL_scale( xx[( i + ( 4 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( ( sc * 4 ) * dim1 ) << 1 ) ) + 1 ) - Woff )] ) ); // Qx move64(); }; { y[5] = CL_mac_j( CL_scale( xx[( i + ( 5 * dim1 ) )], W[( ( ( sc * i ) + ( ( ( sc * 5 ) * dim1 ) << 1 ) ) - Woff )] ), CL_scale( xx[( i + ( 5 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( ( sc * 5 ) * dim1 ) << 1 ) ) + 1 ) - Woff )] ) ); // Qx move64(); }; { y[6] = CL_mac_j( CL_scale( xx[( i + ( 6 * dim1 ) )], W[( ( ( sc * i ) + ( ( ( sc * 6 ) * dim1 ) << 1 ) ) - Woff )] ), CL_scale( xx[( i + ( 6 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( ( sc * 6 ) * dim1 ) << 1 ) ) + 1 ) - Woff )] ) ); // Qx move64(); }; { y[7] = CL_mac_j( CL_scale( xx[( i + ( 7 * dim1 ) )], W[( ( ( sc * i ) + ( ( ( sc * 7 ) * dim1 ) << 1 ) ) - Woff )] ), CL_scale( xx[( i + ( 7 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( ( sc * 7 ) * dim1 ) << 1 ) ) + 1 ) - Woff )] ) ); // Qx move64(); }; } t[0] = CL_add( y[0], y[4] ); move64(); t[1] = CL_sub( y[0], y[4] ); move64(); t[2] = CL_add( y[1], y[5] ); move64(); t[3] = CL_sub( y[1], y[5] ); move64(); t[4] = CL_add( y[2], y[6] ); move64(); t[5] = CL_sub( y[2], y[6] ); move64(); t[6] = CL_add( y[3], y[7] ); move64(); t[7] = CL_sub( y[3], y[7] ); move64(); s[0] = CL_add( t[0], t[4] ); move64(); s[2] = CL_sub( t[0], t[4] ); move64(); s[4] = CL_mac_j( t[1], t[5] ); move64(); s[5] = CL_msu_j( t[1], t[5] ); move64(); s[1] = CL_add( t[2], t[6] ); move64(); s[3] = CL_swap_real_imag( CL_sub( CL_conjugate( t[2] ), CL_conjugate( t[6] ) ) ); move64(); t[0] = CL_swap_real_imag( CL_add( t[3], t[7] ) ); move64(); t[1] = CL_sub( t[3], t[7] ); move64(); s[6] = CL_scale( CL_add( CL_conjugate( t[0] ), t[1] ), FFT_C81 ); // Qx move64(); s[7] = CL_scale( CL_sub( t[0], CL_conjugate( t[1] ) ), FFT_C81 ); // Qx move64(); s[7] = CL_conjugate( s[7] ); move64(); x[i] = CL_add( s[0], s[1] ); move64(); x[( i + ( 1 * dim1 ) )] = CL_add( s[5], s[6] ); move64(); x[( i + ( 2 * dim1 ) )] = CL_sub( s[2], s[3] ); move64(); x[( i + ( 3 * dim1 ) )] = CL_add( s[4], s[7] ); move64(); x[( i + ( 4 * dim1 ) )] = CL_sub( s[0], s[1] ); move64(); x[( i + ( 5 * dim1 ) )] = CL_sub( s[5], s[6] ); move64(); x[( i + ( 6 * dim1 ) )] = CL_add( s[2], s[3] ); move64(); x[( i + ( 7 * dim1 ) )] = CL_sub( s[4], s[7] ); move64(); } } #else /* OPT_STEREO_32KBPS_V1 */ test(); test(); test(); Loading Loading @@ -6781,6 +7110,7 @@ static void fft_lenN( move64(); } } #endif /* OPT_STEREO_32KBPS_V1 */ BREAK; } Loading Loading @@ -7173,7 +7503,11 @@ void rfft_fx( move32(); x[( length - ( i << 1 ) )] = Mpy_32_16_1( L_add( t1, t3 ), 16384 /*0.5.Q15*/ ); move32(); #ifdef OPT_STEREO_32KBPS_V1 x[( ( length - ( i << 1 ) ) + 1 )] = Mpy_32_16_1( L_add( t2, t4 ), -16384 /*0.5.Q15*/ ); #else /* OPT_STEREO_32KBPS_V1 */ x[( ( length - ( i << 1 ) ) + 1 )] = Mpy_32_16_1( L_negate( L_add( t2, t4 ) ), 16384 /*0.5.Q15*/ ); #endif /* OPT_STEREO_32KBPS_V1 */ move32(); } Loading
lib_com/hp50_fx.c +66 −0 Original line number Diff line number Diff line Loading @@ -469,8 +469,14 @@ void hp20_fx_32( { Word16 i; Word32 a1_fx, a2_fx, b1_fx, b2_fx; #ifdef OPT_STEREO_32KBPS_V1 Word16 Qy1, Qy2, Qmin; Word64 y0_fx64, y1_fx64, y2_fx64; Word32 x0, x1, x2; #else /* OPT_STEREO_32KBPS_V1 */ Word16 Qx0, Qx1, Qx2, Qy1, Qprev_y1, Qy2, Qprev_y2, Qmin; Word64 x0_fx64, x1_fx64, x2_fx64, y0_fx64, y1_fx64, y2_fx64, R1, R2, R3, R4, R5; #endif /* OPT_STEREO_32KBPS_V1 */ IF( EQ_32( Fs, 8000 ) ) { Loading Loading @@ -521,15 +527,64 @@ void hp20_fx_32( move32(); move32(); #ifdef OPT_STEREO_32KBPS_V1 y1_fx64 = W_add( W_deposit32_l( mem_fx[0] ), W_deposit32_h( mem_fx[1] ) ); y2_fx64 = W_add( W_deposit32_l( mem_fx[2] ), W_deposit32_h( mem_fx[3] ) ); x0 = mem_fx[4]; move32(); x1 = mem_fx[5]; move32(); #else /* OPT_STEREO_32KBPS_V1 */ Qprev_y1 = extract_l( mem_fx[4] ); Qprev_y2 = extract_l( mem_fx[5] ); y1_fx64 = W_deposit32_l( mem_fx[0] ); y2_fx64 = W_deposit32_l( mem_fx[1] ); x0_fx64 = W_deposit32_l( mem_fx[2] ); x1_fx64 = W_deposit32_l( mem_fx[3] ); #endif /* OPT_STEREO_32KBPS_V1 */ FOR( i = 0; i < lg; i++ ) { #ifdef OPT_STEREO_32KBPS_V1 x2 = x1; move32(); x1 = x0; move32(); x0 = signal_fx[i]; move32(); Qy1 = W_norm( y1_fx64 ); if ( y1_fx64 == 0 ) { Qy1 = 62; move16(); } Qy2 = W_norm( y2_fx64 ); if ( y2_fx64 == 0 ) { Qy2 = 62; move16(); } Qmin = s_min( Qy1, Qy2 ); Qmin = sub( Qmin, 34 ); y0_fx64 = W_mac_32_32( W_mult_32_32( W_shl_sat_l( y1_fx64, Qmin ), a1_fx ), W_shl_sat_l( y2_fx64, Qmin ), a2_fx ); // Qmin + Q29 + Q30 + 1 Word64 temp = W_mac_32_32( W_mac_32_32( W_mult_32_32( x2, b2_fx ), x1, b1_fx ), x0, b2_fx ); // Q30 Word64 y0_fx = W_shr( y0_fx64, add( Qmin, Q30 ) ); // Q30 y0_fx64 = W_add( temp, y0_fx ); // Q30 signal_fx[i] = W_shl_sat_l( y0_fx64, -Q30 ); move32(); y2_fx64 = y1_fx64; move64(); y1_fx64 = y0_fx64; move64(); #else /* OPT_STEREO_32KBPS_V1 */ x2_fx64 = x1_fx64; move64(); x1_fx64 = x0_fx64; Loading Loading @@ -611,8 +666,17 @@ void hp20_fx_32( move64(); move16(); move16(); #endif /* OPT_STEREO_32KBPS_V1 */ } #ifdef OPT_STEREO_32KBPS_V1 mem_fx[0] = W_extract_l( y1_fx64 ); mem_fx[1] = W_extract_h( y1_fx64 ); mem_fx[2] = W_extract_l( y2_fx64 ); mem_fx[3] = W_extract_h( y2_fx64 ); mem_fx[4] = x0; mem_fx[5] = x1; #else /* OPT_STEREO_32KBPS_V1 */ Qy1 = W_norm( y1_fx64 ); test(); IF( y1_fx64 != 0 && LT_16( Qy1, 32 ) ) Loading @@ -635,6 +699,8 @@ void hp20_fx_32( mem_fx[3] = W_extract_l( x1_fx64 ); mem_fx[4] = Qprev_y1; mem_fx[5] = Qprev_y2; #endif /* OPT_STEREO_32KBPS_V1 */ move32(); move32(); move32(); Loading
lib_com/mslvq_com_fx.c +50 −0 Original line number Diff line number Diff line Loading @@ -122,9 +122,33 @@ void init_lvq_fx( ) { Word16 i, j; #ifdef OPT_STEREO_32KBPS_V1 Word16 k; #endif /* OPT_STEREO_32KBPS_V1 */ /* safety-net mode */ FOR( i = 0; i < MAX_NO_MODES; i++ ) { #ifdef OPT_STEREO_32KBPS_V1 FOR( ( j = 0, k = 0 ); j < MAX_NO_SCALES; ( j++, k++ ) ) { if ( ( no_lead_fx[i][j] <= 0 ) ) { j = MAX_NO_SCALES; } } no_scales[i][0] = k; move16(); FOR( k = 0; j < MAX_NO_SCALES << 1; ( j++, k++ ) ) { if ( no_lead_fx[i][j] <= 0 ) { j = MAX_NO_SCALES << 1; } } no_scales[i][1] = k; move16(); #else /* OPT_STEREO_32KBPS_V1 */ j = 0; move16(); test(); Loading @@ -143,10 +167,35 @@ void init_lvq_fx( } no_scales[i][1] = sub( j, MAX_NO_SCALES ); move16(); #endif /* OPT_STEREO_32KBPS_V1 */ } /* predictive mode */ FOR( i = 0; i < MAX_NO_MODES_p; i++ ) { #ifdef OPT_STEREO_32KBPS_V1 FOR( ( j = 0, k = 0 ); j < MAX_NO_SCALES; ( j++, k++ ) ) { if ( ( no_lead_p_fx[i][j] <= 0 ) ) { j = MAX_NO_SCALES; } } no_scales_p[i][0] = k; move16(); FOR( k = 0; j < MAX_NO_SCALES << 1; ( j++, k++ ) ) { if ( ( no_lead_p_fx[i][j] <= 0 ) ) { j = MAX_NO_SCALES << 1; } } no_scales_p[i][1] = k; move16(); #else /* OPT_STEREO_32KBPS_V1 */ j = 0; move16(); WHILE( ( LT_16( j, MAX_NO_SCALES ) ) && ( no_lead_p_fx[i][j] > 0 ) ) Loading @@ -165,6 +214,7 @@ void init_lvq_fx( } no_scales_p[i][1] = sub( j, MAX_NO_SCALES ); move16(); #endif /* OPT_STEREO_32KBPS_V1 */ } /* index offsets for each truncation */ init_offset_fx( offset_scale1, offset_scale2, offset_scale1_p, offset_scale2_p, no_scales, no_scales_p ); Loading
lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -172,4 +172,5 @@ #define FIX_1301_CORRECT_TD_CNST /* VA: Fix 1301, correct wrong constant in TD stereo */ #define NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD /* VA/Eri: FLP issue 1277: Fix Mismatch in DTX high-rate threshold between EVS float and BASOP */ #define NONBE_FIX_708_OSBA_BR_SWITCHING_CRASH /* FhG: issue 708: fix crash in OSBA BR switching with long test vectors */ //#define OPT_STEREO_32KBPS_V1 /* Optimization made in stereo decoding path for 32kbps decoding */ #endif