/** *Enabledthepositioning/cropping/blendingfeature: *1,specifythevideoplaybackpositionintheisurface *2,specifythecroppinginfoforvideoplayback *3,encodedvideowillblendwithbackgroundcolor
*/ #define VA_ENABLE_BLEND 0x00000004 /* video area blend with the constant color */
/* Values used to describe device features. */ /** The feature is not supported by the device. * *Anycorrespondingfeatureflagmustnotbeset.
*/ #define VA_FEATURE_NOT_SUPPORTED 0 /** The feature is supported by the device. * *Theusermaydecidewhetherornottousethisfeature. * *Notethatsupportforafeatureonlyindicatesthatthehardware *isabletouseit;whetheritisactuallyapositivechangeto *enableitinagivensituationwilldependonotherfactors *includingtheinputprovidedbytheuser.
*/ #define VA_FEATURE_SUPPORTED 1 /** The feature is required by the device. * *Thedevicedoesnotsupportnotenablingthisfeature,soany *correspondingfeatureflagmustbesetandanyadditional *configurationneededbythefeaturemustbesupplied.
*/ #define VA_FEATURE_REQUIRED 2
/** @name Attribute values for VAConfigAttribEncInterlaced */ /**@{*/ /** \brief Driver does not support interlaced coding. */ #define VA_ENC_INTERLACED_NONE 0x00000000 /** \brief Driver supports interlaced frame coding. */ #define VA_ENC_INTERLACED_FRAME 0x00000001 /** \brief Driver supports interlaced field coding. */ #define VA_ENC_INTERLACED_FIELD 0x00000002 /** \brief Driver supports macroblock adaptive frame field coding. */ #define VA_ENC_INTERLACED_MBAFF 0x00000004 /** \brief Driver supports picture adaptive frame field coding. */ #define VA_ENC_INTERLACED_PAFF 0x00000008 /**@}*/
/** @name Attribute values for VAConfigAttribEncSliceStructure */ /**@{*/ /** \brief Driver supports a power-of-two number of rows per slice. */ #define VA_ENC_SLICE_STRUCTURE_POWER_OF_TWO_ROWS 0x00000001 /** \brief Driver supports an arbitrary number of macroblocks per slice. */ #define VA_ENC_SLICE_STRUCTURE_ARBITRARY_MACROBLOCKS 0x00000002 /** \brief Driver support 1 row per slice */ #define VA_ENC_SLICE_STRUCTURE_EQUAL_ROWS 0x00000004 /** \brief Driver support max encoded slice size per slice */ #define VA_ENC_SLICE_STRUCTURE_MAX_SLICE_SIZE 0x00000008 /** \brief Driver supports an arbitrary number of rows per slice. */ #define VA_ENC_SLICE_STRUCTURE_ARBITRARY_ROWS 0x00000010 /** \brief Driver supports any number of rows per slice but they must be the same *forallslicesexceptforthelastone,whichmustbeequalorsmaller
* to the previous slices. */ #define VA_ENC_SLICE_STRUCTURE_EQUAL_MULTI_ROWS 0x00000020 /**@}*/
/** \brief Attribute value for VAConfigAttribMaxFrameSize */ typedefunion _VAConfigAttribValMaxFrameSize { struct { /** \brief support max frame size *ifmax_frame_size==1,VAEncMiscParameterTypeMaxFrameSize/VAEncMiscParameterBufferMaxFrameSize *couldbeusedtosettheframesize,ifmultiple_passalsoequal1,VAEncMiscParameterTypeMultiPassFrameSize *VAEncMiscParameterBufferMultiPassFrameSizecouldbeusedtosetframesizeandpassinformation
*/
uint32_t max_frame_size : 1; /** \brief multiple_pass support */
uint32_t multiple_pass : 1; /** \brief reserved bits for future, must be zero*/
uint32_t reserved : 30;
} bits;
uint32_t value;
} VAConfigAttribValMaxFrameSize;
/** \brief Attribute value for VAConfigAttribEncJPEG */ typedefunion _VAConfigAttribValEncJPEG { struct { /** \brief set to 1 for arithmatic coding. */
uint32_t arithmatic_coding_mode : 1; /** \brief set to 1 for progressive dct. */
uint32_t progressive_dct_mode : 1; /** \brief set to 1 for non-interleaved. */
uint32_t non_interleaved_mode : 1; /** \brief set to 1 for differential. */
uint32_t differential_mode : 1;
uint32_t max_num_components : 3;
uint32_t max_num_scans : 4;
uint32_t max_num_huffman_tables : 3;
uint32_t max_num_quantization_tables : 3;
} bits;
uint32_t value;
} VAConfigAttribValEncJPEG;
/** @name Attribute values for VAConfigAttribEncQuantization */ /**@{*/ /** \brief Driver does not support special types of quantization */ #define VA_ENC_QUANTIZATION_NONE 0x00000000 /** \brief Driver supports trellis quantization */ #define VA_ENC_QUANTIZATION_TRELLIS_SUPPORTED 0x00000001 /**@}*/
/** @name Attribute values for VAConfigAttribPredictionDirection */ /**@{*/ /** \brief Driver support forward reference frame (inter frame for vpx, P frame for H26x MPEG) *canworkwiththeVAConfigAttribEncMaxRefFrames.forexample:lowdelayBframeofHEVC. *thesevaluecanbeOR'dtogether.typicalvalueshouldbeVA_PREDICTION_DIRECTION_PREVIOUS *orVA_PREDICTION_DIRECTION_PREVIOUS|VA_PREDICTION_DIRECTION_FUTURE,theoretically,there *arenostreamonlyincludefuturereferenceframe.
*/ #define VA_PREDICTION_DIRECTION_PREVIOUS 0x00000001 /** \brief Driver support backward prediction frame/slice */ #define VA_PREDICTION_DIRECTION_FUTURE 0x00000002 /** \brief Dirver require both reference list must be not empty for inter frame */ #define VA_PREDICTION_DIRECTION_BI_NOT_EMPTY 0x00000004 /**@}*/
/** @name Attribute values for VAConfigAttribEncIntraRefresh */ /**@{*/ /** \brief Driver does not support intra refresh */ #define VA_ENC_INTRA_REFRESH_NONE 0x00000000 /** \brief Driver supports column based rolling intra refresh */ #define VA_ENC_INTRA_REFRESH_ROLLING_COLUMN 0x00000001 /** \brief Driver supports row based rolling intra refresh */ #define VA_ENC_INTRA_REFRESH_ROLLING_ROW 0x00000002 /** \brief Driver supports adaptive intra refresh */ #define VA_ENC_INTRA_REFRESH_ADAPTIVE 0x00000010 /** \brief Driver supports cyclic intra refresh */ #define VA_ENC_INTRA_REFRESH_CYCLIC 0x00000020 /** \brief Driver supports intra refresh of P frame*/ #define VA_ENC_INTRA_REFRESH_P_FRAME 0x00010000 /** \brief Driver supports intra refresh of B frame */ #define VA_ENC_INTRA_REFRESH_B_FRAME 0x00020000 /** \brief Driver supports intra refresh of multiple reference encoder */ #define VA_ENC_INTRA_REFRESH_MULTI_REF 0x00040000
/**@}*/
/** \brief Attribute value for VAConfigAttribEncROI */ typedefunion _VAConfigAttribValEncROI { struct { /** \brief The number of ROI regions supported, 0 if ROI is not supported. */
uint32_t num_roi_regions : 8; /** *\briefAflagindicateswhetherROIpriorityissupported * *\refroi_rc_priority_supportequalto1specifiestheunderlyingdriversupports *ROIprioritywhenVAConfigAttribRateControl!=VA_RC_CQP,usercanuse\croi_value *in#VAEncROItosetROIpriority.\refroi_rc_priority_supportequalto0specifies *theunderlyingdriverdoesn'tsupportROIpriority. * *Usershouldignore\refroi_rc_priority_supportwhenVAConfigAttribRateControl==VA_RC_CQP *becauseROIdeltaQPisalwaysrequiredwhenVAConfigAttribRateControl==VA_RC_CQP.
*/
uint32_t roi_rc_priority_support : 1; /** *\briefAflagindicateswhetherROIdeltaQPissupported * *\refroi_rc_qp_delta_supportequalto1specifiestheunderlyingdriversupports *ROIdeltaQPwhenVAConfigAttribRateControl!=VA_RC_CQP,usercanuse\croi_value *in#VAEncROItosetROIdeltaQP.\refroi_rc_qp_delta_supportequalto0specifies *theunderlyingdriverdoesn'tsupportROIdeltaQP. * *Usershouldignore\refroi_rc_qp_delta_supportwhenVAConfigAttribRateControl==VA_RC_CQP *becauseROIdeltaQPisalwaysrequiredwhenVAConfigAttribRateControl==VA_RC_CQP.
*/
uint32_t roi_rc_qp_delta_support : 1;
uint32_t reserved : 22;
} bits;
uint32_t value;
} VAConfigAttribValEncROI;
/** \brief Attribute value for VAConfigAttribMultipleFrame*/ typedefunion _VAConfigAttribValMultipleFrame { struct { /** \brief max num of concurrent frames from different stream */
uint32_t max_num_concurrent_frames : 8; /** \brief indicate whether all stream must support same quality level *ifmixed_quality_level==0,samequalitylevelsettingformultplestreamsisrequired
* if mixed_quality_level == 1, different stream can have different quality level*/
uint32_t mixed_quality_level : 1; /** \brief reserved bit for future, must be zero */
uint32_t reserved : 23;
} bits;
uint32_t value;
} VAConfigAttribValMultipleFrame;
/** brief Attribute value VAConfigAttribValContextPriority */ typedefunion _VAConfigAttribValContextPriority { struct { /** \brief the priority , for the Query operation (read) it represents highest priority
* for the set operation (write), value should be [0~highest priority] , 0 is lowest priority*/
uint32_t priority : 16; /** \brief reserved bits for future, must be zero*/
uint32_t reserved : 16;
} bits;
uint32_t value;
} VAConfigAttribValContextPriority;
/** \brief Generic value types. */ typedefenum {
VAGenericValueTypeInteger = 1, /**< 32-bit signed integer. */
VAGenericValueTypeFloat, /**< 32-bit floating-point value. */
VAGenericValueTypePointer, /**< Generic pointer type */
VAGenericValueTypeFunc /**< Pointer to function */
} VAGenericValueType;
/** \brief Generic function type. */ typedefvoid (*VAGenericFunc)(void);
/** \brief Generic value. */ typedefstruct _VAGenericValue { /** \brief Value type. See #VAGenericValueType. */
VAGenericValueType type; /** \brief Value holder. */ union { /** \brief 32-bit signed integer. */
int32_t i; /** \brief 32-bit float. */ float f; /** \brief Generic pointer. */ void *p; /** \brief Pointer to function. */
VAGenericFunc fn;
} value;
} VAGenericValue;
/** @name Surface attribute flags */ /**@{*/ /** \brief Surface attribute is not supported. */ #define VA_SURFACE_ATTRIB_NOT_SUPPORTED 0x00000000 /** \brief Surface attribute can be got through vaQuerySurfaceAttributes(). */ #define VA_SURFACE_ATTRIB_GETTABLE 0x00000001 /** \brief Surface attribute can be set through vaCreateSurfaces(). */ #define VA_SURFACE_ATTRIB_SETTABLE 0x00000002 /**@}*/
/** \brief Surface attribute types. */ typedefenum {
VASurfaceAttribNone = 0, /** *\briefPixelformatasaFOURCC(int,read/write). * *WhenvaQuerySurfaceAttributes()iscalled,thedriverwillreturnone *PixelFormatattributepersupportedpixelformat. * *WhenprovidedasaninputtovaCreateSurfaces(),thedriverwill *allocateasurfacewiththeprovidedpixelformat.
*/
VASurfaceAttribPixelFormat, /** \brief Minimal width in pixels (int, read-only). */
VASurfaceAttribMinWidth, /** \brief Maximal width in pixels (int, read-only). */
VASurfaceAttribMaxWidth, /** \brief Minimal height in pixels (int, read-only). */
VASurfaceAttribMinHeight, /** \brief Maximal height in pixels (int, read-only). */
VASurfaceAttribMaxHeight, /** \brief Surface memory type expressed in bit fields (int, read/write). */
VASurfaceAttribMemoryType, /** \brief External buffer descriptor (pointer, write). * *Refertothedocumentationforthememorytypebeingcreatedto *determinewhatdescriptorstructuretopasshere.Ifnototherwise *stated,thecommonVASurfaceAttribExternalBuffersshouldbeused.
*/
VASurfaceAttribExternalBufferDescriptor, /** \brief Surface usage hint, gives the driver a hint of intended usage
* to optimize allocation (e.g. tiling) (int, read/write). */
VASurfaceAttribUsageHint, /** \brief List of possible DRM format modifiers (pointer, write). * *ThevaluemustbeapointertoaVADRMFormatModifierList.Thiscanonly *beusedwhenallocatinganewbuffer,it'sinvalidtousethisattribute *whenimportinganexistingbuffer.
*/
VASurfaceAttribDRMFormatModifiers, /** \brief Number of surface attributes. */
VASurfaceAttribCount
} VASurfaceAttribType;
/** \brief Surface attribute. */ typedefstruct _VASurfaceAttrib { /** \brief Type. */
VASurfaceAttribType type; /** \brief Flags. See "Surface attribute flags". */
uint32_t flags; /** \brief Value. See "Surface attribute types" for the expected types. */
VAGenericValue value;
} VASurfaceAttrib;
/** *@nameVASurfaceAttribMemoryTypevaluesinbitfields. *Bit0:7arereservedforgenerictypes,Bit31:28arereservedfor *LinuxDRM,Bit23:20arereservedforAndroid.DRMandAndroidspecific *typesaredefinedinDRMandAndroidheaderfiles.
*/ /**@{*/ /** \brief VA memory type (default) is supported. */ #define VA_SURFACE_ATTRIB_MEM_TYPE_VA 0x00000001 /** \brief V4L2 buffer memory type is supported. */ #define VA_SURFACE_ATTRIB_MEM_TYPE_V4L2 0x00000002 /** \brief User pointer memory type is supported. */ #define VA_SURFACE_ATTRIB_MEM_TYPE_USER_PTR 0x00000004 /**@}*/
/** *\briefVASurfaceAttribExternalBuffersstructurefor *theVASurfaceAttribExternalBufferDescriptorattribute.
*/ typedefstruct _VASurfaceAttribExternalBuffers { /** \brief pixel format in fourcc. */
uint32_t pixel_format; /** \brief width in pixels. */
uint32_t width; /** \brief height in pixels. */
uint32_t height; /** \brief total size of the buffer in bytes. */
uint32_t data_size; /** \brief number of planes for planar layout */
uint32_t num_planes; /** \brief pitch for each plane in bytes */
uint32_t pitches[4]; /** \brief offset for each plane in bytes */
uint32_t offsets[4]; /** \brief buffer handles or user pointers */
uintptr_t *buffers; /** \brief number of elements in the "buffers" array */
uint32_t num_buffers; /** \brief flags. See "Surface external buffer descriptor flags". */
uint32_t flags; /** \brief reserved for passing private data */ void *private_data;
} VASurfaceAttribExternalBuffers;
/** @name VASurfaceAttribUsageHint attribute usage hint flags */ /**@{*/ /** \brief Surface usage not indicated. */ #define VA_SURFACE_ATTRIB_USAGE_HINT_GENERIC 0x00000000 /** \brief Surface used by video decoder. */ #define VA_SURFACE_ATTRIB_USAGE_HINT_DECODER 0x00000001 /** \brief Surface used by video encoder. */ #define VA_SURFACE_ATTRIB_USAGE_HINT_ENCODER 0x00000002 /** \brief Surface read by video post-processing. */ #define VA_SURFACE_ATTRIB_USAGE_HINT_VPP_READ 0x00000004 /** \brief Surface written by video post-processing. */ #define VA_SURFACE_ATTRIB_USAGE_HINT_VPP_WRITE 0x00000008 /** \brief Surface used for display. */ #define VA_SURFACE_ATTRIB_USAGE_HINT_DISPLAY 0x00000010 /** \brief Surface used for export to third-party APIs, e.g. via
* vaExportSurfaceHandle(). */ #define VA_SURFACE_ATTRIB_USAGE_HINT_EXPORT 0x00000020
/** \brief structure for encrypted segment info. */ typedefstruct _VAEncryptionSegmentInfo { /** \brief The offset relative to the start of the bitstream input in
* bytes of the start of the segment */
uint32_t segment_start_offset; /** \brief The length of the segments in bytes */
uint32_t segment_length; /** \brief The length in bytes of the remainder of an incomplete block
* from a previous segment*/
uint32_t partial_aes_block_size; /** \brief The length in bytes of the initial clear data */
uint32_t init_byte_length; /** \brief This will be AES counter for secure decode and secure encode *whennumSegmentsequals1,validsizeisspecifiedby
* \c key_blob_size */
uint8_t aes_cbc_iv_or_ctr[64]; /** \brief Reserved bytes for future use, must be zero */
uint32_t va_reserved[VA_PADDING_MEDIUM];
} VAEncryptionSegmentInfo;
/** \brief Encryption parameters buffer for VAEncryptionParameterBufferType */ typedefstruct _VAEncryptionParameters { /** \brief Encryption type, refer to \c VA_ENCRYPTION_TYPE_FULLSAMPLE_CTR, *\cVA_ENCRYPTION_TYPE_FULLSAMPLE_CBC,\cVA_ENCRYPTION_TYPE_SUBSAMPLE_CTR,
* or \c VA_ENCRYPTION_TYPE_SUBSAMPLE_CBC */
uint32_t encryption_type; /** \brief The number of sengments */
uint32_t num_segments; /** \brief Pointer of segments */
VAEncryptionSegmentInfo *segment_info; /** \brief The status report index reserved for CENC fullsample workload. *Therelatedstructuresanddefinitionsarevendorspecific.
*/
uint32_t status_report_index; /** \brief CENC counter length */
uint32_t size_of_length; /** \brief Wrapped decrypt blob (Snd)kb, valid size is specified by
* \c key_blob_size */
uint8_t wrapped_decrypt_blob[64]; /** \brief Wrapped Key blob info (Sne)kb, valid size is specified by
* \c key_blob_size */
uint8_t wrapped_encrypt_blob[64]; /** \brief key blob size *Itcouldbe\cVA_PC_BLOCK_SIZE_128,\cVA_PC_BLOCK_SIZE_192,or *\cVA_PC_BLOCK_SIZE_256
*/
uint32_t key_blob_size; /** \brief Indicates the number of 16-byte BLOCKS that are encrypted in any *givenencryptedregionofsegments. *Ifthisvalueiszero: *1.Allbytesinencryptedregionofsegmentsareencrypted,i.e.the *CENCorCBC1schemeisbeingused *2.blocks_stripe_clearmustalsobezero. *Ifthisvalueisnon-zero,blocks_stripe_clearmustalsobenon-zero.
*/
uint32_t blocks_stripe_encrypted; /** \brief Indicates the number of 16-byte BLOCKS that are clear in any given *encryptedregionofsegments,asdefinedbytheCENSandCBCSschemesin *thecommonencryptionspec. *Ifthisvalueiszero,allbytesinencryptedregionofsegmentsare *encrypted,i.e.theCENCorCBC1schemeisbeingused.
*/
uint32_t blocks_stripe_clear; /** \brief Reserved bytes for future use, must be zero */
uint32_t va_reserved[VA_PADDING_MEDIUM];
} VAEncryptionParameters;
/** *Processingrateparameterforencode.
*/ typedefstruct _VAProcessingRateParameterEnc { /** \brief Profile level */
uint8_t level_idc;
uint8_t reserved[3]; /** \brief quality level. When set to 0, default quality *levelisused.
*/
uint32_t quality_level; /** \brief Period between I frames. */
uint32_t intra_period; /** \brief Period between I/P frames. */
uint32_t ip_period;
} VAProcessingRateParameterEnc;
typedefenum {
VAEncMiscParameterTypeFrameRate = 0,
VAEncMiscParameterTypeRateControl = 1,
VAEncMiscParameterTypeMaxSliceSize = 2,
VAEncMiscParameterTypeAIR = 3, /** \brief Buffer type used to express a maximum frame size (in bits). */
VAEncMiscParameterTypeMaxFrameSize = 4, /** \brief Buffer type used for HRD parameters. */
VAEncMiscParameterTypeHRD = 5,
VAEncMiscParameterTypeQualityLevel = 6, /** \brief Buffer type used for Rolling intra refresh */
VAEncMiscParameterTypeRIR = 7, /** \brief Buffer type used for quantization parameters, it's per-sequence parameter*/
VAEncMiscParameterTypeQuantization = 8, /** \brief Buffer type used for sending skip frame parameters to the encoder's
* rate control, when the user has externally skipped frames. */
VAEncMiscParameterTypeSkipFrame = 9, /** \brief Buffer type used for region-of-interest (ROI) parameters. */
VAEncMiscParameterTypeROI = 10, /** \brief Buffer type used to express a maximum frame size (in bytes) settings for multiple pass. */
VAEncMiscParameterTypeMultiPassFrameSize = 11, /** \brief Buffer type used for temporal layer structure */
VAEncMiscParameterTypeTemporalLayerStructure = 12, /** \brief Buffer type used for dirty region-of-interest (ROI) parameters. */
VAEncMiscParameterTypeDirtyRect = 13, /** \brief Buffer type used for parallel BRC parameters. */
VAEncMiscParameterTypeParallelBRC = 14, /** \brief Set MB partion mode mask and Half-pel/Quant-pel motion search */
VAEncMiscParameterTypeSubMbPartPel = 15, /** \brief set encode quality tuning */
VAEncMiscParameterTypeEncQuality = 16, /** \brief Buffer type used for encoder rounding offset parameters. */
VAEncMiscParameterTypeCustomRoundingControl = 17, /** \brief Buffer type used for FEI input frame level parameters */
VAEncMiscParameterTypeFEIFrameControl = 18, /** \brief encode extension buffer, ect. MPEG2 Sequence extenstion data */
VAEncMiscParameterTypeExtensionData = 19
} VAEncMiscParameterType;
/** \brief Reserved bytes for future use, must be zero */
uint32_t va_reserved[VA_PADDING_LOW];
} VAEncMiscParameterMaxSliceSize;
typedefstruct _VAEncMiscParameterAIR {
uint32_t air_num_mbs;
uint32_t air_threshold;
uint32_t air_auto; /* if set to 1 then hardware auto-tune the AIR threshold */
/** \brief Reserved bytes for future use, must be zero */
uint32_t va_reserved[VA_PADDING_LOW];
} VAEncMiscParameterAIR;
/** HRD / VBV buffering parameters for encoding. * *ThissetstheHRD/VBVparameterswhichwillbeusedbytherate *controllerforencoding.Itshouldbespecifiedinmodesusingabitrate *targetwhenthebufferingoftheoutputstreamneedstobeconstrained. * *Ifnotprovided,theencodermayusearbitraryamountsofbuffering.
*/ typedefstruct _VAEncMiscParameterHRD { /** The initial fullness of the HRD coded picture buffer, in bits. * *ThissetshowfulltheCPBiswhenencodingbegins-thatis,howmuch *bufferingwillhappenonthedecodersidebeforethefirstframe. *TheCPBfullnesswillberesettothisvalueafteranyratecontrol *reset(achangeinparametersoranexplicitreset). * *ForH.264,itshouldmatchthevalueofinitial_cpb_removal_delayin *buffering_periodSEImessages.
*/
uint32_t initial_buffer_fullness; /** The HRD coded picture buffer size, in bits. * *ForH.264,itshouldmatchthevalueofcpb_size_value_minus1intheVUI *parameters.
*/
uint32_t buffer_size;
/** \brief Reserved bytes for future use, must be zero */
uint32_t va_reserved[VA_PADDING_LOW];
} VAEncMiscParameterHRD;
/** *\briefDefinesamaximumframesize(inbits). * *Thismiscparameterbufferdefinesthemaximumsizeofaframe(in *bits).Theencoderwilltrytomakesurethateachframedoesnot *exceedthissize.Otherwise,iftheframesizeexceedsthissize, *the\cstatusflagof#VACodedBufferSegmentwillcontain *#VA_CODED_BUF_STATUS_FRAME_SIZE_OVERFLOW.
*/ typedefstruct _VAEncMiscParameterBufferMaxFrameSize { /** \brief Type. Shall be set to #VAEncMiscParameterTypeMaxFrameSize. */ /** duplicated with VAEncMiscParameterBuffer, should be deprecated*/
va_deprecated VAEncMiscParameterType type; /** \brief Maximum size of a frame (in bits). */
uint32_t max_frame_size;
/** \brief Reserved bytes for future use, must be zero */
uint32_t va_reserved[VA_PADDING_LOW];
} VAEncMiscParameterBufferMaxFrameSize;
/** *\briefMaximumframesize(inbytes)settingsformultiplepass. * *Thismiscparameterbufferdefinesthemaximumsizeofaframe(in *bytes)settingsformultiplepass.currentlyonlyAVCencodercan *supportthissettingsinmultiplepasscase.Iftheframesizeexceeds *thissize,theencoderwilldomorepakpassestoadjusttheQPvalue *tocontroltheframesize.
*/ typedefstruct _VAEncMiscParameterBufferMultiPassFrameSize { /** \brief Type. Shall be set to #VAEncMiscParameterTypeMultiPassMaxFrameSize. */ /** duplicated with VAEncMiscParameterBuffer, should be deprecated*/
va_deprecated VAEncMiscParameterType type; /** \brief Maximum size of a frame (in byte) */
uint32_t max_frame_size; /** \brief Reserved bytes for future use, must be zero */
uint32_t reserved; /** \brief number of passes, every pass has different QP, currently AVC encoder can support up to 4 passes */
uint8_t num_passes; /** \brief delta QP list for every pass */
uint8_t *delta_qp;
/** \brief Reserved bytes for future use, must be zero */ unsignedlong va_reserved[VA_PADDING_LOW];
} VAEncMiscParameterBufferMultiPassFrameSize;
/** *\briefEncodingqualitylevel. * *Theencodingqualitycouldbesetthroughthisstructure,iftheimplementation *supportsmultiplequalitylevels.Thequalitylevelsetthroughthisstructureis *persistentovertheentirecodedsequence,oruntilanewstructureisbeingsent. *ThequalitylevelrangecanbequeriedthroughtheVAConfigAttribEncQualityRange *attribute.Alowervaluemeanshigherquality,andavalueof1representsthehighest *quality.Thequalitylevelsettingisusedasatrade-offbetweenqualityandspeed/power *consumption,withhigherqualitycorrespondstolowerspeedandhigherpowerconsumption.
*/ typedefstruct _VAEncMiscParameterBufferQualityLevel { /** \brief Encoding quality level setting. When set to 0, default quality *levelisused.
*/
uint32_t quality_level;
/** \brief Reserved bytes for future use, must be zero */
uint32_t va_reserved[VA_PADDING_LOW];
} VAEncMiscParameterBufferQualityLevel;
/** *\briefQuantizationsettingsforencoding. * *Someencoderssupportspecialtypesofquantizationsuchastrellis,andthisstructure *canbeusedbytheapptocontrolthesespecialtypesofquantizationbytheencoder.
*/ typedefstruct _VAEncMiscParameterQuantization { union { /* if no flags is set then quantization is determined by the driver */ struct { /* \brief disable trellis for all frames/fields */
uint32_t disable_trellis : 1; /* \brief enable trellis for I frames/fields */
uint32_t enable_trellis_I : 1; /* \brief enable trellis for P frames/fields */
uint32_t enable_trellis_P : 1; /* \brief enable trellis for B frames/fields */
uint32_t enable_trellis_B : 1;
uint32_t reserved : 28;
} bits;
uint32_t value;
} quantization_flags;
uint32_t va_reserved;
} VAEncMiscParameterQuantization;
/** *\briefEncodingskipframe. * *Theapplicationmaychoosetoskipframesexternallytotheencoder(e.g.dropcompletelyor *codeasallskip's).Forratecontrolpurposestheencoderwillneedtoknowthesizeandnumber *ofskippedframes.Skipframe(s)indicatedthroughthisstructureisapplicableonlytothe *currentframe.Itisallowedfortheapplicationtostillsendinpackedheadersforthedriverto *pack,althoughnoframewillbeencoded(e.g.forHWtoencrypttheframe).
*/ typedefstruct _VAEncMiscParameterSkipFrame { /** \brief Indicates skip frames as below. *0:Encodeasnormal,noskip. *1:Oneormoreframeswereskippedpriortothecurrentframe,encodethecurrentframeasnormal. *2:Thecurrentframeistobeskipped,donotencodeitbutpack/encryptthepackedheadercontents *(allexceptVAEncPackedHeaderSlice)whichcouldcontainactualframecontents(e.g.packtheframe
* in VAEncPackedHeaderPicture). */
uint8_t skip_frame_flag; /** \brief The number of frames skipped prior to the current frame. Valid when skip_frame_flag = 1. */
uint8_t num_skip_frames; /** \brief When skip_frame_flag = 1, the size of the skipped frames in bits. When skip_frame_flag = 2,
* the size of the current skipped frame that is to be packed/encrypted in bits. */
uint32_t size_skip_frames;
/** \brief Reserved bytes for future use, must be zero */
uint32_t va_reserved[VA_PADDING_LOW];
} VAEncMiscParameterSkipFrame;
/** *\briefEncodingregion-of-interest(ROI). * *TheencodingROIcanbesetthroughVAEncMiscParameterBufferROI,iftheimplementation *supportsROIinput.TheROIsetthroughthisstructureisapplicableonlytothe *currentframeorfield,somustbesenteveryframeorfieldtobeapplied.Thenumberof *supportedROIscanbequeriedthroughtheVAConfigAttribEncROI.Theencoderwillusethe *ROIinformationtoadjusttheQPvaluesoftheMB'sthatfallwithintheROIs.
*/ typedefstruct _VAEncROI { /** \brief Defines the ROI boundary in pixels, the driver will map it to appropriate *codeccodingunits.Itisrelativetoframecoordinatesfortheframecaseand
* to field coordinates for the field case. */
VARectangle roi_rectangle; /** *\briefROIvalue * *\refroi_valuespecifiesROIdeltaQPorROIpriority. *--ROIdeltaQPisthevaluethatwillbeaddedontopoftheframelevelQP. *--ROIpriorityspecifiesthepriorityofaregion,itcanbepositive(moreimportant) *ornegative(lessimportant)valuesandiscomparedwithnon-ROIregion(takenasvalue0), *E.g.ROIregionwith\refroi_value-3islessimportantthanthenon-ROIregion(\refroi_value *impliedtobe0)whichislessimportantthanROIregionwithroi_value+2.Foroverlapping *regions,theroi_valuethatisfirstintheROIarraywillhavepriority. * *\refroi_valuealwaysspecifesROIdeltaQPwhenVAConfigAttribRateControl==VA_RC_CQP,nomatter *thevalueof\croi_value_is_qp_deltain#VAEncMiscParameterBufferROI. * *\refroi_valuedependson\croi_value_is_qp_deltain#VAEncMiscParameterBufferROIwhen *VAConfigAttribRateControl!=VA_RC_CQP.\refroi_valuespecifiesROI_deltaQPif\croi_value_is_qp_delta *inVAEncMiscParameterBufferROIis1,otherwise\refroi_valuespecifiesROIpriority.
*/
int8_t roi_value;
} VAEncROI;
typedefstruct _VAEncMiscParameterBufferROI { /** \brief Number of ROIs being sent.*/
uint32_t num_roi;
/** \brief Valid when VAConfigAttribRateControl != VA_RC_CQP, then the encoder's *ratecontrolwilldetermineactualdeltaQPs.Specifiesthemax/minalloweddelta
* QPs. */
int8_t max_delta_qp;
int8_t min_delta_qp;
/** \brief Pointer to a VAEncROI array with num_roi elements. It is relative to frame
* coordinates for the frame case and to field coordinates for the field case.*/
VAEncROI *roi; union { struct { /** *\briefAnindicationforroivalue. * *\refroi_value_is_qp_deltaequalto1indicates\croi_valuein#VAEncROIshould *beusedasROIdeltaQP.\refroi_value_is_qp_deltaequalto0indicates\croi_value *in#VAEncROIshouldbeusedasROIpriority. * *\refroi_value_is_qp_deltaisonlyavailablewhenVAConfigAttribRateControl!=VA_RC_CQP, *thesettingmustcomplywith\croi_rc_priority_supportand\croi_rc_qp_delta_supportin *#VAConfigAttribValEncROI.Theunderlyingdrivershouldignorethisfield *whenVAConfigAttribRateControl==VA_RC_CQP.
*/
uint32_t roi_value_is_qp_delta : 1;
uint32_t reserved : 31;
} bits;
uint32_t value;
} roi_flags;
/** \brief Reserved bytes for future use, must be zero */
uint32_t va_reserved[VA_PADDING_LOW];
} VAEncMiscParameterBufferROI; /* *\briefDirtyrectangledatastructureforencoding. * *TheencodingdirtyrectcanbesetthroughVAEncMiscParameterBufferDirtyRect,ifthe *implementationsupportsdirtyrectinput.Therectsetthroughthisstructureisapplicable *onlytothecurrentframeorfield,somustbesenteveryframeorfieldtobeapplied. *ThenumberofsupportedrectscanbequeriedthroughtheVAConfigAttribEncDirtyRect.The *encoderwillusetherectinformationtoknowthoserectangleareashavechangedwhilethe *areasnotcoveredbydirtyrectrectanglesareassumedtohavenotchangedcomparedtothe *previouspicture.Theencodermaydosomeinternaloptimizations.
*/ typedefstruct _VAEncMiscParameterBufferDirtyRect { /** \brief Number of Rectangle being sent.*/
uint32_t num_roi_rectangle;
/** \brief Pointer to a VARectangle array with num_roi_rectangle elements.*/
VARectangle *roi_rectangle;
} VAEncMiscParameterBufferDirtyRect;
/** \brief Attribute value for VAConfigAttribEncParallelRateControl */ typedefstruct _VAEncMiscParameterParallelRateControl { /** brief Number of layers*/
uint32_t num_layers; /** brief Number of B frames per layer per GOP. * *itshouldbeallocatedbyapplication,andtheisnum_layers.
* num_b_in_gop[0] is the number of regular B which refers to only I or P frames. */
uint32_t *num_b_in_gop;
} VAEncMiscParameterParallelRateControl;
/** per frame encoder quality controls, once set they will persist for all future frames
*till it is updated again. */ typedefstruct _VAEncMiscParameterEncQuality { union { struct { /** Use raw frames for reference instead of reconstructed frames. *itonlyimpactmotionestimation(ME)stage,andwillnotimpactMCstage
* so the reconstruct picture will can match with decode side */
uint32_t useRawPicForRef : 1; /** Disables skip check for ME stage, it will increase the bistream size
* but will improve the qulity */
uint32_t skipCheckDisable : 1; /** Indicates app will override default driver FTQ settings using FTQEnable.
* FTQ is forward transform quantization */
uint32_t FTQOverride : 1; /** Enables/disables FTQ. */
uint32_t FTQEnable : 1; /** Indicates the app will provide the Skip Threshold LUT to use when FTQ is
* enabled (FTQSkipThresholdLUT), else default driver thresholds will be used. */
uint32_t FTQSkipThresholdLUTInput : 1; /** Indicates the app will provide the Skip Threshold LUT to use when FTQ is
* disabled (NonFTQSkipThresholdLUT), else default driver thresholds will be used. */
uint32_t NonFTQSkipThresholdLUTInput : 1;
uint32_t ReservedBit : 1; /** Control to enable the ME mode decision algorithm to bias to fewer B Direct/Skip types.
* Applies only to B frames, all other frames will ignore this setting. */
uint32_t directBiasAdjustmentEnable : 1; /** Enables global motion bias. global motion also is called HME (Heirarchical Motion Estimation ) *HMEisusedtohandlelargemotionsandavoidinglocalminimainthevideoencodingprocess *downscaledtheinputandreferencepicture,thendoME.theresultwillbeapredictortonextlevelHMEorME *currentinterfacedividetheHMEto3level.UltraHME,SuperHME,andHME,resultofUltraHMEwillbeinputofSurperHME, *resultofsuperHMEwillbeainputforHME.HMEresultwillbeinputofME.itisaswitchforHMEMVCostScalingFactor
* can change the HME bias inside RDO stage*/
uint32_t globalMotionBiasAdjustmentEnable : 1; /** MV cost scaling ratio for HME ( predictors. It is used when *globalMotionBiasAdjustmentEnable==1,elseitisignored.Valuesare: *0:setMVcosttobe0forHMEpredictor. *1:scaleMVcosttobe1/2ofthedefaultvalueforHMEpredictor. *2:scaleMVcosttobe1/4ofthedefaultvalueforHMEpredictor.
* 3: scale MV cost to be 1/8 of the default value for HME predictor. */
uint32_t HMEMVCostScalingFactor : 2; /**disable HME, if it is disabled. Super*ultraHME should also be disabled */
uint32_t HMEDisable : 1; /**disable Super HME, if it is disabled, ultraHME should be disabled */
uint32_t SuperHMEDisable : 1; /** disable Ultra HME */
uint32_t UltraHMEDisable : 1; /** disable panic mode. Panic mode happened when there are extreme BRC (bit rate control) requirement *framesizecantachievethetargetofBRC.whenPanicmodeistriggered,Coefficientswill
* be set to zero. disable panic mode will improve quality but will impact BRC */
uint32_t PanicModeDisable : 1; /** Force RepartitionCheck *0:DEFAULT-followdriverdefaultsettings. *1:FORCE_ENABLE-enablethisfeaturetotallyforallcases.
* 2: FORCE_DISABLE - disable this feature totally for all cases. */
uint32_t ForceRepartitionCheck : 2;
};
uint32_t encControls;
};
/** Maps QP to skip thresholds when FTQ is enabled. Valid range is 0-255. */
uint8_t FTQSkipThresholdLUT[52]; /** Maps QP to skip thresholds when FTQ is disabled. Valid range is 0-65535. */
uint16_t NonFTQSkipThresholdLUT[52];
uint32_t reserved[VA_PADDING_HIGH]; // Reserved for future use.
} VAEncMiscParameterEncQuality;
/** *\briefCustomEncoderRoundingOffsetControl. *Applicationmayusethisstructuretosetcustomizedrounding *offsetparametersforquantization. *Validwhen\cVAConfigAttribCustomRoundingControlequals1.
*/ typedefstruct _VAEncMiscParameterCustomRoundingControl { union { struct { /** \brief Enable customized rounding offset for intra blocks. *If0,defaultvaluewouldbetakenbydriverforintra *roundingoffset.
*/
uint32_t enable_custom_rouding_intra : 1 ;
/** *Therewillbecaseswherethebitstreambufferwillnothaveenoughroomtohold *thedatafortheentireslice,andthefollowingflagswillbeusedintheslice *parametertosignaltotheserverforthepossiblecases. *Ifasliceparameterbufferandslicedatabufferpairissenttotheserverwith *theslicedatapartiallyintheslicedatabuffer(BEGINandMIDDLEcasesbelow), *thenasliceparameteranddatabufferneedstobesentagaintocompletethisslice.
*/ #define VA_SLICE_DATA_FLAG_ALL 0x00 /* whole slice is in the buffer */ #define VA_SLICE_DATA_FLAG_BEGIN 0x01 /* The beginning of the slice is in the buffer but the end if not */ #define VA_SLICE_DATA_FLAG_MIDDLE 0x02 /* Neither beginning nor end of the slice is in the buffer */ #define VA_SLICE_DATA_FLAG_END 0x04 /* end of the slice is in the buffer */
/* Codec-independent Slice Parameter Buffer base */ typedefstruct _VASliceParameterBufferBase {
uint32_t slice_data_size; /* number of bytes in the slice data buffer for this slice */
uint32_t slice_data_offset; /* the offset to the first byte of slice data */
uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX definitions */
} VASliceParameterBufferBase;
/********************************** *JPEGcommondatastructures
**********************************/ /** *\briefHuffmantableforJPEGdecoding. * *ThisstructureholdsthecompleteHuffmantables.Thisisan *aggregationofallHuffmantable(DHT)segmentsmaintainedbythe *application.i.e.upto2Huffmantablesarestoredintherefor *baselineprofile. * *The#load_huffman_tablearraycanbeusedasahinttonotifythe *VAdriverimplementationaboutwhichtable(s)actuallychanged *sincethelastsubmissionofthisbuffer.
*/ typedefstruct _VAHuffmanTableBufferJPEGBaseline { /** \brief Specifies which #huffman_table is valid. */
uint8_t load_huffman_table[2]; /** \brief Huffman tables indexed by table identifier (Th). */ struct { /** @name DC table (up to 12 categories) */ /**@{*/ /** \brief Number of Huffman codes of length i + 1 (Li). */
uint8_t num_dc_codes[16]; /** \brief Value associated with each Huffman code (Vij). */
uint8_t dc_values[12]; /**@}*/ /** @name AC table (2 special codes + up to 16 * 10 codes) */ /**@{*/ /** \brief Number of Huffman codes of length i + 1 (Li). */
uint8_t num_ac_codes[16]; /** \brief Value associated with each Huffman code (Vij). */
uint8_t ac_values[162]; /** \brief Padding to 4-byte boundaries. Must be set to zero. */
uint8_t pad[2]; /**@}*/
} huffman_table[2];
/** \brief Reserved bytes for future use, must be zero */
uint32_t va_reserved[VA_PADDING_LOW];
} VAHuffmanTableBufferJPEGBaseline;
/* MPEG-2 Picture Parameter Buffer */ /* *Foreachframeorfield,andbeforeanyslicedata,asingle *pictureparameterbuffermustbesend.
*/ typedefstruct _VAPictureParameterBufferMPEG2 {
uint16_t horizontal_size;
uint16_t vertical_size;
VASurfaceID forward_reference_picture;
VASurfaceID backward_reference_picture; /* meanings of the following fields are the same as in the standard */
int32_t picture_coding_type;
int32_t f_code; /* pack all four fcode into this */ union { struct {
uint32_t intra_dc_precision : 2;
uint32_t picture_structure : 2;
uint32_t top_field_first : 1;
uint32_t frame_pred_frame_dct : 1;
uint32_t concealment_motion_vectors : 1;
uint32_t q_scale_type : 1;
uint32_t intra_vlc_format : 1;
uint32_t alternate_scan : 1;
uint32_t repeat_first_field : 1;
uint32_t progressive_frame : 1;
uint32_t is_first_field : 1; /* indicate whether the current field *isthefirstfieldforfieldpicture
*/
} bits;
uint32_t value;
} picture_coding_extension;
/** \brief Reserved bytes for future use, must be zero */
uint32_t va_reserved[VA_PADDING_LOW];
} VAPictureParameterBufferMPEG2;
/** MPEG-2 Inverse Quantization Matrix Buffer */ typedefstruct _VAIQMatrixBufferMPEG2 { /** \brief Same as the MPEG-2 bitstream syntax element. */
int32_t load_intra_quantiser_matrix; /** \brief Same as the MPEG-2 bitstream syntax element. */
int32_t load_non_intra_quantiser_matrix; /** \brief Same as the MPEG-2 bitstream syntax element. */
int32_t load_chroma_intra_quantiser_matrix; /** \brief Same as the MPEG-2 bitstream syntax element. */
int32_t load_chroma_non_intra_quantiser_matrix; /** \brief Luminance intra matrix, in zig-zag scan order. */
uint8_t intra_quantiser_matrix[64]; /** \brief Luminance non-intra matrix, in zig-zag scan order. */
uint8_t non_intra_quantiser_matrix[64]; /** \brief Chroma intra matrix, in zig-zag scan order. */
uint8_t chroma_intra_quantiser_matrix[64]; /** \brief Chroma non-intra matrix, in zig-zag scan order. */
uint8_t chroma_non_intra_quantiser_matrix[64];
/** \brief Reserved bytes for future use, must be zero */
uint32_t va_reserved[VA_PADDING_LOW];
} VAIQMatrixBufferMPEG2;
/** MPEG-2 Slice Parameter Buffer */ typedefstruct _VASliceParameterBufferMPEG2 {
uint32_t slice_data_size;/* number of bytes in the slice data buffer for this slice */
uint32_t slice_data_offset;/* the offset to the first byte of slice data */
uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
uint32_t macroblock_offset;/* the offset to the first bit of MB from the first byte of slice data */
uint32_t slice_horizontal_position;
uint32_t slice_vertical_position;
int32_t quantiser_scale_code;
int32_t intra_slice_flag;
/** \brief Reserved bytes for future use, must be zero */
uint32_t va_reserved[VA_PADDING_LOW];
} VASliceParameterBufferMPEG2;
/** \brief Reserved bytes for future use, must be zero */
uint32_t va_reserved[VA_PADDING_LOW];
} VAPictureParameterBufferMPEG4;
/** MPEG-4 Inverse Quantization Matrix Buffer */ typedefstruct _VAIQMatrixBufferMPEG4 { /** Same as the MPEG-4:2 bitstream syntax element. */
int32_t load_intra_quant_mat; /** Same as the MPEG-4:2 bitstream syntax element. */
int32_t load_non_intra_quant_mat; /** The matrix for intra blocks, in zig-zag scan order. */
uint8_t intra_quant_mat[64]; /** The matrix for non-intra blocks, in zig-zag scan order. */
uint8_t non_intra_quant_mat[64];
/** \brief Reserved bytes for future use, must be zero */
uint32_t va_reserved[VA_PADDING_LOW];
} VAIQMatrixBufferMPEG4;
/** MPEG-4 Slice Parameter Buffer */ typedefstruct _VASliceParameterBufferMPEG4 {
uint32_t slice_data_size;/* number of bytes in the slice data buffer for this slice */
uint32_t slice_data_offset;/* the offset to the first byte of slice data */
uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
uint32_t macroblock_offset;/* the offset to the first bit of MB from the first byte of slice data */
uint32_t macroblock_number;
int32_t quant_scale;
/** \brief Reserved bytes for future use, must be zero */
uint32_t va_reserved[VA_PADDING_LOW];
} VASliceParameterBufferMPEG4;
/* VC-1 Slice Parameter Buffer */ typedefstruct _VASliceParameterBufferVC1 {
uint32_t slice_data_size;/* number of bytes in the slice data buffer for this slice */
uint32_t slice_data_offset;/* the offset to the first byte of slice data */
uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
uint32_t macroblock_offset;/* the offset to the first bit of MB from the first byte of slice data */
uint32_t slice_vertical_position;
/** \brief Reserved bytes for future use, must be zero */
uint32_t va_reserved[VA_PADDING_LOW];
} VASliceParameterBufferVC1;
/* VC-1 Slice Data Buffer */ /* Thisissimplelyabuffercontainingrawbit-streambytes
*/
/** \brief Reserved bytes for future use, must be zero */
uint32_t va_reserved[VA_PADDING_LOW];
} VAPictureH264; /* flags in VAPictureH264 could be OR of the following */ #define VA_PICTURE_H264_INVALID 0x00000001 #define VA_PICTURE_H264_TOP_FIELD 0x00000002 #define VA_PICTURE_H264_BOTTOM_FIELD 0x00000004 #define VA_PICTURE_H264_SHORT_TERM_REFERENCE 0x00000008 #define VA_PICTURE_H264_LONG_TERM_REFERENCE 0x00000010
/** *\briefCodedbuffersegment. * *#VACodedBufferSegmentisanelementofalinkedlistdescribing *someinformationonthecodedbuffer.Thecodedbuffersegment *couldcontaineitherasingleNALunit,ormorethanoneNALunit. *Itisrecommended(butnotrequired)toreturnasingleNALunit *inacodedbuffersegment,andtheimplementationshouldsetthe *VA_CODED_BUF_STATUS_SINGLE_NALUstatusflagifthatisthecase.
*/ typedefstruct _VACodedBufferSegment { /** *\briefSizeofthedatabufferinthissegment(inbytes).
*/
uint32_t size; /** \brief Bit offset into the data buffer where the video data starts. */
uint32_t bit_offset; /** \brief Status set by the driver. See \c VA_CODED_BUF_STATUS_*. */
uint32_t status; /** \brief Reserved for future use. */
uint32_t reserved; /** \brief Pointer to the start of the data buffer. */ void *buf; /** *\briefPointertothenext#VACodedBufferSegmentelement, *or\cNULLifthereisnone.
*/ void *next;
/** \brief Reserved bytes for future use, must be zero */
uint32_t va_reserved[VA_PADDING_LOW];
} VACodedBufferSegment;
/** @name vaExportSurfaceHandle() flags * *@{
*/ /** Export surface to be read by external API. */ #define VA_EXPORT_SURFACE_READ_ONLY 0x0001 /** Export surface to be written by external API. */ #define VA_EXPORT_SURFACE_WRITE_ONLY 0x0002 /** Export surface to be both read and written by external API. */ #define VA_EXPORT_SURFACE_READ_WRITE 0x0003 /** Export surface with separate layers. * *Forexample,NV12surfacesshouldbeexportedastwoseparate *planesforlumaandchroma.
*/ #define VA_EXPORT_SURFACE_SEPARATE_LAYERS 0x0004 /** Export surface with composed layers. * *Forexample,NV12surfacesshouldbeexportedasasingleNV12 *composedobject.
*/ #define VA_EXPORT_SURFACE_COMPOSED_LAYERS 0x0008
typedefenum {
VASurfaceRendering = 1, /* Rendering in progress */
VASurfaceDisplaying = 2, /* Displaying in progress (not safe to render into it) */ /* this status is useful if surface is used as the source */ /* of an overlay */
VASurfaceReady = 4, /* not being rendered or displayed */
VASurfaceSkipped = 8/* Indicate a skipped frame during encode */
} VASurfaceStatus;
/** *ClientcallsvaQuerySurfaceErrorwithVA_STATUS_ERROR_DECODING_ERROR,serversidereturns *anarrayofstructureVASurfaceDecodeMBErrors,andthearrayisterminatedbysettingstatus=-1
*/ typedefstruct _VASurfaceDecodeMBErrors {
int32_t status; /* 1 if hardware has returned detailed info below, -1 means this record is invalid */
uint32_t start_mb; /* start mb address with errors */
uint32_t end_mb; /* end mb address with errors */
VADecodeErrorType decode_error_type;
uint32_t num_mb; /* number of mbs with errors */ /** \brief Reserved bytes for future use, must be zero */
uint32_t va_reserved[VA_PADDING_LOW - 1];
} VASurfaceDecodeMBErrors;
/** \brief Reserved bytes for future use, must be zero */
uint32_t va_reserved[VA_PADDING_LOW];
} VAImageFormat;
typedef VAGenericID VAImageID;
typedefstruct _VAImage {
VAImageID image_id; /* uniquely identify this image */
VAImageFormat format;
VABufferID buf; /* image data buffer */ /* *ImagedatawillbestoredinabufferoftypeVAImageBufferTypetofacilitate *datastoreontheserversideforoptimalperformance.Thebufferwillbe *createdbytheCreateImagefunction,andproperstorageallocatedbasedontheimage *sizeandformat.Thisbufferismanagedbythelibraryimplementation,and *accessedbytheclientthroughthebufferMap/Unmapfunctions.
*/
uint16_t width;
uint16_t height;
uint32_t data_size;
uint32_t num_planes; /* can not be greater than 3 */ /* *Anarrayindicatingthescanlinepitchinbytesforeachplane. *Eachplanemayhaveadifferentpitch.Maximum3planesforplanarformats
*/
uint32_t pitches[3]; /* *Anarrayindicatingthebyteoffsetfromthebeginningoftheimagedata *tothestartofeachplane.
*/
uint32_t offsets[3];
/* The following fields are only needed for paletted formats */
int32_t num_palette_entries; /* set to zero for non-palette images */ /* *Eachcomponentisonebyteandentry_bytesindicatesthenumberofcomponentsin *eachentry(eg.3forYUVpaletteentries).settozerofornon-paletteimages
*/
int32_t entry_bytes; /* *Anarrayofasciicharactersdescribingtheorderofthecomponentswithinthebytes. *Onlyentry_bytescharactersofthestringareused.
*/
int8_t component_order[4];
/** \brief Reserved bytes for future use, must be zero */
uint32_t va_reserved[VA_PADDING_LOW];
} VAImage;
/** Get maximum number of image formats supported by the implementation */ int vaMaxNumImageFormats(
VADisplay dpy
);
/** *Querysupportedimageformats *Thecallermustprovidea"format_list"arraythatcanholdat *leastvaMaxNumImageFormats()entries.Theactualnumberofformats *returnedin"format_list"isreturnedin"num_formats".
*/
VAStatus vaQueryImageFormats(
VADisplay dpy,
VAImageFormat *format_list, /* out */ int *num_formats /* out */
);
/** *CreateaVAImagestructure *ThewidthandheightfieldsreturnedintheVAImagestructuremayget *enlargedforsomeYUVformats.Uponreturnfromthisfunction, *image->bufhasbeencreatedandproperstorageallocatedbythelibrary. *TheclientcanaccesstheimagethroughtheMap/Unmapcalls.
*/
VAStatus vaCreateImage(
VADisplay dpy,
VAImageFormat *format, int width, int height,
VAImage *image /* out */
);
/** *RetrivesurfacedataintoaVAImage *Imagemustbeinaformatsupportedbytheimplementation
*/
VAStatus vaGetImage(
VADisplay dpy,
VASurfaceID surface, int x, /* coordinates of the upper left source pixel */ int y, unsignedint width, /* width and height of the region */ unsignedint height,
VAImageID image
);
/** *CopydatafromaVAImagetoasurface *Imagemustbeinaformatsupportedbytheimplementation *ReturnsaVA_STATUS_ERROR_SURFACE_BUSYifthesurface *shouldn'tberenderedintowhenthisiscalled
*/
VAStatus vaPutImage(
VADisplay dpy,
VASurfaceID surface,
VAImageID image, int src_x, int src_y, unsignedint src_width, unsignedint src_height, int dest_x, int dest_y, unsignedint dest_width, unsignedint dest_height
);
typedefstruct _VADisplayAttribute {
VADisplayAttribType type;
int32_t min_value;
int32_t max_value;
int32_t value; /* used by the set/get attribute functions */ /* flags can be VA_DISPLAY_ATTRIB_GETTABLE or VA_DISPLAY_ATTRIB_SETTABLE or OR'd together */
uint32_t flags;
/** \brief Reserved bytes for future use, must be zero */
uint32_t va_reserved[VA_PADDING_LOW];
} VADisplayAttribute;
/** Get maximum number of display attributs supported by the implementation */ int vaMaxNumDisplayAttributes(
VADisplay dpy
);
/** *Querydisplayattributes *Thecallermustprovidea"attr_list"arraythatcanholdat *leastvaMaxNumDisplayAttributes()entries.Theactualnumberofattributes *returnedin"attr_list"isreturnedin"num_attributes".
*/
VAStatus vaQueryDisplayAttributes(
VADisplay dpy,
VADisplayAttribute *attr_list, /* out */ int *num_attributes /* out */
);
typedefunion _VACopyOption { struct { /** \brief va copy synchronization, the value should be /c VA_EXEC_SYNC or /c VA_EXEC_ASYNC */
uint32_t va_copy_sync : 2; /** \brief va copy mode, the value should be VA_EXEC_MODE_XXX */
uint32_t va_copy_mode : 4;
uint32_t reserved : 26;
} bits;
uint32_t value;
} VACopyOption;
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.419Bemerkung:
(vorverarbeitet am 2026-08-25)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.