2 * Video Acceleration API (shared data between FFmpeg and the video player)
3 * HW decode acceleration for MPEG-2, MPEG-4, H.264 and VC-1
5 * Copyright (C) 2008-2009 Splitted-Desktop Systems
7 * This file is part of FFmpeg.
9 * FFmpeg is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * FFmpeg 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 GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with FFmpeg; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 #ifndef AVCODEC_VAAPI_H
25 #define AVCODEC_VAAPI_H
31 * \defgroup VAAPI_Decoding VA API Decoding
37 * This structure is used to share data between the FFmpeg library and
38 * the client video application.
39 * This shall be zero-allocated and available as
40 * AVCodecContext.hwaccel_context. All user members can be set once
41 * during initialization or through each AVCodecContext.get_buffer()
42 * function call. In any case, they must be valid prior to calling
45 struct vaapi_context {
47 * Window system dependent data
50 * - decoding: Set by user
58 * - decoding: Set by user
63 * Context ID (video decode pipeline)
66 * - decoding: Set by user
71 * VAPictureParameterBuffer ID
74 * - decoding: Set by libavcodec
76 VABufferID pic_param_buf_id;
82 * - decoding: Set by libavcodec
84 VABufferID iq_matrix_buf_id;
87 * VABitPlaneBuffer ID (for VC-1 decoding)
90 * - decoding: Set by libavcodec
92 VABufferID bitplane_buf_id;
95 * Slice parameter/data buffer IDs
98 * - decoding: Set by libavcodec
100 VABufferID *slice_buf_ids;
103 * Number of effective slice buffer IDs to send to the HW
106 * - decoding: Set by libavcodec
108 unsigned int n_slice_buf_ids;
111 * Size of pre-allocated slice_buf_ids
114 * - decoding: Set by libavcodec
116 unsigned int slice_buf_ids_alloc;
119 * Picture parameter buffer
122 * - decoding: Set by libavcodec
125 VAPictureParameterBufferMPEG2 mpeg2;
126 VAPictureParameterBufferMPEG4 mpeg4;
127 VAPictureParameterBufferH264 h264;
128 VAPictureParameterBufferVC1 vc1;
132 * Size of a VAPictureParameterBuffer element
135 * - decoding: Set by libavcodec
137 unsigned int pic_param_size;
140 * Inverse quantization matrix buffer
143 * - decoding: Set by libavcodec
146 VAIQMatrixBufferMPEG2 mpeg2;
147 VAIQMatrixBufferMPEG4 mpeg4;
148 VAIQMatrixBufferH264 h264;
152 * Size of a VAIQMatrixBuffer element
155 * - decoding: Set by libavcodec
157 unsigned int iq_matrix_size;
160 * Flag: is quantization matrix present?
163 * - decoding: Set by libavcodec
165 uint8_t iq_matrix_present;
168 * VC-1 bitplane buffer
171 * - decoding: Set by libavcodec
173 uint8_t *bitplane_buffer;
176 * Size of VC-1 bitplane buffer
179 * - decoding: Set by libavcodec
181 unsigned int bitplane_buffer_size;
184 * Pointer to VASliceParameterBuffers
187 * - decoding: Set by libavcodec
192 * Size of a VASliceParameterBuffer element
195 * - decoding: Set by libavcodec
197 unsigned int slice_param_size;
200 * Size of pre-allocated slice_params
203 * - decoding: Set by libavcodec
205 unsigned int slice_params_alloc;
208 * Number of slices currently filled in
211 * - decoding: Set by libavcodec
213 unsigned int slice_count;
216 * Pointer to slice data buffer base
218 * - decoding: Set by libavcodec
220 const uint8_t *slice_data;
223 * Current size of slice data
226 * - decoding: Set by libavcodec
228 uint32_t slice_data_size;
233 #endif /* AVCODEC_VAAPI_H */