]> git.sesse.net Git - vlc/blob - include/vdec_ext-plugins.h
bcd01e50dd35f61ad40dc028226a0ddd8c66fc23
[vlc] / include / vdec_ext-plugins.h
1 /*****************************************************************************
2  * vdec_common.h : structures from the video decoder exported to plug-ins
3  *****************************************************************************
4  * Copyright (C) 1999, 2000 VideoLAN
5  * $Id: vdec_ext-plugins.h,v 1.2 2001/07/18 14:21:00 massiot Exp $
6  *
7  * Authors: Christophe Massiot <massiot@via.ecp.fr>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  * 
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
22  *****************************************************************************/
23  
24 /*****************************************************************************
25  * Function pointers
26  *****************************************************************************/
27 typedef void (*f_motion_t)( struct macroblock_s * );
28
29 /*****************************************************************************
30  * macroblock_t : information on a macroblock passed to the video_decoder
31  *                thread
32  *****************************************************************************/
33 typedef struct macroblock_s
34 {
35     picture_t *             p_picture;          /* current frame in progress */
36
37     int                     i_mb_type;                    /* macroblock type */
38     int                     i_coded_block_pattern;
39                                                  /* which blocks are coded ? */
40     int                     i_chroma_nb_blocks;         /* number of blocks for
41                                                          * chroma components */
42
43     /* IDCT information */
44     dctelem_t               ppi_blocks[12][64];                    /* blocks */
45     void ( * pf_idct[12] )  ( void *, dctelem_t*, int );
46                                                      /* sparse IDCT or not ? */
47     int                     pi_sparse_pos[12];             /* position of the
48                                                             * non-NULL coeff */
49
50     /* Motion compensation information */
51     f_motion_t              pf_motion;    /* function to use for motion comp */
52     picture_t *             p_backward;          /* backward reference frame */
53     picture_t *             p_forward;            /* forward reference frame */
54     int                     ppi_field_select[2][2];      /* field to use to
55                                                           * form predictions */
56     int                     pppi_motion_vectors[2][2][2];  /* motion vectors */
57     int                     ppi_dmv[2][2];    /* differential motion vectors */
58                             /* coordinates of the block in the picture */
59     int                     i_l_x, i_c_x;
60     int                     i_motion_l_y;
61     int                     i_motion_c_y;
62     int                     i_l_stride;         /* number of yuv_data_t to
63                                                  * ignore when changing line */
64     int                     i_c_stride;                  /* idem, for chroma */
65     boolean_t               b_P_second;  /* Second field of a P picture ?
66                                           * (used to determine the predicting
67                                           * frame)                           */
68     boolean_t               b_motion_field;  /* Field we are predicting
69                                               * (top field or bottom field) */
70
71     /* AddBlock information */
72     yuv_data_t *            p_data[12];              /* pointer to the position
73                                                       * in the final picture */
74     int                     i_addb_l_stride, i_addb_c_stride;
75                                  /* nb of coeffs to jump when changing lines */
76 } macroblock_t;
77
78 /* Macroblock types */
79 #define MB_INTRA                        1
80 #define MB_PATTERN                      2
81 #define MB_MOTION_BACKWARD              4
82 #define MB_MOTION_FORWARD               8
83 #define MB_QUANT                        16
84
85 /* Motion types */
86 #define MOTION_FIELD                    1
87 #define MOTION_FRAME                    2
88 #define MOTION_16X8                     2
89 #define MOTION_DMV                      3
90
91 /* Structures */
92 #define TOP_FIELD               1
93 #define BOTTOM_FIELD            2
94 #define FRAME_STRUCTURE         3
95
96 /*****************************************************************************
97  * vdec_thread_t: video decoder thread descriptor
98  *****************************************************************************/
99 typedef struct vdec_thread_s
100 {
101     vlc_thread_t        thread_id;                /* id for thread functions */
102     boolean_t           b_die;
103
104     /* IDCT iformations */
105     void *              p_idct_data;
106
107     /* Input properties */
108     struct vdec_pool_s * p_pool;
109 } vdec_thread_t;
110