VA-API  2.13.0.pre1
va.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2007-2009 Intel Corporation. All Rights Reserved.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the
6  * "Software"), to deal in the Software without restriction, including
7  * without limitation the rights to use, copy, modify, merge, publish,
8  * distribute, sub license, and/or sell copies of the Software, and to
9  * permit persons to whom the Software is furnished to do so, subject to
10  * the following conditions:
11  *
12  * The above copyright notice and this permission notice (including the
13  * next paragraph) shall be included in all copies or substantial portions
14  * of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
19  * IN NO EVENT SHALL INTEL AND/OR ITS SUPPLIERS BE LIABLE FOR
20  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23  */
24 /*
25  * Video Acceleration (VA) API Specification
26  *
27  * Rev. 0.30
28  * <jonathan.bian@intel.com>
29  *
30  * Revision History:
31  * rev 0.10 (12/10/2006 Jonathan Bian) - Initial draft
32  * rev 0.11 (12/15/2006 Jonathan Bian) - Fixed some errors
33  * rev 0.12 (02/05/2007 Jonathan Bian) - Added VC-1 data structures for slice level decode
34  * rev 0.13 (02/28/2007 Jonathan Bian) - Added GetDisplay()
35  * rev 0.14 (04/13/2007 Jonathan Bian) - Fixed MPEG-2 PictureParameter structure, cleaned up a few funcs.
36  * rev 0.15 (04/20/2007 Jonathan Bian) - Overhauled buffer management
37  * rev 0.16 (05/02/2007 Jonathan Bian) - Added error codes and fixed some issues with configuration
38  * rev 0.17 (05/07/2007 Jonathan Bian) - Added H.264/AVC data structures for slice level decode.
39  * rev 0.18 (05/14/2007 Jonathan Bian) - Added data structures for MPEG-4 slice level decode
40  * and MPEG-2 motion compensation.
41  * rev 0.19 (08/06/2007 Jonathan Bian) - Removed extra type for bitplane data.
42  * rev 0.20 (08/08/2007 Jonathan Bian) - Added missing fields to VC-1 PictureParameter structure.
43  * rev 0.21 (08/20/2007 Jonathan Bian) - Added image and subpicture support.
44  * rev 0.22 (08/27/2007 Jonathan Bian) - Added support for chroma-keying and global alpha.
45  * rev 0.23 (09/11/2007 Jonathan Bian) - Fixed some issues with images and subpictures.
46  * rev 0.24 (09/18/2007 Jonathan Bian) - Added display attributes.
47  * rev 0.25 (10/18/2007 Jonathan Bian) - Changed to use IDs only for some types.
48  * rev 0.26 (11/07/2007 Waldo Bastian) - Change vaCreateBuffer semantics
49  * rev 0.27 (11/19/2007 Matt Sottek) - Added DeriveImage
50  * rev 0.28 (12/06/2007 Jonathan Bian) - Added new versions of PutImage and AssociateSubpicture
51  * to enable scaling
52  * rev 0.29 (02/07/2008 Jonathan Bian) - VC1 parameter fixes,
53  * added VA_STATUS_ERROR_RESOLUTION_NOT_SUPPORTED
54  * rev 0.30 (03/01/2009 Jonathan Bian) - Added encoding support for H.264 BP and MPEG-4 SP and fixes
55  * for ISO C conformance.
56  * rev 0.31 (09/02/2009 Gwenole Beauchesne) - VC-1/H264 fields change for VDPAU and XvBA backend
57  * Application needs to relink with the new library.
58  *
59  * rev 0.31.1 (03/29/2009) - Data structure for JPEG encode
60  * rev 0.31.2 (01/13/2011 Anthony Pabon)- Added a flag to indicate Subpicture coordinates are screen
61  * screen relative rather than source video relative.
62  * rev 0.32.0 (01/13/2011 Xiang Haihao) - Add profile into VAPictureParameterBufferVC1
63  * update VAAPI to 0.32.0
64  *
65  * Acknowledgements:
66  * Some concepts borrowed from XvMC and XvImage.
67  * Waldo Bastian (Intel), Matt Sottek (Intel), Austin Yuan (Intel), and Gwenole Beauchesne (SDS)
68  * contributed to various aspects of the API.
69  */
70 
78 #ifndef _VA_H_
79 #define _VA_H_
80 
81 #include <stddef.h>
82 #include <stdint.h>
83 #include <va/va_version.h>
84 
85 #ifdef __cplusplus
86 extern "C" {
87 #endif
88 
89 #if defined(__GNUC__) && !defined(__COVERITY__)
90 #define va_deprecated __attribute__((deprecated))
91 #if __GNUC__ >= 6
92 #define va_deprecated_enum va_deprecated
93 #else
94 #define va_deprecated_enum
95 #endif
96 #else
97 #define va_deprecated
98 #define va_deprecated_enum
99 #endif
100 
258 typedef void* VADisplay; /* window system dependent */
259 
260 typedef int VAStatus;
262 #define VA_STATUS_SUCCESS 0x00000000
263 #define VA_STATUS_ERROR_OPERATION_FAILED 0x00000001
264 #define VA_STATUS_ERROR_ALLOCATION_FAILED 0x00000002
265 #define VA_STATUS_ERROR_INVALID_DISPLAY 0x00000003
266 #define VA_STATUS_ERROR_INVALID_CONFIG 0x00000004
267 #define VA_STATUS_ERROR_INVALID_CONTEXT 0x00000005
268 #define VA_STATUS_ERROR_INVALID_SURFACE 0x00000006
269 #define VA_STATUS_ERROR_INVALID_BUFFER 0x00000007
270 #define VA_STATUS_ERROR_INVALID_IMAGE 0x00000008
271 #define VA_STATUS_ERROR_INVALID_SUBPICTURE 0x00000009
272 #define VA_STATUS_ERROR_ATTR_NOT_SUPPORTED 0x0000000a
273 #define VA_STATUS_ERROR_MAX_NUM_EXCEEDED 0x0000000b
274 #define VA_STATUS_ERROR_UNSUPPORTED_PROFILE 0x0000000c
275 #define VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT 0x0000000d
276 #define VA_STATUS_ERROR_UNSUPPORTED_RT_FORMAT 0x0000000e
277 #define VA_STATUS_ERROR_UNSUPPORTED_BUFFERTYPE 0x0000000f
278 #define VA_STATUS_ERROR_SURFACE_BUSY 0x00000010
279 #define VA_STATUS_ERROR_FLAG_NOT_SUPPORTED 0x00000011
280 #define VA_STATUS_ERROR_INVALID_PARAMETER 0x00000012
281 #define VA_STATUS_ERROR_RESOLUTION_NOT_SUPPORTED 0x00000013
282 #define VA_STATUS_ERROR_UNIMPLEMENTED 0x00000014
283 #define VA_STATUS_ERROR_SURFACE_IN_DISPLAYING 0x00000015
284 #define VA_STATUS_ERROR_INVALID_IMAGE_FORMAT 0x00000016
285 #define VA_STATUS_ERROR_DECODING_ERROR 0x00000017
286 #define VA_STATUS_ERROR_ENCODING_ERROR 0x00000018
287 
294 #define VA_STATUS_ERROR_INVALID_VALUE 0x00000019
295 
296 #define VA_STATUS_ERROR_UNSUPPORTED_FILTER 0x00000020
297 
298 #define VA_STATUS_ERROR_INVALID_FILTER_CHAIN 0x00000021
299 
300 #define VA_STATUS_ERROR_HW_BUSY 0x00000022
301 
302 #define VA_STATUS_ERROR_UNSUPPORTED_MEMORY_TYPE 0x00000024
303 
304 #define VA_STATUS_ERROR_NOT_ENOUGH_BUFFER 0x00000025
305 
306 #define VA_STATUS_ERROR_TIMEDOUT 0x00000026
307 #define VA_STATUS_ERROR_UNKNOWN 0xFFFFFFFF
308 
316 #define VA_FRAME_PICTURE 0x00000000
317 #define VA_TOP_FIELD 0x00000001
318 #define VA_BOTTOM_FIELD 0x00000002
319 #define VA_TOP_FIELD_FIRST 0x00000004
320 #define VA_BOTTOM_FIELD_FIRST 0x00000008
321 
328 #define VA_ENABLE_BLEND 0x00000004 /* video area blend with the constant color */
329 
335 #define VA_CLEAR_DRAWABLE 0x00000008
336 
338 #define VA_SRC_COLOR_MASK 0x000000f0
339 #define VA_SRC_BT601 0x00000010
340 #define VA_SRC_BT709 0x00000020
341 #define VA_SRC_SMPTE_240 0x00000040
342 
344 #define VA_FILTER_SCALING_DEFAULT 0x00000000
345 #define VA_FILTER_SCALING_FAST 0x00000100
346 #define VA_FILTER_SCALING_HQ 0x00000200
347 #define VA_FILTER_SCALING_NL_ANAMORPHIC 0x00000300
348 #define VA_FILTER_SCALING_MASK 0x00000f00
349 
351 #define VA_FILTER_INTERPOLATION_DEFAULT 0x00000000
352 #define VA_FILTER_INTERPOLATION_NEAREST_NEIGHBOR 0x00001000
353 #define VA_FILTER_INTERPOLATION_BILINEAR 0x00002000
354 #define VA_FILTER_INTERPOLATION_ADVANCED 0x00003000
355 #define VA_FILTER_INTERPOLATION_MASK 0x0000f000
356 
358 #define VA_PADDING_LOW 4
359 #define VA_PADDING_MEDIUM 8
360 #define VA_PADDING_HIGH 16
361 #define VA_PADDING_LARGE 32
362 
365 #define VA_EXEC_SYNC 0x0
366 
367 #define VA_EXEC_ASYNC 0x1
368 
370 #define VA_EXEC_MODE_DEFAULT 0x0
371 #define VA_EXEC_MODE_POWER_SAVING 0x1
372 #define VA_EXEC_MODE_PERFORMANCE 0x2
373 
374 /* Values used to describe device features. */
379 #define VA_FEATURE_NOT_SUPPORTED 0
380 
389 #define VA_FEATURE_SUPPORTED 1
390 
396 #define VA_FEATURE_REQUIRED 2
397 
401 const char *vaErrorStr(VAStatus error_status);
402 
403 typedef struct _VARectangle
404 {
405  int16_t x;
406  int16_t y;
407  uint16_t width;
408  uint16_t height;
409 } VARectangle;
410 
412 typedef struct _VAMotionVector {
417  int16_t mv0[2]; /* past reference */
418  int16_t mv1[2]; /* future reference */
420 
422 typedef void (*VAMessageCallback)(void *user_context, const char *message);
423 
428 VAMessageCallback vaSetErrorCallback(VADisplay dpy, VAMessageCallback callback, void *user_context);
429 
434 VAMessageCallback vaSetInfoCallback(VADisplay dpy, VAMessageCallback callback, void *user_context);
435 
443 typedef void* VANativeDisplay; /* window system dependent */
444 
445 int vaDisplayIsValid(VADisplay dpy);
446 
450 VAStatus vaSetDriverName(VADisplay dpy,
451  char *driver_name
452 );
453 
457 VAStatus vaInitialize (
458  VADisplay dpy,
459  int *major_version, /* out */
460  int *minor_version /* out */
461 );
462 
466 VAStatus vaTerminate (
467  VADisplay dpy
468 );
469 
478 const char *vaQueryVendorString (
479  VADisplay dpy
480 );
481 
482 typedef int (*VAPrivFunc)(void);
483 
488 VAPrivFunc vaGetLibFunc (
489  VADisplay dpy,
490  const char *func
491 );
492 
494 typedef enum
495 {
498  VAProfileMPEG2Simple = 0,
499  VAProfileMPEG2Main = 1,
500  VAProfileMPEG4Simple = 2,
501  VAProfileMPEG4AdvancedSimple = 3,
502  VAProfileMPEG4Main = 4,
503  VAProfileH264Baseline va_deprecated_enum = 5,
504  VAProfileH264Main = 6,
505  VAProfileH264High = 7,
506  VAProfileVC1Simple = 8,
507  VAProfileVC1Main = 9,
508  VAProfileVC1Advanced = 10,
509  VAProfileH263Baseline = 11,
510  VAProfileJPEGBaseline = 12,
511  VAProfileH264ConstrainedBaseline = 13,
512  VAProfileVP8Version0_3 = 14,
513  VAProfileH264MultiviewHigh = 15,
514  VAProfileH264StereoHigh = 16,
515  VAProfileHEVCMain = 17,
516  VAProfileHEVCMain10 = 18,
517  VAProfileVP9Profile0 = 19,
518  VAProfileVP9Profile1 = 20,
519  VAProfileVP9Profile2 = 21,
520  VAProfileVP9Profile3 = 22,
521  VAProfileHEVCMain12 = 23,
522  VAProfileHEVCMain422_10 = 24,
523  VAProfileHEVCMain422_12 = 25,
524  VAProfileHEVCMain444 = 26,
525  VAProfileHEVCMain444_10 = 27,
526  VAProfileHEVCMain444_12 = 28,
527  VAProfileHEVCSccMain = 29,
528  VAProfileHEVCSccMain10 = 30,
529  VAProfileHEVCSccMain444 = 31,
530  VAProfileAV1Profile0 = 32,
531  VAProfileAV1Profile1 = 33,
532  VAProfileHEVCSccMain444_10 = 34,
535 } VAProfile;
536 
540 typedef enum
541 {
542  VAEntrypointVLD = 1,
543  VAEntrypointIZZ = 2,
544  VAEntrypointIDCT = 3,
545  VAEntrypointMoComp = 4,
546  VAEntrypointDeblocking = 5,
547  VAEntrypointEncSlice = 6, /* slice level encode */
548  VAEntrypointEncPicture = 7, /* pictuer encode, JPEG, etc */
549  /*
550  * For an implementation that supports a low power/high performance variant
551  * for slice level encode, it can choose to expose the
552  * VAEntrypointEncSliceLP entrypoint. Certain encoding tools may not be
553  * available with this entrypoint (e.g. interlace, MBAFF) and the
554  * application can query the encoding configuration attributes to find
555  * out more details if this entrypoint is supported.
556  */
557  VAEntrypointEncSliceLP = 8,
605 } VAEntrypoint;
606 
608 typedef enum
609 {
610  VAConfigAttribRTFormat = 0,
611  VAConfigAttribSpatialResidual = 1,
612  VAConfigAttribSpatialClipping = 2,
613  VAConfigAttribIntraResidual = 3,
614  VAConfigAttribEncryption = 4,
615  VAConfigAttribRateControl = 5,
616 
982 
1004  VAConfigAttribTypeMax
1006 
1013 typedef struct _VAConfigAttrib {
1014  VAConfigAttribType type;
1015  uint32_t value; /* OR'd flags (bits) for this attribute */
1016 } VAConfigAttrib;
1017 
1018 /* Attribute values for VAConfigAttribRTFormat. */
1019 
1020 #define VA_RT_FORMAT_YUV420 0x00000001
1021 #define VA_RT_FORMAT_YUV422 0x00000002
1022 #define VA_RT_FORMAT_YUV444 0x00000004
1023 #define VA_RT_FORMAT_YUV411 0x00000008
1024 #define VA_RT_FORMAT_YUV400 0x00000010
1025 #define VA_RT_FORMAT_YUV420_10 0x00000100
1026 #define VA_RT_FORMAT_YUV422_10 0x00000200
1027 #define VA_RT_FORMAT_YUV444_10 0x00000400
1028 #define VA_RT_FORMAT_YUV420_12 0x00001000
1029 #define VA_RT_FORMAT_YUV422_12 0x00002000
1030 #define VA_RT_FORMAT_YUV444_12 0x00004000
1031 
1032 #define VA_RT_FORMAT_RGB16 0x00010000
1033 #define VA_RT_FORMAT_RGB32 0x00020000
1034 #define VA_RT_FORMAT_RGBP 0x00100000
1035 #define VA_RT_FORMAT_RGB32_10 0x00200000
1036 
1037 #define VA_RT_FORMAT_PROTECTED 0x80000000
1038 
1039 #define VA_RT_FORMAT_RGB32_10BPP VA_RT_FORMAT_RGB32_10
1040 #define VA_RT_FORMAT_YUV420_10BPP VA_RT_FORMAT_YUV420_10
1041 
1042 
1045 #define VA_RC_NONE 0x00000001
1046 
1047 #define VA_RC_CBR 0x00000002
1048 
1049 #define VA_RC_VBR 0x00000004
1050 
1051 #define VA_RC_VCM 0x00000008
1052 
1053 #define VA_RC_CQP 0x00000010
1054 
1055 #define VA_RC_VBR_CONSTRAINED 0x00000020
1056 
1058 #define VA_RC_ICQ 0x00000040
1059 
1061 #define VA_RC_MB 0x00000080
1062 
1063 #define VA_RC_CFS 0x00000100
1064 
1074 #define VA_RC_PARALLEL 0x00000200
1075 
1081 #define VA_RC_QVBR 0x00000400
1082 
1092 #define VA_RC_AVBR 0x00000800
1093 
1101 #define VA_RC_TCBRC 0x00001000
1102 
1108 #define VA_DEC_SLICE_MODE_NORMAL 0x00000001
1109 
1110 #define VA_DEC_SLICE_MODE_BASE 0x00000002
1111 
1114 typedef union _VAConfigAttribValDecJPEG {
1115  struct {
1117  uint32_t rotation : 4;
1119  uint32_t reserved : 28;
1120  } bits;
1121  uint32_t value;
1122 } VAConfigAttribValDecJPEG;
1126 #define VA_DEC_PROCESSING_NONE 0x00000000
1127 
1128 #define VA_DEC_PROCESSING 0x00000001
1129 
1134 #define VA_ENC_PACKED_HEADER_NONE 0x00000000
1135 
1141 #define VA_ENC_PACKED_HEADER_SEQUENCE 0x00000001
1142 
1148 #define VA_ENC_PACKED_HEADER_PICTURE 0x00000002
1149 
1155 #define VA_ENC_PACKED_HEADER_SLICE 0x00000004
1156 
1164 #define VA_ENC_PACKED_HEADER_MISC 0x00000008
1165 
1166 #define VA_ENC_PACKED_HEADER_RAW_DATA 0x00000010
1167 
1172 #define VA_ENC_INTERLACED_NONE 0x00000000
1173 
1174 #define VA_ENC_INTERLACED_FRAME 0x00000001
1175 
1176 #define VA_ENC_INTERLACED_FIELD 0x00000002
1177 
1178 #define VA_ENC_INTERLACED_MBAFF 0x00000004
1179 
1180 #define VA_ENC_INTERLACED_PAFF 0x00000008
1181 
1186 #define VA_ENC_SLICE_STRUCTURE_POWER_OF_TWO_ROWS 0x00000001
1187 
1188 #define VA_ENC_SLICE_STRUCTURE_ARBITRARY_MACROBLOCKS 0x00000002
1189 
1190 #define VA_ENC_SLICE_STRUCTURE_EQUAL_ROWS 0x00000004
1191 
1192 #define VA_ENC_SLICE_STRUCTURE_MAX_SLICE_SIZE 0x00000008
1193 
1194 #define VA_ENC_SLICE_STRUCTURE_ARBITRARY_ROWS 0x00000010
1195 
1198 #define VA_ENC_SLICE_STRUCTURE_EQUAL_MULTI_ROWS 0x00000020
1199 
1202 typedef union _VAConfigAttribValMaxFrameSize {
1203  struct {
1209  uint32_t max_frame_size : 1;
1211  uint32_t multiple_pass : 1;
1213  uint32_t reserved :30;
1214  } bits;
1215  uint32_t value;
1217 
1219 typedef union _VAConfigAttribValEncJPEG {
1220  struct {
1224  uint32_t progressive_dct_mode : 1;
1226  uint32_t non_interleaved_mode : 1;
1228  uint32_t differential_mode : 1;
1229  uint32_t max_num_components : 3;
1230  uint32_t max_num_scans : 4;
1231  uint32_t max_num_huffman_tables : 3;
1232  uint32_t max_num_quantization_tables : 3;
1233  } bits;
1234  uint32_t value;
1236 
1240 #define VA_ENC_QUANTIZATION_NONE 0x00000000
1241 
1242 #define VA_ENC_QUANTIZATION_TRELLIS_SUPPORTED 0x00000001
1243 
1253 #define VA_PREDICTION_DIRECTION_PREVIOUS 0x00000001
1254 
1255 #define VA_PREDICTION_DIRECTION_FUTURE 0x00000002
1256 
1257 #define VA_PREDICTION_DIRECTION_BI_NOT_EMPTY 0x00000004
1258 
1263 #define VA_ENC_INTRA_REFRESH_NONE 0x00000000
1264 
1265 #define VA_ENC_INTRA_REFRESH_ROLLING_COLUMN 0x00000001
1266 
1267 #define VA_ENC_INTRA_REFRESH_ROLLING_ROW 0x00000002
1268 
1269 #define VA_ENC_INTRA_REFRESH_ADAPTIVE 0x00000010
1270 
1271 #define VA_ENC_INTRA_REFRESH_CYCLIC 0x00000020
1272 
1273 #define VA_ENC_INTRA_REFRESH_P_FRAME 0x00010000
1274 
1275 #define VA_ENC_INTRA_REFRESH_B_FRAME 0x00020000
1276 
1277 #define VA_ENC_INTRA_REFRESH_MULTI_REF 0x00040000
1278 
1282 typedef union _VAConfigAttribValEncROI {
1283  struct {
1285  uint32_t num_roi_regions : 8;
1310  uint32_t reserved : 22;
1311  } bits;
1312  uint32_t value;
1314 
1316 typedef union _VAConfigAttribValEncRateControlExt {
1317  struct {
1326 
1351  uint32_t reserved : 23;
1352  } bits;
1353  uint32_t value;
1355 
1357 typedef union _VAConfigAttribValMultipleFrame {
1358  struct {
1364  uint32_t mixed_quality_level : 1;
1366  uint32_t reserved : 23;
1367  } bits;
1368  uint32_t value;
1370 
1372 typedef union _VAConfigAttribValContextPriority{
1373  struct{
1376  uint32_t priority :16;
1378  uint32_t reserved :16;
1379  }bits;
1380  uint32_t value;
1382 
1385 #define VA_PC_CIPHER_AES 0x00000001
1386 
1389 #define VA_PC_BLOCK_SIZE_128 0x00000001
1390 
1391 #define VA_PC_BLOCK_SIZE_192 0x00000002
1392 
1393 #define VA_PC_BLOCK_SIZE_256 0x00000004
1394 
1397 #define VA_PC_CIPHER_MODE_ECB 0x00000001
1398 
1399 #define VA_PC_CIPHER_MODE_CBC 0x00000002
1400 
1401 #define VA_PC_CIPHER_MODE_CTR 0x00000004
1402 
1405 #define VA_PC_SAMPLE_TYPE_FULLSAMPLE 0x00000001
1406 
1407 #define VA_PC_SAMPLE_TYPE_SUBSAMPLE 0x00000002
1408 
1411 #define VA_PC_USAGE_DEFAULT 0x00000000
1412 
1413 #define VA_PC_USAGE_WIDEVINE 0x00000001
1414 
1418 #define VA_PROCESSING_RATE_NONE 0x00000000
1419 
1420 #define VA_PROCESSING_RATE_ENCODE 0x00000001
1421 
1422 #define VA_PROCESSING_RATE_DECODE 0x00000002
1423 
1428 #define VA_ATTRIB_NOT_SUPPORTED 0x80000000
1429 
1431 int vaMaxNumProfiles (
1432  VADisplay dpy
1433 );
1434 
1436 int vaMaxNumEntrypoints (
1437  VADisplay dpy
1438 );
1439 
1442  VADisplay dpy
1443 );
1444 
1451 VAStatus vaQueryConfigProfiles (
1452  VADisplay dpy,
1453  VAProfile *profile_list, /* out */
1454  int *num_profiles /* out */
1455 );
1456 
1463 VAStatus vaQueryConfigEntrypoints (
1464  VADisplay dpy,
1465  VAProfile profile,
1466  VAEntrypoint *entrypoint_list, /* out */
1467  int *num_entrypoints /* out */
1468 );
1469 
1478 VAStatus vaGetConfigAttributes (
1479  VADisplay dpy,
1480  VAProfile profile,
1481  VAEntrypoint entrypoint,
1482  VAConfigAttrib *attrib_list, /* in/out */
1483  int num_attribs
1484 );
1485 
1487 typedef unsigned int VAGenericID;
1488 
1489 typedef VAGenericID VAConfigID;
1490 
1496 VAStatus vaCreateConfig (
1497  VADisplay dpy,
1498  VAProfile profile,
1499  VAEntrypoint entrypoint,
1500  VAConfigAttrib *attrib_list,
1501  int num_attribs,
1502  VAConfigID *config_id /* out */
1503 );
1504 
1508 VAStatus vaDestroyConfig (
1509  VADisplay dpy,
1510  VAConfigID config_id
1511 );
1512 
1521 VAStatus vaQueryConfigAttributes (
1522  VADisplay dpy,
1523  VAConfigID config_id,
1524  VAProfile *profile, /* out */
1525  VAEntrypoint *entrypoint, /* out */
1526  VAConfigAttrib *attrib_list,/* out */
1527  int *num_attribs /* out */
1528 );
1529 
1530 
1550 typedef VAGenericID VAContextID;
1551 
1552 typedef VAGenericID VASurfaceID;
1553 
1554 #define VA_INVALID_ID 0xffffffff
1555 #define VA_INVALID_SURFACE VA_INVALID_ID
1556 
1558 typedef enum {
1564 
1566 typedef void (*VAGenericFunc)(void);
1567 
1569 typedef struct _VAGenericValue {
1571  VAGenericValueType type;
1573  union {
1575  int32_t i;
1577  float f;
1579  void *p;
1582  } value;
1583 } VAGenericValue;
1584 
1588 #define VA_SURFACE_ATTRIB_NOT_SUPPORTED 0x00000000
1589 
1590 #define VA_SURFACE_ATTRIB_GETTABLE 0x00000001
1591 
1592 #define VA_SURFACE_ATTRIB_SETTABLE 0x00000002
1593 
1596 typedef enum {
1597  VASurfaceAttribNone = 0,
1638 
1640 typedef struct _VASurfaceAttrib {
1642  VASurfaceAttribType type;
1644  uint32_t flags;
1647 } VASurfaceAttrib;
1648 
1657 #define VA_SURFACE_ATTRIB_MEM_TYPE_VA 0x00000001
1658 
1659 #define VA_SURFACE_ATTRIB_MEM_TYPE_V4L2 0x00000002
1660 
1661 #define VA_SURFACE_ATTRIB_MEM_TYPE_USER_PTR 0x00000004
1662 
1668 typedef struct _VASurfaceAttribExternalBuffers {
1670  uint32_t pixel_format;
1672  uint32_t width;
1674  uint32_t height;
1676  uint32_t data_size;
1678  uint32_t num_planes;
1680  uint32_t pitches[4];
1682  uint32_t offsets[4];
1684  uintptr_t *buffers;
1686  uint32_t num_buffers;
1688  uint32_t flags;
1692 
1696 #define VA_SURFACE_EXTBUF_DESC_ENABLE_TILING 0x00000001
1697 
1698 #define VA_SURFACE_EXTBUF_DESC_CACHED 0x00000002
1699 
1700 #define VA_SURFACE_EXTBUF_DESC_UNCACHED 0x00000004
1701 
1702 #define VA_SURFACE_EXTBUF_DESC_WC 0x00000008
1703 
1704 #define VA_SURFACE_EXTBUF_DESC_PROTECTED 0x80000000
1705 
1709 #define VA_SURFACE_ATTRIB_USAGE_HINT_GENERIC 0x00000000
1710 
1711 #define VA_SURFACE_ATTRIB_USAGE_HINT_DECODER 0x00000001
1712 
1713 #define VA_SURFACE_ATTRIB_USAGE_HINT_ENCODER 0x00000002
1714 
1715 #define VA_SURFACE_ATTRIB_USAGE_HINT_VPP_READ 0x00000004
1716 
1717 #define VA_SURFACE_ATTRIB_USAGE_HINT_VPP_WRITE 0x00000008
1718 
1719 #define VA_SURFACE_ATTRIB_USAGE_HINT_DISPLAY 0x00000010
1720 
1722 #define VA_SURFACE_ATTRIB_USAGE_HINT_EXPORT 0x00000020
1723 
1753 VAStatus
1755  VADisplay dpy,
1756  VAConfigID config,
1757  VASurfaceAttrib *attrib_list,
1758  unsigned int *num_attribs
1759 );
1760 
1778 VAStatus
1780  VADisplay dpy,
1781  unsigned int format,
1782  unsigned int width,
1783  unsigned int height,
1784  VASurfaceID *surfaces,
1785  unsigned int num_surfaces,
1786  VASurfaceAttrib *attrib_list,
1787  unsigned int num_attribs
1788 );
1789 
1798 VAStatus vaDestroySurfaces (
1799  VADisplay dpy,
1800  VASurfaceID *surfaces,
1801  int num_surfaces
1802 );
1803 
1804 #define VA_PROGRESSIVE 0x1
1805 
1817 VAStatus vaCreateContext (
1818  VADisplay dpy,
1819  VAConfigID config_id,
1820  int picture_width,
1821  int picture_height,
1822  int flag,
1823  VASurfaceID *render_targets,
1824  int num_render_targets,
1825  VAContextID *context /* out */
1826 );
1827 
1833 VAStatus vaDestroyContext (
1834  VADisplay dpy,
1835  VAContextID context
1836 );
1837 
1838 //Multi-frame context
1839 typedef VAGenericID VAMFContextID;
1856 VAStatus vaCreateMFContext (
1857  VADisplay dpy,
1858  VAMFContextID *mf_context /* out */
1859 );
1860 
1894 VAStatus vaMFAddContext (
1895  VADisplay dpy,
1896  VAMFContextID mf_context,
1897  VAContextID context
1898 );
1899 
1912 VAStatus vaMFReleaseContext (
1913  VADisplay dpy,
1914  VAMFContextID mf_context,
1915  VAContextID context
1916 );
1917 
1926 typedef VAGenericID VABufferID;
1927 
1928 typedef enum
1929 {
1930  VAPictureParameterBufferType = 0,
1931  VAIQMatrixBufferType = 1,
1932  VABitPlaneBufferType = 2,
1933  VASliceGroupMapBufferType = 3,
1934  VASliceParameterBufferType = 4,
1935  VASliceDataBufferType = 5,
1936  VAMacroblockParameterBufferType = 6,
1937  VAResidualDataBufferType = 7,
1938  VADeblockingParameterBufferType = 8,
1939  VAImageBufferType = 9,
1940  VAProtectedSliceDataBufferType = 10,
1941  VAQMatrixBufferType = 11,
1942  VAHuffmanTableBufferType = 12,
1943  VAProbabilityBufferType = 13,
1944 
1945 /* Following are encode buffer types */
1946  VAEncCodedBufferType = 21,
1947  VAEncSequenceParameterBufferType = 22,
1948  VAEncPictureParameterBufferType = 23,
1949  VAEncSliceParameterBufferType = 24,
1950  VAEncPackedHeaderParameterBufferType = 25,
1951  VAEncPackedHeaderDataBufferType = 26,
1952  VAEncMiscParameterBufferType = 27,
1953  VAEncMacroblockParameterBufferType = 28,
1954  VAEncMacroblockMapBufferType = 29,
1955 
1964 /* Following are video processing buffer types */
1989  VAEncFEIMBCodeBufferType = 44,
1990  VAEncFEIDistortionBufferType = 45,
1991  VAEncFEIMBControlBufferType = 46,
1992  VAEncFEIMVPredictorBufferType = 47,
1993  VAStatsStatisticsParameterBufferType = 48,
1998  VAStatsMVBufferType = 51,
1999  VAStatsMVPredictorBufferType = 52,
2020 
2045 
2051 
2052  VABufferTypeMax
2053 } VABufferType;
2054 
2060 typedef struct _VAContextParameterUpdateBuffer
2061 {
2062  union{
2063  struct {
2067  uint32_t reserved :31;
2068  } bits;
2069  uint32_t value;
2070  }flags;
2074  uint32_t reserved[VA_PADDING_MEDIUM];
2076 
2089 #define VA_ENCRYPTION_TYPE_FULLSAMPLE_CTR 0x00000001 /* AES CTR fullsample */
2090 #define VA_ENCRYPTION_TYPE_FULLSAMPLE_CBC 0x00000002 /* AES CBC fullsample */
2091 #define VA_ENCRYPTION_TYPE_SUBSAMPLE_CTR 0x00000004 /* AES CTR fullsample */
2092 #define VA_ENCRYPTION_TYPE_SUBSAMPLE_CBC 0x00000008 /* AES CBC fullsample */
2093 
2095 typedef struct _VAEncryptionSegmentInfo {
2100  uint32_t segment_length;
2109  uint8_t aes_cbc_iv_or_ctr[64];
2111  uint32_t va_reserved[VA_PADDING_MEDIUM];
2113 
2115 typedef struct _VAEncryptionParameters {
2121  uint32_t num_segments;
2129  uint32_t size_of_length;
2132  uint8_t wrapped_decrypt_blob[64];
2135  uint8_t wrapped_encrypt_blob[64];
2140  uint32_t key_blob_size;
2158  uint32_t va_reserved[VA_PADDING_MEDIUM];
2160 
2164 typedef struct _VAProcessingRateParameterEnc {
2166  uint8_t level_idc;
2167  uint8_t reserved[3];
2171  uint32_t quality_level;
2173  uint32_t intra_period;
2175  uint32_t ip_period;
2177 
2181 typedef struct _VAProcessingRateParameterDec {
2183  uint8_t level_idc;
2184  uint8_t reserved0[3];
2185  uint32_t reserved;
2187 
2188 typedef struct _VAProcessingRateParameter {
2189  union {
2190  VAProcessingRateParameterEnc proc_buf_enc;
2191  VAProcessingRateParameterDec proc_buf_dec;
2192  };
2193 } VAProcessingRateParameter;
2194 
2215 VAStatus
2217  VADisplay dpy,
2218  VAConfigID config,
2219  VAProcessingRateParameter *proc_buf,
2220  unsigned int *processing_rate
2221 );
2222 
2223 typedef enum
2224 {
2225  VAEncMiscParameterTypeFrameRate = 0,
2226  VAEncMiscParameterTypeRateControl = 1,
2227  VAEncMiscParameterTypeMaxSliceSize = 2,
2228  VAEncMiscParameterTypeAIR = 3,
2233  VAEncMiscParameterTypeQualityLevel = 6,
2262 
2264 typedef enum {
2287  VAEncPackedHeaderMiscMask va_deprecated_enum = 0x80000000,
2289 
2291 typedef struct _VAEncPackedHeaderParameterBuffer {
2293  uint32_t type;
2295  uint32_t bit_length;
2298 
2300  uint32_t va_reserved[VA_PADDING_LOW];
2302 
2320 typedef struct _VAEncMiscParameterBuffer
2321 {
2323  uint32_t data[];
2325 
2327 typedef struct _VAEncMiscParameterTemporalLayerStructure
2328 {
2332  uint32_t periodicity;
2339  uint32_t layer_id[32];
2340 
2342  uint32_t va_reserved[VA_PADDING_LOW];
2344 
2345 
2347 typedef struct _VAEncMiscParameterRateControl
2348 {
2362  uint32_t window_size;
2367  uint32_t initial_qp;
2373  uint32_t min_qp;
2379  union
2380  {
2381  struct
2382  {
2388  uint32_t reset : 1;
2390  uint32_t disable_frame_skip : 1;
2392  uint32_t disable_bit_stuffing : 1;
2400  uint32_t mb_rate_control : 4;
2402  uint32_t temporal_id : 8;
2404  uint32_t cfs_I_frames : 1;
2409  uint32_t enable_parallel_brc : 1;
2410  uint32_t enable_dynamic_scaling : 1;
2425  uint32_t frame_tolerance_mode : 2;
2427  uint32_t reserved : 12;
2428  } bits;
2429  uint32_t value;
2430  } rc_flags;
2442  uint32_t max_qp;
2447  uint32_t quality_factor;
2458  uint32_t va_reserved[VA_PADDING_LOW];
2460 
2467 typedef struct _VAEncMiscParameterFrameRate
2468 {
2488  uint32_t framerate;
2489  union
2490  {
2491  struct
2492  {
2494  uint32_t temporal_id : 8;
2496  uint32_t reserved : 24;
2497  } bits;
2498  uint32_t value;
2499  } framerate_flags;
2500 
2502  uint32_t va_reserved[VA_PADDING_LOW];
2504 
2510 typedef struct _VAEncMiscParameterMaxSliceSize
2511 {
2512  uint32_t max_slice_size;
2513 
2515  uint32_t va_reserved[VA_PADDING_LOW];
2517 
2518 typedef struct _VAEncMiscParameterAIR
2519 {
2520  uint32_t air_num_mbs;
2521  uint32_t air_threshold;
2522  uint32_t air_auto; /* if set to 1 then hardware auto-tune the AIR threshold */
2523 
2525  uint32_t va_reserved[VA_PADDING_LOW];
2526 } VAEncMiscParameterAIR;
2527 
2528 /*
2529  * \brief Rolling intra refresh data structure for encoding.
2530  */
2531 typedef struct _VAEncMiscParameterRIR
2532 {
2533  union
2534  {
2535  struct
2542  {
2543  /* \brief enable RIR in column */
2544  uint32_t enable_rir_column : 1;
2545  /* \brief enable RIR in row */
2546  uint32_t enable_rir_row : 1;
2547  uint32_t reserved : 30;
2548  } bits;
2549  uint32_t value;
2550  } rir_flags;
2555  uint16_t intra_insertion_location;
2560  uint16_t intra_insert_size;
2565  uint8_t qp_delta_for_inserted_intra;
2567  uint32_t va_reserved[VA_PADDING_LOW];
2568 } VAEncMiscParameterRIR;
2569 
2578 typedef struct _VAEncMiscParameterHRD
2579 {
2596  uint32_t buffer_size;
2597 
2599  uint32_t va_reserved[VA_PADDING_LOW];
2601 
2611 typedef struct _VAEncMiscParameterBufferMaxFrameSize {
2614  va_deprecated VAEncMiscParameterType type;
2616  uint32_t max_frame_size;
2617 
2619  uint32_t va_reserved[VA_PADDING_LOW];
2621 
2631 typedef struct _VAEncMiscParameterBufferMultiPassFrameSize {
2634  va_deprecated VAEncMiscParameterType type;
2636  uint32_t max_frame_size;
2638  uint32_t reserved;
2640  uint8_t num_passes;
2642  uint8_t *delta_qp;
2643 
2645  unsigned long va_reserved[VA_PADDING_LOW];
2647 
2659 typedef struct _VAEncMiscParameterBufferQualityLevel {
2663  uint32_t quality_level;
2664 
2666  uint32_t va_reserved[VA_PADDING_LOW];
2668 
2675 typedef struct _VAEncMiscParameterQuantization
2676 {
2677  union
2678  {
2679  /* if no flags is set then quantization is determined by the driver */
2680  struct
2681  {
2682  /* \brief disable trellis for all frames/fields */
2683  uint32_t disable_trellis : 1;
2684  /* \brief enable trellis for I frames/fields */
2685  uint32_t enable_trellis_I : 1;
2686  /* \brief enable trellis for P frames/fields */
2687  uint32_t enable_trellis_P : 1;
2688  /* \brief enable trellis for B frames/fields */
2689  uint32_t enable_trellis_B : 1;
2690  uint32_t reserved : 28;
2691  } bits;
2692  uint32_t value;
2693  } quantization_flags;
2694  uint32_t va_reserved;
2696 
2706 typedef struct _VAEncMiscParameterSkipFrame {
2719 
2721  uint32_t va_reserved[VA_PADDING_LOW];
2723 
2733 typedef struct _VAEncROI
2734 {
2738  VARectangle roi_rectangle;
2757  int8_t roi_value;
2758 } VAEncROI;
2759 
2760 typedef struct _VAEncMiscParameterBufferROI {
2762  uint32_t num_roi;
2763 
2767  int8_t max_delta_qp;
2768  int8_t min_delta_qp;
2769 
2772  VAEncROI *roi;
2773  union {
2774  struct {
2787  uint32_t roi_value_is_qp_delta : 1;
2788  uint32_t reserved : 31;
2789  } bits;
2790  uint32_t value;
2791  } roi_flags;
2792 
2794  uint32_t va_reserved[VA_PADDING_LOW];
2795 } VAEncMiscParameterBufferROI;
2796 /*
2797  * \brief Dirty rectangle data structure for encoding.
2798  *
2799  * The encoding dirty rect can be set through VAEncMiscParameterBufferDirtyRect, if the
2800  * implementation supports dirty rect input. The rect set through this structure is applicable
2801  * only to the current frame or field, so must be sent every frame or field to be applied.
2802  * The number of supported rects can be queried through the VAConfigAttribEncDirtyRect. The
2803  * encoder will use the rect information to know those rectangle areas have changed while the
2804  * areas not covered by dirty rect rectangles are assumed to have not changed compared to the
2805  * previous picture. The encoder may do some internal optimizations.
2806  */
2807 typedef struct _VAEncMiscParameterBufferDirtyRect
2808 {
2810  uint32_t num_roi_rectangle;
2811 
2813  VARectangle *roi_rectangle;
2814 } VAEncMiscParameterBufferDirtyRect;
2815 
2817 typedef struct _VAEncMiscParameterParallelRateControl {
2819  uint32_t num_layers;
2824  uint32_t *num_b_in_gop;
2826 
2829 typedef struct _VAEncMiscParameterEncQuality
2830 {
2831  union
2832  {
2833  struct
2834  {
2838  uint32_t useRawPicForRef : 1;
2841  uint32_t skipCheckDisable : 1;
2844  uint32_t FTQOverride : 1;
2846  uint32_t FTQEnable : 1;
2853  uint32_t ReservedBit : 1;
2872  uint32_t HMEDisable : 1;
2874  uint32_t SuperHMEDisable : 1;
2876  uint32_t UltraHMEDisable : 1;
2880  uint32_t PanicModeDisable : 1;
2886 
2887  };
2888  uint32_t encControls;
2889  };
2890 
2892  uint8_t FTQSkipThresholdLUT[52];
2894  uint16_t NonFTQSkipThresholdLUT[52];
2895 
2896  uint32_t reserved[VA_PADDING_HIGH]; // Reserved for future use.
2897 
2899 
2906 typedef struct _VAEncMiscParameterCustomRoundingControl
2907 {
2908  union {
2909  struct {
2915 
2920 
2926 
2931 
2932  /* Reserved */
2933  uint32_t reserved :16;
2934  } bits;
2935  uint32_t value;
2936  } rounding_offset_setting;
2938 
2947 #define VA_SLICE_DATA_FLAG_ALL 0x00 /* whole slice is in the buffer */
2948 #define VA_SLICE_DATA_FLAG_BEGIN 0x01 /* The beginning of the slice is in the buffer but the end if not */
2949 #define VA_SLICE_DATA_FLAG_MIDDLE 0x02 /* Neither beginning nor end of the slice is in the buffer */
2950 #define VA_SLICE_DATA_FLAG_END 0x04 /* end of the slice is in the buffer */
2951 
2952 /* Codec-independent Slice Parameter Buffer base */
2953 typedef struct _VASliceParameterBufferBase
2954 {
2955  uint32_t slice_data_size; /* number of bytes in the slice data buffer for this slice */
2956  uint32_t slice_data_offset; /* the offset to the first byte of slice data */
2957  uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX definitions */
2958 } VASliceParameterBufferBase;
2959 
2960 /**********************************
2961  * JPEG common data structures
2962  **********************************/
2975 typedef struct _VAHuffmanTableBufferJPEGBaseline {
2977  uint8_t load_huffman_table[2];
2979  struct {
2983  uint8_t num_dc_codes[16];
2985  uint8_t dc_values[12];
2990  uint8_t num_ac_codes[16];
2992  uint8_t ac_values[162];
2994  uint8_t pad[2];
2996  } huffman_table[2];
2997 
2999  uint32_t va_reserved[VA_PADDING_LOW];
3001 
3002 /****************************
3003  * MPEG-2 data structures
3004  ****************************/
3005 
3006 /* MPEG-2 Picture Parameter Buffer */
3007 /*
3008  * For each frame or field, and before any slice data, a single
3009  * picture parameter buffer must be send.
3010  */
3011 typedef struct _VAPictureParameterBufferMPEG2
3012 {
3013  uint16_t horizontal_size;
3014  uint16_t vertical_size;
3015  VASurfaceID forward_reference_picture;
3016  VASurfaceID backward_reference_picture;
3017  /* meanings of the following fields are the same as in the standard */
3018  int32_t picture_coding_type;
3019  int32_t f_code; /* pack all four fcode into this */
3020  union {
3021  struct {
3022  uint32_t intra_dc_precision : 2;
3023  uint32_t picture_structure : 2;
3024  uint32_t top_field_first : 1;
3025  uint32_t frame_pred_frame_dct : 1;
3026  uint32_t concealment_motion_vectors : 1;
3027  uint32_t q_scale_type : 1;
3028  uint32_t intra_vlc_format : 1;
3029  uint32_t alternate_scan : 1;
3030  uint32_t repeat_first_field : 1;
3031  uint32_t progressive_frame : 1;
3032  uint32_t is_first_field : 1; /* indicate whether the current field
3033  * is the first field for field picture
3034  */
3035  } bits;
3036  uint32_t value;
3037  } picture_coding_extension;
3038 
3040  uint32_t va_reserved[VA_PADDING_LOW];
3041 } VAPictureParameterBufferMPEG2;
3042 
3044 typedef struct _VAIQMatrixBufferMPEG2
3045 {
3055  uint8_t intra_quantiser_matrix[64];
3057  uint8_t non_intra_quantiser_matrix[64];
3059  uint8_t chroma_intra_quantiser_matrix[64];
3061  uint8_t chroma_non_intra_quantiser_matrix[64];
3062 
3064  uint32_t va_reserved[VA_PADDING_LOW];
3066 
3068 typedef struct _VASliceParameterBufferMPEG2
3069 {
3070  uint32_t slice_data_size;/* number of bytes in the slice data buffer for this slice */
3071  uint32_t slice_data_offset;/* the offset to the first byte of slice data */
3072  uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
3073  uint32_t macroblock_offset;/* the offset to the first bit of MB from the first byte of slice data */
3074  uint32_t slice_horizontal_position;
3075  uint32_t slice_vertical_position;
3076  int32_t quantiser_scale_code;
3077  int32_t intra_slice_flag;
3078 
3080  uint32_t va_reserved[VA_PADDING_LOW];
3082 
3084 typedef struct _VAMacroblockParameterBufferMPEG2
3085 {
3086  uint16_t macroblock_address;
3087  /*
3088  * macroblock_address (in raster scan order)
3089  * top-left: 0
3090  * bottom-right: picture-height-in-mb*picture-width-in-mb - 1
3091  */
3092  uint8_t macroblock_type; /* see definition below */
3093  union {
3094  struct {
3095  uint32_t frame_motion_type : 2;
3096  uint32_t field_motion_type : 2;
3097  uint32_t dct_type : 1;
3098  } bits;
3099  uint32_t value;
3100  } macroblock_modes;
3101  uint8_t motion_vertical_field_select;
3102  /*
3103  * motion_vertical_field_select:
3104  * see section 6.3.17.2 in the spec
3105  * only the lower 4 bits are used
3106  * bit 0: first vector forward
3107  * bit 1: first vector backward
3108  * bit 2: second vector forward
3109  * bit 3: second vector backward
3110  */
3111  int16_t PMV[2][2][2]; /* see Table 7-7 in the spec */
3112  uint16_t coded_block_pattern;
3113  /*
3114  * The bitplanes for coded_block_pattern are described
3115  * in Figure 6.10-12 in the spec
3116  */
3117 
3118  /* Number of skipped macroblocks after this macroblock */
3119  uint16_t num_skipped_macroblocks;
3120 
3122  uint32_t va_reserved[VA_PADDING_LOW];
3124 
3125 /*
3126  * OR'd flags for macroblock_type (section 6.3.17.1 in the spec)
3127  */
3128 #define VA_MB_TYPE_MOTION_FORWARD 0x02
3129 #define VA_MB_TYPE_MOTION_BACKWARD 0x04
3130 #define VA_MB_TYPE_MOTION_PATTERN 0x08
3131 #define VA_MB_TYPE_MOTION_INTRA 0x10
3132 
3139 /****************************
3140  * MPEG-4 Part 2 data structures
3141  ****************************/
3142 
3143 /* MPEG-4 Picture Parameter Buffer */
3144 /*
3145  * For each frame or field, and before any slice data, a single
3146  * picture parameter buffer must be send.
3147  */
3148 typedef struct _VAPictureParameterBufferMPEG4
3149 {
3150  uint16_t vop_width;
3151  uint16_t vop_height;
3152  VASurfaceID forward_reference_picture;
3153  VASurfaceID backward_reference_picture;
3154  union {
3155  struct {
3156  uint32_t short_video_header : 1;
3157  uint32_t chroma_format : 2;
3158  uint32_t interlaced : 1;
3159  uint32_t obmc_disable : 1;
3160  uint32_t sprite_enable : 2;
3161  uint32_t sprite_warping_accuracy : 2;
3162  uint32_t quant_type : 1;
3163  uint32_t quarter_sample : 1;
3164  uint32_t data_partitioned : 1;
3165  uint32_t reversible_vlc : 1;
3166  uint32_t resync_marker_disable : 1;
3167  } bits;
3168  uint32_t value;
3169  } vol_fields;
3170  uint8_t no_of_sprite_warping_points;
3171  int16_t sprite_trajectory_du[3];
3172  int16_t sprite_trajectory_dv[3];
3173  uint8_t quant_precision;
3174  union {
3175  struct {
3176  uint32_t vop_coding_type : 2;
3177  uint32_t backward_reference_vop_coding_type : 2;
3178  uint32_t vop_rounding_type : 1;
3179  uint32_t intra_dc_vlc_thr : 3;
3180  uint32_t top_field_first : 1;
3181  uint32_t alternate_vertical_scan_flag : 1;
3182  } bits;
3183  uint32_t value;
3184  } vop_fields;
3185  uint8_t vop_fcode_forward;
3186  uint8_t vop_fcode_backward;
3187  uint16_t vop_time_increment_resolution;
3188  /* short header related */
3189  uint8_t num_gobs_in_vop;
3190  uint8_t num_macroblocks_in_gob;
3191  /* for direct mode prediction */
3192  int16_t TRB;
3193  int16_t TRD;
3194 
3196  uint32_t va_reserved[VA_PADDING_LOW];
3198 
3200 typedef struct _VAIQMatrixBufferMPEG4
3201 {
3207  uint8_t intra_quant_mat[64];
3209  uint8_t non_intra_quant_mat[64];
3210 
3212  uint32_t va_reserved[VA_PADDING_LOW];
3214 
3216 typedef struct _VASliceParameterBufferMPEG4
3217 {
3218  uint32_t slice_data_size;/* number of bytes in the slice data buffer for this slice */
3219  uint32_t slice_data_offset;/* the offset to the first byte of slice data */
3220  uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
3221  uint32_t macroblock_offset;/* the offset to the first bit of MB from the first byte of slice data */
3222  uint32_t macroblock_number;
3223  int32_t quant_scale;
3224 
3226  uint32_t va_reserved[VA_PADDING_LOW];
3228 
3233 typedef enum /* see 7.1.1.32 */
3234 {
3235  VAMvMode1Mv = 0,
3236  VAMvMode1MvHalfPel = 1,
3237  VAMvMode1MvHalfPelBilinear = 2,
3238  VAMvModeMixedMv = 3,
3239  VAMvModeIntensityCompensation = 4
3240 } VAMvModeVC1;
3241 
3243 /*
3244  * For each picture, and before any slice data, a picture parameter
3245  * buffer must be send. Multiple picture parameter buffers may be
3246  * sent for a single picture. In that case picture parameters will
3247  * apply to all slice data that follow it until a new picture
3248  * parameter buffer is sent.
3249  *
3250  * Notes:
3251  * pic_quantizer_type should be set to the applicable quantizer
3252  * type as defined by QUANTIZER (J.1.19) and either
3253  * PQUANTIZER (7.1.1.8) or PQINDEX (7.1.1.6)
3254  */
3255 typedef struct _VAPictureParameterBufferVC1
3256 {
3257  VASurfaceID forward_reference_picture;
3258  VASurfaceID backward_reference_picture;
3259  /* if out-of-loop post-processing is done on the render
3260  target, then we need to keep the in-loop decoded
3261  picture as a reference picture */
3262  VASurfaceID inloop_decoded_picture;
3263 
3264  /* sequence layer for AP or meta data for SP and MP */
3265  union {
3266  struct {
3267  uint32_t pulldown : 1; /* SEQUENCE_LAYER::PULLDOWN */
3268  uint32_t interlace : 1; /* SEQUENCE_LAYER::INTERLACE */
3269  uint32_t tfcntrflag : 1; /* SEQUENCE_LAYER::TFCNTRFLAG */
3270  uint32_t finterpflag : 1; /* SEQUENCE_LAYER::FINTERPFLAG */
3271  uint32_t psf : 1; /* SEQUENCE_LAYER::PSF */
3272  uint32_t multires : 1; /* METADATA::MULTIRES */
3273  uint32_t overlap : 1; /* METADATA::OVERLAP */
3274  uint32_t syncmarker : 1; /* METADATA::SYNCMARKER */
3275  uint32_t rangered : 1; /* METADATA::RANGERED */
3276  uint32_t max_b_frames : 3; /* METADATA::MAXBFRAMES */
3277  uint32_t profile : 2; /* SEQUENCE_LAYER::PROFILE or The MSB of METADATA::PROFILE */
3278  } bits;
3279  uint32_t value;
3280  } sequence_fields;
3281 
3282  uint16_t coded_width; /* ENTRY_POINT_LAYER::CODED_WIDTH */
3283  uint16_t coded_height; /* ENTRY_POINT_LAYER::CODED_HEIGHT */
3284  union {
3285  struct {
3286  uint32_t broken_link : 1; /* ENTRY_POINT_LAYER::BROKEN_LINK */
3287  uint32_t closed_entry : 1; /* ENTRY_POINT_LAYER::CLOSED_ENTRY */
3288  uint32_t panscan_flag : 1; /* ENTRY_POINT_LAYER::PANSCAN_FLAG */
3289  uint32_t loopfilter : 1; /* ENTRY_POINT_LAYER::LOOPFILTER */
3290  } bits;
3291  uint32_t value;
3292  } entrypoint_fields;
3293  uint8_t conditional_overlap_flag; /* ENTRY_POINT_LAYER::CONDOVER */
3294  uint8_t fast_uvmc_flag; /* ENTRY_POINT_LAYER::FASTUVMC */
3295  union {
3296  struct {
3297  uint32_t luma_flag : 1; /* ENTRY_POINT_LAYER::RANGE_MAPY_FLAG */
3298  uint32_t luma : 3; /* ENTRY_POINT_LAYER::RANGE_MAPY */
3299  uint32_t chroma_flag : 1; /* ENTRY_POINT_LAYER::RANGE_MAPUV_FLAG */
3300  uint32_t chroma : 3; /* ENTRY_POINT_LAYER::RANGE_MAPUV */
3301  } bits;
3302  uint32_t value;
3303  } range_mapping_fields;
3304 
3305  uint8_t b_picture_fraction; /* Index for PICTURE_LAYER::BFRACTION value in Table 40 (7.1.1.14) */
3306  uint8_t cbp_table; /* PICTURE_LAYER::CBPTAB/ICBPTAB */
3307  uint8_t mb_mode_table; /* PICTURE_LAYER::MBMODETAB */
3308  uint8_t range_reduction_frame;/* PICTURE_LAYER::RANGEREDFRM */
3309  uint8_t rounding_control; /* PICTURE_LAYER::RNDCTRL */
3310  uint8_t post_processing; /* PICTURE_LAYER::POSTPROC */
3311  uint8_t picture_resolution_index; /* PICTURE_LAYER::RESPIC */
3312  uint8_t luma_scale; /* PICTURE_LAYER::LUMSCALE */
3313  uint8_t luma_shift; /* PICTURE_LAYER::LUMSHIFT */
3314 
3315  union {
3316  struct {
3317  uint32_t picture_type : 3; /* PICTURE_LAYER::PTYPE */
3318  uint32_t frame_coding_mode : 3; /* PICTURE_LAYER::FCM */
3319  uint32_t top_field_first : 1; /* PICTURE_LAYER::TFF */
3320  uint32_t is_first_field : 1; /* set to 1 if it is the first field */
3321  uint32_t intensity_compensation : 1; /* PICTURE_LAYER::INTCOMP */
3322  } bits;
3323  uint32_t value;
3324  } picture_fields;
3325  union {
3326  struct {
3327  uint32_t mv_type_mb : 1; /* PICTURE::MVTYPEMB */
3328  uint32_t direct_mb : 1; /* PICTURE::DIRECTMB */
3329  uint32_t skip_mb : 1; /* PICTURE::SKIPMB */
3330  uint32_t field_tx : 1; /* PICTURE::FIELDTX */
3331  uint32_t forward_mb : 1; /* PICTURE::FORWARDMB */
3332  uint32_t ac_pred : 1; /* PICTURE::ACPRED */
3333  uint32_t overflags : 1; /* PICTURE::OVERFLAGS */
3334  } flags;
3335  uint32_t value;
3336  } raw_coding;
3337  union {
3338  struct {
3339  uint32_t bp_mv_type_mb : 1; /* PICTURE::MVTYPEMB */
3340  uint32_t bp_direct_mb : 1; /* PICTURE::DIRECTMB */
3341  uint32_t bp_skip_mb : 1; /* PICTURE::SKIPMB */
3342  uint32_t bp_field_tx : 1; /* PICTURE::FIELDTX */
3343  uint32_t bp_forward_mb : 1; /* PICTURE::FORWARDMB */
3344  uint32_t bp_ac_pred : 1; /* PICTURE::ACPRED */
3345  uint32_t bp_overflags : 1; /* PICTURE::OVERFLAGS */
3346  } flags;
3347  uint32_t value;
3348  } bitplane_present; /* signal what bitplane is being passed via the bitplane buffer */
3349  union {
3350  struct {
3351  uint32_t reference_distance_flag : 1;/* PICTURE_LAYER::REFDIST_FLAG */
3352  uint32_t reference_distance : 5;/* PICTURE_LAYER::REFDIST */
3353  uint32_t num_reference_pictures: 1;/* PICTURE_LAYER::NUMREF */
3354  uint32_t reference_field_pic_indicator : 1;/* PICTURE_LAYER::REFFIELD */
3355  } bits;
3356  uint32_t value;
3357  } reference_fields;
3358  union {
3359  struct {
3360  uint32_t mv_mode : 3; /* PICTURE_LAYER::MVMODE */
3361  uint32_t mv_mode2 : 3; /* PICTURE_LAYER::MVMODE2 */
3362  uint32_t mv_table : 3; /* PICTURE_LAYER::MVTAB/IMVTAB */
3363  uint32_t two_mv_block_pattern_table: 2; /* PICTURE_LAYER::2MVBPTAB */
3364  uint32_t four_mv_switch : 1; /* PICTURE_LAYER::4MVSWITCH */
3365  uint32_t four_mv_block_pattern_table : 2; /* PICTURE_LAYER::4MVBPTAB */
3366  uint32_t extended_mv_flag : 1; /* ENTRY_POINT_LAYER::EXTENDED_MV */
3367  uint32_t extended_mv_range : 2; /* PICTURE_LAYER::MVRANGE */
3368  uint32_t extended_dmv_flag : 1; /* ENTRY_POINT_LAYER::EXTENDED_DMV */
3369  uint32_t extended_dmv_range : 2; /* PICTURE_LAYER::DMVRANGE */
3370  } bits;
3371  uint32_t value;
3372  } mv_fields;
3373  union {
3374  struct {
3375  uint32_t dquant : 2; /* ENTRY_POINT_LAYER::DQUANT */
3376  uint32_t quantizer : 2; /* ENTRY_POINT_LAYER::QUANTIZER */
3377  uint32_t half_qp : 1; /* PICTURE_LAYER::HALFQP */
3378  uint32_t pic_quantizer_scale : 5;/* PICTURE_LAYER::PQUANT */
3379  uint32_t pic_quantizer_type : 1;/* PICTURE_LAYER::PQUANTIZER */
3380  uint32_t dq_frame : 1; /* VOPDQUANT::DQUANTFRM */
3381  uint32_t dq_profile : 2; /* VOPDQUANT::DQPROFILE */
3382  uint32_t dq_sb_edge : 2; /* VOPDQUANT::DQSBEDGE */
3383  uint32_t dq_db_edge : 2; /* VOPDQUANT::DQDBEDGE */
3384  uint32_t dq_binary_level : 1; /* VOPDQUANT::DQBILEVEL */
3385  uint32_t alt_pic_quantizer : 5;/* VOPDQUANT::ALTPQUANT */
3386  } bits;
3387  uint32_t value;
3388  } pic_quantizer_fields;
3389  union {
3390  struct {
3391  uint32_t variable_sized_transform_flag : 1;/* ENTRY_POINT_LAYER::VSTRANSFORM */
3392  uint32_t mb_level_transform_type_flag : 1;/* PICTURE_LAYER::TTMBF */
3393  uint32_t frame_level_transform_type : 2;/* PICTURE_LAYER::TTFRM */
3394  uint32_t transform_ac_codingset_idx1 : 2;/* PICTURE_LAYER::TRANSACFRM */
3395  uint32_t transform_ac_codingset_idx2 : 2;/* PICTURE_LAYER::TRANSACFRM2 */
3396  uint32_t intra_transform_dc_table : 1;/* PICTURE_LAYER::TRANSDCTAB */
3397  } bits;
3398  uint32_t value;
3399  } transform_fields;
3400 
3401  uint8_t luma_scale2; /* PICTURE_LAYER::LUMSCALE2 */
3402  uint8_t luma_shift2; /* PICTURE_LAYER::LUMSHIFT2 */
3403  uint8_t intensity_compensation_field; /* Index for PICTURE_LAYER::INTCOMPFIELD value in Table 109 (9.1.1.48) */
3404 
3406  uint32_t va_reserved[VA_PADDING_MEDIUM - 1];
3408 
3427 /* VC-1 Slice Parameter Buffer */
3428 typedef struct _VASliceParameterBufferVC1
3429 {
3430  uint32_t slice_data_size;/* number of bytes in the slice data buffer for this slice */
3431  uint32_t slice_data_offset;/* the offset to the first byte of slice data */
3432  uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
3433  uint32_t macroblock_offset;/* the offset to the first bit of MB from the first byte of slice data */
3434  uint32_t slice_vertical_position;
3435 
3437  uint32_t va_reserved[VA_PADDING_LOW];
3439 
3440 /* VC-1 Slice Data Buffer */
3441 /*
3442 This is simplely a buffer containing raw bit-stream bytes
3443 */
3444 
3445 /****************************
3446  * H.264/AVC data structures
3447  ****************************/
3448 
3449 typedef struct _VAPictureH264
3450 {
3451  VASurfaceID picture_id;
3452  uint32_t frame_idx;
3453  uint32_t flags;
3454  int32_t TopFieldOrderCnt;
3455  int32_t BottomFieldOrderCnt;
3456 
3458  uint32_t va_reserved[VA_PADDING_LOW];
3459 } VAPictureH264;
3460 /* flags in VAPictureH264 could be OR of the following */
3461 #define VA_PICTURE_H264_INVALID 0x00000001
3462 #define VA_PICTURE_H264_TOP_FIELD 0x00000002
3463 #define VA_PICTURE_H264_BOTTOM_FIELD 0x00000004
3464 #define VA_PICTURE_H264_SHORT_TERM_REFERENCE 0x00000008
3465 #define VA_PICTURE_H264_LONG_TERM_REFERENCE 0x00000010
3466 
3468 /*
3469  * For each picture, and before any slice data, a single
3470  * picture parameter buffer must be send.
3471  */
3472 typedef struct _VAPictureParameterBufferH264
3473 {
3474  VAPictureH264 CurrPic;
3475  VAPictureH264 ReferenceFrames[16]; /* in DPB */
3476  uint16_t picture_width_in_mbs_minus1;
3477  uint16_t picture_height_in_mbs_minus1;
3478  uint8_t bit_depth_luma_minus8;
3479  uint8_t bit_depth_chroma_minus8;
3480  uint8_t num_ref_frames;
3481  union {
3482  struct {
3483  uint32_t chroma_format_idc : 2;
3484  uint32_t residual_colour_transform_flag : 1; /* Renamed to separate_colour_plane_flag in newer standard versions. */
3485  uint32_t gaps_in_frame_num_value_allowed_flag : 1;
3486  uint32_t frame_mbs_only_flag : 1;
3487  uint32_t mb_adaptive_frame_field_flag : 1;
3488  uint32_t direct_8x8_inference_flag : 1;
3489  uint32_t MinLumaBiPredSize8x8 : 1; /* see A.3.3.2 */
3490  uint32_t log2_max_frame_num_minus4 : 4;
3491  uint32_t pic_order_cnt_type : 2;
3492  uint32_t log2_max_pic_order_cnt_lsb_minus4 : 4;
3493  uint32_t delta_pic_order_always_zero_flag : 1;
3494  } bits;
3495  uint32_t value;
3496  } seq_fields;
3497  // FMO is not supported.
3498  va_deprecated uint8_t num_slice_groups_minus1;
3499  va_deprecated uint8_t slice_group_map_type;
3500  va_deprecated uint16_t slice_group_change_rate_minus1;
3501  int8_t pic_init_qp_minus26;
3502  int8_t pic_init_qs_minus26;
3503  int8_t chroma_qp_index_offset;
3504  int8_t second_chroma_qp_index_offset;
3505  union {
3506  struct {
3507  uint32_t entropy_coding_mode_flag : 1;
3508  uint32_t weighted_pred_flag : 1;
3509  uint32_t weighted_bipred_idc : 2;
3510  uint32_t transform_8x8_mode_flag : 1;
3511  uint32_t field_pic_flag : 1;
3512  uint32_t constrained_intra_pred_flag : 1;
3513  uint32_t pic_order_present_flag : 1; /* Renamed to bottom_field_pic_order_in_frame_present_flag in newer standard versions. */
3514  uint32_t deblocking_filter_control_present_flag : 1;
3515  uint32_t redundant_pic_cnt_present_flag : 1;
3516  uint32_t reference_pic_flag : 1; /* nal_ref_idc != 0 */
3517  } bits;
3518  uint32_t value;
3519  } pic_fields;
3520  uint16_t frame_num;
3521 
3523  uint32_t va_reserved[VA_PADDING_MEDIUM];
3525 
3527 typedef struct _VAIQMatrixBufferH264
3528 {
3530  uint8_t ScalingList4x4[6][16];
3532  uint8_t ScalingList8x8[2][64];
3533 
3535  uint32_t va_reserved[VA_PADDING_LOW];
3537 
3539 typedef struct _VASliceParameterBufferH264
3540 {
3541  uint32_t slice_data_size;/* number of bytes in the slice data buffer for this slice */
3544  uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
3556  uint16_t first_mb_in_slice;
3557  uint8_t slice_type;
3558  uint8_t direct_spatial_mv_pred_flag;
3573  uint8_t cabac_init_idc;
3574  int8_t slice_qp_delta;
3575  uint8_t disable_deblocking_filter_idc;
3576  int8_t slice_alpha_c0_offset_div2;
3577  int8_t slice_beta_offset_div2;
3578  VAPictureH264 RefPicList0[32]; /* See 8.2.4.2 */
3579  VAPictureH264 RefPicList1[32]; /* See 8.2.4.2 */
3580  uint8_t luma_log2_weight_denom;
3581  uint8_t chroma_log2_weight_denom;
3582  uint8_t luma_weight_l0_flag;
3583  int16_t luma_weight_l0[32];
3584  int16_t luma_offset_l0[32];
3585  uint8_t chroma_weight_l0_flag;
3586  int16_t chroma_weight_l0[32][2];
3587  int16_t chroma_offset_l0[32][2];
3588  uint8_t luma_weight_l1_flag;
3589  int16_t luma_weight_l1[32];
3590  int16_t luma_offset_l1[32];
3591  uint8_t chroma_weight_l1_flag;
3592  int16_t chroma_weight_l1[32][2];
3593  int16_t chroma_offset_l1[32][2];
3594 
3596  uint32_t va_reserved[VA_PADDING_LOW];
3598 
3599 /****************************
3600  * Common encode data structures
3601  ****************************/
3602 typedef enum
3603 {
3604  VAEncPictureTypeIntra = 0,
3605  VAEncPictureTypePredictive = 1,
3606  VAEncPictureTypeBidirectional = 2,
3607 } VAEncPictureType;
3608 
3616 typedef struct _VAEncSliceParameterBuffer
3617 {
3618  uint32_t start_row_number; /* starting MB row number for this slice */
3619  uint32_t slice_height; /* slice height measured in MB */
3620  union {
3621  struct {
3622  uint32_t is_intra : 1;
3623  uint32_t disable_deblocking_filter_idc : 2;
3624  uint32_t uses_long_term_ref :1;
3625  uint32_t is_long_term_ref :1;
3626  } bits;
3627  uint32_t value;
3628  } slice_flags;
3629 
3631  uint32_t va_reserved[VA_PADDING_LOW];
3633 
3634 
3635 /****************************
3636  * H.263 specific encode data structures
3637  ****************************/
3638 
3639 typedef struct _VAEncSequenceParameterBufferH263
3640 {
3641  uint32_t intra_period;
3642  uint32_t bits_per_second;
3643  uint32_t frame_rate;
3644  uint32_t initial_qp;
3645  uint32_t min_qp;
3646 
3648  uint32_t va_reserved[VA_PADDING_LOW];
3649 } VAEncSequenceParameterBufferH263;
3650 
3651 typedef struct _VAEncPictureParameterBufferH263
3652 {
3653  VASurfaceID reference_picture;
3654  VASurfaceID reconstructed_picture;
3655  VABufferID coded_buf;
3656  uint16_t picture_width;
3657  uint16_t picture_height;
3658  VAEncPictureType picture_type;
3659 
3661  uint32_t va_reserved[VA_PADDING_LOW];
3662 } VAEncPictureParameterBufferH263;
3663 
3664 /****************************
3665  * MPEG-4 specific encode data structures
3666  ****************************/
3667 
3668 typedef struct _VAEncSequenceParameterBufferMPEG4
3669 {
3670  uint8_t profile_and_level_indication;
3671  uint32_t intra_period;
3672  uint32_t video_object_layer_width;
3673  uint32_t video_object_layer_height;
3674  uint32_t vop_time_increment_resolution;
3675  uint32_t fixed_vop_rate;
3676  uint32_t fixed_vop_time_increment;
3677  uint32_t bits_per_second;
3678  uint32_t frame_rate;
3679  uint32_t initial_qp;
3680  uint32_t min_qp;
3681 
3683  uint32_t va_reserved[VA_PADDING_LOW];
3684 } VAEncSequenceParameterBufferMPEG4;
3685 
3686 typedef struct _VAEncPictureParameterBufferMPEG4
3687 {
3688  VASurfaceID reference_picture;
3689  VASurfaceID reconstructed_picture;
3690  VABufferID coded_buf;
3691  uint16_t picture_width;
3692  uint16_t picture_height;
3693  uint32_t modulo_time_base; /* number of 1s */
3694  uint32_t vop_time_increment;
3695  VAEncPictureType picture_type;
3696 
3698  uint32_t va_reserved[VA_PADDING_LOW];
3699 } VAEncPictureParameterBufferMPEG4;
3700 
3701 
3702 
3720 VAStatus vaCreateBuffer (
3721  VADisplay dpy,
3722  VAContextID context,
3723  VABufferType type, /* in */
3724  unsigned int size, /* in */
3725  unsigned int num_elements, /* in */
3726  void *data, /* in */
3727  VABufferID *buf_id /* out */
3728 );
3729 
3741 VAStatus vaCreateBuffer2(
3742  VADisplay dpy,
3743  VAContextID context,
3744  VABufferType type,
3745  unsigned int width,
3746  unsigned int height,
3747  unsigned int *unit_size,
3748  unsigned int *pitch,
3749  VABufferID *buf_id
3750 );
3751 
3758 VAStatus vaBufferSetNumElements (
3759  VADisplay dpy,
3760  VABufferID buf_id, /* in */
3761  unsigned int num_elements /* in */
3762 );
3763 
3764 
3769 /*
3770  * FICTURE_AVE_QP(bit7-0): The average Qp value used during this frame
3771  * LARGE_SLICE(bit8):At least one slice in the current frame was large
3772  * enough for the encoder to attempt to limit its size.
3773  * SLICE_OVERFLOW(bit9): At least one slice in the current frame has
3774  * exceeded the maximum slice size specified.
3775  * BITRATE_OVERFLOW(bit10): The peak bitrate was exceeded for this frame.
3776  * BITRATE_HIGH(bit11): The frame size got within the safety margin of the maximum size (VCM only)
3777  * AIR_MB_OVER_THRESHOLD: the number of MBs adapted to Intra MB
3778  */
3779 #define VA_CODED_BUF_STATUS_PICTURE_AVE_QP_MASK 0xff
3780 #define VA_CODED_BUF_STATUS_LARGE_SLICE_MASK 0x100
3781 #define VA_CODED_BUF_STATUS_SLICE_OVERFLOW_MASK 0x200
3782 #define VA_CODED_BUF_STATUS_BITRATE_OVERFLOW 0x400
3783 #define VA_CODED_BUF_STATUS_BITRATE_HIGH 0x800
3784 
3791 #define VA_CODED_BUF_STATUS_FRAME_SIZE_OVERFLOW 0x1000
3792 
3795 #define VA_CODED_BUF_STATUS_BAD_BITSTREAM 0x8000
3796 #define VA_CODED_BUF_STATUS_AIR_MB_OVER_THRESHOLD 0xff0000
3797 
3806 #define VA_CODED_BUF_STATUS_NUMBER_PASSES_MASK 0xf000000
3807 
3815 #define VA_CODED_BUF_STATUS_SINGLE_NALU 0x10000000
3816 
3827 typedef struct _VACodedBufferSegment {
3831  uint32_t size;
3833  uint32_t bit_offset;
3835  uint32_t status;
3837  uint32_t reserved;
3839  void *buf;
3844  void *next;
3845 
3847  uint32_t va_reserved[VA_PADDING_LOW];
3849 
3858 VAStatus vaMapBuffer (
3859  VADisplay dpy,
3860  VABufferID buf_id, /* in */
3861  void **pbuf /* out */
3862 );
3863 
3869 VAStatus vaUnmapBuffer (
3870  VADisplay dpy,
3871  VABufferID buf_id /* in */
3872 );
3873 
3883 VAStatus vaDestroyBuffer (
3884  VADisplay dpy,
3885  VABufferID buffer_id
3886 );
3887 
3889 typedef struct {
3891  uintptr_t handle;
3893  uint32_t type;
3902  uint32_t mem_type;
3904  size_t mem_size;
3905 
3907  uint32_t va_reserved[VA_PADDING_LOW];
3908 } VABufferInfo;
3909 
3957 VAStatus
3958 vaAcquireBufferHandle(VADisplay dpy, VABufferID buf_id, VABufferInfo *buf_info);
3959 
3990 VAStatus
3991 vaReleaseBufferHandle(VADisplay dpy, VABufferID buf_id);
3992 
3998 #define VA_EXPORT_SURFACE_READ_ONLY 0x0001
3999 
4000 #define VA_EXPORT_SURFACE_WRITE_ONLY 0x0002
4001 
4002 #define VA_EXPORT_SURFACE_READ_WRITE 0x0003
4003 
4008 #define VA_EXPORT_SURFACE_SEPARATE_LAYERS 0x0004
4009 
4014 #define VA_EXPORT_SURFACE_COMPOSED_LAYERS 0x0008
4015 
4050 VAStatus vaExportSurfaceHandle(VADisplay dpy,
4051  VASurfaceID surface_id,
4052  uint32_t mem_type, uint32_t flags,
4053  void *descriptor);
4054 
4070 VAStatus vaBeginPicture (
4071  VADisplay dpy,
4072  VAContextID context,
4073  VASurfaceID render_target
4074 );
4075 
4079 VAStatus vaRenderPicture (
4080  VADisplay dpy,
4081  VAContextID context,
4082  VABufferID *buffers,
4083  int num_buffers
4084 );
4085 
4094 VAStatus vaEndPicture (
4095  VADisplay dpy,
4096  VAContextID context
4097 );
4098 
4118 VAStatus vaMFSubmit (
4119  VADisplay dpy,
4120  VAMFContextID mf_context,
4121  VAContextID * contexts,
4122  int num_contexts
4123 );
4124 
4125 /*
4126 
4127 Synchronization
4128 
4129 */
4130 
4136 VAStatus vaSyncSurface (
4137  VADisplay dpy,
4138  VASurfaceID render_target
4139 );
4140 
4142 #define VA_TIMEOUT_INFINITE 0xFFFFFFFFFFFFFFFF
4143 
4164 VAStatus vaSyncSurface2 (
4165  VADisplay dpy,
4166  VASurfaceID surface,
4167  uint64_t timeout_ns
4168 );
4169 
4170 typedef enum
4171 {
4172  VASurfaceRendering = 1, /* Rendering in progress */
4173  VASurfaceDisplaying = 2, /* Displaying in progress (not safe to render into it) */
4174  /* this status is useful if surface is used as the source */
4175  /* of an overlay */
4176  VASurfaceReady = 4, /* not being rendered or displayed */
4177  VASurfaceSkipped = 8 /* Indicate a skipped frame during encode */
4178 } VASurfaceStatus;
4179 
4183 VAStatus vaQuerySurfaceStatus (
4184  VADisplay dpy,
4185  VASurfaceID render_target,
4186  VASurfaceStatus *status /* out */
4187 );
4188 
4189 typedef enum
4190 {
4191  VADecodeSliceMissing = 0,
4192  VADecodeMBError = 1,
4193 } VADecodeErrorType;
4194 
4199 typedef struct _VASurfaceDecodeMBErrors
4200 {
4201  int32_t status; /* 1 if hardware has returned detailed info below, -1 means this record is invalid */
4202  uint32_t start_mb; /* start mb address with errors */
4203  uint32_t end_mb; /* end mb address with errors */
4204  VADecodeErrorType decode_error_type;
4205  uint32_t num_mb; /* number of mbs with errors */
4207  uint32_t va_reserved[VA_PADDING_LOW - 1];
4209 
4218 VAStatus vaQuerySurfaceError(
4219  VADisplay dpy,
4220  VASurfaceID surface,
4221  VAStatus error_status,
4222  void **error_info
4223 );
4224 
4245 VAStatus vaSyncBuffer(
4246  VADisplay dpy,
4247  VABufferID buf_id,
4248  uint64_t timeout_ns
4249 );
4250 
4272 #define VA_FOURCC(ch0, ch1, ch2, ch3) \
4273  ((unsigned long)(unsigned char) (ch0) | ((unsigned long)(unsigned char) (ch1) << 8) | \
4274  ((unsigned long)(unsigned char) (ch2) << 16) | ((unsigned long)(unsigned char) (ch3) << 24 ))
4275 
4276 /* Pre-defined fourcc codes. */
4277 
4281 #define VA_FOURCC_NV12 0x3231564E
4282 
4285 #define VA_FOURCC_NV21 0x3132564E
4286 
4291 #define VA_FOURCC_AI44 0x34344149
4292 
4297 #define VA_FOURCC_RGBA 0x41424752
4298 
4302 #define VA_FOURCC_RGBX 0x58424752
4303 
4307 #define VA_FOURCC_BGRA 0x41524742
4308 
4312 #define VA_FOURCC_BGRX 0x58524742
4313 
4317 #define VA_FOURCC_ARGB 0x42475241
4318 
4322 #define VA_FOURCC_XRGB 0x42475258
4323 
4327 #define VA_FOURCC_ABGR 0x52474241
4328 
4332 #define VA_FOURCC_XBGR 0x52474258
4333 
4338 #define VA_FOURCC_UYVY 0x59565955
4339 
4343 #define VA_FOURCC_YUY2 0x32595559
4344 
4348 #define VA_FOURCC_AYUV 0x56555941
4349 
4353 #define VA_FOURCC_NV11 0x3131564e
4354 
4358 #define VA_FOURCC_YV12 0x32315659
4359 
4363 #define VA_FOURCC_P208 0x38303250
4364 
4368 #define VA_FOURCC_I420 0x30323449
4369 
4373 #define VA_FOURCC_YV24 0x34325659
4374 
4378 #define VA_FOURCC_YV32 0x32335659
4379 
4381 #define VA_FOURCC_Y800 0x30303859
4382 
4387 #define VA_FOURCC_IMC3 0x33434D49
4388 
4392 #define VA_FOURCC_411P 0x50313134
4393 
4398 #define VA_FOURCC_411R 0x52313134
4399 
4403 #define VA_FOURCC_422H 0x48323234
4404 
4408 #define VA_FOURCC_422V 0x56323234
4409 
4413 #define VA_FOURCC_444P 0x50343434
4414 
4419 #define VA_FOURCC_RGBP 0x50424752
4420 
4424 #define VA_FOURCC_BGRP 0x50524742
4425 
4430 #define VA_FOURCC_RGB565 0x36314752
4431 
4436 #define VA_FOURCC_BGR565 0x36314742
4437 
4443 #define VA_FOURCC_Y210 0x30313259
4444 
4449 #define VA_FOURCC_Y212 0x32313259
4450 
4455 #define VA_FOURCC_Y216 0x36313259
4456 
4461 #define VA_FOURCC_Y410 0x30313459
4462 
4467 #define VA_FOURCC_Y412 0x32313459
4468 
4473 #define VA_FOURCC_Y416 0x36313459
4474 
4479 #define VA_FOURCC_YV16 0x36315659
4480 
4485 #define VA_FOURCC_P010 0x30313050
4486 
4491 #define VA_FOURCC_P012 0x32313050
4492 
4497 #define VA_FOURCC_P016 0x36313050
4498 
4504 #define VA_FOURCC_I010 0x30313049
4505 
4510 #define VA_FOURCC_IYUV 0x56555949
4511 
4514 #define VA_FOURCC_A2R10G10B10 0x30335241 /* VA_FOURCC('A','R','3','0') */
4515 
4518 #define VA_FOURCC_A2B10G10R10 0x30334241 /* VA_FOURCC('A','B','3','0') */
4519 
4522 #define VA_FOURCC_X2R10G10B10 0x30335258 /* VA_FOURCC('X','R','3','0') */
4523 
4526 #define VA_FOURCC_X2B10G10R10 0x30334258 /* VA_FOURCC('X','B','3','0') */
4527 
4532 #define VA_FOURCC_Y8 0x20203859
4533 
4537 #define VA_FOURCC_Y16 0x20363159
4538 
4542 #define VA_FOURCC_VYUY 0x59555956
4543 
4547 #define VA_FOURCC_YVYU 0x55595659
4548 
4552 #define VA_FOURCC_ARGB64 0x34475241
4553 
4557 #define VA_FOURCC_ABGR64 0x34474241
4558 
4562 #define VA_FOURCC_XYUV 0x56555958
4563 
4564 /* byte order */
4565 #define VA_LSB_FIRST 1
4566 #define VA_MSB_FIRST 2
4567 
4568 typedef struct _VAImageFormat
4569 {
4570  uint32_t fourcc;
4571  uint32_t byte_order; /* VA_LSB_FIRST, VA_MSB_FIRST */
4572  uint32_t bits_per_pixel;
4573  /* for RGB formats */
4574  uint32_t depth; /* significant bits per pixel */
4575  uint32_t red_mask;
4576  uint32_t green_mask;
4577  uint32_t blue_mask;
4578  uint32_t alpha_mask;
4579 
4581  uint32_t va_reserved[VA_PADDING_LOW];
4582 } VAImageFormat;
4583 
4584 typedef VAGenericID VAImageID;
4585 
4586 typedef struct _VAImage
4587 {
4588  VAImageID image_id; /* uniquely identify this image */
4589  VAImageFormat format;
4590  VABufferID buf; /* image data buffer */
4591  /*
4592  * Image data will be stored in a buffer of type VAImageBufferType to facilitate
4593  * data store on the server side for optimal performance. The buffer will be
4594  * created by the CreateImage function, and proper storage allocated based on the image
4595  * size and format. This buffer is managed by the library implementation, and
4596  * accessed by the client through the buffer Map/Unmap functions.
4597  */
4598  uint16_t width;
4599  uint16_t height;
4600  uint32_t data_size;
4601  uint32_t num_planes; /* can not be greater than 3 */
4602  /*
4603  * An array indicating the scanline pitch in bytes for each plane.
4604  * Each plane may have a different pitch. Maximum 3 planes for planar formats
4605  */
4606  uint32_t pitches[3];
4607  /*
4608  * An array indicating the byte offset from the beginning of the image data
4609  * to the start of each plane.
4610  */
4611  uint32_t offsets[3];
4612 
4613  /* The following fields are only needed for paletted formats */
4614  int32_t num_palette_entries; /* set to zero for non-palette images */
4615  /*
4616  * Each component is one byte and entry_bytes indicates the number of components in
4617  * each entry (eg. 3 for YUV palette entries). set to zero for non-palette images
4618  */
4619  int32_t entry_bytes;
4620  /*
4621  * An array of ascii characters describing the order of the components within the bytes.
4622  * Only entry_bytes characters of the string are used.
4623  */
4624  int8_t component_order[4];
4625 
4627  uint32_t va_reserved[VA_PADDING_LOW];
4628 } VAImage;
4629 
4632  VADisplay dpy
4633 );
4634 
4641 VAStatus vaQueryImageFormats (
4642  VADisplay dpy,
4643  VAImageFormat *format_list, /* out */
4644  int *num_formats /* out */
4645 );
4646 
4654 VAStatus vaCreateImage (
4655  VADisplay dpy,
4656  VAImageFormat *format,
4657  int width,
4658  int height,
4659  VAImage *image /* out */
4660 );
4661 
4665 VAStatus vaDestroyImage (
4666  VADisplay dpy,
4667  VAImageID image
4668 );
4669 
4670 VAStatus vaSetImagePalette (
4671  VADisplay dpy,
4672  VAImageID image,
4673  /*
4674  * pointer to an array holding the palette data. The size of the array is
4675  * num_palette_entries * entry_bytes in size. The order of the components
4676  * in the palette is described by the component_order in VAImage struct
4677  */
4678  unsigned char *palette
4679 );
4680 
4685 VAStatus vaGetImage (
4686  VADisplay dpy,
4687  VASurfaceID surface,
4688  int x, /* coordinates of the upper left source pixel */
4689  int y,
4690  unsigned int width, /* width and height of the region */
4691  unsigned int height,
4692  VAImageID image
4693 );
4694 
4701 VAStatus vaPutImage (
4702  VADisplay dpy,
4703  VASurfaceID surface,
4704  VAImageID image,
4705  int src_x,
4706  int src_y,
4707  unsigned int src_width,
4708  unsigned int src_height,
4709  int dest_x,
4710  int dest_y,
4711  unsigned int dest_width,
4712  unsigned int dest_height
4713 );
4714 
4746 VAStatus vaDeriveImage (
4747  VADisplay dpy,
4748  VASurfaceID surface,
4749  VAImage *image /* out */
4750 );
4751 
4759 typedef VAGenericID VASubpictureID;
4760 
4763  VADisplay dpy
4764 );
4765 
4767 #define VA_SUBPICTURE_CHROMA_KEYING 0x0001
4768 #define VA_SUBPICTURE_GLOBAL_ALPHA 0x0002
4769 #define VA_SUBPICTURE_DESTINATION_IS_SCREEN_COORD 0x0004
4770 
4782 VAStatus vaQuerySubpictureFormats (
4783  VADisplay dpy,
4784  VAImageFormat *format_list, /* out */
4785  unsigned int *flags, /* out */
4786  unsigned int *num_formats /* out */
4787 );
4788 
4792 VAStatus vaCreateSubpicture (
4793  VADisplay dpy,
4794  VAImageID image,
4795  VASubpictureID *subpicture /* out */
4796 );
4797 
4801 VAStatus vaDestroySubpicture (
4802  VADisplay dpy,
4803  VASubpictureID subpicture
4804 );
4805 
4810 VAStatus vaSetSubpictureImage (
4811  VADisplay dpy,
4812  VASubpictureID subpicture,
4813  VAImageID image
4814 );
4815 
4825 VAStatus vaSetSubpictureChromakey (
4826  VADisplay dpy,
4827  VASubpictureID subpicture,
4828  unsigned int chromakey_min,
4829  unsigned int chromakey_max,
4830  unsigned int chromakey_mask
4831 );
4832 
4838 VAStatus vaSetSubpictureGlobalAlpha (
4839  VADisplay dpy,
4840  VASubpictureID subpicture,
4841  float global_alpha
4842 );
4843 
4851 VAStatus vaAssociateSubpicture (
4852  VADisplay dpy,
4853  VASubpictureID subpicture,
4854  VASurfaceID *target_surfaces,
4855  int num_surfaces,
4856  int16_t src_x, /* upper left offset in subpicture */
4857  int16_t src_y,
4858  uint16_t src_width,
4859  uint16_t src_height,
4860  int16_t dest_x, /* upper left offset in surface */
4861  int16_t dest_y,
4862  uint16_t dest_width,
4863  uint16_t dest_height,
4864  /*
4865  * whether to enable chroma-keying, global-alpha, or screen relative mode
4866  * see VA_SUBPICTURE_XXX values
4867  */
4868  uint32_t flags
4869 );
4870 
4874 VAStatus vaDeassociateSubpicture (
4875  VADisplay dpy,
4876  VASubpictureID subpicture,
4877  VASurfaceID *target_surfaces,
4878  int num_surfaces
4879 );
4880 
4898 /* PowerVR IEP Lite attributes */
4899 typedef enum
4900 {
4901  VADISPLAYATTRIB_BLE_OFF = 0x00,
4902  VADISPLAYATTRIB_BLE_LOW,
4903  VADISPLAYATTRIB_BLE_MEDIUM,
4904  VADISPLAYATTRIB_BLE_HIGH,
4905  VADISPLAYATTRIB_BLE_NONE,
4907 
4909 #define VA_ROTATION_NONE 0x00000000
4910 #define VA_ROTATION_90 0x00000001
4911 #define VA_ROTATION_180 0x00000002
4912 #define VA_ROTATION_270 0x00000003
4913 
4924 #define VA_MIRROR_NONE 0x00000000
4925 
4926 #define VA_MIRROR_HORIZONTAL 0x00000001
4927 
4928 #define VA_MIRROR_VERTICAL 0x00000002
4929 
4932 #define VA_OOL_DEBLOCKING_FALSE 0x00000000
4933 #define VA_OOL_DEBLOCKING_TRUE 0x00000001
4934 
4936 #define VA_RENDER_MODE_UNDEFINED 0
4937 #define VA_RENDER_MODE_LOCAL_OVERLAY 1
4938 #define VA_RENDER_MODE_LOCAL_GPU 2
4939 #define VA_RENDER_MODE_EXTERNAL_OVERLAY 4
4940 #define VA_RENDER_MODE_EXTERNAL_GPU 8
4941 
4943 #define VA_RENDER_DEVICE_UNDEFINED 0
4944 #define VA_RENDER_DEVICE_LOCAL 1
4945 #define VA_RENDER_DEVICE_EXTERNAL 2
4946 
4960 typedef union _VADisplayAttribValSubDevice{
4961  struct{
4963  uint32_t current_sub_device : 4;
4965  uint32_t sub_device_count : 4;
4967  uint32_t reserved : 8;
4983  uint32_t sub_device_mask : 16;
4984  }bits;
4985  uint32_t value;
4987 
4989 typedef enum
4990 {
4991  VADisplayAttribBrightness = 0,
4992  VADisplayAttribContrast = 1,
4993  VADisplayAttribHue = 2,
4994  VADisplayAttribSaturation = 3,
4995  /* client can specifiy a background color for the target window
4996  * the new feature of video conference,
4997  * the uncovered area of the surface is filled by this color
4998  * also it will blend with the decoded video color
4999  */
5000  VADisplayAttribBackgroundColor = 4,
5001  /*
5002  * this is a gettable only attribute. For some implementations that use the
5003  * hardware overlay, after PutSurface is called, the surface can not be
5004  * re-used until after the subsequent PutSurface call. If this is the case
5005  * then the value for this attribute will be set to 1 so that the client
5006  * will not attempt to re-use the surface right after returning from a call
5007  * to PutSurface.
5008  *
5009  * Don't use it, use flag VASurfaceDisplaying of vaQuerySurfaceStatus since
5010  * driver may use overlay or GPU alternatively
5011  */
5012  VADisplayAttribDirectSurface = 5,
5013  VADisplayAttribRotation = 6,
5014  VADisplayAttribOutofLoopDeblock = 7,
5015 
5016  /* PowerVR IEP Lite specific attributes */
5017  VADisplayAttribBLEBlackMode = 8,
5018  VADisplayAttribBLEWhiteMode = 9,
5019  VADisplayAttribBlueStretch = 10,
5020  VADisplayAttribSkinColorCorrection = 11,
5021  /*
5022  * For type VADisplayAttribCSCMatrix, "value" field is a pointer to the color
5023  * conversion matrix. Each element in the matrix is float-point
5024  */
5025  VADisplayAttribCSCMatrix = 12,
5026  /* specify the constant color used to blend with video surface
5027  * Cd = Cv*Cc*Ac + Cb *(1 - Ac) C means the constant RGB
5028  * d: the final color to overwrite into the frame buffer
5029  * v: decoded video after color conversion,
5030  * c: video color specified by VADisplayAttribBlendColor
5031  * b: background color of the drawable
5032  */
5033  VADisplayAttribBlendColor = 13,
5034  /*
5035  * Indicate driver to skip painting color key or not.
5036  * only applicable if the render is overlay
5037  */
5038  VADisplayAttribOverlayAutoPaintColorKey = 14,
5039  /*
5040  * customized overlay color key, the format is RGB888
5041  * [23:16] = Red, [15:08] = Green, [07:00] = Blue.
5042  */
5043  VADisplayAttribOverlayColorKey = 15,
5044  /*
5045  * The hint for the implementation of vaPutSurface
5046  * normally, the driver could use an overlay or GPU to render the surface on the screen
5047  * this flag provides APP the flexibity to switch the render dynamically
5048  */
5049  VADisplayAttribRenderMode = 16,
5050  /*
5051  * specify if vaPutSurface needs to render into specified monitors
5052  * one example is that one external monitor (e.g. HDMI) is enabled,
5053  * but the window manager is not aware of it, and there is no associated drawable
5054  */
5055  VADisplayAttribRenderDevice = 17,
5056  /*
5057  * specify vaPutSurface render area if there is no drawable on the monitor
5058  */
5059  VADisplayAttribRenderRect = 18,
5060  /*
5061  * HW attribute, read/write, specify the sub device configure
5062  */
5063  VADisplayAttribSubDevice = 19,
5064  /*
5065  * HW attribute. read only. specify whether vaCopy support on current HW
5066  * The value of each bit should equal to 1 << VA_EXEC_MODE_XXX to represent
5067  * modes of vaCopy
5068  */
5069  VADisplayAttribCopy = 20,
5071 
5072 /* flags for VADisplayAttribute */
5073 #define VA_DISPLAY_ATTRIB_NOT_SUPPORTED 0x0000
5074 #define VA_DISPLAY_ATTRIB_GETTABLE 0x0001
5075 #define VA_DISPLAY_ATTRIB_SETTABLE 0x0002
5076 
5077 typedef struct _VADisplayAttribute
5078 {
5079  VADisplayAttribType type;
5080  int32_t min_value;
5081  int32_t max_value;
5082  int32_t value; /* used by the set/get attribute functions */
5083 /* flags can be VA_DISPLAY_ATTRIB_GETTABLE or VA_DISPLAY_ATTRIB_SETTABLE or OR'd together */
5084  uint32_t flags;
5085 
5087  uint32_t va_reserved[VA_PADDING_LOW];
5088 } VADisplayAttribute;
5089 
5092  VADisplay dpy
5093 );
5094 
5101 VAStatus vaQueryDisplayAttributes (
5102  VADisplay dpy,
5103  VADisplayAttribute *attr_list, /* out */
5104  int *num_attributes /* out */
5105 );
5106 
5113 VAStatus vaGetDisplayAttributes (
5114  VADisplay dpy,
5115  VADisplayAttribute *attr_list, /* in/out */
5116  int num_attributes
5117 );
5118 
5125 VAStatus vaSetDisplayAttributes (
5126  VADisplay dpy,
5127  VADisplayAttribute *attr_list,
5128  int num_attributes
5129 );
5130 
5131 /****************************
5132  * HEVC data structures
5133  ****************************/
5143 typedef struct _VAPictureHEVC
5144 {
5148  VASurfaceID picture_id;
5153  int32_t pic_order_cnt;
5154  /* described below */
5155  uint32_t flags;
5156 
5158  uint32_t va_reserved[VA_PADDING_LOW];
5159 } VAPictureHEVC;
5160 
5161 /* flags in VAPictureHEVC could be OR of the following */
5162 #define VA_PICTURE_HEVC_INVALID 0x00000001
5163 
5166 #define VA_PICTURE_HEVC_FIELD_PIC 0x00000002
5167 
5171 #define VA_PICTURE_HEVC_BOTTOM_FIELD 0x00000004
5172 
5173 #define VA_PICTURE_HEVC_LONG_TERM_REFERENCE 0x00000008
5174 
5188 #define VA_PICTURE_HEVC_RPS_ST_CURR_BEFORE 0x00000010
5189 
5193 #define VA_PICTURE_HEVC_RPS_ST_CURR_AFTER 0x00000020
5194 
5198 #define VA_PICTURE_HEVC_RPS_LT_CURR 0x00000040
5199 
5200 typedef enum{
5201  VACopyObjectSurface = 0,
5202  VACopyObjectBuffer = 1,
5203 } VACopyObjectType;
5204 
5205 typedef struct _VACopyObject {
5206  VACopyObjectType obj_type; // type of object.
5207  union
5208  {
5209  VASurfaceID surface_id;
5210  VABufferID buffer_id;
5211  } object;
5212 
5213  uint32_t va_reserved[VA_PADDING_MEDIUM];
5214 } VACopyObject;
5215 
5216 typedef union _VACopyOption{
5217  struct {
5219  uint32_t va_copy_sync : 2;
5221  uint32_t va_copy_mode : 4;
5222  uint32_t reserved :26;
5223  }bits;
5224  uint32_t value;
5225 }VACopyOption;
5226 
5239 VAStatus vaCopy(VADisplay dpy, VACopyObject * dst, VACopyObject * src, VACopyOption option);
5240 
5241 #include <va/va_dec_hevc.h>
5242 #include <va/va_dec_jpeg.h>
5243 #include <va/va_dec_vp8.h>
5244 #include <va/va_dec_vp9.h>
5245 #include <va/va_dec_av1.h>
5246 #include <va/va_enc_hevc.h>
5247 #include <va/va_fei_hevc.h>
5248 #include <va/va_enc_h264.h>
5249 #include <va/va_enc_jpeg.h>
5250 #include <va/va_enc_mpeg2.h>
5251 #include <va/va_enc_vp8.h>
5252 #include <va/va_enc_vp9.h>
5253 #include <va/va_fei.h>
5254 #include <va/va_fei_h264.h>
5255 #include <va/va_vpp.h>
5256 #include <va/va_prot.h>
5257 
5260 #ifdef __cplusplus
5261 }
5262 #endif
5263 
5264 #endif /* _VA_H_ */
combined submission of multiple frames from different streams, it is optimization for different HW im...
Definition: va.h:930
Encoding skip frame attribute. Read-only.
Definition: va.h:794
VAStatus vaCreateBuffer2(VADisplay dpy, VAContextID context, VABufferType type, unsigned int width, unsigned int height, unsigned int *unit_size, unsigned int *pitch, VABufferID *buf_id)
Decryption sample type of the protected content session.
Definition: va.h:974
The video processing API.
VAStatus vaQueryConfigAttributes(VADisplay dpy, VAConfigID config_id, VAProfile *profile, VAEntrypoint *entrypoint, VAConfigAttrib *attrib_list, int *num_attribs)
The MPEG-2 encoding API.
uint32_t max_num_concurrent_frames
max num of concurrent frames from different stream
Definition: va.h:1360
Tile Support Attribute. Read-only.
Definition: va.h:897
VAStatus vaBeginPicture(VADisplay dpy, VAContextID context, VASurfaceID render_target)
Video processing pipeline parameter buffer.
Definition: va.h:1971
Buffer type used for HRD parameters.
Definition: va.h:2232
Definition: va.h:558
Protected content API.
uint32_t status_report_index
The status report index reserved for CENC fullsample workload. The related structures and definitions...
Definition: va.h:2127
The HEVC encoding API.
uint32_t max_qp
Definition: va.h:2442
uint32_t ForceRepartitionCheck
Definition: va.h:2885
Set MB partion mode mask and Half-pel/Quant-pel motion search.
Definition: va.h:2252
Number of surface attributes.
Definition: va.h:1636
Attribute value for VAConfigAttribEncParallelRateControl.
Definition: va.h:2817
VAStatus vaSyncSurface2(VADisplay dpy, VASurfaceID surface, uint64_t timeout_ns)
Synchronizes pending operations associated with the supplied surface.
uint32_t data_size
total size of the buffer in bytes.
Definition: va.h:1676
uint32_t disable_frame_skip
Definition: va.h:2390
int32_t load_intra_quant_mat
Definition: va.h:3203
HEVC/H.265 encoding block sizes. Read-only.
Definition: va.h:1002
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.
Surface attribute.
Definition: va.h:1640
#define va_deprecated_enum
Misc packed header. See codec-specific definitions.
Definition: va.h:98
The HEVC decoding API.
Buffer type used for parallel BRC parameters.
Definition: va.h:2250
inter frame prediction directrion attribute. Read-only. this attribute conveys the prediction directi...
Definition: va.h:926
The VP9 decoding API.
int vaMaxNumImageFormats(VADisplay dpy)
uint32_t num_buffers
number of elements in the "buffers" array
Definition: va.h:1686
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:2914
uint32_t type
Definition: va.h:2293
Definition: va.h:1561
VAMvModeVC1
Definition: va.h:3233
VAGenericID VAContextID
Definition: va.h:1550
VAStatus vaMFSubmit(VADisplay dpy, VAMFContextID mf_context, VAContextID *contexts, int num_contexts)
uint32_t max_frame_size
support max frame size if max_frame_size == 1, VAEncMiscParameterTypeMaxFrameSize/VAEncMiscParameterB...
Definition: va.h:1209
uint32_t num_planes
number of planes for planar layout
Definition: va.h:1678
int32_t i
32-bit signed integer.
Definition: va.h:1575
uint32_t framerate
Definition: va.h:2488
uint8_t num_passes
number of passes, every pass has different QP, currently AVC encoder can support up to 4 passes ...
Definition: va.h:2640
uint32_t FTQOverride
Definition: va.h:2844
VAStatus vaQuerySurfaceError(VADisplay dpy, VASurfaceID surface, VAStatus error_status, void **error_info)
uint32_t mixed_quality_level
indicate whether all stream must support same quality level if mixed_quality_level == 0...
Definition: va.h:1364
uint32_t non_interleaved_mode
set to 1 for non-interleaved.
Definition: va.h:1226
uint32_t multiple_pass
multiple_pass support
Definition: va.h:1211
void * private_data
reserved for passing private data
Definition: va.h:1690
uint32_t max_frame_size
Maximum size of a frame (in byte)
Definition: va.h:2636
uint32_t initial_buffer_fullness
Definition: va.h:2590
uint32_t NonFTQSkipThresholdLUTInput
Definition: va.h:2852
VAStatus vaDestroySurfaces(VADisplay dpy, VASurfaceID *surfaces, int num_surfaces)
VAStatus vaTerminate(VADisplay dpy)
VAStatus vaSyncSurface(VADisplay dpy, VASurfaceID render_target)
VAMessageCallback vaSetInfoCallback(VADisplay dpy, VAMessageCallback callback, void *user_context)
VAStatus vaSetSubpictureGlobalAlpha(VADisplay dpy, VASubpictureID subpicture, float global_alpha)
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)
int vaMaxNumEntrypoints(VADisplay dpy)
Rate control parameters.
Definition: va.h:2347
encode max frame size attribute. Read-only attribute value VAConfigAttribValMaxFrameSize represent ma...
Definition: va.h:914
uint32_t FTQEnable
Definition: va.h:2846
Attribute value for VAConfigAttribEncRateControlExt.
Definition: va.h:1316
set encode quality tuning
Definition: va.h:2254
Encode Slice Parameter Buffer.
Definition: va.h:3616
uint32_t height
height in pixels.
Definition: va.h:1674
uint32_t reserved
reserved bit for future, must be zero
Definition: va.h:1366
HEVC FEI CU level data buffer it&#39;s CTB level information for future usage.
Definition: va.h:2016
uint8_t * delta_qp
delta QP list for every pass
Definition: va.h:2642
JPEG encoding API.
VAStatus vaSetSubpictureImage(VADisplay dpy, VASubpictureID subpicture, VAImageID image)
Encoding skip frame.
Definition: va.h:2706
VAStatus vaCreateContext(VADisplay dpy, VAConfigID config_id, int picture_width, int picture_height, int flag, VASurfaceID *render_targets, int num_render_targets, VAContextID *context)
Definition: va.h:3539
uint32_t buffer_size
Definition: va.h:2596
VA buffer information.
Definition: va.h:3889
HEVC Decoding Subset Parameter buffer type.
Definition: va.h:2031
Buffer type used for temporal layer structure.
Definition: va.h:2246
uint32_t rounding_offset_inter
Inter rounding offset Ignored if enable_custom_rouding_inter equals 0.
Definition: va.h:2930
uint32_t temporal_id
Definition: va.h:2402
Definition: va.h:2181
Packed headers mode. Read/write.
Definition: va.h:684
Slice structure. Read-only.
Definition: va.h:728
const char * vaErrorStr(VAStatus error_status)
uint32_t roi_rc_priority_support
A flag indicates whether ROI priority is supported.
Definition: va.h:1297
VAStatus vaCopy(VADisplay dpy, VACopyObject *dst, VACopyObject *src, VACopyOption option)
Copies an object.
The FEI encoding HEVC special API.
Generic motion vector data structure.
Definition: va.h:412
uint32_t status
Status set by the driver. See VA_CODED_BUF_STATUS_*.
Definition: va.h:3835
uint32_t reserved
Reserved for future use.
Definition: va.h:3837
VAStatus vaQueryImageFormats(VADisplay dpy, VAImageFormat *format_list, int *num_formats)
uint8_t has_emulation_bytes
Flag: buffer contains start code emulation prevention bytes?
Definition: va.h:2297
VAEncMiscParameterType
Definition: va.h:2223
JPEG encoding attribute. Read-only.
Definition: va.h:762
Definition: va.h:2510
AV1 decoding features. Read-only.
Definition: va.h:942
Statistics attribute. Read-only.
Definition: va.h:889
Defines a maximum frame size (in bits).
Definition: va.h:2611
Definition: va.h:3428
VAStatus vaGetConfigAttributes(VADisplay dpy, VAProfile profile, VAEntrypoint entrypoint, VAConfigAttrib *attrib_list, int num_attribs)
size_t mem_size
Size of the underlying buffer.
Definition: va.h:3904
uint32_t periodicity
The length of the array defining frame layer membership. Should be 1-32.
Definition: va.h:2332
uint16_t slice_data_bit_offset
Bit offset from NAL Header Unit to the begining of slice_data().
Definition: va.h:3555
VAStatus vaQuerySurfaceAttributes(VADisplay dpy, VAConfigID config, VASurfaceAttrib *attrib_list, unsigned int *num_attribs)
Queries surface attributes for the supplied config.
uint32_t window_size
Definition: va.h:2362
Encoding quality range attribute. Read-only.
Definition: va.h:771
VAStatus vaEndPicture(VADisplay dpy, VAContextID context)
uint32_t reserved
Definition: va.h:2427
uint32_t basic_unit_size
Definition: va.h:2378
Cipher block size of the protected content session.
Definition: va.h:960
Buffer type used for Rolling intra refresh.
Definition: va.h:2235
uint32_t size_of_length
CENC counter length.
Definition: va.h:2129
Definition: va.h:2019
uint32_t sub_device_count
sub devices count, read - only
Definition: va.h:4965
The JPEG decoding API.
Buffer type used for quantization parameters, it&#39;s per-sequence parameter.
Definition: va.h:2237
Temporal layer Structure.
Definition: va.h:2327
Definition: va.h:2829
VAProfile
Definition: va.h:494
uint32_t HMEDisable
Definition: va.h:2872
VAStatus vaSetSubpictureChromakey(VADisplay dpy, VASubpictureID subpicture, unsigned int chromakey_min, unsigned int chromakey_max, unsigned int chromakey_mask)
VAStatus vaCreateConfig(VADisplay dpy, VAProfile profile, VAEntrypoint entrypoint, VAConfigAttrib *attrib_list, int num_attribs, VAConfigID *config_id)
const char * vaQueryVendorString(VADisplay dpy)
uint32_t target_percentage
Definition: va.h:2356
VAEntrypoint
Definition: va.h:540
VABufferType
Definition: va.h:1928
Definition: va.h:3068
uint32_t current_sub_device
current sub device index, read - write
Definition: va.h:4963
Maximum picture height. Read-only.
Definition: va.h:754
uint32_t quality_level
quality level. When set to 0, default quality level is used.
Definition: va.h:2171
VAStatus vaCreateImage(VADisplay dpy, VAImageFormat *format, int width, int height, VAImage *image)
Parallel Rate Control (hierachical B) attribute. Read-only.
Definition: va.h:850
uint32_t bit_offset
Bit offset into the data buffer where the video data starts.
Definition: va.h:3833
Definition: va.h:3216
uint32_t reserved
Reserved bits for future use, must be zero.
Definition: va.h:2067
Processing rate reporting attribute. Read-only.
Definition: va.h:824
Quantization settings for encoding.
Definition: va.h:2675
Definition: va.h:1559
uint32_t size
Size of the data buffer in this segment (in bytes).
Definition: va.h:3831
Huffman table for JPEG decoding.
Definition: va.h:2975
Packed picture header.
Definition: va.h:2268
uint32_t number_of_layers
The number of temporal layers.
Definition: va.h:2330
uint32_t roi_rc_qp_delta_support
A flag indicates whether ROI delta QP is supported.
Definition: va.h:1309
Encryption parameters buffer for VAEncryptionParameterBufferType.
Definition: va.h:2115
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:2149
Cipher algorithm of the protected content session.
Definition: va.h:953
VAGenericID VABufferID
Definition: va.h:1926
VAStatus vaSetDriverName(VADisplay dpy, char *driver_name)
VAStatus vaGetDisplayAttributes(VADisplay dpy, VADisplayAttribute *attr_list, int num_attributes)
Custom Encoder Rounding Offset Control. Application may use this structure to set customized rounding...
Definition: va.h:2906
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:5153
VAStatus vaDestroyImage(VADisplay dpy, VAImageID image)
uint32_t skipCheckDisable
Definition: va.h:2841
Buffer type used to express a maximum frame size (in bits).
Definition: va.h:2230
int vaMaxNumSubpictureFormats(VADisplay dpy)
uint8_t level_idc
Profile level.
Definition: va.h:2183
uint32_t bits_per_second
Definition: va.h:2350
HEVC/H.265 encoding features. Read-only.
Definition: va.h:992
void(* VAMessageCallback)(void *user_context, const char *message)
Definition: va.h:422
uint32_t useRawPicForRef
Definition: va.h:2838
Buffer type used for FEI input frame level parameters.
Definition: va.h:2258
VAEntrypointStats.
Definition: va.h:592
VAStatus vaMFReleaseContext(VADisplay dpy, VAMFContextID mf_context, VAContextID context)
Minimal height in pixels (int, read-only).
Definition: va.h:1613
void * buf
Pointer to the start of the data buffer.
Definition: va.h:3839
priority setting for the context. Read-Write attribute value is VAConfigAttribValContextPriority this...
Definition: va.h:935
uint32_t frame_tolerance_mode
Definition: va.h:2425
Encoding intra refresh attribute. Read-only.
Definition: va.h:786
HEVC FEI CTB level cmd buffer it is CTB level information for future usage.
Definition: va.h:2011
Special usage attribute of the protected session.
Definition: va.h:981
uint32_t max_num_temporal_layers_minus1
The maximum number of temporal layers minus 1.
Definition: va.h:1325
Encryption parameters buffer for protected content session.
Definition: va.h:2050
uint32_t type
Buffer type (See VABufferType).
Definition: va.h:3893
uint32_t disable_bit_stuffing
Definition: va.h:2392
uint32_t num_roi_regions
The number of ROI regions supported, 0 if ROI is not supported.
Definition: va.h:1285
uint32_t cfs_I_frames
Definition: va.h:2404
VAStatus vaAcquireBufferHandle(VADisplay dpy, VABufferID buf_id, VABufferInfo *buf_info)
Acquires buffer handle for external API usage.
Maximum frame size (in bytes) settings for multiple pass.
Definition: va.h:2631
Protected session execution buffer type.
Definition: va.h:2044
Definition: va.h:2578
uint32_t reserved
reserved bits for future, must be zero
Definition: va.h:4967
uint32_t PanicModeDisable
Definition: va.h:2880
VAEntrypointProtectedTEEComm.
Definition: va.h:598
VAStatus vaDestroySubpicture(VADisplay dpy, VASubpictureID subpicture)
Encoding extended rate control attribute. Read-only.
Definition: va.h:813
Maximum picture width. Read-only.
Definition: va.h:747
uintptr_t handle
Buffer handle.
Definition: va.h:3891
VP9 encoding API.
VADisplayAttribBLEMode
Definition: va.h:4899
VAPrivFunc vaGetLibFunc(VADisplay dpy, const char *func)
The FEI encoding common API.
int32_t load_chroma_intra_quantiser_matrix
Same as the MPEG-2 bitstream syntax element.
Definition: va.h:3051
VAMessageCallback vaSetErrorCallback(VADisplay dpy, VAMessageCallback callback, void *user_context)
VAStatus vaDestroyContext(VADisplay dpy, VAContextID context)
uint32_t context_priority_update
indicate whether context priority changed
Definition: va.h:2065
uint32_t globalMotionBiasAdjustmentEnable
Definition: va.h:2863
VAStatus vaMapBuffer(VADisplay dpy, VABufferID buf_id, void **pbuf)
VP8 encoding API.
VAGenericID VASubpictureID
Definition: va.h:4759
uint8_t num_ref_idx_l0_active_minus1
Definition: va.h:3565
uint32_t enable_parallel_brc
Definition: va.h:2409
VAStatus vaQueryConfigProfiles(VADisplay dpy, VAProfile *profile_list, int *num_profiles)
VAStatus vaCreateSubpicture(VADisplay dpy, VAImageID image, VASubpictureID *subpicture)
The FEI encoding H264 special API.
VASurfaceAttribType
Surface attribute types.
Definition: va.h:1596
VAGenericValue value
Value. See "Surface attribute types" for the expected types.
Definition: va.h:1646
TEE could be any HW secure device. Read-only.
Definition: va.h:944
Encoding region-of-interest (ROI) attribute. Read-only.
Definition: va.h:805
Maximum number of slices per frame. Read-only.
Definition: va.h:711
VAStatus vaRenderPicture(VADisplay dpy, VAContextID context, VABufferID *buffers, int num_buffers)
Maximum number of reference frames. Read-only.
Definition: va.h:704
Encode function type for FEI.
Definition: va.h:873
Slice Decoding mode. Read/write.
Definition: va.h:630
VAStatus vaBufferSetNumElements(VADisplay dpy, VABufferID buf_id, unsigned int num_elements)
uint32_t reserved
Reserved bytes for future use, must be zero.
Definition: va.h:2638
uint8_t level_idc
Profile level.
Definition: va.h:2166
uint32_t reserved
Definition: va.h:2496
VAStatus vaInitialize(VADisplay dpy, int *major_version, int *minor_version)
VAStatus vaSyncBuffer(VADisplay dpy, VABufferID buf_id, uint64_t timeout_ns)
Synchronizes pending operations associated with the supplied buffer.
uint32_t mem_type
Buffer memory type (See VASurfaceAttribMemoryType).
Definition: va.h:3902
VAStatus vaGetImage(VADisplay dpy, VASurfaceID surface, int x, int y, unsigned int width, unsigned int height, VAImageID image)
Profile ID used for video processing.
Definition: va.h:497
VAGenericFunc fn
Pointer to function.
Definition: va.h:1581
uint32_t num_layers
Definition: va.h:2819
uint32_t target_frame_size
Definition: va.h:2456
Video filter parameter buffer.
Definition: va.h:1984
uint32_t differential_mode
set to 1 for differential.
Definition: va.h:1228
Maximal width in pixels (int, read-only).
Definition: va.h:1611
uint32_t FTQSkipThresholdLUTInput
Definition: va.h:2849
VAGenericValueType
Generic value types.
Definition: va.h:1558
uint8_t num_ref_idx_l1_active_minus1
Definition: va.h:3572
frame size tolerance support it indicates the tolerance of frame size
Definition: va.h:864
Buffer type used for dirty region-of-interest (ROI) parameters.
Definition: va.h:2248
VASurfaceID picture_id
reconstructed picture buffer surface index invalid when taking value VA_INVALID_SURFACE.
Definition: va.h:5148
List of possible DRM format modifiers (pointer, write).
Definition: va.h:1634
uint32_t temporal_layer_bitrate_control_flag
Definition: va.h:1350
VAStatus vaDestroyConfig(VADisplay dpy, VAConfigID config_id)
VAStatus vaSetDisplayAttributes(VADisplay dpy, VADisplayAttribute *attr_list, int num_attributes)
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.
Packed sequence header.
Definition: va.h:2266
uint32_t mb_rate_control
Definition: va.h:2400
Attribute value for VAConfigAttribEncROI.
Definition: va.h:1282
uint32_t * num_b_in_gop
Definition: va.h:2824
uint32_t width
width in pixels.
Definition: va.h:1672
uint32_t arithmatic_coding_mode
set to 1 for arithmatic coding.
Definition: va.h:1222
uint32_t reserved
reserved bits for future, must be zero
Definition: va.h:1213
VAEntrypointProtectedContent.
Definition: va.h:604
Encoding quality level.
Definition: va.h:2659
uint32_t initial_qp
Definition: va.h:2367
update the context parameter this structure is used to update context parameters, such as priority of...
Definition: va.h:2060
uint32_t temporal_id
Definition: va.h:2494
The H.264 encoding API.
Definition: va.h:3472
uint32_t priority
the priority , for the Query operation (read) it represents highest priority for the set operation (w...
Definition: va.h:1376
Macroblock information. Read-only.
Definition: va.h:740
int vaMaxNumProfiles(VADisplay dpy)
VASurfaceAttribType type
Type.
Definition: va.h:1642
VAStatus vaCreateBuffer(VADisplay dpy, VAContextID context, VABufferType type, unsigned int size, unsigned int num_elements, void *data, VABufferID *buf_id)
Buffer type used for encoder rounding offset parameters.
Definition: va.h:2256
Surface usage hint, gives the driver a hint of intended usage to optimize allocation (e...
Definition: va.h:1627
uint32_t pixel_format
pixel format in fourcc.
Definition: va.h:1670
Definition: va.h:3148
VAStatus vaReleaseBufferHandle(VADisplay dpy, VABufferID buf_id)
Releases buffer after usage from external API.
Maximum number of FEI MV predictors. Read-only.
Definition: va.h:881
Definition: va.h:2467
uint32_t bit_length
Size of the #VAEncPackedHeaderDataBuffer in bits.
Definition: va.h:2295
VAEncryptionSegmentInfo * segment_info
Pointer of segments.
Definition: va.h:2123
void * next
Pointer to the next VACodedBufferSegment element, or NULL if there is none.
Definition: va.h:3844
int32_t load_non_intra_quant_mat
Definition: va.h:3205
void * VANativeDisplay
Definition: va.h:443
uint32_t sub_device_mask
bit mask to indicate which sub_device is available, read only
Definition: va.h:4983
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:2713
Interlaced mode. Read/write.
Definition: va.h:693
VAEntrypointFEI.
Definition: va.h:575
uint32_t HMEMVCostScalingFactor
Definition: va.h:2870
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)
int8_t roi_value
ROI value.
Definition: va.h:2757
Dynamic Scaling Attribute. Read-only.
Definition: va.h:859
Buffer type used to express a maximum frame size (in bytes) settings for multiple pass...
Definition: va.h:2244
uint32_t ip_period
Period between I/P frames.
Definition: va.h:2175
#define VA_PADDING_LOW
Definition: va.h:358
uint32_t max_frame_size
Maximum size of a frame (in bits).
Definition: va.h:2616
structure for encrypted segment info.
Definition: va.h:2095
Definition: va.h:1560
int32_t load_intra_quantiser_matrix
Same as the MPEG-2 bitstream syntax element.
Definition: va.h:3047
uint32_t init_byte_length
The length in bytes of the initial clear data.
Definition: va.h:2105
Packed raw header.
Definition: va.h:2279
Definition: va.h:4199
float f
32-bit float.
Definition: va.h:1577
VAStatus vaCreateMFContext(VADisplay dpy, VAMFContextID *mf_context)
Pixel format as a FOURCC (int, read/write).
Definition: va.h:1607
VAStatus vaDestroyBuffer(VADisplay dpy, VABufferID buffer_id)
uint32_t quality_factor
Definition: va.h:2447
uint32_t reset
Definition: va.h:2388
unsigned int VAGenericID
Definition: va.h:1487
VAEncPackedHeaderType
Packed header type.
Definition: va.h:2264
VAConfigAttribType
Definition: va.h:608
uint32_t progressive_dct_mode
set to 1 for progressive dct.
Definition: va.h:1224
Definition: va.h:3255
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:2718
uintptr_t * buffers
buffer handles or user pointers
Definition: va.h:1684
adjust context parameters dynamically
Definition: va.h:2037
void * VADisplay
Definition: va.h:258
int32_t load_chroma_non_intra_quantiser_matrix
Same as the MPEG-2 bitstream syntax element.
Definition: va.h:3053
VAStatus vaQueryDisplayAttributes(VADisplay dpy, VADisplayAttribute *attr_list, int *num_attributes)
VAGenericValueType type
Value type. See VAGenericValueType.
Definition: va.h:1571
Definition: va.h:1562
The AV1 decoding API.
Decode processing support. Read/write.
Definition: va.h:671
VAStatus vaQueryConfigEntrypoints(VADisplay dpy, VAProfile profile, VAEntrypoint *entrypoint_list, int *num_entrypoints)
uint32_t partial_aes_block_size
The length in bytes of the remainder of an incomplete block from a previous segment.
Definition: va.h:2103
Statistics output for VAEntrypointStats progressive and top field of interlaced case.
Definition: va.h:1995
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:2140
Definition: va.h:2320
int vaMaxNumConfigAttributes(VADisplay dpy)
Buffer type used for region-of-interest (ROI) parameters.
Definition: va.h:2242
Attribute value for VAConfigAttribEncJPEG.
Definition: va.h:1219
void(* VAGenericFunc)(void)
Generic function type.
Definition: va.h:1566
uint32_t flags
flags. See "Surface external buffer descriptor flags".
Definition: va.h:1688
VAStatus vaDeriveImage(VADisplay dpy, VASurfaceID surface, VAImage *image)
Definition: va.h:3044
uint8_t num_skip_frames
The number of frames skipped prior to the current frame. Valid when skip_frame_flag = 1...
Definition: va.h:2715
JPEG decoding attribute. Read-only.
Definition: va.h:638
Generic value.
Definition: va.h:1569
VAStatus vaDeassociateSubpicture(VADisplay dpy, VASubpictureID subpicture, VASurfaceID *target_surfaces, int num_surfaces)
encode extension buffer, ect. MPEG2 Sequence extenstion data
Definition: va.h:2260
sub device info Sub-device is the concept basing on the "device" behind "vaDisplay". If a device could be divided to several sub devices, the task of decode/encode/vpp could be assigned on one sub-device. So, application could choose the sub device before any other operations. After that, all of the task execution/resource allocation will be dispatched to the sub device. If application does not choose the sub device, driver will assign one as default.
Definition: va.h:4960
Buffer type used for sending skip frame parameters to the encoder&#39;s rate control, when the user has e...
Definition: va.h:2240
uint32_t intra_period
Period between I frames.
Definition: va.h:2173
VAStatus vaQueryProcessingRate(VADisplay dpy, VAConfigID config, VAProcessingRateParameter *proc_buf, unsigned int *processing_rate)
Queries processing rate for the supplied config.
VAStatus vaQuerySubpictureFormats(VADisplay dpy, VAImageFormat *format_list, unsigned int *flags, unsigned int *num_formats)
uint32_t quality_level
Encoding quality level setting. When set to 0, default quality level is used.
Definition: va.h:2663
Minimal width in pixels (int, read-only).
Definition: va.h:1609
Definition: va.h:1013
Encoding QP info block size attribute. Read-only. This attribute conveys the block sizes that underly...
Definition: va.h:909
Definition: va.h:3527
Encoding dirty rectangle. Read-only.
Definition: va.h:838
Surface memory type expressed in bit fields (int, read/write).
Definition: va.h:1617
whether accept rouding setting from application. Read-only. This attribute is for encode quality...
Definition: va.h:903
int vaMaxNumDisplayAttributes(VADisplay dpy)
uint32_t flags
Flags. See "Surface attribute flags".
Definition: va.h:1644
Coded buffer segment.
Definition: va.h:3827
void * p
Generic pointer.
Definition: va.h:1579
Statistics output for VAEntrypointStats bottom field of interlaced case.
Definition: va.h:1997
uint32_t min_qp
Definition: va.h:2373
External buffer descriptor (pointer, write).
Definition: va.h:1624
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:2925
uint32_t rounding_offset_intra
Intra rounding offset Ignored if enable_custom_rouding_intra equals 0.
Definition: va.h:2919
uint32_t SuperHMEDisable
Definition: va.h:2874
VAConfigAttribValContextPriority context_priority
task/context priority
Definition: va.h:2072
Description of picture properties of those in DPB surfaces.
Definition: va.h:5143
int32_t load_non_intra_quantiser_matrix
Same as the MPEG-2 bitstream syntax element.
Definition: va.h:3049
Maximal height in pixels (int, read-only).
Definition: va.h:1615
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:2156
TEE type client is a specific module supporting specific functions in TEE. Read-only.
Definition: va.h:946
VAStatus vaMFAddContext(VADisplay dpy, VAMFContextID mf_context, VAContextID context)
Encoding quantization attribute. Read-only.
Definition: va.h:778
Definition: va.h:2164
FEI specific buffer types.
Definition: va.h:1988
uint32_t slice_data_offset
Byte offset to the NAL Header Unit for this slice.
Definition: va.h:3543
uint32_t directBiasAdjustmentEnable
Definition: va.h:2856
Attribute value for VAConfigAttribMultipleFrame.
Definition: va.h:1357
uint32_t encryption_type
Encryption type, refer to VA_ENCRYPTION_TYPE_FULLSAMPLE_CTR, VA_ENCRYPTION_TYPE_FULLSAMPLE_CBC, VA_ENCRYPTION_TYPE_SUBSAMPLE_CTR, or VA_ENCRYPTION_TYPE_SUBSAMPLE_CBC.
Definition: va.h:2119
Encoding QP buffer.
Definition: va.h:1963
uint32_t ICQ_quality_factor
Definition: va.h:2436
VAStatus vaQuerySurfaceStatus(VADisplay dpy, VASurfaceID render_target, VASurfaceStatus *status)
Encoding region-of-interest (ROI).
Definition: va.h:2733
Profile ID used for protected video playback.
Definition: va.h:534
Packed slice header.
Definition: va.h:2270
uint32_t segment_length
The length of the segments in bytes.
Definition: va.h:2100
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:2098
uint32_t reserved
reserved bits for future, must be zero
Definition: va.h:1378
VAStatus vaUnmapBuffer(VADisplay dpy, VABufferID buf_id)
Packed header parameter.
Definition: va.h:2291
VASurfaceAttribExternalBuffers structure for the VASurfaceAttribExternalBufferDescriptor attribute...
Definition: va.h:1668
Attribute value for VAConfigAttribMaxFrameSize.
Definition: va.h:1202
VARectangle roi_rectangle
Defines the ROI boundary in pixels, the driver will map it to appropriate codec coding units...
Definition: va.h:2738
uint32_t UltraHMEDisable
Definition: va.h:2876
VADisplayAttribType
Definition: va.h:4989
Definition: va.h:3200
Cipher mode of the protected content session.
Definition: va.h:967
uint32_t num_segments
The number of sengments.
Definition: va.h:2121