Go to the documentation of this file.
32 #include "config_components.h"
43 #define QPEL_MC(r, OPNAME, RND, OP) \
44 static void OPNAME ## mpeg4_qpel8_h_lowpass(uint8_t *dst, const uint8_t *src, \
45 int dstStride, int srcStride, \
48 const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \
51 for (i = 0; i < h; i++) { \
52 OP(dst[0], (src[0] + src[1]) * 20 - (src[0] + src[2]) * 6 + (src[1] + src[3]) * 3 - (src[2] + src[4])); \
53 OP(dst[1], (src[1] + src[2]) * 20 - (src[0] + src[3]) * 6 + (src[0] + src[4]) * 3 - (src[1] + src[5])); \
54 OP(dst[2], (src[2] + src[3]) * 20 - (src[1] + src[4]) * 6 + (src[0] + src[5]) * 3 - (src[0] + src[6])); \
55 OP(dst[3], (src[3] + src[4]) * 20 - (src[2] + src[5]) * 6 + (src[1] + src[6]) * 3 - (src[0] + src[7])); \
56 OP(dst[4], (src[4] + src[5]) * 20 - (src[3] + src[6]) * 6 + (src[2] + src[7]) * 3 - (src[1] + src[8])); \
57 OP(dst[5], (src[5] + src[6]) * 20 - (src[4] + src[7]) * 6 + (src[3] + src[8]) * 3 - (src[2] + src[8])); \
58 OP(dst[6], (src[6] + src[7]) * 20 - (src[5] + src[8]) * 6 + (src[4] + src[8]) * 3 - (src[3] + src[7])); \
59 OP(dst[7], (src[7] + src[8]) * 20 - (src[6] + src[8]) * 6 + (src[5] + src[7]) * 3 - (src[4] + src[6])); \
65 static void OPNAME ## mpeg4_qpel8_v_lowpass(uint8_t *dst, const uint8_t *src, \
66 int dstStride, int srcStride) \
68 const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \
72 for (i = 0; i < w; i++) { \
73 const int src0 = src[0 * srcStride]; \
74 const int src1 = src[1 * srcStride]; \
75 const int src2 = src[2 * srcStride]; \
76 const int src3 = src[3 * srcStride]; \
77 const int src4 = src[4 * srcStride]; \
78 const int src5 = src[5 * srcStride]; \
79 const int src6 = src[6 * srcStride]; \
80 const int src7 = src[7 * srcStride]; \
81 const int src8 = src[8 * srcStride]; \
82 OP(dst[0 * dstStride], (src0 + src1) * 20 - (src0 + src2) * 6 + (src1 + src3) * 3 - (src2 + src4)); \
83 OP(dst[1 * dstStride], (src1 + src2) * 20 - (src0 + src3) * 6 + (src0 + src4) * 3 - (src1 + src5)); \
84 OP(dst[2 * dstStride], (src2 + src3) * 20 - (src1 + src4) * 6 + (src0 + src5) * 3 - (src0 + src6)); \
85 OP(dst[3 * dstStride], (src3 + src4) * 20 - (src2 + src5) * 6 + (src1 + src6) * 3 - (src0 + src7)); \
86 OP(dst[4 * dstStride], (src4 + src5) * 20 - (src3 + src6) * 6 + (src2 + src7) * 3 - (src1 + src8)); \
87 OP(dst[5 * dstStride], (src5 + src6) * 20 - (src4 + src7) * 6 + (src3 + src8) * 3 - (src2 + src8)); \
88 OP(dst[6 * dstStride], (src6 + src7) * 20 - (src5 + src8) * 6 + (src4 + src8) * 3 - (src3 + src7)); \
89 OP(dst[7 * dstStride], (src7 + src8) * 20 - (src6 + src8) * 6 + (src5 + src7) * 3 - (src4 + src6)); \
95 static void OPNAME ## mpeg4_qpel16_h_lowpass(uint8_t *dst, \
97 int dstStride, int srcStride, \
100 const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \
103 for (i = 0; i < h; i++) { \
104 OP(dst[0], (src[0] + src[1]) * 20 - (src[0] + src[2]) * 6 + (src[1] + src[3]) * 3 - (src[2] + src[4])); \
105 OP(dst[1], (src[1] + src[2]) * 20 - (src[0] + src[3]) * 6 + (src[0] + src[4]) * 3 - (src[1] + src[5])); \
106 OP(dst[2], (src[2] + src[3]) * 20 - (src[1] + src[4]) * 6 + (src[0] + src[5]) * 3 - (src[0] + src[6])); \
107 OP(dst[3], (src[3] + src[4]) * 20 - (src[2] + src[5]) * 6 + (src[1] + src[6]) * 3 - (src[0] + src[7])); \
108 OP(dst[4], (src[4] + src[5]) * 20 - (src[3] + src[6]) * 6 + (src[2] + src[7]) * 3 - (src[1] + src[8])); \
109 OP(dst[5], (src[5] + src[6]) * 20 - (src[4] + src[7]) * 6 + (src[3] + src[8]) * 3 - (src[2] + src[9])); \
110 OP(dst[6], (src[6] + src[7]) * 20 - (src[5] + src[8]) * 6 + (src[4] + src[9]) * 3 - (src[3] + src[10])); \
111 OP(dst[7], (src[7] + src[8]) * 20 - (src[6] + src[9]) * 6 + (src[5] + src[10]) * 3 - (src[4] + src[11])); \
112 OP(dst[8], (src[8] + src[9]) * 20 - (src[7] + src[10]) * 6 + (src[6] + src[11]) * 3 - (src[5] + src[12])); \
113 OP(dst[9], (src[9] + src[10]) * 20 - (src[8] + src[11]) * 6 + (src[7] + src[12]) * 3 - (src[6] + src[13])); \
114 OP(dst[10], (src[10] + src[11]) * 20 - (src[9] + src[12]) * 6 + (src[8] + src[13]) * 3 - (src[7] + src[14])); \
115 OP(dst[11], (src[11] + src[12]) * 20 - (src[10] + src[13]) * 6 + (src[9] + src[14]) * 3 - (src[8] + src[15])); \
116 OP(dst[12], (src[12] + src[13]) * 20 - (src[11] + src[14]) * 6 + (src[10] + src[15]) * 3 - (src[9] + src[16])); \
117 OP(dst[13], (src[13] + src[14]) * 20 - (src[12] + src[15]) * 6 + (src[11] + src[16]) * 3 - (src[10] + src[16])); \
118 OP(dst[14], (src[14] + src[15]) * 20 - (src[13] + src[16]) * 6 + (src[12] + src[16]) * 3 - (src[11] + src[15])); \
119 OP(dst[15], (src[15] + src[16]) * 20 - (src[14] + src[16]) * 6 + (src[13] + src[15]) * 3 - (src[12] + src[14])); \
125 static void OPNAME ## mpeg4_qpel16_v_lowpass(uint8_t *dst, \
126 const uint8_t *src, \
127 int dstStride, int srcStride) \
129 const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \
133 for (i = 0; i < w; i++) { \
134 const int src0 = src[0 * srcStride]; \
135 const int src1 = src[1 * srcStride]; \
136 const int src2 = src[2 * srcStride]; \
137 const int src3 = src[3 * srcStride]; \
138 const int src4 = src[4 * srcStride]; \
139 const int src5 = src[5 * srcStride]; \
140 const int src6 = src[6 * srcStride]; \
141 const int src7 = src[7 * srcStride]; \
142 const int src8 = src[8 * srcStride]; \
143 const int src9 = src[9 * srcStride]; \
144 const int src10 = src[10 * srcStride]; \
145 const int src11 = src[11 * srcStride]; \
146 const int src12 = src[12 * srcStride]; \
147 const int src13 = src[13 * srcStride]; \
148 const int src14 = src[14 * srcStride]; \
149 const int src15 = src[15 * srcStride]; \
150 const int src16 = src[16 * srcStride]; \
151 OP(dst[0 * dstStride], (src0 + src1) * 20 - (src0 + src2) * 6 + (src1 + src3) * 3 - (src2 + src4)); \
152 OP(dst[1 * dstStride], (src1 + src2) * 20 - (src0 + src3) * 6 + (src0 + src4) * 3 - (src1 + src5)); \
153 OP(dst[2 * dstStride], (src2 + src3) * 20 - (src1 + src4) * 6 + (src0 + src5) * 3 - (src0 + src6)); \
154 OP(dst[3 * dstStride], (src3 + src4) * 20 - (src2 + src5) * 6 + (src1 + src6) * 3 - (src0 + src7)); \
155 OP(dst[4 * dstStride], (src4 + src5) * 20 - (src3 + src6) * 6 + (src2 + src7) * 3 - (src1 + src8)); \
156 OP(dst[5 * dstStride], (src5 + src6) * 20 - (src4 + src7) * 6 + (src3 + src8) * 3 - (src2 + src9)); \
157 OP(dst[6 * dstStride], (src6 + src7) * 20 - (src5 + src8) * 6 + (src4 + src9) * 3 - (src3 + src10)); \
158 OP(dst[7 * dstStride], (src7 + src8) * 20 - (src6 + src9) * 6 + (src5 + src10) * 3 - (src4 + src11)); \
159 OP(dst[8 * dstStride], (src8 + src9) * 20 - (src7 + src10) * 6 + (src6 + src11) * 3 - (src5 + src12)); \
160 OP(dst[9 * dstStride], (src9 + src10) * 20 - (src8 + src11) * 6 + (src7 + src12) * 3 - (src6 + src13)); \
161 OP(dst[10 * dstStride], (src10 + src11) * 20 - (src9 + src12) * 6 + (src8 + src13) * 3 - (src7 + src14)); \
162 OP(dst[11 * dstStride], (src11 + src12) * 20 - (src10 + src13) * 6 + (src9 + src14) * 3 - (src8 + src15)); \
163 OP(dst[12 * dstStride], (src12 + src13) * 20 - (src11 + src14) * 6 + (src10 + src15) * 3 - (src9 + src16)); \
164 OP(dst[13 * dstStride], (src13 + src14) * 20 - (src12 + src15) * 6 + (src11 + src16) * 3 - (src10 + src16)); \
165 OP(dst[14 * dstStride], (src14 + src15) * 20 - (src13 + src16) * 6 + (src12 + src16) * 3 - (src11 + src15)); \
166 OP(dst[15 * dstStride], (src15 + src16) * 20 - (src14 + src16) * 6 + (src13 + src15) * 3 - (src12 + src14)); \
172 static void OPNAME ## qpel8_mc10_c(uint8_t *dst, const uint8_t *src, \
177 put ## RND ## mpeg4_qpel8_h_lowpass(half, src, 8, stride, 8); \
178 OPNAME ## pixels8_l2_8(dst, src, half, stride, stride, 8, 8); \
181 static void OPNAME ## qpel8_mc20_c(uint8_t *dst, const uint8_t *src, \
184 OPNAME ## mpeg4_qpel8_h_lowpass(dst, src, stride, stride, 8); \
187 static void OPNAME ## qpel8_mc30_c(uint8_t *dst, const uint8_t *src, \
192 put ## RND ## mpeg4_qpel8_h_lowpass(half, src, 8, stride, 8); \
193 OPNAME ## pixels8_l2_8(dst, src + 1, half, stride, stride, 8, 8); \
196 static void OPNAME ## qpel8_mc01_c(uint8_t *dst, const uint8_t *src, \
199 uint8_t full[16 * 9]; \
202 copy_block8(full, src, 16, stride, 9); \
203 put ## RND ## mpeg4_qpel8_v_lowpass(half, full, 8, 16); \
204 OPNAME ## pixels8_l2_8(dst, full, half, stride, 16, 8, 8); \
207 static void OPNAME ## qpel8_mc02_c(uint8_t *dst, const uint8_t *src, \
210 uint8_t full[16 * 9]; \
212 copy_block8(full, src, 16, stride, 9); \
213 OPNAME ## mpeg4_qpel8_v_lowpass(dst, full, stride, 16); \
216 static void OPNAME ## qpel8_mc03_c(uint8_t *dst, const uint8_t *src, \
219 uint8_t full[16 * 9]; \
222 copy_block8(full, src, 16, stride, 9); \
223 put ## RND ## mpeg4_qpel8_v_lowpass(half, full, 8, 16); \
224 OPNAME ## pixels8_l2_8(dst, full + 16, half, stride, 16, 8, 8); \
227 void ff_ ## OPNAME ## qpel8_mc11_old_c(uint8_t *dst, const uint8_t *src, \
230 uint8_t full[16 * 9]; \
233 uint8_t halfHV[64]; \
235 copy_block9(full, src, 16, stride, 9); \
236 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
237 put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full, 8, 16); \
238 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
239 OPNAME ## pixels8_l4_8(dst, full, halfH, halfV, halfHV, \
240 stride, 16, 8, 8, 8, 8); \
243 static void OPNAME ## qpel8_mc11_c(uint8_t *dst, const uint8_t *src, \
246 uint8_t full[16 * 9]; \
248 uint8_t halfHV[64]; \
250 copy_block9(full, src, 16, stride, 9); \
251 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
252 put ## RND ## pixels8_l2_8(halfH, halfH, full, 8, 8, 16, 9); \
253 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
254 OPNAME ## pixels8_l2_8(dst, halfH, halfHV, stride, 8, 8, 8); \
257 void ff_ ## OPNAME ## qpel8_mc31_old_c(uint8_t *dst, const uint8_t *src, \
260 uint8_t full[16 * 9]; \
263 uint8_t halfHV[64]; \
265 copy_block9(full, src, 16, stride, 9); \
266 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
267 put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full + 1, 8, 16); \
268 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
269 OPNAME ## pixels8_l4_8(dst, full + 1, halfH, halfV, halfHV, \
270 stride, 16, 8, 8, 8, 8); \
273 static void OPNAME ## qpel8_mc31_c(uint8_t *dst, const uint8_t *src, \
276 uint8_t full[16 * 9]; \
278 uint8_t halfHV[64]; \
280 copy_block9(full, src, 16, stride, 9); \
281 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
282 put ## RND ## pixels8_l2_8(halfH, halfH, full + 1, 8, 8, 16, 9); \
283 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
284 OPNAME ## pixels8_l2_8(dst, halfH, halfHV, stride, 8, 8, 8); \
287 void ff_ ## OPNAME ## qpel8_mc13_old_c(uint8_t *dst, const uint8_t *src, \
290 uint8_t full[16 * 9]; \
293 uint8_t halfHV[64]; \
295 copy_block9(full, src, 16, stride, 9); \
296 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
297 put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full, 8, 16); \
298 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
299 OPNAME ## pixels8_l4_8(dst, full + 16, halfH + 8, halfV, halfHV, \
300 stride, 16, 8, 8, 8, 8); \
303 static void OPNAME ## qpel8_mc13_c(uint8_t *dst, const uint8_t *src, \
306 uint8_t full[16 * 9]; \
308 uint8_t halfHV[64]; \
310 copy_block9(full, src, 16, stride, 9); \
311 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
312 put ## RND ## pixels8_l2_8(halfH, halfH, full, 8, 8, 16, 9); \
313 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
314 OPNAME ## pixels8_l2_8(dst, halfH + 8, halfHV, stride, 8, 8, 8); \
317 void ff_ ## OPNAME ## qpel8_mc33_old_c(uint8_t *dst, const uint8_t *src, \
320 uint8_t full[16 * 9]; \
323 uint8_t halfHV[64]; \
325 copy_block9(full, src, 16, stride, 9); \
326 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
327 put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full + 1, 8, 16); \
328 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
329 OPNAME ## pixels8_l4_8(dst, full + 17, halfH + 8, halfV, halfHV, \
330 stride, 16, 8, 8, 8, 8); \
333 static void OPNAME ## qpel8_mc33_c(uint8_t *dst, const uint8_t *src, \
336 uint8_t full[16 * 9]; \
338 uint8_t halfHV[64]; \
340 copy_block9(full, src, 16, stride, 9); \
341 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
342 put ## RND ## pixels8_l2_8(halfH, halfH, full + 1, 8, 8, 16, 9); \
343 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
344 OPNAME ## pixels8_l2_8(dst, halfH + 8, halfHV, stride, 8, 8, 8); \
347 static void OPNAME ## qpel8_mc21_c(uint8_t *dst, const uint8_t *src, \
351 uint8_t halfHV[64]; \
353 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, src, 8, stride, 9); \
354 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
355 OPNAME ## pixels8_l2_8(dst, halfH, halfHV, stride, 8, 8, 8); \
358 static void OPNAME ## qpel8_mc23_c(uint8_t *dst, const uint8_t *src, \
362 uint8_t halfHV[64]; \
364 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, src, 8, stride, 9); \
365 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
366 OPNAME ## pixels8_l2_8(dst, halfH + 8, halfHV, stride, 8, 8, 8); \
369 void ff_ ## OPNAME ## qpel8_mc12_old_c(uint8_t *dst, const uint8_t *src, \
372 uint8_t full[16 * 9]; \
375 uint8_t halfHV[64]; \
377 copy_block9(full, src, 16, stride, 9); \
378 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
379 put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full, 8, 16); \
380 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
381 OPNAME ## pixels8_l2_8(dst, halfV, halfHV, stride, 8, 8, 8); \
384 static void OPNAME ## qpel8_mc12_c(uint8_t *dst, const uint8_t *src, \
387 uint8_t full[16 * 9]; \
390 copy_block9(full, src, 16, stride, 9); \
391 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
392 put ## RND ## pixels8_l2_8(halfH, halfH, full, 8, 8, 16, 9); \
393 OPNAME ## mpeg4_qpel8_v_lowpass(dst, halfH, stride, 8); \
396 void ff_ ## OPNAME ## qpel8_mc32_old_c(uint8_t *dst, const uint8_t *src, \
399 uint8_t full[16 * 9]; \
402 uint8_t halfHV[64]; \
404 copy_block9(full, src, 16, stride, 9); \
405 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
406 put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full + 1, 8, 16); \
407 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
408 OPNAME ## pixels8_l2_8(dst, halfV, halfHV, stride, 8, 8, 8); \
411 static void OPNAME ## qpel8_mc32_c(uint8_t *dst, const uint8_t *src, \
414 uint8_t full[16 * 9]; \
417 copy_block9(full, src, 16, stride, 9); \
418 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
419 put ## RND ## pixels8_l2_8(halfH, halfH, full + 1, 8, 8, 16, 9); \
420 OPNAME ## mpeg4_qpel8_v_lowpass(dst, halfH, stride, 8); \
423 static void OPNAME ## qpel8_mc22_c(uint8_t *dst, const uint8_t *src, \
428 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, src, 8, stride, 9); \
429 OPNAME ## mpeg4_qpel8_v_lowpass(dst, halfH, stride, 8); \
432 static void OPNAME ## qpel16_mc10_c(uint8_t *dst, const uint8_t *src, \
437 put ## RND ## mpeg4_qpel16_h_lowpass(half, src, 16, stride, 16); \
438 OPNAME ## pixels16_l2_8(dst, src, half, stride, stride, 16, 16); \
441 static void OPNAME ## qpel16_mc20_c(uint8_t *dst, const uint8_t *src, \
444 OPNAME ## mpeg4_qpel16_h_lowpass(dst, src, stride, stride, 16); \
447 static void OPNAME ## qpel16_mc30_c(uint8_t *dst, const uint8_t *src, \
452 put ## RND ## mpeg4_qpel16_h_lowpass(half, src, 16, stride, 16); \
453 OPNAME ## pixels16_l2_8(dst, src + 1, half, stride, stride, 16, 16); \
456 static void OPNAME ## qpel16_mc01_c(uint8_t *dst, const uint8_t *src, \
459 uint8_t full[24 * 17]; \
462 copy_block16(full, src, 24, stride, 17); \
463 put ## RND ## mpeg4_qpel16_v_lowpass(half, full, 16, 24); \
464 OPNAME ## pixels16_l2_8(dst, full, half, stride, 24, 16, 16); \
467 static void OPNAME ## qpel16_mc02_c(uint8_t *dst, const uint8_t *src, \
470 uint8_t full[24 * 17]; \
472 copy_block16(full, src, 24, stride, 17); \
473 OPNAME ## mpeg4_qpel16_v_lowpass(dst, full, stride, 24); \
476 static void OPNAME ## qpel16_mc03_c(uint8_t *dst, const uint8_t *src, \
479 uint8_t full[24 * 17]; \
482 copy_block16(full, src, 24, stride, 17); \
483 put ## RND ## mpeg4_qpel16_v_lowpass(half, full, 16, 24); \
484 OPNAME ## pixels16_l2_8(dst, full + 24, half, stride, 24, 16, 16); \
487 void ff_ ## OPNAME ## qpel16_mc11_old_c(uint8_t *dst, const uint8_t *src, \
490 uint8_t full[24 * 17]; \
491 uint8_t halfH[272]; \
492 uint8_t halfV[256]; \
493 uint8_t halfHV[256]; \
495 copy_block17(full, src, 24, stride, 17); \
496 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
497 put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full, 16, 24); \
498 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
499 OPNAME ## pixels16_l4_8(dst, full, halfH, halfV, halfHV, \
500 stride, 24, 16, 16, 16, 16); \
503 static void OPNAME ## qpel16_mc11_c(uint8_t *dst, const uint8_t *src, \
506 uint8_t full[24 * 17]; \
507 uint8_t halfH[272]; \
508 uint8_t halfHV[256]; \
510 copy_block17(full, src, 24, stride, 17); \
511 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
512 put ## RND ## pixels16_l2_8(halfH, halfH, full, 16, 16, 24, 17); \
513 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
514 OPNAME ## pixels16_l2_8(dst, halfH, halfHV, stride, 16, 16, 16); \
517 void ff_ ## OPNAME ## qpel16_mc31_old_c(uint8_t *dst, const uint8_t *src, \
520 uint8_t full[24 * 17]; \
521 uint8_t halfH[272]; \
522 uint8_t halfV[256]; \
523 uint8_t halfHV[256]; \
525 copy_block17(full, src, 24, stride, 17); \
526 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
527 put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full + 1, 16, 24); \
528 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
529 OPNAME ## pixels16_l4_8(dst, full + 1, halfH, halfV, halfHV, \
530 stride, 24, 16, 16, 16, 16); \
533 static void OPNAME ## qpel16_mc31_c(uint8_t *dst, const uint8_t *src, \
536 uint8_t full[24 * 17]; \
537 uint8_t halfH[272]; \
538 uint8_t halfHV[256]; \
540 copy_block17(full, src, 24, stride, 17); \
541 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
542 put ## RND ## pixels16_l2_8(halfH, halfH, full + 1, 16, 16, 24, 17); \
543 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
544 OPNAME ## pixels16_l2_8(dst, halfH, halfHV, stride, 16, 16, 16); \
547 void ff_ ## OPNAME ## qpel16_mc13_old_c(uint8_t *dst, const uint8_t *src, \
550 uint8_t full[24 * 17]; \
551 uint8_t halfH[272]; \
552 uint8_t halfV[256]; \
553 uint8_t halfHV[256]; \
555 copy_block17(full, src, 24, stride, 17); \
556 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
557 put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full, 16, 24); \
558 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
559 OPNAME ## pixels16_l4_8(dst, full + 24, halfH + 16, halfV, halfHV, \
560 stride, 24, 16, 16, 16, 16); \
563 static void OPNAME ## qpel16_mc13_c(uint8_t *dst, const uint8_t *src, \
566 uint8_t full[24 * 17]; \
567 uint8_t halfH[272]; \
568 uint8_t halfHV[256]; \
570 copy_block17(full, src, 24, stride, 17); \
571 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
572 put ## RND ## pixels16_l2_8(halfH, halfH, full, 16, 16, 24, 17); \
573 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
574 OPNAME ## pixels16_l2_8(dst, halfH + 16, halfHV, stride, 16, 16, 16); \
577 void ff_ ## OPNAME ## qpel16_mc33_old_c(uint8_t *dst, const uint8_t *src, \
580 uint8_t full[24 * 17]; \
581 uint8_t halfH[272]; \
582 uint8_t halfV[256]; \
583 uint8_t halfHV[256]; \
585 copy_block17(full, src, 24, stride, 17); \
586 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
587 put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full + 1, 16, 24); \
588 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
589 OPNAME ## pixels16_l4_8(dst, full + 25, halfH + 16, halfV, halfHV, \
590 stride, 24, 16, 16, 16, 16); \
593 static void OPNAME ## qpel16_mc33_c(uint8_t *dst, const uint8_t *src, \
596 uint8_t full[24 * 17]; \
597 uint8_t halfH[272]; \
598 uint8_t halfHV[256]; \
600 copy_block17(full, src, 24, stride, 17); \
601 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
602 put ## RND ## pixels16_l2_8(halfH, halfH, full + 1, 16, 16, 24, 17); \
603 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
604 OPNAME ## pixels16_l2_8(dst, halfH + 16, halfHV, stride, 16, 16, 16); \
607 static void OPNAME ## qpel16_mc21_c(uint8_t *dst, const uint8_t *src, \
610 uint8_t halfH[272]; \
611 uint8_t halfHV[256]; \
613 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, src, 16, stride, 17); \
614 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
615 OPNAME ## pixels16_l2_8(dst, halfH, halfHV, stride, 16, 16, 16); \
618 static void OPNAME ## qpel16_mc23_c(uint8_t *dst, const uint8_t *src, \
621 uint8_t halfH[272]; \
622 uint8_t halfHV[256]; \
624 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, src, 16, stride, 17); \
625 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
626 OPNAME ## pixels16_l2_8(dst, halfH + 16, halfHV, stride, 16, 16, 16); \
629 void ff_ ## OPNAME ## qpel16_mc12_old_c(uint8_t *dst, const uint8_t *src, \
632 uint8_t full[24 * 17]; \
633 uint8_t halfH[272]; \
634 uint8_t halfV[256]; \
635 uint8_t halfHV[256]; \
637 copy_block17(full, src, 24, stride, 17); \
638 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
639 put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full, 16, 24); \
640 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
641 OPNAME ## pixels16_l2_8(dst, halfV, halfHV, stride, 16, 16, 16); \
644 static void OPNAME ## qpel16_mc12_c(uint8_t *dst, const uint8_t *src, \
647 uint8_t full[24 * 17]; \
648 uint8_t halfH[272]; \
650 copy_block17(full, src, 24, stride, 17); \
651 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
652 put ## RND ## pixels16_l2_8(halfH, halfH, full, 16, 16, 24, 17); \
653 OPNAME ## mpeg4_qpel16_v_lowpass(dst, halfH, stride, 16); \
656 void ff_ ## OPNAME ## qpel16_mc32_old_c(uint8_t *dst, const uint8_t *src, \
659 uint8_t full[24 * 17]; \
660 uint8_t halfH[272]; \
661 uint8_t halfV[256]; \
662 uint8_t halfHV[256]; \
664 copy_block17(full, src, 24, stride, 17); \
665 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
666 put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full + 1, 16, 24); \
667 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
668 OPNAME ## pixels16_l2_8(dst, halfV, halfHV, stride, 16, 16, 16); \
671 static void OPNAME ## qpel16_mc32_c(uint8_t *dst, const uint8_t *src, \
674 uint8_t full[24 * 17]; \
675 uint8_t halfH[272]; \
677 copy_block17(full, src, 24, stride, 17); \
678 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
679 put ## RND ## pixels16_l2_8(halfH, halfH, full + 1, 16, 16, 24, 17); \
680 OPNAME ## mpeg4_qpel16_v_lowpass(dst, halfH, stride, 16); \
683 static void OPNAME ## qpel16_mc22_c(uint8_t *dst, const uint8_t *src, \
686 uint8_t halfH[272]; \
688 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, src, 16, stride, 17); \
689 OPNAME ## mpeg4_qpel16_v_lowpass(dst, halfH, stride, 16); \
692 #define op_avg(a, b) a = (((a) + cm[((b) + 16) >> 5] + 1) >> 1)
693 #define op_put(a, b) a = cm[((b) + 16) >> 5]
694 #define op_put_no_rnd(a, b) a = cm[((b) + 15) >> 5]
724 #define put_qpel8_mc00_c ff_put_pixels8x8_c
725 #define avg_qpel8_mc00_c ff_avg_pixels8x8_c
726 #define put_qpel16_mc00_c ff_put_pixels16x16_c
727 #define avg_qpel16_mc00_c ff_avg_pixels16x16_c
728 #define put_no_rnd_qpel8_mc00_c ff_put_pixels8x8_c
729 #define put_no_rnd_qpel16_mc00_c ff_put_pixels16x16_c
732 int dst_stride,
int src_stride1,
int src_stride2,
735 put_pixels8_l2_8(
dst,
src1,
src2, dst_stride, src_stride1, src_stride2,
h);
739 #if CONFIG_DIRAC_DECODER
740 #define DIRAC_MC(OPNAME)\
741 void ff_ ## OPNAME ## _dirac_pixels8_c(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
743 OPNAME ## _pixels8_8_c(dst, src[0], stride, h);\
745 void ff_ ## OPNAME ## _dirac_pixels16_c(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
747 OPNAME ## _pixels16_8_c(dst, src[0], stride, h);\
749 void ff_ ## OPNAME ## _dirac_pixels32_c(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
751 OPNAME ## _pixels16_8_c(dst , src[0] , stride, h);\
752 OPNAME ## _pixels16_8_c(dst+16, src[0]+16, stride, h);\
754 void ff_ ## OPNAME ## _dirac_pixels8_l2_c(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
756 OPNAME ## _pixels8_l2_8(dst, src[0], src[1], stride, stride, stride, h);\
758 void ff_ ## OPNAME ## _dirac_pixels16_l2_c(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
760 OPNAME ## _pixels16_l2_8(dst, src[0], src[1], stride, stride, stride, h);\
762 void ff_ ## OPNAME ## _dirac_pixels32_l2_c(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
764 OPNAME ## _pixels16_l2_8(dst , src[0] , src[1] , stride, stride, stride, h);\
765 OPNAME ## _pixels16_l2_8(dst+16, src[0]+16, src[1]+16, stride, stride, stride, h);\
767 void ff_ ## OPNAME ## _dirac_pixels8_l4_c(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
769 OPNAME ## _pixels8_l4_8(dst, src[0], src[1], src[2], src[3], stride, stride, stride, stride, stride, h);\
771 void ff_ ## OPNAME ## _dirac_pixels16_l4_c(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
773 OPNAME ## _pixels16_l4_8(dst, src[0], src[1], src[2], src[3], stride, stride, stride, stride, stride, h);\
775 void ff_ ## OPNAME ## _dirac_pixels32_l4_c(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
777 OPNAME ## _pixels16_l4_8(dst , src[0] , src[1] , src[2] , src[3] , stride, stride, stride, stride, stride, h);\
778 OPNAME ## _pixels16_l4_8(dst+16, src[0]+16, src[1]+16, src[2]+16, src[3]+16, stride, stride, stride, stride, stride, h);\
786 #define dspfunc(PFX, IDX, NUM) \
787 c->PFX ## _pixels_tab[IDX][0] = PFX ## NUM ## _mc00_c; \
788 c->PFX ## _pixels_tab[IDX][1] = PFX ## NUM ## _mc10_c; \
789 c->PFX ## _pixels_tab[IDX][2] = PFX ## NUM ## _mc20_c; \
790 c->PFX ## _pixels_tab[IDX][3] = PFX ## NUM ## _mc30_c; \
791 c->PFX ## _pixels_tab[IDX][4] = PFX ## NUM ## _mc01_c; \
792 c->PFX ## _pixels_tab[IDX][5] = PFX ## NUM ## _mc11_c; \
793 c->PFX ## _pixels_tab[IDX][6] = PFX ## NUM ## _mc21_c; \
794 c->PFX ## _pixels_tab[IDX][7] = PFX ## NUM ## _mc31_c; \
795 c->PFX ## _pixels_tab[IDX][8] = PFX ## NUM ## _mc02_c; \
796 c->PFX ## _pixels_tab[IDX][9] = PFX ## NUM ## _mc12_c; \
797 c->PFX ## _pixels_tab[IDX][10] = PFX ## NUM ## _mc22_c; \
798 c->PFX ## _pixels_tab[IDX][11] = PFX ## NUM ## _mc32_c; \
799 c->PFX ## _pixels_tab[IDX][12] = PFX ## NUM ## _mc03_c; \
800 c->PFX ## _pixels_tab[IDX][13] = PFX ## NUM ## _mc13_c; \
801 c->PFX ## _pixels_tab[IDX][14] = PFX ## NUM ## _mc23_c; \
802 c->PFX ## _pixels_tab[IDX][15] = PFX ## NUM ## _mc33_c
807 dspfunc(put_no_rnd_qpel, 0, 16);
808 dspfunc(put_no_rnd_qpel, 1, 8);
av_cold void ff_qpeldsp_init(QpelDSPContext *c)
void ff_avg_pixels8x8_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)
#define op_put_no_rnd(a, b)
void ff_qpeldsp_init_x86(QpelDSPContext *c)
void ff_put_pixels8_l2_8(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, int src_stride1, int src_stride2, int h)
void ff_put_pixels8x8_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)
#define QPEL_MC(r, OPNAME, RND, OP)
void ff_put_pixels16x16_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
void ff_avg_pixels16x16_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
#define dspfunc(PFX, IDX, NUM)
void ff_qpeldsp_init_mips(QpelDSPContext *c)