]> git.sesse.net Git - ffmpeg/blob - libavcodec/dsputil_template.c
Merge commit 'ed1b01131e662c9086b27aaaea69684d8575fbea'
[ffmpeg] / libavcodec / dsputil_template.c
1 /*
2  * DSP utils
3  * Copyright (c) 2000, 2001 Fabrice Bellard
4  * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
5  *
6  * gmc & q-pel & 32/64 bit based MC by Michael Niedermayer <michaelni@gmx.at>
7  *
8  * This file is part of FFmpeg.
9  *
10  * FFmpeg is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2.1 of the License, or (at your option) any later version.
14  *
15  * FFmpeg is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with FFmpeg; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23  */
24
25 /**
26  * @file
27  * DSP utils
28  */
29
30 #include "bit_depth_template.c"
31
32 static inline void FUNC(copy_block2)(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
33 {
34     int i;
35     for(i=0; i<h; i++)
36     {
37         AV_WN2P(dst   , AV_RN2P(src   ));
38         dst+=dstStride;
39         src+=srcStride;
40     }
41 }
42
43 static inline void FUNC(copy_block4)(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
44 {
45     int i;
46     for(i=0; i<h; i++)
47     {
48         AV_WN4P(dst   , AV_RN4P(src   ));
49         dst+=dstStride;
50         src+=srcStride;
51     }
52 }
53
54 static inline void FUNC(copy_block8)(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
55 {
56     int i;
57     for(i=0; i<h; i++)
58     {
59         AV_WN4P(dst                , AV_RN4P(src                ));
60         AV_WN4P(dst+4*sizeof(pixel), AV_RN4P(src+4*sizeof(pixel)));
61         dst+=dstStride;
62         src+=srcStride;
63     }
64 }
65
66 static inline void FUNC(copy_block16)(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
67 {
68     int i;
69     for(i=0; i<h; i++)
70     {
71         AV_WN4P(dst                 , AV_RN4P(src                 ));
72         AV_WN4P(dst+ 4*sizeof(pixel), AV_RN4P(src+ 4*sizeof(pixel)));
73         AV_WN4P(dst+ 8*sizeof(pixel), AV_RN4P(src+ 8*sizeof(pixel)));
74         AV_WN4P(dst+12*sizeof(pixel), AV_RN4P(src+12*sizeof(pixel)));
75         dst+=dstStride;
76         src+=srcStride;
77     }
78 }
79
80 /* draw the edges of width 'w' of an image of size width, height */
81 //FIXME check that this is ok for mpeg4 interlaced
82 static void FUNCC(draw_edges)(uint8_t *p_buf, int p_wrap, int width, int height, int w, int h, int sides)
83 {
84     pixel *buf = (pixel*)p_buf;
85     int wrap = p_wrap / sizeof(pixel);
86     pixel *ptr, *last_line;
87     int i;
88
89     /* left and right */
90     ptr = buf;
91     for(i=0;i<height;i++) {
92 #if BIT_DEPTH > 8
93         int j;
94         for (j = 0; j < w; j++) {
95             ptr[j-w] = ptr[0];
96             ptr[j+width] = ptr[width-1];
97         }
98 #else
99         memset(ptr - w, ptr[0], w);
100         memset(ptr + width, ptr[width-1], w);
101 #endif
102         ptr += wrap;
103     }
104
105     /* top and bottom + corners */
106     buf -= w;
107     last_line = buf + (height - 1) * wrap;
108     if (sides & EDGE_TOP)
109         for(i = 0; i < h; i++)
110             memcpy(buf - (i + 1) * wrap, buf, (width + w + w) * sizeof(pixel)); // top
111     if (sides & EDGE_BOTTOM)
112         for (i = 0; i < h; i++)
113             memcpy(last_line + (i + 1) * wrap, last_line, (width + w + w) * sizeof(pixel)); // bottom
114 }
115
116 #define DCTELEM_FUNCS(dctcoef, suffix)                                  \
117 static void FUNCC(get_pixels ## suffix)(DCTELEM *av_restrict _block,    \
118                                         const uint8_t *_pixels,         \
119                                         int line_size)                  \
120 {                                                                       \
121     const pixel *pixels = (const pixel *) _pixels;                      \
122     dctcoef *av_restrict block = (dctcoef *) _block;                    \
123     int i;                                                              \
124                                                                         \
125     /* read the pixels */                                               \
126     for(i=0;i<8;i++) {                                                  \
127         block[0] = pixels[0];                                           \
128         block[1] = pixels[1];                                           \
129         block[2] = pixels[2];                                           \
130         block[3] = pixels[3];                                           \
131         block[4] = pixels[4];                                           \
132         block[5] = pixels[5];                                           \
133         block[6] = pixels[6];                                           \
134         block[7] = pixels[7];                                           \
135         pixels += line_size / sizeof(pixel);                            \
136         block += 8;                                                     \
137     }                                                                   \
138 }                                                                       \
139                                                                         \
140 static void FUNCC(add_pixels8 ## suffix)(uint8_t *av_restrict _pixels,  \
141                                          DCTELEM *_block,               \
142                                          int line_size)                 \
143 {                                                                       \
144     int i;                                                              \
145     pixel *av_restrict pixels = (pixel *av_restrict)_pixels;            \
146     dctcoef *block = (dctcoef*)_block;                                  \
147     line_size /= sizeof(pixel);                                         \
148                                                                         \
149     for(i=0;i<8;i++) {                                                  \
150         pixels[0] += block[0];                                          \
151         pixels[1] += block[1];                                          \
152         pixels[2] += block[2];                                          \
153         pixels[3] += block[3];                                          \
154         pixels[4] += block[4];                                          \
155         pixels[5] += block[5];                                          \
156         pixels[6] += block[6];                                          \
157         pixels[7] += block[7];                                          \
158         pixels += line_size;                                            \
159         block += 8;                                                     \
160     }                                                                   \
161 }                                                                       \
162                                                                         \
163 static void FUNCC(add_pixels4 ## suffix)(uint8_t *av_restrict _pixels,  \
164                                          DCTELEM *_block,               \
165                                          int line_size)                 \
166 {                                                                       \
167     int i;                                                              \
168     pixel *av_restrict pixels = (pixel *av_restrict)_pixels;            \
169     dctcoef *block = (dctcoef*)_block;                                  \
170     line_size /= sizeof(pixel);                                         \
171                                                                         \
172     for(i=0;i<4;i++) {                                                  \
173         pixels[0] += block[0];                                          \
174         pixels[1] += block[1];                                          \
175         pixels[2] += block[2];                                          \
176         pixels[3] += block[3];                                          \
177         pixels += line_size;                                            \
178         block += 4;                                                     \
179     }                                                                   \
180 }                                                                       \
181                                                                         \
182 static void FUNCC(clear_block ## suffix)(DCTELEM *block)                \
183 {                                                                       \
184     memset(block, 0, sizeof(dctcoef)*64);                               \
185 }                                                                       \
186                                                                         \
187 /**                                                                     \
188  * memset(blocks, 0, sizeof(DCTELEM)*6*64)                              \
189  */                                                                     \
190 static void FUNCC(clear_blocks ## suffix)(DCTELEM *blocks)              \
191 {                                                                       \
192     memset(blocks, 0, sizeof(dctcoef)*6*64);                            \
193 }
194
195 DCTELEM_FUNCS(DCTELEM, _16)
196 #if BIT_DEPTH > 8
197 DCTELEM_FUNCS(dctcoef, _32)
198 #endif
199
200 #define PIXOP2(OPNAME, OP) \
201 static void FUNCC(OPNAME ## _pixels2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
202     int i;\
203     for(i=0; i<h; i++){\
204         OP(*((pixel2*)(block  )), AV_RN2P(pixels  ));\
205         pixels+=line_size;\
206         block +=line_size;\
207     }\
208 }\
209 static void FUNCC(OPNAME ## _pixels4)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
210     int i;\
211     for(i=0; i<h; i++){\
212         OP(*((pixel4*)(block  )), AV_RN4P(pixels  ));\
213         pixels+=line_size;\
214         block +=line_size;\
215     }\
216 }\
217 static void FUNCC(OPNAME ## _pixels8)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
218     int i;\
219     for(i=0; i<h; i++){\
220         OP(*((pixel4*)(block                )), AV_RN4P(pixels                ));\
221         OP(*((pixel4*)(block+4*sizeof(pixel))), AV_RN4P(pixels+4*sizeof(pixel)));\
222         pixels+=line_size;\
223         block +=line_size;\
224     }\
225 }\
226 static inline void FUNCC(OPNAME ## _no_rnd_pixels8)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
227     FUNCC(OPNAME ## _pixels8)(block, pixels, line_size, h);\
228 }\
229 \
230 static inline void FUNC(OPNAME ## _no_rnd_pixels8_l2)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
231                                                 int src_stride1, int src_stride2, int h){\
232     int i;\
233     for(i=0; i<h; i++){\
234         pixel4 a,b;\
235         a= AV_RN4P(&src1[i*src_stride1  ]);\
236         b= AV_RN4P(&src2[i*src_stride2  ]);\
237         OP(*((pixel4*)&dst[i*dst_stride  ]), no_rnd_avg_pixel4(a, b));\
238         a= AV_RN4P(&src1[i*src_stride1+4*sizeof(pixel)]);\
239         b= AV_RN4P(&src2[i*src_stride2+4*sizeof(pixel)]);\
240         OP(*((pixel4*)&dst[i*dst_stride+4*sizeof(pixel)]), no_rnd_avg_pixel4(a, b));\
241     }\
242 }\
243 \
244 static inline void FUNC(OPNAME ## _pixels8_l2)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
245                                                 int src_stride1, int src_stride2, int h){\
246     int i;\
247     for(i=0; i<h; i++){\
248         pixel4 a,b;\
249         a= AV_RN4P(&src1[i*src_stride1  ]);\
250         b= AV_RN4P(&src2[i*src_stride2  ]);\
251         OP(*((pixel4*)&dst[i*dst_stride  ]), rnd_avg_pixel4(a, b));\
252         a= AV_RN4P(&src1[i*src_stride1+4*sizeof(pixel)]);\
253         b= AV_RN4P(&src2[i*src_stride2+4*sizeof(pixel)]);\
254         OP(*((pixel4*)&dst[i*dst_stride+4*sizeof(pixel)]), rnd_avg_pixel4(a, b));\
255     }\
256 }\
257 \
258 static inline void FUNC(OPNAME ## _pixels4_l2)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
259                                                 int src_stride1, int src_stride2, int h){\
260     int i;\
261     for(i=0; i<h; i++){\
262         pixel4 a,b;\
263         a= AV_RN4P(&src1[i*src_stride1  ]);\
264         b= AV_RN4P(&src2[i*src_stride2  ]);\
265         OP(*((pixel4*)&dst[i*dst_stride  ]), rnd_avg_pixel4(a, b));\
266     }\
267 }\
268 \
269 static inline void FUNC(OPNAME ## _pixels2_l2)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
270                                                 int src_stride1, int src_stride2, int h){\
271     int i;\
272     for(i=0; i<h; i++){\
273         pixel4 a,b;\
274         a= AV_RN2P(&src1[i*src_stride1  ]);\
275         b= AV_RN2P(&src2[i*src_stride2  ]);\
276         OP(*((pixel2*)&dst[i*dst_stride  ]), rnd_avg_pixel4(a, b));\
277     }\
278 }\
279 \
280 static inline void FUNC(OPNAME ## _pixels16_l2)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
281                                                 int src_stride1, int src_stride2, int h){\
282     FUNC(OPNAME ## _pixels8_l2)(dst  , src1  , src2  , dst_stride, src_stride1, src_stride2, h);\
283     FUNC(OPNAME ## _pixels8_l2)(dst+8*sizeof(pixel), src1+8*sizeof(pixel), src2+8*sizeof(pixel), dst_stride, src_stride1, src_stride2, h);\
284 }\
285 \
286 static inline void FUNC(OPNAME ## _no_rnd_pixels16_l2)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
287                                                 int src_stride1, int src_stride2, int h){\
288     FUNC(OPNAME ## _no_rnd_pixels8_l2)(dst  , src1  , src2  , dst_stride, src_stride1, src_stride2, h);\
289     FUNC(OPNAME ## _no_rnd_pixels8_l2)(dst+8*sizeof(pixel), src1+8*sizeof(pixel), src2+8*sizeof(pixel), dst_stride, src_stride1, src_stride2, h);\
290 }\
291 \
292 static inline void FUNCC(OPNAME ## _no_rnd_pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
293     FUNC(OPNAME ## _no_rnd_pixels8_l2)(block, pixels, pixels+sizeof(pixel), line_size, line_size, line_size, h);\
294 }\
295 \
296 static inline void FUNCC(OPNAME ## _pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
297     FUNC(OPNAME ## _pixels8_l2)(block, pixels, pixels+sizeof(pixel), line_size, line_size, line_size, h);\
298 }\
299 \
300 static inline void FUNCC(OPNAME ## _no_rnd_pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
301     FUNC(OPNAME ## _no_rnd_pixels8_l2)(block, pixels, pixels+line_size, line_size, line_size, line_size, h);\
302 }\
303 \
304 static inline void FUNCC(OPNAME ## _pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
305     FUNC(OPNAME ## _pixels8_l2)(block, pixels, pixels+line_size, line_size, line_size, line_size, h);\
306 }\
307 \
308 static inline void FUNC(OPNAME ## _pixels8_l4)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, const uint8_t *src3, const uint8_t *src4,\
309                  int dst_stride, int src_stride1, int src_stride2,int src_stride3,int src_stride4, int h){\
310     /* FIXME HIGH BIT DEPTH */\
311     int i;\
312     for(i=0; i<h; i++){\
313         uint32_t a, b, c, d, l0, l1, h0, h1;\
314         a= AV_RN32(&src1[i*src_stride1]);\
315         b= AV_RN32(&src2[i*src_stride2]);\
316         c= AV_RN32(&src3[i*src_stride3]);\
317         d= AV_RN32(&src4[i*src_stride4]);\
318         l0=  (a&0x03030303UL)\
319            + (b&0x03030303UL)\
320            + 0x02020202UL;\
321         h0= ((a&0xFCFCFCFCUL)>>2)\
322           + ((b&0xFCFCFCFCUL)>>2);\
323         l1=  (c&0x03030303UL)\
324            + (d&0x03030303UL);\
325         h1= ((c&0xFCFCFCFCUL)>>2)\
326           + ((d&0xFCFCFCFCUL)>>2);\
327         OP(*((uint32_t*)&dst[i*dst_stride]), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
328         a= AV_RN32(&src1[i*src_stride1+4]);\
329         b= AV_RN32(&src2[i*src_stride2+4]);\
330         c= AV_RN32(&src3[i*src_stride3+4]);\
331         d= AV_RN32(&src4[i*src_stride4+4]);\
332         l0=  (a&0x03030303UL)\
333            + (b&0x03030303UL)\
334            + 0x02020202UL;\
335         h0= ((a&0xFCFCFCFCUL)>>2)\
336           + ((b&0xFCFCFCFCUL)>>2);\
337         l1=  (c&0x03030303UL)\
338            + (d&0x03030303UL);\
339         h1= ((c&0xFCFCFCFCUL)>>2)\
340           + ((d&0xFCFCFCFCUL)>>2);\
341         OP(*((uint32_t*)&dst[i*dst_stride+4]), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
342     }\
343 }\
344 \
345 static inline void FUNCC(OPNAME ## _pixels4_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
346     FUNC(OPNAME ## _pixels4_l2)(block, pixels, pixels+sizeof(pixel), line_size, line_size, line_size, h);\
347 }\
348 \
349 static inline void FUNCC(OPNAME ## _pixels4_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
350     FUNC(OPNAME ## _pixels4_l2)(block, pixels, pixels+line_size, line_size, line_size, line_size, h);\
351 }\
352 \
353 static inline void FUNCC(OPNAME ## _pixels2_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
354     FUNC(OPNAME ## _pixels2_l2)(block, pixels, pixels+sizeof(pixel), line_size, line_size, line_size, h);\
355 }\
356 \
357 static inline void FUNCC(OPNAME ## _pixels2_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
358     FUNC(OPNAME ## _pixels2_l2)(block, pixels, pixels+line_size, line_size, line_size, line_size, h);\
359 }\
360 \
361 static inline void FUNC(OPNAME ## _no_rnd_pixels8_l4)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, const uint8_t *src3, const uint8_t *src4,\
362                  int dst_stride, int src_stride1, int src_stride2,int src_stride3,int src_stride4, int h){\
363     /* FIXME HIGH BIT DEPTH*/\
364     int i;\
365     for(i=0; i<h; i++){\
366         uint32_t a, b, c, d, l0, l1, h0, h1;\
367         a= AV_RN32(&src1[i*src_stride1]);\
368         b= AV_RN32(&src2[i*src_stride2]);\
369         c= AV_RN32(&src3[i*src_stride3]);\
370         d= AV_RN32(&src4[i*src_stride4]);\
371         l0=  (a&0x03030303UL)\
372            + (b&0x03030303UL)\
373            + 0x01010101UL;\
374         h0= ((a&0xFCFCFCFCUL)>>2)\
375           + ((b&0xFCFCFCFCUL)>>2);\
376         l1=  (c&0x03030303UL)\
377            + (d&0x03030303UL);\
378         h1= ((c&0xFCFCFCFCUL)>>2)\
379           + ((d&0xFCFCFCFCUL)>>2);\
380         OP(*((uint32_t*)&dst[i*dst_stride]), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
381         a= AV_RN32(&src1[i*src_stride1+4]);\
382         b= AV_RN32(&src2[i*src_stride2+4]);\
383         c= AV_RN32(&src3[i*src_stride3+4]);\
384         d= AV_RN32(&src4[i*src_stride4+4]);\
385         l0=  (a&0x03030303UL)\
386            + (b&0x03030303UL)\
387            + 0x01010101UL;\
388         h0= ((a&0xFCFCFCFCUL)>>2)\
389           + ((b&0xFCFCFCFCUL)>>2);\
390         l1=  (c&0x03030303UL)\
391            + (d&0x03030303UL);\
392         h1= ((c&0xFCFCFCFCUL)>>2)\
393           + ((d&0xFCFCFCFCUL)>>2);\
394         OP(*((uint32_t*)&dst[i*dst_stride+4]), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
395     }\
396 }\
397 static inline void FUNC(OPNAME ## _pixels16_l4)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, const uint8_t *src3, const uint8_t *src4,\
398                  int dst_stride, int src_stride1, int src_stride2,int src_stride3,int src_stride4, int h){\
399     FUNC(OPNAME ## _pixels8_l4)(dst  , src1  , src2  , src3  , src4  , dst_stride, src_stride1, src_stride2, src_stride3, src_stride4, h);\
400     FUNC(OPNAME ## _pixels8_l4)(dst+8*sizeof(pixel), src1+8*sizeof(pixel), src2+8*sizeof(pixel), src3+8*sizeof(pixel), src4+8*sizeof(pixel), dst_stride, src_stride1, src_stride2, src_stride3, src_stride4, h);\
401 }\
402 static inline void FUNC(OPNAME ## _no_rnd_pixels16_l4)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, const uint8_t *src3, const uint8_t *src4,\
403                  int dst_stride, int src_stride1, int src_stride2,int src_stride3,int src_stride4, int h){\
404     FUNC(OPNAME ## _no_rnd_pixels8_l4)(dst  , src1  , src2  , src3  , src4  , dst_stride, src_stride1, src_stride2, src_stride3, src_stride4, h);\
405     FUNC(OPNAME ## _no_rnd_pixels8_l4)(dst+8*sizeof(pixel), src1+8*sizeof(pixel), src2+8*sizeof(pixel), src3+8*sizeof(pixel), src4+8*sizeof(pixel), dst_stride, src_stride1, src_stride2, src_stride3, src_stride4, h);\
406 }\
407 \
408 static inline void FUNCC(OPNAME ## _pixels2_xy2)(uint8_t *p_block, const uint8_t *p_pixels, int line_size, int h)\
409 {\
410         int i, a0, b0, a1, b1;\
411         pixel *block = (pixel*)p_block;\
412         const pixel *pixels = (const pixel*)p_pixels;\
413         line_size >>= sizeof(pixel)-1;\
414         a0= pixels[0];\
415         b0= pixels[1] + 2;\
416         a0 += b0;\
417         b0 += pixels[2];\
418 \
419         pixels+=line_size;\
420         for(i=0; i<h; i+=2){\
421             a1= pixels[0];\
422             b1= pixels[1];\
423             a1 += b1;\
424             b1 += pixels[2];\
425 \
426             block[0]= (a1+a0)>>2; /* FIXME non put */\
427             block[1]= (b1+b0)>>2;\
428 \
429             pixels+=line_size;\
430             block +=line_size;\
431 \
432             a0= pixels[0];\
433             b0= pixels[1] + 2;\
434             a0 += b0;\
435             b0 += pixels[2];\
436 \
437             block[0]= (a1+a0)>>2;\
438             block[1]= (b1+b0)>>2;\
439             pixels+=line_size;\
440             block +=line_size;\
441         }\
442 }\
443 \
444 static inline void FUNCC(OPNAME ## _pixels4_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)\
445 {\
446         /* FIXME HIGH BIT DEPTH */\
447         int i;\
448         const uint32_t a= AV_RN32(pixels  );\
449         const uint32_t b= AV_RN32(pixels+1);\
450         uint32_t l0=  (a&0x03030303UL)\
451                     + (b&0x03030303UL)\
452                     + 0x02020202UL;\
453         uint32_t h0= ((a&0xFCFCFCFCUL)>>2)\
454                    + ((b&0xFCFCFCFCUL)>>2);\
455         uint32_t l1,h1;\
456 \
457         pixels+=line_size;\
458         for(i=0; i<h; i+=2){\
459             uint32_t a= AV_RN32(pixels  );\
460             uint32_t b= AV_RN32(pixels+1);\
461             l1=  (a&0x03030303UL)\
462                + (b&0x03030303UL);\
463             h1= ((a&0xFCFCFCFCUL)>>2)\
464               + ((b&0xFCFCFCFCUL)>>2);\
465             OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
466             pixels+=line_size;\
467             block +=line_size;\
468             a= AV_RN32(pixels  );\
469             b= AV_RN32(pixels+1);\
470             l0=  (a&0x03030303UL)\
471                + (b&0x03030303UL)\
472                + 0x02020202UL;\
473             h0= ((a&0xFCFCFCFCUL)>>2)\
474               + ((b&0xFCFCFCFCUL)>>2);\
475             OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
476             pixels+=line_size;\
477             block +=line_size;\
478         }\
479 }\
480 \
481 static inline void FUNCC(OPNAME ## _pixels8_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)\
482 {\
483     /* FIXME HIGH BIT DEPTH */\
484     int j;\
485     for(j=0; j<2; j++){\
486         int i;\
487         const uint32_t a= AV_RN32(pixels  );\
488         const uint32_t b= AV_RN32(pixels+1);\
489         uint32_t l0=  (a&0x03030303UL)\
490                     + (b&0x03030303UL)\
491                     + 0x02020202UL;\
492         uint32_t h0= ((a&0xFCFCFCFCUL)>>2)\
493                    + ((b&0xFCFCFCFCUL)>>2);\
494         uint32_t l1,h1;\
495 \
496         pixels+=line_size;\
497         for(i=0; i<h; i+=2){\
498             uint32_t a= AV_RN32(pixels  );\
499             uint32_t b= AV_RN32(pixels+1);\
500             l1=  (a&0x03030303UL)\
501                + (b&0x03030303UL);\
502             h1= ((a&0xFCFCFCFCUL)>>2)\
503               + ((b&0xFCFCFCFCUL)>>2);\
504             OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
505             pixels+=line_size;\
506             block +=line_size;\
507             a= AV_RN32(pixels  );\
508             b= AV_RN32(pixels+1);\
509             l0=  (a&0x03030303UL)\
510                + (b&0x03030303UL)\
511                + 0x02020202UL;\
512             h0= ((a&0xFCFCFCFCUL)>>2)\
513               + ((b&0xFCFCFCFCUL)>>2);\
514             OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
515             pixels+=line_size;\
516             block +=line_size;\
517         }\
518         pixels+=4-line_size*(h+1);\
519         block +=4-line_size*h;\
520     }\
521 }\
522 \
523 static inline void FUNCC(OPNAME ## _no_rnd_pixels8_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)\
524 {\
525     /* FIXME HIGH BIT DEPTH */\
526     int j;\
527     for(j=0; j<2; j++){\
528         int i;\
529         const uint32_t a= AV_RN32(pixels  );\
530         const uint32_t b= AV_RN32(pixels+1);\
531         uint32_t l0=  (a&0x03030303UL)\
532                     + (b&0x03030303UL)\
533                     + 0x01010101UL;\
534         uint32_t h0= ((a&0xFCFCFCFCUL)>>2)\
535                    + ((b&0xFCFCFCFCUL)>>2);\
536         uint32_t l1,h1;\
537 \
538         pixels+=line_size;\
539         for(i=0; i<h; i+=2){\
540             uint32_t a= AV_RN32(pixels  );\
541             uint32_t b= AV_RN32(pixels+1);\
542             l1=  (a&0x03030303UL)\
543                + (b&0x03030303UL);\
544             h1= ((a&0xFCFCFCFCUL)>>2)\
545               + ((b&0xFCFCFCFCUL)>>2);\
546             OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
547             pixels+=line_size;\
548             block +=line_size;\
549             a= AV_RN32(pixels  );\
550             b= AV_RN32(pixels+1);\
551             l0=  (a&0x03030303UL)\
552                + (b&0x03030303UL)\
553                + 0x01010101UL;\
554             h0= ((a&0xFCFCFCFCUL)>>2)\
555               + ((b&0xFCFCFCFCUL)>>2);\
556             OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
557             pixels+=line_size;\
558             block +=line_size;\
559         }\
560         pixels+=4-line_size*(h+1);\
561         block +=4-line_size*h;\
562     }\
563 }\
564 \
565 CALL_2X_PIXELS(FUNCC(OPNAME ## _pixels16)    , FUNCC(OPNAME ## _pixels8)    , 8*sizeof(pixel))\
566 CALL_2X_PIXELS(FUNCC(OPNAME ## _pixels16_x2) , FUNCC(OPNAME ## _pixels8_x2) , 8*sizeof(pixel))\
567 CALL_2X_PIXELS(FUNCC(OPNAME ## _pixels16_y2) , FUNCC(OPNAME ## _pixels8_y2) , 8*sizeof(pixel))\
568 CALL_2X_PIXELS(FUNCC(OPNAME ## _pixels16_xy2), FUNCC(OPNAME ## _pixels8_xy2), 8*sizeof(pixel))\
569 av_unused CALL_2X_PIXELS(FUNCC(OPNAME ## _no_rnd_pixels16)    , FUNCC(OPNAME ## _pixels8) , 8*sizeof(pixel))\
570 CALL_2X_PIXELS(FUNCC(OPNAME ## _no_rnd_pixels16_x2) , FUNCC(OPNAME ## _no_rnd_pixels8_x2) , 8*sizeof(pixel))\
571 CALL_2X_PIXELS(FUNCC(OPNAME ## _no_rnd_pixels16_y2) , FUNCC(OPNAME ## _no_rnd_pixels8_y2) , 8*sizeof(pixel))\
572 CALL_2X_PIXELS(FUNCC(OPNAME ## _no_rnd_pixels16_xy2), FUNCC(OPNAME ## _no_rnd_pixels8_xy2), 8*sizeof(pixel))\
573
574 #define op_avg(a, b) a = rnd_avg_pixel4(a, b)
575 #define op_put(a, b) a = b
576
577 PIXOP2(avg, op_avg)
578 PIXOP2(put, op_put)
579 #undef op_avg
580 #undef op_put
581
582 #define put_no_rnd_pixels8_c  put_pixels8_c
583 #define put_no_rnd_pixels16_c put_pixels16_c
584
585 #define H264_CHROMA_MC(OPNAME, OP)\
586 static void FUNCC(OPNAME ## h264_chroma_mc2)(uint8_t *p_dst/*align 8*/, uint8_t *p_src/*align 1*/, int stride, int h, int x, int y){\
587     pixel *dst = (pixel*)p_dst;\
588     pixel *src = (pixel*)p_src;\
589     const int A=(8-x)*(8-y);\
590     const int B=(  x)*(8-y);\
591     const int C=(8-x)*(  y);\
592     const int D=(  x)*(  y);\
593     int i;\
594     stride >>= sizeof(pixel)-1;\
595     \
596     av_assert2(x<8 && y<8 && x>=0 && y>=0);\
597 \
598     if(D){\
599         for(i=0; i<h; i++){\
600             OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\
601             OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2]));\
602             dst+= stride;\
603             src+= stride;\
604         }\
605     }else{\
606         const int E= B+C;\
607         const int step= C ? stride : 1;\
608         for(i=0; i<h; i++){\
609             OP(dst[0], (A*src[0] + E*src[step+0]));\
610             OP(dst[1], (A*src[1] + E*src[step+1]));\
611             dst+= stride;\
612             src+= stride;\
613         }\
614     }\
615 }\
616 \
617 static void FUNCC(OPNAME ## h264_chroma_mc4)(uint8_t *p_dst/*align 8*/, uint8_t *p_src/*align 1*/, int stride, int h, int x, int y){\
618     pixel *dst = (pixel*)p_dst;\
619     pixel *src = (pixel*)p_src;\
620     const int A=(8-x)*(8-y);\
621     const int B=(  x)*(8-y);\
622     const int C=(8-x)*(  y);\
623     const int D=(  x)*(  y);\
624     int i;\
625     stride >>= sizeof(pixel)-1;\
626     \
627     av_assert2(x<8 && y<8 && x>=0 && y>=0);\
628 \
629     if(D){\
630         for(i=0; i<h; i++){\
631             OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\
632             OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2]));\
633             OP(dst[2], (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3]));\
634             OP(dst[3], (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4]));\
635             dst+= stride;\
636             src+= stride;\
637         }\
638     }else{\
639         const int E= B+C;\
640         const int step= C ? stride : 1;\
641         for(i=0; i<h; i++){\
642             OP(dst[0], (A*src[0] + E*src[step+0]));\
643             OP(dst[1], (A*src[1] + E*src[step+1]));\
644             OP(dst[2], (A*src[2] + E*src[step+2]));\
645             OP(dst[3], (A*src[3] + E*src[step+3]));\
646             dst+= stride;\
647             src+= stride;\
648         }\
649     }\
650 }\
651 \
652 static void FUNCC(OPNAME ## h264_chroma_mc8)(uint8_t *p_dst/*align 8*/, uint8_t *p_src/*align 1*/, int stride, int h, int x, int y){\
653     pixel *dst = (pixel*)p_dst;\
654     pixel *src = (pixel*)p_src;\
655     const int A=(8-x)*(8-y);\
656     const int B=(  x)*(8-y);\
657     const int C=(8-x)*(  y);\
658     const int D=(  x)*(  y);\
659     int i;\
660     stride >>= sizeof(pixel)-1;\
661     \
662     av_assert2(x<8 && y<8 && x>=0 && y>=0);\
663 \
664     if(D){\
665         for(i=0; i<h; i++){\
666             OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\
667             OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2]));\
668             OP(dst[2], (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3]));\
669             OP(dst[3], (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4]));\
670             OP(dst[4], (A*src[4] + B*src[5] + C*src[stride+4] + D*src[stride+5]));\
671             OP(dst[5], (A*src[5] + B*src[6] + C*src[stride+5] + D*src[stride+6]));\
672             OP(dst[6], (A*src[6] + B*src[7] + C*src[stride+6] + D*src[stride+7]));\
673             OP(dst[7], (A*src[7] + B*src[8] + C*src[stride+7] + D*src[stride+8]));\
674             dst+= stride;\
675             src+= stride;\
676         }\
677     }else{\
678         const int E= B+C;\
679         const int step= C ? stride : 1;\
680         for(i=0; i<h; i++){\
681             OP(dst[0], (A*src[0] + E*src[step+0]));\
682             OP(dst[1], (A*src[1] + E*src[step+1]));\
683             OP(dst[2], (A*src[2] + E*src[step+2]));\
684             OP(dst[3], (A*src[3] + E*src[step+3]));\
685             OP(dst[4], (A*src[4] + E*src[step+4]));\
686             OP(dst[5], (A*src[5] + E*src[step+5]));\
687             OP(dst[6], (A*src[6] + E*src[step+6]));\
688             OP(dst[7], (A*src[7] + E*src[step+7]));\
689             dst+= stride;\
690             src+= stride;\
691         }\
692     }\
693 }
694
695 #define op_avg(a, b) a = (((a)+(((b) + 32)>>6)+1)>>1)
696 #define op_put(a, b) a = (((b) + 32)>>6)
697
698 H264_CHROMA_MC(put_       , op_put)
699 H264_CHROMA_MC(avg_       , op_avg)
700 #undef op_avg
701 #undef op_put
702
703 #define H264_LOWPASS(OPNAME, OP, OP2) \
704 static av_unused void FUNC(OPNAME ## h264_qpel2_h_lowpass)(uint8_t *p_dst, uint8_t *p_src, int dstStride, int srcStride){\
705     const int h=2;\
706     INIT_CLIP\
707     int i;\
708     pixel *dst = (pixel*)p_dst;\
709     pixel *src = (pixel*)p_src;\
710     dstStride >>= sizeof(pixel)-1;\
711     srcStride >>= sizeof(pixel)-1;\
712     for(i=0; i<h; i++)\
713     {\
714         OP(dst[0], (src[0]+src[1])*20 - (src[-1]+src[2])*5 + (src[-2]+src[3]));\
715         OP(dst[1], (src[1]+src[2])*20 - (src[0 ]+src[3])*5 + (src[-1]+src[4]));\
716         dst+=dstStride;\
717         src+=srcStride;\
718     }\
719 }\
720 \
721 static av_unused void FUNC(OPNAME ## h264_qpel2_v_lowpass)(uint8_t *p_dst, uint8_t *p_src, int dstStride, int srcStride){\
722     const int w=2;\
723     INIT_CLIP\
724     int i;\
725     pixel *dst = (pixel*)p_dst;\
726     pixel *src = (pixel*)p_src;\
727     dstStride >>= sizeof(pixel)-1;\
728     srcStride >>= sizeof(pixel)-1;\
729     for(i=0; i<w; i++)\
730     {\
731         const int srcB= src[-2*srcStride];\
732         const int srcA= src[-1*srcStride];\
733         const int src0= src[0 *srcStride];\
734         const int src1= src[1 *srcStride];\
735         const int src2= src[2 *srcStride];\
736         const int src3= src[3 *srcStride];\
737         const int src4= src[4 *srcStride];\
738         OP(dst[0*dstStride], (src0+src1)*20 - (srcA+src2)*5 + (srcB+src3));\
739         OP(dst[1*dstStride], (src1+src2)*20 - (src0+src3)*5 + (srcA+src4));\
740         dst++;\
741         src++;\
742     }\
743 }\
744 \
745 static av_unused void FUNC(OPNAME ## h264_qpel2_hv_lowpass)(uint8_t *p_dst, pixeltmp *tmp, uint8_t *p_src, int dstStride, int tmpStride, int srcStride){\
746     const int h=2;\
747     const int w=2;\
748     const int pad = (BIT_DEPTH == 10) ? (-10 * ((1<<BIT_DEPTH)-1)) : 0;\
749     INIT_CLIP\
750     int i;\
751     pixel *dst = (pixel*)p_dst;\
752     pixel *src = (pixel*)p_src;\
753     dstStride >>= sizeof(pixel)-1;\
754     srcStride >>= sizeof(pixel)-1;\
755     src -= 2*srcStride;\
756     for(i=0; i<h+5; i++)\
757     {\
758         tmp[0]= (src[0]+src[1])*20 - (src[-1]+src[2])*5 + (src[-2]+src[3]) + pad;\
759         tmp[1]= (src[1]+src[2])*20 - (src[0 ]+src[3])*5 + (src[-1]+src[4]) + pad;\
760         tmp+=tmpStride;\
761         src+=srcStride;\
762     }\
763     tmp -= tmpStride*(h+5-2);\
764     for(i=0; i<w; i++)\
765     {\
766         const int tmpB= tmp[-2*tmpStride] - pad;\
767         const int tmpA= tmp[-1*tmpStride] - pad;\
768         const int tmp0= tmp[0 *tmpStride] - pad;\
769         const int tmp1= tmp[1 *tmpStride] - pad;\
770         const int tmp2= tmp[2 *tmpStride] - pad;\
771         const int tmp3= tmp[3 *tmpStride] - pad;\
772         const int tmp4= tmp[4 *tmpStride] - pad;\
773         OP2(dst[0*dstStride], (tmp0+tmp1)*20 - (tmpA+tmp2)*5 + (tmpB+tmp3));\
774         OP2(dst[1*dstStride], (tmp1+tmp2)*20 - (tmp0+tmp3)*5 + (tmpA+tmp4));\
775         dst++;\
776         tmp++;\
777     }\
778 }\
779 static void FUNC(OPNAME ## h264_qpel4_h_lowpass)(uint8_t *p_dst, uint8_t *p_src, int dstStride, int srcStride){\
780     const int h=4;\
781     INIT_CLIP\
782     int i;\
783     pixel *dst = (pixel*)p_dst;\
784     pixel *src = (pixel*)p_src;\
785     dstStride >>= sizeof(pixel)-1;\
786     srcStride >>= sizeof(pixel)-1;\
787     for(i=0; i<h; i++)\
788     {\
789         OP(dst[0], (src[0]+src[1])*20 - (src[-1]+src[2])*5 + (src[-2]+src[3]));\
790         OP(dst[1], (src[1]+src[2])*20 - (src[0 ]+src[3])*5 + (src[-1]+src[4]));\
791         OP(dst[2], (src[2]+src[3])*20 - (src[1 ]+src[4])*5 + (src[0 ]+src[5]));\
792         OP(dst[3], (src[3]+src[4])*20 - (src[2 ]+src[5])*5 + (src[1 ]+src[6]));\
793         dst+=dstStride;\
794         src+=srcStride;\
795     }\
796 }\
797 \
798 static void FUNC(OPNAME ## h264_qpel4_v_lowpass)(uint8_t *p_dst, uint8_t *p_src, int dstStride, int srcStride){\
799     const int w=4;\
800     INIT_CLIP\
801     int i;\
802     pixel *dst = (pixel*)p_dst;\
803     pixel *src = (pixel*)p_src;\
804     dstStride >>= sizeof(pixel)-1;\
805     srcStride >>= sizeof(pixel)-1;\
806     for(i=0; i<w; i++)\
807     {\
808         const int srcB= src[-2*srcStride];\
809         const int srcA= src[-1*srcStride];\
810         const int src0= src[0 *srcStride];\
811         const int src1= src[1 *srcStride];\
812         const int src2= src[2 *srcStride];\
813         const int src3= src[3 *srcStride];\
814         const int src4= src[4 *srcStride];\
815         const int src5= src[5 *srcStride];\
816         const int src6= src[6 *srcStride];\
817         OP(dst[0*dstStride], (src0+src1)*20 - (srcA+src2)*5 + (srcB+src3));\
818         OP(dst[1*dstStride], (src1+src2)*20 - (src0+src3)*5 + (srcA+src4));\
819         OP(dst[2*dstStride], (src2+src3)*20 - (src1+src4)*5 + (src0+src5));\
820         OP(dst[3*dstStride], (src3+src4)*20 - (src2+src5)*5 + (src1+src6));\
821         dst++;\
822         src++;\
823     }\
824 }\
825 \
826 static void FUNC(OPNAME ## h264_qpel4_hv_lowpass)(uint8_t *p_dst, pixeltmp *tmp, uint8_t *p_src, int dstStride, int tmpStride, int srcStride){\
827     const int h=4;\
828     const int w=4;\
829     const int pad = (BIT_DEPTH == 10) ? (-10 * ((1<<BIT_DEPTH)-1)) : 0;\
830     INIT_CLIP\
831     int i;\
832     pixel *dst = (pixel*)p_dst;\
833     pixel *src = (pixel*)p_src;\
834     dstStride >>= sizeof(pixel)-1;\
835     srcStride >>= sizeof(pixel)-1;\
836     src -= 2*srcStride;\
837     for(i=0; i<h+5; i++)\
838     {\
839         tmp[0]= (src[0]+src[1])*20 - (src[-1]+src[2])*5 + (src[-2]+src[3]) + pad;\
840         tmp[1]= (src[1]+src[2])*20 - (src[0 ]+src[3])*5 + (src[-1]+src[4]) + pad;\
841         tmp[2]= (src[2]+src[3])*20 - (src[1 ]+src[4])*5 + (src[0 ]+src[5]) + pad;\
842         tmp[3]= (src[3]+src[4])*20 - (src[2 ]+src[5])*5 + (src[1 ]+src[6]) + pad;\
843         tmp+=tmpStride;\
844         src+=srcStride;\
845     }\
846     tmp -= tmpStride*(h+5-2);\
847     for(i=0; i<w; i++)\
848     {\
849         const int tmpB= tmp[-2*tmpStride] - pad;\
850         const int tmpA= tmp[-1*tmpStride] - pad;\
851         const int tmp0= tmp[0 *tmpStride] - pad;\
852         const int tmp1= tmp[1 *tmpStride] - pad;\
853         const int tmp2= tmp[2 *tmpStride] - pad;\
854         const int tmp3= tmp[3 *tmpStride] - pad;\
855         const int tmp4= tmp[4 *tmpStride] - pad;\
856         const int tmp5= tmp[5 *tmpStride] - pad;\
857         const int tmp6= tmp[6 *tmpStride] - pad;\
858         OP2(dst[0*dstStride], (tmp0+tmp1)*20 - (tmpA+tmp2)*5 + (tmpB+tmp3));\
859         OP2(dst[1*dstStride], (tmp1+tmp2)*20 - (tmp0+tmp3)*5 + (tmpA+tmp4));\
860         OP2(dst[2*dstStride], (tmp2+tmp3)*20 - (tmp1+tmp4)*5 + (tmp0+tmp5));\
861         OP2(dst[3*dstStride], (tmp3+tmp4)*20 - (tmp2+tmp5)*5 + (tmp1+tmp6));\
862         dst++;\
863         tmp++;\
864     }\
865 }\
866 \
867 static void FUNC(OPNAME ## h264_qpel8_h_lowpass)(uint8_t *p_dst, uint8_t *p_src, int dstStride, int srcStride){\
868     const int h=8;\
869     INIT_CLIP\
870     int i;\
871     pixel *dst = (pixel*)p_dst;\
872     pixel *src = (pixel*)p_src;\
873     dstStride >>= sizeof(pixel)-1;\
874     srcStride >>= sizeof(pixel)-1;\
875     for(i=0; i<h; i++)\
876     {\
877         OP(dst[0], (src[0]+src[1])*20 - (src[-1]+src[2])*5 + (src[-2]+src[3 ]));\
878         OP(dst[1], (src[1]+src[2])*20 - (src[0 ]+src[3])*5 + (src[-1]+src[4 ]));\
879         OP(dst[2], (src[2]+src[3])*20 - (src[1 ]+src[4])*5 + (src[0 ]+src[5 ]));\
880         OP(dst[3], (src[3]+src[4])*20 - (src[2 ]+src[5])*5 + (src[1 ]+src[6 ]));\
881         OP(dst[4], (src[4]+src[5])*20 - (src[3 ]+src[6])*5 + (src[2 ]+src[7 ]));\
882         OP(dst[5], (src[5]+src[6])*20 - (src[4 ]+src[7])*5 + (src[3 ]+src[8 ]));\
883         OP(dst[6], (src[6]+src[7])*20 - (src[5 ]+src[8])*5 + (src[4 ]+src[9 ]));\
884         OP(dst[7], (src[7]+src[8])*20 - (src[6 ]+src[9])*5 + (src[5 ]+src[10]));\
885         dst+=dstStride;\
886         src+=srcStride;\
887     }\
888 }\
889 \
890 static void FUNC(OPNAME ## h264_qpel8_v_lowpass)(uint8_t *p_dst, uint8_t *p_src, int dstStride, int srcStride){\
891     const int w=8;\
892     INIT_CLIP\
893     int i;\
894     pixel *dst = (pixel*)p_dst;\
895     pixel *src = (pixel*)p_src;\
896     dstStride >>= sizeof(pixel)-1;\
897     srcStride >>= sizeof(pixel)-1;\
898     for(i=0; i<w; i++)\
899     {\
900         const int srcB= src[-2*srcStride];\
901         const int srcA= src[-1*srcStride];\
902         const int src0= src[0 *srcStride];\
903         const int src1= src[1 *srcStride];\
904         const int src2= src[2 *srcStride];\
905         const int src3= src[3 *srcStride];\
906         const int src4= src[4 *srcStride];\
907         const int src5= src[5 *srcStride];\
908         const int src6= src[6 *srcStride];\
909         const int src7= src[7 *srcStride];\
910         const int src8= src[8 *srcStride];\
911         const int src9= src[9 *srcStride];\
912         const int src10=src[10*srcStride];\
913         OP(dst[0*dstStride], (src0+src1)*20 - (srcA+src2)*5 + (srcB+src3));\
914         OP(dst[1*dstStride], (src1+src2)*20 - (src0+src3)*5 + (srcA+src4));\
915         OP(dst[2*dstStride], (src2+src3)*20 - (src1+src4)*5 + (src0+src5));\
916         OP(dst[3*dstStride], (src3+src4)*20 - (src2+src5)*5 + (src1+src6));\
917         OP(dst[4*dstStride], (src4+src5)*20 - (src3+src6)*5 + (src2+src7));\
918         OP(dst[5*dstStride], (src5+src6)*20 - (src4+src7)*5 + (src3+src8));\
919         OP(dst[6*dstStride], (src6+src7)*20 - (src5+src8)*5 + (src4+src9));\
920         OP(dst[7*dstStride], (src7+src8)*20 - (src6+src9)*5 + (src5+src10));\
921         dst++;\
922         src++;\
923     }\
924 }\
925 \
926 static void FUNC(OPNAME ## h264_qpel8_hv_lowpass)(uint8_t *p_dst, pixeltmp *tmp, uint8_t *p_src, int dstStride, int tmpStride, int srcStride){\
927     const int h=8;\
928     const int w=8;\
929     const int pad = (BIT_DEPTH == 10) ? (-10 * ((1<<BIT_DEPTH)-1)) : 0;\
930     INIT_CLIP\
931     int i;\
932     pixel *dst = (pixel*)p_dst;\
933     pixel *src = (pixel*)p_src;\
934     dstStride >>= sizeof(pixel)-1;\
935     srcStride >>= sizeof(pixel)-1;\
936     src -= 2*srcStride;\
937     for(i=0; i<h+5; i++)\
938     {\
939         tmp[0]= (src[0]+src[1])*20 - (src[-1]+src[2])*5 + (src[-2]+src[3 ]) + pad;\
940         tmp[1]= (src[1]+src[2])*20 - (src[0 ]+src[3])*5 + (src[-1]+src[4 ]) + pad;\
941         tmp[2]= (src[2]+src[3])*20 - (src[1 ]+src[4])*5 + (src[0 ]+src[5 ]) + pad;\
942         tmp[3]= (src[3]+src[4])*20 - (src[2 ]+src[5])*5 + (src[1 ]+src[6 ]) + pad;\
943         tmp[4]= (src[4]+src[5])*20 - (src[3 ]+src[6])*5 + (src[2 ]+src[7 ]) + pad;\
944         tmp[5]= (src[5]+src[6])*20 - (src[4 ]+src[7])*5 + (src[3 ]+src[8 ]) + pad;\
945         tmp[6]= (src[6]+src[7])*20 - (src[5 ]+src[8])*5 + (src[4 ]+src[9 ]) + pad;\
946         tmp[7]= (src[7]+src[8])*20 - (src[6 ]+src[9])*5 + (src[5 ]+src[10]) + pad;\
947         tmp+=tmpStride;\
948         src+=srcStride;\
949     }\
950     tmp -= tmpStride*(h+5-2);\
951     for(i=0; i<w; i++)\
952     {\
953         const int tmpB= tmp[-2*tmpStride] - pad;\
954         const int tmpA= tmp[-1*tmpStride] - pad;\
955         const int tmp0= tmp[0 *tmpStride] - pad;\
956         const int tmp1= tmp[1 *tmpStride] - pad;\
957         const int tmp2= tmp[2 *tmpStride] - pad;\
958         const int tmp3= tmp[3 *tmpStride] - pad;\
959         const int tmp4= tmp[4 *tmpStride] - pad;\
960         const int tmp5= tmp[5 *tmpStride] - pad;\
961         const int tmp6= tmp[6 *tmpStride] - pad;\
962         const int tmp7= tmp[7 *tmpStride] - pad;\
963         const int tmp8= tmp[8 *tmpStride] - pad;\
964         const int tmp9= tmp[9 *tmpStride] - pad;\
965         const int tmp10=tmp[10*tmpStride] - pad;\
966         OP2(dst[0*dstStride], (tmp0+tmp1)*20 - (tmpA+tmp2)*5 + (tmpB+tmp3));\
967         OP2(dst[1*dstStride], (tmp1+tmp2)*20 - (tmp0+tmp3)*5 + (tmpA+tmp4));\
968         OP2(dst[2*dstStride], (tmp2+tmp3)*20 - (tmp1+tmp4)*5 + (tmp0+tmp5));\
969         OP2(dst[3*dstStride], (tmp3+tmp4)*20 - (tmp2+tmp5)*5 + (tmp1+tmp6));\
970         OP2(dst[4*dstStride], (tmp4+tmp5)*20 - (tmp3+tmp6)*5 + (tmp2+tmp7));\
971         OP2(dst[5*dstStride], (tmp5+tmp6)*20 - (tmp4+tmp7)*5 + (tmp3+tmp8));\
972         OP2(dst[6*dstStride], (tmp6+tmp7)*20 - (tmp5+tmp8)*5 + (tmp4+tmp9));\
973         OP2(dst[7*dstStride], (tmp7+tmp8)*20 - (tmp6+tmp9)*5 + (tmp5+tmp10));\
974         dst++;\
975         tmp++;\
976     }\
977 }\
978 \
979 static void FUNC(OPNAME ## h264_qpel16_v_lowpass)(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
980     FUNC(OPNAME ## h264_qpel8_v_lowpass)(dst                , src                , dstStride, srcStride);\
981     FUNC(OPNAME ## h264_qpel8_v_lowpass)(dst+8*sizeof(pixel), src+8*sizeof(pixel), dstStride, srcStride);\
982     src += 8*srcStride;\
983     dst += 8*dstStride;\
984     FUNC(OPNAME ## h264_qpel8_v_lowpass)(dst                , src                , dstStride, srcStride);\
985     FUNC(OPNAME ## h264_qpel8_v_lowpass)(dst+8*sizeof(pixel), src+8*sizeof(pixel), dstStride, srcStride);\
986 }\
987 \
988 static void FUNC(OPNAME ## h264_qpel16_h_lowpass)(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
989     FUNC(OPNAME ## h264_qpel8_h_lowpass)(dst                , src                , dstStride, srcStride);\
990     FUNC(OPNAME ## h264_qpel8_h_lowpass)(dst+8*sizeof(pixel), src+8*sizeof(pixel), dstStride, srcStride);\
991     src += 8*srcStride;\
992     dst += 8*dstStride;\
993     FUNC(OPNAME ## h264_qpel8_h_lowpass)(dst                , src                , dstStride, srcStride);\
994     FUNC(OPNAME ## h264_qpel8_h_lowpass)(dst+8*sizeof(pixel), src+8*sizeof(pixel), dstStride, srcStride);\
995 }\
996 \
997 static void FUNC(OPNAME ## h264_qpel16_hv_lowpass)(uint8_t *dst, pixeltmp *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
998     FUNC(OPNAME ## h264_qpel8_hv_lowpass)(dst                , tmp  , src                , dstStride, tmpStride, srcStride);\
999     FUNC(OPNAME ## h264_qpel8_hv_lowpass)(dst+8*sizeof(pixel), tmp+8, src+8*sizeof(pixel), dstStride, tmpStride, srcStride);\
1000     src += 8*srcStride;\
1001     dst += 8*dstStride;\
1002     FUNC(OPNAME ## h264_qpel8_hv_lowpass)(dst                , tmp  , src                , dstStride, tmpStride, srcStride);\
1003     FUNC(OPNAME ## h264_qpel8_hv_lowpass)(dst+8*sizeof(pixel), tmp+8, src+8*sizeof(pixel), dstStride, tmpStride, srcStride);\
1004 }\
1005
1006 #define H264_MC(OPNAME, SIZE) \
1007 static av_unused void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc00)(uint8_t *dst, uint8_t *src, int stride){\
1008     FUNCC(OPNAME ## pixels ## SIZE)(dst, src, stride, SIZE);\
1009 }\
1010 \
1011 static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc10)(uint8_t *dst, uint8_t *src, int stride){\
1012     uint8_t half[SIZE*SIZE*sizeof(pixel)];\
1013     FUNC(put_h264_qpel ## SIZE ## _h_lowpass)(half, src, SIZE*sizeof(pixel), stride);\
1014     FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, src, half, stride, stride, SIZE*sizeof(pixel), SIZE);\
1015 }\
1016 \
1017 static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc20)(uint8_t *dst, uint8_t *src, int stride){\
1018     FUNC(OPNAME ## h264_qpel ## SIZE ## _h_lowpass)(dst, src, stride, stride);\
1019 }\
1020 \
1021 static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc30)(uint8_t *dst, uint8_t *src, int stride){\
1022     uint8_t half[SIZE*SIZE*sizeof(pixel)];\
1023     FUNC(put_h264_qpel ## SIZE ## _h_lowpass)(half, src, SIZE*sizeof(pixel), stride);\
1024     FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, src+sizeof(pixel), half, stride, stride, SIZE*sizeof(pixel), SIZE);\
1025 }\
1026 \
1027 static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc01)(uint8_t *dst, uint8_t *src, int stride){\
1028     uint8_t full[SIZE*(SIZE+5)*sizeof(pixel)];\
1029     uint8_t * const full_mid= full + SIZE*2*sizeof(pixel);\
1030     uint8_t half[SIZE*SIZE*sizeof(pixel)];\
1031     FUNC(copy_block ## SIZE )(full, src - stride*2, SIZE*sizeof(pixel),  stride, SIZE + 5);\
1032     FUNC(put_h264_qpel ## SIZE ## _v_lowpass)(half, full_mid, SIZE*sizeof(pixel), SIZE*sizeof(pixel));\
1033     FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, full_mid, half, stride, SIZE*sizeof(pixel), SIZE*sizeof(pixel), SIZE);\
1034 }\
1035 \
1036 static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc02)(uint8_t *dst, uint8_t *src, int stride){\
1037     uint8_t full[SIZE*(SIZE+5)*sizeof(pixel)];\
1038     uint8_t * const full_mid= full + SIZE*2*sizeof(pixel);\
1039     FUNC(copy_block ## SIZE )(full, src - stride*2, SIZE*sizeof(pixel),  stride, SIZE + 5);\
1040     FUNC(OPNAME ## h264_qpel ## SIZE ## _v_lowpass)(dst, full_mid, stride, SIZE*sizeof(pixel));\
1041 }\
1042 \
1043 static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc03)(uint8_t *dst, uint8_t *src, int stride){\
1044     uint8_t full[SIZE*(SIZE+5)*sizeof(pixel)];\
1045     uint8_t * const full_mid= full + SIZE*2*sizeof(pixel);\
1046     uint8_t half[SIZE*SIZE*sizeof(pixel)];\
1047     FUNC(copy_block ## SIZE )(full, src - stride*2, SIZE*sizeof(pixel),  stride, SIZE + 5);\
1048     FUNC(put_h264_qpel ## SIZE ## _v_lowpass)(half, full_mid, SIZE*sizeof(pixel), SIZE*sizeof(pixel));\
1049     FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, full_mid+SIZE*sizeof(pixel), half, stride, SIZE*sizeof(pixel), SIZE*sizeof(pixel), SIZE);\
1050 }\
1051 \
1052 static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc11)(uint8_t *dst, uint8_t *src, int stride){\
1053     uint8_t full[SIZE*(SIZE+5)*sizeof(pixel)];\
1054     uint8_t * const full_mid= full + SIZE*2*sizeof(pixel);\
1055     uint8_t halfH[SIZE*SIZE*sizeof(pixel)];\
1056     uint8_t halfV[SIZE*SIZE*sizeof(pixel)];\
1057     FUNC(put_h264_qpel ## SIZE ## _h_lowpass)(halfH, src, SIZE*sizeof(pixel), stride);\
1058     FUNC(copy_block ## SIZE )(full, src - stride*2, SIZE*sizeof(pixel),  stride, SIZE + 5);\
1059     FUNC(put_h264_qpel ## SIZE ## _v_lowpass)(halfV, full_mid, SIZE*sizeof(pixel), SIZE*sizeof(pixel));\
1060     FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, halfH, halfV, stride, SIZE*sizeof(pixel), SIZE*sizeof(pixel), SIZE);\
1061 }\
1062 \
1063 static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc31)(uint8_t *dst, uint8_t *src, int stride){\
1064     uint8_t full[SIZE*(SIZE+5)*sizeof(pixel)];\
1065     uint8_t * const full_mid= full + SIZE*2*sizeof(pixel);\
1066     uint8_t halfH[SIZE*SIZE*sizeof(pixel)];\
1067     uint8_t halfV[SIZE*SIZE*sizeof(pixel)];\
1068     FUNC(put_h264_qpel ## SIZE ## _h_lowpass)(halfH, src, SIZE*sizeof(pixel), stride);\
1069     FUNC(copy_block ## SIZE )(full, src - stride*2 + sizeof(pixel), SIZE*sizeof(pixel),  stride, SIZE + 5);\
1070     FUNC(put_h264_qpel ## SIZE ## _v_lowpass)(halfV, full_mid, SIZE*sizeof(pixel), SIZE*sizeof(pixel));\
1071     FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, halfH, halfV, stride, SIZE*sizeof(pixel), SIZE*sizeof(pixel), SIZE);\
1072 }\
1073 \
1074 static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc13)(uint8_t *dst, uint8_t *src, int stride){\
1075     uint8_t full[SIZE*(SIZE+5)*sizeof(pixel)];\
1076     uint8_t * const full_mid= full + SIZE*2*sizeof(pixel);\
1077     uint8_t halfH[SIZE*SIZE*sizeof(pixel)];\
1078     uint8_t halfV[SIZE*SIZE*sizeof(pixel)];\
1079     FUNC(put_h264_qpel ## SIZE ## _h_lowpass)(halfH, src + stride, SIZE*sizeof(pixel), stride);\
1080     FUNC(copy_block ## SIZE )(full, src - stride*2, SIZE*sizeof(pixel),  stride, SIZE + 5);\
1081     FUNC(put_h264_qpel ## SIZE ## _v_lowpass)(halfV, full_mid, SIZE*sizeof(pixel), SIZE*sizeof(pixel));\
1082     FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, halfH, halfV, stride, SIZE*sizeof(pixel), SIZE*sizeof(pixel), SIZE);\
1083 }\
1084 \
1085 static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc33)(uint8_t *dst, uint8_t *src, int stride){\
1086     uint8_t full[SIZE*(SIZE+5)*sizeof(pixel)];\
1087     uint8_t * const full_mid= full + SIZE*2*sizeof(pixel);\
1088     uint8_t halfH[SIZE*SIZE*sizeof(pixel)];\
1089     uint8_t halfV[SIZE*SIZE*sizeof(pixel)];\
1090     FUNC(put_h264_qpel ## SIZE ## _h_lowpass)(halfH, src + stride, SIZE*sizeof(pixel), stride);\
1091     FUNC(copy_block ## SIZE )(full, src - stride*2 + sizeof(pixel), SIZE*sizeof(pixel),  stride, SIZE + 5);\
1092     FUNC(put_h264_qpel ## SIZE ## _v_lowpass)(halfV, full_mid, SIZE*sizeof(pixel), SIZE*sizeof(pixel));\
1093     FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, halfH, halfV, stride, SIZE*sizeof(pixel), SIZE*sizeof(pixel), SIZE);\
1094 }\
1095 \
1096 static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc22)(uint8_t *dst, uint8_t *src, int stride){\
1097     pixeltmp tmp[SIZE*(SIZE+5)*sizeof(pixel)];\
1098     FUNC(OPNAME ## h264_qpel ## SIZE ## _hv_lowpass)(dst, tmp, src, stride, SIZE*sizeof(pixel), stride);\
1099 }\
1100 \
1101 static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc21)(uint8_t *dst, uint8_t *src, int stride){\
1102     pixeltmp tmp[SIZE*(SIZE+5)*sizeof(pixel)];\
1103     uint8_t halfH[SIZE*SIZE*sizeof(pixel)];\
1104     uint8_t halfHV[SIZE*SIZE*sizeof(pixel)];\
1105     FUNC(put_h264_qpel ## SIZE ## _h_lowpass)(halfH, src, SIZE*sizeof(pixel), stride);\
1106     FUNC(put_h264_qpel ## SIZE ## _hv_lowpass)(halfHV, tmp, src, SIZE*sizeof(pixel), SIZE*sizeof(pixel), stride);\
1107     FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, halfH, halfHV, stride, SIZE*sizeof(pixel), SIZE*sizeof(pixel), SIZE);\
1108 }\
1109 \
1110 static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc23)(uint8_t *dst, uint8_t *src, int stride){\
1111     pixeltmp tmp[SIZE*(SIZE+5)*sizeof(pixel)];\
1112     uint8_t halfH[SIZE*SIZE*sizeof(pixel)];\
1113     uint8_t halfHV[SIZE*SIZE*sizeof(pixel)];\
1114     FUNC(put_h264_qpel ## SIZE ## _h_lowpass)(halfH, src + stride, SIZE*sizeof(pixel), stride);\
1115     FUNC(put_h264_qpel ## SIZE ## _hv_lowpass)(halfHV, tmp, src, SIZE*sizeof(pixel), SIZE*sizeof(pixel), stride);\
1116     FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, halfH, halfHV, stride, SIZE*sizeof(pixel), SIZE*sizeof(pixel), SIZE);\
1117 }\
1118 \
1119 static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc12)(uint8_t *dst, uint8_t *src, int stride){\
1120     uint8_t full[SIZE*(SIZE+5)*sizeof(pixel)];\
1121     uint8_t * const full_mid= full + SIZE*2*sizeof(pixel);\
1122     pixeltmp tmp[SIZE*(SIZE+5)*sizeof(pixel)];\
1123     uint8_t halfV[SIZE*SIZE*sizeof(pixel)];\
1124     uint8_t halfHV[SIZE*SIZE*sizeof(pixel)];\
1125     FUNC(copy_block ## SIZE )(full, src - stride*2, SIZE*sizeof(pixel),  stride, SIZE + 5);\
1126     FUNC(put_h264_qpel ## SIZE ## _v_lowpass)(halfV, full_mid, SIZE*sizeof(pixel), SIZE*sizeof(pixel));\
1127     FUNC(put_h264_qpel ## SIZE ## _hv_lowpass)(halfHV, tmp, src, SIZE*sizeof(pixel), SIZE*sizeof(pixel), stride);\
1128     FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, halfV, halfHV, stride, SIZE*sizeof(pixel), SIZE*sizeof(pixel), SIZE);\
1129 }\
1130 \
1131 static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc32)(uint8_t *dst, uint8_t *src, int stride){\
1132     uint8_t full[SIZE*(SIZE+5)*sizeof(pixel)];\
1133     uint8_t * const full_mid= full + SIZE*2*sizeof(pixel);\
1134     pixeltmp tmp[SIZE*(SIZE+5)*sizeof(pixel)];\
1135     uint8_t halfV[SIZE*SIZE*sizeof(pixel)];\
1136     uint8_t halfHV[SIZE*SIZE*sizeof(pixel)];\
1137     FUNC(copy_block ## SIZE )(full, src - stride*2 + sizeof(pixel), SIZE*sizeof(pixel),  stride, SIZE + 5);\
1138     FUNC(put_h264_qpel ## SIZE ## _v_lowpass)(halfV, full_mid, SIZE*sizeof(pixel), SIZE*sizeof(pixel));\
1139     FUNC(put_h264_qpel ## SIZE ## _hv_lowpass)(halfHV, tmp, src, SIZE*sizeof(pixel), SIZE*sizeof(pixel), stride);\
1140     FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, halfV, halfHV, stride, SIZE*sizeof(pixel), SIZE*sizeof(pixel), SIZE);\
1141 }\
1142
1143 #define op_avg(a, b)  a = (((a)+CLIP(((b) + 16)>>5)+1)>>1)
1144 //#define op_avg2(a, b) a = (((a)*w1+cm[((b) + 16)>>5]*w2 + o + 64)>>7)
1145 #define op_put(a, b)  a = CLIP(((b) + 16)>>5)
1146 #define op2_avg(a, b)  a = (((a)+CLIP(((b) + 512)>>10)+1)>>1)
1147 #define op2_put(a, b)  a = CLIP(((b) + 512)>>10)
1148
1149 H264_LOWPASS(put_       , op_put, op2_put)
1150 H264_LOWPASS(avg_       , op_avg, op2_avg)
1151 H264_MC(put_, 2)
1152 H264_MC(put_, 4)
1153 H264_MC(put_, 8)
1154 H264_MC(put_, 16)
1155 H264_MC(avg_, 4)
1156 H264_MC(avg_, 8)
1157 H264_MC(avg_, 16)
1158
1159 #undef op_avg
1160 #undef op_put
1161 #undef op2_avg
1162 #undef op2_put
1163
1164 #if BIT_DEPTH == 8
1165 #   define put_h264_qpel8_mc00_8_c  ff_put_pixels8x8_8_c
1166 #   define avg_h264_qpel8_mc00_8_c  ff_avg_pixels8x8_8_c
1167 #   define put_h264_qpel16_mc00_8_c ff_put_pixels16x16_8_c
1168 #   define avg_h264_qpel16_mc00_8_c ff_avg_pixels16x16_8_c
1169 #elif BIT_DEPTH == 9
1170 #   define put_h264_qpel8_mc00_9_c  ff_put_pixels8x8_9_c
1171 #   define avg_h264_qpel8_mc00_9_c  ff_avg_pixels8x8_9_c
1172 #   define put_h264_qpel16_mc00_9_c ff_put_pixels16x16_9_c
1173 #   define avg_h264_qpel16_mc00_9_c ff_avg_pixels16x16_9_c
1174 #elif BIT_DEPTH == 10
1175 #   define put_h264_qpel8_mc00_10_c  ff_put_pixels8x8_10_c
1176 #   define avg_h264_qpel8_mc00_10_c  ff_avg_pixels8x8_10_c
1177 #   define put_h264_qpel16_mc00_10_c ff_put_pixels16x16_10_c
1178 #   define avg_h264_qpel16_mc00_10_c ff_avg_pixels16x16_10_c
1179 #elif BIT_DEPTH == 12
1180 #   define put_h264_qpel8_mc00_12_c  ff_put_pixels8x8_12_c
1181 #   define avg_h264_qpel8_mc00_12_c  ff_avg_pixels8x8_12_c
1182 #   define put_h264_qpel16_mc00_12_c ff_put_pixels16x16_12_c
1183 #   define avg_h264_qpel16_mc00_12_c ff_avg_pixels16x16_12_c
1184 #elif BIT_DEPTH == 14
1185 #   define put_h264_qpel8_mc00_14_c  ff_put_pixels8x8_14_c
1186 #   define avg_h264_qpel8_mc00_14_c  ff_avg_pixels8x8_14_c
1187 #   define put_h264_qpel16_mc00_14_c ff_put_pixels16x16_14_c
1188 #   define avg_h264_qpel16_mc00_14_c ff_avg_pixels16x16_14_c
1189 #endif
1190
1191 void FUNCC(ff_put_pixels8x8)(uint8_t *dst, uint8_t *src, int stride) {
1192     FUNCC(put_pixels8)(dst, src, stride, 8);
1193 }
1194 void FUNCC(ff_avg_pixels8x8)(uint8_t *dst, uint8_t *src, int stride) {
1195     FUNCC(avg_pixels8)(dst, src, stride, 8);
1196 }
1197 void FUNCC(ff_put_pixels16x16)(uint8_t *dst, uint8_t *src, int stride) {
1198     FUNCC(put_pixels16)(dst, src, stride, 16);
1199 }
1200 void FUNCC(ff_avg_pixels16x16)(uint8_t *dst, uint8_t *src, int stride) {
1201     FUNCC(avg_pixels16)(dst, src, stride, 16);
1202 }
1203