27 #define COMPOSE_VERTICAL(ext, align) \
28 void ff_vertical_compose53iL0##ext(int16_t *b0, int16_t *b1, int16_t *b2, int width); \
29 void ff_vertical_compose_dirac53iH0##ext(int16_t *b0, int16_t *b1, int16_t *b2, int width); \
30 void ff_vertical_compose_dd137iL0##ext(int16_t *b0, int16_t *b1, int16_t *b2, int16_t *b3, int16_t *b4, int width); \
31 void ff_vertical_compose_dd97iH0##ext(int16_t *b0, int16_t *b1, int16_t *b2, int16_t *b3, int16_t *b4, int width); \
32 void ff_vertical_compose_haar##ext(int16_t *b0, int16_t *b1, int width); \
33 void ff_horizontal_compose_haar0i##ext(int16_t *b, int16_t *tmp, int w);\
34 void ff_horizontal_compose_haar1i##ext(int16_t *b, int16_t *tmp, int w);\
36 static void vertical_compose53iL0##ext(uint8_t *_b0, uint8_t *_b1, uint8_t *_b2, int width) \
38 int i, width_align = width&~(align-1); \
39 int16_t *b0 = (int16_t *)_b0; \
40 int16_t *b1 = (int16_t *)_b1; \
41 int16_t *b2 = (int16_t *)_b2; \
43 for(i=width_align; i<width; i++) \
44 b1[i] = COMPOSE_53iL0(b0[i], b1[i], b2[i]); \
46 ff_vertical_compose53iL0##ext(b0, b1, b2, width_align); \
49 static void vertical_compose_dirac53iH0##ext(uint8_t *_b0, uint8_t *_b1, uint8_t *_b2, int width) \
51 int i, width_align = width&~(align-1); \
52 int16_t *b0 = (int16_t *)_b0; \
53 int16_t *b1 = (int16_t *)_b1; \
54 int16_t *b2 = (int16_t *)_b2; \
56 for(i=width_align; i<width; i++) \
57 b1[i] = COMPOSE_DIRAC53iH0(b0[i], b1[i], b2[i]); \
59 ff_vertical_compose_dirac53iH0##ext(b0, b1, b2, width_align); \
62 static void vertical_compose_dd137iL0##ext(uint8_t *_b0, uint8_t *_b1, uint8_t *_b2, \
63 uint8_t *_b3, uint8_t *_b4, int width) \
65 int i, width_align = width&~(align-1); \
66 int16_t *b0 = (int16_t *)_b0; \
67 int16_t *b1 = (int16_t *)_b1; \
68 int16_t *b2 = (int16_t *)_b2; \
69 int16_t *b3 = (int16_t *)_b3; \
70 int16_t *b4 = (int16_t *)_b4; \
72 for(i=width_align; i<width; i++) \
73 b2[i] = COMPOSE_DD137iL0(b0[i], b1[i], b2[i], b3[i], b4[i]); \
75 ff_vertical_compose_dd137iL0##ext(b0, b1, b2, b3, b4, width_align); \
78 static void vertical_compose_dd97iH0##ext(uint8_t *_b0, uint8_t *_b1, uint8_t *_b2, \
79 uint8_t *_b3, uint8_t *_b4, int width) \
81 int i, width_align = width&~(align-1); \
82 int16_t *b0 = (int16_t *)_b0; \
83 int16_t *b1 = (int16_t *)_b1; \
84 int16_t *b2 = (int16_t *)_b2; \
85 int16_t *b3 = (int16_t *)_b3; \
86 int16_t *b4 = (int16_t *)_b4; \
88 for(i=width_align; i<width; i++) \
89 b2[i] = COMPOSE_DD97iH0(b0[i], b1[i], b2[i], b3[i], b4[i]); \
91 ff_vertical_compose_dd97iH0##ext(b0, b1, b2, b3, b4, width_align); \
93 static void vertical_compose_haar##ext(uint8_t *_b0, uint8_t *_b1, int width) \
95 int i, width_align = width&~(align-1); \
96 int16_t *b0 = (int16_t *)_b0; \
97 int16_t *b1 = (int16_t *)_b1; \
99 for(i=width_align; i<width; i++) { \
100 b0[i] = COMPOSE_HAARiL0(b0[i], b1[i]); \
101 b1[i] = COMPOSE_HAARiH0(b1[i], b0[i]); \
104 ff_vertical_compose_haar##ext(b0, b1, width_align); \
106 static void horizontal_compose_haar0i##ext(uint8_t *_b, uint8_t *_tmp, int w)\
109 int x= w2 - (w2&(align-1));\
110 int16_t *b = (int16_t *)_b; \
111 int16_t *tmp = (int16_t *)_tmp; \
113 ff_horizontal_compose_haar0i##ext(b, tmp, w);\
115 for (; x < w2; x++) {\
117 b[2*x+1] = COMPOSE_HAARiH0(b[x+w2], tmp[x]);\
120 static void horizontal_compose_haar1i##ext(uint8_t *_b, uint8_t *_tmp, int w)\
123 int x= w2 - (w2&(align-1));\
124 int16_t *b = (int16_t *)_b; \
125 int16_t *tmp = (int16_t *)_tmp; \
127 ff_horizontal_compose_haar1i##ext(b, tmp, w);\
129 for (; x < w2; x++) {\
130 b[2*x ] = (tmp[x] + 1)>>1;\
131 b[2*x+1] = (COMPOSE_HAARiH0(b[x+w2], tmp[x]) + 1)>>1;\
140 void ff_horizontal_compose_dd97i_ssse3(int16_t *_b, int16_t *_tmp,
int w);
142 static
void horizontal_compose_dd97i_ssse3(uint8_t *_b, uint8_t *_tmp,
int w)
146 int16_t *
b = (int16_t *)_b;
147 int16_t *
tmp = (int16_t *)_tmp;
149 ff_horizontal_compose_dd97i_ssse3(
b,
tmp,
w);
151 for (; x < w2; x++) {
152 b[2*x ] = (
tmp[x] + 1)>>1;
168 d->vertical_compose_l0.tap3 = vertical_compose53iL0_sse2;
169 d->vertical_compose_h0.tap5 = vertical_compose_dd97iH0_sse2;
172 d->vertical_compose_l0.tap3 = vertical_compose53iL0_sse2;
173 d->vertical_compose_h0.tap3 = vertical_compose_dirac53iH0_sse2;
176 d->vertical_compose_l0.tap5 = vertical_compose_dd137iL0_sse2;
177 d->vertical_compose_h0.tap5 = vertical_compose_dd97iH0_sse2;
180 d->vertical_compose = vertical_compose_haar_sse2;
181 d->horizontal_compose = horizontal_compose_haar0i_sse2;
184 d->vertical_compose = vertical_compose_haar_sse2;
185 d->horizontal_compose = horizontal_compose_haar1i_sse2;
194 d->horizontal_compose = horizontal_compose_dd97i_ssse3;
197 #endif // HAVE_X86ASM