]> git.sesse.net Git - vlc/blob - modules/codec/xvmc/accel_xvmc.h
hotkeys: Properly set seekable.
[vlc] / modules / codec / xvmc / accel_xvmc.h
1 /*****************************************************************************
2  * xvmc.c : Common acceleration definitions for XvMC
3  *****************************************************************************
4  * Copyright (C) 2006 VideoLAN
5  * $Id$
6  *
7  * Authors: Christophe Burgalat <c _dot_ burgalat _at_ broadcastavenue _dot_ com>
8  *          Jean-Paul Saman <jpsaman _at_ videolan _dot_ org>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
23  *****************************************************************************/
24
25 /*****************************************************************************
26  * Preamble
27  *****************************************************************************/
28
29 /*
30  * Common acceleration definitions for XvMC
31  *
32  *
33  */
34
35 #ifndef HAVE_VLC_ACCEL_H
36 #define HAVE_VLC_ACCEL_H
37
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41
42 typedef struct vlc_macroblock_s
43 {
44     short  *blockptr;          /* pointer to current dct block */
45     short  *blockbaseptr;      /* pointer to base of dct block array in blocks */
46     short   xvmc_accel;        /* type of acceleration supported */
47 } vlc_macroblocks_t;
48
49 typedef struct vlc_vld_frame_s
50 {
51     int version;              /* Backward compatibility */
52     int mv_ranges[2][2];
53     int picture_structure;
54     int picture_coding_type;
55     int intra_dc_precision;
56     int mpeg_coding;
57     int progressive_sequence;
58     int scan;
59     int pred_dct_frame;
60     int concealment_motion_vectors;
61     int q_scale_type;
62     int intra_vlc_format;
63     int second_field;
64     int load_intra_quantizer_matrix;
65     int load_non_intra_quantizer_matrix;
66     uint8_t intra_quantizer_matrix[64];
67     uint8_t non_intra_quantizer_matrix[64];
68     picture_t *backward_reference_picture;
69     picture_t *forward_reference_picture;
70 } vlc_vld_frame_t;
71
72
73 typedef struct vlc_xvmc_s
74 {
75     vlc_macroblocks_t *macroblocks;
76     void (*proc_macro_block)(int x,int y,int mb_type,
77     int motion_type,int (*mv_field_sel)[2],
78     int *dmvector,int cbp,int dct_type,
79     picture_t *current_picture,picture_t *forward_ref_picture,
80     picture_t *backward_ref_picture,int picture_structure,
81     int second_field,int (*f_mot_pmv)[2],int (*b_mot_pmv)[2]);
82 } vlc_xvmc_t ;
83
84 typedef struct vlc_xxmc_s
85 {
86     /*
87     * We inherit the xine_xvmc_t properties.
88     */
89     vlc_xvmc_t xvmc;
90
91     unsigned mpeg;
92     unsigned acceleration;
93     vlc_fourcc_t fallback_format;
94     vlc_vld_frame_t vld_frame;
95     uint8_t *slice_data;
96     unsigned slice_data_size;
97     unsigned slice_code;
98     int result;
99     int decoded;
100     float sleep;
101     void (*proc_xxmc_update_frame) (picture_t *picture_gen,
102                 uint32_t width, uint32_t height, double ratio,
103                 int format, int flags);
104     void (*proc_xxmc_begin) (picture_t *vo_img);
105     void (*proc_xxmc_slice) (picture_t *vo_img);
106     void (*proc_xxmc_flush) (picture_t *vo_img);
107     void (*proc_xxmc_flushsync) (picture_t *vo_img);
108 } vlc_xxmc_t;
109
110 #define VLC_IMGFMT_XXMC VLC_FOURCC('X','x','M','C')
111
112   /*
113    * Register XvMC stream types here.
114    */
115 #define VLC_XVMC_MPEG_1 0x00000001
116 #define VLC_XVMC_MPEG_2 0x00000002
117 #define VLC_XVMC_MPEG_4 0x00000004
118
119   /*
120    * Register XvMC acceleration levels here.
121    */
122 #define VLC_XVMC_ACCEL_MOCOMP 0x00000001
123 #define VLC_XVMC_ACCEL_IDCT   0x00000002
124 #define VLC_XVMC_ACCEL_VLD    0x00000004
125
126 /* xvmc acceleration types */
127 #define VLC_VO_MOTION_ACCEL   1
128 #define VLC_VO_IDCT_ACCEL     2
129 #define VLC_VO_SIGNED_INTRA   4
130
131 /* motion types */
132 #define VLC_MC_FIELD 1
133 #define VLC_MC_FRAME 2
134 #define VLC_MC_16X8  2
135 #define VLC_MC_DMV   3
136
137 /* picture coding type */
138 #define VLC_PICT_I_TYPE 1
139 #define VLC_PICT_P_TYPE 2
140 #define VLC_PICT_B_TYPE 3
141 #define VLC_PICT_D_TYPE 4
142
143 /* macroblock modes */
144 #define VLC_MACROBLOCK_INTRA 1
145 #define VLC_MACROBLOCK_PATTERN 2
146 #define VLC_MACROBLOCK_MOTION_BACKWARD 4
147 #define VLC_MACROBLOCK_MOTION_FORWARD 8
148 #define VLC_MACROBLOCK_QUANT 16
149 #define VLC_MACROBLOCK_DCT_TYPE_INTERLACED 32
150
151 #ifdef __cplusplus
152 }
153 #endif
154
155 #endif