Go to the documentation of this file.
27 #define IDCT4X4(src, src_stride, src_step, dst, dst_stride, dst_step) \
28 for (int y = 0; y < 4; y++) { \
29 int a = src[y*src_stride + 0*src_step]; \
30 int b = src[y*src_stride + 1*src_step]; \
31 int c = src[y*src_stride + 2*src_step]; \
32 int d = src[y*src_stride + 3*src_step]; \
33 int t0 = 13 * (a + c); \
34 int t1 = 13 * (a - c); \
35 int t2 = 7 * b - 17 * d; \
36 int t3 = 7 * d + 17 * b; \
37 STORE(dst[y*dst_stride + 0*dst_step], (t0 + t3 + 16) >> 5); \
38 STORE(dst[y*dst_stride + 1*dst_step], (t1 + t2 + 16) >> 5); \
39 STORE(dst[y*dst_stride + 2*dst_step], (t1 - t2 + 16) >> 5); \
40 STORE(dst[y*dst_stride + 3*dst_step], (t0 - t3 + 16) >> 5); \
42 #define STORE(a, b) a = b
45 #define STORE(a, b) a = av_clip_uint8(a + (b))
53 #define IDCT8X8(src, src_stride, src_step, dst, dst_stride, dst_step) \
54 for (int y = 0; y < 8; y++) { \
55 int a = src[y*src_stride + 0*src_step]; \
56 int b = src[y*src_stride + 1*src_step]; \
57 int c = src[y*src_stride + 2*src_step]; \
58 int d = src[y*src_stride + 3*src_step]; \
59 int e = src[y*src_stride + 4*src_step]; \
60 int f = src[y*src_stride + 5*src_step]; \
61 int g = src[y*src_stride + 6*src_step]; \
62 int h = src[y*src_stride + 7*src_step]; \
63 int t0 = 37 * (a + e); \
64 int t1 = 37 * (a - e); \
65 int t2 = 48 * c + 20 * g; \
66 int t3 = 20 * c - 48 * g; \
71 int t8 = 51 * b + 43 * d + 29 * f + 10 * h; \
72 int t9 = 43 * b - 10 * d - 51 * f - 29 * h; \
73 int ta = 29 * b - 51 * d + 10 * f + 43 * h; \
74 int tb = 10 * b - 29 * d + 43 * f - 51 * h; \
75 STORE(dst[y*dst_stride + 0*dst_step], (t4 + t8 + 64) >> 7); \
76 STORE(dst[y*dst_stride + 1*dst_step], (t6 + t9 + 64) >> 7); \
77 STORE(dst[y*dst_stride + 2*dst_step], (t7 + ta + 64) >> 7); \
78 STORE(dst[y*dst_stride + 3*dst_step], (t5 + tb + 64) >> 7); \
79 STORE(dst[y*dst_stride + 4*dst_step], (t5 - tb + 64) >> 7); \
80 STORE(dst[y*dst_stride + 5*dst_step], (t7 - ta + 64) >> 7); \
81 STORE(dst[y*dst_stride + 6*dst_step], (t6 - t9 + 64) >> 7); \
82 STORE(dst[y*dst_stride + 7*dst_step], (t4 - t8 + 64) >> 7); \
84 #define STORE(a, b) a = b
87 #define STORE(a, b) a = av_clip_uint8(a + (b))
95 #define IDCT16X16(src, src_stride, src_step, dst, dst_stride, dst_step) \
96 for (int y = 0; y < 16; y++) { \
97 int a = src[y*src_stride + 0*src_step]; \
98 int b = src[y*src_stride + 1*src_step]; \
99 int c = src[y*src_stride + 2*src_step]; \
100 int d = src[y*src_stride + 3*src_step]; \
101 int e = src[y*src_stride + 4*src_step]; \
102 int f = src[y*src_stride + 5*src_step]; \
103 int g = src[y*src_stride + 6*src_step]; \
104 int h = src[y*src_stride + 7*src_step]; \
105 int i = src[y*src_stride + 8*src_step]; \
106 int j = src[y*src_stride + 9*src_step]; \
107 int k = src[y*src_stride + 10*src_step]; \
108 int l = src[y*src_stride + 11*src_step]; \
109 int m = src[y*src_stride + 12*src_step]; \
110 int n = src[y*src_stride + 13*src_step]; \
111 int o = src[y*src_stride + 14*src_step]; \
112 int p = src[y*src_stride + 15*src_step]; \
113 int t0 = 26 * (a + i); \
114 int t1 = 26 * (a - i); \
115 int t2 = 14 * e - 34 * m; \
116 int t3 = 34 * e + 14 * m; \
121 int tmp00 = 31 * c - 7 * g - 36 * k - 20 * o; \
122 int tmp01 = 36 * c + 31 * g + 20 * k + 7 * o; \
123 int tmp02 = 20 * c - 36 * g + 7 * k + 31 * o; \
124 int tmp03 = 7 * c - 20 * g + 31 * k - 36 * o; \
125 int tm0 = t4 + tmp01; \
126 int tm1 = t4 - tmp01; \
127 int tm2 = t5 + tmp03; \
128 int tm3 = t5 - tmp03; \
129 int tm4 = t6 + tmp00; \
130 int tm5 = t6 - tmp00; \
131 int tm6 = t7 + tmp02; \
132 int tm7 = t7 - tmp02; \
133 int tt0 = 37 * b + 35 * d + 32 * f + 28 * h + 23 * j + 17 * l + 11 * n + 4 * p; \
134 int tt1 = 35 * b + 23 * d + 4 * f - 17 * h - 32 * j - 37 * l - 28 * n - 11 * p; \
135 int tt2 = 32 * b + 4 * d - 28 * f - 35 * h - 11 * j + 23 * l + 37 * n + 17 * p; \
136 int tt3 = 28 * b - 17 * d - 35 * f + 4 * h + 37 * j + 11 * l - 32 * n - 23 * p; \
137 int tt4 = 23 * b - 32 * d - 11 * f + 37 * h - 4 * j - 35 * l + 17 * n + 28 * p; \
138 int tt5 = 17 * b - 37 * d + 23 * f + 11 * h - 35 * j + 28 * l + 4 * n - 32 * p; \
139 int tt6 = 11 * b - 28 * d + 37 * f - 32 * h + 17 * j + 4 * l - 23 * n + 35 * p; \
140 int tt7 = 4 * b - 11 * d + 17 * f - 23 * h + 28 * j - 32 * l + 35 * n - 37 * p; \
141 STORE(dst[y*dst_stride+ 0*dst_step], (tm0 + tt0 + 64) >> 7); \
142 STORE(dst[y*dst_stride+ 1*dst_step], (tm4 + tt1 + 64) >> 7); \
143 STORE(dst[y*dst_stride+ 2*dst_step], (tm6 + tt2 + 64) >> 7); \
144 STORE(dst[y*dst_stride+ 3*dst_step], (tm2 + tt3 + 64) >> 7); \
145 STORE(dst[y*dst_stride+ 4*dst_step], (tm3 + tt4 + 64) >> 7); \
146 STORE(dst[y*dst_stride+ 5*dst_step], (tm7 + tt5 + 64) >> 7); \
147 STORE(dst[y*dst_stride+ 6*dst_step], (tm5 + tt6 + 64) >> 7); \
148 STORE(dst[y*dst_stride+ 7*dst_step], (tm1 + tt7 + 64) >> 7); \
149 STORE(dst[y*dst_stride+ 8*dst_step], (tm1 - tt7 + 64) >> 7); \
150 STORE(dst[y*dst_stride+ 9*dst_step], (tm5 - tt6 + 64) >> 7); \
151 STORE(dst[y*dst_stride+ 10*dst_step], (tm7 - tt5 + 64) >> 7); \
152 STORE(dst[y*dst_stride+ 11*dst_step], (tm3 - tt4 + 64) >> 7); \
153 STORE(dst[y*dst_stride+ 12*dst_step], (tm2 - tt3 + 64) >> 7); \
154 STORE(dst[y*dst_stride+ 13*dst_step], (tm6 - tt2 + 64) >> 7); \
155 STORE(dst[y*dst_stride+ 14*dst_step], (tm4 - tt1 + 64) >> 7); \
156 STORE(dst[y*dst_stride+ 15*dst_step], (tm0 - tt0 + 64) >> 7); \
158 #define STORE(a, x) a = av_clip_intp2(x, 15)
161 #define STORE(a, x) a = av_clip_uint8(a + (x))
void ff_rv60_idct8x8_add(const int16_t *block, uint8_t *dst, int dst_stride)
#define IDCT8X8(src, src_stride, src_step, dst, dst_stride, dst_step)
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
void ff_rv60_idct4x4_add(const int16_t *block, uint8_t *dst, int dst_stride)
#define IDCT4X4(src, src_stride, src_step, dst, dst_stride, dst_step)
#define IDCT16X16(src, src_stride, src_step, dst, dst_stride, dst_step)
void ff_rv60_idct16x16_add(const int16_t *block, uint8_t *dst, int dst_stride)
The exact code depends on how similar the blocks are and how related they are to the block