VA-API 2.24.1
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
77
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
225
231
259
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 VAProfileAV1Profile2 = 39,
546 VAProfileH264High422 = 40
547} VAProfile;
548
552typedef enum {
553 VAEntrypointVLD = 1,
554 VAEntrypointIZZ = 2,
555 VAEntrypointIDCT = 3,
556 VAEntrypointMoComp = 4,
557 VAEntrypointDeblocking = 5,
558 VAEntrypointEncSlice = 6, /* slice level encode */
559 VAEntrypointEncPicture = 7, /* pictuer encode, JPEG, etc */
560 /*
561 * For an implementation that supports a low power/high performance variant
562 * for slice level encode, it can choose to expose the
563 * VAEntrypointEncSliceLP entrypoint. Certain encoding tools may not be
564 * available with this entrypoint (e.g. interlace, MBAFF) and the
565 * application can query the encoding configuration attributes to find
566 * out more details if this entrypoint is supported.
567 */
568 VAEntrypointEncSliceLP = 8,
617
619typedef enum {
620 VAConfigAttribRTFormat = 0,
621 VAConfigAttribSpatialResidual = 1,
622 VAConfigAttribSpatialClipping = 2,
623 VAConfigAttribIntraResidual = 3,
624 VAConfigAttribEncryption = 4,
625 VAConfigAttribRateControl = 5,
626
992
1067 VAConfigAttribTypeMax
1069
1076typedef struct _VAConfigAttrib {
1077 VAConfigAttribType type;
1078 uint32_t value; /* OR'd flags (bits) for this attribute */
1080
1081/* Attribute values for VAConfigAttribRTFormat. */
1082
1083#define VA_RT_FORMAT_YUV420 0x00000001
1084#define VA_RT_FORMAT_YUV422 0x00000002
1085#define VA_RT_FORMAT_YUV444 0x00000004
1086#define VA_RT_FORMAT_YUV411 0x00000008
1087#define VA_RT_FORMAT_YUV400 0x00000010
1088#define VA_RT_FORMAT_YUV420_10 0x00000100
1089#define VA_RT_FORMAT_YUV422_10 0x00000200
1090#define VA_RT_FORMAT_YUV444_10 0x00000400
1091#define VA_RT_FORMAT_YUV420_12 0x00001000
1092#define VA_RT_FORMAT_YUV422_12 0x00002000
1093#define VA_RT_FORMAT_YUV444_12 0x00004000
1094
1095#define VA_RT_FORMAT_RGB16 0x00010000
1096#define VA_RT_FORMAT_RGB32 0x00020000
1097#define VA_RT_FORMAT_RGBP 0x00100000
1098#define VA_RT_FORMAT_RGB32_10 0x00200000
1099
1100#define VA_RT_FORMAT_PROTECTED 0x80000000
1101
1102#define VA_RT_FORMAT_RGB32_10BPP VA_RT_FORMAT_RGB32_10
1103#define VA_RT_FORMAT_YUV420_10BPP VA_RT_FORMAT_YUV420_10
1104
1108#define VA_RC_NONE 0x00000001
1110#define VA_RC_CBR 0x00000002
1112#define VA_RC_VBR 0x00000004
1114#define VA_RC_VCM 0x00000008
1116#define VA_RC_CQP 0x00000010
1118#define VA_RC_VBR_CONSTRAINED 0x00000020
1121#define VA_RC_ICQ 0x00000040
1124#define VA_RC_MB 0x00000080
1126#define VA_RC_CFS 0x00000100
1137#define VA_RC_PARALLEL 0x00000200
1144#define VA_RC_QVBR 0x00000400
1155#define VA_RC_AVBR 0x00000800
1164#define VA_RC_TCBRC 0x00001000
1165
1167
1171#define VA_DEC_SLICE_MODE_NORMAL 0x00000001
1173#define VA_DEC_SLICE_MODE_BASE 0x00000002
1174
1177typedef union _VAConfigAttribValDecJPEG {
1178 struct {
1180 uint32_t rotation : 4;
1182 uint32_t crop : 1;
1184 uint32_t reserved : 27;
1185 } bits;
1186 uint32_t value;
1187} VAConfigAttribValDecJPEG;
1191#define VA_DEC_PROCESSING_NONE 0x00000000
1193#define VA_DEC_PROCESSING 0x00000001
1195
1199#define VA_ENC_PACKED_HEADER_NONE 0x00000000
1206#define VA_ENC_PACKED_HEADER_SEQUENCE 0x00000001
1213#define VA_ENC_PACKED_HEADER_PICTURE 0x00000002
1220#define VA_ENC_PACKED_HEADER_SLICE 0x00000004
1229#define VA_ENC_PACKED_HEADER_MISC 0x00000008
1231#define VA_ENC_PACKED_HEADER_RAW_DATA 0x00000010
1233
1237#define VA_ENC_INTERLACED_NONE 0x00000000
1239#define VA_ENC_INTERLACED_FRAME 0x00000001
1241#define VA_ENC_INTERLACED_FIELD 0x00000002
1243#define VA_ENC_INTERLACED_MBAFF 0x00000004
1245#define VA_ENC_INTERLACED_PAFF 0x00000008
1247
1251#define VA_ENC_SLICE_STRUCTURE_POWER_OF_TWO_ROWS 0x00000001
1253#define VA_ENC_SLICE_STRUCTURE_ARBITRARY_MACROBLOCKS 0x00000002
1255#define VA_ENC_SLICE_STRUCTURE_EQUAL_ROWS 0x00000004
1257#define VA_ENC_SLICE_STRUCTURE_MAX_SLICE_SIZE 0x00000008
1259#define VA_ENC_SLICE_STRUCTURE_ARBITRARY_ROWS 0x00000010
1263#define VA_ENC_SLICE_STRUCTURE_EQUAL_MULTI_ROWS 0x00000020
1265
1267typedef union _VAConfigAttribValMaxFrameSize {
1268 struct {
1274 uint32_t max_frame_size : 1;
1276 uint32_t multiple_pass : 1;
1278 uint32_t reserved : 30;
1279 } bits;
1280 uint32_t value;
1282
1284typedef union _VAConfigAttribValEncJPEG {
1285 struct {
1293 uint32_t differential_mode : 1;
1294 uint32_t max_num_components : 3;
1295 uint32_t max_num_scans : 4;
1296 uint32_t max_num_huffman_tables : 3;
1297 uint32_t max_num_quantization_tables : 3;
1298 } bits;
1299 uint32_t value;
1301
1305#define VA_ENC_QUANTIZATION_NONE 0x00000000
1307#define VA_ENC_QUANTIZATION_TRELLIS_SUPPORTED 0x00000001
1309
1318#define VA_PREDICTION_DIRECTION_PREVIOUS 0x00000001
1320#define VA_PREDICTION_DIRECTION_FUTURE 0x00000002
1322#define VA_PREDICTION_DIRECTION_BI_NOT_EMPTY 0x00000004
1324
1328#define VA_ENC_INTRA_REFRESH_NONE 0x00000000
1330#define VA_ENC_INTRA_REFRESH_ROLLING_COLUMN 0x00000001
1332#define VA_ENC_INTRA_REFRESH_ROLLING_ROW 0x00000002
1334#define VA_ENC_INTRA_REFRESH_ADAPTIVE 0x00000010
1336#define VA_ENC_INTRA_REFRESH_CYCLIC 0x00000020
1338#define VA_ENC_INTRA_REFRESH_P_FRAME 0x00010000
1340#define VA_ENC_INTRA_REFRESH_B_FRAME 0x00020000
1342#define VA_ENC_INTRA_REFRESH_MULTI_REF 0x00040000
1343
1345
1347typedef union _VAConfigAttribValEncROI {
1348 struct {
1350 uint32_t num_roi_regions : 8;
1375 uint32_t reserved : 22;
1376 } bits;
1377 uint32_t value;
1379
1381typedef union _VAConfigAttribValEncRateControlExt {
1382 struct {
1391
1416 uint32_t reserved : 23;
1417 } bits;
1418 uint32_t value;
1420
1422typedef union _VAConfigAttribValMultipleFrame {
1423 struct {
1431 uint32_t reserved : 23;
1432 } bits;
1433 uint32_t value;
1435
1437typedef union _VAConfigAttribValContextPriority {
1438 struct {
1441 uint32_t priority : 16;
1443 uint32_t reserved : 16;
1444 } bits;
1445 uint32_t value;
1447
1449typedef union _VAConfigAttribValEncPerBlockControl {
1450 struct {
1452 uint32_t delta_qp_support : 1;
1458 uint32_t reserved : 24;
1459 } bits;
1460 uint32_t value;
1462
1465#define VA_PC_CIPHER_AES 0x00000001
1466
1469#define VA_PC_BLOCK_SIZE_128 0x00000001
1471#define VA_PC_BLOCK_SIZE_192 0x00000002
1473#define VA_PC_BLOCK_SIZE_256 0x00000004
1474
1477#define VA_PC_CIPHER_MODE_ECB 0x00000001
1479#define VA_PC_CIPHER_MODE_CBC 0x00000002
1481#define VA_PC_CIPHER_MODE_CTR 0x00000004
1482
1485#define VA_PC_SAMPLE_TYPE_FULLSAMPLE 0x00000001
1487#define VA_PC_SAMPLE_TYPE_SUBSAMPLE 0x00000002
1488
1491#define VA_PC_USAGE_DEFAULT 0x00000000
1493#define VA_PC_USAGE_WIDEVINE 0x00000001
1494
1498#define VA_PROCESSING_RATE_NONE 0x00000000
1500#define VA_PROCESSING_RATE_ENCODE 0x00000001
1502#define VA_PROCESSING_RATE_DECODE 0x00000002
1504
1508#define VA_SEGID_BLOCK_16X16 0
1510#define VA_SEGID_BLOCK_32X32 1
1512#define VA_SEGID_BLOCK_64X64 2
1514#define VA_SEGID_BLOCK_8X8 3
1516
1521#define VA_ATTRIB_NOT_SUPPORTED 0x80000000
1522
1525 VADisplay dpy
1526);
1527
1530 VADisplay dpy
1531);
1532
1535 VADisplay dpy
1536);
1537
1545 VADisplay dpy,
1546 VAProfile *profile_list, /* out */
1547 int *num_profiles /* out */
1548);
1549
1557 VADisplay dpy,
1558 VAProfile profile,
1559 VAEntrypoint *entrypoint_list, /* out */
1560 int *num_entrypoints /* out */
1561);
1562
1572 VADisplay dpy,
1573 VAProfile profile,
1574 VAEntrypoint entrypoint,
1575 VAConfigAttrib *attrib_list, /* in/out */
1576 int num_attribs
1577);
1578
1580typedef unsigned int VAGenericID;
1581
1582typedef VAGenericID VAConfigID;
1583
1590 VADisplay dpy,
1591 VAProfile profile,
1592 VAEntrypoint entrypoint,
1593 VAConfigAttrib *attrib_list,
1594 int num_attribs,
1595 VAConfigID *config_id /* out */
1596);
1597
1602 VADisplay dpy,
1603 VAConfigID config_id
1604);
1605
1615 VADisplay dpy,
1616 VAConfigID config_id,
1617 VAProfile *profile, /* out */
1618 VAEntrypoint *entrypoint, /* out */
1619 VAConfigAttrib *attrib_list,/* out */
1620 int *num_attribs /* out */
1621);
1622
1623
1642
1644
1645typedef VAGenericID VASurfaceID;
1646
1647#define VA_INVALID_ID 0xffffffff
1648#define VA_INVALID_SURFACE VA_INVALID_ID
1649
1657
1659typedef void (*VAGenericFunc)(void);
1660
1662typedef struct _VAGenericValue {
1666 union {
1668 int32_t i;
1670 float f;
1672 void *p;
1675 } value;
1677
1681#define VA_SURFACE_ATTRIB_NOT_SUPPORTED 0x00000000
1683#define VA_SURFACE_ATTRIB_GETTABLE 0x00000001
1685#define VA_SURFACE_ATTRIB_SETTABLE 0x00000002
1687
1740
1742typedef struct _VASurfaceAttrib {
1746 uint32_t flags;
1750
1759#define VA_SURFACE_ATTRIB_MEM_TYPE_VA 0x00000001
1761#define VA_SURFACE_ATTRIB_MEM_TYPE_V4L2 0x00000002
1763#define VA_SURFACE_ATTRIB_MEM_TYPE_USER_PTR 0x00000004
1769typedef union _VASurfaceAttribAlignmentStruct {
1770 struct {
1775 uint32_t reserved : 24;
1776 } bits;
1777 uint32_t value;
1779
1784typedef struct _VASurfaceAttribExternalBuffers {
1788 uint32_t width;
1790 uint32_t height;
1792 uint32_t data_size;
1794 uint32_t num_planes;
1796 uint32_t pitches[4];
1798 uint32_t offsets[4];
1800 uintptr_t *buffers;
1802 uint32_t num_buffers;
1804 uint32_t flags;
1808
1812#define VA_SURFACE_EXTBUF_DESC_ENABLE_TILING 0x00000001
1814#define VA_SURFACE_EXTBUF_DESC_CACHED 0x00000002
1816#define VA_SURFACE_EXTBUF_DESC_UNCACHED 0x00000004
1818#define VA_SURFACE_EXTBUF_DESC_WC 0x00000008
1820#define VA_SURFACE_EXTBUF_DESC_PROTECTED 0x80000000
1821
1825#define VA_SURFACE_ATTRIB_USAGE_HINT_GENERIC 0x00000000
1827#define VA_SURFACE_ATTRIB_USAGE_HINT_DECODER 0x00000001
1829#define VA_SURFACE_ATTRIB_USAGE_HINT_ENCODER 0x00000002
1831#define VA_SURFACE_ATTRIB_USAGE_HINT_VPP_READ 0x00000004
1833#define VA_SURFACE_ATTRIB_USAGE_HINT_VPP_WRITE 0x00000008
1835#define VA_SURFACE_ATTRIB_USAGE_HINT_DISPLAY 0x00000010
1838#define VA_SURFACE_ATTRIB_USAGE_HINT_EXPORT 0x00000020
1839
1841
1869VAStatus
1871 VADisplay dpy,
1872 VAConfigID config,
1873 VASurfaceAttrib *attrib_list,
1874 unsigned int *num_attribs
1875);
1876
1894VAStatus
1896 VADisplay dpy,
1897 unsigned int format,
1898 unsigned int width,
1899 unsigned int height,
1900 VASurfaceID *surfaces,
1901 unsigned int num_surfaces,
1902 VASurfaceAttrib *attrib_list,
1903 unsigned int num_attribs
1904);
1905
1915 VADisplay dpy,
1916 VASurfaceID *surfaces,
1917 int num_surfaces
1918);
1919
1920#define VA_PROGRESSIVE 0x1
1934 VADisplay dpy,
1935 VAConfigID config_id,
1936 int picture_width,
1937 int picture_height,
1938 int flag,
1939 VASurfaceID *render_targets,
1940 int num_render_targets,
1941 VAContextID *context /* out */
1942);
1943
1950 VADisplay dpy,
1951 VAContextID context
1952);
1953
1954//Multi-frame context
1955typedef VAGenericID VAMFContextID;
1973 VADisplay dpy,
1974 VAMFContextID *mf_context /* out */
1975);
1976
2011 VADisplay dpy,
2012 VAMFContextID mf_context,
2013 VAContextID context
2014);
2015
2029 VADisplay dpy,
2030 VAMFContextID mf_context,
2031 VAContextID context
2032);
2033
2041
2043
2044typedef enum {
2045 VAPictureParameterBufferType = 0,
2046 VAIQMatrixBufferType = 1,
2047 VABitPlaneBufferType = 2,
2048 VASliceGroupMapBufferType = 3,
2049 VASliceParameterBufferType = 4,
2050 VASliceDataBufferType = 5,
2051 VAMacroblockParameterBufferType = 6,
2052 VAResidualDataBufferType = 7,
2053 VADeblockingParameterBufferType = 8,
2054 VAImageBufferType = 9,
2055 VAProtectedSliceDataBufferType = 10,
2056 VAQMatrixBufferType = 11,
2057 VAHuffmanTableBufferType = 12,
2058 VAProbabilityBufferType = 13,
2059
2060 /* Following are encode buffer types */
2061 VAEncCodedBufferType = 21,
2062 VAEncSequenceParameterBufferType = 22,
2063 VAEncPictureParameterBufferType = 23,
2064 VAEncSliceParameterBufferType = 24,
2065 VAEncPackedHeaderParameterBufferType = 25,
2066 VAEncPackedHeaderDataBufferType = 26,
2067 VAEncMiscParameterBufferType = 27,
2068 VAEncMacroblockParameterBufferType = 28,
2069 VAEncMacroblockMapBufferType = 29,
2070
2079 /* Following are video processing buffer types */
2104 VAEncFEIMBCodeBufferType = 44,
2105 VAEncFEIDistortionBufferType = 45,
2106 VAEncFEIMBControlBufferType = 46,
2107 VAEncFEIMVPredictorBufferType = 47,
2108 VAStatsStatisticsParameterBufferType = 48,
2113 VAStatsMVBufferType = 51,
2114 VAStatsMVPredictorBufferType = 52,
2135
2160
2166
2177
2208
2209 VABufferTypeMax
2210} VABufferType;
2211
2217typedef struct _VAContextParameterUpdateBuffer {
2218 union {
2219 struct {
2223 uint32_t reserved : 31;
2224 } bits;
2225 uint32_t value;
2226 } flags;
2230 uint32_t reserved[VA_PADDING_MEDIUM];
2232
2245#define VA_ENCRYPTION_TYPE_FULLSAMPLE_CTR 0x00000001 /* AES CTR fullsample */
2246#define VA_ENCRYPTION_TYPE_FULLSAMPLE_CBC 0x00000002 /* AES CBC fullsample */
2247#define VA_ENCRYPTION_TYPE_SUBSAMPLE_CTR 0x00000004 /* AES CTR fullsample */
2248#define VA_ENCRYPTION_TYPE_SUBSAMPLE_CBC 0x00000008 /* AES CBC fullsample */
2249
2251typedef struct _VAEncryptionSegmentInfo {
2267 uint32_t va_reserved[VA_PADDING_MEDIUM];
2269
2316
2320typedef struct _VAProcessingRateParameterEnc {
2322 uint8_t level_idc;
2323 uint8_t reserved[3];
2331 uint32_t ip_period;
2333
2337typedef struct _VAProcessingRateParameterDec {
2339 uint8_t level_idc;
2340 uint8_t reserved0[3];
2341 uint32_t reserved;
2343
2344typedef struct _VAProcessingRateParameter {
2345 union {
2346 VAProcessingRateParameterEnc proc_buf_enc;
2347 VAProcessingRateParameterDec proc_buf_dec;
2348 };
2349} VAProcessingRateParameter;
2350
2371VAStatus
2373 VADisplay dpy,
2374 VAConfigID config,
2375 VAProcessingRateParameter *proc_buf,
2376 unsigned int *processing_rate
2377);
2378
2417
2444
2446typedef struct _VAEncPackedHeaderParameterBuffer {
2448 uint32_t type;
2450 uint32_t bit_length;
2453
2457
2475typedef struct _VAEncMiscParameterBuffer {
2477 uint32_t data[];
2479
2481typedef struct _VAEncMiscParameterTemporalLayerStructure {
2485 uint32_t periodicity;
2492 uint32_t layer_id[32];
2493
2497
2498
2500typedef struct _VAEncMiscParameterRateControl {
2514 uint32_t window_size;
2519 uint32_t initial_qp;
2525 uint32_t min_qp;
2531 union {
2532 struct {
2538 uint32_t reset : 1;
2550 uint32_t mb_rate_control : 4;
2552 uint32_t temporal_id : 8;
2554 uint32_t cfs_I_frames : 1;
2560 uint32_t enable_dynamic_scaling : 1;
2577 uint32_t reserved : 12;
2578 } bits;
2579 uint32_t value;
2580 } rc_flags;
2592 uint32_t max_qp;
2610
2617typedef struct _VAEncMiscParameterFrameRate {
2637 uint32_t framerate;
2638 union {
2639 struct {
2641 uint32_t temporal_id : 8;
2643 uint32_t reserved : 24;
2644 } bits;
2645 uint32_t value;
2646 } framerate_flags;
2647
2651
2657typedef struct _VAEncMiscParameterMaxSliceSize {
2658 uint32_t max_slice_size;
2659
2663
2664typedef struct _VAEncMiscParameterAIR {
2665 uint32_t air_num_mbs;
2666 uint32_t air_threshold;
2667 uint32_t air_auto; /* if set to 1 then hardware auto-tune the AIR threshold */
2668
2670 uint32_t va_reserved[VA_PADDING_LOW];
2671} VAEncMiscParameterAIR;
2672
2673/*
2674 * \brief Rolling intra refresh data structure for encoding.
2675 */
2676typedef struct _VAEncMiscParameterRIR {
2677 union {
2678 struct
2685 {
2686 /* \brief enable RIR in column */
2687 uint32_t enable_rir_column : 1;
2688 /* \brief enable RIR in row */
2689 uint32_t enable_rir_row : 1;
2690 uint32_t reserved : 30;
2691 } bits;
2692 uint32_t value;
2693 } rir_flags;
2698 uint16_t intra_insertion_location;
2703 uint16_t intra_insert_size;
2708 uint8_t qp_delta_for_inserted_intra;
2710 uint32_t va_reserved[VA_PADDING_LOW];
2711} VAEncMiscParameterRIR;
2712
2721typedef struct _VAEncMiscParameterHRD {
2738 uint32_t buffer_size;
2739
2743
2753typedef struct _VAEncMiscParameterBufferMaxFrameSize {
2759
2763
2773typedef struct _VAEncMiscParameterBufferMultiPassFrameSize {
2780 uint32_t reserved;
2782 uint8_t num_passes;
2784 uint8_t *delta_qp;
2785
2789
2801typedef struct _VAEncMiscParameterBufferQualityLevel {
2806
2810
2817typedef struct _VAEncMiscParameterQuantization {
2818 union {
2819 /* if no flags is set then quantization is determined by the driver */
2820 struct {
2821 /* \brief disable trellis for all frames/fields */
2822 uint32_t disable_trellis : 1;
2823 /* \brief enable trellis for I frames/fields */
2824 uint32_t enable_trellis_I : 1;
2825 /* \brief enable trellis for P frames/fields */
2826 uint32_t enable_trellis_P : 1;
2827 /* \brief enable trellis for B frames/fields */
2828 uint32_t enable_trellis_B : 1;
2829 uint32_t reserved : 28;
2830 } bits;
2831 uint32_t value;
2832 } quantization_flags;
2833 uint32_t va_reserved;
2835
2845typedef struct _VAEncMiscParameterSkipFrame {
2858
2862
2872typedef struct _VAEncROI {
2896} VAEncROI;
2897
2898typedef struct _VAEncMiscParameterBufferROI {
2900 uint32_t num_roi;
2901
2905 int8_t max_delta_qp;
2906 int8_t min_delta_qp;
2907
2910 VAEncROI *roi;
2911 union {
2912 struct {
2925 uint32_t roi_value_is_qp_delta : 1;
2926 uint32_t reserved : 31;
2927 } bits;
2928 uint32_t value;
2929 } roi_flags;
2930
2932 uint32_t va_reserved[VA_PADDING_LOW];
2933} VAEncMiscParameterBufferROI;
2934/*
2935 * \brief Dirty rectangle data structure for encoding.
2936 *
2937 * The encoding dirty rect can be set through VAEncMiscParameterBufferDirtyRect, if the
2938 * implementation supports dirty rect input. The rect set through this structure is applicable
2939 * only to the current frame or field, so must be sent every frame or field to be applied.
2940 * The number of supported rects can be queried through the VAConfigAttribEncDirtyRect. The
2941 * encoder will use the rect information to know those rectangle areas have changed while the
2942 * areas not covered by dirty rect rectangles are assumed to have not changed compared to the
2943 * previous picture. The encoder may do some internal optimizations.
2944 */
2945typedef struct _VAEncMiscParameterBufferDirtyRect {
2947 uint32_t num_roi_rectangle;
2948
2950 VARectangle *roi_rectangle;
2951} VAEncMiscParameterBufferDirtyRect;
2952
2954typedef struct _VAEncMiscParameterParallelRateControl {
2956 uint32_t num_layers;
2961 uint32_t *num_b_in_gop;
2963
2966typedef struct _VAEncMiscParameterEncQuality {
2967 union {
2968 struct {
2972 uint32_t useRawPicForRef : 1;
2975 uint32_t skipCheckDisable : 1;
2978 uint32_t FTQOverride : 1;
2980 uint32_t FTQEnable : 1;
2987 uint32_t ReservedBit : 1;
3006 uint32_t HMEDisable : 1;
3008 uint32_t SuperHMEDisable : 1;
3010 uint32_t UltraHMEDisable : 1;
3014 uint32_t PanicModeDisable : 1;
3020
3021 };
3022 uint32_t encControls;
3023 };
3024
3029
3030 uint32_t reserved[VA_PADDING_HIGH]; // Reserved for future use.
3031
3033
3040typedef struct _VAEncMiscParameterCustomRoundingControl {
3041 union {
3042 struct {
3048
3053
3059
3064
3065 /* Reserved */
3066 uint32_t reserved : 16;
3067 } bits;
3068 uint32_t value;
3069 } rounding_offset_setting;
3071
3080#define VA_SLICE_DATA_FLAG_ALL 0x00 /* whole slice is in the buffer */
3081#define VA_SLICE_DATA_FLAG_BEGIN 0x01 /* The beginning of the slice is in the buffer but the end if not */
3082#define VA_SLICE_DATA_FLAG_MIDDLE 0x02 /* Neither beginning nor end of the slice is in the buffer */
3083#define VA_SLICE_DATA_FLAG_END 0x04 /* end of the slice is in the buffer */
3084
3085/* Codec-independent Slice Parameter Buffer base */
3086typedef struct _VASliceParameterBufferBase {
3087 uint32_t slice_data_size; /* number of bytes in the slice data buffer for this slice */
3088 uint32_t slice_data_offset; /* the offset to the first byte of slice data */
3089 uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX definitions */
3090} VASliceParameterBufferBase;
3091
3092/**********************************
3093 * JPEG common data structures
3094 **********************************/
3107typedef struct _VAHuffmanTableBufferJPEGBaseline {
3111 struct {
3115 uint8_t num_dc_codes[16];
3117 uint8_t dc_values[12];
3122 uint8_t num_ac_codes[16];
3124 uint8_t ac_values[162];
3126 uint8_t pad[2];
3128 } huffman_table[2];
3129
3133
3134/****************************
3135 * MPEG-2 data structures
3136 ****************************/
3137
3138/* MPEG-2 Picture Parameter Buffer */
3139/*
3140 * For each frame or field, and before any slice data, a single
3141 * picture parameter buffer must be send.
3142 */
3143typedef struct _VAPictureParameterBufferMPEG2 {
3144 uint16_t horizontal_size;
3145 uint16_t vertical_size;
3146 VASurfaceID forward_reference_picture;
3147 VASurfaceID backward_reference_picture;
3148 /* meanings of the following fields are the same as in the standard */
3149 int32_t picture_coding_type;
3150 int32_t f_code; /* pack all four fcode into this */
3151 union {
3152 struct {
3153 uint32_t intra_dc_precision : 2;
3154 uint32_t picture_structure : 2;
3155 uint32_t top_field_first : 1;
3156 uint32_t frame_pred_frame_dct : 1;
3157 uint32_t concealment_motion_vectors : 1;
3158 uint32_t q_scale_type : 1;
3159 uint32_t intra_vlc_format : 1;
3160 uint32_t alternate_scan : 1;
3161 uint32_t repeat_first_field : 1;
3162 uint32_t progressive_frame : 1;
3163 uint32_t is_first_field : 1; /* indicate whether the current field
3164 * is the first field for field picture
3165 */
3166 } bits;
3167 uint32_t value;
3168 } picture_coding_extension;
3169
3171 uint32_t va_reserved[VA_PADDING_LOW];
3172} VAPictureParameterBufferMPEG2;
3173
3196
3198typedef struct _VASliceParameterBufferMPEG2 {
3199 uint32_t slice_data_size;/* number of bytes in the slice data buffer for this slice */
3200 uint32_t slice_data_offset;/* the offset to the first byte of slice data */
3201 uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
3202 uint32_t macroblock_offset;/* the offset to the first bit of MB from the first byte of slice data */
3203 uint32_t slice_horizontal_position;
3204 uint32_t slice_vertical_position;
3205 int32_t quantiser_scale_code;
3206 int32_t intra_slice_flag;
3207
3211
3213typedef struct _VAMacroblockParameterBufferMPEG2 {
3214 uint16_t macroblock_address;
3215 /*
3216 * macroblock_address (in raster scan order)
3217 * top-left: 0
3218 * bottom-right: picture-height-in-mb*picture-width-in-mb - 1
3219 */
3220 uint8_t macroblock_type; /* see definition below */
3221 union {
3222 struct {
3223 uint32_t frame_motion_type : 2;
3224 uint32_t field_motion_type : 2;
3225 uint32_t dct_type : 1;
3226 } bits;
3227 uint32_t value;
3228 } macroblock_modes;
3229 uint8_t motion_vertical_field_select;
3230 /*
3231 * motion_vertical_field_select:
3232 * see section 6.3.17.2 in the spec
3233 * only the lower 4 bits are used
3234 * bit 0: first vector forward
3235 * bit 1: first vector backward
3236 * bit 2: second vector forward
3237 * bit 3: second vector backward
3238 */
3239 int16_t PMV[2][2][2]; /* see Table 7-7 in the spec */
3240 uint16_t coded_block_pattern;
3241 /*
3242 * The bitplanes for coded_block_pattern are described
3243 * in Figure 6.10-12 in the spec
3244 */
3245
3246 /* Number of skipped macroblocks after this macroblock */
3247 uint16_t num_skipped_macroblocks;
3248
3252
3253/*
3254 * OR'd flags for macroblock_type (section 6.3.17.1 in the spec)
3255 */
3256#define VA_MB_TYPE_MOTION_FORWARD 0x02
3257#define VA_MB_TYPE_MOTION_BACKWARD 0x04
3258#define VA_MB_TYPE_MOTION_PATTERN 0x08
3259#define VA_MB_TYPE_MOTION_INTRA 0x10
3260
3266
3267/****************************
3268 * MPEG-4 Part 2 data structures
3269 ****************************/
3270
3271/* MPEG-4 Picture Parameter Buffer */
3272/*
3273 * For each frame or field, and before any slice data, a single
3274 * picture parameter buffer must be send.
3275 */
3276typedef struct _VAPictureParameterBufferMPEG4 {
3277 uint16_t vop_width;
3278 uint16_t vop_height;
3279 VASurfaceID forward_reference_picture;
3280 VASurfaceID backward_reference_picture;
3281 union {
3282 struct {
3283 uint32_t short_video_header : 1;
3284 uint32_t chroma_format : 2;
3285 uint32_t interlaced : 1;
3286 uint32_t obmc_disable : 1;
3287 uint32_t sprite_enable : 2;
3288 uint32_t sprite_warping_accuracy : 2;
3289 uint32_t quant_type : 1;
3290 uint32_t quarter_sample : 1;
3291 uint32_t data_partitioned : 1;
3292 uint32_t reversible_vlc : 1;
3293 uint32_t resync_marker_disable : 1;
3294 } bits;
3295 uint32_t value;
3296 } vol_fields;
3297 uint8_t no_of_sprite_warping_points;
3298 int16_t sprite_trajectory_du[3];
3299 int16_t sprite_trajectory_dv[3];
3300 uint8_t quant_precision;
3301 union {
3302 struct {
3303 uint32_t vop_coding_type : 2;
3304 uint32_t backward_reference_vop_coding_type : 2;
3305 uint32_t vop_rounding_type : 1;
3306 uint32_t intra_dc_vlc_thr : 3;
3307 uint32_t top_field_first : 1;
3308 uint32_t alternate_vertical_scan_flag : 1;
3309 } bits;
3310 uint32_t value;
3311 } vop_fields;
3312 uint8_t vop_fcode_forward;
3313 uint8_t vop_fcode_backward;
3314 uint16_t vop_time_increment_resolution;
3315 /* short header related */
3316 uint8_t num_gobs_in_vop;
3317 uint8_t num_macroblocks_in_gob;
3318 /* for direct mode prediction */
3319 int16_t TRB;
3320 int16_t TRD;
3321
3325
3327typedef struct _VAIQMatrixBufferMPEG4 {
3333 uint8_t intra_quant_mat[64];
3336
3340
3342typedef struct _VASliceParameterBufferMPEG4 {
3343 uint32_t slice_data_size;/* number of bytes in the slice data buffer for this slice */
3344 uint32_t slice_data_offset;/* the offset to the first byte of slice data */
3345 uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
3346 uint32_t macroblock_offset;/* the offset to the first bit of MB from the first byte of slice data */
3347 uint32_t macroblock_number;
3348 int32_t quant_scale;
3349
3353
3357
3358typedef enum /* see 7.1.1.32 */
3359{
3360 VAMvMode1Mv = 0,
3361 VAMvMode1MvHalfPel = 1,
3362 VAMvMode1MvHalfPelBilinear = 2,
3363 VAMvModeMixedMv = 3,
3364 VAMvModeIntensityCompensation = 4
3365} VAMvModeVC1;
3366
3368/*
3369 * For each picture, and before any slice data, a picture parameter
3370 * buffer must be send. Multiple picture parameter buffers may be
3371 * sent for a single picture. In that case picture parameters will
3372 * apply to all slice data that follow it until a new picture
3373 * parameter buffer is sent.
3374 *
3375 * Notes:
3376 * pic_quantizer_type should be set to the applicable quantizer
3377 * type as defined by QUANTIZER (J.1.19) and either
3378 * PQUANTIZER (7.1.1.8) or PQINDEX (7.1.1.6)
3379 */
3380typedef struct _VAPictureParameterBufferVC1 {
3381 VASurfaceID forward_reference_picture;
3382 VASurfaceID backward_reference_picture;
3383 /* if out-of-loop post-processing is done on the render
3384 target, then we need to keep the in-loop decoded
3385 picture as a reference picture */
3386 VASurfaceID inloop_decoded_picture;
3387
3388 /* sequence layer for AP or meta data for SP and MP */
3389 union {
3390 struct {
3391 uint32_t pulldown : 1; /* SEQUENCE_LAYER::PULLDOWN */
3392 uint32_t interlace : 1; /* SEQUENCE_LAYER::INTERLACE */
3393 uint32_t tfcntrflag : 1; /* SEQUENCE_LAYER::TFCNTRFLAG */
3394 uint32_t finterpflag : 1; /* SEQUENCE_LAYER::FINTERPFLAG */
3395 uint32_t psf : 1; /* SEQUENCE_LAYER::PSF */
3396 uint32_t multires : 1; /* METADATA::MULTIRES */
3397 uint32_t overlap : 1; /* METADATA::OVERLAP */
3398 uint32_t syncmarker : 1; /* METADATA::SYNCMARKER */
3399 uint32_t rangered : 1; /* METADATA::RANGERED */
3400 uint32_t max_b_frames : 3; /* METADATA::MAXBFRAMES */
3401 uint32_t profile : 2; /* SEQUENCE_LAYER::PROFILE or The MSB of METADATA::PROFILE */
3402 } bits;
3403 uint32_t value;
3404 } sequence_fields;
3405
3406 uint16_t coded_width; /* ENTRY_POINT_LAYER::CODED_WIDTH */
3407 uint16_t coded_height; /* ENTRY_POINT_LAYER::CODED_HEIGHT */
3408 union {
3409 struct {
3410 uint32_t broken_link : 1; /* ENTRY_POINT_LAYER::BROKEN_LINK */
3411 uint32_t closed_entry : 1; /* ENTRY_POINT_LAYER::CLOSED_ENTRY */
3412 uint32_t panscan_flag : 1; /* ENTRY_POINT_LAYER::PANSCAN_FLAG */
3413 uint32_t loopfilter : 1; /* ENTRY_POINT_LAYER::LOOPFILTER */
3414 } bits;
3415 uint32_t value;
3416 } entrypoint_fields;
3417 uint8_t conditional_overlap_flag; /* ENTRY_POINT_LAYER::CONDOVER */
3418 uint8_t fast_uvmc_flag; /* ENTRY_POINT_LAYER::FASTUVMC */
3419 union {
3420 struct {
3421 uint32_t luma_flag : 1; /* ENTRY_POINT_LAYER::RANGE_MAPY_FLAG */
3422 uint32_t luma : 3; /* ENTRY_POINT_LAYER::RANGE_MAPY */
3423 uint32_t chroma_flag : 1; /* ENTRY_POINT_LAYER::RANGE_MAPUV_FLAG */
3424 uint32_t chroma : 3; /* ENTRY_POINT_LAYER::RANGE_MAPUV */
3425 } bits;
3426 uint32_t value;
3427 } range_mapping_fields;
3428
3429 uint8_t b_picture_fraction; /* Index for PICTURE_LAYER::BFRACTION value in Table 40 (7.1.1.14) */
3430 uint8_t cbp_table; /* PICTURE_LAYER::CBPTAB/ICBPTAB */
3431 uint8_t mb_mode_table; /* PICTURE_LAYER::MBMODETAB */
3432 uint8_t range_reduction_frame;/* PICTURE_LAYER::RANGEREDFRM */
3433 uint8_t rounding_control; /* PICTURE_LAYER::RNDCTRL */
3434 uint8_t post_processing; /* PICTURE_LAYER::POSTPROC */
3435 uint8_t picture_resolution_index; /* PICTURE_LAYER::RESPIC */
3436 uint8_t luma_scale; /* PICTURE_LAYER::LUMSCALE */
3437 uint8_t luma_shift; /* PICTURE_LAYER::LUMSHIFT */
3438
3439 union {
3440 struct {
3441 uint32_t picture_type : 3; /* PICTURE_LAYER::PTYPE */
3442 uint32_t frame_coding_mode : 3; /* PICTURE_LAYER::FCM */
3443 uint32_t top_field_first : 1; /* PICTURE_LAYER::TFF */
3444 uint32_t is_first_field : 1; /* set to 1 if it is the first field */
3445 uint32_t intensity_compensation : 1; /* PICTURE_LAYER::INTCOMP */
3446 } bits;
3447 uint32_t value;
3448 } picture_fields;
3449 union {
3450 struct {
3451 uint32_t mv_type_mb : 1; /* PICTURE::MVTYPEMB */
3452 uint32_t direct_mb : 1; /* PICTURE::DIRECTMB */
3453 uint32_t skip_mb : 1; /* PICTURE::SKIPMB */
3454 uint32_t field_tx : 1; /* PICTURE::FIELDTX */
3455 uint32_t forward_mb : 1; /* PICTURE::FORWARDMB */
3456 uint32_t ac_pred : 1; /* PICTURE::ACPRED */
3457 uint32_t overflags : 1; /* PICTURE::OVERFLAGS */
3458 } flags;
3459 uint32_t value;
3460 } raw_coding;
3461 union {
3462 struct {
3463 uint32_t bp_mv_type_mb : 1; /* PICTURE::MVTYPEMB */
3464 uint32_t bp_direct_mb : 1; /* PICTURE::DIRECTMB */
3465 uint32_t bp_skip_mb : 1; /* PICTURE::SKIPMB */
3466 uint32_t bp_field_tx : 1; /* PICTURE::FIELDTX */
3467 uint32_t bp_forward_mb : 1; /* PICTURE::FORWARDMB */
3468 uint32_t bp_ac_pred : 1; /* PICTURE::ACPRED */
3469 uint32_t bp_overflags : 1; /* PICTURE::OVERFLAGS */
3470 } flags;
3471 uint32_t value;
3472 } bitplane_present; /* signal what bitplane is being passed via the bitplane buffer */
3473 union {
3474 struct {
3475 uint32_t reference_distance_flag : 1;/* PICTURE_LAYER::REFDIST_FLAG */
3476 uint32_t reference_distance : 5;/* PICTURE_LAYER::REFDIST */
3477 uint32_t num_reference_pictures: 1;/* PICTURE_LAYER::NUMREF */
3478 uint32_t reference_field_pic_indicator : 1;/* PICTURE_LAYER::REFFIELD */
3479 } bits;
3480 uint32_t value;
3481 } reference_fields;
3482 union {
3483 struct {
3484 uint32_t mv_mode : 3; /* PICTURE_LAYER::MVMODE */
3485 uint32_t mv_mode2 : 3; /* PICTURE_LAYER::MVMODE2 */
3486 uint32_t mv_table : 3; /* PICTURE_LAYER::MVTAB/IMVTAB */
3487 uint32_t two_mv_block_pattern_table: 2; /* PICTURE_LAYER::2MVBPTAB */
3488 uint32_t four_mv_switch : 1; /* PICTURE_LAYER::4MVSWITCH */
3489 uint32_t four_mv_block_pattern_table : 2; /* PICTURE_LAYER::4MVBPTAB */
3490 uint32_t extended_mv_flag : 1; /* ENTRY_POINT_LAYER::EXTENDED_MV */
3491 uint32_t extended_mv_range : 2; /* PICTURE_LAYER::MVRANGE */
3492 uint32_t extended_dmv_flag : 1; /* ENTRY_POINT_LAYER::EXTENDED_DMV */
3493 uint32_t extended_dmv_range : 2; /* PICTURE_LAYER::DMVRANGE */
3494 } bits;
3495 uint32_t value;
3496 } mv_fields;
3497 union {
3498 struct {
3499 uint32_t dquant : 2; /* ENTRY_POINT_LAYER::DQUANT */
3500 uint32_t quantizer : 2; /* ENTRY_POINT_LAYER::QUANTIZER */
3501 uint32_t half_qp : 1; /* PICTURE_LAYER::HALFQP */
3502 uint32_t pic_quantizer_scale : 5;/* PICTURE_LAYER::PQUANT */
3503 uint32_t pic_quantizer_type : 1;/* PICTURE_LAYER::PQUANTIZER */
3504 uint32_t dq_frame : 1; /* VOPDQUANT::DQUANTFRM */
3505 uint32_t dq_profile : 2; /* VOPDQUANT::DQPROFILE */
3506 uint32_t dq_sb_edge : 2; /* VOPDQUANT::DQSBEDGE */
3507 uint32_t dq_db_edge : 2; /* VOPDQUANT::DQDBEDGE */
3508 uint32_t dq_binary_level : 1; /* VOPDQUANT::DQBILEVEL */
3509 uint32_t alt_pic_quantizer : 5;/* VOPDQUANT::ALTPQUANT */
3510 } bits;
3511 uint32_t value;
3512 } pic_quantizer_fields;
3513 union {
3514 struct {
3515 uint32_t variable_sized_transform_flag : 1;/* ENTRY_POINT_LAYER::VSTRANSFORM */
3516 uint32_t mb_level_transform_type_flag : 1;/* PICTURE_LAYER::TTMBF */
3517 uint32_t frame_level_transform_type : 2;/* PICTURE_LAYER::TTFRM */
3518 uint32_t transform_ac_codingset_idx1 : 2;/* PICTURE_LAYER::TRANSACFRM */
3519 uint32_t transform_ac_codingset_idx2 : 2;/* PICTURE_LAYER::TRANSACFRM2 */
3520 uint32_t intra_transform_dc_table : 1;/* PICTURE_LAYER::TRANSDCTAB */
3521 } bits;
3522 uint32_t value;
3523 } transform_fields;
3524
3525 uint8_t luma_scale2; /* PICTURE_LAYER::LUMSCALE2 */
3526 uint8_t luma_shift2; /* PICTURE_LAYER::LUMSHIFT2 */
3527 uint8_t intensity_compensation_field; /* Index for PICTURE_LAYER::INTCOMPFIELD value in Table 109 (9.1.1.48) */
3528
3530 uint32_t va_reserved[VA_PADDING_MEDIUM - 1];
3532
3550
3551/* VC-1 Slice Parameter Buffer */
3552typedef struct _VASliceParameterBufferVC1 {
3553 uint32_t slice_data_size;/* number of bytes in the slice data buffer for this slice */
3554 uint32_t slice_data_offset;/* the offset to the first byte of slice data */
3555 uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
3556 uint32_t macroblock_offset;/* the offset to the first bit of MB from the first byte of slice data */
3557 uint32_t slice_vertical_position;
3558
3562
3563/* VC-1 Slice Data Buffer */
3564/*
3565This is simplely a buffer containing raw bit-stream bytes
3566*/
3567
3568/****************************
3569 * H.264/AVC data structures
3570 ****************************/
3571
3572typedef struct _VAPictureH264 {
3573 VASurfaceID picture_id;
3574 uint32_t frame_idx;
3575 uint32_t flags;
3576 int32_t TopFieldOrderCnt;
3577 int32_t BottomFieldOrderCnt;
3578
3580 uint32_t va_reserved[VA_PADDING_LOW];
3581} VAPictureH264;
3582/* flags in VAPictureH264 could be OR of the following */
3583#define VA_PICTURE_H264_INVALID 0x00000001
3584#define VA_PICTURE_H264_TOP_FIELD 0x00000002
3585#define VA_PICTURE_H264_BOTTOM_FIELD 0x00000004
3586#define VA_PICTURE_H264_SHORT_TERM_REFERENCE 0x00000008
3587#define VA_PICTURE_H264_LONG_TERM_REFERENCE 0x00000010
3592#define VA_PICTURE_H264_NON_EXISTING 0x00000020
3593
3595/*
3596 * For each picture, and before any slice data, a single
3597 * picture parameter buffer must be send.
3598 */
3599typedef struct _VAPictureParameterBufferH264 {
3600 VAPictureH264 CurrPic;
3601 VAPictureH264 ReferenceFrames[16]; /* in DPB */
3602 uint16_t picture_width_in_mbs_minus1;
3603 uint16_t picture_height_in_mbs_minus1;
3604 uint8_t bit_depth_luma_minus8;
3605 uint8_t bit_depth_chroma_minus8;
3606 uint8_t num_ref_frames;
3607 union {
3608 struct {
3609 uint32_t chroma_format_idc : 2;
3610 uint32_t residual_colour_transform_flag : 1; /* Renamed to separate_colour_plane_flag in newer standard versions. */
3611 uint32_t gaps_in_frame_num_value_allowed_flag : 1;
3612 uint32_t frame_mbs_only_flag : 1;
3613 uint32_t mb_adaptive_frame_field_flag : 1;
3614 uint32_t direct_8x8_inference_flag : 1;
3615 uint32_t MinLumaBiPredSize8x8 : 1; /* see A.3.3.2 */
3616 uint32_t log2_max_frame_num_minus4 : 4;
3617 uint32_t pic_order_cnt_type : 2;
3618 uint32_t log2_max_pic_order_cnt_lsb_minus4 : 4;
3619 uint32_t delta_pic_order_always_zero_flag : 1;
3620 } bits;
3621 uint32_t value;
3622 } seq_fields;
3623 // FMO is not supported.
3624 va_deprecated uint8_t num_slice_groups_minus1;
3625 va_deprecated uint8_t slice_group_map_type;
3626 va_deprecated uint16_t slice_group_change_rate_minus1;
3627 int8_t pic_init_qp_minus26;
3628 int8_t pic_init_qs_minus26;
3629 int8_t chroma_qp_index_offset;
3630 int8_t second_chroma_qp_index_offset;
3631 union {
3632 struct {
3633 uint32_t entropy_coding_mode_flag : 1;
3634 uint32_t weighted_pred_flag : 1;
3635 uint32_t weighted_bipred_idc : 2;
3636 uint32_t transform_8x8_mode_flag : 1;
3637 uint32_t field_pic_flag : 1;
3638 uint32_t constrained_intra_pred_flag : 1;
3639 uint32_t pic_order_present_flag : 1; /* Renamed to bottom_field_pic_order_in_frame_present_flag in newer standard versions. */
3640 uint32_t deblocking_filter_control_present_flag : 1;
3641 uint32_t redundant_pic_cnt_present_flag : 1;
3642 uint32_t reference_pic_flag : 1; /* nal_ref_idc != 0 */
3643 } bits;
3644 uint32_t value;
3645 } pic_fields;
3646 uint16_t frame_num;
3647
3649 uint32_t va_reserved[VA_PADDING_MEDIUM];
3651
3653typedef struct _VAIQMatrixBufferH264 {
3655 uint8_t ScalingList4x4[6][16];
3657 uint8_t ScalingList8x8[2][64];
3658
3662
3664typedef struct _VASliceParameterBufferH264 {
3665 uint32_t slice_data_size;/* number of bytes in the slice data buffer for this slice */
3668 uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
3680 uint16_t first_mb_in_slice;
3681 uint8_t slice_type;
3682 uint8_t direct_spatial_mv_pred_flag;
3697 uint8_t cabac_init_idc;
3698 int8_t slice_qp_delta;
3699 uint8_t disable_deblocking_filter_idc;
3700 int8_t slice_alpha_c0_offset_div2;
3701 int8_t slice_beta_offset_div2;
3702 VAPictureH264 RefPicList0[32]; /* See 8.2.4.2 */
3703 VAPictureH264 RefPicList1[32]; /* See 8.2.4.2 */
3704 uint8_t luma_log2_weight_denom;
3705 uint8_t chroma_log2_weight_denom;
3706 uint8_t luma_weight_l0_flag;
3707 int16_t luma_weight_l0[32];
3708 int16_t luma_offset_l0[32];
3709 uint8_t chroma_weight_l0_flag;
3710 int16_t chroma_weight_l0[32][2];
3711 int16_t chroma_offset_l0[32][2];
3712 uint8_t luma_weight_l1_flag;
3713 int16_t luma_weight_l1[32];
3714 int16_t luma_offset_l1[32];
3715 uint8_t chroma_weight_l1_flag;
3716 int16_t chroma_weight_l1[32][2];
3717 int16_t chroma_offset_l1[32][2];
3718
3722
3723/****************************
3724 * Common encode data structures
3725 ****************************/
3726typedef enum {
3727 VAEncPictureTypeIntra = 0,
3728 VAEncPictureTypePredictive = 1,
3729 VAEncPictureTypeBidirectional = 2,
3730} VAEncPictureType;
3731
3739typedef struct _VAEncSliceParameterBuffer {
3740 uint32_t start_row_number; /* starting MB row number for this slice */
3741 uint32_t slice_height; /* slice height measured in MB */
3742 union {
3743 struct {
3744 uint32_t is_intra : 1;
3745 uint32_t disable_deblocking_filter_idc : 2;
3746 uint32_t uses_long_term_ref : 1;
3747 uint32_t is_long_term_ref : 1;
3748 } bits;
3749 uint32_t value;
3750 } slice_flags;
3751
3755
3756
3757/****************************
3758 * H.263 specific encode data structures
3759 ****************************/
3760
3761typedef struct _VAEncSequenceParameterBufferH263 {
3762 uint32_t intra_period;
3763 uint32_t bits_per_second;
3764 uint32_t frame_rate;
3765 uint32_t initial_qp;
3766 uint32_t min_qp;
3767
3769 uint32_t va_reserved[VA_PADDING_LOW];
3770} VAEncSequenceParameterBufferH263;
3771
3772typedef struct _VAEncPictureParameterBufferH263 {
3773 VASurfaceID reference_picture;
3774 VASurfaceID reconstructed_picture;
3775 VABufferID coded_buf;
3776 uint16_t picture_width;
3777 uint16_t picture_height;
3778 VAEncPictureType picture_type;
3779
3781 uint32_t va_reserved[VA_PADDING_LOW];
3782} VAEncPictureParameterBufferH263;
3783
3784/****************************
3785 * MPEG-4 specific encode data structures
3786 ****************************/
3787
3788typedef struct _VAEncSequenceParameterBufferMPEG4 {
3789 uint8_t profile_and_level_indication;
3790 uint32_t intra_period;
3791 uint32_t video_object_layer_width;
3792 uint32_t video_object_layer_height;
3793 uint32_t vop_time_increment_resolution;
3794 uint32_t fixed_vop_rate;
3795 uint32_t fixed_vop_time_increment;
3796 uint32_t bits_per_second;
3797 uint32_t frame_rate;
3798 uint32_t initial_qp;
3799 uint32_t min_qp;
3800
3802 uint32_t va_reserved[VA_PADDING_LOW];
3803} VAEncSequenceParameterBufferMPEG4;
3804
3805typedef struct _VAEncPictureParameterBufferMPEG4 {
3806 VASurfaceID reference_picture;
3807 VASurfaceID reconstructed_picture;
3808 VABufferID coded_buf;
3809 uint16_t picture_width;
3810 uint16_t picture_height;
3811 uint32_t modulo_time_base; /* number of 1s */
3812 uint32_t vop_time_increment;
3813 VAEncPictureType picture_type;
3814
3816 uint32_t va_reserved[VA_PADDING_LOW];
3817} VAEncPictureParameterBufferMPEG4;
3818
3819
3820
3822
3839 VADisplay dpy,
3840 VAContextID context,
3841 VABufferType type, /* in */
3842 unsigned int size, /* in */
3843 unsigned int num_elements, /* in */
3844 void *data, /* in */
3845 VABufferID *buf_id /* out */
3846);
3847
3860 VADisplay dpy,
3861 VAContextID context,
3862 VABufferType type,
3863 unsigned int width,
3864 unsigned int height,
3865 unsigned int *unit_size,
3866 unsigned int *pitch,
3867 VABufferID *buf_id
3868);
3869
3877 VADisplay dpy,
3878 VABufferID buf_id, /* in */
3879 unsigned int num_elements /* in */
3880);
3881
3882
3886
3887/*
3888 * FICTURE_AVE_QP(bit7-0): The average Qp value used during this frame
3889 * LARGE_SLICE(bit8):At least one slice in the current frame was large
3890 * enough for the encoder to attempt to limit its size.
3891 * SLICE_OVERFLOW(bit9): At least one slice in the current frame has
3892 * exceeded the maximum slice size specified.
3893 * BITRATE_OVERFLOW(bit10): The peak bitrate was exceeded for this frame.
3894 * BITRATE_HIGH(bit11): The frame size got within the safety margin of the maximum size (VCM only)
3895 * AIR_MB_OVER_THRESHOLD: the number of MBs adapted to Intra MB
3896 */
3897#define VA_CODED_BUF_STATUS_PICTURE_AVE_QP_MASK 0xff
3898#define VA_CODED_BUF_STATUS_LARGE_SLICE_MASK 0x100
3899#define VA_CODED_BUF_STATUS_SLICE_OVERFLOW_MASK 0x200
3900#define VA_CODED_BUF_STATUS_BITRATE_OVERFLOW 0x400
3901#define VA_CODED_BUF_STATUS_BITRATE_HIGH 0x800
3909#define VA_CODED_BUF_STATUS_FRAME_SIZE_OVERFLOW 0x1000
3913#define VA_CODED_BUF_STATUS_BAD_BITSTREAM 0x8000
3914#define VA_CODED_BUF_STATUS_AIR_MB_OVER_THRESHOLD 0xff0000
3915
3924#define VA_CODED_BUF_STATUS_NUMBER_PASSES_MASK 0xf000000
3925
3933#define VA_CODED_BUF_STATUS_SINGLE_NALU 0x10000000
3934
3945typedef struct _VACodedBufferSegment {
3949 uint32_t size;
3951 uint32_t bit_offset;
3953 uint32_t status;
3955 uint32_t reserved;
3957 void *buf;
3962 void *next;
3963
3967
3977 VADisplay dpy,
3978 VABufferID buf_id, /* in */
3979 void **pbuf /* out */
3980);
3981
3987
3991#define VA_MAPBUFFER_FLAG_DEFAULT 0
3993#define VA_MAPBUFFER_FLAG_READ 1
3995#define VA_MAPBUFFER_FLAG_WRITE 2
3996
3997VAStatus vaMapBuffer2(
3998 VADisplay dpy,
3999 VABufferID buf_id, /* in */
4000 void **pbuf, /* out */
4001 uint32_t flags /* in */
4002);
4003
4010 VADisplay dpy,
4011 VABufferID buf_id /* in */
4012);
4013
4024 VADisplay dpy,
4025 VABufferID buffer_id
4026);
4027
4029typedef struct {
4031 uintptr_t handle;
4033 uint32_t type;
4042 uint32_t mem_type;
4044 size_t mem_size;
4045
4048} VABufferInfo;
4049
4097VAStatus
4099
4130VAStatus
4132
4138#define VA_EXPORT_SURFACE_READ_ONLY 0x0001
4140#define VA_EXPORT_SURFACE_WRITE_ONLY 0x0002
4142#define VA_EXPORT_SURFACE_READ_WRITE 0x0003
4148#define VA_EXPORT_SURFACE_SEPARATE_LAYERS 0x0004
4154#define VA_EXPORT_SURFACE_COMPOSED_LAYERS 0x0008
4155
4157
4191 VASurfaceID surface_id,
4192 uint32_t mem_type, uint32_t flags,
4193 void *descriptor);
4194
4203
4211 VADisplay dpy,
4212 VAContextID context,
4213 VASurfaceID render_target
4214);
4215
4220 VADisplay dpy,
4221 VAContextID context,
4222 VABufferID *buffers,
4223 int num_buffers
4224);
4225
4235 VADisplay dpy,
4236 VAContextID context
4237);
4238
4258VAStatus vaMFSubmit(
4259 VADisplay dpy,
4260 VAMFContextID mf_context,
4261 VAContextID * contexts,
4262 int num_contexts
4263);
4264
4265/*
4266
4267Synchronization
4268
4269*/
4270
4277 VADisplay dpy,
4278 VASurfaceID render_target
4279);
4280
4282#define VA_TIMEOUT_INFINITE 0xFFFFFFFFFFFFFFFF
4283
4305 VADisplay dpy,
4306 VASurfaceID surface,
4307 uint64_t timeout_ns
4308);
4309
4310typedef enum {
4311 VASurfaceRendering = 1, /* Rendering in progress */
4312 VASurfaceDisplaying = 2, /* Displaying in progress (not safe to render into it) */
4313 /* this status is useful if surface is used as the source */
4314 /* of an overlay */
4315 VASurfaceReady = 4, /* not being rendered or displayed */
4316 VASurfaceSkipped = 8 /* Indicate a skipped frame during encode */
4317} VASurfaceStatus;
4318
4323 VADisplay dpy,
4324 VASurfaceID render_target,
4325 VASurfaceStatus *status /* out */
4326);
4327
4328typedef enum {
4329 VADecodeSliceMissing = 0,
4330 VADecodeMBError = 1,
4331 VADecodeReset = 2,
4332} VADecodeErrorType;
4333
4338typedef struct _VASurfaceDecodeMBErrors {
4339 int32_t status; /* 1 if hardware has returned detailed info below, -1 means this record is invalid */
4340 uint32_t start_mb; /* start mb address with errors */
4341 uint32_t end_mb; /* end mb address with errors */
4342 VADecodeErrorType decode_error_type;
4343 uint32_t num_mb; /* number of mbs with errors */
4347
4363 VADisplay dpy,
4364 VASurfaceID surface,
4365 VAStatus error_status,
4366 void **error_info
4367);
4368
4390 VADisplay dpy,
4391 VABufferID buf_id,
4392 uint64_t timeout_ns
4393);
4394
4408
4416#define VA_FOURCC(ch0, ch1, ch2, ch3) \
4417 ((unsigned long)(unsigned char) (ch0) | ((unsigned long)(unsigned char) (ch1) << 8) | \
4418 ((unsigned long)(unsigned char) (ch2) << 16) | ((unsigned long)(unsigned char) (ch3) << 24 ))
4419
4420/* Pre-defined fourcc codes. */
4421
4425#define VA_FOURCC_NV12 0x3231564E
4429#define VA_FOURCC_NV21 0x3132564E
4430
4435#define VA_FOURCC_AI44 0x34344149
4436
4441#define VA_FOURCC_RGBA 0x41424752
4446#define VA_FOURCC_RGBX 0x58424752
4451#define VA_FOURCC_BGRA 0x41524742
4456#define VA_FOURCC_BGRX 0x58524742
4461#define VA_FOURCC_ARGB 0x42475241
4466#define VA_FOURCC_XRGB 0x42475258
4471#define VA_FOURCC_ABGR 0x52474241
4476#define VA_FOURCC_XBGR 0x52474258
4477
4482#define VA_FOURCC_UYVY 0x59565955
4487#define VA_FOURCC_YUY2 0x32595559
4492#define VA_FOURCC_AYUV 0x56555941
4497#define VA_FOURCC_NV11 0x3131564e
4502#define VA_FOURCC_YV12 0x32315659
4507#define VA_FOURCC_P208 0x38303250
4512#define VA_FOURCC_I420 0x30323449
4517#define VA_FOURCC_YV24 0x34325659
4522#define VA_FOURCC_YV32 0x32335659
4525#define VA_FOURCC_Y800 0x30303859
4531#define VA_FOURCC_IMC3 0x33434D49
4536#define VA_FOURCC_411P 0x50313134
4542#define VA_FOURCC_411R 0x52313134
4547#define VA_FOURCC_422H 0x48323234
4552#define VA_FOURCC_422V 0x56323234
4557#define VA_FOURCC_444P 0x50343434
4558
4563#define VA_FOURCC_RGBP 0x50424752
4568#define VA_FOURCC_BGRP 0x50524742
4574#define VA_FOURCC_RGB565 0x36314752
4580#define VA_FOURCC_BGR565 0x36314742
4581
4587#define VA_FOURCC_Y210 0x30313259
4593#define VA_FOURCC_Y212 0x32313259
4599#define VA_FOURCC_Y216 0x36313259
4605#define VA_FOURCC_Y410 0x30313459
4611#define VA_FOURCC_Y412 0x32313459
4617#define VA_FOURCC_Y416 0x36313459
4618
4623#define VA_FOURCC_YV16 0x36315659
4629#define VA_FOURCC_P010 0x30313050
4635#define VA_FOURCC_P012 0x32313050
4641#define VA_FOURCC_P016 0x36313050
4642
4648#define VA_FOURCC_I010 0x30313049
4649
4654#define VA_FOURCC_IYUV 0x56555949
4658#define VA_FOURCC_A2R10G10B10 0x30335241 /* VA_FOURCC('A','R','3','0') */
4662#define VA_FOURCC_A2B10G10R10 0x30334241 /* VA_FOURCC('A','B','3','0') */
4666#define VA_FOURCC_X2R10G10B10 0x30335258 /* VA_FOURCC('X','R','3','0') */
4670#define VA_FOURCC_X2B10G10R10 0x30334258 /* VA_FOURCC('X','B','3','0') */
4671
4676#define VA_FOURCC_Y8 0x20203859
4681#define VA_FOURCC_Y16 0x20363159
4686#define VA_FOURCC_VYUY 0x59555956
4691#define VA_FOURCC_YVYU 0x55595659
4696#define VA_FOURCC_ARGB64 0x34475241
4701#define VA_FOURCC_ABGR64 0x34474241
4706#define VA_FOURCC_XYUV 0x56555958
4711#define VA_FOURCC_Q416 0x36313451
4712
4713/* byte order */
4714#define VA_LSB_FIRST 1
4715#define VA_MSB_FIRST 2
4716
4717typedef struct _VAImageFormat {
4718 uint32_t fourcc;
4719 uint32_t byte_order; /* VA_LSB_FIRST, VA_MSB_FIRST */
4720 uint32_t bits_per_pixel;
4721 /* for RGB formats */
4722 uint32_t depth; /* significant bits per pixel */
4723 uint32_t red_mask;
4724 uint32_t green_mask;
4725 uint32_t blue_mask;
4726 uint32_t alpha_mask;
4727
4729 uint32_t va_reserved[VA_PADDING_LOW];
4730} VAImageFormat;
4731
4732typedef VAGenericID VAImageID;
4733
4734typedef struct _VAImage {
4735 VAImageID image_id; /* uniquely identify this image */
4736 VAImageFormat format;
4737 VABufferID buf; /* image data buffer */
4738 /*
4739 * Image data will be stored in a buffer of type VAImageBufferType to facilitate
4740 * data store on the server side for optimal performance. The buffer will be
4741 * created by the CreateImage function, and proper storage allocated based on the image
4742 * size and format. This buffer is managed by the library implementation, and
4743 * accessed by the client through the buffer Map/Unmap functions.
4744 */
4745 uint16_t width;
4746 uint16_t height;
4747 uint32_t data_size;
4748 uint32_t num_planes; /* can not be greater than 3 */
4749 /*
4750 * An array indicating the scanline pitch in bytes for each plane.
4751 * Each plane may have a different pitch. Maximum 3 planes for planar formats
4752 */
4753 uint32_t pitches[3];
4754 /*
4755 * An array indicating the byte offset from the beginning of the image data
4756 * to the start of each plane.
4757 */
4758 uint32_t offsets[3];
4759
4760 /* The following fields are only needed for paletted formats */
4761 int32_t num_palette_entries; /* set to zero for non-palette images */
4762 /*
4763 * Each component is one byte and entry_bytes indicates the number of components in
4764 * each entry (eg. 3 for YUV palette entries). set to zero for non-palette images
4765 */
4766 int32_t entry_bytes;
4767 /*
4768 * An array of ascii characters describing the order of the components within the bytes.
4769 * Only entry_bytes characters of the string are used.
4770 */
4771 int8_t component_order[4];
4772
4774 uint32_t va_reserved[VA_PADDING_LOW];
4775} VAImage;
4776
4779 VADisplay dpy
4780);
4781
4789 VADisplay dpy,
4790 VAImageFormat *format_list, /* out */
4791 int *num_formats /* out */
4792);
4793
4802 VADisplay dpy,
4803 VAImageFormat *format,
4804 int width,
4805 int height,
4806 VAImage *image /* out */
4807);
4808
4813 VADisplay dpy,
4814 VAImageID image
4815);
4816
4817VAStatus vaSetImagePalette(
4818 VADisplay dpy,
4819 VAImageID image,
4820 /*
4821 * pointer to an array holding the palette data. The size of the array is
4822 * num_palette_entries * entry_bytes in size. The order of the components
4823 * in the palette is described by the component_order in VAImage struct
4824 */
4825 unsigned char *palette
4826);
4827
4832VAStatus vaGetImage(
4833 VADisplay dpy,
4834 VASurfaceID surface,
4835 int x, /* coordinates of the upper left source pixel */
4836 int y,
4837 unsigned int width, /* width and height of the region */
4838 unsigned int height,
4839 VAImageID image
4840);
4841
4848VAStatus vaPutImage(
4849 VADisplay dpy,
4850 VASurfaceID surface,
4851 VAImageID image,
4852 int src_x,
4853 int src_y,
4854 unsigned int src_width,
4855 unsigned int src_height,
4856 int dest_x,
4857 int dest_y,
4858 unsigned int dest_width,
4859 unsigned int dest_height
4860);
4861
4894 VADisplay dpy,
4895 VASurfaceID surface,
4896 VAImage *image /* out */
4897);
4898
4905
4907
4910 VADisplay dpy
4911);
4912
4914#define VA_SUBPICTURE_CHROMA_KEYING 0x0001
4915#define VA_SUBPICTURE_GLOBAL_ALPHA 0x0002
4916#define VA_SUBPICTURE_DESTINATION_IS_SCREEN_COORD 0x0004
4928
4930 VADisplay dpy,
4931 VAImageFormat *format_list, /* out */
4932 unsigned int *flags, /* out */
4933 unsigned int *num_formats /* out */
4934);
4935
4940 VADisplay dpy,
4941 VAImageID image,
4942 VASubpictureID *subpicture /* out */
4943);
4944
4949 VADisplay dpy,
4950 VASubpictureID subpicture
4951);
4952
4958 VADisplay dpy,
4959 VASubpictureID subpicture,
4960 VAImageID image
4961);
4962
4973 VADisplay dpy,
4974 VASubpictureID subpicture,
4975 unsigned int chromakey_min,
4976 unsigned int chromakey_max,
4977 unsigned int chromakey_mask
4978);
4979
4986 VADisplay dpy,
4987 VASubpictureID subpicture,
4988 float global_alpha
4989);
4990
4999 VADisplay dpy,
5000 VASubpictureID subpicture,
5001 VASurfaceID *target_surfaces,
5002 int num_surfaces,
5003 int16_t src_x, /* upper left offset in subpicture */
5004 int16_t src_y,
5005 uint16_t src_width,
5006 uint16_t src_height,
5007 int16_t dest_x, /* upper left offset in surface */
5008 int16_t dest_y,
5009 uint16_t dest_width,
5010 uint16_t dest_height,
5011 /*
5012 * whether to enable chroma-keying, global-alpha, or screen relative mode
5013 * see VA_SUBPICTURE_XXX values
5014 */
5015 uint32_t flags
5016);
5017
5022 VADisplay dpy,
5023 VASubpictureID subpicture,
5024 VASurfaceID *target_surfaces,
5025 int num_surfaces
5026);
5027
5044
5045/* PowerVR IEP Lite attributes */
5046typedef enum {
5047 VADISPLAYATTRIB_BLE_OFF = 0x00,
5048 VADISPLAYATTRIB_BLE_LOW,
5049 VADISPLAYATTRIB_BLE_MEDIUM,
5050 VADISPLAYATTRIB_BLE_HIGH,
5051 VADISPLAYATTRIB_BLE_NONE,
5053
5055#define VA_ROTATION_NONE 0x00000000
5056#define VA_ROTATION_90 0x00000001
5057#define VA_ROTATION_180 0x00000002
5058#define VA_ROTATION_270 0x00000003
5060
5070#define VA_MIRROR_NONE 0x00000000
5072#define VA_MIRROR_HORIZONTAL 0x00000001
5074#define VA_MIRROR_VERTICAL 0x00000002
5076
5078#define VA_OOL_DEBLOCKING_FALSE 0x00000000
5079#define VA_OOL_DEBLOCKING_TRUE 0x00000001
5080
5082#define VA_RENDER_MODE_UNDEFINED 0
5083#define VA_RENDER_MODE_LOCAL_OVERLAY 1
5084#define VA_RENDER_MODE_LOCAL_GPU 2
5085#define VA_RENDER_MODE_EXTERNAL_OVERLAY 4
5086#define VA_RENDER_MODE_EXTERNAL_GPU 8
5087
5089#define VA_RENDER_DEVICE_UNDEFINED 0
5090#define VA_RENDER_DEVICE_LOCAL 1
5091#define VA_RENDER_DEVICE_EXTERNAL 2
5092
5105
5106typedef union _VADisplayAttribValSubDevice {
5107 struct {
5111 uint32_t sub_device_count : 4;
5113 uint32_t reserved : 8;
5129 uint32_t sub_device_mask : 16;
5130 } bits;
5131 uint32_t value;
5133
5135typedef enum {
5136 VADisplayAttribBrightness = 0,
5137 VADisplayAttribContrast = 1,
5138 VADisplayAttribHue = 2,
5139 VADisplayAttribSaturation = 3,
5140 /* client can specifiy a background color for the target window
5141 * the new feature of video conference,
5142 * the uncovered area of the surface is filled by this color
5143 * also it will blend with the decoded video color
5144 */
5145 VADisplayAttribBackgroundColor = 4,
5146 /*
5147 * this is a gettable only attribute. For some implementations that use the
5148 * hardware overlay, after PutSurface is called, the surface can not be
5149 * re-used until after the subsequent PutSurface call. If this is the case
5150 * then the value for this attribute will be set to 1 so that the client
5151 * will not attempt to re-use the surface right after returning from a call
5152 * to PutSurface.
5153 *
5154 * Don't use it, use flag VASurfaceDisplaying of vaQuerySurfaceStatus since
5155 * driver may use overlay or GPU alternatively
5156 */
5157 VADisplayAttribDirectSurface = 5,
5158 VADisplayAttribRotation = 6,
5159 VADisplayAttribOutofLoopDeblock = 7,
5160
5161 /* PowerVR IEP Lite specific attributes */
5162 VADisplayAttribBLEBlackMode = 8,
5163 VADisplayAttribBLEWhiteMode = 9,
5164 VADisplayAttribBlueStretch = 10,
5165 VADisplayAttribSkinColorCorrection = 11,
5166 /*
5167 * For type VADisplayAttribCSCMatrix, "value" field is a pointer to the color
5168 * conversion matrix. Each element in the matrix is float-point
5169 */
5170 VADisplayAttribCSCMatrix = 12,
5171 /* specify the constant color used to blend with video surface
5172 * Cd = Cv*Cc*Ac + Cb *(1 - Ac) C means the constant RGB
5173 * d: the final color to overwrite into the frame buffer
5174 * v: decoded video after color conversion,
5175 * c: video color specified by VADisplayAttribBlendColor
5176 * b: background color of the drawable
5177 */
5178 VADisplayAttribBlendColor = 13,
5179 /*
5180 * Indicate driver to skip painting color key or not.
5181 * only applicable if the render is overlay
5182 */
5183 VADisplayAttribOverlayAutoPaintColorKey = 14,
5184 /*
5185 * customized overlay color key, the format is RGB888
5186 * [23:16] = Red, [15:08] = Green, [07:00] = Blue.
5187 */
5188 VADisplayAttribOverlayColorKey = 15,
5189 /*
5190 * The hint for the implementation of vaPutSurface
5191 * normally, the driver could use an overlay or GPU to render the surface on the screen
5192 * this flag provides APP the flexibity to switch the render dynamically
5193 */
5194 VADisplayAttribRenderMode = 16,
5195 /*
5196 * specify if vaPutSurface needs to render into specified monitors
5197 * one example is that one external monitor (e.g. HDMI) is enabled,
5198 * but the window manager is not aware of it, and there is no associated drawable
5199 */
5200 VADisplayAttribRenderDevice = 17,
5201 /*
5202 * specify vaPutSurface render area if there is no drawable on the monitor
5203 */
5204 VADisplayAttribRenderRect = 18,
5205 /*
5206 * HW attribute, read/write, specify the sub device configure
5207 */
5208 VADisplayAttribSubDevice = 19,
5209 /*
5210 * HW attribute. read only. specify whether vaCopy support on current HW
5211 * The value of each bit should equal to 1 << VA_EXEC_MODE_XXX to represent
5212 * modes of vaCopy
5213 */
5214 VADisplayAttribCopy = 20,
5215 /*
5216 * HW attribute. read only. retrieve the device information from backend driver
5217 * the value should be combined with vendor ID << 16 | device ID
5218 */
5219 VADisplayPCIID = 21,
5221
5222/* flags for VADisplayAttribute */
5223#define VA_DISPLAY_ATTRIB_NOT_SUPPORTED 0x0000
5224#define VA_DISPLAY_ATTRIB_GETTABLE 0x0001
5225#define VA_DISPLAY_ATTRIB_SETTABLE 0x0002
5226
5227typedef struct _VADisplayAttribute {
5229 int32_t min_value;
5230 int32_t max_value;
5231 int32_t value; /* used by the set/get attribute functions */
5232 /* flags can be VA_DISPLAY_ATTRIB_GETTABLE or VA_DISPLAY_ATTRIB_SETTABLE or OR'd together */
5233 uint32_t flags;
5234
5236 uint32_t va_reserved[VA_PADDING_LOW];
5237} VADisplayAttribute;
5238
5241 VADisplay dpy
5242);
5243
5251 VADisplay dpy,
5252 VADisplayAttribute *attr_list, /* out */
5253 int *num_attributes /* out */
5254);
5255
5263 VADisplay dpy,
5264 VADisplayAttribute *attr_list, /* in/out */
5265 int num_attributes
5266);
5267
5275 VADisplay dpy,
5276 VADisplayAttribute *attr_list,
5277 int num_attributes
5278);
5279
5280/****************************
5281 * HEVC data structures
5282 ****************************/
5292typedef struct _VAPictureHEVC {
5296 VASurfaceID picture_id;
5302 /* described below */
5303 uint32_t flags;
5304
5308
5309/* flags in VAPictureHEVC could be OR of the following */
5310#define VA_PICTURE_HEVC_INVALID 0x00000001
5314#define VA_PICTURE_HEVC_FIELD_PIC 0x00000002
5319#define VA_PICTURE_HEVC_BOTTOM_FIELD 0x00000004
5321#define VA_PICTURE_HEVC_LONG_TERM_REFERENCE 0x00000008
5336#define VA_PICTURE_HEVC_RPS_ST_CURR_BEFORE 0x00000010
5341#define VA_PICTURE_HEVC_RPS_ST_CURR_AFTER 0x00000020
5346#define VA_PICTURE_HEVC_RPS_LT_CURR 0x00000040
5347
5348/****************************
5349 * VVC data structures
5350 ****************************/
5357
5358typedef struct _VAPictureVVC {
5362 VASurfaceID picture_id;
5363
5366
5367 /* described below */
5368 uint32_t flags;
5369
5372} VAPictureVVC;
5373
5374/* flags in VAPictureVVC could be OR of the following */
5375#define VA_PICTURE_VVC_INVALID 0x00000001
5377#define VA_PICTURE_VVC_LONG_TERM_REFERENCE 0x00000002
5383#define VA_PICTURE_VVC_UNAVAILABLE_REFERENCE 0x00000004
5384
5385typedef enum {
5386 VACopyObjectSurface = 0,
5387 VACopyObjectBuffer = 1,
5388} VACopyObjectType;
5389
5390typedef struct _VACopyObject {
5391 VACopyObjectType obj_type; // type of object.
5392 union {
5393 VASurfaceID surface_id;
5394 VABufferID buffer_id;
5395 } object;
5396
5397 uint32_t va_reserved[VA_PADDING_MEDIUM];
5398} VACopyObject;
5399
5400typedef union _VACopyOption {
5401 struct {
5403 uint32_t va_copy_sync : 2;
5405 uint32_t va_copy_mode : 4;
5406 uint32_t reserved : 26;
5407 } bits;
5408 uint32_t value;
5409} VACopyOption;
5410
5423VAStatus vaCopy(VADisplay dpy, VACopyObject * dst, VACopyObject * src, VACopyOption option);
5424
5425#include <va/va_dec_hevc.h>
5426#include <va/va_dec_jpeg.h>
5427#include <va/va_dec_vp8.h>
5428#include <va/va_dec_vp9.h>
5429#include <va/va_dec_av1.h>
5430#include <va/va_dec_vvc.h>
5431#include <va/va_enc_hevc.h>
5432#include <va/va_fei_hevc.h>
5433#include <va/va_enc_h264.h>
5434#include <va/va_enc_jpeg.h>
5435#include <va/va_enc_mpeg2.h>
5436#include <va/va_enc_vp8.h>
5437#include <va/va_enc_vp9.h>
5438#include <va/va_enc_av1.h>
5439#include <va/va_fei.h>
5440#include <va/va_fei_h264.h>
5441#include <va/va_vpp.h>
5442#include <va/va_prot.h>
5443
5445
5446#ifdef __cplusplus
5447}
5448#endif
5449
5450#endif /* _VA_H_ */
VAStatus vaTerminate(VADisplay dpy)
VAMvModeVC1
Definition va.h:3359
VAEncMiscParameterType
Definition va.h:2379
VADisplayAttribBLEMode
Definition va.h:5046
VAStatus vaDestroySurfaces(VADisplay dpy, VASurfaceID *surfaces, int num_surfaces)
VAGenericID VASubpictureID
Definition va.h:4906
int vaMaxNumConfigAttributes(VADisplay dpy)
VAStatus vaQueryConfigProfiles(VADisplay dpy, VAProfile *profile_list, int *num_profiles)
VAGenericValueType
Generic value types.
Definition va.h:1651
VAStatus vaDestroyContext(VADisplay dpy, VAContextID context)
VABufferType
Definition va.h:2044
VAStatus vaInitialize(VADisplay dpy, int *major_version, int *minor_version)
void(* VAMessageCallback)(void *user_context, const char *message)
Definition va.h:430
VAStatus vaMFReleaseContext(VADisplay dpy, VAMFContextID mf_context, VAContextID context)
VAConfigAttribType
Definition va.h:619
VAStatus vaSetDriverName(VADisplay dpy, char *driver_name)
VAStatus vaAcquireBufferHandle(VADisplay dpy, VABufferID buf_id, VABufferInfo *buf_info)
Acquires buffer handle for external API usage.
void(* VAGenericFunc)(void)
Generic function type.
Definition va.h:1659
VAStatus vaSetSubpictureChromakey(VADisplay dpy, VASubpictureID subpicture, unsigned int chromakey_min, unsigned int chromakey_max, unsigned int chromakey_mask)
VAStatus vaGetImage(VADisplay dpy, VASurfaceID surface, int x, int y, unsigned int width, unsigned int height, VAImageID image)
VAStatus vaQuerySurfaceError(VADisplay dpy, VASurfaceID surface, VAStatus error_status, void **error_info)
VAStatus vaRenderPicture(VADisplay dpy, VAContextID context, VABufferID *buffers, int num_buffers)
VAStatus vaExportSurfaceHandle(VADisplay dpy, VASurfaceID surface_id, uint32_t mem_type, uint32_t flags, void *descriptor)
Export a handle to a surface for use with an external API.
VAStatus vaSetSubpictureImage(VADisplay dpy, VASubpictureID subpicture, VAImageID image)
int vaMaxNumProfiles(VADisplay dpy)
const char * vaQueryVendorString(VADisplay dpy)
VAGenericID VAContextID
Definition va.h:1643
VASurfaceAttribType
Surface attribute types.
Definition va.h:1689
int vaMaxNumEntrypoints(VADisplay dpy)
VAStatus vaQueryConfigAttributes(VADisplay dpy, VAConfigID config_id, VAProfile *profile, VAEntrypoint *entrypoint, VAConfigAttrib *attrib_list, int *num_attribs)
VAStatus vaQuerySurfaceStatus(VADisplay dpy, VASurfaceID render_target, VASurfaceStatus *status)
const char * vaErrorStr(VAStatus error_status)
VAEntrypoint
Definition va.h:552
VAStatus vaDestroyConfig(VADisplay dpy, VAConfigID config_id)
VAStatus vaQuerySurfaceAttributes(VADisplay dpy, VAConfigID config, VASurfaceAttrib *attrib_list, unsigned int *num_attribs)
Queries surface attributes for the supplied config.
VAStatus vaAssociateSubpicture(VADisplay dpy, VASubpictureID subpicture, VASurfaceID *target_surfaces, int num_surfaces, int16_t src_x, int16_t src_y, uint16_t src_width, uint16_t src_height, int16_t dest_x, int16_t dest_y, uint16_t dest_width, uint16_t dest_height, uint32_t flags)
VAStatus vaCreateSubpicture(VADisplay dpy, VAImageID image, VASubpictureID *subpicture)
VAMessageCallback vaSetErrorCallback(VADisplay dpy, VAMessageCallback callback, void *user_context)
VAStatus vaCreateContext(VADisplay dpy, VAConfigID config_id, int picture_width, int picture_height, int flag, VASurfaceID *render_targets, int num_render_targets, VAContextID *context)
VAStatus vaQueryConfigEntrypoints(VADisplay dpy, VAProfile profile, VAEntrypoint *entrypoint_list, int *num_entrypoints)
void * VANativeDisplay
Definition va.h:451
VAStatus vaSetSubpictureGlobalAlpha(VADisplay dpy, VASubpictureID subpicture, float global_alpha)
VAStatus vaCreateImage(VADisplay dpy, VAImageFormat *format, int width, int height, VAImage *image)
VAEncPackedHeaderType
Packed header type.
Definition va.h:2419
VAStatus vaSyncSurface2(VADisplay dpy, VASurfaceID surface, uint64_t timeout_ns)
Synchronizes pending operations associated with the supplied surface.
VAStatus vaCreateConfig(VADisplay dpy, VAProfile profile, VAEntrypoint entrypoint, VAConfigAttrib *attrib_list, int num_attribs, VAConfigID *config_id)
VAStatus vaSyncSurface(VADisplay dpy, VASurfaceID render_target)
VAStatus vaDestroyBuffer(VADisplay dpy, VABufferID buffer_id)
VAProfile
Definition va.h:502
VAStatus vaQuerySubpictureFormats(VADisplay dpy, VAImageFormat *format_list, unsigned int *flags, unsigned int *num_formats)
VAStatus vaDestroySubpicture(VADisplay dpy, VASubpictureID subpicture)
#define VA_PADDING_LOW
Definition va.h:360
VAStatus vaDeriveImage(VADisplay dpy, VASurfaceID surface, VAImage *image)
VAStatus vaMFAddContext(VADisplay dpy, VAMFContextID mf_context, VAContextID context)
unsigned int VAGenericID
Definition va.h:1580
VAStatus vaCreateBuffer(VADisplay dpy, VAContextID context, VABufferType type, unsigned int size, unsigned int num_elements, void *data, VABufferID *buf_id)
VAStatus vaDeassociateSubpicture(VADisplay dpy, VASubpictureID subpicture, VASurfaceID *target_surfaces, int num_surfaces)
VAStatus vaDestroyImage(VADisplay dpy, VAImageID image)
VAStatus vaPutImage(VADisplay dpy, VASurfaceID surface, VAImageID image, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y, unsigned int dest_width, unsigned int dest_height)
VAStatus vaCreateSurfaces(VADisplay dpy, unsigned int format, unsigned int width, unsigned int height, VASurfaceID *surfaces, unsigned int num_surfaces, VASurfaceAttrib *attrib_list, unsigned int num_attribs)
Creates an array of surfaces.
VAStatus vaSyncBuffer(VADisplay dpy, VABufferID buf_id, uint64_t timeout_ns)
Synchronizes pending operations associated with the supplied buffer.
VAStatus vaQueryImageFormats(VADisplay dpy, VAImageFormat *format_list, int *num_formats)
VAPrivFunc vaGetLibFunc(VADisplay dpy, const char *func)
VAStatus vaBeginPicture(VADisplay dpy, VAContextID context, VASurfaceID render_target)
VAStatus vaBufferSetNumElements(VADisplay dpy, VABufferID buf_id, unsigned int num_elements)
VAGenericID VABufferID
Definition va.h:2042
int vaMaxNumImageFormats(VADisplay dpy)
VAStatus vaCreateMFContext(VADisplay dpy, VAMFContextID *mf_context)
void * VADisplay
Definition va.h:260
VAStatus vaCreateBuffer2(VADisplay dpy, VAContextID context, VABufferType type, unsigned int width, unsigned int height, unsigned int *unit_size, unsigned int *pitch, VABufferID *buf_id)
VAStatus vaReleaseBufferHandle(VADisplay dpy, VABufferID buf_id)
Releases buffer after usage from external API.
VAStatus vaMFSubmit(VADisplay dpy, VAMFContextID mf_context, VAContextID *contexts, int num_contexts)
VAStatus vaQueryProcessingRate(VADisplay dpy, VAConfigID config, VAProcessingRateParameter *proc_buf, unsigned int *processing_rate)
Queries processing rate for the supplied config.
VAStatus vaGetConfigAttributes(VADisplay dpy, VAProfile profile, VAEntrypoint entrypoint, VAConfigAttrib *attrib_list, int num_attribs)
VAStatus vaUnmapBuffer(VADisplay dpy, VABufferID buf_id)
VAMessageCallback vaSetInfoCallback(VADisplay dpy, VAMessageCallback callback, void *user_context)
VAStatus vaMapBuffer(VADisplay dpy, VABufferID buf_id, void **pbuf)
int vaMaxNumSubpictureFormats(VADisplay dpy)
VAStatus vaEndPicture(VADisplay dpy, VAContextID context)
@ VAEncMiscParameterTypeExtensionData
encode extension buffer, ect. MPEG2 Sequence extenstion data
Definition va.h:2415
@ VAEncMiscParameterTypeParallelBRC
Buffer type used for parallel BRC parameters.
Definition va.h:2405
@ VAEncMiscParameterTypeRIR
Buffer type used for Rolling intra refresh.
Definition va.h:2390
@ VAEncMiscParameterTypeCustomRoundingControl
Buffer type used for encoder rounding offset parameters.
Definition va.h:2411
@ VAEncMiscParameterTypeHRD
Buffer type used for HRD parameters.
Definition va.h:2387
@ VAEncMiscParameterTypeROI
Buffer type used for region-of-interest (ROI) parameters.
Definition va.h:2397
@ VAEncMiscParameterTypeSubMbPartPel
Set MB partion mode mask and Half-pel/Quant-pel motion search.
Definition va.h:2407
@ VAEncMiscParameterTypeEncQuality
set encode quality tuning
Definition va.h:2409
@ VAEncMiscParameterTypeDirtyRect
Buffer type used for dirty region-of-interest (ROI) parameters.
Definition va.h:2403
@ VAEncMiscParameterTypeQuantization
Buffer type used for quantization parameters, it's per-sequence parameter.
Definition va.h:2392
@ VAEncMiscParameterTypeTemporalLayerStructure
Buffer type used for temporal layer structure.
Definition va.h:2401
@ VAEncMiscParameterTypeMaxFrameSize
Buffer type used to express a maximum frame size (in bits).
Definition va.h:2385
@ VAEncMiscParameterTypeMultiPassFrameSize
Buffer type used to express a maximum frame size (in bytes) settings for multiple pass.
Definition va.h:2399
@ VAEncMiscParameterTypeSkipFrame
Buffer type used for sending skip frame parameters to the encoder's rate control, when the user has e...
Definition va.h:2395
@ VAEncMiscParameterTypeFEIFrameControl
Buffer type used for FEI input frame level parameters.
Definition va.h:2413
@ VAGenericValueTypeInteger
Definition va.h:1652
@ VAGenericValueTypeFloat
Definition va.h:1653
@ VAGenericValueTypePointer
Definition va.h:1654
@ VAGenericValueTypeFunc
Definition va.h:1655
@ VAProcPipelineParameterBufferType
Video processing pipeline parameter buffer.
Definition va.h:2086
@ VASubsetsParameterBufferType
HEVC Decoding Subset Parameter buffer type.
Definition va.h:2146
@ VAContextParameterUpdateBufferType
adjust context parameters dynamically
Definition va.h:2152
@ VASubPicBufferType
VVC SubPic data buffer.
Definition va.h:2195
@ VAEncQPBufferType
Encoding QP buffer.
Definition va.h:2078
@ VAEncMacroblockDisableSkipMapBufferType
Definition va.h:2121
@ VATileBufferType
VVC Tile Dimension data buffer.
Definition va.h:2201
@ VAProtectedSessionExecuteBufferType
Protected session execution buffer type.
Definition va.h:2159
@ VAEncFEICTBCmdBufferType
HEVC FEI CTB level cmd buffer it is CTB level information for future usage.
Definition va.h:2126
@ VAProcFilterParameterBufferType
Video filter parameter buffer.
Definition va.h:2099
@ VAStatsStatisticsBufferType
Statistics output for VAEntrypointStats progressive and top field of interlaced case.
Definition va.h:2110
@ VASliceStructBufferType
VVC Slice Structure data buffer.
Definition va.h:2207
@ VAAlfBufferType
VVC ALF data buffer.
Definition va.h:2183
@ VALmcsBufferType
VVC LMCS data buffer.
Definition va.h:2189
@ VAStatsStatisticsBottomFieldBufferType
Statistics output for VAEntrypointStats bottom field of interlaced case.
Definition va.h:2112
@ VAEncFEICURecordBufferType
HEVC FEI CU level data buffer it's CTB level information for future usage.
Definition va.h:2131
@ VAEncryptionParameterBufferType
Encryption parameters buffer for protected content session.
Definition va.h:2165
@ VADecodeStreamoutBufferType
Definition va.h:2134
@ VAEncDeltaQpPerBlockBufferType
Encoding delta QP per block buffer.
Definition va.h:2176
@ VAEncFEIMVBufferType
FEI specific buffer types.
Definition va.h:2103
@ VAConfigAttribProcessingRate
Processing rate reporting attribute. Read-only.
Definition va.h:834
@ VAConfigAttribMaxPictureHeight
Maximum picture height. Read-only.
Definition va.h:764
@ VAConfigAttribProtectedContentCipherMode
Cipher mode of the protected content session.
Definition va.h:977
@ VAConfigAttribEncMacroblockInfo
Macroblock information. Read-only.
Definition va.h:750
@ VAConfigAttribFrameSizeToleranceSupport
frame size tolerance support it indicates the tolerance of frame size
Definition va.h:874
@ VAConfigAttribContextPriority
priority setting for the context. Read-Write attribute value is VAConfigAttribValContextPriority this...
Definition va.h:945
@ VAConfigAttribProtectedContentUsage
Special usage attribute of the protected session.
Definition va.h:991
@ VAConfigAttribEncQuantization
Encoding quantization attribute. Read-only.
Definition va.h:788
@ VAConfigAttribProtectedContentCipherSampleType
Decryption sample type of the protected content session.
Definition va.h:984
@ VAConfigAttribEncPerBlockControl
Settings per block attribute for Encoding. Read-only.
Definition va.h:1043
@ VAConfigAttribEncMaxTileRows
Maximum number of tile rows. Read-only.
Definition va.h:1050
@ VAConfigAttribTEETypeClient
TEE type client is a specific module supporting specific functions in TEE. Read-only.
Definition va.h:956
@ VAConfigAttribMaxFrameSize
encode max frame size attribute. Read-only attribute value VAConfigAttribValMaxFrameSize represent ma...
Definition va.h:924
@ VAConfigAttribDecJPEG
JPEG decoding attribute. Read-only.
Definition va.h:648
@ VAConfigAttribEncMaxSlices
Maximum number of slices per frame. Read-only.
Definition va.h:721
@ VAConfigAttribDecSliceMode
Slice Decoding mode. Read/write.
Definition va.h:640
@ VAConfigAttribCustomRoundingControl
whether accept rouding setting from application. Read-only. This attribute is for encode quality,...
Definition va.h:913
@ VAConfigAttribEncSkipFrame
Encoding skip frame attribute. Read-only.
Definition va.h:804
@ VAConfigAttribEncHEVCFeatures
HEVC/H.265 encoding features. Read-only.
Definition va.h:1002
@ VAConfigAttribEncAV1Ext2
AV1 encoding attribute extend2. Read-only.
Definition va.h:1036
@ VAConfigAttribEncQualityRange
Encoding quality range attribute. Read-only.
Definition va.h:781
@ VAConfigAttribEncDynamicScaling
Dynamic Scaling Attribute. Read-only.
Definition va.h:869
@ VAConfigAttribEncTileSupport
Tile Support Attribute. Read-only.
Definition va.h:907
@ VAConfigAttribEncROI
Encoding region-of-interest (ROI) attribute. Read-only.
Definition va.h:815
@ VAConfigAttribFEIMVPredictors
Maximum number of FEI MV predictors. Read-only.
Definition va.h:891
@ VAConfigAttribEncAV1
AV1 encoding attribute. Read-only.
Definition va.h:1020
@ VAConfigAttribEncSliceStructure
Slice structure. Read-only.
Definition va.h:738
@ VAConfigAttribStats
Statistics attribute. Read-only.
Definition va.h:899
@ VAConfigAttribEncMaxRefFrames
Maximum number of reference frames. Read-only.
Definition va.h:714
@ VAConfigAttribQPBlockSize
Encoding QP info block size attribute. Read-only. This attribute conveys the block sizes that underly...
Definition va.h:919
@ VAConfigAttribEncRateControlExt
Encoding extended rate control attribute. Read-only.
Definition va.h:823
@ VAConfigAttribEncHEVCBlockSizes
HEVC/H.265 encoding block sizes. Read-only.
Definition va.h:1012
@ VAConfigAttribMaxPictureWidth
Maximum picture width. Read-only.
Definition va.h:757
@ VAConfigAttribEncIntraRefresh
Encoding intra refresh attribute. Read-only.
Definition va.h:796
@ VAConfigAttribEncMaxTileCols
Maximum number of tile cols. Read-only.
Definition va.h:1057
@ VAConfigAttribDecProcessing
Decode processing support. Read/write.
Definition va.h:681
@ VAConfigAttribPredictionDirection
inter frame prediction directrion attribute. Read-only. this attribute conveys the prediction directi...
Definition va.h:936
@ VAConfigAttribTEEType
TEE could be any HW secure device. Read-only.
Definition va.h:954
@ VAConfigAttribFEIFunctionType
Encode function type for FEI.
Definition va.h:883
@ VAConfigAttribDecAV1Features
AV1 decoding features. Read-only.
Definition va.h:952
@ VAConfigAttribEncParallelRateControl
Parallel Rate Control (hierachical B) attribute. Read-only.
Definition va.h:860
@ VAConfigAttribEncJPEG
JPEG encoding attribute. Read-only.
Definition va.h:772
@ VAConfigAttribEncInterlaced
Interlaced mode. Read/write.
Definition va.h:703
@ VAConfigAttribProtectedContentCipherBlockSize
Cipher block size of the protected content session.
Definition va.h:970
@ VAConfigAttribMultipleFrame
combined submission of multiple frames from different streams, it is optimization for different HW im...
Definition va.h:940
@ VAConfigAttribEncVP9
VP9 encoding attribute. Read-only.
Definition va.h:1065
@ VAConfigAttribEncAV1Ext1
AV1 encoding attribute extend1. Read-only.
Definition va.h:1028
@ VAConfigAttribEncPackedHeaders
Packed headers mode. Read/write.
Definition va.h:694
@ VAConfigAttribEncDirtyRect
Encoding dirty rectangle. Read-only.
Definition va.h:848
@ VAConfigAttribProtectedContentCipherAlgorithm
Cipher algorithm of the protected content session.
Definition va.h:963
@ VASurfaceAttribMaxWidth
Maximal width in pixels (int, read-only).
Definition va.h:1704
@ VASurfaceAttribUsageHint
Surface usage hint, gives the driver a hint of intended usage to optimize allocation (e....
Definition va.h:1720
@ VASurfaceAttribAlignmentSize
width and height log2 aligment in pixels (int, read-only)
Definition va.h:1736
@ VASurfaceAttribMemoryType
Surface memory type expressed in bit fields (int, read/write).
Definition va.h:1710
@ VASurfaceAttribMaxHeight
Maximal height in pixels (int, read-only).
Definition va.h:1708
@ VASurfaceAttribDRMFormatModifiers
List of possible DRM format modifiers (pointer, write).
Definition va.h:1727
@ VASurfaceAttribMinWidth
Minimal width in pixels (int, read-only).
Definition va.h:1702
@ VASurfaceAttribExternalBufferDescriptor
External buffer descriptor (pointer, write).
Definition va.h:1717
@ VASurfaceAttribPixelFormat
Pixel format as a FOURCC (int, read/write).
Definition va.h:1700
@ VASurfaceAttribCount
Number of surface attributes.
Definition va.h:1738
@ VASurfaceAttribMinHeight
Minimal height in pixels (int, read-only).
Definition va.h:1706
@ VAEntrypointFEI
VAEntrypointFEI.
Definition va.h:586
@ VAEntrypointProtectedTEEComm
VAEntrypointProtectedTEEComm.
Definition va.h:609
@ VAEntrypointVideoProc
Definition va.h:569
@ VAEntrypointStats
VAEntrypointStats.
Definition va.h:603
@ VAEntrypointProtectedContent
VAEntrypointProtectedContent.
Definition va.h:615
@ VAEncPackedHeaderPicture
Packed picture header.
Definition va.h:2423
@ VAEncPackedHeaderRawData
Packed raw header.
Definition va.h:2434
@ VAEncPackedHeaderSequence
Packed sequence header.
Definition va.h:2421
@ VAEncPackedHeaderSlice
Packed slice header.
Definition va.h:2425
@ VAProfileProtected
Profile ID used for protected video playback.
Definition va.h:541
@ VAProfileNone
Profile ID used for video processing.
Definition va.h:504
VA buffer information.
Definition va.h:4029
uint32_t va_reserved[VA_PADDING_LOW]
Reserved bytes for future use, must be zero.
Definition va.h:4047
uint32_t mem_type
Buffer memory type (See VASurfaceAttribMemoryType).
Definition va.h:4042
uint32_t type
Buffer type (See VABufferType).
Definition va.h:4033
size_t mem_size
Size of the underlying buffer.
Definition va.h:4044
uintptr_t handle
Buffer handle.
Definition va.h:4031
Coded buffer segment.
Definition va.h:3945
uint32_t bit_offset
Bit offset into the data buffer where the video data starts.
Definition va.h:3951
uint32_t va_reserved[VA_PADDING_LOW]
Reserved bytes for future use, must be zero.
Definition va.h:3965
uint32_t status
Status set by the driver. See VA_CODED_BUF_STATUS_*.
Definition va.h:3953
void * next
Pointer to the next VACodedBufferSegment element, or NULL if there is none.
Definition va.h:3962
uint32_t size
Size of the data buffer in this segment (in bytes).
Definition va.h:3949
void * buf
Pointer to the start of the data buffer.
Definition va.h:3957
uint32_t reserved
Reserved for future use.
Definition va.h:3955
Definition va.h:1076
update the context parameter this structure is used to update context parameters, such as priority of...
Definition va.h:2217
uint32_t context_priority_update
indicate whether context priority changed
Definition va.h:2221
VAConfigAttribValContextPriority context_priority
task/context priority
Definition va.h:2228
uint32_t reserved
Reserved bits for future use, must be zero.
Definition va.h:2223
Defines a maximum frame size (in bits).
Definition va.h:2753
va_deprecated VAEncMiscParameterType type
Type. Shall be set to VAEncMiscParameterTypeMaxFrameSize.
Definition va.h:2756
uint32_t max_frame_size
Maximum size of a frame (in bits).
Definition va.h:2758
uint32_t va_reserved[VA_PADDING_LOW]
Reserved bytes for future use, must be zero.
Definition va.h:2761
Maximum frame size (in bytes) settings for multiple pass.
Definition va.h:2773
uint8_t * delta_qp
delta QP list for every pass
Definition va.h:2784
unsigned long va_reserved[VA_PADDING_LOW]
Reserved bytes for future use, must be zero.
Definition va.h:2787
uint32_t reserved
Reserved bytes for future use, must be zero.
Definition va.h:2780
va_deprecated VAEncMiscParameterType type
Type. Shall be set to VAEncMiscParameterTypeMultiPassMaxFrameSize.
Definition va.h:2776
uint8_t num_passes
number of passes, every pass has different QP, currently AVC encoder can support up to 4 passes
Definition va.h:2782
uint32_t max_frame_size
Maximum size of a frame (in byte)
Definition va.h:2778
Encoding quality level.
Definition va.h:2801
uint32_t quality_level
Encoding quality level setting. When set to 0, default quality level is used.
Definition va.h:2805
uint32_t va_reserved[VA_PADDING_LOW]
Reserved bytes for future use, must be zero.
Definition va.h:2808
Definition va.h:2475
Custom Encoder Rounding Offset Control. Application may use this structure to set customized rounding...
Definition va.h:3040
uint32_t enable_custom_rouding_intra
Enable customized rounding offset for intra blocks. If 0, default value would be taken by driver for ...
Definition va.h:3047
uint32_t rounding_offset_intra
Intra rounding offset Ignored if enable_custom_rouding_intra equals 0.
Definition va.h:3052
uint32_t enable_custom_rounding_inter
Enable customized rounding offset for inter blocks. If 0, default value would be taken by driver for ...
Definition va.h:3058
uint32_t rounding_offset_inter
Inter rounding offset Ignored if enable_custom_rouding_inter equals 0.
Definition va.h:3063
Definition va.h:2966
uint32_t PanicModeDisable
Definition va.h:3014
uint32_t UltraHMEDisable
Definition va.h:3010
uint32_t HMEDisable
Definition va.h:3006
uint32_t FTQSkipThresholdLUTInput
Definition va.h:2983
uint16_t NonFTQSkipThresholdLUT[52]
Definition va.h:3028
uint32_t HMEMVCostScalingFactor
Definition va.h:3004
uint32_t SuperHMEDisable
Definition va.h:3008
uint32_t FTQOverride
Definition va.h:2978
uint32_t ForceRepartitionCheck
Definition va.h:3019
uint32_t directBiasAdjustmentEnable
Definition va.h:2990
uint32_t NonFTQSkipThresholdLUTInput
Definition va.h:2986
uint8_t FTQSkipThresholdLUT[52]
Definition va.h:3026
uint32_t useRawPicForRef
Definition va.h:2972
uint32_t FTQEnable
Definition va.h:2980
uint32_t skipCheckDisable
Definition va.h:2975
uint32_t globalMotionBiasAdjustmentEnable
Definition va.h:2997
Definition va.h:2617
uint32_t va_reserved[VA_PADDING_LOW]
Reserved bytes for future use, must be zero.
Definition va.h:2649
uint32_t reserved
Definition va.h:2643
uint32_t temporal_id
Definition va.h:2641
uint32_t framerate
Definition va.h:2637
Definition va.h:2721
uint32_t buffer_size
Definition va.h:2738
uint32_t initial_buffer_fullness
Definition va.h:2732
uint32_t va_reserved[VA_PADDING_LOW]
Reserved bytes for future use, must be zero.
Definition va.h:2741
Definition va.h:2657
uint32_t va_reserved[VA_PADDING_LOW]
Reserved bytes for future use, must be zero.
Definition va.h:2661
Attribute value for VAConfigAttribEncParallelRateControl.
Definition va.h:2954
uint32_t num_layers
Definition va.h:2956
uint32_t * num_b_in_gop
Definition va.h:2961
Quantization settings for encoding.
Definition va.h:2817
Rate control parameters.
Definition va.h:2500
uint32_t bits_per_second
Definition va.h:2502
uint32_t basic_unit_size
Definition va.h:2530
uint32_t reserved
Definition va.h:2577
uint32_t frame_tolerance_mode
Definition va.h:2575
uint32_t mb_rate_control
Definition va.h:2550
uint32_t temporal_id
Definition va.h:2552
uint32_t disable_bit_stuffing
Definition va.h:2542
uint32_t cfs_I_frames
Definition va.h:2554
uint32_t ICQ_quality_factor
Definition va.h:2586
uint32_t max_qp
Definition va.h:2592
uint32_t window_size
Definition va.h:2514
uint32_t enable_parallel_brc
Definition va.h:2559
uint32_t disable_frame_skip
Definition va.h:2540
uint32_t reset
Definition va.h:2538
uint32_t target_frame_size
Definition va.h:2606
uint32_t initial_qp
Definition va.h:2519
uint32_t va_reserved[VA_PADDING_LOW]
Definition va.h:2608
uint32_t min_qp
Definition va.h:2525
uint32_t target_percentage
Definition va.h:2508
uint32_t quality_factor
Definition va.h:2597
Encoding skip frame.
Definition va.h:2845
uint32_t size_skip_frames
When skip_frame_flag = 1, the size of the skipped frames in bits. When skip_frame_flag = 2,...
Definition va.h:2857
uint8_t skip_frame_flag
Indicates skip frames as below. 0: Encode as normal, no skip. 1: One or more frames were skipped prio...
Definition va.h:2852
uint32_t va_reserved[VA_PADDING_LOW]
Reserved bytes for future use, must be zero.
Definition va.h:2860
uint8_t num_skip_frames
The number of frames skipped prior to the current frame. Valid when skip_frame_flag = 1.
Definition va.h:2854
Temporal layer Structure.
Definition va.h:2481
uint32_t layer_id[32]
The array indicating the layer id for each frame.
Definition va.h:2492
uint32_t periodicity
The length of the array defining frame layer membership. Should be 1-32.
Definition va.h:2485
uint32_t va_reserved[VA_PADDING_LOW]
Reserved bytes for future use, must be zero.
Definition va.h:2495
uint32_t number_of_layers
The number of temporal layers.
Definition va.h:2483
Packed header parameter.
Definition va.h:2446
uint8_t has_emulation_bytes
Flag: buffer contains start code emulation prevention bytes?
Definition va.h:2452
uint32_t type
Definition va.h:2448
uint32_t va_reserved[VA_PADDING_LOW]
Reserved bytes for future use, must be zero.
Definition va.h:2455
uint32_t bit_length
Size of the VAEncPackedHeaderDataBuffer in bits.
Definition va.h:2450
Encoding region-of-interest (ROI).
Definition va.h:2872
int8_t roi_value
ROI value.
Definition va.h:2895
VARectangle roi_rectangle
Defines the ROI boundary in pixels, the driver will map it to appropriate codec coding units....
Definition va.h:2876
Encode Slice Parameter Buffer.
Definition va.h:3739
uint32_t va_reserved[VA_PADDING_LOW]
Reserved bytes for future use, must be zero.
Definition va.h:3753
Encryption parameters buffer for VAEncryptionParameterBufferType.
Definition va.h:2271
uint8_t wrapped_encrypt_blob[64]
Wrapped Key blob info (Sne)kb, valid size is specified by key_blob_size.
Definition va.h:2291
uint32_t key_blob_size
key blob size It could be VA_PC_BLOCK_SIZE_128, VA_PC_BLOCK_SIZE_192, or VA_PC_BLOCK_SIZE_256
Definition va.h:2296
uint8_t wrapped_decrypt_blob[64]
Wrapped decrypt blob (Snd)kb, valid size is specified by key_blob_size.
Definition va.h:2288
uint32_t blocks_stripe_clear
Indicates the number of 16-byte BLOCKS that are clear in any given encrypted region of segments,...
Definition va.h:2312
uint32_t num_segments
The number of sengments.
Definition va.h:2277
uint32_t va_reserved[VA_PADDING_MEDIUM]
Reserved bytes for future use, must be zero.
Definition va.h:2314
uint32_t size_of_length
CENC counter length.
Definition va.h:2285
VAEncryptionSegmentInfo * segment_info
Pointer of segments.
Definition va.h:2279
uint32_t status_report_index
The status report index reserved for CENC fullsample workload. The related structures and definitions...
Definition va.h:2283
uint32_t blocks_stripe_encrypted
Indicates the number of 16-byte BLOCKS that are encrypted in any given encrypted region of segments....
Definition va.h:2305
uint32_t encryption_type
Encryption type, refer to VA_ENCRYPTION_TYPE_FULLSAMPLE_CTR, VA_ENCRYPTION_TYPE_FULLSAMPLE_CBC,...
Definition va.h:2275
structure for encrypted segment info.
Definition va.h:2251
uint32_t segment_length
The length of the segments in bytes.
Definition va.h:2256
uint32_t partial_aes_block_size
The length in bytes of the remainder of an incomplete block from a previous segment.
Definition va.h:2259
uint8_t aes_cbc_iv_or_ctr[64]
This will be AES counter for secure decode and secure encode when numSegments equals 1,...
Definition va.h:2265
uint32_t va_reserved[VA_PADDING_MEDIUM]
Reserved bytes for future use, must be zero.
Definition va.h:2267
uint32_t init_byte_length
The length in bytes of the initial clear data.
Definition va.h:2261
uint32_t segment_start_offset
The offset relative to the start of the bitstream input in bytes of the start of the segment.
Definition va.h:2254
Generic value.
Definition va.h:1662
float f
32-bit float.
Definition va.h:1670
VAGenericFunc fn
Pointer to function.
Definition va.h:1674
int32_t i
32-bit signed integer.
Definition va.h:1668
void * p
Generic pointer.
Definition va.h:1672
VAGenericValueType type
Value type. See VAGenericValueType.
Definition va.h:1664
Huffman table for JPEG decoding.
Definition va.h:3107
uint8_t dc_values[12]
Value associated with each Huffman code (Vij).
Definition va.h:3117
uint8_t pad[2]
Padding to 4-byte boundaries. Must be set to zero.
Definition va.h:3126
uint8_t load_huffman_table[2]
Specifies which huffman_table is valid.
Definition va.h:3109
uint32_t va_reserved[VA_PADDING_LOW]
Reserved bytes for future use, must be zero.
Definition va.h:3131
uint8_t num_ac_codes[16]
Number of Huffman codes of length i + 1 (Li).
Definition va.h:3122
uint8_t ac_values[162]
Value associated with each Huffman code (Vij).
Definition va.h:3124
uint8_t num_dc_codes[16]
Number of Huffman codes of length i + 1 (Li).
Definition va.h:3115
Definition va.h:3653
uint32_t va_reserved[VA_PADDING_LOW]
Reserved bytes for future use, must be zero.
Definition va.h:3660
uint8_t ScalingList4x4[6][16]
4x4 scaling list, in raster scan order.
Definition va.h:3655
uint8_t ScalingList8x8[2][64]
8x8 scaling list, in raster scan order.
Definition va.h:3657
Definition va.h:3175
int32_t load_intra_quantiser_matrix
Same as the MPEG-2 bitstream syntax element.
Definition va.h:3177
int32_t load_chroma_intra_quantiser_matrix
Same as the MPEG-2 bitstream syntax element.
Definition va.h:3181
uint8_t intra_quantiser_matrix[64]
Luminance intra matrix, in zig-zag scan order.
Definition va.h:3185
uint32_t va_reserved[VA_PADDING_LOW]
Reserved bytes for future use, must be zero.
Definition va.h:3194
int32_t load_chroma_non_intra_quantiser_matrix
Same as the MPEG-2 bitstream syntax element.
Definition va.h:3183
uint8_t chroma_non_intra_quantiser_matrix[64]
Chroma non-intra matrix, in zig-zag scan order.
Definition va.h:3191
uint8_t non_intra_quantiser_matrix[64]
Luminance non-intra matrix, in zig-zag scan order.
Definition va.h:3187
uint8_t chroma_intra_quantiser_matrix[64]
Chroma intra matrix, in zig-zag scan order.
Definition va.h:3189
int32_t load_non_intra_quantiser_matrix
Same as the MPEG-2 bitstream syntax element.
Definition va.h:3179
Definition va.h:3327
int32_t load_intra_quant_mat
Definition va.h:3329
uint8_t intra_quant_mat[64]
Definition va.h:3333
int32_t load_non_intra_quant_mat
Definition va.h:3331
uint32_t va_reserved[VA_PADDING_LOW]
Reserved bytes for future use, must be zero.
Definition va.h:3338
uint8_t non_intra_quant_mat[64]
Definition va.h:3335
uint32_t va_reserved[VA_PADDING_LOW]
Reserved bytes for future use, must be zero.
Definition va.h:3250
Generic motion vector data structure.
Definition va.h:414
int16_t mv1[2]
Future reference.
Definition va.h:426
int16_t mv0[2]
Past reference.
Definition va.h:420
Description of picture properties of those in DPB surfaces.
Definition va.h:5292
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:5301
VASurfaceID picture_id
reconstructed picture buffer surface index invalid when taking value VA_INVALID_SURFACE.
Definition va.h:5296
uint32_t va_reserved[VA_PADDING_LOW]
Reserved bytes for future use, must be zero.
Definition va.h:5306
Definition va.h:3599
uint32_t va_reserved[VA_PADDING_MEDIUM]
Reserved bytes for future use, must be zero.
Definition va.h:3649
Definition va.h:3276
uint32_t va_reserved[VA_PADDING_LOW]
Reserved bytes for future use, must be zero.
Definition va.h:3323
Definition va.h:3380
uint32_t va_reserved[VA_PADDING_MEDIUM - 1]
Reserved bytes for future use, must be zero.
Definition va.h:3530
Description of picture properties of those in DPB surfaces.
Definition va.h:5358
int32_t pic_order_cnt
picture order count.
Definition va.h:5365
uint32_t va_reserved[VA_PADDING_LOW]
Reserved bytes for future use, must be zero.
Definition va.h:5371
VASurfaceID picture_id
reconstructed picture buffer surface index invalid when taking value VA_INVALID_SURFACE.
Definition va.h:5362
Definition va.h:2337
uint8_t level_idc
Profile level.
Definition va.h:2339
Definition va.h:2320
uint32_t intra_period
Period between I frames.
Definition va.h:2329
uint8_t level_idc
Profile level.
Definition va.h:2322
uint32_t ip_period
Period between I/P frames.
Definition va.h:2331
uint32_t quality_level
quality level. When set to 0, default quality level is used.
Definition va.h:2327
Structure to describe rectangle.
Definition va.h:406
Definition va.h:3664
uint8_t num_ref_idx_l0_active_minus1
Definition va.h:3689
uint8_t num_ref_idx_l1_active_minus1
Definition va.h:3696
uint32_t slice_data_offset
Byte offset to the NAL Header Unit for this slice.
Definition va.h:3667
uint16_t slice_data_bit_offset
Bit offset from NAL Header Unit to the begining of slice_data().
Definition va.h:3679
uint32_t va_reserved[VA_PADDING_LOW]
Reserved bytes for future use, must be zero.
Definition va.h:3720
Definition va.h:3198
uint32_t va_reserved[VA_PADDING_LOW]
Reserved bytes for future use, must be zero.
Definition va.h:3209
Definition va.h:3342
uint32_t va_reserved[VA_PADDING_LOW]
Reserved bytes for future use, must be zero.
Definition va.h:3351
Definition va.h:3552
uint32_t va_reserved[VA_PADDING_LOW]
Reserved bytes for future use, must be zero.
Definition va.h:3560
VASurfaceAttribExternalBuffers structure for the VASurfaceAttribExternalBufferDescriptor attribute.
Definition va.h:1784
uint32_t num_planes
number of planes for planar layout
Definition va.h:1794
uint32_t data_size
total size of the buffer in bytes.
Definition va.h:1792
uint32_t height
height in pixels.
Definition va.h:1790
uint32_t width
width in pixels.
Definition va.h:1788
uint32_t pixel_format
pixel format in fourcc.
Definition va.h:1786
uint32_t pitches[4]
pitch for each plane in bytes
Definition va.h:1796
uint32_t flags
flags. See "Surface external buffer descriptor flags".
Definition va.h:1804
uint32_t num_buffers
number of elements in the "buffers" array
Definition va.h:1802
uint32_t offsets[4]
offset for each plane in bytes
Definition va.h:1798
uintptr_t * buffers
buffer handles or user pointers
Definition va.h:1800
void * private_data
reserved for passing private data
Definition va.h:1806
Surface attribute.
Definition va.h:1742
VAGenericValue value
Value. See "Surface attribute types" for the expected types.
Definition va.h:1748
VASurfaceAttribType type
Type.
Definition va.h:1744
uint32_t flags
Flags. See "Surface attribute flags".
Definition va.h:1746
Definition va.h:4338
uint32_t va_reserved[VA_PADDING_LOW - 1]
Reserved bytes for future use, must be zero.
Definition va.h:4345
uint32_t reserved
reserved bits for future, must be zero
Definition va.h:1443
uint32_t priority
the priority , for the Query operation (read) it represents highest priority for the set operation (w...
Definition va.h:1441
Attribute value for VAConfigAttribEncJPEG.
Definition va.h:1284
uint32_t non_interleaved_mode
set to 1 for non-interleaved.
Definition va.h:1291
uint32_t differential_mode
set to 1 for differential.
Definition va.h:1293
uint32_t progressive_dct_mode
set to 1 for progressive dct.
Definition va.h:1289
uint32_t arithmatic_coding_mode
set to 1 for arithmatic coding.
Definition va.h:1287
uint32_t reserved
reserved bit for future, must be zero
Definition va.h:1458
uint32_t delta_qp_size_in_bytes
size of delta qp per block in bytes
Definition va.h:1456
uint32_t log2_delta_qp_block_size
supported size of delta qp block
Definition va.h:1454
uint32_t delta_qp_support
whether to support dela qp per block
Definition va.h:1452
Attribute value for VAConfigAttribEncROI.
Definition va.h:1347
uint32_t roi_rc_priority_support
A flag indicates whether ROI priority is supported.
Definition va.h:1362
uint32_t roi_rc_qp_delta_support
A flag indicates whether ROI delta QP is supported.
Definition va.h:1374
uint32_t num_roi_regions
The number of ROI regions supported, 0 if ROI is not supported.
Definition va.h:1350
Attribute value for VAConfigAttribEncRateControlExt.
Definition va.h:1381
uint32_t temporal_layer_bitrate_control_flag
Definition va.h:1415
uint32_t max_num_temporal_layers_minus1
The maximum number of temporal layers minus 1.
Definition va.h:1390
Attribute value for VAConfigAttribMaxFrameSize.
Definition va.h:1267
uint32_t max_frame_size
support max frame size if max_frame_size == 1, VAEncMiscParameterTypeMaxFrameSize/VAEncMiscParameterB...
Definition va.h:1274
uint32_t reserved
reserved bits for future, must be zero
Definition va.h:1278
uint32_t multiple_pass
multiple_pass support
Definition va.h:1276
Attribute value for VAConfigAttribMultipleFrame.
Definition va.h:1422
uint32_t reserved
reserved bit for future, must be zero
Definition va.h:1431
uint32_t max_num_concurrent_frames
max num of concurrent frames from different stream
Definition va.h:1425
uint32_t mixed_quality_level
indicate whether all stream must support same quality level if mixed_quality_level == 0,...
Definition va.h:1429
sub device info Sub-device is the concept basing on the "device" behind "vaDisplay"....
Definition va.h:5106
uint32_t sub_device_count
sub devices count, read - only
Definition va.h:5111
uint32_t reserved
reserved bits for future, must be zero
Definition va.h:5113
uint32_t sub_device_mask
bit mask to indicate which sub_device is available, read only
Definition va.h:5129
uint32_t current_sub_device
current sub device index, read - write
Definition va.h:5109
VASurfaceAttribAlignmentStruct structure for the VASurfaceAttribAlignmentSize attribute.
Definition va.h:1769
uint32_t log2_height_alignment
log2 height aligment
Definition va.h:1774
uint32_t log2_width_alignment
log2 width aligment
Definition va.h:1772
VAStatus vaGetDisplayAttributes(VADisplay dpy, VADisplayAttribute *attr_list, int num_attributes)
VADisplayAttribType
Definition va.h:5135
VAStatus vaCopy(VADisplay dpy, VACopyObject *dst, VACopyObject *src, VACopyOption option)
Copies an object.
VAStatus vaSetDisplayAttributes(VADisplay dpy, VADisplayAttribute *attr_list, int num_attributes)
VAStatus vaQueryDisplayAttributes(VADisplay dpy, VADisplayAttribute *attr_list, int *num_attributes)
#define va_deprecated_enum
Misc packed header. See codec-specific definitions.
Definition va.h:98
int vaMaxNumDisplayAttributes(VADisplay dpy)
The AV1 decoding API.
The HEVC decoding API.
The JPEG decoding API.
VP8 decoding API.
The VP9 decoding API.
The VVC decoding API.
AV1 encoding API.
The H.264 encoding API.
The HEVC encoding API.
JPEG encoding API.
The MPEG-2 encoding API.
VP8 encoding API.
VP9 encoding API.
The FEI encoding common API.
The FEI encoding H264 special API.
The FEI encoding HEVC special API.
Protected content API.
The video processing API.