24 #define ROUNDED_DIV_MVx2(a, b) \
25 (VP56mv) { .x = ROUNDED_DIV(a.x + b.x, 2), .y = ROUNDED_DIV(a.y + b.y, 2) }
26 #define ROUNDED_DIV_MVx4(a, b, c, d) \
27 (VP56mv) { .x = ROUNDED_DIV(a.x + b.x + c.x + d.x, 4), \
28 .y = ROUNDED_DIV(a.y + b.y + c.y + d.y, 4) }
33 { 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4 },
34 { 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4 },
38 int row = s->
row, col = s->
col;
60 row << 3, col << 3, &b->
mv[0][0],,,,, 8, 4, w1, h1, 0);
62 s->
dst[0] + 4 * ls_y, ls_y,
64 (row << 3) + 4, col << 3, &b->
mv[2][0],,,,, 8, 4, w1, h1, 0);
70 s->
dst[1], s->
dst[2], ls_uv,
73 row << 2, col << (3 - s->
ss_h),
74 &uvmv,,,,, 8 >> s->
ss_h, 4, w1, h1, 0);
77 s->
dst[1], s->
dst[2], ls_uv,
80 row << 3, col << (3 - s->
ss_h),
81 &b->
mv[0][0],,,,, 8 >> s->
ss_h, 4, w1, h1, 0);
91 s->
dst[1] + 4 * ls_uv, s->
dst[2] + 4 * ls_uv, ls_uv,
94 (row << 3) + 4, col << (3 - s->
ss_h),
95 &uvmv,,,,, 8 >> s->
ss_h, 4, w1, h1, 0);
100 ref2->data[0], ref2->linesize[0], tref2,
101 row << 3, col << 3, &b->
mv[0][1],,,,, 8, 4, w2, h2, 1);
103 s->
dst[0] + 4 * ls_y, ls_y,
104 ref2->data[0], ref2->linesize[0], tref2,
105 (row << 3) + 4, col << 3, &b->
mv[2][1],,,,, 8, 4, w2, h2, 1);
111 s->
dst[1], s->
dst[2], ls_uv,
112 ref2->data[1], ref2->linesize[1],
113 ref2->data[2], ref2->linesize[2], tref2,
114 row << 2, col << (3 - s->
ss_h),
115 &uvmv,,,,, 8 >> s->
ss_h, 4, w2, h2, 1);
118 s->
dst[1], s->
dst[2], ls_uv,
119 ref2->data[1], ref2->linesize[1],
120 ref2->data[2], ref2->linesize[2], tref2,
121 row << 3, col << (3 - s->
ss_h),
122 &b->
mv[0][1],,,,, 8 >> s->
ss_h, 4, w2, h2, 1);
132 s->
dst[1] + 4 * ls_uv, s->
dst[2] + 4 * ls_uv, ls_uv,
133 ref2->data[1], ref2->linesize[1],
134 ref2->data[2], ref2->linesize[2], tref2,
135 (row << 3) + 4, col << (3 - s->
ss_h),
136 &uvmv,,,,, 8 >> s->
ss_h, 4, w2, h2, 1);
142 row << 3, col << 3, &b->
mv[0][0],,,,, 4, 8, w1, h1, 0);
145 row << 3, (col << 3) + 4, &b->
mv[1][0],,,,, 4, 8, w1, h1, 0);
151 s->
dst[1], s->
dst[2], ls_uv,
154 row << (3 - s->
ss_v), col << 2,
155 &uvmv,,,,, 4, 8 >> s->
ss_v, w1, h1, 0);
158 s->
dst[1], s->
dst[2], ls_uv,
161 row << (3 - s->
ss_v), col << 3,
162 &b->
mv[0][0],,,,, 4, 8 >> s->
ss_v, w1, h1, 0);
164 s->
dst[1] + 4 * bytesperpixel,
165 s->
dst[2] + 4 * bytesperpixel, ls_uv,
168 row << (3 - s->
ss_v), (col << 3) + 4,
169 &b->
mv[1][0],,,,, 4, 8 >> s->
ss_v, w1, h1, 0);
174 ref2->data[0], ref2->linesize[0], tref2,
175 row << 3, col << 3, &b->
mv[0][1],,,,, 4, 8, w2, h2, 1);
177 ref2->data[0], ref2->linesize[0], tref2,
178 row << 3, (col << 3) + 4, &b->
mv[1][1],,,,, 4, 8, w2, h2, 1);
184 s->
dst[1], s->
dst[2], ls_uv,
185 ref2->data[1], ref2->linesize[1],
186 ref2->data[2], ref2->linesize[2], tref2,
187 row << (3 - s->
ss_v), col << 2,
188 &uvmv,,,,, 4, 8 >> s->
ss_v, w2, h2, 1);
191 s->
dst[1], s->
dst[2], ls_uv,
192 ref2->data[1], ref2->linesize[1],
193 ref2->data[2], ref2->linesize[2], tref2,
194 row << (3 - s->
ss_v), col << 3,
195 &b->
mv[0][1],,,,, 4, 8 >> s->
ss_v, w2, h2, 1);
197 s->
dst[1] + 4 * bytesperpixel,
198 s->
dst[2] + 4 * bytesperpixel, ls_uv,
199 ref2->data[1], ref2->linesize[1],
200 ref2->data[2], ref2->linesize[2], tref2,
201 row << (3 - s->
ss_v), (col << 3) + 4,
202 &b->
mv[1][1],,,,, 4, 8 >> s->
ss_v, w2, h2, 1);
214 row << 3, col << 3, &b->
mv[0][0],
215 0, 0, 8, 8, 4, 4, w1, h1, 0);
218 row << 3, (col << 3) + 4, &b->
mv[1][0],
219 4, 0, 8, 8, 4, 4, w1, h1, 0);
221 s->
dst[0] + 4 * ls_y, ls_y,
223 (row << 3) + 4, col << 3, &b->
mv[2][0],
224 0, 4, 8, 8, 4, 4, w1, h1, 0);
226 s->
dst[0] + 4 * ls_y + 4 * bytesperpixel, ls_y,
228 (row << 3) + 4, (col << 3) + 4, &b->
mv[3][0],
229 4, 4, 8, 8, 4, 4, w1, h1, 0);
235 b->
mv[2][0], b->
mv[3][0]);
237 s->
dst[1], s->
dst[2], ls_uv,
241 &uvmv, 0, 0, 4, 4, 4, 4, w1, h1, 0);
245 s->
dst[1], s->
dst[2], ls_uv,
249 &uvmv, 0, 0, 8, 4, 4, 4, w1, h1, 0);
252 s->
dst[1] + 4 * bytesperpixel,
253 s->
dst[2] + 4 * bytesperpixel, ls_uv,
256 row << 2, (col << 3) + 4,
257 &uvmv, 4, 0, 8, 4, 4, 4, w1, h1, 0);
264 s->
dst[1], s->
dst[2], ls_uv,
268 &uvmv, 0, 0, 4, 8, 4, 4, w1, h1, 0);
274 s->
dst[1] + 4 * ls_uv, s->
dst[2] + 4 * ls_uv, ls_uv,
277 (row << 3) + 4, col << 2,
278 &uvmv, 0, 4, 4, 8, 4, 4, w1, h1, 0);
281 s->
dst[1], s->
dst[2], ls_uv,
285 &b->
mv[0][0], 0, 0, 8, 8, 4, 4, w1, h1, 0);
287 s->
dst[1] + 4 * bytesperpixel,
288 s->
dst[2] + 4 * bytesperpixel, ls_uv,
291 row << 3, (col << 3) + 4,
292 &b->
mv[1][0], 4, 0, 8, 8, 4, 4, w1, h1, 0);
294 s->
dst[1] + 4 * ls_uv, s->
dst[2] + 4 * ls_uv, ls_uv,
297 (row << 3) + 4, col << 3,
298 &b->
mv[2][0], 0, 4, 8, 8, 4, 4, w1, h1, 0);
300 s->
dst[1] + 4 * ls_uv + 4 * bytesperpixel,
301 s->
dst[2] + 4 * ls_uv + 4 * bytesperpixel, ls_uv,
304 (row << 3) + 4, (col << 3) + 4,
305 &b->
mv[3][0], 4, 4, 8, 8, 4, 4, w1, h1, 0);
311 ref2->data[0], ref2->linesize[0], tref2,
312 row << 3, col << 3, &b->
mv[0][1], 0, 0, 8, 8, 4, 4, w2, h2, 1);
314 ref2->data[0], ref2->linesize[0], tref2,
315 row << 3, (col << 3) + 4, &b->
mv[1][1], 4, 0, 8, 8, 4, 4, w2, h2, 1);
317 s->
dst[0] + 4 * ls_y, ls_y,
318 ref2->data[0], ref2->linesize[0], tref2,
319 (row << 3) + 4, col << 3, &b->
mv[2][1], 0, 4, 8, 8, 4, 4, w2, h2, 1);
321 s->
dst[0] + 4 * ls_y + 4 * bytesperpixel, ls_y,
322 ref2->data[0], ref2->linesize[0], tref2,
323 (row << 3) + 4, (col << 3) + 4, &b->
mv[3][1], 4, 4, 8, 8, 4, 4, w2, h2, 1);
329 b->
mv[2][1], b->
mv[3][1]);
331 s->
dst[1], s->
dst[2], ls_uv,
332 ref2->data[1], ref2->linesize[1],
333 ref2->data[2], ref2->linesize[2], tref2,
335 &uvmv, 0, 0, 4, 4, 4, 4, w2, h2, 1);
339 s->
dst[1], s->
dst[2], ls_uv,
340 ref2->data[1], ref2->linesize[1],
341 ref2->data[2], ref2->linesize[2], tref2,
343 &uvmv, 0, 0, 8, 4, 4, 4, w2, h2, 1);
346 s->
dst[1] + 4 * bytesperpixel,
347 s->
dst[2] + 4 * bytesperpixel, ls_uv,
348 ref2->data[1], ref2->linesize[1],
349 ref2->data[2], ref2->linesize[2], tref2,
350 row << 2, (col << 3) + 4,
351 &uvmv, 4, 0, 8, 4, 4, 4, w2, h2, 1);
358 s->
dst[1], s->
dst[2], ls_uv,
359 ref2->data[1], ref2->linesize[1],
360 ref2->data[2], ref2->linesize[2], tref2,
362 &uvmv, 0, 0, 4, 8, 4, 4, w2, h2, 1);
368 s->
dst[1] + 4 * ls_uv, s->
dst[2] + 4 * ls_uv, ls_uv,
369 ref2->data[1], ref2->linesize[1],
370 ref2->data[2], ref2->linesize[2], tref2,
371 (row << 3) + 4, col << 2,
372 &uvmv, 0, 4, 4, 8, 4, 4, w2, h2, 1);
375 s->
dst[1], s->
dst[2], ls_uv,
376 ref2->data[1], ref2->linesize[1],
377 ref2->data[2], ref2->linesize[2], tref2,
379 &b->
mv[0][1], 0, 0, 8, 8, 4, 4, w2, h2, 1);
381 s->
dst[1] + 4 * bytesperpixel,
382 s->
dst[2] + 4 * bytesperpixel, ls_uv,
383 ref2->data[1], ref2->linesize[1],
384 ref2->data[2], ref2->linesize[2], tref2,
385 row << 3, (col << 3) + 4,
386 &b->
mv[1][1], 4, 0, 8, 8, 4, 4, w2, h2, 1);
388 s->
dst[1] + 4 * ls_uv, s->
dst[2] + 4 * ls_uv, ls_uv,
389 ref2->data[1], ref2->linesize[1],
390 ref2->data[2], ref2->linesize[2], tref2,
391 (row << 3) + 4, col << 3,
392 &b->
mv[2][1], 0, 4, 8, 8, 4, 4, w2, h2, 1);
394 s->
dst[1] + 4 * ls_uv + 4 * bytesperpixel,
395 s->
dst[2] + 4 * ls_uv + 4 * bytesperpixel, ls_uv,
396 ref2->data[1], ref2->linesize[1],
397 ref2->data[2], ref2->linesize[2], tref2,
398 (row << 3) + 4, (col << 3) + 4,
399 &b->
mv[3][1], 4, 4, 8, 8, 4, 4, w2, h2, 1);
405 int bwl = bwlog_tab[0][b->
bs];
411 row << 3, col << 3, &b->
mv[0][0], 0, 0, bw, bh, bw, bh, w1, h1, 0);
415 s->
dst[1], s->
dst[2], ls_uv,
418 row << (3 - s->
ss_v), col << (3 - s->
ss_h),
419 &b->
mv[0][0], 0, 0, uvbw, uvbh, uvbw, uvbh, w1, h1, 0);
423 ref2->data[0], ref2->linesize[0], tref2,
424 row << 3, col << 3, &b->
mv[0][1], 0, 0, bw, bh, bw, bh, w2, h2, 1);
428 s->
dst[1], s->
dst[2], ls_uv,
429 ref2->data[1], ref2->linesize[1],
430 ref2->data[2], ref2->linesize[2], tref2,
431 row << (3 - s->
ss_v), col << (3 - s->
ss_h),
432 &b->
mv[0][1], 0, 0, uvbw, uvbh, uvbw, uvbh, w2, h2, 1);
This structure describes decoded (raw) audio or video data.
static void FN() inter_pred(AVCodecContext *ctx)
#define ROUNDED_DIV_MVx4(a, b, c, d)
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
int width
width and height of the video frame
#define ROUNDED_DIV_MVx2(a, b)
static const uint8_t bwh_tab[2][N_BS_SIZES][2]
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
#define mc_chroma_dir(s, mc, dstu, dstv, dst_ls, srcu, srcu_ls, srcv, srcv_ls, tref, row, col, mv, px, py, pw, ph, bw, bh, w, h, i)
main external API structure.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
#define mc_luma_dir(s, mc, dst, dst_ls, src, src_ls, tref, row, col, mv, px, py, pw, ph, bw, bh, w, h, i)
void * priv_data
Format private data.