VA-API  2.23.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 
260 typedef void* VADisplay; /* window system dependent */
261 
262 typedef int VAStatus;
264 #define VA_STATUS_SUCCESS 0x00000000
265 #define VA_STATUS_ERROR_OPERATION_FAILED 0x00000001
266 #define VA_STATUS_ERROR_ALLOCATION_FAILED 0x00000002
267 #define VA_STATUS_ERROR_INVALID_DISPLAY 0x00000003
268 #define VA_STATUS_ERROR_INVALID_CONFIG 0x00000004
269 #define VA_STATUS_ERROR_INVALID_CONTEXT 0x00000005
270 #define VA_STATUS_ERROR_INVALID_SURFACE 0x00000006
271 #define VA_STATUS_ERROR_INVALID_BUFFER 0x00000007
272 #define VA_STATUS_ERROR_INVALID_IMAGE 0x00000008
273 #define VA_STATUS_ERROR_INVALID_SUBPICTURE 0x00000009
274 #define VA_STATUS_ERROR_ATTR_NOT_SUPPORTED 0x0000000a
275 #define VA_STATUS_ERROR_MAX_NUM_EXCEEDED 0x0000000b
276 #define VA_STATUS_ERROR_UNSUPPORTED_PROFILE 0x0000000c
277 #define VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT 0x0000000d
278 #define VA_STATUS_ERROR_UNSUPPORTED_RT_FORMAT 0x0000000e
279 #define VA_STATUS_ERROR_UNSUPPORTED_BUFFERTYPE 0x0000000f
280 #define VA_STATUS_ERROR_SURFACE_BUSY 0x00000010
281 #define VA_STATUS_ERROR_FLAG_NOT_SUPPORTED 0x00000011
282 #define VA_STATUS_ERROR_INVALID_PARAMETER 0x00000012
283 #define VA_STATUS_ERROR_RESOLUTION_NOT_SUPPORTED 0x00000013
284 #define VA_STATUS_ERROR_UNIMPLEMENTED 0x00000014
285 #define VA_STATUS_ERROR_SURFACE_IN_DISPLAYING 0x00000015
286 #define VA_STATUS_ERROR_INVALID_IMAGE_FORMAT 0x00000016
287 #define VA_STATUS_ERROR_DECODING_ERROR 0x00000017
288 #define VA_STATUS_ERROR_ENCODING_ERROR 0x00000018
296 #define VA_STATUS_ERROR_INVALID_VALUE 0x00000019
298 #define VA_STATUS_ERROR_UNSUPPORTED_FILTER 0x00000020
300 #define VA_STATUS_ERROR_INVALID_FILTER_CHAIN 0x00000021
302 #define VA_STATUS_ERROR_HW_BUSY 0x00000022
304 #define VA_STATUS_ERROR_UNSUPPORTED_MEMORY_TYPE 0x00000024
306 #define VA_STATUS_ERROR_NOT_ENOUGH_BUFFER 0x00000025
308 #define VA_STATUS_ERROR_TIMEDOUT 0x00000026
309 #define VA_STATUS_ERROR_UNKNOWN 0xFFFFFFFF
310 
318 #define VA_FRAME_PICTURE 0x00000000
319 #define VA_TOP_FIELD 0x00000001
320 #define VA_BOTTOM_FIELD 0x00000002
321 #define VA_TOP_FIELD_FIRST 0x00000004
322 #define VA_BOTTOM_FIELD_FIRST 0x00000008
323 
330 #define VA_ENABLE_BLEND 0x00000004 /* video area blend with the constant color */
331 
337 #define VA_CLEAR_DRAWABLE 0x00000008
338 
340 #define VA_SRC_COLOR_MASK 0x000000f0
341 #define VA_SRC_BT601 0x00000010
342 #define VA_SRC_BT709 0x00000020
343 #define VA_SRC_SMPTE_240 0x00000040
344 
346 #define VA_FILTER_SCALING_DEFAULT 0x00000000
347 #define VA_FILTER_SCALING_FAST 0x00000100
348 #define VA_FILTER_SCALING_HQ 0x00000200
349 #define VA_FILTER_SCALING_NL_ANAMORPHIC 0x00000300
350 #define VA_FILTER_SCALING_MASK 0x00000f00
351 
353 #define VA_FILTER_INTERPOLATION_DEFAULT 0x00000000
354 #define VA_FILTER_INTERPOLATION_NEAREST_NEIGHBOR 0x00001000
355 #define VA_FILTER_INTERPOLATION_BILINEAR 0x00002000
356 #define VA_FILTER_INTERPOLATION_ADVANCED 0x00003000
357 #define VA_FILTER_INTERPOLATION_MASK 0x0000f000
358 
360 #define VA_PADDING_LOW 4
361 #define VA_PADDING_MEDIUM 8
362 #define VA_PADDING_HIGH 16
363 #define VA_PADDING_LARGE 32
364 
367 #define VA_EXEC_SYNC 0x0
369 #define VA_EXEC_ASYNC 0x1
370 
372 #define VA_EXEC_MODE_DEFAULT 0x0
373 #define VA_EXEC_MODE_POWER_SAVING 0x1
374 #define VA_EXEC_MODE_PERFORMANCE 0x2
375 
376 /* Values used to describe device features. */
381 #define VA_FEATURE_NOT_SUPPORTED 0
391 #define VA_FEATURE_SUPPORTED 1
398 #define VA_FEATURE_REQUIRED 2
399 
403 const char *vaErrorStr(VAStatus error_status);
404 
406 typedef struct _VARectangle {
407  int16_t x;
408  int16_t y;
409  uint16_t width;
410  uint16_t height;
411 } VARectangle;
412 
414 typedef struct _VAMotionVector {
420  int16_t mv0[2];
426  int16_t mv1[2];
428 
430 typedef void (*VAMessageCallback)(void *user_context, const char *message);
431 
437 
443 
451 typedef void* VANativeDisplay; /* window system dependent */
452 
453 int vaDisplayIsValid(VADisplay dpy);
454 
459  char *driver_name
460  );
461 
465 VAStatus vaInitialize(
466  VADisplay dpy,
467  int *major_version, /* out */
468  int *minor_version /* out */
469 );
470 
474 VAStatus vaTerminate(
475  VADisplay dpy
476 );
477 
487  VADisplay dpy
488 );
489 
490 typedef int (*VAPrivFunc)(void);
491 
496 VAPrivFunc vaGetLibFunc(
497  VADisplay dpy,
498  const char *func
499 );
500 
502 typedef enum {
505  VAProfileMPEG2Simple = 0,
506  VAProfileMPEG2Main = 1,
507  VAProfileMPEG4Simple = 2,
508  VAProfileMPEG4AdvancedSimple = 3,
509  VAProfileMPEG4Main = 4,
510  VAProfileH264Baseline va_deprecated_enum = 5,
511  VAProfileH264Main = 6,
512  VAProfileH264High = 7,
513  VAProfileVC1Simple = 8,
514  VAProfileVC1Main = 9,
515  VAProfileVC1Advanced = 10,
516  VAProfileH263Baseline = 11,
517  VAProfileJPEGBaseline = 12,
518  VAProfileH264ConstrainedBaseline = 13,
519  VAProfileVP8Version0_3 = 14,
520  VAProfileH264MultiviewHigh = 15,
521  VAProfileH264StereoHigh = 16,
522  VAProfileHEVCMain = 17,
523  VAProfileHEVCMain10 = 18,
524  VAProfileVP9Profile0 = 19,
525  VAProfileVP9Profile1 = 20,
526  VAProfileVP9Profile2 = 21,
527  VAProfileVP9Profile3 = 22,
528  VAProfileHEVCMain12 = 23,
529  VAProfileHEVCMain422_10 = 24,
530  VAProfileHEVCMain422_12 = 25,
531  VAProfileHEVCMain444 = 26,
532  VAProfileHEVCMain444_10 = 27,
533  VAProfileHEVCMain444_12 = 28,
534  VAProfileHEVCSccMain = 29,
535  VAProfileHEVCSccMain10 = 30,
536  VAProfileHEVCSccMain444 = 31,
537  VAProfileAV1Profile0 = 32,
538  VAProfileAV1Profile1 = 33,
539  VAProfileHEVCSccMain444_10 = 34,
542  VAProfileH264High10 = 36,
543  VAProfileVVCMain10 = 37,
544  VAProfileVVCMultilayerMain10 = 38,
545  VAProfileAV1Profile2 = 39,
546  VAProfileH264High422 = 40
547 } VAProfile;
548 
552 typedef enum {
553  VAEntrypointVLD = 1,
554  VAEntrypointIZZ = 2,
555  VAEntrypointIDCT = 3,
556  VAEntrypointMoComp = 4,
557  VAEntrypointDeblocking = 5,
558  VAEntrypointEncSlice = 6, /* slice level encode */
559  VAEntrypointEncPicture = 7, /* pictuer encode, JPEG, etc */
560  /*
561  * For an implementation that supports a low power/high performance variant
562  * for slice level encode, it can choose to expose the
563  * VAEntrypointEncSliceLP entrypoint. Certain encoding tools may not be
564  * available with this entrypoint (e.g. interlace, MBAFF) and the
565  * application can query the encoding configuration attributes to find
566  * out more details if this entrypoint is supported.
567  */
568  VAEntrypointEncSliceLP = 8,
616 } VAEntrypoint;
617 
619 typedef enum {
620  VAConfigAttribRTFormat = 0,
621  VAConfigAttribSpatialResidual = 1,
622  VAConfigAttribSpatialClipping = 2,
623  VAConfigAttribIntraResidual = 3,
624  VAConfigAttribEncryption = 4,
625  VAConfigAttribRateControl = 5,
626 
992 
1067  VAConfigAttribTypeMax
1069 
1076 typedef struct _VAConfigAttrib {
1077  VAConfigAttribType type;
1078  uint32_t value; /* OR'd flags (bits) for this attribute */
1079 } VAConfigAttrib;
1080 
1081 /* Attribute values for VAConfigAttribRTFormat. */
1082 
1083 #define VA_RT_FORMAT_YUV420 0x00000001
1084 #define VA_RT_FORMAT_YUV422 0x00000002
1085 #define VA_RT_FORMAT_YUV444 0x00000004
1086 #define VA_RT_FORMAT_YUV411 0x00000008
1087 #define VA_RT_FORMAT_YUV400 0x00000010
1088 #define VA_RT_FORMAT_YUV420_10 0x00000100
1089 #define VA_RT_FORMAT_YUV422_10 0x00000200
1090 #define VA_RT_FORMAT_YUV444_10 0x00000400
1091 #define VA_RT_FORMAT_YUV420_12 0x00001000
1092 #define VA_RT_FORMAT_YUV422_12 0x00002000
1093 #define VA_RT_FORMAT_YUV444_12 0x00004000
1094 
1095 #define VA_RT_FORMAT_RGB16 0x00010000
1096 #define VA_RT_FORMAT_RGB32 0x00020000
1097 #define VA_RT_FORMAT_RGBP 0x00100000
1098 #define VA_RT_FORMAT_RGB32_10 0x00200000
1099 
1100 #define VA_RT_FORMAT_PROTECTED 0x80000000
1101 
1102 #define VA_RT_FORMAT_RGB32_10BPP VA_RT_FORMAT_RGB32_10
1103 #define VA_RT_FORMAT_YUV420_10BPP VA_RT_FORMAT_YUV420_10
1104 
1108 #define VA_RC_NONE 0x00000001
1110 #define VA_RC_CBR 0x00000002
1112 #define VA_RC_VBR 0x00000004
1114 #define VA_RC_VCM 0x00000008
1116 #define VA_RC_CQP 0x00000010
1118 #define VA_RC_VBR_CONSTRAINED 0x00000020
1121 #define VA_RC_ICQ 0x00000040
1124 #define VA_RC_MB 0x00000080
1126 #define VA_RC_CFS 0x00000100
1137 #define VA_RC_PARALLEL 0x00000200
1144 #define VA_RC_QVBR 0x00000400
1155 #define VA_RC_AVBR 0x00000800
1164 #define VA_RC_TCBRC 0x00001000
1165 
1171 #define VA_DEC_SLICE_MODE_NORMAL 0x00000001
1173 #define VA_DEC_SLICE_MODE_BASE 0x00000002
1174 
1177 typedef union _VAConfigAttribValDecJPEG {
1178  struct {
1180  uint32_t rotation : 4;
1182  uint32_t crop : 1;
1184  uint32_t reserved : 27;
1185  } bits;
1186  uint32_t value;
1187 } VAConfigAttribValDecJPEG;
1191 #define VA_DEC_PROCESSING_NONE 0x00000000
1193 #define VA_DEC_PROCESSING 0x00000001
1199 #define VA_ENC_PACKED_HEADER_NONE 0x00000000
1206 #define VA_ENC_PACKED_HEADER_SEQUENCE 0x00000001
1213 #define VA_ENC_PACKED_HEADER_PICTURE 0x00000002
1220 #define VA_ENC_PACKED_HEADER_SLICE 0x00000004
1229 #define VA_ENC_PACKED_HEADER_MISC 0x00000008
1231 #define VA_ENC_PACKED_HEADER_RAW_DATA 0x00000010
1237 #define VA_ENC_INTERLACED_NONE 0x00000000
1239 #define VA_ENC_INTERLACED_FRAME 0x00000001
1241 #define VA_ENC_INTERLACED_FIELD 0x00000002
1243 #define VA_ENC_INTERLACED_MBAFF 0x00000004
1245 #define VA_ENC_INTERLACED_PAFF 0x00000008
1251 #define VA_ENC_SLICE_STRUCTURE_POWER_OF_TWO_ROWS 0x00000001
1253 #define VA_ENC_SLICE_STRUCTURE_ARBITRARY_MACROBLOCKS 0x00000002
1255 #define VA_ENC_SLICE_STRUCTURE_EQUAL_ROWS 0x00000004
1257 #define VA_ENC_SLICE_STRUCTURE_MAX_SLICE_SIZE 0x00000008
1259 #define VA_ENC_SLICE_STRUCTURE_ARBITRARY_ROWS 0x00000010
1263 #define VA_ENC_SLICE_STRUCTURE_EQUAL_MULTI_ROWS 0x00000020
1267 typedef union _VAConfigAttribValMaxFrameSize {
1268  struct {
1274  uint32_t max_frame_size : 1;
1276  uint32_t multiple_pass : 1;
1278  uint32_t reserved : 30;
1279  } bits;
1280  uint32_t value;
1282 
1284 typedef union _VAConfigAttribValEncJPEG {
1285  struct {
1289  uint32_t progressive_dct_mode : 1;
1291  uint32_t non_interleaved_mode : 1;
1293  uint32_t differential_mode : 1;
1294  uint32_t max_num_components : 3;
1295  uint32_t max_num_scans : 4;
1296  uint32_t max_num_huffman_tables : 3;
1297  uint32_t max_num_quantization_tables : 3;
1298  } bits;
1299  uint32_t value;
1301 
1305 #define VA_ENC_QUANTIZATION_NONE 0x00000000
1307 #define VA_ENC_QUANTIZATION_TRELLIS_SUPPORTED 0x00000001
1318 #define VA_PREDICTION_DIRECTION_PREVIOUS 0x00000001
1320 #define VA_PREDICTION_DIRECTION_FUTURE 0x00000002
1322 #define VA_PREDICTION_DIRECTION_BI_NOT_EMPTY 0x00000004
1328 #define VA_ENC_INTRA_REFRESH_NONE 0x00000000
1330 #define VA_ENC_INTRA_REFRESH_ROLLING_COLUMN 0x00000001
1332 #define VA_ENC_INTRA_REFRESH_ROLLING_ROW 0x00000002
1334 #define VA_ENC_INTRA_REFRESH_ADAPTIVE 0x00000010
1336 #define VA_ENC_INTRA_REFRESH_CYCLIC 0x00000020
1338 #define VA_ENC_INTRA_REFRESH_P_FRAME 0x00010000
1340 #define VA_ENC_INTRA_REFRESH_B_FRAME 0x00020000
1342 #define VA_ENC_INTRA_REFRESH_MULTI_REF 0x00040000
1343 
1347 typedef union _VAConfigAttribValEncROI {
1348  struct {
1350  uint32_t num_roi_regions : 8;
1375  uint32_t reserved : 22;
1376  } bits;
1377  uint32_t value;
1379 
1381 typedef union _VAConfigAttribValEncRateControlExt {
1382  struct {
1391 
1416  uint32_t reserved : 23;
1417  } bits;
1418  uint32_t value;
1420 
1422 typedef union _VAConfigAttribValMultipleFrame {
1423  struct {
1429  uint32_t mixed_quality_level : 1;
1431  uint32_t reserved : 23;
1432  } bits;
1433  uint32_t value;
1435 
1437 typedef union _VAConfigAttribValContextPriority {
1438  struct {
1441  uint32_t priority : 16;
1443  uint32_t reserved : 16;
1444  } bits;
1445  uint32_t value;
1447 
1449 typedef union _VAConfigAttribValEncPerBlockControl {
1450  struct {
1452  uint32_t delta_qp_support : 1;
1458  uint32_t reserved : 24;
1459  } bits;
1460  uint32_t value;
1462 
1465 #define VA_PC_CIPHER_AES 0x00000001
1466 
1469 #define VA_PC_BLOCK_SIZE_128 0x00000001
1471 #define VA_PC_BLOCK_SIZE_192 0x00000002
1473 #define VA_PC_BLOCK_SIZE_256 0x00000004
1474 
1477 #define VA_PC_CIPHER_MODE_ECB 0x00000001
1479 #define VA_PC_CIPHER_MODE_CBC 0x00000002
1481 #define VA_PC_CIPHER_MODE_CTR 0x00000004
1482 
1485 #define VA_PC_SAMPLE_TYPE_FULLSAMPLE 0x00000001
1487 #define VA_PC_SAMPLE_TYPE_SUBSAMPLE 0x00000002
1488 
1491 #define VA_PC_USAGE_DEFAULT 0x00000000
1493 #define VA_PC_USAGE_WIDEVINE 0x00000001
1494 
1498 #define VA_PROCESSING_RATE_NONE 0x00000000
1500 #define VA_PROCESSING_RATE_ENCODE 0x00000001
1502 #define VA_PROCESSING_RATE_DECODE 0x00000002
1508 #define VA_SEGID_BLOCK_16X16 0
1510 #define VA_SEGID_BLOCK_32X32 1
1512 #define VA_SEGID_BLOCK_64X64 2
1514 #define VA_SEGID_BLOCK_8X8 3
1521 #define VA_ATTRIB_NOT_SUPPORTED 0x80000000
1522 
1525  VADisplay dpy
1526 );
1527 
1530  VADisplay dpy
1531 );
1532 
1535  VADisplay dpy
1536 );
1537 
1545  VADisplay dpy,
1546  VAProfile *profile_list, /* out */
1547  int *num_profiles /* out */
1548 );
1549 
1557  VADisplay dpy,
1558  VAProfile profile,
1559  VAEntrypoint *entrypoint_list, /* out */
1560  int *num_entrypoints /* out */
1561 );
1562 
1572  VADisplay dpy,
1573  VAProfile profile,
1574  VAEntrypoint entrypoint,
1575  VAConfigAttrib *attrib_list, /* in/out */
1576  int num_attribs
1577 );
1578 
1580 typedef unsigned int VAGenericID;
1581 
1582 typedef VAGenericID VAConfigID;
1583 
1590  VADisplay dpy,
1591  VAProfile profile,
1592  VAEntrypoint entrypoint,
1593  VAConfigAttrib *attrib_list,
1594  int num_attribs,
1595  VAConfigID *config_id /* out */
1596 );
1597 
1602  VADisplay dpy,
1603  VAConfigID config_id
1604 );
1605 
1615  VADisplay dpy,
1616  VAConfigID config_id,
1617  VAProfile *profile, /* out */
1618  VAEntrypoint *entrypoint, /* out */
1619  VAConfigAttrib *attrib_list,/* out */
1620  int *num_attribs /* out */
1621 );
1622 
1623 
1644 
1645 typedef VAGenericID VASurfaceID;
1646 
1647 #define VA_INVALID_ID 0xffffffff
1648 #define VA_INVALID_SURFACE VA_INVALID_ID
1649 
1651 typedef enum {
1657 
1659 typedef void (*VAGenericFunc)(void);
1660 
1662 typedef struct _VAGenericValue {
1666  union {
1668  int32_t i;
1670  float f;
1672  void *p;
1675  } value;
1676 } VAGenericValue;
1677 
1681 #define VA_SURFACE_ATTRIB_NOT_SUPPORTED 0x00000000
1683 #define VA_SURFACE_ATTRIB_GETTABLE 0x00000001
1685 #define VA_SURFACE_ATTRIB_SETTABLE 0x00000002
1689 typedef enum {
1690  VASurfaceAttribNone = 0,
1740 
1742 typedef struct _VASurfaceAttrib {
1746  uint32_t flags;
1749 } VASurfaceAttrib;
1750 
1759 #define VA_SURFACE_ATTRIB_MEM_TYPE_VA 0x00000001
1761 #define VA_SURFACE_ATTRIB_MEM_TYPE_V4L2 0x00000002
1763 #define VA_SURFACE_ATTRIB_MEM_TYPE_USER_PTR 0x00000004
1769 typedef union _VASurfaceAttribAlignmentStruct {
1770  struct {
1772  uint32_t log2_width_alignment : 4;
1775  uint32_t reserved : 24;
1776  } bits;
1777  uint32_t value;
1779 
1784 typedef struct _VASurfaceAttribExternalBuffers {
1786  uint32_t pixel_format;
1788  uint32_t width;
1790  uint32_t height;
1792  uint32_t data_size;
1794  uint32_t num_planes;
1796  uint32_t pitches[4];
1798  uint32_t offsets[4];
1800  uintptr_t *buffers;
1802  uint32_t num_buffers;
1804  uint32_t flags;
1808 
1812 #define VA_SURFACE_EXTBUF_DESC_ENABLE_TILING 0x00000001
1814 #define VA_SURFACE_EXTBUF_DESC_CACHED 0x00000002
1816 #define VA_SURFACE_EXTBUF_DESC_UNCACHED 0x00000004
1818 #define VA_SURFACE_EXTBUF_DESC_WC 0x00000008
1820 #define VA_SURFACE_EXTBUF_DESC_PROTECTED 0x80000000
1821 
1825 #define VA_SURFACE_ATTRIB_USAGE_HINT_GENERIC 0x00000000
1827 #define VA_SURFACE_ATTRIB_USAGE_HINT_DECODER 0x00000001
1829 #define VA_SURFACE_ATTRIB_USAGE_HINT_ENCODER 0x00000002
1831 #define VA_SURFACE_ATTRIB_USAGE_HINT_VPP_READ 0x00000004
1833 #define VA_SURFACE_ATTRIB_USAGE_HINT_VPP_WRITE 0x00000008
1835 #define VA_SURFACE_ATTRIB_USAGE_HINT_DISPLAY 0x00000010
1838 #define VA_SURFACE_ATTRIB_USAGE_HINT_EXPORT 0x00000020
1839 
1869 VAStatus
1871  VADisplay dpy,
1872  VAConfigID config,
1873  VASurfaceAttrib *attrib_list,
1874  unsigned int *num_attribs
1875 );
1876 
1894 VAStatus
1896  VADisplay dpy,
1897  unsigned int format,
1898  unsigned int width,
1899  unsigned int height,
1900  VASurfaceID *surfaces,
1901  unsigned int num_surfaces,
1902  VASurfaceAttrib *attrib_list,
1903  unsigned int num_attribs
1904 );
1905 
1915  VADisplay dpy,
1916  VASurfaceID *surfaces,
1917  int num_surfaces
1918 );
1919 
1920 #define VA_PROGRESSIVE 0x1
1934  VADisplay dpy,
1935  VAConfigID config_id,
1936  int picture_width,
1937  int picture_height,
1938  int flag,
1939  VASurfaceID *render_targets,
1940  int num_render_targets,
1941  VAContextID *context /* out */
1942 );
1943 
1950  VADisplay dpy,
1951  VAContextID context
1952 );
1953 
1954 //Multi-frame context
1955 typedef VAGenericID VAMFContextID;
1973  VADisplay dpy,
1974  VAMFContextID *mf_context /* out */
1975 );
1976 
2011  VADisplay dpy,
2012  VAMFContextID mf_context,
2013  VAContextID context
2014 );
2015 
2029  VADisplay dpy,
2030  VAMFContextID mf_context,
2031  VAContextID context
2032 );
2033 
2043 
2044 typedef enum {
2045  VAPictureParameterBufferType = 0,
2046  VAIQMatrixBufferType = 1,
2047  VABitPlaneBufferType = 2,
2048  VASliceGroupMapBufferType = 3,
2049  VASliceParameterBufferType = 4,
2050  VASliceDataBufferType = 5,
2051  VAMacroblockParameterBufferType = 6,
2052  VAResidualDataBufferType = 7,
2053  VADeblockingParameterBufferType = 8,
2054  VAImageBufferType = 9,
2055  VAProtectedSliceDataBufferType = 10,
2056  VAQMatrixBufferType = 11,
2057  VAHuffmanTableBufferType = 12,
2058  VAProbabilityBufferType = 13,
2059 
2060  /* Following are encode buffer types */
2061  VAEncCodedBufferType = 21,
2062  VAEncSequenceParameterBufferType = 22,
2063  VAEncPictureParameterBufferType = 23,
2064  VAEncSliceParameterBufferType = 24,
2065  VAEncPackedHeaderParameterBufferType = 25,
2066  VAEncPackedHeaderDataBufferType = 26,
2067  VAEncMiscParameterBufferType = 27,
2068  VAEncMacroblockParameterBufferType = 28,
2069  VAEncMacroblockMapBufferType = 29,
2070 
2079  /* Following are video processing buffer types */
2104  VAEncFEIMBCodeBufferType = 44,
2105  VAEncFEIDistortionBufferType = 45,
2106  VAEncFEIMBControlBufferType = 46,
2107  VAEncFEIMVPredictorBufferType = 47,
2108  VAStatsStatisticsParameterBufferType = 48,
2113  VAStatsMVBufferType = 51,
2114  VAStatsMVPredictorBufferType = 52,
2135 
2160 
2166 
2177 
2208 
2209  VABufferTypeMax
2210 } VABufferType;
2211 
2217 typedef struct _VAContextParameterUpdateBuffer {
2218  union {
2219  struct {
2223  uint32_t reserved : 31;
2224  } bits;
2225  uint32_t value;
2226  } flags;
2230  uint32_t reserved[VA_PADDING_MEDIUM];
2232 
2245 #define VA_ENCRYPTION_TYPE_FULLSAMPLE_CTR 0x00000001 /* AES CTR fullsample */
2246 #define VA_ENCRYPTION_TYPE_FULLSAMPLE_CBC 0x00000002 /* AES CBC fullsample */
2247 #define VA_ENCRYPTION_TYPE_SUBSAMPLE_CTR 0x00000004 /* AES CTR fullsample */
2248 #define VA_ENCRYPTION_TYPE_SUBSAMPLE_CBC 0x00000008 /* AES CBC fullsample */
2249 
2251 typedef struct _VAEncryptionSegmentInfo {
2256  uint32_t segment_length;
2265  uint8_t aes_cbc_iv_or_ctr[64];
2267  uint32_t va_reserved[VA_PADDING_MEDIUM];
2269 
2271 typedef struct _VAEncryptionParameters {
2277  uint32_t num_segments;
2285  uint32_t size_of_length;
2288  uint8_t wrapped_decrypt_blob[64];
2291  uint8_t wrapped_encrypt_blob[64];
2296  uint32_t key_blob_size;
2314  uint32_t va_reserved[VA_PADDING_MEDIUM];
2316 
2320 typedef struct _VAProcessingRateParameterEnc {
2322  uint8_t level_idc;
2323  uint8_t reserved[3];
2327  uint32_t quality_level;
2329  uint32_t intra_period;
2331  uint32_t ip_period;
2333 
2337 typedef struct _VAProcessingRateParameterDec {
2339  uint8_t level_idc;
2340  uint8_t reserved0[3];
2341  uint32_t reserved;
2343 
2344 typedef struct _VAProcessingRateParameter {
2345  union {
2346  VAProcessingRateParameterEnc proc_buf_enc;
2347  VAProcessingRateParameterDec proc_buf_dec;
2348  };
2349 } VAProcessingRateParameter;
2350 
2371 VAStatus
2373  VADisplay dpy,
2374  VAConfigID config,
2375  VAProcessingRateParameter *proc_buf,
2376  unsigned int *processing_rate
2377 );
2378 
2379 typedef enum {
2380  VAEncMiscParameterTypeFrameRate = 0,
2381  VAEncMiscParameterTypeRateControl = 1,
2382  VAEncMiscParameterTypeMaxSliceSize = 2,
2383  VAEncMiscParameterTypeAIR = 3,
2388  VAEncMiscParameterTypeQualityLevel = 6,
2417 
2419 typedef enum {
2442  VAEncPackedHeaderMiscMask va_deprecated_enum = 0x80000000,
2444 
2446 typedef struct _VAEncPackedHeaderParameterBuffer {
2448  uint32_t type;
2450  uint32_t bit_length;
2453 
2455  uint32_t va_reserved[VA_PADDING_LOW];
2457 
2475 typedef struct _VAEncMiscParameterBuffer {
2477  uint32_t data[];
2479 
2481 typedef struct _VAEncMiscParameterTemporalLayerStructure {
2485  uint32_t periodicity;
2492  uint32_t layer_id[32];
2493 
2495  uint32_t va_reserved[VA_PADDING_LOW];
2497 
2498 
2500 typedef struct _VAEncMiscParameterRateControl {
2514  uint32_t window_size;
2519  uint32_t initial_qp;
2525  uint32_t min_qp;
2531  union {
2532  struct {
2538  uint32_t reset : 1;
2540  uint32_t disable_frame_skip : 1;
2542  uint32_t disable_bit_stuffing : 1;
2550  uint32_t mb_rate_control : 4;
2552  uint32_t temporal_id : 8;
2554  uint32_t cfs_I_frames : 1;
2559  uint32_t enable_parallel_brc : 1;
2560  uint32_t enable_dynamic_scaling : 1;
2575  uint32_t frame_tolerance_mode : 2;
2577  uint32_t reserved : 12;
2578  } bits;
2579  uint32_t value;
2580  } rc_flags;
2592  uint32_t max_qp;
2597  uint32_t quality_factor;
2608  uint32_t va_reserved[VA_PADDING_LOW];
2610 
2617 typedef struct _VAEncMiscParameterFrameRate {
2637  uint32_t framerate;
2638  union {
2639  struct {
2641  uint32_t temporal_id : 8;
2643  uint32_t reserved : 24;
2644  } bits;
2645  uint32_t value;
2646  } framerate_flags;
2647 
2649  uint32_t va_reserved[VA_PADDING_LOW];
2651 
2657 typedef struct _VAEncMiscParameterMaxSliceSize {
2658  uint32_t max_slice_size;
2659 
2661  uint32_t va_reserved[VA_PADDING_LOW];
2663 
2664 typedef struct _VAEncMiscParameterAIR {
2665  uint32_t air_num_mbs;
2666  uint32_t air_threshold;
2667  uint32_t air_auto; /* if set to 1 then hardware auto-tune the AIR threshold */
2668 
2670  uint32_t va_reserved[VA_PADDING_LOW];
2671 } VAEncMiscParameterAIR;
2672 
2673 /*
2674  * \brief Rolling intra refresh data structure for encoding.
2675  */
2676 typedef struct _VAEncMiscParameterRIR {
2677  union {
2678  struct
2685  {
2686  /* \brief enable RIR in column */
2687  uint32_t enable_rir_column : 1;
2688  /* \brief enable RIR in row */
2689  uint32_t enable_rir_row : 1;
2690  uint32_t reserved : 30;
2691  } bits;
2692  uint32_t value;
2693  } rir_flags;
2698  uint16_t intra_insertion_location;
2703  uint16_t intra_insert_size;
2708  uint8_t qp_delta_for_inserted_intra;
2710  uint32_t va_reserved[VA_PADDING_LOW];
2711 } VAEncMiscParameterRIR;
2712 
2721 typedef struct _VAEncMiscParameterHRD {
2738  uint32_t buffer_size;
2739 
2741  uint32_t va_reserved[VA_PADDING_LOW];
2743 
2753 typedef struct _VAEncMiscParameterBufferMaxFrameSize {
2756  va_deprecated VAEncMiscParameterType type;
2758  uint32_t max_frame_size;
2759 
2761  uint32_t va_reserved[VA_PADDING_LOW];
2763 
2773 typedef struct _VAEncMiscParameterBufferMultiPassFrameSize {
2776  va_deprecated VAEncMiscParameterType type;
2778  uint32_t max_frame_size;
2780  uint32_t reserved;
2782  uint8_t num_passes;
2784  uint8_t *delta_qp;
2785 
2787  unsigned long va_reserved[VA_PADDING_LOW];
2789 
2801 typedef struct _VAEncMiscParameterBufferQualityLevel {
2805  uint32_t quality_level;
2806 
2808  uint32_t va_reserved[VA_PADDING_LOW];
2810 
2817 typedef struct _VAEncMiscParameterQuantization {
2818  union {
2819  /* if no flags is set then quantization is determined by the driver */
2820  struct {
2821  /* \brief disable trellis for all frames/fields */
2822  uint32_t disable_trellis : 1;
2823  /* \brief enable trellis for I frames/fields */
2824  uint32_t enable_trellis_I : 1;
2825  /* \brief enable trellis for P frames/fields */
2826  uint32_t enable_trellis_P : 1;
2827  /* \brief enable trellis for B frames/fields */
2828  uint32_t enable_trellis_B : 1;
2829  uint32_t reserved : 28;
2830  } bits;
2831  uint32_t value;
2832  } quantization_flags;
2833  uint32_t va_reserved;
2835 
2845 typedef struct _VAEncMiscParameterSkipFrame {
2858 
2860  uint32_t va_reserved[VA_PADDING_LOW];
2862 
2872 typedef struct _VAEncROI {
2895  int8_t roi_value;
2896 } VAEncROI;
2897 
2898 typedef struct _VAEncMiscParameterBufferROI {
2900  uint32_t num_roi;
2901 
2905  int8_t max_delta_qp;
2906  int8_t min_delta_qp;
2907 
2910  VAEncROI *roi;
2911  union {
2912  struct {
2925  uint32_t roi_value_is_qp_delta : 1;
2926  uint32_t reserved : 31;
2927  } bits;
2928  uint32_t value;
2929  } roi_flags;
2930 
2932  uint32_t va_reserved[VA_PADDING_LOW];
2933 } VAEncMiscParameterBufferROI;
2934 /*
2935  * \brief Dirty rectangle data structure for encoding.
2936  *
2937  * The encoding dirty rect can be set through VAEncMiscParameterBufferDirtyRect, if the
2938  * implementation supports dirty rect input. The rect set through this structure is applicable
2939  * only to the current frame or field, so must be sent every frame or field to be applied.
2940  * The number of supported rects can be queried through the VAConfigAttribEncDirtyRect. The
2941  * encoder will use the rect information to know those rectangle areas have changed while the
2942  * areas not covered by dirty rect rectangles are assumed to have not changed compared to the
2943  * previous picture. The encoder may do some internal optimizations.
2944  */
2945 typedef struct _VAEncMiscParameterBufferDirtyRect {
2947  uint32_t num_roi_rectangle;
2948 
2950  VARectangle *roi_rectangle;
2951 } VAEncMiscParameterBufferDirtyRect;
2952 
2954 typedef struct _VAEncMiscParameterParallelRateControl {
2956  uint32_t num_layers;
2961  uint32_t *num_b_in_gop;
2963 
2966 typedef struct _VAEncMiscParameterEncQuality {
2967  union {
2968  struct {
2972  uint32_t useRawPicForRef : 1;
2975  uint32_t skipCheckDisable : 1;
2978  uint32_t FTQOverride : 1;
2980  uint32_t FTQEnable : 1;
2987  uint32_t ReservedBit : 1;
3006  uint32_t HMEDisable : 1;
3008  uint32_t SuperHMEDisable : 1;
3010  uint32_t UltraHMEDisable : 1;
3014  uint32_t PanicModeDisable : 1;
3020 
3021  };
3022  uint32_t encControls;
3023  };
3024 
3026  uint8_t FTQSkipThresholdLUT[52];
3028  uint16_t NonFTQSkipThresholdLUT[52];
3029 
3030  uint32_t reserved[VA_PADDING_HIGH]; // Reserved for future use.
3031 
3033 
3040 typedef struct _VAEncMiscParameterCustomRoundingControl {
3041  union {
3042  struct {
3048 
3053 
3059 
3064 
3065  /* Reserved */
3066  uint32_t reserved : 16;
3067  } bits;
3068  uint32_t value;
3069  } rounding_offset_setting;
3071 
3080 #define VA_SLICE_DATA_FLAG_ALL 0x00 /* whole slice is in the buffer */
3081 #define VA_SLICE_DATA_FLAG_BEGIN 0x01 /* The beginning of the slice is in the buffer but the end if not */
3082 #define VA_SLICE_DATA_FLAG_MIDDLE 0x02 /* Neither beginning nor end of the slice is in the buffer */
3083 #define VA_SLICE_DATA_FLAG_END 0x04 /* end of the slice is in the buffer */
3084 
3085 /* Codec-independent Slice Parameter Buffer base */
3086 typedef struct _VASliceParameterBufferBase {
3087  uint32_t slice_data_size; /* number of bytes in the slice data buffer for this slice */
3088  uint32_t slice_data_offset; /* the offset to the first byte of slice data */
3089  uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX definitions */
3090 } VASliceParameterBufferBase;
3091 
3092 /**********************************
3093  * JPEG common data structures
3094  **********************************/
3107 typedef struct _VAHuffmanTableBufferJPEGBaseline {
3109  uint8_t load_huffman_table[2];
3111  struct {
3115  uint8_t num_dc_codes[16];
3117  uint8_t dc_values[12];
3122  uint8_t num_ac_codes[16];
3124  uint8_t ac_values[162];
3126  uint8_t pad[2];
3128  } huffman_table[2];
3129 
3131  uint32_t va_reserved[VA_PADDING_LOW];
3133 
3134 /****************************
3135  * MPEG-2 data structures
3136  ****************************/
3137 
3138 /* MPEG-2 Picture Parameter Buffer */
3139 /*
3140  * For each frame or field, and before any slice data, a single
3141  * picture parameter buffer must be send.
3142  */
3143 typedef struct _VAPictureParameterBufferMPEG2 {
3144  uint16_t horizontal_size;
3145  uint16_t vertical_size;
3146  VASurfaceID forward_reference_picture;
3147  VASurfaceID backward_reference_picture;
3148  /* meanings of the following fields are the same as in the standard */
3149  int32_t picture_coding_type;
3150  int32_t f_code; /* pack all four fcode into this */
3151  union {
3152  struct {
3153  uint32_t intra_dc_precision : 2;
3154  uint32_t picture_structure : 2;
3155  uint32_t top_field_first : 1;
3156  uint32_t frame_pred_frame_dct : 1;
3157  uint32_t concealment_motion_vectors : 1;
3158  uint32_t q_scale_type : 1;
3159  uint32_t intra_vlc_format : 1;
3160  uint32_t alternate_scan : 1;
3161  uint32_t repeat_first_field : 1;
3162  uint32_t progressive_frame : 1;
3163  uint32_t is_first_field : 1; /* indicate whether the current field
3164  * is the first field for field picture
3165  */
3166  } bits;
3167  uint32_t value;
3168  } picture_coding_extension;
3169 
3171  uint32_t va_reserved[VA_PADDING_LOW];
3172 } VAPictureParameterBufferMPEG2;
3173 
3175 typedef struct _VAIQMatrixBufferMPEG2 {
3185  uint8_t intra_quantiser_matrix[64];
3187  uint8_t non_intra_quantiser_matrix[64];
3189  uint8_t chroma_intra_quantiser_matrix[64];
3191  uint8_t chroma_non_intra_quantiser_matrix[64];
3192 
3194  uint32_t va_reserved[VA_PADDING_LOW];
3196 
3198 typedef struct _VASliceParameterBufferMPEG2 {
3199  uint32_t slice_data_size;/* number of bytes in the slice data buffer for this slice */
3200  uint32_t slice_data_offset;/* the offset to the first byte of slice data */
3201  uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
3202  uint32_t macroblock_offset;/* the offset to the first bit of MB from the first byte of slice data */
3203  uint32_t slice_horizontal_position;
3204  uint32_t slice_vertical_position;
3205  int32_t quantiser_scale_code;
3206  int32_t intra_slice_flag;
3207 
3209  uint32_t va_reserved[VA_PADDING_LOW];
3211 
3213 typedef struct _VAMacroblockParameterBufferMPEG2 {
3214  uint16_t macroblock_address;
3215  /*
3216  * macroblock_address (in raster scan order)
3217  * top-left: 0
3218  * bottom-right: picture-height-in-mb*picture-width-in-mb - 1
3219  */
3220  uint8_t macroblock_type; /* see definition below */
3221  union {
3222  struct {
3223  uint32_t frame_motion_type : 2;
3224  uint32_t field_motion_type : 2;
3225  uint32_t dct_type : 1;
3226  } bits;
3227  uint32_t value;
3228  } macroblock_modes;
3229  uint8_t motion_vertical_field_select;
3230  /*
3231  * motion_vertical_field_select:
3232  * see section 6.3.17.2 in the spec
3233  * only the lower 4 bits are used
3234  * bit 0: first vector forward
3235  * bit 1: first vector backward
3236  * bit 2: second vector forward
3237  * bit 3: second vector backward
3238  */
3239  int16_t PMV[2][2][2]; /* see Table 7-7 in the spec */
3240  uint16_t coded_block_pattern;
3241  /*
3242  * The bitplanes for coded_block_pattern are described
3243  * in Figure 6.10-12 in the spec
3244  */
3245 
3246  /* Number of skipped macroblocks after this macroblock */
3247  uint16_t num_skipped_macroblocks;
3248 
3250  uint32_t va_reserved[VA_PADDING_LOW];
3252 
3253 /*
3254  * OR'd flags for macroblock_type (section 6.3.17.1 in the spec)
3255  */
3256 #define VA_MB_TYPE_MOTION_FORWARD 0x02
3257 #define VA_MB_TYPE_MOTION_BACKWARD 0x04
3258 #define VA_MB_TYPE_MOTION_PATTERN 0x08
3259 #define VA_MB_TYPE_MOTION_INTRA 0x10
3260 
3267 /****************************
3268  * MPEG-4 Part 2 data structures
3269  ****************************/
3270 
3271 /* MPEG-4 Picture Parameter Buffer */
3272 /*
3273  * For each frame or field, and before any slice data, a single
3274  * picture parameter buffer must be send.
3275  */
3276 typedef struct _VAPictureParameterBufferMPEG4 {
3277  uint16_t vop_width;
3278  uint16_t vop_height;
3279  VASurfaceID forward_reference_picture;
3280  VASurfaceID backward_reference_picture;
3281  union {
3282  struct {
3283  uint32_t short_video_header : 1;
3284  uint32_t chroma_format : 2;
3285  uint32_t interlaced : 1;
3286  uint32_t obmc_disable : 1;
3287  uint32_t sprite_enable : 2;
3288  uint32_t sprite_warping_accuracy : 2;
3289  uint32_t quant_type : 1;
3290  uint32_t quarter_sample : 1;
3291  uint32_t data_partitioned : 1;
3292  uint32_t reversible_vlc : 1;
3293  uint32_t resync_marker_disable : 1;
3294  } bits;
3295  uint32_t value;
3296  } vol_fields;
3297  uint8_t no_of_sprite_warping_points;
3298  int16_t sprite_trajectory_du[3];
3299  int16_t sprite_trajectory_dv[3];
3300  uint8_t quant_precision;
3301  union {
3302  struct {
3303  uint32_t vop_coding_type : 2;
3304  uint32_t backward_reference_vop_coding_type : 2;
3305  uint32_t vop_rounding_type : 1;
3306  uint32_t intra_dc_vlc_thr : 3;
3307  uint32_t top_field_first : 1;
3308  uint32_t alternate_vertical_scan_flag : 1;
3309  } bits;
3310  uint32_t value;
3311  } vop_fields;
3312  uint8_t vop_fcode_forward;
3313  uint8_t vop_fcode_backward;
3314  uint16_t vop_time_increment_resolution;
3315  /* short header related */
3316  uint8_t num_gobs_in_vop;
3317  uint8_t num_macroblocks_in_gob;
3318  /* for direct mode prediction */
3319  int16_t TRB;
3320  int16_t TRD;
3321 
3323  uint32_t va_reserved[VA_PADDING_LOW];
3325 
3327 typedef struct _VAIQMatrixBufferMPEG4 {
3333  uint8_t intra_quant_mat[64];
3335  uint8_t non_intra_quant_mat[64];
3336 
3338  uint32_t va_reserved[VA_PADDING_LOW];
3340 
3342 typedef struct _VASliceParameterBufferMPEG4 {
3343  uint32_t slice_data_size;/* number of bytes in the slice data buffer for this slice */
3344  uint32_t slice_data_offset;/* the offset to the first byte of slice data */
3345  uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
3346  uint32_t macroblock_offset;/* the offset to the first bit of MB from the first byte of slice data */
3347  uint32_t macroblock_number;
3348  int32_t quant_scale;
3349 
3351  uint32_t va_reserved[VA_PADDING_LOW];
3353 
3358 typedef enum /* see 7.1.1.32 */
3359 {
3360  VAMvMode1Mv = 0,
3361  VAMvMode1MvHalfPel = 1,
3362  VAMvMode1MvHalfPelBilinear = 2,
3363  VAMvModeMixedMv = 3,
3364  VAMvModeIntensityCompensation = 4
3365 } VAMvModeVC1;
3366 
3368 /*
3369  * For each picture, and before any slice data, a picture parameter
3370  * buffer must be send. Multiple picture parameter buffers may be
3371  * sent for a single picture. In that case picture parameters will
3372  * apply to all slice data that follow it until a new picture
3373  * parameter buffer is sent.
3374  *
3375  * Notes:
3376  * pic_quantizer_type should be set to the applicable quantizer
3377  * type as defined by QUANTIZER (J.1.19) and either
3378  * PQUANTIZER (7.1.1.8) or PQINDEX (7.1.1.6)
3379  */
3380 typedef struct _VAPictureParameterBufferVC1 {
3381  VASurfaceID forward_reference_picture;
3382  VASurfaceID backward_reference_picture;
3383  /* if out-of-loop post-processing is done on the render
3384  target, then we need to keep the in-loop decoded
3385  picture as a reference picture */
3386  VASurfaceID inloop_decoded_picture;
3387 
3388  /* sequence layer for AP or meta data for SP and MP */
3389  union {
3390  struct {
3391  uint32_t pulldown : 1; /* SEQUENCE_LAYER::PULLDOWN */
3392  uint32_t interlace : 1; /* SEQUENCE_LAYER::INTERLACE */
3393  uint32_t tfcntrflag : 1; /* SEQUENCE_LAYER::TFCNTRFLAG */
3394  uint32_t finterpflag : 1; /* SEQUENCE_LAYER::FINTERPFLAG */
3395  uint32_t psf : 1; /* SEQUENCE_LAYER::PSF */
3396  uint32_t multires : 1; /* METADATA::MULTIRES */
3397  uint32_t overlap : 1; /* METADATA::OVERLAP */
3398  uint32_t syncmarker : 1; /* METADATA::SYNCMARKER */
3399  uint32_t rangered : 1; /* METADATA::RANGERED */
3400  uint32_t max_b_frames : 3; /* METADATA::MAXBFRAMES */
3401  uint32_t profile : 2; /* SEQUENCE_LAYER::PROFILE or The MSB of METADATA::PROFILE */
3402  } bits;
3403  uint32_t value;
3404  } sequence_fields;
3405 
3406  uint16_t coded_width; /* ENTRY_POINT_LAYER::CODED_WIDTH */
3407  uint16_t coded_height; /* ENTRY_POINT_LAYER::CODED_HEIGHT */
3408  union {
3409  struct {
3410  uint32_t broken_link : 1; /* ENTRY_POINT_LAYER::BROKEN_LINK */
3411  uint32_t closed_entry : 1; /* ENTRY_POINT_LAYER::CLOSED_ENTRY */
3412  uint32_t panscan_flag : 1; /* ENTRY_POINT_LAYER::PANSCAN_FLAG */
3413  uint32_t loopfilter : 1; /* ENTRY_POINT_LAYER::LOOPFILTER */
3414  } bits;
3415  uint32_t value;
3416  } entrypoint_fields;
3417  uint8_t conditional_overlap_flag; /* ENTRY_POINT_LAYER::CONDOVER */
3418  uint8_t fast_uvmc_flag; /* ENTRY_POINT_LAYER::FASTUVMC */
3419  union {
3420  struct {
3421  uint32_t luma_flag : 1; /* ENTRY_POINT_LAYER::RANGE_MAPY_FLAG */
3422  uint32_t luma : 3; /* ENTRY_POINT_LAYER::RANGE_MAPY */
3423  uint32_t chroma_flag : 1; /* ENTRY_POINT_LAYER::RANGE_MAPUV_FLAG */
3424  uint32_t chroma : 3; /* ENTRY_POINT_LAYER::RANGE_MAPUV */
3425  } bits;
3426  uint32_t value;
3427  } range_mapping_fields;
3428 
3429  uint8_t b_picture_fraction; /* Index for PICTURE_LAYER::BFRACTION value in Table 40 (7.1.1.14) */
3430  uint8_t cbp_table; /* PICTURE_LAYER::CBPTAB/ICBPTAB */
3431  uint8_t mb_mode_table; /* PICTURE_LAYER::MBMODETAB */
3432  uint8_t range_reduction_frame;/* PICTURE_LAYER::RANGEREDFRM */
3433  uint8_t rounding_control; /* PICTURE_LAYER::RNDCTRL */
3434  uint8_t post_processing; /* PICTURE_LAYER::POSTPROC */
3435  uint8_t picture_resolution_index; /* PICTURE_LAYER::RESPIC */
3436  uint8_t luma_scale; /* PICTURE_LAYER::LUMSCALE */
3437  uint8_t luma_shift; /* PICTURE_LAYER::LUMSHIFT */
3438 
3439  union {
3440  struct {
3441  uint32_t picture_type : 3; /* PICTURE_LAYER::PTYPE */
3442  uint32_t frame_coding_mode : 3; /* PICTURE_LAYER::FCM */
3443  uint32_t top_field_first : 1; /* PICTURE_LAYER::TFF */
3444  uint32_t is_first_field : 1; /* set to 1 if it is the first field */
3445  uint32_t intensity_compensation : 1; /* PICTURE_LAYER::INTCOMP */
3446  } bits;
3447  uint32_t value;
3448  } picture_fields;
3449  union {
3450  struct {
3451  uint32_t mv_type_mb : 1; /* PICTURE::MVTYPEMB */
3452  uint32_t direct_mb : 1; /* PICTURE::DIRECTMB */
3453  uint32_t skip_mb : 1; /* PICTURE::SKIPMB */
3454  uint32_t field_tx : 1; /* PICTURE::FIELDTX */
3455  uint32_t forward_mb : 1; /* PICTURE::FORWARDMB */
3456  uint32_t ac_pred : 1; /* PICTURE::ACPRED */
3457  uint32_t overflags : 1; /* PICTURE::OVERFLAGS */
3458  } flags;
3459  uint32_t value;
3460  } raw_coding;
3461  union {
3462  struct {
3463  uint32_t bp_mv_type_mb : 1; /* PICTURE::MVTYPEMB */
3464  uint32_t bp_direct_mb : 1; /* PICTURE::DIRECTMB */
3465  uint32_t bp_skip_mb : 1; /* PICTURE::SKIPMB */
3466  uint32_t bp_field_tx : 1; /* PICTURE::FIELDTX */
3467  uint32_t bp_forward_mb : 1; /* PICTURE::FORWARDMB */
3468  uint32_t bp_ac_pred : 1; /* PICTURE::ACPRED */
3469  uint32_t bp_overflags : 1; /* PICTURE::OVERFLAGS */
3470  } flags;
3471  uint32_t value;
3472  } bitplane_present; /* signal what bitplane is being passed via the bitplane buffer */
3473  union {
3474  struct {
3475  uint32_t reference_distance_flag : 1;/* PICTURE_LAYER::REFDIST_FLAG */
3476  uint32_t reference_distance : 5;/* PICTURE_LAYER::REFDIST */
3477  uint32_t num_reference_pictures: 1;/* PICTURE_LAYER::NUMREF */
3478  uint32_t reference_field_pic_indicator : 1;/* PICTURE_LAYER::REFFIELD */
3479  } bits;
3480  uint32_t value;
3481  } reference_fields;
3482  union {
3483  struct {
3484  uint32_t mv_mode : 3; /* PICTURE_LAYER::MVMODE */
3485  uint32_t mv_mode2 : 3; /* PICTURE_LAYER::MVMODE2 */
3486  uint32_t mv_table : 3; /* PICTURE_LAYER::MVTAB/IMVTAB */
3487  uint32_t two_mv_block_pattern_table: 2; /* PICTURE_LAYER::2MVBPTAB */
3488  uint32_t four_mv_switch : 1; /* PICTURE_LAYER::4MVSWITCH */
3489  uint32_t four_mv_block_pattern_table : 2; /* PICTURE_LAYER::4MVBPTAB */
3490  uint32_t extended_mv_flag : 1; /* ENTRY_POINT_LAYER::EXTENDED_MV */
3491  uint32_t extended_mv_range : 2; /* PICTURE_LAYER::MVRANGE */
3492  uint32_t extended_dmv_flag : 1; /* ENTRY_POINT_LAYER::EXTENDED_DMV */
3493  uint32_t extended_dmv_range : 2; /* PICTURE_LAYER::DMVRANGE */
3494  } bits;
3495  uint32_t value;
3496  } mv_fields;
3497  union {
3498  struct {
3499  uint32_t dquant : 2; /* ENTRY_POINT_LAYER::DQUANT */
3500  uint32_t quantizer : 2; /* ENTRY_POINT_LAYER::QUANTIZER */
3501  uint32_t half_qp : 1; /* PICTURE_LAYER::HALFQP */
3502  uint32_t pic_quantizer_scale : 5;/* PICTURE_LAYER::PQUANT */
3503  uint32_t pic_quantizer_type : 1;/* PICTURE_LAYER::PQUANTIZER */
3504  uint32_t dq_frame : 1; /* VOPDQUANT::DQUANTFRM */
3505  uint32_t dq_profile : 2; /* VOPDQUANT::DQPROFILE */
3506  uint32_t dq_sb_edge : 2; /* VOPDQUANT::DQSBEDGE */
3507  uint32_t dq_db_edge : 2; /* VOPDQUANT::DQDBEDGE */
3508  uint32_t dq_binary_level : 1; /* VOPDQUANT::DQBILEVEL */
3509  uint32_t alt_pic_quantizer : 5;/* VOPDQUANT::ALTPQUANT */
3510  } bits;
3511  uint32_t value;
3512  } pic_quantizer_fields;
3513  union {
3514  struct {
3515  uint32_t variable_sized_transform_flag : 1;/* ENTRY_POINT_LAYER::VSTRANSFORM */
3516  uint32_t mb_level_transform_type_flag : 1;/* PICTURE_LAYER::TTMBF */
3517  uint32_t frame_level_transform_type : 2;/* PICTURE_LAYER::TTFRM */
3518  uint32_t transform_ac_codingset_idx1 : 2;/* PICTURE_LAYER::TRANSACFRM */
3519  uint32_t transform_ac_codingset_idx2 : 2;/* PICTURE_LAYER::TRANSACFRM2 */
3520  uint32_t intra_transform_dc_table : 1;/* PICTURE_LAYER::TRANSDCTAB */
3521  } bits;
3522  uint32_t value;
3523  } transform_fields;
3524 
3525  uint8_t luma_scale2; /* PICTURE_LAYER::LUMSCALE2 */
3526  uint8_t luma_shift2; /* PICTURE_LAYER::LUMSHIFT2 */
3527  uint8_t intensity_compensation_field; /* Index for PICTURE_LAYER::INTCOMPFIELD value in Table 109 (9.1.1.48) */
3528 
3530  uint32_t va_reserved[VA_PADDING_MEDIUM - 1];
3532 
3551 /* VC-1 Slice Parameter Buffer */
3552 typedef struct _VASliceParameterBufferVC1 {
3553  uint32_t slice_data_size;/* number of bytes in the slice data buffer for this slice */
3554  uint32_t slice_data_offset;/* the offset to the first byte of slice data */
3555  uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
3556  uint32_t macroblock_offset;/* the offset to the first bit of MB from the first byte of slice data */
3557  uint32_t slice_vertical_position;
3558 
3560  uint32_t va_reserved[VA_PADDING_LOW];
3562 
3563 /* VC-1 Slice Data Buffer */
3564 /*
3565 This is simplely a buffer containing raw bit-stream bytes
3566 */
3567 
3568 /****************************
3569  * H.264/AVC data structures
3570  ****************************/
3571 
3572 typedef struct _VAPictureH264 {
3573  VASurfaceID picture_id;
3574  uint32_t frame_idx;
3575  uint32_t flags;
3576  int32_t TopFieldOrderCnt;
3577  int32_t BottomFieldOrderCnt;
3578 
3580  uint32_t va_reserved[VA_PADDING_LOW];
3581 } VAPictureH264;
3582 /* flags in VAPictureH264 could be OR of the following */
3583 #define VA_PICTURE_H264_INVALID 0x00000001
3584 #define VA_PICTURE_H264_TOP_FIELD 0x00000002
3585 #define VA_PICTURE_H264_BOTTOM_FIELD 0x00000004
3586 #define VA_PICTURE_H264_SHORT_TERM_REFERENCE 0x00000008
3587 #define VA_PICTURE_H264_LONG_TERM_REFERENCE 0x00000010
3588 
3590 /*
3591  * For each picture, and before any slice data, a single
3592  * picture parameter buffer must be send.
3593  */
3594 typedef struct _VAPictureParameterBufferH264 {
3595  VAPictureH264 CurrPic;
3596  VAPictureH264 ReferenceFrames[16]; /* in DPB */
3597  uint16_t picture_width_in_mbs_minus1;
3598  uint16_t picture_height_in_mbs_minus1;
3599  uint8_t bit_depth_luma_minus8;
3600  uint8_t bit_depth_chroma_minus8;
3601  uint8_t num_ref_frames;
3602  union {
3603  struct {
3604  uint32_t chroma_format_idc : 2;
3605  uint32_t residual_colour_transform_flag : 1; /* Renamed to separate_colour_plane_flag in newer standard versions. */
3606  uint32_t gaps_in_frame_num_value_allowed_flag : 1;
3607  uint32_t frame_mbs_only_flag : 1;
3608  uint32_t mb_adaptive_frame_field_flag : 1;
3609  uint32_t direct_8x8_inference_flag : 1;
3610  uint32_t MinLumaBiPredSize8x8 : 1; /* see A.3.3.2 */
3611  uint32_t log2_max_frame_num_minus4 : 4;
3612  uint32_t pic_order_cnt_type : 2;
3613  uint32_t log2_max_pic_order_cnt_lsb_minus4 : 4;
3614  uint32_t delta_pic_order_always_zero_flag : 1;
3615  } bits;
3616  uint32_t value;
3617  } seq_fields;
3618  // FMO is not supported.
3619  va_deprecated uint8_t num_slice_groups_minus1;
3620  va_deprecated uint8_t slice_group_map_type;
3621  va_deprecated uint16_t slice_group_change_rate_minus1;
3622  int8_t pic_init_qp_minus26;
3623  int8_t pic_init_qs_minus26;
3624  int8_t chroma_qp_index_offset;
3625  int8_t second_chroma_qp_index_offset;
3626  union {
3627  struct {
3628  uint32_t entropy_coding_mode_flag : 1;
3629  uint32_t weighted_pred_flag : 1;
3630  uint32_t weighted_bipred_idc : 2;
3631  uint32_t transform_8x8_mode_flag : 1;
3632  uint32_t field_pic_flag : 1;
3633  uint32_t constrained_intra_pred_flag : 1;
3634  uint32_t pic_order_present_flag : 1; /* Renamed to bottom_field_pic_order_in_frame_present_flag in newer standard versions. */
3635  uint32_t deblocking_filter_control_present_flag : 1;
3636  uint32_t redundant_pic_cnt_present_flag : 1;
3637  uint32_t reference_pic_flag : 1; /* nal_ref_idc != 0 */
3638  } bits;
3639  uint32_t value;
3640  } pic_fields;
3641  uint16_t frame_num;
3642 
3644  uint32_t va_reserved[VA_PADDING_MEDIUM];
3646 
3648 typedef struct _VAIQMatrixBufferH264 {
3650  uint8_t ScalingList4x4[6][16];
3652  uint8_t ScalingList8x8[2][64];
3653 
3655  uint32_t va_reserved[VA_PADDING_LOW];
3657 
3659 typedef struct _VASliceParameterBufferH264 {
3660  uint32_t slice_data_size;/* number of bytes in the slice data buffer for this slice */
3663  uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
3675  uint16_t first_mb_in_slice;
3676  uint8_t slice_type;
3677  uint8_t direct_spatial_mv_pred_flag;
3692  uint8_t cabac_init_idc;
3693  int8_t slice_qp_delta;
3694  uint8_t disable_deblocking_filter_idc;
3695  int8_t slice_alpha_c0_offset_div2;
3696  int8_t slice_beta_offset_div2;
3697  VAPictureH264 RefPicList0[32]; /* See 8.2.4.2 */
3698  VAPictureH264 RefPicList1[32]; /* See 8.2.4.2 */
3699  uint8_t luma_log2_weight_denom;
3700  uint8_t chroma_log2_weight_denom;
3701  uint8_t luma_weight_l0_flag;
3702  int16_t luma_weight_l0[32];
3703  int16_t luma_offset_l0[32];
3704  uint8_t chroma_weight_l0_flag;
3705  int16_t chroma_weight_l0[32][2];
3706  int16_t chroma_offset_l0[32][2];
3707  uint8_t luma_weight_l1_flag;
3708  int16_t luma_weight_l1[32];
3709  int16_t luma_offset_l1[32];
3710  uint8_t chroma_weight_l1_flag;
3711  int16_t chroma_weight_l1[32][2];
3712  int16_t chroma_offset_l1[32][2];
3713 
3715  uint32_t va_reserved[VA_PADDING_LOW];
3717 
3718 /****************************
3719  * Common encode data structures
3720  ****************************/
3721 typedef enum {
3722  VAEncPictureTypeIntra = 0,
3723  VAEncPictureTypePredictive = 1,
3724  VAEncPictureTypeBidirectional = 2,
3725 } VAEncPictureType;
3726 
3734 typedef struct _VAEncSliceParameterBuffer {
3735  uint32_t start_row_number; /* starting MB row number for this slice */
3736  uint32_t slice_height; /* slice height measured in MB */
3737  union {
3738  struct {
3739  uint32_t is_intra : 1;
3740  uint32_t disable_deblocking_filter_idc : 2;
3741  uint32_t uses_long_term_ref : 1;
3742  uint32_t is_long_term_ref : 1;
3743  } bits;
3744  uint32_t value;
3745  } slice_flags;
3746 
3748  uint32_t va_reserved[VA_PADDING_LOW];
3750 
3751 
3752 /****************************
3753  * H.263 specific encode data structures
3754  ****************************/
3755 
3756 typedef struct _VAEncSequenceParameterBufferH263 {
3757  uint32_t intra_period;
3758  uint32_t bits_per_second;
3759  uint32_t frame_rate;
3760  uint32_t initial_qp;
3761  uint32_t min_qp;
3762 
3764  uint32_t va_reserved[VA_PADDING_LOW];
3765 } VAEncSequenceParameterBufferH263;
3766 
3767 typedef struct _VAEncPictureParameterBufferH263 {
3768  VASurfaceID reference_picture;
3769  VASurfaceID reconstructed_picture;
3770  VABufferID coded_buf;
3771  uint16_t picture_width;
3772  uint16_t picture_height;
3773  VAEncPictureType picture_type;
3774 
3776  uint32_t va_reserved[VA_PADDING_LOW];
3777 } VAEncPictureParameterBufferH263;
3778 
3779 /****************************
3780  * MPEG-4 specific encode data structures
3781  ****************************/
3782 
3783 typedef struct _VAEncSequenceParameterBufferMPEG4 {
3784  uint8_t profile_and_level_indication;
3785  uint32_t intra_period;
3786  uint32_t video_object_layer_width;
3787  uint32_t video_object_layer_height;
3788  uint32_t vop_time_increment_resolution;
3789  uint32_t fixed_vop_rate;
3790  uint32_t fixed_vop_time_increment;
3791  uint32_t bits_per_second;
3792  uint32_t frame_rate;
3793  uint32_t initial_qp;
3794  uint32_t min_qp;
3795 
3797  uint32_t va_reserved[VA_PADDING_LOW];
3798 } VAEncSequenceParameterBufferMPEG4;
3799 
3800 typedef struct _VAEncPictureParameterBufferMPEG4 {
3801  VASurfaceID reference_picture;
3802  VASurfaceID reconstructed_picture;
3803  VABufferID coded_buf;
3804  uint16_t picture_width;
3805  uint16_t picture_height;
3806  uint32_t modulo_time_base; /* number of 1s */
3807  uint32_t vop_time_increment;
3808  VAEncPictureType picture_type;
3809 
3811  uint32_t va_reserved[VA_PADDING_LOW];
3812 } VAEncPictureParameterBufferMPEG4;
3813 
3814 
3815 
3834  VADisplay dpy,
3835  VAContextID context,
3836  VABufferType type, /* in */
3837  unsigned int size, /* in */
3838  unsigned int num_elements, /* in */
3839  void *data, /* in */
3840  VABufferID *buf_id /* out */
3841 );
3842 
3855  VADisplay dpy,
3856  VAContextID context,
3857  VABufferType type,
3858  unsigned int width,
3859  unsigned int height,
3860  unsigned int *unit_size,
3861  unsigned int *pitch,
3862  VABufferID *buf_id
3863 );
3864 
3872  VADisplay dpy,
3873  VABufferID buf_id, /* in */
3874  unsigned int num_elements /* in */
3875 );
3876 
3877 
3882 /*
3883  * FICTURE_AVE_QP(bit7-0): The average Qp value used during this frame
3884  * LARGE_SLICE(bit8):At least one slice in the current frame was large
3885  * enough for the encoder to attempt to limit its size.
3886  * SLICE_OVERFLOW(bit9): At least one slice in the current frame has
3887  * exceeded the maximum slice size specified.
3888  * BITRATE_OVERFLOW(bit10): The peak bitrate was exceeded for this frame.
3889  * BITRATE_HIGH(bit11): The frame size got within the safety margin of the maximum size (VCM only)
3890  * AIR_MB_OVER_THRESHOLD: the number of MBs adapted to Intra MB
3891  */
3892 #define VA_CODED_BUF_STATUS_PICTURE_AVE_QP_MASK 0xff
3893 #define VA_CODED_BUF_STATUS_LARGE_SLICE_MASK 0x100
3894 #define VA_CODED_BUF_STATUS_SLICE_OVERFLOW_MASK 0x200
3895 #define VA_CODED_BUF_STATUS_BITRATE_OVERFLOW 0x400
3896 #define VA_CODED_BUF_STATUS_BITRATE_HIGH 0x800
3904 #define VA_CODED_BUF_STATUS_FRAME_SIZE_OVERFLOW 0x1000
3908 #define VA_CODED_BUF_STATUS_BAD_BITSTREAM 0x8000
3909 #define VA_CODED_BUF_STATUS_AIR_MB_OVER_THRESHOLD 0xff0000
3910 
3919 #define VA_CODED_BUF_STATUS_NUMBER_PASSES_MASK 0xf000000
3920 
3928 #define VA_CODED_BUF_STATUS_SINGLE_NALU 0x10000000
3929 
3940 typedef struct _VACodedBufferSegment {
3944  uint32_t size;
3946  uint32_t bit_offset;
3948  uint32_t status;
3950  uint32_t reserved;
3952  void *buf;
3957  void *next;
3958 
3960  uint32_t va_reserved[VA_PADDING_LOW];
3962 
3971 VAStatus vaMapBuffer(
3972  VADisplay dpy,
3973  VABufferID buf_id, /* in */
3974  void **pbuf /* out */
3975 );
3976 
3986 #define VA_MAPBUFFER_FLAG_DEFAULT 0
3988 #define VA_MAPBUFFER_FLAG_READ 1
3990 #define VA_MAPBUFFER_FLAG_WRITE 2
3991 
3992 VAStatus vaMapBuffer2(
3993  VADisplay dpy,
3994  VABufferID buf_id, /* in */
3995  void **pbuf, /* out */
3996  uint32_t flags /* in */
3997 );
3998 
4004 VAStatus vaUnmapBuffer(
4005  VADisplay dpy,
4006  VABufferID buf_id /* in */
4007 );
4008 
4019  VADisplay dpy,
4020  VABufferID buffer_id
4021 );
4022 
4024 typedef struct {
4026  uintptr_t handle;
4028  uint32_t type;
4037  uint32_t mem_type;
4039  size_t mem_size;
4040 
4042  uint32_t va_reserved[VA_PADDING_LOW];
4043 } VABufferInfo;
4044 
4092 VAStatus
4094 
4125 VAStatus
4127 
4133 #define VA_EXPORT_SURFACE_READ_ONLY 0x0001
4135 #define VA_EXPORT_SURFACE_WRITE_ONLY 0x0002
4137 #define VA_EXPORT_SURFACE_READ_WRITE 0x0003
4143 #define VA_EXPORT_SURFACE_SEPARATE_LAYERS 0x0004
4149 #define VA_EXPORT_SURFACE_COMPOSED_LAYERS 0x0008
4150 
4186  VASurfaceID surface_id,
4187  uint32_t mem_type, uint32_t flags,
4188  void *descriptor);
4189 
4206  VADisplay dpy,
4207  VAContextID context,
4208  VASurfaceID render_target
4209 );
4210 
4215  VADisplay dpy,
4216  VAContextID context,
4217  VABufferID *buffers,
4218  int num_buffers
4219 );
4220 
4229 VAStatus vaEndPicture(
4230  VADisplay dpy,
4231  VAContextID context
4232 );
4233 
4253 VAStatus vaMFSubmit(
4254  VADisplay dpy,
4255  VAMFContextID mf_context,
4256  VAContextID * contexts,
4257  int num_contexts
4258 );
4259 
4260 /*
4261 
4262 Synchronization
4263 
4264 */
4265 
4271 VAStatus vaSyncSurface(
4272  VADisplay dpy,
4273  VASurfaceID render_target
4274 );
4275 
4277 #define VA_TIMEOUT_INFINITE 0xFFFFFFFFFFFFFFFF
4278 
4300  VADisplay dpy,
4301  VASurfaceID surface,
4302  uint64_t timeout_ns
4303 );
4304 
4305 typedef enum {
4306  VASurfaceRendering = 1, /* Rendering in progress */
4307  VASurfaceDisplaying = 2, /* Displaying in progress (not safe to render into it) */
4308  /* this status is useful if surface is used as the source */
4309  /* of an overlay */
4310  VASurfaceReady = 4, /* not being rendered or displayed */
4311  VASurfaceSkipped = 8 /* Indicate a skipped frame during encode */
4312 } VASurfaceStatus;
4313 
4318  VADisplay dpy,
4319  VASurfaceID render_target,
4320  VASurfaceStatus *status /* out */
4321 );
4322 
4323 typedef enum {
4324  VADecodeSliceMissing = 0,
4325  VADecodeMBError = 1,
4326  VADecodeReset = 2,
4327 } VADecodeErrorType;
4328 
4333 typedef struct _VASurfaceDecodeMBErrors {
4334  int32_t status; /* 1 if hardware has returned detailed info below, -1 means this record is invalid */
4335  uint32_t start_mb; /* start mb address with errors */
4336  uint32_t end_mb; /* end mb address with errors */
4337  VADecodeErrorType decode_error_type;
4338  uint32_t num_mb; /* number of mbs with errors */
4340  uint32_t va_reserved[VA_PADDING_LOW - 1];
4342 
4358  VADisplay dpy,
4359  VASurfaceID surface,
4360  VAStatus error_status,
4361  void **error_info
4362 );
4363 
4384 VAStatus vaSyncBuffer(
4385  VADisplay dpy,
4386  VABufferID buf_id,
4387  uint64_t timeout_ns
4388 );
4389 
4411 #define VA_FOURCC(ch0, ch1, ch2, ch3) \
4412  ((unsigned long)(unsigned char) (ch0) | ((unsigned long)(unsigned char) (ch1) << 8) | \
4413  ((unsigned long)(unsigned char) (ch2) << 16) | ((unsigned long)(unsigned char) (ch3) << 24 ))
4414 
4415 /* Pre-defined fourcc codes. */
4416 
4420 #define VA_FOURCC_NV12 0x3231564E
4424 #define VA_FOURCC_NV21 0x3132564E
4425 
4430 #define VA_FOURCC_AI44 0x34344149
4431 
4436 #define VA_FOURCC_RGBA 0x41424752
4441 #define VA_FOURCC_RGBX 0x58424752
4446 #define VA_FOURCC_BGRA 0x41524742
4451 #define VA_FOURCC_BGRX 0x58524742
4456 #define VA_FOURCC_ARGB 0x42475241
4461 #define VA_FOURCC_XRGB 0x42475258
4466 #define VA_FOURCC_ABGR 0x52474241
4471 #define VA_FOURCC_XBGR 0x52474258
4472 
4477 #define VA_FOURCC_UYVY 0x59565955
4482 #define VA_FOURCC_YUY2 0x32595559
4487 #define VA_FOURCC_AYUV 0x56555941
4492 #define VA_FOURCC_NV11 0x3131564e
4497 #define VA_FOURCC_YV12 0x32315659
4502 #define VA_FOURCC_P208 0x38303250
4507 #define VA_FOURCC_I420 0x30323449
4512 #define VA_FOURCC_YV24 0x34325659
4517 #define VA_FOURCC_YV32 0x32335659
4520 #define VA_FOURCC_Y800 0x30303859
4526 #define VA_FOURCC_IMC3 0x33434D49
4531 #define VA_FOURCC_411P 0x50313134
4537 #define VA_FOURCC_411R 0x52313134
4542 #define VA_FOURCC_422H 0x48323234
4547 #define VA_FOURCC_422V 0x56323234
4552 #define VA_FOURCC_444P 0x50343434
4553 
4558 #define VA_FOURCC_RGBP 0x50424752
4563 #define VA_FOURCC_BGRP 0x50524742
4569 #define VA_FOURCC_RGB565 0x36314752
4575 #define VA_FOURCC_BGR565 0x36314742
4576 
4582 #define VA_FOURCC_Y210 0x30313259
4588 #define VA_FOURCC_Y212 0x32313259
4594 #define VA_FOURCC_Y216 0x36313259
4600 #define VA_FOURCC_Y410 0x30313459
4606 #define VA_FOURCC_Y412 0x32313459
4612 #define VA_FOURCC_Y416 0x36313459
4613 
4618 #define VA_FOURCC_YV16 0x36315659
4624 #define VA_FOURCC_P010 0x30313050
4630 #define VA_FOURCC_P012 0x32313050
4636 #define VA_FOURCC_P016 0x36313050
4637 
4643 #define VA_FOURCC_I010 0x30313049
4644 
4649 #define VA_FOURCC_IYUV 0x56555949
4653 #define VA_FOURCC_A2R10G10B10 0x30335241 /* VA_FOURCC('A','R','3','0') */
4657 #define VA_FOURCC_A2B10G10R10 0x30334241 /* VA_FOURCC('A','B','3','0') */
4661 #define VA_FOURCC_X2R10G10B10 0x30335258 /* VA_FOURCC('X','R','3','0') */
4665 #define VA_FOURCC_X2B10G10R10 0x30334258 /* VA_FOURCC('X','B','3','0') */
4666 
4671 #define VA_FOURCC_Y8 0x20203859
4676 #define VA_FOURCC_Y16 0x20363159
4681 #define VA_FOURCC_VYUY 0x59555956
4686 #define VA_FOURCC_YVYU 0x55595659
4691 #define VA_FOURCC_ARGB64 0x34475241
4696 #define VA_FOURCC_ABGR64 0x34474241
4701 #define VA_FOURCC_XYUV 0x56555958
4706 #define VA_FOURCC_Q416 0x36313451
4707 
4708 /* byte order */
4709 #define VA_LSB_FIRST 1
4710 #define VA_MSB_FIRST 2
4711 
4712 typedef struct _VAImageFormat {
4713  uint32_t fourcc;
4714  uint32_t byte_order; /* VA_LSB_FIRST, VA_MSB_FIRST */
4715  uint32_t bits_per_pixel;
4716  /* for RGB formats */
4717  uint32_t depth; /* significant bits per pixel */
4718  uint32_t red_mask;
4719  uint32_t green_mask;
4720  uint32_t blue_mask;
4721  uint32_t alpha_mask;
4722 
4724  uint32_t va_reserved[VA_PADDING_LOW];
4725 } VAImageFormat;
4726 
4727 typedef VAGenericID VAImageID;
4728 
4729 typedef struct _VAImage {
4730  VAImageID image_id; /* uniquely identify this image */
4731  VAImageFormat format;
4732  VABufferID buf; /* image data buffer */
4733  /*
4734  * Image data will be stored in a buffer of type VAImageBufferType to facilitate
4735  * data store on the server side for optimal performance. The buffer will be
4736  * created by the CreateImage function, and proper storage allocated based on the image
4737  * size and format. This buffer is managed by the library implementation, and
4738  * accessed by the client through the buffer Map/Unmap functions.
4739  */
4740  uint16_t width;
4741  uint16_t height;
4742  uint32_t data_size;
4743  uint32_t num_planes; /* can not be greater than 3 */
4744  /*
4745  * An array indicating the scanline pitch in bytes for each plane.
4746  * Each plane may have a different pitch. Maximum 3 planes for planar formats
4747  */
4748  uint32_t pitches[3];
4749  /*
4750  * An array indicating the byte offset from the beginning of the image data
4751  * to the start of each plane.
4752  */
4753  uint32_t offsets[3];
4754 
4755  /* The following fields are only needed for paletted formats */
4756  int32_t num_palette_entries; /* set to zero for non-palette images */
4757  /*
4758  * Each component is one byte and entry_bytes indicates the number of components in
4759  * each entry (eg. 3 for YUV palette entries). set to zero for non-palette images
4760  */
4761  int32_t entry_bytes;
4762  /*
4763  * An array of ascii characters describing the order of the components within the bytes.
4764  * Only entry_bytes characters of the string are used.
4765  */
4766  int8_t component_order[4];
4767 
4769  uint32_t va_reserved[VA_PADDING_LOW];
4770 } VAImage;
4771 
4774  VADisplay dpy
4775 );
4776 
4784  VADisplay dpy,
4785  VAImageFormat *format_list, /* out */
4786  int *num_formats /* out */
4787 );
4788 
4796 VAStatus vaCreateImage(
4797  VADisplay dpy,
4798  VAImageFormat *format,
4799  int width,
4800  int height,
4801  VAImage *image /* out */
4802 );
4803 
4808  VADisplay dpy,
4809  VAImageID image
4810 );
4811 
4812 VAStatus vaSetImagePalette(
4813  VADisplay dpy,
4814  VAImageID image,
4815  /*
4816  * pointer to an array holding the palette data. The size of the array is
4817  * num_palette_entries * entry_bytes in size. The order of the components
4818  * in the palette is described by the component_order in VAImage struct
4819  */
4820  unsigned char *palette
4821 );
4822 
4827 VAStatus vaGetImage(
4828  VADisplay dpy,
4829  VASurfaceID surface,
4830  int x, /* coordinates of the upper left source pixel */
4831  int y,
4832  unsigned int width, /* width and height of the region */
4833  unsigned int height,
4834  VAImageID image
4835 );
4836 
4843 VAStatus vaPutImage(
4844  VADisplay dpy,
4845  VASurfaceID surface,
4846  VAImageID image,
4847  int src_x,
4848  int src_y,
4849  unsigned int src_width,
4850  unsigned int src_height,
4851  int dest_x,
4852  int dest_y,
4853  unsigned int dest_width,
4854  unsigned int dest_height
4855 );
4856 
4888 VAStatus vaDeriveImage(
4889  VADisplay dpy,
4890  VASurfaceID surface,
4891  VAImage *image /* out */
4892 );
4893 
4902 
4905  VADisplay dpy
4906 );
4907 
4909 #define VA_SUBPICTURE_CHROMA_KEYING 0x0001
4910 #define VA_SUBPICTURE_GLOBAL_ALPHA 0x0002
4911 #define VA_SUBPICTURE_DESTINATION_IS_SCREEN_COORD 0x0004
4925  VADisplay dpy,
4926  VAImageFormat *format_list, /* out */
4927  unsigned int *flags, /* out */
4928  unsigned int *num_formats /* out */
4929 );
4930 
4935  VADisplay dpy,
4936  VAImageID image,
4937  VASubpictureID *subpicture /* out */
4938 );
4939 
4944  VADisplay dpy,
4945  VASubpictureID subpicture
4946 );
4947 
4953  VADisplay dpy,
4954  VASubpictureID subpicture,
4955  VAImageID image
4956 );
4957 
4968  VADisplay dpy,
4969  VASubpictureID subpicture,
4970  unsigned int chromakey_min,
4971  unsigned int chromakey_max,
4972  unsigned int chromakey_mask
4973 );
4974 
4981  VADisplay dpy,
4982  VASubpictureID subpicture,
4983  float global_alpha
4984 );
4985 
4994  VADisplay dpy,
4995  VASubpictureID subpicture,
4996  VASurfaceID *target_surfaces,
4997  int num_surfaces,
4998  int16_t src_x, /* upper left offset in subpicture */
4999  int16_t src_y,
5000  uint16_t src_width,
5001  uint16_t src_height,
5002  int16_t dest_x, /* upper left offset in surface */
5003  int16_t dest_y,
5004  uint16_t dest_width,
5005  uint16_t dest_height,
5006  /*
5007  * whether to enable chroma-keying, global-alpha, or screen relative mode
5008  * see VA_SUBPICTURE_XXX values
5009  */
5010  uint32_t flags
5011 );
5012 
5017  VADisplay dpy,
5018  VASubpictureID subpicture,
5019  VASurfaceID *target_surfaces,
5020  int num_surfaces
5021 );
5022 
5040 /* PowerVR IEP Lite attributes */
5041 typedef enum {
5042  VADISPLAYATTRIB_BLE_OFF = 0x00,
5043  VADISPLAYATTRIB_BLE_LOW,
5044  VADISPLAYATTRIB_BLE_MEDIUM,
5045  VADISPLAYATTRIB_BLE_HIGH,
5046  VADISPLAYATTRIB_BLE_NONE,
5048 
5050 #define VA_ROTATION_NONE 0x00000000
5051 #define VA_ROTATION_90 0x00000001
5052 #define VA_ROTATION_180 0x00000002
5053 #define VA_ROTATION_270 0x00000003
5065 #define VA_MIRROR_NONE 0x00000000
5067 #define VA_MIRROR_HORIZONTAL 0x00000001
5069 #define VA_MIRROR_VERTICAL 0x00000002
5073 #define VA_OOL_DEBLOCKING_FALSE 0x00000000
5074 #define VA_OOL_DEBLOCKING_TRUE 0x00000001
5075 
5077 #define VA_RENDER_MODE_UNDEFINED 0
5078 #define VA_RENDER_MODE_LOCAL_OVERLAY 1
5079 #define VA_RENDER_MODE_LOCAL_GPU 2
5080 #define VA_RENDER_MODE_EXTERNAL_OVERLAY 4
5081 #define VA_RENDER_MODE_EXTERNAL_GPU 8
5082 
5084 #define VA_RENDER_DEVICE_UNDEFINED 0
5085 #define VA_RENDER_DEVICE_LOCAL 1
5086 #define VA_RENDER_DEVICE_EXTERNAL 2
5087 
5101 typedef union _VADisplayAttribValSubDevice {
5102  struct {
5104  uint32_t current_sub_device : 4;
5106  uint32_t sub_device_count : 4;
5108  uint32_t reserved : 8;
5124  uint32_t sub_device_mask : 16;
5125  } bits;
5126  uint32_t value;
5128 
5130 typedef enum {
5131  VADisplayAttribBrightness = 0,
5132  VADisplayAttribContrast = 1,
5133  VADisplayAttribHue = 2,
5134  VADisplayAttribSaturation = 3,
5135  /* client can specifiy a background color for the target window
5136  * the new feature of video conference,
5137  * the uncovered area of the surface is filled by this color
5138  * also it will blend with the decoded video color
5139  */
5140  VADisplayAttribBackgroundColor = 4,
5141  /*
5142  * this is a gettable only attribute. For some implementations that use the
5143  * hardware overlay, after PutSurface is called, the surface can not be
5144  * re-used until after the subsequent PutSurface call. If this is the case
5145  * then the value for this attribute will be set to 1 so that the client
5146  * will not attempt to re-use the surface right after returning from a call
5147  * to PutSurface.
5148  *
5149  * Don't use it, use flag VASurfaceDisplaying of vaQuerySurfaceStatus since
5150  * driver may use overlay or GPU alternatively
5151  */
5152  VADisplayAttribDirectSurface = 5,
5153  VADisplayAttribRotation = 6,
5154  VADisplayAttribOutofLoopDeblock = 7,
5155 
5156  /* PowerVR IEP Lite specific attributes */
5157  VADisplayAttribBLEBlackMode = 8,
5158  VADisplayAttribBLEWhiteMode = 9,
5159  VADisplayAttribBlueStretch = 10,
5160  VADisplayAttribSkinColorCorrection = 11,
5161  /*
5162  * For type VADisplayAttribCSCMatrix, "value" field is a pointer to the color
5163  * conversion matrix. Each element in the matrix is float-point
5164  */
5165  VADisplayAttribCSCMatrix = 12,
5166  /* specify the constant color used to blend with video surface
5167  * Cd = Cv*Cc*Ac + Cb *(1 - Ac) C means the constant RGB
5168  * d: the final color to overwrite into the frame buffer
5169  * v: decoded video after color conversion,
5170  * c: video color specified by VADisplayAttribBlendColor
5171  * b: background color of the drawable
5172  */
5173  VADisplayAttribBlendColor = 13,
5174  /*
5175  * Indicate driver to skip painting color key or not.
5176  * only applicable if the render is overlay
5177  */
5178  VADisplayAttribOverlayAutoPaintColorKey = 14,
5179  /*
5180  * customized overlay color key, the format is RGB888
5181  * [23:16] = Red, [15:08] = Green, [07:00] = Blue.
5182  */
5183  VADisplayAttribOverlayColorKey = 15,
5184  /*
5185  * The hint for the implementation of vaPutSurface
5186  * normally, the driver could use an overlay or GPU to render the surface on the screen
5187  * this flag provides APP the flexibity to switch the render dynamically
5188  */
5189  VADisplayAttribRenderMode = 16,
5190  /*
5191  * specify if vaPutSurface needs to render into specified monitors
5192  * one example is that one external monitor (e.g. HDMI) is enabled,
5193  * but the window manager is not aware of it, and there is no associated drawable
5194  */
5195  VADisplayAttribRenderDevice = 17,
5196  /*
5197  * specify vaPutSurface render area if there is no drawable on the monitor
5198  */
5199  VADisplayAttribRenderRect = 18,
5200  /*
5201  * HW attribute, read/write, specify the sub device configure
5202  */
5203  VADisplayAttribSubDevice = 19,
5204  /*
5205  * HW attribute. read only. specify whether vaCopy support on current HW
5206  * The value of each bit should equal to 1 << VA_EXEC_MODE_XXX to represent
5207  * modes of vaCopy
5208  */
5209  VADisplayAttribCopy = 20,
5210  /*
5211  * HW attribute. read only. retrieve the device information from backend driver
5212  * the value should be combined with vendor ID << 16 | device ID
5213  */
5214  VADisplayPCIID = 21,
5216 
5217 /* flags for VADisplayAttribute */
5218 #define VA_DISPLAY_ATTRIB_NOT_SUPPORTED 0x0000
5219 #define VA_DISPLAY_ATTRIB_GETTABLE 0x0001
5220 #define VA_DISPLAY_ATTRIB_SETTABLE 0x0002
5221 
5222 typedef struct _VADisplayAttribute {
5223  VADisplayAttribType type;
5224  int32_t min_value;
5225  int32_t max_value;
5226  int32_t value; /* used by the set/get attribute functions */
5227  /* flags can be VA_DISPLAY_ATTRIB_GETTABLE or VA_DISPLAY_ATTRIB_SETTABLE or OR'd together */
5228  uint32_t flags;
5229 
5231  uint32_t va_reserved[VA_PADDING_LOW];
5232 } VADisplayAttribute;
5233 
5236  VADisplay dpy
5237 );
5238 
5246  VADisplay dpy,
5247  VADisplayAttribute *attr_list, /* out */
5248  int *num_attributes /* out */
5249 );
5250 
5258  VADisplay dpy,
5259  VADisplayAttribute *attr_list, /* in/out */
5260  int num_attributes
5261 );
5262 
5270  VADisplay dpy,
5271  VADisplayAttribute *attr_list,
5272  int num_attributes
5273 );
5274 
5275 /****************************
5276  * HEVC data structures
5277  ****************************/
5287 typedef struct _VAPictureHEVC {
5291  VASurfaceID picture_id;
5296  int32_t pic_order_cnt;
5297  /* described below */
5298  uint32_t flags;
5299 
5301  uint32_t va_reserved[VA_PADDING_LOW];
5302 } VAPictureHEVC;
5303 
5304 /* flags in VAPictureHEVC could be OR of the following */
5305 #define VA_PICTURE_HEVC_INVALID 0x00000001
5309 #define VA_PICTURE_HEVC_FIELD_PIC 0x00000002
5314 #define VA_PICTURE_HEVC_BOTTOM_FIELD 0x00000004
5316 #define VA_PICTURE_HEVC_LONG_TERM_REFERENCE 0x00000008
5331 #define VA_PICTURE_HEVC_RPS_ST_CURR_BEFORE 0x00000010
5336 #define VA_PICTURE_HEVC_RPS_ST_CURR_AFTER 0x00000020
5341 #define VA_PICTURE_HEVC_RPS_LT_CURR 0x00000040
5342 
5343 /****************************
5344  * VVC data structures
5345  ****************************/
5353 typedef struct _VAPictureVVC {
5357  VASurfaceID picture_id;
5358 
5360  int32_t pic_order_cnt;
5361 
5362  /* described below */
5363  uint32_t flags;
5364 
5366  uint32_t va_reserved[VA_PADDING_LOW];
5367 } VAPictureVVC;
5368 
5369 /* flags in VAPictureVVC could be OR of the following */
5370 #define VA_PICTURE_VVC_INVALID 0x00000001
5372 #define VA_PICTURE_VVC_LONG_TERM_REFERENCE 0x00000002
5378 #define VA_PICTURE_VVC_UNAVAILABLE_REFERENCE 0x00000004
5379 
5380 typedef enum {
5381  VACopyObjectSurface = 0,
5382  VACopyObjectBuffer = 1,
5383 } VACopyObjectType;
5384 
5385 typedef struct _VACopyObject {
5386  VACopyObjectType obj_type; // type of object.
5387  union {
5388  VASurfaceID surface_id;
5389  VABufferID buffer_id;
5390  } object;
5391 
5392  uint32_t va_reserved[VA_PADDING_MEDIUM];
5393 } VACopyObject;
5394 
5395 typedef union _VACopyOption {
5396  struct {
5398  uint32_t va_copy_sync : 2;
5400  uint32_t va_copy_mode : 4;
5401  uint32_t reserved : 26;
5402  } bits;
5403  uint32_t value;
5404 } VACopyOption;
5405 
5418 VAStatus vaCopy(VADisplay dpy, VACopyObject * dst, VACopyObject * src, VACopyOption option);
5419 
5420 #include <va/va_dec_hevc.h>
5421 #include <va/va_dec_jpeg.h>
5422 #include <va/va_dec_vp8.h>
5423 #include <va/va_dec_vp9.h>
5424 #include <va/va_dec_av1.h>
5425 #include <va/va_dec_vvc.h>
5426 #include <va/va_enc_hevc.h>
5427 #include <va/va_fei_hevc.h>
5428 #include <va/va_enc_h264.h>
5429 #include <va/va_enc_jpeg.h>
5430 #include <va/va_enc_mpeg2.h>
5431 #include <va/va_enc_vp8.h>
5432 #include <va/va_enc_vp9.h>
5433 #include <va/va_enc_av1.h>
5434 #include <va/va_fei.h>
5435 #include <va/va_fei_h264.h>
5436 #include <va/va_vpp.h>
5437 #include <va/va_prot.h>
5438 
5441 #ifdef __cplusplus
5442 }
5443 #endif
5444 
5445 #endif /* _VA_H_ */
VAStatus vaTerminate(VADisplay dpy)
VAMvModeVC1
Definition: va.h:3359
VAEncMiscParameterType
Definition: va.h:2379
VADisplayAttribBLEMode
Definition: va.h:5041
VAStatus vaDestroySurfaces(VADisplay dpy, VASurfaceID *surfaces, int num_surfaces)
VAGenericID VASubpictureID
Definition: va.h:4901
int vaMaxNumConfigAttributes(VADisplay dpy)
const char * vaErrorStr(VAStatus error_status)
VAStatus vaQueryConfigProfiles(VADisplay dpy, VAProfile *profile_list, int *num_profiles)
VAGenericValueType
Generic value types.
Definition: va.h:1651
VAStatus vaDestroyContext(VADisplay dpy, VAContextID context)
VABufferType
Definition: va.h:2044
VAStatus vaInitialize(VADisplay dpy, int *major_version, int *minor_version)
void(* VAMessageCallback)(void *user_context, const char *message)
Definition: va.h:430
VAStatus vaMFReleaseContext(VADisplay dpy, VAMFContextID mf_context, VAContextID context)
VAConfigAttribType
Definition: va.h:619
VAStatus vaSetDriverName(VADisplay dpy, char *driver_name)
VAStatus vaAcquireBufferHandle(VADisplay dpy, VABufferID buf_id, VABufferInfo *buf_info)
Acquires buffer handle for external API usage.
void(* VAGenericFunc)(void)
Generic function type.
Definition: va.h:1659
VAStatus vaSetSubpictureChromakey(VADisplay dpy, VASubpictureID subpicture, unsigned int chromakey_min, unsigned int chromakey_max, unsigned int chromakey_mask)
VAStatus vaGetImage(VADisplay dpy, VASurfaceID surface, int x, int y, unsigned int width, unsigned int height, VAImageID image)
VAStatus vaQuerySurfaceError(VADisplay dpy, VASurfaceID surface, VAStatus error_status, void **error_info)
VAStatus vaRenderPicture(VADisplay dpy, VAContextID context, VABufferID *buffers, int num_buffers)
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.
VAStatus vaSetSubpictureImage(VADisplay dpy, VASubpictureID subpicture, VAImageID image)
int vaMaxNumProfiles(VADisplay dpy)
VAGenericID VAContextID
Definition: va.h:1643
VASurfaceAttribType
Surface attribute types.
Definition: va.h:1689
int vaMaxNumEntrypoints(VADisplay dpy)
VAStatus vaQueryConfigAttributes(VADisplay dpy, VAConfigID config_id, VAProfile *profile, VAEntrypoint *entrypoint, VAConfigAttrib *attrib_list, int *num_attribs)
VAStatus vaQuerySurfaceStatus(VADisplay dpy, VASurfaceID render_target, VASurfaceStatus *status)
VAEntrypoint
Definition: va.h:552
const char * vaQueryVendorString(VADisplay dpy)
VAStatus vaDestroyConfig(VADisplay dpy, VAConfigID config_id)
VAStatus vaQuerySurfaceAttributes(VADisplay dpy, VAConfigID config, VASurfaceAttrib *attrib_list, unsigned int *num_attribs)
Queries surface attributes for the supplied config.
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)
VAStatus vaCreateSubpicture(VADisplay dpy, VAImageID image, VASubpictureID *subpicture)
VAMessageCallback vaSetErrorCallback(VADisplay dpy, VAMessageCallback callback, void *user_context)
VAStatus vaCreateContext(VADisplay dpy, VAConfigID config_id, int picture_width, int picture_height, int flag, VASurfaceID *render_targets, int num_render_targets, VAContextID *context)
VAStatus vaQueryConfigEntrypoints(VADisplay dpy, VAProfile profile, VAEntrypoint *entrypoint_list, int *num_entrypoints)
void * VANativeDisplay
Definition: va.h:451
VAStatus vaSetSubpictureGlobalAlpha(VADisplay dpy, VASubpictureID subpicture, float global_alpha)
VAStatus vaCreateImage(VADisplay dpy, VAImageFormat *format, int width, int height, VAImage *image)
VAEncPackedHeaderType
Packed header type.
Definition: va.h:2419
VAStatus vaSyncSurface2(VADisplay dpy, VASurfaceID surface, uint64_t timeout_ns)
Synchronizes pending operations associated with the supplied surface.
VAStatus vaCreateConfig(VADisplay dpy, VAProfile profile, VAEntrypoint entrypoint, VAConfigAttrib *attrib_list, int num_attribs, VAConfigID *config_id)
VAStatus vaSyncSurface(VADisplay dpy, VASurfaceID render_target)
VAStatus vaDestroyBuffer(VADisplay dpy, VABufferID buffer_id)
VAProfile
Definition: va.h:502
VAStatus vaQuerySubpictureFormats(VADisplay dpy, VAImageFormat *format_list, unsigned int *flags, unsigned int *num_formats)
VAStatus vaDestroySubpicture(VADisplay dpy, VASubpictureID subpicture)
#define VA_PADDING_LOW
Definition: va.h:360
VAStatus vaDeriveImage(VADisplay dpy, VASurfaceID surface, VAImage *image)
VAStatus vaMFAddContext(VADisplay dpy, VAMFContextID mf_context, VAContextID context)
unsigned int VAGenericID
Definition: va.h:1580
VAStatus vaCreateBuffer(VADisplay dpy, VAContextID context, VABufferType type, unsigned int size, unsigned int num_elements, void *data, VABufferID *buf_id)
VAStatus vaDeassociateSubpicture(VADisplay dpy, VASubpictureID subpicture, VASurfaceID *target_surfaces, int num_surfaces)
VAStatus vaDestroyImage(VADisplay dpy, VAImageID image)
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)
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.
VAStatus vaSyncBuffer(VADisplay dpy, VABufferID buf_id, uint64_t timeout_ns)
Synchronizes pending operations associated with the supplied buffer.
VAStatus vaQueryImageFormats(VADisplay dpy, VAImageFormat *format_list, int *num_formats)
VAPrivFunc vaGetLibFunc(VADisplay dpy, const char *func)
VAStatus vaBeginPicture(VADisplay dpy, VAContextID context, VASurfaceID render_target)
VAStatus vaBufferSetNumElements(VADisplay dpy, VABufferID buf_id, unsigned int num_elements)
VAGenericID VABufferID
Definition: va.h:2042
int vaMaxNumImageFormats(VADisplay dpy)
VAStatus vaCreateMFContext(VADisplay dpy, VAMFContextID *mf_context)
void * VADisplay
Definition: va.h:260
VAStatus vaCreateBuffer2(VADisplay dpy, VAContextID context, VABufferType type, unsigned int width, unsigned int height, unsigned int *unit_size, unsigned int *pitch, VABufferID *buf_id)
VAStatus vaReleaseBufferHandle(VADisplay dpy, VABufferID buf_id)
Releases buffer after usage from external API.
VAStatus vaMFSubmit(VADisplay dpy, VAMFContextID mf_context, VAContextID *contexts, int num_contexts)
VAStatus vaQueryProcessingRate(VADisplay dpy, VAConfigID config, VAProcessingRateParameter *proc_buf, unsigned int *processing_rate)
Queries processing rate for the supplied config.
VAStatus vaGetConfigAttributes(VADisplay dpy, VAProfile profile, VAEntrypoint entrypoint, VAConfigAttrib *attrib_list, int num_attribs)
VAStatus vaUnmapBuffer(VADisplay dpy, VABufferID buf_id)
VAMessageCallback vaSetInfoCallback(VADisplay dpy, VAMessageCallback callback, void *user_context)
VAStatus vaMapBuffer(VADisplay dpy, VABufferID buf_id, void **pbuf)
int vaMaxNumSubpictureFormats(VADisplay dpy)
VAStatus vaEndPicture(VADisplay dpy, VAContextID context)
@ VAEncMiscParameterTypeExtensionData
encode extension buffer, ect. MPEG2 Sequence extenstion data
Definition: va.h:2415
@ VAEncMiscParameterTypeParallelBRC
Buffer type used for parallel BRC parameters.
Definition: va.h:2405
@ VAEncMiscParameterTypeRIR
Buffer type used for Rolling intra refresh.
Definition: va.h:2390
@ VAEncMiscParameterTypeCustomRoundingControl
Buffer type used for encoder rounding offset parameters.
Definition: va.h:2411
@ VAEncMiscParameterTypeHRD
Buffer type used for HRD parameters.
Definition: va.h:2387
@ VAEncMiscParameterTypeROI
Buffer type used for region-of-interest (ROI) parameters.
Definition: va.h:2397
@ VAEncMiscParameterTypeSubMbPartPel
Set MB partion mode mask and Half-pel/Quant-pel motion search.
Definition: va.h:2407
@ VAEncMiscParameterTypeEncQuality
set encode quality tuning
Definition: va.h:2409
@ VAEncMiscParameterTypeDirtyRect
Buffer type used for dirty region-of-interest (ROI) parameters.
Definition: va.h:2403
@ VAEncMiscParameterTypeQuantization
Buffer type used for quantization parameters, it's per-sequence parameter.
Definition: va.h:2392
@ VAEncMiscParameterTypeTemporalLayerStructure
Buffer type used for temporal layer structure.
Definition: va.h:2401
@ VAEncMiscParameterTypeMaxFrameSize
Buffer type used to express a maximum frame size (in bits).
Definition: va.h:2385
@ VAEncMiscParameterTypeMultiPassFrameSize
Buffer type used to express a maximum frame size (in bytes) settings for multiple pass.
Definition: va.h:2399
@ VAEncMiscParameterTypeSkipFrame
Buffer type used for sending skip frame parameters to the encoder's rate control, when the user has e...
Definition: va.h:2395
@ VAEncMiscParameterTypeFEIFrameControl
Buffer type used for FEI input frame level parameters.
Definition: va.h:2413
@ VAGenericValueTypeInteger
Definition: va.h:1652
@ VAGenericValueTypeFloat
Definition: va.h:1653
@ VAGenericValueTypePointer
Definition: va.h:1654
@ VAGenericValueTypeFunc
Definition: va.h:1655
@ VAProcPipelineParameterBufferType
Video processing pipeline parameter buffer.
Definition: va.h:2086
@ VASubsetsParameterBufferType
HEVC Decoding Subset Parameter buffer type.
Definition: va.h:2146
@ VAContextParameterUpdateBufferType
adjust context parameters dynamically
Definition: va.h:2152
@ VASubPicBufferType
VVC SubPic data buffer.
Definition: va.h:2195
@ VAEncQPBufferType
Encoding QP buffer.
Definition: va.h:2078
@ VAEncMacroblockDisableSkipMapBufferType
Definition: va.h:2121
@ VATileBufferType
VVC Tile Dimension data buffer.
Definition: va.h:2201
@ VAProtectedSessionExecuteBufferType
Protected session execution buffer type.
Definition: va.h:2159
@ VAEncFEICTBCmdBufferType
HEVC FEI CTB level cmd buffer it is CTB level information for future usage.
Definition: va.h:2126
@ VAProcFilterParameterBufferType
Video filter parameter buffer.
Definition: va.h:2099
@ VAStatsStatisticsBufferType
Statistics output for VAEntrypointStats progressive and top field of interlaced case.
Definition: va.h:2110
@ VASliceStructBufferType
VVC Slice Structure data buffer.
Definition: va.h:2207
@ VAAlfBufferType
VVC ALF data buffer.
Definition: va.h:2183
@ VALmcsBufferType
VVC LMCS data buffer.
Definition: va.h:2189
@ VAStatsStatisticsBottomFieldBufferType
Statistics output for VAEntrypointStats bottom field of interlaced case.
Definition: va.h:2112
@ VAEncFEICURecordBufferType
HEVC FEI CU level data buffer it's CTB level information for future usage.
Definition: va.h:2131
@ VAEncryptionParameterBufferType
Encryption parameters buffer for protected content session.
Definition: va.h:2165
@ VADecodeStreamoutBufferType
Definition: va.h:2134
@ VAEncDeltaQpPerBlockBufferType
Encoding delta QP per block buffer.
Definition: va.h:2176
@ VAEncFEIMVBufferType
FEI specific buffer types.
Definition: va.h:2103
@ VAConfigAttribProcessingRate
Processing rate reporting attribute. Read-only.
Definition: va.h:834
@ VAConfigAttribMaxPictureHeight
Maximum picture height. Read-only.
Definition: va.h:764
@ VAConfigAttribProtectedContentCipherMode
Cipher mode of the protected content session.
Definition: va.h:977
@ VAConfigAttribEncMacroblockInfo
Macroblock information. Read-only.
Definition: va.h:750
@ VAConfigAttribFrameSizeToleranceSupport
frame size tolerance support it indicates the tolerance of frame size
Definition: va.h:874
@ VAConfigAttribContextPriority
priority setting for the context. Read-Write attribute value is VAConfigAttribValContextPriority this...
Definition: va.h:945
@ VAConfigAttribProtectedContentUsage
Special usage attribute of the protected session.
Definition: va.h:991
@ VAConfigAttribEncQuantization
Encoding quantization attribute. Read-only.
Definition: va.h:788
@ VAConfigAttribProtectedContentCipherSampleType
Decryption sample type of the protected content session.
Definition: va.h:984
@ VAConfigAttribEncPerBlockControl
Settings per block attribute for Encoding. Read-only.
Definition: va.h:1043
@ VAConfigAttribEncMaxTileRows
Maximum number of tile rows. Read-only.
Definition: va.h:1050
@ VAConfigAttribTEETypeClient
TEE type client is a specific module supporting specific functions in TEE. Read-only.
Definition: va.h:956
@ VAConfigAttribMaxFrameSize
encode max frame size attribute. Read-only attribute value VAConfigAttribValMaxFrameSize represent ma...
Definition: va.h:924
@ VAConfigAttribDecJPEG
JPEG decoding attribute. Read-only.
Definition: va.h:648
@ VAConfigAttribEncMaxSlices
Maximum number of slices per frame. Read-only.
Definition: va.h:721
@ VAConfigAttribDecSliceMode
Slice Decoding mode. Read/write.
Definition: va.h:640
@ VAConfigAttribCustomRoundingControl
whether accept rouding setting from application. Read-only. This attribute is for encode quality,...
Definition: va.h:913
@ VAConfigAttribEncSkipFrame
Encoding skip frame attribute. Read-only.
Definition: va.h:804
@ VAConfigAttribEncHEVCFeatures
HEVC/H.265 encoding features. Read-only.
Definition: va.h:1002
@ VAConfigAttribEncAV1Ext2
AV1 encoding attribute extend2. Read-only.
Definition: va.h:1036
@ VAConfigAttribEncQualityRange
Encoding quality range attribute. Read-only.
Definition: va.h:781
@ VAConfigAttribEncDynamicScaling
Dynamic Scaling Attribute. Read-only.
Definition: va.h:869
@ VAConfigAttribEncTileSupport
Tile Support Attribute. Read-only.
Definition: va.h:907
@ VAConfigAttribEncROI
Encoding region-of-interest (ROI) attribute. Read-only.
Definition: va.h:815
@ VAConfigAttribFEIMVPredictors
Maximum number of FEI MV predictors. Read-only.
Definition: va.h:891
@ VAConfigAttribEncAV1
AV1 encoding attribute. Read-only.
Definition: va.h:1020
@ VAConfigAttribEncSliceStructure
Slice structure. Read-only.
Definition: va.h:738
@ VAConfigAttribStats
Statistics attribute. Read-only.
Definition: va.h:899
@ VAConfigAttribEncMaxRefFrames
Maximum number of reference frames. Read-only.
Definition: va.h:714
@ VAConfigAttribQPBlockSize
Encoding QP info block size attribute. Read-only. This attribute conveys the block sizes that underly...
Definition: va.h:919
@ VAConfigAttribEncRateControlExt
Encoding extended rate control attribute. Read-only.
Definition: va.h:823
@ VAConfigAttribEncHEVCBlockSizes
HEVC/H.265 encoding block sizes. Read-only.
Definition: va.h:1012
@ VAConfigAttribMaxPictureWidth
Maximum picture width. Read-only.
Definition: va.h:757
@ VAConfigAttribEncIntraRefresh
Encoding intra refresh attribute. Read-only.
Definition: va.h:796
@ VAConfigAttribEncMaxTileCols
Maximum number of tile cols. Read-only.
Definition: va.h:1057
@ VAConfigAttribDecProcessing
Decode processing support. Read/write.
Definition: va.h:681
@ VAConfigAttribPredictionDirection
inter frame prediction directrion attribute. Read-only. this attribute conveys the prediction directi...
Definition: va.h:936
@ VAConfigAttribTEEType
TEE could be any HW secure device. Read-only.
Definition: va.h:954
@ VAConfigAttribFEIFunctionType
Encode function type for FEI.
Definition: va.h:883
@ VAConfigAttribDecAV1Features
AV1 decoding features. Read-only.
Definition: va.h:952
@ VAConfigAttribEncParallelRateControl
Parallel Rate Control (hierachical B) attribute. Read-only.
Definition: va.h:860
@ VAConfigAttribEncJPEG
JPEG encoding attribute. Read-only.
Definition: va.h:772
@ VAConfigAttribEncInterlaced
Interlaced mode. Read/write.
Definition: va.h:703
@ VAConfigAttribProtectedContentCipherBlockSize
Cipher block size of the protected content session.
Definition: va.h:970
@ VAConfigAttribMultipleFrame
combined submission of multiple frames from different streams, it is optimization for different HW im...
Definition: va.h:940
@ VAConfigAttribEncVP9
VP9 encoding attribute. Read-only.
Definition: va.h:1065
@ VAConfigAttribEncAV1Ext1
AV1 encoding attribute extend1. Read-only.
Definition: va.h:1028
@ VAConfigAttribEncPackedHeaders
Packed headers mode. Read/write.
Definition: va.h:694
@ VAConfigAttribEncDirtyRect
Encoding dirty rectangle. Read-only.
Definition: va.h:848
@ VAConfigAttribProtectedContentCipherAlgorithm
Cipher algorithm of the protected content session.
Definition: va.h:963
@ VASurfaceAttribMaxWidth
Maximal width in pixels (int, read-only).
Definition: va.h:1704
@ VASurfaceAttribUsageHint
Surface usage hint, gives the driver a hint of intended usage to optimize allocation (e....
Definition: va.h:1720
@ VASurfaceAttribAlignmentSize
width and height log2 aligment in pixels (int, read-only)
Definition: va.h:1736
@ VASurfaceAttribMemoryType
Surface memory type expressed in bit fields (int, read/write).
Definition: va.h:1710
@ VASurfaceAttribMaxHeight
Maximal height in pixels (int, read-only).
Definition: va.h:1708
@ VASurfaceAttribDRMFormatModifiers
List of possible DRM format modifiers (pointer, write).
Definition: va.h:1727
@ VASurfaceAttribMinWidth
Minimal width in pixels (int, read-only).
Definition: va.h:1702
@ VASurfaceAttribExternalBufferDescriptor
External buffer descriptor (pointer, write).
Definition: va.h:1717
@ VASurfaceAttribPixelFormat
Pixel format as a FOURCC (int, read/write).
Definition: va.h:1700
@ VASurfaceAttribCount
Number of surface attributes.
Definition: va.h:1738
@ VASurfaceAttribMinHeight
Minimal height in pixels (int, read-only).
Definition: va.h:1706
@ VAEntrypointFEI
VAEntrypointFEI.
Definition: va.h:586
@ VAEntrypointProtectedTEEComm
VAEntrypointProtectedTEEComm.
Definition: va.h:609
@ VAEntrypointVideoProc
Definition: va.h:569
@ VAEntrypointStats
VAEntrypointStats.
Definition: va.h:603
@ VAEntrypointProtectedContent
VAEntrypointProtectedContent.
Definition: va.h:615
@ VAEncPackedHeaderPicture
Packed picture header.
Definition: va.h:2423
@ VAEncPackedHeaderRawData
Packed raw header.
Definition: va.h:2434
@ VAEncPackedHeaderSequence
Packed sequence header.
Definition: va.h:2421
@ VAEncPackedHeaderSlice
Packed slice header.
Definition: va.h:2425
@ VAProfileProtected
Profile ID used for protected video playback.
Definition: va.h:541
@ VAProfileNone
Profile ID used for video processing.
Definition: va.h:504
VA buffer information.
Definition: va.h:4024
uint32_t mem_type
Buffer memory type (See VASurfaceAttribMemoryType).
Definition: va.h:4037
uint32_t type
Buffer type (See VABufferType).
Definition: va.h:4028
size_t mem_size
Size of the underlying buffer.
Definition: va.h:4039
uintptr_t handle
Buffer handle.
Definition: va.h:4026
Coded buffer segment.
Definition: va.h:3940
uint32_t bit_offset
Bit offset into the data buffer where the video data starts.
Definition: va.h:3946
uint32_t status
Status set by the driver. See VA_CODED_BUF_STATUS_*.
Definition: va.h:3948
void * next
Pointer to the next VACodedBufferSegment element, or NULL if there is none.
Definition: va.h:3957
uint32_t size
Size of the data buffer in this segment (in bytes).
Definition: va.h:3944
void * buf
Pointer to the start of the data buffer.
Definition: va.h:3952
uint32_t reserved
Reserved for future use.
Definition: va.h:3950
Definition: va.h:1076
update the context parameter this structure is used to update context parameters, such as priority of...
Definition: va.h:2217
uint32_t context_priority_update
indicate whether context priority changed
Definition: va.h:2221
VAConfigAttribValContextPriority context_priority
task/context priority
Definition: va.h:2228
uint32_t reserved
Reserved bits for future use, must be zero.
Definition: va.h:2223
Defines a maximum frame size (in bits).
Definition: va.h:2753
uint32_t max_frame_size
Maximum size of a frame (in bits).
Definition: va.h:2758
Maximum frame size (in bytes) settings for multiple pass.
Definition: va.h:2773
uint8_t * delta_qp
delta QP list for every pass
Definition: va.h:2784
uint32_t reserved
Reserved bytes for future use, must be zero.
Definition: va.h:2780
uint8_t num_passes
number of passes, every pass has different QP, currently AVC encoder can support up to 4 passes
Definition: va.h:2782
uint32_t max_frame_size
Maximum size of a frame (in byte)
Definition: va.h:2778
Encoding quality level.
Definition: va.h:2801
uint32_t quality_level
Encoding quality level setting. When set to 0, default quality level is used.
Definition: va.h:2805
Definition: va.h:2475
Custom Encoder Rounding Offset Control. Application may use this structure to set customized rounding...
Definition: va.h:3040
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:3047
uint32_t rounding_offset_intra
Intra rounding offset Ignored if enable_custom_rouding_intra equals 0.
Definition: va.h:3052
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:3058
uint32_t rounding_offset_inter
Inter rounding offset Ignored if enable_custom_rouding_inter equals 0.
Definition: va.h:3063
Definition: va.h:2966
uint32_t PanicModeDisable
Definition: va.h:3014
uint32_t UltraHMEDisable
Definition: va.h:3010
uint32_t HMEDisable
Definition: va.h:3006
uint32_t FTQSkipThresholdLUTInput
Definition: va.h:2983
uint32_t HMEMVCostScalingFactor
Definition: va.h:3004
uint32_t SuperHMEDisable
Definition: va.h:3008
uint32_t FTQOverride
Definition: va.h:2978
uint32_t ForceRepartitionCheck
Definition: va.h:3019
uint32_t directBiasAdjustmentEnable
Definition: va.h:2990
uint32_t NonFTQSkipThresholdLUTInput
Definition: va.h:2986
uint32_t useRawPicForRef
Definition: va.h:2972
uint32_t FTQEnable
Definition: va.h:2980
uint32_t skipCheckDisable
Definition: va.h:2975
uint32_t globalMotionBiasAdjustmentEnable
Definition: va.h:2997
Definition: va.h:2617
uint32_t reserved
Definition: va.h:2643
uint32_t temporal_id
Definition: va.h:2641
uint32_t framerate
Definition: va.h:2637
Definition: va.h:2721
uint32_t buffer_size
Definition: va.h:2738
uint32_t initial_buffer_fullness
Definition: va.h:2732
Definition: va.h:2657
Attribute value for VAConfigAttribEncParallelRateControl.
Definition: va.h:2954
uint32_t num_layers
Definition: va.h:2956
uint32_t * num_b_in_gop
Definition: va.h:2961
Quantization settings for encoding.
Definition: va.h:2817
Rate control parameters.
Definition: va.h:2500
uint32_t bits_per_second
Definition: va.h:2502
uint32_t basic_unit_size
Definition: va.h:2530
uint32_t reserved
Definition: va.h:2577
uint32_t frame_tolerance_mode
Definition: va.h:2575
uint32_t mb_rate_control
Definition: va.h:2550
uint32_t temporal_id
Definition: va.h:2552
uint32_t disable_bit_stuffing
Definition: va.h:2542
uint32_t cfs_I_frames
Definition: va.h:2554
uint32_t ICQ_quality_factor
Definition: va.h:2586
uint32_t max_qp
Definition: va.h:2592
uint32_t window_size
Definition: va.h:2514
uint32_t enable_parallel_brc
Definition: va.h:2559
uint32_t disable_frame_skip
Definition: va.h:2540
uint32_t reset
Definition: va.h:2538
uint32_t target_frame_size
Definition: va.h:2606
uint32_t initial_qp
Definition: va.h:2519
uint32_t min_qp
Definition: va.h:2525
uint32_t target_percentage
Definition: va.h:2508
uint32_t quality_factor
Definition: va.h:2597
Encoding skip frame.
Definition: va.h:2845
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:2857
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:2852
uint8_t num_skip_frames
The number of frames skipped prior to the current frame. Valid when skip_frame_flag = 1.
Definition: va.h:2854
Temporal layer Structure.
Definition: va.h:2481
uint32_t periodicity
The length of the array defining frame layer membership. Should be 1-32.
Definition: va.h:2485
uint32_t number_of_layers
The number of temporal layers.
Definition: va.h:2483
Packed header parameter.
Definition: va.h:2446
uint8_t has_emulation_bytes
Flag: buffer contains start code emulation prevention bytes?
Definition: va.h:2452
uint32_t type
Definition: va.h:2448
uint32_t bit_length
Size of the #VAEncPackedHeaderDataBuffer in bits.
Definition: va.h:2450
Encoding region-of-interest (ROI).
Definition: va.h:2872
int8_t roi_value
ROI value.
Definition: va.h:2895
VARectangle roi_rectangle
Defines the ROI boundary in pixels, the driver will map it to appropriate codec coding units....
Definition: va.h:2876
Encode Slice Parameter Buffer.
Definition: va.h:3734
Encryption parameters buffer for VAEncryptionParameterBufferType.
Definition: va.h:2271
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:2296
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:2312
uint32_t num_segments
The number of sengments.
Definition: va.h:2277
uint32_t size_of_length
CENC counter length.
Definition: va.h:2285
VAEncryptionSegmentInfo * segment_info
Pointer of segments.
Definition: va.h:2279
uint32_t status_report_index
The status report index reserved for CENC fullsample workload. The related structures and definitions...
Definition: va.h:2283
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:2305
uint32_t encryption_type
Encryption type, refer to VA_ENCRYPTION_TYPE_FULLSAMPLE_CTR, VA_ENCRYPTION_TYPE_FULLSAMPLE_CBC,...
Definition: va.h:2275
structure for encrypted segment info.
Definition: va.h:2251
uint32_t segment_length
The length of the segments in bytes.
Definition: va.h:2256
uint32_t partial_aes_block_size
The length in bytes of the remainder of an incomplete block from a previous segment.
Definition: va.h:2259
uint32_t init_byte_length
The length in bytes of the initial clear data.
Definition: va.h:2261
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:2254
Generic value.
Definition: va.h:1662
float f
32-bit float.
Definition: va.h:1670
VAGenericFunc fn
Pointer to function.
Definition: va.h:1674
int32_t i
32-bit signed integer.
Definition: va.h:1668
void * p
Generic pointer.
Definition: va.h:1672
VAGenericValueType type
Value type. See VAGenericValueType.
Definition: va.h:1664
Huffman table for JPEG decoding.
Definition: va.h:3107
Definition: va.h:3648
Definition: va.h:3175
int32_t load_intra_quantiser_matrix
Same as the MPEG-2 bitstream syntax element.
Definition: va.h:3177
int32_t load_chroma_intra_quantiser_matrix
Same as the MPEG-2 bitstream syntax element.
Definition: va.h:3181
int32_t load_chroma_non_intra_quantiser_matrix
Same as the MPEG-2 bitstream syntax element.
Definition: va.h:3183
int32_t load_non_intra_quantiser_matrix
Same as the MPEG-2 bitstream syntax element.
Definition: va.h:3179
Definition: va.h:3327
int32_t load_intra_quant_mat
Definition: va.h:3329
int32_t load_non_intra_quant_mat
Definition: va.h:3331
Generic motion vector data structure.
Definition: va.h:414
Description of picture properties of those in DPB surfaces.
Definition: va.h:5287
int32_t pic_order_cnt
picture order count. in HEVC, POCs for top and bottom fields of same picture should take different va...
Definition: va.h:5296
VASurfaceID picture_id
reconstructed picture buffer surface index invalid when taking value VA_INVALID_SURFACE.
Definition: va.h:5291
Definition: va.h:3594
Definition: va.h:3276
Definition: va.h:3380
Description of picture properties of those in DPB surfaces.
Definition: va.h:5353
int32_t pic_order_cnt
picture order count.
Definition: va.h:5360
VASurfaceID picture_id
reconstructed picture buffer surface index invalid when taking value VA_INVALID_SURFACE.
Definition: va.h:5357
Definition: va.h:2337
uint8_t level_idc
Profile level.
Definition: va.h:2339
Definition: va.h:2320
uint32_t intra_period
Period between I frames.
Definition: va.h:2329
uint8_t level_idc
Profile level.
Definition: va.h:2322
uint32_t ip_period
Period between I/P frames.
Definition: va.h:2331
uint32_t quality_level
quality level. When set to 0, default quality level is used.
Definition: va.h:2327
Structure to describe rectangle.
Definition: va.h:406
Definition: va.h:3659
uint8_t num_ref_idx_l0_active_minus1
Definition: va.h:3684
uint8_t num_ref_idx_l1_active_minus1
Definition: va.h:3691
uint32_t slice_data_offset
Byte offset to the NAL Header Unit for this slice.
Definition: va.h:3662
uint16_t slice_data_bit_offset
Bit offset from NAL Header Unit to the begining of slice_data().
Definition: va.h:3674
Definition: va.h:3198
Definition: va.h:3342
Definition: va.h:3552
VASurfaceAttribExternalBuffers structure for the VASurfaceAttribExternalBufferDescriptor attribute.
Definition: va.h:1784
uint32_t num_planes
number of planes for planar layout
Definition: va.h:1794
uint32_t data_size
total size of the buffer in bytes.
Definition: va.h:1792
uint32_t height
height in pixels.
Definition: va.h:1790
uint32_t width
width in pixels.
Definition: va.h:1788
uint32_t pixel_format
pixel format in fourcc.
Definition: va.h:1786
uint32_t flags
flags. See "Surface external buffer descriptor flags".
Definition: va.h:1804
uint32_t num_buffers
number of elements in the "buffers" array
Definition: va.h:1802
uintptr_t * buffers
buffer handles or user pointers
Definition: va.h:1800
void * private_data
reserved for passing private data
Definition: va.h:1806
Surface attribute.
Definition: va.h:1742
VAGenericValue value
Value. See "Surface attribute types" for the expected types.
Definition: va.h:1748
VASurfaceAttribType type
Type.
Definition: va.h:1744
uint32_t flags
Flags. See "Surface attribute flags".
Definition: va.h:1746
Definition: va.h:4333
uint32_t reserved
reserved bits for future, must be zero
Definition: va.h:1443
uint32_t priority
the priority , for the Query operation (read) it represents highest priority for the set operation (w...
Definition: va.h:1441
Attribute value for VAConfigAttribEncJPEG.
Definition: va.h:1284
uint32_t non_interleaved_mode
set to 1 for non-interleaved.
Definition: va.h:1291
uint32_t differential_mode
set to 1 for differential.
Definition: va.h:1293
uint32_t progressive_dct_mode
set to 1 for progressive dct.
Definition: va.h:1289
uint32_t arithmatic_coding_mode
set to 1 for arithmatic coding.
Definition: va.h:1287
uint32_t reserved
reserved bit for future, must be zero
Definition: va.h:1458
uint32_t delta_qp_size_in_bytes
size of delta qp per block in bytes
Definition: va.h:1456
uint32_t log2_delta_qp_block_size
supported size of delta qp block
Definition: va.h:1454
uint32_t delta_qp_support
whether to support dela qp per block
Definition: va.h:1452
Attribute value for VAConfigAttribEncROI.
Definition: va.h:1347
uint32_t roi_rc_priority_support
A flag indicates whether ROI priority is supported.
Definition: va.h:1362
uint32_t roi_rc_qp_delta_support
A flag indicates whether ROI delta QP is supported.
Definition: va.h:1374
uint32_t num_roi_regions
The number of ROI regions supported, 0 if ROI is not supported.
Definition: va.h:1350
Attribute value for VAConfigAttribEncRateControlExt.
Definition: va.h:1381
uint32_t temporal_layer_bitrate_control_flag
Definition: va.h:1415
uint32_t max_num_temporal_layers_minus1
The maximum number of temporal layers minus 1.
Definition: va.h:1390
Attribute value for VAConfigAttribMaxFrameSize.
Definition: va.h:1267
uint32_t max_frame_size
support max frame size if max_frame_size == 1, VAEncMiscParameterTypeMaxFrameSize/VAEncMiscParameterB...
Definition: va.h:1274
uint32_t reserved
reserved bits for future, must be zero
Definition: va.h:1278
uint32_t multiple_pass
multiple_pass support
Definition: va.h:1276
Attribute value for VAConfigAttribMultipleFrame.
Definition: va.h:1422
uint32_t reserved
reserved bit for future, must be zero
Definition: va.h:1431
uint32_t max_num_concurrent_frames
max num of concurrent frames from different stream
Definition: va.h:1425
uint32_t mixed_quality_level
indicate whether all stream must support same quality level if mixed_quality_level == 0,...
Definition: va.h:1429
sub device info Sub-device is the concept basing on the "device" behind "vaDisplay"....
Definition: va.h:5101
uint32_t sub_device_count
sub devices count, read - only
Definition: va.h:5106
uint32_t reserved
reserved bits for future, must be zero
Definition: va.h:5108
uint32_t sub_device_mask
bit mask to indicate which sub_device is available, read only
Definition: va.h:5124
uint32_t current_sub_device
current sub device index, read - write
Definition: va.h:5104
VASurfaceAttribAlignmentStruct structure for the VASurfaceAttribAlignmentSize attribute.
Definition: va.h:1769
uint32_t log2_height_alignment
log2 height aligment
Definition: va.h:1774
uint32_t log2_width_alignment
log2 width aligment
Definition: va.h:1772
VAStatus vaGetDisplayAttributes(VADisplay dpy, VADisplayAttribute *attr_list, int num_attributes)
VADisplayAttribType
Definition: va.h:5130
VAStatus vaCopy(VADisplay dpy, VACopyObject *dst, VACopyObject *src, VACopyOption option)
Copies an object.
VAStatus vaSetDisplayAttributes(VADisplay dpy, VADisplayAttribute *attr_list, int num_attributes)
VAStatus vaQueryDisplayAttributes(VADisplay dpy, VADisplayAttribute *attr_list, int *num_attributes)
#define va_deprecated_enum
Misc packed header. See codec-specific definitions.
Definition: va.h:98
int vaMaxNumDisplayAttributes(VADisplay dpy)
The AV1 decoding API.
The HEVC decoding API.
The JPEG decoding API.
VP8 decoding API.
The VP9 decoding API.
The VVC decoding API.
AV1 encoding API.
The H.264 encoding API.
The HEVC encoding API.
JPEG encoding API.
The MPEG-2 encoding API.
VP8 encoding API.
VP9 encoding API.
The FEI encoding common API.
The FEI encoding H264 special API.
The FEI encoding HEVC special API.
Protected content API.
The video processing API.