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.6 2001/04/15 04:19:57 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 /* MODULE_NAME defined in Makefile together with -DBUILTIN */
28 # include "modules_inner.h"
30 # define _M( foo ) foo
33 /*****************************************************************************
35 *****************************************************************************/
48 #include "vdec_motion.h"
49 #include "vpar_blocks.h"
51 extern int _M( motion_Probe )( probedata_t *p_data );
53 static void vdec_MotionFieldField420 ( macroblock_t * p_mb );
54 static void vdec_MotionFieldField422 ( macroblock_t * p_mb );
55 static void vdec_MotionFieldField444 ( macroblock_t * p_mb );
56 static void vdec_MotionField16x8420 ( macroblock_t * p_mb );
57 static void vdec_MotionField16x8422 ( macroblock_t * p_mb );
58 static void vdec_MotionField16x8444 ( macroblock_t * p_mb );
59 static void vdec_MotionFieldDMV420 ( macroblock_t * p_mb );
60 static void vdec_MotionFieldDMV422 ( macroblock_t * p_mb );
61 static void vdec_MotionFieldDMV444 ( macroblock_t * p_mb );
62 static void vdec_MotionFrameFrame420 ( macroblock_t * p_mb );
63 static void vdec_MotionFrameFrame422 ( macroblock_t * p_mb );
64 static void vdec_MotionFrameFrame444 ( macroblock_t * p_mb );
65 static void vdec_MotionFrameField420 ( macroblock_t * p_mb );
66 static void vdec_MotionFrameField422 ( macroblock_t * p_mb );
67 static void vdec_MotionFrameField444 ( macroblock_t * p_mb );
68 static void vdec_MotionFrameDMV420 ( macroblock_t * p_mb );
69 static void vdec_MotionFrameDMV422 ( macroblock_t * p_mb );
70 static void vdec_MotionFrameDMV444 ( macroblock_t * p_mb );
72 /*****************************************************************************
73 * Functions exported as capabilities. They are declared as static so that
74 * we don't pollute the namespace too much.
75 *****************************************************************************/
76 void motion_getfunctions( function_list_t * p_function_list )
78 p_function_list->pf_probe = _M( motion_Probe );
80 #define list p_function_list->functions.motion
81 #define motion_functions( yuv ) \
82 list.pf_field_field_##yuv = vdec_MotionFieldField##yuv; \
83 list.pf_field_16x8_##yuv = vdec_MotionField16x8##yuv; \
84 list.pf_field_dmv_##yuv = vdec_MotionFieldDMV##yuv; \
85 list.pf_frame_field_##yuv = vdec_MotionFrameField##yuv; \
86 list.pf_frame_frame_##yuv = vdec_MotionFrameFrame##yuv; \
87 list.pf_frame_dmv_##yuv = vdec_MotionFrameDMV##yuv;
88 motion_functions( 420 )
89 motion_functions( 422 )
90 motion_functions( 444 )
91 #undef motion_functions
97 #define __MotionComponents(width,height) \
98 void MotionComponent_x_y_copy_##width##_##height (); \
99 void MotionComponent_X_y_copy_##width##_##height (); \
100 void MotionComponent_x_Y_copy_##width##_##height (); \
101 void MotionComponent_X_Y_copy_##width##_##height (); \
102 void MotionComponent_x_y_avg_##width##_##height (); \
103 void MotionComponent_X_y_avg_##width##_##height (); \
104 void MotionComponent_x_Y_avg_##width##_##height (); \
105 void MotionComponent_X_Y_avg_##width##_##height ();
107 __MotionComponents (16,16) /* 444, 422, 420 */
108 __MotionComponents (16,8) /* 444, 422, 420 */
109 __MotionComponents (8,8) /* 422, 420 */
110 __MotionComponents (8,4) /* 420 */
112 __MotionComponents (8,16) /* 422 */
115 #define ___callTheRightOne(width,height) \
116 if ((i_width == width) && (i_height == height)) \
123 MotionComponent_x_y_copy_##width##_##height (p_src, p_dest, \
127 MotionComponent_X_y_copy_##width##_##height (p_src, p_dest, \
131 MotionComponent_x_Y_copy_##width##_##height (p_src, p_dest, \
135 MotionComponent_X_Y_copy_##width##_##height (p_src, p_dest, \
145 MotionComponent_x_y_avg_##width##_##height (p_src, p_dest, \
149 MotionComponent_X_y_avg_##width##_##height (p_src, p_dest, \
153 MotionComponent_x_Y_avg_##width##_##height (p_src, p_dest, \
157 MotionComponent_X_Y_avg_##width##_##height (p_src, p_dest, \
164 /*****************************************************************************
165 * vdec_MotionComponent : last stage of motion compensation
166 *****************************************************************************/
167 static __inline__ void MotionComponent(
168 yuv_data_t * p_src, /* source block */
169 yuv_data_t * p_dest, /* dest block */
170 int i_width, /* (explicit) width of block */
171 int i_height, /* (explicit) height of block */
172 int i_stride, /* number of coeffs to jump
173 * between each predicted line */
174 int i_select, /* half-pel vectors */
175 boolean_t b_average /* (explicit) averaging of several
178 ___callTheRightOne (16,16)
179 ___callTheRightOne (16,8)
180 ___callTheRightOne (8,8)
181 ___callTheRightOne (8,4)
183 ___callTheRightOne (8,16)
187 /*****************************************************************************
188 * Motion420 : motion compensation for a 4:2:0 macroblock
189 *****************************************************************************/
190 static __inline__ void Motion420(
191 macroblock_t * p_mb, /* destination macroblock */
192 picture_t * p_source, /* source picture */
193 boolean_t b_source_field, /* source field */
194 boolean_t b_dest_field, /* destination field */
195 int i_mv_x, int i_mv_y, /* motion vector coordinates,
197 int i_l_stride, /* number of coeffs to jump to
198 * go to the next predicted
201 int i_height, /* height of the block to
202 * predict, in luminance
204 int i_offset, /* position of the first
205 * predicted line (explicit) */
206 boolean_t b_average /* (explicit) averaging of
207 * several predictions */ )
209 /* Temporary variables to avoid recalculating things twice */
210 int i_source_offset, i_dest_offset, i_c_height, i_c_select;
212 i_source_offset = (p_mb->i_l_x + (i_mv_x >> 1))
213 + (p_mb->i_motion_l_y + i_offset
215 * p_mb->p_picture->i_width
216 + (i_mv_y >> 1) * i_l_stride;
218 if( i_source_offset >= p_source->i_size )
220 intf_WarnMsg( 2, "Bad motion vector (lum)" );
225 MotionComponent( /* source */
226 p_source->p_y + i_source_offset,
230 + (p_mb->i_motion_l_y + b_dest_field + i_offset)
231 * p_mb->p_picture->i_width,
232 /* prediction width and height */
237 ((i_mv_y & 1) << 1) | (i_mv_x & 1),
240 i_source_offset = (p_mb->i_c_x + ((i_mv_x/2) >> 1))
241 + (p_mb->i_motion_c_y + (i_offset >> 1)
243 * p_mb->p_picture->i_chroma_width
244 + ((i_mv_y/2) >> 1) * i_c_stride;
246 if( i_source_offset >= p_source->i_chroma_size )
248 intf_WarnMsg( 2, "Bad motion vector (chroma)" );
252 i_dest_offset = (p_mb->i_c_x)
253 + (p_mb->i_motion_c_y + b_dest_field
255 * p_mb->p_picture->i_chroma_width;
256 i_c_height = i_height >> 1;
257 i_c_select = (((i_mv_y/2) & 1) << 1) | ((i_mv_x/2) & 1);
260 MotionComponent( p_source->p_u
264 8, i_c_height, i_c_stride,
265 i_c_select, b_average );
268 MotionComponent( p_source->p_v
272 8, i_c_height, i_c_stride,
273 i_c_select, b_average );
276 /*****************************************************************************
277 * Motion422 : motion compensation for a 4:2:2 macroblock
278 *****************************************************************************/
279 static __inline__ void Motion422(
280 macroblock_t * p_mb, /* destination macroblock */
281 picture_t * p_source, /* source picture */
282 boolean_t b_source_field, /* source field */
283 boolean_t b_dest_field, /* destination field */
284 int i_mv_x, int i_mv_y, /* motion vector coordinates,
286 int i_l_stride, /* number of coeffs to jump to
287 * go to the next predicted
290 int i_height, /* height of the block to
291 * predict, in luminance
293 int i_offset, /* position of the first
294 * predicted line (explicit) */
295 boolean_t b_average /* (explicit) averaging of
296 * several predictions */ )
299 int i_source_offset, i_dest_offset, i_c_select;
302 MotionComponent( /* source */
304 + (p_mb->i_l_x + (i_mv_x >> 1))
305 + (p_mb->i_motion_l_y + i_offset
307 * p_mb->p_picture->i_width
308 + (i_mv_y >> 1) * p_mb->i_l_stride,
312 + (p_mb->i_motion_l_y + b_dest_field)
313 * p_mb->p_picture->i_width,
314 /* prediction width and height */
319 ((i_mv_y & 1) << 1) | (i_mv_x & 1),
322 i_source_offset = (p_mb->i_c_x + ((i_mv_x/2) >> 1))
323 + (p_mb->i_motion_c_y + i_offset
325 * p_mb->p_picture->i_chroma_width
326 + (i_mv_y) >> 1) * p_mb->i_c_stride;
327 i_dest_offset = (p_mb->i_c_x)
328 + (p_mb->i_motion_c_y + b_dest_field)
329 * p_mb->p_picture->i_chroma_width;
330 i_c_select = ((i_mv_y & 1) << 1) | ((i_mv_x/2) & 1);
333 MotionComponent( p_source->p_u
337 8, i_height, i_c_stride,
338 i_c_select, b_average );
341 MotionComponent( p_source->p_v
345 8, i_height, i_c_stride,
346 i_c_select, b_average );
350 /*****************************************************************************
351 * Motion444 : motion compensation for a 4:4:4 macroblock
352 *****************************************************************************/
353 static __inline__ void Motion444(
354 macroblock_t * p_mb, /* destination macroblock */
355 picture_t * p_source, /* source picture */
356 boolean_t b_source_field, /* source field */
357 boolean_t b_dest_field, /* destination field */
358 int i_mv_x, int i_mv_y, /* motion vector coordinates,
360 int i_l_stride, /* number of coeffs to jump to
361 * go to the next predicted
364 int i_height, /* height of the block to
365 * predict, in luminance
367 int i_offset, /* position of the first
368 * predicted line (explicit) */
369 boolean_t b_average /* (explicit) averaging of
370 * several predictions */ )
373 int i_source_offset, i_dest_offset, i_select;
375 i_source_offset = (p_mb->i_l_x + (i_mv_x >> 1))
376 + (p_mb->i_motion_l_y + i_offset
378 * p_mb->p_picture->i_width
379 + (i_mv_y >> 1) * p_mb->i_l_stride;
380 i_dest_offset = (p_mb->i_l_x)
381 + (p_mb->i_motion_l_y + b_dest_field)
382 * p_mb->p_picture->i_width;
383 i_select = ((i_mv_y & 1) << 1) | (i_mv_x & 1);
387 MotionComponent( p_source->p_y
391 16, i_height, i_l_stride,
392 i_select, b_average );
395 MotionComponent( p_source->p_u
399 16, i_height, i_l_stride,
400 i_select, b_average );
403 MotionComponent( p_source->p_v
407 16, i_height, i_l_stride,
408 i_select, b_average );
412 /*****************************************************************************
413 * vdec_MotionFieldField : motion compensation for field motion type (field)
414 *****************************************************************************/
415 #define FIELDFIELD( MOTION ) \
417 picture_t * p_pred; \
419 if( p_mb->i_mb_type & MB_MOTION_FORWARD ) \
421 if( p_mb->b_P_second \
422 && (p_mb->b_motion_field != p_mb->ppi_field_select[0][0]) )\
423 p_pred = p_mb->p_picture; \
425 p_pred = p_mb->p_forward; \
427 MOTION( p_mb, p_pred, p_mb->ppi_field_select[0][0], \
428 p_mb->b_motion_field, \
429 p_mb->pppi_motion_vectors[0][0][0], \
430 p_mb->pppi_motion_vectors[0][0][1], \
431 p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 0 ); \
433 if( p_mb->i_mb_type & MB_MOTION_BACKWARD ) \
435 MOTION( p_mb, p_mb->p_backward, \
436 p_mb->ppi_field_select[0][1], \
437 p_mb->b_motion_field, \
438 p_mb->pppi_motion_vectors[0][1][0], \
439 p_mb->pppi_motion_vectors[0][1][1], \
440 p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 1 ); \
444 else /* MB_MOTION_BACKWARD */ \
446 MOTION( p_mb, p_mb->p_backward, p_mb->ppi_field_select[0][1], \
447 p_mb->b_motion_field, \
448 p_mb->pppi_motion_vectors[0][1][0], \
449 p_mb->pppi_motion_vectors[0][1][1], \
450 p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 0 ); \
454 static void vdec_MotionFieldField420( macroblock_t * p_mb )
456 FIELDFIELD( Motion420 )
459 static void vdec_MotionFieldField422( macroblock_t * p_mb )
461 //FIELDFIELD( Motion422 )
464 static void vdec_MotionFieldField444( macroblock_t * p_mb )
466 //FIELDFIELD( Motion444 )
469 /*****************************************************************************
470 * vdec_MotionField16x8XXX: motion compensation for 16x8 motion type (field)
471 *****************************************************************************/
472 #define FIELD16X8( MOTION ) \
474 picture_t * p_pred; \
476 if( p_mb->i_mb_type & MB_MOTION_FORWARD ) \
478 if( p_mb->b_P_second \
479 && (p_mb->b_motion_field != p_mb->ppi_field_select[0][0]) )\
480 p_pred = p_mb->p_picture; \
482 p_pred = p_mb->p_forward; \
484 MOTION( p_mb, p_pred, p_mb->ppi_field_select[0][0], \
485 p_mb->b_motion_field, \
486 p_mb->pppi_motion_vectors[0][0][0], \
487 p_mb->pppi_motion_vectors[0][0][1], \
488 p_mb->i_l_stride, p_mb->i_c_stride, 8, 0, 0 ); \
490 if( p_mb->b_P_second \
491 && (p_mb->b_motion_field != p_mb->ppi_field_select[1][0]) )\
492 p_pred = p_mb->p_picture; \
494 p_pred = p_mb->p_forward; \
496 MOTION( p_mb, p_pred, p_mb->ppi_field_select[1][0], \
497 p_mb->b_motion_field, \
498 p_mb->pppi_motion_vectors[1][0][0], \
499 p_mb->pppi_motion_vectors[1][0][1], \
500 p_mb->i_l_stride, p_mb->i_c_stride, 8, 8, 0 ); \
502 if( p_mb->i_mb_type & MB_MOTION_BACKWARD ) \
504 MOTION( p_mb, p_mb->p_backward, \
505 p_mb->ppi_field_select[0][1], \
506 p_mb->b_motion_field, \
507 p_mb->pppi_motion_vectors[0][1][0], \
508 p_mb->pppi_motion_vectors[0][1][1], \
509 p_mb->i_l_stride, p_mb->i_c_stride, 8, 0, 1 ); \
511 MOTION( p_mb, p_mb->p_backward, \
512 p_mb->ppi_field_select[1][1], \
513 p_mb->b_motion_field, \
514 p_mb->pppi_motion_vectors[1][1][0], \
515 p_mb->pppi_motion_vectors[1][1][1], \
516 p_mb->i_l_stride, p_mb->i_c_stride, 8, 8, 1 ); \
520 else /* MB_MOTION_BACKWARD */ \
522 MOTION( p_mb, p_mb->p_backward, p_mb->ppi_field_select[0][1], \
523 p_mb->b_motion_field, \
524 p_mb->pppi_motion_vectors[0][1][0], \
525 p_mb->pppi_motion_vectors[0][1][1], \
526 p_mb->i_l_stride, p_mb->i_c_stride, 8, 0, 0 ); \
528 MOTION( p_mb, p_mb->p_backward, p_mb->ppi_field_select[1][1], \
529 p_mb->b_motion_field, \
530 p_mb->pppi_motion_vectors[1][1][0], \
531 p_mb->pppi_motion_vectors[1][1][1], \
532 p_mb->i_l_stride, p_mb->i_c_stride, 8, 8, 0 ); \
536 static void vdec_MotionField16x8420( macroblock_t * p_mb )
538 FIELD16X8( Motion420 )
541 static void vdec_MotionField16x8422( macroblock_t * p_mb )
543 //FIELD16X8( Motion422 )
546 static void vdec_MotionField16x8444( macroblock_t * p_mb )
548 //FIELD16X8( Motion444 )
551 /*****************************************************************************
552 * vdec_MotionFieldDMVXXX : motion compensation for dmv motion type (field)
553 *****************************************************************************/
554 #define FIELDDMV( MOTION ) \
556 /* This is necessarily a MOTION_FORWARD only macroblock, in a P \
558 picture_t * p_pred; \
560 /* predict from field of same parity */ \
561 MOTION( p_mb, p_mb->p_forward, \
562 p_mb->b_motion_field, p_mb->b_motion_field, \
563 p_mb->pppi_motion_vectors[0][0][0], \
564 p_mb->pppi_motion_vectors[0][0][1], \
565 p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 0 ); \
567 if( p_mb->b_P_second ) \
568 p_pred = p_mb->p_picture; \
570 p_pred = p_mb->p_forward; \
572 /* predict from field of opposite parity */ \
573 MOTION( p_mb, p_pred, !p_mb->b_motion_field, p_mb->b_motion_field, \
574 p_mb->ppi_dmv[0][0], p_mb->ppi_dmv[0][1], \
575 p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 1 ); \
578 static void vdec_MotionFieldDMV420( macroblock_t * p_mb )
580 FIELDDMV( Motion420 )
583 static void vdec_MotionFieldDMV422( macroblock_t * p_mb )
585 //FIELDDMV( Motion422 )
588 static void vdec_MotionFieldDMV444( macroblock_t * p_mb )
590 //FIELDDMV( Motion444 )
593 /*****************************************************************************
594 * vdec_MotionFrameFrameXXX?? : motion compensation for frame motion type (frame)
595 *****************************************************************************/
596 #define FRAMEFRAME( MOTION ) \
598 if( p_mb->i_mb_type & MB_MOTION_FORWARD ) \
600 MOTION( p_mb, p_mb->p_forward, 0, 0, \
601 p_mb->pppi_motion_vectors[0][0][0], \
602 p_mb->pppi_motion_vectors[0][0][1], \
603 p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 0 ); \
605 if( p_mb->i_mb_type & 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, 1 ); \
614 else /* MB_MOTION_BACKWARD */ \
616 MOTION( p_mb, p_mb->p_backward, 0, 0, \
617 p_mb->pppi_motion_vectors[0][1][0], \
618 p_mb->pppi_motion_vectors[0][1][1], \
619 p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 0 ); \
623 static void vdec_MotionFrameFrame420( macroblock_t * p_mb )
625 FRAMEFRAME( Motion420 )
628 static void vdec_MotionFrameFrame422( macroblock_t * p_mb )
630 //FRAMEFRAME( Motion422 )
633 static void vdec_MotionFrameFrame444( macroblock_t * p_mb )
635 //FRAMEFRAME( Motion444 )
638 /*****************************************************************************
639 * vdec_MotionFrameFieldXXX?? : motion compensation for field motion type (frame)
640 *****************************************************************************/
641 #define FRAMEFIELD( MOTION ) \
643 int i_l_stride = p_mb->i_l_stride << 1; \
644 int i_c_stride = p_mb->i_c_stride << 1; \
646 if( p_mb->i_mb_type & MB_MOTION_FORWARD ) \
648 MOTION( p_mb, p_mb->p_forward, p_mb->ppi_field_select[0][0], 0, \
649 p_mb->pppi_motion_vectors[0][0][0], \
650 p_mb->pppi_motion_vectors[0][0][1] >> 1, \
651 i_l_stride, i_c_stride, 8, 0, 0 ); \
653 MOTION( p_mb, p_mb->p_forward, p_mb->ppi_field_select[1][0], 1, \
654 p_mb->pppi_motion_vectors[1][0][0], \
655 p_mb->pppi_motion_vectors[1][0][1] >> 1, \
656 i_l_stride, i_c_stride, 8, 0, 0 ); \
658 if( p_mb->i_mb_type & MB_MOTION_BACKWARD ) \
660 MOTION( p_mb, p_mb->p_backward, \
661 p_mb->ppi_field_select[0][1], 0, \
662 p_mb->pppi_motion_vectors[0][1][0], \
663 p_mb->pppi_motion_vectors[0][1][1] >> 1, \
664 i_l_stride, i_c_stride, 8, 0, 1 ); \
666 MOTION( p_mb, p_mb->p_backward, \
667 p_mb->ppi_field_select[1][1], 1, \
668 p_mb->pppi_motion_vectors[1][1][0], \
669 p_mb->pppi_motion_vectors[1][1][1] >> 1, \
670 i_l_stride, i_c_stride, 8, 0, 1 ); \
674 else /* MB_MOTION_BACKWARD only */ \
676 MOTION( p_mb, p_mb->p_backward, p_mb->ppi_field_select[0][1], 0,\
677 p_mb->pppi_motion_vectors[0][1][0], \
678 p_mb->pppi_motion_vectors[0][1][1] >> 1, \
679 i_l_stride, i_c_stride, 8, 0, 0 ); \
681 MOTION( p_mb, p_mb->p_backward, p_mb->ppi_field_select[1][1], 1,\
682 p_mb->pppi_motion_vectors[1][1][0], \
683 p_mb->pppi_motion_vectors[1][1][1] >> 1, \
684 i_l_stride, i_c_stride, 8, 0, 0 ); \
688 static void vdec_MotionFrameField420( macroblock_t * p_mb )
690 FRAMEFIELD( Motion420 )
693 static void vdec_MotionFrameField422( macroblock_t * p_mb )
695 //FRAMEFIELD( Motion422 )
698 static void vdec_MotionFrameField444( macroblock_t * p_mb )
700 //FRAMEFIELD( Motion444 )
703 /*****************************************************************************
704 * vdec_MotionFrameDMVXXX?? : motion compensation for dmv motion type (frame)
705 *****************************************************************************/
706 #define FRAMEDMV( MOTION ) \
708 /* This is necessarily a MOTION_FORWARD only macroblock, in a P \
711 /* predict top field from top field */ \
712 MOTION( p_mb, p_mb->p_forward, 0, 0, \
713 p_mb->pppi_motion_vectors[0][0][0], \
714 p_mb->pppi_motion_vectors[0][0][1], \
715 /* XXX?? XXX?? >> 1 ? */ \
716 p_mb->i_l_stride << 1, p_mb->i_c_stride << 1, 8, 0, 0 ); \
718 /* predict and add to top field from bottom field */ \
719 MOTION( p_mb, p_mb->p_forward, 1, 0, \
720 p_mb->ppi_dmv[0][0], p_mb->ppi_dmv[0][1], \
721 p_mb->i_l_stride << 1, p_mb->i_c_stride << 1, 8, 0, 1 ); \
723 /* predict bottom field from bottom field */ \
724 MOTION( p_mb, p_mb->p_forward, 1, 1, \
725 p_mb->pppi_motion_vectors[0][0][0], \
726 p_mb->pppi_motion_vectors[0][0][1], \
727 /* XXX?? XXX?? >> 1 ? */ \
728 p_mb->i_l_stride << 1, p_mb->i_c_stride << 1, 8, 0, 0 ); \
730 /* predict and add to bottom field from top field */ \
731 MOTION( p_mb, p_mb->p_forward, 1, 0, \
732 p_mb->ppi_dmv[1][0], p_mb->ppi_dmv[1][1], \
733 p_mb->i_l_stride << 1, p_mb->i_c_stride << 1, 8, 0, 1 ); \
736 static void vdec_MotionFrameDMV420( macroblock_t * p_mb )
738 FRAMEDMV( Motion420 )
741 static void vdec_MotionFrameDMV422( macroblock_t * p_mb )
743 //FRAMEDMV( Motion422 )
746 static void vdec_MotionFrameDMV444( macroblock_t * p_mb )
748 //FRAMEDMV( Motion444 )