]> git.sesse.net Git - vlc/commitdiff
Minor optimizations in the video decoder.
authorChristophe Massiot <massiot@videolan.org>
Tue, 20 Feb 2001 15:03:00 +0000 (15:03 +0000)
committerChristophe Massiot <massiot@videolan.org>
Tue, 20 Feb 2001 15:03:00 +0000 (15:03 +0000)
include/video.h
plugins/motion/vdec_motion_common.c
src/video_output/video_output.c
src/video_parser/video_parser.c

index f51689260462c3d5b6ea8d869f29df82fba6c5e7..e54ebee46a2cf87e11ce409e55a1fa3c4ea98b81 100644 (file)
@@ -57,8 +57,10 @@ typedef struct picture_s
     /* Picture static properties - those properties are fixed at initialization
      * and should NOT be modified */
     int             i_width;                                /* picture width */
-    int             i_height;                              /* picture height */
     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
      * decoder */
index df73182f81e073b04e6dac7d6c6f641eb7f47c6b..ac1d118e33678653129d34c7de6413f9f3f6da57 100644 (file)
@@ -2,7 +2,7 @@
  * vdec_motion_common.c : common motion compensation routines common
  *****************************************************************************
  * 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>
  *          Jean-Marc Dressler <polux@via.ecp.fr>
@@ -207,7 +207,8 @@ static __inline__ void Motion420(
                          + b_source_field)
                        * p_mb->p_picture->i_width
                        + (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)" );
         return;
@@ -234,7 +235,8 @@ static __inline__ void Motion420(
                            + b_source_field)
                           * p_mb->p_picture->i_chroma_width
                         + ((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)" );
         return;
index 6d48fd4b7c1925cc6fa0b6767fb35bdc593b3933..e358705ccd8a370e59744b34886767733d92fea4 100644 (file)
@@ -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_height                    = i_height;
             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_vertical_offset   = 0;
             p_free_picture->i_display_width             = i_width;
index 5b1dfe49640a9ea374d0d8c2aa55e4a65a6828dc..839a715eff9c83192643adf0f1f70c7e3e1f22d7 100644 (file)
@@ -2,7 +2,7 @@
  * video_parser.c : video parser thread
  *****************************************************************************
  * 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>
  *          Samuel Hocevar <sam@via.ecp.fr>
@@ -300,9 +300,6 @@ static int InitThread( vpar_thread_t *p_vpar )
 #endif
 
     /* Initialize lookup tables */
-#if defined(MPEG2_COMPLIANT) && !defined(VDEC_DFT)
-    vpar_InitCrop( p_vpar );
-#endif
     vpar_InitMbAddrInc( p_vpar );
     vpar_InitDCTTables( p_vpar );
     vpar_InitPMBType( p_vpar );