Parent Directory | Revision Log
Revision 581 - (view) (download)
1 : | Isibaar | 581 | // 04.10.2002 added qpel support to MBMotionCompensation |
2 : | edgomez | 195 | // 01.05.2002 updated MBMotionCompensationBVOP |
3 : | // 14.04.2002 bframe compensation | ||
4 : | suxen_drol | 118 | |
5 : | Isibaar | 3 | #include "../encoder.h" |
6 : | #include "../utils/mbfunctions.h" | ||
7 : | #include "../image/interpolate8x8.h" | ||
8 : | #include "../utils/timer.h" | ||
9 : | suxen_drol | 118 | #include "motion.h" |
10 : | Isibaar | 3 | |
11 : | #define ABS(X) (((X)>0)?(X):-(X)) | ||
12 : | #define SIGN(X) (((X)>0)?1:-1) | ||
13 : | |||
14 : | chl | 530 | |
15 : | edgomez | 195 | static __inline void |
16 : | Isibaar | 581 | compensate8x8_interpolate(int16_t * const dct_codes, |
17 : | uint8_t * const cur, | ||
18 : | const uint8_t * const ref, | ||
19 : | const uint8_t * const refh, | ||
20 : | const uint8_t * const refv, | ||
21 : | const uint8_t * const refhv, | ||
22 : | const uint32_t x, | ||
23 : | const uint32_t y, | ||
24 : | const int32_t dx, | ||
25 : | const int32_t dy, | ||
26 : | const uint32_t stride, | ||
27 : | const uint32_t quarterpel, | ||
28 : | const uint32_t rounding) | ||
29 : | Isibaar | 3 | { |
30 : | Isibaar | 581 | if(quarterpel) { |
31 : | interpolate8x8_quarterpel((uint8_t *) refv, (uint8_t *) ref, (uint8_t *) refh, | ||
32 : | (uint8_t *) refh + 64, (uint8_t *) refhv, x, y, dx, dy, stride, rounding); | ||
33 : | Isibaar | 3 | |
34 : | Isibaar | 581 | transfer_8to16sub(dct_codes, cur + y*stride + x, |
35 : | refv + y*stride + x, stride); | ||
36 : | } | ||
37 : | else | ||
38 : | edgomez | 195 | { |
39 : | Isibaar | 581 | const uint8_t * reference; |
40 : | |||
41 : | switch (((dx & 1) << 1) + (dy & 1)) // ((dx%2)?2:0)+((dy%2)?1:0) | ||
42 : | { | ||
43 : | case 0: reference = ref + ((y + dy / 2) * stride + x + dx / 2); break; | ||
44 : | case 1: reference = refv + ((y + (dy-1) / 2) * stride + x + dx / 2); break; | ||
45 : | case 2: reference = refh + ((y + dy / 2) * stride + x + (dx-1) / 2); break; | ||
46 : | default: // case 3: | ||
47 : | reference = refhv + ((y + (dy-1) / 2) * stride + x + (dx-1) / 2); break; | ||
48 : | } | ||
49 : | transfer_8to16sub(dct_codes, cur + y * stride + x, | ||
50 : | reference, stride); | ||
51 : | edgomez | 195 | } |
52 : | Isibaar | 3 | } |
53 : | |||
54 : | edgomez | 195 | void |
55 : | MBMotionCompensation(MACROBLOCK * const mb, | ||
56 : | const uint32_t i, | ||
57 : | const uint32_t j, | ||
58 : | const IMAGE * const ref, | ||
59 : | const IMAGE * const refh, | ||
60 : | const IMAGE * const refv, | ||
61 : | const IMAGE * const refhv, | ||
62 : | IMAGE * const cur, | ||
63 : | int16_t * dct_codes, | ||
64 : | const uint32_t width, | ||
65 : | const uint32_t height, | ||
66 : | const uint32_t edged_width, | ||
67 : | Isibaar | 581 | const uint32_t quarterpel, |
68 : | edgomez | 195 | const uint32_t rounding) |
69 : | Isibaar | 3 | { |
70 : | chl | 530 | if (mb->mode == MODE_NOT_CODED) { |
71 : | transfer8x8_copy(cur->y + 16 * (i + j * edged_width), | ||
72 : | ref->y + 16 * (i + j * edged_width), | ||
73 : | edged_width); | ||
74 : | transfer8x8_copy(cur->y + 16 * (i + j * edged_width) + 8, | ||
75 : | ref->y + 16 * (i + j * edged_width) + 8, | ||
76 : | edged_width); | ||
77 : | transfer8x8_copy(cur->y + 16 * (i + j * edged_width) + 8 * edged_width, | ||
78 : | ref->y + 16 * (i + j * edged_width) + 8 * edged_width, | ||
79 : | edged_width); | ||
80 : | transfer8x8_copy(cur->y + 16 * (i + j * edged_width) + 8 * (edged_width+1), | ||
81 : | ref->y + 16 * (i + j * edged_width) + 8 * (edged_width+1), | ||
82 : | edged_width); | ||
83 : | Isibaar | 3 | |
84 : | chl | 530 | transfer8x8_copy(cur->u + 8 * (i + j * edged_width/2), |
85 : | ref->u + 8 * (i + j * edged_width/2), | ||
86 : | edged_width / 2); | ||
87 : | transfer8x8_copy(cur->v + 8 * (i + j * edged_width/2), | ||
88 : | ref->v + 8 * (i + j * edged_width/2), | ||
89 : | edged_width / 2); | ||
90 : | return; | ||
91 : | } | ||
92 : | |||
93 : | edgomez | 195 | if (mb->mode == MODE_INTER || mb->mode == MODE_INTER_Q) { |
94 : | Isibaar | 3 | int32_t dx = mb->mvs[0].x; |
95 : | int32_t dy = mb->mvs[0].y; | ||
96 : | |||
97 : | Isibaar | 581 | if(quarterpel) { |
98 : | dx = mb->qmvs[0].x; | ||
99 : | dy = mb->qmvs[0].y; | ||
100 : | } | ||
101 : | |||
102 : | compensate8x8_interpolate(&dct_codes[0 * 64], cur->y, ref->y, refh->y, | ||
103 : | edgomez | 195 | refv->y, refhv->y, 16 * i, 16 * j, dx, dy, |
104 : | Isibaar | 581 | edged_width, quarterpel, rounding); |
105 : | compensate8x8_interpolate(&dct_codes[1 * 64], cur->y, ref->y, refh->y, | ||
106 : | edgomez | 195 | refv->y, refhv->y, 16 * i + 8, 16 * j, dx, dy, |
107 : | Isibaar | 581 | edged_width, quarterpel, rounding); |
108 : | compensate8x8_interpolate(&dct_codes[2 * 64], cur->y, ref->y, refh->y, | ||
109 : | edgomez | 195 | refv->y, refhv->y, 16 * i, 16 * j + 8, dx, dy, |
110 : | Isibaar | 581 | edged_width, quarterpel, rounding); |
111 : | compensate8x8_interpolate(&dct_codes[3 * 64], cur->y, ref->y, refh->y, | ||
112 : | edgomez | 195 | refv->y, refhv->y, 16 * i + 8, 16 * j + 8, dx, |
113 : | Isibaar | 581 | dy, edged_width, quarterpel, rounding); |
114 : | Isibaar | 3 | |
115 : | Isibaar | 581 | if (quarterpel) |
116 : | { | ||
117 : | dx = (dx >> 1) | (dx & 1); | ||
118 : | dy = (dy >> 1) | (dy & 1); | ||
119 : | } | ||
120 : | |||
121 : | Isibaar | 3 | dx = (dx & 3) ? (dx >> 1) | 1 : dx / 2; |
122 : | dy = (dy & 3) ? (dy >> 1) | 1 : dy / 2; | ||
123 : | |||
124 : | chl | 530 | /* uv-block-based compensation */ |
125 : | edgomez | 195 | transfer_8to16sub(&dct_codes[4 * 64], |
126 : | chl | 530 | cur->u + 8 * j * edged_width / 2 + 8 * i, |
127 : | interpolate8x8_switch2(refv->u, ref->u, 8 * i, 8 * j, | ||
128 : | dx, dy, edged_width / 2, rounding), | ||
129 : | edged_width / 2); | ||
130 : | Isibaar | 3 | |
131 : | edgomez | 195 | transfer_8to16sub(&dct_codes[5 * 64], |
132 : | chl | 530 | cur->v + 8 * j * edged_width / 2 + 8 * i, |
133 : | interpolate8x8_switch2(refv->u, ref->v, 8 * i, 8 * j, | ||
134 : | dx, dy, edged_width / 2, rounding), | ||
135 : | edged_width / 2); | ||
136 : | suxen_drol | 449 | |
137 : | chl | 530 | } else { // mode == MODE_INTER4V |
138 : | Isibaar | 3 | int32_t sum, dx, dy; |
139 : | Isibaar | 581 | VECTOR *mvs; |
140 : | Isibaar | 3 | |
141 : | Isibaar | 581 | if(quarterpel) |
142 : | mvs = mb->qmvs; | ||
143 : | else | ||
144 : | mvs = mb->mvs; | ||
145 : | |||
146 : | compensate8x8_interpolate(&dct_codes[0 * 64], cur->y, ref->y, refh->y, | ||
147 : | refv->y, refhv->y, 16 * i, 16 * j, mvs[0].x, | ||
148 : | mvs[0].y, edged_width, quarterpel, rounding); | ||
149 : | compensate8x8_interpolate(&dct_codes[1 * 64], cur->y, ref->y, refh->y, | ||
150 : | edgomez | 195 | refv->y, refhv->y, 16 * i + 8, 16 * j, |
151 : | Isibaar | 581 | mvs[1].x, mvs[1].y, edged_width, quarterpel, rounding); |
152 : | compensate8x8_interpolate(&dct_codes[2 * 64], cur->y, ref->y, refh->y, | ||
153 : | edgomez | 195 | refv->y, refhv->y, 16 * i, 16 * j + 8, |
154 : | Isibaar | 581 | mvs[2].x, mvs[2].y, edged_width, quarterpel, rounding); |
155 : | compensate8x8_interpolate(&dct_codes[3 * 64], cur->y, ref->y, refh->y, | ||
156 : | edgomez | 195 | refv->y, refhv->y, 16 * i + 8, 16 * j + 8, |
157 : | Isibaar | 581 | mvs[3].x, mvs[3].y, edged_width, quarterpel, rounding); |
158 : | Isibaar | 3 | |
159 : | Isibaar | 581 | sum = mvs[0].x + mvs[1].x + mvs[2].x + mvs[3].x; |
160 : | |||
161 : | if(quarterpel) | ||
162 : | sum /= 2; | ||
163 : | |||
164 : | edgomez | 195 | dx = (sum ? SIGN(sum) * |
165 : | (roundtab[ABS(sum) % 16] + (ABS(sum) / 16) * 2) : 0); | ||
166 : | Isibaar | 3 | |
167 : | Isibaar | 581 | sum = mvs[0].y + mvs[1].y + mvs[2].y + mvs[3].y; |
168 : | |||
169 : | if(quarterpel) | ||
170 : | sum /= 2; | ||
171 : | |||
172 : | edgomez | 195 | dy = (sum ? SIGN(sum) * |
173 : | (roundtab[ABS(sum) % 16] + (ABS(sum) / 16) * 2) : 0); | ||
174 : | Isibaar | 3 | |
175 : | chl | 530 | /* uv-block-based compensation */ |
176 : | edgomez | 195 | transfer_8to16sub(&dct_codes[4 * 64], |
177 : | chl | 530 | cur->u + 8 * j * edged_width / 2 + 8 * i, |
178 : | interpolate8x8_switch2(refv->u, ref->u, 8 * i, 8 * j, | ||
179 : | dx, dy, edged_width / 2, rounding), | ||
180 : | edged_width / 2); | ||
181 : | Isibaar | 3 | |
182 : | edgomez | 195 | transfer_8to16sub(&dct_codes[5 * 64], |
183 : | chl | 530 | cur->v + 8 * j * edged_width / 2 + 8 * i, |
184 : | interpolate8x8_switch2(refv->u, ref->v, 8 * i, 8 * j, | ||
185 : | dx, dy, edged_width / 2, rounding), | ||
186 : | |||
187 : | edged_width / 2); | ||
188 : | Isibaar | 3 | } |
189 : | } | ||
190 : | suxen_drol | 118 | |
191 : | |||
192 : | edgomez | 195 | void |
193 : | MBMotionCompensationBVOP(MBParam * pParam, | ||
194 : | MACROBLOCK * const mb, | ||
195 : | const uint32_t i, | ||
196 : | const uint32_t j, | ||
197 : | IMAGE * const cur, | ||
198 : | const IMAGE * const f_ref, | ||
199 : | const IMAGE * const f_refh, | ||
200 : | const IMAGE * const f_refv, | ||
201 : | const IMAGE * const f_refhv, | ||
202 : | const IMAGE * const b_ref, | ||
203 : | const IMAGE * const b_refh, | ||
204 : | const IMAGE * const b_refv, | ||
205 : | const IMAGE * const b_refhv, | ||
206 : | int16_t * dct_codes) | ||
207 : | suxen_drol | 118 | { |
208 : | static const uint32_t roundtab[16] = | ||
209 : | { 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2 }; | ||
210 : | |||
211 : | const int32_t edged_width = pParam->edged_width; | ||
212 : | int32_t dx, dy; | ||
213 : | int32_t b_dx, b_dy; | ||
214 : | chl | 374 | int k,sum; |
215 : | suxen_drol | 118 | int x = i; |
216 : | int y = j; | ||
217 : | |||
218 : | |||
219 : | edgomez | 195 | switch (mb->mode) { |
220 : | case MODE_FORWARD: | ||
221 : | suxen_drol | 118 | dx = mb->mvs[0].x; |
222 : | dy = mb->mvs[0].y; | ||
223 : | |||
224 : | chl | 530 | transfer_8to16sub(&dct_codes[0 * 64], |
225 : | edgomez | 195 | cur->y + (j * 16) * edged_width + (i * 16), |
226 : | get_ref(f_ref->y, f_refh->y, f_refv->y, f_refhv->y, | ||
227 : | i * 16, j * 16, 1, dx, dy, edged_width), | ||
228 : | edged_width); | ||
229 : | suxen_drol | 118 | |
230 : | edgomez | 195 | transfer_8to16sub(&dct_codes[1 * 64], |
231 : | chl | 530 | cur->y + (j * 16) * edged_width + (i * 16 + 8), |
232 : | get_ref(f_ref->y, f_refh->y, f_refv->y, f_refhv->y, | ||
233 : | edgomez | 195 | i * 16 + 8, j * 16, 1, dx, dy, edged_width), |
234 : | chl | 530 | edged_width); |
235 : | suxen_drol | 118 | |
236 : | chl | 530 | transfer_8to16sub(&dct_codes[2 * 64], |
237 : | edgomez | 195 | cur->y + (j * 16 + 8) * edged_width + (i * 16), |
238 : | get_ref(f_ref->y, f_refh->y, f_refv->y, f_refhv->y, | ||
239 : | chl | 530 | i * 16, j * 16 + 8, 1, dx, dy, edged_width), |
240 : | edged_width); | ||
241 : | suxen_drol | 118 | |
242 : | edgomez | 195 | transfer_8to16sub(&dct_codes[3 * 64], |
243 : | chl | 530 | cur->y + (j * 16 + 8) * edged_width + (i * 16 + 8), |
244 : | get_ref(f_ref->y, f_refh->y, f_refv->y, f_refhv->y, | ||
245 : | i * 16 + 8, j * 16 + 8, 1, dx, dy, edged_width), | ||
246 : | edged_width); | ||
247 : | suxen_drol | 118 | |
248 : | |||
249 : | dx = (dx & 3) ? (dx >> 1) | 1 : dx / 2; | ||
250 : | dy = (dy & 3) ? (dy >> 1) | 1 : dy / 2; | ||
251 : | |||
252 : | chl | 530 | /* uv-block-based compensation */ |
253 : | suxen_drol | 449 | transfer_8to16sub(&dct_codes[4 * 64], |
254 : | chl | 530 | cur->u + 8 * j * edged_width / 2 + 8 * i, |
255 : | interpolate8x8_switch2(f_refv->u, f_ref->u, 8 * i, 8 * j, | ||
256 : | dx, dy, edged_width / 2, 0), | ||
257 : | |||
258 : | suxen_drol | 449 | edged_width / 2); |
259 : | |||
260 : | transfer_8to16sub(&dct_codes[5 * 64], | ||
261 : | chl | 530 | cur->v + 8 * j * edged_width / 2 + 8 * i, |
262 : | interpolate8x8_switch2(f_refv->u, f_ref->v, 8 * i, 8 * j, | ||
263 : | dx, dy, edged_width / 2, 0), | ||
264 : | |||
265 : | suxen_drol | 449 | edged_width / 2); |
266 : | |||
267 : | suxen_drol | 118 | break; |
268 : | |||
269 : | edgomez | 195 | case MODE_BACKWARD: |
270 : | suxen_drol | 118 | b_dx = mb->b_mvs[0].x; |
271 : | b_dy = mb->b_mvs[0].y; | ||
272 : | |||
273 : | chl | 530 | transfer_8to16sub(&dct_codes[0 * 64], |
274 : | edgomez | 195 | cur->y + (j * 16) * edged_width + (i * 16), |
275 : | get_ref(b_ref->y, b_refh->y, b_refv->y, b_refhv->y, | ||
276 : | i * 16, j * 16, 1, b_dx, b_dy, | ||
277 : | edged_width), edged_width); | ||
278 : | suxen_drol | 118 | |
279 : | edgomez | 195 | transfer_8to16sub(&dct_codes[1 * 64], |
280 : | cur->y + (j * 16) * edged_width + (i * 16 + 8), | ||
281 : | get_ref(b_ref->y, b_refh->y, b_refv->y, b_refhv->y, | ||
282 : | i * 16 + 8, j * 16, 1, b_dx, b_dy, | ||
283 : | edged_width), edged_width); | ||
284 : | suxen_drol | 118 | |
285 : | chl | 530 | transfer_8to16sub(&dct_codes[2 * 64], |
286 : | edgomez | 195 | cur->y + (j * 16 + 8) * edged_width + (i * 16), |
287 : | get_ref(b_ref->y, b_refh->y, b_refv->y, b_refhv->y, | ||
288 : | i * 16, j * 16 + 8, 1, b_dx, b_dy, | ||
289 : | edged_width), edged_width); | ||
290 : | suxen_drol | 118 | |
291 : | edgomez | 195 | transfer_8to16sub(&dct_codes[3 * 64], |
292 : | cur->y + (j * 16 + 8) * edged_width + (i * 16 + 8), | ||
293 : | get_ref(b_ref->y, b_refh->y, b_refv->y, b_refhv->y, | ||
294 : | i * 16 + 8, j * 16 + 8, 1, b_dx, b_dy, | ||
295 : | edged_width), edged_width); | ||
296 : | suxen_drol | 118 | |
297 : | b_dx = (b_dx & 3) ? (b_dx >> 1) | 1 : b_dx / 2; | ||
298 : | b_dy = (b_dy & 3) ? (b_dy >> 1) | 1 : b_dy / 2; | ||
299 : | |||
300 : | chl | 530 | /* uv-block-based compensation */ |
301 : | suxen_drol | 449 | transfer_8to16sub(&dct_codes[4 * 64], |
302 : | chl | 530 | cur->u + 8 * j * edged_width / 2 + 8 * i, |
303 : | interpolate8x8_switch2(f_refv->u, b_ref->u, 8 * i, 8 * j, | ||
304 : | b_dx, b_dy, edged_width / 2, 0), | ||
305 : | suxen_drol | 449 | |
306 : | chl | 530 | edged_width / 2); |
307 : | |||
308 : | suxen_drol | 449 | transfer_8to16sub(&dct_codes[5 * 64], |
309 : | chl | 530 | cur->v + 8 * j * edged_width / 2 + 8 * i, |
310 : | interpolate8x8_switch2(f_refv->u, b_ref->v, 8 * i, 8 * j, | ||
311 : | b_dx, b_dy, edged_width / 2, 0), | ||
312 : | suxen_drol | 449 | |
313 : | chl | 530 | edged_width / 2); |
314 : | |||
315 : | suxen_drol | 118 | break; |
316 : | |||
317 : | |||
318 : | chl | 374 | case MODE_INTERPOLATE: /* _could_ use DIRECT, but would be overkill (no 4MV there) */ |
319 : | chl | 530 | case MODE_DIRECT_NO4V: |
320 : | chl | 374 | |
321 : | suxen_drol | 118 | dx = mb->mvs[0].x; |
322 : | dy = mb->mvs[0].y; | ||
323 : | chl | 374 | |
324 : | suxen_drol | 118 | b_dx = mb->b_mvs[0].x; |
325 : | b_dy = mb->b_mvs[0].y; | ||
326 : | |||
327 : | chl | 530 | for (k = 0; k < 4; k++) { |
328 : | transfer_8to16sub2(&dct_codes[k * 64], | ||
329 : | cur->y + (i * 16+(k&1)*8) + (j * 16+((k>>1)*8)) * edged_width, | ||
330 : | get_ref(f_ref->y, f_refh->y, f_refv->y, | ||
331 : | f_refhv->y, 2*i + (k&1), 2*j + (k>>1), 8, dx, dy, | ||
332 : | edged_width), | ||
333 : | get_ref(b_ref->y, b_refh->y, b_refv->y, | ||
334 : | b_refhv->y, 2*i + (k&1), 2 * j+(k>>1), 8, b_dx, b_dy, | ||
335 : | edged_width), | ||
336 : | edged_width); | ||
337 : | chl | 374 | } |
338 : | suxen_drol | 118 | |
339 : | dx = (dx & 3) ? (dx >> 1) | 1 : dx / 2; | ||
340 : | dy = (dy & 3) ? (dy >> 1) | 1 : dy / 2; | ||
341 : | |||
342 : | b_dx = (b_dx & 3) ? (b_dx >> 1) | 1 : b_dx / 2; | ||
343 : | b_dy = (b_dy & 3) ? (b_dy >> 1) | 1 : b_dy / 2; | ||
344 : | |||
345 : | chl | 530 | transfer_8to16sub2(&dct_codes[4 * 64], |
346 : | cur->u + (y * 8) * edged_width / 2 + (x * 8), | ||
347 : | interpolate8x8_switch2(f_refv->u, b_ref->u, 8 * i, 8 * j, | ||
348 : | b_dx, b_dy, edged_width / 2, 0), | ||
349 : | interpolate8x8_switch2(f_refv->u + 8, f_ref->u, 8 * i, 8 * j, | ||
350 : | dx, dy, edged_width / 2, 0), | ||
351 : | suxen_drol | 449 | edged_width / 2); |
352 : | |||
353 : | chl | 530 | transfer_8to16sub2(&dct_codes[5 * 64], |
354 : | cur->v + (y * 8) * edged_width / 2 + (x * 8), | ||
355 : | interpolate8x8_switch2(f_refv->u, b_ref->v, 8 * i, 8 * j, | ||
356 : | b_dx, b_dy, edged_width / 2, 0), | ||
357 : | interpolate8x8_switch2(f_refv->u + 8, f_ref->v, 8 * i, 8 * j, | ||
358 : | dx, dy, edged_width / 2, 0), | ||
359 : | suxen_drol | 449 | edged_width / 2); |
360 : | chl | 530 | |
361 : | suxen_drol | 118 | break; |
362 : | chl | 374 | |
363 : | case MODE_DIRECT: | ||
364 : | suxen_drol | 118 | |
365 : | chl | 374 | for (k=0;k<4;k++) |
366 : | { | ||
367 : | dx = mb->mvs[k].x; | ||
368 : | dy = mb->mvs[k].y; | ||
369 : | |||
370 : | b_dx = mb->b_mvs[k].x; | ||
371 : | b_dy = mb->b_mvs[k].y; | ||
372 : | |||
373 : | // fprintf(stderr,"Direct Vector %d -- %d:%d %d:%d\n",k,dx,dy,b_dx,b_dy); | ||
374 : | |||
375 : | chl | 530 | transfer_8to16sub2(&dct_codes[k * 64], |
376 : | cur->y + (i*16 + (k&1)*8) + (j*16 + (k>>1)*8 ) * edged_width, | ||
377 : | get_ref(f_ref->y, f_refh->y, f_refv->y, f_refhv->y, | ||
378 : | 2*i + (k&1), 2*j + (k>>1), 8, dx, dy, | ||
379 : | edged_width), | ||
380 : | get_ref(b_ref->y, b_refh->y, b_refv->y, b_refhv->y, | ||
381 : | 2*i + (k&1), 2*j + (k>>1), 8, b_dx, b_dy, | ||
382 : | edged_width), | ||
383 : | edged_width); | ||
384 : | chl | 374 | } |
385 : | |||
386 : | sum = mb->mvs[0].x + mb->mvs[1].x + mb->mvs[2].x + mb->mvs[3].x; | ||
387 : | dx = (sum == 0 ? 0 : SIGN(sum) * (roundtab[ABS(sum) % 16] + (ABS(sum) / 16) * 2)); | ||
388 : | |||
389 : | sum = mb->mvs[0].y + mb->mvs[1].y + mb->mvs[2].y + mb->mvs[3].y; | ||
390 : | dy = (sum == 0 ? 0 : SIGN(sum) * (roundtab[ABS(sum) % 16] + (ABS(sum) / 16) * 2)); | ||
391 : | |||
392 : | |||
393 : | sum = mb->b_mvs[0].x + mb->b_mvs[1].x + mb->b_mvs[2].x + mb->b_mvs[3].x; | ||
394 : | b_dx = (sum == 0 ? 0 : SIGN(sum) * (roundtab[ABS(sum) % 16] + (ABS(sum) / 16) * 2)); | ||
395 : | |||
396 : | sum = mb->b_mvs[0].y + mb->b_mvs[1].y + mb->b_mvs[2].y + mb->b_mvs[3].y; | ||
397 : | b_dy = (sum == 0 ? 0 : SIGN(sum) * (roundtab[ABS(sum) % 16] + (ABS(sum) / 16) * 2)); | ||
398 : | |||
399 : | /* // for QPel don't forget to always do | ||
400 : | |||
401 : | if (quarterpel) | ||
402 : | chl | 530 | sum /= 2; |
403 : | chl | 374 | */ |
404 : | chl | 530 | transfer_8to16sub2(&dct_codes[4 * 64], |
405 : | cur->u + (y * 8) * edged_width / 2 + (x * 8), | ||
406 : | interpolate8x8_switch2(f_refv->u, b_ref->u, 8 * i, 8 * j, | ||
407 : | b_dx, b_dy, edged_width / 2, 0), | ||
408 : | interpolate8x8_switch2(f_refv->u + 8, f_ref->u, 8 * i, 8 * j, dx, dy, | ||
409 : | edged_width / 2, 0), | ||
410 : | suxen_drol | 449 | edged_width / 2); |
411 : | |||
412 : | chl | 530 | transfer_8to16sub2(&dct_codes[5 * 64], |
413 : | cur->v + (y * 8) * edged_width / 2 + (x * 8), | ||
414 : | interpolate8x8_switch2(f_refv->u, b_ref->v, 8 * i, 8 * j, | ||
415 : | b_dx, b_dy, edged_width / 2, 0), | ||
416 : | interpolate8x8_switch2(f_refv->u + 8, f_ref->v, 8 * i, 8 * j, | ||
417 : | dx, dy, edged_width / 2, 0), | ||
418 : | suxen_drol | 449 | edged_width / 2); |
419 : | chl | 530 | |
420 : | |||
421 : | suxen_drol | 118 | break; |
422 : | } | ||
423 : | } |
No admin address has been configured | ViewVC Help |
Powered by ViewVC 1.0.4 |