Commit e229f269 authored by Christophe Massiot's avatar Christophe Massiot

Suite du video_parser et du video_decoder.

parent ce68167e
/*****************************************************************************
* video_decoder.h : video decoder thread
* (c)1999 VideoLAN
*****************************************************************************
*****************************************************************************
* Requires:
* "config.h"
* "common.h"
* "mtime.h"
* "vlc_thread.h"
* "input.h"
* "video.h"
* "video_output.h"
* "decoder_fifo.h"
*****************************************************************************/
/*****************************************************************************
* vdec_thread_t: video decoder thread descriptor
*****************************************************************************
* ??
*****************************************************************************/
typedef struct vdec_thread_s
{
/* Thread properties and locks */
boolean_t b_die; /* `die' flag */
boolean_t b_run; /* `run' flag */
boolean_t b_error; /* `error' flag */
boolean_t b_active; /* `active' flag */
vlc_thread_t thread_id; /* id for thread functions */
/* Thread configuration */
/* ?? */
/*??*/
// int *pi_status;
/* Input properties */
video_parser_t * p_vpar; /* video_parser thread */
#ifdef STATS
/* Statistics */
count_t c_loops; /* number of loops */
count_t c_idle_loops; /* number of idle loops */
count_t c_decoded_pictures; /* number of pictures decoded */
count_t c_decoded_i_pictures; /* number of I pictures decoded */
count_t c_decoded_p_pictures; /* number of P pictures decoded */
count_t c_decoded_b_pictures; /* number of B pictures decoded */
#endif
} vdec_thread_t;
/*****************************************************************************
* Prototypes
*****************************************************************************/
/* Thread management functions */
vdec_thread_t * vdec_CreateThread ( vpar_thread_t *p_vpar /*, int *pi_status */ );
void vdec_DestroyThread ( vdec_thread_t *p_vdec /*, int *pi_status */ );
/* Time management functions */
/* ?? */
/* Dynamic thread settings */
/* ?? */
......@@ -29,7 +29,7 @@
/*****************************************************************************
* video_fifo_t
*****************************************************************************
* This rotative FIFO contains undecoded pictures that are to be decoded
* This rotative FIFO contains undecoded macroblocks that are to be decoded
*****************************************************************************/
typedef struct video_fifo_s
{
......@@ -37,7 +37,7 @@ typedef struct video_fifo_s
vlc_cond_t wait; /* fifo data conditional variable */
/* buffer is an array of undec_picture_t pointers */
undec_picture_t * buffer[VFIFO_SIZE + 1];
macroblock_t * buffer[VFIFO_SIZE + 1];
int i_start;
int i_end;
......@@ -48,22 +48,22 @@ typedef struct video_fifo_s
* video_buffer_t
*****************************************************************************
* This structure enables the parser to maintain a list of free
* undec_picture_t structures
* macroblock_t structures
*****************************************************************************/
typedef struct video_buffer_s
{
vlc_mutex_t lock; /* buffer data lock */
undec_picture_t p_undec_p[VFIFO_SIZE + 1];
undec_picture_t * pp_undec_free[VFIFO_SIZE+1]; /* this is a LIFO */
macroblock_t p_macroblocks[VFIFO_SIZE + 1];
macroblock_t * pp_mb_free[VFIFO_SIZE+1]; /* this is a LIFO */
int i_index;
} video_buffer_t;
/*****************************************************************************
* Prototypes
*****************************************************************************/
undec_picture_t * vpar_GetPicture( video_fifo_t * p_fifo );
undec_picture_t * vpar_NewPicture( video_fifo_t * p_fifo );
void vpar_DecodePicture( video_fifo_t * p_fifo, undec_picture_t * p_undec_p );
void vpar_ReleasePicture( video_fifo_t * p_fifo, undec_picture_t * p_undec_p );
void vpar_DestroyPicture( video_fifo_t * p_fifo, undec_picture_t * p_undec_p );
macroblock_t * vpar_GetMacroblock( video_fifo_t * p_fifo );
macroblock_t * vpar_NewMacroblock( video_fifo_t * p_fifo );
void vpar_DecodeMacroblock( video_fifo_t * p_fifo, macroblock_t * p_mb );
void vpar_ReleaseMacroblock( video_fifo_t * p_fifo, macroblock_t * p_mb );
void vpar_DestroyMacroblock( video_fifo_t * p_fifo, macroblock_t * p_mb );
/*******************************************************************************
/*****************************************************************************
* video_parser.h : video parser thread
* (c)1999 VideoLAN
*******************************************************************************
*******************************************************************************
*****************************************************************************
*****************************************************************************
* Requires:
* "config.h"
* "common.h"
......@@ -13,44 +13,22 @@
* "video_output.h"
* "decoder_fifo.h"
* "video_fifo.h"
*******************************************************************************/
* "vpar_headers.h"
*****************************************************************************/
/*******************************************************************************
* sequence_t : sequence descriptor
*******************************************************************************
* ??
*******************************************************************************/
typedef struct sequence_s
{
u16 i_height, i_width;
u16 i_mb_height, i_mb_width;
unsigned int i_aspect_ratio;
double d_frame_rate;
unsigned int i_chroma_format;
boolean_t b_mpeg2;
boolean_t b_progressive;
/* Parser context */
picture_t * p_forward, p_backward;
pel_lookup_table_t * p_frame_lum_lookup, p_field_lum_lookup;
pel_lookup_table_t * p_frame_chroma_lookup, p_field_chroma_lookup;
quant_matrix_t intra_quant, nonintra_quant;
quant_matrix_t chroma_intra_quant, chroma_nonintra_quant;
} sequence_t;
/*******************************************************************************
/*****************************************************************************
* vpar_thread_t: video parser thread descriptor
*******************************************************************************
*****************************************************************************
* ??
*******************************************************************************/
*****************************************************************************/
typedef struct vpar_thread_s
{
/* Thread properties and locks */
boolean_t b_die; /* `die' flag */
boolean_t b_run; /* `run' flag */
boolean_t b_error; /* `error' flag */
boolean_t b_active; /* `active' flag */
vlc_thread_t thread_id; /* id for thread functions */
boolean_t b_die; /* `die' flag */
boolean_t b_run; /* `run' flag */
boolean_t b_error; /* `error' flag */
boolean_t b_active; /* `active' flag */
vlc_thread_t thread_id; /* id for thread functions */
/* Thread configuration */
/* ?? */
......@@ -59,67 +37,45 @@ typedef struct vpar_thread_s
/* Input properties */
decoder_fifo_t fifo; /* PES input fifo */
decoder_fifo_t fifo; /* PES input fifo */
/* The bit stream structure handles the PES stream at the bit level */
bit_stream_t bit_stream;
/* Output properties */
vout_thread_t * p_vout; /* video output thread */
int i_stream; /* video stream id */
vout_thread_t * p_vout; /* video output thread */
int i_stream; /* video stream id */
/* Decoder properties */
struct vdec_thread_s * p_vdec[MAX_VDEC];
struct vdec_thread_s * p_vdec[NB_VDEC];
video_fifo_t vfifo;
video_buffer_t vbuffer;
/* Parser properties */
sequence_t sequence;
sequence_t sequence;
picture_parsing_t picture;
slice_parsing_t slice;
macroblock_parsing_t mb;
#ifdef STATS
/* Statistics */
count_t c_loops; /* number of loops */
count_t c_idle_loops; /* number of idle loops */
count_t c_sequences; /* number of sequences */
count_t c_pictures; /* number of pictures read */
count_t c_i_pictures; /* number of I pictures read */
count_t c_p_pictures; /* number of P pictures read */
count_t c_b_pictures; /* number of B pictures read */
count_t c_decoded_pictures; /* number of pictures decoded */
count_t c_decoded_i_pictures; /* number of I pictures decoded */
count_t c_decoded_p_pictures; /* number of P pictures decoded */
count_t c_decoded_b_pictures; /* number of B pictures decoded */
count_t c_loops; /* number of loops */
count_t c_idle_loops; /* number of idle loops */
count_t c_sequences; /* number of sequences */
count_t c_pictures; /* number of pictures read */
count_t c_i_pictures; /* number of I pictures read */
count_t c_p_pictures; /* number of P pictures read */
count_t c_b_pictures; /* number of B pictures read */
count_t c_decoded_pictures; /* number of pictures decoded */
count_t c_decoded_i_pictures; /* number of I pictures decoded */
count_t c_decoded_p_pictures; /* number of P pictures decoded */
count_t c_decoded_b_pictures; /* number of B pictures decoded */
#endif
} vpar_thread_t;
/*******************************************************************************
* Standard start codes
*******************************************************************************/
#define PICTURE_START_CODE 0x100
#define SLICE_START_CODE_MIN 0x101
#define SLICE_START_CODE_MAX 0x1AF
#define USER_DATA_START_CODE 0x1B2
#define SEQUENCE_HEADER_CODE 0x1B3
#define SEQUENCE_ERROR_CODE 0x1B4
#define EXTENSION_START_CODE 0x1B5
#define SEQUENCE_END_CODE 0x1B7
#define GROUP_START_CODE 0x1B8
/* extension start code IDs */
#define SEQUENCE_EXTENSION_ID 1
#define SEQUENCE_DISPLAY_EXTENSION_ID 2
#define QUANT_MATRIX_EXTENSION_ID 3
#define COPYRIGHT_EXTENSION_ID 4
#define SEQUENCE_SCALABLE_EXTENSION_ID 5
#define PICTURE_DISPLAY_EXTENSION_ID 7
#define PICTURE_CODING_EXTENSION_ID 8
#define PICTURE_SPATIAL_SCALABLE_EXTENSION_ID 9
#define PICTURE_TEMPORAL_SCALABLE_EXTENSION_ID 10
/*******************************************************************************
/*****************************************************************************
* Prototypes
*******************************************************************************/
*****************************************************************************/
/* Thread management functions */
vpar_thread_t * vpar_CreateThread ( /* video_cfg_t *p_cfg, */ input_thread_t *p_input /*,
......
......@@ -16,16 +16,97 @@
*****************************************************************************/
/*****************************************************************************
* quant_matrix_t : Quantization Matrix
* macroblock_t : information on a macroblock
*****************************************************************************/
typedef struct macroblock_s
{
picture_t * p_picture;
int i_mb_x, i_mb_y;
int i_structure;
int i_l_x, i_l_y; /* position of macroblock (lum) */
int i_c_x, i_c_y; /* position of macroblock (chroma) */
int i_structure;
int i_chroma_nb_blocks; /* nb of bks for a chr comp */
/* IDCT information */
elem_t ppi_blocks[12][64]; /* blocks */
f_idct_t pf_idct[12]; /* sparse IDCT or not ? */
int pi_sparse_pos[12];
/* Motion compensation information */
f_motion_t pf_motion; /* function to use for motion comp */
f_chroma_motion_t pf_chroma_motion;
picture_t * p_backw_top, p_backw_bot;
picture_t * p_forw_top, p_forw_bot;
int i_field_select_backw_top, i_field_select_backw_bot;
int i_field_select_forw_top, i_field_select_forw_bot;
int pi_motion_vectors_backw_top[2];
int pi_motion_vectors_backw_bot[2];
int pi_motion_vectors_forw_top[2];
int pi_motion_vectors_forw_bot[2];
/* AddBlock information */
f_addb_t pf_addb[12];
data_t * p_data[12]; /* positions of blocks in picture */
int i_lum_incr, i_chroma_incr;
} macroblock_t;
/*****************************************************************************
* macroblock_parsing_t : parser context descriptor #3
*****************************************************************************/
typedef struct
{
int i_mb_type, i_motion_type, i_mv_count, i_mv_format;
int i_coded_block_pattern;
boolean_t b_dct_type;
} macroblock_parsing_t;
/*****************************************************************************
* LoadQuantizerScale
*****************************************************************************
* ??
* Quantizer scale factor (ISO/IEC 13818-2 7.4.2.2)
*****************************************************************************/
typedef struct quant_matrix_s
static __inline__ void LoadQuantizerScale( vpar_thread_t * p_vpar )
{
int pi_matrix[64];
boolean_t b_allocated;
/* Has the matrix been allocated by vpar_headers ? */
} quant_matrix_t;
/* Quantization coefficient table */
static unsigned char ppi_quantizer_scale[3][32] =
{
/* MPEG-2 */
{
/* q_scale_type */
/* linear */
0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,
32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62
},
{
/* non-linear */
0, 1, 2, 3, 4, 5, 6, 7, 8, 10,12,14,16,18,20, 22,
24,28,32,36,40,44,48,52,56,64,72,80,88,96,104,112
},
/* MPEG-1 */
{
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
}
};
p_vpar->slice.i_quantizer_scale = ppi_quantizer_scale
[(!p_vpar->sequence.b_mpeg2 << 1) | p_vpar->picture.b_q_scale_type]
[GetBits( &p_vpar->bit_stream, 5 )];
}
/*****************************************************************************
* Standard codes
*****************************************************************************/
/* Macroblock types */
#define MB_INTRA 1
#define MB_PATTERN 2
#define MB_MOTION_BACKWARD 4
#define MB_MOTION_FORWARD 8
#define MB_QUANT 16
extern int * pi_default_intra_quant;
extern int * pi_default_nonintra_quant;
/* Motion types */
#define MOTION_FIELD 1
#define MOTION_FRAME 2
#define MOTION_16X8 2
#define MOTION_DMV 3
/*****************************************************************************
* vpar_headers.h : video parser : headers parsing
* (c)1999 VideoLAN
*****************************************************************************
*****************************************************************************
* Requires:
* "config.h"
* "common.h"
* "mtime.h"
* "vlc_thread.h"
* "input.h"
* "video.h"
* "video_output.h"
* "decoder_fifo.h"
* "video_fifo.h"
*****************************************************************************/
/*****************************************************************************
* Function pointers
*****************************************************************************/
typedef (void *) f_slice_header_t( vpar_thread_t*, int*, int, elem_t*, u32);
/*****************************************************************************
* quant_matrix_t : Quantization Matrix
*****************************************************************************/
typedef struct quant_matrix_s
{
int pi_matrix[64];
boolean_t b_allocated;
/* Has the matrix been allocated by vpar_headers ? */
} quant_matrix_t;
extern int * pi_default_intra_quant;
extern int * pi_default_nonintra_quant;
/*****************************************************************************
* sequence_t : sequence descriptor
*****************************************************************************/
typedef struct sequence_s
{
u32 i_height, i_width, i_chroma_width, i_size;
u32 i_mb_height, i_mb_width, i_mb_size;
unsigned int i_aspect_ratio;
double d_frame_rate;
unsigned int i_chroma_format;
int i_chroma_nb_blocks;
boolean_t b_mpeg2;
boolean_t b_progressive;
unsigned int i_scalable_mode;
f_slice_header_t pf_slice_header;
quant_matrix_t intra_quant, nonintra_quant;
quant_matrix_t chroma_intra_quant, chroma_nonintra_quant;
(void *) pf_decode_mv( vpar_thread_t *, int );
(void *) pf_decode_pattern( vpar_thread_t * );
/* Parser context */
picture_t * p_forward, p_backward;
} sequence_t;
/*****************************************************************************
* picture_parsing_t : parser context descriptor
*****************************************************************************/
typedef struct picture_parsing_s
{
boolean_t b_full_pel_forward_vector, b_full_pel_backward_vector;
int i_forward_f_code, i_backward_f_code;
int ppi_f_code[2][2];
int i_intra_dc_precision;
boolean_t b_frame_pred_frame_dct, b_q_scale_type;
boolean_t b_alternate_scan, b_progressive_frame;
boolean_t b_top_field_first, b_concealment_mv;
int i_lum_incr, i_chroma_incr;
/* Used for second field management */
int i_current_structure;
picture_t * p_picture;
macroblock_t * pp_mb[MAX_MB];
/* Relative to the current field */
int i_coding_type, i_structure;
boolean_t b_frame_structure;
(int *) pf_macroblock_type( vpar_thread_t * );
boolean_t b_error;
} picture_parsing_t;
/*****************************************************************************
* slice_parsing_t : parser context descriptor #2
*****************************************************************************/
typedef struct slice_parsing_s
{
unsigned char i_quantizer_scale;
int pi_dc_dct_pred[3]; /* ISO/IEC 13818-2 7.2.1 */
int pppi_pmv[2][2][2]; /* Motion vect predictors, 7.6.3 */
} slice_parsing_t;
/*****************************************************************************
* Standard codes
*****************************************************************************/
#define PICTURE_START_CODE 0x100
#define SLICE_START_CODE_MIN 0x101
#define SLICE_START_CODE_MAX 0x1AF
#define USER_DATA_START_CODE 0x1B2
#define SEQUENCE_HEADER_CODE 0x1B3
#define SEQUENCE_ERROR_CODE 0x1B4
#define EXTENSION_START_CODE 0x1B5
#define SEQUENCE_END_CODE 0x1B7
#define GROUP_START_CODE 0x1B8
/* extension start code IDs */
#define SEQUENCE_EXTENSION_ID 1
#define SEQUENCE_DISPLAY_EXTENSION_ID 2
#define QUANT_MATRIX_EXTENSION_ID 3
#define COPYRIGHT_EXTENSION_ID 4
#define SEQUENCE_SCALABLE_EXTENSION_ID 5
#define PICTURE_DISPLAY_EXTENSION_ID 7
#define PICTURE_CODING_EXTENSION_ID 8
#define PICTURE_SPATIAL_SCALABLE_EXTENSION_ID 9
#define PICTURE_TEMPORAL_SCALABLE_EXTENSION_ID 10
/* scalable modes */
#define SC_NONE 0
#define SC_DP 1
#define SC_SPAT 2
#define SC_SNR 3
#define SC_TEMP 4
/* Pictures types */
#define I_CODING_TYPE 1
#define P_CODING_TYPE 2
#define B_CODING_TYPE 3
#define D_CODING_TYPE 4 /* MPEG-1 ONLY */
/* other values are reserved */
/* Structures */
#define TOP_FIELD 1
#define BOTTOM_FIELD 2
#define FRAME_STRUCTURE 3
/*****************************************************************************
* vdec_idct.c : IDCT functions
* (c)1999 VideoLAN
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <sys/uio.h>
#include <X11/Xlib.h>
#include <X11/extensions/XShm.h>
#include "config.h"
#include "common.h"
#include "mtime.h"
#include "vlc_thread.h"
#include "intf_msg.h"
#include "debug.h" /* ?? temporaire, requis par netlist.h */
#include "input.h"
#include "input_netlist.h"
#include "decoder_fifo.h"
#include "video.h"
#include "video_output.h"
#include "video_parser.h"
#include "undec_picture.h"
#include "video_fifo.h"
#include "video_decoder.h"
/*
* Local prototypes
*/
/* Our current implementation is a fast DCT, we might move to a fast DFT or
* an MMX DCT in the future. */
/*****************************************************************************
* vdec_DummyIDCT : dummy function that does nothing
*****************************************************************************/
void vdec_DummyIDCT( elem_t * p_block, int i_idontcare )
{
}
/*****************************************************************************
* vdec_SparseIDCT : IDCT function for sparse matrices
*****************************************************************************/
void vdec_SparseIDCT( elem_t * p_block, int i_sparse_pos )
{
/* Copy from mpeg_play */
}
/*****************************************************************************
* vdec_IDCT : IDCT function for normal matrices
*****************************************************************************/
void vdec_IDCT( elem_t * p_block, int i_idontcare )
{
}
......@@ -3,8 +3,6 @@
* (c)1999 VideoLAN
*****************************************************************************/
/* ?? passer en terminate/destroy avec les signaux supplmentaires */
/*****************************************************************************
* Preamble
*****************************************************************************/
......@@ -40,52 +38,46 @@
* Local prototypes
*/
typedef (void *) f_motion_c_t( coeff_t *, pel_lookup_table_t *,
int, coeff_t *, int, int,
int, int, int, int, int );
/*****************************************************************************
* vdec_MotionCompensation : motion compensation
* vdec_DummyRecon : motion compensation for an intra macroblock
*****************************************************************************/
void vdec_MotionFrame( vdec_thread_t * p_vdec,
undec_picture_t * p_undec_p, int i_mb,
f_motion_mb_t pf_mb_motion )
void vdec_DummyRecon( macroblock_t * p_mb )
{
static int p_chroma_nb_blocks[4] = {1, 2, 4};
static int p_chroma_nb_elems[4] = {0, 64, 128, 256};
}
int i_mb_x, i_mb_y; /* Position of our macroblock in the final picture */
elem_t * p_y, p_u, p_v; /* Pointers to our picture's data */
/*****************************************************************************
* vdec_ForwardRecon : motion compensation for a forward predicted macroblock
*****************************************************************************/
void vdec_ForwardRecon( macroblock_t * p_mb )
{
}
/*****************************************************************************
* vdec_BackwardRecon : motion compensation for a backward predicted macroblock
*****************************************************************************/
void vdec_BackwardRecon( macroblock_t * p_mb )
{
#define P_mb_info p_undec_p->p_mb_info[i_mb]
i_mb_x = (i_mb << 5) % p_undec_p->p_picture->i_width;
i_mb_y = (i_mb << 5) / p_undec_p->p_picture->i_width;
p_y = &p_undec_p->p_picture->p_y[256*i_mb];
p_u = &p_undec_p->p_picture->p_u[p_chroma_nb_elems[p_undec_p->p_picture->i_chroma_type]*i_mb];
p_v = &p_undec_p->p_picture->p_v[p_chroma_nb_elems[p_undec_p->p_picture->i_chroma_type]*i_mb];
if( (p_undec_p->i_coding_type == P_CODING_TYPE) ||
(P_mb_info->i_mb_type & MB_MOTION_FORWARD) )
{
if( (P_mb_info->i_motion_type == MOTION_FRAME) ||
!(P_mb_info->i_mb_type & MB_INTRA) )
{
MotionBlock( p_undec_p->p_forward->p_u,
p_undec_p->p_forward->p_lookup_lum,
p_undec_p->p_picture->i_width,
p_u, i_mb_x, i_mb_y,
p_undec_p->p_picture->i_width,
p_undec_p->ppp_motion_vectors[0][0][0],
p_undec_p->ppp_motion_vectors[0][0][1] );
}
}
}
/*****************************************************************************
* MotionMacroblock : motion compensation for a macroblock
* vdec_BidirectionalRecon : motion compensation for a bidirectionally
* predicted macroblock
*****************************************************************************/
void vdec_MotionMacroblock420( coeff_t * p_src, pel_lookup_table_t * p_lookup,
int i_width_line,
coeff_t * p_dest, int i_dest_x, i_dest_y,
int i_stride_line,
i_mv1_x, i_mv1_y, i_mv2_x, i_mv2_y )
void vdec_BidirectionalRecon( macroblock_t * p_mb )
{
}
/*****************************************************************************
* vdec_MotionMacroblock420 : motion compensation for a 4:2:0 macroblock
*****************************************************************************/
void vdec_MotionMacroblock420( macroblock_t * p_mb )
{
/* Luminance */
MotionBlock( p_undec_p->p_forward->p_u, p_undec_p->p_forward->p_lookup_lum,
......@@ -105,12 +97,9 @@ void __inline__ MotionBlock( coeff_t * p_src, pel_lookup_table_t * p_lookup,
int i_stride_line,
i_mv1_x, i_mv1_y, i_mv2_x, i_mv2_y )
{
static (void *) ComponentMode( coeff_t * p_src,
pel_lookup_table_t * p_lookup,
coeff_t * p_dest, int i_dest_x, i_dest_y,
int i_stride_line, i_mv_x, i_mv_y )[4]
= { ComponentNN, ComponentNH, ComponentHN,
ComponentHH };
static f_motion_c_t ComponentMode[4]
= { &ComponentNN, &ComponentNH, &ComponentHN,
&ComponentHH };
int i_mode;
......@@ -118,7 +107,8 @@ void __inline__ MotionBlock( coeff_t * p_src, pel_lookup_table_t * p_lookup,
ComponentMode[i_mode]( p_src, p_lookup, i_width_line,
p_dest, i_dest_x, i_dest_y,
i_stride_line, i_mv_x >> 1, i_mv_y >> 1 );
i_stride_line, i_mv1_x >> 1, i_mv1_y >> 1,
i_mv2_x >> 1, i_mv2_y >> 1 );
}
/*****************************************************************************
......@@ -132,9 +122,22 @@ void ComponentNN( coeff_t * p_src, pel_lookup_table_t * p_lookup,
int i_vpos;
register int i_hpos, i_src_loc;
i_src_loc = (i_dest_y + i_mv_y)*i_width_line + i_dest_x + i_mv_x;
i_src_loc = (i_dest_y + i_mv1_y)*i_width_line + i_dest_x + i_mv1_x;
for( i_vpos = 0; i_vpos < 8; i_vpos++ )
for( i_vpos = 0; i_vpos < 4; i_vpos++ )
{
for( i_hpos = 0; i_hpos < 8; i_hpos++ )
{
p_dest[i_hpos] += p_src[p_lookup->pi_pel[i_src_loc + i_hpos]];
}
p_dest += 8;
i_src_loc += i_stride_line;
}
i_src_loc = (i_dest_y + i_mv2_y)*i_width_line + i_dest_x + i_mv2_x;
for( i_vpos = 4; i_vpos < 8; i_vpos++ )
{
for( i_hpos = 0; i_hpos < 8; i_hpos++ )
{
......
......@@ -43,8 +43,8 @@ static int InitThread ( vdec_thread_t *p_vdec );
static void RunThread ( vdec_thread_t *p_vdec );
static void ErrorThread ( vdec_thread_t *p_vdec );
static void EndThread ( vdec_thread_t *p_vdec );
static void DecodePicture ( vdec_thread_t *p_vdec,
undec_picture_t * p_undec_p );
static void DecodeMacroblock ( vdec_thread_t *p_vdec,
macroblock_t * p_mb );
/*******************************************************************************
* vdec_CreateThread: create a video decoder thread
......@@ -165,11 +165,11 @@ static void RunThread( vdec_thread_t *p_vdec )
*/
while( (!p_vdec->b_die) && (!p_vdec->b_error) )
{
undec_picture_t * p_undec_p;
macroblock_t * p_mb;