VA-API  2.19.0
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 
1040  VAConfigAttribTypeMax
1042 
1049 typedef struct _VAConfigAttrib {
1050  VAConfigAttribType type;
1051  uint32_t value; /* OR'd flags (bits) for this attribute */
1052 } VAConfigAttrib;
1053 
1054 /* Attribute values for VAConfigAttribRTFormat. */
1055 
1056 #define VA_RT_FORMAT_YUV420 0x00000001
1057 #define VA_RT_FORMAT_YUV422 0x00000002
1058 #define VA_RT_FORMAT_YUV444 0x00000004
1059 #define VA_RT_FORMAT_YUV411 0x00000008
1060 #define VA_RT_FORMAT_YUV400 0x00000010
1061 #define VA_RT_FORMAT_YUV420_10 0x00000100
1062 #define VA_RT_FORMAT_YUV422_10 0x00000200
1063 #define VA_RT_FORMAT_YUV444_10 0x00000400
1064 #define VA_RT_FORMAT_YUV420_12 0x00001000
1065 #define VA_RT_FORMAT_YUV422_12 0x00002000
1066 #define VA_RT_FORMAT_YUV444_12 0x00004000
1067 
1068 #define VA_RT_FORMAT_RGB16 0x00010000
1069 #define VA_RT_FORMAT_RGB32 0x00020000
1070 #define VA_RT_FORMAT_RGBP 0x00100000
1071 #define VA_RT_FORMAT_RGB32_10 0x00200000
1072 
1073 #define VA_RT_FORMAT_PROTECTED 0x80000000
1074 
1075 #define VA_RT_FORMAT_RGB32_10BPP VA_RT_FORMAT_RGB32_10
1076 #define VA_RT_FORMAT_YUV420_10BPP VA_RT_FORMAT_YUV420_10
1077 
1078 
1081 #define VA_RC_NONE 0x00000001
1082 
1083 #define VA_RC_CBR 0x00000002
1084 
1085 #define VA_RC_VBR 0x00000004
1086 
1087 #define VA_RC_VCM 0x00000008
1088 
1089 #define VA_RC_CQP 0x00000010
1090 
1091 #define VA_RC_VBR_CONSTRAINED 0x00000020
1092 
1094 #define VA_RC_ICQ 0x00000040
1095 
1097 #define VA_RC_MB 0x00000080
1098 
1099 #define VA_RC_CFS 0x00000100
1100 
1110 #define VA_RC_PARALLEL 0x00000200
1111 
1117 #define VA_RC_QVBR 0x00000400
1118 
1128 #define VA_RC_AVBR 0x00000800
1129 
1137 #define VA_RC_TCBRC 0x00001000
1138 
1144 #define VA_DEC_SLICE_MODE_NORMAL 0x00000001
1145 
1146 #define VA_DEC_SLICE_MODE_BASE 0x00000002
1147 
1150 typedef union _VAConfigAttribValDecJPEG {
1151  struct {
1153  uint32_t rotation : 4;
1155  uint32_t reserved : 28;
1156  } bits;
1157  uint32_t value;
1158 } VAConfigAttribValDecJPEG;
1162 #define VA_DEC_PROCESSING_NONE 0x00000000
1163 
1164 #define VA_DEC_PROCESSING 0x00000001
1165 
1170 #define VA_ENC_PACKED_HEADER_NONE 0x00000000
1171 
1177 #define VA_ENC_PACKED_HEADER_SEQUENCE 0x00000001
1178 
1184 #define VA_ENC_PACKED_HEADER_PICTURE 0x00000002
1185 
1191 #define VA_ENC_PACKED_HEADER_SLICE 0x00000004
1192 
1200 #define VA_ENC_PACKED_HEADER_MISC 0x00000008
1201 
1202 #define VA_ENC_PACKED_HEADER_RAW_DATA 0x00000010
1203 
1208 #define VA_ENC_INTERLACED_NONE 0x00000000
1209 
1210 #define VA_ENC_INTERLACED_FRAME 0x00000001
1211 
1212 #define VA_ENC_INTERLACED_FIELD 0x00000002
1213 
1214 #define VA_ENC_INTERLACED_MBAFF 0x00000004
1215 
1216 #define VA_ENC_INTERLACED_PAFF 0x00000008
1217 
1222 #define VA_ENC_SLICE_STRUCTURE_POWER_OF_TWO_ROWS 0x00000001
1223 
1224 #define VA_ENC_SLICE_STRUCTURE_ARBITRARY_MACROBLOCKS 0x00000002
1225 
1226 #define VA_ENC_SLICE_STRUCTURE_EQUAL_ROWS 0x00000004
1227 
1228 #define VA_ENC_SLICE_STRUCTURE_MAX_SLICE_SIZE 0x00000008
1229 
1230 #define VA_ENC_SLICE_STRUCTURE_ARBITRARY_ROWS 0x00000010
1231 
1234 #define VA_ENC_SLICE_STRUCTURE_EQUAL_MULTI_ROWS 0x00000020
1235 
1238 typedef union _VAConfigAttribValMaxFrameSize {
1239  struct {
1245  uint32_t max_frame_size : 1;
1247  uint32_t multiple_pass : 1;
1249  uint32_t reserved : 30;
1250  } bits;
1251  uint32_t value;
1253 
1255 typedef union _VAConfigAttribValEncJPEG {
1256  struct {
1260  uint32_t progressive_dct_mode : 1;
1262  uint32_t non_interleaved_mode : 1;
1264  uint32_t differential_mode : 1;
1265  uint32_t max_num_components : 3;
1266  uint32_t max_num_scans : 4;
1267  uint32_t max_num_huffman_tables : 3;
1268  uint32_t max_num_quantization_tables : 3;
1269  } bits;
1270  uint32_t value;
1272 
1276 #define VA_ENC_QUANTIZATION_NONE 0x00000000
1277 
1278 #define VA_ENC_QUANTIZATION_TRELLIS_SUPPORTED 0x00000001
1279 
1289 #define VA_PREDICTION_DIRECTION_PREVIOUS 0x00000001
1290 
1291 #define VA_PREDICTION_DIRECTION_FUTURE 0x00000002
1292 
1293 #define VA_PREDICTION_DIRECTION_BI_NOT_EMPTY 0x00000004
1294 
1299 #define VA_ENC_INTRA_REFRESH_NONE 0x00000000
1300 
1301 #define VA_ENC_INTRA_REFRESH_ROLLING_COLUMN 0x00000001
1302 
1303 #define VA_ENC_INTRA_REFRESH_ROLLING_ROW 0x00000002
1304 
1305 #define VA_ENC_INTRA_REFRESH_ADAPTIVE 0x00000010
1306 
1307 #define VA_ENC_INTRA_REFRESH_CYCLIC 0x00000020
1308 
1309 #define VA_ENC_INTRA_REFRESH_P_FRAME 0x00010000
1310 
1311 #define VA_ENC_INTRA_REFRESH_B_FRAME 0x00020000
1312 
1313 #define VA_ENC_INTRA_REFRESH_MULTI_REF 0x00040000
1314 
1318 typedef union _VAConfigAttribValEncROI {
1319  struct {
1321  uint32_t num_roi_regions : 8;
1346  uint32_t reserved : 22;
1347  } bits;
1348  uint32_t value;
1350 
1352 typedef union _VAConfigAttribValEncRateControlExt {
1353  struct {
1362 
1387  uint32_t reserved : 23;
1388  } bits;
1389  uint32_t value;
1391 
1393 typedef union _VAConfigAttribValMultipleFrame {
1394  struct {
1400  uint32_t mixed_quality_level : 1;
1402  uint32_t reserved : 23;
1403  } bits;
1404  uint32_t value;
1406 
1408 typedef union _VAConfigAttribValContextPriority {
1409  struct {
1412  uint32_t priority : 16;
1414  uint32_t reserved : 16;
1415  } bits;
1416  uint32_t value;
1418 
1420 typedef union _VAConfigAttribValEncPerBlockControl {
1421  struct {
1423  uint32_t delta_qp_support : 1;
1429  uint32_t reserved : 24;
1430  } bits;
1431  uint32_t value;
1433 
1436 #define VA_PC_CIPHER_AES 0x00000001
1437 
1440 #define VA_PC_BLOCK_SIZE_128 0x00000001
1441 
1442 #define VA_PC_BLOCK_SIZE_192 0x00000002
1443 
1444 #define VA_PC_BLOCK_SIZE_256 0x00000004
1445 
1448 #define VA_PC_CIPHER_MODE_ECB 0x00000001
1449 
1450 #define VA_PC_CIPHER_MODE_CBC 0x00000002
1451 
1452 #define VA_PC_CIPHER_MODE_CTR 0x00000004
1453 
1456 #define VA_PC_SAMPLE_TYPE_FULLSAMPLE 0x00000001
1457 
1458 #define VA_PC_SAMPLE_TYPE_SUBSAMPLE 0x00000002
1459 
1462 #define VA_PC_USAGE_DEFAULT 0x00000000
1463 
1464 #define VA_PC_USAGE_WIDEVINE 0x00000001
1465 
1469 #define VA_PROCESSING_RATE_NONE 0x00000000
1470 
1471 #define VA_PROCESSING_RATE_ENCODE 0x00000001
1472 
1473 #define VA_PROCESSING_RATE_DECODE 0x00000002
1474 
1479 #define VA_ATTRIB_NOT_SUPPORTED 0x80000000
1480 
1482 int vaMaxNumProfiles(
1483  VADisplay dpy
1484 );
1485 
1488  VADisplay dpy
1489 );
1490 
1493  VADisplay dpy
1494 );
1495 
1502 VAStatus vaQueryConfigProfiles(
1503  VADisplay dpy,
1504  VAProfile *profile_list, /* out */
1505  int *num_profiles /* out */
1506 );
1507 
1514 VAStatus vaQueryConfigEntrypoints(
1515  VADisplay dpy,
1516  VAProfile profile,
1517  VAEntrypoint *entrypoint_list, /* out */
1518  int *num_entrypoints /* out */
1519 );
1520 
1529 VAStatus vaGetConfigAttributes(
1530  VADisplay dpy,
1531  VAProfile profile,
1532  VAEntrypoint entrypoint,
1533  VAConfigAttrib *attrib_list, /* in/out */
1534  int num_attribs
1535 );
1536 
1538 typedef unsigned int VAGenericID;
1539 
1540 typedef VAGenericID VAConfigID;
1541 
1547 VAStatus vaCreateConfig(
1548  VADisplay dpy,
1549  VAProfile profile,
1550  VAEntrypoint entrypoint,
1551  VAConfigAttrib *attrib_list,
1552  int num_attribs,
1553  VAConfigID *config_id /* out */
1554 );
1555 
1559 VAStatus vaDestroyConfig(
1560  VADisplay dpy,
1561  VAConfigID config_id
1562 );
1563 
1572 VAStatus vaQueryConfigAttributes(
1573  VADisplay dpy,
1574  VAConfigID config_id,
1575  VAProfile *profile, /* out */
1576  VAEntrypoint *entrypoint, /* out */
1577  VAConfigAttrib *attrib_list,/* out */
1578  int *num_attribs /* out */
1579 );
1580 
1581 
1602 
1603 typedef VAGenericID VASurfaceID;
1604 
1605 #define VA_INVALID_ID 0xffffffff
1606 #define VA_INVALID_SURFACE VA_INVALID_ID
1607 
1609 typedef enum {
1615 
1617 typedef void (*VAGenericFunc)(void);
1618 
1620 typedef struct _VAGenericValue {
1624  union {
1626  int32_t i;
1628  float f;
1630  void *p;
1633  } value;
1634 } VAGenericValue;
1635 
1639 #define VA_SURFACE_ATTRIB_NOT_SUPPORTED 0x00000000
1640 
1641 #define VA_SURFACE_ATTRIB_GETTABLE 0x00000001
1642 
1643 #define VA_SURFACE_ATTRIB_SETTABLE 0x00000002
1644 
1647 typedef enum {
1648  VASurfaceAttribNone = 0,
1689 
1691 typedef struct _VASurfaceAttrib {
1695  uint32_t flags;
1698 } VASurfaceAttrib;
1699 
1708 #define VA_SURFACE_ATTRIB_MEM_TYPE_VA 0x00000001
1709 
1710 #define VA_SURFACE_ATTRIB_MEM_TYPE_V4L2 0x00000002
1711 
1712 #define VA_SURFACE_ATTRIB_MEM_TYPE_USER_PTR 0x00000004
1713 
1719 typedef struct _VASurfaceAttribExternalBuffers {
1721  uint32_t pixel_format;
1723  uint32_t width;
1725  uint32_t height;
1727  uint32_t data_size;
1729  uint32_t num_planes;
1731  uint32_t pitches[4];
1733  uint32_t offsets[4];
1735  uintptr_t *buffers;
1737  uint32_t num_buffers;
1739  uint32_t flags;
1743 
1747 #define VA_SURFACE_EXTBUF_DESC_ENABLE_TILING 0x00000001
1748 
1749 #define VA_SURFACE_EXTBUF_DESC_CACHED 0x00000002
1750 
1751 #define VA_SURFACE_EXTBUF_DESC_UNCACHED 0x00000004
1752 
1753 #define VA_SURFACE_EXTBUF_DESC_WC 0x00000008
1754 
1755 #define VA_SURFACE_EXTBUF_DESC_PROTECTED 0x80000000
1756 
1760 #define VA_SURFACE_ATTRIB_USAGE_HINT_GENERIC 0x00000000
1761 
1762 #define VA_SURFACE_ATTRIB_USAGE_HINT_DECODER 0x00000001
1763 
1764 #define VA_SURFACE_ATTRIB_USAGE_HINT_ENCODER 0x00000002
1765 
1766 #define VA_SURFACE_ATTRIB_USAGE_HINT_VPP_READ 0x00000004
1767 
1768 #define VA_SURFACE_ATTRIB_USAGE_HINT_VPP_WRITE 0x00000008
1769 
1770 #define VA_SURFACE_ATTRIB_USAGE_HINT_DISPLAY 0x00000010
1771 
1773 #define VA_SURFACE_ATTRIB_USAGE_HINT_EXPORT 0x00000020
1774 
1804 VAStatus
1806  VADisplay dpy,
1807  VAConfigID config,
1808  VASurfaceAttrib *attrib_list,
1809  unsigned int *num_attribs
1810 );
1811 
1829 VAStatus
1831  VADisplay dpy,
1832  unsigned int format,
1833  unsigned int width,
1834  unsigned int height,
1835  VASurfaceID *surfaces,
1836  unsigned int num_surfaces,
1837  VASurfaceAttrib *attrib_list,
1838  unsigned int num_attribs
1839 );
1840 
1849 VAStatus vaDestroySurfaces(
1850  VADisplay dpy,
1851  VASurfaceID *surfaces,
1852  int num_surfaces
1853 );
1854 
1855 #define VA_PROGRESSIVE 0x1
1856 
1868 VAStatus vaCreateContext(
1869  VADisplay dpy,
1870  VAConfigID config_id,
1871  int picture_width,
1872  int picture_height,
1873  int flag,
1874  VASurfaceID *render_targets,
1875  int num_render_targets,
1876  VAContextID *context /* out */
1877 );
1878 
1884 VAStatus vaDestroyContext(
1885  VADisplay dpy,
1886  VAContextID context
1887 );
1888 
1889 //Multi-frame context
1890 typedef VAGenericID VAMFContextID;
1907 VAStatus vaCreateMFContext(
1908  VADisplay dpy,
1909  VAMFContextID *mf_context /* out */
1910 );
1911 
1945 VAStatus vaMFAddContext(
1946  VADisplay dpy,
1947  VAMFContextID mf_context,
1948  VAContextID context
1949 );
1950 
1963 VAStatus vaMFReleaseContext(
1964  VADisplay dpy,
1965  VAMFContextID mf_context,
1966  VAContextID context
1967 );
1968 
1978 
1979 typedef enum {
1980  VAPictureParameterBufferType = 0,
1981  VAIQMatrixBufferType = 1,
1982  VABitPlaneBufferType = 2,
1983  VASliceGroupMapBufferType = 3,
1984  VASliceParameterBufferType = 4,
1985  VASliceDataBufferType = 5,
1986  VAMacroblockParameterBufferType = 6,
1987  VAResidualDataBufferType = 7,
1988  VADeblockingParameterBufferType = 8,
1989  VAImageBufferType = 9,
1990  VAProtectedSliceDataBufferType = 10,
1991  VAQMatrixBufferType = 11,
1992  VAHuffmanTableBufferType = 12,
1993  VAProbabilityBufferType = 13,
1994 
1995  /* Following are encode buffer types */
1996  VAEncCodedBufferType = 21,
1997  VAEncSequenceParameterBufferType = 22,
1998  VAEncPictureParameterBufferType = 23,
1999  VAEncSliceParameterBufferType = 24,
2000  VAEncPackedHeaderParameterBufferType = 25,
2001  VAEncPackedHeaderDataBufferType = 26,
2002  VAEncMiscParameterBufferType = 27,
2003  VAEncMacroblockParameterBufferType = 28,
2004  VAEncMacroblockMapBufferType = 29,
2005 
2014  /* Following are video processing buffer types */
2039  VAEncFEIMBCodeBufferType = 44,
2040  VAEncFEIDistortionBufferType = 45,
2041  VAEncFEIMBControlBufferType = 46,
2042  VAEncFEIMVPredictorBufferType = 47,
2043  VAStatsStatisticsParameterBufferType = 48,
2048  VAStatsMVBufferType = 51,
2049  VAStatsMVPredictorBufferType = 52,
2070 
2095 
2101 
2112 
2113  VABufferTypeMax
2114 } VABufferType;
2115 
2121 typedef struct _VAContextParameterUpdateBuffer {
2122  union {
2123  struct {
2127  uint32_t reserved : 31;
2128  } bits;
2129  uint32_t value;
2130  } flags;
2134  uint32_t reserved[VA_PADDING_MEDIUM];
2136 
2149 #define VA_ENCRYPTION_TYPE_FULLSAMPLE_CTR 0x00000001 /* AES CTR fullsample */
2150 #define VA_ENCRYPTION_TYPE_FULLSAMPLE_CBC 0x00000002 /* AES CBC fullsample */
2151 #define VA_ENCRYPTION_TYPE_SUBSAMPLE_CTR 0x00000004 /* AES CTR fullsample */
2152 #define VA_ENCRYPTION_TYPE_SUBSAMPLE_CBC 0x00000008 /* AES CBC fullsample */
2153 
2155 typedef struct _VAEncryptionSegmentInfo {
2160  uint32_t segment_length;
2169  uint8_t aes_cbc_iv_or_ctr[64];
2171  uint32_t va_reserved[VA_PADDING_MEDIUM];
2173 
2175 typedef struct _VAEncryptionParameters {
2181  uint32_t num_segments;
2189  uint32_t size_of_length;
2192  uint8_t wrapped_decrypt_blob[64];
2195  uint8_t wrapped_encrypt_blob[64];
2200  uint32_t key_blob_size;
2218  uint32_t va_reserved[VA_PADDING_MEDIUM];
2220 
2224 typedef struct _VAProcessingRateParameterEnc {
2226  uint8_t level_idc;
2227  uint8_t reserved[3];
2231  uint32_t quality_level;
2233  uint32_t intra_period;
2235  uint32_t ip_period;
2237 
2241 typedef struct _VAProcessingRateParameterDec {
2243  uint8_t level_idc;
2244  uint8_t reserved0[3];
2245  uint32_t reserved;
2247 
2248 typedef struct _VAProcessingRateParameter {
2249  union {
2250  VAProcessingRateParameterEnc proc_buf_enc;
2251  VAProcessingRateParameterDec proc_buf_dec;
2252  };
2253 } VAProcessingRateParameter;
2254 
2275 VAStatus
2277  VADisplay dpy,
2278  VAConfigID config,
2279  VAProcessingRateParameter *proc_buf,
2280  unsigned int *processing_rate
2281 );
2282 
2283 typedef enum {
2284  VAEncMiscParameterTypeFrameRate = 0,
2285  VAEncMiscParameterTypeRateControl = 1,
2286  VAEncMiscParameterTypeMaxSliceSize = 2,
2287  VAEncMiscParameterTypeAIR = 3,
2292  VAEncMiscParameterTypeQualityLevel = 6,
2321 
2323 typedef enum {
2346  VAEncPackedHeaderMiscMask va_deprecated_enum = 0x80000000,
2348 
2350 typedef struct _VAEncPackedHeaderParameterBuffer {
2352  uint32_t type;
2354  uint32_t bit_length;
2357 
2359  uint32_t va_reserved[VA_PADDING_LOW];
2361 
2379 typedef struct _VAEncMiscParameterBuffer {
2381  uint32_t data[];
2383 
2385 typedef struct _VAEncMiscParameterTemporalLayerStructure {
2389  uint32_t periodicity;
2396  uint32_t layer_id[32];
2397 
2399  uint32_t va_reserved[VA_PADDING_LOW];
2401 
2402 
2404 typedef struct _VAEncMiscParameterRateControl {
2418  uint32_t window_size;
2423  uint32_t initial_qp;
2429  uint32_t min_qp;
2435  union {
2436  struct {
2442  uint32_t reset : 1;
2444  uint32_t disable_frame_skip : 1;
2446  uint32_t disable_bit_stuffing : 1;
2454  uint32_t mb_rate_control : 4;
2456  uint32_t temporal_id : 8;
2458  uint32_t cfs_I_frames : 1;
2463  uint32_t enable_parallel_brc : 1;
2464  uint32_t enable_dynamic_scaling : 1;
2479  uint32_t frame_tolerance_mode : 2;
2481  uint32_t reserved : 12;
2482  } bits;
2483  uint32_t value;
2484  } rc_flags;
2496  uint32_t max_qp;
2501  uint32_t quality_factor;
2512  uint32_t va_reserved[VA_PADDING_LOW];
2514 
2521 typedef struct _VAEncMiscParameterFrameRate {
2541  uint32_t framerate;
2542  union {
2543  struct {
2545  uint32_t temporal_id : 8;
2547  uint32_t reserved : 24;
2548  } bits;
2549  uint32_t value;
2550  } framerate_flags;
2551 
2553  uint32_t va_reserved[VA_PADDING_LOW];
2555 
2561 typedef struct _VAEncMiscParameterMaxSliceSize {
2562  uint32_t max_slice_size;
2563 
2565  uint32_t va_reserved[VA_PADDING_LOW];
2567 
2568 typedef struct _VAEncMiscParameterAIR {
2569  uint32_t air_num_mbs;
2570  uint32_t air_threshold;
2571  uint32_t air_auto; /* if set to 1 then hardware auto-tune the AIR threshold */
2572 
2574  uint32_t va_reserved[VA_PADDING_LOW];
2575 } VAEncMiscParameterAIR;
2576 
2577 /*
2578  * \brief Rolling intra refresh data structure for encoding.
2579  */
2580 typedef struct _VAEncMiscParameterRIR {
2581  union {
2582  struct
2589  {
2590  /* \brief enable RIR in column */
2591  uint32_t enable_rir_column : 1;
2592  /* \brief enable RIR in row */
2593  uint32_t enable_rir_row : 1;
2594  uint32_t reserved : 30;
2595  } bits;
2596  uint32_t value;
2597  } rir_flags;
2602  uint16_t intra_insertion_location;
2607  uint16_t intra_insert_size;
2612  uint8_t qp_delta_for_inserted_intra;
2614  uint32_t va_reserved[VA_PADDING_LOW];
2615 } VAEncMiscParameterRIR;
2616 
2625 typedef struct _VAEncMiscParameterHRD {
2642  uint32_t buffer_size;
2643 
2645  uint32_t va_reserved[VA_PADDING_LOW];
2647 
2657 typedef struct _VAEncMiscParameterBufferMaxFrameSize {
2660  va_deprecated VAEncMiscParameterType type;
2662  uint32_t max_frame_size;
2663 
2665  uint32_t va_reserved[VA_PADDING_LOW];
2667 
2677 typedef struct _VAEncMiscParameterBufferMultiPassFrameSize {
2680  va_deprecated VAEncMiscParameterType type;
2682  uint32_t max_frame_size;
2684  uint32_t reserved;
2686  uint8_t num_passes;
2688  uint8_t *delta_qp;
2689 
2691  unsigned long va_reserved[VA_PADDING_LOW];
2693 
2705 typedef struct _VAEncMiscParameterBufferQualityLevel {
2709  uint32_t quality_level;
2710 
2712  uint32_t va_reserved[VA_PADDING_LOW];
2714 
2721 typedef struct _VAEncMiscParameterQuantization {
2722  union {
2723  /* if no flags is set then quantization is determined by the driver */
2724  struct {
2725  /* \brief disable trellis for all frames/fields */
2726  uint32_t disable_trellis : 1;
2727  /* \brief enable trellis for I frames/fields */
2728  uint32_t enable_trellis_I : 1;
2729  /* \brief enable trellis for P frames/fields */
2730  uint32_t enable_trellis_P : 1;
2731  /* \brief enable trellis for B frames/fields */
2732  uint32_t enable_trellis_B : 1;
2733  uint32_t reserved : 28;
2734  } bits;
2735  uint32_t value;
2736  } quantization_flags;
2737  uint32_t va_reserved;
2739 
2749 typedef struct _VAEncMiscParameterSkipFrame {
2762 
2764  uint32_t va_reserved[VA_PADDING_LOW];
2766 
2776 typedef struct _VAEncROI {
2799  int8_t roi_value;
2800 } VAEncROI;
2801 
2802 typedef struct _VAEncMiscParameterBufferROI {
2804  uint32_t num_roi;
2805 
2809  int8_t max_delta_qp;
2810  int8_t min_delta_qp;
2811 
2814  VAEncROI *roi;
2815  union {
2816  struct {
2829  uint32_t roi_value_is_qp_delta : 1;
2830  uint32_t reserved : 31;
2831  } bits;
2832  uint32_t value;
2833  } roi_flags;
2834 
2836  uint32_t va_reserved[VA_PADDING_LOW];
2837 } VAEncMiscParameterBufferROI;
2838 /*
2839  * \brief Dirty rectangle data structure for encoding.
2840  *
2841  * The encoding dirty rect can be set through VAEncMiscParameterBufferDirtyRect, if the
2842  * implementation supports dirty rect input. The rect set through this structure is applicable
2843  * only to the current frame or field, so must be sent every frame or field to be applied.
2844  * The number of supported rects can be queried through the VAConfigAttribEncDirtyRect. The
2845  * encoder will use the rect information to know those rectangle areas have changed while the
2846  * areas not covered by dirty rect rectangles are assumed to have not changed compared to the
2847  * previous picture. The encoder may do some internal optimizations.
2848  */
2849 typedef struct _VAEncMiscParameterBufferDirtyRect {
2851  uint32_t num_roi_rectangle;
2852 
2854  VARectangle *roi_rectangle;
2855 } VAEncMiscParameterBufferDirtyRect;
2856 
2858 typedef struct _VAEncMiscParameterParallelRateControl {
2860  uint32_t num_layers;
2865  uint32_t *num_b_in_gop;
2867 
2870 typedef struct _VAEncMiscParameterEncQuality {
2871  union {
2872  struct {
2876  uint32_t useRawPicForRef : 1;
2879  uint32_t skipCheckDisable : 1;
2882  uint32_t FTQOverride : 1;
2884  uint32_t FTQEnable : 1;
2891  uint32_t ReservedBit : 1;
2910  uint32_t HMEDisable : 1;
2912  uint32_t SuperHMEDisable : 1;
2914  uint32_t UltraHMEDisable : 1;
2918  uint32_t PanicModeDisable : 1;
2924 
2925  };
2926  uint32_t encControls;
2927  };
2928 
2930  uint8_t FTQSkipThresholdLUT[52];
2932  uint16_t NonFTQSkipThresholdLUT[52];
2933 
2934  uint32_t reserved[VA_PADDING_HIGH]; // Reserved for future use.
2935 
2937 
2944 typedef struct _VAEncMiscParameterCustomRoundingControl {
2945  union {
2946  struct {
2952 
2957 
2963 
2968 
2969  /* Reserved */
2970  uint32_t reserved : 16;
2971  } bits;
2972  uint32_t value;
2973  } rounding_offset_setting;
2975 
2984 #define VA_SLICE_DATA_FLAG_ALL 0x00 /* whole slice is in the buffer */
2985 #define VA_SLICE_DATA_FLAG_BEGIN 0x01 /* The beginning of the slice is in the buffer but the end if not */
2986 #define VA_SLICE_DATA_FLAG_MIDDLE 0x02 /* Neither beginning nor end of the slice is in the buffer */
2987 #define VA_SLICE_DATA_FLAG_END 0x04 /* end of the slice is in the buffer */
2988 
2989 /* Codec-independent Slice Parameter Buffer base */
2990 typedef struct _VASliceParameterBufferBase {
2991  uint32_t slice_data_size; /* number of bytes in the slice data buffer for this slice */
2992  uint32_t slice_data_offset; /* the offset to the first byte of slice data */
2993  uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX definitions */
2994 } VASliceParameterBufferBase;
2995 
2996 /**********************************
2997  * JPEG common data structures
2998  **********************************/
3011 typedef struct _VAHuffmanTableBufferJPEGBaseline {
3013  uint8_t load_huffman_table[2];
3015  struct {
3019  uint8_t num_dc_codes[16];
3021  uint8_t dc_values[12];
3026  uint8_t num_ac_codes[16];
3028  uint8_t ac_values[162];
3030  uint8_t pad[2];
3032  } huffman_table[2];
3033 
3035  uint32_t va_reserved[VA_PADDING_LOW];
3037 
3038 /****************************
3039  * MPEG-2 data structures
3040  ****************************/
3041 
3042 /* MPEG-2 Picture Parameter Buffer */
3043 /*
3044  * For each frame or field, and before any slice data, a single
3045  * picture parameter buffer must be send.
3046  */
3047 typedef struct _VAPictureParameterBufferMPEG2 {
3048  uint16_t horizontal_size;
3049  uint16_t vertical_size;
3050  VASurfaceID forward_reference_picture;
3051  VASurfaceID backward_reference_picture;
3052  /* meanings of the following fields are the same as in the standard */
3053  int32_t picture_coding_type;
3054  int32_t f_code; /* pack all four fcode into this */
3055  union {
3056  struct {
3057  uint32_t intra_dc_precision : 2;
3058  uint32_t picture_structure : 2;
3059  uint32_t top_field_first : 1;
3060  uint32_t frame_pred_frame_dct : 1;
3061  uint32_t concealment_motion_vectors : 1;
3062  uint32_t q_scale_type : 1;
3063  uint32_t intra_vlc_format : 1;
3064  uint32_t alternate_scan : 1;
3065  uint32_t repeat_first_field : 1;
3066  uint32_t progressive_frame : 1;
3067  uint32_t is_first_field : 1; /* indicate whether the current field
3068  * is the first field for field picture
3069  */
3070  } bits;
3071  uint32_t value;
3072  } picture_coding_extension;
3073 
3075  uint32_t va_reserved[VA_PADDING_LOW];
3076 } VAPictureParameterBufferMPEG2;
3079 typedef struct _VAIQMatrixBufferMPEG2 {
3081  int32_t load_intra_quantiser_matrix;
3083  int32_t load_non_intra_quantiser_matrix;
3085  int32_t load_chroma_intra_quantiser_matrix;
3087  int32_t load_chroma_non_intra_quantiser_matrix;
3089  uint8_t intra_quantiser_matrix[64];
3091  uint8_t non_intra_quantiser_matrix[64];
3093  uint8_t chroma_intra_quantiser_matrix[64];
3095  uint8_t chroma_non_intra_quantiser_matrix[64];
3098  uint32_t va_reserved[VA_PADDING_LOW];
3102 typedef struct _VASliceParameterBufferMPEG2 {
3103  uint32_t slice_data_size;/* number of bytes in the slice data buffer for this slice */
3104  uint32_t slice_data_offset;/* the offset to the first byte of slice data */
3105  uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
3106  uint32_t macroblock_offset;/* the offset to the first bit of MB from the first byte of slice data */
3107  uint32_t slice_horizontal_position;
3108  uint32_t slice_vertical_position;
3109  int32_t quantiser_scale_code;
3110  int32_t intra_slice_flag;
3113  uint32_t va_reserved[VA_PADDING_LOW];
3117 typedef struct _VAMacroblockParameterBufferMPEG2 {
3118  uint16_t macroblock_address;
3119  /*
3120  * macroblock_address (in raster scan order)
3121  * top-left: 0
3122  * bottom-right: picture-height-in-mb*picture-width-in-mb - 1
3123  */
3124  uint8_t macroblock_type; /* see definition below */
3125  union {
3126  struct {
3127  uint32_t frame_motion_type : 2;
3128  uint32_t field_motion_type : 2;
3129  uint32_t dct_type : 1;
3130  } bits;
3131  uint32_t value;
3132  } macroblock_modes;
3133  uint8_t motion_vertical_field_select;
3134  /*
3135  * motion_vertical_field_select:
3136  * see section 6.3.17.2 in the spec
3137  * only the lower 4 bits are used
3138  * bit 0: first vector forward
3139  * bit 1: first vector backward
3140  * bit 2: second vector forward
3141  * bit 3: second vector backward
3142  */
3143  int16_t PMV[2][2][2]; /* see Table 7-7 in the spec */
3144  uint16_t coded_block_pattern;
3145  /*
3146  * The bitplanes for coded_block_pattern are described
3147  * in Figure 6.10-12 in the spec
3148  */
3149 
3150  /* Number of skipped macroblocks after this macroblock */
3151  uint16_t num_skipped_macroblocks;
3154  uint32_t va_reserved[VA_PADDING_LOW];
3156 
3157 /*
3158  * OR'd flags for macroblock_type (section 6.3.17.1 in the spec)
3159  */
3160 #define VA_MB_TYPE_MOTION_FORWARD 0x02
3161 #define VA_MB_TYPE_MOTION_BACKWARD 0x04
3162 #define VA_MB_TYPE_MOTION_PATTERN 0x08
3163 #define VA_MB_TYPE_MOTION_INTRA 0x10
3164 
3171 /****************************
3172  * MPEG-4 Part 2 data structures
3173  ****************************/
3174 
3175 /* MPEG-4 Picture Parameter Buffer */
3176 /*
3177  * For each frame or field, and before any slice data, a single
3178  * picture parameter buffer must be send.
3179  */
3180 typedef struct _VAPictureParameterBufferMPEG4 {
3181  uint16_t vop_width;
3182  uint16_t vop_height;
3183  VASurfaceID forward_reference_picture;
3184  VASurfaceID backward_reference_picture;
3185  union {
3186  struct {
3187  uint32_t short_video_header : 1;
3188  uint32_t chroma_format : 2;
3189  uint32_t interlaced : 1;
3190  uint32_t obmc_disable : 1;
3191  uint32_t sprite_enable : 2;
3192  uint32_t sprite_warping_accuracy : 2;
3193  uint32_t quant_type : 1;
3194  uint32_t quarter_sample : 1;
3195  uint32_t data_partitioned : 1;
3196  uint32_t reversible_vlc : 1;
3197  uint32_t resync_marker_disable : 1;
3198  } bits;
3199  uint32_t value;
3200  } vol_fields;
3201  uint8_t no_of_sprite_warping_points;
3202  int16_t sprite_trajectory_du[3];
3203  int16_t sprite_trajectory_dv[3];
3204  uint8_t quant_precision;
3205  union {
3206  struct {
3207  uint32_t vop_coding_type : 2;
3208  uint32_t backward_reference_vop_coding_type : 2;
3209  uint32_t vop_rounding_type : 1;
3210  uint32_t intra_dc_vlc_thr : 3;
3211  uint32_t top_field_first : 1;
3212  uint32_t alternate_vertical_scan_flag : 1;
3213  } bits;
3214  uint32_t value;
3215  } vop_fields;
3216  uint8_t vop_fcode_forward;
3217  uint8_t vop_fcode_backward;
3218  uint16_t vop_time_increment_resolution;
3219  /* short header related */
3220  uint8_t num_gobs_in_vop;
3221  uint8_t num_macroblocks_in_gob;
3222  /* for direct mode prediction */
3223  int16_t TRB;
3224  int16_t TRD;
3227  uint32_t va_reserved[VA_PADDING_LOW];
3229 
3231 typedef struct _VAIQMatrixBufferMPEG4 {
3233  int32_t load_intra_quant_mat;
3235  int32_t load_non_intra_quant_mat;
3237  uint8_t intra_quant_mat[64];
3239  uint8_t non_intra_quant_mat[64];
3240 
3242  uint32_t va_reserved[VA_PADDING_LOW];
3244 
3246 typedef struct _VASliceParameterBufferMPEG4 {
3247  uint32_t slice_data_size;/* number of bytes in the slice data buffer for this slice */
3248  uint32_t slice_data_offset;/* the offset to the first byte of slice data */
3249  uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
3250  uint32_t macroblock_offset;/* the offset to the first bit of MB from the first byte of slice data */
3251  uint32_t macroblock_number;
3252  int32_t quant_scale;
3253 
3255  uint32_t va_reserved[VA_PADDING_LOW];
3257 
3262 typedef enum /* see 7.1.1.32 */
3263 {
3264  VAMvMode1Mv = 0,
3265  VAMvMode1MvHalfPel = 1,
3266  VAMvMode1MvHalfPelBilinear = 2,
3267  VAMvModeMixedMv = 3,
3268  VAMvModeIntensityCompensation = 4
3269 } VAMvModeVC1;
3270 
3272 /*
3273  * For each picture, and before any slice data, a picture parameter
3274  * buffer must be send. Multiple picture parameter buffers may be
3275  * sent for a single picture. In that case picture parameters will
3276  * apply to all slice data that follow it until a new picture
3277  * parameter buffer is sent.
3278  *
3279  * Notes:
3280  * pic_quantizer_type should be set to the applicable quantizer
3281  * type as defined by QUANTIZER (J.1.19) and either
3282  * PQUANTIZER (7.1.1.8) or PQINDEX (7.1.1.6)
3283  */
3284 typedef struct _VAPictureParameterBufferVC1 {
3285  VASurfaceID forward_reference_picture;
3286  VASurfaceID backward_reference_picture;
3287  /* if out-of-loop post-processing is done on the render
3288  target, then we need to keep the in-loop decoded
3289  picture as a reference picture */
3290  VASurfaceID inloop_decoded_picture;
3291 
3292  /* sequence layer for AP or meta data for SP and MP */
3293  union {
3294  struct {
3295  uint32_t pulldown : 1; /* SEQUENCE_LAYER::PULLDOWN */
3296  uint32_t interlace : 1; /* SEQUENCE_LAYER::INTERLACE */
3297  uint32_t tfcntrflag : 1; /* SEQUENCE_LAYER::TFCNTRFLAG */
3298  uint32_t finterpflag : 1; /* SEQUENCE_LAYER::FINTERPFLAG */
3299  uint32_t psf : 1; /* SEQUENCE_LAYER::PSF */
3300  uint32_t multires : 1; /* METADATA::MULTIRES */
3301  uint32_t overlap : 1; /* METADATA::OVERLAP */
3302  uint32_t syncmarker : 1; /* METADATA::SYNCMARKER */
3303  uint32_t rangered : 1; /* METADATA::RANGERED */
3304  uint32_t max_b_frames : 3; /* METADATA::MAXBFRAMES */
3305  uint32_t profile : 2; /* SEQUENCE_LAYER::PROFILE or The MSB of METADATA::PROFILE */
3306  } bits;
3307  uint32_t value;
3308  } sequence_fields;
3309 
3310  uint16_t coded_width; /* ENTRY_POINT_LAYER::CODED_WIDTH */
3311  uint16_t coded_height; /* ENTRY_POINT_LAYER::CODED_HEIGHT */
3312  union {
3313  struct {
3314  uint32_t broken_link : 1; /* ENTRY_POINT_LAYER::BROKEN_LINK */
3315  uint32_t closed_entry : 1; /* ENTRY_POINT_LAYER::CLOSED_ENTRY */
3316  uint32_t panscan_flag : 1; /* ENTRY_POINT_LAYER::PANSCAN_FLAG */
3317  uint32_t loopfilter : 1; /* ENTRY_POINT_LAYER::LOOPFILTER */
3318  } bits;
3319  uint32_t value;
3320  } entrypoint_fields;
3321  uint8_t conditional_overlap_flag; /* ENTRY_POINT_LAYER::CONDOVER */
3322  uint8_t fast_uvmc_flag; /* ENTRY_POINT_LAYER::FASTUVMC */
3323  union {
3324  struct {
3325  uint32_t luma_flag : 1; /* ENTRY_POINT_LAYER::RANGE_MAPY_FLAG */
3326  uint32_t luma : 3; /* ENTRY_POINT_LAYER::RANGE_MAPY */
3327  uint32_t chroma_flag : 1; /* ENTRY_POINT_LAYER::RANGE_MAPUV_FLAG */
3328  uint32_t chroma : 3; /* ENTRY_POINT_LAYER::RANGE_MAPUV */
3329  } bits;
3330  uint32_t value;
3331  } range_mapping_fields;
3332 
3333  uint8_t b_picture_fraction; /* Index for PICTURE_LAYER::BFRACTION value in Table 40 (7.1.1.14) */
3334  uint8_t cbp_table; /* PICTURE_LAYER::CBPTAB/ICBPTAB */
3335  uint8_t mb_mode_table; /* PICTURE_LAYER::MBMODETAB */
3336  uint8_t range_reduction_frame;/* PICTURE_LAYER::RANGEREDFRM */
3337  uint8_t rounding_control; /* PICTURE_LAYER::RNDCTRL */
3338  uint8_t post_processing; /* PICTURE_LAYER::POSTPROC */
3339  uint8_t picture_resolution_index; /* PICTURE_LAYER::RESPIC */
3340  uint8_t luma_scale; /* PICTURE_LAYER::LUMSCALE */
3341  uint8_t luma_shift; /* PICTURE_LAYER::LUMSHIFT */
3342 
3343  union {
3344  struct {
3345  uint32_t picture_type : 3; /* PICTURE_LAYER::PTYPE */
3346  uint32_t frame_coding_mode : 3; /* PICTURE_LAYER::FCM */
3347  uint32_t top_field_first : 1; /* PICTURE_LAYER::TFF */
3348  uint32_t is_first_field : 1; /* set to 1 if it is the first field */
3349  uint32_t intensity_compensation : 1; /* PICTURE_LAYER::INTCOMP */
3350  } bits;
3351  uint32_t value;
3352  } picture_fields;
3353  union {
3354  struct {
3355  uint32_t mv_type_mb : 1; /* PICTURE::MVTYPEMB */
3356  uint32_t direct_mb : 1; /* PICTURE::DIRECTMB */
3357  uint32_t skip_mb : 1; /* PICTURE::SKIPMB */
3358  uint32_t field_tx : 1; /* PICTURE::FIELDTX */
3359  uint32_t forward_mb : 1; /* PICTURE::FORWARDMB */
3360  uint32_t ac_pred : 1; /* PICTURE::ACPRED */
3361  uint32_t overflags : 1; /* PICTURE::OVERFLAGS */
3362  } flags;
3363  uint32_t value;
3364  } raw_coding;
3365  union {
3366  struct {
3367  uint32_t bp_mv_type_mb : 1; /* PICTURE::MVTYPEMB */
3368  uint32_t bp_direct_mb : 1; /* PICTURE::DIRECTMB */
3369  uint32_t bp_skip_mb : 1; /* PICTURE::SKIPMB */
3370  uint32_t bp_field_tx : 1; /* PICTURE::FIELDTX */
3371  uint32_t bp_forward_mb : 1; /* PICTURE::FORWARDMB */
3372  uint32_t bp_ac_pred : 1; /* PICTURE::ACPRED */
3373  uint32_t bp_overflags : 1; /* PICTURE::OVERFLAGS */
3374  } flags;
3375  uint32_t value;
3376  } bitplane_present; /* signal what bitplane is being passed via the bitplane buffer */
3377  union {
3378  struct {
3379  uint32_t reference_distance_flag : 1;/* PICTURE_LAYER::REFDIST_FLAG */
3380  uint32_t reference_distance : 5;/* PICTURE_LAYER::REFDIST */
3381  uint32_t num_reference_pictures: 1;/* PICTURE_LAYER::NUMREF */
3382  uint32_t reference_field_pic_indicator : 1;/* PICTURE_LAYER::REFFIELD */
3383  } bits;
3384  uint32_t value;
3385  } reference_fields;
3386  union {
3387  struct {
3388  uint32_t mv_mode : 3; /* PICTURE_LAYER::MVMODE */
3389  uint32_t mv_mode2 : 3; /* PICTURE_LAYER::MVMODE2 */
3390  uint32_t mv_table : 3; /* PICTURE_LAYER::MVTAB/IMVTAB */
3391  uint32_t two_mv_block_pattern_table: 2; /* PICTURE_LAYER::2MVBPTAB */
3392  uint32_t four_mv_switch : 1; /* PICTURE_LAYER::4MVSWITCH */
3393  uint32_t four_mv_block_pattern_table : 2; /* PICTURE_LAYER::4MVBPTAB */
3394  uint32_t extended_mv_flag : 1; /* ENTRY_POINT_LAYER::EXTENDED_MV */
3395  uint32_t extended_mv_range : 2; /* PICTURE_LAYER::MVRANGE */
3396  uint32_t extended_dmv_flag : 1; /* ENTRY_POINT_LAYER::EXTENDED_DMV */
3397  uint32_t extended_dmv_range : 2; /* PICTURE_LAYER::DMVRANGE */
3398  } bits;
3399  uint32_t value;
3400  } mv_fields;
3401  union {
3402  struct {
3403  uint32_t dquant : 2; /* ENTRY_POINT_LAYER::DQUANT */
3404  uint32_t quantizer : 2; /* ENTRY_POINT_LAYER::QUANTIZER */
3405  uint32_t half_qp : 1; /* PICTURE_LAYER::HALFQP */
3406  uint32_t pic_quantizer_scale : 5;/* PICTURE_LAYER::PQUANT */
3407  uint32_t pic_quantizer_type : 1;/* PICTURE_LAYER::PQUANTIZER */
3408  uint32_t dq_frame : 1; /* VOPDQUANT::DQUANTFRM */
3409  uint32_t dq_profile : 2; /* VOPDQUANT::DQPROFILE */
3410  uint32_t dq_sb_edge : 2; /* VOPDQUANT::DQSBEDGE */
3411  uint32_t dq_db_edge : 2; /* VOPDQUANT::DQDBEDGE */
3412  uint32_t dq_binary_level : 1; /* VOPDQUANT::DQBILEVEL */
3413  uint32_t alt_pic_quantizer : 5;/* VOPDQUANT::ALTPQUANT */
3414  } bits;
3415  uint32_t value;
3416  } pic_quantizer_fields;
3417  union {
3418  struct {
3419  uint32_t variable_sized_transform_flag : 1;/* ENTRY_POINT_LAYER::VSTRANSFORM */
3420  uint32_t mb_level_transform_type_flag : 1;/* PICTURE_LAYER::TTMBF */
3421  uint32_t frame_level_transform_type : 2;/* PICTURE_LAYER::TTFRM */
3422  uint32_t transform_ac_codingset_idx1 : 2;/* PICTURE_LAYER::TRANSACFRM */
3423  uint32_t transform_ac_codingset_idx2 : 2;/* PICTURE_LAYER::TRANSACFRM2 */
3424  uint32_t intra_transform_dc_table : 1;/* PICTURE_LAYER::TRANSDCTAB */
3425  } bits;
3426  uint32_t value;
3427  } transform_fields;
3428 
3429  uint8_t luma_scale2; /* PICTURE_LAYER::LUMSCALE2 */
3430  uint8_t luma_shift2; /* PICTURE_LAYER::LUMSHIFT2 */
3431  uint8_t intensity_compensation_field; /* Index for PICTURE_LAYER::INTCOMPFIELD value in Table 109 (9.1.1.48) */
3432 
3434  uint32_t va_reserved[VA_PADDING_MEDIUM - 1];
3436 
3455 /* VC-1 Slice Parameter Buffer */
3456 typedef struct _VASliceParameterBufferVC1 {
3457  uint32_t slice_data_size;/* number of bytes in the slice data buffer for this slice */
3458  uint32_t slice_data_offset;/* the offset to the first byte of slice data */
3459  uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
3460  uint32_t macroblock_offset;/* the offset to the first bit of MB from the first byte of slice data */
3461  uint32_t slice_vertical_position;
3462 
3464  uint32_t va_reserved[VA_PADDING_LOW];
3466 
3467 /* VC-1 Slice Data Buffer */
3468 /*
3469 This is simplely a buffer containing raw bit-stream bytes
3470 */
3471 
3472 /****************************
3473  * H.264/AVC data structures
3474  ****************************/
3475 
3476 typedef struct _VAPictureH264 {
3477  VASurfaceID picture_id;
3478  uint32_t frame_idx;
3479  uint32_t flags;
3480  int32_t TopFieldOrderCnt;
3481  int32_t BottomFieldOrderCnt;
3482 
3484  uint32_t va_reserved[VA_PADDING_LOW];
3485 } VAPictureH264;
3486 /* flags in VAPictureH264 could be OR of the following */
3487 #define VA_PICTURE_H264_INVALID 0x00000001
3488 #define VA_PICTURE_H264_TOP_FIELD 0x00000002
3489 #define VA_PICTURE_H264_BOTTOM_FIELD 0x00000004
3490 #define VA_PICTURE_H264_SHORT_TERM_REFERENCE 0x00000008
3491 #define VA_PICTURE_H264_LONG_TERM_REFERENCE 0x00000010
3492 
3494 /*
3495  * For each picture, and before any slice data, a single
3496  * picture parameter buffer must be send.
3497  */
3498 typedef struct _VAPictureParameterBufferH264 {
3499  VAPictureH264 CurrPic;
3500  VAPictureH264 ReferenceFrames[16]; /* in DPB */
3501  uint16_t picture_width_in_mbs_minus1;
3502  uint16_t picture_height_in_mbs_minus1;
3503  uint8_t bit_depth_luma_minus8;
3504  uint8_t bit_depth_chroma_minus8;
3505  uint8_t num_ref_frames;
3506  union {
3507  struct {
3508  uint32_t chroma_format_idc : 2;
3509  uint32_t residual_colour_transform_flag : 1; /* Renamed to separate_colour_plane_flag in newer standard versions. */
3510  uint32_t gaps_in_frame_num_value_allowed_flag : 1;
3511  uint32_t frame_mbs_only_flag : 1;
3512  uint32_t mb_adaptive_frame_field_flag : 1;
3513  uint32_t direct_8x8_inference_flag : 1;
3514  uint32_t MinLumaBiPredSize8x8 : 1; /* see A.3.3.2 */
3515  uint32_t log2_max_frame_num_minus4 : 4;
3516  uint32_t pic_order_cnt_type : 2;
3517  uint32_t log2_max_pic_order_cnt_lsb_minus4 : 4;
3518  uint32_t delta_pic_order_always_zero_flag : 1;
3519  } bits;
3520  uint32_t value;
3521  } seq_fields;
3522  // FMO is not supported.
3523  va_deprecated uint8_t num_slice_groups_minus1;
3524  va_deprecated uint8_t slice_group_map_type;
3525  va_deprecated uint16_t slice_group_change_rate_minus1;
3526  int8_t pic_init_qp_minus26;
3527  int8_t pic_init_qs_minus26;
3528  int8_t chroma_qp_index_offset;
3529  int8_t second_chroma_qp_index_offset;
3530  union {
3531  struct {
3532  uint32_t entropy_coding_mode_flag : 1;
3533  uint32_t weighted_pred_flag : 1;
3534  uint32_t weighted_bipred_idc : 2;
3535  uint32_t transform_8x8_mode_flag : 1;
3536  uint32_t field_pic_flag : 1;
3537  uint32_t constrained_intra_pred_flag : 1;
3538  uint32_t pic_order_present_flag : 1; /* Renamed to bottom_field_pic_order_in_frame_present_flag in newer standard versions. */
3539  uint32_t deblocking_filter_control_present_flag : 1;
3540  uint32_t redundant_pic_cnt_present_flag : 1;
3541  uint32_t reference_pic_flag : 1; /* nal_ref_idc != 0 */
3542  } bits;
3543  uint32_t value;
3544  } pic_fields;
3545  uint16_t frame_num;
3546 
3548  uint32_t va_reserved[VA_PADDING_MEDIUM];
3552 typedef struct _VAIQMatrixBufferH264 {
3554  uint8_t ScalingList4x4[6][16];
3556  uint8_t ScalingList8x8[2][64];
3557 
3559  uint32_t va_reserved[VA_PADDING_LOW];
3561 
3563 typedef struct _VASliceParameterBufferH264 {
3564  uint32_t slice_data_size;/* number of bytes in the slice data buffer for this slice */
3566  uint32_t slice_data_offset;
3567  uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
3578  uint16_t slice_data_bit_offset;
3579  uint16_t first_mb_in_slice;
3580  uint8_t slice_type;
3581  uint8_t direct_spatial_mv_pred_flag;
3588  uint8_t num_ref_idx_l0_active_minus1;
3595  uint8_t num_ref_idx_l1_active_minus1;
3596  uint8_t cabac_init_idc;
3597  int8_t slice_qp_delta;
3598  uint8_t disable_deblocking_filter_idc;
3599  int8_t slice_alpha_c0_offset_div2;
3600  int8_t slice_beta_offset_div2;
3601  VAPictureH264 RefPicList0[32]; /* See 8.2.4.2 */
3602  VAPictureH264 RefPicList1[32]; /* See 8.2.4.2 */
3603  uint8_t luma_log2_weight_denom;
3604  uint8_t chroma_log2_weight_denom;
3605  uint8_t luma_weight_l0_flag;
3606  int16_t luma_weight_l0[32];
3607  int16_t luma_offset_l0[32];
3608  uint8_t chroma_weight_l0_flag;
3609  int16_t chroma_weight_l0[32][2];
3610  int16_t chroma_offset_l0[32][2];
3611  uint8_t luma_weight_l1_flag;
3612  int16_t luma_weight_l1[32];
3613  int16_t luma_offset_l1[32];
3614  uint8_t chroma_weight_l1_flag;
3615  int16_t chroma_weight_l1[32][2];
3616  int16_t chroma_offset_l1[32][2];
3617 
3619  uint32_t va_reserved[VA_PADDING_LOW];
3621 
3622 /****************************
3623  * Common encode data structures
3624  ****************************/
3625 typedef enum {
3626  VAEncPictureTypeIntra = 0,
3627  VAEncPictureTypePredictive = 1,
3628  VAEncPictureTypeBidirectional = 2,
3629 } VAEncPictureType;
3630 
3638 typedef struct _VAEncSliceParameterBuffer {
3639  uint32_t start_row_number; /* starting MB row number for this slice */
3640  uint32_t slice_height; /* slice height measured in MB */
3641  union {
3642  struct {
3643  uint32_t is_intra : 1;
3644  uint32_t disable_deblocking_filter_idc : 2;
3645  uint32_t uses_long_term_ref : 1;
3646  uint32_t is_long_term_ref : 1;
3647  } bits;
3648  uint32_t value;
3649  } slice_flags;
3650 
3652  uint32_t va_reserved[VA_PADDING_LOW];
3654 
3655 
3656 /****************************
3657  * H.263 specific encode data structures
3658  ****************************/
3659 
3660 typedef struct _VAEncSequenceParameterBufferH263 {
3661  uint32_t intra_period;
3662  uint32_t bits_per_second;
3663  uint32_t frame_rate;
3664  uint32_t initial_qp;
3665  uint32_t min_qp;
3666 
3668  uint32_t va_reserved[VA_PADDING_LOW];
3669 } VAEncSequenceParameterBufferH263;
3670 
3671 typedef struct _VAEncPictureParameterBufferH263 {
3672  VASurfaceID reference_picture;
3673  VASurfaceID reconstructed_picture;
3674  VABufferID coded_buf;
3675  uint16_t picture_width;
3676  uint16_t picture_height;
3677  VAEncPictureType picture_type;
3678 
3680  uint32_t va_reserved[VA_PADDING_LOW];
3681 } VAEncPictureParameterBufferH263;
3682 
3683 /****************************
3684  * MPEG-4 specific encode data structures
3685  ****************************/
3686 
3687 typedef struct _VAEncSequenceParameterBufferMPEG4 {
3688  uint8_t profile_and_level_indication;
3689  uint32_t intra_period;
3690  uint32_t video_object_layer_width;
3691  uint32_t video_object_layer_height;
3692  uint32_t vop_time_increment_resolution;
3693  uint32_t fixed_vop_rate;
3694  uint32_t fixed_vop_time_increment;
3695  uint32_t bits_per_second;
3696  uint32_t frame_rate;
3697  uint32_t initial_qp;
3698  uint32_t min_qp;
3699 
3701  uint32_t va_reserved[VA_PADDING_LOW];
3702 } VAEncSequenceParameterBufferMPEG4;
3703 
3704 typedef struct _VAEncPictureParameterBufferMPEG4 {
3705  VASurfaceID reference_picture;
3706  VASurfaceID reconstructed_picture;
3707  VABufferID coded_buf;
3708  uint16_t picture_width;
3709  uint16_t picture_height;
3710  uint32_t modulo_time_base; /* number of 1s */
3711  uint32_t vop_time_increment;
3712  VAEncPictureType picture_type;
3713 
3715  uint32_t va_reserved[VA_PADDING_LOW];
3716 } VAEncPictureParameterBufferMPEG4;
3717 
3718 
3719 
3737 VAStatus vaCreateBuffer(
3738  VADisplay dpy,
3739  VAContextID context,
3740  VABufferType type, /* in */
3741  unsigned int size, /* in */
3742  unsigned int num_elements, /* in */
3743  void *data, /* in */
3744  VABufferID *buf_id /* out */
3745 );
3746 
3758 VAStatus vaCreateBuffer2(
3759  VADisplay dpy,
3760  VAContextID context,
3761  VABufferType type,
3762  unsigned int width,
3763  unsigned int height,
3764  unsigned int *unit_size,
3765  unsigned int *pitch,
3766  VABufferID *buf_id
3767 );
3768 
3775 VAStatus vaBufferSetNumElements(
3776  VADisplay dpy,
3777  VABufferID buf_id, /* in */
3778  unsigned int num_elements /* in */
3779 );
3780 
3781 
3786 /*
3787  * FICTURE_AVE_QP(bit7-0): The average Qp value used during this frame
3788  * LARGE_SLICE(bit8):At least one slice in the current frame was large
3789  * enough for the encoder to attempt to limit its size.
3790  * SLICE_OVERFLOW(bit9): At least one slice in the current frame has
3791  * exceeded the maximum slice size specified.
3792  * BITRATE_OVERFLOW(bit10): The peak bitrate was exceeded for this frame.
3793  * BITRATE_HIGH(bit11): The frame size got within the safety margin of the maximum size (VCM only)
3794  * AIR_MB_OVER_THRESHOLD: the number of MBs adapted to Intra MB
3795  */
3796 #define VA_CODED_BUF_STATUS_PICTURE_AVE_QP_MASK 0xff
3797 #define VA_CODED_BUF_STATUS_LARGE_SLICE_MASK 0x100
3798 #define VA_CODED_BUF_STATUS_SLICE_OVERFLOW_MASK 0x200
3799 #define VA_CODED_BUF_STATUS_BITRATE_OVERFLOW 0x400
3800 #define VA_CODED_BUF_STATUS_BITRATE_HIGH 0x800
3808 #define VA_CODED_BUF_STATUS_FRAME_SIZE_OVERFLOW 0x1000
3809 
3812 #define VA_CODED_BUF_STATUS_BAD_BITSTREAM 0x8000
3813 #define VA_CODED_BUF_STATUS_AIR_MB_OVER_THRESHOLD 0xff0000
3814 
3823 #define VA_CODED_BUF_STATUS_NUMBER_PASSES_MASK 0xf000000
3824 
3832 #define VA_CODED_BUF_STATUS_SINGLE_NALU 0x10000000
3833 
3844 typedef struct _VACodedBufferSegment {
3848  uint32_t size;
3850  uint32_t bit_offset;
3852  uint32_t status;
3854  uint32_t reserved;
3856  void *buf;
3861  void *next;
3862 
3864  uint32_t va_reserved[VA_PADDING_LOW];
3866 
3875 VAStatus vaMapBuffer(
3876  VADisplay dpy,
3877  VABufferID buf_id, /* in */
3878  void **pbuf /* out */
3879 );
3880 
3886 VAStatus vaUnmapBuffer(
3887  VADisplay dpy,
3888  VABufferID buf_id /* in */
3889 );
3890 
3900 VAStatus vaDestroyBuffer(
3902  VABufferID buffer_id
3903 );
3904 
3906 typedef struct {
3908  uintptr_t handle;
3910  uint32_t type;
3919  uint32_t mem_type;
3921  size_t mem_size;
3922 
3924  uint32_t va_reserved[VA_PADDING_LOW];
3925 } VABufferInfo;
3926 
3974 VAStatus
3975 vaAcquireBufferHandle(VADisplay dpy, VABufferID buf_id, VABufferInfo *buf_info);
3976 
4007 VAStatus
4009 
4015 #define VA_EXPORT_SURFACE_READ_ONLY 0x0001
4016 
4017 #define VA_EXPORT_SURFACE_WRITE_ONLY 0x0002
4019 #define VA_EXPORT_SURFACE_READ_WRITE 0x0003
4020 
4025 #define VA_EXPORT_SURFACE_SEPARATE_LAYERS 0x0004
4026 
4031 #define VA_EXPORT_SURFACE_COMPOSED_LAYERS 0x0008
4032 
4067 VAStatus vaExportSurfaceHandle(VADisplay dpy,
4068  VASurfaceID surface_id,
4069  uint32_t mem_type, uint32_t flags,
4070  void *descriptor);
4071 
4087 VAStatus vaBeginPicture(
4088  VADisplay dpy,
4089  VAContextID context,
4090  VASurfaceID render_target
4091 );
4092 
4096 VAStatus vaRenderPicture(
4097  VADisplay dpy,
4098  VAContextID context,
4099  VABufferID *buffers,
4100  int num_buffers
4101 );
4102 
4111 VAStatus vaEndPicture(
4112  VADisplay dpy,
4113  VAContextID context
4114 );
4115 
4135 VAStatus vaMFSubmit(
4136  VADisplay dpy,
4137  VAMFContextID mf_context,
4138  VAContextID * contexts,
4139  int num_contexts
4140 );
4141 
4142 /*
4143 
4144 Synchronization
4145 
4146 */
4147 
4153 VAStatus vaSyncSurface(
4154  VADisplay dpy,
4155  VASurfaceID render_target
4156 );
4157 
4159 #define VA_TIMEOUT_INFINITE 0xFFFFFFFFFFFFFFFF
4160 
4181 VAStatus vaSyncSurface2(
4182  VADisplay dpy,
4183  VASurfaceID surface,
4184  uint64_t timeout_ns
4185 );
4186 
4187 typedef enum {
4188  VASurfaceRendering = 1, /* Rendering in progress */
4189  VASurfaceDisplaying = 2, /* Displaying in progress (not safe to render into it) */
4190  /* this status is useful if surface is used as the source */
4191  /* of an overlay */
4192  VASurfaceReady = 4, /* not being rendered or displayed */
4193  VASurfaceSkipped = 8 /* Indicate a skipped frame during encode */
4194 } VASurfaceStatus;
4195 
4199 VAStatus vaQuerySurfaceStatus(
4200  VADisplay dpy,
4201  VASurfaceID render_target,
4202  VASurfaceStatus *status /* out */
4203 );
4204 
4205 typedef enum {
4206  VADecodeSliceMissing = 0,
4207  VADecodeMBError = 1,
4208 } VADecodeErrorType;
4209 
4214 typedef struct _VASurfaceDecodeMBErrors {
4215  int32_t status; /* 1 if hardware has returned detailed info below, -1 means this record is invalid */
4216  uint32_t start_mb; /* start mb address with errors */
4217  uint32_t end_mb; /* end mb address with errors */
4218  VADecodeErrorType decode_error_type;
4219  uint32_t num_mb; /* number of mbs with errors */
4221  uint32_t va_reserved[VA_PADDING_LOW - 1];
4223 
4232 VAStatus vaQuerySurfaceError(
4233  VADisplay dpy,
4234  VASurfaceID surface,
4235  VAStatus error_status,
4236  void **error_info
4237 );
4238 
4259 VAStatus vaSyncBuffer(
4260  VADisplay dpy,
4261  VABufferID buf_id,
4262  uint64_t timeout_ns
4263 );
4264 
4286 #define VA_FOURCC(ch0, ch1, ch2, ch3) \
4287  ((unsigned long)(unsigned char) (ch0) | ((unsigned long)(unsigned char) (ch1) << 8) | \
4288  ((unsigned long)(unsigned char) (ch2) << 16) | ((unsigned long)(unsigned char) (ch3) << 24 ))
4289 
4290 /* Pre-defined fourcc codes. */
4291 
4295 #define VA_FOURCC_NV12 0x3231564E
4296 
4299 #define VA_FOURCC_NV21 0x3132564E
4300 
4305 #define VA_FOURCC_AI44 0x34344149
4306 
4311 #define VA_FOURCC_RGBA 0x41424752
4312 
4316 #define VA_FOURCC_RGBX 0x58424752
4317 
4321 #define VA_FOURCC_BGRA 0x41524742
4322 
4326 #define VA_FOURCC_BGRX 0x58524742
4327 
4331 #define VA_FOURCC_ARGB 0x42475241
4332 
4336 #define VA_FOURCC_XRGB 0x42475258
4337 
4341 #define VA_FOURCC_ABGR 0x52474241
4342 
4346 #define VA_FOURCC_XBGR 0x52474258
4347 
4352 #define VA_FOURCC_UYVY 0x59565955
4353 
4357 #define VA_FOURCC_YUY2 0x32595559
4358 
4362 #define VA_FOURCC_AYUV 0x56555941
4363 
4367 #define VA_FOURCC_NV11 0x3131564e
4368 
4372 #define VA_FOURCC_YV12 0x32315659
4373 
4377 #define VA_FOURCC_P208 0x38303250
4378 
4382 #define VA_FOURCC_I420 0x30323449
4383 
4387 #define VA_FOURCC_YV24 0x34325659
4392 #define VA_FOURCC_YV32 0x32335659
4393 
4395 #define VA_FOURCC_Y800 0x30303859
4396 
4401 #define VA_FOURCC_IMC3 0x33434D49
4402 
4406 #define VA_FOURCC_411P 0x50313134
4407 
4412 #define VA_FOURCC_411R 0x52313134
4413 
4417 #define VA_FOURCC_422H 0x48323234
4418 
4422 #define VA_FOURCC_422V 0x56323234
4423 
4427 #define VA_FOURCC_444P 0x50343434
4428 
4433 #define VA_FOURCC_RGBP 0x50424752
4434 
4438 #define VA_FOURCC_BGRP 0x50524742
4439 
4444 #define VA_FOURCC_RGB565 0x36314752
4445 
4450 #define VA_FOURCC_BGR565 0x36314742
4451 
4457 #define VA_FOURCC_Y210 0x30313259
4458 
4463 #define VA_FOURCC_Y212 0x32313259
4464 
4469 #define VA_FOURCC_Y216 0x36313259
4470 
4475 #define VA_FOURCC_Y410 0x30313459
4476 
4481 #define VA_FOURCC_Y412 0x32313459
4482 
4487 #define VA_FOURCC_Y416 0x36313459
4488 
4493 #define VA_FOURCC_YV16 0x36315659
4494 
4499 #define VA_FOURCC_P010 0x30313050
4500 
4505 #define VA_FOURCC_P012 0x32313050
4506 
4511 #define VA_FOURCC_P016 0x36313050
4512 
4518 #define VA_FOURCC_I010 0x30313049
4519 
4524 #define VA_FOURCC_IYUV 0x56555949
4528 #define VA_FOURCC_A2R10G10B10 0x30335241 /* VA_FOURCC('A','R','3','0') */
4532 #define VA_FOURCC_A2B10G10R10 0x30334241 /* VA_FOURCC('A','B','3','0') */
4536 #define VA_FOURCC_X2R10G10B10 0x30335258 /* VA_FOURCC('X','R','3','0') */
4537 
4540 #define VA_FOURCC_X2B10G10R10 0x30334258 /* VA_FOURCC('X','B','3','0') */
4541 
4546 #define VA_FOURCC_Y8 0x20203859
4547 
4551 #define VA_FOURCC_Y16 0x20363159
4552 
4556 #define VA_FOURCC_VYUY 0x59555956
4557 
4561 #define VA_FOURCC_YVYU 0x55595659
4562 
4566 #define VA_FOURCC_ARGB64 0x34475241
4567 
4571 #define VA_FOURCC_ABGR64 0x34474241
4572 
4576 #define VA_FOURCC_XYUV 0x56555958
4577 
4578 /* byte order */
4579 #define VA_LSB_FIRST 1
4580 #define VA_MSB_FIRST 2
4581 
4582 typedef struct _VAImageFormat {
4583  uint32_t fourcc;
4584  uint32_t byte_order; /* VA_LSB_FIRST, VA_MSB_FIRST */
4585  uint32_t bits_per_pixel;
4586  /* for RGB formats */
4587  uint32_t depth; /* significant bits per pixel */
4588  uint32_t red_mask;
4589  uint32_t green_mask;
4590  uint32_t blue_mask;
4591  uint32_t alpha_mask;
4592 
4594  uint32_t va_reserved[VA_PADDING_LOW];
4595 } VAImageFormat;
4596 
4597 typedef VAGenericID VAImageID;
4598 
4599 typedef struct _VAImage {
4600  VAImageID image_id; /* uniquely identify this image */
4601  VAImageFormat format;
4602  VABufferID buf; /* image data buffer */
4603  /*
4604  * Image data will be stored in a buffer of type VAImageBufferType to facilitate
4605  * data store on the server side for optimal performance. The buffer will be
4606  * created by the CreateImage function, and proper storage allocated based on the image
4607  * size and format. This buffer is managed by the library implementation, and
4608  * accessed by the client through the buffer Map/Unmap functions.
4609  */
4610  uint16_t width;
4611  uint16_t height;
4612  uint32_t data_size;
4613  uint32_t num_planes; /* can not be greater than 3 */
4614  /*
4615  * An array indicating the scanline pitch in bytes for each plane.
4616  * Each plane may have a different pitch. Maximum 3 planes for planar formats
4617  */
4618  uint32_t pitches[3];
4619  /*
4620  * An array indicating the byte offset from the beginning of the image data
4621  * to the start of each plane.
4622  */
4623  uint32_t offsets[3];
4624 
4625  /* The following fields are only needed for paletted formats */
4626  int32_t num_palette_entries; /* set to zero for non-palette images */
4627  /*
4628  * Each component is one byte and entry_bytes indicates the number of components in
4629  * each entry (eg. 3 for YUV palette entries). set to zero for non-palette images
4630  */
4631  int32_t entry_bytes;
4632  /*
4633  * An array of ascii characters describing the order of the components within the bytes.
4634  * Only entry_bytes characters of the string are used.
4635  */
4636  int8_t component_order[4];
4637 
4639  uint32_t va_reserved[VA_PADDING_LOW];
4640 } VAImage;
4641 
4644  VADisplay dpy
4645 );
4646 
4653 VAStatus vaQueryImageFormats(
4654  VADisplay dpy,
4655  VAImageFormat *format_list, /* out */
4656  int *num_formats /* out */
4657 );
4658 
4666 VAStatus vaCreateImage(
4667  VADisplay dpy,
4668  VAImageFormat *format,
4669  int width,
4670  int height,
4671  VAImage *image /* out */
4672 );
4673 
4677 VAStatus vaDestroyImage(
4678  VADisplay dpy,
4679  VAImageID image
4680 );
4681 
4682 VAStatus vaSetImagePalette(
4683  VADisplay dpy,
4684  VAImageID image,
4685  /*
4686  * pointer to an array holding the palette data. The size of the array is
4687  * num_palette_entries * entry_bytes in size. The order of the components
4688  * in the palette is described by the component_order in VAImage struct
4689  */
4690  unsigned char *palette
4691 );
4692 
4697 VAStatus vaGetImage(
4698  VADisplay dpy,
4699  VASurfaceID surface,
4700  int x, /* coordinates of the upper left source pixel */
4701  int y,
4702  unsigned int width, /* width and height of the region */
4703  unsigned int height,
4704  VAImageID image
4705 );
4706 
4713 VAStatus vaPutImage(
4714  VADisplay dpy,
4715  VASurfaceID surface,
4716  VAImageID image,
4717  int src_x,
4718  int src_y,
4719  unsigned int src_width,
4720  unsigned int src_height,
4721  int dest_x,
4722  int dest_y,
4723  unsigned int dest_width,
4724  unsigned int dest_height
4725 );
4726 
4758 VAStatus vaDeriveImage(
4759  VADisplay dpy,
4760  VASurfaceID surface,
4761  VAImage *image /* out */
4762 );
4763 
4771 typedef VAGenericID VASubpictureID;
4775  VADisplay dpy
4776 );
4777 
4779 #define VA_SUBPICTURE_CHROMA_KEYING 0x0001
4780 #define VA_SUBPICTURE_GLOBAL_ALPHA 0x0002
4781 #define VA_SUBPICTURE_DESTINATION_IS_SCREEN_COORD 0x0004
4782 
4794 VAStatus vaQuerySubpictureFormats(
4795  VADisplay dpy,
4796  VAImageFormat *format_list, /* out */
4797  unsigned int *flags, /* out */
4798  unsigned int *num_formats /* out */
4799 );
4800 
4804 VAStatus vaCreateSubpicture(
4805  VADisplay dpy,
4806  VAImageID image,
4807  VASubpictureID *subpicture /* out */
4808 );
4809 
4813 VAStatus vaDestroySubpicture(
4814  VADisplay dpy,
4815  VASubpictureID subpicture
4816 );
4817 
4822 VAStatus vaSetSubpictureImage(
4823  VADisplay dpy,
4824  VASubpictureID subpicture,
4825  VAImageID image
4826 );
4827 
4837 VAStatus vaSetSubpictureChromakey(
4838  VADisplay dpy,
4839  VASubpictureID subpicture,
4840  unsigned int chromakey_min,
4841  unsigned int chromakey_max,
4842  unsigned int chromakey_mask
4843 );
4844 
4851  VADisplay dpy,
4852  VASubpictureID subpicture,
4853  float global_alpha
4854 );
4855 
4863 VAStatus vaAssociateSubpicture(
4864  VADisplay dpy,
4865  VASubpictureID subpicture,
4866  VASurfaceID *target_surfaces,
4867  int num_surfaces,
4868  int16_t src_x, /* upper left offset in subpicture */
4869  int16_t src_y,
4870  uint16_t src_width,
4871  uint16_t src_height,
4872  int16_t dest_x, /* upper left offset in surface */
4873  int16_t dest_y,
4874  uint16_t dest_width,
4875  uint16_t dest_height,
4876  /*
4877  * whether to enable chroma-keying, global-alpha, or screen relative mode
4878  * see VA_SUBPICTURE_XXX values
4879  */
4880  uint32_t flags
4881 );
4882 
4886 VAStatus vaDeassociateSubpicture(
4887  VADisplay dpy,
4888  VASubpictureID subpicture,
4889  VASurfaceID *target_surfaces,
4890  int num_surfaces
4891 );
4892 
4910 /* PowerVR IEP Lite attributes */
4911 typedef enum {
4912  VADISPLAYATTRIB_BLE_OFF = 0x00,
4913  VADISPLAYATTRIB_BLE_LOW,
4914  VADISPLAYATTRIB_BLE_MEDIUM,
4915  VADISPLAYATTRIB_BLE_HIGH,
4916  VADISPLAYATTRIB_BLE_NONE,
4918 
4920 #define VA_ROTATION_NONE 0x00000000
4921 #define VA_ROTATION_90 0x00000001
4922 #define VA_ROTATION_180 0x00000002
4923 #define VA_ROTATION_270 0x00000003
4924 
4935 #define VA_MIRROR_NONE 0x00000000
4937 #define VA_MIRROR_HORIZONTAL 0x00000001
4938 
4939 #define VA_MIRROR_VERTICAL 0x00000002
4943 #define VA_OOL_DEBLOCKING_FALSE 0x00000000
4944 #define VA_OOL_DEBLOCKING_TRUE 0x00000001
4945 
4947 #define VA_RENDER_MODE_UNDEFINED 0
4948 #define VA_RENDER_MODE_LOCAL_OVERLAY 1
4949 #define VA_RENDER_MODE_LOCAL_GPU 2
4950 #define VA_RENDER_MODE_EXTERNAL_OVERLAY 4
4951 #define VA_RENDER_MODE_EXTERNAL_GPU 8
4952 
4954 #define VA_RENDER_DEVICE_UNDEFINED 0
4955 #define VA_RENDER_DEVICE_LOCAL 1
4956 #define VA_RENDER_DEVICE_EXTERNAL 2
4957 
4971 typedef union _VADisplayAttribValSubDevice {
4972  struct {
4974  uint32_t current_sub_device : 4;
4976  uint32_t sub_device_count : 4;
4978  uint32_t reserved : 8;
4994  uint32_t sub_device_mask : 16;
4995  } bits;
4996  uint32_t value;
4998 
5000 typedef enum {
5001  VADisplayAttribBrightness = 0,
5002  VADisplayAttribContrast = 1,
5003  VADisplayAttribHue = 2,
5004  VADisplayAttribSaturation = 3,
5005  /* client can specifiy a background color for the target window
5006  * the new feature of video conference,
5007  * the uncovered area of the surface is filled by this color
5008  * also it will blend with the decoded video color
5009  */
5010  VADisplayAttribBackgroundColor = 4,
5011  /*
5012  * this is a gettable only attribute. For some implementations that use the
5013  * hardware overlay, after PutSurface is called, the surface can not be
5014  * re-used until after the subsequent PutSurface call. If this is the case
5015  * then the value for this attribute will be set to 1 so that the client
5016  * will not attempt to re-use the surface right after returning from a call
5017  * to PutSurface.
5018  *
5019  * Don't use it, use flag VASurfaceDisplaying of vaQuerySurfaceStatus since
5020  * driver may use overlay or GPU alternatively
5021  */
5022  VADisplayAttribDirectSurface = 5,
5023  VADisplayAttribRotation = 6,
5024  VADisplayAttribOutofLoopDeblock = 7,
5025 
5026  /* PowerVR IEP Lite specific attributes */
5027  VADisplayAttribBLEBlackMode = 8,
5028  VADisplayAttribBLEWhiteMode = 9,
5029  VADisplayAttribBlueStretch = 10,
5030  VADisplayAttribSkinColorCorrection = 11,
5031  /*
5032  * For type VADisplayAttribCSCMatrix, "value" field is a pointer to the color
5033  * conversion matrix. Each element in the matrix is float-point
5034  */
5035  VADisplayAttribCSCMatrix = 12,
5036  /* specify the constant color used to blend with video surface
5037  * Cd = Cv*Cc*Ac + Cb *(1 - Ac) C means the constant RGB
5038  * d: the final color to overwrite into the frame buffer
5039  * v: decoded video after color conversion,
5040  * c: video color specified by VADisplayAttribBlendColor
5041  * b: background color of the drawable
5042  */
5043  VADisplayAttribBlendColor = 13,
5044  /*
5045  * Indicate driver to skip painting color key or not.
5046  * only applicable if the render is overlay
5047  */
5048  VADisplayAttribOverlayAutoPaintColorKey = 14,
5049  /*
5050  * customized overlay color key, the format is RGB888
5051  * [23:16] = Red, [15:08] = Green, [07:00] = Blue.
5052  */
5053  VADisplayAttribOverlayColorKey = 15,
5054  /*
5055  * The hint for the implementation of vaPutSurface
5056  * normally, the driver could use an overlay or GPU to render the surface on the screen
5057  * this flag provides APP the flexibity to switch the render dynamically
5058  */
5059  VADisplayAttribRenderMode = 16,
5060  /*
5061  * specify if vaPutSurface needs to render into specified monitors
5062  * one example is that one external monitor (e.g. HDMI) is enabled,
5063  * but the window manager is not aware of it, and there is no associated drawable
5064  */
5065  VADisplayAttribRenderDevice = 17,
5066  /*
5067  * specify vaPutSurface render area if there is no drawable on the monitor
5068  */
5069  VADisplayAttribRenderRect = 18,
5070  /*
5071  * HW attribute, read/write, specify the sub device configure
5072  */
5073  VADisplayAttribSubDevice = 19,
5074  /*
5075  * HW attribute. read only. specify whether vaCopy support on current HW
5076  * The value of each bit should equal to 1 << VA_EXEC_MODE_XXX to represent
5077  * modes of vaCopy
5078  */
5079  VADisplayAttribCopy = 20,
5080  /*
5081  * HW attribute. read only. retrieve the device information from backend driver
5082  * the value should be combined with vendor ID << 16 | device ID
5083  */
5084  VADisplayPCIID = 21,
5086 
5087 /* flags for VADisplayAttribute */
5088 #define VA_DISPLAY_ATTRIB_NOT_SUPPORTED 0x0000
5089 #define VA_DISPLAY_ATTRIB_GETTABLE 0x0001
5090 #define VA_DISPLAY_ATTRIB_SETTABLE 0x0002
5091 
5092 typedef struct _VADisplayAttribute {
5093  VADisplayAttribType type;
5094  int32_t min_value;
5095  int32_t max_value;
5096  int32_t value; /* used by the set/get attribute functions */
5097  /* flags can be VA_DISPLAY_ATTRIB_GETTABLE or VA_DISPLAY_ATTRIB_SETTABLE or OR'd together */
5098  uint32_t flags;
5099 
5101  uint32_t va_reserved[VA_PADDING_LOW];
5102 } VADisplayAttribute;
5103 
5106  VADisplay dpy
5107 );
5108 
5115 VAStatus vaQueryDisplayAttributes(
5116  VADisplay dpy,
5117  VADisplayAttribute *attr_list, /* out */
5118  int *num_attributes /* out */
5119 );
5120 
5127 VAStatus vaGetDisplayAttributes(
5128  VADisplay dpy,
5129  VADisplayAttribute *attr_list, /* in/out */
5130  int num_attributes
5131 );
5132 
5139 VAStatus vaSetDisplayAttributes(
5140  VADisplay dpy,
5141  VADisplayAttribute *attr_list,
5142  int num_attributes
5143 );
5144 
5145 /****************************
5146  * HEVC data structures
5147  ****************************/
5157 typedef struct _VAPictureHEVC {
5161  VASurfaceID picture_id;
5166  int32_t pic_order_cnt;
5167  /* described below */
5168  uint32_t flags;
5169 
5171  uint32_t va_reserved[VA_PADDING_LOW];
5172 } VAPictureHEVC;
5173 
5174 /* flags in VAPictureHEVC could be OR of the following */
5175 #define VA_PICTURE_HEVC_INVALID 0x00000001
5179 #define VA_PICTURE_HEVC_FIELD_PIC 0x00000002
5180 
5184 #define VA_PICTURE_HEVC_BOTTOM_FIELD 0x00000004
5185 
5186 #define VA_PICTURE_HEVC_LONG_TERM_REFERENCE 0x00000008
5187 
5201 #define VA_PICTURE_HEVC_RPS_ST_CURR_BEFORE 0x00000010
5202 
5206 #define VA_PICTURE_HEVC_RPS_ST_CURR_AFTER 0x00000020
5207 
5211 #define VA_PICTURE_HEVC_RPS_LT_CURR 0x00000040
5212 
5213 typedef enum {
5214  VACopyObjectSurface = 0,
5215  VACopyObjectBuffer = 1,
5216 } VACopyObjectType;
5217 
5218 typedef struct _VACopyObject {
5219  VACopyObjectType obj_type; // type of object.
5220  union {
5221  VASurfaceID surface_id;
5222  VABufferID buffer_id;
5223  } object;
5224 
5225  uint32_t va_reserved[VA_PADDING_MEDIUM];
5226 } VACopyObject;
5227 
5228 typedef union _VACopyOption {
5229  struct {
5231  uint32_t va_copy_sync : 2;
5233  uint32_t va_copy_mode : 4;
5234  uint32_t reserved : 26;
5235  } bits;
5236  uint32_t value;
5237 } VACopyOption;
5238 
5251 VAStatus vaCopy(VADisplay dpy, VACopyObject * dst, VACopyObject * src, VACopyOption option);
5252 
5253 #include <va/va_dec_hevc.h>
5254 #include <va/va_dec_jpeg.h>
5255 #include <va/va_dec_vp8.h>
5256 #include <va/va_dec_vp9.h>
5257 #include <va/va_dec_av1.h>
5258 #include <va/va_enc_hevc.h>
5259 #include <va/va_fei_hevc.h>
5260 #include <va/va_enc_h264.h>
5261 #include <va/va_enc_jpeg.h>
5262 #include <va/va_enc_mpeg2.h>
5263 #include <va/va_enc_vp8.h>
5264 #include <va/va_enc_vp9.h>
5265 #include <va/va_enc_av1.h>
5266 #include <va/va_fei.h>
5267 #include <va/va_fei_h264.h>
5268 #include <va/va_vpp.h>
5269 #include <va/va_prot.h>
5270 
5273 #ifdef __cplusplus
5274 }
5275 #endif
5276 
5277 #endif /* _VA_H_ */
VASurfaceAttribExternalBuffers::buffers
uintptr_t * buffers
buffer handles or user pointers
Definition: va.h:1735
VAEncMiscParameterEncQuality::directBiasAdjustmentEnable
uint32_t directBiasAdjustmentEnable
Definition: va.h:2894
VAEncMiscParameterTypeSkipFrame
Buffer type used for sending skip frame parameters to the encoder's rate control, when the user has e...
Definition: va.h:2299
VAEncMiscParameterFrameRate::temporal_id
uint32_t temporal_id
Definition: va.h:2545
VAConfigAttribEncMaxRefFrames
Maximum number of reference frames. Read-only.
Definition: va.h:709
VAIQMatrixBufferH264
Definition: va.h:3548
vaBeginPicture
VAStatus vaBeginPicture(VADisplay dpy, VAContextID context, VASurfaceID render_target)
VAEncMiscParameterCustomRoundingControl
Custom Encoder Rounding Offset Control. Application may use this structure to set customized rounding...
Definition: va.h:2944
vaUnmapBuffer
VAStatus vaUnmapBuffer(VADisplay dpy, VABufferID buf_id)
vaEndPicture
VAStatus vaEndPicture(VADisplay dpy, VAContextID context)
VAEncMiscParameterFrameRate::reserved
uint32_t reserved
Definition: va.h:2547
VAGenericValueTypeInteger
Definition: va.h:1610
vaDestroySurfaces
VAStatus vaDestroySurfaces(VADisplay dpy, VASurfaceID *surfaces, int num_surfaces)
va_dec_hevc.h
The HEVC decoding API.
VAEncMiscParameterSkipFrame::size_skip_frames
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:2761
VASurfaceAttribMaxWidth
Maximal width in pixels (int, read-only).
Definition: va.h:1662
VAEncMiscParameterRateControl::min_qp
uint32_t min_qp
Definition: va.h:2429
VAPictureParameterBufferH264
Definition: va.h:3494
VAEncMiscParameterRateControl::enable_parallel_brc
uint32_t enable_parallel_brc
Definition: va.h:2463
VAEntrypointFEI
VAEntrypointFEI.
Definition: va.h:581
VAEncMiscParameterEncQuality::FTQOverride
uint32_t FTQOverride
Definition: va.h:2882
VAEncMiscParameterRateControl::target_frame_size
uint32_t target_frame_size
Definition: va.h:2510
VAEncMiscParameterBuffer
Definition: va.h:2379
VAConfigAttribValEncRateControlExt::temporal_layer_bitrate_control_flag
uint32_t temporal_layer_bitrate_control_flag
Definition: va.h:1386
VAEncMiscParameterTypeROI
Buffer type used for region-of-interest (ROI) parameters.
Definition: va.h:2301
VAConfigAttribValContextPriority::reserved
uint32_t reserved
reserved bits for future, must be zero
Definition: va.h:1414
VAEncMiscParameterEncQuality::ForceRepartitionCheck
uint32_t ForceRepartitionCheck
Definition: va.h:2923
VAEncMiscParameterSkipFrame::num_skip_frames
uint8_t num_skip_frames
The number of frames skipped prior to the current frame. Valid when skip_frame_flag = 1.
Definition: va.h:2758
VAEncMiscParameterEncQuality::NonFTQSkipThresholdLUTInput
uint32_t NonFTQSkipThresholdLUTInput
Definition: va.h:2890
VAConfigAttribValEncRateControlExt
Attribute value for VAConfigAttribEncRateControlExt.
Definition: va.h:1352
VAEncMiscParameterRateControl::temporal_id
uint32_t temporal_id
Definition: va.h:2456
VAGenericValueTypeFloat
Definition: va.h:1611
VAEncMiscParameterRateControl::initial_qp
uint32_t initial_qp
Definition: va.h:2423
VAConfigAttribEncMacroblockInfo
Macroblock information. Read-only.
Definition: va.h:745
VAEncryptionParameterBufferType
Encryption parameters buffer for protected content session.
Definition: va.h:2100
VAConfigAttribValEncJPEG::non_interleaved_mode
uint32_t non_interleaved_mode
set to 1 for non-interleaved.
Definition: va.h:1262
vaCreateImage
VAStatus vaCreateImage(VADisplay dpy, VAImageFormat *format, int width, int height, VAImage *image)
VASurfaceAttribMinWidth
Minimal width in pixels (int, read-only).
Definition: va.h:1660
VAConfigAttribEncAV1Ext1
AV1 encoding attribute extend1. Read-only.
Definition: va.h:1023
VAEncROI
Encoding region-of-interest (ROI).
Definition: va.h:2776
VAConfigAttribValMultipleFrame::max_num_concurrent_frames
uint32_t max_num_concurrent_frames
max num of concurrent frames from different stream
Definition: va.h:1396
VAConfigAttribValEncJPEG::differential_mode
uint32_t differential_mode
set to 1 for differential.
Definition: va.h:1264
VASurfaceAttribUsageHint
Surface usage hint, gives the driver a hint of intended usage to optimize allocation (e....
Definition: va.h:1678
VAEntrypointProtectedTEEComm
VAEntrypointProtectedTEEComm.
Definition: va.h:604
VAConfigAttribValEncPerBlockControl::log2_delta_qp_block_size
uint32_t log2_delta_qp_block_size
supported size of delta qp block
Definition: va.h:1425
VAEncDeltaQpPerBlockBufferType
Encoding delta QP per block buffer.
Definition: va.h:2111
VAStatsStatisticsBottomFieldBufferType
Statistics output for VAEntrypointStats bottom field of interlaced case.
Definition: va.h:2047
VAContextParameterUpdateBufferType
adjust context parameters dynamically
Definition: va.h:2087
va_vpp.h
The video processing API.
VAConfigAttribValEncROI
Attribute value for VAConfigAttribEncROI.
Definition: va.h:1318
VAConfigAttribValMaxFrameSize::multiple_pass
uint32_t multiple_pass
multiple_pass support
Definition: va.h:1247
VAEncMiscParameterBufferMultiPassFrameSize::reserved
uint32_t reserved
Reserved bytes for future use, must be zero.
Definition: va.h:2684
vaQuerySurfaceAttributes
VAStatus vaQuerySurfaceAttributes(VADisplay dpy, VAConfigID config, VASurfaceAttrib *attrib_list, unsigned int *num_attribs)
Queries surface attributes for the supplied config.
vaAcquireBufferHandle
VAStatus vaAcquireBufferHandle(VADisplay dpy, VABufferID buf_id, VABufferInfo *buf_info)
Acquires buffer handle for external API usage.
VAStatsStatisticsBufferType
Statistics output for VAEntrypointStats progressive and top field of interlaced case.
Definition: va.h:2045
VASurfaceAttribMaxHeight
Maximal height in pixels (int, read-only).
Definition: va.h:1666
VAConfigAttribEncDynamicScaling
Dynamic Scaling Attribute. Read-only.
Definition: va.h:864
vaQueryVendorString
const char * vaQueryVendorString(VADisplay dpy)
VAConfigAttribEncIntraRefresh
Encoding intra refresh attribute. Read-only.
Definition: va.h:791
VAEncMiscParameterEncQuality
Definition: va.h:2870
VAProcessingRateParameterEnc
Definition: va.h:2224
VAEncMiscParameterRateControl::target_percentage
uint32_t target_percentage
Definition: va.h:2412
VAEncMiscParameterRateControl::frame_tolerance_mode
uint32_t frame_tolerance_mode
Definition: va.h:2479
va_dec_jpeg.h
The JPEG decoding API.
VAEncMiscParameterFrameRate
Definition: va.h:2521
VASurfaceAttribExternalBuffers::private_data
void * private_data
reserved for passing private data
Definition: va.h:1741
VAEncMiscParameterTypeExtensionData
encode extension buffer, ect. MPEG2 Sequence extenstion data
Definition: va.h:2319
vaSetSubpictureGlobalAlpha
VAStatus vaSetSubpictureGlobalAlpha(VADisplay dpy, VASubpictureID subpicture, float global_alpha)
VASurfaceAttribCount
Number of surface attributes.
Definition: va.h:1687
VAConfigAttribDecSliceMode
Slice Decoding mode. Read/write.
Definition: va.h:635
VAConfigAttribValEncRateControlExt::max_num_temporal_layers_minus1
uint32_t max_num_temporal_layers_minus1
The maximum number of temporal layers minus 1.
Definition: va.h:1361
VAConfigAttribValMaxFrameSize
Attribute value for VAConfigAttribMaxFrameSize.
Definition: va.h:1238
VAEncFEIMVBufferType
FEI specific buffer types.
Definition: va.h:2038
VAEncryptionSegmentInfo::init_byte_length
uint32_t init_byte_length
The length in bytes of the initial clear data.
Definition: va.h:2165
VAEncMiscParameterEncQuality::FTQEnable
uint32_t FTQEnable
Definition: va.h:2884
VAGenericValue::fn
VAGenericFunc fn
Pointer to function.
Definition: va.h:1632
VAEncMiscParameterHRD
Definition: va.h:2625
VAEncPackedHeaderParameterBuffer::type
uint32_t type
Definition: va.h:2352
VAEncMiscParameterBufferMaxFrameSize
Defines a maximum frame size (in bits).
Definition: va.h:2657
vaQueryImageFormats
VAStatus vaQueryImageFormats(VADisplay dpy, VAImageFormat *format_list, int *num_formats)
VASliceParameterBufferMPEG2
Definition: va.h:3100
VAEncPackedHeaderPicture
Packed picture header.
Definition: va.h:2327
VAGenericValueType
VAGenericValueType
Generic value types.
Definition: va.h:1609
VAConfigAttribMaxPictureWidth
Maximum picture width. Read-only.
Definition: va.h:752
VAIQMatrixBufferMPEG2
Definition: va.h:3077
vaDestroySubpicture
VAStatus vaDestroySubpicture(VADisplay dpy, VASubpictureID subpicture)
VASliceParameterBufferH264
Definition: va.h:3559
vaCreateContext
VAStatus vaCreateContext(VADisplay dpy, VAConfigID config_id, int picture_width, int picture_height, int flag, VASurfaceID *render_targets, int num_render_targets, VAContextID *context)
VASliceParameterBufferMPEG4
Definition: va.h:3243
VAGenericValue::p
void * p
Generic pointer.
Definition: va.h:1630
vaCreateBuffer2
VAStatus vaCreateBuffer2(VADisplay dpy, VAContextID context, VABufferType type, unsigned int width, unsigned int height, unsigned int *unit_size, unsigned int *pitch, VABufferID *buf_id)
VAConfigAttribEncInterlaced
Interlaced mode. Read/write.
Definition: va.h:698
vaMFAddContext
VAStatus vaMFAddContext(VADisplay dpy, VAMFContextID mf_context, VAContextID context)
vaMaxNumEntrypoints
int vaMaxNumEntrypoints(VADisplay dpy)
VAGenericValueTypePointer
Definition: va.h:1612
VAConfigAttribDecProcessing
Decode processing support. Read/write.
Definition: va.h:676
VAEncryptionSegmentInfo
structure for encrypted segment info.
Definition: va.h:2155
vaSetErrorCallback
VAMessageCallback vaSetErrorCallback(VADisplay dpy, VAMessageCallback callback, void *user_context)
VAConfigAttribValEncROI::roi_rc_priority_support
uint32_t roi_rc_priority_support
A flag indicates whether ROI priority is supported.
Definition: va.h:1333
va_enc_hevc.h
The HEVC encoding API.
VAEncMiscParameterEncQuality::HMEDisable
uint32_t HMEDisable
Definition: va.h:2910
va_dec_av1.h
The AV1 decoding API.
va_deprecated_enum
#define va_deprecated_enum
Misc packed header. See codec-specific definitions.
Definition: va.h:98
VASubpictureID
VAGenericID VASubpictureID
Definition: va.h:4764
VAEncPackedHeaderParameterBuffer::bit_length
uint32_t bit_length
Size of the #VAEncPackedHeaderDataBuffer in bits.
Definition: va.h:2354
VAEncMiscParameterBufferMultiPassFrameSize::num_passes
uint8_t num_passes
number of passes, every pass has different QP, currently AVC encoder can support up to 4 passes
Definition: va.h:2686
VAConfigAttribValEncPerBlockControl::reserved
uint32_t reserved
reserved bit for future, must be zero
Definition: va.h:1429
VAConfigAttribDecJPEG
JPEG decoding attribute. Read-only.
Definition: va.h:643
VAProcessingRateParameterDec::level_idc
uint8_t level_idc
Profile level.
Definition: va.h:2243
VAEncMiscParameterBufferMaxFrameSize::max_frame_size
uint32_t max_frame_size
Maximum size of a frame (in bits).
Definition: va.h:2662
VAEncMiscParameterSkipFrame
Encoding skip frame.
Definition: va.h:2749
VAConfigAttribFEIFunctionType
Encode function type for FEI.
Definition: va.h:878
VASurfaceAttribPixelFormat
Pixel format as a FOURCC (int, read/write).
Definition: va.h:1658
vaSetDriverName
VAStatus vaSetDriverName(VADisplay dpy, char *driver_name)
VASurfaceAttribExternalBuffers
VASurfaceAttribExternalBuffers structure for the VASurfaceAttribExternalBufferDescriptor attribute.
Definition: va.h:1719
VAEncROI::roi_value
int8_t roi_value
ROI value.
Definition: va.h:2799
VAContextParameterUpdateBuffer::context_priority_update
uint32_t context_priority_update
indicate whether context priority changed
Definition: va.h:2125
vaSyncBuffer
VAStatus vaSyncBuffer(VADisplay dpy, VABufferID buf_id, uint64_t timeout_ns)
Synchronizes pending operations associated with the supplied buffer.
vaGetImage
VAStatus vaGetImage(VADisplay dpy, VASurfaceID surface, int x, int y, unsigned int width, unsigned int height, VAImageID image)
vaSetSubpictureChromakey
VAStatus vaSetSubpictureChromakey(VADisplay dpy, VASubpictureID subpicture, unsigned int chromakey_min, unsigned int chromakey_max, unsigned int chromakey_mask)
VAEncMiscParameterTemporalLayerStructure::periodicity
uint32_t periodicity
The length of the array defining frame layer membership. Should be 1-32.
Definition: va.h:2389
VAConfigAttribMultipleFrame
combined submission of multiple frames from different streams, it is optimization for different HW im...
Definition: va.h:935
vaSyncSurface
VAStatus vaSyncSurface(VADisplay dpy, VASurfaceID render_target)
vaSetInfoCallback
VAMessageCallback vaSetInfoCallback(VADisplay dpy, VAMessageCallback callback, void *user_context)
vaRenderPicture
VAStatus vaRenderPicture(VADisplay dpy, VAContextID context, VABufferID *buffers, int num_buffers)
VAEncMiscParameterParallelRateControl::num_layers
uint32_t num_layers
Definition: va.h:2860
VAEncMiscParameterTemporalLayerStructure::number_of_layers
uint32_t number_of_layers
The number of temporal layers.
Definition: va.h:2387
VAEncryptionParameters::size_of_length
uint32_t size_of_length
CENC counter length.
Definition: va.h:2189
vaPutImage
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)
VAGenericValueTypeFunc
Definition: va.h:1613
VAHuffmanTableBufferJPEGBaseline
Huffman table for JPEG decoding.
Definition: va.h:3010
VAMvModeVC1
VAMvModeVC1
Definition: va.h:3259
vaGetConfigAttributes
VAStatus vaGetConfigAttributes(VADisplay dpy, VAProfile profile, VAEntrypoint entrypoint, VAConfigAttrib *attrib_list, int num_attribs)
VA_PADDING_LOW
#define VA_PADDING_LOW
Definition: va.h:359
VAMotionVector
Generic motion vector data structure.
Definition: va.h:413
VAEncMiscParameterRateControl::mb_rate_control
uint32_t mb_rate_control
Definition: va.h:2454
VAProcPipelineParameterBufferType
Video processing pipeline parameter buffer.
Definition: va.h:2021
VAEncMiscParameterCustomRoundingControl::enable_custom_rouding_intra
uint32_t enable_custom_rouding_intra
Enable customized rounding offset for intra blocks. If 0, default value would be taken by driver for ...
Definition: va.h:2951
VAEntrypointVideoProc
Definition: va.h:564
vaCreateSubpicture
VAStatus vaCreateSubpicture(VADisplay dpy, VAImageID image, VASubpictureID *subpicture)
VAPictureParameterBufferVC1
Definition: va.h:3281
VAEncMiscParameterRateControl::ICQ_quality_factor
uint32_t ICQ_quality_factor
Definition: va.h:2490
VAIQMatrixBufferMPEG4
Definition: va.h:3228
VABufferType
VABufferType
Definition: va.h:1979
va_fei_h264.h
The FEI encoding H264 special API.
va_enc_mpeg2.h
The MPEG-2 encoding API.
VAEncQPBufferType
Encoding QP buffer.
Definition: va.h:2013
VABufferID
VAGenericID VABufferID
Definition: va.h:1977
vaCreateBuffer
VAStatus vaCreateBuffer(VADisplay dpy, VAContextID context, VABufferType type, unsigned int size, unsigned int num_elements, void *data, VABufferID *buf_id)
VAConfigAttribValEncPerBlockControl
Definition: va.h:1420
VAContextParameterUpdateBuffer::context_priority
VAConfigAttribValContextPriority context_priority
task/context priority
Definition: va.h:2132
va_enc_vp8.h
VP8 encoding API.
VAConfigAttribValMultipleFrame::reserved
uint32_t reserved
reserved bit for future, must be zero
Definition: va.h:1402
VAEncMiscParameterBufferMultiPassFrameSize::delta_qp
uint8_t * delta_qp
delta QP list for every pass
Definition: va.h:2688
VAEncPackedHeaderParameterBuffer::has_emulation_bytes
uint8_t has_emulation_bytes
Flag: buffer contains start code emulation prevention bytes?
Definition: va.h:2356
VAEncMiscParameterEncQuality::PanicModeDisable
uint32_t PanicModeDisable
Definition: va.h:2918
vaCreateMFContext
VAStatus vaCreateMFContext(VADisplay dpy, VAMFContextID *mf_context)
VAConfigAttribProtectedContentCipherSampleType
Decryption sample type of the protected content session.
Definition: va.h:979
VAProcessingRateParameterDec
Definition: va.h:2241
vaMaxNumProfiles
int vaMaxNumProfiles(VADisplay dpy)
VASurfaceAttribDRMFormatModifiers
List of possible DRM format modifiers (pointer, write).
Definition: va.h:1685
va_enc_vp9.h
VP9 encoding API.
VAEncMiscParameterTypeRIR
Buffer type used for Rolling intra refresh.
Definition: va.h:2294
VAEncryptionParameters::blocks_stripe_encrypted
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:2209
VASubsetsParameterBufferType
HEVC Decoding Subset Parameter buffer type.
Definition: va.h:2081
vaAssociateSubpicture
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)
VAConfigAttribValEncROI::roi_rc_qp_delta_support
uint32_t roi_rc_qp_delta_support
A flag indicates whether ROI delta QP is supported.
Definition: va.h:1345
VAConfigAttribEncPackedHeaders
Packed headers mode. Read/write.
Definition: va.h:689
VAEncMiscParameterBufferMultiPassFrameSize::max_frame_size
uint32_t max_frame_size
Maximum size of a frame (in byte)
Definition: va.h:2682
VAEntrypointProtectedContent
VAEntrypointProtectedContent.
Definition: va.h:610
VAContextParameterUpdateBuffer
update the context parameter this structure is used to update context parameters, such as priority of...
Definition: va.h:2121
VAConfigAttribEncPerBlockControl
Settings per block attribute for Encoding. Read-only.
Definition: va.h:1038
VAEncMiscParameterTypeQuantization
Buffer type used for quantization parameters, it's per-sequence parameter.
Definition: va.h:2296
VAEncMiscParameterEncQuality::skipCheckDisable
uint32_t skipCheckDisable
Definition: va.h:2879
VAConfigAttribTEETypeClient
TEE type client is a specific module supporting specific functions in TEE. Read-only.
Definition: va.h:951
VAEncMiscParameterEncQuality::globalMotionBiasAdjustmentEnable
uint32_t globalMotionBiasAdjustmentEnable
Definition: va.h:2901
VAConfigAttribValMaxFrameSize::reserved
uint32_t reserved
reserved bits for future, must be zero
Definition: va.h:1249
VAEncMiscParameterTypeHRD
Buffer type used for HRD parameters.
Definition: va.h:2291
VASurfaceAttribExternalBuffers::flags
uint32_t flags
flags. See "Surface external buffer descriptor flags".
Definition: va.h:1739
VAEncMiscParameterEncQuality::useRawPicForRef
uint32_t useRawPicForRef
Definition: va.h:2876
VAEncMiscParameterType
VAEncMiscParameterType
Definition: va.h:2283
VAEncMiscParameterParallelRateControl
Attribute value for VAConfigAttribEncParallelRateControl.
Definition: va.h:2858
VAEncMiscParameterTypeSubMbPartPel
Set MB partion mode mask and Half-pel/Quant-pel motion search.
Definition: va.h:2311
va_fei.h
The FEI encoding common API.
vaSetSubpictureImage
VAStatus vaSetSubpictureImage(VADisplay dpy, VASubpictureID subpicture, VAImageID image)
va_enc_jpeg.h
JPEG encoding API.
vaBufferSetNumElements
VAStatus vaBufferSetNumElements(VADisplay dpy, VABufferID buf_id, unsigned int num_elements)
va_dec_vp9.h
The VP9 decoding API.
VAEncMiscParameterTypeCustomRoundingControl
Buffer type used for encoder rounding offset parameters.
Definition: va.h:2315
VASurfaceAttribExternalBuffers::num_planes
uint32_t num_planes
number of planes for planar layout
Definition: va.h:1729
VAEncMiscParameterBufferMultiPassFrameSize
Maximum frame size (in bytes) settings for multiple pass.
Definition: va.h:2677
VAProcessingRateParameterEnc::quality_level
uint32_t quality_level
quality level. When set to 0, default quality level is used.
Definition: va.h:2231
VAProfile
VAProfile
Definition: va.h:501
vaDeassociateSubpicture
VAStatus vaDeassociateSubpicture(VADisplay dpy, VASubpictureID subpicture, VASurfaceID *target_surfaces, int num_surfaces)
VAConfigAttribValEncPerBlockControl::delta_qp_support
uint32_t delta_qp_support
whether to support dela qp per block
Definition: va.h:1423
VAEncMiscParameterCustomRoundingControl::enable_custom_rounding_inter
uint32_t enable_custom_rounding_inter
Enable customized rounding offset for inter blocks. If 0, default value would be taken by driver for ...
Definition: va.h:2962
vaMaxNumSubpictureFormats
int vaMaxNumSubpictureFormats(VADisplay dpy)
va_dec_vp8.h
VP8 decoding API.
VAEncFEICURecordBufferType
HEVC FEI CU level data buffer it's CTB level information for future usage.
Definition: va.h:2066
VAConfigAttribEncSkipFrame
Encoding skip frame attribute. Read-only.
Definition: va.h:799
VAConfigAttribEncQualityRange
Encoding quality range attribute. Read-only.
Definition: va.h:776
VAConfigAttribValEncROI::num_roi_regions
uint32_t num_roi_regions
The number of ROI regions supported, 0 if ROI is not supported.
Definition: va.h:1321
vaMFReleaseContext
VAStatus vaMFReleaseContext(VADisplay dpy, VAMFContextID mf_context, VAContextID context)
VADisplayAttribType
VADisplayAttribType
Definition: va.h:4993
VASurfaceAttribType
VASurfaceAttribType
Surface attribute types.
Definition: va.h:1647
VAEncMiscParameterCustomRoundingControl::rounding_offset_intra
uint32_t rounding_offset_intra
Intra rounding offset Ignored if enable_custom_rouding_intra equals 0.
Definition: va.h:2956
VAEncMiscParameterHRD::buffer_size
uint32_t buffer_size
Definition: va.h:2642
VAEncMiscParameterRateControl::quality_factor
uint32_t quality_factor
Definition: va.h:2501
VAEncMiscParameterTypeMultiPassFrameSize
Buffer type used to express a maximum frame size (in bytes) settings for multiple pass.
Definition: va.h:2303
VAConfigAttribValEncJPEG::progressive_dct_mode
uint32_t progressive_dct_mode
set to 1 for progressive dct.
Definition: va.h:1260
VAEncMiscParameterFrameRate::framerate
uint32_t framerate
Definition: va.h:2541
vaSetDisplayAttributes
VAStatus vaSetDisplayAttributes(VADisplay dpy, VADisplayAttribute *attr_list, int num_attributes)
vaErrorStr
const char * vaErrorStr(VAStatus error_status)
VAEncMiscParameterRateControl::cfs_I_frames
uint32_t cfs_I_frames
Definition: va.h:2458
VASurfaceAttribExternalBuffers::data_size
uint32_t data_size
total size of the buffer in bytes.
Definition: va.h:1727
vaMapBuffer
VAStatus vaMapBuffer(VADisplay dpy, VABufferID buf_id, void **pbuf)
VAConfigAttribValEncPerBlockControl::delta_qp_size_in_bytes
uint32_t delta_qp_size_in_bytes
size of delta qp per block in bytes
Definition: va.h:1427
VAContextParameterUpdateBuffer::reserved
uint32_t reserved
Reserved bits for future use, must be zero.
Definition: va.h:2127
VASurfaceAttrib::type
VASurfaceAttribType type
Type.
Definition: va.h:1693
VAConfigAttribValEncJPEG
Attribute value for VAConfigAttribEncJPEG.
Definition: va.h:1255
VAEncryptionSegmentInfo::segment_length
uint32_t segment_length
The length of the segments in bytes.
Definition: va.h:2160
VAConfigAttribStats
Statistics attribute. Read-only.
Definition: va.h:894
vaQueryConfigProfiles
VAStatus vaQueryConfigProfiles(VADisplay dpy, VAProfile *profile_list, int *num_profiles)
VAEncMiscParameterTypeFEIFrameControl
Buffer type used for FEI input frame level parameters.
Definition: va.h:2317
VAEntrypoint
VAEntrypoint
Definition: va.h:547
VAMacroblockParameterBufferMPEG2
Definition: va.h:3115
VAProfileProtected
Profile ID used for protected video playback.
Definition: va.h:540
VAGenericValue::f
float f
32-bit float.
Definition: va.h:1628
VAConfigAttribQPBlockSize
Encoding QP info block size attribute. Read-only. This attribute conveys the block sizes that underly...
Definition: va.h:914
VAConfigAttribEncDirtyRect
Encoding dirty rectangle. Read-only.
Definition: va.h:843
VASurfaceAttribMemoryType
Surface memory type expressed in bit fields (int, read/write).
Definition: va.h:1668
VAConfigAttribEncHEVCBlockSizes
HEVC/H.265 encoding block sizes. Read-only.
Definition: va.h:1007
VAConfigAttribContextPriority
priority setting for the context. Read-Write attribute value is VAConfigAttribValContextPriority this...
Definition: va.h:940
VASliceParameterBufferVC1
Definition: va.h:3453
VAEncMiscParameterRateControl::disable_frame_skip
uint32_t disable_frame_skip
Definition: va.h:2444
vaGetDisplayAttributes
VAStatus vaGetDisplayAttributes(VADisplay dpy, VADisplayAttribute *attr_list, int num_attributes)
VAConfigAttribProtectedContentUsage
Special usage attribute of the protected session.
Definition: va.h:986
VAEncMiscParameterTypeEncQuality
set encode quality tuning
Definition: va.h:2313
VASurfaceAttrib::value
VAGenericValue value
Value. See "Surface attribute types" for the expected types.
Definition: va.h:1697
VASurfaceAttribExternalBufferDescriptor
External buffer descriptor (pointer, write).
Definition: va.h:1675
VAConfigAttribProtectedContentCipherMode
Cipher mode of the protected content session.
Definition: va.h:972
VAPictureParameterBufferMPEG4
Definition: va.h:3177
VAConfigAttribValMultipleFrame::mixed_quality_level
uint32_t mixed_quality_level
indicate whether all stream must support same quality level if mixed_quality_level == 0,...
Definition: va.h:1400
VAEncMiscParameterEncQuality::FTQSkipThresholdLUTInput
uint32_t FTQSkipThresholdLUTInput
Definition: va.h:2887
vaQueryProcessingRate
VAStatus vaQueryProcessingRate(VADisplay dpy, VAConfigID config, VAProcessingRateParameter *proc_buf, unsigned int *processing_rate)
Queries processing rate for the supplied config.
VABufferInfo
VA buffer information.
Definition: va.h:3899
VAConfigAttribValEncJPEG::arithmatic_coding_mode
uint32_t arithmatic_coding_mode
set to 1 for arithmatic coding.
Definition: va.h:1258
vaQueryDisplayAttributes
VAStatus vaQueryDisplayAttributes(VADisplay dpy, VADisplayAttribute *attr_list, int *num_attributes)
VAConfigAttribEncRateControlExt
Encoding extended rate control attribute. Read-only.
Definition: va.h:818
vaCopy
VAStatus vaCopy(VADisplay dpy, VACopyObject *dst, VACopyObject *src, VACopyOption option)
Copies an object.
vaMaxNumConfigAttributes
int vaMaxNumConfigAttributes(VADisplay dpy)
VAConfigAttribEncSliceStructure
Slice structure. Read-only.
Definition: va.h:733
vaDestroyConfig
VAStatus vaDestroyConfig(VADisplay dpy, VAConfigID config_id)
VAEncMiscParameterQuantization
Quantization settings for encoding.
Definition: va.h:2721
vaDestroyImage
VAStatus vaDestroyImage(VADisplay dpy, VAImageID image)
VAEncMiscParameterTypeMaxFrameSize
Buffer type used to express a maximum frame size (in bits).
Definition: va.h:2289
VAConfigAttribEncQuantization
Encoding quantization attribute. Read-only.
Definition: va.h:783
VAConfigAttribEncAV1Ext2
AV1 encoding attribute extend2. Read-only.
Definition: va.h:1031
VASurfaceAttribExternalBuffers::num_buffers
uint32_t num_buffers
number of elements in the "buffers" array
Definition: va.h:1737
VAPictureHEVC
Description of picture properties of those in DPB surfaces.
Definition: va.h:5149
VAGenericValue
Generic value.
Definition: va.h:1620
VAConfigAttrib
Definition: va.h:1049
VAEncPackedHeaderSlice
Packed slice header.
Definition: va.h:2329
VAEncFEICTBCmdBufferType
HEVC FEI CTB level cmd buffer it is CTB level information for future usage.
Definition: va.h:2061
VAConfigAttribCustomRoundingControl
whether accept rouding setting from application. Read-only. This attribute is for encode quality,...
Definition: va.h:908
VAConfigAttribMaxFrameSize
encode max frame size attribute. Read-only attribute value VAConfigAttribValMaxFrameSize represent ma...
Definition: va.h:919
VASurfaceAttrib::flags
uint32_t flags
Flags. See "Surface attribute flags".
Definition: va.h:1695
VAEncMiscParameterTypeParallelBRC
Buffer type used for parallel BRC parameters.
Definition: va.h:2309
VAProcessingRateParameterEnc::level_idc
uint8_t level_idc
Profile level.
Definition: va.h:2226
VAConfigAttribValContextPriority::priority
uint32_t priority
the priority , for the Query operation (read) it represents highest priority for the set operation (w...
Definition: va.h:1412
VAEncMiscParameterParallelRateControl::num_b_in_gop
uint32_t * num_b_in_gop
Definition: va.h:2865
VAEncSliceParameterBuffer
Encode Slice Parameter Buffer.
Definition: va.h:3633
VAEncMiscParameterTemporalLayerStructure
Temporal layer Structure.
Definition: va.h:2385
VAEncryptionParameters::segment_info
VAEncryptionSegmentInfo * segment_info
Pointer of segments.
Definition: va.h:2183
VAConfigAttribProtectedContentCipherBlockSize
Cipher block size of the protected content session.
Definition: va.h:965
VAProtectedSessionExecuteBufferType
Protected session execution buffer type.
Definition: va.h:2094
VAMessageCallback
void(* VAMessageCallback)(void *user_context, const char *message)
Definition: va.h:429
VAContextID
VAGenericID VAContextID
Definition: va.h:1601
VAProfileNone
Profile ID used for video processing.
Definition: va.h:503
VAEncMiscParameterBufferQualityLevel::quality_level
uint32_t quality_level
Encoding quality level setting. When set to 0, default quality level is used.
Definition: va.h:2709
VAEncMiscParameterTypeTemporalLayerStructure
Buffer type used for temporal layer structure.
Definition: va.h:2305
VADecodeStreamoutBufferType
Definition: va.h:2069
VAConfigAttribEncTileSupport
Tile Support Attribute. Read-only.
Definition: va.h:902
vaExportSurfaceHandle
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.
vaQuerySurfaceError
VAStatus vaQuerySurfaceError(VADisplay dpy, VASurfaceID surface, VAStatus error_status, void **error_info)
VAEncMiscParameterRateControl::window_size
uint32_t window_size
Definition: va.h:2418
VAEncMiscParameterEncQuality::HMEMVCostScalingFactor
uint32_t HMEMVCostScalingFactor
Definition: va.h:2908
VAEncryptionParameters::key_blob_size
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:2200
VAConfigAttribType
VAConfigAttribType
Definition: va.h:614
VAEncMiscParameterBufferQualityLevel
Encoding quality level.
Definition: va.h:2705
VAEncMiscParameterSkipFrame::skip_frame_flag
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:2756
VAConfigAttribFrameSizeToleranceSupport
frame size tolerance support it indicates the tolerance of frame size
Definition: va.h:869
VAGenericValue::i
int32_t i
32-bit signed integer.
Definition: va.h:1626
VAConfigAttribValMultipleFrame
Attribute value for VAConfigAttribMultipleFrame.
Definition: va.h:1393
vaTerminate
VAStatus vaTerminate(VADisplay dpy)
vaDestroyContext
VAStatus vaDestroyContext(VADisplay dpy, VAContextID context)
VAEncMiscParameterRateControl::disable_bit_stuffing
uint32_t disable_bit_stuffing
Definition: va.h:2446
VAEncMiscParameterHRD::initial_buffer_fullness
uint32_t initial_buffer_fullness
Definition: va.h:2636
VAEncMiscParameterRateControl::bits_per_second
uint32_t bits_per_second
Definition: va.h:2406
va_enc_h264.h
The H.264 encoding API.
VAEntrypointStats
VAEntrypointStats.
Definition: va.h:598
vaMFSubmit
VAStatus vaMFSubmit(VADisplay dpy, VAMFContextID mf_context, VAContextID *contexts, int num_contexts)
VANativeDisplay
void * VANativeDisplay
Definition: va.h:450
vaQuerySubpictureFormats
VAStatus vaQuerySubpictureFormats(VADisplay dpy, VAImageFormat *format_list, unsigned int *flags, unsigned int *num_formats)
vaQuerySurfaceStatus
VAStatus vaQuerySurfaceStatus(VADisplay dpy, VASurfaceID render_target, VASurfaceStatus *status)
VADisplayAttribValSubDevice
sub device info Sub-device is the concept basing on the "device" behind "vaDisplay"....
Definition: va.h:4964
VAGenericID
unsigned int VAGenericID
Definition: va.h:1538
VAConfigAttribMaxPictureHeight
Maximum picture height. Read-only.
Definition: va.h:759
VAEncMiscParameterMaxSliceSize
Definition: va.h:2561
VAConfigAttribEncMaxSlices
Maximum number of slices per frame. Read-only.
Definition: va.h:716
VAEncPackedHeaderParameterBuffer
Packed header parameter.
Definition: va.h:2350
VAEncMiscParameterRateControl
Rate control parameters.
Definition: va.h:2404
VASurfaceAttrib
Surface attribute.
Definition: va.h:1691
VAEncMiscParameterEncQuality::SuperHMEDisable
uint32_t SuperHMEDisable
Definition: va.h:2912
VAProcFilterParameterBufferType
Video filter parameter buffer.
Definition: va.h:2034
vaQueryConfigAttributes
VAStatus vaQueryConfigAttributes(VADisplay dpy, VAConfigID config_id, VAProfile *profile, VAEntrypoint *entrypoint, VAConfigAttrib *attrib_list, int *num_attribs)
VACodedBufferSegment
Coded buffer segment.
Definition: va.h:3837
vaDestroyBuffer
VAStatus vaDestroyBuffer(VADisplay dpy, VABufferID buffer_id)
VAProcessingRateParameterEnc::ip_period
uint32_t ip_period
Period between I/P frames.
Definition: va.h:2235
VAEncPackedHeaderType
VAEncPackedHeaderType
Packed header type.
Definition: va.h:2323
vaQueryConfigEntrypoints
VAStatus vaQueryConfigEntrypoints(VADisplay dpy, VAProfile profile, VAEntrypoint *entrypoint_list, int *num_entrypoints)
VADisplayAttribBLEMode
VADisplayAttribBLEMode
Definition: va.h:4904
vaGetLibFunc
VAPrivFunc vaGetLibFunc(VADisplay dpy, const char *func)
VAEncMacroblockDisableSkipMapBufferType
Definition: va.h:2056
VAConfigAttribEncJPEG
JPEG encoding attribute. Read-only.
Definition: va.h:767
VAEncMiscParameterCustomRoundingControl::rounding_offset_inter
uint32_t rounding_offset_inter
Inter rounding offset Ignored if enable_custom_rouding_inter equals 0.
Definition: va.h:2967
VAConfigAttribDecAV1Features
AV1 decoding features. Read-only.
Definition: va.h:947
VAConfigAttribEncHEVCFeatures
HEVC/H.265 encoding features. Read-only.
Definition: va.h:997
vaCreateSurfaces
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.
VASurfaceDecodeMBErrors
Definition: va.h:4207
VAEncryptionSegmentInfo::partial_aes_block_size
uint32_t partial_aes_block_size
The length in bytes of the remainder of an incomplete block from a previous segment.
Definition: va.h:2163
VAEncMiscParameterRateControl::max_qp
uint32_t max_qp
Definition: va.h:2496
vaMaxNumImageFormats
int vaMaxNumImageFormats(VADisplay dpy)
VAConfigAttribEncAV1
AV1 encoding attribute. Read-only.
Definition: va.h:1015
VAGenericValue::type
VAGenericValueType type
Value type. See VAGenericValueType.
Definition: va.h:1622
VAEncryptionSegmentInfo::segment_start_offset
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:2158
VASurfaceAttribExternalBuffers::pixel_format
uint32_t pixel_format
pixel format in fourcc.
Definition: va.h:1721
VASurfaceAttribMinHeight
Minimal height in pixels (int, read-only).
Definition: va.h:1664
VAEncryptionParameters::encryption_type
uint32_t encryption_type
Encryption type, refer to VA_ENCRYPTION_TYPE_FULLSAMPLE_CTR, VA_ENCRYPTION_TYPE_FULLSAMPLE_CBC,...
Definition: va.h:2179
VAConfigAttribTEEType
TEE could be any HW secure device. Read-only.
Definition: va.h:949
VAEncryptionParameters
Encryption parameters buffer for VAEncryptionParameterBufferType.
Definition: va.h:2175
VAEncPackedHeaderRawData
Packed raw header.
Definition: va.h:2338
VAEncROI::roi_rectangle
VARectangle roi_rectangle
Defines the ROI boundary in pixels, the driver will map it to appropriate codec coding units....
Definition: va.h:2780
VAEncMiscParameterRateControl::reset
uint32_t reset
Definition: va.h:2442
VAConfigAttribEncROI
Encoding region-of-interest (ROI) attribute. Read-only.
Definition: va.h:810
VAConfigAttribEncParallelRateControl
Parallel Rate Control (hierachical B) attribute. Read-only.
Definition: va.h:855
VAEncMiscParameterRateControl::reserved
uint32_t reserved
Definition: va.h:2481
VAConfigAttribPredictionDirection
inter frame prediction directrion attribute. Read-only. this attribute conveys the prediction directi...
Definition: va.h:931
VAEncMiscParameterRateControl::basic_unit_size
uint32_t basic_unit_size
Definition: va.h:2434
vaInitialize
VAStatus vaInitialize(VADisplay dpy, int *major_version, int *minor_version)
VAEncMiscParameterEncQuality::UltraHMEDisable
uint32_t UltraHMEDisable
Definition: va.h:2914
VAConfigAttribFEIMVPredictors
Maximum number of FEI MV predictors. Read-only.
Definition: va.h:886
vaReleaseBufferHandle
VAStatus vaReleaseBufferHandle(VADisplay dpy, VABufferID buf_id)
Releases buffer after usage from external API.
VAEncryptionParameters::num_segments
uint32_t num_segments
The number of sengments.
Definition: va.h:2181
VAConfigAttribProcessingRate
Processing rate reporting attribute. Read-only.
Definition: va.h:829
VAConfigAttribValMaxFrameSize::max_frame_size
uint32_t max_frame_size
support max frame size if max_frame_size == 1, VAEncMiscParameterTypeMaxFrameSize/VAEncMiscParameterB...
Definition: va.h:1245
vaSyncSurface2
VAStatus vaSyncSurface2(VADisplay dpy, VASurfaceID surface, uint64_t timeout_ns)
Synchronizes pending operations associated with the supplied surface.
VADisplay
void * VADisplay
Definition: va.h:259
VAConfigAttribProtectedContentCipherAlgorithm
Cipher algorithm of the protected content session.
Definition: va.h:958
VAConfigAttribValContextPriority
Definition: va.h:1408
VASurfaceAttribExternalBuffers::width
uint32_t width
width in pixels.
Definition: va.h:1723
VARectangle
Structure to describe rectangle.
Definition: va.h:405
vaCreateConfig
VAStatus vaCreateConfig(VADisplay dpy, VAProfile profile, VAEntrypoint entrypoint, VAConfigAttrib *attrib_list, int num_attribs, VAConfigID *config_id)
VAEncryptionParameters::blocks_stripe_clear
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:2216
VASurfaceAttribExternalBuffers::height
uint32_t height
height in pixels.
Definition: va.h:1725
VAEncMiscParameterTypeDirtyRect
Buffer type used for dirty region-of-interest (ROI) parameters.
Definition: va.h:2307
va_prot.h
Protected content API.
VAProcessingRateParameterEnc::intra_period
uint32_t intra_period
Period between I frames.
Definition: va.h:2233
VAGenericFunc
void(* VAGenericFunc)(void)
Generic function type.
Definition: va.h:1617
VAEncPackedHeaderSequence
Packed sequence header.
Definition: va.h:2325
VAEncryptionParameters::status_report_index
uint32_t status_report_index
The status report index reserved for CENC fullsample workload. The related structures and definitions...
Definition: va.h:2187
vaDeriveImage
VAStatus vaDeriveImage(VADisplay dpy, VASurfaceID surface, VAImage *image)
vaMaxNumDisplayAttributes
int vaMaxNumDisplayAttributes(VADisplay dpy)
va_fei_hevc.h
The FEI encoding HEVC special API.