Loading lib_enc/tcx_utils_enc_fx.c +16 −9 Original line number Diff line number Diff line Loading @@ -1398,12 +1398,9 @@ void tcx_scalar_quantization_fx( tmp32 = L_shl_sat( L_deposit_h( gain ), tmp16 ); // exp:x_e #else tmp32 = L_shl( L_deposit_h( gain ), s_max( -31, s_min( tmp16, 0 ) ) ); tmp16 = negate( s_max( tmp16, 0 ) ); #endif // !FIX_BASOP_2551_HARM_SCALAR_QUAN #ifdef FIX_BASOP_2551_HARM_SCALAR_QUAN tmp16 = negate( s_max( tmp16, 0 ) ); #endif // FIX_BASOP_2551_HARM_SCALAR_QUAN i = sub( L_frame, 1 ); IF( memQuantZeros_fx != NULL ) { Loading Loading @@ -1440,9 +1437,10 @@ void tcx_scalar_quantization_fx( } #endif // FIX_BASOP_2551_HARM_SCALAR_QUAN #ifndef FIX_BASOP_2551_HARM_SCALAR_QUAN FOR( ; i >= 0; i-- ) { #ifndef FIX_BASOP_2551_HARM_SCALAR_QUAN offs32 = Mpy_32_16_1( x[i], gain ); offs32 = L_shl_sat( offs32, s ); /* convert to 15Q16 */ Loading @@ -1459,13 +1457,17 @@ void tcx_scalar_quantization_fx( } xq[i] = tmp16; move16(); } #else if ( EQ_16( element_mode, EVS_MONO ) ) IF( EQ_16( element_mode, EVS_MONO ) ) { FOR( ; i >= 0; i-- ) { offs32 = Mpy_32_16_1( L_abs( x[i] ), gain ); /* multiply */ offs32 = L_shl_sat( offs32, s ); /* convert to 15Q16 */ tmp16 = mac_r_sat( offs32, offset, 1 ); /* add offset and truncate */ IF( x[i] < 0 ) if ( x[i] < 0 ) { tmp16 = negate( tmp16 ); /* restore sign */ } Loading @@ -1473,13 +1475,17 @@ void tcx_scalar_quantization_fx( xq[i] = tmp16; move16(); } else } ELSE { FOR( ; i >= 0; i-- ) { offs32 = Mpy_32_16_1( x[i], gain ); offs32 = L_shl_sat( offs32, s ); /* convert to 15Q16 */ offs32_1 = L_add_sat( offs32, offset_Q16 ); /*15Q16 */ tmp16 = extract_h( offs32_1 ); IF( x[i] < 0 ) { offs32 = L_sub_sat( offs32, offset_Q16 ); /*15Q16 */ Loading @@ -1489,11 +1495,12 @@ void tcx_scalar_quantization_fx( tmp16 = add( tmp16, 1 ); } } xq[i] = tmp16; move16(); } #endif // !FIX_BASOP_2551_HARM_SCALAR_QUAN } #endif IF( alfe_flag == 0 ) { Loading Loading
lib_enc/tcx_utils_enc_fx.c +16 −9 Original line number Diff line number Diff line Loading @@ -1398,12 +1398,9 @@ void tcx_scalar_quantization_fx( tmp32 = L_shl_sat( L_deposit_h( gain ), tmp16 ); // exp:x_e #else tmp32 = L_shl( L_deposit_h( gain ), s_max( -31, s_min( tmp16, 0 ) ) ); tmp16 = negate( s_max( tmp16, 0 ) ); #endif // !FIX_BASOP_2551_HARM_SCALAR_QUAN #ifdef FIX_BASOP_2551_HARM_SCALAR_QUAN tmp16 = negate( s_max( tmp16, 0 ) ); #endif // FIX_BASOP_2551_HARM_SCALAR_QUAN i = sub( L_frame, 1 ); IF( memQuantZeros_fx != NULL ) { Loading Loading @@ -1440,9 +1437,10 @@ void tcx_scalar_quantization_fx( } #endif // FIX_BASOP_2551_HARM_SCALAR_QUAN #ifndef FIX_BASOP_2551_HARM_SCALAR_QUAN FOR( ; i >= 0; i-- ) { #ifndef FIX_BASOP_2551_HARM_SCALAR_QUAN offs32 = Mpy_32_16_1( x[i], gain ); offs32 = L_shl_sat( offs32, s ); /* convert to 15Q16 */ Loading @@ -1459,13 +1457,17 @@ void tcx_scalar_quantization_fx( } xq[i] = tmp16; move16(); } #else if ( EQ_16( element_mode, EVS_MONO ) ) IF( EQ_16( element_mode, EVS_MONO ) ) { FOR( ; i >= 0; i-- ) { offs32 = Mpy_32_16_1( L_abs( x[i] ), gain ); /* multiply */ offs32 = L_shl_sat( offs32, s ); /* convert to 15Q16 */ tmp16 = mac_r_sat( offs32, offset, 1 ); /* add offset and truncate */ IF( x[i] < 0 ) if ( x[i] < 0 ) { tmp16 = negate( tmp16 ); /* restore sign */ } Loading @@ -1473,13 +1475,17 @@ void tcx_scalar_quantization_fx( xq[i] = tmp16; move16(); } else } ELSE { FOR( ; i >= 0; i-- ) { offs32 = Mpy_32_16_1( x[i], gain ); offs32 = L_shl_sat( offs32, s ); /* convert to 15Q16 */ offs32_1 = L_add_sat( offs32, offset_Q16 ); /*15Q16 */ tmp16 = extract_h( offs32_1 ); IF( x[i] < 0 ) { offs32 = L_sub_sat( offs32, offset_Q16 ); /*15Q16 */ Loading @@ -1489,11 +1495,12 @@ void tcx_scalar_quantization_fx( tmp16 = add( tmp16, 1 ); } } xq[i] = tmp16; move16(); } #endif // !FIX_BASOP_2551_HARM_SCALAR_QUAN } #endif IF( alfe_flag == 0 ) { Loading