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.9 2001/07/17 09:48:07 massiot 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_ext-plugins.h"
50 #include "modules_export.h"
52 extern int _M( motion_Probe )( probedata_t *p_data );
54 static void vdec_MotionFieldField420 ( macroblock_t * p_mb );
55 static void vdec_MotionFieldField422 ( macroblock_t * p_mb );
56 static void vdec_MotionFieldField444 ( macroblock_t * p_mb );
57 static void vdec_MotionField16x8420 ( macroblock_t * p_mb );
58 static void vdec_MotionField16x8422 ( macroblock_t * p_mb );
59 static void vdec_MotionField16x8444 ( macroblock_t * p_mb );
60 static void vdec_MotionFieldDMV420 ( macroblock_t * p_mb );
61 static void vdec_MotionFieldDMV422 ( macroblock_t * p_mb );
62 static void vdec_MotionFieldDMV444 ( macroblock_t * p_mb );
63 static void vdec_MotionFrameFrame420 ( macroblock_t * p_mb );
64 static void vdec_MotionFrameFrame422 ( macroblock_t * p_mb );
65 static void vdec_MotionFrameFrame444 ( macroblock_t * p_mb );
66 static void vdec_MotionFrameField420 ( macroblock_t * p_mb );
67 static void vdec_MotionFrameField422 ( macroblock_t * p_mb );
68 static void vdec_MotionFrameField444 ( macroblock_t * p_mb );
69 static void vdec_MotionFrameDMV420 ( macroblock_t * p_mb );
70 static void vdec_MotionFrameDMV422 ( macroblock_t * p_mb );
71 static void vdec_MotionFrameDMV444 ( macroblock_t * p_mb );
73 /*****************************************************************************
74 * Functions exported as capabilities. They are declared as static so that
75 * we don't pollute the namespace too much.
76 *****************************************************************************/
77 void _M( motion_getfunctions )( function_list_t * p_function_list )
79 p_function_list->pf_probe = _M( motion_Probe );
81 #define list p_function_list->functions.motion
82 #define motion_functions( yuv ) \
83 list.pf_field_field_##yuv = vdec_MotionFieldField##yuv; \
84 list.pf_field_16x8_##yuv = vdec_MotionField16x8##yuv; \
85 list.pf_field_dmv_##yuv = vdec_MotionFieldDMV##yuv; \
86 list.pf_frame_field_##yuv = vdec_MotionFrameField##yuv; \
87 list.pf_frame_frame_##yuv = vdec_MotionFrameFrame##yuv; \
88 list.pf_frame_dmv_##yuv = vdec_MotionFrameDMV##yuv;
89 motion_functions( 420 )
90 motion_functions( 422 )
91 motion_functions( 444 )
92 #undef motion_functions
98 #define __MotionComponents(width,height) \
99 void _M( MotionComponent_x_y_copy_##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_avg_##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 )();
108 __MotionComponents (16,16) /* 444, 422, 420 */
109 __MotionComponents (16,8) /* 444, 422, 420 */
110 __MotionComponents (8,8) /* 422, 420 */
111 __MotionComponents (8,4) /* 420 */
113 __MotionComponents (8,16) /* 422 */
116 #define ___callTheRightOne(width,height) \
117 if ((i_width == width) && (i_height == height)) \
124 _M( MotionComponent_x_y_copy_##width##_##height )(p_src, \
128 _M( MotionComponent_X_y_copy_##width##_##height )(p_src, \
132 _M( MotionComponent_x_Y_copy_##width##_##height )(p_src, \
136 _M( MotionComponent_X_Y_copy_##width##_##height )(p_src, \
146 _M( MotionComponent_x_y_avg_##width##_##height )(p_src, \
150 _M( MotionComponent_X_y_avg_##width##_##height )(p_src, \
154 _M( MotionComponent_x_Y_avg_##width##_##height )(p_src, \
158 _M( MotionComponent_X_Y_avg_##width##_##height )(p_src, \
165 /*****************************************************************************
166 * vdec_MotionComponent : last stage of motion compensation
167 *****************************************************************************/
168 static __inline__ void MotionComponent(
169 yuv_data_t * p_src, /* source block */
170 yuv_data_t * p_dest, /* dest block */
171 int i_width, /* (explicit) width of block */
172 int i_height, /* (explicit) height of block */
173 int i_stride, /* number of coeffs to jump
174 * between each predicted line */
175 int i_select, /* half-pel vectors */
176 boolean_t b_average /* (explicit) averaging of several
179 ___callTheRightOne (16,16)
180 ___callTheRightOne (16,8)
181 ___callTheRightOne (8,8)
182 ___callTheRightOne (8,4)
184 ___callTheRightOne (8,16)
188 /*****************************************************************************
189 * Motion420 : motion compensation for a 4:2:0 macroblock
190 *****************************************************************************/
191 static __inline__ void Motion420(
192 macroblock_t * p_mb, /* destination macroblock */
193 picture_t * p_source, /* source picture */
194 boolean_t b_source_field, /* source field */
195 boolean_t b_dest_field, /* destination field */
196 int i_mv_x, int i_mv_y, /* motion vector coordinates,
198 int i_l_stride, /* number of coeffs to jump to
199 * go to the next predicted
202 int i_height, /* height of the block to
203 * predict, in luminance
205 int i_offset, /* position of the first
206 * predicted line (explicit) */
207 boolean_t b_average /* (explicit) averaging of
208 * several predictions */ )
210 /* Temporary variables to avoid recalculating things twice */
211 int i_source_offset, i_dest_offset, i_c_height, i_c_select;
213 i_source_offset = (p_mb->i_l_x + (i_mv_x >> 1))
214 + (p_mb->i_motion_l_y + i_offset
216 * p_mb->p_picture->i_width
217 + (i_mv_y >> 1) * i_l_stride;
219 if( i_source_offset >= p_source->i_size )
221 intf_WarnMsg( 2, "Bad motion vector (lum)" );
226 MotionComponent( /* source */
227 p_source->p_y + i_source_offset,
231 + (p_mb->i_motion_l_y + b_dest_field + i_offset)
232 * p_mb->p_picture->i_width,
233 /* prediction width and height */
238 ((i_mv_y & 1) << 1) | (i_mv_x & 1),
241 i_source_offset = (p_mb->i_c_x + ((i_mv_x/2) >> 1))
242 + (p_mb->i_motion_c_y + (i_offset >> 1)
244 * p_mb->p_picture->i_chroma_width
245 + ((i_mv_y/2) >> 1) * i_c_stride;
247 if( i_source_offset >= p_source->i_chroma_size )
249 intf_WarnMsg( 2, "Bad motion vector (chroma)" );
253 i_dest_offset = (p_mb->i_c_x)
254 + (p_mb->i_motion_c_y + b_dest_field
256 * p_mb->p_picture->i_chroma_width;
257 i_c_height = i_height >> 1;
258 i_c_select = (((i_mv_y/2) & 1) << 1) | ((i_mv_x/2) & 1);
261 MotionComponent( p_source->p_u
265 8, i_c_height, i_c_stride,
266 i_c_select, b_average );
269 MotionComponent( p_source->p_v
273 8, i_c_height, i_c_stride,
274 i_c_select, b_average );
277 /*****************************************************************************
278 * Motion422 : motion compensation for a 4:2:2 macroblock
279 *****************************************************************************/
280 static __inline__ void Motion422(
281 macroblock_t * p_mb, /* destination macroblock */
282 picture_t * p_source, /* source picture */
283 boolean_t b_source_field, /* source field */
284 boolean_t b_dest_field, /* destination field */
285 int i_mv_x, int i_mv_y, /* motion vector coordinates,
287 int i_l_stride, /* number of coeffs to jump to
288 * go to the next predicted
291 int i_height, /* height of the block to
292 * predict, in luminance
294 int i_offset, /* position of the first
295 * predicted line (explicit) */
296 boolean_t b_average /* (explicit) averaging of
297 * several predictions */ )
300 int i_source_offset, i_dest_offset, i_c_select;
303 MotionComponent( /* source */
305 + (p_mb->i_l_x + (i_mv_x >> 1))
306 + (p_mb->i_motion_l_y + i_offset
308 * p_mb->p_picture->i_width
309 + (i_mv_y >> 1) * p_mb->i_l_stride,
313 + (p_mb->i_motion_l_y + b_dest_field)
314 * p_mb->p_picture->i_width,
315 /* prediction width and height */
320 ((i_mv_y & 1) << 1) | (i_mv_x & 1),
323 i_source_offset = (p_mb->i_c_x + ((i_mv_x/2) >> 1))
324 + (p_mb->i_motion_c_y + i_offset
326 * p_mb->p_picture->i_chroma_width
327 + (i_mv_y) >> 1) * p_mb->i_c_stride;
328 i_dest_offset = (p_mb->i_c_x)
329 + (p_mb->i_motion_c_y + b_dest_field)
330 * p_mb->p_picture->i_chroma_width;
331 i_c_select = ((i_mv_y & 1) << 1) | ((i_mv_x/2) & 1);
334 MotionComponent( p_source->p_u
338 8, i_height, i_c_stride,
339 i_c_select, b_average );
342 MotionComponent( p_source->p_v
346 8, i_height, i_c_stride,
347 i_c_select, b_average );
351 /*****************************************************************************
352 * Motion444 : motion compensation for a 4:4:4 macroblock
353 *****************************************************************************/
354 static __inline__ void Motion444(
355 macroblock_t * p_mb, /* destination macroblock */
356 picture_t * p_source, /* source picture */
357 boolean_t b_source_field, /* source field */
358 boolean_t b_dest_field, /* destination field */
359 int i_mv_x, int i_mv_y, /* motion vector coordinates,
361 int i_l_stride, /* number of coeffs to jump to
362 * go to the next predicted
365 int i_height, /* height of the block to
366 * predict, in luminance
368 int i_offset, /* position of the first
369 * predicted line (explicit) */
370 boolean_t b_average /* (explicit) averaging of
371 * several predictions */ )
374 int i_source_offset, i_dest_offset, i_select;
376 i_source_offset = (p_mb->i_l_x + (i_mv_x >> 1))
377 + (p_mb->i_motion_l_y + i_offset
379 * p_mb->p_picture->i_width
380 + (i_mv_y >> 1) * p_mb->i_l_stride;
381 i_dest_offset = (p_mb->i_l_x)
382 + (p_mb->i_motion_l_y + b_dest_field)
383 * p_mb->p_picture->i_width;
384 i_select = ((i_mv_y & 1) << 1) | (i_mv_x & 1);
388 MotionComponent( p_source->p_y
392 16, i_height, i_l_stride,
393 i_select, b_average );
396 MotionComponent( p_source->p_u
400 16, i_height, i_l_stride,
401 i_select, b_average );
404 MotionComponent( p_source->p_v
408 16, i_height, i_l_stride,
409 i_select, b_average );
413 /*****************************************************************************
414 * vdec_MotionFieldField : motion compensation for field motion type (field)
415 *****************************************************************************/
416 #define FIELDFIELD( MOTION ) \
418 picture_t * p_pred; \
420 if( p_mb->i_mb_type & MB_MOTION_FORWARD ) \
422 if( p_mb->b_P_second \
423 && (p_mb->b_motion_field != p_mb->ppi_field_select[0][0]) )\
424 p_pred = p_mb->p_picture; \
426 p_pred = p_mb->p_forward; \
428 MOTION( p_mb, p_pred, p_mb->ppi_field_select[0][0], \
429 p_mb->b_motion_field, \
430 p_mb->pppi_motion_vectors[0][0][0], \
431 p_mb->pppi_motion_vectors[0][0][1], \
432 p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 0 ); \
434 if( p_mb->i_mb_type & MB_MOTION_BACKWARD ) \
436 MOTION( p_mb, p_mb->p_backward, \
437 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, 1 ); \
445 else /* MB_MOTION_BACKWARD */ \
447 MOTION( p_mb, p_mb->p_backward, p_mb->ppi_field_select[0][1], \
448 p_mb->b_motion_field, \
449 p_mb->pppi_motion_vectors[0][1][0], \
450 p_mb->pppi_motion_vectors[0][1][1], \
451 p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 0 ); \
455 static void vdec_MotionFieldField420( macroblock_t * p_mb )
457 FIELDFIELD( Motion420 )
460 static void vdec_MotionFieldField422( macroblock_t * p_mb )
462 //FIELDFIELD( Motion422 )
465 static void vdec_MotionFieldField444( macroblock_t * p_mb )
467 //FIELDFIELD( Motion444 )
470 /*****************************************************************************
471 * vdec_MotionField16x8XXX: motion compensation for 16x8 motion type (field)
472 *****************************************************************************/
473 #define FIELD16X8( MOTION ) \
475 picture_t * p_pred; \
477 if( p_mb->i_mb_type & MB_MOTION_FORWARD ) \
479 if( p_mb->b_P_second \
480 && (p_mb->b_motion_field != p_mb->ppi_field_select[0][0]) )\
481 p_pred = p_mb->p_picture; \
483 p_pred = p_mb->p_forward; \
485 MOTION( p_mb, p_pred, p_mb->ppi_field_select[0][0], \
486 p_mb->b_motion_field, \
487 p_mb->pppi_motion_vectors[0][0][0], \
488 p_mb->pppi_motion_vectors[0][0][1], \
489 p_mb->i_l_stride, p_mb->i_c_stride, 8, 0, 0 ); \
491 if( p_mb->b_P_second \
492 && (p_mb->b_motion_field != p_mb->ppi_field_select[1][0]) )\
493 p_pred = p_mb->p_picture; \
495 p_pred = p_mb->p_forward; \
497 MOTION( p_mb, p_pred, p_mb->ppi_field_select[1][0], \
498 p_mb->b_motion_field, \
499 p_mb->pppi_motion_vectors[1][0][0], \
500 p_mb->pppi_motion_vectors[1][0][1], \
501 p_mb->i_l_stride, p_mb->i_c_stride, 8, 8, 0 ); \
503 if( p_mb->i_mb_type & MB_MOTION_BACKWARD ) \
505 MOTION( p_mb, p_mb->p_backward, \
506 p_mb->ppi_field_select[0][1], \
507 p_mb->b_motion_field, \
508 p_mb->pppi_motion_vectors[0][1][0], \
509 p_mb->pppi_motion_vectors[0][1][1], \
510 p_mb->i_l_stride, p_mb->i_c_stride, 8, 0, 1 ); \
512 MOTION( p_mb, p_mb->p_backward, \
513 p_mb->ppi_field_select[1][1], \
514 p_mb->b_motion_field, \
515 p_mb->pppi_motion_vectors[1][1][0], \
516 p_mb->pppi_motion_vectors[1][1][1], \
517 p_mb->i_l_stride, p_mb->i_c_stride, 8, 8, 1 ); \
521 else /* MB_MOTION_BACKWARD */ \
523 MOTION( p_mb, p_mb->p_backward, p_mb->ppi_field_select[0][1], \
524 p_mb->b_motion_field, \
525 p_mb->pppi_motion_vectors[0][1][0], \
526 p_mb->pppi_motion_vectors[0][1][1], \
527 p_mb->i_l_stride, p_mb->i_c_stride, 8, 0, 0 ); \
529 MOTION( p_mb, p_mb->p_backward, p_mb->ppi_field_select[1][1], \
530 p_mb->b_motion_field, \
531 p_mb->pppi_motion_vectors[1][1][0], \
532 p_mb->pppi_motion_vectors[1][1][1], \
533 p_mb->i_l_stride, p_mb->i_c_stride, 8, 8, 0 ); \
537 static void vdec_MotionField16x8420( macroblock_t * p_mb )
539 FIELD16X8( Motion420 )
542 static void vdec_MotionField16x8422( macroblock_t * p_mb )
544 //FIELD16X8( Motion422 )
547 static void vdec_MotionField16x8444( macroblock_t * p_mb )
549 //FIELD16X8( Motion444 )
552 /*****************************************************************************
553 * vdec_MotionFieldDMVXXX : motion compensation for dmv motion type (field)
554 *****************************************************************************/
555 #define FIELDDMV( MOTION ) \
557 /* This is necessarily a MOTION_FORWARD only macroblock, in a P \
559 picture_t * p_pred; \
561 /* predict from field of same parity */ \
562 MOTION( p_mb, p_mb->p_forward, \
563 p_mb->b_motion_field, p_mb->b_motion_field, \
564 p_mb->pppi_motion_vectors[0][0][0], \
565 p_mb->pppi_motion_vectors[0][0][1], \
566 p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 0 ); \
568 if( p_mb->b_P_second ) \
569 p_pred = p_mb->p_picture; \
571 p_pred = p_mb->p_forward; \
573 /* predict from field of opposite parity */ \
574 MOTION( p_mb, p_pred, !p_mb->b_motion_field, p_mb->b_motion_field, \
575 p_mb->ppi_dmv[0][0], p_mb->ppi_dmv[0][1], \
576 p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 1 ); \
579 static void vdec_MotionFieldDMV420( macroblock_t * p_mb )
581 FIELDDMV( Motion420 )
584 static void vdec_MotionFieldDMV422( macroblock_t * p_mb )
586 //FIELDDMV( Motion422 )
589 static void vdec_MotionFieldDMV444( macroblock_t * p_mb )
591 //FIELDDMV( Motion444 )
594 /*****************************************************************************
595 * vdec_MotionFrameFrameXXX?? : motion compensation for frame motion type (frame)
596 *****************************************************************************/
597 #define FRAMEFRAME( MOTION ) \
599 if( p_mb->i_mb_type & MB_MOTION_FORWARD ) \
601 MOTION( p_mb, p_mb->p_forward, 0, 0, \
602 p_mb->pppi_motion_vectors[0][0][0], \
603 p_mb->pppi_motion_vectors[0][0][1], \
604 p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 0 ); \
606 if( p_mb->i_mb_type & MB_MOTION_BACKWARD ) \
608 MOTION( p_mb, p_mb->p_backward, 0, 0, \
609 p_mb->pppi_motion_vectors[0][1][0], \
610 p_mb->pppi_motion_vectors[0][1][1], \
611 p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 1 ); \
615 else /* MB_MOTION_BACKWARD */ \
617 MOTION( p_mb, p_mb->p_backward, 0, 0, \
618 p_mb->pppi_motion_vectors[0][1][0], \
619 p_mb->pppi_motion_vectors[0][1][1], \
620 p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 0 ); \
624 static void vdec_MotionFrameFrame420( macroblock_t * p_mb )
626 FRAMEFRAME( Motion420 )
629 static void vdec_MotionFrameFrame422( macroblock_t * p_mb )
631 //FRAMEFRAME( Motion422 )
634 static void vdec_MotionFrameFrame444( macroblock_t * p_mb )
636 //FRAMEFRAME( Motion444 )
639 /*****************************************************************************
640 * vdec_MotionFrameFieldXXX?? : motion compensation for field motion type (frame)
641 *****************************************************************************/
642 #define FRAMEFIELD( MOTION ) \
644 int i_l_stride = p_mb->i_l_stride << 1; \
645 int i_c_stride = p_mb->i_c_stride << 1; \
647 if( p_mb->i_mb_type & MB_MOTION_FORWARD ) \
649 MOTION( p_mb, p_mb->p_forward, p_mb->ppi_field_select[0][0], 0, \
650 p_mb->pppi_motion_vectors[0][0][0], \
651 p_mb->pppi_motion_vectors[0][0][1] >> 1, \
652 i_l_stride, i_c_stride, 8, 0, 0 ); \
654 MOTION( p_mb, p_mb->p_forward, p_mb->ppi_field_select[1][0], 1, \
655 p_mb->pppi_motion_vectors[1][0][0], \
656 p_mb->pppi_motion_vectors[1][0][1] >> 1, \
657 i_l_stride, i_c_stride, 8, 0, 0 ); \
659 if( p_mb->i_mb_type & MB_MOTION_BACKWARD ) \
661 MOTION( p_mb, p_mb->p_backward, \
662 p_mb->ppi_field_select[0][1], 0, \
663 p_mb->pppi_motion_vectors[0][1][0], \
664 p_mb->pppi_motion_vectors[0][1][1] >> 1, \
665 i_l_stride, i_c_stride, 8, 0, 1 ); \
667 MOTION( p_mb, p_mb->p_backward, \
668 p_mb->ppi_field_select[1][1], 1, \
669 p_mb->pppi_motion_vectors[1][1][0], \
670 p_mb->pppi_motion_vectors[1][1][1] >> 1, \
671 i_l_stride, i_c_stride, 8, 0, 1 ); \
675 else /* MB_MOTION_BACKWARD only */ \
677 MOTION( p_mb, p_mb->p_backward, p_mb->ppi_field_select[0][1], 0,\
678 p_mb->pppi_motion_vectors[0][1][0], \
679 p_mb->pppi_motion_vectors[0][1][1] >> 1, \
680 i_l_stride, i_c_stride, 8, 0, 0 ); \
682 MOTION( p_mb, p_mb->p_backward, p_mb->ppi_field_select[1][1], 1,\
683 p_mb->pppi_motion_vectors[1][1][0], \
684 p_mb->pppi_motion_vectors[1][1][1] >> 1, \
685 i_l_stride, i_c_stride, 8, 0, 0 ); \
689 static void vdec_MotionFrameField420( macroblock_t * p_mb )
691 FRAMEFIELD( Motion420 )
694 static void vdec_MotionFrameField422( macroblock_t * p_mb )
696 //FRAMEFIELD( Motion422 )
699 static void vdec_MotionFrameField444( macroblock_t * p_mb )
701 //FRAMEFIELD( Motion444 )
704 /*****************************************************************************
705 * vdec_MotionFrameDMVXXX?? : motion compensation for dmv motion type (frame)
706 *****************************************************************************/
707 #define FRAMEDMV( MOTION ) \
709 /* This is necessarily a MOTION_FORWARD only macroblock, in a P \
712 /* predict top field from top field */ \
713 MOTION( p_mb, p_mb->p_forward, 0, 0, \
714 p_mb->pppi_motion_vectors[0][0][0], \
715 p_mb->pppi_motion_vectors[0][0][1], \
716 /* XXX?? XXX?? >> 1 ? */ \
717 p_mb->i_l_stride << 1, p_mb->i_c_stride << 1, 8, 0, 0 ); \
719 /* predict and add to top field from bottom field */ \
720 MOTION( p_mb, p_mb->p_forward, 1, 0, \
721 p_mb->ppi_dmv[0][0], p_mb->ppi_dmv[0][1], \
722 p_mb->i_l_stride << 1, p_mb->i_c_stride << 1, 8, 0, 1 ); \
724 /* predict bottom field from bottom field */ \
725 MOTION( p_mb, p_mb->p_forward, 1, 1, \
726 p_mb->pppi_motion_vectors[0][0][0], \
727 p_mb->pppi_motion_vectors[0][0][1], \
728 /* XXX?? XXX?? >> 1 ? */ \
729 p_mb->i_l_stride << 1, p_mb->i_c_stride << 1, 8, 0, 0 ); \
731 /* predict and add to bottom field from top field */ \
732 MOTION( p_mb, p_mb->p_forward, 1, 0, \
733 p_mb->ppi_dmv[1][0], p_mb->ppi_dmv[1][1], \
734 p_mb->i_l_stride << 1, p_mb->i_c_stride << 1, 8, 0, 1 ); \
737 static void vdec_MotionFrameDMV420( macroblock_t * p_mb )
739 FRAMEDMV( Motion420 )
742 static void vdec_MotionFrameDMV422( macroblock_t * p_mb )
744 //FRAMEDMV( Motion422 )
747 static void vdec_MotionFrameDMV444( macroblock_t * p_mb )
749 //FRAMEDMV( Motion444 )