Commit f6268f60 authored by Sam Hocevar's avatar Sam Hocevar

* vlc.init becomes ~/.vlcrc

  * removed float operations in the video decoder, and all emms asm functions
  * borrowed linuxvideo's MMX motion compensation
  * fixed an undefined symbol in the MMX YUV plugin

Meuuh & Sam.
parent 52d7937c
......@@ -2,8 +2,7 @@
Rgis Duchesne <regis@via.ecp.fr>
Michel Lespinasse <walken@wrs.com>
Olivier Baxa <oli@via.ecp.fr>
Eric Estievenart <eric@via.ecp.fr>
Olivier Pomel <pomel@via.ecp.fr>
Jean-Philippe Grimaldi <jeanphi@via.ecp.fr>
Andres Krapf <dae@via.ecp.fr>
......@@ -14,11 +13,9 @@
Jean-Marc Dressler <polux@via.ecp.fr>
Gal Hendryckx <jimmy@via.ecp.fr>
Samuel Hocevar <sam@via.ecp.fr>
Brieuc Jeunhomme <bbp@via.ecp.fr>
Michel Kaempf <maxx@via.ecp.fr>
Stphane Borel <stef@via.ecp.fr>
Renaud Dartus <reno@via.ecp.fr>
Henri Fallon <henri@via.ecp.fr>
Contributors include Aaron Holtzman for his ac3dec decoder, and the
LiViD team for a few lines of code we borrowed here and there.
......@@ -5,6 +5,10 @@
* "gvlc", "fbvlc", "ggivlc" aliases now work
* fixed functions that weren't properly inlined
* removed bloat from the MMX YUV plugin
* vlc.init becomes ~/.vlcrc
* removed float operations in the video decoder, and all emms asm functions
* borrowed linuxvideo's MMX motion compensation
* fixed an undefined symbol in the MMX YUV plugin
Thu Jul 20 15:14:06 CEST 2000
0.1.99e :
......
......@@ -156,69 +156,75 @@ endif
#
# C Objects
#
interface_obj = interface/main.o \
interface/interface.o \
interface/intf_msg.o \
interface/intf_cmd.o \
interface/intf_ctrl.o \
interface/intf_console.o
input_obj = input/input_vlan.o \
input/input_file.o \
input/input_netlist.o \
input/input_network.o \
input/input_ctrl.o \
input/input_pcr.o \
input/input_psi.o \
input/input.o
audio_output_obj = audio_output/audio_output.o
video_output_obj = video_output/video_output.o \
video_output/video_text.o \
video_output/video_spu.o \
video_output/video_yuv.o
ac3_decoder_obj = ac3_decoder/ac3_decoder_thread.o \
ac3_decoder/ac3_decoder.o \
ac3_decoder/ac3_parse.o \
ac3_decoder/ac3_exponent.o \
ac3_decoder/ac3_bit_allocate.o \
ac3_decoder/ac3_mantissa.o \
ac3_decoder/ac3_rematrix.o \
ac3_decoder/ac3_imdct.o \
ac3_decoder/ac3_downmix.o
interface_obj = interface/main.o \
interface/interface.o \
interface/intf_msg.o \
interface/intf_cmd.o \
interface/intf_ctrl.o \
interface/intf_console.o
input_obj = input/input_vlan.o \
input/input_file.o \
input/input_netlist.o \
input/input_network.o \
input/input_ctrl.o \
input/input_pcr.o \
input/input_psi.o \
input/input.o
audio_output_obj = audio_output/audio_output.o
video_output_obj = video_output/video_output.o \
video_output/video_text.o \
video_output/video_spu.o \
video_output/video_yuv.o
ac3_decoder_obj = ac3_decoder/ac3_decoder_thread.o \
ac3_decoder/ac3_decoder.o \
ac3_decoder/ac3_parse.o \
ac3_decoder/ac3_exponent.o \
ac3_decoder/ac3_bit_allocate.o \
ac3_decoder/ac3_mantissa.o \
ac3_decoder/ac3_rematrix.o \
ac3_decoder/ac3_imdct.o \
ac3_decoder/ac3_downmix.o
lpcm_decoder_obj = lpcm_decoder/lpcm_decoder_thread.o \
lpcm_decoder/lpcm_decoder.o
lpcm_decoder_obj = lpcm_decoder/lpcm_decoder_thread.o \
lpcm_decoder/lpcm_decoder.o
audio_decoder_obj = audio_decoder/audio_decoder_thread.o \
audio_decoder/audio_decoder.o \
audio_decoder/audio_math.o
audio_decoder_obj = audio_decoder/audio_decoder_thread.o \
audio_decoder/audio_decoder.o \
audio_decoder/audio_math.o
spu_decoder_obj = spu_decoder/spu_decoder.o
spu_decoder_obj = spu_decoder/spu_decoder.o
#??generic_decoder_obj = generic_decoder/generic_decoder.o
# remeber to add it to OBJ
video_parser_obj = video_parser/video_parser.o \
video_parser/vpar_headers.o \
video_parser/vpar_blocks.o \
video_parser/vpar_synchro.o \
video_parser/video_fifo.o
video_decoder_obj = video_decoder/video_decoder.o \
video_decoder/vdec_motion.o \
video_decoder/vdec_motion_inner.o \
video_decoder/vdec_idct.o
misc_obj = misc/mtime.o \
misc/tests.o \
misc/rsc_files.o \
misc/netutils.o \
misc/playlist.o \
misc/plugins.o \
misc/decoder_fifo.o
video_parser_obj = video_parser/video_parser.o \
video_parser/vpar_headers.o \
video_parser/vpar_blocks.o \
video_parser/vpar_synchro.o \
video_parser/video_fifo.o
ifneq (,$(findstring mmx,$(ARCH)))
vdec_motion_inner = video_decoder/vdec_motion_inner_mmx.o
else
vdec_motion_inner = video_decoder/vdec_motion_inner.o
endif
video_decoder_obj = video_decoder/video_decoder.o \
video_decoder/vdec_motion.o \
video_decoder/vdec_idct.o \
$(vdec_motion_inner)
misc_obj = misc/mtime.o \
misc/tests.o \
misc/rsc_files.o \
misc/netutils.o \
misc/playlist.o \
misc/plugins.o \
misc/decoder_fifo.o
C_OBJ = $(interface_obj) \
......
......@@ -127,8 +127,8 @@
*****************************************************************************/
/* Environment variable used to store startup script name and default value */
#define INTF_INIT_SCRIPT_VAR "vlc_init"
#define INTF_INIT_SCRIPT_DEFAULT "vlc.init"
#define INTF_INIT_SCRIPT_VAR "vlcrc"
#define INTF_INIT_SCRIPT_DEFAULT ".vlcrc"
/* Environment variable used to store channels file and default value */
#define INTF_CHANNELS_VAR "vlc_channels"
......@@ -434,6 +434,7 @@
* Synchro configuration
*****************************************************************************/
#define VOUT_SYNCHRO_LEVEL_START 5
#define VOUT_SYNCHRO_LEVEL_MAX 15
#define VOUT_SYNCHRO_LEVEL_START 5 << 10
#define VOUT_SYNCHRO_LEVEL_MAX 15 << 10
#define VOUT_SYNCHRO_HEAP_IDEAL_SIZE 5
......@@ -166,17 +166,4 @@ void vpar_InitPMBType( 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_InitDCTTables( struct vpar_thread_s * p_vpar );
void vpar_PictureDataGENERIC( struct vpar_thread_s * p_vpar, int i_mb_base );
#if (VPAR_OPTIM_LEVEL > 0)
void vpar_PictureData2I420F0( struct vpar_thread_s * p_vpar, int i_mb_base );
void vpar_PictureData2P420F0( struct vpar_thread_s * p_vpar, int i_mb_base );
void vpar_PictureData2B420F0( struct vpar_thread_s * p_vpar, int i_mb_base );
#endif
#if (VPAR_OPTIM_LEVEL > 1)
void vpar_PictureData2I420TZ( struct vpar_thread_s * p_vpar, int i_mb_base );
void vpar_PictureData2P420TZ( struct vpar_thread_s * p_vpar, int i_mb_base );
void vpar_PictureData2B420TZ( struct vpar_thread_s * p_vpar, int i_mb_base );
void vpar_PictureData2I420BZ( struct vpar_thread_s * p_vpar, int i_mb_base );
void vpar_PictureData2P420BZ( struct vpar_thread_s * p_vpar, int i_mb_base );
void vpar_PictureData2B420BZ( struct vpar_thread_s * p_vpar, int i_mb_base );
#endif
void vpar_PictureData( struct vpar_thread_s * p_vpar, int i_mb_base );
......@@ -58,7 +58,7 @@ typedef struct sequence_s
/* the same, in macroblock units */
unsigned int i_aspect_ratio; /* height/width display ratio */
unsigned int i_matrix_coefficients;/* coeffs of the YUV transform */
float r_frame_rate; /* theoritical frame rate in fps */
int i_frame_rate; /* theoritical frame rate in fps*1001 */
boolean_t b_mpeg2; /* guess */
boolean_t b_progressive; /* progressive (ie.
* non-interlaced) frame */
......
......@@ -67,9 +67,9 @@ typedef struct video_synchro_s
/* can we display pictures ? */
boolean_t b_all_I;
boolean_t b_all_P;
double displayable_p;
int displayable_p;
boolean_t b_all_B;
double displayable_b;
int displayable_b;
} video_synchro_t;
......@@ -100,7 +100,7 @@ typedef struct video_synchro_s
/* Date Section */
/* Dates needed to compute the date of the current frame
* We also use the stream frame rate (sequence.r_frame_rate) */
* We also use the stream frame rate (sequence.i_frame_rate) */
mtime_t i_current_frame_date;
mtime_t i_backward_frame_date;
......
......@@ -131,12 +131,8 @@ int yuv_MMXReset( vout_thread_t *p_vout )
+ *****************************************************************************/
void SetYUV( vout_thread_t *p_vout )
{
int pi_gamma[256]; /* gamma table */
int i_index; /* index in tables */
/* Build gamma table */
SetGammaTable( pi_gamma, p_vout->f_gamma );
/*
* Set pointers and build YUV tables
*/
......
......@@ -53,7 +53,6 @@ int i_pic_height, int i_pic_line_width, int i_matrix_coefficients
/*****************************************************************************
* Local prototypes
*****************************************************************************/
void SetGammaTable ( int *pi_table, double f_gamma );
void SetYUV ( vout_thread_t *p_vout );
void SetOffset ( int i_width, int i_height, int i_pic_width,
int i_pic_height, boolean_t *pb_h_scaling,
......
......@@ -158,14 +158,23 @@ int intf_ExecScript( char *psz_filename )
FILE * p_file; /* file */
char psz_line[INTF_MAX_CMD_SIZE]; /* line */
char * psz_index; /* index in string */
char * psz_vlcrc; /* full path to vlcrc */
int i_err; /* error indicator */
/* Open file */
i_err = 0;
p_file = fopen( psz_filename, "r" );
if( !( psz_index = getenv("HOME") ) )
{
psz_index = "/";
}
psz_vlcrc = malloc( strlen( psz_index ) + 1 + strlen( psz_filename ) + 1 );
sprintf( psz_vlcrc, "%s/%s", psz_index, psz_filename );
p_file = fopen( psz_vlcrc, "r" );
if( p_file == NULL )
{
intf_DbgMsg("intf warning: %s: %s\n", psz_filename, strerror(errno));
intf_DbgMsg("intf warning: %s: %s\n", psz_vlcrc, strerror(errno));
return( -1 );
}
......@@ -194,7 +203,7 @@ int intf_ExecScript( char *psz_filename )
}
if( !feof( p_file ) )
{
intf_ErrMsg("error: %s: %s\n", psz_filename, strerror(errno));
intf_ErrMsg("error: %s: %s\n", psz_vlcrc, strerror(errno));
return( -1 );
}
......
......@@ -322,8 +322,8 @@ static __inline__ void AddBlock( vdec_thread_t * p_vdec, dctelem_t * p_block,
"packuswb %%mm1,%%mm2\n\t"
"movq %%mm2,(%0)\n\t"
"emms"
:"+r" (p_data): "r" (p_block),"r" (i_incr+8));
//"emms"
:"+r" (p_data): "r" (p_block),"r" (i_incr+8));
}
#endif
......@@ -389,7 +389,7 @@ static __inline__ void CopyBlock( vdec_thread_t * p_vdec, dctelem_t * p_block,
"movq 112(%1),%%mm0\n\t"
"packuswb 120(%1),%%mm0\n\t"
"movq %%mm0,(%0)\n\t"
"emms"
//"emms"
:"+r" (p_data): "r" (p_block),"r" (i_incr+8));
}
#endif
......
......@@ -1691,7 +1691,7 @@ static void RenderPictureInfo( vout_thread_t *p_vout, picture_t *p_pic )
*/
if( p_vout->c_fps_samples > VOUT_FPS_SAMPLES )
{
sprintf( psz_buffer, "%.2f fps", (double) VOUT_FPS_SAMPLES * 1000000 /
sprintf( psz_buffer, "%.2f fps/10", VOUT_FPS_SAMPLES * 1000000 * 10 /
( p_vout->p_fps_sample[ (p_vout->c_fps_samples - 1) % VOUT_FPS_SAMPLES ] -
p_vout->p_fps_sample[ p_vout->c_fps_samples % VOUT_FPS_SAMPLES ] ) );
Print( p_vout, 0, 0, RIGHT_RALIGN, TOP_RALIGN, psz_buffer );
......@@ -1939,7 +1939,7 @@ static void Synchronize( vout_thread_t *p_vout, s64 i_delay )
/* XXX?? gore following */
static int i_panic_count = 0;
static int i_last_synchro_inc = 0;
static float r_synchro_level = VOUT_SYNCHRO_LEVEL_START;
static int i_synchro_level = VOUT_SYNCHRO_LEVEL_START;
static int i_truc = 10;
if( i_delay < 0 )
......@@ -1965,7 +1965,7 @@ static void Synchronize( vout_thread_t *p_vout, s64 i_delay )
}
}
if( i_truc > VOUT_SYNCHRO_LEVEL_MAX*2*2*2*2*2 ||
if( i_truc > VOUT_SYNCHRO_LEVEL_MAX >> 5 ||
i_synchro_inc*i_last_synchro_inc < 0 )
{
i_truc = 32;
......@@ -1985,17 +1985,17 @@ static void Synchronize( vout_thread_t *p_vout, s64 i_delay )
}
else if( i_delay > 100000 )
{
r_synchro_level += 1;
i_synchro_level += 1 << 10;
if( i_delay > 130000 )
r_synchro_level += 1;
i_synchro_level += 1 << 10;
}
r_synchro_level += (float)i_synchro_inc / i_truc;
p_vout->i_synchro_level = (int)(r_synchro_level+0.5);
i_synchro_level += ( i_synchro_inc << 10 ) / i_truc;
p_vout->i_synchro_level = ( i_synchro_level + (1 << 9) );
if( r_synchro_level > VOUT_SYNCHRO_LEVEL_MAX )
if( i_synchro_level > VOUT_SYNCHRO_LEVEL_MAX )
{
r_synchro_level = VOUT_SYNCHRO_LEVEL_MAX;
i_synchro_level = VOUT_SYNCHRO_LEVEL_MAX;
}
//fprintf( stderr, "synchro level : %d, heap : %d (%d, %d) (%d, %f) - %Ld\n", p_vout->i_synchro_level,
......
......@@ -291,14 +291,14 @@ static int InitThread( vpar_thread_t *p_vpar )
p_vpar->synchro.i_delay = 200000;
p_vpar->synchro.i_theorical_delay = 40000; /* 25 fps */
/* assume we can display all Is and 2 Ps */
p_vpar->synchro.b_all_I = 1;
p_vpar->synchro.b_all_I = 1 << 10;
p_vpar->synchro.b_all_P = 0;
p_vpar->synchro.displayable_p = 2;
p_vpar->synchro.displayable_p = 2 << 10;
p_vpar->synchro.b_all_B = 0;
p_vpar->synchro.displayable_b = 0;
/* assume there were about 3 P and 6 B images between I's */
p_vpar->synchro.i_P_seen = p_vpar->synchro.i_P_kept = 1;
p_vpar->synchro.i_B_seen = p_vpar->synchro.i_B_kept = 1;
p_vpar->synchro.i_P_seen = p_vpar->synchro.i_P_kept = 1 << 10;
p_vpar->synchro.i_B_seen = p_vpar->synchro.i_B_kept = 1 << 10;
#endif
#ifdef MEUUH_SYNCHRO
......
......@@ -618,7 +618,7 @@ void vpar_InitDCTTables( vpar_thread_t * p_vpar )
/*****************************************************************************
* DecodeMPEG1NonIntra : decode MPEG-1 non-intra blocks
*****************************************************************************/
static void DecodeMPEG1NonIntra( vpar_thread_t * p_vpar,
static __inline__ void DecodeMPEG1NonIntra( vpar_thread_t * p_vpar,
macroblock_t * p_mb, int i_b,
int i_chroma_format )
{
......@@ -729,7 +729,7 @@ static void DecodeMPEG1NonIntra( vpar_thread_t * p_vpar,
/*****************************************************************************
* DecodeMPEG1Intra : decode MPEG-1 intra blocks
*****************************************************************************/
static void DecodeMPEG1Intra( vpar_thread_t * p_vpar,
static __inline__ void DecodeMPEG1Intra( vpar_thread_t * p_vpar,
macroblock_t * p_mb, int i_b ,
int i_chroma_format )
{
......@@ -876,7 +876,7 @@ static void DecodeMPEG1Intra( vpar_thread_t * p_vpar,
/*****************************************************************************
* DecodeMPEG2NonIntra : decode MPEG-2 non-intra blocks
*****************************************************************************/
static void DecodeMPEG2NonIntra( vpar_thread_t * p_vpar,
static __inline__ void DecodeMPEG2NonIntra( vpar_thread_t * p_vpar,
macroblock_t * p_mb, int i_b,
int i_chroma_format )
{
......@@ -985,7 +985,7 @@ static void DecodeMPEG2NonIntra( vpar_thread_t * p_vpar,
/*****************************************************************************
* DecodeMPEG2Intra : decode MPEG-2 intra blocks
*****************************************************************************/
static void DecodeMPEG2Intra( vpar_thread_t * p_vpar,
static __inline__ void DecodeMPEG2Intra( vpar_thread_t * p_vpar,
macroblock_t * p_mb, int i_b,
int i_chroma_format )
{
......@@ -1135,7 +1135,7 @@ static void DecodeMPEG2Intra( vpar_thread_t * p_vpar,
/****************************************************************************
* MotionCode : Parse the next motion code
****************************************************************************/
static int MotionCode( vpar_thread_t * p_vpar )
static __inline__ int MotionCode( vpar_thread_t * p_vpar )
{
int i_code;
static lookup_t pl_mv_tab0[8] =
......@@ -1184,7 +1184,7 @@ static int MotionCode( vpar_thread_t * p_vpar )
/****************************************************************************
* DecodeMotionVector : Decode a motion_vector
****************************************************************************/
static void DecodeMotionVector( int * pi_prediction, int i_r_size,
static __inline__ void DecodeMotionVector( int * pi_prediction, int i_r_size,
int i_motion_code, int i_motion_residual, int i_full_pel )
{
int i_limit, i_vector;
......@@ -1211,7 +1211,7 @@ static void DecodeMotionVector( int * pi_prediction, int i_r_size,
/****************************************************************************
* MotionVector : Parse the next motion_vector field
****************************************************************************/
static void MotionVector( vpar_thread_t * p_vpar,
static __inline__ void MotionVector( vpar_thread_t * p_vpar,
macroblock_t * p_mb, int i_r,
int i_s, int i_full_pel, int i_structure )
{
......@@ -1321,7 +1321,7 @@ static void MotionVector( vpar_thread_t * p_vpar,
* DecodeMVMPEG1 : Parse the next MPEG-1 motion vectors
*****************************************************************************/
static void DecodeMVMPEG1( vpar_thread_t * p_vpar,
macroblock_t * p_mb, int i_s, int i_structure )
macroblock_t * p_mb, int i_s, int i_structure )
{
MotionVector( p_vpar, p_mb, 0, i_s,
p_vpar->picture.pb_full_pel_vector[i_s], i_structure );
......@@ -1331,7 +1331,7 @@ static void DecodeMVMPEG1( vpar_thread_t * p_vpar,
* DecodeMVMPEG2 : Parse the next MPEG-2 motion_vectors field
*****************************************************************************/
static void DecodeMVMPEG2( vpar_thread_t * p_vpar,
macroblock_t * p_mb, int i_s, int i_structure )
macroblock_t * p_mb, int i_s, int i_structure )
{
if( p_vpar->mb.i_mv_count == 1 )
{
......@@ -1389,7 +1389,7 @@ static int MacroblockAddressIncrement( vpar_thread_t * p_vpar )
/*****************************************************************************
* IMBType : macroblock_type in I pictures
*****************************************************************************/
static int IMBType( vpar_thread_t * p_vpar )
static __inline__ int IMBType( vpar_thread_t * p_vpar )
{
/* Take two bits for testing */
int i_type = ShowBits( &p_vpar->bit_stream, 2 );
......@@ -1407,7 +1407,7 @@ static int IMBType( vpar_thread_t * p_vpar )
/*****************************************************************************
* PMBType : macroblock_type in P pictures
*****************************************************************************/
static int PMBType( vpar_thread_t * p_vpar )
static __inline__ int PMBType( vpar_thread_t * p_vpar )
{
/* Testing on 6 bits */
int i_type = ShowBits( &p_vpar->bit_stream, 6 );
......@@ -1421,7 +1421,7 @@ static int PMBType( vpar_thread_t * p_vpar )
/*****************************************************************************
* BMBType : macroblock_type in B pictures
*****************************************************************************/
static int BMBType( vpar_thread_t * p_vpar )
static __inline__ int BMBType( vpar_thread_t * p_vpar )
{
/* Testing on 6 bits */
int i_type = ShowBits( &p_vpar->bit_stream, 6 );
......@@ -1436,7 +1436,7 @@ static int BMBType( vpar_thread_t * p_vpar )
/*****************************************************************************
* DMBType : macroblock_type in D pictures
*****************************************************************************/
static int DMBType( vpar_thread_t * p_vpar )
static __inline__ int DMBType( vpar_thread_t * p_vpar )
{
return GetBits( &p_vpar->bit_stream, 1 );
}
......@@ -1444,7 +1444,7 @@ static int DMBType( vpar_thread_t * p_vpar )
/*****************************************************************************
* CodedPattern420 : coded_block_pattern with 4:2:0 chroma
*****************************************************************************/
static int CodedPattern420( vpar_thread_t * p_vpar )
static __inline__ int CodedPattern420( vpar_thread_t * p_vpar )
{
/* Take the max 9 bits length vlc code for testing */
int i_vlc = ShowBits( &p_vpar->bit_stream, 9 );
......@@ -1459,7 +1459,7 @@ static int CodedPattern420( vpar_thread_t * p_vpar )
/*****************************************************************************
* CodedPattern422 : coded_block_pattern with 4:2:2 chroma
*****************************************************************************/
static int CodedPattern422( vpar_thread_t * p_vpar )
static __inline__ int CodedPattern422( vpar_thread_t * p_vpar )
{
int i_vlc = ShowBits( &p_vpar->bit_stream, 9 );
......@@ -1473,7 +1473,7 @@ static int CodedPattern422( vpar_thread_t * p_vpar )
/*****************************************************************************
* CodedPattern444 : coded_block_pattern with 4:4:4 chroma
*****************************************************************************/
static int CodedPattern444( vpar_thread_t * p_vpar )
static __inline__ int CodedPattern444( vpar_thread_t * p_vpar )
{
int i_vlc = ShowBits( &p_vpar->bit_stream, 9 );
......@@ -1486,7 +1486,7 @@ static int CodedPattern444( vpar_thread_t * p_vpar )
/*****************************************************************************
* InitMacroblock : Initialize macroblock values
*****************************************************************************/
static void InitMacroblock( vpar_thread_t * p_vpar,
static __inline__ void InitMacroblock( vpar_thread_t * p_vpar,
macroblock_t * p_mb, int i_coding_type,
int i_chroma_format,
int i_structure,
......@@ -1521,7 +1521,7 @@ static void InitMacroblock( vpar_thread_t * p_vpar,
/*****************************************************************************
* UpdateContext : Update the p_vpar contextual values
*****************************************************************************/
static void UpdateContext( vpar_thread_t * p_vpar, int i_structure )
static __inline__ void UpdateContext( vpar_thread_t * p_vpar, int i_structure )
{
/* Update macroblock real position. */
p_vpar->mb.i_l_x += 16;
......@@ -1539,7 +1539,7 @@ static void UpdateContext( vpar_thread_t * p_vpar, int i_structure )
/*****************************************************************************
* SkippedMacroblock : Generate a skipped macroblock with NULL motion vector
*****************************************************************************/
static void SkippedMacroblock( vpar_thread_t * p_vpar, int i_mb,
static __inline__ void SkippedMacroblock( vpar_thread_t * p_vpar, int i_mb,
int i_mb_base, int i_coding_type,
int i_chroma_format,
int i_structure,
......@@ -1599,7 +1599,7 @@ static void SkippedMacroblock( vpar_thread_t * p_vpar, int i_mb,
/*****************************************************************************
* MacroblockModes : Get the macroblock_modes structure
*****************************************************************************/
static void MacroblockModes( vpar_thread_t * p_vpar,
static __inline__ void MacroblockModes( vpar_thread_t * p_vpar,
macroblock_t * p_mb,
int i_chroma_format,
int i_coding_type,
......@@ -1683,7 +1683,6 @@ if( p_vpar->picture.b_error ) \
return; \
}
#define PARSEBLOCKS( MPEG1FUNC, MPEG2FUNC ) \
{ \
i_mask = 1 << (3 + (1 << i_chroma_format)); \
......@@ -1746,7 +1745,7 @@ if( p_vpar->picture.b_error ) \
} \
}
static void ParseMacroblock(
static __inline__ void ParseMacroblock(
vpar_thread_t * p_vpar,
int * pi_mb_address, /* previous address to be
* used for mb_addr_incr */
......@@ -1977,10 +1976,137 @@ i_count++;
* Picture data parsing management
*/
/*****************************************************************************
* ParseMacroblockVWXYZ : Parse the next macroblock ; specific functions
*****************************************************************************
* V = MPEG2 ?
* W = coding type ?
* X = chroma format ?
* Y = structure ?
* Z = second field ?
*****************************************************************************/
void ParseMacroblockGENERIC( vpar_thread_t * 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 )
{
/* ParseMacroblock( p_vpar, pi_mb_address, i_mb_previous, i_mb_base,
b_mpeg2, i_coding_type, i_chroma_format,
i_structure, b_second_field );*/
}
#if (VPAR_OPTIM_LEVEL > 0)
/* Optimizations for frame pictures */
void ParseMacroblock2I420F0( vpar_thread_t * 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 )
{
ParseMacroblock( p_vpar, pi_mb_address, i_mb_previous, i_mb_base,
1, I_CODING_TYPE, CHROMA_420,
FRAME_STRUCTURE, 0 );
}
void ParseMacroblock2P420F0( vpar_thread_t * 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 )
{
ParseMacroblock( p_vpar, pi_mb_address, i_mb_previous, i_mb_base,
1, P_CODING_TYPE, CHROMA_420,
FRAME_STRUCTURE, 0 );
}
void ParseMacroblock2B420F0( vpar_thread_t * 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 )
{
ParseMacroblock( p_vpar, pi_mb_address, i_mb_previous, i_mb_base,
1, B_CODING_TYPE, CHROMA_420,
FRAME_STRUCTURE, 0 );
}
#endif
#if (VPAR_OPTIM_LEVEL > 1)
/* Optimizations for field pictures */
void ParseMacroblock2I420TZ( vpar_thread_t * 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 )
{
ParseMacroblock( p_vpar, pi_mb_address, i_mb_previous, i_mb_base,
1, I_CODING_TYPE, CHROMA_420,
TOP_FIELD, (p_vpar->picture.i_structure !=
p_vpar->picture.i_current_structure) );
}
void ParseMacroblock2P420TZ( vpar_thread_t * 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 )
{
ParseMacroblock( p_vpar, pi_mb_address, i_mb_previous, i_mb_base,
1, P_CODING_TYPE, CHROMA_420,
TOP_FIELD, (p_vpar->picture.i_structure !=
p_vpar->picture.i_current_structure) );
}
void ParseMacroblock2B420TZ( vpar_thread_t * 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 )
{
ParseMacroblock( p_vpar, pi_mb_address, i_mb_previous, i_mb_base,
1, B_CODING_TYPE, CHROMA_420,
TOP_FIELD, (p_vpar->picture.i_structure !=
p_vpar->picture.i_current_structure) );
}
void ParseMacroblock2I420BZ( vpar_thread_t * 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 )
{
ParseMacroblock( p_vpar, pi_mb_address, i_mb_previous, i_mb_base,
1, I_CODING_TYPE, CHROMA_420,
BOTTOM_FIELD, (p_vpar->picture.i_structure !=
p_vpar->picture.i_current_structure) );
}
void ParseMacroblock2P420BZ( vpar_thread_t * 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 )
{
ParseMacroblock( p_vpar, pi_mb_address, i_mb_previous, i_mb_base,
1, P_CODING_TYPE, CHROMA_420,
BOTTOM_FIELD, (p_vpar->picture.i_structure !=
p_vpar->picture.i_current_structure) );
}
void ParseMacroblock2B420BZ( vpar_thread_t * 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 )
{
ParseMacroblock( p_vpar, pi_mb_address, i_mb_previous, i_mb_base,
1, B_CODING_TYPE, CHROMA_420,
BOTTOM_FIELD, (p_vpar->picture.i_structure !=
p_vpar->picture.i_current_structure) );
}
#endif
/*****************************************************************************
* SliceHeader : Parse the next slice structure
*****************************************************************************/
static void SliceHeader( vpar_thread_t * p_vpar,
typedef void (*f_parse_mb_t)( vpar_thread_t * 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 );
static __inline__ void SliceHeader( vpar_thread_t * p_vpar,
int * pi_mb_address, int i_mb_base,
u32 i_vert_code, boolean_t b_high,
boolean_t b_dp_scalable,
......@@ -1988,6 +2114,43 @@ static void SliceHeader( vpar_thread_t * p_vpar,
int i_chroma_format, int i_structure,
boolean_t b_second_field )
{
static f_parse_mb_t ppf_parse_mb[4][4] =
{
{
NULL, NULL, NULL, NULL
},
{
/* TOP_FIELD */
#if (VPAR_OPTIM_LEVEL > 1)
NULL, ParseMacroblock2I420TZ, ParseMacroblock2P420TZ,
ParseMacroblock2B420TZ
#else
NULL, ParseMacroblockGENERIC, ParseMacroblockGENERIC,
ParseMacroblockGENERIC
#endif
},
{
/* BOTTOM_FIELD */
#if (VPAR_OPTIM_LEVEL > 1)