Commit 7b3ed3ad authored by Christophe Massiot's avatar Christophe Massiot

* Various miscellaneous minor optimizations of the video parser.

parent 95ef185a
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* input_ext-dec.h: structures exported to the VideoLAN decoders * input_ext-dec.h: structures exported to the VideoLAN decoders
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-dec.h,v 1.17 2001/01/20 13:08:33 sam Exp $ * $Id: input_ext-dec.h,v 1.18 2001/01/21 01:36:25 massiot Exp $
* *
* Authors: * Authors:
* *
...@@ -135,6 +135,11 @@ typedef struct bit_fifo_s ...@@ -135,6 +135,11 @@ typedef struct bit_fifo_s
*****************************************************************************/ *****************************************************************************/
typedef struct bit_stream_s typedef struct bit_stream_s
{ {
/*
* Bit structures
*/
bit_fifo_t fifo;
/* /*
* Input structures * Input structures
*/ */
...@@ -160,11 +165,6 @@ typedef struct bit_stream_s ...@@ -160,11 +165,6 @@ typedef struct bit_stream_s
byte_t * p_byte; byte_t * p_byte;
/* Pointer to the last byte that is to be read (in the current TS packet */ /* Pointer to the last byte that is to be read (in the current TS packet */
byte_t * p_end; byte_t * p_end;
/*
* Bit structures
*/
bit_fifo_t fifo;
} bit_stream_t; } bit_stream_t;
/***************************************************************************** /*****************************************************************************
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vpar_blocks.h : video parser blocks management * vpar_blocks.h : video parser blocks management
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: vpar_blocks.h,v 1.32 2001/01/18 05:13:22 sam Exp $ * $Id: vpar_blocks.h,v 1.33 2001/01/21 01:36:25 massiot Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Jean-Marc Dressler <polux@via.ecp.fr> * Jean-Marc Dressler <polux@via.ecp.fr>
...@@ -172,4 +172,28 @@ void vpar_InitBMBType( struct vpar_thread_s * p_vpar ); ...@@ -172,4 +172,28 @@ 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_InitScanTable( struct vpar_thread_s * p_vpar ); void vpar_InitScanTable( struct vpar_thread_s * p_vpar );
void vpar_PictureData( struct vpar_thread_s * p_vpar, int i_mb_base );
typedef void (*f_picture_data_t)( struct vpar_thread_s * p_vpar,
int i_mb_base );
#define PROTO_PICD( FUNCNAME ) \
void FUNCNAME( struct vpar_thread_s * p_vpar, int i_mb_base );
PROTO_PICD( vpar_PictureDataGENERIC )
#if (VPAR_OPTIM_LEVEL > 0)
PROTO_PICD( vpar_PictureData1I )
PROTO_PICD( vpar_PictureData1P )
PROTO_PICD( vpar_PictureData1B )
PROTO_PICD( vpar_PictureData1D )
PROTO_PICD( vpar_PictureData2IF )
PROTO_PICD( vpar_PictureData2PF )
PROTO_PICD( vpar_PictureData2BF )
#endif
#if (VPAR_OPTIM_LEVEL > 1)
PROTO_PICD( vpar_PictureData2IT )
PROTO_PICD( vpar_PictureData2PT )
PROTO_PICD( vpar_PictureData2BT )
PROTO_PICD( vpar_PictureData2IB )
PROTO_PICD( vpar_PictureData2PB )
PROTO_PICD( vpar_PictureData2BB )
#endif
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* video_parser.h : video parser thread * video_parser.h : video parser thread
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: video_parser.h,v 1.6 2001/01/18 05:13:23 sam Exp $ * $Id: video_parser.h,v 1.7 2001/01/21 01:36:25 massiot Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -83,6 +83,8 @@ typedef struct video_buffer_s ...@@ -83,6 +83,8 @@ typedef struct video_buffer_s
*****************************************************************************/ *****************************************************************************/
typedef struct vpar_thread_s typedef struct vpar_thread_s
{ {
bit_stream_t bit_stream;
/* Thread properties and locks */ /* Thread properties and locks */
vlc_thread_t thread_id; /* id for thread functions */ vlc_thread_t thread_id; /* id for thread functions */
...@@ -93,7 +95,6 @@ typedef struct vpar_thread_s ...@@ -93,7 +95,6 @@ typedef struct vpar_thread_s
/* Input properties */ /* Input properties */
decoder_fifo_t * p_fifo; /* PES input fifo */ decoder_fifo_t * p_fifo; /* PES input fifo */
bit_stream_t bit_stream;
vdec_config_t * p_config; vdec_config_t * p_config;
/* Output properties */ /* Output properties */
......
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vpar_headers.c : headers parsing * vpar_headers.c : headers parsing
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: vpar_headers.c,v 1.74 2001/01/18 05:13:23 sam Exp $ * $Id: vpar_headers.c,v 1.75 2001/01/21 01:36:26 massiot Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -572,7 +572,7 @@ static void PictureHeader( vpar_thread_t * p_vpar ) ...@@ -572,7 +572,7 @@ static void PictureHeader( vpar_thread_t * p_vpar )
p_vpar->picture.i_current_structure = 0; p_vpar->picture.i_current_structure = 0;
intf_DbgMsg("vpar debug: odd number of field picture."); intf_ErrMsg("vpar error: odd number of field pictures.");
} }
/* Do we have the reference pictures ? */ /* Do we have the reference pictures ? */
...@@ -737,7 +737,68 @@ static void PictureHeader( vpar_thread_t * p_vpar ) ...@@ -737,7 +737,68 @@ static void PictureHeader( vpar_thread_t * p_vpar )
/* Extension and User data. */ /* Extension and User data. */
ExtensionAndUserData( p_vpar ); ExtensionAndUserData( p_vpar );
vpar_PictureData( p_vpar, i_mb_base ); /* This is an MP@ML decoder, please note that neither of the following
* assertions can be true :
* p_vpar->sequence.i_chroma_format != CHROMA_420
* p_vpar->sequence.i_height > 2800
* p_vpar->sequence.i_scalable_mode == SC_DP
* Be cautious if you try to use the decoder for other profiles and
* levels.
*/
if( p_vpar->sequence.b_mpeg2 )
{
static f_picture_data_t ppf_picture_data[4][4] =
{
{
NULL, NULL, NULL, NULL
},
{
/* TOP_FIELD */
#if (VPAR_OPTIM_LEVEL > 1)
NULL, vpar_PictureData2IT, vpar_PictureData2PT,
vpar_PictureData2BT
#else
NULL, vpar_PictureDataGENERIC, vpar_PictureDataGENERIC,
vpar_PictureDataGENERIC
#endif
},
{
/* BOTTOM_FIELD */
#if (VPAR_OPTIM_LEVEL > 1)
NULL, vpar_PictureData2IB, vpar_PictureData2PB,
vpar_PictureData2BB
#else
NULL, vpar_PictureDataGENERIC, vpar_PictureDataGENERIC,
vpar_PictureDataGENERIC
#endif
},
{
/* FRAME_PICTURE */
#if (VPAR_OPTIM_LEVEL > 0)
NULL, vpar_PictureData2IF, vpar_PictureData2PF,
vpar_PictureData2BF
#else
NULL, vpar_PictureDataGENERIC, vpar_PictureDataGENERIC,
vpar_PictureDataGENERIC
#endif
}
};
ppf_picture_data[p_vpar->picture.i_structure]
[p_vpar->picture.i_coding_type]( p_vpar, i_mb_base );
}
else
{
#if (VPAR_OPTIM_LEVEL > 0)
static f_picture_data_t pf_picture_data[5] =
{ NULL, vpar_PictureData1I, vpar_PictureData1P, vpar_PictureData1B,
vpar_PictureData1D };
pf_picture_data[p_vpar->picture.i_coding_type]( p_vpar, i_mb_base );
#else
vpar_PictureDataGENERIC( p_vpar, i_mb_base );
#endif
}
if( p_vpar->p_fifo->b_die || p_vpar->p_fifo->b_error ) if( p_vpar->p_fifo->b_die || p_vpar->p_fifo->b_error )
{ {
......
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