1 /*****************************************************************************
2 * xvmc.c : Common acceleration definitions for XvMC
3 *****************************************************************************
4 * Copyright (C) 2006 VideoLAN
7 * Authors: Christophe Burgalat <c _dot_ burgalat _at_ broadcastavenue _dot_ com>
8 * Jean-Paul Saman <jpsaman _at_ videolan _dot_ org>
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.
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.
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 *****************************************************************************/
25 /*****************************************************************************
27 *****************************************************************************/
30 * Common acceleration definitions for XvMC
35 #ifndef HAVE_VLC_ACCEL_H
36 #define HAVE_VLC_ACCEL_H
42 typedef struct vlc_macroblock_s
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 */
49 typedef struct vlc_vld_frame_s
51 int version; /* Backward compatibility */
53 int picture_structure;
54 int picture_coding_type;
55 int intra_dc_precision;
57 int progressive_sequence;
60 int concealment_motion_vectors;
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;
73 typedef struct vlc_xvmc_s
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]);
84 typedef struct vlc_xxmc_s
87 * We inherit the xine_xvmc_t properties.
92 unsigned acceleration;
93 vlc_fourcc_t fallback_format;
94 vlc_vld_frame_t vld_frame;
96 unsigned slice_data_size;
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);
110 #define VLC_IMGFMT_XXMC VLC_FOURCC('X','x','M','C')
113 * Register XvMC stream types here.
115 #define VLC_XVMC_MPEG_1 0x00000001
116 #define VLC_XVMC_MPEG_2 0x00000002
117 #define VLC_XVMC_MPEG_4 0x00000004
120 * Register XvMC acceleration levels here.
122 #define VLC_XVMC_ACCEL_MOCOMP 0x00000001
123 #define VLC_XVMC_ACCEL_IDCT 0x00000002
124 #define VLC_XVMC_ACCEL_VLD 0x00000004
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
132 #define VLC_MC_FIELD 1
133 #define VLC_MC_FRAME 2
134 #define VLC_MC_16X8 2
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
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