Commit c79648fe authored by Christophe Massiot's avatar Christophe Massiot

* Optimisation du video_parser ; define VPAR_OPTIM_LEVEL dans config.h

  pour r�gler le temps de compilation ;
* virage d'un printf dans l'idct et d'une fonction inutile.
parent 060c6b7a
...@@ -288,6 +288,10 @@ ...@@ -288,6 +288,10 @@
/* Time to sleep when waiting for a buffer (from vout or the video fifo). */ /* Time to sleep when waiting for a buffer (from vout or the video fifo). */
#define VPAR_OUTMEM_SLEEP 50000 #define VPAR_OUTMEM_SLEEP 50000
/* Optimization level, from 0 to 2 - 1 is generally a good compromise. Remember
* that raising this level dramatically lengthens the compilation time. */
#define VPAR_OPTIM_LEVEL 1
/* The following directives only apply if you define VDEC_SMP below. */ /* The following directives only apply if you define VDEC_SMP below. */
/* Number of macroblock buffers available. It should be always greater than /* Number of macroblock buffers available. It should be always greater than
......
...@@ -148,7 +148,6 @@ typedef void (*f_idct_t)( struct vdec_thread_s *, dctelem_t*, int ); ...@@ -148,7 +148,6 @@ typedef void (*f_idct_t)( struct vdec_thread_s *, dctelem_t*, int );
/***************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
*****************************************************************************/ *****************************************************************************/
void vdec_DummyIDCT( struct vdec_thread_s *, dctelem_t*, int );
void vdec_InitIDCT (struct vdec_thread_s * p_vdec); void vdec_InitIDCT (struct vdec_thread_s * p_vdec);
void vdec_SparseIDCT( struct vdec_thread_s *, dctelem_t*, int ); void vdec_SparseIDCT( struct vdec_thread_s *, dctelem_t*, int );
void vdec_IDCT( struct vdec_thread_s *, dctelem_t*, int ); void vdec_IDCT( struct vdec_thread_s *, dctelem_t*, int );
...@@ -150,6 +150,21 @@ void vpar_DestroyThread ( vpar_thread_t *p_vpar /*, int *pi_stat ...@@ -150,6 +150,21 @@ void vpar_DestroyThread ( vpar_thread_t *p_vpar /*, int *pi_stat
/* Dynamic thread settings */ /* Dynamic thread settings */
/* ?? */ /* ?? */
/*****************************************************************************
* NextStartCode : Find the next start code
*****************************************************************************/
static __inline__ void NextStartCode( vpar_thread_t * p_vpar )
{
/* Re-align the buffer on an 8-bit boundary */
RealignBits( &p_vpar->bit_stream );
while( ShowBits( &p_vpar->bit_stream, 24 ) != 0x01L && !p_vpar->b_die )
{
RemoveBits( &p_vpar->bit_stream, 8 );
}
}
/***************************************************************************** /*****************************************************************************
* LoadQuantizerScale * LoadQuantizerScale
***************************************************************************** *****************************************************************************
......
...@@ -141,53 +141,17 @@ void vpar_InitPMBType( struct vpar_thread_s * p_vpar ); ...@@ -141,53 +141,17 @@ void vpar_InitPMBType( struct vpar_thread_s * p_vpar );
void vpar_InitBMBType( struct vpar_thread_s * p_vpar ); void vpar_InitBMBType( struct vpar_thread_s * p_vpar );
void vpar_InitCodedPattern( struct vpar_thread_s * p_vpar ); void vpar_InitCodedPattern( struct vpar_thread_s * p_vpar );
void vpar_InitDCTTables( struct vpar_thread_s * p_vpar ); void vpar_InitDCTTables( struct vpar_thread_s * p_vpar );
void vpar_ParseMacroblockGENERIC( struct vpar_thread_s* p_vpar, int * pi_mb_address, void vpar_PictureDataGENERIC( struct vpar_thread_s * p_vpar, int i_mb_base );
int i_mb_previous, int i_mb_base, #if (VPAR_OPTIM_LEVEL > 0)
boolean_t b_mpeg2, int i_coding_type, void vpar_PictureData2I420F0( struct vpar_thread_s * p_vpar, int i_mb_base );
int i_chroma_format, int i_structure, void vpar_PictureData2P420F0( struct vpar_thread_s * p_vpar, int i_mb_base );
boolean_t b_second_field ); void vpar_PictureData2B420F0( struct vpar_thread_s * p_vpar, int i_mb_base );
void vpar_ParseMacroblock2I420F0( struct vpar_thread_s* p_vpar, int * pi_mb_address, #endif
int i_mb_previous, int i_mb_base, #if (VPAR_OPTIM_LEVEL > 1)
boolean_t b_mpeg2, int i_coding_type, void vpar_PictureData2I420TZ( struct vpar_thread_s * p_vpar, int i_mb_base );
int i_chroma_format, int i_structure, void vpar_PictureData2P420TZ( struct vpar_thread_s * p_vpar, int i_mb_base );
boolean_t b_second_field ); void vpar_PictureData2B420TZ( struct vpar_thread_s * p_vpar, int i_mb_base );
void vpar_ParseMacroblock2P420F0( struct vpar_thread_s* p_vpar, int * pi_mb_address, void vpar_PictureData2I420BZ( struct vpar_thread_s * p_vpar, int i_mb_base );
int i_mb_previous, int i_mb_base, void vpar_PictureData2P420BZ( struct vpar_thread_s * p_vpar, int i_mb_base );
boolean_t b_mpeg2, int i_coding_type, void vpar_PictureData2B420BZ( struct vpar_thread_s * p_vpar, int i_mb_base );
int i_chroma_format, int i_structure, #endif
boolean_t b_second_field ); \ No newline at end of file
void vpar_ParseMacroblock2B420F0( struct vpar_thread_s* p_vpar, int * pi_mb_address,
int i_mb_previous, int i_mb_base,
boolean_t b_mpeg2, int i_coding_type,
int i_chroma_format, int i_structure,
boolean_t b_second_field );
void vpar_ParseMacroblock2I420T0( struct vpar_thread_s* p_vpar, int * pi_mb_address,
int i_mb_previous, int i_mb_base,
boolean_t b_mpeg2, int i_coding_type,
int i_chroma_format, int i_structure,
boolean_t b_second_field );
void vpar_ParseMacroblock2P420T0( struct vpar_thread_s* p_vpar, int * pi_mb_address,
int i_mb_previous, int i_mb_base,
boolean_t b_mpeg2, int i_coding_type,
int i_chroma_format, int i_structure,
boolean_t b_second_field );
void vpar_ParseMacroblock2B420T0( struct vpar_thread_s* p_vpar, int * pi_mb_address,
int i_mb_previous, int i_mb_base,
boolean_t b_mpeg2, int i_coding_type,
int i_chroma_format, int i_structure,
boolean_t b_second_field );
void vpar_ParseMacroblock2I420B1( struct vpar_thread_s* p_vpar, int * pi_mb_address,
int i_mb_previous, int i_mb_base,
boolean_t b_mpeg2, int i_coding_type,
int i_chroma_format, int i_structure,
boolean_t b_second_field );
void vpar_ParseMacroblock2P420B1( struct vpar_thread_s* p_vpar, int * pi_mb_address,
int i_mb_previous, int i_mb_base,
boolean_t b_mpeg2, int i_coding_type,
int i_chroma_format, int i_structure,
boolean_t b_second_field );
void vpar_ParseMacroblock2B420B1( struct vpar_thread_s* p_vpar, int * pi_mb_address,
int i_mb_previous, int i_mb_base,
boolean_t b_mpeg2, int i_coding_type,
int i_chroma_format, int i_structure,
boolean_t b_second_field );
...@@ -15,13 +15,6 @@ ...@@ -15,13 +15,6 @@
* "video_fifo.h" * "video_fifo.h"
*****************************************************************************/ *****************************************************************************/
/*****************************************************************************
* Function pointers
*****************************************************************************/
struct vpar_thread_s;
typedef void (*f_slice_header_t)( struct vpar_thread_s*, int*, int, u32);
/***************************************************************************** /*****************************************************************************
* quant_matrix_t : Quantization Matrix * quant_matrix_t : Quantization Matrix
*****************************************************************************/ *****************************************************************************/
...@@ -44,7 +37,6 @@ typedef struct sequence_s ...@@ -44,7 +37,6 @@ typedef struct sequence_s
boolean_t b_mpeg2; boolean_t b_mpeg2;
boolean_t b_progressive; boolean_t b_progressive;
unsigned int i_scalable_mode; unsigned int i_scalable_mode;
f_slice_header_t pf_slice_header;
quant_matrix_t intra_quant, nonintra_quant; quant_matrix_t intra_quant, nonintra_quant;
quant_matrix_t chroma_intra_quant, chroma_nonintra_quant; quant_matrix_t chroma_intra_quant, chroma_nonintra_quant;
...@@ -154,7 +146,6 @@ typedef struct slice_parsing_s ...@@ -154,7 +146,6 @@ typedef struct slice_parsing_s
#define BOTTOM_FIELD 2 #define BOTTOM_FIELD 2
#define FRAME_STRUCTURE 3 #define FRAME_STRUCTURE 3
/***************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
*****************************************************************************/ *****************************************************************************/
......
...@@ -46,20 +46,12 @@ ...@@ -46,20 +46,12 @@
* an MMX DCT in the future. */ * an MMX DCT in the future. */
/***************************************************************************** /*****************************************************************************
* vdec_DummyIDCT : dummy function that does nothing * vdec_InitIDCT : initialize datas for vdec_SparceIDCT
*****************************************************************************/
void vdec_DummyIDCT( vdec_thread_t * p_vdec, dctelem_t * p_block,
int i_idontcare )
{
}
/*****************************************************************************
* init_SparseIDCT : initialize datas for vdec_SparceIDCT
* vdec_SparseIDCT : IDCT function for sparse matrices * vdec_SparseIDCT : IDCT function for sparse matrices
*****************************************************************************/ *****************************************************************************/
void vdec_InitIDCT (vdec_thread_t * p_vdec) void vdec_InitIDCT (vdec_thread_t * p_vdec)
{ {
int i; int i;
dctelem_t * p_pre = p_vdec->p_pre_idct; dctelem_t * p_pre = p_vdec->p_pre_idct;
...@@ -86,7 +78,7 @@ void vdec_SparseIDCT (vdec_thread_t * p_vdec, dctelem_t * p_block, ...@@ -86,7 +78,7 @@ void vdec_SparseIDCT (vdec_thread_t * p_vdec, dctelem_t * p_block,
/* If DC Coefficient. */ /* If DC Coefficient. */
if ( i_sparse_pos == 0 ) if ( i_sparse_pos == 0 )
{ {
dp=(int *)p_block; dp=(int *)p_block;
val=RIGHT_SHIFT((*p_block + 4), 3); val=RIGHT_SHIFT((*p_block + 4), 3);
/* Compute int to assign. This speeds things up a bit */ /* Compute int to assign. This speeds things up a bit */
v = ((val & 0xffff) | (val << 16)); v = ((val & 0xffff) | (val << 16));
...@@ -372,7 +364,6 @@ void vdec_IDCT( vdec_thread_t * p_vdec, dctelem_t * p_block, int i_idontcare ) ...@@ -372,7 +364,6 @@ void vdec_IDCT( vdec_thread_t * p_vdec, dctelem_t * p_block, int i_idontcare )
dataptr = p_block; dataptr = p_block;
fprintf( stderr, "normal dct" );
for (rowctr = DCTSIZE-1; rowctr >= 0; rowctr--) for (rowctr = DCTSIZE-1; rowctr >= 0; rowctr--)
{ {
/* Due to quantization, we will usually find that many of the input /* Due to quantization, we will usually find that many of the input
......
This diff is collapsed.
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