Commit fdcd1cca authored by Christophe Massiot's avatar Christophe Massiot

Minor optimizations in the video decoder.

parent 290dc45a
...@@ -57,8 +57,10 @@ typedef struct picture_s ...@@ -57,8 +57,10 @@ typedef struct picture_s
/* Picture static properties - those properties are fixed at initialization /* Picture static properties - those properties are fixed at initialization
* and should NOT be modified */ * and should NOT be modified */
int i_width; /* picture width */ int i_width; /* picture width */
int i_height; /* picture height */
int i_chroma_width; /* chroma width */ int i_chroma_width; /* chroma width */
int i_height; /* picture height */
int i_size; /* number of pels */
int i_chroma_size; /* number of chroma pels */
/* Picture dynamic properties - those properties can be changed by the /* Picture dynamic properties - those properties can be changed by the
* decoder */ * decoder */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vdec_motion_common.c : common motion compensation routines common * vdec_motion_common.c : common motion compensation routines common
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: vdec_motion_common.c,v 1.4 2001/02/19 19:08:59 massiot Exp $ * $Id: vdec_motion_common.c,v 1.5 2001/02/20 15:03:00 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>
...@@ -207,7 +207,8 @@ static __inline__ void Motion420( ...@@ -207,7 +207,8 @@ static __inline__ void Motion420(
+ b_source_field) + b_source_field)
* p_mb->p_picture->i_width * p_mb->p_picture->i_width
+ (i_mv_y >> 1) * i_l_stride; + (i_mv_y >> 1) * i_l_stride;
if( i_source_offset >= p_source->i_width * p_source->i_height )
if( i_source_offset >= p_source->i_size )
{ {
intf_WarnMsg( 2, "Bad motion vector (lum)" ); intf_WarnMsg( 2, "Bad motion vector (lum)" );
return; return;
...@@ -234,7 +235,8 @@ static __inline__ void Motion420( ...@@ -234,7 +235,8 @@ static __inline__ void Motion420(
+ b_source_field) + b_source_field)
* p_mb->p_picture->i_chroma_width * p_mb->p_picture->i_chroma_width
+ ((i_mv_y/2) >> 1) * i_c_stride; + ((i_mv_y/2) >> 1) * i_c_stride;
if( i_source_offset >= (p_source->i_width * p_source->i_height) / 4 )
if( i_source_offset >= p_source->i_chroma_size )
{ {
intf_WarnMsg( 2, "Bad motion vector (chroma)" ); intf_WarnMsg( 2, "Bad motion vector (chroma)" );
return; return;
......
...@@ -674,6 +674,9 @@ picture_t *vout_CreatePicture( vout_thread_t *p_vout, int i_type, ...@@ -674,6 +674,9 @@ picture_t *vout_CreatePicture( vout_thread_t *p_vout, int i_type,
p_free_picture->i_width = i_width; p_free_picture->i_width = i_width;
p_free_picture->i_height = i_height; p_free_picture->i_height = i_height;
p_free_picture->i_chroma_width = i_chroma_width; p_free_picture->i_chroma_width = i_chroma_width;
p_free_picture->i_size = i_width * i_height;
p_free_picture->i_chroma_size = i_chroma_width
* i_height;
p_free_picture->i_display_horizontal_offset = 0; p_free_picture->i_display_horizontal_offset = 0;
p_free_picture->i_display_vertical_offset = 0; p_free_picture->i_display_vertical_offset = 0;
p_free_picture->i_display_width = i_width; p_free_picture->i_display_width = i_width;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* video_parser.c : video parser thread * video_parser.c : video parser thread
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: video_parser.c,v 1.75 2001/02/18 03:32:02 polux Exp $ * $Id: video_parser.c,v 1.76 2001/02/20 15:03:00 massiot Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr> * Samuel Hocevar <sam@via.ecp.fr>
...@@ -300,9 +300,6 @@ static int InitThread( vpar_thread_t *p_vpar ) ...@@ -300,9 +300,6 @@ static int InitThread( vpar_thread_t *p_vpar )
#endif #endif
/* Initialize lookup tables */ /* Initialize lookup tables */
#if defined(MPEG2_COMPLIANT) && !defined(VDEC_DFT)
vpar_InitCrop( p_vpar );
#endif
vpar_InitMbAddrInc( p_vpar ); vpar_InitMbAddrInc( p_vpar );
vpar_InitDCTTables( p_vpar ); vpar_InitDCTTables( p_vpar );
vpar_InitPMBType( p_vpar ); vpar_InitPMBType( p_vpar );
......
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