*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
*
- * Authors:
+ * Authors: Christophe Massiot <massiot@via.ecp.fr>
+ * Jean-Marc Dressler <polux@via.ecp.fr>
+ * Michel Lespinasse <walken@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include "intf_msg.h"
-#include "input.h"
-#include "decoder_fifo.h"
+#include "stream_control.h"
+#include "input_ext-dec.h"
+
#include "video.h"
#include "video_output.h"
break; \
case 2: \
MotionComponent_x_Y_copy_##width##_##height (p_src, p_dest, \
- i_stride, \
- i_step); \
+ i_stride); \
break; \
case 3: \
MotionComponent_X_Y_copy_##width##_##height (p_src, p_dest, \
- i_stride, \
- i_step); \
+ i_stride); \
break; \
} \
} \
break; \
case 2: \
MotionComponent_x_Y_avg_##width##_##height (p_src, p_dest, \
- i_stride, \
- i_step); \
+ i_stride); \
break; \
case 3: \
MotionComponent_X_Y_avg_##width##_##height (p_src, p_dest, \
- i_stride, \
- i_step); \
+ i_stride); \
break; \
} \
} \
int i_height, /* (explicit) height of block */
int i_stride, /* number of coeffs to jump
* between each predicted line */
- int i_step, /* number of coeffs to jump to
- * go to the next line of the
- * field */
int i_select, /* half-pel vectors */
boolean_t b_average /* (explicit) averaging of several
* predictions */ )
i_source_offset = (p_mb->i_l_x + (i_mv_x >> 1))
+ (p_mb->i_motion_l_y + i_offset
- + (i_mv_y >> 1)
+ b_source_field)
- * p_mb->p_picture->i_width;
+ * p_mb->p_picture->i_width
+ + (i_mv_y >> 1) * i_l_stride;
if( i_source_offset >= p_source->i_width * p_source->i_height )
{
- intf_ErrMsg( "vdec error: bad motion vector\n" );
+ intf_ErrMsg( "vdec error: bad motion vector (lum)\n" );
return;
}
/* destination */
p_mb->p_picture->p_y
+ (p_mb->i_l_x)
- + (p_mb->i_motion_l_y + b_dest_field)
+ + (p_mb->i_motion_l_y + b_dest_field + i_offset)
* p_mb->p_picture->i_width,
/* prediction width and height */
16, i_height,
/* stride */
- i_l_stride, p_mb->i_l_stride,
+ i_l_stride,
/* select */
((i_mv_y & 1) << 1) | (i_mv_x & 1),
b_average );
i_source_offset = (p_mb->i_c_x + ((i_mv_x/2) >> 1))
- + ((p_mb->i_motion_c_y + (i_offset >> 1)
- + ((i_mv_y/2) >> 1))
+ + (p_mb->i_motion_c_y + (i_offset >> 1)
+ b_source_field)
- * p_mb->p_picture->i_chroma_width;
+ * p_mb->p_picture->i_chroma_width
+ + ((i_mv_y/2) >> 1) * i_c_stride;
if( i_source_offset >= (p_source->i_width * p_source->i_height) / 4 )
{
- intf_ErrMsg( "vdec error: bad motion vector\n" );
+ intf_ErrMsg( "vdec error: bad motion vector (chroma)\n" );
return;
}
i_dest_offset = (p_mb->i_c_x)
- + (p_mb->i_motion_c_y + b_dest_field)
+ + (p_mb->i_motion_c_y + b_dest_field
+ + (i_offset >> 1))
* p_mb->p_picture->i_chroma_width;
i_c_height = i_height >> 1;
i_c_select = (((i_mv_y/2) & 1) << 1) | ((i_mv_x/2) & 1);
+ i_source_offset,
p_mb->p_picture->p_u
+ i_dest_offset,
- 8, i_c_height, i_c_stride, p_mb->i_c_stride,
+ 8, i_c_height, i_c_stride,
i_c_select, b_average );
/* Chrominance Cb */
+ i_source_offset,
p_mb->p_picture->p_v
+ i_dest_offset,
- 8, i_c_height, i_c_stride, p_mb->i_c_stride,
+ 8, i_c_height, i_c_stride,
i_c_select, b_average );
}
p_source->p_y
+ (p_mb->i_l_x + (i_mv_x >> 1))
+ (p_mb->i_motion_l_y + i_offset
- + (i_mv_y >> 1)
+ b_source_field)
- * p_mb->p_picture->i_width,
+ * p_mb->p_picture->i_width
+ + (i_mv_y >> 1) * p_mb->i_l_stride,
/* destination */
p_mb->p_picture->p_y
+ (p_mb->i_l_x)
/* prediction width and height */
16, i_height,
/* stride */
- i_l_stride, p_mb->i_l_stride,
+ i_l_stride,
/* select */
((i_mv_y & 1) << 1) | (i_mv_x & 1),
b_average );
i_source_offset = (p_mb->i_c_x + ((i_mv_x/2) >> 1))
- + ((p_mb->i_motion_c_y + (i_offset)
- + ((i_mv_y) >> 1))
+ + (p_mb->i_motion_c_y + i_offset
+ b_source_field)
- * p_mb->p_picture->i_chroma_width;
+ * p_mb->p_picture->i_chroma_width
+ + (i_mv_y) >> 1) * p_mb->i_c_stride;
i_dest_offset = (p_mb->i_c_x)
+ (p_mb->i_motion_c_y + b_dest_field)
* p_mb->p_picture->i_chroma_width;
+ i_source_offset,
p_mb->p_picture->p_u
+ i_dest_offset,
- 8, i_height, i_c_stride, p_mb->i_c_stride,
+ 8, i_height, i_c_stride,
i_c_select, b_average );
/* Chrominance Cb */
+ i_source_offset,
p_mb->p_picture->p_u
+ i_dest_offset,
- 8, i_height, i_c_stride, p_mb->i_c_stride,
+ 8, i_height, i_c_stride,
i_c_select, b_average );
#endif
}
i_source_offset = (p_mb->i_l_x + (i_mv_x >> 1))
+ (p_mb->i_motion_l_y + i_offset
- + (i_mv_y >> 1)
+ b_source_field)
- * p_mb->p_picture->i_width;
+ * p_mb->p_picture->i_width
+ + (i_mv_y >> 1) * p_mb->i_l_stride;
i_dest_offset = (p_mb->i_l_x)
+ (p_mb->i_motion_l_y + b_dest_field)
* p_mb->p_picture->i_width;
+ i_source_offset,
p_mb->p_picture->p_y
+ i_dest_offset,
- 16, i_height, i_l_stride, p_mb->i_l_stride,
+ 16, i_height, i_l_stride,
i_select, b_average );
/* Chrominance Cr */
+ i_source_offset,
p_mb->p_picture->p_u
+ i_dest_offset,
- 16, i_height, i_l_stride, p_mb->i_l_stride,
+ 16, i_height, i_l_stride,
i_select, b_average );
/* Chrominance Cb */
+ i_source_offset,
p_mb->p_picture->p_v
+ i_dest_offset,
- 16, i_height, i_l_stride, p_mb->i_l_stride,
+ 16, i_height, i_l_stride,
i_select, b_average );
#endif
}
* vdec_MotionFieldField : motion compensation for field motion type (field)
*****************************************************************************/
#define FIELDFIELD( MOTION ) \
+{ \
picture_t * p_pred; \
\
if( p_mb->i_mb_type & MB_MOTION_FORWARD ) \
p_mb->pppi_motion_vectors[0][1][0], \
p_mb->pppi_motion_vectors[0][1][1], \
p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 1 ); \
+ } \
} \
\
else /* MB_MOTION_BACKWARD */ \
}
/*****************************************************************************
- * vdec_MotionFieldDMVXXX?? : motion compensation for dmv motion type (field)
+ * vdec_MotionFieldDMVXXX : motion compensation for dmv motion type (field)
*****************************************************************************/
#define FIELDDMV( MOTION ) \
{ \
{ \
MOTION( p_mb, p_mb->p_forward, p_mb->ppi_field_select[0][0], 0, \
p_mb->pppi_motion_vectors[0][0][0], \
- p_mb->pppi_motion_vectors[0][0][1], \
+ p_mb->pppi_motion_vectors[0][0][1] >> 1, \
i_l_stride, i_c_stride, 8, 0, 0 ); \
\
MOTION( p_mb, p_mb->p_forward, p_mb->ppi_field_select[1][0], 1, \
p_mb->pppi_motion_vectors[1][0][0], \
- p_mb->pppi_motion_vectors[1][0][1], \
+ p_mb->pppi_motion_vectors[1][0][1] >> 1, \
i_l_stride, i_c_stride, 8, 0, 0 ); \
\
if( p_mb->i_mb_type & MB_MOTION_BACKWARD ) \
MOTION( p_mb, p_mb->p_backward, \
p_mb->ppi_field_select[0][1], 0, \
p_mb->pppi_motion_vectors[0][1][0], \
- p_mb->pppi_motion_vectors[0][1][1], \
+ p_mb->pppi_motion_vectors[0][1][1] >> 1, \
i_l_stride, i_c_stride, 8, 0, 1 ); \
\
MOTION( p_mb, p_mb->p_backward, \
p_mb->ppi_field_select[1][1], 1, \
p_mb->pppi_motion_vectors[1][1][0], \
- p_mb->pppi_motion_vectors[1][1][1], \
+ p_mb->pppi_motion_vectors[1][1][1] >> 1, \
i_l_stride, i_c_stride, 8, 0, 1 ); \
} \
} \
{ \
MOTION( p_mb, p_mb->p_backward, p_mb->ppi_field_select[0][1], 0,\
p_mb->pppi_motion_vectors[0][1][0], \
- p_mb->pppi_motion_vectors[0][1][1], \
+ p_mb->pppi_motion_vectors[0][1][1] >> 1, \
i_l_stride, i_c_stride, 8, 0, 0 ); \
\
MOTION( p_mb, p_mb->p_backward, p_mb->ppi_field_select[1][1], 1,\
p_mb->pppi_motion_vectors[1][1][0], \
- p_mb->pppi_motion_vectors[1][1][1], \
+ p_mb->pppi_motion_vectors[1][1][1] >> 1, \
i_l_stride, i_c_stride, 8, 0, 0 ); \
} \
} /* FRAMEFIELD */