00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00030 #include "bit_depth_template.c"
00031
00032 static inline void FUNC(copy_block2)(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
00033 {
00034 int i;
00035 for(i=0; i<h; i++)
00036 {
00037 AV_WN2P(dst , AV_RN2P(src ));
00038 dst+=dstStride;
00039 src+=srcStride;
00040 }
00041 }
00042
00043 static inline void FUNC(copy_block4)(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
00044 {
00045 int i;
00046 for(i=0; i<h; i++)
00047 {
00048 AV_WN4P(dst , AV_RN4P(src ));
00049 dst+=dstStride;
00050 src+=srcStride;
00051 }
00052 }
00053
00054 static inline void FUNC(copy_block8)(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
00055 {
00056 int i;
00057 for(i=0; i<h; i++)
00058 {
00059 AV_WN4P(dst , AV_RN4P(src ));
00060 AV_WN4P(dst+4*sizeof(pixel), AV_RN4P(src+4*sizeof(pixel)));
00061 dst+=dstStride;
00062 src+=srcStride;
00063 }
00064 }
00065
00066 static inline void FUNC(copy_block16)(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
00067 {
00068 int i;
00069 for(i=0; i<h; i++)
00070 {
00071 AV_WN4P(dst , AV_RN4P(src ));
00072 AV_WN4P(dst+ 4*sizeof(pixel), AV_RN4P(src+ 4*sizeof(pixel)));
00073 AV_WN4P(dst+ 8*sizeof(pixel), AV_RN4P(src+ 8*sizeof(pixel)));
00074 AV_WN4P(dst+12*sizeof(pixel), AV_RN4P(src+12*sizeof(pixel)));
00075 dst+=dstStride;
00076 src+=srcStride;
00077 }
00078 }
00079
00080
00081
00082 static void FUNCC(draw_edges)(uint8_t *p_buf, int p_wrap, int width, int height, int w, int h, int sides)
00083 {
00084 pixel *buf = (pixel*)p_buf;
00085 int wrap = p_wrap / sizeof(pixel);
00086 pixel *ptr, *last_line;
00087 int i;
00088
00089
00090 ptr = buf;
00091 for(i=0;i<height;i++) {
00092 #if BIT_DEPTH > 8
00093 int j;
00094 for (j = 0; j < w; j++) {
00095 ptr[j-w] = ptr[0];
00096 ptr[j+width] = ptr[width-1];
00097 }
00098 #else
00099 memset(ptr - w, ptr[0], w);
00100 memset(ptr + width, ptr[width-1], w);
00101 #endif
00102 ptr += wrap;
00103 }
00104
00105
00106 buf -= w;
00107 last_line = buf + (height - 1) * wrap;
00108 if (sides & EDGE_TOP)
00109 for(i = 0; i < h; i++)
00110 memcpy(buf - (i + 1) * wrap, buf, (width + w + w) * sizeof(pixel));
00111 if (sides & EDGE_BOTTOM)
00112 for (i = 0; i < h; i++)
00113 memcpy(last_line + (i + 1) * wrap, last_line, (width + w + w) * sizeof(pixel));
00114 }
00115
00128 void FUNC(ff_emulated_edge_mc)(uint8_t *buf, const uint8_t *src, int linesize, int block_w, int block_h,
00129 int src_x, int src_y, int w, int h){
00130 int x, y;
00131 int start_y, start_x, end_y, end_x;
00132
00133 if(!w || !h)
00134 return;
00135
00136 if(src_y>= h){
00137 src-= src_y*linesize;
00138 src+= (h-1)*linesize;
00139 src_y=h-1;
00140 }else if(src_y<=-block_h){
00141 src-= src_y*linesize;
00142 src+= (1-block_h)*linesize;
00143 src_y=1-block_h;
00144 }
00145 if(src_x>= w){
00146 src+= (w-1-src_x)*sizeof(pixel);
00147 src_x=w-1;
00148 }else if(src_x<=-block_w){
00149 src+= (1-block_w-src_x)*sizeof(pixel);
00150 src_x=1-block_w;
00151 }
00152
00153 start_y= FFMAX(0, -src_y);
00154 start_x= FFMAX(0, -src_x);
00155 end_y= FFMIN(block_h, h-src_y);
00156 end_x= FFMIN(block_w, w-src_x);
00157 av_assert2(start_y < end_y && block_h);
00158 av_assert2(start_x < end_x && block_w);
00159
00160 w = end_x - start_x;
00161 src += start_y*linesize + start_x*sizeof(pixel);
00162 buf += start_x*sizeof(pixel);
00163
00164
00165 for(y=0; y<start_y; y++){
00166 memcpy(buf, src, w*sizeof(pixel));
00167 buf += linesize;
00168 }
00169
00170
00171 for(; y<end_y; y++){
00172 memcpy(buf, src, w*sizeof(pixel));
00173 src += linesize;
00174 buf += linesize;
00175 }
00176
00177
00178 src -= linesize;
00179 for(; y<block_h; y++){
00180 memcpy(buf, src, w*sizeof(pixel));
00181 buf += linesize;
00182 }
00183
00184 buf -= block_h * linesize + start_x*sizeof(pixel);
00185 while (block_h--){
00186 pixel *bufp = (pixel*)buf;
00187
00188 for(x=0; x<start_x; x++){
00189 bufp[x] = bufp[start_x];
00190 }
00191
00192
00193 for(x=end_x; x<block_w; x++){
00194 bufp[x] = bufp[end_x - 1];
00195 }
00196 buf += linesize;
00197 }
00198 }
00199
00200 #define DCTELEM_FUNCS(dctcoef, suffix) \
00201 static void FUNCC(get_pixels ## suffix)(DCTELEM *av_restrict _block, \
00202 const uint8_t *_pixels, \
00203 int line_size) \
00204 { \
00205 const pixel *pixels = (const pixel *) _pixels; \
00206 dctcoef *av_restrict block = (dctcoef *) _block; \
00207 int i; \
00208 \
00209 \
00210 for(i=0;i<8;i++) { \
00211 block[0] = pixels[0]; \
00212 block[1] = pixels[1]; \
00213 block[2] = pixels[2]; \
00214 block[3] = pixels[3]; \
00215 block[4] = pixels[4]; \
00216 block[5] = pixels[5]; \
00217 block[6] = pixels[6]; \
00218 block[7] = pixels[7]; \
00219 pixels += line_size / sizeof(pixel); \
00220 block += 8; \
00221 } \
00222 } \
00223 \
00224 static void FUNCC(add_pixels8 ## suffix)(uint8_t *av_restrict _pixels, \
00225 DCTELEM *_block, \
00226 int line_size) \
00227 { \
00228 int i; \
00229 pixel *av_restrict pixels = (pixel *av_restrict)_pixels; \
00230 dctcoef *block = (dctcoef*)_block; \
00231 line_size /= sizeof(pixel); \
00232 \
00233 for(i=0;i<8;i++) { \
00234 pixels[0] += block[0]; \
00235 pixels[1] += block[1]; \
00236 pixels[2] += block[2]; \
00237 pixels[3] += block[3]; \
00238 pixels[4] += block[4]; \
00239 pixels[5] += block[5]; \
00240 pixels[6] += block[6]; \
00241 pixels[7] += block[7]; \
00242 pixels += line_size; \
00243 block += 8; \
00244 } \
00245 } \
00246 \
00247 static void FUNCC(add_pixels4 ## suffix)(uint8_t *av_restrict _pixels, \
00248 DCTELEM *_block, \
00249 int line_size) \
00250 { \
00251 int i; \
00252 pixel *av_restrict pixels = (pixel *av_restrict)_pixels; \
00253 dctcoef *block = (dctcoef*)_block; \
00254 line_size /= sizeof(pixel); \
00255 \
00256 for(i=0;i<4;i++) { \
00257 pixels[0] += block[0]; \
00258 pixels[1] += block[1]; \
00259 pixels[2] += block[2]; \
00260 pixels[3] += block[3]; \
00261 pixels += line_size; \
00262 block += 4; \
00263 } \
00264 } \
00265 \
00266 static void FUNCC(clear_block ## suffix)(DCTELEM *block) \
00267 { \
00268 memset(block, 0, sizeof(dctcoef)*64); \
00269 } \
00270 \
00271 \
00274 static void FUNCC(clear_blocks ## suffix)(DCTELEM *blocks) \
00275 { \
00276 memset(blocks, 0, sizeof(dctcoef)*6*64); \
00277 }
00278
00279 DCTELEM_FUNCS(DCTELEM, _16)
00280 #if BIT_DEPTH > 8
00281 DCTELEM_FUNCS(dctcoef, _32)
00282 #endif
00283
00284 #define PIXOP2(OPNAME, OP) \
00285 static void FUNCC(OPNAME ## _pixels2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
00286 int i;\
00287 for(i=0; i<h; i++){\
00288 OP(*((pixel2*)(block )), AV_RN2P(pixels ));\
00289 pixels+=line_size;\
00290 block +=line_size;\
00291 }\
00292 }\
00293 static void FUNCC(OPNAME ## _pixels4)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
00294 int i;\
00295 for(i=0; i<h; i++){\
00296 OP(*((pixel4*)(block )), AV_RN4P(pixels ));\
00297 pixels+=line_size;\
00298 block +=line_size;\
00299 }\
00300 }\
00301 static void FUNCC(OPNAME ## _pixels8)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
00302 int i;\
00303 for(i=0; i<h; i++){\
00304 OP(*((pixel4*)(block )), AV_RN4P(pixels ));\
00305 OP(*((pixel4*)(block+4*sizeof(pixel))), AV_RN4P(pixels+4*sizeof(pixel)));\
00306 pixels+=line_size;\
00307 block +=line_size;\
00308 }\
00309 }\
00310 static inline void FUNCC(OPNAME ## _no_rnd_pixels8)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
00311 FUNCC(OPNAME ## _pixels8)(block, pixels, line_size, h);\
00312 }\
00313 \
00314 static inline void FUNC(OPNAME ## _no_rnd_pixels8_l2)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
00315 int src_stride1, int src_stride2, int h){\
00316 int i;\
00317 for(i=0; i<h; i++){\
00318 pixel4 a,b;\
00319 a= AV_RN4P(&src1[i*src_stride1 ]);\
00320 b= AV_RN4P(&src2[i*src_stride2 ]);\
00321 OP(*((pixel4*)&dst[i*dst_stride ]), no_rnd_avg_pixel4(a, b));\
00322 a= AV_RN4P(&src1[i*src_stride1+4*sizeof(pixel)]);\
00323 b= AV_RN4P(&src2[i*src_stride2+4*sizeof(pixel)]);\
00324 OP(*((pixel4*)&dst[i*dst_stride+4*sizeof(pixel)]), no_rnd_avg_pixel4(a, b));\
00325 }\
00326 }\
00327 \
00328 static inline void FUNC(OPNAME ## _pixels8_l2)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
00329 int src_stride1, int src_stride2, int h){\
00330 int i;\
00331 for(i=0; i<h; i++){\
00332 pixel4 a,b;\
00333 a= AV_RN4P(&src1[i*src_stride1 ]);\
00334 b= AV_RN4P(&src2[i*src_stride2 ]);\
00335 OP(*((pixel4*)&dst[i*dst_stride ]), rnd_avg_pixel4(a, b));\
00336 a= AV_RN4P(&src1[i*src_stride1+4*sizeof(pixel)]);\
00337 b= AV_RN4P(&src2[i*src_stride2+4*sizeof(pixel)]);\
00338 OP(*((pixel4*)&dst[i*dst_stride+4*sizeof(pixel)]), rnd_avg_pixel4(a, b));\
00339 }\
00340 }\
00341 \
00342 static inline void FUNC(OPNAME ## _pixels4_l2)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
00343 int src_stride1, int src_stride2, int h){\
00344 int i;\
00345 for(i=0; i<h; i++){\
00346 pixel4 a,b;\
00347 a= AV_RN4P(&src1[i*src_stride1 ]);\
00348 b= AV_RN4P(&src2[i*src_stride2 ]);\
00349 OP(*((pixel4*)&dst[i*dst_stride ]), rnd_avg_pixel4(a, b));\
00350 }\
00351 }\
00352 \
00353 static inline void FUNC(OPNAME ## _pixels2_l2)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
00354 int src_stride1, int src_stride2, int h){\
00355 int i;\
00356 for(i=0; i<h; i++){\
00357 pixel4 a,b;\
00358 a= AV_RN2P(&src1[i*src_stride1 ]);\
00359 b= AV_RN2P(&src2[i*src_stride2 ]);\
00360 OP(*((pixel2*)&dst[i*dst_stride ]), rnd_avg_pixel4(a, b));\
00361 }\
00362 }\
00363 \
00364 static inline void FUNC(OPNAME ## _pixels16_l2)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
00365 int src_stride1, int src_stride2, int h){\
00366 FUNC(OPNAME ## _pixels8_l2)(dst , src1 , src2 , dst_stride, src_stride1, src_stride2, h);\
00367 FUNC(OPNAME ## _pixels8_l2)(dst+8*sizeof(pixel), src1+8*sizeof(pixel), src2+8*sizeof(pixel), dst_stride, src_stride1, src_stride2, h);\
00368 }\
00369 \
00370 static inline void FUNC(OPNAME ## _no_rnd_pixels16_l2)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
00371 int src_stride1, int src_stride2, int h){\
00372 FUNC(OPNAME ## _no_rnd_pixels8_l2)(dst , src1 , src2 , dst_stride, src_stride1, src_stride2, h);\
00373 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);\
00374 }\
00375 \
00376 static inline void FUNCC(OPNAME ## _no_rnd_pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
00377 FUNC(OPNAME ## _no_rnd_pixels8_l2)(block, pixels, pixels+sizeof(pixel), line_size, line_size, line_size, h);\
00378 }\
00379 \
00380 static inline void FUNCC(OPNAME ## _pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
00381 FUNC(OPNAME ## _pixels8_l2)(block, pixels, pixels+sizeof(pixel), line_size, line_size, line_size, h);\
00382 }\
00383 \
00384 static inline void FUNCC(OPNAME ## _no_rnd_pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
00385 FUNC(OPNAME ## _no_rnd_pixels8_l2)(block, pixels, pixels+line_size, line_size, line_size, line_size, h);\
00386 }\
00387 \
00388 static inline void FUNCC(OPNAME ## _pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
00389 FUNC(OPNAME ## _pixels8_l2)(block, pixels, pixels+line_size, line_size, line_size, line_size, h);\
00390 }\
00391 \
00392 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,\
00393 int dst_stride, int src_stride1, int src_stride2,int src_stride3,int src_stride4, int h){\
00394 \
00395 int i;\
00396 for(i=0; i<h; i++){\
00397 uint32_t a, b, c, d, l0, l1, h0, h1;\
00398 a= AV_RN32(&src1[i*src_stride1]);\
00399 b= AV_RN32(&src2[i*src_stride2]);\
00400 c= AV_RN32(&src3[i*src_stride3]);\
00401 d= AV_RN32(&src4[i*src_stride4]);\
00402 l0= (a&0x03030303UL)\
00403 + (b&0x03030303UL)\
00404 + 0x02020202UL;\
00405 h0= ((a&0xFCFCFCFCUL)>>2)\
00406 + ((b&0xFCFCFCFCUL)>>2);\
00407 l1= (c&0x03030303UL)\
00408 + (d&0x03030303UL);\
00409 h1= ((c&0xFCFCFCFCUL)>>2)\
00410 + ((d&0xFCFCFCFCUL)>>2);\
00411 OP(*((uint32_t*)&dst[i*dst_stride]), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
00412 a= AV_RN32(&src1[i*src_stride1+4]);\
00413 b= AV_RN32(&src2[i*src_stride2+4]);\
00414 c= AV_RN32(&src3[i*src_stride3+4]);\
00415 d= AV_RN32(&src4[i*src_stride4+4]);\
00416 l0= (a&0x03030303UL)\
00417 + (b&0x03030303UL)\
00418 + 0x02020202UL;\
00419 h0= ((a&0xFCFCFCFCUL)>>2)\
00420 + ((b&0xFCFCFCFCUL)>>2);\
00421 l1= (c&0x03030303UL)\
00422 + (d&0x03030303UL);\
00423 h1= ((c&0xFCFCFCFCUL)>>2)\
00424 + ((d&0xFCFCFCFCUL)>>2);\
00425 OP(*((uint32_t*)&dst[i*dst_stride+4]), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
00426 }\
00427 }\
00428 \
00429 static inline void FUNCC(OPNAME ## _pixels4_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
00430 FUNC(OPNAME ## _pixels4_l2)(block, pixels, pixels+sizeof(pixel), line_size, line_size, line_size, h);\
00431 }\
00432 \
00433 static inline void FUNCC(OPNAME ## _pixels4_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
00434 FUNC(OPNAME ## _pixels4_l2)(block, pixels, pixels+line_size, line_size, line_size, line_size, h);\
00435 }\
00436 \
00437 static inline void FUNCC(OPNAME ## _pixels2_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
00438 FUNC(OPNAME ## _pixels2_l2)(block, pixels, pixels+sizeof(pixel), line_size, line_size, line_size, h);\
00439 }\
00440 \
00441 static inline void FUNCC(OPNAME ## _pixels2_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
00442 FUNC(OPNAME ## _pixels2_l2)(block, pixels, pixels+line_size, line_size, line_size, line_size, h);\
00443 }\
00444 \
00445 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,\
00446 int dst_stride, int src_stride1, int src_stride2,int src_stride3,int src_stride4, int h){\
00447 \
00448 int i;\
00449 for(i=0; i<h; i++){\
00450 uint32_t a, b, c, d, l0, l1, h0, h1;\
00451 a= AV_RN32(&src1[i*src_stride1]);\
00452 b= AV_RN32(&src2[i*src_stride2]);\
00453 c= AV_RN32(&src3[i*src_stride3]);\
00454 d= AV_RN32(&src4[i*src_stride4]);\
00455 l0= (a&0x03030303UL)\
00456 + (b&0x03030303UL)\
00457 + 0x01010101UL;\
00458 h0= ((a&0xFCFCFCFCUL)>>2)\
00459 + ((b&0xFCFCFCFCUL)>>2);\
00460 l1= (c&0x03030303UL)\
00461 + (d&0x03030303UL);\
00462 h1= ((c&0xFCFCFCFCUL)>>2)\
00463 + ((d&0xFCFCFCFCUL)>>2);\
00464 OP(*((uint32_t*)&dst[i*dst_stride]), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
00465 a= AV_RN32(&src1[i*src_stride1+4]);\
00466 b= AV_RN32(&src2[i*src_stride2+4]);\
00467 c= AV_RN32(&src3[i*src_stride3+4]);\
00468 d= AV_RN32(&src4[i*src_stride4+4]);\
00469 l0= (a&0x03030303UL)\
00470 + (b&0x03030303UL)\
00471 + 0x01010101UL;\
00472 h0= ((a&0xFCFCFCFCUL)>>2)\
00473 + ((b&0xFCFCFCFCUL)>>2);\
00474 l1= (c&0x03030303UL)\
00475 + (d&0x03030303UL);\
00476 h1= ((c&0xFCFCFCFCUL)>>2)\
00477 + ((d&0xFCFCFCFCUL)>>2);\
00478 OP(*((uint32_t*)&dst[i*dst_stride+4]), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
00479 }\
00480 }\
00481 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,\
00482 int dst_stride, int src_stride1, int src_stride2,int src_stride3,int src_stride4, int h){\
00483 FUNC(OPNAME ## _pixels8_l4)(dst , src1 , src2 , src3 , src4 , dst_stride, src_stride1, src_stride2, src_stride3, src_stride4, h);\
00484 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);\
00485 }\
00486 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,\
00487 int dst_stride, int src_stride1, int src_stride2,int src_stride3,int src_stride4, int h){\
00488 FUNC(OPNAME ## _no_rnd_pixels8_l4)(dst , src1 , src2 , src3 , src4 , dst_stride, src_stride1, src_stride2, src_stride3, src_stride4, h);\
00489 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);\
00490 }\
00491 \
00492 static inline void FUNCC(OPNAME ## _pixels2_xy2)(uint8_t *p_block, const uint8_t *p_pixels, int line_size, int h)\
00493 {\
00494 int i, a0, b0, a1, b1;\
00495 pixel *block = (pixel*)p_block;\
00496 const pixel *pixels = (const pixel*)p_pixels;\
00497 line_size >>= sizeof(pixel)-1;\
00498 a0= pixels[0];\
00499 b0= pixels[1] + 2;\
00500 a0 += b0;\
00501 b0 += pixels[2];\
00502 \
00503 pixels+=line_size;\
00504 for(i=0; i<h; i+=2){\
00505 a1= pixels[0];\
00506 b1= pixels[1];\
00507 a1 += b1;\
00508 b1 += pixels[2];\
00509 \
00510 block[0]= (a1+a0)>>2; \
00511 block[1]= (b1+b0)>>2;\
00512 \
00513 pixels+=line_size;\
00514 block +=line_size;\
00515 \
00516 a0= pixels[0];\
00517 b0= pixels[1] + 2;\
00518 a0 += b0;\
00519 b0 += pixels[2];\
00520 \
00521 block[0]= (a1+a0)>>2;\
00522 block[1]= (b1+b0)>>2;\
00523 pixels+=line_size;\
00524 block +=line_size;\
00525 }\
00526 }\
00527 \
00528 static inline void FUNCC(OPNAME ## _pixels4_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)\
00529 {\
00530 \
00531 int i;\
00532 const uint32_t a= AV_RN32(pixels );\
00533 const uint32_t b= AV_RN32(pixels+1);\
00534 uint32_t l0= (a&0x03030303UL)\
00535 + (b&0x03030303UL)\
00536 + 0x02020202UL;\
00537 uint32_t h0= ((a&0xFCFCFCFCUL)>>2)\
00538 + ((b&0xFCFCFCFCUL)>>2);\
00539 uint32_t l1,h1;\
00540 \
00541 pixels+=line_size;\
00542 for(i=0; i<h; i+=2){\
00543 uint32_t a= AV_RN32(pixels );\
00544 uint32_t b= AV_RN32(pixels+1);\
00545 l1= (a&0x03030303UL)\
00546 + (b&0x03030303UL);\
00547 h1= ((a&0xFCFCFCFCUL)>>2)\
00548 + ((b&0xFCFCFCFCUL)>>2);\
00549 OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
00550 pixels+=line_size;\
00551 block +=line_size;\
00552 a= AV_RN32(pixels );\
00553 b= AV_RN32(pixels+1);\
00554 l0= (a&0x03030303UL)\
00555 + (b&0x03030303UL)\
00556 + 0x02020202UL;\
00557 h0= ((a&0xFCFCFCFCUL)>>2)\
00558 + ((b&0xFCFCFCFCUL)>>2);\
00559 OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
00560 pixels+=line_size;\
00561 block +=line_size;\
00562 }\
00563 }\
00564 \
00565 static inline void FUNCC(OPNAME ## _pixels8_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)\
00566 {\
00567 \
00568 int j;\
00569 for(j=0; j<2; j++){\
00570 int i;\
00571 const uint32_t a= AV_RN32(pixels );\
00572 const uint32_t b= AV_RN32(pixels+1);\
00573 uint32_t l0= (a&0x03030303UL)\
00574 + (b&0x03030303UL)\
00575 + 0x02020202UL;\
00576 uint32_t h0= ((a&0xFCFCFCFCUL)>>2)\
00577 + ((b&0xFCFCFCFCUL)>>2);\
00578 uint32_t l1,h1;\
00579 \
00580 pixels+=line_size;\
00581 for(i=0; i<h; i+=2){\
00582 uint32_t a= AV_RN32(pixels );\
00583 uint32_t b= AV_RN32(pixels+1);\
00584 l1= (a&0x03030303UL)\
00585 + (b&0x03030303UL);\
00586 h1= ((a&0xFCFCFCFCUL)>>2)\
00587 + ((b&0xFCFCFCFCUL)>>2);\
00588 OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
00589 pixels+=line_size;\
00590 block +=line_size;\
00591 a= AV_RN32(pixels );\
00592 b= AV_RN32(pixels+1);\
00593 l0= (a&0x03030303UL)\
00594 + (b&0x03030303UL)\
00595 + 0x02020202UL;\
00596 h0= ((a&0xFCFCFCFCUL)>>2)\
00597 + ((b&0xFCFCFCFCUL)>>2);\
00598 OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
00599 pixels+=line_size;\
00600 block +=line_size;\
00601 }\
00602 pixels+=4-line_size*(h+1);\
00603 block +=4-line_size*h;\
00604 }\
00605 }\
00606 \
00607 static inline void FUNCC(OPNAME ## _no_rnd_pixels8_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)\
00608 {\
00609 \
00610 int j;\
00611 for(j=0; j<2; j++){\
00612 int i;\
00613 const uint32_t a= AV_RN32(pixels );\
00614 const uint32_t b= AV_RN32(pixels+1);\
00615 uint32_t l0= (a&0x03030303UL)\
00616 + (b&0x03030303UL)\
00617 + 0x01010101UL;\
00618 uint32_t h0= ((a&0xFCFCFCFCUL)>>2)\
00619 + ((b&0xFCFCFCFCUL)>>2);\
00620 uint32_t l1,h1;\
00621 \
00622 pixels+=line_size;\
00623 for(i=0; i<h; i+=2){\
00624 uint32_t a= AV_RN32(pixels );\
00625 uint32_t b= AV_RN32(pixels+1);\
00626 l1= (a&0x03030303UL)\
00627 + (b&0x03030303UL);\
00628 h1= ((a&0xFCFCFCFCUL)>>2)\
00629 + ((b&0xFCFCFCFCUL)>>2);\
00630 OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
00631 pixels+=line_size;\
00632 block +=line_size;\
00633 a= AV_RN32(pixels );\
00634 b= AV_RN32(pixels+1);\
00635 l0= (a&0x03030303UL)\
00636 + (b&0x03030303UL)\
00637 + 0x01010101UL;\
00638 h0= ((a&0xFCFCFCFCUL)>>2)\
00639 + ((b&0xFCFCFCFCUL)>>2);\
00640 OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
00641 pixels+=line_size;\
00642 block +=line_size;\
00643 }\
00644 pixels+=4-line_size*(h+1);\
00645 block +=4-line_size*h;\
00646 }\
00647 }\
00648 \
00649 CALL_2X_PIXELS(FUNCC(OPNAME ## _pixels16) , FUNCC(OPNAME ## _pixels8) , 8*sizeof(pixel))\
00650 CALL_2X_PIXELS(FUNCC(OPNAME ## _pixels16_x2) , FUNCC(OPNAME ## _pixels8_x2) , 8*sizeof(pixel))\
00651 CALL_2X_PIXELS(FUNCC(OPNAME ## _pixels16_y2) , FUNCC(OPNAME ## _pixels8_y2) , 8*sizeof(pixel))\
00652 CALL_2X_PIXELS(FUNCC(OPNAME ## _pixels16_xy2), FUNCC(OPNAME ## _pixels8_xy2), 8*sizeof(pixel))\
00653 av_unused CALL_2X_PIXELS(FUNCC(OPNAME ## _no_rnd_pixels16) , FUNCC(OPNAME ## _pixels8) , 8*sizeof(pixel))\
00654 CALL_2X_PIXELS(FUNCC(OPNAME ## _no_rnd_pixels16_x2) , FUNCC(OPNAME ## _no_rnd_pixels8_x2) , 8*sizeof(pixel))\
00655 CALL_2X_PIXELS(FUNCC(OPNAME ## _no_rnd_pixels16_y2) , FUNCC(OPNAME ## _no_rnd_pixels8_y2) , 8*sizeof(pixel))\
00656 CALL_2X_PIXELS(FUNCC(OPNAME ## _no_rnd_pixels16_xy2), FUNCC(OPNAME ## _no_rnd_pixels8_xy2), 8*sizeof(pixel))\
00657
00658 #define op_avg(a, b) a = rnd_avg_pixel4(a, b)
00659 #define op_put(a, b) a = b
00660
00661 PIXOP2(avg, op_avg)
00662 PIXOP2(put, op_put)
00663 #undef op_avg
00664 #undef op_put
00665
00666 #define put_no_rnd_pixels8_c put_pixels8_c
00667 #define put_no_rnd_pixels16_c put_pixels16_c
00668
00669 static void FUNCC(put_no_rnd_pixels16_l2)(uint8_t *dst, const uint8_t *a, const uint8_t *b, int stride, int h){
00670 FUNC(put_no_rnd_pixels16_l2)(dst, a, b, stride, stride, stride, h);
00671 }
00672
00673 static void FUNCC(put_no_rnd_pixels8_l2)(uint8_t *dst, const uint8_t *a, const uint8_t *b, int stride, int h){
00674 FUNC(put_no_rnd_pixels8_l2)(dst, a, b, stride, stride, stride, h);
00675 }
00676
00677 #define H264_CHROMA_MC(OPNAME, OP)\
00678 static void FUNCC(OPNAME ## h264_chroma_mc2)(uint8_t *p_dst, uint8_t *p_src, int stride, int h, int x, int y){\
00679 pixel *dst = (pixel*)p_dst;\
00680 pixel *src = (pixel*)p_src;\
00681 const int A=(8-x)*(8-y);\
00682 const int B=( x)*(8-y);\
00683 const int C=(8-x)*( y);\
00684 const int D=( x)*( y);\
00685 int i;\
00686 stride >>= sizeof(pixel)-1;\
00687 \
00688 av_assert2(x<8 && y<8 && x>=0 && y>=0);\
00689 \
00690 if(D){\
00691 for(i=0; i<h; i++){\
00692 OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\
00693 OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2]));\
00694 dst+= stride;\
00695 src+= stride;\
00696 }\
00697 }else{\
00698 const int E= B+C;\
00699 const int step= C ? stride : 1;\
00700 for(i=0; i<h; i++){\
00701 OP(dst[0], (A*src[0] + E*src[step+0]));\
00702 OP(dst[1], (A*src[1] + E*src[step+1]));\
00703 dst+= stride;\
00704 src+= stride;\
00705 }\
00706 }\
00707 }\
00708 \
00709 static void FUNCC(OPNAME ## h264_chroma_mc4)(uint8_t *p_dst, uint8_t *p_src, int stride, int h, int x, int y){\
00710 pixel *dst = (pixel*)p_dst;\
00711 pixel *src = (pixel*)p_src;\
00712 const int A=(8-x)*(8-y);\
00713 const int B=( x)*(8-y);\
00714 const int C=(8-x)*( y);\
00715 const int D=( x)*( y);\
00716 int i;\
00717 stride >>= sizeof(pixel)-1;\
00718 \
00719 av_assert2(x<8 && y<8 && x>=0 && y>=0);\
00720 \
00721 if(D){\
00722 for(i=0; i<h; i++){\
00723 OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\
00724 OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2]));\
00725 OP(dst[2], (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3]));\
00726 OP(dst[3], (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4]));\
00727 dst+= stride;\
00728 src+= stride;\
00729 }\
00730 }else{\
00731 const int E= B+C;\
00732 const int step= C ? stride : 1;\
00733 for(i=0; i<h; i++){\
00734 OP(dst[0], (A*src[0] + E*src[step+0]));\
00735 OP(dst[1], (A*src[1] + E*src[step+1]));\
00736 OP(dst[2], (A*src[2] + E*src[step+2]));\
00737 OP(dst[3], (A*src[3] + E*src[step+3]));\
00738 dst+= stride;\
00739 src+= stride;\
00740 }\
00741 }\
00742 }\
00743 \
00744 static void FUNCC(OPNAME ## h264_chroma_mc8)(uint8_t *p_dst, uint8_t *p_src, int stride, int h, int x, int y){\
00745 pixel *dst = (pixel*)p_dst;\
00746 pixel *src = (pixel*)p_src;\
00747 const int A=(8-x)*(8-y);\
00748 const int B=( x)*(8-y);\
00749 const int C=(8-x)*( y);\
00750 const int D=( x)*( y);\
00751 int i;\
00752 stride >>= sizeof(pixel)-1;\
00753 \
00754 av_assert2(x<8 && y<8 && x>=0 && y>=0);\
00755 \
00756 if(D){\
00757 for(i=0; i<h; i++){\
00758 OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\
00759 OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2]));\
00760 OP(dst[2], (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3]));\
00761 OP(dst[3], (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4]));\
00762 OP(dst[4], (A*src[4] + B*src[5] + C*src[stride+4] + D*src[stride+5]));\
00763 OP(dst[5], (A*src[5] + B*src[6] + C*src[stride+5] + D*src[stride+6]));\
00764 OP(dst[6], (A*src[6] + B*src[7] + C*src[stride+6] + D*src[stride+7]));\
00765 OP(dst[7], (A*src[7] + B*src[8] + C*src[stride+7] + D*src[stride+8]));\
00766 dst+= stride;\
00767 src+= stride;\
00768 }\
00769 }else{\
00770 const int E= B+C;\
00771 const int step= C ? stride : 1;\
00772 for(i=0; i<h; i++){\
00773 OP(dst[0], (A*src[0] + E*src[step+0]));\
00774 OP(dst[1], (A*src[1] + E*src[step+1]));\
00775 OP(dst[2], (A*src[2] + E*src[step+2]));\
00776 OP(dst[3], (A*src[3] + E*src[step+3]));\
00777 OP(dst[4], (A*src[4] + E*src[step+4]));\
00778 OP(dst[5], (A*src[5] + E*src[step+5]));\
00779 OP(dst[6], (A*src[6] + E*src[step+6]));\
00780 OP(dst[7], (A*src[7] + E*src[step+7]));\
00781 dst+= stride;\
00782 src+= stride;\
00783 }\
00784 }\
00785 }
00786
00787 #define op_avg(a, b) a = (((a)+(((b) + 32)>>6)+1)>>1)
00788 #define op_put(a, b) a = (((b) + 32)>>6)
00789
00790 H264_CHROMA_MC(put_ , op_put)
00791 H264_CHROMA_MC(avg_ , op_avg)
00792 #undef op_avg
00793 #undef op_put
00794
00795 #define H264_LOWPASS(OPNAME, OP, OP2) \
00796 static av_unused void FUNC(OPNAME ## h264_qpel2_h_lowpass)(uint8_t *p_dst, uint8_t *p_src, int dstStride, int srcStride){\
00797 const int h=2;\
00798 INIT_CLIP\
00799 int i;\
00800 pixel *dst = (pixel*)p_dst;\
00801 pixel *src = (pixel*)p_src;\
00802 dstStride >>= sizeof(pixel)-1;\
00803 srcStride >>= sizeof(pixel)-1;\
00804 for(i=0; i<h; i++)\
00805 {\
00806 OP(dst[0], (src[0]+src[1])*20 - (src[-1]+src[2])*5 + (src[-2]+src[3]));\
00807 OP(dst[1], (src[1]+src[2])*20 - (src[0 ]+src[3])*5 + (src[-1]+src[4]));\
00808 dst+=dstStride;\
00809 src+=srcStride;\
00810 }\
00811 }\
00812 \
00813 static av_unused void FUNC(OPNAME ## h264_qpel2_v_lowpass)(uint8_t *p_dst, uint8_t *p_src, int dstStride, int srcStride){\
00814 const int w=2;\
00815 INIT_CLIP\
00816 int i;\
00817 pixel *dst = (pixel*)p_dst;\
00818 pixel *src = (pixel*)p_src;\
00819 dstStride >>= sizeof(pixel)-1;\
00820 srcStride >>= sizeof(pixel)-1;\
00821 for(i=0; i<w; i++)\
00822 {\
00823 const int srcB= src[-2*srcStride];\
00824 const int srcA= src[-1*srcStride];\
00825 const int src0= src[0 *srcStride];\
00826 const int src1= src[1 *srcStride];\
00827 const int src2= src[2 *srcStride];\
00828 const int src3= src[3 *srcStride];\
00829 const int src4= src[4 *srcStride];\
00830 OP(dst[0*dstStride], (src0+src1)*20 - (srcA+src2)*5 + (srcB+src3));\
00831 OP(dst[1*dstStride], (src1+src2)*20 - (src0+src3)*5 + (srcA+src4));\
00832 dst++;\
00833 src++;\
00834 }\
00835 }\
00836 \
00837 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){\
00838 const int h=2;\
00839 const int w=2;\
00840 const int pad = (BIT_DEPTH == 10) ? (-10 * ((1<<BIT_DEPTH)-1)) : 0;\
00841 INIT_CLIP\
00842 int i;\
00843 pixel *dst = (pixel*)p_dst;\
00844 pixel *src = (pixel*)p_src;\
00845 dstStride >>= sizeof(pixel)-1;\
00846 srcStride >>= sizeof(pixel)-1;\
00847 src -= 2*srcStride;\
00848 for(i=0; i<h+5; i++)\
00849 {\
00850 tmp[0]= (src[0]+src[1])*20 - (src[-1]+src[2])*5 + (src[-2]+src[3]) + pad;\
00851 tmp[1]= (src[1]+src[2])*20 - (src[0 ]+src[3])*5 + (src[-1]+src[4]) + pad;\
00852 tmp+=tmpStride;\
00853 src+=srcStride;\
00854 }\
00855 tmp -= tmpStride*(h+5-2);\
00856 for(i=0; i<w; i++)\
00857 {\
00858 const int tmpB= tmp[-2*tmpStride] - pad;\
00859 const int tmpA= tmp[-1*tmpStride] - pad;\
00860 const int tmp0= tmp[0 *tmpStride] - pad;\
00861 const int tmp1= tmp[1 *tmpStride] - pad;\
00862 const int tmp2= tmp[2 *tmpStride] - pad;\
00863 const int tmp3= tmp[3 *tmpStride] - pad;\
00864 const int tmp4= tmp[4 *tmpStride] - pad;\
00865 OP2(dst[0*dstStride], (tmp0+tmp1)*20 - (tmpA+tmp2)*5 + (tmpB+tmp3));\
00866 OP2(dst[1*dstStride], (tmp1+tmp2)*20 - (tmp0+tmp3)*5 + (tmpA+tmp4));\
00867 dst++;\
00868 tmp++;\
00869 }\
00870 }\
00871 static void FUNC(OPNAME ## h264_qpel4_h_lowpass)(uint8_t *p_dst, uint8_t *p_src, int dstStride, int srcStride){\
00872 const int h=4;\
00873 INIT_CLIP\
00874 int i;\
00875 pixel *dst = (pixel*)p_dst;\
00876 pixel *src = (pixel*)p_src;\
00877 dstStride >>= sizeof(pixel)-1;\
00878 srcStride >>= sizeof(pixel)-1;\
00879 for(i=0; i<h; i++)\
00880 {\
00881 OP(dst[0], (src[0]+src[1])*20 - (src[-1]+src[2])*5 + (src[-2]+src[3]));\
00882 OP(dst[1], (src[1]+src[2])*20 - (src[0 ]+src[3])*5 + (src[-1]+src[4]));\
00883 OP(dst[2], (src[2]+src[3])*20 - (src[1 ]+src[4])*5 + (src[0 ]+src[5]));\
00884 OP(dst[3], (src[3]+src[4])*20 - (src[2 ]+src[5])*5 + (src[1 ]+src[6]));\
00885 dst+=dstStride;\
00886 src+=srcStride;\
00887 }\
00888 }\
00889 \
00890 static void FUNC(OPNAME ## h264_qpel4_v_lowpass)(uint8_t *p_dst, uint8_t *p_src, int dstStride, int srcStride){\
00891 const int w=4;\
00892 INIT_CLIP\
00893 int i;\
00894 pixel *dst = (pixel*)p_dst;\
00895 pixel *src = (pixel*)p_src;\
00896 dstStride >>= sizeof(pixel)-1;\
00897 srcStride >>= sizeof(pixel)-1;\
00898 for(i=0; i<w; i++)\
00899 {\
00900 const int srcB= src[-2*srcStride];\
00901 const int srcA= src[-1*srcStride];\
00902 const int src0= src[0 *srcStride];\
00903 const int src1= src[1 *srcStride];\
00904 const int src2= src[2 *srcStride];\
00905 const int src3= src[3 *srcStride];\
00906 const int src4= src[4 *srcStride];\
00907 const int src5= src[5 *srcStride];\
00908 const int src6= src[6 *srcStride];\
00909 OP(dst[0*dstStride], (src0+src1)*20 - (srcA+src2)*5 + (srcB+src3));\
00910 OP(dst[1*dstStride], (src1+src2)*20 - (src0+src3)*5 + (srcA+src4));\
00911 OP(dst[2*dstStride], (src2+src3)*20 - (src1+src4)*5 + (src0+src5));\
00912 OP(dst[3*dstStride], (src3+src4)*20 - (src2+src5)*5 + (src1+src6));\
00913 dst++;\
00914 src++;\
00915 }\
00916 }\
00917 \
00918 static void FUNC(OPNAME ## h264_qpel4_hv_lowpass)(uint8_t *p_dst, pixeltmp *tmp, uint8_t *p_src, int dstStride, int tmpStride, int srcStride){\
00919 const int h=4;\
00920 const int w=4;\
00921 const int pad = (BIT_DEPTH == 10) ? (-10 * ((1<<BIT_DEPTH)-1)) : 0;\
00922 INIT_CLIP\
00923 int i;\
00924 pixel *dst = (pixel*)p_dst;\
00925 pixel *src = (pixel*)p_src;\
00926 dstStride >>= sizeof(pixel)-1;\
00927 srcStride >>= sizeof(pixel)-1;\
00928 src -= 2*srcStride;\
00929 for(i=0; i<h+5; i++)\
00930 {\
00931 tmp[0]= (src[0]+src[1])*20 - (src[-1]+src[2])*5 + (src[-2]+src[3]) + pad;\
00932 tmp[1]= (src[1]+src[2])*20 - (src[0 ]+src[3])*5 + (src[-1]+src[4]) + pad;\
00933 tmp[2]= (src[2]+src[3])*20 - (src[1 ]+src[4])*5 + (src[0 ]+src[5]) + pad;\
00934 tmp[3]= (src[3]+src[4])*20 - (src[2 ]+src[5])*5 + (src[1 ]+src[6]) + pad;\
00935 tmp+=tmpStride;\
00936 src+=srcStride;\
00937 }\
00938 tmp -= tmpStride*(h+5-2);\
00939 for(i=0; i<w; i++)\
00940 {\
00941 const int tmpB= tmp[-2*tmpStride] - pad;\
00942 const int tmpA= tmp[-1*tmpStride] - pad;\
00943 const int tmp0= tmp[0 *tmpStride] - pad;\
00944 const int tmp1= tmp[1 *tmpStride] - pad;\
00945 const int tmp2= tmp[2 *tmpStride] - pad;\
00946 const int tmp3= tmp[3 *tmpStride] - pad;\
00947 const int tmp4= tmp[4 *tmpStride] - pad;\
00948 const int tmp5= tmp[5 *tmpStride] - pad;\
00949 const int tmp6= tmp[6 *tmpStride] - pad;\
00950 OP2(dst[0*dstStride], (tmp0+tmp1)*20 - (tmpA+tmp2)*5 + (tmpB+tmp3));\
00951 OP2(dst[1*dstStride], (tmp1+tmp2)*20 - (tmp0+tmp3)*5 + (tmpA+tmp4));\
00952 OP2(dst[2*dstStride], (tmp2+tmp3)*20 - (tmp1+tmp4)*5 + (tmp0+tmp5));\
00953 OP2(dst[3*dstStride], (tmp3+tmp4)*20 - (tmp2+tmp5)*5 + (tmp1+tmp6));\
00954 dst++;\
00955 tmp++;\
00956 }\
00957 }\
00958 \
00959 static void FUNC(OPNAME ## h264_qpel8_h_lowpass)(uint8_t *p_dst, uint8_t *p_src, int dstStride, int srcStride){\
00960 const int h=8;\
00961 INIT_CLIP\
00962 int i;\
00963 pixel *dst = (pixel*)p_dst;\
00964 pixel *src = (pixel*)p_src;\
00965 dstStride >>= sizeof(pixel)-1;\
00966 srcStride >>= sizeof(pixel)-1;\
00967 for(i=0; i<h; i++)\
00968 {\
00969 OP(dst[0], (src[0]+src[1])*20 - (src[-1]+src[2])*5 + (src[-2]+src[3 ]));\
00970 OP(dst[1], (src[1]+src[2])*20 - (src[0 ]+src[3])*5 + (src[-1]+src[4 ]));\
00971 OP(dst[2], (src[2]+src[3])*20 - (src[1 ]+src[4])*5 + (src[0 ]+src[5 ]));\
00972 OP(dst[3], (src[3]+src[4])*20 - (src[2 ]+src[5])*5 + (src[1 ]+src[6 ]));\
00973 OP(dst[4], (src[4]+src[5])*20 - (src[3 ]+src[6])*5 + (src[2 ]+src[7 ]));\
00974 OP(dst[5], (src[5]+src[6])*20 - (src[4 ]+src[7])*5 + (src[3 ]+src[8 ]));\
00975 OP(dst[6], (src[6]+src[7])*20 - (src[5 ]+src[8])*5 + (src[4 ]+src[9 ]));\
00976 OP(dst[7], (src[7]+src[8])*20 - (src[6 ]+src[9])*5 + (src[5 ]+src[10]));\
00977 dst+=dstStride;\
00978 src+=srcStride;\
00979 }\
00980 }\
00981 \
00982 static void FUNC(OPNAME ## h264_qpel8_v_lowpass)(uint8_t *p_dst, uint8_t *p_src, int dstStride, int srcStride){\
00983 const int w=8;\
00984 INIT_CLIP\
00985 int i;\
00986 pixel *dst = (pixel*)p_dst;\
00987 pixel *src = (pixel*)p_src;\
00988 dstStride >>= sizeof(pixel)-1;\
00989 srcStride >>= sizeof(pixel)-1;\
00990 for(i=0; i<w; i++)\
00991 {\
00992 const int srcB= src[-2*srcStride];\
00993 const int srcA= src[-1*srcStride];\
00994 const int src0= src[0 *srcStride];\
00995 const int src1= src[1 *srcStride];\
00996 const int src2= src[2 *srcStride];\
00997 const int src3= src[3 *srcStride];\
00998 const int src4= src[4 *srcStride];\
00999 const int src5= src[5 *srcStride];\
01000 const int src6= src[6 *srcStride];\
01001 const int src7= src[7 *srcStride];\
01002 const int src8= src[8 *srcStride];\
01003 const int src9= src[9 *srcStride];\
01004 const int src10=src[10*srcStride];\
01005 OP(dst[0*dstStride], (src0+src1)*20 - (srcA+src2)*5 + (srcB+src3));\
01006 OP(dst[1*dstStride], (src1+src2)*20 - (src0+src3)*5 + (srcA+src4));\
01007 OP(dst[2*dstStride], (src2+src3)*20 - (src1+src4)*5 + (src0+src5));\
01008 OP(dst[3*dstStride], (src3+src4)*20 - (src2+src5)*5 + (src1+src6));\
01009 OP(dst[4*dstStride], (src4+src5)*20 - (src3+src6)*5 + (src2+src7));\
01010 OP(dst[5*dstStride], (src5+src6)*20 - (src4+src7)*5 + (src3+src8));\
01011 OP(dst[6*dstStride], (src6+src7)*20 - (src5+src8)*5 + (src4+src9));\
01012 OP(dst[7*dstStride], (src7+src8)*20 - (src6+src9)*5 + (src5+src10));\
01013 dst++;\
01014 src++;\
01015 }\
01016 }\
01017 \
01018 static void FUNC(OPNAME ## h264_qpel8_hv_lowpass)(uint8_t *p_dst, pixeltmp *tmp, uint8_t *p_src, int dstStride, int tmpStride, int srcStride){\
01019 const int h=8;\
01020 const int w=8;\
01021 const int pad = (BIT_DEPTH == 10) ? (-10 * ((1<<BIT_DEPTH)-1)) : 0;\
01022 INIT_CLIP\
01023 int i;\
01024 pixel *dst = (pixel*)p_dst;\
01025 pixel *src = (pixel*)p_src;\
01026 dstStride >>= sizeof(pixel)-1;\
01027 srcStride >>= sizeof(pixel)-1;\
01028 src -= 2*srcStride;\
01029 for(i=0; i<h+5; i++)\
01030 {\
01031 tmp[0]= (src[0]+src[1])*20 - (src[-1]+src[2])*5 + (src[-2]+src[3 ]) + pad;\
01032 tmp[1]= (src[1]+src[2])*20 - (src[0 ]+src[3])*5 + (src[-1]+src[4 ]) + pad;\
01033 tmp[2]= (src[2]+src[3])*20 - (src[1 ]+src[4])*5 + (src[0 ]+src[5 ]) + pad;\
01034 tmp[3]= (src[3]+src[4])*20 - (src[2 ]+src[5])*5 + (src[1 ]+src[6 ]) + pad;\
01035 tmp[4]= (src[4]+src[5])*20 - (src[3 ]+src[6])*5 + (src[2 ]+src[7 ]) + pad;\
01036 tmp[5]= (src[5]+src[6])*20 - (src[4 ]+src[7])*5 + (src[3 ]+src[8 ]) + pad;\
01037 tmp[6]= (src[6]+src[7])*20 - (src[5 ]+src[8])*5 + (src[4 ]+src[9 ]) + pad;\
01038 tmp[7]= (src[7]+src[8])*20 - (src[6 ]+src[9])*5 + (src[5 ]+src[10]) + pad;\
01039 tmp+=tmpStride;\
01040 src+=srcStride;\
01041 }\
01042 tmp -= tmpStride*(h+5-2);\
01043 for(i=0; i<w; i++)\
01044 {\
01045 const int tmpB= tmp[-2*tmpStride] - pad;\
01046 const int tmpA= tmp[-1*tmpStride] - pad;\
01047 const int tmp0= tmp[0 *tmpStride] - pad;\
01048 const int tmp1= tmp[1 *tmpStride] - pad;\
01049 const int tmp2= tmp[2 *tmpStride] - pad;\
01050 const int tmp3= tmp[3 *tmpStride] - pad;\
01051 const int tmp4= tmp[4 *tmpStride] - pad;\
01052 const int tmp5= tmp[5 *tmpStride] - pad;\
01053 const int tmp6= tmp[6 *tmpStride] - pad;\
01054 const int tmp7= tmp[7 *tmpStride] - pad;\
01055 const int tmp8= tmp[8 *tmpStride] - pad;\
01056 const int tmp9= tmp[9 *tmpStride] - pad;\
01057 const int tmp10=tmp[10*tmpStride] - pad;\
01058 OP2(dst[0*dstStride], (tmp0+tmp1)*20 - (tmpA+tmp2)*5 + (tmpB+tmp3));\
01059 OP2(dst[1*dstStride], (tmp1+tmp2)*20 - (tmp0+tmp3)*5 + (tmpA+tmp4));\
01060 OP2(dst[2*dstStride], (tmp2+tmp3)*20 - (tmp1+tmp4)*5 + (tmp0+tmp5));\
01061 OP2(dst[3*dstStride], (tmp3+tmp4)*20 - (tmp2+tmp5)*5 + (tmp1+tmp6));\
01062 OP2(dst[4*dstStride], (tmp4+tmp5)*20 - (tmp3+tmp6)*5 + (tmp2+tmp7));\
01063 OP2(dst[5*dstStride], (tmp5+tmp6)*20 - (tmp4+tmp7)*5 + (tmp3+tmp8));\
01064 OP2(dst[6*dstStride], (tmp6+tmp7)*20 - (tmp5+tmp8)*5 + (tmp4+tmp9));\
01065 OP2(dst[7*dstStride], (tmp7+tmp8)*20 - (tmp6+tmp9)*5 + (tmp5+tmp10));\
01066 dst++;\
01067 tmp++;\
01068 }\
01069 }\
01070 \
01071 static void FUNC(OPNAME ## h264_qpel16_v_lowpass)(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
01072 FUNC(OPNAME ## h264_qpel8_v_lowpass)(dst , src , dstStride, srcStride);\
01073 FUNC(OPNAME ## h264_qpel8_v_lowpass)(dst+8*sizeof(pixel), src+8*sizeof(pixel), dstStride, srcStride);\
01074 src += 8*srcStride;\
01075 dst += 8*dstStride;\
01076 FUNC(OPNAME ## h264_qpel8_v_lowpass)(dst , src , dstStride, srcStride);\
01077 FUNC(OPNAME ## h264_qpel8_v_lowpass)(dst+8*sizeof(pixel), src+8*sizeof(pixel), dstStride, srcStride);\
01078 }\
01079 \
01080 static void FUNC(OPNAME ## h264_qpel16_h_lowpass)(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
01081 FUNC(OPNAME ## h264_qpel8_h_lowpass)(dst , src , dstStride, srcStride);\
01082 FUNC(OPNAME ## h264_qpel8_h_lowpass)(dst+8*sizeof(pixel), src+8*sizeof(pixel), dstStride, srcStride);\
01083 src += 8*srcStride;\
01084 dst += 8*dstStride;\
01085 FUNC(OPNAME ## h264_qpel8_h_lowpass)(dst , src , dstStride, srcStride);\
01086 FUNC(OPNAME ## h264_qpel8_h_lowpass)(dst+8*sizeof(pixel), src+8*sizeof(pixel), dstStride, srcStride);\
01087 }\
01088 \
01089 static void FUNC(OPNAME ## h264_qpel16_hv_lowpass)(uint8_t *dst, pixeltmp *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
01090 FUNC(OPNAME ## h264_qpel8_hv_lowpass)(dst , tmp , src , dstStride, tmpStride, srcStride);\
01091 FUNC(OPNAME ## h264_qpel8_hv_lowpass)(dst+8*sizeof(pixel), tmp+8, src+8*sizeof(pixel), dstStride, tmpStride, srcStride);\
01092 src += 8*srcStride;\
01093 dst += 8*dstStride;\
01094 FUNC(OPNAME ## h264_qpel8_hv_lowpass)(dst , tmp , src , dstStride, tmpStride, srcStride);\
01095 FUNC(OPNAME ## h264_qpel8_hv_lowpass)(dst+8*sizeof(pixel), tmp+8, src+8*sizeof(pixel), dstStride, tmpStride, srcStride);\
01096 }\
01097
01098 #define H264_MC(OPNAME, SIZE) \
01099 static av_unused void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc00)(uint8_t *dst, uint8_t *src, int stride){\
01100 FUNCC(OPNAME ## pixels ## SIZE)(dst, src, stride, SIZE);\
01101 }\
01102 \
01103 static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc10)(uint8_t *dst, uint8_t *src, int stride){\
01104 uint8_t half[SIZE*SIZE*sizeof(pixel)];\
01105 FUNC(put_h264_qpel ## SIZE ## _h_lowpass)(half, src, SIZE*sizeof(pixel), stride);\
01106 FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, src, half, stride, stride, SIZE*sizeof(pixel), SIZE);\
01107 }\
01108 \
01109 static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc20)(uint8_t *dst, uint8_t *src, int stride){\
01110 FUNC(OPNAME ## h264_qpel ## SIZE ## _h_lowpass)(dst, src, stride, stride);\
01111 }\
01112 \
01113 static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc30)(uint8_t *dst, uint8_t *src, int stride){\
01114 uint8_t half[SIZE*SIZE*sizeof(pixel)];\
01115 FUNC(put_h264_qpel ## SIZE ## _h_lowpass)(half, src, SIZE*sizeof(pixel), stride);\
01116 FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, src+sizeof(pixel), half, stride, stride, SIZE*sizeof(pixel), SIZE);\
01117 }\
01118 \
01119 static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc01)(uint8_t *dst, uint8_t *src, int stride){\
01120 uint8_t full[SIZE*(SIZE+5)*sizeof(pixel)];\
01121 uint8_t * const full_mid= full + SIZE*2*sizeof(pixel);\
01122 uint8_t half[SIZE*SIZE*sizeof(pixel)];\
01123 FUNC(copy_block ## SIZE )(full, src - stride*2, SIZE*sizeof(pixel), stride, SIZE + 5);\
01124 FUNC(put_h264_qpel ## SIZE ## _v_lowpass)(half, full_mid, SIZE*sizeof(pixel), SIZE*sizeof(pixel));\
01125 FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, full_mid, half, stride, SIZE*sizeof(pixel), SIZE*sizeof(pixel), SIZE);\
01126 }\
01127 \
01128 static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc02)(uint8_t *dst, uint8_t *src, int stride){\
01129 uint8_t full[SIZE*(SIZE+5)*sizeof(pixel)];\
01130 uint8_t * const full_mid= full + SIZE*2*sizeof(pixel);\
01131 FUNC(copy_block ## SIZE )(full, src - stride*2, SIZE*sizeof(pixel), stride, SIZE + 5);\
01132 FUNC(OPNAME ## h264_qpel ## SIZE ## _v_lowpass)(dst, full_mid, stride, SIZE*sizeof(pixel));\
01133 }\
01134 \
01135 static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc03)(uint8_t *dst, uint8_t *src, int stride){\
01136 uint8_t full[SIZE*(SIZE+5)*sizeof(pixel)];\
01137 uint8_t * const full_mid= full + SIZE*2*sizeof(pixel);\
01138 uint8_t half[SIZE*SIZE*sizeof(pixel)];\
01139 FUNC(copy_block ## SIZE )(full, src - stride*2, SIZE*sizeof(pixel), stride, SIZE + 5);\
01140 FUNC(put_h264_qpel ## SIZE ## _v_lowpass)(half, full_mid, SIZE*sizeof(pixel), SIZE*sizeof(pixel));\
01141 FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, full_mid+SIZE*sizeof(pixel), half, stride, SIZE*sizeof(pixel), SIZE*sizeof(pixel), SIZE);\
01142 }\
01143 \
01144 static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc11)(uint8_t *dst, uint8_t *src, int stride){\
01145 uint8_t full[SIZE*(SIZE+5)*sizeof(pixel)];\
01146 uint8_t * const full_mid= full + SIZE*2*sizeof(pixel);\
01147 uint8_t halfH[SIZE*SIZE*sizeof(pixel)];\
01148 uint8_t halfV[SIZE*SIZE*sizeof(pixel)];\
01149 FUNC(put_h264_qpel ## SIZE ## _h_lowpass)(halfH, src, SIZE*sizeof(pixel), stride);\
01150 FUNC(copy_block ## SIZE )(full, src - stride*2, SIZE*sizeof(pixel), stride, SIZE + 5);\
01151 FUNC(put_h264_qpel ## SIZE ## _v_lowpass)(halfV, full_mid, SIZE*sizeof(pixel), SIZE*sizeof(pixel));\
01152 FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, halfH, halfV, stride, SIZE*sizeof(pixel), SIZE*sizeof(pixel), SIZE);\
01153 }\
01154 \
01155 static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc31)(uint8_t *dst, uint8_t *src, int stride){\
01156 uint8_t full[SIZE*(SIZE+5)*sizeof(pixel)];\
01157 uint8_t * const full_mid= full + SIZE*2*sizeof(pixel);\
01158 uint8_t halfH[SIZE*SIZE*sizeof(pixel)];\
01159 uint8_t halfV[SIZE*SIZE*sizeof(pixel)];\
01160 FUNC(put_h264_qpel ## SIZE ## _h_lowpass)(halfH, src, SIZE*sizeof(pixel), stride);\
01161 FUNC(copy_block ## SIZE )(full, src - stride*2 + sizeof(pixel), SIZE*sizeof(pixel), stride, SIZE + 5);\
01162 FUNC(put_h264_qpel ## SIZE ## _v_lowpass)(halfV, full_mid, SIZE*sizeof(pixel), SIZE*sizeof(pixel));\
01163 FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, halfH, halfV, stride, SIZE*sizeof(pixel), SIZE*sizeof(pixel), SIZE);\
01164 }\
01165 \
01166 static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc13)(uint8_t *dst, uint8_t *src, int stride){\
01167 uint8_t full[SIZE*(SIZE+5)*sizeof(pixel)];\
01168 uint8_t * const full_mid= full + SIZE*2*sizeof(pixel);\
01169 uint8_t halfH[SIZE*SIZE*sizeof(pixel)];\
01170 uint8_t halfV[SIZE*SIZE*sizeof(pixel)];\
01171 FUNC(put_h264_qpel ## SIZE ## _h_lowpass)(halfH, src + stride, SIZE*sizeof(pixel), stride);\
01172 FUNC(copy_block ## SIZE )(full, src - stride*2, SIZE*sizeof(pixel), stride, SIZE + 5);\
01173 FUNC(put_h264_qpel ## SIZE ## _v_lowpass)(halfV, full_mid, SIZE*sizeof(pixel), SIZE*sizeof(pixel));\
01174 FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, halfH, halfV, stride, SIZE*sizeof(pixel), SIZE*sizeof(pixel), SIZE);\
01175 }\
01176 \
01177 static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc33)(uint8_t *dst, uint8_t *src, int stride){\
01178 uint8_t full[SIZE*(SIZE+5)*sizeof(pixel)];\
01179 uint8_t * const full_mid= full + SIZE*2*sizeof(pixel);\
01180 uint8_t halfH[SIZE*SIZE*sizeof(pixel)];\
01181 uint8_t halfV[SIZE*SIZE*sizeof(pixel)];\
01182 FUNC(put_h264_qpel ## SIZE ## _h_lowpass)(halfH, src + stride, SIZE*sizeof(pixel), stride);\
01183 FUNC(copy_block ## SIZE )(full, src - stride*2 + sizeof(pixel), SIZE*sizeof(pixel), stride, SIZE + 5);\
01184 FUNC(put_h264_qpel ## SIZE ## _v_lowpass)(halfV, full_mid, SIZE*sizeof(pixel), SIZE*sizeof(pixel));\
01185 FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, halfH, halfV, stride, SIZE*sizeof(pixel), SIZE*sizeof(pixel), SIZE);\
01186 }\
01187 \
01188 static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc22)(uint8_t *dst, uint8_t *src, int stride){\
01189 pixeltmp tmp[SIZE*(SIZE+5)*sizeof(pixel)];\
01190 FUNC(OPNAME ## h264_qpel ## SIZE ## _hv_lowpass)(dst, tmp, src, stride, SIZE*sizeof(pixel), stride);\
01191 }\
01192 \
01193 static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc21)(uint8_t *dst, uint8_t *src, int stride){\
01194 pixeltmp tmp[SIZE*(SIZE+5)*sizeof(pixel)];\
01195 uint8_t halfH[SIZE*SIZE*sizeof(pixel)];\
01196 uint8_t halfHV[SIZE*SIZE*sizeof(pixel)];\
01197 FUNC(put_h264_qpel ## SIZE ## _h_lowpass)(halfH, src, SIZE*sizeof(pixel), stride);\
01198 FUNC(put_h264_qpel ## SIZE ## _hv_lowpass)(halfHV, tmp, src, SIZE*sizeof(pixel), SIZE*sizeof(pixel), stride);\
01199 FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, halfH, halfHV, stride, SIZE*sizeof(pixel), SIZE*sizeof(pixel), SIZE);\
01200 }\
01201 \
01202 static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc23)(uint8_t *dst, uint8_t *src, int stride){\
01203 pixeltmp tmp[SIZE*(SIZE+5)*sizeof(pixel)];\
01204 uint8_t halfH[SIZE*SIZE*sizeof(pixel)];\
01205 uint8_t halfHV[SIZE*SIZE*sizeof(pixel)];\
01206 FUNC(put_h264_qpel ## SIZE ## _h_lowpass)(halfH, src + stride, SIZE*sizeof(pixel), stride);\
01207 FUNC(put_h264_qpel ## SIZE ## _hv_lowpass)(halfHV, tmp, src, SIZE*sizeof(pixel), SIZE*sizeof(pixel), stride);\
01208 FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, halfH, halfHV, stride, SIZE*sizeof(pixel), SIZE*sizeof(pixel), SIZE);\
01209 }\
01210 \
01211 static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc12)(uint8_t *dst, uint8_t *src, int stride){\
01212 uint8_t full[SIZE*(SIZE+5)*sizeof(pixel)];\
01213 uint8_t * const full_mid= full + SIZE*2*sizeof(pixel);\
01214 pixeltmp tmp[SIZE*(SIZE+5)*sizeof(pixel)];\
01215 uint8_t halfV[SIZE*SIZE*sizeof(pixel)];\
01216 uint8_t halfHV[SIZE*SIZE*sizeof(pixel)];\
01217 FUNC(copy_block ## SIZE )(full, src - stride*2, SIZE*sizeof(pixel), stride, SIZE + 5);\
01218 FUNC(put_h264_qpel ## SIZE ## _v_lowpass)(halfV, full_mid, SIZE*sizeof(pixel), SIZE*sizeof(pixel));\
01219 FUNC(put_h264_qpel ## SIZE ## _hv_lowpass)(halfHV, tmp, src, SIZE*sizeof(pixel), SIZE*sizeof(pixel), stride);\
01220 FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, halfV, halfHV, stride, SIZE*sizeof(pixel), SIZE*sizeof(pixel), SIZE);\
01221 }\
01222 \
01223 static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc32)(uint8_t *dst, uint8_t *src, int stride){\
01224 uint8_t full[SIZE*(SIZE+5)*sizeof(pixel)];\
01225 uint8_t * const full_mid= full + SIZE*2*sizeof(pixel);\
01226 pixeltmp tmp[SIZE*(SIZE+5)*sizeof(pixel)];\
01227 uint8_t halfV[SIZE*SIZE*sizeof(pixel)];\
01228 uint8_t halfHV[SIZE*SIZE*sizeof(pixel)];\
01229 FUNC(copy_block ## SIZE )(full, src - stride*2 + sizeof(pixel), SIZE*sizeof(pixel), stride, SIZE + 5);\
01230 FUNC(put_h264_qpel ## SIZE ## _v_lowpass)(halfV, full_mid, SIZE*sizeof(pixel), SIZE*sizeof(pixel));\
01231 FUNC(put_h264_qpel ## SIZE ## _hv_lowpass)(halfHV, tmp, src, SIZE*sizeof(pixel), SIZE*sizeof(pixel), stride);\
01232 FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, halfV, halfHV, stride, SIZE*sizeof(pixel), SIZE*sizeof(pixel), SIZE);\
01233 }\
01234
01235 #define op_avg(a, b) a = (((a)+CLIP(((b) + 16)>>5)+1)>>1)
01236
01237 #define op_put(a, b) a = CLIP(((b) + 16)>>5)
01238 #define op2_avg(a, b) a = (((a)+CLIP(((b) + 512)>>10)+1)>>1)
01239 #define op2_put(a, b) a = CLIP(((b) + 512)>>10)
01240
01241 H264_LOWPASS(put_ , op_put, op2_put)
01242 H264_LOWPASS(avg_ , op_avg, op2_avg)
01243 H264_MC(put_, 2)
01244 H264_MC(put_, 4)
01245 H264_MC(put_, 8)
01246 H264_MC(put_, 16)
01247 H264_MC(avg_, 4)
01248 H264_MC(avg_, 8)
01249 H264_MC(avg_, 16)
01250
01251 #undef op_avg
01252 #undef op_put
01253 #undef op2_avg
01254 #undef op2_put
01255
01256 #if BIT_DEPTH == 8
01257 # define put_h264_qpel8_mc00_8_c ff_put_pixels8x8_8_c
01258 # define avg_h264_qpel8_mc00_8_c ff_avg_pixels8x8_8_c
01259 # define put_h264_qpel16_mc00_8_c ff_put_pixels16x16_8_c
01260 # define avg_h264_qpel16_mc00_8_c ff_avg_pixels16x16_8_c
01261 #elif BIT_DEPTH == 9
01262 # define put_h264_qpel8_mc00_9_c ff_put_pixels8x8_9_c
01263 # define avg_h264_qpel8_mc00_9_c ff_avg_pixels8x8_9_c
01264 # define put_h264_qpel16_mc00_9_c ff_put_pixels16x16_9_c
01265 # define avg_h264_qpel16_mc00_9_c ff_avg_pixels16x16_9_c
01266 #elif BIT_DEPTH == 10
01267 # define put_h264_qpel8_mc00_10_c ff_put_pixels8x8_10_c
01268 # define avg_h264_qpel8_mc00_10_c ff_avg_pixels8x8_10_c
01269 # define put_h264_qpel16_mc00_10_c ff_put_pixels16x16_10_c
01270 # define avg_h264_qpel16_mc00_10_c ff_avg_pixels16x16_10_c
01271 #elif BIT_DEPTH == 12
01272 # define put_h264_qpel8_mc00_12_c ff_put_pixels8x8_12_c
01273 # define avg_h264_qpel8_mc00_12_c ff_avg_pixels8x8_12_c
01274 # define put_h264_qpel16_mc00_12_c ff_put_pixels16x16_12_c
01275 # define avg_h264_qpel16_mc00_12_c ff_avg_pixels16x16_12_c
01276 #elif BIT_DEPTH == 14
01277 # define put_h264_qpel8_mc00_14_c ff_put_pixels8x8_14_c
01278 # define avg_h264_qpel8_mc00_14_c ff_avg_pixels8x8_14_c
01279 # define put_h264_qpel16_mc00_14_c ff_put_pixels16x16_14_c
01280 # define avg_h264_qpel16_mc00_14_c ff_avg_pixels16x16_14_c
01281 #endif
01282
01283 void FUNCC(ff_put_pixels8x8)(uint8_t *dst, uint8_t *src, int stride) {
01284 FUNCC(put_pixels8)(dst, src, stride, 8);
01285 }
01286 void FUNCC(ff_avg_pixels8x8)(uint8_t *dst, uint8_t *src, int stride) {
01287 FUNCC(avg_pixels8)(dst, src, stride, 8);
01288 }
01289 void FUNCC(ff_put_pixels16x16)(uint8_t *dst, uint8_t *src, int stride) {
01290 FUNCC(put_pixels16)(dst, src, stride, 16);
01291 }
01292 void FUNCC(ff_avg_pixels16x16)(uint8_t *dst, uint8_t *src, int stride) {
01293 FUNCC(avg_pixels16)(dst, src, stride, 16);
01294 }
01295