VA-API  2.21.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
va.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2007-2009 Intel Corporation. All Rights Reserved.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the
6  * "Software"), to deal in the Software without restriction, including
7  * without limitation the rights to use, copy, modify, merge, publish,
8  * distribute, sub license, and/or sell copies of the Software, and to
9  * permit persons to whom the Software is furnished to do so, subject to
10  * the following conditions:
11  *
12  * The above copyright notice and this permission notice (including the
13  * next paragraph) shall be included in all copies or substantial portions
14  * of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
19  * IN NO EVENT SHALL INTEL AND/OR ITS SUPPLIERS BE LIABLE FOR
20  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23  */
24 /*
25  * Video Acceleration (VA) API Specification
26  *
27  * Rev. 0.30
28  * <jonathan.bian@intel.com>
29  *
30  * Revision History:
31  * rev 0.10 (12/10/2006 Jonathan Bian) - Initial draft
32  * rev 0.11 (12/15/2006 Jonathan Bian) - Fixed some errors
33  * rev 0.12 (02/05/2007 Jonathan Bian) - Added VC-1 data structures for slice level decode
34  * rev 0.13 (02/28/2007 Jonathan Bian) - Added GetDisplay()
35  * rev 0.14 (04/13/2007 Jonathan Bian) - Fixed MPEG-2 PictureParameter structure, cleaned up a few funcs.
36  * rev 0.15 (04/20/2007 Jonathan Bian) - Overhauled buffer management
37  * rev 0.16 (05/02/2007 Jonathan Bian) - Added error codes and fixed some issues with configuration
38  * rev 0.17 (05/07/2007 Jonathan Bian) - Added H.264/AVC data structures for slice level decode.
39  * rev 0.18 (05/14/2007 Jonathan Bian) - Added data structures for MPEG-4 slice level decode
40  * and MPEG-2 motion compensation.
41  * rev 0.19 (08/06/2007 Jonathan Bian) - Removed extra type for bitplane data.
42  * rev 0.20 (08/08/2007 Jonathan Bian) - Added missing fields to VC-1 PictureParameter structure.
43  * rev 0.21 (08/20/2007 Jonathan Bian) - Added image and subpicture support.
44  * rev 0.22 (08/27/2007 Jonathan Bian) - Added support for chroma-keying and global alpha.
45  * rev 0.23 (09/11/2007 Jonathan Bian) - Fixed some issues with images and subpictures.
46  * rev 0.24 (09/18/2007 Jonathan Bian) - Added display attributes.
47  * rev 0.25 (10/18/2007 Jonathan Bian) - Changed to use IDs only for some types.
48  * rev 0.26 (11/07/2007 Waldo Bastian) - Change vaCreateBuffer semantics
49  * rev 0.27 (11/19/2007 Matt Sottek) - Added DeriveImage
50  * rev 0.28 (12/06/2007 Jonathan Bian) - Added new versions of PutImage and AssociateSubpicture
51  * to enable scaling
52  * rev 0.29 (02/07/2008 Jonathan Bian) - VC1 parameter fixes,
53  * added VA_STATUS_ERROR_RESOLUTION_NOT_SUPPORTED
54  * rev 0.30 (03/01/2009 Jonathan Bian) - Added encoding support for H.264 BP and MPEG-4 SP and fixes
55  * for ISO C conformance.
56  * rev 0.31 (09/02/2009 Gwenole Beauchesne) - VC-1/H264 fields change for VDPAU and XvBA backend
57  * Application needs to relink with the new library.
58  *
59  * rev 0.31.1 (03/29/2009) - Data structure for JPEG encode
60  * rev 0.31.2 (01/13/2011 Anthony Pabon)- Added a flag to indicate Subpicture coordinates are screen
61  * screen relative rather than source video relative.
62  * rev 0.32.0 (01/13/2011 Xiang Haihao) - Add profile into VAPictureParameterBufferVC1
63  * update VAAPI to 0.32.0
64  *
65  * Acknowledgements:
66  * Some concepts borrowed from XvMC and XvImage.
67  * Waldo Bastian (Intel), Matt Sottek (Intel), Austin Yuan (Intel), and Gwenole Beauchesne (SDS)
68  * contributed to various aspects of the API.
69  */
70 
78 #ifndef _VA_H_
79 #define _VA_H_
80 
81 #include <stddef.h>
82 #include <stdint.h>
83 #include <va/va_version.h>
84 
85 #ifdef __cplusplus
86 extern "C" {
87 #endif
88 
89 #if defined(__GNUC__) && !defined(__COVERITY__)
90 #define va_deprecated __attribute__((deprecated))
91 #if __GNUC__ >= 6
92 #define va_deprecated_enum va_deprecated
93 #else
94 #define va_deprecated_enum
95 #endif
96 #else
97 #define va_deprecated
98 #define va_deprecated_enum
99 #endif
100 
259 typedef void* VADisplay; /* window system dependent */
260 
261 typedef int VAStatus;
263 #define VA_STATUS_SUCCESS 0x00000000
264 #define VA_STATUS_ERROR_OPERATION_FAILED 0x00000001
265 #define VA_STATUS_ERROR_ALLOCATION_FAILED 0x00000002
266 #define VA_STATUS_ERROR_INVALID_DISPLAY 0x00000003
267 #define VA_STATUS_ERROR_INVALID_CONFIG 0x00000004
268 #define VA_STATUS_ERROR_INVALID_CONTEXT 0x00000005
269 #define VA_STATUS_ERROR_INVALID_SURFACE 0x00000006
270 #define VA_STATUS_ERROR_INVALID_BUFFER 0x00000007
271 #define VA_STATUS_ERROR_INVALID_IMAGE 0x00000008
272 #define VA_STATUS_ERROR_INVALID_SUBPICTURE 0x00000009
273 #define VA_STATUS_ERROR_ATTR_NOT_SUPPORTED 0x0000000a
274 #define VA_STATUS_ERROR_MAX_NUM_EXCEEDED 0x0000000b
275 #define VA_STATUS_ERROR_UNSUPPORTED_PROFILE 0x0000000c
276 #define VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT 0x0000000d
277 #define VA_STATUS_ERROR_UNSUPPORTED_RT_FORMAT 0x0000000e
278 #define VA_STATUS_ERROR_UNSUPPORTED_BUFFERTYPE 0x0000000f
279 #define VA_STATUS_ERROR_SURFACE_BUSY 0x00000010
280 #define VA_STATUS_ERROR_FLAG_NOT_SUPPORTED 0x00000011
281 #define VA_STATUS_ERROR_INVALID_PARAMETER 0x00000012
282 #define VA_STATUS_ERROR_RESOLUTION_NOT_SUPPORTED 0x00000013
283 #define VA_STATUS_ERROR_UNIMPLEMENTED 0x00000014
284 #define VA_STATUS_ERROR_SURFACE_IN_DISPLAYING 0x00000015
285 #define VA_STATUS_ERROR_INVALID_IMAGE_FORMAT 0x00000016
286 #define VA_STATUS_ERROR_DECODING_ERROR 0x00000017
287 #define VA_STATUS_ERROR_ENCODING_ERROR 0x00000018
288 
295 #define VA_STATUS_ERROR_INVALID_VALUE 0x00000019
296 
297 #define VA_STATUS_ERROR_UNSUPPORTED_FILTER 0x00000020
298 
299 #define VA_STATUS_ERROR_INVALID_FILTER_CHAIN 0x00000021
300 
301 #define VA_STATUS_ERROR_HW_BUSY 0x00000022
302 
303 #define VA_STATUS_ERROR_UNSUPPORTED_MEMORY_TYPE 0x00000024
304 
305 #define VA_STATUS_ERROR_NOT_ENOUGH_BUFFER 0x00000025
306 
307 #define VA_STATUS_ERROR_TIMEDOUT 0x00000026
308 #define VA_STATUS_ERROR_UNKNOWN 0xFFFFFFFF
309 
317 #define VA_FRAME_PICTURE 0x00000000
318 #define VA_TOP_FIELD 0x00000001
319 #define VA_BOTTOM_FIELD 0x00000002
320 #define VA_TOP_FIELD_FIRST 0x00000004
321 #define VA_BOTTOM_FIELD_FIRST 0x00000008
322 
329 #define VA_ENABLE_BLEND 0x00000004 /* video area blend with the constant color */
330 
336 #define VA_CLEAR_DRAWABLE 0x00000008
337 
339 #define VA_SRC_COLOR_MASK 0x000000f0
340 #define VA_SRC_BT601 0x00000010
341 #define VA_SRC_BT709 0x00000020
342 #define VA_SRC_SMPTE_240 0x00000040
343 
345 #define VA_FILTER_SCALING_DEFAULT 0x00000000
346 #define VA_FILTER_SCALING_FAST 0x00000100
347 #define VA_FILTER_SCALING_HQ 0x00000200
348 #define VA_FILTER_SCALING_NL_ANAMORPHIC 0x00000300
349 #define VA_FILTER_SCALING_MASK 0x00000f00
350 
352 #define VA_FILTER_INTERPOLATION_DEFAULT 0x00000000
353 #define VA_FILTER_INTERPOLATION_NEAREST_NEIGHBOR 0x00001000
354 #define VA_FILTER_INTERPOLATION_BILINEAR 0x00002000
355 #define VA_FILTER_INTERPOLATION_ADVANCED 0x00003000
356 #define VA_FILTER_INTERPOLATION_MASK 0x0000f000
357 
359 #define VA_PADDING_LOW 4
360 #define VA_PADDING_MEDIUM 8
361 #define VA_PADDING_HIGH 16
362 #define VA_PADDING_LARGE 32
363 
366 #define VA_EXEC_SYNC 0x0
367 
368 #define VA_EXEC_ASYNC 0x1
369 
371 #define VA_EXEC_MODE_DEFAULT 0x0
372 #define VA_EXEC_MODE_POWER_SAVING 0x1
373 #define VA_EXEC_MODE_PERFORMANCE 0x2
374 
375 /* Values used to describe device features. */
380 #define VA_FEATURE_NOT_SUPPORTED 0
381 
390 #define VA_FEATURE_SUPPORTED 1
391 
397 #define VA_FEATURE_REQUIRED 2
398 
402 const char *vaErrorStr(VAStatus error_status);
403 
405 typedef struct _VARectangle {
406  int16_t x;
407  int16_t y;
408  uint16_t width;
409  uint16_t height;
410 } VARectangle;
411 
413 typedef struct _VAMotionVector {
419  int16_t mv0[2];
425  int16_t mv1[2];
427 
429 typedef void (*VAMessageCallback)(void *user_context, const char *message);
430 
435 VAMessageCallback vaSetErrorCallback(VADisplay dpy, VAMessageCallback callback, void *user_context);
436 
441 VAMessageCallback vaSetInfoCallback(VADisplay dpy, VAMessageCallback callback, void *user_context);
442 
450 typedef void* VANativeDisplay; /* window system dependent */
451 
452 int vaDisplayIsValid(VADisplay dpy);
453 
457 VAStatus vaSetDriverName(VADisplay dpy,
458  char *driver_name
459  );
460 
464 VAStatus vaInitialize(
465  VADisplay dpy,
466  int *major_version, /* out */
467  int *minor_version /* out */
468 );
469 
473 VAStatus vaTerminate(
474  VADisplay dpy
475 );
476 
485 const char *vaQueryVendorString(
486  VADisplay dpy
487 );
488 
489 typedef int (*VAPrivFunc)(void);
490 
495 VAPrivFunc vaGetLibFunc(
496  VADisplay dpy,
497  const char *func
498 );
499 
501 typedef enum {
504  VAProfileMPEG2Simple = 0,
505  VAProfileMPEG2Main = 1,
506  VAProfileMPEG4Simple = 2,
507  VAProfileMPEG4AdvancedSimple = 3,
508  VAProfileMPEG4Main = 4,
509  VAProfileH264Baseline va_deprecated_enum = 5,
510  VAProfileH264Main = 6,
511  VAProfileH264High = 7,
512  VAProfileVC1Simple = 8,
513  VAProfileVC1Main = 9,
514  VAProfileVC1Advanced = 10,
515  VAProfileH263Baseline = 11,
516  VAProfileJPEGBaseline = 12,
517  VAProfileH264ConstrainedBaseline = 13,
518  VAProfileVP8Version0_3 = 14,
519  VAProfileH264MultiviewHigh = 15,
520  VAProfileH264StereoHigh = 16,
521  VAProfileHEVCMain = 17,
522  VAProfileHEVCMain10 = 18,
523  VAProfileVP9Profile0 = 19,
524  VAProfileVP9Profile1 = 20,
525  VAProfileVP9Profile2 = 21,
526  VAProfileVP9Profile3 = 22,
527  VAProfileHEVCMain12 = 23,
528  VAProfileHEVCMain422_10 = 24,
529  VAProfileHEVCMain422_12 = 25,
530  VAProfileHEVCMain444 = 26,
531  VAProfileHEVCMain444_10 = 27,
532  VAProfileHEVCMain444_12 = 28,
533  VAProfileHEVCSccMain = 29,
534  VAProfileHEVCSccMain10 = 30,
535  VAProfileHEVCSccMain444 = 31,
536  VAProfileAV1Profile0 = 32,
537  VAProfileAV1Profile1 = 33,
538  VAProfileHEVCSccMain444_10 = 34,
541  VAProfileH264High10 = 36
542 } VAProfile;
543 
547 typedef enum {
548  VAEntrypointVLD = 1,
549  VAEntrypointIZZ = 2,
550  VAEntrypointIDCT = 3,
551  VAEntrypointMoComp = 4,
552  VAEntrypointDeblocking = 5,
553  VAEntrypointEncSlice = 6, /* slice level encode */
554  VAEntrypointEncPicture = 7, /* pictuer encode, JPEG, etc */
555  /*
556  * For an implementation that supports a low power/high performance variant
557  * for slice level encode, it can choose to expose the
558  * VAEntrypointEncSliceLP entrypoint. Certain encoding tools may not be
559  * available with this entrypoint (e.g. interlace, MBAFF) and the
560  * application can query the encoding configuration attributes to find
561  * out more details if this entrypoint is supported.
562  */
563  VAEntrypointEncSliceLP = 8,
611 } VAEntrypoint;
612 
614 typedef enum {
615  VAConfigAttribRTFormat = 0,
616  VAConfigAttribSpatialResidual = 1,
617  VAConfigAttribSpatialClipping = 2,
618  VAConfigAttribIntraResidual = 3,
619  VAConfigAttribEncryption = 4,
620  VAConfigAttribRateControl = 5,
621 
987 
1054  VAConfigAttribTypeMax
1056 
1063 typedef struct _VAConfigAttrib {
1064  VAConfigAttribType type;
1065  uint32_t value; /* OR'd flags (bits) for this attribute */
1066 } VAConfigAttrib;
1067 
1068 /* Attribute values for VAConfigAttribRTFormat. */
1069 
1070 #define VA_RT_FORMAT_YUV420 0x00000001
1071 #define VA_RT_FORMAT_YUV422 0x00000002
1072 #define VA_RT_FORMAT_YUV444 0x00000004
1073 #define VA_RT_FORMAT_YUV411 0x00000008
1074 #define VA_RT_FORMAT_YUV400 0x00000010
1075 #define VA_RT_FORMAT_YUV420_10 0x00000100
1076 #define VA_RT_FORMAT_YUV422_10 0x00000200
1077 #define VA_RT_FORMAT_YUV444_10 0x00000400
1078 #define VA_RT_FORMAT_YUV420_12 0x00001000
1079 #define VA_RT_FORMAT_YUV422_12 0x00002000
1080 #define VA_RT_FORMAT_YUV444_12 0x00004000
1081 
1082 #define VA_RT_FORMAT_RGB16 0x00010000
1083 #define VA_RT_FORMAT_RGB32 0x00020000
1084 #define VA_RT_FORMAT_RGBP 0x00100000
1085 #define VA_RT_FORMAT_RGB32_10 0x00200000
1086 
1087 #define VA_RT_FORMAT_PROTECTED 0x80000000
1088 
1089 #define VA_RT_FORMAT_RGB32_10BPP VA_RT_FORMAT_RGB32_10
1090 #define VA_RT_FORMAT_YUV420_10BPP VA_RT_FORMAT_YUV420_10
1091 
1092 
1095 #define VA_RC_NONE 0x00000001
1096 
1097 #define VA_RC_CBR 0x00000002
1098 
1099 #define VA_RC_VBR 0x00000004
1100 
1101 #define VA_RC_VCM 0x00000008
1102 
1103 #define VA_RC_CQP 0x00000010
1104 
1105 #define VA_RC_VBR_CONSTRAINED 0x00000020
1106 
1108 #define VA_RC_ICQ 0x00000040
1109 
1111 #define VA_RC_MB 0x00000080
1112 
1113 #define VA_RC_CFS 0x00000100
1114 
1124 #define VA_RC_PARALLEL 0x00000200
1125 
1131 #define VA_RC_QVBR 0x00000400
1132 
1142 #define VA_RC_AVBR 0x00000800
1143 
1151 #define VA_RC_TCBRC 0x00001000
1152 
1158 #define VA_DEC_SLICE_MODE_NORMAL 0x00000001
1159 
1160 #define VA_DEC_SLICE_MODE_BASE 0x00000002
1161 
1164 typedef union _VAConfigAttribValDecJPEG {
1165  struct {
1167  uint32_t rotation : 4;
1169  uint32_t crop : 1;
1171  uint32_t reserved : 27;
1172  } bits;
1173  uint32_t value;
1174 } VAConfigAttribValDecJPEG;
1178 #define VA_DEC_PROCESSING_NONE 0x00000000
1179 
1180 #define VA_DEC_PROCESSING 0x00000001
1181 
1186 #define VA_ENC_PACKED_HEADER_NONE 0x00000000
1187 
1193 #define VA_ENC_PACKED_HEADER_SEQUENCE 0x00000001
1194 
1200 #define VA_ENC_PACKED_HEADER_PICTURE 0x00000002
1201 
1207 #define VA_ENC_PACKED_HEADER_SLICE 0x00000004
1208 
1216 #define VA_ENC_PACKED_HEADER_MISC 0x00000008
1217 
1218 #define VA_ENC_PACKED_HEADER_RAW_DATA 0x00000010
1219 
1224 #define VA_ENC_INTERLACED_NONE 0x00000000
1225 
1226 #define VA_ENC_INTERLACED_FRAME 0x00000001
1227 
1228 #define VA_ENC_INTERLACED_FIELD 0x00000002
1229 
1230 #define VA_ENC_INTERLACED_MBAFF 0x00000004
1231 
1232 #define VA_ENC_INTERLACED_PAFF 0x00000008
1233 
1238 #define VA_ENC_SLICE_STRUCTURE_POWER_OF_TWO_ROWS 0x00000001
1239 
1240 #define VA_ENC_SLICE_STRUCTURE_ARBITRARY_MACROBLOCKS 0x00000002
1241 
1242 #define VA_ENC_SLICE_STRUCTURE_EQUAL_ROWS 0x00000004
1243 
1244 #define VA_ENC_SLICE_STRUCTURE_MAX_SLICE_SIZE 0x00000008
1245 
1246 #define VA_ENC_SLICE_STRUCTURE_ARBITRARY_ROWS 0x00000010
1247 
1250 #define VA_ENC_SLICE_STRUCTURE_EQUAL_MULTI_ROWS 0x00000020
1251 
1254 typedef union _VAConfigAttribValMaxFrameSize {
1255  struct {
1261  uint32_t max_frame_size : 1;
1263  uint32_t multiple_pass : 1;
1265  uint32_t reserved : 30;
1266  } bits;
1267  uint32_t value;
1269 
1271 typedef union _VAConfigAttribValEncJPEG {
1272  struct {
1274  uint32_t arithmatic_coding_mode : 1;
1276  uint32_t progressive_dct_mode : 1;
1278  uint32_t non_interleaved_mode : 1;
1280  uint32_t differential_mode : 1;
1281  uint32_t max_num_components : 3;
1282  uint32_t max_num_scans : 4;
1283  uint32_t max_num_huffman_tables : 3;
1284  uint32_t max_num_quantization_tables : 3;
1285  } bits;
1286  uint32_t value;
1288 
1292 #define VA_ENC_QUANTIZATION_NONE 0x00000000
1293 
1294 #define VA_ENC_QUANTIZATION_TRELLIS_SUPPORTED 0x00000001
1295 
1305 #define VA_PREDICTION_DIRECTION_PREVIOUS 0x00000001
1306 
1307 #define VA_PREDICTION_DIRECTION_FUTURE 0x00000002
1308 
1309 #define VA_PREDICTION_DIRECTION_BI_NOT_EMPTY 0x00000004
1310 
1315 #define VA_ENC_INTRA_REFRESH_NONE 0x00000000
1316 
1317 #define VA_ENC_INTRA_REFRESH_ROLLING_COLUMN 0x00000001
1318 
1319 #define VA_ENC_INTRA_REFRESH_ROLLING_ROW 0x00000002
1320 
1321 #define VA_ENC_INTRA_REFRESH_ADAPTIVE 0x00000010
1322 
1323 #define VA_ENC_INTRA_REFRESH_CYCLIC 0x00000020
1324 
1325 #define VA_ENC_INTRA_REFRESH_P_FRAME 0x00010000
1326 
1327 #define VA_ENC_INTRA_REFRESH_B_FRAME 0x00020000
1328 
1329 #define VA_ENC_INTRA_REFRESH_MULTI_REF 0x00040000
1330 
1334 typedef union _VAConfigAttribValEncROI {
1335  struct {
1337  uint32_t num_roi_regions : 8;
1349  uint32_t roi_rc_priority_support : 1;
1361  uint32_t roi_rc_qp_delta_support : 1;
1362  uint32_t reserved : 22;
1363  } bits;
1364  uint32_t value;
1366 
1368 typedef union _VAConfigAttribValEncRateControlExt {
1369  struct {
1377  uint32_t max_num_temporal_layers_minus1 : 8;
1378 
1402  uint32_t temporal_layer_bitrate_control_flag : 1;
1403  uint32_t reserved : 23;
1404  } bits;
1405  uint32_t value;
1407 
1409 typedef union _VAConfigAttribValMultipleFrame {
1410  struct {
1412  uint32_t max_num_concurrent_frames : 8;
1416  uint32_t mixed_quality_level : 1;
1418  uint32_t reserved : 23;
1419  } bits;
1420  uint32_t value;
1422 
1424 typedef union _VAConfigAttribValContextPriority {
1425  struct {
1428  uint32_t priority : 16;
1430  uint32_t reserved : 16;
1431  } bits;
1432  uint32_t value;
1434 
1436 typedef union _VAConfigAttribValEncPerBlockControl {
1437  struct {
1439  uint32_t delta_qp_support : 1;
1441  uint32_t log2_delta_qp_block_size : 4;
1443  uint32_t delta_qp_size_in_bytes : 3;
1445  uint32_t reserved : 24;
1446  } bits;
1447  uint32_t value;
1449 
1452 #define VA_PC_CIPHER_AES 0x00000001
1453 
1456 #define VA_PC_BLOCK_SIZE_128 0x00000001
1457 
1458 #define VA_PC_BLOCK_SIZE_192 0x00000002
1459 
1460 #define VA_PC_BLOCK_SIZE_256 0x00000004
1461 
1464 #define VA_PC_CIPHER_MODE_ECB 0x00000001
1465 
1466 #define VA_PC_CIPHER_MODE_CBC 0x00000002
1467 
1468 #define VA_PC_CIPHER_MODE_CTR 0x00000004
1469 
1472 #define VA_PC_SAMPLE_TYPE_FULLSAMPLE 0x00000001
1473 
1474 #define VA_PC_SAMPLE_TYPE_SUBSAMPLE 0x00000002
1475 
1478 #define VA_PC_USAGE_DEFAULT 0x00000000
1479 
1480 #define VA_PC_USAGE_WIDEVINE 0x00000001
1481 
1485 #define VA_PROCESSING_RATE_NONE 0x00000000
1486 
1487 #define VA_PROCESSING_RATE_ENCODE 0x00000001
1488 
1489 #define VA_PROCESSING_RATE_DECODE 0x00000002
1490 
1495 #define VA_ATTRIB_NOT_SUPPORTED 0x80000000
1496 
1498 int vaMaxNumProfiles(
1499  VADisplay dpy
1500 );
1501 
1504  VADisplay dpy
1505 );
1506 
1509  VADisplay dpy
1510 );
1511 
1518 VAStatus vaQueryConfigProfiles(
1519  VADisplay dpy,
1520  VAProfile *profile_list, /* out */
1521  int *num_profiles /* out */
1522 );
1523 
1530 VAStatus vaQueryConfigEntrypoints(
1531  VADisplay dpy,
1532  VAProfile profile,
1533  VAEntrypoint *entrypoint_list, /* out */
1534  int *num_entrypoints /* out */
1535 );
1536 
1545 VAStatus vaGetConfigAttributes(
1546  VADisplay dpy,
1547  VAProfile profile,
1548  VAEntrypoint entrypoint,
1549  VAConfigAttrib *attrib_list, /* in/out */
1550  int num_attribs
1551 );
1552 
1554 typedef unsigned int VAGenericID;
1555 
1556 typedef VAGenericID VAConfigID;
1557 
1563 VAStatus vaCreateConfig(
1564  VADisplay dpy,
1565  VAProfile profile,
1566  VAEntrypoint entrypoint,
1567  VAConfigAttrib *attrib_list,
1568  int num_attribs,
1569  VAConfigID *config_id /* out */
1570 );
1571 
1575 VAStatus vaDestroyConfig(
1576  VADisplay dpy,
1577  VAConfigID config_id
1578 );
1579 
1588 VAStatus vaQueryConfigAttributes(
1589  VADisplay dpy,
1590  VAConfigID config_id,
1591  VAProfile *profile, /* out */
1592  VAEntrypoint *entrypoint, /* out */
1593  VAConfigAttrib *attrib_list,/* out */
1594  int *num_attribs /* out */
1595 );
1596 
1597 
1617 typedef VAGenericID VAContextID;
1618 
1619 typedef VAGenericID VASurfaceID;
1620 
1621 #define VA_INVALID_ID 0xffffffff
1622 #define VA_INVALID_SURFACE VA_INVALID_ID
1623 
1625 typedef enum {
1631 
1633 typedef void (*VAGenericFunc)(void);
1634 
1636 typedef struct _VAGenericValue {
1640  union {
1642  int32_t i;
1644  float f;
1646  void *p;
1649  } value;
1650 } VAGenericValue;
1651 
1655 #define VA_SURFACE_ATTRIB_NOT_SUPPORTED 0x00000000
1656 
1657 #define VA_SURFACE_ATTRIB_GETTABLE 0x00000001
1658 
1659 #define VA_SURFACE_ATTRIB_SETTABLE 0x00000002
1660 
1663 typedef enum {
1664  VASurfaceAttribNone = 0,
1714 
1716 typedef struct _VASurfaceAttrib {
1720  uint32_t flags;
1723 } VASurfaceAttrib;
1724 
1733 #define VA_SURFACE_ATTRIB_MEM_TYPE_VA 0x00000001
1734 
1735 #define VA_SURFACE_ATTRIB_MEM_TYPE_V4L2 0x00000002
1736 
1737 #define VA_SURFACE_ATTRIB_MEM_TYPE_USER_PTR 0x00000004
1738 
1743 typedef union _VASurfaceAttribAlignmentStruct {
1744  struct {
1746  uint32_t log2_width_alignment : 4;
1748  uint32_t log2_height_alignment : 4;
1749  uint32_t reserved : 24;
1750  } bits;
1751  uint32_t value;
1753 
1758 typedef struct _VASurfaceAttribExternalBuffers {
1760  uint32_t pixel_format;
1762  uint32_t width;
1764  uint32_t height;
1766  uint32_t data_size;
1768  uint32_t num_planes;
1770  uint32_t pitches[4];
1772  uint32_t offsets[4];
1774  uintptr_t *buffers;
1776  uint32_t num_buffers;
1778  uint32_t flags;
1782 
1786 #define VA_SURFACE_EXTBUF_DESC_ENABLE_TILING 0x00000001
1787 
1788 #define VA_SURFACE_EXTBUF_DESC_CACHED 0x00000002
1789 
1790 #define VA_SURFACE_EXTBUF_DESC_UNCACHED 0x00000004
1791 
1792 #define VA_SURFACE_EXTBUF_DESC_WC 0x00000008
1793 
1794 #define VA_SURFACE_EXTBUF_DESC_PROTECTED 0x80000000
1795 
1799 #define VA_SURFACE_ATTRIB_USAGE_HINT_GENERIC 0x00000000
1800 
1801 #define VA_SURFACE_ATTRIB_USAGE_HINT_DECODER 0x00000001
1802 
1803 #define VA_SURFACE_ATTRIB_USAGE_HINT_ENCODER 0x00000002
1804 
1805 #define VA_SURFACE_ATTRIB_USAGE_HINT_VPP_READ 0x00000004
1806 
1807 #define VA_SURFACE_ATTRIB_USAGE_HINT_VPP_WRITE 0x00000008
1808 
1809 #define VA_SURFACE_ATTRIB_USAGE_HINT_DISPLAY 0x00000010
1810 
1812 #define VA_SURFACE_ATTRIB_USAGE_HINT_EXPORT 0x00000020
1813 
1843 VAStatus
1845  VADisplay dpy,
1846  VAConfigID config,
1847  VASurfaceAttrib *attrib_list,
1848  unsigned int *num_attribs
1849 );
1850 
1868 VAStatus
1870  VADisplay dpy,
1871  unsigned int format,
1872  unsigned int width,
1873  unsigned int height,
1874  VASurfaceID *surfaces,
1875  unsigned int num_surfaces,
1876  VASurfaceAttrib *attrib_list,
1877  unsigned int num_attribs
1878 );
1879 
1888 VAStatus vaDestroySurfaces(
1889  VADisplay dpy,
1890  VASurfaceID *surfaces,
1891  int num_surfaces
1892 );
1893 
1894 #define VA_PROGRESSIVE 0x1
1895 
1907 VAStatus vaCreateContext(
1908  VADisplay dpy,
1909  VAConfigID config_id,
1910  int picture_width,
1911  int picture_height,
1912  int flag,
1913  VASurfaceID *render_targets,
1914  int num_render_targets,
1915  VAContextID *context /* out */
1916 );
1917 
1923 VAStatus vaDestroyContext(
1924  VADisplay dpy,
1925  VAContextID context
1926 );
1927 
1928 //Multi-frame context
1929 typedef VAGenericID VAMFContextID;
1946 VAStatus vaCreateMFContext(
1947  VADisplay dpy,
1948  VAMFContextID *mf_context /* out */
1949 );
1950 
1984 VAStatus vaMFAddContext(
1985  VADisplay dpy,
1986  VAMFContextID mf_context,
1987  VAContextID context
1988 );
1989 
2002 VAStatus vaMFReleaseContext(
2003  VADisplay dpy,
2004  VAMFContextID mf_context,
2005  VAContextID context
2006 );
2007 
2016 typedef VAGenericID VABufferID;
2017 
2018 typedef enum {
2019  VAPictureParameterBufferType = 0,
2020  VAIQMatrixBufferType = 1,
2021  VABitPlaneBufferType = 2,
2022  VASliceGroupMapBufferType = 3,
2023  VASliceParameterBufferType = 4,
2024  VASliceDataBufferType = 5,
2025  VAMacroblockParameterBufferType = 6,
2026  VAResidualDataBufferType = 7,
2027  VADeblockingParameterBufferType = 8,
2028  VAImageBufferType = 9,
2029  VAProtectedSliceDataBufferType = 10,
2030  VAQMatrixBufferType = 11,
2031  VAHuffmanTableBufferType = 12,
2032  VAProbabilityBufferType = 13,
2033 
2034  /* Following are encode buffer types */
2035  VAEncCodedBufferType = 21,
2036  VAEncSequenceParameterBufferType = 22,
2037  VAEncPictureParameterBufferType = 23,
2038  VAEncSliceParameterBufferType = 24,
2039  VAEncPackedHeaderParameterBufferType = 25,
2040  VAEncPackedHeaderDataBufferType = 26,
2041  VAEncMiscParameterBufferType = 27,
2042  VAEncMacroblockParameterBufferType = 28,
2043  VAEncMacroblockMapBufferType = 29,
2044 
2053  /* Following are video processing buffer types */
2078  VAEncFEIMBCodeBufferType = 44,
2079  VAEncFEIDistortionBufferType = 45,
2080  VAEncFEIMBControlBufferType = 46,
2081  VAEncFEIMVPredictorBufferType = 47,
2082  VAStatsStatisticsParameterBufferType = 48,
2087  VAStatsMVBufferType = 51,
2088  VAStatsMVPredictorBufferType = 52,
2109 
2134 
2140 
2151 
2152  VABufferTypeMax
2153 } VABufferType;
2154 
2160 typedef struct _VAContextParameterUpdateBuffer {
2161  union {
2162  struct {
2164  uint32_t context_priority_update : 1;
2166  uint32_t reserved : 31;
2167  } bits;
2168  uint32_t value;
2169  } flags;
2173  uint32_t reserved[VA_PADDING_MEDIUM];
2175 
2188 #define VA_ENCRYPTION_TYPE_FULLSAMPLE_CTR 0x00000001 /* AES CTR fullsample */
2189 #define VA_ENCRYPTION_TYPE_FULLSAMPLE_CBC 0x00000002 /* AES CBC fullsample */
2190 #define VA_ENCRYPTION_TYPE_SUBSAMPLE_CTR 0x00000004 /* AES CTR fullsample */
2191 #define VA_ENCRYPTION_TYPE_SUBSAMPLE_CBC 0x00000008 /* AES CBC fullsample */
2192 
2194 typedef struct _VAEncryptionSegmentInfo {
2199  uint32_t segment_length;
2208  uint8_t aes_cbc_iv_or_ctr[64];
2210  uint32_t va_reserved[VA_PADDING_MEDIUM];
2212 
2214 typedef struct _VAEncryptionParameters {
2220  uint32_t num_segments;
2228  uint32_t size_of_length;
2231  uint8_t wrapped_decrypt_blob[64];
2234  uint8_t wrapped_encrypt_blob[64];
2239  uint32_t key_blob_size;
2257  uint32_t va_reserved[VA_PADDING_MEDIUM];
2259 
2263 typedef struct _VAProcessingRateParameterEnc {
2265  uint8_t level_idc;
2266  uint8_t reserved[3];
2270  uint32_t quality_level;
2272  uint32_t intra_period;
2274  uint32_t ip_period;
2276 
2280 typedef struct _VAProcessingRateParameterDec {
2282  uint8_t level_idc;
2283  uint8_t reserved0[3];
2284  uint32_t reserved;
2286 
2287 typedef struct _VAProcessingRateParameter {
2288  union {
2289  VAProcessingRateParameterEnc proc_buf_enc;
2290  VAProcessingRateParameterDec proc_buf_dec;
2291  };
2292 } VAProcessingRateParameter;
2293 
2314 VAStatus
2316  VADisplay dpy,
2317  VAConfigID config,
2318  VAProcessingRateParameter *proc_buf,
2319  unsigned int *processing_rate
2320 );
2321 
2322 typedef enum {
2323  VAEncMiscParameterTypeFrameRate = 0,
2324  VAEncMiscParameterTypeRateControl = 1,
2325  VAEncMiscParameterTypeMaxSliceSize = 2,
2326  VAEncMiscParameterTypeAIR = 3,
2331  VAEncMiscParameterTypeQualityLevel = 6,
2360 
2362 typedef enum {
2385  VAEncPackedHeaderMiscMask va_deprecated_enum = 0x80000000,
2387 
2389 typedef struct _VAEncPackedHeaderParameterBuffer {
2391  uint32_t type;
2393  uint32_t bit_length;
2396 
2398  uint32_t va_reserved[VA_PADDING_LOW];
2400 
2418 typedef struct _VAEncMiscParameterBuffer {
2420  uint32_t data[];
2422 
2424 typedef struct _VAEncMiscParameterTemporalLayerStructure {
2428  uint32_t periodicity;
2435  uint32_t layer_id[32];
2436 
2438  uint32_t va_reserved[VA_PADDING_LOW];
2440 
2441 
2443 typedef struct _VAEncMiscParameterRateControl {
2457  uint32_t window_size;
2462  uint32_t initial_qp;
2468  uint32_t min_qp;
2474  union {
2475  struct {
2481  uint32_t reset : 1;
2483  uint32_t disable_frame_skip : 1;
2485  uint32_t disable_bit_stuffing : 1;
2493  uint32_t mb_rate_control : 4;
2495  uint32_t temporal_id : 8;
2497  uint32_t cfs_I_frames : 1;
2502  uint32_t enable_parallel_brc : 1;
2503  uint32_t enable_dynamic_scaling : 1;
2518  uint32_t frame_tolerance_mode : 2;
2520  uint32_t reserved : 12;
2521  } bits;
2522  uint32_t value;
2523  } rc_flags;
2535  uint32_t max_qp;
2540  uint32_t quality_factor;
2551  uint32_t va_reserved[VA_PADDING_LOW];
2553 
2560 typedef struct _VAEncMiscParameterFrameRate {
2580  uint32_t framerate;
2581  union {
2582  struct {
2584  uint32_t temporal_id : 8;
2586  uint32_t reserved : 24;
2587  } bits;
2588  uint32_t value;
2589  } framerate_flags;
2590 
2592  uint32_t va_reserved[VA_PADDING_LOW];
2594 
2600 typedef struct _VAEncMiscParameterMaxSliceSize {
2601  uint32_t max_slice_size;
2602 
2604  uint32_t va_reserved[VA_PADDING_LOW];
2606 
2607 typedef struct _VAEncMiscParameterAIR {
2608  uint32_t air_num_mbs;
2609  uint32_t air_threshold;
2610  uint32_t air_auto; /* if set to 1 then hardware auto-tune the AIR threshold */
2611 
2613  uint32_t va_reserved[VA_PADDING_LOW];
2614 } VAEncMiscParameterAIR;
2615 
2616 /*
2617  * \brief Rolling intra refresh data structure for encoding.
2618  */
2619 typedef struct _VAEncMiscParameterRIR {
2620  union {
2621  struct
2628  {
2629  /* \brief enable RIR in column */
2630  uint32_t enable_rir_column : 1;
2631  /* \brief enable RIR in row */
2632  uint32_t enable_rir_row : 1;
2633  uint32_t reserved : 30;
2634  } bits;
2635  uint32_t value;
2636  } rir_flags;
2641  uint16_t intra_insertion_location;
2646  uint16_t intra_insert_size;
2651  uint8_t qp_delta_for_inserted_intra;
2653  uint32_t va_reserved[VA_PADDING_LOW];
2654 } VAEncMiscParameterRIR;
2655 
2664 typedef struct _VAEncMiscParameterHRD {
2681  uint32_t buffer_size;
2682 
2684  uint32_t va_reserved[VA_PADDING_LOW];
2686 
2696 typedef struct _VAEncMiscParameterBufferMaxFrameSize {
2701  uint32_t max_frame_size;
2702 
2704  uint32_t va_reserved[VA_PADDING_LOW];
2706 
2716 typedef struct _VAEncMiscParameterBufferMultiPassFrameSize {
2721  uint32_t max_frame_size;
2723  uint32_t reserved;
2725  uint8_t num_passes;
2727  uint8_t *delta_qp;
2728 
2730  unsigned long va_reserved[VA_PADDING_LOW];
2732 
2744 typedef struct _VAEncMiscParameterBufferQualityLevel {
2748  uint32_t quality_level;
2749 
2751  uint32_t va_reserved[VA_PADDING_LOW];
2753 
2760 typedef struct _VAEncMiscParameterQuantization {
2761  union {
2762  /* if no flags is set then quantization is determined by the driver */
2763  struct {
2764  /* \brief disable trellis for all frames/fields */
2765  uint32_t disable_trellis : 1;
2766  /* \brief enable trellis for I frames/fields */
2767  uint32_t enable_trellis_I : 1;
2768  /* \brief enable trellis for P frames/fields */
2769  uint32_t enable_trellis_P : 1;
2770  /* \brief enable trellis for B frames/fields */
2771  uint32_t enable_trellis_B : 1;
2772  uint32_t reserved : 28;
2773  } bits;
2774  uint32_t value;
2775  } quantization_flags;
2776  uint32_t va_reserved;
2778 
2788 typedef struct _VAEncMiscParameterSkipFrame {
2801 
2803  uint32_t va_reserved[VA_PADDING_LOW];
2805 
2815 typedef struct _VAEncROI {
2838  int8_t roi_value;
2839 } VAEncROI;
2840 
2841 typedef struct _VAEncMiscParameterBufferROI {
2843  uint32_t num_roi;
2844 
2848  int8_t max_delta_qp;
2849  int8_t min_delta_qp;
2850 
2853  VAEncROI *roi;
2854  union {
2855  struct {
2868  uint32_t roi_value_is_qp_delta : 1;
2869  uint32_t reserved : 31;
2870  } bits;
2871  uint32_t value;
2872  } roi_flags;
2873 
2875  uint32_t va_reserved[VA_PADDING_LOW];
2876 } VAEncMiscParameterBufferROI;
2877 /*
2878  * \brief Dirty rectangle data structure for encoding.
2879  *
2880  * The encoding dirty rect can be set through VAEncMiscParameterBufferDirtyRect, if the
2881  * implementation supports dirty rect input. The rect set through this structure is applicable
2882  * only to the current frame or field, so must be sent every frame or field to be applied.
2883  * The number of supported rects can be queried through the VAConfigAttribEncDirtyRect. The
2884  * encoder will use the rect information to know those rectangle areas have changed while the
2885  * areas not covered by dirty rect rectangles are assumed to have not changed compared to the
2886  * previous picture. The encoder may do some internal optimizations.
2887  */
2888 typedef struct _VAEncMiscParameterBufferDirtyRect {
2890  uint32_t num_roi_rectangle;
2891 
2893  VARectangle *roi_rectangle;
2894 } VAEncMiscParameterBufferDirtyRect;
2895 
2897 typedef struct _VAEncMiscParameterParallelRateControl {
2899  uint32_t num_layers;
2904  uint32_t *num_b_in_gop;
2906 
2909 typedef struct _VAEncMiscParameterEncQuality {
2910  union {
2911  struct {
2915  uint32_t useRawPicForRef : 1;
2918  uint32_t skipCheckDisable : 1;
2921  uint32_t FTQOverride : 1;
2923  uint32_t FTQEnable : 1;
2926  uint32_t FTQSkipThresholdLUTInput : 1;
2929  uint32_t NonFTQSkipThresholdLUTInput : 1;
2930  uint32_t ReservedBit : 1;
2933  uint32_t directBiasAdjustmentEnable : 1;
2940  uint32_t globalMotionBiasAdjustmentEnable : 1;
2947  uint32_t HMEMVCostScalingFactor : 2;
2949  uint32_t HMEDisable : 1;
2951  uint32_t SuperHMEDisable : 1;
2953  uint32_t UltraHMEDisable : 1;
2957  uint32_t PanicModeDisable : 1;
2962  uint32_t ForceRepartitionCheck : 2;
2963 
2964  };
2965  uint32_t encControls;
2966  };
2967 
2969  uint8_t FTQSkipThresholdLUT[52];
2971  uint16_t NonFTQSkipThresholdLUT[52];
2972 
2973  uint32_t reserved[VA_PADDING_HIGH]; // Reserved for future use.
2974 
2976 
2983 typedef struct _VAEncMiscParameterCustomRoundingControl {
2984  union {
2985  struct {
2990  uint32_t enable_custom_rouding_intra : 1 ;
2991 
2995  uint32_t rounding_offset_intra : 7;
2996 
3001  uint32_t enable_custom_rounding_inter : 1 ;
3002 
3006  uint32_t rounding_offset_inter : 7;
3007 
3008  /* Reserved */
3009  uint32_t reserved : 16;
3010  } bits;
3011  uint32_t value;
3012  } rounding_offset_setting;
3014 
3023 #define VA_SLICE_DATA_FLAG_ALL 0x00 /* whole slice is in the buffer */
3024 #define VA_SLICE_DATA_FLAG_BEGIN 0x01 /* The beginning of the slice is in the buffer but the end if not */
3025 #define VA_SLICE_DATA_FLAG_MIDDLE 0x02 /* Neither beginning nor end of the slice is in the buffer */
3026 #define VA_SLICE_DATA_FLAG_END 0x04 /* end of the slice is in the buffer */
3027 
3028 /* Codec-independent Slice Parameter Buffer base */
3029 typedef struct _VASliceParameterBufferBase {
3030  uint32_t slice_data_size; /* number of bytes in the slice data buffer for this slice */
3031  uint32_t slice_data_offset; /* the offset to the first byte of slice data */
3032  uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX definitions */
3033 } VASliceParameterBufferBase;
3034 
3035 /**********************************
3036  * JPEG common data structures
3037  **********************************/
3050 typedef struct _VAHuffmanTableBufferJPEGBaseline {
3052  uint8_t load_huffman_table[2];
3054  struct {
3058  uint8_t num_dc_codes[16];
3060  uint8_t dc_values[12];
3065  uint8_t num_ac_codes[16];
3067  uint8_t ac_values[162];
3069  uint8_t pad[2];
3071  } huffman_table[2];
3072 
3074  uint32_t va_reserved[VA_PADDING_LOW];
3076 
3077 /****************************
3078  * MPEG-2 data structures
3079  ****************************/
3080 
3081 /* MPEG-2 Picture Parameter Buffer */
3082 /*
3083  * For each frame or field, and before any slice data, a single
3084  * picture parameter buffer must be send.
3085  */
3086 typedef struct _VAPictureParameterBufferMPEG2 {
3087  uint16_t horizontal_size;
3088  uint16_t vertical_size;
3089  VASurfaceID forward_reference_picture;
3090  VASurfaceID backward_reference_picture;
3091  /* meanings of the following fields are the same as in the standard */
3092  int32_t picture_coding_type;
3093  int32_t f_code; /* pack all four fcode into this */
3094  union {
3095  struct {
3096  uint32_t intra_dc_precision : 2;
3097  uint32_t picture_structure : 2;
3098  uint32_t top_field_first : 1;
3099  uint32_t frame_pred_frame_dct : 1;
3100  uint32_t concealment_motion_vectors : 1;
3101  uint32_t q_scale_type : 1;
3102  uint32_t intra_vlc_format : 1;
3103  uint32_t alternate_scan : 1;
3104  uint32_t repeat_first_field : 1;
3105  uint32_t progressive_frame : 1;
3106  uint32_t is_first_field : 1; /* indicate whether the current field
3107  * is the first field for field picture
3108  */
3109  } bits;
3110  uint32_t value;
3111  } picture_coding_extension;
3112 
3114  uint32_t va_reserved[VA_PADDING_LOW];
3115 } VAPictureParameterBufferMPEG2;
3116 
3118 typedef struct _VAIQMatrixBufferMPEG2 {
3128  uint8_t intra_quantiser_matrix[64];
3130  uint8_t non_intra_quantiser_matrix[64];
3132  uint8_t chroma_intra_quantiser_matrix[64];
3134  uint8_t chroma_non_intra_quantiser_matrix[64];
3135 
3137  uint32_t va_reserved[VA_PADDING_LOW];
3139 
3141 typedef struct _VASliceParameterBufferMPEG2 {
3142  uint32_t slice_data_size;/* number of bytes in the slice data buffer for this slice */
3143  uint32_t slice_data_offset;/* the offset to the first byte of slice data */
3144  uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
3145  uint32_t macroblock_offset;/* the offset to the first bit of MB from the first byte of slice data */
3146  uint32_t slice_horizontal_position;
3147  uint32_t slice_vertical_position;
3148  int32_t quantiser_scale_code;
3149  int32_t intra_slice_flag;
3150 
3152  uint32_t va_reserved[VA_PADDING_LOW];
3154 
3156 typedef struct _VAMacroblockParameterBufferMPEG2 {
3157  uint16_t macroblock_address;
3158  /*
3159  * macroblock_address (in raster scan order)
3160  * top-left: 0
3161  * bottom-right: picture-height-in-mb*picture-width-in-mb - 1
3162  */
3163  uint8_t macroblock_type; /* see definition below */
3164  union {
3165  struct {
3166  uint32_t frame_motion_type : 2;
3167  uint32_t field_motion_type : 2;
3168  uint32_t dct_type : 1;
3169  } bits;
3170  uint32_t value;
3171  } macroblock_modes;
3172  uint8_t motion_vertical_field_select;
3173  /*
3174  * motion_vertical_field_select:
3175  * see section 6.3.17.2 in the spec
3176  * only the lower 4 bits are used
3177  * bit 0: first vector forward
3178  * bit 1: first vector backward
3179  * bit 2: second vector forward
3180  * bit 3: second vector backward
3181  */
3182  int16_t PMV[2][2][2]; /* see Table 7-7 in the spec */
3183  uint16_t coded_block_pattern;
3184  /*
3185  * The bitplanes for coded_block_pattern are described
3186  * in Figure 6.10-12 in the spec
3187  */
3188 
3189  /* Number of skipped macroblocks after this macroblock */
3190  uint16_t num_skipped_macroblocks;
3191 
3193  uint32_t va_reserved[VA_PADDING_LOW];
3195 
3196 /*
3197  * OR'd flags for macroblock_type (section 6.3.17.1 in the spec)
3198  */
3199 #define VA_MB_TYPE_MOTION_FORWARD 0x02
3200 #define VA_MB_TYPE_MOTION_BACKWARD 0x04
3201 #define VA_MB_TYPE_MOTION_PATTERN 0x08
3202 #define VA_MB_TYPE_MOTION_INTRA 0x10
3203 
3210 /****************************
3211  * MPEG-4 Part 2 data structures
3212  ****************************/
3213 
3214 /* MPEG-4 Picture Parameter Buffer */
3215 /*
3216  * For each frame or field, and before any slice data, a single
3217  * picture parameter buffer must be send.
3218  */
3219 typedef struct _VAPictureParameterBufferMPEG4 {
3220  uint16_t vop_width;
3221  uint16_t vop_height;
3222  VASurfaceID forward_reference_picture;
3223  VASurfaceID backward_reference_picture;
3224  union {
3225  struct {
3226  uint32_t short_video_header : 1;
3227  uint32_t chroma_format : 2;
3228  uint32_t interlaced : 1;
3229  uint32_t obmc_disable : 1;
3230  uint32_t sprite_enable : 2;
3231  uint32_t sprite_warping_accuracy : 2;
3232  uint32_t quant_type : 1;
3233  uint32_t quarter_sample : 1;
3234  uint32_t data_partitioned : 1;
3235  uint32_t reversible_vlc : 1;
3236  uint32_t resync_marker_disable : 1;
3237  } bits;
3238  uint32_t value;
3239  } vol_fields;
3240  uint8_t no_of_sprite_warping_points;
3241  int16_t sprite_trajectory_du[3];
3242  int16_t sprite_trajectory_dv[3];
3243  uint8_t quant_precision;
3244  union {
3245  struct {
3246  uint32_t vop_coding_type : 2;
3247  uint32_t backward_reference_vop_coding_type : 2;
3248  uint32_t vop_rounding_type : 1;
3249  uint32_t intra_dc_vlc_thr : 3;
3250  uint32_t top_field_first : 1;
3251  uint32_t alternate_vertical_scan_flag : 1;
3252  } bits;
3253  uint32_t value;
3254  } vop_fields;
3255  uint8_t vop_fcode_forward;
3256  uint8_t vop_fcode_backward;
3257  uint16_t vop_time_increment_resolution;
3258  /* short header related */
3259  uint8_t num_gobs_in_vop;
3260  uint8_t num_macroblocks_in_gob;
3261  /* for direct mode prediction */
3262  int16_t TRB;
3263  int16_t TRD;
3264 
3266  uint32_t va_reserved[VA_PADDING_LOW];
3268 
3270 typedef struct _VAIQMatrixBufferMPEG4 {
3276  uint8_t intra_quant_mat[64];
3278  uint8_t non_intra_quant_mat[64];
3279 
3281  uint32_t va_reserved[VA_PADDING_LOW];
3283 
3285 typedef struct _VASliceParameterBufferMPEG4 {
3286  uint32_t slice_data_size;/* number of bytes in the slice data buffer for this slice */
3287  uint32_t slice_data_offset;/* the offset to the first byte of slice data */
3288  uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
3289  uint32_t macroblock_offset;/* the offset to the first bit of MB from the first byte of slice data */
3290  uint32_t macroblock_number;
3291  int32_t quant_scale;
3292 
3294  uint32_t va_reserved[VA_PADDING_LOW];
3296 
3301 typedef enum /* see 7.1.1.32 */
3302 {
3303  VAMvMode1Mv = 0,
3304  VAMvMode1MvHalfPel = 1,
3305  VAMvMode1MvHalfPelBilinear = 2,
3306  VAMvModeMixedMv = 3,
3307  VAMvModeIntensityCompensation = 4
3308 } VAMvModeVC1;
3309 
3311 /*
3312  * For each picture, and before any slice data, a picture parameter
3313  * buffer must be send. Multiple picture parameter buffers may be
3314  * sent for a single picture. In that case picture parameters will
3315  * apply to all slice data that follow it until a new picture
3316  * parameter buffer is sent.
3317  *
3318  * Notes:
3319  * pic_quantizer_type should be set to the applicable quantizer
3320  * type as defined by QUANTIZER (J.1.19) and either
3321  * PQUANTIZER (7.1.1.8) or PQINDEX (7.1.1.6)
3322  */
3323 typedef struct _VAPictureParameterBufferVC1 {
3324  VASurfaceID forward_reference_picture;
3325  VASurfaceID backward_reference_picture;
3326  /* if out-of-loop post-processing is done on the render
3327  target, then we need to keep the in-loop decoded
3328  picture as a reference picture */
3329  VASurfaceID inloop_decoded_picture;
3330 
3331  /* sequence layer for AP or meta data for SP and MP */
3332  union {
3333  struct {
3334  uint32_t pulldown : 1; /* SEQUENCE_LAYER::PULLDOWN */
3335  uint32_t interlace : 1; /* SEQUENCE_LAYER::INTERLACE */
3336  uint32_t tfcntrflag : 1; /* SEQUENCE_LAYER::TFCNTRFLAG */
3337  uint32_t finterpflag : 1; /* SEQUENCE_LAYER::FINTERPFLAG */
3338  uint32_t psf : 1; /* SEQUENCE_LAYER::PSF */
3339  uint32_t multires : 1; /* METADATA::MULTIRES */
3340  uint32_t overlap : 1; /* METADATA::OVERLAP */
3341  uint32_t syncmarker : 1; /* METADATA::SYNCMARKER */
3342  uint32_t rangered : 1; /* METADATA::RANGERED */
3343  uint32_t max_b_frames : 3; /* METADATA::MAXBFRAMES */
3344  uint32_t profile : 2; /* SEQUENCE_LAYER::PROFILE or The MSB of METADATA::PROFILE */
3345  } bits;
3346  uint32_t value;
3347  } sequence_fields;
3348 
3349  uint16_t coded_width; /* ENTRY_POINT_LAYER::CODED_WIDTH */
3350  uint16_t coded_height; /* ENTRY_POINT_LAYER::CODED_HEIGHT */
3351  union {
3352  struct {
3353  uint32_t broken_link : 1; /* ENTRY_POINT_LAYER::BROKEN_LINK */
3354  uint32_t closed_entry : 1; /* ENTRY_POINT_LAYER::CLOSED_ENTRY */
3355  uint32_t panscan_flag : 1; /* ENTRY_POINT_LAYER::PANSCAN_FLAG */
3356  uint32_t loopfilter : 1; /* ENTRY_POINT_LAYER::LOOPFILTER */
3357  } bits;
3358  uint32_t value;
3359  } entrypoint_fields;
3360  uint8_t conditional_overlap_flag; /* ENTRY_POINT_LAYER::CONDOVER */
3361  uint8_t fast_uvmc_flag; /* ENTRY_POINT_LAYER::FASTUVMC */
3362  union {
3363  struct {
3364  uint32_t luma_flag : 1; /* ENTRY_POINT_LAYER::RANGE_MAPY_FLAG */
3365  uint32_t luma : 3; /* ENTRY_POINT_LAYER::RANGE_MAPY */
3366  uint32_t chroma_flag : 1; /* ENTRY_POINT_LAYER::RANGE_MAPUV_FLAG */
3367  uint32_t chroma : 3; /* ENTRY_POINT_LAYER::RANGE_MAPUV */
3368  } bits;
3369  uint32_t value;
3370  } range_mapping_fields;
3371 
3372  uint8_t b_picture_fraction; /* Index for PICTURE_LAYER::BFRACTION value in Table 40 (7.1.1.14) */
3373  uint8_t cbp_table; /* PICTURE_LAYER::CBPTAB/ICBPTAB */
3374  uint8_t mb_mode_table; /* PICTURE_LAYER::MBMODETAB */
3375  uint8_t range_reduction_frame;/* PICTURE_LAYER::RANGEREDFRM */
3376  uint8_t rounding_control; /* PICTURE_LAYER::RNDCTRL */
3377  uint8_t post_processing; /* PICTURE_LAYER::POSTPROC */
3378  uint8_t picture_resolution_index; /* PICTURE_LAYER::RESPIC */
3379  uint8_t luma_scale; /* PICTURE_LAYER::LUMSCALE */
3380  uint8_t luma_shift; /* PICTURE_LAYER::LUMSHIFT */
3381 
3382  union {
3383  struct {
3384  uint32_t picture_type : 3; /* PICTURE_LAYER::PTYPE */
3385  uint32_t frame_coding_mode : 3; /* PICTURE_LAYER::FCM */
3386  uint32_t top_field_first : 1; /* PICTURE_LAYER::TFF */
3387  uint32_t is_first_field : 1; /* set to 1 if it is the first field */
3388  uint32_t intensity_compensation : 1; /* PICTURE_LAYER::INTCOMP */
3389  } bits;
3390  uint32_t value;
3391  } picture_fields;
3392  union {
3393  struct {
3394  uint32_t mv_type_mb : 1; /* PICTURE::MVTYPEMB */
3395  uint32_t direct_mb : 1; /* PICTURE::DIRECTMB */
3396  uint32_t skip_mb : 1; /* PICTURE::SKIPMB */
3397  uint32_t field_tx : 1; /* PICTURE::FIELDTX */
3398  uint32_t forward_mb : 1; /* PICTURE::FORWARDMB */
3399  uint32_t ac_pred : 1; /* PICTURE::ACPRED */
3400  uint32_t overflags : 1; /* PICTURE::OVERFLAGS */
3401  } flags;
3402  uint32_t value;
3403  } raw_coding;
3404  union {
3405  struct {
3406  uint32_t bp_mv_type_mb : 1; /* PICTURE::MVTYPEMB */
3407  uint32_t bp_direct_mb : 1; /* PICTURE::DIRECTMB */
3408  uint32_t bp_skip_mb : 1; /* PICTURE::SKIPMB */
3409  uint32_t bp_field_tx : 1; /* PICTURE::FIELDTX */
3410  uint32_t bp_forward_mb : 1; /* PICTURE::FORWARDMB */
3411  uint32_t bp_ac_pred : 1; /* PICTURE::ACPRED */
3412  uint32_t bp_overflags : 1; /* PICTURE::OVERFLAGS */
3413  } flags;
3414  uint32_t value;
3415  } bitplane_present; /* signal what bitplane is being passed via the bitplane buffer */
3416  union {
3417  struct {
3418  uint32_t reference_distance_flag : 1;/* PICTURE_LAYER::REFDIST_FLAG */
3419  uint32_t reference_distance : 5;/* PICTURE_LAYER::REFDIST */
3420  uint32_t num_reference_pictures: 1;/* PICTURE_LAYER::NUMREF */
3421  uint32_t reference_field_pic_indicator : 1;/* PICTURE_LAYER::REFFIELD */
3422  } bits;
3423  uint32_t value;
3424  } reference_fields;
3425  union {
3426  struct {
3427  uint32_t mv_mode : 3; /* PICTURE_LAYER::MVMODE */
3428  uint32_t mv_mode2 : 3; /* PICTURE_LAYER::MVMODE2 */
3429  uint32_t mv_table : 3; /* PICTURE_LAYER::MVTAB/IMVTAB */
3430  uint32_t two_mv_block_pattern_table: 2; /* PICTURE_LAYER::2MVBPTAB */
3431  uint32_t four_mv_switch : 1; /* PICTURE_LAYER::4MVSWITCH */
3432  uint32_t four_mv_block_pattern_table : 2; /* PICTURE_LAYER::4MVBPTAB */
3433  uint32_t extended_mv_flag : 1; /* ENTRY_POINT_LAYER::EXTENDED_MV */
3434  uint32_t extended_mv_range : 2; /* PICTURE_LAYER::MVRANGE */
3435  uint32_t extended_dmv_flag : 1; /* ENTRY_POINT_LAYER::EXTENDED_DMV */
3436  uint32_t extended_dmv_range : 2; /* PICTURE_LAYER::DMVRANGE */
3437  } bits;
3438  uint32_t value;
3439  } mv_fields;
3440  union {
3441  struct {
3442  uint32_t dquant : 2; /* ENTRY_POINT_LAYER::DQUANT */
3443  uint32_t quantizer : 2; /* ENTRY_POINT_LAYER::QUANTIZER */
3444  uint32_t half_qp : 1; /* PICTURE_LAYER::HALFQP */
3445  uint32_t pic_quantizer_scale : 5;/* PICTURE_LAYER::PQUANT */
3446  uint32_t pic_quantizer_type : 1;/* PICTURE_LAYER::PQUANTIZER */
3447  uint32_t dq_frame : 1; /* VOPDQUANT::DQUANTFRM */
3448  uint32_t dq_profile : 2; /* VOPDQUANT::DQPROFILE */
3449  uint32_t dq_sb_edge : 2; /* VOPDQUANT::DQSBEDGE */
3450  uint32_t dq_db_edge : 2; /* VOPDQUANT::DQDBEDGE */
3451  uint32_t dq_binary_level : 1; /* VOPDQUANT::DQBILEVEL */
3452  uint32_t alt_pic_quantizer : 5;/* VOPDQUANT::ALTPQUANT */
3453  } bits;
3454  uint32_t value;
3455  } pic_quantizer_fields;
3456  union {
3457  struct {
3458  uint32_t variable_sized_transform_flag : 1;/* ENTRY_POINT_LAYER::VSTRANSFORM */
3459  uint32_t mb_level_transform_type_flag : 1;/* PICTURE_LAYER::TTMBF */
3460  uint32_t frame_level_transform_type : 2;/* PICTURE_LAYER::TTFRM */
3461  uint32_t transform_ac_codingset_idx1 : 2;/* PICTURE_LAYER::TRANSACFRM */
3462  uint32_t transform_ac_codingset_idx2 : 2;/* PICTURE_LAYER::TRANSACFRM2 */
3463  uint32_t intra_transform_dc_table : 1;/* PICTURE_LAYER::TRANSDCTAB */
3464  } bits;
3465  uint32_t value;
3466  } transform_fields;
3467 
3468  uint8_t luma_scale2; /* PICTURE_LAYER::LUMSCALE2 */
3469  uint8_t luma_shift2; /* PICTURE_LAYER::LUMSHIFT2 */
3470  uint8_t intensity_compensation_field; /* Index for PICTURE_LAYER::INTCOMPFIELD value in Table 109 (9.1.1.48) */
3471 
3473  uint32_t va_reserved[VA_PADDING_MEDIUM - 1];
3475 
3494 /* VC-1 Slice Parameter Buffer */
3495 typedef struct _VASliceParameterBufferVC1 {
3496  uint32_t slice_data_size;/* number of bytes in the slice data buffer for this slice */
3497  uint32_t slice_data_offset;/* the offset to the first byte of slice data */
3498  uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
3499  uint32_t macroblock_offset;/* the offset to the first bit of MB from the first byte of slice data */
3500  uint32_t slice_vertical_position;
3501 
3503  uint32_t va_reserved[VA_PADDING_LOW];
3505 
3506 /* VC-1 Slice Data Buffer */
3507 /*
3508 This is simplely a buffer containing raw bit-stream bytes
3509 */
3510 
3511 /****************************
3512  * H.264/AVC data structures
3513  ****************************/
3514 
3515 typedef struct _VAPictureH264 {
3516  VASurfaceID picture_id;
3517  uint32_t frame_idx;
3518  uint32_t flags;
3519  int32_t TopFieldOrderCnt;
3520  int32_t BottomFieldOrderCnt;
3521 
3523  uint32_t va_reserved[VA_PADDING_LOW];
3524 } VAPictureH264;
3525 /* flags in VAPictureH264 could be OR of the following */
3526 #define VA_PICTURE_H264_INVALID 0x00000001
3527 #define VA_PICTURE_H264_TOP_FIELD 0x00000002
3528 #define VA_PICTURE_H264_BOTTOM_FIELD 0x00000004
3529 #define VA_PICTURE_H264_SHORT_TERM_REFERENCE 0x00000008
3530 #define VA_PICTURE_H264_LONG_TERM_REFERENCE 0x00000010
3531 
3533 /*
3534  * For each picture, and before any slice data, a single
3535  * picture parameter buffer must be send.
3536  */
3537 typedef struct _VAPictureParameterBufferH264 {
3538  VAPictureH264 CurrPic;
3539  VAPictureH264 ReferenceFrames[16]; /* in DPB */
3540  uint16_t picture_width_in_mbs_minus1;
3541  uint16_t picture_height_in_mbs_minus1;
3542  uint8_t bit_depth_luma_minus8;
3543  uint8_t bit_depth_chroma_minus8;
3544  uint8_t num_ref_frames;
3545  union {
3546  struct {
3547  uint32_t chroma_format_idc : 2;
3548  uint32_t residual_colour_transform_flag : 1; /* Renamed to separate_colour_plane_flag in newer standard versions. */
3549  uint32_t gaps_in_frame_num_value_allowed_flag : 1;
3550  uint32_t frame_mbs_only_flag : 1;
3551  uint32_t mb_adaptive_frame_field_flag : 1;
3552  uint32_t direct_8x8_inference_flag : 1;
3553  uint32_t MinLumaBiPredSize8x8 : 1; /* see A.3.3.2 */
3554  uint32_t log2_max_frame_num_minus4 : 4;
3555  uint32_t pic_order_cnt_type : 2;
3556  uint32_t log2_max_pic_order_cnt_lsb_minus4 : 4;
3557  uint32_t delta_pic_order_always_zero_flag : 1;
3558  } bits;
3559  uint32_t value;
3560  } seq_fields;
3561  // FMO is not supported.
3562  va_deprecated uint8_t num_slice_groups_minus1;
3563  va_deprecated uint8_t slice_group_map_type;
3564  va_deprecated uint16_t slice_group_change_rate_minus1;
3565  int8_t pic_init_qp_minus26;
3566  int8_t pic_init_qs_minus26;
3567  int8_t chroma_qp_index_offset;
3568  int8_t second_chroma_qp_index_offset;
3569  union {
3570  struct {
3571  uint32_t entropy_coding_mode_flag : 1;
3572  uint32_t weighted_pred_flag : 1;
3573  uint32_t weighted_bipred_idc : 2;
3574  uint32_t transform_8x8_mode_flag : 1;
3575  uint32_t field_pic_flag : 1;
3576  uint32_t constrained_intra_pred_flag : 1;
3577  uint32_t pic_order_present_flag : 1; /* Renamed to bottom_field_pic_order_in_frame_present_flag in newer standard versions. */
3578  uint32_t deblocking_filter_control_present_flag : 1;
3579  uint32_t redundant_pic_cnt_present_flag : 1;
3580  uint32_t reference_pic_flag : 1; /* nal_ref_idc != 0 */
3581  } bits;
3582  uint32_t value;
3583  } pic_fields;
3584  uint16_t frame_num;
3585 
3587  uint32_t va_reserved[VA_PADDING_MEDIUM];
3589 
3591 typedef struct _VAIQMatrixBufferH264 {
3593  uint8_t ScalingList4x4[6][16];
3595  uint8_t ScalingList8x8[2][64];
3596 
3598  uint32_t va_reserved[VA_PADDING_LOW];
3600 
3602 typedef struct _VASliceParameterBufferH264 {
3603  uint32_t slice_data_size;/* number of bytes in the slice data buffer for this slice */
3606  uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
3618  uint16_t first_mb_in_slice;
3619  uint8_t slice_type;
3620  uint8_t direct_spatial_mv_pred_flag;
3635  uint8_t cabac_init_idc;
3636  int8_t slice_qp_delta;
3637  uint8_t disable_deblocking_filter_idc;
3638  int8_t slice_alpha_c0_offset_div2;
3639  int8_t slice_beta_offset_div2;
3640  VAPictureH264 RefPicList0[32]; /* See 8.2.4.2 */
3641  VAPictureH264 RefPicList1[32]; /* See 8.2.4.2 */
3642  uint8_t luma_log2_weight_denom;
3643  uint8_t chroma_log2_weight_denom;
3644  uint8_t luma_weight_l0_flag;
3645  int16_t luma_weight_l0[32];
3646  int16_t luma_offset_l0[32];
3647  uint8_t chroma_weight_l0_flag;
3648  int16_t chroma_weight_l0[32][2];
3649  int16_t chroma_offset_l0[32][2];
3650  uint8_t luma_weight_l1_flag;
3651  int16_t luma_weight_l1[32];
3652  int16_t luma_offset_l1[32];
3653  uint8_t chroma_weight_l1_flag;
3654  int16_t chroma_weight_l1[32][2];
3655  int16_t chroma_offset_l1[32][2];
3656 
3658  uint32_t va_reserved[VA_PADDING_LOW];
3660 
3661 /****************************
3662  * Common encode data structures
3663  ****************************/
3664 typedef enum {
3665  VAEncPictureTypeIntra = 0,
3666  VAEncPictureTypePredictive = 1,
3667  VAEncPictureTypeBidirectional = 2,
3668 } VAEncPictureType;
3669 
3677 typedef struct _VAEncSliceParameterBuffer {
3678  uint32_t start_row_number; /* starting MB row number for this slice */
3679  uint32_t slice_height; /* slice height measured in MB */
3680  union {
3681  struct {
3682  uint32_t is_intra : 1;
3683  uint32_t disable_deblocking_filter_idc : 2;
3684  uint32_t uses_long_term_ref : 1;
3685  uint32_t is_long_term_ref : 1;
3686  } bits;
3687  uint32_t value;
3688  } slice_flags;
3689 
3691  uint32_t va_reserved[VA_PADDING_LOW];
3693 
3694 
3695 /****************************
3696  * H.263 specific encode data structures
3697  ****************************/
3698 
3699 typedef struct _VAEncSequenceParameterBufferH263 {
3700  uint32_t intra_period;
3701  uint32_t bits_per_second;
3702  uint32_t frame_rate;
3703  uint32_t initial_qp;
3704  uint32_t min_qp;
3705 
3707  uint32_t va_reserved[VA_PADDING_LOW];
3708 } VAEncSequenceParameterBufferH263;
3709 
3710 typedef struct _VAEncPictureParameterBufferH263 {
3711  VASurfaceID reference_picture;
3712  VASurfaceID reconstructed_picture;
3713  VABufferID coded_buf;
3714  uint16_t picture_width;
3715  uint16_t picture_height;
3716  VAEncPictureType picture_type;
3717 
3719  uint32_t va_reserved[VA_PADDING_LOW];
3720 } VAEncPictureParameterBufferH263;
3721 
3722 /****************************
3723  * MPEG-4 specific encode data structures
3724  ****************************/
3725 
3726 typedef struct _VAEncSequenceParameterBufferMPEG4 {
3727  uint8_t profile_and_level_indication;
3728  uint32_t intra_period;
3729  uint32_t video_object_layer_width;
3730  uint32_t video_object_layer_height;
3731  uint32_t vop_time_increment_resolution;
3732  uint32_t fixed_vop_rate;
3733  uint32_t fixed_vop_time_increment;
3734  uint32_t bits_per_second;
3735  uint32_t frame_rate;
3736  uint32_t initial_qp;
3737  uint32_t min_qp;
3738 
3740  uint32_t va_reserved[VA_PADDING_LOW];
3741 } VAEncSequenceParameterBufferMPEG4;
3742 
3743 typedef struct _VAEncPictureParameterBufferMPEG4 {
3744  VASurfaceID reference_picture;
3745  VASurfaceID reconstructed_picture;
3746  VABufferID coded_buf;
3747  uint16_t picture_width;
3748  uint16_t picture_height;
3749  uint32_t modulo_time_base; /* number of 1s */
3750  uint32_t vop_time_increment;
3751  VAEncPictureType picture_type;
3752 
3754  uint32_t va_reserved[VA_PADDING_LOW];
3755 } VAEncPictureParameterBufferMPEG4;
3756 
3757 
3758 
3776 VAStatus vaCreateBuffer(
3777  VADisplay dpy,
3778  VAContextID context,
3779  VABufferType type, /* in */
3780  unsigned int size, /* in */
3781  unsigned int num_elements, /* in */
3782  void *data, /* in */
3783  VABufferID *buf_id /* out */
3784 );
3785 
3797 VAStatus vaCreateBuffer2(
3798  VADisplay dpy,
3799  VAContextID context,
3800  VABufferType type,
3801  unsigned int width,
3802  unsigned int height,
3803  unsigned int *unit_size,
3804  unsigned int *pitch,
3805  VABufferID *buf_id
3806 );
3807 
3814 VAStatus vaBufferSetNumElements(
3815  VADisplay dpy,
3816  VABufferID buf_id, /* in */
3817  unsigned int num_elements /* in */
3818 );
3819 
3820 
3825 /*
3826  * FICTURE_AVE_QP(bit7-0): The average Qp value used during this frame
3827  * LARGE_SLICE(bit8):At least one slice in the current frame was large
3828  * enough for the encoder to attempt to limit its size.
3829  * SLICE_OVERFLOW(bit9): At least one slice in the current frame has
3830  * exceeded the maximum slice size specified.
3831  * BITRATE_OVERFLOW(bit10): The peak bitrate was exceeded for this frame.
3832  * BITRATE_HIGH(bit11): The frame size got within the safety margin of the maximum size (VCM only)
3833  * AIR_MB_OVER_THRESHOLD: the number of MBs adapted to Intra MB
3834  */
3835 #define VA_CODED_BUF_STATUS_PICTURE_AVE_QP_MASK 0xff
3836 #define VA_CODED_BUF_STATUS_LARGE_SLICE_MASK 0x100
3837 #define VA_CODED_BUF_STATUS_SLICE_OVERFLOW_MASK 0x200
3838 #define VA_CODED_BUF_STATUS_BITRATE_OVERFLOW 0x400
3839 #define VA_CODED_BUF_STATUS_BITRATE_HIGH 0x800
3840 
3847 #define VA_CODED_BUF_STATUS_FRAME_SIZE_OVERFLOW 0x1000
3848 
3851 #define VA_CODED_BUF_STATUS_BAD_BITSTREAM 0x8000
3852 #define VA_CODED_BUF_STATUS_AIR_MB_OVER_THRESHOLD 0xff0000
3853 
3862 #define VA_CODED_BUF_STATUS_NUMBER_PASSES_MASK 0xf000000
3863 
3871 #define VA_CODED_BUF_STATUS_SINGLE_NALU 0x10000000
3872 
3883 typedef struct _VACodedBufferSegment {
3887  uint32_t size;
3889  uint32_t bit_offset;
3891  uint32_t status;
3893  uint32_t reserved;
3895  void *buf;
3900  void *next;
3901 
3903  uint32_t va_reserved[VA_PADDING_LOW];
3905 
3914 VAStatus vaMapBuffer(
3915  VADisplay dpy,
3916  VABufferID buf_id, /* in */
3917  void **pbuf /* out */
3918 );
3919 
3929 #define VA_MAPBUFFER_FLAG_DEFAULT 0
3930 
3931 #define VA_MAPBUFFER_FLAG_READ 1
3932 
3933 #define VA_MAPBUFFER_FLAG_WRITE 2
3934 
3935 VAStatus vaMapBuffer2(
3936  VADisplay dpy,
3937  VABufferID buf_id, /* in */
3938  void **pbuf, /* out */
3939  uint32_t flags /* in */
3940 );
3941 
3947 VAStatus vaUnmapBuffer(
3948  VADisplay dpy,
3949  VABufferID buf_id /* in */
3950 );
3951 
3961 VAStatus vaDestroyBuffer(
3962  VADisplay dpy,
3963  VABufferID buffer_id
3964 );
3965 
3967 typedef struct {
3969  uintptr_t handle;
3971  uint32_t type;
3980  uint32_t mem_type;
3982  size_t mem_size;
3983 
3985  uint32_t va_reserved[VA_PADDING_LOW];
3986 } VABufferInfo;
3987 
4035 VAStatus
4036 vaAcquireBufferHandle(VADisplay dpy, VABufferID buf_id, VABufferInfo *buf_info);
4037 
4068 VAStatus
4069 vaReleaseBufferHandle(VADisplay dpy, VABufferID buf_id);
4070 
4076 #define VA_EXPORT_SURFACE_READ_ONLY 0x0001
4077 
4078 #define VA_EXPORT_SURFACE_WRITE_ONLY 0x0002
4079 
4080 #define VA_EXPORT_SURFACE_READ_WRITE 0x0003
4081 
4086 #define VA_EXPORT_SURFACE_SEPARATE_LAYERS 0x0004
4087 
4092 #define VA_EXPORT_SURFACE_COMPOSED_LAYERS 0x0008
4093 
4128 VAStatus vaExportSurfaceHandle(VADisplay dpy,
4129  VASurfaceID surface_id,
4130  uint32_t mem_type, uint32_t flags,
4131  void *descriptor);
4132 
4148 VAStatus vaBeginPicture(
4149  VADisplay dpy,
4150  VAContextID context,
4151  VASurfaceID render_target
4152 );
4153 
4157 VAStatus vaRenderPicture(
4158  VADisplay dpy,
4159  VAContextID context,
4160  VABufferID *buffers,
4161  int num_buffers
4162 );
4163 
4172 VAStatus vaEndPicture(
4173  VADisplay dpy,
4174  VAContextID context
4175 );
4176 
4196 VAStatus vaMFSubmit(
4197  VADisplay dpy,
4198  VAMFContextID mf_context,
4199  VAContextID * contexts,
4200  int num_contexts
4201 );
4202 
4203 /*
4204 
4205 Synchronization
4206 
4207 */
4208 
4214 VAStatus vaSyncSurface(
4215  VADisplay dpy,
4216  VASurfaceID render_target
4217 );
4218 
4220 #define VA_TIMEOUT_INFINITE 0xFFFFFFFFFFFFFFFF
4221 
4242 VAStatus vaSyncSurface2(
4243  VADisplay dpy,
4244  VASurfaceID surface,
4245  uint64_t timeout_ns
4246 );
4247 
4248 typedef enum {
4249  VASurfaceRendering = 1, /* Rendering in progress */
4250  VASurfaceDisplaying = 2, /* Displaying in progress (not safe to render into it) */
4251  /* this status is useful if surface is used as the source */
4252  /* of an overlay */
4253  VASurfaceReady = 4, /* not being rendered or displayed */
4254  VASurfaceSkipped = 8 /* Indicate a skipped frame during encode */
4255 } VASurfaceStatus;
4256 
4260 VAStatus vaQuerySurfaceStatus(
4261  VADisplay dpy,
4262  VASurfaceID render_target,
4263  VASurfaceStatus *status /* out */
4264 );
4265 
4266 typedef enum {
4267  VADecodeSliceMissing = 0,
4268  VADecodeMBError = 1,
4269  VADecodeReset = 2,
4270 } VADecodeErrorType;
4271 
4276 typedef struct _VASurfaceDecodeMBErrors {
4277  int32_t status; /* 1 if hardware has returned detailed info below, -1 means this record is invalid */
4278  uint32_t start_mb; /* start mb address with errors */
4279  uint32_t end_mb; /* end mb address with errors */
4280  VADecodeErrorType decode_error_type;
4281  uint32_t num_mb; /* number of mbs with errors */
4283  uint32_t va_reserved[VA_PADDING_LOW - 1];
4285 
4300 VAStatus vaQuerySurfaceError(
4301  VADisplay dpy,
4302  VASurfaceID surface,
4303  VAStatus error_status,
4304  void **error_info
4305 );
4306 
4327 VAStatus vaSyncBuffer(
4328  VADisplay dpy,
4329  VABufferID buf_id,
4330  uint64_t timeout_ns
4331 );
4332 
4354 #define VA_FOURCC(ch0, ch1, ch2, ch3) \
4355  ((unsigned long)(unsigned char) (ch0) | ((unsigned long)(unsigned char) (ch1) << 8) | \
4356  ((unsigned long)(unsigned char) (ch2) << 16) | ((unsigned long)(unsigned char) (ch3) << 24 ))
4357 
4358 /* Pre-defined fourcc codes. */
4359 
4363 #define VA_FOURCC_NV12 0x3231564E
4364 
4367 #define VA_FOURCC_NV21 0x3132564E
4368 
4373 #define VA_FOURCC_AI44 0x34344149
4374 
4379 #define VA_FOURCC_RGBA 0x41424752
4380 
4384 #define VA_FOURCC_RGBX 0x58424752
4385 
4389 #define VA_FOURCC_BGRA 0x41524742
4390 
4394 #define VA_FOURCC_BGRX 0x58524742
4395 
4399 #define VA_FOURCC_ARGB 0x42475241
4400 
4404 #define VA_FOURCC_XRGB 0x42475258
4405 
4409 #define VA_FOURCC_ABGR 0x52474241
4410 
4414 #define VA_FOURCC_XBGR 0x52474258
4415 
4420 #define VA_FOURCC_UYVY 0x59565955
4421 
4425 #define VA_FOURCC_YUY2 0x32595559
4426 
4430 #define VA_FOURCC_AYUV 0x56555941
4431 
4435 #define VA_FOURCC_NV11 0x3131564e
4436 
4440 #define VA_FOURCC_YV12 0x32315659
4441 
4445 #define VA_FOURCC_P208 0x38303250
4446 
4450 #define VA_FOURCC_I420 0x30323449
4451 
4455 #define VA_FOURCC_YV24 0x34325659
4456 
4460 #define VA_FOURCC_YV32 0x32335659
4461 
4463 #define VA_FOURCC_Y800 0x30303859
4464 
4469 #define VA_FOURCC_IMC3 0x33434D49
4470 
4474 #define VA_FOURCC_411P 0x50313134
4475 
4480 #define VA_FOURCC_411R 0x52313134
4481 
4485 #define VA_FOURCC_422H 0x48323234
4486 
4490 #define VA_FOURCC_422V 0x56323234
4491 
4495 #define VA_FOURCC_444P 0x50343434
4496 
4501 #define VA_FOURCC_RGBP 0x50424752
4502 
4506 #define VA_FOURCC_BGRP 0x50524742
4507 
4512 #define VA_FOURCC_RGB565 0x36314752
4513 
4518 #define VA_FOURCC_BGR565 0x36314742
4519 
4525 #define VA_FOURCC_Y210 0x30313259
4526 
4531 #define VA_FOURCC_Y212 0x32313259
4532 
4537 #define VA_FOURCC_Y216 0x36313259
4538 
4543 #define VA_FOURCC_Y410 0x30313459
4544 
4549 #define VA_FOURCC_Y412 0x32313459
4550 
4555 #define VA_FOURCC_Y416 0x36313459
4556 
4561 #define VA_FOURCC_YV16 0x36315659
4562 
4567 #define VA_FOURCC_P010 0x30313050
4568 
4573 #define VA_FOURCC_P012 0x32313050
4574 
4579 #define VA_FOURCC_P016 0x36313050
4580 
4586 #define VA_FOURCC_I010 0x30313049
4587 
4592 #define VA_FOURCC_IYUV 0x56555949
4593 
4596 #define VA_FOURCC_A2R10G10B10 0x30335241 /* VA_FOURCC('A','R','3','0') */
4597 
4600 #define VA_FOURCC_A2B10G10R10 0x30334241 /* VA_FOURCC('A','B','3','0') */
4601 
4604 #define VA_FOURCC_X2R10G10B10 0x30335258 /* VA_FOURCC('X','R','3','0') */
4605 
4608 #define VA_FOURCC_X2B10G10R10 0x30334258 /* VA_FOURCC('X','B','3','0') */
4609 
4614 #define VA_FOURCC_Y8 0x20203859
4615 
4619 #define VA_FOURCC_Y16 0x20363159
4620 
4624 #define VA_FOURCC_VYUY 0x59555956
4625 
4629 #define VA_FOURCC_YVYU 0x55595659
4630 
4634 #define VA_FOURCC_ARGB64 0x34475241
4635 
4639 #define VA_FOURCC_ABGR64 0x34474241
4640 
4644 #define VA_FOURCC_XYUV 0x56555958
4645 
4649 #define VA_FOURCC_Q416 0x36313451
4650 
4651 /* byte order */
4652 #define VA_LSB_FIRST 1
4653 #define VA_MSB_FIRST 2
4654 
4655 typedef struct _VAImageFormat {
4656  uint32_t fourcc;
4657  uint32_t byte_order; /* VA_LSB_FIRST, VA_MSB_FIRST */
4658  uint32_t bits_per_pixel;
4659  /* for RGB formats */
4660  uint32_t depth; /* significant bits per pixel */
4661  uint32_t red_mask;
4662  uint32_t green_mask;
4663  uint32_t blue_mask;
4664  uint32_t alpha_mask;
4665 
4667  uint32_t va_reserved[VA_PADDING_LOW];
4668 } VAImageFormat;
4669 
4670 typedef VAGenericID VAImageID;
4671 
4672 typedef struct _VAImage {
4673  VAImageID image_id; /* uniquely identify this image */
4674  VAImageFormat format;
4675  VABufferID buf; /* image data buffer */
4676  /*
4677  * Image data will be stored in a buffer of type VAImageBufferType to facilitate
4678  * data store on the server side for optimal performance. The buffer will be
4679  * created by the CreateImage function, and proper storage allocated based on the image
4680  * size and format. This buffer is managed by the library implementation, and
4681  * accessed by the client through the buffer Map/Unmap functions.
4682  */
4683  uint16_t width;
4684  uint16_t height;
4685  uint32_t data_size;
4686  uint32_t num_planes; /* can not be greater than 3 */
4687  /*
4688  * An array indicating the scanline pitch in bytes for each plane.
4689  * Each plane may have a different pitch. Maximum 3 planes for planar formats
4690  */
4691  uint32_t pitches[3];
4692  /*
4693  * An array indicating the byte offset from the beginning of the image data
4694  * to the start of each plane.
4695  */
4696  uint32_t offsets[3];
4697 
4698  /* The following fields are only needed for paletted formats */
4699  int32_t num_palette_entries; /* set to zero for non-palette images */
4700  /*
4701  * Each component is one byte and entry_bytes indicates the number of components in
4702  * each entry (eg. 3 for YUV palette entries). set to zero for non-palette images
4703  */
4704  int32_t entry_bytes;
4705  /*
4706  * An array of ascii characters describing the order of the components within the bytes.
4707  * Only entry_bytes characters of the string are used.
4708  */
4709  int8_t component_order[4];
4710 
4712  uint32_t va_reserved[VA_PADDING_LOW];
4713 } VAImage;
4714 
4717  VADisplay dpy
4718 );
4719 
4726 VAStatus vaQueryImageFormats(
4727  VADisplay dpy,
4728  VAImageFormat *format_list, /* out */
4729  int *num_formats /* out */
4730 );
4731 
4739 VAStatus vaCreateImage(
4740  VADisplay dpy,
4741  VAImageFormat *format,
4742  int width,
4743  int height,
4744  VAImage *image /* out */
4745 );
4746 
4750 VAStatus vaDestroyImage(
4751  VADisplay dpy,
4752  VAImageID image
4753 );
4754 
4755 VAStatus vaSetImagePalette(
4756  VADisplay dpy,
4757  VAImageID image,
4758  /*
4759  * pointer to an array holding the palette data. The size of the array is
4760  * num_palette_entries * entry_bytes in size. The order of the components
4761  * in the palette is described by the component_order in VAImage struct
4762  */
4763  unsigned char *palette
4764 );
4765 
4770 VAStatus vaGetImage(
4771  VADisplay dpy,
4772  VASurfaceID surface,
4773  int x, /* coordinates of the upper left source pixel */
4774  int y,
4775  unsigned int width, /* width and height of the region */
4776  unsigned int height,
4777  VAImageID image
4778 );
4779 
4786 VAStatus vaPutImage(
4787  VADisplay dpy,
4788  VASurfaceID surface,
4789  VAImageID image,
4790  int src_x,
4791  int src_y,
4792  unsigned int src_width,
4793  unsigned int src_height,
4794  int dest_x,
4795  int dest_y,
4796  unsigned int dest_width,
4797  unsigned int dest_height
4798 );
4799 
4831 VAStatus vaDeriveImage(
4832  VADisplay dpy,
4833  VASurfaceID surface,
4834  VAImage *image /* out */
4835 );
4836 
4844 typedef VAGenericID VASubpictureID;
4845 
4848  VADisplay dpy
4849 );
4850 
4852 #define VA_SUBPICTURE_CHROMA_KEYING 0x0001
4853 #define VA_SUBPICTURE_GLOBAL_ALPHA 0x0002
4854 #define VA_SUBPICTURE_DESTINATION_IS_SCREEN_COORD 0x0004
4855 
4867 VAStatus vaQuerySubpictureFormats(
4868  VADisplay dpy,
4869  VAImageFormat *format_list, /* out */
4870  unsigned int *flags, /* out */
4871  unsigned int *num_formats /* out */
4872 );
4873 
4877 VAStatus vaCreateSubpicture(
4878  VADisplay dpy,
4879  VAImageID image,
4880  VASubpictureID *subpicture /* out */
4881 );
4882 
4886 VAStatus vaDestroySubpicture(
4887  VADisplay dpy,
4888  VASubpictureID subpicture
4889 );
4890 
4895 VAStatus vaSetSubpictureImage(
4896  VADisplay dpy,
4897  VASubpictureID subpicture,
4898  VAImageID image
4899 );
4900 
4910 VAStatus vaSetSubpictureChromakey(
4911  VADisplay dpy,
4912  VASubpictureID subpicture,
4913  unsigned int chromakey_min,
4914  unsigned int chromakey_max,
4915  unsigned int chromakey_mask
4916 );
4917 
4924  VADisplay dpy,
4925  VASubpictureID subpicture,
4926  float global_alpha
4927 );
4928 
4936 VAStatus vaAssociateSubpicture(
4937  VADisplay dpy,
4938  VASubpictureID subpicture,
4939  VASurfaceID *target_surfaces,
4940  int num_surfaces,
4941  int16_t src_x, /* upper left offset in subpicture */
4942  int16_t src_y,
4943  uint16_t src_width,
4944  uint16_t src_height,
4945  int16_t dest_x, /* upper left offset in surface */
4946  int16_t dest_y,
4947  uint16_t dest_width,
4948  uint16_t dest_height,
4949  /*
4950  * whether to enable chroma-keying, global-alpha, or screen relative mode
4951  * see VA_SUBPICTURE_XXX values
4952  */
4953  uint32_t flags
4954 );
4955 
4959 VAStatus vaDeassociateSubpicture(
4960  VADisplay dpy,
4961  VASubpictureID subpicture,
4962  VASurfaceID *target_surfaces,
4963  int num_surfaces
4964 );
4965 
4983 /* PowerVR IEP Lite attributes */
4984 typedef enum {
4985  VADISPLAYATTRIB_BLE_OFF = 0x00,
4986  VADISPLAYATTRIB_BLE_LOW,
4987  VADISPLAYATTRIB_BLE_MEDIUM,
4988  VADISPLAYATTRIB_BLE_HIGH,
4989  VADISPLAYATTRIB_BLE_NONE,
4991 
4993 #define VA_ROTATION_NONE 0x00000000
4994 #define VA_ROTATION_90 0x00000001
4995 #define VA_ROTATION_180 0x00000002
4996 #define VA_ROTATION_270 0x00000003
4997 
5008 #define VA_MIRROR_NONE 0x00000000
5009 
5010 #define VA_MIRROR_HORIZONTAL 0x00000001
5011 
5012 #define VA_MIRROR_VERTICAL 0x00000002
5013 
5016 #define VA_OOL_DEBLOCKING_FALSE 0x00000000
5017 #define VA_OOL_DEBLOCKING_TRUE 0x00000001
5018 
5020 #define VA_RENDER_MODE_UNDEFINED 0
5021 #define VA_RENDER_MODE_LOCAL_OVERLAY 1
5022 #define VA_RENDER_MODE_LOCAL_GPU 2
5023 #define VA_RENDER_MODE_EXTERNAL_OVERLAY 4
5024 #define VA_RENDER_MODE_EXTERNAL_GPU 8
5025 
5027 #define VA_RENDER_DEVICE_UNDEFINED 0
5028 #define VA_RENDER_DEVICE_LOCAL 1
5029 #define VA_RENDER_DEVICE_EXTERNAL 2
5030 
5044 typedef union _VADisplayAttribValSubDevice {
5045  struct {
5047  uint32_t current_sub_device : 4;
5049  uint32_t sub_device_count : 4;
5051  uint32_t reserved : 8;
5067  uint32_t sub_device_mask : 16;
5068  } bits;
5069  uint32_t value;
5071 
5073 typedef enum {
5074  VADisplayAttribBrightness = 0,
5075  VADisplayAttribContrast = 1,
5076  VADisplayAttribHue = 2,
5077  VADisplayAttribSaturation = 3,
5078  /* client can specifiy a background color for the target window
5079  * the new feature of video conference,
5080  * the uncovered area of the surface is filled by this color
5081  * also it will blend with the decoded video color
5082  */
5083  VADisplayAttribBackgroundColor = 4,
5084  /*
5085  * this is a gettable only attribute. For some implementations that use the
5086  * hardware overlay, after PutSurface is called, the surface can not be
5087  * re-used until after the subsequent PutSurface call. If this is the case
5088  * then the value for this attribute will be set to 1 so that the client
5089  * will not attempt to re-use the surface right after returning from a call
5090  * to PutSurface.
5091  *
5092  * Don't use it, use flag VASurfaceDisplaying of vaQuerySurfaceStatus since
5093  * driver may use overlay or GPU alternatively
5094  */
5095  VADisplayAttribDirectSurface = 5,
5096  VADisplayAttribRotation = 6,
5097  VADisplayAttribOutofLoopDeblock = 7,
5098 
5099  /* PowerVR IEP Lite specific attributes */
5100  VADisplayAttribBLEBlackMode = 8,
5101  VADisplayAttribBLEWhiteMode = 9,
5102  VADisplayAttribBlueStretch = 10,
5103  VADisplayAttribSkinColorCorrection = 11,
5104  /*
5105  * For type VADisplayAttribCSCMatrix, "value" field is a pointer to the color
5106  * conversion matrix. Each element in the matrix is float-point
5107  */
5108  VADisplayAttribCSCMatrix = 12,
5109  /* specify the constant color used to blend with video surface
5110  * Cd = Cv*Cc*Ac + Cb *(1 - Ac) C means the constant RGB
5111  * d: the final color to overwrite into the frame buffer
5112  * v: decoded video after color conversion,
5113  * c: video color specified by VADisplayAttribBlendColor
5114  * b: background color of the drawable
5115  */
5116  VADisplayAttribBlendColor = 13,
5117  /*
5118  * Indicate driver to skip painting color key or not.
5119  * only applicable if the render is overlay
5120  */
5121  VADisplayAttribOverlayAutoPaintColorKey = 14,
5122  /*
5123  * customized overlay color key, the format is RGB888
5124  * [23:16] = Red, [15:08] = Green, [07:00] = Blue.
5125  */
5126  VADisplayAttribOverlayColorKey = 15,
5127  /*
5128  * The hint for the implementation of vaPutSurface
5129  * normally, the driver could use an overlay or GPU to render the surface on the screen
5130  * this flag provides APP the flexibity to switch the render dynamically
5131  */
5132  VADisplayAttribRenderMode = 16,
5133  /*
5134  * specify if vaPutSurface needs to render into specified monitors
5135  * one example is that one external monitor (e.g. HDMI) is enabled,
5136  * but the window manager is not aware of it, and there is no associated drawable
5137  */
5138  VADisplayAttribRenderDevice = 17,
5139  /*
5140  * specify vaPutSurface render area if there is no drawable on the monitor
5141  */
5142  VADisplayAttribRenderRect = 18,
5143  /*
5144  * HW attribute, read/write, specify the sub device configure
5145  */
5146  VADisplayAttribSubDevice = 19,
5147  /*
5148  * HW attribute. read only. specify whether vaCopy support on current HW
5149  * The value of each bit should equal to 1 << VA_EXEC_MODE_XXX to represent
5150  * modes of vaCopy
5151  */
5152  VADisplayAttribCopy = 20,
5153  /*
5154  * HW attribute. read only. retrieve the device information from backend driver
5155  * the value should be combined with vendor ID << 16 | device ID
5156  */
5157  VADisplayPCIID = 21,
5159 
5160 /* flags for VADisplayAttribute */
5161 #define VA_DISPLAY_ATTRIB_NOT_SUPPORTED 0x0000
5162 #define VA_DISPLAY_ATTRIB_GETTABLE 0x0001
5163 #define VA_DISPLAY_ATTRIB_SETTABLE 0x0002
5164 
5165 typedef struct _VADisplayAttribute {
5166  VADisplayAttribType type;
5167  int32_t min_value;
5168  int32_t max_value;
5169  int32_t value; /* used by the set/get attribute functions */
5170  /* flags can be VA_DISPLAY_ATTRIB_GETTABLE or VA_DISPLAY_ATTRIB_SETTABLE or OR'd together */
5171  uint32_t flags;
5172 
5174  uint32_t va_reserved[VA_PADDING_LOW];
5175 } VADisplayAttribute;
5176 
5179  VADisplay dpy
5180 );
5181 
5188 VAStatus vaQueryDisplayAttributes(
5189  VADisplay dpy,
5190  VADisplayAttribute *attr_list, /* out */
5191  int *num_attributes /* out */
5192 );
5193 
5200 VAStatus vaGetDisplayAttributes(
5201  VADisplay dpy,
5202  VADisplayAttribute *attr_list, /* in/out */
5203  int num_attributes
5204 );
5205 
5212 VAStatus vaSetDisplayAttributes(
5213  VADisplay dpy,
5214  VADisplayAttribute *attr_list,
5215  int num_attributes
5216 );
5217 
5218 /****************************
5219  * HEVC data structures
5220  ****************************/
5230 typedef struct _VAPictureHEVC {
5234  VASurfaceID picture_id;
5239  int32_t pic_order_cnt;
5240  /* described below */
5241  uint32_t flags;
5242 
5244  uint32_t va_reserved[VA_PADDING_LOW];
5245 } VAPictureHEVC;
5246 
5247 /* flags in VAPictureHEVC could be OR of the following */
5248 #define VA_PICTURE_HEVC_INVALID 0x00000001
5249 
5252 #define VA_PICTURE_HEVC_FIELD_PIC 0x00000002
5253 
5257 #define VA_PICTURE_HEVC_BOTTOM_FIELD 0x00000004
5258 
5259 #define VA_PICTURE_HEVC_LONG_TERM_REFERENCE 0x00000008
5260 
5274 #define VA_PICTURE_HEVC_RPS_ST_CURR_BEFORE 0x00000010
5275 
5279 #define VA_PICTURE_HEVC_RPS_ST_CURR_AFTER 0x00000020
5280 
5284 #define VA_PICTURE_HEVC_RPS_LT_CURR 0x00000040
5285 
5286 typedef enum {
5287  VACopyObjectSurface = 0,
5288  VACopyObjectBuffer = 1,
5289 } VACopyObjectType;
5290 
5291 typedef struct _VACopyObject {
5292  VACopyObjectType obj_type; // type of object.
5293  union {
5294  VASurfaceID surface_id;
5295  VABufferID buffer_id;
5296  } object;
5297 
5298  uint32_t va_reserved[VA_PADDING_MEDIUM];
5299 } VACopyObject;
5300 
5301 typedef union _VACopyOption {
5302  struct {
5304  uint32_t va_copy_sync : 2;
5306  uint32_t va_copy_mode : 4;
5307  uint32_t reserved : 26;
5308  } bits;
5309  uint32_t value;
5310 } VACopyOption;
5311 
5324 VAStatus vaCopy(VADisplay dpy, VACopyObject * dst, VACopyObject * src, VACopyOption option);
5325 
5326 #include <va/va_dec_hevc.h>
5327 #include <va/va_dec_jpeg.h>
5328 #include <va/va_dec_vp8.h>
5329 #include <va/va_dec_vp9.h>
5330 #include <va/va_dec_av1.h>
5331 #include <va/va_enc_hevc.h>
5332 #include <va/va_fei_hevc.h>
5333 #include <va/va_enc_h264.h>
5334 #include <va/va_enc_jpeg.h>
5335 #include <va/va_enc_mpeg2.h>
5336 #include <va/va_enc_vp8.h>
5337 #include <va/va_enc_vp9.h>
5338 #include <va/va_enc_av1.h>
5339 #include <va/va_fei.h>
5340 #include <va/va_fei_h264.h>
5341 #include <va/va_vpp.h>
5342 #include <va/va_prot.h>
5343 
5346 #ifdef __cplusplus
5347 }
5348 #endif
5349 
5350 #endif /* _VA_H_ */
combined submission of multiple frames from different streams, it is optimization for different HW im...
Definition: va.h:935
Encoding skip frame attribute. Read-only.
Definition: va.h:799
VAStatus vaCreateBuffer2(VADisplay dpy, VAContextID context, VABufferType type, unsigned int width, unsigned int height, unsigned int *unit_size, unsigned int *pitch, VABufferID *buf_id)
Decryption sample type of the protected content session.
Definition: va.h:979
The video processing API.
VAStatus vaQueryConfigAttributes(VADisplay dpy, VAConfigID config_id, VAProfile *profile, VAEntrypoint *entrypoint, VAConfigAttrib *attrib_list, int *num_attribs)
The MPEG-2 encoding API.
void(* VAGenericFunc)(void)
Generic function type.
Definition: va.h:1633
Tile Support Attribute. Read-only.
Definition: va.h:902
VAStatus vaBeginPicture(VADisplay dpy, VAContextID context, VASurfaceID render_target)
Video processing pipeline parameter buffer.
Definition: va.h:2060
Buffer type used for HRD parameters.
Definition: va.h:2330
Definition: va.h:564
Protected content API.
uint32_t status_report_index
The status report index reserved for CENC fullsample workload. The related structures and definitions...
Definition: va.h:2226
The HEVC encoding API.
uint32_t max_qp
Definition: va.h:2535
Set MB partion mode mask and Half-pel/Quant-pel motion search.
Definition: va.h:2350
Number of surface attributes.
Definition: va.h:1712
Attribute value for VAConfigAttribEncParallelRateControl.
Definition: va.h:2897
VAStatus vaSyncSurface2(VADisplay dpy, VASurfaceID surface, uint64_t timeout_ns)
Synchronizes pending operations associated with the supplied surface.
uint32_t data_size
total size of the buffer in bytes.
Definition: va.h:1766
int32_t load_intra_quant_mat
Definition: va.h:3272
HEVC/H.265 encoding block sizes. Read-only.
Definition: va.h:1007
VAStatus vaExportSurfaceHandle(VADisplay dpy, VASurfaceID surface_id, uint32_t mem_type, uint32_t flags, void *descriptor)
Export a handle to a surface for use with an external API.
VP8 decoding API.
Surface attribute.
Definition: va.h:1716
#define va_deprecated_enum
Misc packed header. See codec-specific definitions.
Definition: va.h:98
The HEVC decoding API.
Buffer type used for parallel BRC parameters.
Definition: va.h:2348
inter frame prediction directrion attribute. Read-only. this attribute conveys the prediction directi...
Definition: va.h:931
The VP9 decoding API.
int vaMaxNumImageFormats(VADisplay dpy)
uint32_t num_buffers
number of elements in the &quot;buffers&quot; array
Definition: va.h:1776
uint32_t type
Definition: va.h:2391
Definition: va.h:1628
VAMvModeVC1
Definition: va.h:3301
VAGenericID VAContextID
Definition: va.h:1617
VAStatus vaMFSubmit(VADisplay dpy, VAMFContextID mf_context, VAContextID *contexts, int num_contexts)
uint32_t num_planes
number of planes for planar layout
Definition: va.h:1768
int32_t i
32-bit signed integer.
Definition: va.h:1642
uint32_t framerate
Definition: va.h:2580
uint8_t num_passes
number of passes, every pass has different QP, currently AVC encoder can support up to 4 passes ...
Definition: va.h:2725
VAStatus vaQuerySurfaceError(VADisplay dpy, VASurfaceID surface, VAStatus error_status, void **error_info)
void * private_data
reserved for passing private data
Definition: va.h:1780
uint32_t max_frame_size
Maximum size of a frame (in byte)
Definition: va.h:2721
uint32_t initial_buffer_fullness
Definition: va.h:2675
VAStatus vaDestroySurfaces(VADisplay dpy, VASurfaceID *surfaces, int num_surfaces)
VAStatus vaTerminate(VADisplay dpy)
VAStatus vaSyncSurface(VADisplay dpy, VASurfaceID render_target)
VAMessageCallback vaSetInfoCallback(VADisplay dpy, VAMessageCallback callback, void *user_context)
VAStatus vaSetSubpictureGlobalAlpha(VADisplay dpy, VASubpictureID subpicture, float global_alpha)
VAStatus vaPutImage(VADisplay dpy, VASurfaceID surface, VAImageID image, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y, unsigned int dest_width, unsigned int dest_height)
int vaMaxNumEntrypoints(VADisplay dpy)
Rate control parameters.
Definition: va.h:2443
encode max frame size attribute. Read-only attribute value VAConfigAttribValMaxFrameSize represent ma...
Definition: va.h:919
Attribute value for VAConfigAttribEncRateControlExt.
Definition: va.h:1368
set encode quality tuning
Definition: va.h:2352
Encode Slice Parameter Buffer.
Definition: va.h:3677
uint32_t height
height in pixels.
Definition: va.h:1764
HEVC FEI CU level data buffer it&#39;s CTB level information for future usage.
Definition: va.h:2105
uint8_t * delta_qp
delta QP list for every pass
Definition: va.h:2727
JPEG encoding API.
VAStatus vaSetSubpictureImage(VADisplay dpy, VASubpictureID subpicture, VAImageID image)
Encoding skip frame.
Definition: va.h:2788
VAStatus vaCreateContext(VADisplay dpy, VAConfigID config_id, int picture_width, int picture_height, int flag, VASurfaceID *render_targets, int num_render_targets, VAContextID *context)
Definition: va.h:3602
uint32_t buffer_size
Definition: va.h:2681
VA buffer information.
Definition: va.h:3967
HEVC Decoding Subset Parameter buffer type.
Definition: va.h:2120
Buffer type used for temporal layer structure.
Definition: va.h:2344
Definition: va.h:2280
Packed headers mode. Read/write.
Definition: va.h:689
Slice structure. Read-only.
Definition: va.h:733
const char * vaErrorStr(VAStatus error_status)
VAStatus vaCopy(VADisplay dpy, VACopyObject *dst, VACopyObject *src, VACopyOption option)
Copies an object.
The FEI encoding HEVC special API.
Generic motion vector data structure.
Definition: va.h:413
uint32_t status
Status set by the driver. See VA_CODED_BUF_STATUS_*.
Definition: va.h:3891
va_deprecated VAEncMiscParameterType type
Type. Shall be set to VAEncMiscParameterTypeMaxFrameSize.
Definition: va.h:2699
uint32_t reserved
Reserved for future use.
Definition: va.h:3893
VAStatus vaQueryImageFormats(VADisplay dpy, VAImageFormat *format_list, int *num_formats)
uint8_t has_emulation_bytes
Flag: buffer contains start code emulation prevention bytes?
Definition: va.h:2395
VAEncMiscParameterType
Definition: va.h:2322
JPEG encoding attribute. Read-only.
Definition: va.h:767
Definition: va.h:2600
AV1 decoding features. Read-only.
Definition: va.h:947
Statistics attribute. Read-only.
Definition: va.h:894
Defines a maximum frame size (in bits).
Definition: va.h:2696
Definition: va.h:3495
Structure to describe rectangle.
Definition: va.h:405
VAStatus vaGetConfigAttributes(VADisplay dpy, VAProfile profile, VAEntrypoint entrypoint, VAConfigAttrib *attrib_list, int num_attribs)
size_t mem_size
Size of the underlying buffer.
Definition: va.h:3982
uint32_t periodicity
The length of the array defining frame layer membership. Should be 1-32.
Definition: va.h:2428
uint16_t slice_data_bit_offset
Bit offset from NAL Header Unit to the begining of slice_data().
Definition: va.h:3617
VAStatus vaQuerySurfaceAttributes(VADisplay dpy, VAConfigID config, VASurfaceAttrib *attrib_list, unsigned int *num_attribs)
Queries surface attributes for the supplied config.
uint32_t window_size
Definition: va.h:2457
AV1 encoding API.
Encoding quality range attribute. Read-only.
Definition: va.h:776
VAStatus vaEndPicture(VADisplay dpy, VAContextID context)
uint32_t basic_unit_size
Definition: va.h:2473
Cipher block size of the protected content session.
Definition: va.h:965
Buffer type used for Rolling intra refresh.
Definition: va.h:2333
uint32_t size_of_length
CENC counter length.
Definition: va.h:2228
Definition: va.h:2108
The JPEG decoding API.
Buffer type used for quantization parameters, it&#39;s per-sequence parameter.
Definition: va.h:2335
Temporal layer Structure.
Definition: va.h:2424
Definition: va.h:2909
va_deprecated VAEncMiscParameterType type
Type. Shall be set to #VAEncMiscParameterTypeMultiPassMaxFrameSize.
Definition: va.h:2719
VAProfile
Definition: va.h:501
VAStatus vaSetSubpictureChromakey(VADisplay dpy, VASubpictureID subpicture, unsigned int chromakey_min, unsigned int chromakey_max, unsigned int chromakey_mask)
VAStatus vaCreateConfig(VADisplay dpy, VAProfile profile, VAEntrypoint entrypoint, VAConfigAttrib *attrib_list, int num_attribs, VAConfigID *config_id)
const char * vaQueryVendorString(VADisplay dpy)
uint32_t target_percentage
Definition: va.h:2451
AV1 encoding attribute extend2. Read-only.
Definition: va.h:1031
VAEntrypoint
Definition: va.h:547
VABufferType
Definition: va.h:2018
VASurfaceAttribAlignmentStruct structure for the VASurfaceAttribAlignmentSize attribute.
Definition: va.h:1743
Definition: va.h:3141
Maximum picture height. Read-only.
Definition: va.h:759
uint32_t quality_level
quality level. When set to 0, default quality level is used.
Definition: va.h:2270
VAStatus vaCreateImage(VADisplay dpy, VAImageFormat *format, int width, int height, VAImage *image)
Parallel Rate Control (hierachical B) attribute. Read-only.
Definition: va.h:855
uint32_t bit_offset
Bit offset into the data buffer where the video data starts.
Definition: va.h:3889
Definition: va.h:3285
Processing rate reporting attribute. Read-only.
Definition: va.h:829
Quantization settings for encoding.
Definition: va.h:2760
Definition: va.h:1626
uint32_t size
Size of the data buffer in this segment (in bytes).
Definition: va.h:3887
Huffman table for JPEG decoding.
Definition: va.h:3050
Packed picture header.
Definition: va.h:2366
uint32_t number_of_layers
The number of temporal layers.
Definition: va.h:2426
Encryption parameters buffer for VAEncryptionParameterBufferType.
Definition: va.h:2214
uint32_t blocks_stripe_encrypted
Indicates the number of 16-byte BLOCKS that are encrypted in any given encrypted region of segments...
Definition: va.h:2248
Maximum number of tile rows. Read-only.
Definition: va.h:1045
Cipher algorithm of the protected content session.
Definition: va.h:958
VAGenericID VABufferID
Definition: va.h:2016
VAStatus vaSetDriverName(VADisplay dpy, char *driver_name)
VAStatus vaGetDisplayAttributes(VADisplay dpy, VADisplayAttribute *attr_list, int num_attributes)
Custom Encoder Rounding Offset Control. Application may use this structure to set customized rounding...
Definition: va.h:2983
int32_t pic_order_cnt
picture order count. in HEVC, POCs for top and bottom fields of same picture should take different va...
Definition: va.h:5239
VAStatus vaDestroyImage(VADisplay dpy, VAImageID image)
Buffer type used to express a maximum frame size (in bits).
Definition: va.h:2328
int vaMaxNumSubpictureFormats(VADisplay dpy)
uint8_t level_idc
Profile level.
Definition: va.h:2282
uint32_t bits_per_second
Definition: va.h:2445
HEVC/H.265 encoding features. Read-only.
Definition: va.h:997
Buffer type used for FEI input frame level parameters.
Definition: va.h:2356
VAEntrypointStats.
Definition: va.h:598
VAStatus vaMFReleaseContext(VADisplay dpy, VAMFContextID mf_context, VAContextID context)
Minimal height in pixels (int, read-only).
Definition: va.h:1680
void * buf
Pointer to the start of the data buffer.
Definition: va.h:3895
priority setting for the context. Read-Write attribute value is VAConfigAttribValContextPriority this...
Definition: va.h:940
Encoding intra refresh attribute. Read-only.
Definition: va.h:791
HEVC FEI CTB level cmd buffer it is CTB level information for future usage.
Definition: va.h:2100
Special usage attribute of the protected session.
Definition: va.h:986
Encryption parameters buffer for protected content session.
Definition: va.h:2139
uint32_t type
Buffer type (See VABufferType).
Definition: va.h:3971
VAStatus vaAcquireBufferHandle(VADisplay dpy, VABufferID buf_id, VABufferInfo *buf_info)
Acquires buffer handle for external API usage.
Maximum frame size (in bytes) settings for multiple pass.
Definition: va.h:2716
Protected session execution buffer type.
Definition: va.h:2133
Definition: va.h:2664
VAEntrypointProtectedTEEComm.
Definition: va.h:604
VAStatus vaDestroySubpicture(VADisplay dpy, VASubpictureID subpicture)
Encoding extended rate control attribute. Read-only.
Definition: va.h:818
Maximum picture width. Read-only.
Definition: va.h:752
uintptr_t handle
Buffer handle.
Definition: va.h:3969
VP9 encoding API.
VADisplayAttribBLEMode
Definition: va.h:4984
VAPrivFunc vaGetLibFunc(VADisplay dpy, const char *func)
The FEI encoding common API.
int32_t load_chroma_intra_quantiser_matrix
Same as the MPEG-2 bitstream syntax element.
Definition: va.h:3124
VAMessageCallback vaSetErrorCallback(VADisplay dpy, VAMessageCallback callback, void *user_context)
VAStatus vaDestroyContext(VADisplay dpy, VAContextID context)
VAStatus vaMapBuffer(VADisplay dpy, VABufferID buf_id, void **pbuf)
VP8 encoding API.
VAGenericID VASubpictureID
Definition: va.h:4844
uint8_t num_ref_idx_l0_active_minus1
Definition: va.h:3627
VAStatus vaQueryConfigProfiles(VADisplay dpy, VAProfile *profile_list, int *num_profiles)
VAStatus vaCreateSubpicture(VADisplay dpy, VAImageID image, VASubpictureID *subpicture)
The FEI encoding H264 special API.
VASurfaceAttribType
Surface attribute types.
Definition: va.h:1663
VAGenericValue value
Value. See &quot;Surface attribute types&quot; for the expected types.
Definition: va.h:1722
TEE could be any HW secure device. Read-only.
Definition: va.h:949
Encoding region-of-interest (ROI) attribute. Read-only.
Definition: va.h:810
Maximum number of slices per frame. Read-only.
Definition: va.h:716
VAStatus vaRenderPicture(VADisplay dpy, VAContextID context, VABufferID *buffers, int num_buffers)
Maximum number of reference frames. Read-only.
Definition: va.h:709
Encode function type for FEI.
Definition: va.h:878
Slice Decoding mode. Read/write.
Definition: va.h:635
VAStatus vaBufferSetNumElements(VADisplay dpy, VABufferID buf_id, unsigned int num_elements)
uint32_t reserved
Reserved bytes for future use, must be zero.
Definition: va.h:2723
uint8_t level_idc
Profile level.
Definition: va.h:2265
VAStatus vaInitialize(VADisplay dpy, int *major_version, int *minor_version)
VAStatus vaSyncBuffer(VADisplay dpy, VABufferID buf_id, uint64_t timeout_ns)
Synchronizes pending operations associated with the supplied buffer.
uint32_t mem_type
Buffer memory type (See VASurfaceAttribMemoryType).
Definition: va.h:3980
VAStatus vaGetImage(VADisplay dpy, VASurfaceID surface, int x, int y, unsigned int width, unsigned int height, VAImageID image)
Profile ID used for video processing.
Definition: va.h:503
VAGenericFunc fn
Pointer to function.
Definition: va.h:1648
uint32_t num_layers
Definition: va.h:2899
uint32_t target_frame_size
Definition: va.h:2549
Video filter parameter buffer.
Definition: va.h:2073
Maximal width in pixels (int, read-only).
Definition: va.h:1678
VAGenericValueType
Generic value types.
Definition: va.h:1625
uint8_t num_ref_idx_l1_active_minus1
Definition: va.h:3634
Encoding delta QP per block buffer.
Definition: va.h:2150
frame size tolerance support it indicates the tolerance of frame size
Definition: va.h:869
Buffer type used for dirty region-of-interest (ROI) parameters.
Definition: va.h:2346
VASurfaceID picture_id
reconstructed picture buffer surface index invalid when taking value VA_INVALID_SURFACE.
Definition: va.h:5234
List of possible DRM format modifiers (pointer, write).
Definition: va.h:1701
VAStatus vaDestroyConfig(VADisplay dpy, VAConfigID config_id)
VAStatus vaSetDisplayAttributes(VADisplay dpy, VADisplayAttribute *attr_list, int num_attributes)
VAStatus vaCreateSurfaces(VADisplay dpy, unsigned int format, unsigned int width, unsigned int height, VASurfaceID *surfaces, unsigned int num_surfaces, VASurfaceAttrib *attrib_list, unsigned int num_attribs)
Creates an array of surfaces.
Packed sequence header.
Definition: va.h:2364
Attribute value for VAConfigAttribEncROI.
Definition: va.h:1334
uint32_t * num_b_in_gop
Definition: va.h:2904
uint32_t width
width in pixels.
Definition: va.h:1762
VAEntrypointProtectedContent.
Definition: va.h:610
Encoding quality level.
Definition: va.h:2744
uint32_t initial_qp
Definition: va.h:2462
update the context parameter this structure is used to update context parameters, such as priority of...
Definition: va.h:2160
The H.264 encoding API.
Definition: va.h:3537
Macroblock information. Read-only.
Definition: va.h:745
int vaMaxNumProfiles(VADisplay dpy)
VASurfaceAttribType type
Type.
Definition: va.h:1718
VAStatus vaCreateBuffer(VADisplay dpy, VAContextID context, VABufferType type, unsigned int size, unsigned int num_elements, void *data, VABufferID *buf_id)
Buffer type used for encoder rounding offset parameters.
Definition: va.h:2354
Surface usage hint, gives the driver a hint of intended usage to optimize allocation (e...
Definition: va.h:1694
uint32_t pixel_format
pixel format in fourcc.
Definition: va.h:1760
Definition: va.h:3219
VAStatus vaReleaseBufferHandle(VADisplay dpy, VABufferID buf_id)
Releases buffer after usage from external API.
Maximum number of FEI MV predictors. Read-only.
Definition: va.h:886
Definition: va.h:2560
uint32_t bit_length
Size of the #VAEncPackedHeaderDataBuffer in bits.
Definition: va.h:2393
VAEncryptionSegmentInfo * segment_info
Pointer of segments.
Definition: va.h:2222
void * next
Pointer to the next VACodedBufferSegment element, or NULL if there is none.
Definition: va.h:3900
int32_t load_non_intra_quant_mat
Definition: va.h:3274
void * VANativeDisplay
Definition: va.h:450
uint8_t skip_frame_flag
Indicates skip frames as below. 0: Encode as normal, no skip. 1: One or more frames were skipped prio...
Definition: va.h:2795
Interlaced mode. Read/write.
Definition: va.h:698
VAEntrypointFEI.
Definition: va.h:581
VAStatus vaAssociateSubpicture(VADisplay dpy, VASubpictureID subpicture, VASurfaceID *target_surfaces, int num_surfaces, int16_t src_x, int16_t src_y, uint16_t src_width, uint16_t src_height, int16_t dest_x, int16_t dest_y, uint16_t dest_width, uint16_t dest_height, uint32_t flags)
int8_t roi_value
ROI value.
Definition: va.h:2838
Dynamic Scaling Attribute. Read-only.
Definition: va.h:864
Buffer type used to express a maximum frame size (in bytes) settings for multiple pass...
Definition: va.h:2342
uint32_t ip_period
Period between I/P frames.
Definition: va.h:2274
AV1 encoding attribute. Read-only.
Definition: va.h:1015
#define VA_PADDING_LOW
Definition: va.h:359
void(* VAMessageCallback)(void *user_context, const char *message)
Definition: va.h:429
uint32_t max_frame_size
Maximum size of a frame (in bits).
Definition: va.h:2701
Settings per block attribute for Encoding. Read-only.
Definition: va.h:1038
structure for encrypted segment info.
Definition: va.h:2194
Definition: va.h:1627
int32_t load_intra_quantiser_matrix
Same as the MPEG-2 bitstream syntax element.
Definition: va.h:3120
uint32_t init_byte_length
The length in bytes of the initial clear data.
Definition: va.h:2204
Packed raw header.
Definition: va.h:2377
Definition: va.h:4276
float f
32-bit float.
Definition: va.h:1644
VAStatus vaCreateMFContext(VADisplay dpy, VAMFContextID *mf_context)
Pixel format as a FOURCC (int, read/write).
Definition: va.h:1674
VAStatus vaDestroyBuffer(VADisplay dpy, VABufferID buffer_id)
uint32_t quality_factor
Definition: va.h:2540
unsigned int VAGenericID
Definition: va.h:1554
VAEncPackedHeaderType
Packed header type.
Definition: va.h:2362
VAConfigAttribType
Definition: va.h:614
Definition: va.h:3323
uint32_t size_skip_frames
When skip_frame_flag = 1, the size of the skipped frames in bits. When skip_frame_flag = 2...
Definition: va.h:2800
width and height log2 aligment in pixels (int, read-only)
Definition: va.h:1710
uintptr_t * buffers
buffer handles or user pointers
Definition: va.h:1774
adjust context parameters dynamically
Definition: va.h:2126
void * VADisplay
Definition: va.h:259
int32_t load_chroma_non_intra_quantiser_matrix
Same as the MPEG-2 bitstream syntax element.
Definition: va.h:3126
VAStatus vaQueryDisplayAttributes(VADisplay dpy, VADisplayAttribute *attr_list, int *num_attributes)
VAGenericValueType type
Value type. See VAGenericValueType.
Definition: va.h:1638
Definition: va.h:1629
The AV1 decoding API.
Decode processing support. Read/write.
Definition: va.h:676
VAStatus vaQueryConfigEntrypoints(VADisplay dpy, VAProfile profile, VAEntrypoint *entrypoint_list, int *num_entrypoints)
uint32_t partial_aes_block_size
The length in bytes of the remainder of an incomplete block from a previous segment.
Definition: va.h:2202
Statistics output for VAEntrypointStats progressive and top field of interlaced case.
Definition: va.h:2084
uint32_t key_blob_size
key blob size It could be VA_PC_BLOCK_SIZE_128, VA_PC_BLOCK_SIZE_192, or VA_PC_BLOCK_SIZE_256 ...
Definition: va.h:2239
Definition: va.h:2418
int vaMaxNumConfigAttributes(VADisplay dpy)
Buffer type used for region-of-interest (ROI) parameters.
Definition: va.h:2340
Attribute value for VAConfigAttribEncJPEG.
Definition: va.h:1271
uint32_t flags
flags. See &quot;Surface external buffer descriptor flags&quot;.
Definition: va.h:1778
VAStatus vaDeriveImage(VADisplay dpy, VASurfaceID surface, VAImage *image)
Definition: va.h:3118
uint8_t num_skip_frames
The number of frames skipped prior to the current frame. Valid when skip_frame_flag = 1...
Definition: va.h:2797
JPEG decoding attribute. Read-only.
Definition: va.h:643
Generic value.
Definition: va.h:1636
VAStatus vaDeassociateSubpicture(VADisplay dpy, VASubpictureID subpicture, VASurfaceID *target_surfaces, int num_surfaces)
encode extension buffer, ect. MPEG2 Sequence extenstion data
Definition: va.h:2358
sub device info Sub-device is the concept basing on the &quot;device&quot; behind &quot;vaDisplay&quot;. If a device could be divided to several sub devices, the task of decode/encode/vpp could be assigned on one sub-device. So, application could choose the sub device before any other operations. After that, all of the task execution/resource allocation will be dispatched to the sub device. If application does not choose the sub device, driver will assign one as default.
Definition: va.h:5044
Buffer type used for sending skip frame parameters to the encoder&#39;s rate control, when the user has e...
Definition: va.h:2338
uint32_t intra_period
Period between I frames.
Definition: va.h:2272
VAStatus vaQueryProcessingRate(VADisplay dpy, VAConfigID config, VAProcessingRateParameter *proc_buf, unsigned int *processing_rate)
Queries processing rate for the supplied config.
VAStatus vaQuerySubpictureFormats(VADisplay dpy, VAImageFormat *format_list, unsigned int *flags, unsigned int *num_formats)
uint32_t quality_level
Encoding quality level setting. When set to 0, default quality level is used.
Definition: va.h:2748
Minimal width in pixels (int, read-only).
Definition: va.h:1676
Definition: va.h:1063
Encoding QP info block size attribute. Read-only. This attribute conveys the block sizes that underly...
Definition: va.h:914
Definition: va.h:3591
Encoding dirty rectangle. Read-only.
Definition: va.h:843
Surface memory type expressed in bit fields (int, read/write).
Definition: va.h:1684
whether accept rouding setting from application. Read-only. This attribute is for encode quality...
Definition: va.h:908
int vaMaxNumDisplayAttributes(VADisplay dpy)
uint32_t flags
Flags. See &quot;Surface attribute flags&quot;.
Definition: va.h:1720
Coded buffer segment.
Definition: va.h:3883
void * p
Generic pointer.
Definition: va.h:1646
Statistics output for VAEntrypointStats bottom field of interlaced case.
Definition: va.h:2086
uint32_t min_qp
Definition: va.h:2468
External buffer descriptor (pointer, write).
Definition: va.h:1691
VAConfigAttribValContextPriority context_priority
task/context priority
Definition: va.h:2171
Description of picture properties of those in DPB surfaces.
Definition: va.h:5230
int32_t load_non_intra_quantiser_matrix
Same as the MPEG-2 bitstream syntax element.
Definition: va.h:3122
Maximal height in pixels (int, read-only).
Definition: va.h:1682
uint32_t blocks_stripe_clear
Indicates the number of 16-byte BLOCKS that are clear in any given encrypted region of segments...
Definition: va.h:2255
TEE type client is a specific module supporting specific functions in TEE. Read-only.
Definition: va.h:951
VAStatus vaMFAddContext(VADisplay dpy, VAMFContextID mf_context, VAContextID context)
Encoding quantization attribute. Read-only.
Definition: va.h:783
Definition: va.h:2263
FEI specific buffer types.
Definition: va.h:2077
uint32_t slice_data_offset
Byte offset to the NAL Header Unit for this slice.
Definition: va.h:3605
Attribute value for VAConfigAttribMultipleFrame.
Definition: va.h:1409
AV1 encoding attribute extend1. Read-only.
Definition: va.h:1023
uint32_t encryption_type
Encryption type, refer to VA_ENCRYPTION_TYPE_FULLSAMPLE_CTR, VA_ENCRYPTION_TYPE_FULLSAMPLE_CBC, VA_ENCRYPTION_TYPE_SUBSAMPLE_CTR, or VA_ENCRYPTION_TYPE_SUBSAMPLE_CBC.
Definition: va.h:2218
Encoding QP buffer.
Definition: va.h:2052
uint32_t ICQ_quality_factor
Definition: va.h:2529
VAStatus vaQuerySurfaceStatus(VADisplay dpy, VASurfaceID render_target, VASurfaceStatus *status)
Encoding region-of-interest (ROI).
Definition: va.h:2815
Profile ID used for protected video playback.
Definition: va.h:540
Packed slice header.
Definition: va.h:2368
uint32_t segment_length
The length of the segments in bytes.
Definition: va.h:2199
uint32_t segment_start_offset
The offset relative to the start of the bitstream input in bytes of the start of the segment...
Definition: va.h:2197
VAStatus vaUnmapBuffer(VADisplay dpy, VABufferID buf_id)
Packed header parameter.
Definition: va.h:2389
VASurfaceAttribExternalBuffers structure for the VASurfaceAttribExternalBufferDescriptor attribute...
Definition: va.h:1758
Attribute value for VAConfigAttribMaxFrameSize.
Definition: va.h:1254
VARectangle roi_rectangle
Defines the ROI boundary in pixels, the driver will map it to appropriate codec coding units...
Definition: va.h:2819
VADisplayAttribType
Definition: va.h:5073
Definition: va.h:3270
Cipher mode of the protected content session.
Definition: va.h:972
Maximum number of tile cols. Read-only.
Definition: va.h:1052
uint32_t num_segments
The number of sengments.
Definition: va.h:2220