VA-API  2.17.0.1
va.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2007-2009 Intel Corporation. All Rights Reserved.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the
6  * "Software"), to deal in the Software without restriction, including
7  * without limitation the rights to use, copy, modify, merge, publish,
8  * distribute, sub license, and/or sell copies of the Software, and to
9  * permit persons to whom the Software is furnished to do so, subject to
10  * the following conditions:
11  *
12  * The above copyright notice and this permission notice (including the
13  * next paragraph) shall be included in all copies or substantial portions
14  * of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
19  * IN NO EVENT SHALL INTEL AND/OR ITS SUPPLIERS BE LIABLE FOR
20  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23  */
24 /*
25  * Video Acceleration (VA) API Specification
26  *
27  * Rev. 0.30
28  * <jonathan.bian@intel.com>
29  *
30  * Revision History:
31  * rev 0.10 (12/10/2006 Jonathan Bian) - Initial draft
32  * rev 0.11 (12/15/2006 Jonathan Bian) - Fixed some errors
33  * rev 0.12 (02/05/2007 Jonathan Bian) - Added VC-1 data structures for slice level decode
34  * rev 0.13 (02/28/2007 Jonathan Bian) - Added GetDisplay()
35  * rev 0.14 (04/13/2007 Jonathan Bian) - Fixed MPEG-2 PictureParameter structure, cleaned up a few funcs.
36  * rev 0.15 (04/20/2007 Jonathan Bian) - Overhauled buffer management
37  * rev 0.16 (05/02/2007 Jonathan Bian) - Added error codes and fixed some issues with configuration
38  * rev 0.17 (05/07/2007 Jonathan Bian) - Added H.264/AVC data structures for slice level decode.
39  * rev 0.18 (05/14/2007 Jonathan Bian) - Added data structures for MPEG-4 slice level decode
40  * and MPEG-2 motion compensation.
41  * rev 0.19 (08/06/2007 Jonathan Bian) - Removed extra type for bitplane data.
42  * rev 0.20 (08/08/2007 Jonathan Bian) - Added missing fields to VC-1 PictureParameter structure.
43  * rev 0.21 (08/20/2007 Jonathan Bian) - Added image and subpicture support.
44  * rev 0.22 (08/27/2007 Jonathan Bian) - Added support for chroma-keying and global alpha.
45  * rev 0.23 (09/11/2007 Jonathan Bian) - Fixed some issues with images and subpictures.
46  * rev 0.24 (09/18/2007 Jonathan Bian) - Added display attributes.
47  * rev 0.25 (10/18/2007 Jonathan Bian) - Changed to use IDs only for some types.
48  * rev 0.26 (11/07/2007 Waldo Bastian) - Change vaCreateBuffer semantics
49  * rev 0.27 (11/19/2007 Matt Sottek) - Added DeriveImage
50  * rev 0.28 (12/06/2007 Jonathan Bian) - Added new versions of PutImage and AssociateSubpicture
51  * to enable scaling
52  * rev 0.29 (02/07/2008 Jonathan Bian) - VC1 parameter fixes,
53  * added VA_STATUS_ERROR_RESOLUTION_NOT_SUPPORTED
54  * rev 0.30 (03/01/2009 Jonathan Bian) - Added encoding support for H.264 BP and MPEG-4 SP and fixes
55  * for ISO C conformance.
56  * rev 0.31 (09/02/2009 Gwenole Beauchesne) - VC-1/H264 fields change for VDPAU and XvBA backend
57  * Application needs to relink with the new library.
58  *
59  * rev 0.31.1 (03/29/2009) - Data structure for JPEG encode
60  * rev 0.31.2 (01/13/2011 Anthony Pabon)- Added a flag to indicate Subpicture coordinates are screen
61  * screen relative rather than source video relative.
62  * rev 0.32.0 (01/13/2011 Xiang Haihao) - Add profile into VAPictureParameterBufferVC1
63  * update VAAPI to 0.32.0
64  *
65  * Acknowledgements:
66  * Some concepts borrowed from XvMC and XvImage.
67  * Waldo Bastian (Intel), Matt Sottek (Intel), Austin Yuan (Intel), and Gwenole Beauchesne (SDS)
68  * contributed to various aspects of the API.
69  */
70 
78 #ifndef _VA_H_
79 #define _VA_H_
80 
81 #include <stddef.h>
82 #include <stdint.h>
83 #include <va/va_version.h>
84 
85 #ifdef __cplusplus
86 extern "C" {
87 #endif
88 
89 #if defined(__GNUC__) && !defined(__COVERITY__)
90 #define va_deprecated __attribute__((deprecated))
91 #if __GNUC__ >= 6
92 #define va_deprecated_enum va_deprecated
93 #else
94 #define va_deprecated_enum
95 #endif
96 #else
97 #define va_deprecated
98 #define va_deprecated_enum
99 #endif
100 
259 typedef void* VADisplay; /* window system dependent */
260 
261 typedef int VAStatus;
263 #define VA_STATUS_SUCCESS 0x00000000
264 #define VA_STATUS_ERROR_OPERATION_FAILED 0x00000001
265 #define VA_STATUS_ERROR_ALLOCATION_FAILED 0x00000002
266 #define VA_STATUS_ERROR_INVALID_DISPLAY 0x00000003
267 #define VA_STATUS_ERROR_INVALID_CONFIG 0x00000004
268 #define VA_STATUS_ERROR_INVALID_CONTEXT 0x00000005
269 #define VA_STATUS_ERROR_INVALID_SURFACE 0x00000006
270 #define VA_STATUS_ERROR_INVALID_BUFFER 0x00000007
271 #define VA_STATUS_ERROR_INVALID_IMAGE 0x00000008
272 #define VA_STATUS_ERROR_INVALID_SUBPICTURE 0x00000009
273 #define VA_STATUS_ERROR_ATTR_NOT_SUPPORTED 0x0000000a
274 #define VA_STATUS_ERROR_MAX_NUM_EXCEEDED 0x0000000b
275 #define VA_STATUS_ERROR_UNSUPPORTED_PROFILE 0x0000000c
276 #define VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT 0x0000000d
277 #define VA_STATUS_ERROR_UNSUPPORTED_RT_FORMAT 0x0000000e
278 #define VA_STATUS_ERROR_UNSUPPORTED_BUFFERTYPE 0x0000000f
279 #define VA_STATUS_ERROR_SURFACE_BUSY 0x00000010
280 #define VA_STATUS_ERROR_FLAG_NOT_SUPPORTED 0x00000011
281 #define VA_STATUS_ERROR_INVALID_PARAMETER 0x00000012
282 #define VA_STATUS_ERROR_RESOLUTION_NOT_SUPPORTED 0x00000013
283 #define VA_STATUS_ERROR_UNIMPLEMENTED 0x00000014
284 #define VA_STATUS_ERROR_SURFACE_IN_DISPLAYING 0x00000015
285 #define VA_STATUS_ERROR_INVALID_IMAGE_FORMAT 0x00000016
286 #define VA_STATUS_ERROR_DECODING_ERROR 0x00000017
287 #define VA_STATUS_ERROR_ENCODING_ERROR 0x00000018
295 #define VA_STATUS_ERROR_INVALID_VALUE 0x00000019
297 #define VA_STATUS_ERROR_UNSUPPORTED_FILTER 0x00000020
299 #define VA_STATUS_ERROR_INVALID_FILTER_CHAIN 0x00000021
301 #define VA_STATUS_ERROR_HW_BUSY 0x00000022
303 #define VA_STATUS_ERROR_UNSUPPORTED_MEMORY_TYPE 0x00000024
305 #define VA_STATUS_ERROR_NOT_ENOUGH_BUFFER 0x00000025
307 #define VA_STATUS_ERROR_TIMEDOUT 0x00000026
308 #define VA_STATUS_ERROR_UNKNOWN 0xFFFFFFFF
309 
317 #define VA_FRAME_PICTURE 0x00000000
318 #define VA_TOP_FIELD 0x00000001
319 #define VA_BOTTOM_FIELD 0x00000002
320 #define VA_TOP_FIELD_FIRST 0x00000004
321 #define VA_BOTTOM_FIELD_FIRST 0x00000008
322 
329 #define VA_ENABLE_BLEND 0x00000004 /* video area blend with the constant color */
330 
336 #define VA_CLEAR_DRAWABLE 0x00000008
337 
339 #define VA_SRC_COLOR_MASK 0x000000f0
340 #define VA_SRC_BT601 0x00000010
341 #define VA_SRC_BT709 0x00000020
342 #define VA_SRC_SMPTE_240 0x00000040
343 
345 #define VA_FILTER_SCALING_DEFAULT 0x00000000
346 #define VA_FILTER_SCALING_FAST 0x00000100
347 #define VA_FILTER_SCALING_HQ 0x00000200
348 #define VA_FILTER_SCALING_NL_ANAMORPHIC 0x00000300
349 #define VA_FILTER_SCALING_MASK 0x00000f00
350 
352 #define VA_FILTER_INTERPOLATION_DEFAULT 0x00000000
353 #define VA_FILTER_INTERPOLATION_NEAREST_NEIGHBOR 0x00001000
354 #define VA_FILTER_INTERPOLATION_BILINEAR 0x00002000
355 #define VA_FILTER_INTERPOLATION_ADVANCED 0x00003000
356 #define VA_FILTER_INTERPOLATION_MASK 0x0000f000
357 
359 #define VA_PADDING_LOW 4
360 #define VA_PADDING_MEDIUM 8
361 #define VA_PADDING_HIGH 16
362 #define VA_PADDING_LARGE 32
363 
366 #define VA_EXEC_SYNC 0x0
368 #define VA_EXEC_ASYNC 0x1
369 
371 #define VA_EXEC_MODE_DEFAULT 0x0
372 #define VA_EXEC_MODE_POWER_SAVING 0x1
373 #define VA_EXEC_MODE_PERFORMANCE 0x2
374 
375 /* Values used to describe device features. */
380 #define VA_FEATURE_NOT_SUPPORTED 0
390 #define VA_FEATURE_SUPPORTED 1
397 #define VA_FEATURE_REQUIRED 2
398 
402 const char *vaErrorStr(VAStatus error_status);
403 
404 typedef struct _VARectangle {
405  int16_t x;
406  int16_t y;
407  uint16_t width;
408  uint16_t height;
409 } VARectangle;
410 
412 typedef struct _VAMotionVector {
417  int16_t mv0[2]; /* past reference */
418  int16_t mv1[2]; /* future reference */
420 
422 typedef void (*VAMessageCallback)(void *user_context, const char *message);
423 
429 
435 
443 typedef void* VANativeDisplay; /* window system dependent */
444 
445 int vaDisplayIsValid(VADisplay dpy);
446 
451  char *driver_name
452  );
453 
457 VAStatus vaInitialize(
458  VADisplay dpy,
459  int *major_version, /* out */
460  int *minor_version /* out */
461 );
462 
466 VAStatus vaTerminate(
467  VADisplay dpy
468 );
469 
479  VADisplay dpy
480 );
481 
482 typedef int (*VAPrivFunc)(void);
483 
488 VAPrivFunc vaGetLibFunc(
489  VADisplay dpy,
490  const char *func
491 );
492 
494 typedef enum {
497  VAProfileMPEG2Simple = 0,
498  VAProfileMPEG2Main = 1,
499  VAProfileMPEG4Simple = 2,
500  VAProfileMPEG4AdvancedSimple = 3,
501  VAProfileMPEG4Main = 4,
502  VAProfileH264Baseline va_deprecated_enum = 5,
503  VAProfileH264Main = 6,
504  VAProfileH264High = 7,
505  VAProfileVC1Simple = 8,
506  VAProfileVC1Main = 9,
507  VAProfileVC1Advanced = 10,
508  VAProfileH263Baseline = 11,
509  VAProfileJPEGBaseline = 12,
510  VAProfileH264ConstrainedBaseline = 13,
511  VAProfileVP8Version0_3 = 14,
512  VAProfileH264MultiviewHigh = 15,
513  VAProfileH264StereoHigh = 16,
514  VAProfileHEVCMain = 17,
515  VAProfileHEVCMain10 = 18,
516  VAProfileVP9Profile0 = 19,
517  VAProfileVP9Profile1 = 20,
518  VAProfileVP9Profile2 = 21,
519  VAProfileVP9Profile3 = 22,
520  VAProfileHEVCMain12 = 23,
521  VAProfileHEVCMain422_10 = 24,
522  VAProfileHEVCMain422_12 = 25,
523  VAProfileHEVCMain444 = 26,
524  VAProfileHEVCMain444_10 = 27,
525  VAProfileHEVCMain444_12 = 28,
526  VAProfileHEVCSccMain = 29,
527  VAProfileHEVCSccMain10 = 30,
528  VAProfileHEVCSccMain444 = 31,
529  VAProfileAV1Profile0 = 32,
530  VAProfileAV1Profile1 = 33,
531  VAProfileHEVCSccMain444_10 = 34,
533  VAProfileProtected = 35
535 
539 typedef enum {
540  VAEntrypointVLD = 1,
541  VAEntrypointIZZ = 2,
542  VAEntrypointIDCT = 3,
543  VAEntrypointMoComp = 4,
544  VAEntrypointDeblocking = 5,
545  VAEntrypointEncSlice = 6, /* slice level encode */
546  VAEntrypointEncPicture = 7, /* pictuer encode, JPEG, etc */
547  /*
548  * For an implementation that supports a low power/high performance variant
549  * for slice level encode, it can choose to expose the
550  * VAEntrypointEncSliceLP entrypoint. Certain encoding tools may not be
551  * available with this entrypoint (e.g. interlace, MBAFF) and the
552  * application can query the encoding configuration attributes to find
553  * out more details if this entrypoint is supported.
554  */
555  VAEntrypointEncSliceLP = 8,
603 } VAEntrypoint;
604 
606 typedef enum {
607  VAConfigAttribRTFormat = 0,
608  VAConfigAttribSpatialResidual = 1,
609  VAConfigAttribSpatialClipping = 2,
610  VAConfigAttribIntraResidual = 3,
611  VAConfigAttribEncryption = 4,
612  VAConfigAttribRateControl = 5,
613 
979 
1032  VAConfigAttribTypeMax
1034 
1041 typedef struct _VAConfigAttrib {
1042  VAConfigAttribType type;
1043  uint32_t value; /* OR'd flags (bits) for this attribute */
1044 } VAConfigAttrib;
1045 
1046 /* Attribute values for VAConfigAttribRTFormat. */
1047 
1048 #define VA_RT_FORMAT_YUV420 0x00000001
1049 #define VA_RT_FORMAT_YUV422 0x00000002
1050 #define VA_RT_FORMAT_YUV444 0x00000004
1051 #define VA_RT_FORMAT_YUV411 0x00000008
1052 #define VA_RT_FORMAT_YUV400 0x00000010
1053 #define VA_RT_FORMAT_YUV420_10 0x00000100
1054 #define VA_RT_FORMAT_YUV422_10 0x00000200
1055 #define VA_RT_FORMAT_YUV444_10 0x00000400
1056 #define VA_RT_FORMAT_YUV420_12 0x00001000
1057 #define VA_RT_FORMAT_YUV422_12 0x00002000
1058 #define VA_RT_FORMAT_YUV444_12 0x00004000
1059 
1060 #define VA_RT_FORMAT_RGB16 0x00010000
1061 #define VA_RT_FORMAT_RGB32 0x00020000
1062 #define VA_RT_FORMAT_RGBP 0x00100000
1063 #define VA_RT_FORMAT_RGB32_10 0x00200000
1064 
1065 #define VA_RT_FORMAT_PROTECTED 0x80000000
1066 
1067 #define VA_RT_FORMAT_RGB32_10BPP VA_RT_FORMAT_RGB32_10
1068 #define VA_RT_FORMAT_YUV420_10BPP VA_RT_FORMAT_YUV420_10
1069 
1073 #define VA_RC_NONE 0x00000001
1075 #define VA_RC_CBR 0x00000002
1077 #define VA_RC_VBR 0x00000004
1079 #define VA_RC_VCM 0x00000008
1081 #define VA_RC_CQP 0x00000010
1083 #define VA_RC_VBR_CONSTRAINED 0x00000020
1086 #define VA_RC_ICQ 0x00000040
1089 #define VA_RC_MB 0x00000080
1091 #define VA_RC_CFS 0x00000100
1102 #define VA_RC_PARALLEL 0x00000200
1109 #define VA_RC_QVBR 0x00000400
1120 #define VA_RC_AVBR 0x00000800
1129 #define VA_RC_TCBRC 0x00001000
1130 
1136 #define VA_DEC_SLICE_MODE_NORMAL 0x00000001
1138 #define VA_DEC_SLICE_MODE_BASE 0x00000002
1139 
1142 typedef union _VAConfigAttribValDecJPEG {
1143  struct {
1145  uint32_t rotation : 4;
1147  uint32_t reserved : 28;
1148  } bits;
1149  uint32_t value;
1150 } VAConfigAttribValDecJPEG;
1154 #define VA_DEC_PROCESSING_NONE 0x00000000
1156 #define VA_DEC_PROCESSING 0x00000001
1162 #define VA_ENC_PACKED_HEADER_NONE 0x00000000
1169 #define VA_ENC_PACKED_HEADER_SEQUENCE 0x00000001
1176 #define VA_ENC_PACKED_HEADER_PICTURE 0x00000002
1183 #define VA_ENC_PACKED_HEADER_SLICE 0x00000004
1192 #define VA_ENC_PACKED_HEADER_MISC 0x00000008
1194 #define VA_ENC_PACKED_HEADER_RAW_DATA 0x00000010
1200 #define VA_ENC_INTERLACED_NONE 0x00000000
1202 #define VA_ENC_INTERLACED_FRAME 0x00000001
1204 #define VA_ENC_INTERLACED_FIELD 0x00000002
1206 #define VA_ENC_INTERLACED_MBAFF 0x00000004
1208 #define VA_ENC_INTERLACED_PAFF 0x00000008
1214 #define VA_ENC_SLICE_STRUCTURE_POWER_OF_TWO_ROWS 0x00000001
1216 #define VA_ENC_SLICE_STRUCTURE_ARBITRARY_MACROBLOCKS 0x00000002
1218 #define VA_ENC_SLICE_STRUCTURE_EQUAL_ROWS 0x00000004
1220 #define VA_ENC_SLICE_STRUCTURE_MAX_SLICE_SIZE 0x00000008
1222 #define VA_ENC_SLICE_STRUCTURE_ARBITRARY_ROWS 0x00000010
1226 #define VA_ENC_SLICE_STRUCTURE_EQUAL_MULTI_ROWS 0x00000020
1230 typedef union _VAConfigAttribValMaxFrameSize {
1231  struct {
1237  uint32_t max_frame_size : 1;
1239  uint32_t multiple_pass : 1;
1241  uint32_t reserved : 30;
1242  } bits;
1243  uint32_t value;
1245 
1247 typedef union _VAConfigAttribValEncJPEG {
1248  struct {
1252  uint32_t progressive_dct_mode : 1;
1254  uint32_t non_interleaved_mode : 1;
1256  uint32_t differential_mode : 1;
1257  uint32_t max_num_components : 3;
1258  uint32_t max_num_scans : 4;
1259  uint32_t max_num_huffman_tables : 3;
1260  uint32_t max_num_quantization_tables : 3;
1261  } bits;
1262  uint32_t value;
1264 
1268 #define VA_ENC_QUANTIZATION_NONE 0x00000000
1270 #define VA_ENC_QUANTIZATION_TRELLIS_SUPPORTED 0x00000001
1281 #define VA_PREDICTION_DIRECTION_PREVIOUS 0x00000001
1283 #define VA_PREDICTION_DIRECTION_FUTURE 0x00000002
1285 #define VA_PREDICTION_DIRECTION_BI_NOT_EMPTY 0x00000004
1291 #define VA_ENC_INTRA_REFRESH_NONE 0x00000000
1293 #define VA_ENC_INTRA_REFRESH_ROLLING_COLUMN 0x00000001
1295 #define VA_ENC_INTRA_REFRESH_ROLLING_ROW 0x00000002
1297 #define VA_ENC_INTRA_REFRESH_ADAPTIVE 0x00000010
1299 #define VA_ENC_INTRA_REFRESH_CYCLIC 0x00000020
1301 #define VA_ENC_INTRA_REFRESH_P_FRAME 0x00010000
1303 #define VA_ENC_INTRA_REFRESH_B_FRAME 0x00020000
1305 #define VA_ENC_INTRA_REFRESH_MULTI_REF 0x00040000
1306 
1310 typedef union _VAConfigAttribValEncROI {
1311  struct {
1313  uint32_t num_roi_regions : 8;
1338  uint32_t reserved : 22;
1339  } bits;
1340  uint32_t value;
1342 
1344 typedef union _VAConfigAttribValEncRateControlExt {
1345  struct {
1354 
1379  uint32_t reserved : 23;
1380  } bits;
1381  uint32_t value;
1383 
1385 typedef union _VAConfigAttribValMultipleFrame {
1386  struct {
1392  uint32_t mixed_quality_level : 1;
1394  uint32_t reserved : 23;
1395  } bits;
1396  uint32_t value;
1398 
1400 typedef union _VAConfigAttribValContextPriority {
1401  struct {
1404  uint32_t priority : 16;
1406  uint32_t reserved : 16;
1407  } bits;
1408  uint32_t value;
1410 
1412 typedef union _VAConfigAttribValEncPerBlockControl {
1413  struct {
1415  uint32_t delta_qp_support : 1;
1421  uint32_t reserved : 24;
1422  } bits;
1423  uint32_t value;
1425 
1428 #define VA_PC_CIPHER_AES 0x00000001
1429 
1432 #define VA_PC_BLOCK_SIZE_128 0x00000001
1434 #define VA_PC_BLOCK_SIZE_192 0x00000002
1436 #define VA_PC_BLOCK_SIZE_256 0x00000004
1437 
1440 #define VA_PC_CIPHER_MODE_ECB 0x00000001
1442 #define VA_PC_CIPHER_MODE_CBC 0x00000002
1444 #define VA_PC_CIPHER_MODE_CTR 0x00000004
1445 
1448 #define VA_PC_SAMPLE_TYPE_FULLSAMPLE 0x00000001
1450 #define VA_PC_SAMPLE_TYPE_SUBSAMPLE 0x00000002
1451 
1454 #define VA_PC_USAGE_DEFAULT 0x00000000
1456 #define VA_PC_USAGE_WIDEVINE 0x00000001
1457 
1461 #define VA_PROCESSING_RATE_NONE 0x00000000
1463 #define VA_PROCESSING_RATE_ENCODE 0x00000001
1465 #define VA_PROCESSING_RATE_DECODE 0x00000002
1471 #define VA_ATTRIB_NOT_SUPPORTED 0x80000000
1472 
1475  VADisplay dpy
1476 );
1477 
1480  VADisplay dpy
1481 );
1482 
1485  VADisplay dpy
1486 );
1487 
1495  VADisplay dpy,
1496  VAProfile *profile_list, /* out */
1497  int *num_profiles /* out */
1498 );
1499 
1507  VADisplay dpy,
1508  VAProfile profile,
1509  VAEntrypoint *entrypoint_list, /* out */
1510  int *num_entrypoints /* out */
1511 );
1512 
1522  VADisplay dpy,
1523  VAProfile profile,
1524  VAEntrypoint entrypoint,
1525  VAConfigAttrib *attrib_list, /* in/out */
1526  int num_attribs
1527 );
1528 
1530 typedef unsigned int VAGenericID;
1531 
1532 typedef VAGenericID VAConfigID;
1533 
1540  VADisplay dpy,
1541  VAProfile profile,
1542  VAEntrypoint entrypoint,
1543  VAConfigAttrib *attrib_list,
1544  int num_attribs,
1545  VAConfigID *config_id /* out */
1546 );
1547 
1552  VADisplay dpy,
1553  VAConfigID config_id
1554 );
1555 
1565  VADisplay dpy,
1566  VAConfigID config_id,
1567  VAProfile *profile, /* out */
1568  VAEntrypoint *entrypoint, /* out */
1569  VAConfigAttrib *attrib_list,/* out */
1570  int *num_attribs /* out */
1571 );
1572 
1573 
1594 
1595 typedef VAGenericID VASurfaceID;
1596 
1597 #define VA_INVALID_ID 0xffffffff
1598 #define VA_INVALID_SURFACE VA_INVALID_ID
1599 
1601 typedef enum {
1607 
1609 typedef void (*VAGenericFunc)(void);
1610 
1612 typedef struct _VAGenericValue {
1616  union {
1618  int32_t i;
1620  float f;
1622  void *p;
1625  } value;
1626 } VAGenericValue;
1627 
1631 #define VA_SURFACE_ATTRIB_NOT_SUPPORTED 0x00000000
1633 #define VA_SURFACE_ATTRIB_GETTABLE 0x00000001
1635 #define VA_SURFACE_ATTRIB_SETTABLE 0x00000002
1639 typedef enum {
1640  VASurfaceAttribNone = 0,
1681 
1683 typedef struct _VASurfaceAttrib {
1687  uint32_t flags;
1690 } VASurfaceAttrib;
1691 
1700 #define VA_SURFACE_ATTRIB_MEM_TYPE_VA 0x00000001
1702 #define VA_SURFACE_ATTRIB_MEM_TYPE_V4L2 0x00000002
1704 #define VA_SURFACE_ATTRIB_MEM_TYPE_USER_PTR 0x00000004
1711 typedef struct _VASurfaceAttribExternalBuffers {
1713  uint32_t pixel_format;
1715  uint32_t width;
1717  uint32_t height;
1719  uint32_t data_size;
1721  uint32_t num_planes;
1723  uint32_t pitches[4];
1725  uint32_t offsets[4];
1727  uintptr_t *buffers;
1729  uint32_t num_buffers;
1731  uint32_t flags;
1735 
1739 #define VA_SURFACE_EXTBUF_DESC_ENABLE_TILING 0x00000001
1741 #define VA_SURFACE_EXTBUF_DESC_CACHED 0x00000002
1743 #define VA_SURFACE_EXTBUF_DESC_UNCACHED 0x00000004
1745 #define VA_SURFACE_EXTBUF_DESC_WC 0x00000008
1747 #define VA_SURFACE_EXTBUF_DESC_PROTECTED 0x80000000
1748 
1752 #define VA_SURFACE_ATTRIB_USAGE_HINT_GENERIC 0x00000000
1754 #define VA_SURFACE_ATTRIB_USAGE_HINT_DECODER 0x00000001
1756 #define VA_SURFACE_ATTRIB_USAGE_HINT_ENCODER 0x00000002
1758 #define VA_SURFACE_ATTRIB_USAGE_HINT_VPP_READ 0x00000004
1760 #define VA_SURFACE_ATTRIB_USAGE_HINT_VPP_WRITE 0x00000008
1762 #define VA_SURFACE_ATTRIB_USAGE_HINT_DISPLAY 0x00000010
1765 #define VA_SURFACE_ATTRIB_USAGE_HINT_EXPORT 0x00000020
1766 
1796 VAStatus
1798  VADisplay dpy,
1799  VAConfigID config,
1800  VASurfaceAttrib *attrib_list,
1801  unsigned int *num_attribs
1802 );
1803 
1821 VAStatus
1823  VADisplay dpy,
1824  unsigned int format,
1825  unsigned int width,
1826  unsigned int height,
1827  VASurfaceID *surfaces,
1828  unsigned int num_surfaces,
1829  VASurfaceAttrib *attrib_list,
1830  unsigned int num_attribs
1831 );
1832 
1842  VADisplay dpy,
1843  VASurfaceID *surfaces,
1844  int num_surfaces
1845 );
1846 
1847 #define VA_PROGRESSIVE 0x1
1861  VADisplay dpy,
1862  VAConfigID config_id,
1863  int picture_width,
1864  int picture_height,
1865  int flag,
1866  VASurfaceID *render_targets,
1867  int num_render_targets,
1868  VAContextID *context /* out */
1869 );
1870 
1877  VADisplay dpy,
1878  VAContextID context
1879 );
1880 
1881 //Multi-frame context
1882 typedef VAGenericID VAMFContextID;
1900  VADisplay dpy,
1901  VAMFContextID *mf_context /* out */
1902 );
1903 
1938  VADisplay dpy,
1939  VAMFContextID mf_context,
1940  VAContextID context
1941 );
1942 
1956  VADisplay dpy,
1957  VAMFContextID mf_context,
1958  VAContextID context
1959 );
1960 
1970 
1971 typedef enum {
1972  VAPictureParameterBufferType = 0,
1973  VAIQMatrixBufferType = 1,
1974  VABitPlaneBufferType = 2,
1975  VASliceGroupMapBufferType = 3,
1976  VASliceParameterBufferType = 4,
1977  VASliceDataBufferType = 5,
1978  VAMacroblockParameterBufferType = 6,
1979  VAResidualDataBufferType = 7,
1980  VADeblockingParameterBufferType = 8,
1981  VAImageBufferType = 9,
1982  VAProtectedSliceDataBufferType = 10,
1983  VAQMatrixBufferType = 11,
1984  VAHuffmanTableBufferType = 12,
1985  VAProbabilityBufferType = 13,
1986 
1987  /* Following are encode buffer types */
1988  VAEncCodedBufferType = 21,
1989  VAEncSequenceParameterBufferType = 22,
1990  VAEncPictureParameterBufferType = 23,
1991  VAEncSliceParameterBufferType = 24,
1992  VAEncPackedHeaderParameterBufferType = 25,
1993  VAEncPackedHeaderDataBufferType = 26,
1994  VAEncMiscParameterBufferType = 27,
1995  VAEncMacroblockParameterBufferType = 28,
1996  VAEncMacroblockMapBufferType = 29,
1997 
2006  /* Following are video processing buffer types */
2031  VAEncFEIMBCodeBufferType = 44,
2032  VAEncFEIDistortionBufferType = 45,
2033  VAEncFEIMBControlBufferType = 46,
2034  VAEncFEIMVPredictorBufferType = 47,
2035  VAStatsStatisticsParameterBufferType = 48,
2040  VAStatsMVBufferType = 51,
2041  VAStatsMVPredictorBufferType = 52,
2062 
2087 
2093 
2104 
2105  VABufferTypeMax
2106 } VABufferType;
2107 
2113 typedef struct _VAContextParameterUpdateBuffer {
2114  union {
2115  struct {
2119  uint32_t reserved : 31;
2120  } bits;
2121  uint32_t value;
2122  } flags;
2126  uint32_t reserved[VA_PADDING_MEDIUM];
2128 
2141 #define VA_ENCRYPTION_TYPE_FULLSAMPLE_CTR 0x00000001 /* AES CTR fullsample */
2142 #define VA_ENCRYPTION_TYPE_FULLSAMPLE_CBC 0x00000002 /* AES CBC fullsample */
2143 #define VA_ENCRYPTION_TYPE_SUBSAMPLE_CTR 0x00000004 /* AES CTR fullsample */
2144 #define VA_ENCRYPTION_TYPE_SUBSAMPLE_CBC 0x00000008 /* AES CBC fullsample */
2145 
2147 typedef struct _VAEncryptionSegmentInfo {
2152  uint32_t segment_length;
2161  uint8_t aes_cbc_iv_or_ctr[64];
2163  uint32_t va_reserved[VA_PADDING_MEDIUM];
2165 
2167 typedef struct _VAEncryptionParameters {
2173  uint32_t num_segments;
2181  uint32_t size_of_length;
2184  uint8_t wrapped_decrypt_blob[64];
2187  uint8_t wrapped_encrypt_blob[64];
2192  uint32_t key_blob_size;
2210  uint32_t va_reserved[VA_PADDING_MEDIUM];
2212 
2216 typedef struct _VAProcessingRateParameterEnc {
2218  uint8_t level_idc;
2219  uint8_t reserved[3];
2223  uint32_t quality_level;
2225  uint32_t intra_period;
2227  uint32_t ip_period;
2229 
2233 typedef struct _VAProcessingRateParameterDec {
2235  uint8_t level_idc;
2236  uint8_t reserved0[3];
2237  uint32_t reserved;
2239 
2240 typedef struct _VAProcessingRateParameter {
2241  union {
2242  VAProcessingRateParameterEnc proc_buf_enc;
2243  VAProcessingRateParameterDec proc_buf_dec;
2244  };
2245 } VAProcessingRateParameter;
2246 
2267 VAStatus
2269  VADisplay dpy,
2270  VAConfigID config,
2271  VAProcessingRateParameter *proc_buf,
2272  unsigned int *processing_rate
2273 );
2274 
2275 typedef enum {
2276  VAEncMiscParameterTypeFrameRate = 0,
2277  VAEncMiscParameterTypeRateControl = 1,
2278  VAEncMiscParameterTypeMaxSliceSize = 2,
2279  VAEncMiscParameterTypeAIR = 3,
2284  VAEncMiscParameterTypeQualityLevel = 6,
2313 
2315 typedef enum {
2338  VAEncPackedHeaderMiscMask va_deprecated_enum = 0x80000000,
2340 
2342 typedef struct _VAEncPackedHeaderParameterBuffer {
2344  uint32_t type;
2346  uint32_t bit_length;
2349 
2351  uint32_t va_reserved[VA_PADDING_LOW];
2353 
2371 typedef struct _VAEncMiscParameterBuffer {
2373  uint32_t data[];
2375 
2377 typedef struct _VAEncMiscParameterTemporalLayerStructure {
2381  uint32_t periodicity;
2388  uint32_t layer_id[32];
2389 
2391  uint32_t va_reserved[VA_PADDING_LOW];
2393 
2394 
2396 typedef struct _VAEncMiscParameterRateControl {
2410  uint32_t window_size;
2415  uint32_t initial_qp;
2421  uint32_t min_qp;
2427  union {
2428  struct {
2434  uint32_t reset : 1;
2436  uint32_t disable_frame_skip : 1;
2438  uint32_t disable_bit_stuffing : 1;
2446  uint32_t mb_rate_control : 4;
2448  uint32_t temporal_id : 8;
2450  uint32_t cfs_I_frames : 1;
2455  uint32_t enable_parallel_brc : 1;
2456  uint32_t enable_dynamic_scaling : 1;
2471  uint32_t frame_tolerance_mode : 2;
2473  uint32_t reserved : 12;
2474  } bits;
2475  uint32_t value;
2476  } rc_flags;
2488  uint32_t max_qp;
2493  uint32_t quality_factor;
2504  uint32_t va_reserved[VA_PADDING_LOW];
2506 
2513 typedef struct _VAEncMiscParameterFrameRate {
2533  uint32_t framerate;
2534  union {
2535  struct {
2537  uint32_t temporal_id : 8;
2539  uint32_t reserved : 24;
2540  } bits;
2541  uint32_t value;
2542  } framerate_flags;
2543 
2545  uint32_t va_reserved[VA_PADDING_LOW];
2547 
2553 typedef struct _VAEncMiscParameterMaxSliceSize {
2554  uint32_t max_slice_size;
2555 
2557  uint32_t va_reserved[VA_PADDING_LOW];
2559 
2560 typedef struct _VAEncMiscParameterAIR {
2561  uint32_t air_num_mbs;
2562  uint32_t air_threshold;
2563  uint32_t air_auto; /* if set to 1 then hardware auto-tune the AIR threshold */
2564 
2566  uint32_t va_reserved[VA_PADDING_LOW];
2567 } VAEncMiscParameterAIR;
2568 
2569 /*
2570  * \brief Rolling intra refresh data structure for encoding.
2571  */
2572 typedef struct _VAEncMiscParameterRIR {
2573  union {
2574  struct
2581  {
2582  /* \brief enable RIR in column */
2583  uint32_t enable_rir_column : 1;
2584  /* \brief enable RIR in row */
2585  uint32_t enable_rir_row : 1;
2586  uint32_t reserved : 30;
2587  } bits;
2588  uint32_t value;
2589  } rir_flags;
2594  uint16_t intra_insertion_location;
2599  uint16_t intra_insert_size;
2604  uint8_t qp_delta_for_inserted_intra;
2606  uint32_t va_reserved[VA_PADDING_LOW];
2607 } VAEncMiscParameterRIR;
2608 
2617 typedef struct _VAEncMiscParameterHRD {
2634  uint32_t buffer_size;
2635 
2637  uint32_t va_reserved[VA_PADDING_LOW];
2639 
2649 typedef struct _VAEncMiscParameterBufferMaxFrameSize {
2652  va_deprecated VAEncMiscParameterType type;
2654  uint32_t max_frame_size;
2655 
2657  uint32_t va_reserved[VA_PADDING_LOW];
2659 
2669 typedef struct _VAEncMiscParameterBufferMultiPassFrameSize {
2672  va_deprecated VAEncMiscParameterType type;
2674  uint32_t max_frame_size;
2676  uint32_t reserved;
2678  uint8_t num_passes;
2680  uint8_t *delta_qp;
2681 
2683  unsigned long va_reserved[VA_PADDING_LOW];
2685 
2697 typedef struct _VAEncMiscParameterBufferQualityLevel {
2701  uint32_t quality_level;
2702 
2704  uint32_t va_reserved[VA_PADDING_LOW];
2706 
2713 typedef struct _VAEncMiscParameterQuantization {
2714  union {
2715  /* if no flags is set then quantization is determined by the driver */
2716  struct {
2717  /* \brief disable trellis for all frames/fields */
2718  uint32_t disable_trellis : 1;
2719  /* \brief enable trellis for I frames/fields */
2720  uint32_t enable_trellis_I : 1;
2721  /* \brief enable trellis for P frames/fields */
2722  uint32_t enable_trellis_P : 1;
2723  /* \brief enable trellis for B frames/fields */
2724  uint32_t enable_trellis_B : 1;
2725  uint32_t reserved : 28;
2726  } bits;
2727  uint32_t value;
2728  } quantization_flags;
2729  uint32_t va_reserved;
2731 
2741 typedef struct _VAEncMiscParameterSkipFrame {
2754 
2756  uint32_t va_reserved[VA_PADDING_LOW];
2758 
2768 typedef struct _VAEncROI {
2772  VARectangle roi_rectangle;
2791  int8_t roi_value;
2792 } VAEncROI;
2793 
2794 typedef struct _VAEncMiscParameterBufferROI {
2796  uint32_t num_roi;
2797 
2801  int8_t max_delta_qp;
2802  int8_t min_delta_qp;
2803 
2806  VAEncROI *roi;
2807  union {
2808  struct {
2821  uint32_t roi_value_is_qp_delta : 1;
2822  uint32_t reserved : 31;
2823  } bits;
2824  uint32_t value;
2825  } roi_flags;
2826 
2828  uint32_t va_reserved[VA_PADDING_LOW];
2829 } VAEncMiscParameterBufferROI;
2830 /*
2831  * \brief Dirty rectangle data structure for encoding.
2832  *
2833  * The encoding dirty rect can be set through VAEncMiscParameterBufferDirtyRect, if the
2834  * implementation supports dirty rect input. The rect set through this structure is applicable
2835  * only to the current frame or field, so must be sent every frame or field to be applied.
2836  * The number of supported rects can be queried through the VAConfigAttribEncDirtyRect. The
2837  * encoder will use the rect information to know those rectangle areas have changed while the
2838  * areas not covered by dirty rect rectangles are assumed to have not changed compared to the
2839  * previous picture. The encoder may do some internal optimizations.
2840  */
2841 typedef struct _VAEncMiscParameterBufferDirtyRect {
2843  uint32_t num_roi_rectangle;
2844 
2846  VARectangle *roi_rectangle;
2847 } VAEncMiscParameterBufferDirtyRect;
2848 
2850 typedef struct _VAEncMiscParameterParallelRateControl {
2852  uint32_t num_layers;
2857  uint32_t *num_b_in_gop;
2859 
2862 typedef struct _VAEncMiscParameterEncQuality {
2863  union {
2864  struct {
2868  uint32_t useRawPicForRef : 1;
2871  uint32_t skipCheckDisable : 1;
2874  uint32_t FTQOverride : 1;
2876  uint32_t FTQEnable : 1;
2883  uint32_t ReservedBit : 1;
2902  uint32_t HMEDisable : 1;
2904  uint32_t SuperHMEDisable : 1;
2906  uint32_t UltraHMEDisable : 1;
2910  uint32_t PanicModeDisable : 1;
2916 
2917  };
2918  uint32_t encControls;
2919  };
2920 
2922  uint8_t FTQSkipThresholdLUT[52];
2924  uint16_t NonFTQSkipThresholdLUT[52];
2925 
2926  uint32_t reserved[VA_PADDING_HIGH]; // Reserved for future use.
2927 
2929 
2936 typedef struct _VAEncMiscParameterCustomRoundingControl {
2937  union {
2938  struct {
2944 
2949 
2955 
2960 
2961  /* Reserved */
2962  uint32_t reserved : 16;
2963  } bits;
2964  uint32_t value;
2965  } rounding_offset_setting;
2967 
2976 #define VA_SLICE_DATA_FLAG_ALL 0x00 /* whole slice is in the buffer */
2977 #define VA_SLICE_DATA_FLAG_BEGIN 0x01 /* The beginning of the slice is in the buffer but the end if not */
2978 #define VA_SLICE_DATA_FLAG_MIDDLE 0x02 /* Neither beginning nor end of the slice is in the buffer */
2979 #define VA_SLICE_DATA_FLAG_END 0x04 /* end of the slice is in the buffer */
2980 
2981 /* Codec-independent Slice Parameter Buffer base */
2982 typedef struct _VASliceParameterBufferBase {
2983  uint32_t slice_data_size; /* number of bytes in the slice data buffer for this slice */
2984  uint32_t slice_data_offset; /* the offset to the first byte of slice data */
2985  uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX definitions */
2986 } VASliceParameterBufferBase;
2987 
2988 /**********************************
2989  * JPEG common data structures
2990  **********************************/
3003 typedef struct _VAHuffmanTableBufferJPEGBaseline {
3005  uint8_t load_huffman_table[2];
3007  struct {
3011  uint8_t num_dc_codes[16];
3013  uint8_t dc_values[12];
3018  uint8_t num_ac_codes[16];
3020  uint8_t ac_values[162];
3022  uint8_t pad[2];
3024  } huffman_table[2];
3025 
3027  uint32_t va_reserved[VA_PADDING_LOW];
3029 
3030 /****************************
3031  * MPEG-2 data structures
3032  ****************************/
3033 
3034 /* MPEG-2 Picture Parameter Buffer */
3035 /*
3036  * For each frame or field, and before any slice data, a single
3037  * picture parameter buffer must be send.
3038  */
3039 typedef struct _VAPictureParameterBufferMPEG2 {
3040  uint16_t horizontal_size;
3041  uint16_t vertical_size;
3042  VASurfaceID forward_reference_picture;
3043  VASurfaceID backward_reference_picture;
3044  /* meanings of the following fields are the same as in the standard */
3045  int32_t picture_coding_type;
3046  int32_t f_code; /* pack all four fcode into this */
3047  union {
3048  struct {
3049  uint32_t intra_dc_precision : 2;
3050  uint32_t picture_structure : 2;
3051  uint32_t top_field_first : 1;
3052  uint32_t frame_pred_frame_dct : 1;
3053  uint32_t concealment_motion_vectors : 1;
3054  uint32_t q_scale_type : 1;
3055  uint32_t intra_vlc_format : 1;
3056  uint32_t alternate_scan : 1;
3057  uint32_t repeat_first_field : 1;
3058  uint32_t progressive_frame : 1;
3059  uint32_t is_first_field : 1; /* indicate whether the current field
3060  * is the first field for field picture
3061  */
3062  } bits;
3063  uint32_t value;
3064  } picture_coding_extension;
3065 
3067  uint32_t va_reserved[VA_PADDING_LOW];
3068 } VAPictureParameterBufferMPEG2;
3069 
3071 typedef struct _VAIQMatrixBufferMPEG2 {
3081  uint8_t intra_quantiser_matrix[64];
3083  uint8_t non_intra_quantiser_matrix[64];
3085  uint8_t chroma_intra_quantiser_matrix[64];
3087  uint8_t chroma_non_intra_quantiser_matrix[64];
3088 
3090  uint32_t va_reserved[VA_PADDING_LOW];
3092 
3094 typedef struct _VASliceParameterBufferMPEG2 {
3095  uint32_t slice_data_size;/* number of bytes in the slice data buffer for this slice */
3096  uint32_t slice_data_offset;/* the offset to the first byte of slice data */
3097  uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
3098  uint32_t macroblock_offset;/* the offset to the first bit of MB from the first byte of slice data */
3099  uint32_t slice_horizontal_position;
3100  uint32_t slice_vertical_position;
3101  int32_t quantiser_scale_code;
3102  int32_t intra_slice_flag;
3103 
3105  uint32_t va_reserved[VA_PADDING_LOW];
3107 
3109 typedef struct _VAMacroblockParameterBufferMPEG2 {
3110  uint16_t macroblock_address;
3111  /*
3112  * macroblock_address (in raster scan order)
3113  * top-left: 0
3114  * bottom-right: picture-height-in-mb*picture-width-in-mb - 1
3115  */
3116  uint8_t macroblock_type; /* see definition below */
3117  union {
3118  struct {
3119  uint32_t frame_motion_type : 2;
3120  uint32_t field_motion_type : 2;
3121  uint32_t dct_type : 1;
3122  } bits;
3123  uint32_t value;
3124  } macroblock_modes;
3125  uint8_t motion_vertical_field_select;
3126  /*
3127  * motion_vertical_field_select:
3128  * see section 6.3.17.2 in the spec
3129  * only the lower 4 bits are used
3130  * bit 0: first vector forward
3131  * bit 1: first vector backward
3132  * bit 2: second vector forward
3133  * bit 3: second vector backward
3134  */
3135  int16_t PMV[2][2][2]; /* see Table 7-7 in the spec */
3136  uint16_t coded_block_pattern;
3137  /*
3138  * The bitplanes for coded_block_pattern are described
3139  * in Figure 6.10-12 in the spec
3140  */
3141 
3142  /* Number of skipped macroblocks after this macroblock */
3143  uint16_t num_skipped_macroblocks;
3144 
3146  uint32_t va_reserved[VA_PADDING_LOW];
3148 
3149 /*
3150  * OR'd flags for macroblock_type (section 6.3.17.1 in the spec)
3151  */
3152 #define VA_MB_TYPE_MOTION_FORWARD 0x02
3153 #define VA_MB_TYPE_MOTION_BACKWARD 0x04
3154 #define VA_MB_TYPE_MOTION_PATTERN 0x08
3155 #define VA_MB_TYPE_MOTION_INTRA 0x10
3156 
3163 /****************************
3164  * MPEG-4 Part 2 data structures
3165  ****************************/
3166 
3167 /* MPEG-4 Picture Parameter Buffer */
3168 /*
3169  * For each frame or field, and before any slice data, a single
3170  * picture parameter buffer must be send.
3171  */
3172 typedef struct _VAPictureParameterBufferMPEG4 {
3173  uint16_t vop_width;
3174  uint16_t vop_height;
3175  VASurfaceID forward_reference_picture;
3176  VASurfaceID backward_reference_picture;
3177  union {
3178  struct {
3179  uint32_t short_video_header : 1;
3180  uint32_t chroma_format : 2;
3181  uint32_t interlaced : 1;
3182  uint32_t obmc_disable : 1;
3183  uint32_t sprite_enable : 2;
3184  uint32_t sprite_warping_accuracy : 2;
3185  uint32_t quant_type : 1;
3186  uint32_t quarter_sample : 1;
3187  uint32_t data_partitioned : 1;
3188  uint32_t reversible_vlc : 1;
3189  uint32_t resync_marker_disable : 1;
3190  } bits;
3191  uint32_t value;
3192  } vol_fields;
3193  uint8_t no_of_sprite_warping_points;
3194  int16_t sprite_trajectory_du[3];
3195  int16_t sprite_trajectory_dv[3];
3196  uint8_t quant_precision;
3197  union {
3198  struct {
3199  uint32_t vop_coding_type : 2;
3200  uint32_t backward_reference_vop_coding_type : 2;
3201  uint32_t vop_rounding_type : 1;
3202  uint32_t intra_dc_vlc_thr : 3;
3203  uint32_t top_field_first : 1;
3204  uint32_t alternate_vertical_scan_flag : 1;
3205  } bits;
3206  uint32_t value;
3207  } vop_fields;
3208  uint8_t vop_fcode_forward;
3209  uint8_t vop_fcode_backward;
3210  uint16_t vop_time_increment_resolution;
3211  /* short header related */
3212  uint8_t num_gobs_in_vop;
3213  uint8_t num_macroblocks_in_gob;
3214  /* for direct mode prediction */
3215  int16_t TRB;
3216  int16_t TRD;
3217 
3219  uint32_t va_reserved[VA_PADDING_LOW];
3221 
3223 typedef struct _VAIQMatrixBufferMPEG4 {
3229  uint8_t intra_quant_mat[64];
3231  uint8_t non_intra_quant_mat[64];
3232 
3234  uint32_t va_reserved[VA_PADDING_LOW];
3236 
3238 typedef struct _VASliceParameterBufferMPEG4 {
3239  uint32_t slice_data_size;/* number of bytes in the slice data buffer for this slice */
3240  uint32_t slice_data_offset;/* the offset to the first byte of slice data */
3241  uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
3242  uint32_t macroblock_offset;/* the offset to the first bit of MB from the first byte of slice data */
3243  uint32_t macroblock_number;
3244  int32_t quant_scale;
3245 
3247  uint32_t va_reserved[VA_PADDING_LOW];
3249 
3254 typedef enum /* see 7.1.1.32 */
3255 {
3256  VAMvMode1Mv = 0,
3257  VAMvMode1MvHalfPel = 1,
3258  VAMvMode1MvHalfPelBilinear = 2,
3259  VAMvModeMixedMv = 3,
3260  VAMvModeIntensityCompensation = 4
3261 } VAMvModeVC1;
3262 
3264 /*
3265  * For each picture, and before any slice data, a picture parameter
3266  * buffer must be send. Multiple picture parameter buffers may be
3267  * sent for a single picture. In that case picture parameters will
3268  * apply to all slice data that follow it until a new picture
3269  * parameter buffer is sent.
3270  *
3271  * Notes:
3272  * pic_quantizer_type should be set to the applicable quantizer
3273  * type as defined by QUANTIZER (J.1.19) and either
3274  * PQUANTIZER (7.1.1.8) or PQINDEX (7.1.1.6)
3275  */
3276 typedef struct _VAPictureParameterBufferVC1 {
3277  VASurfaceID forward_reference_picture;
3278  VASurfaceID backward_reference_picture;
3279  /* if out-of-loop post-processing is done on the render
3280  target, then we need to keep the in-loop decoded
3281  picture as a reference picture */
3282  VASurfaceID inloop_decoded_picture;
3283 
3284  /* sequence layer for AP or meta data for SP and MP */
3285  union {
3286  struct {
3287  uint32_t pulldown : 1; /* SEQUENCE_LAYER::PULLDOWN */
3288  uint32_t interlace : 1; /* SEQUENCE_LAYER::INTERLACE */
3289  uint32_t tfcntrflag : 1; /* SEQUENCE_LAYER::TFCNTRFLAG */
3290  uint32_t finterpflag : 1; /* SEQUENCE_LAYER::FINTERPFLAG */
3291  uint32_t psf : 1; /* SEQUENCE_LAYER::PSF */
3292  uint32_t multires : 1; /* METADATA::MULTIRES */
3293  uint32_t overlap : 1; /* METADATA::OVERLAP */
3294  uint32_t syncmarker : 1; /* METADATA::SYNCMARKER */
3295  uint32_t rangered : 1; /* METADATA::RANGERED */
3296  uint32_t max_b_frames : 3; /* METADATA::MAXBFRAMES */
3297  uint32_t profile : 2; /* SEQUENCE_LAYER::PROFILE or The MSB of METADATA::PROFILE */
3298  } bits;
3299  uint32_t value;
3300  } sequence_fields;
3301 
3302  uint16_t coded_width; /* ENTRY_POINT_LAYER::CODED_WIDTH */
3303  uint16_t coded_height; /* ENTRY_POINT_LAYER::CODED_HEIGHT */
3304  union {
3305  struct {
3306  uint32_t broken_link : 1; /* ENTRY_POINT_LAYER::BROKEN_LINK */
3307  uint32_t closed_entry : 1; /* ENTRY_POINT_LAYER::CLOSED_ENTRY */
3308  uint32_t panscan_flag : 1; /* ENTRY_POINT_LAYER::PANSCAN_FLAG */
3309  uint32_t loopfilter : 1; /* ENTRY_POINT_LAYER::LOOPFILTER */
3310  } bits;
3311  uint32_t value;
3312  } entrypoint_fields;
3313  uint8_t conditional_overlap_flag; /* ENTRY_POINT_LAYER::CONDOVER */
3314  uint8_t fast_uvmc_flag; /* ENTRY_POINT_LAYER::FASTUVMC */
3315  union {
3316  struct {
3317  uint32_t luma_flag : 1; /* ENTRY_POINT_LAYER::RANGE_MAPY_FLAG */
3318  uint32_t luma : 3; /* ENTRY_POINT_LAYER::RANGE_MAPY */
3319  uint32_t chroma_flag : 1; /* ENTRY_POINT_LAYER::RANGE_MAPUV_FLAG */
3320  uint32_t chroma : 3; /* ENTRY_POINT_LAYER::RANGE_MAPUV */
3321  } bits;
3322  uint32_t value;
3323  } range_mapping_fields;
3324 
3325  uint8_t b_picture_fraction; /* Index for PICTURE_LAYER::BFRACTION value in Table 40 (7.1.1.14) */
3326  uint8_t cbp_table; /* PICTURE_LAYER::CBPTAB/ICBPTAB */
3327  uint8_t mb_mode_table; /* PICTURE_LAYER::MBMODETAB */
3328  uint8_t range_reduction_frame;/* PICTURE_LAYER::RANGEREDFRM */
3329  uint8_t rounding_control; /* PICTURE_LAYER::RNDCTRL */
3330  uint8_t post_processing; /* PICTURE_LAYER::POSTPROC */
3331  uint8_t picture_resolution_index; /* PICTURE_LAYER::RESPIC */
3332  uint8_t luma_scale; /* PICTURE_LAYER::LUMSCALE */
3333  uint8_t luma_shift; /* PICTURE_LAYER::LUMSHIFT */
3334 
3335  union {
3336  struct {
3337  uint32_t picture_type : 3; /* PICTURE_LAYER::PTYPE */
3338  uint32_t frame_coding_mode : 3; /* PICTURE_LAYER::FCM */
3339  uint32_t top_field_first : 1; /* PICTURE_LAYER::TFF */
3340  uint32_t is_first_field : 1; /* set to 1 if it is the first field */
3341  uint32_t intensity_compensation : 1; /* PICTURE_LAYER::INTCOMP */
3342  } bits;
3343  uint32_t value;
3344  } picture_fields;
3345  union {
3346  struct {
3347  uint32_t mv_type_mb : 1; /* PICTURE::MVTYPEMB */
3348  uint32_t direct_mb : 1; /* PICTURE::DIRECTMB */
3349  uint32_t skip_mb : 1; /* PICTURE::SKIPMB */
3350  uint32_t field_tx : 1; /* PICTURE::FIELDTX */
3351  uint32_t forward_mb : 1; /* PICTURE::FORWARDMB */
3352  uint32_t ac_pred : 1; /* PICTURE::ACPRED */
3353  uint32_t overflags : 1; /* PICTURE::OVERFLAGS */
3354  } flags;
3355  uint32_t value;
3356  } raw_coding;
3357  union {
3358  struct {
3359  uint32_t bp_mv_type_mb : 1; /* PICTURE::MVTYPEMB */
3360  uint32_t bp_direct_mb : 1; /* PICTURE::DIRECTMB */
3361  uint32_t bp_skip_mb : 1; /* PICTURE::SKIPMB */
3362  uint32_t bp_field_tx : 1; /* PICTURE::FIELDTX */
3363  uint32_t bp_forward_mb : 1; /* PICTURE::FORWARDMB */
3364  uint32_t bp_ac_pred : 1; /* PICTURE::ACPRED */
3365  uint32_t bp_overflags : 1; /* PICTURE::OVERFLAGS */
3366  } flags;
3367  uint32_t value;
3368  } bitplane_present; /* signal what bitplane is being passed via the bitplane buffer */
3369  union {
3370  struct {
3371  uint32_t reference_distance_flag : 1;/* PICTURE_LAYER::REFDIST_FLAG */
3372  uint32_t reference_distance : 5;/* PICTURE_LAYER::REFDIST */
3373  uint32_t num_reference_pictures: 1;/* PICTURE_LAYER::NUMREF */
3374  uint32_t reference_field_pic_indicator : 1;/* PICTURE_LAYER::REFFIELD */
3375  } bits;
3376  uint32_t value;
3377  } reference_fields;
3378  union {
3379  struct {
3380  uint32_t mv_mode : 3; /* PICTURE_LAYER::MVMODE */
3381  uint32_t mv_mode2 : 3; /* PICTURE_LAYER::MVMODE2 */
3382  uint32_t mv_table : 3; /* PICTURE_LAYER::MVTAB/IMVTAB */
3383  uint32_t two_mv_block_pattern_table: 2; /* PICTURE_LAYER::2MVBPTAB */
3384  uint32_t four_mv_switch : 1; /* PICTURE_LAYER::4MVSWITCH */
3385  uint32_t four_mv_block_pattern_table : 2; /* PICTURE_LAYER::4MVBPTAB */
3386  uint32_t extended_mv_flag : 1; /* ENTRY_POINT_LAYER::EXTENDED_MV */
3387  uint32_t extended_mv_range : 2; /* PICTURE_LAYER::MVRANGE */
3388  uint32_t extended_dmv_flag : 1; /* ENTRY_POINT_LAYER::EXTENDED_DMV */
3389  uint32_t extended_dmv_range : 2; /* PICTURE_LAYER::DMVRANGE */
3390  } bits;
3391  uint32_t value;
3392  } mv_fields;
3393  union {
3394  struct {
3395  uint32_t dquant : 2; /* ENTRY_POINT_LAYER::DQUANT */
3396  uint32_t quantizer : 2; /* ENTRY_POINT_LAYER::QUANTIZER */
3397  uint32_t half_qp : 1; /* PICTURE_LAYER::HALFQP */
3398  uint32_t pic_quantizer_scale : 5;/* PICTURE_LAYER::PQUANT */
3399  uint32_t pic_quantizer_type : 1;/* PICTURE_LAYER::PQUANTIZER */
3400  uint32_t dq_frame : 1; /* VOPDQUANT::DQUANTFRM */
3401  uint32_t dq_profile : 2; /* VOPDQUANT::DQPROFILE */
3402  uint32_t dq_sb_edge : 2; /* VOPDQUANT::DQSBEDGE */
3403  uint32_t dq_db_edge : 2; /* VOPDQUANT::DQDBEDGE */
3404  uint32_t dq_binary_level : 1; /* VOPDQUANT::DQBILEVEL */
3405  uint32_t alt_pic_quantizer : 5;/* VOPDQUANT::ALTPQUANT */
3406  } bits;
3407  uint32_t value;
3408  } pic_quantizer_fields;
3409  union {
3410  struct {
3411  uint32_t variable_sized_transform_flag : 1;/* ENTRY_POINT_LAYER::VSTRANSFORM */
3412  uint32_t mb_level_transform_type_flag : 1;/* PICTURE_LAYER::TTMBF */
3413  uint32_t frame_level_transform_type : 2;/* PICTURE_LAYER::TTFRM */
3414  uint32_t transform_ac_codingset_idx1 : 2;/* PICTURE_LAYER::TRANSACFRM */
3415  uint32_t transform_ac_codingset_idx2 : 2;/* PICTURE_LAYER::TRANSACFRM2 */
3416  uint32_t intra_transform_dc_table : 1;/* PICTURE_LAYER::TRANSDCTAB */
3417  } bits;
3418  uint32_t value;
3419  } transform_fields;
3420 
3421  uint8_t luma_scale2; /* PICTURE_LAYER::LUMSCALE2 */
3422  uint8_t luma_shift2; /* PICTURE_LAYER::LUMSHIFT2 */
3423  uint8_t intensity_compensation_field; /* Index for PICTURE_LAYER::INTCOMPFIELD value in Table 109 (9.1.1.48) */
3424 
3426  uint32_t va_reserved[VA_PADDING_MEDIUM - 1];
3428 
3447 /* VC-1 Slice Parameter Buffer */
3448 typedef struct _VASliceParameterBufferVC1 {
3449  uint32_t slice_data_size;/* number of bytes in the slice data buffer for this slice */
3450  uint32_t slice_data_offset;/* the offset to the first byte of slice data */
3451  uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
3452  uint32_t macroblock_offset;/* the offset to the first bit of MB from the first byte of slice data */
3453  uint32_t slice_vertical_position;
3454 
3456  uint32_t va_reserved[VA_PADDING_LOW];
3458 
3459 /* VC-1 Slice Data Buffer */
3460 /*
3461 This is simplely a buffer containing raw bit-stream bytes
3462 */
3463 
3464 /****************************
3465  * H.264/AVC data structures
3466  ****************************/
3467 
3468 typedef struct _VAPictureH264 {
3469  VASurfaceID picture_id;
3470  uint32_t frame_idx;
3471  uint32_t flags;
3472  int32_t TopFieldOrderCnt;
3473  int32_t BottomFieldOrderCnt;
3474 
3476  uint32_t va_reserved[VA_PADDING_LOW];
3477 } VAPictureH264;
3478 /* flags in VAPictureH264 could be OR of the following */
3479 #define VA_PICTURE_H264_INVALID 0x00000001
3480 #define VA_PICTURE_H264_TOP_FIELD 0x00000002
3481 #define VA_PICTURE_H264_BOTTOM_FIELD 0x00000004
3482 #define VA_PICTURE_H264_SHORT_TERM_REFERENCE 0x00000008
3483 #define VA_PICTURE_H264_LONG_TERM_REFERENCE 0x00000010
3484 
3486 /*
3487  * For each picture, and before any slice data, a single
3488  * picture parameter buffer must be send.
3489  */
3490 typedef struct _VAPictureParameterBufferH264 {
3491  VAPictureH264 CurrPic;
3492  VAPictureH264 ReferenceFrames[16]; /* in DPB */
3493  uint16_t picture_width_in_mbs_minus1;
3494  uint16_t picture_height_in_mbs_minus1;
3495  uint8_t bit_depth_luma_minus8;
3496  uint8_t bit_depth_chroma_minus8;
3497  uint8_t num_ref_frames;
3498  union {
3499  struct {
3500  uint32_t chroma_format_idc : 2;
3501  uint32_t residual_colour_transform_flag : 1; /* Renamed to separate_colour_plane_flag in newer standard versions. */
3502  uint32_t gaps_in_frame_num_value_allowed_flag : 1;
3503  uint32_t frame_mbs_only_flag : 1;
3504  uint32_t mb_adaptive_frame_field_flag : 1;
3505  uint32_t direct_8x8_inference_flag : 1;
3506  uint32_t MinLumaBiPredSize8x8 : 1; /* see A.3.3.2 */
3507  uint32_t log2_max_frame_num_minus4 : 4;
3508  uint32_t pic_order_cnt_type : 2;
3509  uint32_t log2_max_pic_order_cnt_lsb_minus4 : 4;
3510  uint32_t delta_pic_order_always_zero_flag : 1;
3511  } bits;
3512  uint32_t value;
3513  } seq_fields;
3514  // FMO is not supported.
3515  va_deprecated uint8_t num_slice_groups_minus1;
3516  va_deprecated uint8_t slice_group_map_type;
3517  va_deprecated uint16_t slice_group_change_rate_minus1;
3518  int8_t pic_init_qp_minus26;
3519  int8_t pic_init_qs_minus26;
3520  int8_t chroma_qp_index_offset;
3521  int8_t second_chroma_qp_index_offset;
3522  union {
3523  struct {
3524  uint32_t entropy_coding_mode_flag : 1;
3525  uint32_t weighted_pred_flag : 1;
3526  uint32_t weighted_bipred_idc : 2;
3527  uint32_t transform_8x8_mode_flag : 1;
3528  uint32_t field_pic_flag : 1;
3529  uint32_t constrained_intra_pred_flag : 1;
3530  uint32_t pic_order_present_flag : 1; /* Renamed to bottom_field_pic_order_in_frame_present_flag in newer standard versions. */
3531  uint32_t deblocking_filter_control_present_flag : 1;
3532  uint32_t redundant_pic_cnt_present_flag : 1;
3533  uint32_t reference_pic_flag : 1; /* nal_ref_idc != 0 */
3534  } bits;
3535  uint32_t value;
3536  } pic_fields;
3537  uint16_t frame_num;
3538 
3540  uint32_t va_reserved[VA_PADDING_MEDIUM];
3542 
3544 typedef struct _VAIQMatrixBufferH264 {
3546  uint8_t ScalingList4x4[6][16];
3548  uint8_t ScalingList8x8[2][64];
3549 
3551  uint32_t va_reserved[VA_PADDING_LOW];
3553 
3555 typedef struct _VASliceParameterBufferH264 {
3556  uint32_t slice_data_size;/* number of bytes in the slice data buffer for this slice */
3559  uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
3571  uint16_t first_mb_in_slice;
3572  uint8_t slice_type;
3573  uint8_t direct_spatial_mv_pred_flag;
3588  uint8_t cabac_init_idc;
3589  int8_t slice_qp_delta;
3590  uint8_t disable_deblocking_filter_idc;
3591  int8_t slice_alpha_c0_offset_div2;
3592  int8_t slice_beta_offset_div2;
3593  VAPictureH264 RefPicList0[32]; /* See 8.2.4.2 */
3594  VAPictureH264 RefPicList1[32]; /* See 8.2.4.2 */
3595  uint8_t luma_log2_weight_denom;
3596  uint8_t chroma_log2_weight_denom;
3597  uint8_t luma_weight_l0_flag;
3598  int16_t luma_weight_l0[32];
3599  int16_t luma_offset_l0[32];
3600  uint8_t chroma_weight_l0_flag;
3601  int16_t chroma_weight_l0[32][2];
3602  int16_t chroma_offset_l0[32][2];
3603  uint8_t luma_weight_l1_flag;
3604  int16_t luma_weight_l1[32];
3605  int16_t luma_offset_l1[32];
3606  uint8_t chroma_weight_l1_flag;
3607  int16_t chroma_weight_l1[32][2];
3608  int16_t chroma_offset_l1[32][2];
3609 
3611  uint32_t va_reserved[VA_PADDING_LOW];
3613 
3614 /****************************
3615  * Common encode data structures
3616  ****************************/
3617 typedef enum {
3618  VAEncPictureTypeIntra = 0,
3619  VAEncPictureTypePredictive = 1,
3620  VAEncPictureTypeBidirectional = 2,
3621 } VAEncPictureType;
3622 
3630 typedef struct _VAEncSliceParameterBuffer {
3631  uint32_t start_row_number; /* starting MB row number for this slice */
3632  uint32_t slice_height; /* slice height measured in MB */
3633  union {
3634  struct {
3635  uint32_t is_intra : 1;
3636  uint32_t disable_deblocking_filter_idc : 2;
3637  uint32_t uses_long_term_ref : 1;
3638  uint32_t is_long_term_ref : 1;
3639  } bits;
3640  uint32_t value;
3641  } slice_flags;
3642 
3644  uint32_t va_reserved[VA_PADDING_LOW];
3646 
3647 
3648 /****************************
3649  * H.263 specific encode data structures
3650  ****************************/
3651 
3652 typedef struct _VAEncSequenceParameterBufferH263 {
3653  uint32_t intra_period;
3654  uint32_t bits_per_second;
3655  uint32_t frame_rate;
3656  uint32_t initial_qp;
3657  uint32_t min_qp;
3658 
3660  uint32_t va_reserved[VA_PADDING_LOW];
3661 } VAEncSequenceParameterBufferH263;
3662 
3663 typedef struct _VAEncPictureParameterBufferH263 {
3664  VASurfaceID reference_picture;
3665  VASurfaceID reconstructed_picture;
3666  VABufferID coded_buf;
3667  uint16_t picture_width;
3668  uint16_t picture_height;
3669  VAEncPictureType picture_type;
3670 
3672  uint32_t va_reserved[VA_PADDING_LOW];
3673 } VAEncPictureParameterBufferH263;
3674 
3675 /****************************
3676  * MPEG-4 specific encode data structures
3677  ****************************/
3678 
3679 typedef struct _VAEncSequenceParameterBufferMPEG4 {
3680  uint8_t profile_and_level_indication;
3681  uint32_t intra_period;
3682  uint32_t video_object_layer_width;
3683  uint32_t video_object_layer_height;
3684  uint32_t vop_time_increment_resolution;
3685  uint32_t fixed_vop_rate;
3686  uint32_t fixed_vop_time_increment;
3687  uint32_t bits_per_second;
3688  uint32_t frame_rate;
3689  uint32_t initial_qp;
3690  uint32_t min_qp;
3691 
3693  uint32_t va_reserved[VA_PADDING_LOW];
3694 } VAEncSequenceParameterBufferMPEG4;
3695 
3696 typedef struct _VAEncPictureParameterBufferMPEG4 {
3697  VASurfaceID reference_picture;
3698  VASurfaceID reconstructed_picture;
3699  VABufferID coded_buf;
3700  uint16_t picture_width;
3701  uint16_t picture_height;
3702  uint32_t modulo_time_base; /* number of 1s */
3703  uint32_t vop_time_increment;
3704  VAEncPictureType picture_type;
3705 
3707  uint32_t va_reserved[VA_PADDING_LOW];
3708 } VAEncPictureParameterBufferMPEG4;
3709 
3710 
3711 
3730  VADisplay dpy,
3731  VAContextID context,
3732  VABufferType type, /* in */
3733  unsigned int size, /* in */
3734  unsigned int num_elements, /* in */
3735  void *data, /* in */
3736  VABufferID *buf_id /* out */
3737 );
3738 
3751  VADisplay dpy,
3752  VAContextID context,
3753  VABufferType type,
3754  unsigned int width,
3755  unsigned int height,
3756  unsigned int *unit_size,
3757  unsigned int *pitch,
3758  VABufferID *buf_id
3759 );
3760 
3768  VADisplay dpy,
3769  VABufferID buf_id, /* in */
3770  unsigned int num_elements /* in */
3771 );
3772 
3773 
3778 /*
3779  * FICTURE_AVE_QP(bit7-0): The average Qp value used during this frame
3780  * LARGE_SLICE(bit8):At least one slice in the current frame was large
3781  * enough for the encoder to attempt to limit its size.
3782  * SLICE_OVERFLOW(bit9): At least one slice in the current frame has
3783  * exceeded the maximum slice size specified.
3784  * BITRATE_OVERFLOW(bit10): The peak bitrate was exceeded for this frame.
3785  * BITRATE_HIGH(bit11): The frame size got within the safety margin of the maximum size (VCM only)
3786  * AIR_MB_OVER_THRESHOLD: the number of MBs adapted to Intra MB
3787  */
3788 #define VA_CODED_BUF_STATUS_PICTURE_AVE_QP_MASK 0xff
3789 #define VA_CODED_BUF_STATUS_LARGE_SLICE_MASK 0x100
3790 #define VA_CODED_BUF_STATUS_SLICE_OVERFLOW_MASK 0x200
3791 #define VA_CODED_BUF_STATUS_BITRATE_OVERFLOW 0x400
3792 #define VA_CODED_BUF_STATUS_BITRATE_HIGH 0x800
3800 #define VA_CODED_BUF_STATUS_FRAME_SIZE_OVERFLOW 0x1000
3804 #define VA_CODED_BUF_STATUS_BAD_BITSTREAM 0x8000
3805 #define VA_CODED_BUF_STATUS_AIR_MB_OVER_THRESHOLD 0xff0000
3806 
3815 #define VA_CODED_BUF_STATUS_NUMBER_PASSES_MASK 0xf000000
3816 
3824 #define VA_CODED_BUF_STATUS_SINGLE_NALU 0x10000000
3825 
3836 typedef struct _VACodedBufferSegment {
3840  uint32_t size;
3842  uint32_t bit_offset;
3844  uint32_t status;
3846  uint32_t reserved;
3848  void *buf;
3853  void *next;
3854 
3856  uint32_t va_reserved[VA_PADDING_LOW];
3858 
3867 VAStatus vaMapBuffer(
3868  VADisplay dpy,
3869  VABufferID buf_id, /* in */
3870  void **pbuf /* out */
3871 );
3872 
3878 VAStatus vaUnmapBuffer(
3879  VADisplay dpy,
3880  VABufferID buf_id /* in */
3881 );
3882 
3893  VADisplay dpy,
3894  VABufferID buffer_id
3895 );
3896 
3898 typedef struct {
3900  uintptr_t handle;
3902  uint32_t type;
3911  uint32_t mem_type;
3913  size_t mem_size;
3914 
3916  uint32_t va_reserved[VA_PADDING_LOW];
3917 } VABufferInfo;
3918 
3966 VAStatus
3968 
3999 VAStatus
4001 
4007 #define VA_EXPORT_SURFACE_READ_ONLY 0x0001
4009 #define VA_EXPORT_SURFACE_WRITE_ONLY 0x0002
4011 #define VA_EXPORT_SURFACE_READ_WRITE 0x0003
4017 #define VA_EXPORT_SURFACE_SEPARATE_LAYERS 0x0004
4023 #define VA_EXPORT_SURFACE_COMPOSED_LAYERS 0x0008
4024 
4060  VASurfaceID surface_id,
4061  uint32_t mem_type, uint32_t flags,
4062  void *descriptor);
4063 
4080  VADisplay dpy,
4081  VAContextID context,
4082  VASurfaceID render_target
4083 );
4084 
4089  VADisplay dpy,
4090  VAContextID context,
4091  VABufferID *buffers,
4092  int num_buffers
4093 );
4094 
4103 VAStatus vaEndPicture(
4104  VADisplay dpy,
4105  VAContextID context
4106 );
4107 
4127 VAStatus vaMFSubmit(
4128  VADisplay dpy,
4129  VAMFContextID mf_context,
4130  VAContextID * contexts,
4131  int num_contexts
4132 );
4133 
4134 /*
4135 
4136 Synchronization
4137 
4138 */
4139 
4145 VAStatus vaSyncSurface(
4146  VADisplay dpy,
4147  VASurfaceID render_target
4148 );
4149 
4151 #define VA_TIMEOUT_INFINITE 0xFFFFFFFFFFFFFFFF
4152 
4174  VADisplay dpy,
4175  VASurfaceID surface,
4176  uint64_t timeout_ns
4177 );
4178 
4179 typedef enum {
4180  VASurfaceRendering = 1, /* Rendering in progress */
4181  VASurfaceDisplaying = 2, /* Displaying in progress (not safe to render into it) */
4182  /* this status is useful if surface is used as the source */
4183  /* of an overlay */
4184  VASurfaceReady = 4, /* not being rendered or displayed */
4185  VASurfaceSkipped = 8 /* Indicate a skipped frame during encode */
4186 } VASurfaceStatus;
4187 
4192  VADisplay dpy,
4193  VASurfaceID render_target,
4194  VASurfaceStatus *status /* out */
4195 );
4196 
4197 typedef enum {
4198  VADecodeSliceMissing = 0,
4199  VADecodeMBError = 1,
4200 } VADecodeErrorType;
4201 
4206 typedef struct _VASurfaceDecodeMBErrors {
4207  int32_t status; /* 1 if hardware has returned detailed info below, -1 means this record is invalid */
4208  uint32_t start_mb; /* start mb address with errors */
4209  uint32_t end_mb; /* end mb address with errors */
4210  VADecodeErrorType decode_error_type;
4211  uint32_t num_mb; /* number of mbs with errors */
4213  uint32_t va_reserved[VA_PADDING_LOW - 1];
4215 
4225  VADisplay dpy,
4226  VASurfaceID surface,
4227  VAStatus error_status,
4228  void **error_info
4229 );
4230 
4251 VAStatus vaSyncBuffer(
4252  VADisplay dpy,
4253  VABufferID buf_id,
4254  uint64_t timeout_ns
4255 );
4256 
4278 #define VA_FOURCC(ch0, ch1, ch2, ch3) \
4279  ((unsigned long)(unsigned char) (ch0) | ((unsigned long)(unsigned char) (ch1) << 8) | \
4280  ((unsigned long)(unsigned char) (ch2) << 16) | ((unsigned long)(unsigned char) (ch3) << 24 ))
4281 
4282 /* Pre-defined fourcc codes. */
4283 
4287 #define VA_FOURCC_NV12 0x3231564E
4291 #define VA_FOURCC_NV21 0x3132564E
4292 
4297 #define VA_FOURCC_AI44 0x34344149
4298 
4303 #define VA_FOURCC_RGBA 0x41424752
4308 #define VA_FOURCC_RGBX 0x58424752
4313 #define VA_FOURCC_BGRA 0x41524742
4318 #define VA_FOURCC_BGRX 0x58524742
4323 #define VA_FOURCC_ARGB 0x42475241
4328 #define VA_FOURCC_XRGB 0x42475258
4333 #define VA_FOURCC_ABGR 0x52474241
4338 #define VA_FOURCC_XBGR 0x52474258
4339 
4344 #define VA_FOURCC_UYVY 0x59565955
4349 #define VA_FOURCC_YUY2 0x32595559
4354 #define VA_FOURCC_AYUV 0x56555941
4359 #define VA_FOURCC_NV11 0x3131564e
4364 #define VA_FOURCC_YV12 0x32315659
4369 #define VA_FOURCC_P208 0x38303250
4374 #define VA_FOURCC_I420 0x30323449
4379 #define VA_FOURCC_YV24 0x34325659
4384 #define VA_FOURCC_YV32 0x32335659
4387 #define VA_FOURCC_Y800 0x30303859
4393 #define VA_FOURCC_IMC3 0x33434D49
4398 #define VA_FOURCC_411P 0x50313134
4404 #define VA_FOURCC_411R 0x52313134
4409 #define VA_FOURCC_422H 0x48323234
4414 #define VA_FOURCC_422V 0x56323234
4419 #define VA_FOURCC_444P 0x50343434
4420 
4425 #define VA_FOURCC_RGBP 0x50424752
4430 #define VA_FOURCC_BGRP 0x50524742
4436 #define VA_FOURCC_RGB565 0x36314752
4442 #define VA_FOURCC_BGR565 0x36314742
4443 
4449 #define VA_FOURCC_Y210 0x30313259
4455 #define VA_FOURCC_Y212 0x32313259
4461 #define VA_FOURCC_Y216 0x36313259
4467 #define VA_FOURCC_Y410 0x30313459
4473 #define VA_FOURCC_Y412 0x32313459
4479 #define VA_FOURCC_Y416 0x36313459
4480 
4485 #define VA_FOURCC_YV16 0x36315659
4491 #define VA_FOURCC_P010 0x30313050
4497 #define VA_FOURCC_P012 0x32313050
4503 #define VA_FOURCC_P016 0x36313050
4504 
4510 #define VA_FOURCC_I010 0x30313049
4511 
4516 #define VA_FOURCC_IYUV 0x56555949
4520 #define VA_FOURCC_A2R10G10B10 0x30335241 /* VA_FOURCC('A','R','3','0') */
4524 #define VA_FOURCC_A2B10G10R10 0x30334241 /* VA_FOURCC('A','B','3','0') */
4528 #define VA_FOURCC_X2R10G10B10 0x30335258 /* VA_FOURCC('X','R','3','0') */
4532 #define VA_FOURCC_X2B10G10R10 0x30334258 /* VA_FOURCC('X','B','3','0') */
4533 
4538 #define VA_FOURCC_Y8 0x20203859
4543 #define VA_FOURCC_Y16 0x20363159
4548 #define VA_FOURCC_VYUY 0x59555956
4553 #define VA_FOURCC_YVYU 0x55595659
4558 #define VA_FOURCC_ARGB64 0x34475241
4563 #define VA_FOURCC_ABGR64 0x34474241
4568 #define VA_FOURCC_XYUV 0x56555958
4569 
4570 /* byte order */
4571 #define VA_LSB_FIRST 1
4572 #define VA_MSB_FIRST 2
4573 
4574 typedef struct _VAImageFormat {
4575  uint32_t fourcc;
4576  uint32_t byte_order; /* VA_LSB_FIRST, VA_MSB_FIRST */
4577  uint32_t bits_per_pixel;
4578  /* for RGB formats */
4579  uint32_t depth; /* significant bits per pixel */
4580  uint32_t red_mask;
4581  uint32_t green_mask;
4582  uint32_t blue_mask;
4583  uint32_t alpha_mask;
4584 
4586  uint32_t va_reserved[VA_PADDING_LOW];
4587 } VAImageFormat;
4588 
4589 typedef VAGenericID VAImageID;
4590 
4591 typedef struct _VAImage {
4592  VAImageID image_id; /* uniquely identify this image */
4593  VAImageFormat format;
4594  VABufferID buf; /* image data buffer */
4595  /*
4596  * Image data will be stored in a buffer of type VAImageBufferType to facilitate
4597  * data store on the server side for optimal performance. The buffer will be
4598  * created by the CreateImage function, and proper storage allocated based on the image
4599  * size and format. This buffer is managed by the library implementation, and
4600  * accessed by the client through the buffer Map/Unmap functions.
4601  */
4602  uint16_t width;
4603  uint16_t height;
4604  uint32_t data_size;
4605  uint32_t num_planes; /* can not be greater than 3 */
4606  /*
4607  * An array indicating the scanline pitch in bytes for each plane.
4608  * Each plane may have a different pitch. Maximum 3 planes for planar formats
4609  */
4610  uint32_t pitches[3];
4611  /*
4612  * An array indicating the byte offset from the beginning of the image data
4613  * to the start of each plane.
4614  */
4615  uint32_t offsets[3];
4616 
4617  /* The following fields are only needed for paletted formats */
4618  int32_t num_palette_entries; /* set to zero for non-palette images */
4619  /*
4620  * Each component is one byte and entry_bytes indicates the number of components in
4621  * each entry (eg. 3 for YUV palette entries). set to zero for non-palette images
4622  */
4623  int32_t entry_bytes;
4624  /*
4625  * An array of ascii characters describing the order of the components within the bytes.
4626  * Only entry_bytes characters of the string are used.
4627  */
4628  int8_t component_order[4];
4629 
4631  uint32_t va_reserved[VA_PADDING_LOW];
4632 } VAImage;
4633 
4636  VADisplay dpy
4637 );
4638 
4646  VADisplay dpy,
4647  VAImageFormat *format_list, /* out */
4648  int *num_formats /* out */
4649 );
4650 
4658 VAStatus vaCreateImage(
4659  VADisplay dpy,
4660  VAImageFormat *format,
4661  int width,
4662  int height,
4663  VAImage *image /* out */
4664 );
4665 
4670  VADisplay dpy,
4671  VAImageID image
4672 );
4673 
4674 VAStatus vaSetImagePalette(
4675  VADisplay dpy,
4676  VAImageID image,
4677  /*
4678  * pointer to an array holding the palette data. The size of the array is
4679  * num_palette_entries * entry_bytes in size. The order of the components
4680  * in the palette is described by the component_order in VAImage struct
4681  */
4682  unsigned char *palette
4683 );
4684 
4689 VAStatus vaGetImage(
4690  VADisplay dpy,
4691  VASurfaceID surface,
4692  int x, /* coordinates of the upper left source pixel */
4693  int y,
4694  unsigned int width, /* width and height of the region */
4695  unsigned int height,
4696  VAImageID image
4697 );
4698 
4705 VAStatus vaPutImage(
4706  VADisplay dpy,
4707  VASurfaceID surface,
4708  VAImageID image,
4709  int src_x,
4710  int src_y,
4711  unsigned int src_width,
4712  unsigned int src_height,
4713  int dest_x,
4714  int dest_y,
4715  unsigned int dest_width,
4716  unsigned int dest_height
4717 );
4718 
4750 VAStatus vaDeriveImage(
4751  VADisplay dpy,
4752  VASurfaceID surface,
4753  VAImage *image /* out */
4754 );
4755 
4764 
4767  VADisplay dpy
4768 );
4769 
4771 #define VA_SUBPICTURE_CHROMA_KEYING 0x0001
4772 #define VA_SUBPICTURE_GLOBAL_ALPHA 0x0002
4773 #define VA_SUBPICTURE_DESTINATION_IS_SCREEN_COORD 0x0004
4787  VADisplay dpy,
4788  VAImageFormat *format_list, /* out */
4789  unsigned int *flags, /* out */
4790  unsigned int *num_formats /* out */
4791 );
4792 
4797  VADisplay dpy,
4798  VAImageID image,
4799  VASubpictureID *subpicture /* out */
4800 );
4801 
4806  VADisplay dpy,
4807  VASubpictureID subpicture
4808 );
4809 
4815  VADisplay dpy,
4816  VASubpictureID subpicture,
4817  VAImageID image
4818 );
4819 
4830  VADisplay dpy,
4831  VASubpictureID subpicture,
4832  unsigned int chromakey_min,
4833  unsigned int chromakey_max,
4834  unsigned int chromakey_mask
4835 );
4836 
4843  VADisplay dpy,
4844  VASubpictureID subpicture,
4845  float global_alpha
4846 );
4847 
4856  VADisplay dpy,
4857  VASubpictureID subpicture,
4858  VASurfaceID *target_surfaces,
4859  int num_surfaces,
4860  int16_t src_x, /* upper left offset in subpicture */
4861  int16_t src_y,
4862  uint16_t src_width,
4863  uint16_t src_height,
4864  int16_t dest_x, /* upper left offset in surface */
4865  int16_t dest_y,
4866  uint16_t dest_width,
4867  uint16_t dest_height,
4868  /*
4869  * whether to enable chroma-keying, global-alpha, or screen relative mode
4870  * see VA_SUBPICTURE_XXX values
4871  */
4872  uint32_t flags
4873 );
4874 
4879  VADisplay dpy,
4880  VASubpictureID subpicture,
4881  VASurfaceID *target_surfaces,
4882  int num_surfaces
4883 );
4884 
4902 /* PowerVR IEP Lite attributes */
4903 typedef enum {
4904  VADISPLAYATTRIB_BLE_OFF = 0x00,
4905  VADISPLAYATTRIB_BLE_LOW,
4906  VADISPLAYATTRIB_BLE_MEDIUM,
4907  VADISPLAYATTRIB_BLE_HIGH,
4908  VADISPLAYATTRIB_BLE_NONE,
4910 
4912 #define VA_ROTATION_NONE 0x00000000
4913 #define VA_ROTATION_90 0x00000001
4914 #define VA_ROTATION_180 0x00000002
4915 #define VA_ROTATION_270 0x00000003
4927 #define VA_MIRROR_NONE 0x00000000
4929 #define VA_MIRROR_HORIZONTAL 0x00000001
4931 #define VA_MIRROR_VERTICAL 0x00000002
4935 #define VA_OOL_DEBLOCKING_FALSE 0x00000000
4936 #define VA_OOL_DEBLOCKING_TRUE 0x00000001
4937 
4939 #define VA_RENDER_MODE_UNDEFINED 0
4940 #define VA_RENDER_MODE_LOCAL_OVERLAY 1
4941 #define VA_RENDER_MODE_LOCAL_GPU 2
4942 #define VA_RENDER_MODE_EXTERNAL_OVERLAY 4
4943 #define VA_RENDER_MODE_EXTERNAL_GPU 8
4944 
4946 #define VA_RENDER_DEVICE_UNDEFINED 0
4947 #define VA_RENDER_DEVICE_LOCAL 1
4948 #define VA_RENDER_DEVICE_EXTERNAL 2
4949 
4963 typedef union _VADisplayAttribValSubDevice {
4964  struct {
4966  uint32_t current_sub_device : 4;
4968  uint32_t sub_device_count : 4;
4970  uint32_t reserved : 8;
4986  uint32_t sub_device_mask : 16;
4987  } bits;
4988  uint32_t value;
4990 
4992 typedef enum {
4993  VADisplayAttribBrightness = 0,
4994  VADisplayAttribContrast = 1,
4995  VADisplayAttribHue = 2,
4996  VADisplayAttribSaturation = 3,
4997  /* client can specifiy a background color for the target window
4998  * the new feature of video conference,
4999  * the uncovered area of the surface is filled by this color
5000  * also it will blend with the decoded video color
5001  */
5002  VADisplayAttribBackgroundColor = 4,
5003  /*
5004  * this is a gettable only attribute. For some implementations that use the
5005  * hardware overlay, after PutSurface is called, the surface can not be
5006  * re-used until after the subsequent PutSurface call. If this is the case
5007  * then the value for this attribute will be set to 1 so that the client
5008  * will not attempt to re-use the surface right after returning from a call
5009  * to PutSurface.
5010  *
5011  * Don't use it, use flag VASurfaceDisplaying of vaQuerySurfaceStatus since
5012  * driver may use overlay or GPU alternatively
5013  */
5014  VADisplayAttribDirectSurface = 5,
5015  VADisplayAttribRotation = 6,
5016  VADisplayAttribOutofLoopDeblock = 7,
5017 
5018  /* PowerVR IEP Lite specific attributes */
5019  VADisplayAttribBLEBlackMode = 8,
5020  VADisplayAttribBLEWhiteMode = 9,
5021  VADisplayAttribBlueStretch = 10,
5022  VADisplayAttribSkinColorCorrection = 11,
5023  /*
5024  * For type VADisplayAttribCSCMatrix, "value" field is a pointer to the color
5025  * conversion matrix. Each element in the matrix is float-point
5026  */
5027  VADisplayAttribCSCMatrix = 12,
5028  /* specify the constant color used to blend with video surface
5029  * Cd = Cv*Cc*Ac + Cb *(1 - Ac) C means the constant RGB
5030  * d: the final color to overwrite into the frame buffer
5031  * v: decoded video after color conversion,
5032  * c: video color specified by VADisplayAttribBlendColor
5033  * b: background color of the drawable
5034  */
5035  VADisplayAttribBlendColor = 13,
5036  /*
5037  * Indicate driver to skip painting color key or not.
5038  * only applicable if the render is overlay
5039  */
5040  VADisplayAttribOverlayAutoPaintColorKey = 14,
5041  /*
5042  * customized overlay color key, the format is RGB888
5043  * [23:16] = Red, [15:08] = Green, [07:00] = Blue.
5044  */
5045  VADisplayAttribOverlayColorKey = 15,
5046  /*
5047  * The hint for the implementation of vaPutSurface
5048  * normally, the driver could use an overlay or GPU to render the surface on the screen
5049  * this flag provides APP the flexibity to switch the render dynamically
5050  */
5051  VADisplayAttribRenderMode = 16,
5052  /*
5053  * specify if vaPutSurface needs to render into specified monitors
5054  * one example is that one external monitor (e.g. HDMI) is enabled,
5055  * but the window manager is not aware of it, and there is no associated drawable
5056  */
5057  VADisplayAttribRenderDevice = 17,
5058  /*
5059  * specify vaPutSurface render area if there is no drawable on the monitor
5060  */
5061  VADisplayAttribRenderRect = 18,
5062  /*
5063  * HW attribute, read/write, specify the sub device configure
5064  */
5065  VADisplayAttribSubDevice = 19,
5066  /*
5067  * HW attribute. read only. specify whether vaCopy support on current HW
5068  * The value of each bit should equal to 1 << VA_EXEC_MODE_XXX to represent
5069  * modes of vaCopy
5070  */
5071  VADisplayAttribCopy = 20,
5072  /*
5073  * HW attribute. read only. retrieve the device information from backend driver
5074  * the value should be combined with vendor ID << 16 | device ID
5075  */
5076  VADisplayPCIID = 21,
5078 
5079 /* flags for VADisplayAttribute */
5080 #define VA_DISPLAY_ATTRIB_NOT_SUPPORTED 0x0000
5081 #define VA_DISPLAY_ATTRIB_GETTABLE 0x0001
5082 #define VA_DISPLAY_ATTRIB_SETTABLE 0x0002
5083 
5084 typedef struct _VADisplayAttribute {
5085  VADisplayAttribType type;
5086  int32_t min_value;
5087  int32_t max_value;
5088  int32_t value; /* used by the set/get attribute functions */
5089  /* flags can be VA_DISPLAY_ATTRIB_GETTABLE or VA_DISPLAY_ATTRIB_SETTABLE or OR'd together */
5090  uint32_t flags;
5091 
5093  uint32_t va_reserved[VA_PADDING_LOW];
5094 } VADisplayAttribute;
5095 
5098  VADisplay dpy
5099 );
5100 
5108  VADisplay dpy,
5109  VADisplayAttribute *attr_list, /* out */
5110  int *num_attributes /* out */
5111 );
5112 
5120  VADisplay dpy,
5121  VADisplayAttribute *attr_list, /* in/out */
5122  int num_attributes
5123 );
5124 
5132  VADisplay dpy,
5133  VADisplayAttribute *attr_list,
5134  int num_attributes
5135 );
5136 
5137 /****************************
5138  * HEVC data structures
5139  ****************************/
5149 typedef struct _VAPictureHEVC {
5153  VASurfaceID picture_id;
5158  int32_t pic_order_cnt;
5159  /* described below */
5160  uint32_t flags;
5161 
5163  uint32_t va_reserved[VA_PADDING_LOW];
5164 } VAPictureHEVC;
5165 
5166 /* flags in VAPictureHEVC could be OR of the following */
5167 #define VA_PICTURE_HEVC_INVALID 0x00000001
5171 #define VA_PICTURE_HEVC_FIELD_PIC 0x00000002
5176 #define VA_PICTURE_HEVC_BOTTOM_FIELD 0x00000004
5178 #define VA_PICTURE_HEVC_LONG_TERM_REFERENCE 0x00000008
5193 #define VA_PICTURE_HEVC_RPS_ST_CURR_BEFORE 0x00000010
5198 #define VA_PICTURE_HEVC_RPS_ST_CURR_AFTER 0x00000020
5203 #define VA_PICTURE_HEVC_RPS_LT_CURR 0x00000040
5204 
5205 typedef enum {
5206  VACopyObjectSurface = 0,
5207  VACopyObjectBuffer = 1,
5208 } VACopyObjectType;
5209 
5210 typedef struct _VACopyObject {
5211  VACopyObjectType obj_type; // type of object.
5212  union {
5213  VASurfaceID surface_id;
5214  VABufferID buffer_id;
5215  } object;
5216 
5217  uint32_t va_reserved[VA_PADDING_MEDIUM];
5218 } VACopyObject;
5219 
5220 typedef union _VACopyOption {
5221  struct {
5223  uint32_t va_copy_sync : 2;
5225  uint32_t va_copy_mode : 4;
5226  uint32_t reserved : 26;
5227  } bits;
5228  uint32_t value;
5229 } VACopyOption;
5230 
5243 VAStatus vaCopy(VADisplay dpy, VACopyObject * dst, VACopyObject * src, VACopyOption option);
5244 
5245 #include <va/va_dec_hevc.h>
5246 #include <va/va_dec_jpeg.h>
5247 #include <va/va_dec_vp8.h>
5248 #include <va/va_dec_vp9.h>
5249 #include <va/va_dec_av1.h>
5250 #include <va/va_enc_hevc.h>
5251 #include <va/va_fei_hevc.h>
5252 #include <va/va_enc_h264.h>
5253 #include <va/va_enc_jpeg.h>
5254 #include <va/va_enc_mpeg2.h>
5255 #include <va/va_enc_vp8.h>
5256 #include <va/va_enc_vp9.h>
5257 #include <va/va_enc_av1.h>
5258 #include <va/va_fei.h>
5259 #include <va/va_fei_h264.h>
5260 #include <va/va_vpp.h>
5261 #include <va/va_prot.h>
5262 
5265 #ifdef __cplusplus
5266 }
5267 #endif
5268 
5269 #endif /* _VA_H_ */
VAStatus vaTerminate(VADisplay dpy)
VAMvModeVC1
Definition: va.h:3255
VAEncMiscParameterType
Definition: va.h:2275
VADisplayAttribBLEMode
Definition: va.h:4903
VAStatus vaDestroySurfaces(VADisplay dpy, VASurfaceID *surfaces, int num_surfaces)
VAGenericID VASubpictureID
Definition: va.h:4763
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:1601
VAStatus vaDestroyContext(VADisplay dpy, VAContextID context)
VABufferType
Definition: va.h:1971
VAStatus vaInitialize(VADisplay dpy, int *major_version, int *minor_version)
void(* VAMessageCallback)(void *user_context, const char *message)
Definition: va.h:422
VAStatus vaMFReleaseContext(VADisplay dpy, VAMFContextID mf_context, VAContextID context)
VAConfigAttribType
Definition: va.h:606
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:1609
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:1593
VASurfaceAttribType
Surface attribute types.
Definition: va.h:1639
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:539
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:443
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:2315
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:494
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:359
VAStatus vaDeriveImage(VADisplay dpy, VASurfaceID surface, VAImage *image)
VAStatus vaMFAddContext(VADisplay dpy, VAMFContextID mf_context, VAContextID context)
unsigned int VAGenericID
Definition: va.h:1530
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:1969
int vaMaxNumImageFormats(VADisplay dpy)
VAStatus vaCreateMFContext(VADisplay dpy, VAMFContextID *mf_context)
void * VADisplay
Definition: va.h:259
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:2311
@ VAEncMiscParameterTypeParallelBRC
Buffer type used for parallel BRC parameters.
Definition: va.h:2301
@ VAEncMiscParameterTypeRIR
Buffer type used for Rolling intra refresh.
Definition: va.h:2286
@ VAEncMiscParameterTypeCustomRoundingControl
Buffer type used for encoder rounding offset parameters.
Definition: va.h:2307
@ VAEncMiscParameterTypeHRD
Buffer type used for HRD parameters.
Definition: va.h:2283
@ VAEncMiscParameterTypeROI
Buffer type used for region-of-interest (ROI) parameters.
Definition: va.h:2293
@ VAEncMiscParameterTypeSubMbPartPel
Set MB partion mode mask and Half-pel/Quant-pel motion search.
Definition: va.h:2303
@ VAEncMiscParameterTypeEncQuality
set encode quality tuning
Definition: va.h:2305
@ VAEncMiscParameterTypeDirtyRect
Buffer type used for dirty region-of-interest (ROI) parameters.
Definition: va.h:2299
@ VAEncMiscParameterTypeQuantization
Buffer type used for quantization parameters, it's per-sequence parameter.
Definition: va.h:2288
@ VAEncMiscParameterTypeTemporalLayerStructure
Buffer type used for temporal layer structure.
Definition: va.h:2297
@ VAEncMiscParameterTypeMaxFrameSize
Buffer type used to express a maximum frame size (in bits).
Definition: va.h:2281
@ VAEncMiscParameterTypeMultiPassFrameSize
Buffer type used to express a maximum frame size (in bytes) settings for multiple pass.
Definition: va.h:2295
@ VAEncMiscParameterTypeSkipFrame
Buffer type used for sending skip frame parameters to the encoder's rate control, when the user has e...
Definition: va.h:2291
@ VAEncMiscParameterTypeFEIFrameControl
Buffer type used for FEI input frame level parameters.
Definition: va.h:2309
@ VAGenericValueTypeInteger
Definition: va.h:1602
@ VAGenericValueTypeFloat
Definition: va.h:1603
@ VAGenericValueTypePointer
Definition: va.h:1604
@ VAGenericValueTypeFunc
Definition: va.h:1605
@ VAProcPipelineParameterBufferType
Video processing pipeline parameter buffer.
Definition: va.h:2013
@ VASubsetsParameterBufferType
HEVC Decoding Subset Parameter buffer type.
Definition: va.h:2073
@ VAContextParameterUpdateBufferType
adjust context parameters dynamically
Definition: va.h:2079
@ VAEncQPBufferType
Encoding QP buffer.
Definition: va.h:2005
@ VAEncMacroblockDisableSkipMapBufferType
Definition: va.h:2048
@ VAProtectedSessionExecuteBufferType
Protected session execution buffer type.
Definition: va.h:2086
@ VAEncFEICTBCmdBufferType
HEVC FEI CTB level cmd buffer it is CTB level information for future usage.
Definition: va.h:2053
@ VAProcFilterParameterBufferType
Video filter parameter buffer.
Definition: va.h:2026
@ VAStatsStatisticsBufferType
Statistics output for VAEntrypointStats progressive and top field of interlaced case.
Definition: va.h:2037
@ VAStatsStatisticsBottomFieldBufferType
Statistics output for VAEntrypointStats bottom field of interlaced case.
Definition: va.h:2039
@ VAEncFEICURecordBufferType
HEVC FEI CU level data buffer it's CTB level information for future usage.
Definition: va.h:2058
@ VAEncryptionParameterBufferType
Encryption parameters buffer for protected content session.
Definition: va.h:2092
@ VADecodeStreamoutBufferType
Definition: va.h:2061
@ VAEncDeltaQpPerBlockBufferType
Encoding delta QP per block buffer.
Definition: va.h:2103
@ VAEncFEIMVBufferType
FEI specific buffer types.
Definition: va.h:2030
@ VAConfigAttribProcessingRate
Processing rate reporting attribute. Read-only.
Definition: va.h:821
@ VAConfigAttribMaxPictureHeight
Maximum picture height. Read-only.
Definition: va.h:751
@ VAConfigAttribProtectedContentCipherMode
Cipher mode of the protected content session.
Definition: va.h:964
@ VAConfigAttribEncMacroblockInfo
Macroblock information. Read-only.
Definition: va.h:737
@ VAConfigAttribFrameSizeToleranceSupport
frame size tolerance support it indicates the tolerance of frame size
Definition: va.h:861
@ VAConfigAttribContextPriority
priority setting for the context. Read-Write attribute value is VAConfigAttribValContextPriority this...
Definition: va.h:932
@ VAConfigAttribProtectedContentUsage
Special usage attribute of the protected session.
Definition: va.h:978
@ VAConfigAttribEncQuantization
Encoding quantization attribute. Read-only.
Definition: va.h:775
@ VAConfigAttribProtectedContentCipherSampleType
Decryption sample type of the protected content session.
Definition: va.h:971
@ VAConfigAttribEncPerBlockControl
Settings per block attribute for Encoding. Read-only.
Definition: va.h:1030
@ VAConfigAttribTEETypeClient
TEE type client is a specific module supporting specific functions in TEE. Read-only.
Definition: va.h:943
@ VAConfigAttribMaxFrameSize
encode max frame size attribute. Read-only attribute value VAConfigAttribValMaxFrameSize represent ma...
Definition: va.h:911
@ VAConfigAttribDecJPEG
JPEG decoding attribute. Read-only.
Definition: va.h:635
@ VAConfigAttribEncMaxSlices
Maximum number of slices per frame. Read-only.
Definition: va.h:708
@ VAConfigAttribDecSliceMode
Slice Decoding mode. Read/write.
Definition: va.h:627
@ VAConfigAttribCustomRoundingControl
whether accept rouding setting from application. Read-only. This attribute is for encode quality,...
Definition: va.h:900
@ VAConfigAttribEncSkipFrame
Encoding skip frame attribute. Read-only.
Definition: va.h:791
@ VAConfigAttribEncHEVCFeatures
HEVC/H.265 encoding features. Read-only.
Definition: va.h:989
@ VAConfigAttribEncAV1Ext2
AV1 encoding attribute extend2. Read-only.
Definition: va.h:1023
@ VAConfigAttribEncQualityRange
Encoding quality range attribute. Read-only.
Definition: va.h:768
@ VAConfigAttribEncDynamicScaling
Dynamic Scaling Attribute. Read-only.
Definition: va.h:856
@ VAConfigAttribEncTileSupport
Tile Support Attribute. Read-only.
Definition: va.h:894
@ VAConfigAttribEncROI
Encoding region-of-interest (ROI) attribute. Read-only.
Definition: va.h:802
@ VAConfigAttribFEIMVPredictors
Maximum number of FEI MV predictors. Read-only.
Definition: va.h:878
@ VAConfigAttribEncAV1
AV1 encoding attribute. Read-only.
Definition: va.h:1007
@ VAConfigAttribEncSliceStructure
Slice structure. Read-only.
Definition: va.h:725
@ VAConfigAttribStats
Statistics attribute. Read-only.
Definition: va.h:886
@ VAConfigAttribEncMaxRefFrames
Maximum number of reference frames. Read-only.
Definition: va.h:701
@ VAConfigAttribQPBlockSize
Encoding QP info block size attribute. Read-only. This attribute conveys the block sizes that underly...
Definition: va.h:906
@ VAConfigAttribEncRateControlExt
Encoding extended rate control attribute. Read-only.
Definition: va.h:810
@ VAConfigAttribEncHEVCBlockSizes
HEVC/H.265 encoding block sizes. Read-only.
Definition: va.h:999
@ VAConfigAttribMaxPictureWidth
Maximum picture width. Read-only.
Definition: va.h:744
@ VAConfigAttribEncIntraRefresh
Encoding intra refresh attribute. Read-only.
Definition: va.h:783
@ VAConfigAttribDecProcessing
Decode processing support. Read/write.
Definition: va.h:668
@ VAConfigAttribPredictionDirection
inter frame prediction directrion attribute. Read-only. this attribute conveys the prediction directi...
Definition: va.h:923
@ VAConfigAttribTEEType
TEE could be any HW secure device. Read-only.
Definition: va.h:941
@ VAConfigAttribFEIFunctionType
Encode function type for FEI.
Definition: va.h:870
@ VAConfigAttribDecAV1Features
AV1 decoding features. Read-only.
Definition: va.h:939
@ VAConfigAttribEncParallelRateControl
Parallel Rate Control (hierachical B) attribute. Read-only.
Definition: va.h:847
@ VAConfigAttribEncJPEG
JPEG encoding attribute. Read-only.
Definition: va.h:759
@ VAConfigAttribEncInterlaced
Interlaced mode. Read/write.
Definition: va.h:690
@ VAConfigAttribProtectedContentCipherBlockSize
Cipher block size of the protected content session.
Definition: va.h:957
@ VAConfigAttribMultipleFrame
combined submission of multiple frames from different streams, it is optimization for different HW im...
Definition: va.h:927
@ VAConfigAttribEncAV1Ext1
AV1 encoding attribute extend1. Read-only.
Definition: va.h:1015
@ VAConfigAttribEncPackedHeaders
Packed headers mode. Read/write.
Definition: va.h:681
@ VAConfigAttribEncDirtyRect
Encoding dirty rectangle. Read-only.
Definition: va.h:835
@ VAConfigAttribProtectedContentCipherAlgorithm
Cipher algorithm of the protected content session.
Definition: va.h:950
@ VASurfaceAttribMaxWidth
Maximal width in pixels (int, read-only).
Definition: va.h:1654
@ VASurfaceAttribUsageHint
Surface usage hint, gives the driver a hint of intended usage to optimize allocation (e....
Definition: va.h:1670
@ VASurfaceAttribMemoryType
Surface memory type expressed in bit fields (int, read/write).
Definition: va.h:1660
@ VASurfaceAttribMaxHeight
Maximal height in pixels (int, read-only).
Definition: va.h:1658
@ VASurfaceAttribDRMFormatModifiers
List of possible DRM format modifiers (pointer, write).
Definition: va.h:1677
@ VASurfaceAttribMinWidth
Minimal width in pixels (int, read-only).
Definition: va.h:1652
@ VASurfaceAttribExternalBufferDescriptor
External buffer descriptor (pointer, write).
Definition: va.h:1667
@ VASurfaceAttribPixelFormat
Pixel format as a FOURCC (int, read/write).
Definition: va.h:1650
@ VASurfaceAttribCount
Number of surface attributes.
Definition: va.h:1679
@ VASurfaceAttribMinHeight
Minimal height in pixels (int, read-only).
Definition: va.h:1656
@ VAEntrypointFEI
VAEntrypointFEI.
Definition: va.h:573
@ VAEntrypointProtectedTEEComm
VAEntrypointProtectedTEEComm.
Definition: va.h:596
@ VAEntrypointVideoProc
Definition: va.h:556
@ VAEntrypointStats
VAEntrypointStats.
Definition: va.h:590
@ VAEntrypointProtectedContent
VAEntrypointProtectedContent.
Definition: va.h:602
@ VAEncPackedHeaderPicture
Packed picture header.
Definition: va.h:2319
@ VAEncPackedHeaderRawData
Packed raw header.
Definition: va.h:2330
@ VAEncPackedHeaderSequence
Packed sequence header.
Definition: va.h:2317
@ VAEncPackedHeaderSlice
Packed slice header.
Definition: va.h:2321
@ VAProfileProtected
Profile ID used for protected video playback.
Definition: va.h:533
@ VAProfileNone
Profile ID used for video processing.
Definition: va.h:496
VA buffer information.
Definition: va.h:3898
uint32_t mem_type
Buffer memory type (See VASurfaceAttribMemoryType).
Definition: va.h:3911
uint32_t type
Buffer type (See VABufferType).
Definition: va.h:3902
size_t mem_size
Size of the underlying buffer.
Definition: va.h:3913
uintptr_t handle
Buffer handle.
Definition: va.h:3900
Coded buffer segment.
Definition: va.h:3836
uint32_t bit_offset
Bit offset into the data buffer where the video data starts.
Definition: va.h:3842
uint32_t status
Status set by the driver. See VA_CODED_BUF_STATUS_*.
Definition: va.h:3844
void * next
Pointer to the next VACodedBufferSegment element, or NULL if there is none.
Definition: va.h:3853
uint32_t size
Size of the data buffer in this segment (in bytes).
Definition: va.h:3840
void * buf
Pointer to the start of the data buffer.
Definition: va.h:3848
uint32_t reserved
Reserved for future use.
Definition: va.h:3846
Definition: va.h:1041
update the context parameter this structure is used to update context parameters, such as priority of...
Definition: va.h:2113
uint32_t context_priority_update
indicate whether context priority changed
Definition: va.h:2117
VAConfigAttribValContextPriority context_priority
task/context priority
Definition: va.h:2124
uint32_t reserved
Reserved bits for future use, must be zero.
Definition: va.h:2119
Defines a maximum frame size (in bits).
Definition: va.h:2649
uint32_t max_frame_size
Maximum size of a frame (in bits).
Definition: va.h:2654
Maximum frame size (in bytes) settings for multiple pass.
Definition: va.h:2669
uint8_t * delta_qp
delta QP list for every pass
Definition: va.h:2680
uint32_t reserved
Reserved bytes for future use, must be zero.
Definition: va.h:2676
uint8_t num_passes
number of passes, every pass has different QP, currently AVC encoder can support up to 4 passes
Definition: va.h:2678
uint32_t max_frame_size
Maximum size of a frame (in byte)
Definition: va.h:2674
Encoding quality level.
Definition: va.h:2697
uint32_t quality_level
Encoding quality level setting. When set to 0, default quality level is used.
Definition: va.h:2701
Definition: va.h:2371
Custom Encoder Rounding Offset Control. Application may use this structure to set customized rounding...
Definition: va.h:2936
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:2943
uint32_t rounding_offset_intra
Intra rounding offset Ignored if enable_custom_rouding_intra equals 0.
Definition: va.h:2948
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:2954
uint32_t rounding_offset_inter
Inter rounding offset Ignored if enable_custom_rouding_inter equals 0.
Definition: va.h:2959
Definition: va.h:2862
uint32_t PanicModeDisable
Definition: va.h:2910
uint32_t UltraHMEDisable
Definition: va.h:2906
uint32_t HMEDisable
Definition: va.h:2902
uint32_t FTQSkipThresholdLUTInput
Definition: va.h:2879
uint32_t HMEMVCostScalingFactor
Definition: va.h:2900
uint32_t SuperHMEDisable
Definition: va.h:2904
uint32_t FTQOverride
Definition: va.h:2874
uint32_t ForceRepartitionCheck
Definition: va.h:2915
uint32_t directBiasAdjustmentEnable
Definition: va.h:2886
uint32_t NonFTQSkipThresholdLUTInput
Definition: va.h:2882
uint32_t useRawPicForRef
Definition: va.h:2868
uint32_t FTQEnable
Definition: va.h:2876
uint32_t skipCheckDisable
Definition: va.h:2871
uint32_t globalMotionBiasAdjustmentEnable
Definition: va.h:2893
Definition: va.h:2513
uint32_t reserved
Definition: va.h:2539
uint32_t temporal_id
Definition: va.h:2537
uint32_t framerate
Definition: va.h:2533
Definition: va.h:2617
uint32_t buffer_size
Definition: va.h:2634
uint32_t initial_buffer_fullness
Definition: va.h:2628
Definition: va.h:2553
Attribute value for VAConfigAttribEncParallelRateControl.
Definition: va.h:2850
uint32_t num_layers
Definition: va.h:2852
uint32_t * num_b_in_gop
Definition: va.h:2857
Quantization settings for encoding.
Definition: va.h:2713
Rate control parameters.
Definition: va.h:2396
uint32_t bits_per_second
Definition: va.h:2398
uint32_t basic_unit_size
Definition: va.h:2426
uint32_t reserved
Definition: va.h:2473
uint32_t frame_tolerance_mode
Definition: va.h:2471
uint32_t mb_rate_control
Definition: va.h:2446
uint32_t temporal_id
Definition: va.h:2448
uint32_t disable_bit_stuffing
Definition: va.h:2438
uint32_t cfs_I_frames
Definition: va.h:2450
uint32_t ICQ_quality_factor
Definition: va.h:2482
uint32_t max_qp
Definition: va.h:2488
uint32_t window_size
Definition: va.h:2410
uint32_t enable_parallel_brc
Definition: va.h:2455
uint32_t disable_frame_skip
Definition: va.h:2436
uint32_t reset
Definition: va.h:2434
uint32_t target_frame_size
Definition: va.h:2502
uint32_t initial_qp
Definition: va.h:2415
uint32_t min_qp
Definition: va.h:2421
uint32_t target_percentage
Definition: va.h:2404
uint32_t quality_factor
Definition: va.h:2493
Encoding skip frame.
Definition: va.h:2741
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:2753
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:2748
uint8_t num_skip_frames
The number of frames skipped prior to the current frame. Valid when skip_frame_flag = 1.
Definition: va.h:2750
Temporal layer Structure.
Definition: va.h:2377
uint32_t periodicity
The length of the array defining frame layer membership. Should be 1-32.
Definition: va.h:2381
uint32_t number_of_layers
The number of temporal layers.
Definition: va.h:2379
Packed header parameter.
Definition: va.h:2342
uint8_t has_emulation_bytes
Flag: buffer contains start code emulation prevention bytes?
Definition: va.h:2348
uint32_t type
Definition: va.h:2344
uint32_t bit_length
Size of the #VAEncPackedHeaderDataBuffer in bits.
Definition: va.h:2346
Encoding region-of-interest (ROI).
Definition: va.h:2768
int8_t roi_value
ROI value.
Definition: va.h:2791
VARectangle roi_rectangle
Defines the ROI boundary in pixels, the driver will map it to appropriate codec coding units....
Definition: va.h:2772
Encode Slice Parameter Buffer.
Definition: va.h:3630
Encryption parameters buffer for VAEncryptionParameterBufferType.
Definition: va.h:2167
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:2192
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:2208
uint32_t num_segments
The number of sengments.
Definition: va.h:2173
uint32_t size_of_length
CENC counter length.
Definition: va.h:2181
VAEncryptionSegmentInfo * segment_info
Pointer of segments.
Definition: va.h:2175
uint32_t status_report_index
The status report index reserved for CENC fullsample workload. The related structures and definitions...
Definition: va.h:2179
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:2201
uint32_t encryption_type
Encryption type, refer to VA_ENCRYPTION_TYPE_FULLSAMPLE_CTR, VA_ENCRYPTION_TYPE_FULLSAMPLE_CBC,...
Definition: va.h:2171
structure for encrypted segment info.
Definition: va.h:2147
uint32_t segment_length
The length of the segments in bytes.
Definition: va.h:2152
uint32_t partial_aes_block_size
The length in bytes of the remainder of an incomplete block from a previous segment.
Definition: va.h:2155
uint32_t init_byte_length
The length in bytes of the initial clear data.
Definition: va.h:2157
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:2150
Generic value.
Definition: va.h:1612
float f
32-bit float.
Definition: va.h:1620
VAGenericFunc fn
Pointer to function.
Definition: va.h:1624
int32_t i
32-bit signed integer.
Definition: va.h:1618
void * p
Generic pointer.
Definition: va.h:1622
VAGenericValueType type
Value type. See VAGenericValueType.
Definition: va.h:1614
Huffman table for JPEG decoding.
Definition: va.h:3003
Definition: va.h:3544
Definition: va.h:3071
int32_t load_intra_quantiser_matrix
Same as the MPEG-2 bitstream syntax element.
Definition: va.h:3073
int32_t load_chroma_intra_quantiser_matrix
Same as the MPEG-2 bitstream syntax element.
Definition: va.h:3077
int32_t load_chroma_non_intra_quantiser_matrix
Same as the MPEG-2 bitstream syntax element.
Definition: va.h:3079
int32_t load_non_intra_quantiser_matrix
Same as the MPEG-2 bitstream syntax element.
Definition: va.h:3075
Definition: va.h:3223
int32_t load_intra_quant_mat
Definition: va.h:3225
int32_t load_non_intra_quant_mat
Definition: va.h:3227
Generic motion vector data structure.
Definition: va.h:412
Description of picture properties of those in DPB surfaces.
Definition: va.h:5149
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:5158
VASurfaceID picture_id
reconstructed picture buffer surface index invalid when taking value VA_INVALID_SURFACE.
Definition: va.h:5153
Definition: va.h:3490
Definition: va.h:3172
Definition: va.h:3276
Definition: va.h:2233
uint8_t level_idc
Profile level.
Definition: va.h:2235
Definition: va.h:2216
uint32_t intra_period
Period between I frames.
Definition: va.h:2225
uint8_t level_idc
Profile level.
Definition: va.h:2218
uint32_t ip_period
Period between I/P frames.
Definition: va.h:2227
uint32_t quality_level
quality level. When set to 0, default quality level is used.
Definition: va.h:2223
Definition: va.h:3555
uint8_t num_ref_idx_l0_active_minus1
Definition: va.h:3580
uint8_t num_ref_idx_l1_active_minus1
Definition: va.h:3587
uint32_t slice_data_offset
Byte offset to the NAL Header Unit for this slice.
Definition: va.h:3558
uint16_t slice_data_bit_offset
Bit offset from NAL Header Unit to the begining of slice_data().
Definition: va.h:3570
Definition: va.h:3094
Definition: va.h:3238
Definition: va.h:3448
VASurfaceAttribExternalBuffers structure for the VASurfaceAttribExternalBufferDescriptor attribute.
Definition: va.h:1711
uint32_t num_planes
number of planes for planar layout
Definition: va.h:1721
uint32_t data_size
total size of the buffer in bytes.
Definition: va.h:1719
uint32_t height
height in pixels.
Definition: va.h:1717
uint32_t width
width in pixels.
Definition: va.h:1715
uint32_t pixel_format
pixel format in fourcc.
Definition: va.h:1713
uint32_t flags
flags. See "Surface external buffer descriptor flags".
Definition: va.h:1731
uint32_t num_buffers
number of elements in the "buffers" array
Definition: va.h:1729
uintptr_t * buffers
buffer handles or user pointers
Definition: va.h:1727
void * private_data
reserved for passing private data
Definition: va.h:1733
Surface attribute.
Definition: va.h:1683
VAGenericValue value
Value. See "Surface attribute types" for the expected types.
Definition: va.h:1689
VASurfaceAttribType type
Type.
Definition: va.h:1685
uint32_t flags
Flags. See "Surface attribute flags".
Definition: va.h:1687
Definition: va.h:4206
uint32_t reserved
reserved bits for future, must be zero
Definition: va.h:1406
uint32_t priority
the priority , for the Query operation (read) it represents highest priority for the set operation (w...
Definition: va.h:1404
Attribute value for VAConfigAttribEncJPEG.
Definition: va.h:1247
uint32_t non_interleaved_mode
set to 1 for non-interleaved.
Definition: va.h:1254
uint32_t differential_mode
set to 1 for differential.
Definition: va.h:1256
uint32_t progressive_dct_mode
set to 1 for progressive dct.
Definition: va.h:1252
uint32_t arithmatic_coding_mode
set to 1 for arithmatic coding.
Definition: va.h:1250
uint32_t reserved
reserved bit for future, must be zero
Definition: va.h:1421
uint32_t delta_qp_size_in_bytes
size of delta qp per block in bytes
Definition: va.h:1419
uint32_t log2_delta_qp_block_size
supported size of delta qp block
Definition: va.h:1417
uint32_t delta_qp_support
whether to support dela qp per block
Definition: va.h:1415
Attribute value for VAConfigAttribEncROI.
Definition: va.h:1310
uint32_t roi_rc_priority_support
A flag indicates whether ROI priority is supported.
Definition: va.h:1325
uint32_t roi_rc_qp_delta_support
A flag indicates whether ROI delta QP is supported.
Definition: va.h:1337
uint32_t num_roi_regions
The number of ROI regions supported, 0 if ROI is not supported.
Definition: va.h:1313
Attribute value for VAConfigAttribEncRateControlExt.
Definition: va.h:1344
uint32_t temporal_layer_bitrate_control_flag
Definition: va.h:1378
uint32_t max_num_temporal_layers_minus1
The maximum number of temporal layers minus 1.
Definition: va.h:1353
Attribute value for VAConfigAttribMaxFrameSize.
Definition: va.h:1230
uint32_t max_frame_size
support max frame size if max_frame_size == 1, VAEncMiscParameterTypeMaxFrameSize/VAEncMiscParameterB...
Definition: va.h:1237
uint32_t reserved
reserved bits for future, must be zero
Definition: va.h:1241
uint32_t multiple_pass
multiple_pass support
Definition: va.h:1239
Attribute value for VAConfigAttribMultipleFrame.
Definition: va.h:1385
uint32_t reserved
reserved bit for future, must be zero
Definition: va.h:1394
uint32_t max_num_concurrent_frames
max num of concurrent frames from different stream
Definition: va.h:1388
uint32_t mixed_quality_level
indicate whether all stream must support same quality level if mixed_quality_level == 0,...
Definition: va.h:1392
sub device info Sub-device is the concept basing on the "device" behind "vaDisplay"....
Definition: va.h:4963
uint32_t sub_device_count
sub devices count, read - only
Definition: va.h:4968
uint32_t reserved
reserved bits for future, must be zero
Definition: va.h:4970
uint32_t sub_device_mask
bit mask to indicate which sub_device is available, read only
Definition: va.h:4986
uint32_t current_sub_device
current sub device index, read - write
Definition: va.h:4966
VAStatus vaGetDisplayAttributes(VADisplay dpy, VADisplayAttribute *attr_list, int num_attributes)
VADisplayAttribType
Definition: va.h:4992
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.
The VP9 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.