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.8 2001/06/07 15:27:44 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 *****************************************************************************/
47 #include "vdec_motion.h"
48 #include "vpar_blocks.h"
51 #include "modules_export.h"
53 extern int _M( motion_Probe )( probedata_t *p_data );
55 static void vdec_MotionFieldField420 ( macroblock_t * p_mb );
56 static void vdec_MotionFieldField422 ( macroblock_t * p_mb );
57 static void vdec_MotionFieldField444 ( macroblock_t * p_mb );
58 static void vdec_MotionField16x8420 ( macroblock_t * p_mb );
59 static void vdec_MotionField16x8422 ( macroblock_t * p_mb );
60 static void vdec_MotionField16x8444 ( macroblock_t * p_mb );
61 static void vdec_MotionFieldDMV420 ( macroblock_t * p_mb );
62 static void vdec_MotionFieldDMV422 ( macroblock_t * p_mb );
63 static void vdec_MotionFieldDMV444 ( macroblock_t * p_mb );
64 static void vdec_MotionFrameFrame420 ( macroblock_t * p_mb );
65 static void vdec_MotionFrameFrame422 ( macroblock_t * p_mb );
66 static void vdec_MotionFrameFrame444 ( macroblock_t * p_mb );
67 static void vdec_MotionFrameField420 ( macroblock_t * p_mb );
68 static void vdec_MotionFrameField422 ( macroblock_t * p_mb );
69 static void vdec_MotionFrameField444 ( macroblock_t * p_mb );
70 static void vdec_MotionFrameDMV420 ( macroblock_t * p_mb );
71 static void vdec_MotionFrameDMV422 ( macroblock_t * p_mb );
72 static void vdec_MotionFrameDMV444 ( macroblock_t * p_mb );
74 /*****************************************************************************
75 * Functions exported as capabilities. They are declared as static so that
76 * we don't pollute the namespace too much.
77 *****************************************************************************/
78 void _M( motion_getfunctions )( function_list_t * p_function_list )
80 p_function_list->pf_probe = _M( motion_Probe );
82 #define list p_function_list->functions.motion
83 #define motion_functions( yuv ) \
84 list.pf_field_field_##yuv = vdec_MotionFieldField##yuv; \
85 list.pf_field_16x8_##yuv = vdec_MotionField16x8##yuv; \
86 list.pf_field_dmv_##yuv = vdec_MotionFieldDMV##yuv; \
87 list.pf_frame_field_##yuv = vdec_MotionFrameField##yuv; \
88 list.pf_frame_frame_##yuv = vdec_MotionFrameFrame##yuv; \
89 list.pf_frame_dmv_##yuv = vdec_MotionFrameDMV##yuv;
90 motion_functions( 420 )
91 motion_functions( 422 )
92 motion_functions( 444 )
93 #undef motion_functions
99 #define __MotionComponents(width,height) \
100 void _M( MotionComponent_x_y_copy_##width##_##height )(); \
101 void _M( MotionComponent_X_y_copy_##width##_##height )(); \
102 void _M( MotionComponent_x_Y_copy_##width##_##height )(); \
103 void _M( MotionComponent_X_Y_copy_##width##_##height )(); \
104 void _M( MotionComponent_x_y_avg_##width##_##height )(); \
105 void _M( MotionComponent_X_y_avg_##width##_##height )(); \
106 void _M( MotionComponent_x_Y_avg_##width##_##height )(); \
107 void _M( MotionComponent_X_Y_avg_##width##_##height )();
109 __MotionComponents (16,16) /* 444, 422, 420 */
110 __MotionComponents (16,8) /* 444, 422, 420 */
111 __MotionComponents (8,8) /* 422, 420 */
112 __MotionComponents (8,4) /* 420 */
114 __MotionComponents (8,16) /* 422 */
117 #define ___callTheRightOne(width,height) \
118 if ((i_width == width) && (i_height == height)) \
125 _M( MotionComponent_x_y_copy_##width##_##height )(p_src, \
129 _M( MotionComponent_X_y_copy_##width##_##height )(p_src, \
133 _M( MotionComponent_x_Y_copy_##width##_##height )(p_src, \
137 _M( MotionComponent_X_Y_copy_##width##_##height )(p_src, \
147 _M( MotionComponent_x_y_avg_##width##_##height )(p_src, \
151 _M( MotionComponent_X_y_avg_##width##_##height )(p_src, \
155 _M( MotionComponent_x_Y_avg_##width##_##height )(p_src, \
159 _M( MotionComponent_X_Y_avg_##width##_##height )(p_src, \
166 /*****************************************************************************
167 * vdec_MotionComponent : last stage of motion compensation
168 *****************************************************************************/
169 static __inline__ void MotionComponent(
170 yuv_data_t * p_src, /* source block */
171 yuv_data_t * p_dest, /* dest block */
172 int i_width, /* (explicit) width of block */
173 int i_height, /* (explicit) height of block */
174 int i_stride, /* number of coeffs to jump
175 * between each predicted line */
176 int i_select, /* half-pel vectors */
177 boolean_t b_average /* (explicit) averaging of several
180 ___callTheRightOne (16,16)
181 ___callTheRightOne (16,8)
182 ___callTheRightOne (8,8)
183 ___callTheRightOne (8,4)
185 ___callTheRightOne (8,16)
189 /*****************************************************************************
190 * Motion420 : motion compensation for a 4:2:0 macroblock
191 *****************************************************************************/
192 static __inline__ void Motion420(
193 macroblock_t * p_mb, /* destination macroblock */
194 picture_t * p_source, /* source picture */
195 boolean_t b_source_field, /* source field */
196 boolean_t b_dest_field, /* destination field */
197 int i_mv_x, int i_mv_y, /* motion vector coordinates,
199 int i_l_stride, /* number of coeffs to jump to
200 * go to the next predicted
203 int i_height, /* height of the block to
204 * predict, in luminance
206 int i_offset, /* position of the first
207 * predicted line (explicit) */
208 boolean_t b_average /* (explicit) averaging of
209 * several predictions */ )
211 /* Temporary variables to avoid recalculating things twice */
212 int i_source_offset, i_dest_offset, i_c_height, i_c_select;
214 i_source_offset = (p_mb->i_l_x + (i_mv_x >> 1))
215 + (p_mb->i_motion_l_y + i_offset
217 * p_mb->p_picture->i_width
218 + (i_mv_y >> 1) * i_l_stride;
220 if( i_source_offset >= p_source->i_size )
222 intf_WarnMsg( 2, "Bad motion vector (lum)" );
227 MotionComponent( /* source */
228 p_source->p_y + i_source_offset,
232 + (p_mb->i_motion_l_y + b_dest_field + i_offset)
233 * p_mb->p_picture->i_width,
234 /* prediction width and height */
239 ((i_mv_y & 1) << 1) | (i_mv_x & 1),
242 i_source_offset = (p_mb->i_c_x + ((i_mv_x/2) >> 1))
243 + (p_mb->i_motion_c_y + (i_offset >> 1)
245 * p_mb->p_picture->i_chroma_width
246 + ((i_mv_y/2) >> 1) * i_c_stride;
248 if( i_source_offset >= p_source->i_chroma_size )
250 intf_WarnMsg( 2, "Bad motion vector (chroma)" );
254 i_dest_offset = (p_mb->i_c_x)
255 + (p_mb->i_motion_c_y + b_dest_field
257 * p_mb->p_picture->i_chroma_width;
258 i_c_height = i_height >> 1;
259 i_c_select = (((i_mv_y/2) & 1) << 1) | ((i_mv_x/2) & 1);
262 MotionComponent( p_source->p_u
266 8, i_c_height, i_c_stride,
267 i_c_select, b_average );
270 MotionComponent( p_source->p_v
274 8, i_c_height, i_c_stride,
275 i_c_select, b_average );
278 /*****************************************************************************
279 * Motion422 : motion compensation for a 4:2:2 macroblock
280 *****************************************************************************/
281 static __inline__ void Motion422(
282 macroblock_t * p_mb, /* destination macroblock */
283 picture_t * p_source, /* source picture */
284 boolean_t b_source_field, /* source field */
285 boolean_t b_dest_field, /* destination field */
286 int i_mv_x, int i_mv_y, /* motion vector coordinates,
288 int i_l_stride, /* number of coeffs to jump to
289 * go to the next predicted
292 int i_height, /* height of the block to
293 * predict, in luminance
295 int i_offset, /* position of the first
296 * predicted line (explicit) */
297 boolean_t b_average /* (explicit) averaging of
298 * several predictions */ )
301 int i_source_offset, i_dest_offset, i_c_select;
304 MotionComponent( /* source */
306 + (p_mb->i_l_x + (i_mv_x >> 1))
307 + (p_mb->i_motion_l_y + i_offset
309 * p_mb->p_picture->i_width
310 + (i_mv_y >> 1) * p_mb->i_l_stride,
314 + (p_mb->i_motion_l_y + b_dest_field)
315 * p_mb->p_picture->i_width,
316 /* prediction width and height */
321 ((i_mv_y & 1) << 1) | (i_mv_x & 1),
324 i_source_offset = (p_mb->i_c_x + ((i_mv_x/2) >> 1))
325 + (p_mb->i_motion_c_y + i_offset
327 * p_mb->p_picture->i_chroma_width
328 + (i_mv_y) >> 1) * p_mb->i_c_stride;
329 i_dest_offset = (p_mb->i_c_x)
330 + (p_mb->i_motion_c_y + b_dest_field)
331 * p_mb->p_picture->i_chroma_width;
332 i_c_select = ((i_mv_y & 1) << 1) | ((i_mv_x/2) & 1);
335 MotionComponent( p_source->p_u
339 8, i_height, i_c_stride,
340 i_c_select, b_average );
343 MotionComponent( p_source->p_v
347 8, i_height, i_c_stride,
348 i_c_select, b_average );
352 /*****************************************************************************
353 * Motion444 : motion compensation for a 4:4:4 macroblock
354 *****************************************************************************/
355 static __inline__ void Motion444(
356 macroblock_t * p_mb, /* destination macroblock */
357 picture_t * p_source, /* source picture */
358 boolean_t b_source_field, /* source field */
359 boolean_t b_dest_field, /* destination field */
360 int i_mv_x, int i_mv_y, /* motion vector coordinates,
362 int i_l_stride, /* number of coeffs to jump to
363 * go to the next predicted
366 int i_height, /* height of the block to
367 * predict, in luminance
369 int i_offset, /* position of the first
370 * predicted line (explicit) */
371 boolean_t b_average /* (explicit) averaging of
372 * several predictions */ )
375 int i_source_offset, i_dest_offset, i_select;
377 i_source_offset = (p_mb->i_l_x + (i_mv_x >> 1))
378 + (p_mb->i_motion_l_y + i_offset
380 * p_mb->p_picture->i_width
381 + (i_mv_y >> 1) * p_mb->i_l_stride;
382 i_dest_offset = (p_mb->i_l_x)
383 + (p_mb->i_motion_l_y + b_dest_field)
384 * p_mb->p_picture->i_width;
385 i_select = ((i_mv_y & 1) << 1) | (i_mv_x & 1);
389 MotionComponent( p_source->p_y
393 16, i_height, i_l_stride,
394 i_select, b_average );
397 MotionComponent( p_source->p_u
401 16, i_height, i_l_stride,
402 i_select, b_average );
405 MotionComponent( p_source->p_v
409 16, i_height, i_l_stride,
410 i_select, b_average );
414 /*****************************************************************************
415 * vdec_MotionFieldField : motion compensation for field motion type (field)
416 *****************************************************************************/
417 #define FIELDFIELD( MOTION ) \
419 picture_t * p_pred; \
421 if( p_mb->i_mb_type & MB_MOTION_FORWARD ) \
423 if( p_mb->b_P_second \
424 && (p_mb->b_motion_field != p_mb->ppi_field_select[0][0]) )\
425 p_pred = p_mb->p_picture; \
427 p_pred = p_mb->p_forward; \
429 MOTION( p_mb, p_pred, p_mb->ppi_field_select[0][0], \
430 p_mb->b_motion_field, \
431 p_mb->pppi_motion_vectors[0][0][0], \
432 p_mb->pppi_motion_vectors[0][0][1], \
433 p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 0 ); \
435 if( p_mb->i_mb_type & MB_MOTION_BACKWARD ) \
437 MOTION( p_mb, p_mb->p_backward, \
438 p_mb->ppi_field_select[0][1], \
439 p_mb->b_motion_field, \
440 p_mb->pppi_motion_vectors[0][1][0], \
441 p_mb->pppi_motion_vectors[0][1][1], \
442 p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 1 ); \
446 else /* MB_MOTION_BACKWARD */ \
448 MOTION( p_mb, p_mb->p_backward, p_mb->ppi_field_select[0][1], \
449 p_mb->b_motion_field, \
450 p_mb->pppi_motion_vectors[0][1][0], \
451 p_mb->pppi_motion_vectors[0][1][1], \
452 p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 0 ); \
456 static void vdec_MotionFieldField420( macroblock_t * p_mb )
458 FIELDFIELD( Motion420 )
461 static void vdec_MotionFieldField422( macroblock_t * p_mb )
463 //FIELDFIELD( Motion422 )
466 static void vdec_MotionFieldField444( macroblock_t * p_mb )
468 //FIELDFIELD( Motion444 )
471 /*****************************************************************************
472 * vdec_MotionField16x8XXX: motion compensation for 16x8 motion type (field)
473 *****************************************************************************/
474 #define FIELD16X8( MOTION ) \
476 picture_t * p_pred; \
478 if( p_mb->i_mb_type & MB_MOTION_FORWARD ) \
480 if( p_mb->b_P_second \
481 && (p_mb->b_motion_field != p_mb->ppi_field_select[0][0]) )\
482 p_pred = p_mb->p_picture; \
484 p_pred = p_mb->p_forward; \
486 MOTION( p_mb, p_pred, p_mb->ppi_field_select[0][0], \
487 p_mb->b_motion_field, \
488 p_mb->pppi_motion_vectors[0][0][0], \
489 p_mb->pppi_motion_vectors[0][0][1], \
490 p_mb->i_l_stride, p_mb->i_c_stride, 8, 0, 0 ); \
492 if( p_mb->b_P_second \
493 && (p_mb->b_motion_field != p_mb->ppi_field_select[1][0]) )\
494 p_pred = p_mb->p_picture; \
496 p_pred = p_mb->p_forward; \
498 MOTION( p_mb, p_pred, p_mb->ppi_field_select[1][0], \
499 p_mb->b_motion_field, \
500 p_mb->pppi_motion_vectors[1][0][0], \
501 p_mb->pppi_motion_vectors[1][0][1], \
502 p_mb->i_l_stride, p_mb->i_c_stride, 8, 8, 0 ); \
504 if( p_mb->i_mb_type & MB_MOTION_BACKWARD ) \
506 MOTION( p_mb, p_mb->p_backward, \
507 p_mb->ppi_field_select[0][1], \
508 p_mb->b_motion_field, \
509 p_mb->pppi_motion_vectors[0][1][0], \
510 p_mb->pppi_motion_vectors[0][1][1], \
511 p_mb->i_l_stride, p_mb->i_c_stride, 8, 0, 1 ); \
513 MOTION( p_mb, p_mb->p_backward, \
514 p_mb->ppi_field_select[1][1], \
515 p_mb->b_motion_field, \
516 p_mb->pppi_motion_vectors[1][1][0], \
517 p_mb->pppi_motion_vectors[1][1][1], \
518 p_mb->i_l_stride, p_mb->i_c_stride, 8, 8, 1 ); \
522 else /* MB_MOTION_BACKWARD */ \
524 MOTION( p_mb, p_mb->p_backward, p_mb->ppi_field_select[0][1], \
525 p_mb->b_motion_field, \
526 p_mb->pppi_motion_vectors[0][1][0], \
527 p_mb->pppi_motion_vectors[0][1][1], \
528 p_mb->i_l_stride, p_mb->i_c_stride, 8, 0, 0 ); \
530 MOTION( p_mb, p_mb->p_backward, p_mb->ppi_field_select[1][1], \
531 p_mb->b_motion_field, \
532 p_mb->pppi_motion_vectors[1][1][0], \
533 p_mb->pppi_motion_vectors[1][1][1], \
534 p_mb->i_l_stride, p_mb->i_c_stride, 8, 8, 0 ); \
538 static void vdec_MotionField16x8420( macroblock_t * p_mb )
540 FIELD16X8( Motion420 )
543 static void vdec_MotionField16x8422( macroblock_t * p_mb )
545 //FIELD16X8( Motion422 )
548 static void vdec_MotionField16x8444( macroblock_t * p_mb )
550 //FIELD16X8( Motion444 )
553 /*****************************************************************************
554 * vdec_MotionFieldDMVXXX : motion compensation for dmv motion type (field)
555 *****************************************************************************/
556 #define FIELDDMV( MOTION ) \
558 /* This is necessarily a MOTION_FORWARD only macroblock, in a P \
560 picture_t * p_pred; \
562 /* predict from field of same parity */ \
563 MOTION( p_mb, p_mb->p_forward, \
564 p_mb->b_motion_field, p_mb->b_motion_field, \
565 p_mb->pppi_motion_vectors[0][0][0], \
566 p_mb->pppi_motion_vectors[0][0][1], \
567 p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 0 ); \
569 if( p_mb->b_P_second ) \
570 p_pred = p_mb->p_picture; \
572 p_pred = p_mb->p_forward; \
574 /* predict from field of opposite parity */ \
575 MOTION( p_mb, p_pred, !p_mb->b_motion_field, p_mb->b_motion_field, \
576 p_mb->ppi_dmv[0][0], p_mb->ppi_dmv[0][1], \
577 p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 1 ); \
580 static void vdec_MotionFieldDMV420( macroblock_t * p_mb )
582 FIELDDMV( Motion420 )
585 static void vdec_MotionFieldDMV422( macroblock_t * p_mb )
587 //FIELDDMV( Motion422 )
590 static void vdec_MotionFieldDMV444( macroblock_t * p_mb )
592 //FIELDDMV( Motion444 )
595 /*****************************************************************************
596 * vdec_MotionFrameFrameXXX?? : motion compensation for frame motion type (frame)
597 *****************************************************************************/
598 #define FRAMEFRAME( MOTION ) \
600 if( p_mb->i_mb_type & MB_MOTION_FORWARD ) \
602 MOTION( p_mb, p_mb->p_forward, 0, 0, \
603 p_mb->pppi_motion_vectors[0][0][0], \
604 p_mb->pppi_motion_vectors[0][0][1], \
605 p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 0 ); \
607 if( p_mb->i_mb_type & MB_MOTION_BACKWARD ) \
609 MOTION( p_mb, p_mb->p_backward, 0, 0, \
610 p_mb->pppi_motion_vectors[0][1][0], \
611 p_mb->pppi_motion_vectors[0][1][1], \
612 p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 1 ); \
616 else /* MB_MOTION_BACKWARD */ \
618 MOTION( p_mb, p_mb->p_backward, 0, 0, \
619 p_mb->pppi_motion_vectors[0][1][0], \
620 p_mb->pppi_motion_vectors[0][1][1], \
621 p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 0 ); \
625 static void vdec_MotionFrameFrame420( macroblock_t * p_mb )
627 FRAMEFRAME( Motion420 )
630 static void vdec_MotionFrameFrame422( macroblock_t * p_mb )
632 //FRAMEFRAME( Motion422 )
635 static void vdec_MotionFrameFrame444( macroblock_t * p_mb )
637 //FRAMEFRAME( Motion444 )
640 /*****************************************************************************
641 * vdec_MotionFrameFieldXXX?? : motion compensation for field motion type (frame)
642 *****************************************************************************/
643 #define FRAMEFIELD( MOTION ) \
645 int i_l_stride = p_mb->i_l_stride << 1; \
646 int i_c_stride = p_mb->i_c_stride << 1; \
648 if( p_mb->i_mb_type & MB_MOTION_FORWARD ) \
650 MOTION( p_mb, p_mb->p_forward, p_mb->ppi_field_select[0][0], 0, \
651 p_mb->pppi_motion_vectors[0][0][0], \
652 p_mb->pppi_motion_vectors[0][0][1] >> 1, \
653 i_l_stride, i_c_stride, 8, 0, 0 ); \
655 MOTION( p_mb, p_mb->p_forward, p_mb->ppi_field_select[1][0], 1, \
656 p_mb->pppi_motion_vectors[1][0][0], \
657 p_mb->pppi_motion_vectors[1][0][1] >> 1, \
658 i_l_stride, i_c_stride, 8, 0, 0 ); \
660 if( p_mb->i_mb_type & MB_MOTION_BACKWARD ) \
662 MOTION( p_mb, p_mb->p_backward, \
663 p_mb->ppi_field_select[0][1], 0, \
664 p_mb->pppi_motion_vectors[0][1][0], \
665 p_mb->pppi_motion_vectors[0][1][1] >> 1, \
666 i_l_stride, i_c_stride, 8, 0, 1 ); \
668 MOTION( p_mb, p_mb->p_backward, \
669 p_mb->ppi_field_select[1][1], 1, \
670 p_mb->pppi_motion_vectors[1][1][0], \
671 p_mb->pppi_motion_vectors[1][1][1] >> 1, \
672 i_l_stride, i_c_stride, 8, 0, 1 ); \
676 else /* MB_MOTION_BACKWARD only */ \
678 MOTION( p_mb, p_mb->p_backward, p_mb->ppi_field_select[0][1], 0,\
679 p_mb->pppi_motion_vectors[0][1][0], \
680 p_mb->pppi_motion_vectors[0][1][1] >> 1, \
681 i_l_stride, i_c_stride, 8, 0, 0 ); \
683 MOTION( p_mb, p_mb->p_backward, p_mb->ppi_field_select[1][1], 1,\
684 p_mb->pppi_motion_vectors[1][1][0], \
685 p_mb->pppi_motion_vectors[1][1][1] >> 1, \
686 i_l_stride, i_c_stride, 8, 0, 0 ); \
690 static void vdec_MotionFrameField420( macroblock_t * p_mb )
692 FRAMEFIELD( Motion420 )
695 static void vdec_MotionFrameField422( macroblock_t * p_mb )
697 //FRAMEFIELD( Motion422 )
700 static void vdec_MotionFrameField444( macroblock_t * p_mb )
702 //FRAMEFIELD( Motion444 )
705 /*****************************************************************************
706 * vdec_MotionFrameDMVXXX?? : motion compensation for dmv motion type (frame)
707 *****************************************************************************/
708 #define FRAMEDMV( MOTION ) \
710 /* This is necessarily a MOTION_FORWARD only macroblock, in a P \
713 /* predict top field from top field */ \
714 MOTION( p_mb, p_mb->p_forward, 0, 0, \
715 p_mb->pppi_motion_vectors[0][0][0], \
716 p_mb->pppi_motion_vectors[0][0][1], \
717 /* XXX?? XXX?? >> 1 ? */ \
718 p_mb->i_l_stride << 1, p_mb->i_c_stride << 1, 8, 0, 0 ); \
720 /* predict and add to top field from bottom field */ \
721 MOTION( p_mb, p_mb->p_forward, 1, 0, \
722 p_mb->ppi_dmv[0][0], p_mb->ppi_dmv[0][1], \
723 p_mb->i_l_stride << 1, p_mb->i_c_stride << 1, 8, 0, 1 ); \
725 /* predict bottom field from bottom field */ \
726 MOTION( p_mb, p_mb->p_forward, 1, 1, \
727 p_mb->pppi_motion_vectors[0][0][0], \
728 p_mb->pppi_motion_vectors[0][0][1], \
729 /* XXX?? XXX?? >> 1 ? */ \
730 p_mb->i_l_stride << 1, p_mb->i_c_stride << 1, 8, 0, 0 ); \
732 /* predict and add to bottom field from top field */ \
733 MOTION( p_mb, p_mb->p_forward, 1, 0, \
734 p_mb->ppi_dmv[1][0], p_mb->ppi_dmv[1][1], \
735 p_mb->i_l_stride << 1, p_mb->i_c_stride << 1, 8, 0, 1 ); \
738 static void vdec_MotionFrameDMV420( macroblock_t * p_mb )
740 FRAMEDMV( Motion420 )
743 static void vdec_MotionFrameDMV422( macroblock_t * p_mb )
745 //FRAMEDMV( Motion422 )
748 static void vdec_MotionFrameDMV444( macroblock_t * p_mb )
750 //FRAMEDMV( Motion444 )