VA-API 2.22.0
Loading...
Searching...
No Matches
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
86extern "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
260typedef void* VADisplay; /* window system dependent */
261
262typedef int VAStatus;
264#define VA_STATUS_SUCCESS 0x00000000
265#define VA_STATUS_ERROR_OPERATION_FAILED 0x00000001
266#define VA_STATUS_ERROR_ALLOCATION_FAILED 0x00000002
267#define VA_STATUS_ERROR_INVALID_DISPLAY 0x00000003
268#define VA_STATUS_ERROR_INVALID_CONFIG 0x00000004
269#define VA_STATUS_ERROR_INVALID_CONTEXT 0x00000005
270#define VA_STATUS_ERROR_INVALID_SURFACE 0x00000006
271#define VA_STATUS_ERROR_INVALID_BUFFER 0x00000007
272#define VA_STATUS_ERROR_INVALID_IMAGE 0x00000008
273#define VA_STATUS_ERROR_INVALID_SUBPICTURE 0x00000009
274#define VA_STATUS_ERROR_ATTR_NOT_SUPPORTED 0x0000000a
275#define VA_STATUS_ERROR_MAX_NUM_EXCEEDED 0x0000000b
276#define VA_STATUS_ERROR_UNSUPPORTED_PROFILE 0x0000000c
277#define VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT 0x0000000d
278#define VA_STATUS_ERROR_UNSUPPORTED_RT_FORMAT 0x0000000e
279#define VA_STATUS_ERROR_UNSUPPORTED_BUFFERTYPE 0x0000000f
280#define VA_STATUS_ERROR_SURFACE_BUSY 0x00000010
281#define VA_STATUS_ERROR_FLAG_NOT_SUPPORTED 0x00000011
282#define VA_STATUS_ERROR_INVALID_PARAMETER 0x00000012
283#define VA_STATUS_ERROR_RESOLUTION_NOT_SUPPORTED 0x00000013
284#define VA_STATUS_ERROR_UNIMPLEMENTED 0x00000014
285#define VA_STATUS_ERROR_SURFACE_IN_DISPLAYING 0x00000015
286#define VA_STATUS_ERROR_INVALID_IMAGE_FORMAT 0x00000016
287#define VA_STATUS_ERROR_DECODING_ERROR 0x00000017
288#define VA_STATUS_ERROR_ENCODING_ERROR 0x00000018
296#define VA_STATUS_ERROR_INVALID_VALUE 0x00000019
298#define VA_STATUS_ERROR_UNSUPPORTED_FILTER 0x00000020
300#define VA_STATUS_ERROR_INVALID_FILTER_CHAIN 0x00000021
302#define VA_STATUS_ERROR_HW_BUSY 0x00000022
304#define VA_STATUS_ERROR_UNSUPPORTED_MEMORY_TYPE 0x00000024
306#define VA_STATUS_ERROR_NOT_ENOUGH_BUFFER 0x00000025
308#define VA_STATUS_ERROR_TIMEDOUT 0x00000026
309#define VA_STATUS_ERROR_UNKNOWN 0xFFFFFFFF
310
318#define VA_FRAME_PICTURE 0x00000000
319#define VA_TOP_FIELD 0x00000001
320#define VA_BOTTOM_FIELD 0x00000002
321#define VA_TOP_FIELD_FIRST 0x00000004
322#define VA_BOTTOM_FIELD_FIRST 0x00000008
323
330#define VA_ENABLE_BLEND 0x00000004 /* video area blend with the constant color */
331
337#define VA_CLEAR_DRAWABLE 0x00000008
338
340#define VA_SRC_COLOR_MASK 0x000000f0
341#define VA_SRC_BT601 0x00000010
342#define VA_SRC_BT709 0x00000020
343#define VA_SRC_SMPTE_240 0x00000040
344
346#define VA_FILTER_SCALING_DEFAULT 0x00000000
347#define VA_FILTER_SCALING_FAST 0x00000100
348#define VA_FILTER_SCALING_HQ 0x00000200
349#define VA_FILTER_SCALING_NL_ANAMORPHIC 0x00000300
350#define VA_FILTER_SCALING_MASK 0x00000f00
351
353#define VA_FILTER_INTERPOLATION_DEFAULT 0x00000000
354#define VA_FILTER_INTERPOLATION_NEAREST_NEIGHBOR 0x00001000
355#define VA_FILTER_INTERPOLATION_BILINEAR 0x00002000
356#define VA_FILTER_INTERPOLATION_ADVANCED 0x00003000
357#define VA_FILTER_INTERPOLATION_MASK 0x0000f000
358
360#define VA_PADDING_LOW 4
361#define VA_PADDING_MEDIUM 8
362#define VA_PADDING_HIGH 16
363#define VA_PADDING_LARGE 32
364
367#define VA_EXEC_SYNC 0x0
369#define VA_EXEC_ASYNC 0x1
370
372#define VA_EXEC_MODE_DEFAULT 0x0
373#define VA_EXEC_MODE_POWER_SAVING 0x1
374#define VA_EXEC_MODE_PERFORMANCE 0x2
375
376/* Values used to describe device features. */
381#define VA_FEATURE_NOT_SUPPORTED 0
391#define VA_FEATURE_SUPPORTED 1
398#define VA_FEATURE_REQUIRED 2
399
403const char *vaErrorStr(VAStatus error_status);
404
406typedef struct _VARectangle {
407 int16_t x;
408 int16_t y;
409 uint16_t width;
410 uint16_t height;
412
414typedef struct _VAMotionVector {
420 int16_t mv0[2];
426 int16_t mv1[2];
428
430typedef void (*VAMessageCallback)(void *user_context, const char *message);
431
437
443
451typedef void* VANativeDisplay; /* window system dependent */
452
453int vaDisplayIsValid(VADisplay dpy);
454
459 char *driver_name
460 );
461
466 VADisplay dpy,
467 int *major_version, /* out */
468 int *minor_version /* out */
469);
470
474VAStatus vaTerminate(
475 VADisplay dpy
476);
477
487 VADisplay dpy
488);
489
490typedef int (*VAPrivFunc)(void);
491
496VAPrivFunc vaGetLibFunc(
497 VADisplay dpy,
498 const char *func
499);
500
502typedef enum {
505 VAProfileMPEG2Simple = 0,
506 VAProfileMPEG2Main = 1,
507 VAProfileMPEG4Simple = 2,
508 VAProfileMPEG4AdvancedSimple = 3,
509 VAProfileMPEG4Main = 4,
510 VAProfileH264Baseline va_deprecated_enum = 5,
511 VAProfileH264Main = 6,
512 VAProfileH264High = 7,
513 VAProfileVC1Simple = 8,
514 VAProfileVC1Main = 9,
515 VAProfileVC1Advanced = 10,
516 VAProfileH263Baseline = 11,
517 VAProfileJPEGBaseline = 12,
518 VAProfileH264ConstrainedBaseline = 13,
519 VAProfileVP8Version0_3 = 14,
520 VAProfileH264MultiviewHigh = 15,
521 VAProfileH264StereoHigh = 16,
522 VAProfileHEVCMain = 17,
523 VAProfileHEVCMain10 = 18,
524 VAProfileVP9Profile0 = 19,
525 VAProfileVP9Profile1 = 20,
526 VAProfileVP9Profile2 = 21,
527 VAProfileVP9Profile3 = 22,
528 VAProfileHEVCMain12 = 23,
529 VAProfileHEVCMain422_10 = 24,
530 VAProfileHEVCMain422_12 = 25,
531 VAProfileHEVCMain444 = 26,
532 VAProfileHEVCMain444_10 = 27,
533 VAProfileHEVCMain444_12 = 28,
534 VAProfileHEVCSccMain = 29,
535 VAProfileHEVCSccMain10 = 30,
536 VAProfileHEVCSccMain444 = 31,
537 VAProfileAV1Profile0 = 32,
538 VAProfileAV1Profile1 = 33,
539 VAProfileHEVCSccMain444_10 = 34,
542 VAProfileH264High10 = 36,
543 VAProfileVVCMain10 = 37,
544 VAProfileVVCMultilayerMain10 = 38
545} VAProfile;
546
550typedef enum {
551 VAEntrypointVLD = 1,
552 VAEntrypointIZZ = 2,
553 VAEntrypointIDCT = 3,
554 VAEntrypointMoComp = 4,
555 VAEntrypointDeblocking = 5,
556 VAEntrypointEncSlice = 6, /* slice level encode */
557 VAEntrypointEncPicture = 7, /* pictuer encode, JPEG, etc */
558 /*
559 * For an implementation that supports a low power/high performance variant
560 * for slice level encode, it can choose to expose the
561 * VAEntrypointEncSliceLP entrypoint. Certain encoding tools may not be
562 * available with this entrypoint (e.g. interlace, MBAFF) and the
563 * application can query the encoding configuration attributes to find
564 * out more details if this entrypoint is supported.
565 */
566 VAEntrypointEncSliceLP = 8,
615
617typedef enum {
618 VAConfigAttribRTFormat = 0,
619 VAConfigAttribSpatialResidual = 1,
620 VAConfigAttribSpatialClipping = 2,
621 VAConfigAttribIntraResidual = 3,
622 VAConfigAttribEncryption = 4,
623 VAConfigAttribRateControl = 5,
624
990
1057 VAConfigAttribTypeMax
1059
1066typedef struct _VAConfigAttrib {
1067 VAConfigAttribType type;
1068 uint32_t value; /* OR'd flags (bits) for this attribute */
1070
1071/* Attribute values for VAConfigAttribRTFormat. */
1072
1073#define VA_RT_FORMAT_YUV420 0x00000001
1074#define VA_RT_FORMAT_YUV422 0x00000002
1075#define VA_RT_FORMAT_YUV444 0x00000004
1076#define VA_RT_FORMAT_YUV411 0x00000008
1077#define VA_RT_FORMAT_YUV400 0x00000010
1078#define VA_RT_FORMAT_YUV420_10 0x00000100
1079#define VA_RT_FORMAT_YUV422_10 0x00000200
1080#define VA_RT_FORMAT_YUV444_10 0x00000400
1081#define VA_RT_FORMAT_YUV420_12 0x00001000
1082#define VA_RT_FORMAT_YUV422_12 0x00002000
1083#define VA_RT_FORMAT_YUV444_12 0x00004000
1084
1085#define VA_RT_FORMAT_RGB16 0x00010000
1086#define VA_RT_FORMAT_RGB32 0x00020000
1087#define VA_RT_FORMAT_RGBP 0x00100000
1088#define VA_RT_FORMAT_RGB32_10 0x00200000
1089
1090#define VA_RT_FORMAT_PROTECTED 0x80000000
1091
1092#define VA_RT_FORMAT_RGB32_10BPP VA_RT_FORMAT_RGB32_10
1093#define VA_RT_FORMAT_YUV420_10BPP VA_RT_FORMAT_YUV420_10
1094
1098#define VA_RC_NONE 0x00000001
1100#define VA_RC_CBR 0x00000002
1102#define VA_RC_VBR 0x00000004
1104#define VA_RC_VCM 0x00000008
1106#define VA_RC_CQP 0x00000010
1108#define VA_RC_VBR_CONSTRAINED 0x00000020
1111#define VA_RC_ICQ 0x00000040
1114#define VA_RC_MB 0x00000080
1116#define VA_RC_CFS 0x00000100
1127#define VA_RC_PARALLEL 0x00000200
1134#define VA_RC_QVBR 0x00000400
1145#define VA_RC_AVBR 0x00000800
1154#define VA_RC_TCBRC 0x00001000
1155
1161#define VA_DEC_SLICE_MODE_NORMAL 0x00000001
1163#define VA_DEC_SLICE_MODE_BASE 0x00000002
1164
1167typedef union _VAConfigAttribValDecJPEG {
1168 struct {
1170 uint32_t rotation : 4;
1172 uint32_t crop : 1;
1174 uint32_t reserved : 27;
1175 } bits;
1176 uint32_t value;
1177} VAConfigAttribValDecJPEG;
1181#define VA_DEC_PROCESSING_NONE 0x00000000
1183#define VA_DEC_PROCESSING 0x00000001
1189#define VA_ENC_PACKED_HEADER_NONE 0x00000000
1196#define VA_ENC_PACKED_HEADER_SEQUENCE 0x00000001
1203#define VA_ENC_PACKED_HEADER_PICTURE 0x00000002
1210#define VA_ENC_PACKED_HEADER_SLICE 0x00000004
1219#define VA_ENC_PACKED_HEADER_MISC 0x00000008
1221#define VA_ENC_PACKED_HEADER_RAW_DATA 0x00000010
1227#define VA_ENC_INTERLACED_NONE 0x00000000
1229#define VA_ENC_INTERLACED_FRAME 0x00000001
1231#define VA_ENC_INTERLACED_FIELD 0x00000002
1233#define VA_ENC_INTERLACED_MBAFF 0x00000004
1235#define VA_ENC_INTERLACED_PAFF 0x00000008
1241#define VA_ENC_SLICE_STRUCTURE_POWER_OF_TWO_ROWS 0x00000001
1243#define VA_ENC_SLICE_STRUCTURE_ARBITRARY_MACROBLOCKS 0x00000002
1245#define VA_ENC_SLICE_STRUCTURE_EQUAL_ROWS 0x00000004
1247#define VA_ENC_SLICE_STRUCTURE_MAX_SLICE_SIZE 0x00000008
1249#define VA_ENC_SLICE_STRUCTURE_ARBITRARY_ROWS 0x00000010
1253#define VA_ENC_SLICE_STRUCTURE_EQUAL_MULTI_ROWS 0x00000020
1257typedef union _VAConfigAttribValMaxFrameSize {
1258 struct {
1264 uint32_t max_frame_size : 1;
1266 uint32_t multiple_pass : 1;
1268 uint32_t reserved : 30;
1269 } bits;
1270 uint32_t value;
1272
1274typedef union _VAConfigAttribValEncJPEG {
1275 struct {
1283 uint32_t differential_mode : 1;
1284 uint32_t max_num_components : 3;
1285 uint32_t max_num_scans : 4;
1286 uint32_t max_num_huffman_tables : 3;
1287 uint32_t max_num_quantization_tables : 3;
1288 } bits;
1289 uint32_t value;
1291
1295#define VA_ENC_QUANTIZATION_NONE 0x00000000
1297#define VA_ENC_QUANTIZATION_TRELLIS_SUPPORTED 0x00000001
1308#define VA_PREDICTION_DIRECTION_PREVIOUS 0x00000001
1310#define VA_PREDICTION_DIRECTION_FUTURE 0x00000002
1312#define VA_PREDICTION_DIRECTION_BI_NOT_EMPTY 0x00000004
1318#define VA_ENC_INTRA_REFRESH_NONE 0x00000000
1320#define VA_ENC_INTRA_REFRESH_ROLLING_COLUMN 0x00000001
1322#define VA_ENC_INTRA_REFRESH_ROLLING_ROW 0x00000002
1324#define VA_ENC_INTRA_REFRESH_ADAPTIVE 0x00000010
1326#define VA_ENC_INTRA_REFRESH_CYCLIC 0x00000020
1328#define VA_ENC_INTRA_REFRESH_P_FRAME 0x00010000
1330#define VA_ENC_INTRA_REFRESH_B_FRAME 0x00020000
1332#define VA_ENC_INTRA_REFRESH_MULTI_REF 0x00040000
1333
1337typedef union _VAConfigAttribValEncROI {
1338 struct {
1340 uint32_t num_roi_regions : 8;
1365 uint32_t reserved : 22;
1366 } bits;
1367 uint32_t value;
1369
1371typedef union _VAConfigAttribValEncRateControlExt {
1372 struct {
1381
1406 uint32_t reserved : 23;
1407 } bits;
1408 uint32_t value;
1410
1412typedef union _VAConfigAttribValMultipleFrame {
1413 struct {
1421 uint32_t reserved : 23;
1422 } bits;
1423 uint32_t value;
1425
1427typedef union _VAConfigAttribValContextPriority {
1428 struct {
1431 uint32_t priority : 16;
1433 uint32_t reserved : 16;
1434 } bits;
1435 uint32_t value;
1437
1439typedef union _VAConfigAttribValEncPerBlockControl {
1440 struct {
1442 uint32_t delta_qp_support : 1;
1448 uint32_t reserved : 24;
1449 } bits;
1450 uint32_t value;
1452
1455#define VA_PC_CIPHER_AES 0x00000001
1456
1459#define VA_PC_BLOCK_SIZE_128 0x00000001
1461#define VA_PC_BLOCK_SIZE_192 0x00000002
1463#define VA_PC_BLOCK_SIZE_256 0x00000004
1464
1467#define VA_PC_CIPHER_MODE_ECB 0x00000001
1469#define VA_PC_CIPHER_MODE_CBC 0x00000002
1471#define VA_PC_CIPHER_MODE_CTR 0x00000004
1472
1475#define VA_PC_SAMPLE_TYPE_FULLSAMPLE 0x00000001
1477#define VA_PC_SAMPLE_TYPE_SUBSAMPLE 0x00000002
1478
1481#define VA_PC_USAGE_DEFAULT 0x00000000
1483#define VA_PC_USAGE_WIDEVINE 0x00000001
1484
1488#define VA_PROCESSING_RATE_NONE 0x00000000
1490#define VA_PROCESSING_RATE_ENCODE 0x00000001
1492#define VA_PROCESSING_RATE_DECODE 0x00000002
1498#define VA_ATTRIB_NOT_SUPPORTED 0x80000000
1499
1502 VADisplay dpy
1503);
1504
1507 VADisplay dpy
1508);
1509
1512 VADisplay dpy
1513);
1514
1522 VADisplay dpy,
1523 VAProfile *profile_list, /* out */
1524 int *num_profiles /* out */
1525);
1526
1534 VADisplay dpy,
1535 VAProfile profile,
1536 VAEntrypoint *entrypoint_list, /* out */
1537 int *num_entrypoints /* out */
1538);
1539
1549 VADisplay dpy,
1550 VAProfile profile,
1551 VAEntrypoint entrypoint,
1552 VAConfigAttrib *attrib_list, /* in/out */
1553 int num_attribs
1554);
1555
1557typedef unsigned int VAGenericID;
1558
1559typedef VAGenericID VAConfigID;
1560
1567 VADisplay dpy,
1568 VAProfile profile,
1569 VAEntrypoint entrypoint,
1570 VAConfigAttrib *attrib_list,
1571 int num_attribs,
1572 VAConfigID *config_id /* out */
1573);
1574
1579 VADisplay dpy,
1580 VAConfigID config_id
1581);
1582
1592 VADisplay dpy,
1593 VAConfigID config_id,
1594 VAProfile *profile, /* out */
1595 VAEntrypoint *entrypoint, /* out */
1596 VAConfigAttrib *attrib_list,/* out */
1597 int *num_attribs /* out */
1598);
1599
1600
1621
1622typedef VAGenericID VASurfaceID;
1623
1624#define VA_INVALID_ID 0xffffffff
1625#define VA_INVALID_SURFACE VA_INVALID_ID
1626
1628typedef enum {
1634
1636typedef void (*VAGenericFunc)(void);
1637
1639typedef struct _VAGenericValue {
1643 union {
1645 int32_t i;
1647 float f;
1649 void *p;
1652 } value;
1654
1658#define VA_SURFACE_ATTRIB_NOT_SUPPORTED 0x00000000
1660#define VA_SURFACE_ATTRIB_GETTABLE 0x00000001
1662#define VA_SURFACE_ATTRIB_SETTABLE 0x00000002
1666typedef enum {
1667 VASurfaceAttribNone = 0,
1717
1719typedef struct _VASurfaceAttrib {
1723 uint32_t flags;
1727
1736#define VA_SURFACE_ATTRIB_MEM_TYPE_VA 0x00000001
1738#define VA_SURFACE_ATTRIB_MEM_TYPE_V4L2 0x00000002
1740#define VA_SURFACE_ATTRIB_MEM_TYPE_USER_PTR 0x00000004
1746typedef union _VASurfaceAttribAlignmentStruct {
1747 struct {
1752 uint32_t reserved : 24;
1753 } bits;
1754 uint32_t value;
1756
1761typedef struct _VASurfaceAttribExternalBuffers {
1765 uint32_t width;
1767 uint32_t height;
1769 uint32_t data_size;
1771 uint32_t num_planes;
1773 uint32_t pitches[4];
1775 uint32_t offsets[4];
1777 uintptr_t *buffers;
1779 uint32_t num_buffers;
1781 uint32_t flags;
1785
1789#define VA_SURFACE_EXTBUF_DESC_ENABLE_TILING 0x00000001
1791#define VA_SURFACE_EXTBUF_DESC_CACHED 0x00000002
1793#define VA_SURFACE_EXTBUF_DESC_UNCACHED 0x00000004
1795#define VA_SURFACE_EXTBUF_DESC_WC 0x00000008
1797#define VA_SURFACE_EXTBUF_DESC_PROTECTED 0x80000000
1798
1802#define VA_SURFACE_ATTRIB_USAGE_HINT_GENERIC 0x00000000
1804#define VA_SURFACE_ATTRIB_USAGE_HINT_DECODER 0x00000001
1806#define VA_SURFACE_ATTRIB_USAGE_HINT_ENCODER 0x00000002
1808#define VA_SURFACE_ATTRIB_USAGE_HINT_VPP_READ 0x00000004
1810#define VA_SURFACE_ATTRIB_USAGE_HINT_VPP_WRITE 0x00000008
1812#define VA_SURFACE_ATTRIB_USAGE_HINT_DISPLAY 0x00000010
1815#define VA_SURFACE_ATTRIB_USAGE_HINT_EXPORT 0x00000020
1816
1846VAStatus
1848 VADisplay dpy,
1849 VAConfigID config,
1850 VASurfaceAttrib *attrib_list,
1851 unsigned int *num_attribs
1852);
1853
1871VAStatus
1873 VADisplay dpy,
1874 unsigned int format,
1875 unsigned int width,
1876 unsigned int height,
1877 VASurfaceID *surfaces,
1878 unsigned int num_surfaces,
1879 VASurfaceAttrib *attrib_list,
1880 unsigned int num_attribs
1881);
1882
1892 VADisplay dpy,
1893 VASurfaceID *surfaces,
1894 int num_surfaces
1895);
1896
1897#define VA_PROGRESSIVE 0x1
1911 VADisplay dpy,
1912 VAConfigID config_id,
1913 int picture_width,
1914 int picture_height,
1915 int flag,
1916 VASurfaceID *render_targets,
1917 int num_render_targets,
1918 VAContextID *context /* out */
1919);
1920
1927 VADisplay dpy,
1928 VAContextID context
1929);
1930
1931//Multi-frame context
1932typedef VAGenericID VAMFContextID;
1950 VADisplay dpy,
1951 VAMFContextID *mf_context /* out */
1952);
1953
1988 VADisplay dpy,
1989 VAMFContextID mf_context,
1990 VAContextID context
1991);
1992
2006 VADisplay dpy,
2007 VAMFContextID mf_context,
2008 VAContextID context
2009);
2010
2020
2021typedef enum {
2022 VAPictureParameterBufferType = 0,
2023 VAIQMatrixBufferType = 1,
2024 VABitPlaneBufferType = 2,
2025 VASliceGroupMapBufferType = 3,
2026 VASliceParameterBufferType = 4,
2027 VASliceDataBufferType = 5,
2028 VAMacroblockParameterBufferType = 6,
2029 VAResidualDataBufferType = 7,
2030 VADeblockingParameterBufferType = 8,
2031 VAImageBufferType = 9,
2032 VAProtectedSliceDataBufferType = 10,
2033 VAQMatrixBufferType = 11,
2034 VAHuffmanTableBufferType = 12,
2035 VAProbabilityBufferType = 13,
2036
2037 /* Following are encode buffer types */
2038 VAEncCodedBufferType = 21,
2039 VAEncSequenceParameterBufferType = 22,
2040 VAEncPictureParameterBufferType = 23,
2041 VAEncSliceParameterBufferType = 24,
2042 VAEncPackedHeaderParameterBufferType = 25,
2043 VAEncPackedHeaderDataBufferType = 26,
2044 VAEncMiscParameterBufferType = 27,
2045 VAEncMacroblockParameterBufferType = 28,
2046 VAEncMacroblockMapBufferType = 29,
2047
2056 /* Following are video processing buffer types */
2081 VAEncFEIMBCodeBufferType = 44,
2082 VAEncFEIDistortionBufferType = 45,
2083 VAEncFEIMBControlBufferType = 46,
2084 VAEncFEIMVPredictorBufferType = 47,
2085 VAStatsStatisticsParameterBufferType = 48,
2090 VAStatsMVBufferType = 51,
2091 VAStatsMVPredictorBufferType = 52,
2112
2137
2143
2154
2185
2186 VABufferTypeMax
2187} VABufferType;
2188
2194typedef struct _VAContextParameterUpdateBuffer {
2195 union {
2196 struct {
2200 uint32_t reserved : 31;
2201 } bits;
2202 uint32_t value;
2203 } flags;
2207 uint32_t reserved[VA_PADDING_MEDIUM];
2209
2222#define VA_ENCRYPTION_TYPE_FULLSAMPLE_CTR 0x00000001 /* AES CTR fullsample */
2223#define VA_ENCRYPTION_TYPE_FULLSAMPLE_CBC 0x00000002 /* AES CBC fullsample */
2224#define VA_ENCRYPTION_TYPE_SUBSAMPLE_CTR 0x00000004 /* AES CTR fullsample */
2225#define VA_ENCRYPTION_TYPE_SUBSAMPLE_CBC 0x00000008 /* AES CBC fullsample */
2226
2228typedef struct _VAEncryptionSegmentInfo {
2242 uint8_t aes_cbc_iv_or_ctr[64];
2244 uint32_t va_reserved[VA_PADDING_MEDIUM];
2246
2248typedef struct _VAEncryptionParameters {
2265 uint8_t wrapped_decrypt_blob[64];
2268 uint8_t wrapped_encrypt_blob[64];
2291 uint32_t va_reserved[VA_PADDING_MEDIUM];
2293
2297typedef struct _VAProcessingRateParameterEnc {
2299 uint8_t level_idc;
2300 uint8_t reserved[3];
2308 uint32_t ip_period;
2310
2314typedef struct _VAProcessingRateParameterDec {
2316 uint8_t level_idc;
2317 uint8_t reserved0[3];
2318 uint32_t reserved;
2320
2321typedef struct _VAProcessingRateParameter {
2322 union {
2323 VAProcessingRateParameterEnc proc_buf_enc;
2324 VAProcessingRateParameterDec proc_buf_dec;
2325 };
2326} VAProcessingRateParameter;
2327
2348VAStatus
2350 VADisplay dpy,
2351 VAConfigID config,
2352 VAProcessingRateParameter *proc_buf,
2353 unsigned int *processing_rate
2354);
2355
2356typedef enum {
2357 VAEncMiscParameterTypeFrameRate = 0,
2358 VAEncMiscParameterTypeRateControl = 1,
2359 VAEncMiscParameterTypeMaxSliceSize = 2,
2360 VAEncMiscParameterTypeAIR = 3,
2365 VAEncMiscParameterTypeQualityLevel = 6,
2394
2396typedef enum {
2419 VAEncPackedHeaderMiscMask va_deprecated_enum = 0x80000000,
2421
2423typedef struct _VAEncPackedHeaderParameterBuffer {
2425 uint32_t type;
2427 uint32_t bit_length;
2430
2432 uint32_t va_reserved[VA_PADDING_LOW];
2434
2452typedef struct _VAEncMiscParameterBuffer {
2454 uint32_t data[];
2456
2458typedef struct _VAEncMiscParameterTemporalLayerStructure {
2462 uint32_t periodicity;
2469 uint32_t layer_id[32];
2470
2472 uint32_t va_reserved[VA_PADDING_LOW];
2474
2475
2477typedef struct _VAEncMiscParameterRateControl {
2491 uint32_t window_size;
2496 uint32_t initial_qp;
2502 uint32_t min_qp;
2508 union {
2509 struct {
2515 uint32_t reset : 1;
2527 uint32_t mb_rate_control : 4;
2529 uint32_t temporal_id : 8;
2531 uint32_t cfs_I_frames : 1;
2537 uint32_t enable_dynamic_scaling : 1;
2554 uint32_t reserved : 12;
2555 } bits;
2556 uint32_t value;
2557 } rc_flags;
2569 uint32_t max_qp;
2585 uint32_t va_reserved[VA_PADDING_LOW];
2587
2594typedef struct _VAEncMiscParameterFrameRate {
2614 uint32_t framerate;
2615 union {
2616 struct {
2618 uint32_t temporal_id : 8;
2620 uint32_t reserved : 24;
2621 } bits;
2622 uint32_t value;
2623 } framerate_flags;
2624
2626 uint32_t va_reserved[VA_PADDING_LOW];
2628
2634typedef struct _VAEncMiscParameterMaxSliceSize {
2635 uint32_t max_slice_size;
2636
2638 uint32_t va_reserved[VA_PADDING_LOW];
2640
2641typedef struct _VAEncMiscParameterAIR {
2642 uint32_t air_num_mbs;
2643 uint32_t air_threshold;
2644 uint32_t air_auto; /* if set to 1 then hardware auto-tune the AIR threshold */
2645
2647 uint32_t va_reserved[VA_PADDING_LOW];
2648} VAEncMiscParameterAIR;
2649
2650/*
2651 * \brief Rolling intra refresh data structure for encoding.
2652 */
2653typedef struct _VAEncMiscParameterRIR {
2654 union {
2655 struct
2662 {
2663 /* \brief enable RIR in column */
2664 uint32_t enable_rir_column : 1;
2665 /* \brief enable RIR in row */
2666 uint32_t enable_rir_row : 1;
2667 uint32_t reserved : 30;
2668 } bits;
2669 uint32_t value;
2670 } rir_flags;
2675 uint16_t intra_insertion_location;
2680 uint16_t intra_insert_size;
2685 uint8_t qp_delta_for_inserted_intra;
2687 uint32_t va_reserved[VA_PADDING_LOW];
2688} VAEncMiscParameterRIR;
2689
2698typedef struct _VAEncMiscParameterHRD {
2715 uint32_t buffer_size;
2716
2718 uint32_t va_reserved[VA_PADDING_LOW];
2720
2730typedef struct _VAEncMiscParameterBufferMaxFrameSize {
2736
2738 uint32_t va_reserved[VA_PADDING_LOW];
2740
2750typedef struct _VAEncMiscParameterBufferMultiPassFrameSize {
2757 uint32_t reserved;
2759 uint8_t num_passes;
2761 uint8_t *delta_qp;
2762
2764 unsigned long va_reserved[VA_PADDING_LOW];
2766
2778typedef struct _VAEncMiscParameterBufferQualityLevel {
2783
2785 uint32_t va_reserved[VA_PADDING_LOW];
2787
2794typedef struct _VAEncMiscParameterQuantization {
2795 union {
2796 /* if no flags is set then quantization is determined by the driver */
2797 struct {
2798 /* \brief disable trellis for all frames/fields */
2799 uint32_t disable_trellis : 1;
2800 /* \brief enable trellis for I frames/fields */
2801 uint32_t enable_trellis_I : 1;
2802 /* \brief enable trellis for P frames/fields */
2803 uint32_t enable_trellis_P : 1;
2804 /* \brief enable trellis for B frames/fields */
2805 uint32_t enable_trellis_B : 1;
2806 uint32_t reserved : 28;
2807 } bits;
2808 uint32_t value;
2809 } quantization_flags;
2810 uint32_t va_reserved;
2812
2822typedef struct _VAEncMiscParameterSkipFrame {
2835
2837 uint32_t va_reserved[VA_PADDING_LOW];
2839
2849typedef struct _VAEncROI {
2873} VAEncROI;
2874
2875typedef struct _VAEncMiscParameterBufferROI {
2877 uint32_t num_roi;
2878
2882 int8_t max_delta_qp;
2883 int8_t min_delta_qp;
2884
2887 VAEncROI *roi;
2888 union {
2889 struct {
2902 uint32_t roi_value_is_qp_delta : 1;
2903 uint32_t reserved : 31;
2904 } bits;
2905 uint32_t value;
2906 } roi_flags;
2907
2909 uint32_t va_reserved[VA_PADDING_LOW];
2910} VAEncMiscParameterBufferROI;
2911/*
2912 * \brief Dirty rectangle data structure for encoding.
2913 *
2914 * The encoding dirty rect can be set through VAEncMiscParameterBufferDirtyRect, if the
2915 * implementation supports dirty rect input. The rect set through this structure is applicable
2916 * only to the current frame or field, so must be sent every frame or field to be applied.
2917 * The number of supported rects can be queried through the VAConfigAttribEncDirtyRect. The
2918 * encoder will use the rect information to know those rectangle areas have changed while the
2919 * areas not covered by dirty rect rectangles are assumed to have not changed compared to the
2920 * previous picture. The encoder may do some internal optimizations.
2921 */
2922typedef struct _VAEncMiscParameterBufferDirtyRect {
2924 uint32_t num_roi_rectangle;
2925
2927 VARectangle *roi_rectangle;
2928} VAEncMiscParameterBufferDirtyRect;
2929
2931typedef struct _VAEncMiscParameterParallelRateControl {
2933 uint32_t num_layers;
2938 uint32_t *num_b_in_gop;
2940
2943typedef struct _VAEncMiscParameterEncQuality {
2944 union {
2945 struct {
2949 uint32_t useRawPicForRef : 1;
2952 uint32_t skipCheckDisable : 1;
2955 uint32_t FTQOverride : 1;
2957 uint32_t FTQEnable : 1;
2964 uint32_t ReservedBit : 1;
2983 uint32_t HMEDisable : 1;
2985 uint32_t SuperHMEDisable : 1;
2987 uint32_t UltraHMEDisable : 1;
2991 uint32_t PanicModeDisable : 1;
2997
2998 };
2999 uint32_t encControls;
3000 };
3001
3003 uint8_t FTQSkipThresholdLUT[52];
3005 uint16_t NonFTQSkipThresholdLUT[52];
3006
3007 uint32_t reserved[VA_PADDING_HIGH]; // Reserved for future use.
3008
3010
3017typedef struct _VAEncMiscParameterCustomRoundingControl {
3018 union {
3019 struct {
3025
3030
3036
3041
3042 /* Reserved */
3043 uint32_t reserved : 16;
3044 } bits;
3045 uint32_t value;
3046 } rounding_offset_setting;
3048
3057#define VA_SLICE_DATA_FLAG_ALL 0x00 /* whole slice is in the buffer */
3058#define VA_SLICE_DATA_FLAG_BEGIN 0x01 /* The beginning of the slice is in the buffer but the end if not */
3059#define VA_SLICE_DATA_FLAG_MIDDLE 0x02 /* Neither beginning nor end of the slice is in the buffer */
3060#define VA_SLICE_DATA_FLAG_END 0x04 /* end of the slice is in the buffer */
3061
3062/* Codec-independent Slice Parameter Buffer base */
3063typedef struct _VASliceParameterBufferBase {
3064 uint32_t slice_data_size; /* number of bytes in the slice data buffer for this slice */
3065 uint32_t slice_data_offset; /* the offset to the first byte of slice data */
3066 uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX definitions */
3067} VASliceParameterBufferBase;
3068
3069/**********************************
3070 * JPEG common data structures
3071 **********************************/
3084typedef struct _VAHuffmanTableBufferJPEGBaseline {
3086 uint8_t load_huffman_table[2];
3088 struct {
3092 uint8_t num_dc_codes[16];
3094 uint8_t dc_values[12];
3099 uint8_t num_ac_codes[16];
3101 uint8_t ac_values[162];
3103 uint8_t pad[2];
3105 } huffman_table[2];
3106
3108 uint32_t va_reserved[VA_PADDING_LOW];
3110
3111/****************************
3112 * MPEG-2 data structures
3113 ****************************/
3114
3115/* MPEG-2 Picture Parameter Buffer */
3116/*
3117 * For each frame or field, and before any slice data, a single
3118 * picture parameter buffer must be send.
3119 */
3120typedef struct _VAPictureParameterBufferMPEG2 {
3121 uint16_t horizontal_size;
3122 uint16_t vertical_size;
3123 VASurfaceID forward_reference_picture;
3124 VASurfaceID backward_reference_picture;
3125 /* meanings of the following fields are the same as in the standard */
3126 int32_t picture_coding_type;
3127 int32_t f_code; /* pack all four fcode into this */
3128 union {
3129 struct {
3130 uint32_t intra_dc_precision : 2;
3131 uint32_t picture_structure : 2;
3132 uint32_t top_field_first : 1;
3133 uint32_t frame_pred_frame_dct : 1;
3134 uint32_t concealment_motion_vectors : 1;
3135 uint32_t q_scale_type : 1;
3136 uint32_t intra_vlc_format : 1;
3137 uint32_t alternate_scan : 1;
3138 uint32_t repeat_first_field : 1;
3139 uint32_t progressive_frame : 1;
3140 uint32_t is_first_field : 1; /* indicate whether the current field
3141 * is the first field for field picture
3142 */
3143 } bits;
3144 uint32_t value;
3145 } picture_coding_extension;
3146
3148 uint32_t va_reserved[VA_PADDING_LOW];
3149} VAPictureParameterBufferMPEG2;
3150
3152typedef struct _VAIQMatrixBufferMPEG2 {
3162 uint8_t intra_quantiser_matrix[64];
3164 uint8_t non_intra_quantiser_matrix[64];
3166 uint8_t chroma_intra_quantiser_matrix[64];
3168 uint8_t chroma_non_intra_quantiser_matrix[64];
3169
3171 uint32_t va_reserved[VA_PADDING_LOW];
3173
3175typedef struct _VASliceParameterBufferMPEG2 {
3176 uint32_t slice_data_size;/* number of bytes in the slice data buffer for this slice */
3177 uint32_t slice_data_offset;/* the offset to the first byte of slice data */
3178 uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
3179 uint32_t macroblock_offset;/* the offset to the first bit of MB from the first byte of slice data */
3180 uint32_t slice_horizontal_position;
3181 uint32_t slice_vertical_position;
3182 int32_t quantiser_scale_code;
3183 int32_t intra_slice_flag;
3184
3186 uint32_t va_reserved[VA_PADDING_LOW];
3188
3190typedef struct _VAMacroblockParameterBufferMPEG2 {
3191 uint16_t macroblock_address;
3192 /*
3193 * macroblock_address (in raster scan order)
3194 * top-left: 0
3195 * bottom-right: picture-height-in-mb*picture-width-in-mb - 1
3196 */
3197 uint8_t macroblock_type; /* see definition below */
3198 union {
3199 struct {
3200 uint32_t frame_motion_type : 2;
3201 uint32_t field_motion_type : 2;
3202 uint32_t dct_type : 1;
3203 } bits;
3204 uint32_t value;
3205 } macroblock_modes;
3206 uint8_t motion_vertical_field_select;
3207 /*
3208 * motion_vertical_field_select:
3209 * see section 6.3.17.2 in the spec
3210 * only the lower 4 bits are used
3211 * bit 0: first vector forward
3212 * bit 1: first vector backward
3213 * bit 2: second vector forward
3214 * bit 3: second vector backward
3215 */
3216 int16_t PMV[2][2][2]; /* see Table 7-7 in the spec */
3217 uint16_t coded_block_pattern;
3218 /*
3219 * The bitplanes for coded_block_pattern are described
3220 * in Figure 6.10-12 in the spec
3221 */
3222
3223 /* Number of skipped macroblocks after this macroblock */
3224 uint16_t num_skipped_macroblocks;
3225
3227 uint32_t va_reserved[VA_PADDING_LOW];
3229
3230/*
3231 * OR'd flags for macroblock_type (section 6.3.17.1 in the spec)
3232 */
3233#define VA_MB_TYPE_MOTION_FORWARD 0x02
3234#define VA_MB_TYPE_MOTION_BACKWARD 0x04
3235#define VA_MB_TYPE_MOTION_PATTERN 0x08
3236#define VA_MB_TYPE_MOTION_INTRA 0x10
3237
3244/****************************
3245 * MPEG-4 Part 2 data structures
3246 ****************************/
3247
3248/* MPEG-4 Picture Parameter Buffer */
3249/*
3250 * For each frame or field, and before any slice data, a single
3251 * picture parameter buffer must be send.
3252 */
3253typedef struct _VAPictureParameterBufferMPEG4 {
3254 uint16_t vop_width;
3255 uint16_t vop_height;
3256 VASurfaceID forward_reference_picture;
3257 VASurfaceID backward_reference_picture;
3258 union {
3259 struct {
3260 uint32_t short_video_header : 1;
3261 uint32_t chroma_format : 2;
3262 uint32_t interlaced : 1;
3263 uint32_t obmc_disable : 1;
3264 uint32_t sprite_enable : 2;
3265 uint32_t sprite_warping_accuracy : 2;
3266 uint32_t quant_type : 1;
3267 uint32_t quarter_sample : 1;
3268 uint32_t data_partitioned : 1;
3269 uint32_t reversible_vlc : 1;
3270 uint32_t resync_marker_disable : 1;
3271 } bits;
3272 uint32_t value;
3273 } vol_fields;
3274 uint8_t no_of_sprite_warping_points;
3275 int16_t sprite_trajectory_du[3];
3276 int16_t sprite_trajectory_dv[3];
3277 uint8_t quant_precision;
3278 union {
3279 struct {
3280 uint32_t vop_coding_type : 2;
3281 uint32_t backward_reference_vop_coding_type : 2;
3282 uint32_t vop_rounding_type : 1;
3283 uint32_t intra_dc_vlc_thr : 3;
3284 uint32_t top_field_first : 1;
3285 uint32_t alternate_vertical_scan_flag : 1;
3286 } bits;
3287 uint32_t value;
3288 } vop_fields;
3289 uint8_t vop_fcode_forward;
3290 uint8_t vop_fcode_backward;
3291 uint16_t vop_time_increment_resolution;
3292 /* short header related */
3293 uint8_t num_gobs_in_vop;
3294 uint8_t num_macroblocks_in_gob;
3295 /* for direct mode prediction */
3296 int16_t TRB;
3297 int16_t TRD;
3298
3300 uint32_t va_reserved[VA_PADDING_LOW];
3302
3304typedef struct _VAIQMatrixBufferMPEG4 {
3310 uint8_t intra_quant_mat[64];
3312 uint8_t non_intra_quant_mat[64];
3313
3315 uint32_t va_reserved[VA_PADDING_LOW];
3317
3319typedef struct _VASliceParameterBufferMPEG4 {
3320 uint32_t slice_data_size;/* number of bytes in the slice data buffer for this slice */
3321 uint32_t slice_data_offset;/* the offset to the first byte of slice data */
3322 uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
3323 uint32_t macroblock_offset;/* the offset to the first bit of MB from the first byte of slice data */
3324 uint32_t macroblock_number;
3325 int32_t quant_scale;
3326
3328 uint32_t va_reserved[VA_PADDING_LOW];
3330
3335typedef enum /* see 7.1.1.32 */
3336{
3337 VAMvMode1Mv = 0,
3338 VAMvMode1MvHalfPel = 1,
3339 VAMvMode1MvHalfPelBilinear = 2,
3340 VAMvModeMixedMv = 3,
3341 VAMvModeIntensityCompensation = 4
3342} VAMvModeVC1;
3343
3345/*
3346 * For each picture, and before any slice data, a picture parameter
3347 * buffer must be send. Multiple picture parameter buffers may be
3348 * sent for a single picture. In that case picture parameters will
3349 * apply to all slice data that follow it until a new picture
3350 * parameter buffer is sent.
3351 *
3352 * Notes:
3353 * pic_quantizer_type should be set to the applicable quantizer
3354 * type as defined by QUANTIZER (J.1.19) and either
3355 * PQUANTIZER (7.1.1.8) or PQINDEX (7.1.1.6)
3356 */
3357typedef struct _VAPictureParameterBufferVC1 {
3358 VASurfaceID forward_reference_picture;
3359 VASurfaceID backward_reference_picture;
3360 /* if out-of-loop post-processing is done on the render
3361 target, then we need to keep the in-loop decoded
3362 picture as a reference picture */
3363 VASurfaceID inloop_decoded_picture;
3364
3365 /* sequence layer for AP or meta data for SP and MP */
3366 union {
3367 struct {
3368 uint32_t pulldown : 1; /* SEQUENCE_LAYER::PULLDOWN */
3369 uint32_t interlace : 1; /* SEQUENCE_LAYER::INTERLACE */
3370 uint32_t tfcntrflag : 1; /* SEQUENCE_LAYER::TFCNTRFLAG */
3371 uint32_t finterpflag : 1; /* SEQUENCE_LAYER::FINTERPFLAG */
3372 uint32_t psf : 1; /* SEQUENCE_LAYER::PSF */
3373 uint32_t multires : 1; /* METADATA::MULTIRES */
3374 uint32_t overlap : 1; /* METADATA::OVERLAP */
3375 uint32_t syncmarker : 1; /* METADATA::SYNCMARKER */
3376 uint32_t rangered : 1; /* METADATA::RANGERED */
3377 uint32_t max_b_frames : 3; /* METADATA::MAXBFRAMES */
3378 uint32_t profile : 2; /* SEQUENCE_LAYER::PROFILE or The MSB of METADATA::PROFILE */
3379 } bits;
3380 uint32_t value;
3381 } sequence_fields;
3382
3383 uint16_t coded_width; /* ENTRY_POINT_LAYER::CODED_WIDTH */
3384 uint16_t coded_height; /* ENTRY_POINT_LAYER::CODED_HEIGHT */
3385 union {
3386 struct {
3387 uint32_t broken_link : 1; /* ENTRY_POINT_LAYER::BROKEN_LINK */
3388 uint32_t closed_entry : 1; /* ENTRY_POINT_LAYER::CLOSED_ENTRY */
3389 uint32_t panscan_flag : 1; /* ENTRY_POINT_LAYER::PANSCAN_FLAG */
3390 uint32_t loopfilter : 1; /* ENTRY_POINT_LAYER::LOOPFILTER */
3391 } bits;
3392 uint32_t value;
3393 } entrypoint_fields;
3394 uint8_t conditional_overlap_flag; /* ENTRY_POINT_LAYER::CONDOVER */
3395 uint8_t fast_uvmc_flag; /* ENTRY_POINT_LAYER::FASTUVMC */
3396 union {
3397 struct {
3398 uint32_t luma_flag : 1; /* ENTRY_POINT_LAYER::RANGE_MAPY_FLAG */
3399 uint32_t luma : 3; /* ENTRY_POINT_LAYER::RANGE_MAPY */
3400 uint32_t chroma_flag : 1; /* ENTRY_POINT_LAYER::RANGE_MAPUV_FLAG */
3401 uint32_t chroma : 3; /* ENTRY_POINT_LAYER::RANGE_MAPUV */
3402 } bits;
3403 uint32_t value;
3404 } range_mapping_fields;
3405
3406 uint8_t b_picture_fraction; /* Index for PICTURE_LAYER::BFRACTION value in Table 40 (7.1.1.14) */
3407 uint8_t cbp_table; /* PICTURE_LAYER::CBPTAB/ICBPTAB */
3408 uint8_t mb_mode_table; /* PICTURE_LAYER::MBMODETAB */
3409 uint8_t range_reduction_frame;/* PICTURE_LAYER::RANGEREDFRM */
3410 uint8_t rounding_control; /* PICTURE_LAYER::RNDCTRL */
3411 uint8_t post_processing; /* PICTURE_LAYER::POSTPROC */
3412 uint8_t picture_resolution_index; /* PICTURE_LAYER::RESPIC */
3413 uint8_t luma_scale; /* PICTURE_LAYER::LUMSCALE */
3414 uint8_t luma_shift; /* PICTURE_LAYER::LUMSHIFT */
3415
3416 union {
3417 struct {
3418 uint32_t picture_type : 3; /* PICTURE_LAYER::PTYPE */
3419 uint32_t frame_coding_mode : 3; /* PICTURE_LAYER::FCM */
3420 uint32_t top_field_first : 1; /* PICTURE_LAYER::TFF */
3421 uint32_t is_first_field : 1; /* set to 1 if it is the first field */
3422 uint32_t intensity_compensation : 1; /* PICTURE_LAYER::INTCOMP */
3423 } bits;
3424 uint32_t value;
3425 } picture_fields;
3426 union {
3427 struct {
3428 uint32_t mv_type_mb : 1; /* PICTURE::MVTYPEMB */
3429 uint32_t direct_mb : 1; /* PICTURE::DIRECTMB */
3430 uint32_t skip_mb : 1; /* PICTURE::SKIPMB */
3431 uint32_t field_tx : 1; /* PICTURE::FIELDTX */
3432 uint32_t forward_mb : 1; /* PICTURE::FORWARDMB */
3433 uint32_t ac_pred : 1; /* PICTURE::ACPRED */
3434 uint32_t overflags : 1; /* PICTURE::OVERFLAGS */
3435 } flags;
3436 uint32_t value;
3437 } raw_coding;
3438 union {
3439 struct {
3440 uint32_t bp_mv_type_mb : 1; /* PICTURE::MVTYPEMB */
3441 uint32_t bp_direct_mb : 1; /* PICTURE::DIRECTMB */
3442 uint32_t bp_skip_mb : 1; /* PICTURE::SKIPMB */
3443 uint32_t bp_field_tx : 1; /* PICTURE::FIELDTX */
3444 uint32_t bp_forward_mb : 1; /* PICTURE::FORWARDMB */
3445 uint32_t bp_ac_pred : 1; /* PICTURE::ACPRED */
3446 uint32_t bp_overflags : 1; /* PICTURE::OVERFLAGS */
3447 } flags;
3448 uint32_t value;
3449 } bitplane_present; /* signal what bitplane is being passed via the bitplane buffer */
3450 union {
3451 struct {
3452 uint32_t reference_distance_flag : 1;/* PICTURE_LAYER::REFDIST_FLAG */
3453 uint32_t reference_distance : 5;/* PICTURE_LAYER::REFDIST */
3454 uint32_t num_reference_pictures: 1;/* PICTURE_LAYER::NUMREF */
3455 uint32_t reference_field_pic_indicator : 1;/* PICTURE_LAYER::REFFIELD */
3456 } bits;
3457 uint32_t value;
3458 } reference_fields;
3459 union {
3460 struct {
3461 uint32_t mv_mode : 3; /* PICTURE_LAYER::MVMODE */
3462 uint32_t mv_mode2 : 3; /* PICTURE_LAYER::MVMODE2 */
3463 uint32_t mv_table : 3; /* PICTURE_LAYER::MVTAB/IMVTAB */
3464 uint32_t two_mv_block_pattern_table: 2; /* PICTURE_LAYER::2MVBPTAB */
3465 uint32_t four_mv_switch : 1; /* PICTURE_LAYER::4MVSWITCH */
3466 uint32_t four_mv_block_pattern_table : 2; /* PICTURE_LAYER::4MVBPTAB */
3467 uint32_t extended_mv_flag : 1; /* ENTRY_POINT_LAYER::EXTENDED_MV */
3468 uint32_t extended_mv_range : 2; /* PICTURE_LAYER::MVRANGE */
3469 uint32_t extended_dmv_flag : 1; /* ENTRY_POINT_LAYER::EXTENDED_DMV */
3470 uint32_t extended_dmv_range : 2; /* PICTURE_LAYER::DMVRANGE */
3471 } bits;
3472 uint32_t value;
3473 } mv_fields;
3474 union {
3475 struct {
3476 uint32_t dquant : 2; /* ENTRY_POINT_LAYER::DQUANT */
3477 uint32_t quantizer : 2; /* ENTRY_POINT_LAYER::QUANTIZER */
3478 uint32_t half_qp : 1; /* PICTURE_LAYER::HALFQP */
3479 uint32_t pic_quantizer_scale : 5;/* PICTURE_LAYER::PQUANT */
3480 uint32_t pic_quantizer_type : 1;/* PICTURE_LAYER::PQUANTIZER */
3481 uint32_t dq_frame : 1; /* VOPDQUANT::DQUANTFRM */
3482 uint32_t dq_profile : 2; /* VOPDQUANT::DQPROFILE */
3483 uint32_t dq_sb_edge : 2; /* VOPDQUANT::DQSBEDGE */
3484 uint32_t dq_db_edge : 2; /* VOPDQUANT::DQDBEDGE */
3485 uint32_t dq_binary_level : 1; /* VOPDQUANT::DQBILEVEL */
3486 uint32_t alt_pic_quantizer : 5;/* VOPDQUANT::ALTPQUANT */
3487 } bits;
3488 uint32_t value;
3489 } pic_quantizer_fields;
3490 union {
3491 struct {
3492 uint32_t variable_sized_transform_flag : 1;/* ENTRY_POINT_LAYER::VSTRANSFORM */
3493 uint32_t mb_level_transform_type_flag : 1;/* PICTURE_LAYER::TTMBF */
3494 uint32_t frame_level_transform_type : 2;/* PICTURE_LAYER::TTFRM */
3495 uint32_t transform_ac_codingset_idx1 : 2;/* PICTURE_LAYER::TRANSACFRM */
3496 uint32_t transform_ac_codingset_idx2 : 2;/* PICTURE_LAYER::TRANSACFRM2 */
3497 uint32_t intra_transform_dc_table : 1;/* PICTURE_LAYER::TRANSDCTAB */
3498 } bits;
3499 uint32_t value;
3500 } transform_fields;
3501
3502 uint8_t luma_scale2; /* PICTURE_LAYER::LUMSCALE2 */
3503 uint8_t luma_shift2; /* PICTURE_LAYER::LUMSHIFT2 */
3504 uint8_t intensity_compensation_field; /* Index for PICTURE_LAYER::INTCOMPFIELD value in Table 109 (9.1.1.48) */
3505
3507 uint32_t va_reserved[VA_PADDING_MEDIUM - 1];
3509
3528/* VC-1 Slice Parameter Buffer */
3529typedef struct _VASliceParameterBufferVC1 {
3530 uint32_t slice_data_size;/* number of bytes in the slice data buffer for this slice */
3531 uint32_t slice_data_offset;/* the offset to the first byte of slice data */
3532 uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
3533 uint32_t macroblock_offset;/* the offset to the first bit of MB from the first byte of slice data */
3534 uint32_t slice_vertical_position;
3535
3537 uint32_t va_reserved[VA_PADDING_LOW];
3539
3540/* VC-1 Slice Data Buffer */
3541/*
3542This is simplely a buffer containing raw bit-stream bytes
3543*/
3544
3545/****************************
3546 * H.264/AVC data structures
3547 ****************************/
3548
3549typedef struct _VAPictureH264 {
3550 VASurfaceID picture_id;
3551 uint32_t frame_idx;
3552 uint32_t flags;
3553 int32_t TopFieldOrderCnt;
3554 int32_t BottomFieldOrderCnt;
3555
3557 uint32_t va_reserved[VA_PADDING_LOW];
3558} VAPictureH264;
3559/* flags in VAPictureH264 could be OR of the following */
3560#define VA_PICTURE_H264_INVALID 0x00000001
3561#define VA_PICTURE_H264_TOP_FIELD 0x00000002
3562#define VA_PICTURE_H264_BOTTOM_FIELD 0x00000004
3563#define VA_PICTURE_H264_SHORT_TERM_REFERENCE 0x00000008
3564#define VA_PICTURE_H264_LONG_TERM_REFERENCE 0x00000010
3565
3567/*
3568 * For each picture, and before any slice data, a single
3569 * picture parameter buffer must be send.
3570 */
3571typedef struct _VAPictureParameterBufferH264 {
3572 VAPictureH264 CurrPic;
3573 VAPictureH264 ReferenceFrames[16]; /* in DPB */
3574 uint16_t picture_width_in_mbs_minus1;
3575 uint16_t picture_height_in_mbs_minus1;
3576 uint8_t bit_depth_luma_minus8;
3577 uint8_t bit_depth_chroma_minus8;
3578 uint8_t num_ref_frames;
3579 union {
3580 struct {
3581 uint32_t chroma_format_idc : 2;
3582 uint32_t residual_colour_transform_flag : 1; /* Renamed to separate_colour_plane_flag in newer standard versions. */
3583 uint32_t gaps_in_frame_num_value_allowed_flag : 1;
3584 uint32_t frame_mbs_only_flag : 1;
3585 uint32_t mb_adaptive_frame_field_flag : 1;
3586 uint32_t direct_8x8_inference_flag : 1;
3587 uint32_t MinLumaBiPredSize8x8 : 1; /* see A.3.3.2 */
3588 uint32_t log2_max_frame_num_minus4 : 4;
3589 uint32_t pic_order_cnt_type : 2;
3590 uint32_t log2_max_pic_order_cnt_lsb_minus4 : 4;
3591 uint32_t delta_pic_order_always_zero_flag : 1;
3592 } bits;
3593 uint32_t value;
3594 } seq_fields;
3595 // FMO is not supported.
3596 va_deprecated uint8_t num_slice_groups_minus1;
3597 va_deprecated uint8_t slice_group_map_type;
3598 va_deprecated uint16_t slice_group_change_rate_minus1;
3599 int8_t pic_init_qp_minus26;
3600 int8_t pic_init_qs_minus26;
3601 int8_t chroma_qp_index_offset;
3602 int8_t second_chroma_qp_index_offset;
3603 union {
3604 struct {
3605 uint32_t entropy_coding_mode_flag : 1;
3606 uint32_t weighted_pred_flag : 1;
3607 uint32_t weighted_bipred_idc : 2;
3608 uint32_t transform_8x8_mode_flag : 1;
3609 uint32_t field_pic_flag : 1;
3610 uint32_t constrained_intra_pred_flag : 1;
3611 uint32_t pic_order_present_flag : 1; /* Renamed to bottom_field_pic_order_in_frame_present_flag in newer standard versions. */
3612 uint32_t deblocking_filter_control_present_flag : 1;
3613 uint32_t redundant_pic_cnt_present_flag : 1;
3614 uint32_t reference_pic_flag : 1; /* nal_ref_idc != 0 */
3615 } bits;
3616 uint32_t value;
3617 } pic_fields;
3618 uint16_t frame_num;
3619
3621 uint32_t va_reserved[VA_PADDING_MEDIUM];
3623
3625typedef struct _VAIQMatrixBufferH264 {
3627 uint8_t ScalingList4x4[6][16];
3629 uint8_t ScalingList8x8[2][64];
3630
3632 uint32_t va_reserved[VA_PADDING_LOW];
3634
3636typedef struct _VASliceParameterBufferH264 {
3637 uint32_t slice_data_size;/* number of bytes in the slice data buffer for this slice */
3640 uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
3652 uint16_t first_mb_in_slice;
3653 uint8_t slice_type;
3654 uint8_t direct_spatial_mv_pred_flag;
3669 uint8_t cabac_init_idc;
3670 int8_t slice_qp_delta;
3671 uint8_t disable_deblocking_filter_idc;
3672 int8_t slice_alpha_c0_offset_div2;
3673 int8_t slice_beta_offset_div2;
3674 VAPictureH264 RefPicList0[32]; /* See 8.2.4.2 */
3675 VAPictureH264 RefPicList1[32]; /* See 8.2.4.2 */
3676 uint8_t luma_log2_weight_denom;
3677 uint8_t chroma_log2_weight_denom;
3678 uint8_t luma_weight_l0_flag;
3679 int16_t luma_weight_l0[32];
3680 int16_t luma_offset_l0[32];
3681 uint8_t chroma_weight_l0_flag;
3682 int16_t chroma_weight_l0[32][2];
3683 int16_t chroma_offset_l0[32][2];
3684 uint8_t luma_weight_l1_flag;
3685 int16_t luma_weight_l1[32];
3686 int16_t luma_offset_l1[32];
3687 uint8_t chroma_weight_l1_flag;
3688 int16_t chroma_weight_l1[32][2];
3689 int16_t chroma_offset_l1[32][2];
3690
3692 uint32_t va_reserved[VA_PADDING_LOW];
3694
3695/****************************
3696 * Common encode data structures
3697 ****************************/
3698typedef enum {
3699 VAEncPictureTypeIntra = 0,
3700 VAEncPictureTypePredictive = 1,
3701 VAEncPictureTypeBidirectional = 2,
3702} VAEncPictureType;
3703
3711typedef struct _VAEncSliceParameterBuffer {
3712 uint32_t start_row_number; /* starting MB row number for this slice */
3713 uint32_t slice_height; /* slice height measured in MB */
3714 union {
3715 struct {
3716 uint32_t is_intra : 1;
3717 uint32_t disable_deblocking_filter_idc : 2;
3718 uint32_t uses_long_term_ref : 1;
3719 uint32_t is_long_term_ref : 1;
3720 } bits;
3721 uint32_t value;
3722 } slice_flags;
3723
3725 uint32_t va_reserved[VA_PADDING_LOW];
3727
3728
3729/****************************
3730 * H.263 specific encode data structures
3731 ****************************/
3732
3733typedef struct _VAEncSequenceParameterBufferH263 {
3734 uint32_t intra_period;
3735 uint32_t bits_per_second;
3736 uint32_t frame_rate;
3737 uint32_t initial_qp;
3738 uint32_t min_qp;
3739
3741 uint32_t va_reserved[VA_PADDING_LOW];
3742} VAEncSequenceParameterBufferH263;
3743
3744typedef struct _VAEncPictureParameterBufferH263 {
3745 VASurfaceID reference_picture;
3746 VASurfaceID reconstructed_picture;
3747 VABufferID coded_buf;
3748 uint16_t picture_width;
3749 uint16_t picture_height;
3750 VAEncPictureType picture_type;
3751
3753 uint32_t va_reserved[VA_PADDING_LOW];
3754} VAEncPictureParameterBufferH263;
3755
3756/****************************
3757 * MPEG-4 specific encode data structures
3758 ****************************/
3759
3760typedef struct _VAEncSequenceParameterBufferMPEG4 {
3761 uint8_t profile_and_level_indication;
3762 uint32_t intra_period;
3763 uint32_t video_object_layer_width;
3764 uint32_t video_object_layer_height;
3765 uint32_t vop_time_increment_resolution;
3766 uint32_t fixed_vop_rate;
3767 uint32_t fixed_vop_time_increment;
3768 uint32_t bits_per_second;
3769 uint32_t frame_rate;
3770 uint32_t initial_qp;
3771 uint32_t min_qp;
3772
3774 uint32_t va_reserved[VA_PADDING_LOW];
3775} VAEncSequenceParameterBufferMPEG4;
3776
3777typedef struct _VAEncPictureParameterBufferMPEG4 {
3778 VASurfaceID reference_picture;
3779 VASurfaceID reconstructed_picture;
3780 VABufferID coded_buf;
3781 uint16_t picture_width;
3782 uint16_t picture_height;
3783 uint32_t modulo_time_base; /* number of 1s */
3784 uint32_t vop_time_increment;
3785 VAEncPictureType picture_type;
3786
3788 uint32_t va_reserved[VA_PADDING_LOW];
3789} VAEncPictureParameterBufferMPEG4;
3790
3791
3792
3811 VADisplay dpy,
3812 VAContextID context,
3813 VABufferType type, /* in */
3814 unsigned int size, /* in */
3815 unsigned int num_elements, /* in */
3816 void *data, /* in */
3817 VABufferID *buf_id /* out */
3818);
3819
3832 VADisplay dpy,
3833 VAContextID context,
3834 VABufferType type,
3835 unsigned int width,
3836 unsigned int height,
3837 unsigned int *unit_size,
3838 unsigned int *pitch,
3839 VABufferID *buf_id
3840);
3841
3849 VADisplay dpy,
3850 VABufferID buf_id, /* in */
3851 unsigned int num_elements /* in */
3852);
3853
3854
3859/*
3860 * FICTURE_AVE_QP(bit7-0): The average Qp value used during this frame
3861 * LARGE_SLICE(bit8):At least one slice in the current frame was large
3862 * enough for the encoder to attempt to limit its size.
3863 * SLICE_OVERFLOW(bit9): At least one slice in the current frame has
3864 * exceeded the maximum slice size specified.
3865 * BITRATE_OVERFLOW(bit10): The peak bitrate was exceeded for this frame.
3866 * BITRATE_HIGH(bit11): The frame size got within the safety margin of the maximum size (VCM only)
3867 * AIR_MB_OVER_THRESHOLD: the number of MBs adapted to Intra MB
3868 */
3869#define VA_CODED_BUF_STATUS_PICTURE_AVE_QP_MASK 0xff
3870#define VA_CODED_BUF_STATUS_LARGE_SLICE_MASK 0x100
3871#define VA_CODED_BUF_STATUS_SLICE_OVERFLOW_MASK 0x200
3872#define VA_CODED_BUF_STATUS_BITRATE_OVERFLOW 0x400
3873#define VA_CODED_BUF_STATUS_BITRATE_HIGH 0x800
3881#define VA_CODED_BUF_STATUS_FRAME_SIZE_OVERFLOW 0x1000
3885#define VA_CODED_BUF_STATUS_BAD_BITSTREAM 0x8000
3886#define VA_CODED_BUF_STATUS_AIR_MB_OVER_THRESHOLD 0xff0000
3887
3896#define VA_CODED_BUF_STATUS_NUMBER_PASSES_MASK 0xf000000
3897
3905#define VA_CODED_BUF_STATUS_SINGLE_NALU 0x10000000
3906
3917typedef struct _VACodedBufferSegment {
3921 uint32_t size;
3923 uint32_t bit_offset;
3925 uint32_t status;
3927 uint32_t reserved;
3929 void *buf;
3934 void *next;
3935
3937 uint32_t va_reserved[VA_PADDING_LOW];
3939
3949 VADisplay dpy,
3950 VABufferID buf_id, /* in */
3951 void **pbuf /* out */
3952);
3953
3963#define VA_MAPBUFFER_FLAG_DEFAULT 0
3965#define VA_MAPBUFFER_FLAG_READ 1
3967#define VA_MAPBUFFER_FLAG_WRITE 2
3968
3969VAStatus vaMapBuffer2(
3970 VADisplay dpy,
3971 VABufferID buf_id, /* in */
3972 void **pbuf, /* out */
3973 uint32_t flags /* in */
3974);
3975
3982 VADisplay dpy,
3983 VABufferID buf_id /* in */
3984);
3985
3996 VADisplay dpy,
3997 VABufferID buffer_id
3998);
3999
4001typedef struct {
4003 uintptr_t handle;
4005 uint32_t type;
4014 uint32_t mem_type;
4016 size_t mem_size;
4017
4019 uint32_t va_reserved[VA_PADDING_LOW];
4020} VABufferInfo;
4021
4069VAStatus
4071
4102VAStatus
4104
4110#define VA_EXPORT_SURFACE_READ_ONLY 0x0001
4112#define VA_EXPORT_SURFACE_WRITE_ONLY 0x0002
4114#define VA_EXPORT_SURFACE_READ_WRITE 0x0003
4120#define VA_EXPORT_SURFACE_SEPARATE_LAYERS 0x0004
4126#define VA_EXPORT_SURFACE_COMPOSED_LAYERS 0x0008
4127
4163 VASurfaceID surface_id,
4164 uint32_t mem_type, uint32_t flags,
4165 void *descriptor);
4166
4183 VADisplay dpy,
4184 VAContextID context,
4185 VASurfaceID render_target
4186);
4187
4192 VADisplay dpy,
4193 VAContextID context,
4194 VABufferID *buffers,
4195 int num_buffers
4196);
4197
4207 VADisplay dpy,
4208 VAContextID context
4209);
4210
4230VAStatus vaMFSubmit(
4231 VADisplay dpy,
4232 VAMFContextID mf_context,
4233 VAContextID * contexts,
4234 int num_contexts
4235);
4236
4237/*
4238
4239Synchronization
4240
4241*/
4242
4249 VADisplay dpy,
4250 VASurfaceID render_target
4251);
4252
4254#define VA_TIMEOUT_INFINITE 0xFFFFFFFFFFFFFFFF
4255
4277 VADisplay dpy,
4278 VASurfaceID surface,
4279 uint64_t timeout_ns
4280);
4281
4282typedef enum {
4283 VASurfaceRendering = 1, /* Rendering in progress */
4284 VASurfaceDisplaying = 2, /* Displaying in progress (not safe to render into it) */
4285 /* this status is useful if surface is used as the source */
4286 /* of an overlay */
4287 VASurfaceReady = 4, /* not being rendered or displayed */
4288 VASurfaceSkipped = 8 /* Indicate a skipped frame during encode */
4289} VASurfaceStatus;
4290
4295 VADisplay dpy,
4296 VASurfaceID render_target,
4297 VASurfaceStatus *status /* out */
4298);
4299
4300typedef enum {
4301 VADecodeSliceMissing = 0,
4302 VADecodeMBError = 1,
4303 VADecodeReset = 2,
4304} VADecodeErrorType;
4305
4310typedef struct _VASurfaceDecodeMBErrors {
4311 int32_t status; /* 1 if hardware has returned detailed info below, -1 means this record is invalid */
4312 uint32_t start_mb; /* start mb address with errors */
4313 uint32_t end_mb; /* end mb address with errors */
4314 VADecodeErrorType decode_error_type;
4315 uint32_t num_mb; /* number of mbs with errors */
4317 uint32_t va_reserved[VA_PADDING_LOW - 1];
4319
4335 VADisplay dpy,
4336 VASurfaceID surface,
4337 VAStatus error_status,
4338 void **error_info
4339);
4340
4362 VADisplay dpy,
4363 VABufferID buf_id,
4364 uint64_t timeout_ns
4365);
4366
4388#define VA_FOURCC(ch0, ch1, ch2, ch3) \
4389 ((unsigned long)(unsigned char) (ch0) | ((unsigned long)(unsigned char) (ch1) << 8) | \
4390 ((unsigned long)(unsigned char) (ch2) << 16) | ((unsigned long)(unsigned char) (ch3) << 24 ))
4391
4392/* Pre-defined fourcc codes. */
4393
4397#define VA_FOURCC_NV12 0x3231564E
4401#define VA_FOURCC_NV21 0x3132564E
4402
4407#define VA_FOURCC_AI44 0x34344149
4408
4413#define VA_FOURCC_RGBA 0x41424752
4418#define VA_FOURCC_RGBX 0x58424752
4423#define VA_FOURCC_BGRA 0x41524742
4428#define VA_FOURCC_BGRX 0x58524742
4433#define VA_FOURCC_ARGB 0x42475241
4438#define VA_FOURCC_XRGB 0x42475258
4443#define VA_FOURCC_ABGR 0x52474241
4448#define VA_FOURCC_XBGR 0x52474258
4449
4454#define VA_FOURCC_UYVY 0x59565955
4459#define VA_FOURCC_YUY2 0x32595559
4464#define VA_FOURCC_AYUV 0x56555941
4469#define VA_FOURCC_NV11 0x3131564e
4474#define VA_FOURCC_YV12 0x32315659
4479#define VA_FOURCC_P208 0x38303250
4484#define VA_FOURCC_I420 0x30323449
4489#define VA_FOURCC_YV24 0x34325659
4494#define VA_FOURCC_YV32 0x32335659
4497#define VA_FOURCC_Y800 0x30303859
4503#define VA_FOURCC_IMC3 0x33434D49
4508#define VA_FOURCC_411P 0x50313134
4514#define VA_FOURCC_411R 0x52313134
4519#define VA_FOURCC_422H 0x48323234
4524#define VA_FOURCC_422V 0x56323234
4529#define VA_FOURCC_444P 0x50343434
4530
4535#define VA_FOURCC_RGBP 0x50424752
4540#define VA_FOURCC_BGRP 0x50524742
4546#define VA_FOURCC_RGB565 0x36314752
4552#define VA_FOURCC_BGR565 0x36314742
4553
4559#define VA_FOURCC_Y210 0x30313259
4565#define VA_FOURCC_Y212 0x32313259
4571#define VA_FOURCC_Y216 0x36313259
4577#define VA_FOURCC_Y410 0x30313459
4583#define VA_FOURCC_Y412 0x32313459
4589#define VA_FOURCC_Y416 0x36313459
4590
4595#define VA_FOURCC_YV16 0x36315659
4601#define VA_FOURCC_P010 0x30313050
4607#define VA_FOURCC_P012 0x32313050
4613#define VA_FOURCC_P016 0x36313050
4614
4620#define VA_FOURCC_I010 0x30313049
4621
4626#define VA_FOURCC_IYUV 0x56555949
4630#define VA_FOURCC_A2R10G10B10 0x30335241 /* VA_FOURCC('A','R','3','0') */
4634#define VA_FOURCC_A2B10G10R10 0x30334241 /* VA_FOURCC('A','B','3','0') */
4638#define VA_FOURCC_X2R10G10B10 0x30335258 /* VA_FOURCC('X','R','3','0') */
4642#define VA_FOURCC_X2B10G10R10 0x30334258 /* VA_FOURCC('X','B','3','0') */
4643
4648#define VA_FOURCC_Y8 0x20203859
4653#define VA_FOURCC_Y16 0x20363159
4658#define VA_FOURCC_VYUY 0x59555956
4663#define VA_FOURCC_YVYU 0x55595659
4668#define VA_FOURCC_ARGB64 0x34475241
4673#define VA_FOURCC_ABGR64 0x34474241
4678#define VA_FOURCC_XYUV 0x56555958
4683#define VA_FOURCC_Q416 0x36313451
4684
4685/* byte order */
4686#define VA_LSB_FIRST 1
4687#define VA_MSB_FIRST 2
4688
4689typedef struct _VAImageFormat {
4690 uint32_t fourcc;
4691 uint32_t byte_order; /* VA_LSB_FIRST, VA_MSB_FIRST */
4692 uint32_t bits_per_pixel;
4693 /* for RGB formats */
4694 uint32_t depth; /* significant bits per pixel */
4695 uint32_t red_mask;
4696 uint32_t green_mask;
4697 uint32_t blue_mask;
4698 uint32_t alpha_mask;
4699
4701 uint32_t va_reserved[VA_PADDING_LOW];
4702} VAImageFormat;
4703
4704typedef VAGenericID VAImageID;
4705
4706typedef struct _VAImage {
4707 VAImageID image_id; /* uniquely identify this image */
4708 VAImageFormat format;
4709 VABufferID buf; /* image data buffer */
4710 /*
4711 * Image data will be stored in a buffer of type VAImageBufferType to facilitate
4712 * data store on the server side for optimal performance. The buffer will be
4713 * created by the CreateImage function, and proper storage allocated based on the image
4714 * size and format. This buffer is managed by the library implementation, and
4715 * accessed by the client through the buffer Map/Unmap functions.
4716 */
4717 uint16_t width;
4718 uint16_t height;
4719 uint32_t data_size;
4720 uint32_t num_planes; /* can not be greater than 3 */
4721 /*
4722 * An array indicating the scanline pitch in bytes for each plane.
4723 * Each plane may have a different pitch. Maximum 3 planes for planar formats
4724 */
4725 uint32_t pitches[3];
4726 /*
4727 * An array indicating the byte offset from the beginning of the image data
4728 * to the start of each plane.
4729 */
4730 uint32_t offsets[3];
4731
4732 /* The following fields are only needed for paletted formats */
4733 int32_t num_palette_entries; /* set to zero for non-palette images */
4734 /*
4735 * Each component is one byte and entry_bytes indicates the number of components in
4736 * each entry (eg. 3 for YUV palette entries). set to zero for non-palette images
4737 */
4738 int32_t entry_bytes;
4739 /*
4740 * An array of ascii characters describing the order of the components within the bytes.
4741 * Only entry_bytes characters of the string are used.
4742 */
4743 int8_t component_order[4];
4744
4746 uint32_t va_reserved[VA_PADDING_LOW];
4747} VAImage;
4748
4751 VADisplay dpy
4752);
4753
4761 VADisplay dpy,
4762 VAImageFormat *format_list, /* out */
4763 int *num_formats /* out */
4764);
4765
4774 VADisplay dpy,
4775 VAImageFormat *format,
4776 int width,
4777 int height,
4778 VAImage *image /* out */
4779);
4780
4785 VADisplay dpy,
4786 VAImageID image
4787);
4788
4789VAStatus vaSetImagePalette(
4790 VADisplay dpy,
4791 VAImageID image,
4792 /*
4793 * pointer to an array holding the palette data. The size of the array is
4794 * num_palette_entries * entry_bytes in size. The order of the components
4795 * in the palette is described by the component_order in VAImage struct
4796 */
4797 unsigned char *palette
4798);
4799
4804VAStatus vaGetImage(
4805 VADisplay dpy,
4806 VASurfaceID surface,
4807 int x, /* coordinates of the upper left source pixel */
4808 int y,
4809 unsigned int width, /* width and height of the region */
4810 unsigned int height,
4811 VAImageID image
4812);
4813
4820VAStatus vaPutImage(
4821 VADisplay dpy,
4822 VASurfaceID surface,
4823 VAImageID image,
4824 int src_x,
4825 int src_y,
4826 unsigned int src_width,
4827 unsigned int src_height,
4828 int dest_x,
4829 int dest_y,
4830 unsigned int dest_width,
4831 unsigned int dest_height
4832);
4833
4866 VADisplay dpy,
4867 VASurfaceID surface,
4868 VAImage *image /* out */
4869);
4870
4879
4882 VADisplay dpy
4883);
4884
4886#define VA_SUBPICTURE_CHROMA_KEYING 0x0001
4887#define VA_SUBPICTURE_GLOBAL_ALPHA 0x0002
4888#define VA_SUBPICTURE_DESTINATION_IS_SCREEN_COORD 0x0004
4902 VADisplay dpy,
4903 VAImageFormat *format_list, /* out */
4904 unsigned int *flags, /* out */
4905 unsigned int *num_formats /* out */
4906);
4907
4912 VADisplay dpy,
4913 VAImageID image,
4914 VASubpictureID *subpicture /* out */
4915);
4916
4921 VADisplay dpy,
4922 VASubpictureID subpicture
4923);
4924
4930 VADisplay dpy,
4931 VASubpictureID subpicture,
4932 VAImageID image
4933);
4934
4945 VADisplay dpy,
4946 VASubpictureID subpicture,
4947 unsigned int chromakey_min,
4948 unsigned int chromakey_max,
4949 unsigned int chromakey_mask
4950);
4951
4958 VADisplay dpy,
4959 VASubpictureID subpicture,
4960 float global_alpha
4961);
4962
4971 VADisplay dpy,
4972 VASubpictureID subpicture,
4973 VASurfaceID *target_surfaces,
4974 int num_surfaces,
4975 int16_t src_x, /* upper left offset in subpicture */
4976 int16_t src_y,
4977 uint16_t src_width,
4978 uint16_t src_height,
4979 int16_t dest_x, /* upper left offset in surface */
4980 int16_t dest_y,
4981 uint16_t dest_width,
4982 uint16_t dest_height,
4983 /*
4984 * whether to enable chroma-keying, global-alpha, or screen relative mode
4985 * see VA_SUBPICTURE_XXX values
4986 */
4987 uint32_t flags
4988);
4989
4994 VADisplay dpy,
4995 VASubpictureID subpicture,
4996 VASurfaceID *target_surfaces,
4997 int num_surfaces
4998);
4999
5017/* PowerVR IEP Lite attributes */
5018typedef enum {
5019 VADISPLAYATTRIB_BLE_OFF = 0x00,
5020 VADISPLAYATTRIB_BLE_LOW,
5021 VADISPLAYATTRIB_BLE_MEDIUM,
5022 VADISPLAYATTRIB_BLE_HIGH,
5023 VADISPLAYATTRIB_BLE_NONE,
5025
5027#define VA_ROTATION_NONE 0x00000000
5028#define VA_ROTATION_90 0x00000001
5029#define VA_ROTATION_180 0x00000002
5030#define VA_ROTATION_270 0x00000003
5042#define VA_MIRROR_NONE 0x00000000
5044#define VA_MIRROR_HORIZONTAL 0x00000001
5046#define VA_MIRROR_VERTICAL 0x00000002
5050#define VA_OOL_DEBLOCKING_FALSE 0x00000000
5051#define VA_OOL_DEBLOCKING_TRUE 0x00000001
5052
5054#define VA_RENDER_MODE_UNDEFINED 0
5055#define VA_RENDER_MODE_LOCAL_OVERLAY 1
5056#define VA_RENDER_MODE_LOCAL_GPU 2
5057#define VA_RENDER_MODE_EXTERNAL_OVERLAY 4
5058#define VA_RENDER_MODE_EXTERNAL_GPU 8
5059
5061#define VA_RENDER_DEVICE_UNDEFINED 0
5062#define VA_RENDER_DEVICE_LOCAL 1
5063#define VA_RENDER_DEVICE_EXTERNAL 2
5064
5078typedef union _VADisplayAttribValSubDevice {
5079 struct {
5083 uint32_t sub_device_count : 4;
5085 uint32_t reserved : 8;
5101 uint32_t sub_device_mask : 16;
5102 } bits;
5103 uint32_t value;
5105
5107typedef enum {
5108 VADisplayAttribBrightness = 0,
5109 VADisplayAttribContrast = 1,
5110 VADisplayAttribHue = 2,
5111 VADisplayAttribSaturation = 3,
5112 /* client can specifiy a background color for the target window
5113 * the new feature of video conference,
5114 * the uncovered area of the surface is filled by this color
5115 * also it will blend with the decoded video color
5116 */
5117 VADisplayAttribBackgroundColor = 4,
5118 /*
5119 * this is a gettable only attribute. For some implementations that use the
5120 * hardware overlay, after PutSurface is called, the surface can not be
5121 * re-used until after the subsequent PutSurface call. If this is the case
5122 * then the value for this attribute will be set to 1 so that the client
5123 * will not attempt to re-use the surface right after returning from a call
5124 * to PutSurface.
5125 *
5126 * Don't use it, use flag VASurfaceDisplaying of vaQuerySurfaceStatus since
5127 * driver may use overlay or GPU alternatively
5128 */
5129 VADisplayAttribDirectSurface = 5,
5130 VADisplayAttribRotation = 6,
5131 VADisplayAttribOutofLoopDeblock = 7,
5132
5133 /* PowerVR IEP Lite specific attributes */
5134 VADisplayAttribBLEBlackMode = 8,
5135 VADisplayAttribBLEWhiteMode = 9,
5136 VADisplayAttribBlueStretch = 10,
5137 VADisplayAttribSkinColorCorrection = 11,
5138 /*
5139 * For type VADisplayAttribCSCMatrix, "value" field is a pointer to the color
5140 * conversion matrix. Each element in the matrix is float-point
5141 */
5142 VADisplayAttribCSCMatrix = 12,
5143 /* specify the constant color used to blend with video surface
5144 * Cd = Cv*Cc*Ac + Cb *(1 - Ac) C means the constant RGB
5145 * d: the final color to overwrite into the frame buffer
5146 * v: decoded video after color conversion,
5147 * c: video color specified by VADisplayAttribBlendColor
5148 * b: background color of the drawable
5149 */
5150 VADisplayAttribBlendColor = 13,
5151 /*
5152 * Indicate driver to skip painting color key or not.
5153 * only applicable if the render is overlay
5154 */
5155 VADisplayAttribOverlayAutoPaintColorKey = 14,
5156 /*
5157 * customized overlay color key, the format is RGB888
5158 * [23:16] = Red, [15:08] = Green, [07:00] = Blue.
5159 */
5160 VADisplayAttribOverlayColorKey = 15,
5161 /*
5162 * The hint for the implementation of vaPutSurface
5163 * normally, the driver could use an overlay or GPU to render the surface on the screen
5164 * this flag provides APP the flexibity to switch the render dynamically
5165 */
5166 VADisplayAttribRenderMode = 16,
5167 /*
5168 * specify if vaPutSurface needs to render into specified monitors
5169 * one example is that one external monitor (e.g. HDMI) is enabled,
5170 * but the window manager is not aware of it, and there is no associated drawable
5171 */
5172 VADisplayAttribRenderDevice = 17,
5173 /*
5174 * specify vaPutSurface render area if there is no drawable on the monitor
5175 */
5176 VADisplayAttribRenderRect = 18,
5177 /*
5178 * HW attribute, read/write, specify the sub device configure
5179 */
5180 VADisplayAttribSubDevice = 19,
5181 /*
5182 * HW attribute. read only. specify whether vaCopy support on current HW
5183 * The value of each bit should equal to 1 << VA_EXEC_MODE_XXX to represent
5184 * modes of vaCopy
5185 */
5186 VADisplayAttribCopy = 20,
5187 /*
5188 * HW attribute. read only. retrieve the device information from backend driver
5189 * the value should be combined with vendor ID << 16 | device ID
5190 */
5191 VADisplayPCIID = 21,
5193
5194/* flags for VADisplayAttribute */
5195#define VA_DISPLAY_ATTRIB_NOT_SUPPORTED 0x0000
5196#define VA_DISPLAY_ATTRIB_GETTABLE 0x0001
5197#define VA_DISPLAY_ATTRIB_SETTABLE 0x0002
5198
5199typedef struct _VADisplayAttribute {
5201 int32_t min_value;
5202 int32_t max_value;
5203 int32_t value; /* used by the set/get attribute functions */
5204 /* flags can be VA_DISPLAY_ATTRIB_GETTABLE or VA_DISPLAY_ATTRIB_SETTABLE or OR'd together */
5205 uint32_t flags;
5206
5208 uint32_t va_reserved[VA_PADDING_LOW];
5209} VADisplayAttribute;
5210
5213 VADisplay dpy
5214);
5215
5223 VADisplay dpy,
5224 VADisplayAttribute *attr_list, /* out */
5225 int *num_attributes /* out */
5226);
5227
5235 VADisplay dpy,
5236 VADisplayAttribute *attr_list, /* in/out */
5237 int num_attributes
5238);
5239
5247 VADisplay dpy,
5248 VADisplayAttribute *attr_list,
5249 int num_attributes
5250);
5251
5252/****************************
5253 * HEVC data structures
5254 ****************************/
5264typedef struct _VAPictureHEVC {
5268 VASurfaceID picture_id;
5274 /* described below */
5275 uint32_t flags;
5276
5278 uint32_t va_reserved[VA_PADDING_LOW];
5280
5281/* flags in VAPictureHEVC could be OR of the following */
5282#define VA_PICTURE_HEVC_INVALID 0x00000001
5286#define VA_PICTURE_HEVC_FIELD_PIC 0x00000002
5291#define VA_PICTURE_HEVC_BOTTOM_FIELD 0x00000004
5293#define VA_PICTURE_HEVC_LONG_TERM_REFERENCE 0x00000008
5308#define VA_PICTURE_HEVC_RPS_ST_CURR_BEFORE 0x00000010
5313#define VA_PICTURE_HEVC_RPS_ST_CURR_AFTER 0x00000020
5318#define VA_PICTURE_HEVC_RPS_LT_CURR 0x00000040
5319
5320/****************************
5321 * VVC data structures
5322 ****************************/
5330typedef struct _VAPictureVVC {
5334 VASurfaceID picture_id;
5335
5338
5339 /* described below */
5340 uint32_t flags;
5341
5343 uint32_t va_reserved[VA_PADDING_LOW];
5344} VAPictureVVC;
5345
5346/* flags in VAPictureVVC could be OR of the following */
5347#define VA_PICTURE_VVC_INVALID 0x00000001
5349#define VA_PICTURE_VVC_LONG_TERM_REFERENCE 0x00000002
5355#define VA_PICTURE_VVC_UNAVAILABLE_REFERENCE 0x00000004
5356
5357typedef enum {
5358 VACopyObjectSurface = 0,
5359 VACopyObjectBuffer = 1,
5360} VACopyObjectType;
5361
5362typedef struct _VACopyObject {
5363 VACopyObjectType obj_type; // type of object.
5364 union {
5365 VASurfaceID surface_id;
5366 VABufferID buffer_id;
5367 } object;
5368
5369 uint32_t va_reserved[VA_PADDING_MEDIUM];
5370} VACopyObject;
5371
5372typedef union _VACopyOption {
5373 struct {
5375 uint32_t va_copy_sync : 2;
5377 uint32_t va_copy_mode : 4;
5378 uint32_t reserved : 26;
5379 } bits;
5380 uint32_t value;
5381} VACopyOption;
5382
5395VAStatus vaCopy(VADisplay dpy, VACopyObject * dst, VACopyObject * src, VACopyOption option);
5396
5397#include <va/va_dec_hevc.h>
5398#include <va/va_dec_jpeg.h>
5399#include <va/va_dec_vp8.h>
5400#include <va/va_dec_vp9.h>
5401#include <va/va_dec_av1.h>
5402#include <va/va_dec_vvc.h>
5403#include <va/va_enc_hevc.h>
5404#include <va/va_fei_hevc.h>
5405#include <va/va_enc_h264.h>
5406#include <va/va_enc_jpeg.h>
5407#include <va/va_enc_mpeg2.h>
5408#include <va/va_enc_vp8.h>
5409#include <va/va_enc_vp9.h>
5410#include <va/va_enc_av1.h>
5411#include <va/va_fei.h>
5412#include <va/va_fei_h264.h>
5413#include <va/va_vpp.h>
5414#include <va/va_prot.h>
5415
5418#ifdef __cplusplus
5419}
5420#endif
5421
5422#endif /* _VA_H_ */
VAStatus vaTerminate(VADisplay dpy)
VAMvModeVC1
Definition va.h:3336
VAEncMiscParameterType
Definition va.h:2356
VADisplayAttribBLEMode
Definition va.h:5018
VAStatus vaDestroySurfaces(VADisplay dpy, VASurfaceID *surfaces, int num_surfaces)
VAGenericID VASubpictureID
Definition va.h:4878
int vaMaxNumConfigAttributes(VADisplay dpy)
VAStatus vaQueryConfigProfiles(VADisplay dpy, VAProfile *profile_list, int *num_profiles)
VAGenericValueType
Generic value types.
Definition va.h:1628
VAStatus vaDestroyContext(VADisplay dpy, VAContextID context)
VABufferType
Definition va.h:2021
VAStatus vaInitialize(VADisplay dpy, int *major_version, int *minor_version)
void(* VAMessageCallback)(void *user_context, const char *message)
Definition va.h:430
VAStatus vaMFReleaseContext(VADisplay dpy, VAMFContextID mf_context, VAContextID context)
VAConfigAttribType
Definition va.h:617
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:1636
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)
const char * vaQueryVendorString(VADisplay dpy)
VAGenericID VAContextID
Definition va.h:1620
VASurfaceAttribType
Surface attribute types.
Definition va.h:1666
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)
const char * vaErrorStr(VAStatus error_status)
VAEntrypoint
Definition va.h:550
VAStatus vaDestroyConfig(VADisplay dpy, VAConfigID config_id)
VAStatus vaQuerySurfaceAttributes(VADisplay dpy, VAConfigID config, VASurfaceAttrib *attrib_list, unsigned int *num_attribs)
Queries surface attributes for the supplied config.
VAStatus vaAssociateSubpicture(VADisplay dpy, VASubpictureID subpicture, VASurfaceID *target_surfaces, int num_surfaces, int16_t src_x, int16_t src_y, uint16_t src_width, uint16_t src_height, int16_t dest_x, int16_t dest_y, uint16_t dest_width, uint16_t dest_height, uint32_t flags)
VAStatus vaCreateSubpicture(VADisplay dpy, VAImageID image, VASubpictureID *subpicture)
VAMessageCallback vaSetErrorCallback(VADisplay dpy, VAMessageCallback callback, void *user_context)
VAStatus vaCreateContext(VADisplay dpy, VAConfigID config_id, int picture_width, int picture_height, int flag, VASurfaceID *render_targets, int num_render_targets, VAContextID *context)
VAStatus vaQueryConfigEntrypoints(VADisplay dpy, VAProfile profile, VAEntrypoint *entrypoint_list, int *num_entrypoints)
void * VANativeDisplay
Definition va.h:451
VAStatus vaSetSubpictureGlobalAlpha(VADisplay dpy, VASubpictureID subpicture, float global_alpha)
VAStatus vaCreateImage(VADisplay dpy, VAImageFormat *format, int width, int height, VAImage *image)
VAEncPackedHeaderType
Packed header type.
Definition va.h:2396
VAStatus vaSyncSurface2(VADisplay dpy, VASurfaceID surface, uint64_t timeout_ns)
Synchronizes pending operations associated with the supplied surface.
VAStatus vaCreateConfig(VADisplay dpy, VAProfile profile, VAEntrypoint entrypoint, VAConfigAttrib *attrib_list, int num_attribs, VAConfigID *config_id)
VAStatus vaSyncSurface(VADisplay dpy, VASurfaceID render_target)
VAStatus vaDestroyBuffer(VADisplay dpy, VABufferID buffer_id)
VAProfile
Definition va.h:502
VAStatus vaQuerySubpictureFormats(VADisplay dpy, VAImageFormat *format_list, unsigned int *flags, unsigned int *num_formats)
VAStatus vaDestroySubpicture(VADisplay dpy, VASubpictureID subpicture)
#define VA_PADDING_LOW
Definition va.h:360
VAStatus vaDeriveImage(VADisplay dpy, VASurfaceID surface, VAImage *image)
VAStatus vaMFAddContext(VADisplay dpy, VAMFContextID mf_context, VAContextID context)
unsigned int VAGenericID
Definition va.h:1557
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:2019
int vaMaxNumImageFormats(VADisplay dpy)
VAStatus vaCreateMFContext(VADisplay dpy, VAMFContextID *mf_context)
void * VADisplay
Definition va.h:260
VAStatus vaCreateBuffer2(VADisplay dpy, VAContextID context, VABufferType type, unsigned int width, unsigned int height, unsigned int *unit_size, unsigned int *pitch, VABufferID *buf_id)
VAStatus vaReleaseBufferHandle(VADisplay dpy, VABufferID buf_id)
Releases buffer after usage from external API.
VAStatus vaMFSubmit(VADisplay dpy, VAMFContextID mf_context, VAContextID *contexts, int num_contexts)
VAStatus vaQueryProcessingRate(VADisplay dpy, VAConfigID config, VAProcessingRateParameter *proc_buf, unsigned int *processing_rate)
Queries processing rate for the supplied config.
VAStatus vaGetConfigAttributes(VADisplay dpy, VAProfile profile, VAEntrypoint entrypoint, VAConfigAttrib *attrib_list, int num_attribs)
VAStatus vaUnmapBuffer(VADisplay dpy, VABufferID buf_id)
VAMessageCallback vaSetInfoCallback(VADisplay dpy, VAMessageCallback callback, void *user_context)
VAStatus vaMapBuffer(VADisplay dpy, VABufferID buf_id, void **pbuf)
int vaMaxNumSubpictureFormats(VADisplay dpy)
VAStatus vaEndPicture(VADisplay dpy, VAContextID context)
@ VAEncMiscParameterTypeExtensionData
encode extension buffer, ect. MPEG2 Sequence extenstion data
Definition va.h:2392
@ VAEncMiscParameterTypeParallelBRC
Buffer type used for parallel BRC parameters.
Definition va.h:2382
@ VAEncMiscParameterTypeRIR
Buffer type used for Rolling intra refresh.
Definition va.h:2367
@ VAEncMiscParameterTypeCustomRoundingControl
Buffer type used for encoder rounding offset parameters.
Definition va.h:2388
@ VAEncMiscParameterTypeHRD
Buffer type used for HRD parameters.
Definition va.h:2364
@ VAEncMiscParameterTypeROI
Buffer type used for region-of-interest (ROI) parameters.
Definition va.h:2374
@ VAEncMiscParameterTypeSubMbPartPel
Set MB partion mode mask and Half-pel/Quant-pel motion search.
Definition va.h:2384
@ VAEncMiscParameterTypeEncQuality
set encode quality tuning
Definition va.h:2386
@ VAEncMiscParameterTypeDirtyRect
Buffer type used for dirty region-of-interest (ROI) parameters.
Definition va.h:2380
@ VAEncMiscParameterTypeQuantization
Buffer type used for quantization parameters, it's per-sequence parameter.
Definition va.h:2369
@ VAEncMiscParameterTypeTemporalLayerStructure
Buffer type used for temporal layer structure.
Definition va.h:2378
@ VAEncMiscParameterTypeMaxFrameSize
Buffer type used to express a maximum frame size (in bits).
Definition va.h:2362
@ VAEncMiscParameterTypeMultiPassFrameSize
Buffer type used to express a maximum frame size (in bytes) settings for multiple pass.
Definition va.h:2376
@ VAEncMiscParameterTypeSkipFrame
Buffer type used for sending skip frame parameters to the encoder's rate control, when the user has e...
Definition va.h:2372
@ VAEncMiscParameterTypeFEIFrameControl
Buffer type used for FEI input frame level parameters.
Definition va.h:2390
@ VAGenericValueTypeInteger
Definition va.h:1629
@ VAGenericValueTypeFloat
Definition va.h:1630
@ VAGenericValueTypePointer
Definition va.h:1631
@ VAGenericValueTypeFunc
Definition va.h:1632
@ VAProcPipelineParameterBufferType
Video processing pipeline parameter buffer.
Definition va.h:2063
@ VASubsetsParameterBufferType
HEVC Decoding Subset Parameter buffer type.
Definition va.h:2123
@ VAContextParameterUpdateBufferType
adjust context parameters dynamically
Definition va.h:2129
@ VASubPicBufferType
VVC SubPic data buffer.
Definition va.h:2172
@ VAEncQPBufferType
Encoding QP buffer.
Definition va.h:2055
@ VAEncMacroblockDisableSkipMapBufferType
Definition va.h:2098
@ VATileBufferType
VVC Tile Dimension data buffer.
Definition va.h:2178
@ VAProtectedSessionExecuteBufferType
Protected session execution buffer type.
Definition va.h:2136
@ VAEncFEICTBCmdBufferType
HEVC FEI CTB level cmd buffer it is CTB level information for future usage.
Definition va.h:2103
@ VAProcFilterParameterBufferType
Video filter parameter buffer.
Definition va.h:2076
@ VAStatsStatisticsBufferType
Statistics output for VAEntrypointStats progressive and top field of interlaced case.
Definition va.h:2087
@ VASliceStructBufferType
VVC Slice Structure data buffer.
Definition va.h:2184
@ VAAlfBufferType
VVC ALF data buffer.
Definition va.h:2160
@ VALmcsBufferType
VVC LMCS data buffer.
Definition va.h:2166
@ VAStatsStatisticsBottomFieldBufferType
Statistics output for VAEntrypointStats bottom field of interlaced case.
Definition va.h:2089
@ VAEncFEICURecordBufferType
HEVC FEI CU level data buffer it's CTB level information for future usage.
Definition va.h:2108
@ VAEncryptionParameterBufferType
Encryption parameters buffer for protected content session.
Definition va.h:2142
@ VADecodeStreamoutBufferType
Definition va.h:2111
@ VAEncDeltaQpPerBlockBufferType
Encoding delta QP per block buffer.
Definition va.h:2153
@ VAEncFEIMVBufferType
FEI specific buffer types.
Definition va.h:2080
@ VAConfigAttribProcessingRate
Processing rate reporting attribute. Read-only.
Definition va.h:832
@ VAConfigAttribMaxPictureHeight
Maximum picture height. Read-only.
Definition va.h:762
@ VAConfigAttribProtectedContentCipherMode
Cipher mode of the protected content session.
Definition va.h:975
@ VAConfigAttribEncMacroblockInfo
Macroblock information. Read-only.
Definition va.h:748
@ VAConfigAttribFrameSizeToleranceSupport
frame size tolerance support it indicates the tolerance of frame size
Definition va.h:872
@ VAConfigAttribContextPriority
priority setting for the context. Read-Write attribute value is VAConfigAttribValContextPriority this...
Definition va.h:943
@ VAConfigAttribProtectedContentUsage
Special usage attribute of the protected session.
Definition va.h:989
@ VAConfigAttribEncQuantization
Encoding quantization attribute. Read-only.
Definition va.h:786
@ VAConfigAttribProtectedContentCipherSampleType
Decryption sample type of the protected content session.
Definition va.h:982
@ VAConfigAttribEncPerBlockControl
Settings per block attribute for Encoding. Read-only.
Definition va.h:1041
@ VAConfigAttribEncMaxTileRows
Maximum number of tile rows. Read-only.
Definition va.h:1048
@ VAConfigAttribTEETypeClient
TEE type client is a specific module supporting specific functions in TEE. Read-only.
Definition va.h:954
@ VAConfigAttribMaxFrameSize
encode max frame size attribute. Read-only attribute value VAConfigAttribValMaxFrameSize represent ma...
Definition va.h:922
@ VAConfigAttribDecJPEG
JPEG decoding attribute. Read-only.
Definition va.h:646
@ VAConfigAttribEncMaxSlices
Maximum number of slices per frame. Read-only.
Definition va.h:719
@ VAConfigAttribDecSliceMode
Slice Decoding mode. Read/write.
Definition va.h:638
@ VAConfigAttribCustomRoundingControl
whether accept rouding setting from application. Read-only. This attribute is for encode quality,...
Definition va.h:911
@ VAConfigAttribEncSkipFrame
Encoding skip frame attribute. Read-only.
Definition va.h:802
@ VAConfigAttribEncHEVCFeatures
HEVC/H.265 encoding features. Read-only.
Definition va.h:1000
@ VAConfigAttribEncAV1Ext2
AV1 encoding attribute extend2. Read-only.
Definition va.h:1034
@ VAConfigAttribEncQualityRange
Encoding quality range attribute. Read-only.
Definition va.h:779
@ VAConfigAttribEncDynamicScaling
Dynamic Scaling Attribute. Read-only.
Definition va.h:867
@ VAConfigAttribEncTileSupport
Tile Support Attribute. Read-only.
Definition va.h:905
@ VAConfigAttribEncROI
Encoding region-of-interest (ROI) attribute. Read-only.
Definition va.h:813
@ VAConfigAttribFEIMVPredictors
Maximum number of FEI MV predictors. Read-only.
Definition va.h:889
@ VAConfigAttribEncAV1
AV1 encoding attribute. Read-only.
Definition va.h:1018
@ VAConfigAttribEncSliceStructure
Slice structure. Read-only.
Definition va.h:736
@ VAConfigAttribStats
Statistics attribute. Read-only.
Definition va.h:897
@ VAConfigAttribEncMaxRefFrames
Maximum number of reference frames. Read-only.
Definition va.h:712
@ VAConfigAttribQPBlockSize
Encoding QP info block size attribute. Read-only. This attribute conveys the block sizes that underly...
Definition va.h:917
@ VAConfigAttribEncRateControlExt
Encoding extended rate control attribute. Read-only.
Definition va.h:821
@ VAConfigAttribEncHEVCBlockSizes
HEVC/H.265 encoding block sizes. Read-only.
Definition va.h:1010
@ VAConfigAttribMaxPictureWidth
Maximum picture width. Read-only.
Definition va.h:755
@ VAConfigAttribEncIntraRefresh
Encoding intra refresh attribute. Read-only.
Definition va.h:794
@ VAConfigAttribEncMaxTileCols
Maximum number of tile cols. Read-only.
Definition va.h:1055
@ VAConfigAttribDecProcessing
Decode processing support. Read/write.
Definition va.h:679
@ VAConfigAttribPredictionDirection
inter frame prediction directrion attribute. Read-only. this attribute conveys the prediction directi...
Definition va.h:934
@ VAConfigAttribTEEType
TEE could be any HW secure device. Read-only.
Definition va.h:952
@ VAConfigAttribFEIFunctionType
Encode function type for FEI.
Definition va.h:881
@ VAConfigAttribDecAV1Features
AV1 decoding features. Read-only.
Definition va.h:950
@ VAConfigAttribEncParallelRateControl
Parallel Rate Control (hierachical B) attribute. Read-only.
Definition va.h:858
@ VAConfigAttribEncJPEG
JPEG encoding attribute. Read-only.
Definition va.h:770
@ VAConfigAttribEncInterlaced
Interlaced mode. Read/write.
Definition va.h:701
@ VAConfigAttribProtectedContentCipherBlockSize
Cipher block size of the protected content session.
Definition va.h:968
@ VAConfigAttribMultipleFrame
combined submission of multiple frames from different streams, it is optimization for different HW im...
Definition va.h:938
@ VAConfigAttribEncAV1Ext1
AV1 encoding attribute extend1. Read-only.
Definition va.h:1026
@ VAConfigAttribEncPackedHeaders
Packed headers mode. Read/write.
Definition va.h:692
@ VAConfigAttribEncDirtyRect
Encoding dirty rectangle. Read-only.
Definition va.h:846
@ VAConfigAttribProtectedContentCipherAlgorithm
Cipher algorithm of the protected content session.
Definition va.h:961
@ VASurfaceAttribMaxWidth
Maximal width in pixels (int, read-only).
Definition va.h:1681
@ VASurfaceAttribUsageHint
Surface usage hint, gives the driver a hint of intended usage to optimize allocation (e....
Definition va.h:1697
@ VASurfaceAttribAlignmentSize
width and height log2 aligment in pixels (int, read-only)
Definition va.h:1713
@ VASurfaceAttribMemoryType
Surface memory type expressed in bit fields (int, read/write).
Definition va.h:1687
@ VASurfaceAttribMaxHeight
Maximal height in pixels (int, read-only).
Definition va.h:1685
@ VASurfaceAttribDRMFormatModifiers
List of possible DRM format modifiers (pointer, write).
Definition va.h:1704
@ VASurfaceAttribMinWidth
Minimal width in pixels (int, read-only).
Definition va.h:1679
@ VASurfaceAttribExternalBufferDescriptor
External buffer descriptor (pointer, write).
Definition va.h:1694
@ VASurfaceAttribPixelFormat
Pixel format as a FOURCC (int, read/write).
Definition va.h:1677
@ VASurfaceAttribCount
Number of surface attributes.
Definition va.h:1715
@ VASurfaceAttribMinHeight
Minimal height in pixels (int, read-only).
Definition va.h:1683
@ VAEntrypointFEI
VAEntrypointFEI.
Definition va.h:584
@ VAEntrypointProtectedTEEComm
VAEntrypointProtectedTEEComm.
Definition va.h:607
@ VAEntrypointVideoProc
Definition va.h:567
@ VAEntrypointStats
VAEntrypointStats.
Definition va.h:601
@ VAEntrypointProtectedContent
VAEntrypointProtectedContent.
Definition va.h:613
@ VAEncPackedHeaderPicture
Packed picture header.
Definition va.h:2400
@ VAEncPackedHeaderRawData
Packed raw header.
Definition va.h:2411
@ VAEncPackedHeaderSequence
Packed sequence header.
Definition va.h:2398
@ VAEncPackedHeaderSlice
Packed slice header.
Definition va.h:2402
@ VAProfileProtected
Profile ID used for protected video playback.
Definition va.h:541
@ VAProfileNone
Profile ID used for video processing.
Definition va.h:504
VA buffer information.
Definition va.h:4001
uint32_t mem_type
Buffer memory type (See VASurfaceAttribMemoryType).
Definition va.h:4014
uint32_t type
Buffer type (See VABufferType).
Definition va.h:4005
size_t mem_size
Size of the underlying buffer.
Definition va.h:4016
uintptr_t handle
Buffer handle.
Definition va.h:4003
Coded buffer segment.
Definition va.h:3917
uint32_t bit_offset
Bit offset into the data buffer where the video data starts.
Definition va.h:3923
uint32_t status
Status set by the driver. See VA_CODED_BUF_STATUS_*.
Definition va.h:3925
void * next
Pointer to the next VACodedBufferSegment element, or NULL if there is none.
Definition va.h:3934
uint32_t size
Size of the data buffer in this segment (in bytes).
Definition va.h:3921
void * buf
Pointer to the start of the data buffer.
Definition va.h:3929
uint32_t reserved
Reserved for future use.
Definition va.h:3927
Definition va.h:1066
update the context parameter this structure is used to update context parameters, such as priority of...
Definition va.h:2194
uint32_t context_priority_update
indicate whether context priority changed
Definition va.h:2198
VAConfigAttribValContextPriority context_priority
task/context priority
Definition va.h:2205
uint32_t reserved
Reserved bits for future use, must be zero.
Definition va.h:2200
Defines a maximum frame size (in bits).
Definition va.h:2730
va_deprecated VAEncMiscParameterType type
Type. Shall be set to VAEncMiscParameterTypeMaxFrameSize.
Definition va.h:2733
uint32_t max_frame_size
Maximum size of a frame (in bits).
Definition va.h:2735
Maximum frame size (in bytes) settings for multiple pass.
Definition va.h:2750
uint8_t * delta_qp
delta QP list for every pass
Definition va.h:2761
uint32_t reserved
Reserved bytes for future use, must be zero.
Definition va.h:2757
va_deprecated VAEncMiscParameterType type
Type. Shall be set to #VAEncMiscParameterTypeMultiPassMaxFrameSize.
Definition va.h:2753
uint8_t num_passes
number of passes, every pass has different QP, currently AVC encoder can support up to 4 passes
Definition va.h:2759
uint32_t max_frame_size
Maximum size of a frame (in byte)
Definition va.h:2755
Encoding quality level.
Definition va.h:2778
uint32_t quality_level
Encoding quality level setting. When set to 0, default quality level is used.
Definition va.h:2782
Definition va.h:2452
Custom Encoder Rounding Offset Control. Application may use this structure to set customized rounding...
Definition va.h:3017
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:3024
uint32_t rounding_offset_intra
Intra rounding offset Ignored if enable_custom_rouding_intra equals 0.
Definition va.h:3029
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:3035
uint32_t rounding_offset_inter
Inter rounding offset Ignored if enable_custom_rouding_inter equals 0.
Definition va.h:3040
Definition va.h:2943
uint32_t PanicModeDisable
Definition va.h:2991
uint32_t UltraHMEDisable
Definition va.h:2987
uint32_t HMEDisable
Definition va.h:2983
uint32_t FTQSkipThresholdLUTInput
Definition va.h:2960
uint32_t HMEMVCostScalingFactor
Definition va.h:2981
uint32_t SuperHMEDisable
Definition va.h:2985
uint32_t FTQOverride
Definition va.h:2955
uint32_t ForceRepartitionCheck
Definition va.h:2996
uint32_t directBiasAdjustmentEnable
Definition va.h:2967
uint32_t NonFTQSkipThresholdLUTInput
Definition va.h:2963
uint32_t useRawPicForRef
Definition va.h:2949
uint32_t FTQEnable
Definition va.h:2957
uint32_t skipCheckDisable
Definition va.h:2952
uint32_t globalMotionBiasAdjustmentEnable
Definition va.h:2974
Definition va.h:2594
uint32_t reserved
Definition va.h:2620
uint32_t temporal_id
Definition va.h:2618
uint32_t framerate
Definition va.h:2614
Definition va.h:2698
uint32_t buffer_size
Definition va.h:2715
uint32_t initial_buffer_fullness
Definition va.h:2709
Definition va.h:2634
Attribute value for VAConfigAttribEncParallelRateControl.
Definition va.h:2931
uint32_t num_layers
Definition va.h:2933
uint32_t * num_b_in_gop
Definition va.h:2938
Quantization settings for encoding.
Definition va.h:2794
Rate control parameters.
Definition va.h:2477
uint32_t bits_per_second
Definition va.h:2479
uint32_t basic_unit_size
Definition va.h:2507
uint32_t reserved
Definition va.h:2554
uint32_t frame_tolerance_mode
Definition va.h:2552
uint32_t mb_rate_control
Definition va.h:2527
uint32_t temporal_id
Definition va.h:2529
uint32_t disable_bit_stuffing
Definition va.h:2519
uint32_t cfs_I_frames
Definition va.h:2531
uint32_t ICQ_quality_factor
Definition va.h:2563
uint32_t max_qp
Definition va.h:2569
uint32_t window_size
Definition va.h:2491
uint32_t enable_parallel_brc
Definition va.h:2536
uint32_t disable_frame_skip
Definition va.h:2517
uint32_t reset
Definition va.h:2515
uint32_t target_frame_size
Definition va.h:2583
uint32_t initial_qp
Definition va.h:2496
uint32_t min_qp
Definition va.h:2502
uint32_t target_percentage
Definition va.h:2485
uint32_t quality_factor
Definition va.h:2574
Encoding skip frame.
Definition va.h:2822
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:2834
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:2829
uint8_t num_skip_frames
The number of frames skipped prior to the current frame. Valid when skip_frame_flag = 1.
Definition va.h:2831
Temporal layer Structure.
Definition va.h:2458
uint32_t periodicity
The length of the array defining frame layer membership. Should be 1-32.
Definition va.h:2462
uint32_t number_of_layers
The number of temporal layers.
Definition va.h:2460
Packed header parameter.
Definition va.h:2423
uint8_t has_emulation_bytes
Flag: buffer contains start code emulation prevention bytes?
Definition va.h:2429
uint32_t type
Definition va.h:2425
uint32_t bit_length
Size of the #VAEncPackedHeaderDataBuffer in bits.
Definition va.h:2427
Encoding region-of-interest (ROI).
Definition va.h:2849
int8_t roi_value
ROI value.
Definition va.h:2872
VARectangle roi_rectangle
Defines the ROI boundary in pixels, the driver will map it to appropriate codec coding units....
Definition va.h:2853
Encode Slice Parameter Buffer.
Definition va.h:3711
Encryption parameters buffer for VAEncryptionParameterBufferType.
Definition va.h:2248
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:2273
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:2289
uint32_t num_segments
The number of sengments.
Definition va.h:2254
uint32_t size_of_length
CENC counter length.
Definition va.h:2262
VAEncryptionSegmentInfo * segment_info
Pointer of segments.
Definition va.h:2256
uint32_t status_report_index
The status report index reserved for CENC fullsample workload. The related structures and definitions...
Definition va.h:2260
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:2282
uint32_t encryption_type
Encryption type, refer to VA_ENCRYPTION_TYPE_FULLSAMPLE_CTR, VA_ENCRYPTION_TYPE_FULLSAMPLE_CBC,...
Definition va.h:2252
structure for encrypted segment info.
Definition va.h:2228
uint32_t segment_length
The length of the segments in bytes.
Definition va.h:2233
uint32_t partial_aes_block_size
The length in bytes of the remainder of an incomplete block from a previous segment.
Definition va.h:2236
uint32_t init_byte_length
The length in bytes of the initial clear data.
Definition va.h:2238
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:2231
Generic value.
Definition va.h:1639
float f
32-bit float.
Definition va.h:1647
VAGenericFunc fn
Pointer to function.
Definition va.h:1651
int32_t i
32-bit signed integer.
Definition va.h:1645
void * p
Generic pointer.
Definition va.h:1649
VAGenericValueType type
Value type. See VAGenericValueType.
Definition va.h:1641
Huffman table for JPEG decoding.
Definition va.h:3084
Definition va.h:3625
Definition va.h:3152
int32_t load_intra_quantiser_matrix
Same as the MPEG-2 bitstream syntax element.
Definition va.h:3154
int32_t load_chroma_intra_quantiser_matrix
Same as the MPEG-2 bitstream syntax element.
Definition va.h:3158
int32_t load_chroma_non_intra_quantiser_matrix
Same as the MPEG-2 bitstream syntax element.
Definition va.h:3160
int32_t load_non_intra_quantiser_matrix
Same as the MPEG-2 bitstream syntax element.
Definition va.h:3156
Definition va.h:3304
int32_t load_intra_quant_mat
Definition va.h:3306
int32_t load_non_intra_quant_mat
Definition va.h:3308
Generic motion vector data structure.
Definition va.h:414
Description of picture properties of those in DPB surfaces.
Definition va.h:5264
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:5273
VASurfaceID picture_id
reconstructed picture buffer surface index invalid when taking value VA_INVALID_SURFACE.
Definition va.h:5268
Definition va.h:3571
Definition va.h:3253
Definition va.h:3357
Description of picture properties of those in DPB surfaces.
Definition va.h:5330
int32_t pic_order_cnt
picture order count.
Definition va.h:5337
VASurfaceID picture_id
reconstructed picture buffer surface index invalid when taking value VA_INVALID_SURFACE.
Definition va.h:5334
Definition va.h:2314
uint8_t level_idc
Profile level.
Definition va.h:2316
Definition va.h:2297
uint32_t intra_period
Period between I frames.
Definition va.h:2306
uint8_t level_idc
Profile level.
Definition va.h:2299
uint32_t ip_period
Period between I/P frames.
Definition va.h:2308
uint32_t quality_level
quality level. When set to 0, default quality level is used.
Definition va.h:2304
Structure to describe rectangle.
Definition va.h:406
Definition va.h:3636
uint8_t num_ref_idx_l0_active_minus1
Definition va.h:3661
uint8_t num_ref_idx_l1_active_minus1
Definition va.h:3668
uint32_t slice_data_offset
Byte offset to the NAL Header Unit for this slice.
Definition va.h:3639
uint16_t slice_data_bit_offset
Bit offset from NAL Header Unit to the begining of slice_data().
Definition va.h:3651
Definition va.h:3175
Definition va.h:3319
Definition va.h:3529
VASurfaceAttribExternalBuffers structure for the VASurfaceAttribExternalBufferDescriptor attribute.
Definition va.h:1761
uint32_t num_planes
number of planes for planar layout
Definition va.h:1771
uint32_t data_size
total size of the buffer in bytes.
Definition va.h:1769
uint32_t height
height in pixels.
Definition va.h:1767
uint32_t width
width in pixels.
Definition va.h:1765
uint32_t pixel_format
pixel format in fourcc.
Definition va.h:1763
uint32_t flags
flags. See "Surface external buffer descriptor flags".
Definition va.h:1781
uint32_t num_buffers
number of elements in the "buffers" array
Definition va.h:1779
uintptr_t * buffers
buffer handles or user pointers
Definition va.h:1777
void * private_data
reserved for passing private data
Definition va.h:1783
Surface attribute.
Definition va.h:1719
VAGenericValue value
Value. See "Surface attribute types" for the expected types.
Definition va.h:1725
VASurfaceAttribType type
Type.
Definition va.h:1721
uint32_t flags
Flags. See "Surface attribute flags".
Definition va.h:1723
Definition va.h:4310
uint32_t reserved
reserved bits for future, must be zero
Definition va.h:1433
uint32_t priority
the priority , for the Query operation (read) it represents highest priority for the set operation (w...
Definition va.h:1431
Attribute value for VAConfigAttribEncJPEG.
Definition va.h:1274
uint32_t non_interleaved_mode
set to 1 for non-interleaved.
Definition va.h:1281
uint32_t differential_mode
set to 1 for differential.
Definition va.h:1283
uint32_t progressive_dct_mode
set to 1 for progressive dct.
Definition va.h:1279
uint32_t arithmatic_coding_mode
set to 1 for arithmatic coding.
Definition va.h:1277
uint32_t reserved
reserved bit for future, must be zero
Definition va.h:1448
uint32_t delta_qp_size_in_bytes
size of delta qp per block in bytes
Definition va.h:1446
uint32_t log2_delta_qp_block_size
supported size of delta qp block
Definition va.h:1444
uint32_t delta_qp_support
whether to support dela qp per block
Definition va.h:1442
Attribute value for VAConfigAttribEncROI.
Definition va.h:1337
uint32_t roi_rc_priority_support
A flag indicates whether ROI priority is supported.
Definition va.h:1352
uint32_t roi_rc_qp_delta_support
A flag indicates whether ROI delta QP is supported.
Definition va.h:1364
uint32_t num_roi_regions
The number of ROI regions supported, 0 if ROI is not supported.
Definition va.h:1340
Attribute value for VAConfigAttribEncRateControlExt.
Definition va.h:1371
uint32_t temporal_layer_bitrate_control_flag
Definition va.h:1405
uint32_t max_num_temporal_layers_minus1
The maximum number of temporal layers minus 1.
Definition va.h:1380
Attribute value for VAConfigAttribMaxFrameSize.
Definition va.h:1257
uint32_t max_frame_size
support max frame size if max_frame_size == 1, VAEncMiscParameterTypeMaxFrameSize/VAEncMiscParameterB...
Definition va.h:1264
uint32_t reserved
reserved bits for future, must be zero
Definition va.h:1268
uint32_t multiple_pass
multiple_pass support
Definition va.h:1266
Attribute value for VAConfigAttribMultipleFrame.
Definition va.h:1412
uint32_t reserved
reserved bit for future, must be zero
Definition va.h:1421
uint32_t max_num_concurrent_frames
max num of concurrent frames from different stream
Definition va.h:1415
uint32_t mixed_quality_level
indicate whether all stream must support same quality level if mixed_quality_level == 0,...
Definition va.h:1419
sub device info Sub-device is the concept basing on the "device" behind "vaDisplay"....
Definition va.h:5078
uint32_t sub_device_count
sub devices count, read - only
Definition va.h:5083
uint32_t reserved
reserved bits for future, must be zero
Definition va.h:5085
uint32_t sub_device_mask
bit mask to indicate which sub_device is available, read only
Definition va.h:5101
uint32_t current_sub_device
current sub device index, read - write
Definition va.h:5081
VASurfaceAttribAlignmentStruct structure for the VASurfaceAttribAlignmentSize attribute.
Definition va.h:1746
uint32_t log2_height_alignment
log2 height aligment
Definition va.h:1751
uint32_t log2_width_alignment
log2 width aligment
Definition va.h:1749
VAStatus vaGetDisplayAttributes(VADisplay dpy, VADisplayAttribute *attr_list, int num_attributes)
VADisplayAttribType
Definition va.h:5107
VAStatus vaCopy(VADisplay dpy, VACopyObject *dst, VACopyObject *src, VACopyOption option)
Copies an object.
VAStatus vaSetDisplayAttributes(VADisplay dpy, VADisplayAttribute *attr_list, int num_attributes)
VAStatus vaQueryDisplayAttributes(VADisplay dpy, VADisplayAttribute *attr_list, int *num_attributes)
#define va_deprecated_enum
Misc packed header. See codec-specific definitions.
Definition va.h:98
int vaMaxNumDisplayAttributes(VADisplay dpy)
The AV1 decoding API.
The HEVC decoding API.
The JPEG decoding API.
VP8 decoding API.
The VP9 decoding API.
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.