29 #define H264_CHROMA_MC(OPNAME, OP)\
30 static void OPNAME ## h264_chroma_mc2_sh4(uint8_t *dst, uint8_t *src, int stride, int h, int x, int y){\
31 const int A=(8-x)*(8-y);\
32 const int B=( x)*(8-y);\
33 const int C=(8-x)*( y);\
34 const int D=( x)*( y);\
36 assert(x<8 && y<8 && x>=0 && y>=0);\
41 uint8_t *s1 = src+stride; \
42 t0 = *s0++; t2 = *s1++; \
43 t1 = *s0++; t3 = *s1++; \
44 OP(dst[0], (A*t0 + B*t1 + C*t2 + D*t3));\
45 t0 = *s0++; t2 = *s1++; \
46 OP(dst[1], (A*t1 + B*t0 + C*t3 + D*t2));\
52 static void OPNAME ## h264_chroma_mc4_sh4(uint8_t *dst, uint8_t *src, int stride, int h, int x, int y){\
53 const int A=(8-x)*(8-y);\
54 const int B=( x)*(8-y);\
55 const int C=(8-x)*( y);\
56 const int D=( x)*( y);\
58 assert(x<8 && y<8 && x>=0 && y>=0);\
63 uint8_t *s1 = src+stride; \
64 t0 = *s0++; t2 = *s1++; \
65 t1 = *s0++; t3 = *s1++; \
66 OP(dst[0], (A*t0 + B*t1 + C*t2 + D*t3));\
67 t0 = *s0++; t2 = *s1++; \
68 OP(dst[1], (A*t1 + B*t0 + C*t3 + D*t2));\
69 t1 = *s0++; t3 = *s1++; \
70 OP(dst[2], (A*t0 + B*t1 + C*t2 + D*t3));\
71 t0 = *s0++; t2 = *s1++; \
72 OP(dst[3], (A*t1 + B*t0 + C*t3 + D*t2));\
78 static void OPNAME ## h264_chroma_mc8_sh4(uint8_t *dst, uint8_t *src, int stride, int h, int x, int y){\
79 const int A=(8-x)*(8-y);\
80 const int B=( x)*(8-y);\
81 const int C=(8-x)*( y);\
82 const int D=( x)*( y);\
84 assert(x<8 && y<8 && x>=0 && y>=0);\
89 uint8_t *s1 = src+stride; \
90 t0 = *s0++; t2 = *s1++; \
91 t1 = *s0++; t3 = *s1++; \
92 OP(dst[0], (A*t0 + B*t1 + C*t2 + D*t3));\
93 t0 = *s0++; t2 = *s1++; \
94 OP(dst[1], (A*t1 + B*t0 + C*t3 + D*t2));\
95 t1 = *s0++; t3 = *s1++; \
96 OP(dst[2], (A*t0 + B*t1 + C*t2 + D*t3));\
97 t0 = *s0++; t2 = *s1++; \
98 OP(dst[3], (A*t1 + B*t0 + C*t3 + D*t2));\
99 t1 = *s0++; t3 = *s1++; \
100 OP(dst[4], (A*t0 + B*t1 + C*t2 + D*t3));\
101 t0 = *s0++; t2 = *s1++; \
102 OP(dst[5], (A*t1 + B*t0 + C*t3 + D*t2));\
103 t1 = *s0++; t3 = *s1++; \
104 OP(dst[6], (A*t0 + B*t1 + C*t2 + D*t3));\
105 t0 = *s0++; t2 = *s1++; \
106 OP(dst[7], (A*t1 + B*t0 + C*t3 + D*t2));\
112 #define op_avg(a, b) a = (((a)+(((b) + 32)>>6)+1)>>1)
113 #define op_put(a, b) a = (((b) + 32)>>6)
122 const int high_bit_depth = bit_depth > 8;
124 if (!high_bit_depth) {