Commit 54f82a15 authored by Christophe Massiot's avatar Christophe Massiot

Un bon morceau du parseur.

Stef, je ne t'oublie pas, demain t'auras du boulot, promis :)
parent a6dfb286
...@@ -62,6 +62,7 @@ typedef struct undec_picture_s ...@@ -62,6 +62,7 @@ typedef struct undec_picture_s
boolean_t b_mpeg2; boolean_t b_mpeg2;
int i_mb_height, i_mb_width; int i_mb_height, i_mb_width;
int i_structure; int i_structure;
mtime_t i_pts;
macroblock_info_t * p_mb_info; macroblock_info_t * p_mb_info;
...@@ -87,15 +88,32 @@ typedef struct undec_picture_s ...@@ -87,15 +88,32 @@ typedef struct undec_picture_s
/******************************************************************************* /*******************************************************************************
* pel_lookup_table_t : lookup table for pixels * pel_lookup_table_t : lookup table for pixels
*******************************************************************************/ *******************************************************************************/
typedef struct pel_lookup_table_s {
#ifdef BIG_PICTURES #ifdef BIG_PICTURES
u32 * pi_pel; # define PEL_P u32
#else #else
u16 * pi_pel; # define PEL_P u16
#endif #endif
typedef struct pel_lookup_table_s {
PEL_P * pi_pel;
/* When the size of the picture changes, this structure is freed, so we /* When the size of the picture changes, this structure is freed, so we
* keep a reference count. */ * keep a reference count. */
int i_refcount; int i_refcount;
vlc_mutex_t lock; vlc_mutex_t lock;
} pel_lookup_table_t; } pel_lookup_table_t;
#define LINK_LOOKUP(p_l) \
vlc_mutex_lock( (p_l)->lock ); \
(p_l)->i_refcount++; \
vlc_mutex_unlock( (p_l)->lock );
#define UNLINK_LOOKUP(p_l) \
vlc_mutex_lock( (p_l)->lock ); \
(p_l)->i_refcount--; \
if( (p_l)->i_refcount <= 0 ) \
{ \
vlc_mutex_unlock( (p_l)->lock ); \
free( p_l ); \
} \
vlc_mutex_unlock( (p_l)->lock );
...@@ -22,9 +22,20 @@ ...@@ -22,9 +22,20 @@
*******************************************************************************/ *******************************************************************************/
typedef struct sequence_s typedef struct sequence_s
{ {
u32 i_height, i_width; u16 i_height, i_width;
u16 i_mb_height, i_mb_width;
unsigned int i_aspect_ratio; unsigned int i_aspect_ratio;
double frame_rate; 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; } sequence_t;
/******************************************************************************* /*******************************************************************************
......
/*****************************************************************************
* vpar_blocks.h : video parser blocks management
* (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"
*****************************************************************************/
/*****************************************************************************
* 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;
...@@ -55,6 +55,7 @@ void vpar_InitFIFO( vpar_thread_t * p_vpar ) ...@@ -55,6 +55,7 @@ void vpar_InitFIFO( vpar_thread_t * p_vpar )
for( i_dummy = 0; i_dummy < VFIFO_SIZE + 1; i_dummy++ ) for( i_dummy = 0; i_dummy < VFIFO_SIZE + 1; i_dummy++ )
{ {
p_vpar->vfifo.pp_undec_free[i_dummy] = p_vpar->vfifo.p_undec_p + i; p_vpar->vfifo.pp_undec_free[i_dummy] = p_vpar->vfifo.p_undec_p + i;
p_vpar->vfifo.p_undec_p[i].p_mb_info = NULL;
} }
} }
......
...@@ -166,13 +166,22 @@ static int InitThread( vpar_thread_t *p_vpar ) ...@@ -166,13 +166,22 @@ static int InitThread( vpar_thread_t *p_vpar )
p_vpar->i_stream = vout_CreateStream( p_vpar->p_vout ); p_vpar->i_stream = vout_CreateStream( p_vpar->p_vout );
if( p_vpar->i_stream < 0 ) /* error */ if( p_vpar->i_stream < 0 ) /* error */
{ {
return( 1 ); return( 1 );
} }
/* Initialize parsing data */
/* ?? */
#endif #endif
/* Initialize parsing data */
p_vpar->sequence.p_forward = p_vpar->sequence.p_backward = NULL;
p_vpar->sequence.p_frame_lum_lookup
= p_vpar->sequence.p_field_lum_lookup
= p_vpar->sequence.p_frame_chroma_lookup
= p_vpar->sequence.p_field_chroma_lookup
= NULL;
p_vpar->sequence.intra_quant.b_allocated = FALSE;
p_vpar->sequence.nonintra_quant.b_allocated = FALSE;
p_vpar->sequence.chroma_intra_quant.b_allocated = FALSE;
p_vpar->sequence.chroma_nonintra_quant.b_allocated = FALSE;
/* Initialize other properties */ /* Initialize other properties */
#ifdef STATS #ifdef STATS
p_vpar->c_loops = 0; p_vpar->c_loops = 0;
...@@ -255,7 +264,7 @@ static void RunThread( vpar_thread_t *p_vpar ) ...@@ -255,7 +264,7 @@ static void RunThread( vpar_thread_t *p_vpar )
*/ */
if( p_vpar->b_error ) if( p_vpar->b_error )
{ {
ErrorThread( p_vpar ); ErrorThread( p_vpar );
} }
/* End of thread */ /* End of thread */
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment