1 /**************************************************************************
2 *
3 * Copyright 2010 Thomas Balling Sørensen & Orasanu Lucian.
4 * Copyright 2014 Advanced Micro Devices, Inc.
5 * All Rights Reserved.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the
9 * "Software"), to deal in the Software without restriction, including
10 * without limitation the rights to use, copy, modify, merge, publish,
11 * distribute, sub license, and/or sell copies of the Software, and to
12 * permit persons to whom the Software is furnished to do so, subject to
13 * the following conditions:
14 *
15 * The above copyright notice and this permission notice (including the
16 * next paragraph) shall be included in all copies or substantial portions
17 * of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
22 * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR
23 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
25 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 *
27 **************************************************************************/
28
29 #ifndef VA_PRIVATE_H
30 #define VA_PRIVATE_H
31
32 #include <assert.h>
33
34 #include <va/va.h>
35 #include <va/va_backend.h>
36 #include <va/va_backend_vpp.h>
37 #include <va/va_drmcommon.h>
38
39 #include "pipe/p_video_enums.h"
40 #include "pipe/p_video_codec.h"
41 #include "pipe/p_video_state.h"
42
43 #include "vl/vl_compositor.h"
44 #include "vl/vl_csc.h"
45
46 #include "util/u_dynarray.h"
47 #include "os/os_thread.h"
48
49 #ifndef VA_RT_FORMAT_YUV420_10
50 #define VA_RT_FORMAT_YUV420_10 VA_RT_FORMAT_YUV420_10BPP
51 #endif
52
53 #define VL_VA_DRIVER(ctx) ((vlVaDriver *)ctx->pDriverData)
54 #define VL_VA_PSCREEN(ctx) (VL_VA_DRIVER(ctx)->vscreen->pscreen)
55
56 #define VL_VA_MAX_IMAGE_FORMATS 12
57 #define VL_VA_ENC_GOP_COEFF 16
58
59 #define UINT_TO_PTR(x) ((void*)(uintptr_t)(x))
60 #define PTR_TO_UINT(x) ((unsigned)((intptr_t)(x)))
61
62 #define SOI 2
63 #define DQT (4 + 4 * 65)
64 #define DHT (4 + 2 * 29 + 2 * 179)
65 #define DRI 6
66 #define SOF (10 + 255 * 3)
67 #define SOS (8 + 4 * 2)
68 #define MAX_MJPEG_SLICE_HEADER_SIZE (SOI + DQT + DHT + DRI + SOF + SOS)
69
70 static inline enum pipe_video_chroma_format
ChromaToPipe(int format)71 ChromaToPipe(int format)
72 {
73 switch (format) {
74 case VA_RT_FORMAT_YUV420:
75 case VA_RT_FORMAT_YUV420_10BPP:
76 return PIPE_VIDEO_CHROMA_FORMAT_420;
77 case VA_RT_FORMAT_YUV422:
78 return PIPE_VIDEO_CHROMA_FORMAT_422;
79 case VA_RT_FORMAT_YUV444:
80 return PIPE_VIDEO_CHROMA_FORMAT_444;
81 default:
82 return PIPE_VIDEO_CHROMA_FORMAT_NONE;
83 }
84 }
85
86 static inline enum pipe_format
VaFourccToPipeFormat(unsigned format)87 VaFourccToPipeFormat(unsigned format)
88 {
89 switch(format) {
90 case VA_FOURCC('N','V','1','2'):
91 return PIPE_FORMAT_NV12;
92 case VA_FOURCC('P','0','1','0'):
93 return PIPE_FORMAT_P010;
94 case VA_FOURCC('P','0','1','6'):
95 return PIPE_FORMAT_P016;
96 case VA_FOURCC('I','4','2','0'):
97 return PIPE_FORMAT_IYUV;
98 case VA_FOURCC('Y','V','1','2'):
99 return PIPE_FORMAT_YV12;
100 case VA_FOURCC('Y','U','Y','V'):
101 case VA_FOURCC('Y','U','Y','2'):
102 return PIPE_FORMAT_YUYV;
103 case VA_FOURCC('U','Y','V','Y'):
104 return PIPE_FORMAT_UYVY;
105 case VA_FOURCC('B','G','R','A'):
106 return PIPE_FORMAT_B8G8R8A8_UNORM;
107 case VA_FOURCC('R','G','B','A'):
108 return PIPE_FORMAT_R8G8B8A8_UNORM;
109 case VA_FOURCC('B','G','R','X'):
110 return PIPE_FORMAT_B8G8R8X8_UNORM;
111 case VA_FOURCC('R','G','B','X'):
112 return PIPE_FORMAT_R8G8B8X8_UNORM;
113 default:
114 assert(0);
115 return PIPE_FORMAT_NONE;
116 }
117 }
118
119 static inline unsigned
PipeFormatToVaFourcc(enum pipe_format p_format)120 PipeFormatToVaFourcc(enum pipe_format p_format)
121 {
122 switch (p_format) {
123 case PIPE_FORMAT_NV12:
124 return VA_FOURCC('N','V','1','2');
125 case PIPE_FORMAT_P010:
126 return VA_FOURCC('P','0','1','0');
127 case PIPE_FORMAT_P016:
128 return VA_FOURCC('P','0','1','6');
129 case PIPE_FORMAT_IYUV:
130 return VA_FOURCC('I','4','2','0');
131 case PIPE_FORMAT_YV12:
132 return VA_FOURCC('Y','V','1','2');
133 case PIPE_FORMAT_UYVY:
134 return VA_FOURCC('U','Y','V','Y');
135 case PIPE_FORMAT_YUYV:
136 return VA_FOURCC('Y','U','Y','V');
137 case PIPE_FORMAT_B8G8R8A8_UNORM:
138 return VA_FOURCC('B','G','R','A');
139 case PIPE_FORMAT_R8G8B8A8_UNORM:
140 return VA_FOURCC('R','G','B','A');
141 case PIPE_FORMAT_B8G8R8X8_UNORM:
142 return VA_FOURCC('B','G','R','X');
143 case PIPE_FORMAT_R8G8B8X8_UNORM:
144 return VA_FOURCC('R','G','B','X');
145 default:
146 assert(0);
147 return -1;
148 }
149 }
150
151 static inline VAProfile
PipeToProfile(enum pipe_video_profile profile)152 PipeToProfile(enum pipe_video_profile profile)
153 {
154 switch (profile) {
155 case PIPE_VIDEO_PROFILE_MPEG2_SIMPLE:
156 return VAProfileMPEG2Simple;
157 case PIPE_VIDEO_PROFILE_MPEG2_MAIN:
158 return VAProfileMPEG2Main;
159 case PIPE_VIDEO_PROFILE_MPEG4_SIMPLE:
160 return VAProfileMPEG4Simple;
161 case PIPE_VIDEO_PROFILE_MPEG4_ADVANCED_SIMPLE:
162 return VAProfileMPEG4AdvancedSimple;
163 case PIPE_VIDEO_PROFILE_VC1_SIMPLE:
164 return VAProfileVC1Simple;
165 case PIPE_VIDEO_PROFILE_VC1_MAIN:
166 return VAProfileVC1Main;
167 case PIPE_VIDEO_PROFILE_VC1_ADVANCED:
168 return VAProfileVC1Advanced;
169 case PIPE_VIDEO_PROFILE_MPEG4_AVC_BASELINE:
170 return VAProfileH264ConstrainedBaseline;
171 case PIPE_VIDEO_PROFILE_MPEG4_AVC_MAIN:
172 return VAProfileH264Main;
173 case PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH:
174 return VAProfileH264High;
175 case PIPE_VIDEO_PROFILE_HEVC_MAIN:
176 return VAProfileHEVCMain;
177 case PIPE_VIDEO_PROFILE_HEVC_MAIN_10:
178 return VAProfileHEVCMain10;
179 case PIPE_VIDEO_PROFILE_JPEG_BASELINE:
180 return VAProfileJPEGBaseline;
181 case PIPE_VIDEO_PROFILE_VP9_PROFILE0:
182 return VAProfileVP9Profile0;
183 case PIPE_VIDEO_PROFILE_VP9_PROFILE2:
184 return VAProfileVP9Profile2;
185 case PIPE_VIDEO_PROFILE_AV1_MAIN:
186 return VAProfileAV1Profile0;
187 case PIPE_VIDEO_PROFILE_MPEG4_AVC_EXTENDED:
188 case PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH10:
189 case PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH422:
190 case PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH444:
191 case PIPE_VIDEO_PROFILE_MPEG4_AVC_CONSTRAINED_BASELINE:
192 case PIPE_VIDEO_PROFILE_HEVC_MAIN_12:
193 case PIPE_VIDEO_PROFILE_HEVC_MAIN_STILL:
194 case PIPE_VIDEO_PROFILE_HEVC_MAIN_444:
195 case PIPE_VIDEO_PROFILE_UNKNOWN:
196 return VAProfileNone;
197 default:
198 assert(0);
199 return -1;
200 }
201 }
202
203 static inline enum pipe_video_profile
ProfileToPipe(VAProfile profile)204 ProfileToPipe(VAProfile profile)
205 {
206 switch (profile) {
207 case VAProfileMPEG2Simple:
208 return PIPE_VIDEO_PROFILE_MPEG2_SIMPLE;
209 case VAProfileMPEG2Main:
210 return PIPE_VIDEO_PROFILE_MPEG2_MAIN;
211 case VAProfileMPEG4Simple:
212 return PIPE_VIDEO_PROFILE_MPEG4_SIMPLE;
213 case VAProfileMPEG4AdvancedSimple:
214 return PIPE_VIDEO_PROFILE_MPEG4_ADVANCED_SIMPLE;
215 case VAProfileVC1Simple:
216 return PIPE_VIDEO_PROFILE_VC1_SIMPLE;
217 case VAProfileVC1Main:
218 return PIPE_VIDEO_PROFILE_VC1_MAIN;
219 case VAProfileVC1Advanced:
220 return PIPE_VIDEO_PROFILE_VC1_ADVANCED;
221 case VAProfileH264ConstrainedBaseline:
222 return PIPE_VIDEO_PROFILE_MPEG4_AVC_BASELINE;
223 case VAProfileH264Main:
224 return PIPE_VIDEO_PROFILE_MPEG4_AVC_MAIN;
225 case VAProfileH264High:
226 return PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH;
227 case VAProfileHEVCMain:
228 return PIPE_VIDEO_PROFILE_HEVC_MAIN;
229 case VAProfileHEVCMain10:
230 return PIPE_VIDEO_PROFILE_HEVC_MAIN_10;
231 case VAProfileJPEGBaseline:
232 return PIPE_VIDEO_PROFILE_JPEG_BASELINE;
233 case VAProfileVP9Profile0:
234 return PIPE_VIDEO_PROFILE_VP9_PROFILE0;
235 case VAProfileVP9Profile2:
236 return PIPE_VIDEO_PROFILE_VP9_PROFILE2;
237 case VAProfileAV1Profile0:
238 return PIPE_VIDEO_PROFILE_AV1_MAIN;
239 case VAProfileNone:
240 return PIPE_VIDEO_PROFILE_UNKNOWN;
241 default:
242 return PIPE_VIDEO_PROFILE_UNKNOWN;
243 }
244 }
245
246 typedef struct {
247 struct vl_screen *vscreen;
248 struct pipe_context *pipe;
249 struct handle_table *htab;
250 struct vl_compositor compositor;
251 struct vl_compositor_state cstate;
252 vl_csc_matrix csc;
253 mtx_t mutex;
254 char vendor_string[256];
255 } vlVaDriver;
256
257 typedef struct {
258 VAImage *image;
259
260 struct u_rect src_rect;
261 struct u_rect dst_rect;
262
263 struct pipe_sampler_view *sampler;
264 } vlVaSubpicture;
265
266 typedef struct {
267 VABufferType type;
268 unsigned int size;
269 unsigned int num_elements;
270 void *data;
271 struct {
272 struct pipe_resource *resource;
273 struct pipe_transfer *transfer;
274 } derived_surface;
275 unsigned int export_refcount;
276 VABufferInfo export_state;
277 unsigned int coded_size;
278 struct pipe_video_buffer *derived_image_buffer;
279 } vlVaBuffer;
280
281 typedef struct {
282 struct pipe_video_codec templat, *decoder;
283 struct pipe_video_buffer *target;
284 union {
285 struct pipe_picture_desc base;
286 struct pipe_mpeg12_picture_desc mpeg12;
287 struct pipe_mpeg4_picture_desc mpeg4;
288 struct pipe_vc1_picture_desc vc1;
289 struct pipe_h264_picture_desc h264;
290 struct pipe_h265_picture_desc h265;
291 struct pipe_mjpeg_picture_desc mjpeg;
292 struct pipe_vp9_picture_desc vp9;
293 struct pipe_av1_picture_desc av1;
294 struct pipe_h264_enc_picture_desc h264enc;
295 struct pipe_h265_enc_picture_desc h265enc;
296 } desc;
297
298 struct {
299 unsigned long long int frame_num;
300 unsigned int start_code_size;
301 unsigned int vti_bits;
302 unsigned int quant_scale;
303 VAPictureParameterBufferMPEG4 pps;
304 uint8_t start_code[32];
305 } mpeg4;
306
307 struct {
308 unsigned sampling_factor;
309 uint8_t slice_header[MAX_MJPEG_SLICE_HEADER_SIZE];
310 unsigned int slice_header_size;
311 } mjpeg;
312
313 struct vl_deint_filter *deint;
314 vlVaBuffer *coded_buf;
315 int target_id;
316 bool first_single_submitted;
317 int gop_coeff;
318 bool needs_begin_frame;
319 void *blit_cs;
320 int packed_header_type;
321 } vlVaContext;
322
323 typedef struct {
324 enum pipe_video_profile profile;
325 enum pipe_video_entrypoint entrypoint;
326 enum pipe_h2645_enc_rate_control_method rc;
327 unsigned int rt_format;
328 } vlVaConfig;
329
330 typedef struct {
331 struct pipe_video_buffer templat, *buffer;
332 struct util_dynarray subpics; /* vlVaSubpicture */
333 VAContextID ctx;
334 vlVaBuffer *coded_buf;
335 void *feedback;
336 unsigned int frame_num_cnt;
337 bool force_flushed;
338 } vlVaSurface;
339
340 // Public functions:
341 VAStatus VA_DRIVER_INIT_FUNC(VADriverContextP ctx);
342
343 // vtable functions:
344 VAStatus vlVaTerminate(VADriverContextP ctx);
345 VAStatus vlVaQueryConfigProfiles(VADriverContextP ctx, VAProfile *profile_list,int *num_profiles);
346 VAStatus vlVaQueryConfigEntrypoints(VADriverContextP ctx, VAProfile profile,
347 VAEntrypoint *entrypoint_list, int *num_entrypoints);
348 VAStatus vlVaGetConfigAttributes(VADriverContextP ctx, VAProfile profile, VAEntrypoint entrypoint,
349 VAConfigAttrib *attrib_list, int num_attribs);
350 VAStatus vlVaCreateConfig(VADriverContextP ctx, VAProfile profile, VAEntrypoint entrypoint,
351 VAConfigAttrib *attrib_list, int num_attribs, VAConfigID *config_id);
352 VAStatus vlVaDestroyConfig(VADriverContextP ctx, VAConfigID config_id);
353 VAStatus vlVaQueryConfigAttributes(VADriverContextP ctx, VAConfigID config_id, VAProfile *profile,
354 VAEntrypoint *entrypoint, VAConfigAttrib *attrib_list, int *num_attribs);
355 VAStatus vlVaCreateSurfaces(VADriverContextP ctx, int width, int height, int format,
356 int num_surfaces, VASurfaceID *surfaces);
357 VAStatus vlVaDestroySurfaces(VADriverContextP ctx, VASurfaceID *surface_list, int num_surfaces);
358 VAStatus vlVaCreateContext(VADriverContextP ctx, VAConfigID config_id, int picture_width, int picture_height,
359 int flag, VASurfaceID *render_targets, int num_render_targets, VAContextID *context);
360 VAStatus vlVaDestroyContext(VADriverContextP ctx, VAContextID context);
361 VAStatus vlVaCreateBuffer(VADriverContextP ctx, VAContextID context, VABufferType type, unsigned int size,
362 unsigned int num_elements, void *data, VABufferID *buf_id);
363 VAStatus vlVaBufferSetNumElements(VADriverContextP ctx, VABufferID buf_id, unsigned int num_elements);
364 VAStatus vlVaMapBuffer(VADriverContextP ctx, VABufferID buf_id, void **pbuf);
365 VAStatus vlVaUnmapBuffer(VADriverContextP ctx, VABufferID buf_id);
366 VAStatus vlVaDestroyBuffer(VADriverContextP ctx, VABufferID buffer_id);
367 VAStatus vlVaBeginPicture(VADriverContextP ctx, VAContextID context, VASurfaceID render_target);
368 VAStatus vlVaRenderPicture(VADriverContextP ctx, VAContextID context, VABufferID *buffers, int num_buffers);
369 VAStatus vlVaEndPicture(VADriverContextP ctx, VAContextID context);
370 VAStatus vlVaSyncSurface(VADriverContextP ctx, VASurfaceID render_target);
371 VAStatus vlVaQuerySurfaceStatus(VADriverContextP ctx, VASurfaceID render_target, VASurfaceStatus *status);
372 VAStatus vlVaQuerySurfaceError(VADriverContextP ctx, VASurfaceID render_target,
373 VAStatus error_status, void **error_info);
374 VAStatus vlVaPutSurface(VADriverContextP ctx, VASurfaceID surface, void* draw, short srcx, short srcy,
375 unsigned short srcw, unsigned short srch, short destx, short desty, unsigned short destw,
376 unsigned short desth, VARectangle *cliprects, unsigned int number_cliprects,
377 unsigned int flags);
378 VAStatus vlVaQueryImageFormats(VADriverContextP ctx, VAImageFormat *format_list, int *num_formats);
379 VAStatus vlVaQuerySubpictureFormats(VADriverContextP ctx, VAImageFormat *format_list,
380 unsigned int *flags, unsigned int *num_formats);
381 VAStatus vlVaCreateImage(VADriverContextP ctx, VAImageFormat *format, int width, int height, VAImage *image);
382 VAStatus vlVaDeriveImage(VADriverContextP ctx, VASurfaceID surface, VAImage *image);
383 VAStatus vlVaDestroyImage(VADriverContextP ctx, VAImageID image);
384 VAStatus vlVaSetImagePalette(VADriverContextP ctx, VAImageID image, unsigned char *palette);
385 VAStatus vlVaGetImage(VADriverContextP ctx, VASurfaceID surface, int x, int y,
386 unsigned int width, unsigned int height, VAImageID image);
387 VAStatus vlVaPutImage(VADriverContextP ctx, VASurfaceID surface, VAImageID image, int src_x, int src_y,
388 unsigned int src_width, unsigned int src_height, int dest_x, int dest_y,
389 unsigned int dest_width, unsigned int dest_height);
390 VAStatus vlVaQuerySubpictureFormats(VADriverContextP ctx, VAImageFormat *format_list,
391 unsigned int *flags, unsigned int *num_formats);
392 VAStatus vlVaCreateSubpicture(VADriverContextP ctx, VAImageID image, VASubpictureID *subpicture);
393 VAStatus vlVaDestroySubpicture(VADriverContextP ctx, VASubpictureID subpicture);
394 VAStatus vlVaSubpictureImage(VADriverContextP ctx, VASubpictureID subpicture, VAImageID image);
395 VAStatus vlVaSetSubpictureChromakey(VADriverContextP ctx, VASubpictureID subpicture,
396 unsigned int chromakey_min, unsigned int chromakey_max,
397 unsigned int chromakey_mask);
398 VAStatus vlVaSetSubpictureGlobalAlpha(VADriverContextP ctx, VASubpictureID subpicture, float global_alpha);
399 VAStatus vlVaAssociateSubpicture(VADriverContextP ctx, VASubpictureID subpicture, VASurfaceID *target_surfaces,
400 int num_surfaces, short src_x, short src_y,
401 unsigned short src_width, unsigned short src_height,
402 short dest_x, short dest_y, unsigned short dest_width, unsigned short dest_height,
403 unsigned int flags);
404 VAStatus vlVaDeassociateSubpicture(VADriverContextP ctx, VASubpictureID subpicture,
405 VASurfaceID *target_surfaces, int num_surfaces);
406 VAStatus vlVaQueryDisplayAttributes(VADriverContextP ctx, VADisplayAttribute *attr_list, int *num_attributes);
407 VAStatus vlVaGetDisplayAttributes(VADriverContextP ctx, VADisplayAttribute *attr_list, int num_attributes);
408 VAStatus vlVaSetDisplayAttributes(VADriverContextP ctx, VADisplayAttribute *attr_list, int num_attributes);
409 VAStatus vlVaBufferInfo(VADriverContextP ctx, VABufferID buf_id, VABufferType *type,
410 unsigned int *size, unsigned int *num_elements);
411 VAStatus vlVaLockSurface(VADriverContextP ctx, VASurfaceID surface, unsigned int *fourcc,
412 unsigned int *luma_stride, unsigned int *chroma_u_stride, unsigned int *chroma_v_stride,
413 unsigned int *luma_offset, unsigned int *chroma_u_offset, unsigned int *chroma_v_offset,
414 unsigned int *buffer_name, void **buffer);
415 VAStatus vlVaUnlockSurface(VADriverContextP ctx, VASurfaceID surface);
416 VAStatus vlVaCreateSurfaces2(VADriverContextP ctx, unsigned int format, unsigned int width, unsigned int height,
417 VASurfaceID *surfaces, unsigned int num_surfaces, VASurfaceAttrib *attrib_list,
418 unsigned int num_attribs);
419 VAStatus vlVaQuerySurfaceAttributes(VADriverContextP ctx, VAConfigID config, VASurfaceAttrib *attrib_list,
420 unsigned int *num_attribs);
421
422 VAStatus vlVaAcquireBufferHandle(VADriverContextP ctx, VABufferID buf_id, VABufferInfo *out_buf_info);
423 VAStatus vlVaReleaseBufferHandle(VADriverContextP ctx, VABufferID buf_id);
424 VAStatus vlVaExportSurfaceHandle(VADriverContextP ctx, VASurfaceID surface_id, uint32_t mem_type, uint32_t flags, void *descriptor);
425
426 VAStatus vlVaQueryVideoProcFilters(VADriverContextP ctx, VAContextID context, VAProcFilterType *filters,
427 unsigned int *num_filters);
428 VAStatus vlVaQueryVideoProcFilterCaps(VADriverContextP ctx, VAContextID context, VAProcFilterType type,
429 void *filter_caps, unsigned int *num_filter_caps);
430 VAStatus vlVaQueryVideoProcPipelineCaps(VADriverContextP ctx, VAContextID context, VABufferID *filters,
431 unsigned int num_filters, VAProcPipelineCaps *pipeline_cap);
432
433 // internal functions
434 VAStatus vlVaHandleVAProcPipelineParameterBufferType(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf);
435 VAStatus vlVaHandleSurfaceAllocate(vlVaDriver *drv, vlVaSurface *surface, struct pipe_video_buffer *templat,
436 const uint64_t *modifiers, unsigned int modifiers_count);
437 void vlVaGetReferenceFrame(vlVaDriver *drv, VASurfaceID surface_id, struct pipe_video_buffer **ref_frame);
438 void vlVaHandlePictureParameterBufferMPEG12(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf);
439 void vlVaHandleIQMatrixBufferMPEG12(vlVaContext *context, vlVaBuffer *buf);
440 void vlVaHandleSliceParameterBufferMPEG12(vlVaContext *context, vlVaBuffer *buf);
441 void vlVaHandlePictureParameterBufferH264(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf);
442 void vlVaHandleIQMatrixBufferH264(vlVaContext *context, vlVaBuffer *buf);
443 void vlVaHandleSliceParameterBufferH264(vlVaContext *context, vlVaBuffer *buf);
444 void vlVaHandlePictureParameterBufferVC1(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf);
445 void vlVaHandleSliceParameterBufferVC1(vlVaContext *context, vlVaBuffer *buf);
446 void vlVaHandlePictureParameterBufferMPEG4(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf);
447 void vlVaHandleIQMatrixBufferMPEG4(vlVaContext *context, vlVaBuffer *buf);
448 void vlVaHandleSliceParameterBufferMPEG4(vlVaContext *context, vlVaBuffer *buf);
449 void vlVaDecoderFixMPEG4Startcode(vlVaContext *context);
450 void vlVaGetJpegSliceHeader(vlVaContext *context);
451 void vlVaHandlePictureParameterBufferHEVC(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf);
452 void vlVaHandleIQMatrixBufferHEVC(vlVaContext *context, vlVaBuffer *buf);
453 void vlVaHandleSliceParameterBufferHEVC(vlVaContext *context, vlVaBuffer *buf);
454 void vlVaHandlePictureParameterBufferMJPEG(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf);
455 void vlVaHandleIQMatrixBufferMJPEG(vlVaContext *context, vlVaBuffer *buf);
456 void vlVaHandleHuffmanTableBufferType(vlVaContext *context, vlVaBuffer *buf);
457 void vlVaHandleSliceParameterBufferMJPEG(vlVaContext *context, vlVaBuffer *buf);
458 void vlVaHandlePictureParameterBufferVP9(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf);
459 void vlVaHandleSliceParameterBufferVP9(vlVaContext *context, vlVaBuffer *buf);
460 void vlVaDecoderVP9BitstreamHeader(vlVaContext *context, vlVaBuffer *buf);
461 void vlVaHandlePictureParameterBufferAV1(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf);
462 void vlVaHandleSliceParameterBufferAV1(vlVaContext *context, vlVaBuffer *buf, unsigned int num);
463 void getEncParamPresetH264(vlVaContext *context);
464 void getEncParamPresetH265(vlVaContext *context);
465 VAStatus vlVaHandleVAEncPictureParameterBufferTypeH264(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf);
466 VAStatus vlVaHandleVAEncSliceParameterBufferTypeH264(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf);
467 VAStatus vlVaHandleVAEncSequenceParameterBufferTypeH264(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf);
468 VAStatus vlVaHandleVAEncMiscParameterTypeRateControlH264(vlVaContext *context, VAEncMiscParameterBuffer *buf);
469 VAStatus vlVaHandleVAEncMiscParameterTypeFrameRateH264(vlVaContext *context, VAEncMiscParameterBuffer *buf);
470 VAStatus vlVaHandleVAEncMiscParameterTypeTemporalLayerH264(vlVaContext *context, VAEncMiscParameterBuffer *buf);
471 VAStatus vlVaHandleVAEncPictureParameterBufferTypeHEVC(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf);
472 VAStatus vlVaHandleVAEncSliceParameterBufferTypeHEVC(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf);
473 VAStatus vlVaHandleVAEncSequenceParameterBufferTypeHEVC(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf);
474 VAStatus vlVaHandleVAEncMiscParameterTypeRateControlHEVC(vlVaContext *context, VAEncMiscParameterBuffer *buf);
475 VAStatus vlVaHandleVAEncMiscParameterTypeFrameRateHEVC(vlVaContext *context, VAEncMiscParameterBuffer *buf);
476 VAStatus vlVaHandleVAEncPackedHeaderDataBufferTypeHEVC(vlVaContext *context, vlVaBuffer *buf);
477 #endif //VA_PRIVATE_H
478