]> git.sesse.net Git - vlc/blobdiff - include/vpar_headers.h
. fix� une b�vue dans la YUV 8 bits
[vlc] / include / vpar_headers.h
index 5036f0b94be3a1a0bb20a65b23c8df4563e01d18..6b27a1f1af8cd268f608c1c9ee5fef76516923cd 100644 (file)
@@ -1,28 +1,37 @@
 /*****************************************************************************
  * vpar_headers.h : video parser : headers parsing
- * (c)1999 VideoLAN
- *****************************************************************************
  *****************************************************************************
+ * Copyright (C) 1999, 2000 VideoLAN
+ *
+ * Authors:
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
  * Requires:
  *  "config.h"
  *  "common.h"
  *  "mtime.h"
- *  "vlc_thread.h"
+ *  "threads.h"
  *  "input.h"
  *  "video.h"
  *  "video_output.h"
  *  "decoder_fifo.h"
  *  "video_fifo.h"
  *****************************************************************************/
-/*****************************************************************************
- * Function pointers
- *****************************************************************************/
-struct vpar_thread_s;
-
-typedef void    (*f_slice_header_t)( struct vpar_thread_s*, int*, int, u32);
-typedef void    (*f_chroma_pattern_t)( struct vpar_thread_s* );
-typedef int     (*f_macroblock_type_t)( struct vpar_thread_s* );
 
 /*****************************************************************************
  * quant_matrix_t : Quantization Matrix
@@ -36,49 +45,64 @@ typedef struct quant_matrix_s
 
 /*****************************************************************************
  * sequence_t : sequence descriptor
+ *****************************************************************************
+ * This structure should only be changed when reading the sequence header,
+ * or exceptionnally some extension structures (like quant_matrix).
  *****************************************************************************/
 typedef struct sequence_s
 {
-    u32                 i_height, i_width, i_size;
+    u32                 i_height, i_width;      /* height and width of the lum
+                                                 * comp of the picture       */
+    u32                 i_size;       /* total number of pel of the lum comp */
     u32                 i_mb_height, i_mb_width, i_mb_size;
-    unsigned int        i_aspect_ratio;
-    double              d_frame_rate;
-    boolean_t           b_mpeg2;
-    boolean_t           b_progressive;
-    unsigned int        i_scalable_mode;
-    f_slice_header_t    pf_slice_header;
+                                            /* 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 */
+    boolean_t           b_mpeg2;                                    /* guess */
+    boolean_t           b_progressive;              /* progressive (ie.
+                                                     * non-interlaced) frame */
+    unsigned int        i_scalable_mode; /* scalability ; unsupported, but
+                                          * modifies the syntax of the binary
+                                          * stream.                          */
     quant_matrix_t      intra_quant, nonintra_quant;
     quant_matrix_t      chroma_intra_quant, chroma_nonintra_quant;
-    void                (*pf_decode_mv)( struct vpar_thread_s *, int );
-    f_chroma_pattern_t  pf_decode_pattern;
+                                            /* current quantization matrices */
 
     /* Chromatic information */
-    unsigned int        i_chroma_format;
-    int                 i_chroma_nb_blocks;
-    u32                 i_chroma_width;
+    unsigned int        i_chroma_format;               /* see CHROMA_* below */
+    int                 i_chroma_nb_blocks;       /* number of chroma blocks */
+    u32                 i_chroma_width;/* width of a line of the chroma comp */
     u32                 i_chroma_mb_width, i_chroma_mb_height;
+                                 /* size of a macroblock in the chroma buffer
+                                  * (eg. 8x8 or 8x16 or 16x16)               */
 
     /* Parser context */
-    picture_t *         p_forward;
-    picture_t *         p_backward;
+    picture_t *         p_forward;        /* current forward reference frame */
+    picture_t *         p_backward;      /* current backward reference frame */
 
     /* Copyright extension */
-    boolean_t               b_copyright_flag;     /* Whether the following
-                                                     information is significant
-                                                     or not. */
-    u8                      i_copyright_id;
-    boolean_t               b_original;
-    u64                     i_copyright_nb;
+    boolean_t           b_copyright_flag;     /* Whether the following
+                                                 information is significant
+                                                 or not. */
+    u8                  i_copyright_id;
+    boolean_t           b_original;
+    u64                 i_copyright_nb;
 } sequence_t;
 
 /*****************************************************************************
  * picture_parsing_t : parser context descriptor
+ *****************************************************************************
+ * This structure should only be changed when reading the picture header.
  *****************************************************************************/
 typedef struct picture_parsing_s
 {
+    /* ISO/CEI 11172-2 backward compatibility */
     boolean_t           pb_full_pel_vector[2];
     int                 i_forward_f_code, i_backward_f_code;
 
+    /* Values from the picture_coding_extension. Please refer to ISO/IEC
+     * 13818-2. */
     int                 ppi_f_code[2][2];
     int                 i_intra_dc_precision;
     boolean_t           b_frame_pred_frame_dct, b_q_scale_type;
@@ -86,47 +110,36 @@ typedef struct picture_parsing_s
     boolean_t           b_alternate_scan, b_progressive_frame;
     boolean_t           b_top_field_first, b_concealment_mv;
     boolean_t           b_repeat_first_field;
-    int                 i_l_stride, i_c_stride;
-
-    /* Used for second field management */
-    int                 i_current_structure;
-
-    picture_t *         p_picture;
-    macroblock_t *      pp_mb[MAX_MB];
-
     /* Relative to the current field */
     int                 i_coding_type, i_structure;
-    boolean_t           b_frame_structure;
-    f_macroblock_type_t pf_macroblock_type;
+    boolean_t           b_frame_structure; /* i_structure == FRAME_STRUCTURE */
 
-    /* Scalability variables */
-    int                 i_spatial_temporal_weight_code_table_index;
-    
-    boolean_t           b_error;
-} picture_parsing_t;
+    picture_t *         p_picture;               /* picture buffer from vout */
+    int                 i_current_structure;   /* current parsed structure of
+                                                * p_picture (second field ?) */
+#ifdef VDEC_SMP
+    macroblock_t *      pp_mb[MAX_MB];         /* macroblock buffer to
+                                                * send to the vdec thread(s) */
+#endif
+    boolean_t           b_error;            /* parsing error, try to recover */
 
-/*****************************************************************************
- * slice_parsing_t : parser context descriptor #2
- *****************************************************************************/
-typedef struct slice_parsing_s
-{
-    unsigned char       i_quantizer_scale;
-    int                 pi_dc_dct_pred[3];          /* ISO/IEC 13818-2 7.2.1 */
-    int                 pppi_pmv[2][2][2];  /* Motion vect predictors, 7.6.3 */
-} slice_parsing_t;
+    int                 i_l_stride, i_c_stride;
+                                    /* number of coeffs to jump when changing
+                                     * lines (different with field pictures) */
+} picture_parsing_t;
 
 /*****************************************************************************
  * Standard codes
  *****************************************************************************/
-#define PICTURE_START_CODE      0x100
-#define SLICE_START_CODE_MIN    0x101
-#define SLICE_START_CODE_MAX    0x1AF
-#define USER_DATA_START_CODE    0x1B2
-#define SEQUENCE_HEADER_CODE    0x1B3
-#define SEQUENCE_ERROR_CODE     0x1B4
-#define EXTENSION_START_CODE    0x1B5
-#define SEQUENCE_END_CODE       0x1B7
-#define GROUP_START_CODE        0x1B8
+#define PICTURE_START_CODE      0x100L
+#define SLICE_START_CODE_MIN    0x101L
+#define SLICE_START_CODE_MAX    0x1AFL
+#define USER_DATA_START_CODE    0x1B2L
+#define SEQUENCE_HEADER_CODE    0x1B3L
+#define SEQUENCE_ERROR_CODE     0x1B4L
+#define EXTENSION_START_CODE    0x1B5L
+#define SEQUENCE_END_CODE       0x1B7L
+#define GROUP_START_CODE        0x1B8L
 
 /* extension start code IDs */
 #define SEQUENCE_EXTENSION_ID                    1
@@ -146,6 +159,11 @@ typedef struct slice_parsing_s
 #define SC_SNR      3
 #define SC_TEMP     4
 
+/* Chroma types */
+#define CHROMA_420 1
+#define CHROMA_422 2
+#define CHROMA_444 3
+
 /* Pictures types */
 #define I_CODING_TYPE           1
 #define P_CODING_TYPE           2
@@ -158,7 +176,6 @@ typedef struct slice_parsing_s
 #define BOTTOM_FIELD            2
 #define FRAME_STRUCTURE         3
 
-
 /*****************************************************************************
  * Prototypes
  *****************************************************************************/