1 /*****************************************************************************
2 * vdec_motion_common.c : common motion compensation routines common
3 *****************************************************************************
4 * Copyright (C) 1999, 2000 VideoLAN
5 * $Id: vdec_motion_common.c,v 1.1 2001/01/18 05:13:22 sam Exp $
7 * Authors: Christophe Massiot <massiot@via.ecp.fr>
8 * Jean-Marc Dressler <polux@via.ecp.fr>
9 * Michel Lespinasse <walken@via.ecp.fr>
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
24 *****************************************************************************/
26 /*****************************************************************************
28 *****************************************************************************/
41 #include "vdec_motion.h"
42 #include "vpar_blocks.h"
44 extern int motion_Probe( probedata_t *p_data );
46 static void vdec_MotionFieldField420 ( macroblock_t * p_mb );
47 static void vdec_MotionFieldField422 ( macroblock_t * p_mb );
48 static void vdec_MotionFieldField444 ( macroblock_t * p_mb );
49 static void vdec_MotionField16x8420 ( macroblock_t * p_mb );
50 static void vdec_MotionField16x8422 ( macroblock_t * p_mb );
51 static void vdec_MotionField16x8444 ( macroblock_t * p_mb );
52 static void vdec_MotionFieldDMV420 ( macroblock_t * p_mb );
53 static void vdec_MotionFieldDMV422 ( macroblock_t * p_mb );
54 static void vdec_MotionFieldDMV444 ( macroblock_t * p_mb );
55 static void vdec_MotionFrameFrame420 ( macroblock_t * p_mb );
56 static void vdec_MotionFrameFrame422 ( macroblock_t * p_mb );
57 static void vdec_MotionFrameFrame444 ( macroblock_t * p_mb );
58 static void vdec_MotionFrameField420 ( macroblock_t * p_mb );
59 static void vdec_MotionFrameField422 ( macroblock_t * p_mb );
60 static void vdec_MotionFrameField444 ( macroblock_t * p_mb );
61 static void vdec_MotionFrameDMV420 ( macroblock_t * p_mb );
62 static void vdec_MotionFrameDMV422 ( macroblock_t * p_mb );
63 static void vdec_MotionFrameDMV444 ( macroblock_t * p_mb );
65 /*****************************************************************************
66 * Functions exported as capabilities. They are declared as static so that
67 * we don't pollute the namespace too much.
68 *****************************************************************************/
69 void motion_getfunctions( function_list_t * p_function_list )
71 p_function_list->pf_probe = motion_Probe;
73 #define list p_function_list->functions.motion
74 #define motion_functions( yuv ) \
75 list.pf_field_field_##yuv = vdec_MotionFieldField##yuv; \
76 list.pf_field_16x8_##yuv = vdec_MotionField16x8##yuv; \
77 list.pf_field_dmv_##yuv = vdec_MotionFieldDMV##yuv; \
78 list.pf_frame_field_##yuv = vdec_MotionFrameField##yuv; \
79 list.pf_frame_frame_##yuv = vdec_MotionFrameFrame##yuv; \
80 list.pf_frame_dmv_##yuv = vdec_MotionFrameDMV##yuv;
81 motion_functions( 420 )
82 motion_functions( 422 )
83 motion_functions( 444 )
84 #undef motion_functions
90 #define __MotionComponents(width,height) \
91 void MotionComponent_x_y_copy_##width##_##height (); \
92 void MotionComponent_X_y_copy_##width##_##height (); \
93 void MotionComponent_x_Y_copy_##width##_##height (); \
94 void MotionComponent_X_Y_copy_##width##_##height (); \
95 void MotionComponent_x_y_avg_##width##_##height (); \
96 void MotionComponent_X_y_avg_##width##_##height (); \
97 void MotionComponent_x_Y_avg_##width##_##height (); \
98 void MotionComponent_X_Y_avg_##width##_##height ();
100 __MotionComponents (16,16) /* 444, 422, 420 */
101 __MotionComponents (16,8) /* 444, 422, 420 */
102 __MotionComponents (8,8) /* 422, 420 */
103 __MotionComponents (8,4) /* 420 */
105 __MotionComponents (8,16) /* 422 */
108 #define ___callTheRightOne(width,height) \
109 if ((i_width == width) && (i_height == height)) \
116 MotionComponent_x_y_copy_##width##_##height (p_src, p_dest, \
120 MotionComponent_X_y_copy_##width##_##height (p_src, p_dest, \
124 MotionComponent_x_Y_copy_##width##_##height (p_src, p_dest, \
128 MotionComponent_X_Y_copy_##width##_##height (p_src, p_dest, \
138 MotionComponent_x_y_avg_##width##_##height (p_src, p_dest, \
142 MotionComponent_X_y_avg_##width##_##height (p_src, p_dest, \
146 MotionComponent_x_Y_avg_##width##_##height (p_src, p_dest, \
150 MotionComponent_X_Y_avg_##width##_##height (p_src, p_dest, \
157 /*****************************************************************************
158 * vdec_MotionComponent : last stage of motion compensation
159 *****************************************************************************/
160 static __inline__ void MotionComponent(
161 yuv_data_t * p_src, /* source block */
162 yuv_data_t * p_dest, /* dest block */
163 int i_width, /* (explicit) width of block */
164 int i_height, /* (explicit) height of block */
165 int i_stride, /* number of coeffs to jump
166 * between each predicted line */
167 int i_select, /* half-pel vectors */
168 boolean_t b_average /* (explicit) averaging of several
171 ___callTheRightOne (16,16)
172 ___callTheRightOne (16,8)
173 ___callTheRightOne (8,8)
174 ___callTheRightOne (8,4)
176 ___callTheRightOne (8,16)
180 /*****************************************************************************
181 * Motion420 : motion compensation for a 4:2:0 macroblock
182 *****************************************************************************/
183 static __inline__ void Motion420(
184 macroblock_t * p_mb, /* destination macroblock */
185 picture_t * p_source, /* source picture */
186 boolean_t b_source_field, /* source field */
187 boolean_t b_dest_field, /* destination field */
188 int i_mv_x, int i_mv_y, /* motion vector coordinates,
190 int i_l_stride, /* number of coeffs to jump to
191 * go to the next predicted
194 int i_height, /* height of the block to
195 * predict, in luminance
197 int i_offset, /* position of the first
198 * predicted line (explicit) */
199 boolean_t b_average /* (explicit) averaging of
200 * several predictions */ )
202 /* Temporary variables to avoid recalculating things twice */
203 int i_source_offset, i_dest_offset, i_c_height, i_c_select;
205 i_source_offset = (p_mb->i_l_x + (i_mv_x >> 1))
206 + (p_mb->i_motion_l_y + i_offset
208 * p_mb->p_picture->i_width
209 + (i_mv_y >> 1) * i_l_stride;
210 if( i_source_offset >= p_source->i_width * p_source->i_height )
212 intf_ErrMsg( "vdec error: bad motion vector (lum)" );
217 MotionComponent( /* source */
218 p_source->p_y + i_source_offset,
222 + (p_mb->i_motion_l_y + b_dest_field + i_offset)
223 * p_mb->p_picture->i_width,
224 /* prediction width and height */
229 ((i_mv_y & 1) << 1) | (i_mv_x & 1),
232 i_source_offset = (p_mb->i_c_x + ((i_mv_x/2) >> 1))
233 + (p_mb->i_motion_c_y + (i_offset >> 1)
235 * p_mb->p_picture->i_chroma_width
236 + ((i_mv_y/2) >> 1) * i_c_stride;
237 if( i_source_offset >= (p_source->i_width * p_source->i_height) / 4 )
239 intf_ErrMsg( "vdec error: bad motion vector (chroma)" );
243 i_dest_offset = (p_mb->i_c_x)
244 + (p_mb->i_motion_c_y + b_dest_field
246 * p_mb->p_picture->i_chroma_width;
247 i_c_height = i_height >> 1;
248 i_c_select = (((i_mv_y/2) & 1) << 1) | ((i_mv_x/2) & 1);
251 MotionComponent( p_source->p_u
255 8, i_c_height, i_c_stride,
256 i_c_select, b_average );
259 MotionComponent( p_source->p_v
263 8, i_c_height, i_c_stride,
264 i_c_select, b_average );
267 /*****************************************************************************
268 * Motion422 : motion compensation for a 4:2:2 macroblock
269 *****************************************************************************/
270 static __inline__ void Motion422(
271 macroblock_t * p_mb, /* destination macroblock */
272 picture_t * p_source, /* source picture */
273 boolean_t b_source_field, /* source field */
274 boolean_t b_dest_field, /* destination field */
275 int i_mv_x, int i_mv_y, /* motion vector coordinates,
277 int i_l_stride, /* number of coeffs to jump to
278 * go to the next predicted
281 int i_height, /* height of the block to
282 * predict, in luminance
284 int i_offset, /* position of the first
285 * predicted line (explicit) */
286 boolean_t b_average /* (explicit) averaging of
287 * several predictions */ )
290 int i_source_offset, i_dest_offset, i_c_select;
293 MotionComponent( /* source */
295 + (p_mb->i_l_x + (i_mv_x >> 1))
296 + (p_mb->i_motion_l_y + i_offset
298 * p_mb->p_picture->i_width
299 + (i_mv_y >> 1) * p_mb->i_l_stride,
303 + (p_mb->i_motion_l_y + b_dest_field)
304 * p_mb->p_picture->i_width,
305 /* prediction width and height */
310 ((i_mv_y & 1) << 1) | (i_mv_x & 1),
313 i_source_offset = (p_mb->i_c_x + ((i_mv_x/2) >> 1))
314 + (p_mb->i_motion_c_y + i_offset
316 * p_mb->p_picture->i_chroma_width
317 + (i_mv_y) >> 1) * p_mb->i_c_stride;
318 i_dest_offset = (p_mb->i_c_x)
319 + (p_mb->i_motion_c_y + b_dest_field)
320 * p_mb->p_picture->i_chroma_width;
321 i_c_select = ((i_mv_y & 1) << 1) | ((i_mv_x/2) & 1);
324 MotionComponent( p_source->p_u
328 8, i_height, i_c_stride,
329 i_c_select, b_average );
332 MotionComponent( p_source->p_v
336 8, i_height, i_c_stride,
337 i_c_select, b_average );
341 /*****************************************************************************
342 * Motion444 : motion compensation for a 4:4:4 macroblock
343 *****************************************************************************/
344 static __inline__ void Motion444(
345 macroblock_t * p_mb, /* destination macroblock */
346 picture_t * p_source, /* source picture */
347 boolean_t b_source_field, /* source field */
348 boolean_t b_dest_field, /* destination field */
349 int i_mv_x, int i_mv_y, /* motion vector coordinates,
351 int i_l_stride, /* number of coeffs to jump to
352 * go to the next predicted
355 int i_height, /* height of the block to
356 * predict, in luminance
358 int i_offset, /* position of the first
359 * predicted line (explicit) */
360 boolean_t b_average /* (explicit) averaging of
361 * several predictions */ )
364 int i_source_offset, i_dest_offset, i_select;
366 i_source_offset = (p_mb->i_l_x + (i_mv_x >> 1))
367 + (p_mb->i_motion_l_y + i_offset
369 * p_mb->p_picture->i_width
370 + (i_mv_y >> 1) * p_mb->i_l_stride;
371 i_dest_offset = (p_mb->i_l_x)
372 + (p_mb->i_motion_l_y + b_dest_field)
373 * p_mb->p_picture->i_width;
374 i_select = ((i_mv_y & 1) << 1) | (i_mv_x & 1);
378 MotionComponent( p_source->p_y
382 16, i_height, i_l_stride,
383 i_select, b_average );
386 MotionComponent( p_source->p_u
390 16, i_height, i_l_stride,
391 i_select, b_average );
394 MotionComponent( p_source->p_v
398 16, i_height, i_l_stride,
399 i_select, b_average );
403 /*****************************************************************************
404 * vdec_MotionFieldField : motion compensation for field motion type (field)
405 *****************************************************************************/
406 #define FIELDFIELD( MOTION ) \
408 picture_t * p_pred; \
410 if( p_mb->i_mb_type & MB_MOTION_FORWARD ) \
412 if( p_mb->b_P_second \
413 && (p_mb->b_motion_field != p_mb->ppi_field_select[0][0]) )\
414 p_pred = p_mb->p_picture; \
416 p_pred = p_mb->p_forward; \
418 MOTION( p_mb, p_pred, p_mb->ppi_field_select[0][0], \
419 p_mb->b_motion_field, \
420 p_mb->pppi_motion_vectors[0][0][0], \
421 p_mb->pppi_motion_vectors[0][0][1], \
422 p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 0 ); \
424 if( p_mb->i_mb_type & MB_MOTION_BACKWARD ) \
426 MOTION( p_mb, p_mb->p_backward, \
427 p_mb->ppi_field_select[0][1], \
428 p_mb->b_motion_field, \
429 p_mb->pppi_motion_vectors[0][1][0], \
430 p_mb->pppi_motion_vectors[0][1][1], \
431 p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 1 ); \
435 else /* MB_MOTION_BACKWARD */ \
437 MOTION( p_mb, p_mb->p_backward, p_mb->ppi_field_select[0][1], \
438 p_mb->b_motion_field, \
439 p_mb->pppi_motion_vectors[0][1][0], \
440 p_mb->pppi_motion_vectors[0][1][1], \
441 p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 0 ); \
445 static void vdec_MotionFieldField420( macroblock_t * p_mb )
447 FIELDFIELD( Motion420 )
450 static void vdec_MotionFieldField422( macroblock_t * p_mb )
452 //FIELDFIELD( Motion422 )
455 static void vdec_MotionFieldField444( macroblock_t * p_mb )
457 //FIELDFIELD( Motion444 )
460 /*****************************************************************************
461 * vdec_MotionField16x8XXX: motion compensation for 16x8 motion type (field)
462 *****************************************************************************/
463 #define FIELD16X8( MOTION ) \
465 picture_t * p_pred; \
467 if( p_mb->i_mb_type & MB_MOTION_FORWARD ) \
469 if( p_mb->b_P_second \
470 && (p_mb->b_motion_field != p_mb->ppi_field_select[0][0]) )\
471 p_pred = p_mb->p_picture; \
473 p_pred = p_mb->p_forward; \
475 MOTION( p_mb, p_pred, p_mb->ppi_field_select[0][0], \
476 p_mb->b_motion_field, \
477 p_mb->pppi_motion_vectors[0][0][0], \
478 p_mb->pppi_motion_vectors[0][0][1], \
479 p_mb->i_l_stride, p_mb->i_c_stride, 8, 0, 0 ); \
481 if( p_mb->b_P_second \
482 && (p_mb->b_motion_field != p_mb->ppi_field_select[1][0]) )\
483 p_pred = p_mb->p_picture; \
485 p_pred = p_mb->p_forward; \
487 MOTION( p_mb, p_pred, p_mb->ppi_field_select[1][0], \
488 p_mb->b_motion_field, \
489 p_mb->pppi_motion_vectors[1][0][0], \
490 p_mb->pppi_motion_vectors[1][0][1], \
491 p_mb->i_l_stride, p_mb->i_c_stride, 8, 8, 0 ); \
493 if( p_mb->i_mb_type & MB_MOTION_BACKWARD ) \
495 MOTION( p_mb, p_mb->p_backward, \
496 p_mb->ppi_field_select[0][1], \
497 p_mb->b_motion_field, \
498 p_mb->pppi_motion_vectors[0][1][0], \
499 p_mb->pppi_motion_vectors[0][1][1], \
500 p_mb->i_l_stride, p_mb->i_c_stride, 8, 0, 1 ); \
502 MOTION( p_mb, p_mb->p_backward, \
503 p_mb->ppi_field_select[1][1], \
504 p_mb->b_motion_field, \
505 p_mb->pppi_motion_vectors[1][1][0], \
506 p_mb->pppi_motion_vectors[1][1][1], \
507 p_mb->i_l_stride, p_mb->i_c_stride, 8, 8, 1 ); \
511 else /* MB_MOTION_BACKWARD */ \
513 MOTION( p_mb, p_mb->p_backward, p_mb->ppi_field_select[0][1], \
514 p_mb->b_motion_field, \
515 p_mb->pppi_motion_vectors[0][1][0], \
516 p_mb->pppi_motion_vectors[0][1][1], \
517 p_mb->i_l_stride, p_mb->i_c_stride, 8, 0, 0 ); \
519 MOTION( p_mb, p_mb->p_backward, p_mb->ppi_field_select[1][1], \
520 p_mb->b_motion_field, \
521 p_mb->pppi_motion_vectors[1][1][0], \
522 p_mb->pppi_motion_vectors[1][1][1], \
523 p_mb->i_l_stride, p_mb->i_c_stride, 8, 8, 0 ); \
527 static void vdec_MotionField16x8420( macroblock_t * p_mb )
529 FIELD16X8( Motion420 )
532 static void vdec_MotionField16x8422( macroblock_t * p_mb )
534 //FIELD16X8( Motion422 )
537 static void vdec_MotionField16x8444( macroblock_t * p_mb )
539 //FIELD16X8( Motion444 )
542 /*****************************************************************************
543 * vdec_MotionFieldDMVXXX : motion compensation for dmv motion type (field)
544 *****************************************************************************/
545 #define FIELDDMV( MOTION ) \
547 /* This is necessarily a MOTION_FORWARD only macroblock, in a P \
549 picture_t * p_pred; \
551 /* predict from field of same parity */ \
552 MOTION( p_mb, p_mb->p_forward, \
553 p_mb->b_motion_field, p_mb->b_motion_field, \
554 p_mb->pppi_motion_vectors[0][0][0], \
555 p_mb->pppi_motion_vectors[0][0][1], \
556 p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 0 ); \
558 if( p_mb->b_P_second ) \
559 p_pred = p_mb->p_picture; \
561 p_pred = p_mb->p_forward; \
563 /* predict from field of opposite parity */ \
564 MOTION( p_mb, p_pred, !p_mb->b_motion_field, p_mb->b_motion_field, \
565 p_mb->ppi_dmv[0][0], p_mb->ppi_dmv[0][1], \
566 p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 1 ); \
569 static void vdec_MotionFieldDMV420( macroblock_t * p_mb )
571 FIELDDMV( Motion420 )
574 static void vdec_MotionFieldDMV422( macroblock_t * p_mb )
576 //FIELDDMV( Motion422 )
579 static void vdec_MotionFieldDMV444( macroblock_t * p_mb )
581 //FIELDDMV( Motion444 )
584 /*****************************************************************************
585 * vdec_MotionFrameFrameXXX?? : motion compensation for frame motion type (frame)
586 *****************************************************************************/
587 #define FRAMEFRAME( MOTION ) \
589 if( p_mb->i_mb_type & MB_MOTION_FORWARD ) \
591 MOTION( p_mb, p_mb->p_forward, 0, 0, \
592 p_mb->pppi_motion_vectors[0][0][0], \
593 p_mb->pppi_motion_vectors[0][0][1], \
594 p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 0 ); \
596 if( p_mb->i_mb_type & MB_MOTION_BACKWARD ) \
598 MOTION( p_mb, p_mb->p_backward, 0, 0, \
599 p_mb->pppi_motion_vectors[0][1][0], \
600 p_mb->pppi_motion_vectors[0][1][1], \
601 p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 1 ); \
605 else /* MB_MOTION_BACKWARD */ \
607 MOTION( p_mb, p_mb->p_backward, 0, 0, \
608 p_mb->pppi_motion_vectors[0][1][0], \
609 p_mb->pppi_motion_vectors[0][1][1], \
610 p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 0 ); \
614 static void vdec_MotionFrameFrame420( macroblock_t * p_mb )
616 FRAMEFRAME( Motion420 )
619 static void vdec_MotionFrameFrame422( macroblock_t * p_mb )
621 //FRAMEFRAME( Motion422 )
624 static void vdec_MotionFrameFrame444( macroblock_t * p_mb )
626 //FRAMEFRAME( Motion444 )
629 /*****************************************************************************
630 * vdec_MotionFrameFieldXXX?? : motion compensation for field motion type (frame)
631 *****************************************************************************/
632 #define FRAMEFIELD( MOTION ) \
634 int i_l_stride = p_mb->i_l_stride << 1; \
635 int i_c_stride = p_mb->i_c_stride << 1; \
637 if( p_mb->i_mb_type & MB_MOTION_FORWARD ) \
639 MOTION( p_mb, p_mb->p_forward, p_mb->ppi_field_select[0][0], 0, \
640 p_mb->pppi_motion_vectors[0][0][0], \
641 p_mb->pppi_motion_vectors[0][0][1] >> 1, \
642 i_l_stride, i_c_stride, 8, 0, 0 ); \
644 MOTION( p_mb, p_mb->p_forward, p_mb->ppi_field_select[1][0], 1, \
645 p_mb->pppi_motion_vectors[1][0][0], \
646 p_mb->pppi_motion_vectors[1][0][1] >> 1, \
647 i_l_stride, i_c_stride, 8, 0, 0 ); \
649 if( p_mb->i_mb_type & MB_MOTION_BACKWARD ) \
651 MOTION( p_mb, p_mb->p_backward, \
652 p_mb->ppi_field_select[0][1], 0, \
653 p_mb->pppi_motion_vectors[0][1][0], \
654 p_mb->pppi_motion_vectors[0][1][1] >> 1, \
655 i_l_stride, i_c_stride, 8, 0, 1 ); \
657 MOTION( p_mb, p_mb->p_backward, \
658 p_mb->ppi_field_select[1][1], 1, \
659 p_mb->pppi_motion_vectors[1][1][0], \
660 p_mb->pppi_motion_vectors[1][1][1] >> 1, \
661 i_l_stride, i_c_stride, 8, 0, 1 ); \
665 else /* MB_MOTION_BACKWARD only */ \
667 MOTION( p_mb, p_mb->p_backward, p_mb->ppi_field_select[0][1], 0,\
668 p_mb->pppi_motion_vectors[0][1][0], \
669 p_mb->pppi_motion_vectors[0][1][1] >> 1, \
670 i_l_stride, i_c_stride, 8, 0, 0 ); \
672 MOTION( p_mb, p_mb->p_backward, p_mb->ppi_field_select[1][1], 1,\
673 p_mb->pppi_motion_vectors[1][1][0], \
674 p_mb->pppi_motion_vectors[1][1][1] >> 1, \
675 i_l_stride, i_c_stride, 8, 0, 0 ); \
679 static void vdec_MotionFrameField420( macroblock_t * p_mb )
681 FRAMEFIELD( Motion420 )
684 static void vdec_MotionFrameField422( macroblock_t * p_mb )
686 //FRAMEFIELD( Motion422 )
689 static void vdec_MotionFrameField444( macroblock_t * p_mb )
691 //FRAMEFIELD( Motion444 )
694 /*****************************************************************************
695 * vdec_MotionFrameDMVXXX?? : motion compensation for dmv motion type (frame)
696 *****************************************************************************/
697 #define FRAMEDMV( MOTION ) \
699 /* This is necessarily a MOTION_FORWARD only macroblock, in a P \
702 /* predict top field from top field */ \
703 MOTION( p_mb, p_mb->p_forward, 0, 0, \
704 p_mb->pppi_motion_vectors[0][0][0], \
705 p_mb->pppi_motion_vectors[0][0][1], \
706 /* XXX?? XXX?? >> 1 ? */ \
707 p_mb->i_l_stride << 1, p_mb->i_c_stride << 1, 8, 0, 0 ); \
709 /* predict and add to top field from bottom field */ \
710 MOTION( p_mb, p_mb->p_forward, 1, 0, \
711 p_mb->ppi_dmv[0][0], p_mb->ppi_dmv[0][1], \
712 p_mb->i_l_stride << 1, p_mb->i_c_stride << 1, 8, 0, 1 ); \
714 /* predict bottom field from bottom field */ \
715 MOTION( p_mb, p_mb->p_forward, 1, 1, \
716 p_mb->pppi_motion_vectors[0][0][0], \
717 p_mb->pppi_motion_vectors[0][0][1], \
718 /* XXX?? XXX?? >> 1 ? */ \
719 p_mb->i_l_stride << 1, p_mb->i_c_stride << 1, 8, 0, 0 ); \
721 /* predict and add to bottom field from top field */ \
722 MOTION( p_mb, p_mb->p_forward, 1, 0, \
723 p_mb->ppi_dmv[1][0], p_mb->ppi_dmv[1][1], \
724 p_mb->i_l_stride << 1, p_mb->i_c_stride << 1, 8, 0, 1 ); \
727 static void vdec_MotionFrameDMV420( macroblock_t * p_mb )
729 FRAMEDMV( Motion420 )
732 static void vdec_MotionFrameDMV422( macroblock_t * p_mb )
734 //FRAMEDMV( Motion422 )
737 static void vdec_MotionFrameDMV444( macroblock_t * p_mb )
739 //FRAMEDMV( Motion444 )