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;
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;
}
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) * p_mb->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;
}
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)
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->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;
* 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 ) \
{ \
#include "video_parser.h"
#include "video_fifo.h"
-static int i_count = 0;
-
/*
* Welcome to vpar_blocks.c ! Here's where the heavy processor-critical parsing
* task is done. This file is divided in several parts :
/* Calculate block coordinates. */ \
p_mb->p_data[i_b] = p_data1 \
+ pi_y[p_vpar->mb.b_dct_type][i_b] \
- * p_vpar->sequence.i_width \
+ * p_vpar->picture.i_l_stride \
+ pi_x[i_b]; \
\
PARSEERROR \
/* Calculate block coordinates. */ \
p_mb->p_data[i_b] = pp_data[i_b & 1] \
+ pi_y[p_vpar->mb.b_dct_type][i_b] \
- * p_vpar->sequence.i_chroma_width \
+ * p_vpar->picture.i_c_stride \
+ pi_x[i_b]; \
\
PARSEERROR \
yuv_data_t * p_data1;
yuv_data_t * p_data2;
-i_count++;
-
i_inc = MacroblockAddressIncrement( p_vpar );
*pi_mb_address += i_inc;
else
{
/* Try to find an optimized function. */
- if( ppf_parse_mb[p_vpar->picture.i_structure]
+ if( ppf_parse_mb[i_structure]
[p_vpar->picture.i_coding_type] == NULL )
{
intf_ErrMsg( "vpar error: bad ppf_parse_mb function pointer (struct:%d, coding type:%d)\n",
- p_vpar->picture.i_structure, p_vpar->picture.i_coding_type );
+ i_structure, i_coding_type );
}
else
{
- ppf_parse_mb[p_vpar->picture.i_structure]
- [p_vpar->picture.i_coding_type]
+ ppf_parse_mb[i_structure][i_coding_type]
( p_vpar, pi_mb_address, i_mb_address_save,
i_mb_base, b_mpeg2, i_coding_type,
i_chroma_format, i_structure,
while( ((p_vpar->picture.i_coding_type != I_CODING_TYPE
&& p_vpar->picture.i_coding_type != D_CODING_TYPE)
|| !p_vpar->picture.b_error)
- && i_mb_address+i_mb_base < p_vpar->sequence.i_mb_size
+ && i_mb_address < (p_vpar->sequence.i_mb_size
+ >> (p_vpar->picture.i_structure != FRAME_STRUCTURE))
&& !p_vpar->b_die )
{
if( ((i_dummy = ShowBits( &p_vpar->bit_stream, 32 ))