Simplify txfm code using helper function

Change-Id: Ib92f54480035a85ab7279ffa9f8b9237d0a3f334
This commit is contained in:
Frederic Barbier 2017-05-05 09:37:40 +02:00 коммит произвёл Fred BARBIER
Родитель 6fe148218f
Коммит bbf7bb02d3
8 изменённых файлов: 116 добавлений и 112 удалений

Просмотреть файл

@ -53,7 +53,7 @@ void av1_fdct4_new(const int32_t *input, int32_t *output, const int8_t *cos_bit,
// stage 2
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = half_btf(cospi[32], bf0[0], cospi[32], bf0[1], cos_bit[stage]);
@ -100,7 +100,7 @@ void av1_fdct8_new(const int32_t *input, int32_t *output, const int8_t *cos_bit,
// stage 2
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0] + bf0[3];
@ -115,7 +115,7 @@ void av1_fdct8_new(const int32_t *input, int32_t *output, const int8_t *cos_bit,
// stage 3
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = step;
bf1 = output;
bf1[0] = half_btf(cospi[32], bf0[0], cospi[32], bf0[1], cos_bit[stage]);
@ -130,7 +130,7 @@ void av1_fdct8_new(const int32_t *input, int32_t *output, const int8_t *cos_bit,
// stage 4
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0];
@ -193,7 +193,7 @@ void av1_fdct16_new(const int32_t *input, int32_t *output,
// stage 2
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0] + bf0[7];
@ -216,7 +216,7 @@ void av1_fdct16_new(const int32_t *input, int32_t *output,
// stage 3
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = step;
bf1 = output;
bf1[0] = bf0[0] + bf0[3];
@ -239,7 +239,7 @@ void av1_fdct16_new(const int32_t *input, int32_t *output,
// stage 4
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = half_btf(cospi[32], bf0[0], cospi[32], bf0[1], cos_bit[stage]);
@ -262,7 +262,7 @@ void av1_fdct16_new(const int32_t *input, int32_t *output,
// stage 5
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = step;
bf1 = output;
bf1[0] = bf0[0];
@ -285,7 +285,7 @@ void av1_fdct16_new(const int32_t *input, int32_t *output,
// stage 6
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0];
@ -380,7 +380,7 @@ void av1_fdct32_new(const int32_t *input, int32_t *output,
// stage 2
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0] + bf0[15];
@ -419,7 +419,7 @@ void av1_fdct32_new(const int32_t *input, int32_t *output,
// stage 3
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = step;
bf1 = output;
bf1[0] = bf0[0] + bf0[7];
@ -458,7 +458,7 @@ void av1_fdct32_new(const int32_t *input, int32_t *output,
// stage 4
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0] + bf0[3];
@ -497,7 +497,7 @@ void av1_fdct32_new(const int32_t *input, int32_t *output,
// stage 5
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = step;
bf1 = output;
bf1[0] = half_btf(cospi[32], bf0[0], cospi[32], bf0[1], cos_bit[stage]);
@ -536,7 +536,7 @@ void av1_fdct32_new(const int32_t *input, int32_t *output,
// stage 6
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0];
@ -575,7 +575,7 @@ void av1_fdct32_new(const int32_t *input, int32_t *output,
// stage 7
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = step;
bf1 = output;
bf1[0] = bf0[0];
@ -614,7 +614,7 @@ void av1_fdct32_new(const int32_t *input, int32_t *output,
// stage 8
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0];
@ -713,7 +713,7 @@ void av1_fadst4_new(const int32_t *input, int32_t *output,
// stage 2
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = half_btf(cospi[8], bf0[0], cospi[56], bf0[1], cos_bit[stage]);
@ -734,7 +734,7 @@ void av1_fadst4_new(const int32_t *input, int32_t *output,
// stage 4
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0];
@ -781,7 +781,7 @@ void av1_fadst8_new(const int32_t *input, int32_t *output,
// stage 2
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = half_btf(cospi[4], bf0[0], cospi[60], bf0[1], cos_bit[stage]);
@ -810,7 +810,7 @@ void av1_fadst8_new(const int32_t *input, int32_t *output,
// stage 4
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0];
@ -839,7 +839,7 @@ void av1_fadst8_new(const int32_t *input, int32_t *output,
// stage 6
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0];
@ -902,7 +902,7 @@ void av1_fadst16_new(const int32_t *input, int32_t *output,
// stage 2
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = half_btf(cospi[2], bf0[0], cospi[62], bf0[1], cos_bit[stage]);
@ -947,7 +947,7 @@ void av1_fadst16_new(const int32_t *input, int32_t *output,
// stage 4
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0];
@ -992,7 +992,7 @@ void av1_fadst16_new(const int32_t *input, int32_t *output,
// stage 6
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0];
@ -1037,7 +1037,7 @@ void av1_fadst16_new(const int32_t *input, int32_t *output,
// stage 8
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0];
@ -1132,7 +1132,7 @@ void av1_fadst32_new(const int32_t *input, int32_t *output,
// stage 2
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = half_btf(cospi[1], bf0[0], cospi[63], bf0[1], cos_bit[stage]);
@ -1209,7 +1209,7 @@ void av1_fadst32_new(const int32_t *input, int32_t *output,
// stage 4
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0];
@ -1286,7 +1286,7 @@ void av1_fadst32_new(const int32_t *input, int32_t *output,
// stage 6
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0];
@ -1363,7 +1363,7 @@ void av1_fadst32_new(const int32_t *input, int32_t *output,
// stage 8
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0];
@ -1440,7 +1440,7 @@ void av1_fadst32_new(const int32_t *input, int32_t *output,
// stage 10
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0];
@ -1531,7 +1531,7 @@ void av1_fdct64_new(const int32_t *input, int32_t *output,
// stage 1;
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf1 = output;
bf1[0] = input[0] + input[63];
bf1[1] = input[1] + input[62];
@ -1601,7 +1601,7 @@ void av1_fdct64_new(const int32_t *input, int32_t *output,
// stage 2
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0] + bf0[31];
@ -1672,7 +1672,7 @@ void av1_fdct64_new(const int32_t *input, int32_t *output,
// stage 3
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = step;
bf1 = output;
bf1[0] = bf0[0] + bf0[15];
@ -1743,7 +1743,7 @@ void av1_fdct64_new(const int32_t *input, int32_t *output,
// stage 4
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0] + bf0[7];
@ -1814,7 +1814,7 @@ void av1_fdct64_new(const int32_t *input, int32_t *output,
// stage 5
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = step;
bf1 = output;
bf1[0] = bf0[0] + bf0[3];
@ -1885,7 +1885,7 @@ void av1_fdct64_new(const int32_t *input, int32_t *output,
// stage 6
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = half_btf(cospi[32], bf0[0], cospi[32], bf0[1], cos_bit[stage]);
@ -1956,7 +1956,7 @@ void av1_fdct64_new(const int32_t *input, int32_t *output,
// stage 7
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = step;
bf1 = output;
bf1[0] = bf0[0];
@ -2027,7 +2027,7 @@ void av1_fdct64_new(const int32_t *input, int32_t *output,
// stage 8
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0];
@ -2098,7 +2098,7 @@ void av1_fdct64_new(const int32_t *input, int32_t *output,
// stage 9
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = step;
bf1 = output;
bf1[0] = bf0[0];
@ -2169,7 +2169,7 @@ void av1_fdct64_new(const int32_t *input, int32_t *output,
// stage 10
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0];
@ -2240,7 +2240,7 @@ void av1_fdct64_new(const int32_t *input, int32_t *output,
// stage 11
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = step;
bf1 = output;
bf1[0] = bf0[0];

Просмотреть файл

@ -75,7 +75,7 @@ void av1_idct4_new(const int32_t *input, int32_t *output, const int8_t *cos_bit,
// stage 2
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = half_btf(cospi[32], bf0[0], cospi[32], bf0[1], cos_bit[stage]);
@ -122,7 +122,7 @@ void av1_idct8_new(const int32_t *input, int32_t *output, const int8_t *cos_bit,
// stage 2
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0];
@ -137,7 +137,7 @@ void av1_idct8_new(const int32_t *input, int32_t *output, const int8_t *cos_bit,
// stage 3
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = step;
bf1 = output;
bf1[0] = half_btf(cospi[32], bf0[0], cospi[32], bf0[1], cos_bit[stage]);
@ -152,7 +152,7 @@ void av1_idct8_new(const int32_t *input, int32_t *output, const int8_t *cos_bit,
// stage 4
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0] + bf0[3];
@ -215,7 +215,7 @@ void av1_idct16_new(const int32_t *input, int32_t *output,
// stage 2
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0];
@ -238,7 +238,7 @@ void av1_idct16_new(const int32_t *input, int32_t *output,
// stage 3
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = step;
bf1 = output;
bf1[0] = bf0[0];
@ -261,7 +261,7 @@ void av1_idct16_new(const int32_t *input, int32_t *output,
// stage 4
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = half_btf(cospi[32], bf0[0], cospi[32], bf0[1], cos_bit[stage]);
@ -284,7 +284,7 @@ void av1_idct16_new(const int32_t *input, int32_t *output,
// stage 5
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = step;
bf1 = output;
bf1[0] = bf0[0] + bf0[3];
@ -307,7 +307,7 @@ void av1_idct16_new(const int32_t *input, int32_t *output,
// stage 6
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0] + bf0[7];
@ -402,7 +402,7 @@ void av1_idct32_new(const int32_t *input, int32_t *output,
// stage 2
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0];
@ -441,7 +441,7 @@ void av1_idct32_new(const int32_t *input, int32_t *output,
// stage 3
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = step;
bf1 = output;
bf1[0] = bf0[0];
@ -480,7 +480,7 @@ void av1_idct32_new(const int32_t *input, int32_t *output,
// stage 4
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0];
@ -519,7 +519,7 @@ void av1_idct32_new(const int32_t *input, int32_t *output,
// stage 5
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = step;
bf1 = output;
bf1[0] = half_btf(cospi[32], bf0[0], cospi[32], bf0[1], cos_bit[stage]);
@ -558,7 +558,7 @@ void av1_idct32_new(const int32_t *input, int32_t *output,
// stage 6
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0] + bf0[3];
@ -597,7 +597,7 @@ void av1_idct32_new(const int32_t *input, int32_t *output,
// stage 7
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = step;
bf1 = output;
bf1[0] = bf0[0] + bf0[7];
@ -636,7 +636,7 @@ void av1_idct32_new(const int32_t *input, int32_t *output,
// stage 8
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0] + bf0[15];
@ -735,7 +735,7 @@ void av1_iadst4_new(const int32_t *input, int32_t *output,
// stage 2
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0];
@ -756,7 +756,7 @@ void av1_iadst4_new(const int32_t *input, int32_t *output,
// stage 4
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = half_btf(cospi[8], bf0[0], cospi[56], bf0[1], cos_bit[stage]);
@ -803,7 +803,7 @@ void av1_iadst8_new(const int32_t *input, int32_t *output,
// stage 2
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0];
@ -832,7 +832,7 @@ void av1_iadst8_new(const int32_t *input, int32_t *output,
// stage 4
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0];
@ -861,7 +861,7 @@ void av1_iadst8_new(const int32_t *input, int32_t *output,
// stage 6
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = half_btf(cospi[4], bf0[0], cospi[60], bf0[1], cos_bit[stage]);
@ -924,7 +924,7 @@ void av1_iadst16_new(const int32_t *input, int32_t *output,
// stage 2
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0];
@ -969,7 +969,7 @@ void av1_iadst16_new(const int32_t *input, int32_t *output,
// stage 4
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0];
@ -1014,7 +1014,7 @@ void av1_iadst16_new(const int32_t *input, int32_t *output,
// stage 6
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0];
@ -1059,7 +1059,7 @@ void av1_iadst16_new(const int32_t *input, int32_t *output,
// stage 8
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = half_btf(cospi[2], bf0[0], cospi[62], bf0[1], cos_bit[stage]);
@ -1154,7 +1154,7 @@ void av1_iadst32_new(const int32_t *input, int32_t *output,
// stage 2
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0];
@ -1231,7 +1231,7 @@ void av1_iadst32_new(const int32_t *input, int32_t *output,
// stage 4
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0];
@ -1308,7 +1308,7 @@ void av1_iadst32_new(const int32_t *input, int32_t *output,
// stage 6
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0];
@ -1385,7 +1385,7 @@ void av1_iadst32_new(const int32_t *input, int32_t *output,
// stage 8
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0];
@ -1462,7 +1462,7 @@ void av1_iadst32_new(const int32_t *input, int32_t *output,
// stage 10
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = half_btf(cospi[1], bf0[0], cospi[63], bf0[1], cos_bit[stage]);
@ -1553,7 +1553,7 @@ void av1_idct64_new(const int32_t *input, int32_t *output,
// stage 1;
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf1 = output;
bf1[0] = input[0];
bf1[1] = input[32];
@ -1623,7 +1623,7 @@ void av1_idct64_new(const int32_t *input, int32_t *output,
// stage 2
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0];
@ -1694,7 +1694,7 @@ void av1_idct64_new(const int32_t *input, int32_t *output,
// stage 3
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = step;
bf1 = output;
bf1[0] = bf0[0];
@ -1765,7 +1765,7 @@ void av1_idct64_new(const int32_t *input, int32_t *output,
// stage 4
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0];
@ -1836,7 +1836,7 @@ void av1_idct64_new(const int32_t *input, int32_t *output,
// stage 5
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = step;
bf1 = output;
bf1[0] = bf0[0];
@ -1907,7 +1907,7 @@ void av1_idct64_new(const int32_t *input, int32_t *output,
// stage 6
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = half_btf(cospi[32], bf0[0], cospi[32], bf0[1], cos_bit[stage]);
@ -1978,7 +1978,7 @@ void av1_idct64_new(const int32_t *input, int32_t *output,
// stage 7
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = step;
bf1 = output;
bf1[0] = bf0[0] + bf0[3];
@ -2049,7 +2049,7 @@ void av1_idct64_new(const int32_t *input, int32_t *output,
// stage 8
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0] + bf0[7];
@ -2120,7 +2120,7 @@ void av1_idct64_new(const int32_t *input, int32_t *output,
// stage 9
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = step;
bf1 = output;
bf1[0] = bf0[0] + bf0[15];
@ -2191,7 +2191,7 @@ void av1_idct64_new(const int32_t *input, int32_t *output,
// stage 10
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = output;
bf1 = step;
bf1[0] = bf0[0] + bf0[31];
@ -2262,7 +2262,7 @@ void av1_idct64_new(const int32_t *input, int32_t *output,
// stage 11
stage++;
cospi = cospi_arr[cos_bit[stage] - cos_bit_min];
cospi = cospi_arr(cos_bit[stage]);
bf0 = step;
bf1 = output;
bf1[0] = bf0[0] + bf0[63];

Просмотреть файл

@ -24,7 +24,7 @@ static const int cos_bit_min = 10;
static const int cos_bit_max = 16;
// cospi_arr[i][j] = (int)round(cos(M_PI*j/128) * (1<<(cos_bit_min+i)));
static const int32_t cospi_arr[7][64] = {
static const int32_t cospi_arr_data[7][64] = {
{ 1024, 1024, 1023, 1021, 1019, 1016, 1013, 1009, 1004, 999, 993, 987, 980,
972, 964, 955, 946, 936, 926, 915, 903, 891, 878, 865, 851, 837,
822, 807, 792, 775, 759, 742, 724, 706, 688, 669, 650, 630, 610,
@ -68,6 +68,10 @@ static const int32_t cospi_arr[7][64] = {
14359, 12785, 11204, 9616, 8022, 6424, 4821, 3216, 1608 }
};
static INLINE const int32_t *cospi_arr(int n) {
return cospi_arr_data[n - cos_bit_min];
}
static INLINE int32_t round_shift(int32_t value, int bit) {
assert(bit >= 1);
return (value + (1 << (bit - 1))) >> bit;

Просмотреть файл

@ -57,7 +57,7 @@ void av1_fdct32_new_sse4_1(const __m128i *input, __m128i *output,
// stage 2
stage_idx++;
bit = cos_bit[stage_idx];
cospi = cospi_arr[bit - cos_bit_min];
cospi = cospi_arr(bit);
buf0[0] = _mm_add_epi32(buf1[0], buf1[15]);
buf0[15] = _mm_sub_epi32(buf1[0], buf1[15]);
buf0[1] = _mm_add_epi32(buf1[1], buf1[14]);
@ -94,7 +94,7 @@ void av1_fdct32_new_sse4_1(const __m128i *input, __m128i *output,
// stage 3
stage_idx++;
bit = cos_bit[stage_idx];
cospi = cospi_arr[bit - cos_bit_min];
cospi = cospi_arr(bit);
buf1[0] = _mm_add_epi32(buf0[0], buf0[7]);
buf1[7] = _mm_sub_epi32(buf0[0], buf0[7]);
buf1[1] = _mm_add_epi32(buf0[1], buf0[6]);
@ -131,7 +131,7 @@ void av1_fdct32_new_sse4_1(const __m128i *input, __m128i *output,
// stage 4
stage_idx++;
bit = cos_bit[stage_idx];
cospi = cospi_arr[bit - cos_bit_min];
cospi = cospi_arr(bit);
buf0[0] = _mm_add_epi32(buf1[0], buf1[3]);
buf0[3] = _mm_sub_epi32(buf1[0], buf1[3]);
buf0[1] = _mm_add_epi32(buf1[1], buf1[2]);
@ -168,7 +168,7 @@ void av1_fdct32_new_sse4_1(const __m128i *input, __m128i *output,
// stage 5
stage_idx++;
bit = cos_bit[stage_idx];
cospi = cospi_arr[bit - cos_bit_min];
cospi = cospi_arr(bit);
btf_32_sse4_1_type0(cospi[32], cospi[32], buf0[0], buf0[1], buf1[0],
buf1[1], bit);
btf_32_sse4_1_type1(cospi[48], cospi[16], buf0[2], buf0[3], buf1[2],
@ -205,7 +205,7 @@ void av1_fdct32_new_sse4_1(const __m128i *input, __m128i *output,
// stage 6
stage_idx++;
bit = cos_bit[stage_idx];
cospi = cospi_arr[bit - cos_bit_min];
cospi = cospi_arr(bit);
buf0[0] = buf1[0];
buf0[1] = buf1[1];
buf0[2] = buf1[2];
@ -242,7 +242,7 @@ void av1_fdct32_new_sse4_1(const __m128i *input, __m128i *output,
// stage 7
stage_idx++;
bit = cos_bit[stage_idx];
cospi = cospi_arr[bit - cos_bit_min];
cospi = cospi_arr(bit);
buf1[0] = buf0[0];
buf1[1] = buf0[1];
buf1[2] = buf0[2];
@ -279,7 +279,7 @@ void av1_fdct32_new_sse4_1(const __m128i *input, __m128i *output,
// stage 8
stage_idx++;
bit = cos_bit[stage_idx];
cospi = cospi_arr[bit - cos_bit_min];
cospi = cospi_arr(bit);
buf0[0] = buf1[0];
buf0[1] = buf1[1];
buf0[2] = buf1[2];
@ -383,7 +383,7 @@ void av1_fadst4_new_sse4_1(const __m128i *input, __m128i *output,
// stage 2
stage_idx++;
bit = cos_bit[stage_idx];
cospi = cospi_arr[bit - cos_bit_min];
cospi = cospi_arr(bit);
btf_32_sse4_1_type0(cospi[8], cospi[56], buf1[0], buf1[1], buf0[0], buf0[1],
bit);
btf_32_sse4_1_type0(cospi[40], cospi[24], buf1[2], buf1[3], buf0[2],
@ -399,7 +399,7 @@ void av1_fadst4_new_sse4_1(const __m128i *input, __m128i *output,
// stage 4
stage_idx++;
bit = cos_bit[stage_idx];
cospi = cospi_arr[bit - cos_bit_min];
cospi = cospi_arr(bit);
buf0[0] = buf1[0];
buf0[1] = buf1[1];
btf_32_sse4_1_type0(cospi[32], cospi[32], buf1[2], buf1[3], buf0[2],
@ -475,7 +475,7 @@ void av1_fadst32_new_sse4_1(const __m128i *input, __m128i *output,
// stage 2
stage_idx++;
bit = cos_bit[stage_idx];
cospi = cospi_arr[bit - cos_bit_min];
cospi = cospi_arr(bit);
btf_32_sse4_1_type0(cospi[1], cospi[63], buf1[0], buf1[1], buf0[0], buf0[1],
bit);
btf_32_sse4_1_type0(cospi[5], cospi[59], buf1[2], buf1[3], buf0[2], buf0[3],
@ -547,7 +547,7 @@ void av1_fadst32_new_sse4_1(const __m128i *input, __m128i *output,
// stage 4
stage_idx++;
bit = cos_bit[stage_idx];
cospi = cospi_arr[bit - cos_bit_min];
cospi = cospi_arr(bit);
buf0[0] = buf1[0];
buf0[1] = buf1[1];
buf0[2] = buf1[2];
@ -619,7 +619,7 @@ void av1_fadst32_new_sse4_1(const __m128i *input, __m128i *output,
// stage 6
stage_idx++;
bit = cos_bit[stage_idx];
cospi = cospi_arr[bit - cos_bit_min];
cospi = cospi_arr(bit);
buf0[0] = buf1[0];
buf0[1] = buf1[1];
buf0[2] = buf1[2];
@ -691,7 +691,7 @@ void av1_fadst32_new_sse4_1(const __m128i *input, __m128i *output,
// stage 8
stage_idx++;
bit = cos_bit[stage_idx];
cospi = cospi_arr[bit - cos_bit_min];
cospi = cospi_arr(bit);
buf0[0] = buf1[0];
buf0[1] = buf1[1];
buf0[2] = buf1[2];
@ -763,7 +763,7 @@ void av1_fadst32_new_sse4_1(const __m128i *input, __m128i *output,
// stage 10
stage_idx++;
bit = cos_bit[stage_idx];
cospi = cospi_arr[bit - cos_bit_min];
cospi = cospi_arr(bit);
buf0[0] = buf1[0];
buf0[1] = buf1[1];
btf_32_sse4_1_type0(cospi[32], cospi[32], buf1[2], buf1[3], buf0[2],

Просмотреть файл

@ -167,7 +167,7 @@ static INLINE __m256i half_btf_avx2(__m256i w0, __m256i n0, __m256i w1,
}
static void idct32_avx2(__m256i *in, __m256i *out, int bit) {
const int32_t *cospi = cospi_arr[bit - cos_bit_min];
const int32_t *cospi = cospi_arr(bit);
const __m256i cospi62 = _mm256_set1_epi32(cospi[62]);
const __m256i cospi30 = _mm256_set1_epi32(cospi[30]);
const __m256i cospi46 = _mm256_set1_epi32(cospi[46]);

Просмотреть файл

@ -24,7 +24,7 @@ static INLINE void load_buffer_4x4(const int32_t *coeff, __m128i *in) {
}
static void idct4x4_sse4_1(__m128i *in, int bit) {
const int32_t *cospi = cospi_arr[bit - cos_bit_min];
const int32_t *cospi = cospi_arr(bit);
const __m128i cospi32 = _mm_set1_epi32(cospi[32]);
const __m128i cospi48 = _mm_set1_epi32(cospi[48]);
const __m128i cospi16 = _mm_set1_epi32(cospi[16]);
@ -72,7 +72,7 @@ static void idct4x4_sse4_1(__m128i *in, int bit) {
}
static void iadst4x4_sse4_1(__m128i *in, int bit) {
const int32_t *cospi = cospi_arr[bit - cos_bit_min];
const int32_t *cospi = cospi_arr(bit);
const __m128i cospi32 = _mm_set1_epi32(cospi[32]);
const __m128i cospi8 = _mm_set1_epi32(cospi[8]);
const __m128i cospim8 = _mm_set1_epi32(-cospi[8]);
@ -325,7 +325,7 @@ static void load_buffer_8x8(const int32_t *coeff, __m128i *in) {
}
static void idct8x8_sse4_1(__m128i *in, __m128i *out, int bit) {
const int32_t *cospi = cospi_arr[bit - cos_bit_min];
const int32_t *cospi = cospi_arr(bit);
const __m128i cospi56 = _mm_set1_epi32(cospi[56]);
const __m128i cospim8 = _mm_set1_epi32(-cospi[8]);
const __m128i cospi24 = _mm_set1_epi32(cospi[24]);
@ -439,7 +439,7 @@ static void idct8x8_sse4_1(__m128i *in, __m128i *out, int bit) {
}
static void iadst8x8_sse4_1(__m128i *in, __m128i *out, int bit) {
const int32_t *cospi = cospi_arr[bit - cos_bit_min];
const int32_t *cospi = cospi_arr(bit);
const __m128i cospi32 = _mm_set1_epi32(cospi[32]);
const __m128i cospi16 = _mm_set1_epi32(cospi[16]);
const __m128i cospim16 = _mm_set1_epi32(-cospi[16]);
@ -849,7 +849,7 @@ static void write_buffer_16x16(__m128i *in, uint16_t *output, int stride,
}
static void idct16x16_sse4_1(__m128i *in, __m128i *out, int bit) {
const int32_t *cospi = cospi_arr[bit - cos_bit_min];
const int32_t *cospi = cospi_arr(bit);
const __m128i cospi60 = _mm_set1_epi32(cospi[60]);
const __m128i cospim4 = _mm_set1_epi32(-cospi[4]);
const __m128i cospi28 = _mm_set1_epi32(cospi[28]);
@ -1043,7 +1043,7 @@ static void idct16x16_sse4_1(__m128i *in, __m128i *out, int bit) {
}
static void iadst16x16_sse4_1(__m128i *in, __m128i *out, int bit) {
const int32_t *cospi = cospi_arr[bit - cos_bit_min];
const int32_t *cospi = cospi_arr(bit);
const __m128i cospi32 = _mm_set1_epi32(cospi[32]);
const __m128i cospi48 = _mm_set1_epi32(cospi[48]);
const __m128i cospi16 = _mm_set1_epi32(cospi[16]);

Просмотреть файл

@ -58,7 +58,7 @@ static INLINE void load_buffer_4x4(const int16_t *input, __m128i *in,
// shift[1] is used in txfm_func_col()
// shift[2] is used in txfm_func_row()
static void fdct4x4_sse4_1(__m128i *in, int bit) {
const int32_t *cospi = cospi_arr[bit - cos_bit_min];
const int32_t *cospi = cospi_arr(bit);
const __m128i cospi32 = _mm_set1_epi32(cospi[32]);
const __m128i cospi48 = _mm_set1_epi32(cospi[48]);
const __m128i cospi16 = _mm_set1_epi32(cospi[16]);
@ -133,7 +133,7 @@ void av1_highbd_fht4x4_sse4_1(const int16_t *input, tran_low_t *output,
}
static void fadst4x4_sse4_1(__m128i *in, int bit) {
const int32_t *cospi = cospi_arr[bit - cos_bit_min];
const int32_t *cospi = cospi_arr(bit);
const __m128i cospi8 = _mm_set1_epi32(cospi[8]);
const __m128i cospi56 = _mm_set1_epi32(cospi[56]);
const __m128i cospi40 = _mm_set1_epi32(cospi[40]);
@ -429,7 +429,7 @@ static INLINE void write_buffer_8x8(const __m128i *res, tran_low_t *output) {
}
static void fdct8x8_sse4_1(__m128i *in, __m128i *out, int bit) {
const int32_t *cospi = cospi_arr[bit - cos_bit_min];
const int32_t *cospi = cospi_arr(bit);
const __m128i cospi32 = _mm_set1_epi32(cospi[32]);
const __m128i cospim32 = _mm_set1_epi32(-cospi[32]);
const __m128i cospi48 = _mm_set1_epi32(cospi[48]);
@ -625,7 +625,7 @@ static void fdct8x8_sse4_1(__m128i *in, __m128i *out, int bit) {
}
static void fadst8x8_sse4_1(__m128i *in, __m128i *out, int bit) {
const int32_t *cospi = cospi_arr[bit - cos_bit_min];
const int32_t *cospi = cospi_arr(bit);
const __m128i cospi4 = _mm_set1_epi32(cospi[4]);
const __m128i cospi60 = _mm_set1_epi32(cospi[60]);
const __m128i cospi20 = _mm_set1_epi32(cospi[20]);
@ -1107,7 +1107,7 @@ static INLINE void load_buffer_16x16(const int16_t *input, __m128i *out,
}
static void fdct16x16_sse4_1(__m128i *in, __m128i *out, int bit) {
const int32_t *cospi = cospi_arr[bit - cos_bit_min];
const int32_t *cospi = cospi_arr(bit);
const __m128i cospi32 = _mm_set1_epi32(cospi[32]);
const __m128i cospim32 = _mm_set1_epi32(-cospi[32]);
const __m128i cospi48 = _mm_set1_epi32(cospi[48]);
@ -1393,7 +1393,7 @@ static void fdct16x16_sse4_1(__m128i *in, __m128i *out, int bit) {
}
static void fadst16x16_sse4_1(__m128i *in, __m128i *out, int bit) {
const int32_t *cospi = cospi_arr[bit - cos_bit_min];
const int32_t *cospi = cospi_arr(bit);
const __m128i cospi2 = _mm_set1_epi32(cospi[2]);
const __m128i cospi62 = _mm_set1_epi32(cospi[62]);
const __m128i cospi10 = _mm_set1_epi32(cospi[10]);

Просмотреть файл

@ -56,10 +56,10 @@ TEST(av1_fwd_txfm1d, get_max_bit) {
EXPECT_EQ(max_bit, 3);
}
TEST(av1_fwd_txfm1d, cospi_arr) {
TEST(av1_fwd_txfm1d, cospi_arr_data) {
for (int i = 0; i < 7; i++) {
for (int j = 0; j < 64; j++) {
EXPECT_EQ(cospi_arr[i][j],
EXPECT_EQ(cospi_arr_data[i][j],
(int32_t)round(cos(M_PI * j / 128) * (1 << (cos_bit_min + i))));
}
}