]> git.sesse.net Git - vlc/blobdiff - plugins/mpeg_vdec/vpar_headers.c
* ALL: changed __inline__ with inline (autoconf does the job for us anyway,
[vlc] / plugins / mpeg_vdec / vpar_headers.c
index d232a608189234d675a87e1d084f071ea1333e92..9516fdb41e77fb383111266e70c9e28d1ea8d5a8 100644 (file)
@@ -2,7 +2,7 @@
  * vpar_headers.c : headers parsing
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: vpar_headers.c,v 1.16 2002/03/14 01:35:28 stef Exp $
+ * $Id: vpar_headers.c,v 1.20 2002/05/18 17:47:47 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Stéphane Borel <stef@via.ecp.fr>
@@ -44,7 +44,7 @@
 /*
  * Local prototypes
  */
-static __inline__ void NextStartCode( bit_stream_t * );
+static inline void NextStartCode( bit_stream_t * );
 static void SequenceHeader( vpar_thread_t * p_vpar );
 static void GroupHeader( vpar_thread_t * p_vpar );
 static void PictureHeader( vpar_thread_t * p_vpar );
@@ -117,9 +117,9 @@ u8 pi_scan[2][64] ATTR_ALIGN(16) =
 /*****************************************************************************
  * ReferenceUpdate : Update the reference pointers when we have a new picture
  *****************************************************************************/
-static void __inline__ ReferenceUpdate( vpar_thread_t * p_vpar,
-                                        int i_coding_type,
-                                        picture_t * p_newref )
+static void inline ReferenceUpdate( vpar_thread_t * p_vpar,
+                                    int i_coding_type,
+                                    picture_t * p_newref )
 {
     if( i_coding_type != B_CODING_TYPE )
     {
@@ -150,9 +150,8 @@ static void __inline__ ReferenceUpdate( vpar_thread_t * p_vpar,
  * ReferenceReplace : Replace the last reference pointer when we destroy
  *                    a picture
  *****************************************************************************/
-static void __inline__ ReferenceReplace( vpar_thread_t * p_vpar,
-                                         int i_coding_type,
-                                         picture_t * p_newref )
+static void inline ReferenceReplace( vpar_thread_t * p_vpar, int i_coding_type,
+                                     picture_t * p_newref )
 {
     if( i_coding_type != B_CODING_TYPE )
     {
@@ -171,8 +170,8 @@ static void __inline__ ReferenceReplace( vpar_thread_t * p_vpar,
 /*****************************************************************************
  * LoadMatrix : Load a quantization matrix
  *****************************************************************************/
-static __inline__ void LoadMatrix( vpar_thread_t * p_vpar,
-                                   quant_matrix_t * p_matrix )
+static inline void LoadMatrix( vpar_thread_t * p_vpar,
+                               quant_matrix_t * p_matrix )
 {
     int i_dummy;
 
@@ -198,7 +197,7 @@ static __inline__ void LoadMatrix( vpar_thread_t * p_vpar,
 /*****************************************************************************
  * LinkMatrix : Link a quantization matrix to another
  *****************************************************************************/
-static __inline__ void LinkMatrix( quant_matrix_t * p_matrix, u8 * pi_array )
+static inline void LinkMatrix( quant_matrix_t * p_matrix, u8 * pi_array )
 {
     if( p_matrix->b_allocated )
     {
@@ -213,7 +212,7 @@ static __inline__ void LinkMatrix( quant_matrix_t * p_matrix, u8 * pi_array )
 /*****************************************************************************
  * ChromaToFourCC: Return a FourCC value used by the video output.
  *****************************************************************************/
-static __inline__ u64 ChromaToFourCC( int i_chroma )
+static inline u64 ChromaToFourCC( int i_chroma )
 {
     switch( i_chroma )
     {
@@ -279,6 +278,9 @@ int vpar_ParseHeader( vpar_thread_t * p_vpar )
 
     case SEQUENCE_END_CODE:
         intf_WarnMsg(3, "vpar warning: sequence end code received");
+
+        ReferenceUpdate( p_vpar, I_CODING_TYPE, NULL );
+
         return 1;
         break;
 
@@ -422,7 +424,8 @@ static void SequenceHeader( vpar_thread_t * p_vpar )
     }
 
     /* check whether the input gives a particular aspect ratio */
-    if( p_vpar->p_config->p_demux_data )
+    if( p_vpar->p_config->p_demux_data
+         && ( *(int*)(p_vpar->p_config->p_demux_data) & 0x7 ) )
     {
         i_aspect = *(int*)(p_vpar->p_config->p_demux_data);
     }
@@ -842,8 +845,6 @@ static void PictureHeader( vpar_thread_t * p_vpar )
         /* Initialize values. */
         vpar_SynchroDecode( p_vpar, p_vpar->picture.i_coding_type, i_structure );
         P_picture->i_matrix_coefficients = p_vpar->sequence.i_matrix_coefficients;
-        p_vpar->picture.i_field_width = ( p_vpar->sequence.i_width
-                    << ( 1 - p_vpar->picture.b_frame_structure ) );
 
         /* Update the reference pointers. */
         ReferenceUpdate( p_vpar, p_vpar->picture.i_coding_type, P_picture );
@@ -856,6 +857,13 @@ static void PictureHeader( vpar_thread_t * p_vpar )
         (i_structure != p_vpar->picture.i_current_structure);
     p_vpar->picture.b_current_field =
         (i_structure == BOTTOM_FIELD );
+    p_vpar->picture.i_lum_stride = p_vpar->picture.p_picture->Y_PITCH
+        << ( 1 - p_vpar->picture.b_frame_structure );
+    p_vpar->picture.i_chrom_stride = p_vpar->picture.p_picture->U_PITCH
+        << ( 1 - p_vpar->picture.b_frame_structure );
+    /* We suppose the pitch is the same for U and V planes. */
+    p_vpar->picture.i_field_width = p_vpar->sequence.i_width
+        << ( 1 - p_vpar->picture.b_frame_structure );
 
     if( !p_vpar->p_config->p_stream_ctrl->b_grayscale )
     {