43 #define RND0 65536 // 1 << (COL_SHIFT + ROW_SHIFT - 1);
44 #define RND1 3597 // FIX (1.75683487303);
45 #define RND2 2260 // FIX (1.10355339059);
46 #define RND3 1203 // FIX (0.587788325588);
48 #define RND5 120 // FIX (0.058658283817);
49 #define RND6 512 // FIX (0.25);
50 #define RND7 512 // FIX (0.25);
52 static const int TAB04[] = { 22725, 21407, 19266, 16384, 12873, 8867, 4520 };
53 static const int TAB17[] = { 31521, 29692, 26722, 22725, 17855, 12299, 6270 };
54 static const int TAB26[] = { 29692, 27969, 25172, 21407, 16819, 11585, 5906 };
55 static const int TAB35[] = { 26722, 25172, 22654, 19266, 15137, 10426, 5315 };
59 const int c1 = tab[0];
60 const int c2 = tab[1];
61 const int c3 = tab[2];
62 const int c4 = tab[3];
63 const int c5 = tab[4];
64 const int c6 = tab[5];
65 const int c7 = tab[6];
67 const int right = in[5] | in[6] | in[7];
68 const int left = in[1] | in[2] | in[3];
69 if (!(right | in[4])) {
70 const int k = c4 * in[0] + rnd;
72 const int a0 = k + c2 * in[2];
73 const int a1 = k + c6 * in[2];
74 const int a2 = k - c6 * in[2];
75 const int a3 = k - c2 * in[2];
77 const int b0 = c1 * in[1] + c3 * in[3];
78 const int b1 = c3 * in[1] - c7 * in[3];
79 const int b2 = c5 * in[1] - c1 * in[3];
80 const int b3 = c7 * in[1] - c5 * in[3];
104 }
else if (!(left | right)) {
105 const int a0 = (rnd + c4 * (in[0] + in[4])) >>
ROW_SHIFT;
106 const int a1 = (rnd + c4 * (in[0] - in[4])) >>
ROW_SHIFT;
117 const int k = c4 * in[0] + rnd;
118 const int a0 = k + c2 * in[2] + c4 * in[4] + c6 * in[6];
119 const int a1 = k + c6 * in[2] - c4 * in[4] - c2 * in[6];
120 const int a2 = k - c6 * in[2] - c4 * in[4] + c2 * in[6];
121 const int a3 = k - c2 * in[2] + c4 * in[4] - c6 * in[6];
123 const int b0 = c1 * in[1] + c3 * in[3] + c5 * in[5] + c7 * in[7];
124 const int b1 = c3 * in[1] - c7 * in[3] - c1 * in[5] - c5 * in[7];
125 const int b2 = c5 * in[1] - c1 * in[3] + c7 * in[5] + c3 * in[7];
126 const int b3 = c7 * in[1] - c5 * in[3] + c3 * in[5] - c1 * in[7];
145 #define MULT(c, x, n) (((c) * (x)) >> (n))
149 #define BUTTERFLY(a, b, tmp) \
154 #define LOAD_BUTTERFLY(m1, m2, a, b, tmp, s) \
155 (m1) = (s)[(a)] + (s)[(b)]; \
156 (m2) = (s)[(a)] - (s)[(b)]
160 int mm0, mm1, mm2, mm3, mm4, mm5, mm6, mm7, spill;
164 mm4 = (int) in[7 * 8];
165 mm5 = (int) in[5 * 8];
166 mm6 = (int) in[3 * 8];
167 mm7 = (int) in[1 * 8];
186 mm1 = (int) in[2 * 8];
187 mm2 = (int) in[6 * 8];
195 in[8 * 0] = (int16_t) (mm0 >>
COL_SHIFT);
196 in[8 * 7] = (int16_t) (mm7 >>
COL_SHIFT);
198 in[8 * 3] = (int16_t) (mm3 >>
COL_SHIFT);
199 in[8 * 4] = (int16_t) (mm4 >>
COL_SHIFT);
203 in[8 * 1] = (int16_t) (mm1 >>
COL_SHIFT);
204 in[8 * 6] = (int16_t) (mm6 >>
COL_SHIFT);
206 in[8 * 2] = (int16_t) (mm2 >>
COL_SHIFT);
207 in[8 * 5] = (int16_t) (mm5 >>
COL_SHIFT);
212 int mm0, mm1, mm2, mm3, mm4, mm5, mm6, mm7, spill;
216 mm0 = (int) in[1 * 8];
217 mm2 = (int) in[3 * 8];
233 mm0 = mm1 = (int) in[0 * 8];
234 mm3 = (int) in[2 * 8];
239 in[8 * 0] = (int16_t) (mm0 >>
COL_SHIFT);
240 in[8 * 7] = (int16_t) (mm7 >>
COL_SHIFT);
242 in[8 * 3] = (int16_t) (mm3 >>
COL_SHIFT);
243 in[8 * 4] = (int16_t) (mm4 >>
COL_SHIFT);
247 in[8 * 1] = (int16_t) (mm1 >>
COL_SHIFT);
248 in[8 * 6] = (int16_t) (mm6 >>
COL_SHIFT);
250 in[8 * 2] = (int16_t) (mm2 >>
COL_SHIFT);
251 in[8 * 5] = (int16_t) (mm5 >>
COL_SHIFT);
256 int mm0, mm1, mm2, mm3, mm4, mm5, mm6, mm7, spill;
260 mm7 = (int) in[1 * 8];
270 mm0 = mm1 = (int) in[0 * 8];
271 mm3 = (int) in[2 * 8];
276 in[8 * 0] = (int16_t) (mm0 >>
COL_SHIFT);
277 in[8 * 7] = (int16_t) (mm7 >>
COL_SHIFT);
279 in[8 * 3] = (int16_t) (mm3 >>
COL_SHIFT);
280 in[8 * 4] = (int16_t) (mm4 >>
COL_SHIFT);
284 in[8 * 1] = (int16_t) (mm1 >>
COL_SHIFT);
285 in[8 * 6] = (int16_t) (mm6 >>
COL_SHIFT);
287 in[8 * 2] = (int16_t) (mm2 >>
COL_SHIFT);
288 in[8 * 5] = (int16_t) (mm5 >>
COL_SHIFT);
310 for (i = 0; i < 8; i++)
312 }
else if (rows & 0x08) {
313 for (i = 0; i < 8; i++)
316 for (i = 0; i < 8; i++)
337 if (high_bit_depth || avctx->
lowres ||