1 /*******************************************************************************
2 * video_parser.h : video parser thread
4 *******************************************************************************
5 *******************************************************************************
16 *******************************************************************************/
18 /*******************************************************************************
19 * sequence_t : sequence descriptor
20 *******************************************************************************
22 *******************************************************************************/
23 typedef struct sequence_s
25 u16 i_height, i_width;
26 u16 i_mb_height, i_mb_width;
27 unsigned int i_aspect_ratio;
29 unsigned int i_chroma_format;
31 boolean_t b_progressive;
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;
41 /*******************************************************************************
42 * vpar_thread_t: video parser thread descriptor
43 *******************************************************************************
45 *******************************************************************************/
46 typedef struct vpar_thread_s
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 */
55 /* Thread configuration */
61 /* Input properties */
62 decoder_fifo_t fifo; /* PES input fifo */
64 /* The bit stream structure handles the PES stream at the bit level */
65 bit_stream_t bit_stream;
67 /* Output properties */
68 vout_thread_t * p_vout; /* video output thread */
69 int i_stream; /* video stream id */
71 /* Decoder properties */
72 struct vdec_thread_s * p_vdec[MAX_VDEC];
74 video_buffer_t vbuffer;
76 /* Parser properties */
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 */
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
108 /* extension start code IDs */
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
120 /*******************************************************************************
122 *******************************************************************************/
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 */ );
129 /* Time management functions */
132 /* Dynamic thread settings */