]> git.sesse.net Git - vlc/blob - include/video_parser.h
suite du parseur.
[vlc] / include / video_parser.h
1 /*******************************************************************************
2  * video_parser.h : video parser thread
3  * (c)1999 VideoLAN
4  *******************************************************************************
5  *******************************************************************************
6  * Requires:
7  *  "config.h"
8  *  "common.h"
9  *  "mtime.h"
10  *  "vlc_thread.h"
11  *  "input.h"
12  *  "video.h"
13  *  "video_output.h"
14  *  "decoder_fifo.h"
15  *  "video_fifo.h"
16  *******************************************************************************/
17
18 /*******************************************************************************
19  * sequence_t : sequence descriptor
20  *******************************************************************************
21  * ??
22  *******************************************************************************/
23 typedef struct sequence_s
24 {
25     u16                 i_height, i_width;
26     u16                 i_mb_height, i_mb_width;
27     unsigned int        i_aspect_ratio;
28     double              d_frame_rate;
29     unsigned int        i_chroma_format;
30     boolean_t           b_mpeg2;
31     boolean_t           b_progressive;
32     
33     /* Parser context */
34     picture_t *             p_forward, p_backward;
35     pel_lookup_table_t *    p_frame_lum_lookup, p_field_lum_lookup;
36     pel_lookup_table_t *    p_frame_chroma_lookup, p_field_chroma_lookup;
37     quant_matrix_t          intra_quant, nonintra_quant;
38     quant_matrix_t          chroma_intra_quant, chroma_nonintra_quant;
39 } sequence_t;
40
41 /*******************************************************************************
42  * vpar_thread_t: video parser thread descriptor
43  *******************************************************************************
44  * ??
45  *******************************************************************************/
46 typedef struct vpar_thread_s
47 {
48     /* Thread properties and locks */
49     boolean_t           b_die;                                   /* `die' flag */
50     boolean_t           b_run;                                   /* `run' flag */
51     boolean_t           b_error;                               /* `error' flag */
52     boolean_t           b_active;                             /* `active' flag */
53     vlc_thread_t        thread_id;                  /* id for thread functions */
54
55     /* Thread configuration */
56     /* ?? */
57  /*??*/
58 //    int *pi_status;
59     
60
61     /* Input properties */
62     decoder_fifo_t      fifo;                                /* PES input fifo */
63
64     /* The bit stream structure handles the PES stream at the bit level */
65     bit_stream_t        bit_stream;
66
67     /* Output properties */
68     vout_thread_t *     p_vout;                         /* video output thread */
69     int                 i_stream;                           /* video stream id */
70     
71     /* Decoder properties */
72     struct vdec_thread_s *      p_vdec[MAX_VDEC];
73     video_fifo_t                vfifo;
74     video_buffer_t              vbuffer;
75
76     /* Parser properties */
77     sequence_t          sequence;
78
79 #ifdef STATS
80     /* Statistics */
81     count_t         c_loops;                               /* number of loops */
82     count_t         c_idle_loops;                     /* number of idle loops */
83     count_t         c_sequences;                       /* number of sequences */
84     count_t         c_pictures;                    /* number of pictures read */
85     count_t         c_i_pictures;                /* number of I pictures read */
86     count_t         c_p_pictures;                /* number of P pictures read */
87     count_t         c_b_pictures;                /* number of B pictures read */    
88     count_t         c_decoded_pictures;         /* number of pictures decoded */
89     count_t         c_decoded_i_pictures;     /* number of I pictures decoded */
90     count_t         c_decoded_p_pictures;     /* number of P pictures decoded */
91     count_t         c_decoded_b_pictures;     /* number of B pictures decoded */
92 #endif
93 } vpar_thread_t;
94
95 /*******************************************************************************
96  * Standard start codes
97  *******************************************************************************/
98 #define PICTURE_START_CODE      0x100
99 #define SLICE_START_CODE_MIN    0x101
100 #define SLICE_START_CODE_MAX    0x1AF
101 #define USER_DATA_START_CODE    0x1B2
102 #define SEQUENCE_HEADER_CODE    0x1B3
103 #define SEQUENCE_ERROR_CODE     0x1B4
104 #define EXTENSION_START_CODE    0x1B5
105 #define SEQUENCE_END_CODE       0x1B7
106 #define GROUP_START_CODE        0x1B8
107
108 /* extension start code IDs */
109
110 #define SEQUENCE_EXTENSION_ID                    1
111 #define SEQUENCE_DISPLAY_EXTENSION_ID            2
112 #define QUANT_MATRIX_EXTENSION_ID                3
113 #define COPYRIGHT_EXTENSION_ID                   4
114 #define SEQUENCE_SCALABLE_EXTENSION_ID           5
115 #define PICTURE_DISPLAY_EXTENSION_ID             7
116 #define PICTURE_CODING_EXTENSION_ID              8
117 #define PICTURE_SPATIAL_SCALABLE_EXTENSION_ID    9
118 #define PICTURE_TEMPORAL_SCALABLE_EXTENSION_ID  10
119
120 /*******************************************************************************
121  * Prototypes
122  *******************************************************************************/
123
124 /* Thread management functions */
125 vpar_thread_t * vpar_CreateThread       ( /* video_cfg_t *p_cfg, */ input_thread_t *p_input /*,
126                                           vout_thread_t *p_vout, int *pi_status */ );
127 void            vpar_DestroyThread      ( vpar_thread_t *p_vpar /*, int *pi_status */ );
128
129 /* Time management functions */
130 /* ?? */
131
132 /* Dynamic thread settings */
133 /* ?? */