*****************************************************************************/
static void __inline__ MotionComponent( yuv_data_t * p_src, yuv_data_t * p_dest,
int i_width, int i_height, int i_x_step,
- int i_select )
+ int i_x_stride, int i_select )
{
int i_x, i_y, i_x1, i_y1;
unsigned int i_dummy;
{
i_dummy = p_dest[i_x+i_x1]
+ ((unsigned int)(p_src[i_x+i_x1] + 1
- + p_src[i_x+i_x1 + i_x_step]) >> 1);
+ + p_src[i_x+i_x1 + i_x_stride]) >> 1);
p_dest[i_x + i_x1] = (i_dummy + 1) >> 1;
}
}
for( i_x1 = 0; i_x1 < 8; i_x1++ )
{
p_dest[i_x+i_x1] = (unsigned int)(p_src[i_x+i_x1] + 1
- + p_src[i_x+i_x1 + i_x_step])
+ + p_src[i_x+i_x1 + i_x_stride])
>> 1;
}
}
+ ((unsigned int)(
p_src[i_x+i_x1]
+ p_src[i_x+i_x1 + 1]
- + p_src[i_x+i_x1 + i_x_step]
- + p_src[i_x+i_x1 + i_x_step + 1]
+ + p_src[i_x+i_x1 + i_x_stride]
+ + p_src[i_x+i_x1 + i_x_stride + 1]
+ 2) >> 2);
p_dest[i_x + i_x1] = (i_dummy + 1) >> 1;
}
= ((unsigned int)(
p_src[i_x+i_x1]
+ p_src[i_x+i_x1 + 1]
- + p_src[i_x+i_x1 + i_x_step]
- + p_src[i_x+i_x1 + i_x_step + 1]
+ + p_src[i_x+i_x1 + i_x_stride]
+ + p_src[i_x+i_x1 + i_x_stride + 1]
+ 2) >> 2);
}
}
int i_height, i_offset;
int i_mv_x, i_mv_y;
boolean_t b_average;
+ int i_l_x_step, i_c_x_step;
} motion_arg_t;
/*****************************************************************************
*****************************************************************************/
void vdec_MotionFieldField( macroblock_t * p_mb )
{
-#if 0
+#if 1
motion_arg_t args;
args.i_height = 16;
args.b_average = 0;
args.b_dest_field = p_mb->b_motion_field;
args.i_offset = 0;
+ args.i_l_x_step = p_mb->i_l_stride;
+ args.i_c_x_step = p_mb->i_c_stride;
if( p_mb->i_mb_type & MB_MOTION_FORWARD )
{
*****************************************************************************/
void vdec_MotionField16x8( macroblock_t * p_mb )
{
-#if 0
+#if 1
motion_arg_t args;
args.i_height = 8;
args.b_average = 0;
args.b_dest_field = p_mb->b_motion_field;
args.i_offset = 0;
+ args.i_l_x_step = p_mb->i_l_stride;
+ args.i_c_x_step = p_mb->i_c_stride;
if( p_mb->i_mb_type & MB_MOTION_FORWARD )
{
args.i_height = 16;
args.b_average = 0;
args.i_offset = 0;
+ args.i_l_x_step = p_mb->i_l_stride;
+ args.i_c_x_step = p_mb->i_c_stride;
if( p_mb->i_mb_type & MB_MOTION_FORWARD )
{
args.i_height = 8;
args.b_average = 0;
args.i_offset = 0;
- p_mb->i_l_stride <<= 1;
- p_mb->i_c_stride <<= 1;
+ args.i_l_x_step = p_mb->i_l_stride << 1;
+ args.i_c_x_step = p_mb->i_c_stride << 1;
if( p_mb->i_mb_type & MB_MOTION_FORWARD )
{
args.b_source_field = p_mb->ppi_field_select[0][0];
args.b_dest_field = 0;
args.i_mv_x = p_mb->pppi_motion_vectors[0][0][0];
- args.i_mv_y = p_mb->pppi_motion_vectors[0][0][1] >> 1;
+ args.i_mv_y = p_mb->pppi_motion_vectors[0][0][1];
p_mb->pf_chroma_motion( p_mb, &args );
#endif
#if 1
args.b_source_field = p_mb->ppi_field_select[1][0];
args.b_dest_field = 1;
- args.i_mv_x = p_mb->pppi_motion_vectors[0][0][0];
- args.i_mv_y = p_mb->pppi_motion_vectors[0][0][1] >> 1;
+ args.i_mv_x = p_mb->pppi_motion_vectors[1][0][0];
+ args.i_mv_y = p_mb->pppi_motion_vectors[1][0][1];
p_mb->pf_chroma_motion( p_mb, &args );
#endif
args.b_average = 1;
args.b_source_field = p_mb->ppi_field_select[0][1];
args.b_dest_field = 0;
args.i_mv_x = p_mb->pppi_motion_vectors[0][1][0];
- args.i_mv_y = p_mb->pppi_motion_vectors[0][1][1] >> 1;
+ args.i_mv_y = p_mb->pppi_motion_vectors[0][1][1];
p_mb->pf_chroma_motion( p_mb, &args );
args.b_source_field = p_mb->ppi_field_select[1][1];
args.b_dest_field = 1;
args.i_mv_x = p_mb->pppi_motion_vectors[1][1][0];
- args.i_mv_y = p_mb->pppi_motion_vectors[1][1][1] >> 1;
+ args.i_mv_y = p_mb->pppi_motion_vectors[1][1][1];
p_mb->pf_chroma_motion( p_mb, &args );
}
#endif
motion_arg_t args;
int ppi_dmv[2][2];
- p_mb->i_l_stride <<= 1;
- p_mb->i_c_stride <<= 1;
+ args.i_l_x_step = p_mb->i_l_stride << 1;
+ args.i_c_x_step = p_mb->i_c_stride << 1;
args.i_height = 8;
args.b_average = 0;
args.b_dest_field = 0;
/* prediction width and height */
16, p_motion->i_height,
/* step */
- p_mb->i_l_stride,
+ p_motion->i_l_x_step, p_mb->i_l_stride,
/* select */
(p_motion->b_average << 2)
| ((p_motion->i_mv_y & 1) << 1)
+ (p_mb->i_c_x)
+ (p_mb->i_motion_c_y + p_motion->b_dest_field)
* p_mb->p_picture->i_chroma_width,
- 8, p_motion->i_height >> 1, p_mb->i_c_stride,
+ 8, p_motion->i_height >> 1, p_motion->i_c_x_step,
+ p_mb->i_c_stride,
(p_motion->b_average << 2)
| (((p_motion->i_mv_y/2) & 1) << 1)
| ((p_motion->i_mv_x/2) & 1) );
+ (p_mb->i_c_x)
+ (p_mb->i_motion_c_y + p_motion->b_dest_field)
* p_mb->p_picture->i_chroma_width,
- 8, p_motion->i_height >> 1, p_mb->i_c_stride,
+ 8, p_motion->i_height >> 1, p_motion->i_c_x_step,
+ p_mb->i_c_stride,
(p_motion->b_average << 2)
| (((p_motion->i_mv_y/2) & 1) << 1)
| ((p_motion->i_mv_x/2) & 1) );
*****************************************************************************/
void vdec_Motion422( macroblock_t * p_mb, motion_arg_t * p_motion )
{
+#if 0
/* Luminance */
MotionComponent( p_motion->p_source->p_y
+ (p_mb->i_l_x + (p_motion->i_mv_x >> 1))
(p_motion->b_average << 2)
| ((p_motion->i_mv_y & 1) << 1)
| ((p_motion->i_mv_x/2) & 1) );
+#endif
}
/*****************************************************************************
*****************************************************************************/
void vdec_Motion444( macroblock_t * p_mb, motion_arg_t * p_motion )
{
+#if 0
/* Luminance */
MotionComponent( p_motion->p_source->p_y
+ (p_mb->i_l_x + (p_motion->i_mv_x >> 1))
(p_motion->b_average << 2)
| ((p_motion->i_mv_y & 1) << 1)
| (p_motion->i_mv_x & 1) );
+#endif
}
p_mb->pf_motion = pf_motion[p_vpar->picture.b_frame_structure]
[p_vpar->mb.i_motion_type];
}
+
p_vpar->mb.i_mv_count = ppi_mv_count[p_vpar->picture.b_frame_structure]
[p_vpar->mb.i_motion_type];
p_vpar->mb.i_mv_format = ppi_mv_format[p_vpar->picture.b_frame_structure]
static int pi_dc_dct_reinit[4] = {128,256,512,1024};
static f_motion_t pf_motion_skipped[4] = {NULL, vdec_MotionFieldField,
vdec_MotionFieldField, vdec_MotionFrameFrame};
-fprintf(stderr, "On sauuuute !\n");
+
/* Reset DC predictors (7.2.1). */
p_vpar->slice.pi_dc_dct_pred[0] = p_vpar->slice.pi_dc_dct_pred[1]
= p_vpar->slice.pi_dc_dct_pred[2]
/* Motion type is picture structure. */
p_mb->pf_motion = pf_motion_skipped[p_vpar->picture.i_structure];
p_mb->i_mb_type = MB_MOTION_FORWARD;
+ memset( p_mb->pppi_motion_vectors, 0, 8*sizeof(int) );
/* Set the field we use for motion compensation */
p_mb->ppi_field_select[0][0] = p_mb->ppi_field_select[0][1]
p_mb->ppi_blocks[i_b][i_pos] = b_sign ? -i_level : i_level;
}
fprintf( stderr, "Non intra MPEG2 end (%d)\n", i_b );
-exit(0);
//p_vpar->picture.b_error = 1;
}
}
fprintf( stderr, "MPEG2 end (%d)\n", i_b );
-exit(0);
//p_vpar->b_error = 1;
}