]> git.sesse.net Git - vlc/blob - include/video_decoder.h
7515e779a5b307d69f19f7e9f4848a52c56f7c0f
[vlc] / include / video_decoder.h
1 /*****************************************************************************
2  * video_decoder.h : video decoder thread
3  *****************************************************************************
4  * Copyright (C) 1999, 2000 VideoLAN
5  *
6  * Authors:
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  * 
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
21  *****************************************************************************/
22  
23 /*****************************************************************************
24  * Requires:
25  *  "config.h"
26  *  "common.h"
27  *  "mtime.h"
28  *  "threads.h"
29  *  "input.h"
30  *  "video.h"
31  *  "video_output.h"
32  *  "decoder_fifo.h"
33  *****************************************************************************/
34
35 /*****************************************************************************
36  * vdec_thread_t: video decoder thread descriptor
37  *****************************************************************************
38  * XXX??
39  *****************************************************************************/
40 typedef struct vdec_thread_s
41 {
42     /* Thread properties and locks */
43     boolean_t           b_die;                                 /* `die' flag */
44     boolean_t           b_run;                                 /* `run' flag */
45     boolean_t           b_error;                             /* `error' flag */
46     boolean_t           b_active;                           /* `active' flag */
47     vlc_thread_t        thread_id;                /* id for thread functions */
48
49     /* Thread configuration */
50     /* XXX?? */
51 //    int *pi_status;
52
53     /* idct iformations */
54     dctelem_t              p_pre_idct[64*64];
55
56     /* Input properties */
57     struct vpar_thread_s *    p_vpar;                 /* video_parser thread */
58
59     /* Lookup tables */
60 //#ifdef MPEG2_COMPLIANT
61     u8              pi_crop_buf[VDEC_CROPRANGE];
62     u8 *            pi_crop;
63 //#endif
64
65 #ifdef STATS
66     /* Statistics */
67     count_t         c_loops;                              /* number of loops */
68     count_t         c_idle_loops;                    /* number of idle loops */
69     count_t         c_decoded_pictures;        /* number of pictures decoded */
70     count_t         c_decoded_i_pictures;    /* number of I pictures decoded */
71     count_t         c_decoded_p_pictures;    /* number of P pictures decoded */
72     count_t         c_decoded_b_pictures;    /* number of B pictures decoded */
73 #endif
74 } vdec_thread_t;
75
76 /*****************************************************************************
77  * Prototypes
78  *****************************************************************************/
79 struct vpar_thread_s;
80 struct macroblock_s;
81
82 /* Thread management functions */
83 #ifndef VDEC_SMP
84 int             vdec_InitThread         ( struct vdec_thread_s *p_vdec );
85 void            vdec_DecodeMacroblock   ( struct vdec_thread_s *p_vdec,
86                                           struct macroblock_s *p_mb );
87 #endif
88 vdec_thread_t * vdec_CreateThread       ( struct vpar_thread_s *p_vpar /*,
89                                           int *pi_status */ );
90 void            vdec_DestroyThread      ( vdec_thread_t *p_vdec /*,
91                                           int *pi_status */ );
92