Commit ea23960c authored by Christophe Massiot's avatar Christophe Massiot

video_fifo.c et vpar_headers.c compilent � peu pr�s. Correction d'environ

4212 fautes de frappe.
parent 56bb1291
......@@ -31,7 +31,7 @@
*****************************************************************************
* This rotative FIFO contains undecoded macroblocks that are to be decoded
*****************************************************************************/
struct video_parser_s;
struct vpar_thread_s;
typedef struct video_fifo_s
{
......@@ -43,7 +43,7 @@ typedef struct video_fifo_s
int i_start;
int i_end;
struct video_parser_s * p_vpar;
struct vpar_thread_s * p_vpar;
} video_fifo_t;
/*****************************************************************************
......
......@@ -77,3 +77,15 @@ typedef struct
#define MOTION_FRAME 2
#define MOTION_16X8 2
#define MOTION_DMV 3
/*****************************************************************************
* Prototypes
*****************************************************************************/
void vpar_CodedPattern420( struct vpar_thread_s* p_vpar );
void vpar_CodedPattern422( struct vpar_thread_s* p_vpar );
void vpar_CodedPattern444( struct vpar_thread_s* p_vpar );
int vpar_IMBType( struct vpar_thread_s* p_vpar );
int vpar_PMBType( struct vpar_thread_s* p_vpar );
int vpar_BMBType( struct vpar_thread_s* p_vpar );
int vpar_DMBType( struct vpar_thread_s* p_vpar );
......@@ -20,7 +20,9 @@
*****************************************************************************/
struct vpar_thread_s;
typedef void (*f_slice_header_t)( struct vpar_thread_s*, int*, int, elem_t*, u32);
typedef void (*f_slice_header_t)( struct vpar_thread_s*, int*, int, u32);
typedef void (*f_chroma_pattern_t)( struct vpar_thread_s* );
typedef int (*f_macroblock_type_t)( struct vpar_thread_s* );
/*****************************************************************************
* quant_matrix_t : Quantization Matrix
......@@ -53,7 +55,7 @@ typedef struct sequence_s
quant_matrix_t intra_quant, nonintra_quant;
quant_matrix_t chroma_intra_quant, chroma_nonintra_quant;
void (*pf_decode_mv)( struct vpar_thread_s *, int );
void (*pf_decode_pattern)( struct vpar_thread_s * );
f_chroma_pattern_t pf_decode_pattern;
/* Parser context */
picture_t * p_forward;
......@@ -79,6 +81,7 @@ typedef struct picture_parsing_s
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_intra_vlc_format;
boolean_t b_alternate_scan, b_progressive_frame;
boolean_t b_top_field_first, b_concealment_mv;
boolean_t b_repeat_first_field;
......@@ -93,7 +96,7 @@ typedef struct picture_parsing_s
/* Relative to the current field */
int i_coding_type, i_structure;
boolean_t b_frame_structure;
int (*pf_macroblock_type)( struct vpar_thread_s * );
f_macroblock_type_t pf_macroblock_type;
boolean_t b_error;
} picture_parsing_t;
......
......@@ -28,11 +28,15 @@
#include "decoder_fifo.h"
#include "video.h"
#include "video_output.h"
#include "video_parser.h"
#include "macroblock.h"
#include "video_fifo.h"
#include "vdec_idct.h"
#include "video_decoder.h"
#include "vdec_motion.h"
#include "vpar_blocks.h"
#include "vpar_headers.h"
#include "video_fifo.h"
#include "video_parser.h"
/*****************************************************************************
* vpar_InitFIFO : initialize the video FIFO
......@@ -42,19 +46,20 @@ void vpar_InitFIFO( vpar_thread_t * p_vpar )
int i_dummy;
/* Initialize mutex and cond */
vlc_mutex_init( p_vpar->vfifo.lock );
vlc_cond_init( p_vpar->vfifo.wait );
vlc_mutex_init( p_vpar->vbuffer.lock );
vlc_mutex_init( &p_vpar->vfifo.lock );
vlc_cond_init( &p_vpar->vfifo.wait );
vlc_mutex_init( &p_vpar->vbuffer.lock );
/* Initialize FIFO properties */
p_vpar->vfifo.i_start = p_vpar->vfifo.i_end = 0;
p_vpar->vfifo.p_vpar = p_vpar;
/* Initialize buffer properties */
i_index = VFIFO_SIZE; /* all structures are available */
p_vpar->vbuffer.i_index = VFIFO_SIZE; /* all structures are available */
for( i_dummy = 0; i_dummy < VFIFO_SIZE + 1; i_dummy++ )
{
p_vpar->vfifo.pp_mb_free[i_dummy] = p_vpar->vfifo.p_macroblocks + i;
p_vpar->vbuffer.pp_mb_free[i_dummy] = p_vpar->vbuffer.p_macroblocks
+ i_dummy;
}
}
......@@ -91,18 +96,18 @@ macroblock_t * vpar_NewMacroblock( video_fifo_t * p_fifo )
{
macroblock_t * p_mb;
#define P_buffer p_fifo->p_vpar.vbuffer
vlc_mutex_lock( &P_buffer->lock );
#define P_buffer p_fifo->p_vpar->vbuffer
vlc_mutex_lock( &P_buffer.lock );
if( P_buffer.i_index == -1 )
{
/* No more structures available. This should not happen ! */
return NULL;
}
p_mb = P_buffer->pp_undec_free[ P_buffer->i_index-- ];
#undef P_buffer
p_mb = P_buffer.pp_mb_free[ P_buffer.i_index-- ];
vlc_mutex_unlock( &P_buffer->lock );
vlc_mutex_unlock( &P_buffer.lock );
#undef P_buffer
return( p_mb );
}
......@@ -117,7 +122,7 @@ void vpar_DecodeMacroblock( video_fifo_t * p_fifo, macroblock_t * p_mb )
/* By construction, the video FIFO cannot be full */
VIDEO_FIFO_END( *p_fifo ) = p_mb;
VIDEO_FIFO_INCEND( *p_fifo );
vlc_mutex_unlock( &p_fifo->lock );
}
......@@ -130,19 +135,19 @@ void vpar_ReleaseMacroblock( video_fifo_t * p_fifo, macroblock_t * p_mb )
/* Unlink referenced pictures */
if( p_mb->p_forw_top != NULL )
{
vout_UnlinkPicture( p_fifo->p_vpar.p_vout, p_mb->p_forw_top );
vout_UnlinkPicture( p_fifo->p_vpar->p_vout, p_mb->p_forw_top );
}
if( p_mb->p_backw_top != NULL )
{
vout_UnlinkPicture( p_fifo->p_vpar.p_vout, p_mb->p_backw_top );
vout_UnlinkPicture( p_fifo->p_vpar->p_vout, p_mb->p_backw_top );
}
if( p_mb->p_forw_bot != NULL )
{
vout_UnlinkPicture( p_fifo->p_vpar.p_vout, p_mb->p_forw_bot );
vout_UnlinkPicture( p_fifo->p_vpar->p_vout, p_mb->p_forw_bot );
}
if( p_mb->p_backw_bot != NULL )
{
vout_UnlinkPicture( p_fifo->p_vpar.p_vout, p_mb->p_backw_bot );
vout_UnlinkPicture( p_fifo->p_vpar->p_vout, p_mb->p_backw_bot );
}
/* Unlink picture buffer */
......@@ -151,7 +156,7 @@ void vpar_ReleaseMacroblock( video_fifo_t * p_fifo, macroblock_t * p_mb )
if( p_mb->p_picture->i_deccount == 0 )
{
/* Mark the picture to be displayed */
vout_DisplayPicture( p_fifo->p_vpar.p_vout, p_mb->p_picture );
vout_DisplayPicture( p_fifo->p_vpar->p_vout, p_mb->p_picture );
/* Warn Synchro for its records. */
vpar_SynchroEnd( p_fifo->p_vpar );
......@@ -159,10 +164,10 @@ void vpar_ReleaseMacroblock( video_fifo_t * p_fifo, macroblock_t * p_mb )
vlc_mutex_unlock( & p_mb->p_picture->lock_deccount );
/* Release the macroblock_t structure */
#define P_buffer p_fifo->p_vpar.vbuffer
vlc_mutex_lock( &P_buffer->lock );
P_buffer->pp_mb_free[ ++P_buffer->i_index ] = p_mb;
vlc_mutex_unlock( &P_buffer->lock );
#define P_buffer p_fifo->p_vpar->vbuffer
vlc_mutex_lock( &P_buffer.lock );
P_buffer.pp_mb_free[ ++P_buffer.i_index ] = p_mb;
vlc_mutex_unlock( &P_buffer.lock );
#undef P_buffer
}
......@@ -174,25 +179,25 @@ void vpar_DestroyMacroblock( video_fifo_t * p_fifo, macroblock_t * p_mb )
/* Unlink referenced pictures */
if( p_mb->p_forw_top != NULL )
{
vout_UnlinkPicture( p_fifo->p_vpar.p_vout, p_mb->p_forw_top );
vout_UnlinkPicture( p_fifo->p_vpar->p_vout, p_mb->p_forw_top );
}
if( p_mb->p_backw_top != NULL )
{
vout_UnlinkPicture( p_fifo->p_vpar.p_vout, p_mb->p_backw_top );
vout_UnlinkPicture( p_fifo->p_vpar->p_vout, p_mb->p_backw_top );
}
if( p_mb->p_forw_bot != NULL )
{
vout_UnlinkPicture( p_fifo->p_vpar.p_vout, p_mb->p_forw_bot );
vout_UnlinkPicture( p_fifo->p_vpar->p_vout, p_mb->p_forw_bot );
}
if( p_mb->p_backw_bot != NULL )
{
vout_UnlinkPicture( p_fifo->p_vpar.p_vout, p_mb->p_backw_bot );
vout_UnlinkPicture( p_fifo->p_vpar->p_vout, p_mb->p_backw_bot );
}
/* Release the macroblock_t structure */
#define P_buffer p_fifo->p_vpar.vbuffer
vlc_mutex_lock( &P_buffer->lock );
P_buffer->pp_mb_free[ ++P_buffer->i_index ] = p_mb;
vlc_mutex_unlock( &P_buffer->lock );
#define P_buffer p_fifo->p_vpar->vbuffer
vlc_mutex_lock( &P_buffer.lock );
P_buffer.pp_mb_free[ ++P_buffer.i_index ] = p_mb;
vlc_mutex_unlock( &P_buffer.lock );
#undef P_buffer
}
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