Commit 76a3d3fc authored by Linfeng Zhang's avatar Linfeng Zhang Committed by James Zern

Remove the unnecessary upcasts of (int)cospi_{1...31}_64

BUG=webm:1450

Change-Id: Ib046fe28caec5b9ebdc9d0152df7c54ff4266858
parent 64653fa1
......@@ -56,10 +56,10 @@ void vpx_fdct8x8_neon(const int16_t *input, tran_low_t *final_output,
v_t2_hi = vmlal_n_s16(v_t2_hi, vget_high_s16(v_x3), (int16_t)cospi_8_64);
v_t3_lo = vmlsl_n_s16(v_t3_lo, vget_low_s16(v_x2), (int16_t)cospi_8_64);
v_t3_hi = vmlsl_n_s16(v_t3_hi, vget_high_s16(v_x2), (int16_t)cospi_8_64);
v_t0_lo = vmulq_n_s32(v_t0_lo, (int32_t)cospi_16_64);
v_t0_hi = vmulq_n_s32(v_t0_hi, (int32_t)cospi_16_64);
v_t1_lo = vmulq_n_s32(v_t1_lo, (int32_t)cospi_16_64);
v_t1_hi = vmulq_n_s32(v_t1_hi, (int32_t)cospi_16_64);
v_t0_lo = vmulq_n_s32(v_t0_lo, cospi_16_64);
v_t0_hi = vmulq_n_s32(v_t0_hi, cospi_16_64);
v_t1_lo = vmulq_n_s32(v_t1_lo, cospi_16_64);
v_t1_hi = vmulq_n_s32(v_t1_hi, cospi_16_64);
{
const int16x4_t a = vrshrn_n_s32(v_t0_lo, DCT_CONST_BITS);
const int16x4_t b = vrshrn_n_s32(v_t0_hi, DCT_CONST_BITS);
......
......@@ -56,20 +56,20 @@ static INLINE void highbd_idct16_4col(__m128i *const io /*io[16]*/) {
__m128i step1[16], step2[16];
// stage 2
highbd_butterfly_sse2(io[1], io[15], (int)cospi_30_64, (int)cospi_2_64,
&step2[8], &step2[15]);
highbd_butterfly_sse2(io[9], io[7], (int)cospi_14_64, (int)cospi_18_64,
&step2[9], &step2[14]);
highbd_butterfly_sse2(io[5], io[11], (int)cospi_22_64, (int)cospi_10_64,
&step2[10], &step2[13]);
highbd_butterfly_sse2(io[13], io[3], (int)cospi_6_64, (int)cospi_26_64,
&step2[11], &step2[12]);
highbd_butterfly_sse2(io[1], io[15], cospi_30_64, cospi_2_64, &step2[8],
&step2[15]);
highbd_butterfly_sse2(io[9], io[7], cospi_14_64, cospi_18_64, &step2[9],
&step2[14]);
highbd_butterfly_sse2(io[5], io[11], cospi_22_64, cospi_10_64, &step2[10],
&step2[13]);
highbd_butterfly_sse2(io[13], io[3], cospi_6_64, cospi_26_64, &step2[11],
&step2[12]);
// stage 3
highbd_butterfly_sse2(io[2], io[14], (int)cospi_28_64, (int)cospi_4_64,
&step1[4], &step1[7]);
highbd_butterfly_sse2(io[10], io[6], (int)cospi_12_64, (int)cospi_20_64,
&step1[5], &step1[6]);
highbd_butterfly_sse2(io[2], io[14], cospi_28_64, cospi_4_64, &step1[4],
&step1[7]);
highbd_butterfly_sse2(io[10], io[6], cospi_12_64, cospi_20_64, &step1[5],
&step1[6]);
step1[8] = _mm_add_epi32(step2[8], step2[9]);
step1[9] = _mm_sub_epi32(step2[8], step2[9]);
step1[10] = _mm_sub_epi32(step2[10], step2[11]); // step1[10] = -step1[10]
......@@ -81,11 +81,11 @@ static INLINE void highbd_idct16_4col(__m128i *const io /*io[16]*/) {
// stage 4
highbd_butterfly_cospi16_sse2(io[0], io[8], &step2[0], &step2[1]);
highbd_butterfly_sse2(io[4], io[12], (int)cospi_24_64, (int)cospi_8_64,
&step2[2], &step2[3]);
highbd_butterfly_sse2(step1[14], step1[9], (int)cospi_24_64, (int)cospi_8_64,
&step2[9], &step2[14]);
highbd_butterfly_sse2(step1[10], step1[13], (int)cospi_8_64, (int)cospi_24_64,
highbd_butterfly_sse2(io[4], io[12], cospi_24_64, cospi_8_64, &step2[2],
&step2[3]);
highbd_butterfly_sse2(step1[14], step1[9], cospi_24_64, cospi_8_64, &step2[9],
&step2[14]);
highbd_butterfly_sse2(step1[10], step1[13], cospi_8_64, cospi_24_64,
&step2[13], &step2[10]);
step2[5] = _mm_sub_epi32(step1[4], step1[5]);
step1[4] = _mm_add_epi32(step1[4], step1[5]);
......@@ -106,20 +106,20 @@ static INLINE void highbd_idct16x16_38_4col(__m128i *const io /*io[16]*/) {
__m128i temp1[2], sign[2];
// stage 2
highbd_partial_butterfly_sse2(io[1], (int)cospi_30_64, (int)cospi_2_64,
&step2[8], &step2[15]);
highbd_partial_butterfly_neg_sse2(io[7], (int)cospi_14_64, (int)cospi_18_64,
&step2[9], &step2[14]);
highbd_partial_butterfly_sse2(io[5], (int)cospi_22_64, (int)cospi_10_64,
&step2[10], &step2[13]);
highbd_partial_butterfly_neg_sse2(io[3], (int)cospi_6_64, (int)cospi_26_64,
&step2[11], &step2[12]);
highbd_partial_butterfly_sse2(io[1], cospi_30_64, cospi_2_64, &step2[8],
&step2[15]);
highbd_partial_butterfly_neg_sse2(io[7], cospi_14_64, cospi_18_64, &step2[9],
&step2[14]);
highbd_partial_butterfly_sse2(io[5], cospi_22_64, cospi_10_64, &step2[10],
&step2[13]);
highbd_partial_butterfly_neg_sse2(io[3], cospi_6_64, cospi_26_64, &step2[11],
&step2[12]);
// stage 3
highbd_partial_butterfly_sse2(io[2], (int)cospi_28_64, (int)cospi_4_64,
&step1[4], &step1[7]);
highbd_partial_butterfly_neg_sse2(io[6], (int)cospi_12_64, (int)cospi_20_64,
&step1[5], &step1[6]);
highbd_partial_butterfly_sse2(io[2], cospi_28_64, cospi_4_64, &step1[4],
&step1[7]);
highbd_partial_butterfly_neg_sse2(io[6], cospi_12_64, cospi_20_64, &step1[5],
&step1[6]);
step1[8] = _mm_add_epi32(step2[8], step2[9]);
step1[9] = _mm_sub_epi32(step2[8], step2[9]);
step1[10] = _mm_sub_epi32(step2[10], step2[11]); // step1[10] = -step1[10]
......@@ -131,13 +131,13 @@ static INLINE void highbd_idct16x16_38_4col(__m128i *const io /*io[16]*/) {
// stage 4
abs_extend_64bit_sse2(io[0], temp1, sign);
step2[0] = multiplication_round_shift_sse2(temp1, sign, (int)cospi_16_64);
step2[0] = multiplication_round_shift_sse2(temp1, sign, cospi_16_64);
step2[1] = step2[0];
highbd_partial_butterfly_sse2(io[4], (int)cospi_24_64, (int)cospi_8_64,
&step2[2], &step2[3]);
highbd_butterfly_sse2(step1[14], step1[9], (int)cospi_24_64, (int)cospi_8_64,
&step2[9], &step2[14]);
highbd_butterfly_sse2(step1[10], step1[13], (int)cospi_8_64, (int)cospi_24_64,
highbd_partial_butterfly_sse2(io[4], cospi_24_64, cospi_8_64, &step2[2],
&step2[3]);
highbd_butterfly_sse2(step1[14], step1[9], cospi_24_64, cospi_8_64, &step2[9],
&step2[14]);
highbd_butterfly_sse2(step1[10], step1[13], cospi_8_64, cospi_24_64,
&step2[13], &step2[10]);
step2[5] = _mm_sub_epi32(step1[4], step1[5]);
step1[4] = _mm_add_epi32(step1[4], step1[5]);
......@@ -158,14 +158,14 @@ static INLINE void highbd_idct16x16_10_4col(__m128i *const io /*io[16]*/) {
__m128i temp[2], sign[2];
// stage 2
highbd_partial_butterfly_sse2(io[1], (int)cospi_30_64, (int)cospi_2_64,
&step2[8], &step2[15]);
highbd_partial_butterfly_neg_sse2(io[3], (int)cospi_6_64, (int)cospi_26_64,
&step2[11], &step2[12]);
highbd_partial_butterfly_sse2(io[1], cospi_30_64, cospi_2_64, &step2[8],
&step2[15]);
highbd_partial_butterfly_neg_sse2(io[3], cospi_6_64, cospi_26_64, &step2[11],
&step2[12]);
// stage 3
highbd_partial_butterfly_sse2(io[2], (int)cospi_28_64, (int)cospi_4_64,
&step1[4], &step1[7]);
highbd_partial_butterfly_sse2(io[2], cospi_28_64, cospi_4_64, &step1[4],
&step1[7]);
step1[8] = step2[8];
step1[9] = step2[8];
step1[10] =
......@@ -179,13 +179,13 @@ static INLINE void highbd_idct16x16_10_4col(__m128i *const io /*io[16]*/) {
// stage 4
abs_extend_64bit_sse2(io[0], temp, sign);
step2[0] = multiplication_round_shift_sse2(temp, sign, (int)cospi_16_64);
step2[0] = multiplication_round_shift_sse2(temp, sign, cospi_16_64);
step2[1] = step2[0];
step2[2] = _mm_setzero_si128();
step2[3] = _mm_setzero_si128();
highbd_butterfly_sse2(step1[14], step1[9], (int)cospi_24_64, (int)cospi_8_64,
&step2[9], &step2[14]);
highbd_butterfly_sse2(step1[10], step1[13], (int)cospi_8_64, (int)cospi_24_64,
highbd_butterfly_sse2(step1[14], step1[9], cospi_24_64, cospi_8_64, &step2[9],
&step2[14]);
highbd_butterfly_sse2(step1[10], step1[13], cospi_8_64, cospi_24_64,
&step2[13], &step2[10]);
step2[5] = step1[4];
step2[6] = step1[7];
......
......@@ -57,20 +57,20 @@ static INLINE void highbd_idct16_4col(__m128i *const io /*io[16]*/) {
__m128i step1[16], step2[16];
// stage 2
highbd_butterfly_sse4_1(io[1], io[15], (int)cospi_30_64, (int)cospi_2_64,
&step2[8], &step2[15]);
highbd_butterfly_sse4_1(io[9], io[7], (int)cospi_14_64, (int)cospi_18_64,
&step2[9], &step2[14]);
highbd_butterfly_sse4_1(io[5], io[11], (int)cospi_22_64, (int)cospi_10_64,
&step2[10], &step2[13]);
highbd_butterfly_sse4_1(io[13], io[3], (int)cospi_6_64, (int)cospi_26_64,
&step2[11], &step2[12]);
highbd_butterfly_sse4_1(io[1], io[15], cospi_30_64, cospi_2_64, &step2[8],
&step2[15]);
highbd_butterfly_sse4_1(io[9], io[7], cospi_14_64, cospi_18_64, &step2[9],
&step2[14]);
highbd_butterfly_sse4_1(io[5], io[11], cospi_22_64, cospi_10_64, &step2[10],
&step2[13]);
highbd_butterfly_sse4_1(io[13], io[3], cospi_6_64, cospi_26_64, &step2[11],
&step2[12]);
// stage 3
highbd_butterfly_sse4_1(io[2], io[14], (int)cospi_28_64, (int)cospi_4_64,
&step1[4], &step1[7]);
highbd_butterfly_sse4_1(io[10], io[6], (int)cospi_12_64, (int)cospi_20_64,
&step1[5], &step1[6]);
highbd_butterfly_sse4_1(io[2], io[14], cospi_28_64, cospi_4_64, &step1[4],
&step1[7]);
highbd_butterfly_sse4_1(io[10], io[6], cospi_12_64, cospi_20_64, &step1[5],
&step1[6]);
step1[8] = _mm_add_epi32(step2[8], step2[9]);
step1[9] = _mm_sub_epi32(step2[8], step2[9]);
step1[10] = _mm_sub_epi32(step2[11], step2[10]);
......@@ -82,12 +82,12 @@ static INLINE void highbd_idct16_4col(__m128i *const io /*io[16]*/) {
// stage 4
highbd_butterfly_cospi16_sse4_1(io[0], io[8], &step2[0], &step2[1]);
highbd_butterfly_sse4_1(io[4], io[12], (int)cospi_24_64, (int)cospi_8_64,
&step2[2], &step2[3]);
highbd_butterfly_sse4_1(step1[14], step1[9], (int)cospi_24_64,
(int)cospi_8_64, &step2[9], &step2[14]);
highbd_butterfly_sse4_1(step1[10], step1[13], -(int)cospi_8_64,
-(int)cospi_24_64, &step2[13], &step2[10]);
highbd_butterfly_sse4_1(io[4], io[12], cospi_24_64, cospi_8_64, &step2[2],
&step2[3]);
highbd_butterfly_sse4_1(step1[14], step1[9], cospi_24_64, cospi_8_64,
&step2[9], &step2[14]);
highbd_butterfly_sse4_1(step1[10], step1[13], -cospi_8_64, -cospi_24_64,
&step2[13], &step2[10]);
step2[5] = _mm_sub_epi32(step1[4], step1[5]);
step1[4] = _mm_add_epi32(step1[4], step1[5]);
step2[6] = _mm_sub_epi32(step1[7], step1[6]);
......@@ -107,20 +107,20 @@ static INLINE void highbd_idct16x16_38_4col(__m128i *const io /*io[16]*/) {
__m128i temp1[2];
// stage 2
highbd_partial_butterfly_sse4_1(io[1], (int)cospi_30_64, (int)cospi_2_64,
&step2[8], &step2[15]);
highbd_partial_butterfly_sse4_1(io[7], -(int)cospi_18_64, (int)cospi_14_64,
&step2[9], &step2[14]);
highbd_partial_butterfly_sse4_1(io[5], (int)cospi_22_64, (int)cospi_10_64,
&step2[10], &step2[13]);
highbd_partial_butterfly_sse4_1(io[3], -(int)cospi_26_64, (int)cospi_6_64,
&step2[11], &step2[12]);
highbd_partial_butterfly_sse4_1(io[1], cospi_30_64, cospi_2_64, &step2[8],
&step2[15]);
highbd_partial_butterfly_sse4_1(io[7], -cospi_18_64, cospi_14_64, &step2[9],
&step2[14]);
highbd_partial_butterfly_sse4_1(io[5], cospi_22_64, cospi_10_64, &step2[10],
&step2[13]);
highbd_partial_butterfly_sse4_1(io[3], -cospi_26_64, cospi_6_64, &step2[11],
&step2[12]);
// stage 3
highbd_partial_butterfly_sse4_1(io[2], (int)cospi_28_64, (int)cospi_4_64,
&step1[4], &step1[7]);
highbd_partial_butterfly_sse4_1(io[6], -(int)cospi_20_64, (int)cospi_12_64,
&step1[5], &step1[6]);
highbd_partial_butterfly_sse4_1(io[2], cospi_28_64, cospi_4_64, &step1[4],
&step1[7]);
highbd_partial_butterfly_sse4_1(io[6], -cospi_20_64, cospi_12_64, &step1[5],
&step1[6]);
step1[8] = _mm_add_epi32(step2[8], step2[9]);
step1[9] = _mm_sub_epi32(step2[8], step2[9]);
step1[10] = _mm_sub_epi32(step2[11], step2[10]);
......@@ -132,14 +132,14 @@ static INLINE void highbd_idct16x16_38_4col(__m128i *const io /*io[16]*/) {
// stage 4
extend_64bit(io[0], temp1);
step2[0] = multiplication_round_shift_sse4_1(temp1, (int)cospi_16_64);
step2[0] = multiplication_round_shift_sse4_1(temp1, cospi_16_64);
step2[1] = step2[0];
highbd_partial_butterfly_sse4_1(io[4], (int)cospi_24_64, (int)cospi_8_64,
&step2[2], &step2[3]);
highbd_butterfly_sse4_1(step1[14], step1[9], (int)cospi_24_64,
(int)cospi_8_64, &step2[9], &step2[14]);
highbd_butterfly_sse4_1(step1[10], step1[13], -(int)cospi_8_64,
-(int)cospi_24_64, &step2[13], &step2[10]);
highbd_partial_butterfly_sse4_1(io[4], cospi_24_64, cospi_8_64, &step2[2],
&step2[3]);
highbd_butterfly_sse4_1(step1[14], step1[9], cospi_24_64, cospi_8_64,
&step2[9], &step2[14]);
highbd_butterfly_sse4_1(step1[10], step1[13], -cospi_8_64, -cospi_24_64,
&step2[13], &step2[10]);
step2[5] = _mm_sub_epi32(step1[4], step1[5]);
step1[4] = _mm_add_epi32(step1[4], step1[5]);
step2[6] = _mm_sub_epi32(step1[7], step1[6]);
......@@ -159,14 +159,14 @@ static INLINE void highbd_idct16x16_10_4col(__m128i *const io /*io[16]*/) {
__m128i temp[2];
// stage 2
highbd_partial_butterfly_sse4_1(io[1], (int)cospi_30_64, (int)cospi_2_64,
&step2[8], &step2[15]);
highbd_partial_butterfly_sse4_1(io[3], -(int)cospi_26_64, (int)cospi_6_64,
&step2[11], &step2[12]);
highbd_partial_butterfly_sse4_1(io[1], cospi_30_64, cospi_2_64, &step2[8],
&step2[15]);
highbd_partial_butterfly_sse4_1(io[3], -cospi_26_64, cospi_6_64, &step2[11],
&step2[12]);
// stage 3
highbd_partial_butterfly_sse4_1(io[2], (int)cospi_28_64, (int)cospi_4_64,
&step1[4], &step1[7]);
highbd_partial_butterfly_sse4_1(io[2], cospi_28_64, cospi_4_64, &step1[4],
&step1[7]);
step1[8] = step2[8];
step1[9] = step2[8];
step1[10] = step2[11];
......@@ -178,14 +178,14 @@ static INLINE void highbd_idct16x16_10_4col(__m128i *const io /*io[16]*/) {
// stage 4
extend_64bit(io[0], temp);
step2[0] = multiplication_round_shift_sse4_1(temp, (int)cospi_16_64);
step2[0] = multiplication_round_shift_sse4_1(temp, cospi_16_64);
step2[1] = step2[0];
step2[2] = _mm_setzero_si128();
step2[3] = _mm_setzero_si128();
highbd_butterfly_sse4_1(step1[14], step1[9], (int)cospi_24_64,
(int)cospi_8_64, &step2[9], &step2[14]);
highbd_butterfly_sse4_1(step1[10], step1[13], -(int)cospi_8_64,
-(int)cospi_24_64, &step2[13], &step2[10]);
highbd_butterfly_sse4_1(step1[14], step1[9], cospi_24_64, cospi_8_64,
&step2[9], &step2[14]);
highbd_butterfly_sse4_1(step1[10], step1[13], -cospi_8_64, -cospi_24_64,
&step2[13], &step2[10]);
step2[5] = step1[4];
step2[6] = step1[7];
step2[8] = step1[8];
......
This diff is collapsed.
This diff is collapsed.
......@@ -24,12 +24,9 @@ static INLINE __m128i dct_const_round_shift_4_sse2(const __m128i in0,
}
static INLINE void highbd_idct4_small_sse2(__m128i *const io) {
const __m128i cospi_p16_p16 =
_mm_setr_epi32((int)cospi_16_64, 0, (int)cospi_16_64, 0);
const __m128i cospi_p08_p08 =
_mm_setr_epi32((int)cospi_8_64, 0, (int)cospi_8_64, 0);
const __m128i cospi_p24_p24 =
_mm_setr_epi32((int)cospi_24_64, 0, (int)cospi_24_64, 0);
const __m128i cospi_p16_p16 = _mm_setr_epi32(cospi_16_64, 0, cospi_16_64, 0);
const __m128i cospi_p08_p08 = _mm_setr_epi32(cospi_8_64, 0, cospi_8_64, 0);
const __m128i cospi_p24_p24 = _mm_setr_epi32(cospi_24_64, 0, cospi_24_64, 0);
__m128i temp1[4], temp2[4], step[4];
transpose_32bit_4x4(io, io);
......@@ -81,8 +78,8 @@ static INLINE void highbd_idct4_large_sse2(__m128i *const io) {
// stage 1
highbd_butterfly_cospi16_sse2(io[0], io[2], &step[0], &step[1]);
highbd_butterfly_sse2(io[1], io[3], (int)cospi_24_64, (int)cospi_8_64,
&step[2], &step[3]);
highbd_butterfly_sse2(io[1], io[3], cospi_24_64, cospi_8_64, &step[2],
&step[3]);
// stage 2
io[0] = _mm_add_epi32(step[0], step[3]); // step[0] + step[3]
......
......@@ -24,12 +24,12 @@ static INLINE void highbd_idct4(__m128i *const io) {
// stage 1
temp[0] = _mm_add_epi32(io[0], io[2]); // input[0] + input[2]
extend_64bit(temp[0], temp);
step[0] = multiplication_round_shift_sse4_1(temp, (int)cospi_16_64);
step[0] = multiplication_round_shift_sse4_1(temp, cospi_16_64);
temp[0] = _mm_sub_epi32(io[0], io[2]); // input[0] - input[2]
extend_64bit(temp[0], temp);
step[1] = multiplication_round_shift_sse4_1(temp, (int)cospi_16_64);
highbd_butterfly_sse4_1(io[1], io[3], (int)cospi_24_64, (int)cospi_8_64,
&step[2], &step[3]);
step[1] = multiplication_round_shift_sse4_1(temp, cospi_16_64);
highbd_butterfly_sse4_1(io[1], io[3], cospi_24_64, cospi_8_64, &step[2],
&step[3]);
// stage 2
io[0] = _mm_add_epi32(step[0], step[3]); // step[0] + step[3]
......
......@@ -25,15 +25,15 @@ static void highbd_idct8x8_half1d(__m128i *const io) {
step1[2] = io[4];
step1[1] = io[2];
step1[3] = io[6];
highbd_butterfly_sse2(io[1], io[7], (int)cospi_28_64, (int)cospi_4_64,
&step1[4], &step1[7]);
highbd_butterfly_sse2(io[5], io[3], (int)cospi_12_64, (int)cospi_20_64,
&step1[5], &step1[6]);
highbd_butterfly_sse2(io[1], io[7], cospi_28_64, cospi_4_64, &step1[4],
&step1[7]);
highbd_butterfly_sse2(io[5], io[3], cospi_12_64, cospi_20_64, &step1[5],
&step1[6]);
// stage 2
highbd_butterfly_cospi16_sse2(step1[0], step1[2], &step2[0], &step2[1]);
highbd_butterfly_sse2(step1[1], step1[3], (int)cospi_24_64, (int)cospi_8_64,
&step2[2], &step2[3]);
highbd_butterfly_sse2(step1[1], step1[3], cospi_24_64, cospi_8_64, &step2[2],
&step2[3]);
step2[4] = _mm_add_epi32(step1[4], step1[5]);
step2[5] = _mm_sub_epi32(step1[4], step1[5]);
step2[6] = _mm_sub_epi32(step1[7], step1[6]);
......@@ -61,18 +61,18 @@ static void highbd_idct8x8_12_half1d(__m128i *const io) {
step1[0] = io[0];
step1[1] = io[2];
abs_extend_64bit_sse2(io[1], temp1, sign);
step1[4] = multiplication_round_shift_sse2(temp1, sign, (int)cospi_28_64);
step1[7] = multiplication_round_shift_sse2(temp1, sign, (int)cospi_4_64);
step1[4] = multiplication_round_shift_sse2(temp1, sign, cospi_28_64);
step1[7] = multiplication_round_shift_sse2(temp1, sign, cospi_4_64);
abs_extend_64bit_sse2(io[3], temp1, sign);
step1[5] = multiplication_neg_round_shift_sse2(temp1, sign, (int)cospi_20_64);
step1[6] = multiplication_round_shift_sse2(temp1, sign, (int)cospi_12_64);
step1[5] = multiplication_neg_round_shift_sse2(temp1, sign, cospi_20_64);
step1[6] = multiplication_round_shift_sse2(temp1, sign, cospi_12_64);
// stage 2
abs_extend_64bit_sse2(step1[0], temp1, sign);
step2[0] = multiplication_round_shift_sse2(temp1, sign, (int)cospi_16_64);
step2[0] = multiplication_round_shift_sse2(temp1, sign, cospi_16_64);
abs_extend_64bit_sse2(step1[1], temp1, sign);
step2[2] = multiplication_round_shift_sse2(temp1, sign, (int)cospi_24_64);
step2[3] = multiplication_round_shift_sse2(temp1, sign, (int)cospi_8_64);
step2[2] = multiplication_round_shift_sse2(temp1, sign, cospi_24_64);
step2[3] = multiplication_round_shift_sse2(temp1, sign, cospi_8_64);
step2[4] = _mm_add_epi32(step1[4], step1[5]);
step2[5] = _mm_sub_epi32(step1[4], step1[5]);
step2[6] = _mm_sub_epi32(step1[7], step1[6]);
......
......@@ -27,14 +27,14 @@ static void highbd_idct8x8_half1d(__m128i *const io) {
step1[2] = io[4];
step1[1] = io[2];
step1[3] = io[6];
highbd_butterfly_sse4_1(io[1], io[7], (int)cospi_28_64, (int)cospi_4_64,
&step1[4], &step1[7]);
highbd_butterfly_sse4_1(io[5], io[3], (int)cospi_12_64, (int)cospi_20_64,
&step1[5], &step1[6]);
highbd_butterfly_sse4_1(io[1], io[7], cospi_28_64, cospi_4_64, &step1[4],
&step1[7]);
highbd_butterfly_sse4_1(io[5], io[3], cospi_12_64, cospi_20_64, &step1[5],
&step1[6]);
// stage 2
highbd_butterfly_cospi16_sse4_1(step1[0], step1[2], &step2[0], &step2[1]);
highbd_butterfly_sse4_1(step1[1], step1[3], (int)cospi_24_64, (int)cospi_8_64,
highbd_butterfly_sse4_1(step1[1], step1[3], cospi_24_64, cospi_8_64,
&step2[2], &step2[3]);
step2[4] = _mm_add_epi32(step1[4], step1[5]);
step2[5] = _mm_sub_epi32(step1[4], step1[5]);
......@@ -63,18 +63,18 @@ static void highbd_idct8x8_12_half1d(__m128i *const io) {
step1[0] = io[0];
step1[1] = io[2];
extend_64bit(io[1], temp1);
step1[4] = multiplication_round_shift_sse4_1(temp1, (int)cospi_28_64);
step1[7] = multiplication_round_shift_sse4_1(temp1, (int)cospi_4_64);
step1[4] = multiplication_round_shift_sse4_1(temp1, cospi_28_64);
step1[7] = multiplication_round_shift_sse4_1(temp1, cospi_4_64);
extend_64bit(io[3], temp1);
step1[5] = multiplication_round_shift_sse4_1(temp1, -(int)cospi_20_64);
step1[6] = multiplication_round_shift_sse4_1(temp1, (int)cospi_12_64);
step1[5] = multiplication_round_shift_sse4_1(temp1, -cospi_20_64);
step1[6] = multiplication_round_shift_sse4_1(temp1, cospi_12_64);
// stage 2
extend_64bit(step1[0], temp1);
step2[0] = multiplication_round_shift_sse4_1(temp1, (int)cospi_16_64);
step2[0] = multiplication_round_shift_sse4_1(temp1, cospi_16_64);
extend_64bit(step1[1], temp1);
step2[2] = multiplication_round_shift_sse4_1(temp1, (int)cospi_24_64);
step2[3] = multiplication_round_shift_sse4_1(temp1, (int)cospi_8_64);
step2[2] = multiplication_round_shift_sse4_1(temp1, cospi_24_64);
step2[3] = multiplication_round_shift_sse4_1(temp1, cospi_8_64);
step2[4] = _mm_add_epi32(step1[4], step1[5]);
step2[5] = _mm_sub_epi32(step1[4], step1[5]);
step2[6] = _mm_sub_epi32(step1[7], step1[6]);
......
......@@ -181,10 +181,10 @@ static INLINE void highbd_butterfly_cospi16_sse2(const __m128i in0,
temp2 = _mm_add_epi32(in0, in1);
abs_extend_64bit_sse2(temp2, temp1, sign);
*out0 = multiplication_round_shift_sse2(temp1, sign, (int)cospi_16_64);
*out0 = multiplication_round_shift_sse2(temp1, sign, cospi_16_64);
temp2 = _mm_sub_epi32(in0, in1);
abs_extend_64bit_sse2(temp2, temp1, sign);
*out1 = multiplication_round_shift_sse2(temp1, sign, (int)cospi_16_64);
*out1 = multiplication_round_shift_sse2(temp1, sign, cospi_16_64);
}
// Only do addition and subtraction butterfly, size = 16, 32
......
......@@ -67,10 +67,10 @@ static INLINE void highbd_butterfly_cospi16_sse4_1(const __m128i in0,
temp2 = _mm_add_epi32(in0, in1);
extend_64bit(temp2, temp1);
*out0 = multiplication_round_shift_sse4_1(temp1, (int)cospi_16_64);
*out0 = multiplication_round_shift_sse4_1(temp1, cospi_16_64);
temp2 = _mm_sub_epi32(in0, in1);
extend_64bit(temp2, temp1);
*out1 = multiplication_round_shift_sse4_1(temp1, (int)cospi_16_64);
*out1 = multiplication_round_shift_sse4_1(temp1, cospi_16_64);
}
static INLINE void highbd_partial_butterfly_sse4_1(const __m128i in,
......
......@@ -1006,8 +1006,7 @@ static INLINE void idct32_34_8x32_quarter_1(const __m128i *const in /*in[32]*/,
__m128i step1[8], step2[8];
// stage 3
butterfly(in[4], zero, (int)cospi_28_64, (int)cospi_4_64, &step1[4],
&step1[7]);
butterfly(in[4], zero, cospi_28_64, cospi_4_64, &step1[4], &step1[7]);
// stage 4
step2[0] = butterfly_cospi16(in[0]);
......@@ -1022,8 +1021,7 @@ static INLINE void idct32_34_8x32_quarter_1(const __m128i *const in /*in[32]*/,
step1[2] = step2[0];
step1[3] = step2[0];
step1[4] = step2[4];
butterfly(step2[6], step2[5], (int)cospi_16_64, (int)cospi_16_64, &step1[5],
&step1[6]);
butterfly(step2[6], step2[5], cospi_16_64, cospi_16_64, &step1[5], &step1[6]);
step1[7] = step2[7];
// stage 6
......@@ -1046,10 +1044,8 @@ static INLINE void idct32_34_8x32_quarter_2(const __m128i *const in /*in[32]*/,
__m128i step1[16], step2[16];
// stage 2
butterfly(in[2], zero, (int)cospi_30_64, (int)cospi_2_64, &step2[8],
&step2[15]);
butterfly(zero, in[6], (int)cospi_6_64, (int)cospi_26_64, &step2[11],
&step2[12]);
butterfly(in[2], zero, cospi_30_64, cospi_2_64, &step2[8], &step2[15]);
butterfly(zero, in[6], cospi_6_64, cospi_26_64, &step2[11], &step2[12]);
// stage 3
step1[8] = step2[8];
......@@ -1082,24 +1078,20 @@ static INLINE void idct32_34_8x32_quarter_3_4(
__m128i step1[32];
// stage 1
butterfly(in[1], zero, (int)cospi_31_64, (int)cospi_1_64, &step1[16],
&step1[31]);
butterfly(zero, in[7], (int)cospi_7_64, (int)cospi_25_64, &step1[19],
&step1[28]);
butterfly(in[5], zero, (int)cospi_27_64, (int)cospi_5_64, &step1[20],
&step1[27]);
butterfly(zero, in[3], (int)cospi_3_64, (int)cospi_29_64, &step1[23],
&step1[24]);
butterfly(in[1], zero, cospi_31_64, cospi_1_64, &step1[16], &step1[31]);
butterfly(zero, in[7], cospi_7_64, cospi_25_64, &step1[19], &step1[28]);
butterfly(in[5], zero, cospi_27_64, cospi_5_64, &step1[20], &step1[27]);
butterfly(zero, in[3], cospi_3_64, cospi_29_64, &step1[23], &step1[24]);
// stage 3
butterfly(step1[31], step1[16], (int)cospi_28_64, (int)cospi_4_64, &step1[17],
butterfly(step1[31], step1[16], cospi_28_64, cospi_4_64, &step1[17],
&step1[30]);
butterfly(step1[28], step1[19], -(int)cospi_4_64, (int)cospi_28_64,
&step1[18], &step1[29]);
butterfly(step1[27], step1[20], (int)cospi_12_64, (int)cospi_20_64,
&step1[21], &step1[26]);
butterfly(step1[24], step1[23], -(int)cospi_20_64, (int)cospi_12_64,
&step1[22], &step1[25]);
butterfly(step1[28], step1[19], -cospi_4_64, cospi_28_64, &step1[18],
&step1[29]);
butterfly(step1[27], step1[20], cospi_12_64, cospi_20_64, &step1[21],
&step1[26]);
butterfly(step1[24], step1[23], -cospi_20_64, cospi_12_64, &step1[22],
&step1[25]);
idct32_8x32_quarter_3_4_stage_4_to_7(step1, out);
}
......@@ -1145,16 +1137,12 @@ static INLINE void idct32_1024_8x32_quarter_1(
__m128i step1[8], step2[8];
// stage 3
butterfly(in[4], in[28], (int)cospi_28_64, (int)cospi_4_64, &step1[4],
&step1[7]);
butterfly(in[20], in[12], (int)cospi_12_64, (int)cospi_20_64, &step1[5],
&step1[6]);
butterfly(in[4], in[28], cospi_28_64, cospi_4_64, &step1[4], &step1[7]);
butterfly(in[20], in[12], cospi_12_64, cospi_20_64, &step1[5], &step1[6]);
// stage 4
butterfly(in[0], in[16], (int)cospi_16_64, (int)cospi_16_64, &step2[1],
&step2[0]);
butterfly(in[8], in[24], (int)cospi_24_64, (int)cospi_8_64, &step2[2],
&step2[3]);
butterfly(in[0], in[16], cospi_16_64, cospi_16_64, &step2[1], &step2[0]);
butterfly(in[8], in[24], cospi_24_64, cospi_8_64, &step2[2], &step2[3]);
step2[4] = _mm_add_epi16(step1[4], step1[5]);
step2[5] = _mm_sub_epi16(step1[4], step1[5]);
step2[6] = _mm_sub_epi16(step1[7], step1[6]);
......@@ -1166,8 +1154,7 @@ static INLINE void idct32_1024_8x32_quarter_1(
step1[2] = _mm_sub_epi16(step2[1], step2[2]);
step1[3] = _mm_sub_epi16(step2[0], step2[3]);
step1[4] = step2[4];
butterfly(step2[6], step2[5], (int)cospi_16_64, (int)cospi_16_64, &step1[5],
&step1[6]);
butterfly(step2[6], step2[5], cospi_16_64, cospi_16_64, &step1[5], &step1[6]);
step1[7] = step2[7];
// stage 6
......@@ -1189,14 +1176,10 @@ static INLINE void idct32_1024_8x32_quarter_2(
__m128i step1[16], step2[16];
// stage 2
butterfly(in[2], in[30], (int)cospi_30_64, (int)cospi_2_64, &step2[8],
&step2[15]);
butterfly(in[18], in[14], (int)cospi_14_64, (int)cospi_18_64, &step2[9],
&step2[14]);
butterfly(in[10], in[22], (int)cospi_22_64, (int)cospi_10_64, &step2[10],
&step2[13]);
butterfly(in[26], in[6], (int)cospi_6_64, (int)cospi_26_64, &step2[11],
&step2[12]);
butterfly(in[2], in[30], cospi_30_64, cospi_2_64, &step2[8], &step2[15]);
butterfly(in[18], in[14], cospi_14_64, cospi_18_64, &step2[9], &step2[14]);
butterfly(in[10], in[22], cospi_22_64, cospi_10_64, &step2[10], &step2[13]);
butterfly(in[26], in[6], cospi_6_64, cospi_26_64, &step2[11], &step2[12]);
// stage 3
step1[8] = _mm_add_epi16(step2[8], step2[9]);
......@@ -1229,24 +1212,16 @@ static INLINE void idct32_1024_8x32_quarter_3_4(
__m128i step1[32], step2[32];
// stage 1
butterfly(in[1], in[31], (int)cospi_31_64, (int)cospi_1_64, &step1[16],
&step1[31]);
butterfly(in[17], in[15], (int)cospi_15_64, (int)cospi_17_64, &step1[17],
&step1[30]);
butterfly(in[9], in[23], (int)cospi_23_64, (int)cospi_9_64, &step1[18],
&step1[29]);
butterfly(in[25], in[7], (int)cospi_7_64, (int)cospi_25_64, &step1[19],
&step1[28]);
butterfly(in[1], in[31], cospi_31_64, cospi_1_64, &step1[16], &step1[31]);
butterfly(in[17], in[15], cospi_15_64, cospi_17_64, &step1[17], &step1[30]);
butterfly(in[9], in[23], cospi_23_64, cospi_9_64, &step1[18], &step1[29]);
butterfly(in[25], in[7], cospi_7_64, cospi_25_64, &step1[19], &step1[28]);
butterfly(in[5], in[27], (int)cospi_27_64, (int)cospi_5_64, &step1[20],
&step1[27]);
butterfly(in[21], in[11], (int)cospi_11_64, (int)cospi_21_64, &step1[21],
&step1[26]);
butterfly(in[5], in[27], cospi_27_64, cospi_5_64, &step1[20], &step1[27]);
butterfly(in[21], in[11], cospi_11_64, cospi_21_64, &step1[21], &step1[26]);
butterfly(in[13], in[19], (int)cospi_19_64, (int)cospi_13_64, &step1[22],
&step1[25]);
butterfly(in[29], in[3], (int)cospi_3_64, (int)cospi_29_64, &step1[23],
&step1[24]);
butterfly(in[13], in[19], cospi_19_64, cospi_13_64, &step1[22], &step1[25]);
butterfly(in[29], in[3], cospi_3_64, cospi_29_64, &step1[23], &step1[24]);