1 /*
2 * H.26L/H.264/AVC/JVT/14496-10/... motion vector prediction
3 * Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 /**
23 * @file
24 * H.264 / AVC / MPEG-4 part10 motion vector prediction.
25 * @author Michael Niedermayer <michaelni@gmx.at>
26 */
27
28 #ifndef AVCODEC_H264_MVPRED_H
29 #define AVCODEC_H264_MVPRED_H
30
36
37
40 int i, int list, int part_width)
41 {
42 const int topright_ref = sl->
ref_cache[list][i - 8 + part_width];
43
44 /* there is no consistent mapping of mvs to neighboring locations that will
45 * make mbaff happy, so we can't move all this logic to fill_caches */
47 #define SET_DIAG_MV(MV_OP, REF_OP, XY, Y4) \
48 const int xy = XY, y4 = Y4; \
49 const int mb_type = mb_types[xy + (y4 >> 2) * h->mb_stride]; \
50 if (!USES_LIST(mb_type, list)) \
51 return LIST_NOT_USED; \
52 mv = h->cur_pic_ptr->motion_val[list][h->mb2b_xy[xy] + 3 + y4 * h->b_stride]; \
53 sl->mv_cache[list][scan8[0] - 2][0] = mv[0]; \
54 sl->mv_cache[list][scan8[0] - 2][1] = mv[1] MV_OP; \
55 return h->cur_pic_ptr->ref_index[list][4 * xy + 1 + (y4 & ~1)] REF_OP;
56
58 && i >=
scan8[0] + 8 && (i & 7) == 4
64
67 (sl->
mb_y & 1) * 2 + (i >> 5));
68 }
70 // left shift will turn LIST_NOT_USED into PART_NOT_AVAILABLE, but that's OK.
72 }
73 }
74 #undef SET_DIAG_MV
75 }
76
78 *C = sl->
mv_cache[list][i - 8 + part_width];
79 return topright_ref;
80 } else {
82
85 }
86 }
87
88 /**
89 * Get the predicted MV.
90 * @param n the block index
91 * @param part_width the width of the partition (4, 8,16) -> (1, 2, 4)
92 * @param mx the x component of the predicted motion vector
93 * @param my the y component of the predicted motion vector
94 */
98 int part_width,
int list,
int ref,
99 int *const mx, int *const my)
100 {
101 const int index8 =
scan8[
n];
102 const int top_ref = sl->
ref_cache[list][index8 - 8];
103 const int left_ref = sl->
ref_cache[list][index8 - 1];
104 const int16_t *
const A = sl->
mv_cache[list][index8 - 1];
105 const int16_t *
const B = sl->
mv_cache[list][index8 - 8];
107 int diagonal_ref, match_count;
108
109 av_assert2(part_width == 1 || part_width == 2 || part_width == 4);
110
111 /* mv_cache
112 * B . . A T T T T
113 * U . . L . . , .
114 * U . . L . . . .
115 * U . . L . . , .
116 * . . . L . . . .
117 */
118
120 match_count = (diagonal_ref ==
ref) + (top_ref == ref) + (left_ref ==
ref);
121 ff_tlog(h->
avctx,
"pred_motion match_count=%d\n", match_count);
122 if (match_count > 1) { //most common
125 } else if (match_count == 1) {
126 if (left_ref == ref) {
127 *mx = A[0];
128 *my = A[1];
129 } else if (top_ref == ref) {
130 *mx = B[0];
131 *my = B[1];
132 } else {
133 *mx = C[0];
134 *my = C[1];
135 }
136 } else {
140 *mx = A[0];
141 *my = A[1];
142 } else {
145 }
146 }
147
149 "pred_motion (%2d %2d %2d) (%2d %2d %2d) (%2d %2d %2d) -> (%2d %2d %2d) at %2d %2d %d list %d\n",
150 top_ref, B[0], B[1], diagonal_ref, C[0], C[1], left_ref,
151 A[0], A[1], ref, *mx, *my, sl->
mb_x, sl->
mb_y, n, list);
152 }
153
154 /**
155 * Get the directionally predicted 16x8 MV.
156 * @param n the block index
157 * @param mx the x component of the predicted motion vector
158 * @param my the y component of the predicted motion vector
159 */
162 int n,
int list,
int ref,
163 int *const mx, int *const my)
164 {
165 if (n == 0) {
168
169 ff_tlog(h->
avctx,
"pred_16x8: (%2d %2d %2d) at %2d %2d %d list %d\n",
170 top_ref, B[0], B[1], sl->
mb_x, sl->
mb_y, n, list);
171
172 if (top_ref == ref) {
173 *mx = B[0];
174 *my = B[1];
175 return;
176 }
177 } else {
180
181 ff_tlog(h->
avctx,
"pred_16x8: (%2d %2d %2d) at %2d %2d %d list %d\n",
182 left_ref, A[0], A[1], sl->
mb_x, sl->
mb_y, n, list);
183
184 if (left_ref == ref) {
185 *mx = A[0];
186 *my = A[1];
187 return;
188 }
189 }
190
191 //RARE
193 }
194
195 /**
196 * Get the directionally predicted 8x16 MV.
197 * @param n the block index
198 * @param mx the x component of the predicted motion vector
199 * @param my the y component of the predicted motion vector
200 */
203 int n,
int list,
int ref,
204 int *const mx, int *const my)
205 {
206 if (n == 0) {
209
210 ff_tlog(h->
avctx,
"pred_8x16: (%2d %2d %2d) at %2d %2d %d list %d\n",
211 left_ref, A[0], A[1], sl->
mb_x, sl->
mb_y, n, list);
212
213 if (left_ref == ref) {
214 *mx = A[0];
215 *my = A[1];
216 return;
217 }
218 } else {
220 int diagonal_ref;
221
223
224 ff_tlog(h->
avctx,
"pred_8x16: (%2d %2d %2d) at %2d %2d %d list %d\n",
225 diagonal_ref, C[0], C[1], sl->
mb_x, sl->
mb_y, n, list);
226
227 if (diagonal_ref == ref) {
228 *mx = C[0];
229 *my = C[1];
230 return;
231 }
232 }
233
234 //RARE
236 }
237
238 #define FIX_MV_MBAFF(type, refn, mvn, idx) \
239 if (FRAME_MBAFF(h)) { \
240 if (MB_FIELD(sl)) { \
241 if (!IS_INTERLACED(type)) { \
242 refn <<= 1; \
243 AV_COPY32(mvbuf[idx], mvn); \
244 mvbuf[idx][1] /= 2; \
245 mvn = mvbuf[idx]; \
246 } \
247 } else { \
248 if (IS_INTERLACED(type)) { \
249 refn >>= 1; \
250 AV_COPY32(mvbuf[idx], mvn); \
251 mvbuf[idx][1] *= 2; \
252 mvn = mvbuf[idx]; \
253 } \
254 } \
255 }
256
259 {
264 int top_ref, left_ref, diagonal_ref, match_count, mx, my;
265 const int16_t *
A, *
B, *
C;
267
269
270 /* To avoid doing an entire fill_decode_caches, we inline the relevant
271 * parts here.
272 * FIXME: this is a partial duplicate of the logic in fill_decode_caches,
273 * but it's faster this way. Is there a way to avoid this duplication?
274 */
280 goto zeromv;
283 A = zeromv;
284 } else {
285 goto zeromv;
286 }
287
293 goto zeromv;
296 B = zeromv;
297 } else {
298 goto zeromv;
299 }
300
302 top_ref, left_ref, sl->
mb_x, sl->
mb_y);
303
310 C = zeromv;
311 } else {
320 C = zeromv;
321 } else {
323 C = zeromv;
324 }
325 }
326
327 match_count = !diagonal_ref + !top_ref + !left_ref;
328 ff_tlog(h->
avctx,
"pred_pskip_motion match_count=%d\n", match_count);
329 if (match_count > 1) {
332 } else if (match_count == 1) {
333 if (!left_ref) {
334 mx = A[0];
335 my = A[1];
336 } else if (!top_ref) {
337 mx = B[0];
338 my = B[1];
339 } else {
340 mx = C[0];
341 my = C[1];
342 }
343 } else {
346 }
347
349 return;
350
351 zeromv:
353 return;
354 }
355
357 {
358 const int mb_xy = sl->
mb_xy;
359 int topleft_xy, top_xy, topright_xy, left_xy[
LEFT_MBS];
360 static const uint8_t left_block_options[4][32] = {
361 { 0, 1, 2, 3, 7, 10, 8, 11, 3 + 0 * 4, 3 + 1 * 4, 3 + 2 * 4, 3 + 3 * 4, 1 + 4 * 4, 1 + 8 * 4, 1 + 5 * 4, 1 + 9 * 4 },
362 { 2, 2, 3, 3, 8, 11, 8, 11, 3 + 2 * 4, 3 + 2 * 4, 3 + 3 * 4, 3 + 3 * 4, 1 + 5 * 4, 1 + 9 * 4, 1 + 5 * 4, 1 + 9 * 4 },
363 { 0, 0, 1, 1, 7, 10, 7, 10, 3 + 0 * 4, 3 + 0 * 4, 3 + 1 * 4, 3 + 1 * 4, 1 + 4 * 4, 1 + 8 * 4, 1 + 4 * 4, 1 + 8 * 4 },
364 { 0, 2, 0, 2, 7, 10, 7, 10, 3 + 0 * 4, 3 + 2 * 4, 3 + 0 * 4, 3 + 2 * 4, 1 + 4 * 4, 1 + 8 * 4, 1 + 4 * 4, 1 + 8 * 4 }
365 };
366
368
370
371 /* Wow, what a mess, why didn't they simplify the interlacing & intra
372 * stuff, I can't imagine that these complex rules are worth it. */
373
374 topleft_xy = top_xy - 1;
375 topright_xy = top_xy + 1;
376 left_xy[
LBOT] = left_xy[
LTOP] = mb_xy - 1;
382 if (left_mb_field_flag != curr_mb_field_flag) {
384 if (curr_mb_field_flag) {
387 } else {
389 /* take top left mv from the middle of the mb, as opposed
390 * to all other modes which use the bottom right partition */
393 }
394 }
395 } else {
396 if (curr_mb_field_flag) {
400 }
401 if (left_mb_field_flag != curr_mb_field_flag) {
402 if (curr_mb_field_flag) {
405 } else {
407 }
408 }
409 }
410 }
411
417 //FIXME do we need all in the context?
418
424
432 } else {
439 }
440 }
443 }
444
446 {
447 int topleft_xy, top_xy, topright_xy, left_xy[
LEFT_MBS];
448 int topleft_type, top_type, topright_type, left_type[
LEFT_MBS];
450 int i;
453
464
472
473 if (!(top_type & type_mask)) {
477 }
480 if (!(left_type[LTOP] & type_mask)) {
483 }
484 if (!(left_type[
LBOT] & type_mask)) {
487 }
488 } else {
490
492 if (!((left_typei & type_mask) && (left_type[LTOP] & type_mask))) {
495 }
496 }
497 } else {
498 if (!(left_type[LTOP] & type_mask)) {
501 }
502 }
503
504 if (!(topleft_type & type_mask))
506
507 if (!(topright_type & type_mask))
509
513 } else {
518 }
519 for (i = 0; i < 2; i++) {
524 } else {
527 }
528 }
529 }
530 }
531
532 /*
533 * 0 . T T. T T T T
534 * 1 L . .L . . . .
535 * 2 L . .L . . . .
536 * 3 . T TL . . . .
537 * 4 L . .L . . . .
538 * 5 L . .. . . . .
539 */
540 /* FIXME: constraint_intra_pred & partitioning & nnz
541 * (let us hope this is just a typo in the spec) */
543 if (top_type) {
545 AV_COPY32(&nnz_cache[4 + 8 * 0], &nnz[4 * 3]);
547 AV_COPY32(&nnz_cache[4 + 8 * 5], &nnz[4 * 7]);
548 AV_COPY32(&nnz_cache[4 + 8 * 10], &nnz[4 * 11]);
549 } else {
550 AV_COPY32(&nnz_cache[4 + 8 * 5], &nnz[4 * 5]);
551 AV_COPY32(&nnz_cache[4 + 8 * 10], &nnz[4 * 9]);
552 }
553 } else {
554 uint32_t top_empty =
CABAC(h) && !
IS_INTRA(mb_type) ? 0 : 0x40404040;
555 AV_WN32A(&nnz_cache[4 + 8 * 0], top_empty);
556 AV_WN32A(&nnz_cache[4 + 8 * 5], top_empty);
557 AV_WN32A(&nnz_cache[4 + 8 * 10], top_empty);
558 }
559
560 for (i = 0; i < 2; i++) {
561 if (left_type[
LEFT(i)]) {
563 nnz_cache[3 + 8 * 1 + 2 * 8 * i] = nnz[left_block[8 + 0 + 2 * i]];
564 nnz_cache[3 + 8 * 2 + 2 * 8 * i] = nnz[left_block[8 + 1 + 2 * i]];
566 nnz_cache[3 + 8 * 6 + 2 * 8 * i] = nnz[left_block[8 + 0 + 2 * i] + 4 * 4];
567 nnz_cache[3 + 8 * 7 + 2 * 8 * i] = nnz[left_block[8 + 1 + 2 * i] + 4 * 4];
568 nnz_cache[3 + 8 * 11 + 2 * 8 * i] = nnz[left_block[8 + 0 + 2 * i] + 8 * 4];
569 nnz_cache[3 + 8 * 12 + 2 * 8 * i] = nnz[left_block[8 + 1 + 2 * i] + 8 * 4];
571 nnz_cache[3 + 8 * 6 + 2 * 8 * i] = nnz[left_block[8 + 0 + 2 * i] - 2 + 4 * 4];
572 nnz_cache[3 + 8 * 7 + 2 * 8 * i] = nnz[left_block[8 + 1 + 2 * i] - 2 + 4 * 4];
573 nnz_cache[3 + 8 * 11 + 2 * 8 * i] = nnz[left_block[8 + 0 + 2 * i] - 2 + 8 * 4];
574 nnz_cache[3 + 8 * 12 + 2 * 8 * i] = nnz[left_block[8 + 1 + 2 * i] - 2 + 8 * 4];
575 } else {
576 nnz_cache[3 + 8 * 6 + 8 * i] = nnz[left_block[8 + 4 + 2 * i]];
577 nnz_cache[3 + 8 * 11 + 8 * i] = nnz[left_block[8 + 5 + 2 * i]];
578 }
579 } else {
580 nnz_cache[3 + 8 * 1 + 2 * 8 * i] =
581 nnz_cache[3 + 8 * 2 + 2 * 8 * i] =
582 nnz_cache[3 + 8 * 6 + 2 * 8 * i] =
583 nnz_cache[3 + 8 * 7 + 2 * 8 * i] =
584 nnz_cache[3 + 8 * 11 + 2 * 8 * i] =
585 nnz_cache[3 + 8 * 12 + 2 * 8 * i] =
CABAC(h) && !
IS_INTRA(mb_type) ? 0 : 64;
586 }
587 }
588
590 // top_cbp
591 if (top_type)
593 else
595 // left_cbp
596 if (left_type[
LTOP]) {
598 ((h->
cbp_table[left_xy[LTOP]] >> (left_block[0] & (~1))) & 2) |
599 (((h->
cbp_table[left_xy[
LBOT]] >> (left_block[2] & (~1))) & 2) << 2);
600 } else {
602 }
603 }
604 }
605
607 int list;
609 for (list = 0; list < sl->
list_count; list++) {
615 continue;
617
619 const int b_xy = h->
mb2b_xy[top_xy] + 3 * b_stride;
621 ref_cache[0 - 1 * 8] =
622 ref_cache[1 - 1 * 8] = ref[4 * top_xy + 2];
623 ref_cache[2 - 1 * 8] =
624 ref_cache[3 - 1 * 8] = ref[4 * top_xy + 3];
625 } else {
629 }
630
632 for (i = 0; i < 2; i++) {
633 int cache_idx = -1 + i * 2 * 8;
636 const int b8_xy = 4 * left_xy[
LEFT(i)] + 1;
638 mv[b_xy + b_stride * left_block[0 + i * 2]]);
640 mv[b_xy + b_stride * left_block[1 + i * 2]]);
641 ref_cache[cache_idx] = ref[b8_xy + (left_block[0 + i * 2] & ~1)];
642 ref_cache[cache_idx + 8] = ref[b8_xy + (left_block[1 + i * 2] & ~1)];
643 } else {
646 ref_cache[cache_idx] =
649 }
650 }
651 } else {
654 const int b8_xy = 4 * left_xy[
LTOP] + 1;
655 AV_COPY32(mv_cache[-1],
mv[b_xy + b_stride * left_block[0]]);
656 ref_cache[-1] = ref[b8_xy + (left_block[0] & ~1)];
657 } else {
661 }
662 }
663
665 const int b_xy = h->
mb2b_xy[topright_xy] + 3 * b_stride;
667 ref_cache[4 - 1 * 8] = ref[4 * topright_xy + 2];
668 } else {
672 }
673 if(ref_cache[2 - 1*8] < 0 || ref_cache[4 - 1 * 8] < 0) {
675 const int b_xy = h->
mb2b_xy[topleft_xy] + 3 + b_stride +
679 ref_cache[-1 - 1 * 8] = ref[b8_xy];
680 } else {
684 }
685 }
686
688 continue;
689
693 ref_cache[2 + 8 * 0] =
697
700 const int b_xy = h->
mb2br_xy[top_xy];
701 AV_COPY64(mvd_cache[0 - 1 * 8], mvd[b_xy + 0]);
702 } else {
704 }
707 AV_COPY16(mvd_cache[-1 + 0 * 8], mvd[b_xy - left_block[0]]);
708 AV_COPY16(mvd_cache[-1 + 1 * 8], mvd[b_xy - left_block[1]]);
709 } else {
712 }
715 AV_COPY16(mvd_cache[-1 + 2 * 8], mvd[b_xy - left_block[2]]);
716 AV_COPY16(mvd_cache[-1 + 3 * 8], mvd[b_xy - left_block[3]]);
717 } else {
720 }
727
731 }
else if (
IS_8X8(top_type)) {
732 int b8_xy = 4 * top_xy;
733 direct_cache[0 - 1 * 8] = direct_table[b8_xy + 2];
734 direct_cache[2 - 1 * 8] = direct_table[b8_xy + 3];
735 } else {
738 }
739
742 else if (
IS_8X8(left_type[LTOP]))
743 direct_cache[-1 + 0 * 8] = direct_table[4 * left_xy[
LTOP] + 1 + (left_block[0] & ~1)];
744 else
746
749 else if (
IS_8X8(left_type[LBOT]))
750 direct_cache[-1 + 2 * 8] = direct_table[4 * left_xy[LBOT] + 1 + (left_block[2] & ~1)];
751 else
753 }
754 }
755 }
756
757 #define MAP_MVS \
758 MAP_F2F(scan8[0] - 1 - 1 * 8, topleft_type) \
759 MAP_F2F(scan8[0] + 0 - 1 * 8, top_type) \
760 MAP_F2F(scan8[0] + 1 - 1 * 8, top_type) \
761 MAP_F2F(scan8[0] + 2 - 1 * 8, top_type) \
762 MAP_F2F(scan8[0] + 3 - 1 * 8, top_type) \
763 MAP_F2F(scan8[0] + 4 - 1 * 8, topright_type) \
764 MAP_F2F(scan8[0] - 1 + 0 * 8, left_type[LTOP]) \
765 MAP_F2F(scan8[0] - 1 + 1 * 8, left_type[LTOP]) \
766 MAP_F2F(scan8[0] - 1 + 2 * 8, left_type[LBOT]) \
767 MAP_F2F(scan8[0] - 1 + 3 * 8, left_type[LBOT])
768
771
772 #define MAP_F2F(idx, mb_type) \
773 if (!IS_INTERLACED(mb_type) && sl->ref_cache[list][idx] >= 0) { \
774 sl->ref_cache[list][idx] *= 2; \
775 sl->mv_cache[list][idx][1] /= 2; \
776 sl->mvd_cache[list][idx][1] >>= 1; \
777 }
778
780 } else {
781
782 #undef MAP_F2F
783 #define MAP_F2F(idx, mb_type) \
784 if (IS_INTERLACED(mb_type) && sl->ref_cache[list][idx] >= 0) { \
785 sl->ref_cache[list][idx] >>= 1; \
786 sl->mv_cache[list][idx][1] *= 2; \
787 sl->mvd_cache[list][idx][1] <<= 1; \
788 }
789
791 #undef MAP_F2F
792 }
793 }
794 }
795 }
796
798 }
799
800 /**
801 * decodes a P_SKIP or B_SKIP macroblock
802 */
804 {
805 const int mb_xy = sl->
mb_xy;
806 int mb_type = 0;
807
809
812
814 // just for fill_caches. pred_direct_motion will set the real mb_type
819 }
822 } else {
824
827 }
828
834 }
835
836 #endif /* AVCODEC_H264_MVPRED_H */
const uint8_t * left_block
int16_t mv_cache[2][5 *8][2]
Motion vector cache.
int neighbor_transform_size
number of neighbors (top and/or left) that used 8x8 dct
#define FIX_MV_MBAFF(type, refn, mvn, idx)
unsigned int topleft_samples_available
uint8_t mvd_cache[2][5 *8][2]
int16_t(*[2] motion_val)[2]
void ff_h264_pred_direct_motion(const H264Context *const h, H264SliceContext *sl, int *mb_type)
#define USES_LIST(a, list)
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
#define SET_DIAG_MV(MV_OP, REF_OP, XY, Y4)
#define DECLARE_ALIGNED(n, t, v)
Declare a variable that is aligned in memory.
static av_always_inline void write_back_motion(const H264Context *h, H264SliceContext *sl, int mb_type)
unsigned int topright_samples_available
static av_always_inline void pred_pskip_motion(const H264Context *const h, H264SliceContext *sl)
int constrained_intra_pred
constrained_intra_pred_flag
int8_t intra4x4_pred_mode_cache[5 *8]
static av_always_inline void pred_16x8_motion(const H264Context *const h, H264SliceContext *sl, int n, int list, int ref, int *const mx, int *const my)
Get the directionally predicted 16x8 MV.
simple assert() macros that are a bit more flexible than ISO C assert().
int direct_spatial_mv_pred
unsigned int top_samples_available
int slice_type_nos
S free slice type (SI/SP are remapped to I/P)
uint16_t * slice_table
slice_table_base + 2*mb_stride + 1
static av_always_inline void pred_8x16_motion(const H264Context *const h, H264SliceContext *sl, int n, int list, int ref, int *const mx, int *const my)
Get the directionally predicted 8x16 MV.
H.264 / AVC / MPEG-4 part10 codec.
static void fill_rectangle(int x, int y, int w, int h)
#define MB_TYPE_INTERLACED
static const int8_t mv[256][2]
Libavcodec external API header.
static const uint8_t scan8[16 *3+3]
uint8_t non_zero_count_cache[15 *8]
non zero coeff count cache.
static av_always_inline uint32_t pack16to32(unsigned a, unsigned b)
H264Picture * cur_pic_ptr
uint8_t direct_cache[5 *8]
static void fill_decode_caches(const H264Context *h, H264SliceContext *sl, int mb_type)
common internal api header.
static int ref[MAX_W *MAX_W]
static void fill_decode_neighbors(const H264Context *h, H264SliceContext *sl, int mb_type)
int8_t * intra4x4_pred_mode
int8_t ref_cache[2][5 *8]
static av_always_inline int fetch_diagonal_mv(const H264Context *h, H264SliceContext *sl, const int16_t **C, int i, int list, int part_width)
#define PART_NOT_AVAILABLE
static void av_unused decode_mb_skip(const H264Context *h, H264SliceContext *sl)
decodes a P_SKIP or B_SKIP macroblock
unsigned int left_samples_available
uint8_t(*[2] mvd_table)[2]
uint8_t(* non_zero_count)[48]
mode
Use these values in ebur128_init (or'ed).
static av_always_inline void pred_motion(const H264Context *const h, H264SliceContext *sl, int n, int part_width, int list, int ref, int *const mx, int *const my)
Get the predicted MV.