/** *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 */
typedef struct _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 */
typedef struct _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 Picture Parameter Buffer */
/*
* For each picture, and before any slice data, a picture parameter
* buffer must be send. Multiple picture parameter buffers may be
* sent for a single picture. In that case picture parameters will
* apply to all slice data that follow it until a new picture
* parameter buffer is sent.
*
* Notes:
* pic_quantizer_type should be set to the applicable quantizer
* type as defined by QUANTIZER (J.1.19) and either
* PQUANTIZER (7.1.1.8) or PQINDEX (7.1.1.6)
*/
typedef struct _VAPictureParameterBufferVC1 {
VASurfaceID forward_reference_picture;
VASurfaceID backward_reference_picture;
/* if out-of-loop post-processing is done on the render
target, then we need to keep the in-loop decoded
picture as a reference picture */
VASurfaceID inloop_decoded_picture;
/* sequence layer for AP or meta data for SP and MP */
union {
struct {
uint32_t pulldown : 1; /* SEQUENCE_LAYER::PULLDOWN */
uint32_t interlace : 1; /* SEQUENCE_LAYER::INTERLACE */
uint32_t tfcntrflag : 1; /* SEQUENCE_LAYER::TFCNTRFLAG */
uint32_t finterpflag : 1; /* SEQUENCE_LAYER::FINTERPFLAG */
uint32_t psf : 1; /* SEQUENCE_LAYER::PSF */
uint32_t multires : 1; /* METADATA::MULTIRES */
uint32_t overlap : 1; /* METADATA::OVERLAP */
uint32_t syncmarker : 1; /* METADATA::SYNCMARKER */
uint32_t rangered : 1; /* METADATA::RANGERED */
uint32_t max_b_frames : 3; /* METADATA::MAXBFRAMES */
uint32_t profile : 2; /* SEQUENCE_LAYER::PROFILE or The MSB of METADATA::PROFILE */
} bits;
uint32_t value;
} sequence_fields;
uint8_t luma_scale2; /* PICTURE_LAYER::LUMSCALE2 */
uint8_t luma_shift2; /* PICTURE_LAYER::LUMSHIFT2 */
uint8_t intensity_compensation_field; /* Index for PICTURE_LAYER::INTCOMPFIELD value inTable 109 (9.1.1.48) */
/** \brief Reserved bytes for future use, must be zero */
uint32_t va_reserved[VA_PADDING_MEDIUM - 1];
} VAPictureParameterBufferVC1;
/** VC-1 Bitplane Buffer
There will be at most three bitplanes coded in any picture header. To send
the bitplane data more efficiently, each byte is divided in two nibbles, with
each nibble carrying three bitplanes for one macroblock. The following table
shows the bitplane data arrangement within each nibble based on the picture
type.
Picture Type Bit3 Bit2 Bit1 Bit0
I or BI OVERFLAGS ACPRED FIELDTX
P MYTYPEMB SKIPMB DIRECTMB
B FORWARDMB SKIPMB DIRECTMB
Within each byte, the lower nibble isfor the first MB and the upper nibble is for the second MB. E.g. the lower nibble of the first byte in the bitplane
buffer isfor Macroblock #1 and the upper nibble of the first byte is for
Macroblock #2 in the first row.
*/
/* VC-1 Slice Parameter Buffer */
typedef struct _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 */
/*
This is simplely a buffer containing raw bit-stream bytes
*/
/****************************
* H.264/AVC data structures
****************************/
/** \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
/** \brief Reserved bytes for future use, must be zero */
uint32_t va_reserved[VA_PADDING_LOW];
} VAIQMatrixBufferH264;
/** H.264 Slice Parameter Buffer */
typedef struct _VASliceParameterBufferH264 {
uint32_t slice_data_size;/* number of bytes in the slice data buffer for this slice */
/** \brief Byte offset to the NAL Header Unit for this slice. */
uint32_t slice_data_offset;
uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
/**
* \brief Bit offset from NAL Header Unit to the begining of slice_data().
*
* This bit offset is relative to and includes the NAL unit byte
* and represents the number of bits parsed in the slice_header()
* after the removal of any emulation prevention bytes in
* there. However, the slice data buffer passed to the hardware is
* the original bitstream, thus including any emulation prevention
* bytes.
*/
uint16_t slice_data_bit_offset;
uint16_t first_mb_in_slice;
uint8_t slice_type;
uint8_t direct_spatial_mv_pred_flag;
/**
* H264/AVC syntax element
*
* if num_ref_idx_active_override_flag equals 0, host decoder should
* set its value to num_ref_idx_l0_default_active_minus1.
*/
uint8_t num_ref_idx_l0_active_minus1;
/**
* H264/AVC syntax element
*
* if num_ref_idx_active_override_flag equals 0, host decoder should
* set its value to num_ref_idx_l1_default_active_minus1.
*/
uint8_t num_ref_idx_l1_active_minus1;
uint8_t cabac_init_idc;
int8_t slice_qp_delta;
uint8_t disable_deblocking_filter_idc;
int8_t slice_alpha_c0_offset_div2;
int8_t slice_beta_offset_div2;
VAPictureH264 RefPicList0[32]; /* See 8.2.4.2 */
VAPictureH264 RefPicList1[32]; /* See 8.2.4.2 */
uint8_t luma_log2_weight_denom;
uint8_t chroma_log2_weight_denom;
uint8_t luma_weight_l0_flag;
int16_t luma_weight_l0[32];
int16_t luma_offset_l0[32];
uint8_t chroma_weight_l0_flag;
int16_t chroma_weight_l0[32][2];
int16_t chroma_offset_l0[32][2];
uint8_t luma_weight_l1_flag;
int16_t luma_weight_l1[32];
int16_t luma_offset_l1[32];
uint8_t chroma_weight_l1_flag;
int16_t chroma_weight_l1[32][2];
int16_t chroma_offset_l1[32][2];
/** \brief Reserved bytes for future use, must be zero */
uint32_t va_reserved[VA_PADDING_LOW];
} VASliceParameterBufferH264;
/** \brief Reserved bytes for future use, must be zero */
uint32_t va_reserved[VA_PADDING_LOW];
} VAEncPictureParameterBufferMPEG4;
/** Buffer functions */
/**
* Creates a buffer for"num_elements" elements of "size" bytes and
* initalize with"data".
* if"data"is null, then the contents of the buffer data store
* are undefined.
* Basically there are two ways to get buffer data to the server side. One is
* to call vaCreateBuffer() with a non-null "data", which results the data being
* copied to the data store on the server side. A different method that
* eliminates this copy is to pass null as"data" when calling vaCreateBuffer(),
* and then use vaMapBuffer() to map the data store from the server side to the
* client address space for access.
* The user must call vaDestroyBuffer() to destroy a buffer.
* Note: image buffers are created by the library, not the client. Please see
* vaCreateImage on how image buffers are managed.
*/
VAStatus vaCreateBuffer(
VADisplay dpy,
VAContextID context,
VABufferType type, /* in */
unsigned int size, /* in */
unsigned int num_elements, /* in */
void *data, /* in */
VABufferID *buf_id /* out */
);
/**
* Create a buffer for given width & height get unit_size, pitch, buf_id for2D buffer
* for permb qp buffer, it will return unit_size for one MB or LCU and the pitch for alignments
* can call vaMapBuffer with this Buffer ID to get virtual address.
* e.g. AVC 1080P encode, 1920x1088, the size in MB is120x68,but inside driver,
* maybe it should align with256, and one byte present one Qp.so, call the function.
* then get unit_size = 1, pitch = 256. call vaMapBuffer to get the virtual address (pBuf).
* then read write the memory like 2D. the size is256x68, application can only use 120x68
* pBuf + 256is the start of next line.
* different driver implementation maybe return different unit_size and pitch
*/
VAStatus vaCreateBuffer2(
VADisplay dpy,
VAContextID context,
VABufferType type,
unsigned int width,
unsigned int height,
unsigned int *unit_size,
unsigned int *pitch,
VABufferID *buf_id
);
/**
* Convey to the server how many valid elements are in the buffer.
* e.g. if multiple slice parameters are being held in a single buffer,
* this will communicate to the server the number of slice parameters
* that are valid in the buffer.
*/
VAStatus vaBufferSetNumElements(
VADisplay dpy,
VABufferID buf_id, /* in */
unsigned int num_elements /* in */
);
/**
* device independent data structure for codedbuffer
*/
/*
* FICTURE_AVE_QP(bit7-0): The average Qp value used during this frame
* LARGE_SLICE(bit8):At least one slice in the current frame was large
* enough for the encoder to attempt to limit its size.
* SLICE_OVERFLOW(bit9): At least one slice in the current frame has
* exceeded the maximum slice size specified.
* BITRATE_OVERFLOW(bit10): The peak bitrate was exceeded for this frame.
* BITRATE_HIGH(bit11): The frame size got within the safety margin of the maximum size (VCM only)
* AIR_MB_OVER_THRESHOLD: the number of MBs adapted to Intra MB
*/ #define VA_CODED_BUF_STATUS_PICTURE_AVE_QP_MASK 0xff #define VA_CODED_BUF_STATUS_LARGE_SLICE_MASK 0x100 #define VA_CODED_BUF_STATUS_SLICE_OVERFLOW_MASK 0x200 #define VA_CODED_BUF_STATUS_BITRATE_OVERFLOW 0x400 #define VA_CODED_BUF_STATUS_BITRATE_HIGH 0x800
/**
* \brief The frame has exceeded the maximum requested size.
*
* This flag indicates that the encoded frame size exceeds the value
* specified through a misc parameter buffer of type
* #VAEncMiscParameterTypeMaxFrameSize.
*/ #define VA_CODED_BUF_STATUS_FRAME_SIZE_OVERFLOW 0x1000
/**
* \brief the bitstream is bad or corrupt.
*/ #define VA_CODED_BUF_STATUS_BAD_BITSTREAM 0x8000 #define VA_CODED_BUF_STATUS_AIR_MB_OVER_THRESHOLD 0xff0000
/**
* \brief The coded buffer segment status contains frame encoding passes number
*
* This is the mask to get the number of encoding passes from the coded
* buffer segment status.
* NUMBER_PASS(bit24~bit27): the number for encoding passes executed for the coded frame.
*
*/ #define VA_CODED_BUF_STATUS_NUMBER_PASSES_MASK 0xf000000
/**
* \brief The coded buffer segment contains a single NAL unit.
*
* This flag indicates that the coded buffer segment contains a
* single NAL unit. This flag might be useful to the user for
* processing the coded buffer.
*/ #define VA_CODED_BUF_STATUS_SINGLE_NALU 0x10000000
/**
* \brief Coded buffer segment.
*
* #VACodedBufferSegment is an element of a linked list describing
* some information on the coded buffer. The coded buffer segment
* could contain either a single NAL unit, or more than one NAL unit.
* It is recommended (but not required) to return a single NAL unit
* in a coded buffer segment, and the implementation should set the
* VA_CODED_BUF_STATUS_SINGLE_NALU status flag if that is the case.
*/
typedef struct _VACodedBufferSegment {
/**
* \brief Size of the data buffer in this segment (in bytes).
*/
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;
/**
* \brief Pointer to the next #VACodedBufferSegment element,
* or \c NULL if there isnone.
*/
void *next;
/** \brief Reserved bytes for future use, must be zero */
uint32_t va_reserved[VA_PADDING_LOW];
} VACodedBufferSegment;
/**
* Map data store of the buffer into the client's address space
* vaCreateBuffer() needs to be called with"data" set to NULL before
* calling vaMapBuffer()
*
* if buffer type is VAEncCodedBufferType, pbuf points to link-list of
* VACodedBufferSegment, and the list is terminated if"next"is NULL
*/
VAStatus vaMapBuffer(
VADisplay dpy,
VABufferID buf_id, /* in */
void **pbuf /* out */
);
/**
* After client making changes to a mapped data store, it needs to
* "Unmap" it to let the server know that the data is ready to be
* consumed by the server
*/
VAStatus vaUnmapBuffer(
VADisplay dpy,
VABufferID buf_id /* in */
);
/**
* After this call, the buffer is deleted and this buffer_id is no longer valid
*
* A buffer can be re-used and sent to the server by another Begin/Render/End
* sequence if vaDestroyBuffer() isnot called with this buffer.
*
* Note re-using a shared buffer (e.g. a slice data buffer) between the host and the
* hardware accelerator can result in performance dropping.
*/
VAStatus vaDestroyBuffer(
VADisplay dpy,
VABufferID buffer_id
);
/** \brief VA buffer information */
typedef struct {
/** \brief Buffer handle */
uintptr_t handle;
/** \brief Buffer type (See \ref VABufferType). */
uint32_t type;
/**
* \brief Buffer memory type (See \ref VASurfaceAttribMemoryType).
*
* On input to vaAcquireBufferHandle(), this field can serve as a hint
* to specify the set of memory types the caller is interested in.
* On successful returnfrom vaAcquireBufferHandle(), the field is
* updated with the best matching memory type.
*/
uint32_t mem_type;
/** \brief Size of the underlying buffer. */
size_t mem_size;
/** \brief Reserved bytes for future use, must be zero */
uint32_t va_reserved[VA_PADDING_LOW];
} VABufferInfo;
/**
* \brief Acquires buffer handle for external API usage
*
* Locks the VA buffer object \ref buf_id for external API usage like
* EGL or OpenCL (OCL). This function is a synchronization point. This
* means that any pending operation is guaranteed to be completed
* prior to returning from the function.
*
* If the referenced VA buffer object is the backing store of a VA
* surface, then this function acts asif vaSyncSurface() on the
* parent surface was called first.
*
* The \ref VABufferInfo argument shall be zero'ed on input. On
* successful output, the data structure is filled inwith all the
* necessary buffer level implementation details like handle, type,
* memory type and memory size.
*
* Note: the external API implementation, or the application, can
* express the memory types it is interested in by filling in the \ref
* mem_type field accordingly. On successful output, the memory type
* that fits best the request and that was used is updated in the \ref
* VABufferInfo data structure. Ifnone of the supplied memory types
* is supported, then a \ref VA_STATUS_ERROR_UNSUPPORTED_MEMORY_TYPE
* error is returned.
*
* The \ref VABufferInfo data is valid until vaReleaseBufferHandle()
* is called. Besides, no additional operation is allowed on any of
* the buffer parent object until vaReleaseBufferHandle() is called.
* e.g. decoding into a VA surface backed with the supplied VA buffer
* object \ref buf_id would fail with a \ref VA_STATUS_ERROR_SURFACE_BUSY
* error.
*
* Possible errors:
* - \ref VA_STATUS_ERROR_UNIMPLEMENTED: the VA driver implementation
* does not support this interface
* - \ref VA_STATUS_ERROR_INVALID_DISPLAY: an invalid display was supplied
* - \ref VA_STATUS_ERROR_INVALID_BUFFER: an invalid buffer was supplied
* - \ref VA_STATUS_ERROR_UNSUPPORTED_BUFFERTYPE: the implementation
* does not support exporting buffers of the specified type
* - \ref VA_STATUS_ERROR_UNSUPPORTED_MEMORY_TYPE: none of the requested
* memory types in \ref VABufferInfo.mem_type was supported
*
* @param[in] dpy the VA display
* @param[in] buf_id the VA buffer
* @param[in,out] buf_info the associated VA buffer information
* @return VA_STATUS_SUCCESS if successful
*/
VAStatus
vaAcquireBufferHandle(VADisplay dpy, VABufferID buf_id, VABufferInfo *buf_info);
/**
* \brief Releases buffer after usage from external API
*
* Unlocks the VA buffer object \ref buf_id from external API usage like
* EGL or OpenCL (OCL). This function is a synchronization point. This
* means that any pending operation is guaranteed to be completed
* prior to returning from the function.
*
* The \ref VABufferInfo argument shall point to the original data
* structure that was obtained from vaAcquireBufferHandle(), unaltered.
* This is necessary so that the VA driver implementation could
* deallocate any resources that were needed.
*
* In any case, returning from this function invalidates any contents
* in \ref VABufferInfo. i.e. the underlyng buffer handle is no longer
* valid. Therefore, VA driver implementations are free to reset this
* data structure to safe defaults.
*
* Possible errors:
* - \ref VA_STATUS_ERROR_UNIMPLEMENTED: the VA driver implementation
* does not support this interface
* - \ref VA_STATUS_ERROR_INVALID_DISPLAY: an invalid display was supplied
* - \ref VA_STATUS_ERROR_INVALID_BUFFER: an invalid buffer was supplied
* - \ref VA_STATUS_ERROR_UNSUPPORTED_BUFFERTYPE: the implementation
* does not support exporting buffers of the specified type
*
* @param[in] dpy the VA display
* @param[in] buf_id the VA buffer
* @return VA_STATUS_SUCCESS if successful
*/
VAStatus
vaReleaseBufferHandle(VADisplay dpy, VABufferID buf_id);
/** @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.
*
* For example, NV12 surfaces should be exported as two separate
* planes for luma and chroma.
*/ #define VA_EXPORT_SURFACE_SEPARATE_LAYERS 0x0004
/** Export surface with composed layers.
*
* For example, NV12 surfaces should be exported as a single NV12
* composed object.
*/ #define VA_EXPORT_SURFACE_COMPOSED_LAYERS 0x0008
/** @} */
/**
* \brief Export a handle to a surface for use with an external API
*
* The exported handles are owned by the caller, and the caller is
* responsible for freeing them when no longer needed (e.g. by closing
* DRM PRIME file descriptors).
*
* This does not perform any synchronisation. If the contents of the
* surface will be read, vaSyncSurface() must be called before doing so.
* If the contents of the surface are written, then all operations must
* be completed externally before using the surface again by via VA-API
* functions.
*
* @param[in] dpy VA display.
* @param[in] surface_id Surface to export.
* @param[in] mem_type Memory type to export to.
* @param[in] flags Combination of flags to apply
* (VA_EXPORT_SURFACE_*).
* @param[out] descriptor Pointer to the descriptor structure to fill
* with the handle details. The type of this structure depends on
* the value of mem_type.
*
* @return Status code:
* - VA_STATUS_SUCCESS: Success.
* - VA_STATUS_ERROR_INVALID_DISPLAY: The display isnot valid.
* - VA_STATUS_ERROR_UNIMPLEMENTED: The driver does not implement
* this interface.
* - VA_STATUS_ERROR_INVALID_SURFACE: The surface isnot valid, or
* the surface isnot exportable in the specified way.
* - VA_STATUS_ERROR_UNSUPPORTED_MEMORY_TYPE: The driver does not
* support exporting surfaces to the specified memory type.
*/
VAStatus vaExportSurfaceHandle(VADisplay dpy,
VASurfaceID surface_id,
uint32_t mem_type, uint32_t flags,
void *descriptor);
/**
* Render (Video Decode/Encode/Processing) Pictures
*
* A picture represents either a frame or a field.
*
* The Begin/Render/End sequence sends the video decode/encode/processing buffers
* to the server
*/
/**
* Get ready for a video pipeline
* - decode a picture to a target surface
* - encode a picture from a target surface
* - process a picture to a target surface
*/
VAStatus vaBeginPicture(
VADisplay dpy,
VAContextID context,
VASurfaceID render_target
);
/**
* Send video decode, encode or processing buffers to the server.
*/
VAStatus vaRenderPicture(
VADisplay dpy,
VAContextID context,
VABufferID *buffers,
int num_buffers
);
/**
* Make the end of rendering for a picture.
* The server should start processing all pending operations for this
* surface. This call is non-blocking. The client can start another
* Begin/Render/End sequence on a different render target.
* if VAContextID used in this function previously successfully passed
* vaMFAddContext call, real processing will be started during vaMFSubmit
*/
VAStatus vaEndPicture(
VADisplay dpy,
VAContextID context
);
/**
* Make the end of rendering for a pictures in contexts passed with submission.
* The server should start processing all pending operations for contexts.
* All contexts passed should be associated through vaMFAddContext
* and call sequence Begin/Render/End performed.
* This call is non-blocking. The client can start another
* Begin/Render/End/vaMFSubmit sequence on a different render targets.
* Return values:
* VA_STATUS_SUCCESS - operation successful, context was removed.
* VA_STATUS_ERROR_INVALID_CONTEXT - mf_context or one of contexts are invalid
* due to mf_context not created or one of contexts not assotiated with mf_context
* through vaAddContext.
* VA_STATUS_ERROR_INVALID_PARAMETER - one of context has not submitted it's frame
* through vaBeginPicture vaRenderPicture vaEndPicture call sequence.
* dpy: display
* mf_context: Multi-Frame context
* contexts: list of contexts submitting their tasks for multi-frame operation.
* num_contexts: number of passed contexts.
*/
VAStatus vaMFSubmit(
VADisplay dpy,
VAMFContextID mf_context,
VAContextID * contexts,
int num_contexts
);
/*
Synchronization
*/
/**
* This function blocks until all pending operations on the render target
* have been completed. Upon return it is safe to use the render target for a
* different picture.
*/
VAStatus vaSyncSurface(
VADisplay dpy,
VASurfaceID render_target
);
/** \brief Indicates an infinite timeout. */ #define VA_TIMEOUT_INFINITE 0xFFFFFFFFFFFFFFFF
/**
* \brief Synchronizes pending operations associated with the supplied surface.
*
* This function blocks during specified timeout (in nanoseconds) until
* all pending operations on the render target have been completed.
* If timeout is zero, the function returns immediately.
*
* Possible errors:
* - \ref VA_STATUS_ERROR_UNIMPLEMENTED: the VA driver implementation
* does not support this interface
* - \ref VA_STATUS_ERROR_INVALID_DISPLAY: an invalid display was supplied
* - \ref VA_STATUS_ERROR_INVALID_SURFACE: an invalid surface was supplied
* - \ref VA_STATUS_ERROR_TIMEDOUT: synchronization is still in progress,
* client should call the function again to complete synchronization
*
* @param[in] dpy the VA display
* @param[in] surface the surface for which synchronization is performed
* @param[in] timeout_ns the timeout in nanoseconds
*
*/
VAStatus vaSyncSurface2(
VADisplay dpy,
VASurfaceID surface,
uint64_t timeout_ns
);
typedef enum {
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;
/**
* Find out any pending ops on the render target
*/
VAStatus vaQuerySurfaceStatus(
VADisplay dpy,
VASurfaceID render_target,
VASurfaceStatus *status /* out */
);
/**
* Client calls vaQuerySurfaceError with VA_STATUS_ERROR_DECODING_ERROR, server side returns
* an array of structure VASurfaceDecodeMBErrors, and the array is terminated by setting status=-1
*/
typedef struct _VASurfaceDecodeMBErrors {
int32_t status; /* 1if 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;
/**
* After the application gets VA_STATUS_ERROR_DECODING_ERROR after calling vaSyncSurface(),
* it can call vaQuerySurfaceError to find out further details on the particular error.
* VA_STATUS_ERROR_DECODING_ERROR should be passed inas"error_status",
* upon the return, error_info will point to an array of _VASurfaceDecodeMBErrors structure,
* which is allocated and filled by libVA with detailed information on the missing or error macroblocks.
* The array is terminated if"status==-1"is detected.
*/
VAStatus vaQuerySurfaceError(
VADisplay dpy,
VASurfaceID surface,
VAStatus error_status,
void **error_info
);
/**
* \brief Synchronizes pending operations associated with the supplied buffer.
*
* This function blocks during specified timeout (in nanoseconds) until
* all pending operations on the supplied buffer have been completed.
* If timeout is zero, the function returns immediately.
*
* Possible errors:
* - \ref VA_STATUS_ERROR_UNIMPLEMENTED: the VA driver implementation
* does not support this interface
* - \ref VA_STATUS_ERROR_INVALID_DISPLAY: an invalid display was supplied
* - \ref VA_STATUS_ERROR_INVALID_BUFFER: an invalid buffer was supplied
* - \ref VA_STATUS_ERROR_TIMEDOUT: synchronization is still in progress,
* client should call the function again to complete synchronization
*
* @param[in] dpy the VA display
* @param[in] buf_id the buffer for which synchronization is performed
* @param[in] timeout_ns the timeout in nanoseconds
*
*/
VAStatus vaSyncBuffer(
VADisplay dpy,
VABufferID buf_id,
uint64_t timeout_ns
);
/**
* Notes about synchronization interfaces:
* vaSyncSurface:
* 1. Allows to synchronize output surface (i.e. from decoding or VP)
* 2. Allows to synchronize all bitstreams being encoded from the given input surface (1->N pipelines).
*
* vaSyncSurface2:
* 1. The same as vaSyncSurface but allows to specify a timeout
*
* vaSyncBuffer:
* 1. Allows to synchronize output buffer (e.g. bitstream from encoding).
* Comparing to vaSyncSurface this function synchronizes given bitstream only.
*/
/**
* Images and Subpictures
* VAImage is used to either get the surface data to client memory, or
* to copy image data in client memory to a surface.
* Both images, subpictures and surfaces follow the same 2D coordinate system where origin
* is at the upper left corner with positive X to the right and positive Y down
*/ #define VA_FOURCC(ch0, ch1, ch2, ch3) \
((unsigned long)(unsigned char) (ch0) | ((unsigned long)(unsigned char) (ch1) << 8) | \
((unsigned long)(unsigned char) (ch2) << 16) | ((unsigned long)(unsigned char) (ch3) << 24 ))
/* Pre-defined fourcc codes. */
/** NV12: two-plane 8-bit YUV 4:2:0.
* The first plane contains Y, the second plane contains U and V in pairs of bytes.
*/ #define VA_FOURCC_NV12 0x3231564E
/** NV21: two-plane 8-bit YUV 4:2:0.
* Same as NV12, but with U and V swapped.
*/ #define VA_FOURCC_NV21 0x3132564E
/** AI44: packed 4-bit YA.
*
* The bottom half of each byte contains luma, the top half contains alpha.
*/ #define VA_FOURCC_AI44 0x34344149
/** RGBA: packed 8-bit RGBA.
*
* Four bytes per pixel: red, green, blue, alpha.
*/ #define VA_FOURCC_RGBA 0x41424752
/** RGBX: packed 8-bit RGB.
*
* Four bytes per pixel: red, green, blue, unspecified.
*/ #define VA_FOURCC_RGBX 0x58424752
/** BGRA: packed 8-bit RGBA.
*
* Four bytes per pixel: blue, green, red, alpha.
*/ #define VA_FOURCC_BGRA 0x41524742
/** BGRX: packed 8-bit RGB.
*
* Four bytes per pixel: blue, green, red, unspecified.
*/ #define VA_FOURCC_BGRX 0x58524742
/** ARGB: packed 8-bit RGBA.
*
* Four bytes per pixel: alpha, red, green, blue.
*/ #define VA_FOURCC_ARGB 0x42475241
/** XRGB: packed 8-bit RGB.
*
* Four bytes per pixel: unspecified, red, green, blue.
*/ #define VA_FOURCC_XRGB 0x42475258
/** ABGR: packed 8-bit RGBA.
*
* Four bytes per pixel: alpha, blue, green, red.
*/ #define VA_FOURCC_ABGR 0x52474241
/** XBGR: packed 8-bit RGB.
*
* Four bytes per pixel: unspecified, blue, green, red.
*/ #define VA_FOURCC_XBGR 0x52474258
/** UYUV: packed 8-bit YUV 4:2:2.
*
* Four bytes per pair of pixels: U, Y, U, V.
*/ #define VA_FOURCC_UYVY 0x59565955
/** YUY2: packed 8-bit YUV 4:2:2.
*
* Four bytes per pair of pixels: Y, U, Y, V.
*/ #define VA_FOURCC_YUY2 0x32595559
/** AYUV: packed 8-bit YUVA 4:4:4.
*
* Four bytes per pixel: A, Y, U, V.
*/ #define VA_FOURCC_AYUV 0x56555941
/** NV11: two-plane 8-bit YUV 4:1:1.
*
* The first plane contains Y, the second plane contains U and V in pairs of bytes.
*/ #define VA_FOURCC_NV11 0x3131564e
/** YV12: three-plane 8-bit YUV 4:2:0.
*
* The three planes contain Y, V and U respectively.
*/ #define VA_FOURCC_YV12 0x32315659
/** P208: two-plane 8-bit YUV 4:2:2.
*
* The first plane contains Y, the second plane contains U and V in pairs of bytes.
*/ #define VA_FOURCC_P208 0x38303250
/** I420: three-plane 8-bit YUV 4:2:0.
*
* The three planes contain Y, U and V respectively.
*/ #define VA_FOURCC_I420 0x30323449
/** YV24: three-plane 8-bit YUV 4:4:4.
*
* The three planes contain Y, V and U respectively.
*/ #define VA_FOURCC_YV24 0x34325659
/** YV32: four-plane 8-bit YUVA 4:4:4
*
* The four planes contain Y, V, U and A respectively.
*/ #define VA_FOURCC_YV32 0x32335659
/** Y800: 8-bit greyscale.
*/ #define VA_FOURCC_Y800 0x30303859
/** IMC3: three-plane 8-bit YUV 4:2:0.
*
* Equivalent to YV12, but with the additional constraint that the pitch of all three planes
* must be the same.
*/ #define VA_FOURCC_IMC3 0x33434D49
/** 411P: three-plane 8-bit YUV 4:1:1.
*
* The three planes contain Y, U and V respectively.
*/ #define VA_FOURCC_411P 0x50313134
/** 411R: three-plane 8-bit YUV.
*
* The subsampling is the transpose of 4:1:1 - full chroma appears on every fourth line.
* The three planes contain Y, U and V respectively.
*/ #define VA_FOURCC_411R 0x52313134
/** 422H: three-plane 8-bit YUV 4:2:2.
*
* The three planes contain Y, U and V respectively.
*/ #define VA_FOURCC_422H 0x48323234
/** 422V: three-plane 8-bit YUV 4:4:0.
*
* The three planes contain Y, U and V respectively.
*/ #define VA_FOURCC_422V 0x56323234
/** 444P: three-plane 8-bit YUV 4:4:4.
*
* The three planes contain Y, U and V respectively.
*/ #define VA_FOURCC_444P 0x50343434
/** RGBP: three-plane 8-bit RGB.
*
* The three planes contain red, green and blue respectively.
*/ #define VA_FOURCC_RGBP 0x50424752
/** BGRP: three-plane 8-bit RGB.
*
* The three planes contain blue, green and red respectively.
*/ #define VA_FOURCC_BGRP 0x50524742
/** RG16: packed 5/6-bit RGB.
*
* Each pixel is a two-byte little-endian value.
* Red, green and blue are found in bits 15:11, 10:5, 4:0 respectively.
*/ #define VA_FOURCC_RGB565 0x36314752
/** BG16: packed 5/6-bit RGB.
*
* Each pixel is a two-byte little-endian value.
* Blue, green and red are found in bits 15:11, 10:5, 4:0 respectively.
*/ #define VA_FOURCC_BGR565 0x36314742
/** Y210: packed 10-bit YUV 4:2:2.
*
* Eight bytes represent a pair of pixels. Each sample is a two-byte little-endian value,
* with the bottom six bits ignored. The samples are in the order Y, U, Y, V.
*/ #define VA_FOURCC_Y210 0x30313259
/** Y212: packed 12-bit YUV 4:2:2.
*
* Eight bytes represent a pair of pixels. Each sample is a two-byte little-endian value.
* The samples are in the order Y, U, Y, V.
*/ #define VA_FOURCC_Y212 0x32313259
/** Y216: packed 16-bit YUV 4:2:2.
*
* Eight bytes represent a pair of pixels. Each sample is a two-byte little-endian value.
* The samples are in the order Y, U, Y, V.
*/ #define VA_FOURCC_Y216 0x36313259
/** Y410: packed 10-bit YUVA 4:4:4.
*
* Each pixel is a four-byte little-endian value.
* A, V, Y, U are found in bits 31:30, 29:20, 19:10, 9:0 respectively.
*/ #define VA_FOURCC_Y410 0x30313459
/** Y412 packed 12-bit YUVA 4:4:4.
*
* Each pixel is a set of four samples, each of which is a two-byte little-endian value.
* The samples are in the order A, V, Y, U.
*/ #define VA_FOURCC_Y412 0x32313459
/** Y416: packed 16-bit YUVA 4:4:4.
*
* Each pixel is a set of four samples, each of which is a two-byte little-endian value.
* The samples are in the order A, V, Y, U.
*/ #define VA_FOURCC_Y416 0x36313459
/** YV16: three-plane 8-bit YUV 4:2:2.
*
* The three planes contain Y, V and U respectively.
*/ #define VA_FOURCC_YV16 0x36315659
/** P010: two-plane 10-bit YUV 4:2:0.
*
* Each sample is a two-byte little-endian value with the bottom six bits ignored.
* The first plane contains Y, the second plane contains U and V in pairs of samples.
*/ #define VA_FOURCC_P010 0x30313050
/** P012: two-plane 12-bit YUV 4:2:0.
*
* Each sample is a two-byte little-endian value with the bottom four bits ignored.
* The first plane contains Y, the second plane contains U and V in pairs of samples.
*/ #define VA_FOURCC_P012 0x32313050
/** P016: two-plane 16-bit YUV 4:2:0.
*
* Each sample is a two-byte little-endian value. The first plane contains Y, the second
* plane contains U and V in pairs of samples.
*/ #define VA_FOURCC_P016 0x36313050
/** I010: three-plane 10-bit YUV 4:2:0.
*
* Each sample is a two-byte little-endian value with the top six bits ignored.
* The three planes contain Y, V and U respectively.
*/ #define VA_FOURCC_I010 0x30313049
/** Y8: 8-bit greyscale.
*
* Only a single sample, 8 bit Y plane for monochrome images
*/ #define VA_FOURCC_Y8 0x20203859
/** Y16: 16-bit greyscale.
*
* Only a single sample, 16 bit Y plane for monochrome images
*/ #define VA_FOURCC_Y16 0x20363159
/** VYUV: packed 8-bit YUV 4:2:2.
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
* Four bytes per pair of pixels: V, Y, U, V.
*/ #define VA_FOURCC_VYUY 0x59555956
/** YVYU: packed 8-bit YUV 4:2:2.
*
* Four bytes per pair of pixels: Y, V, Y, U.
*/ #define VA_FOURCC_YVYU 0x55595659
/** AGRB64: three-plane 16-bit ARGB 16:16:16:16
*
* The four planes contain: alpha, red, green, blue respectively.
*/ #define VA_FOURCC_ARGB64 0x34475241
/** ABGR64: three-plane 16-bit ABGR 16:16:16:16
*
* The four planes contain: alpha, blue, green, red respectively.
*/ #define VA_FOURCC_ABGR64 0x34474241
/** XYUV: packed 8-bit YUVX 4:4:4.
*
* Four bytes per pixel: X, Y, U, V.
*/ #define VA_FOURCC_XYUV 0x56555958
/* byte order */ #define VA_LSB_FIRST 1 #define VA_MSB_FIRST 2
/** \brief Reserved bytes for future use, must be zero */
uint32_t va_reserved[VA_PADDING_LOW];
} VAImageFormat;
typedef VAGenericID VAImageID;
typedef struct _VAImage {
VAImageID image_id; /* uniquely identify this image */
VAImageFormat format;
VABufferID buf; /* image data buffer */
/*
* Image data will be stored in a buffer of type VAImageBufferType to facilitate
* data store on the server side for optimal performance. The buffer will be
* created by the CreateImage function, and proper storage allocated based on the image
* size and format. This buffer is managed by the library implementation, and
* accessed by the client through the buffer Map/Unmap functions.
*/
uint16_t width;
uint16_t height;
uint32_t data_size;
uint32_t num_planes; /* can not be greater than 3 */
/*
* An array indicating the scanline pitch in bytes for each plane.
* Each plane may have a different pitch. Maximum 3 planes for planar formats
*/
uint32_t pitches[3];
/*
* An array indicating the byte offset from the beginning of the image data
* to the start of each plane.
*/
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 */
/*
* Each component is one byte and entry_bytes indicates the number of components in
* each entry (eg. 3for YUV palette entries). set to zero for non-palette images
*/
int32_t entry_bytes;
/*
* An array of ascii characters describing the order of the components within the bytes.
* Only entry_bytes characters of the string are used.
*/
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
);
/**
* Query supported image formats
* The caller must provide a "format_list" array that can hold at
* least vaMaxNumImageFormats() entries. The actual number of formats
* returned in"format_list"is returned in"num_formats".
*/
VAStatus vaQueryImageFormats(
VADisplay dpy,
VAImageFormat *format_list, /* out */
int *num_formats /* out */
);
/**
* Create a VAImage structure
* The width and height fields returned in the VAImage structure may get
* enlarged for some YUV formats. Upon returnfrom this function,
* image->buf has been created and proper storage allocated by the library.
* The client can access the image through the Map/Unmap calls.
*/
VAStatus vaCreateImage(
VADisplay dpy,
VAImageFormat *format,
int width,
int height,
VAImage *image /* out */
);
/**
* Should call DestroyImage before destroying the surface it is bound to
*/
VAStatus vaDestroyImage(
VADisplay dpy,
VAImageID image
);
VAStatus vaSetImagePalette(
VADisplay dpy,
VAImageID image,
/*
* pointer to an array holding the palette data. The size of the array is
* num_palette_entries * entry_bytes in size. The order of the components
* in the palette is described by the component_order in VAImage struct
*/
unsigned char *palette
);
/**
* Retrive surface data into a VAImage
* Image must be in a format supported by the implementation
*/
VAStatus vaGetImage(
VADisplay dpy,
VASurfaceID surface,
int x, /* coordinates of the upper left source pixel */
int y,
unsigned int width, /* width and height of the region */
unsigned int height,
VAImageID image
);
/**
* Copy data from a VAImage to a surface
* Image must be in a format supported by the implementation
* Returns a VA_STATUS_ERROR_SURFACE_BUSY if the surface
* shouldn't be rendered into when this is called
*/
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
);
/**
* Derive an VAImage from an existing surface.
* This interface will derive a VAImage and corresponding image buffer from
* an existing VA Surface. The image buffer can then be mapped/unmapped for
* direct CPU access. This operation is only possible on implementations with
* direct rendering capabilities and internal surface formats that can be
* represented with a VAImage. When the operation isnot possible this interface
* will return VA_STATUS_ERROR_OPERATION_FAILED. Clients should then fall back
* to using vaCreateImage + vaPutImage to accomplish the same task in an
* indirect manner.
*
* Implementations should only return success when the resulting image buffer
* would be useable with vaMap/Unmap.
*
* When directly accessing a surface special care must be taken to insure
* proper synchronization with the graphics hardware. Clients should call
* vaQuerySurfaceStatus to insure that a surface isnot the target of concurrent
* rendering or currently being displayed by an overlay.
*
* Additionally nothing about the contents of a surface should be assumed
* following a vaPutSurface. Implementations are free to modify the surface for
* scaling or subpicture blending within a call to vaPutImage.
*
* Calls to vaPutImage or vaGetImage using the same surface from which the image
* has been derived will return VA_STATUS_ERROR_SURFACE_BUSY. vaPutImage or
* vaGetImage with other surfaces is supported.
*
* An image created with vaDeriveImage should be freed with vaDestroyImage. The
* image and image buffer structures will be destroyed; however, the underlying
* surface will remain unchanged until freed with vaDestroySurfaces.
*/
VAStatus vaDeriveImage(
VADisplay dpy,
VASurfaceID surface,
VAImage *image /* out */
);
/**
* Subpictures
* Subpicture is a special type of image that can be blended
* with a surface during vaPutSurface(). Subpicture can be used to render
* DVD sub-titles or closed captioning text etc.
*/
typedef VAGenericID VASubpictureID;
/** Get maximum number of subpicture formats supported by the implementation */
int vaMaxNumSubpictureFormats(
VADisplay dpy
);
/** flags for subpictures */ #define VA_SUBPICTURE_CHROMA_KEYING 0x0001 #define VA_SUBPICTURE_GLOBAL_ALPHA 0x0002 #define VA_SUBPICTURE_DESTINATION_IS_SCREEN_COORD 0x0004
/**
* Query supported subpicture formats
* The caller must provide a "format_list" array that can hold at
* least vaMaxNumSubpictureFormats() entries. The flags arrary holds the flag
* for each format to indicate additional capabilities for that format. The actual
* number of formats returned in"format_list"is returned in"num_formats".
* flags: returned value to indicate addtional capabilities
* VA_SUBPICTURE_CHROMA_KEYING - supports chroma-keying
* VA_SUBPICTURE_GLOBAL_ALPHA - supports global alpha
* VA_SUBPICTURE_DESTINATION_IS_SCREEN_COORD - supports unscaled screen relative subpictures for On Screen Display
*/
VAStatus vaQuerySubpictureFormats(
VADisplay dpy,
VAImageFormat *format_list, /* out */
unsigned int *flags, /* out */
unsigned int *num_formats /* out */
);
/**
* Subpictures are created with an image associated.
*/
VAStatus vaCreateSubpicture(
VADisplay dpy,
VAImageID image,
VASubpictureID *subpicture /* out */
);
/**
* Destroy the subpicture before destroying the image it is assocated to
*/
VAStatus vaDestroySubpicture(
VADisplay dpy,
VASubpictureID subpicture
);
/**
* Bind an image to the subpicture. This image will now be associated with
* the subpicture instead of the one at creation.
*/
VAStatus vaSetSubpictureImage(
VADisplay dpy,
VASubpictureID subpicture,
VAImageID image
);
/**
* If chromakey is enabled, then the area where the source value falls within
* the chromakey [min, max] range is transparent
* The chromakey component format is the following:
* For RGB: [0:7] Red [8:15] Blue [16:23] Green
* For YUV: [0:7] V [8:15] U [16:23] Y
* The chromakey mask can be used to mask out certain components for chromakey
* comparision
*/
VAStatus vaSetSubpictureChromakey(
VADisplay dpy,
VASubpictureID subpicture,
unsigned int chromakey_min,
unsigned int chromakey_max,
unsigned int chromakey_mask
);
/**
* Global alpha value is between 0and1. A value of 1 means fully opaque and
* a value of 0 means fully transparent. If per-pixel alpha is also specified then
* the overall alpha is per-pixel alpha multiplied by the global alpha
*/
VAStatus vaSetSubpictureGlobalAlpha(
VADisplay dpy,
VASubpictureID subpicture,
float global_alpha
);
/**
* vaAssociateSubpicture associates the subpicture with target_surfaces.
* It defines the region mapping between the subpicture and the target
* surfaces through source and destination rectangles (with the same width and height).
* Both will be displayed at the next call to vaPutSurface. Additional
* associations before the call to vaPutSurface simply overrides the association.
*/
VAStatus vaAssociateSubpicture(
VADisplay dpy,
VASubpictureID subpicture,
VASurfaceID *target_surfaces,
int num_surfaces,
int16_t src_x, /* upper left offset in subpicture */
int16_t src_y,
uint16_t src_width,
uint16_t src_height,
int16_t dest_x, /* upper left offset in surface */
int16_t dest_y,
uint16_t dest_width,
uint16_t dest_height,
/*
* whether to enable chroma-keying, global-alpha, or screen relative mode
* see VA_SUBPICTURE_XXX values
*/
uint32_t flags
);
/**
* vaDeassociateSubpicture removes the association of the subpicture with target_surfaces.
*/
VAStatus vaDeassociateSubpicture(
VADisplay dpy,
VASubpictureID subpicture,
VASurfaceID *target_surfaces,
int num_surfaces
);
/**
* Display attributes
* Display attributes are used to control things such as contrast, hue, saturation,
* brightness etc. in the rendering process. The application can query what
* attributes are supported by the driver, and then set the appropriate attributes
* before calling vaPutSurface()
*
* Display attributes can also be used to query/set platform or display adaptor (vaDisplay)
* related information. These attributes do not depend on vaConfig, and could not be used
* for vaPutSurface. Application can use vaQueryDisplayAttributes/vaGetDisplayAttributes
* at anytime after vaInitialize, but (for settable attributes) vaSetDisplayAttributes should be
* called after vaInitialize and before any other function call.
*
* To distinguish these two types of display attributes, display adaptor related attributes
* should be marked as"HW attribute"in the description.
*/
/**\brief 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.
*
* If the value == VA_ATTRIB_NOT_SUPPORTED, it mean that the attribute
* is unsupport or UNKNOWN.
*/
typedef union _VADisplayAttribValSubDevice {
struct {
/** \brief current sub device index, read - write */
uint32_t current_sub_device : 4;
/** \brief sub devices count, read - only */
uint32_t sub_device_count : 4;
/** \brief reserved bits for future, must be zero*/
uint32_t reserved : 8;
/** \brief bit mask to indicate which sub_device is available, read only
* \code
* VADisplayAttribValSubDevice reg;
* VADisplayAttribute reg_attr;
* reg_attr.type = VADisplayAttribSubDevice;
* vaGetDisplayAttributes(dpy, ®_attr, 1);
* reg.value = reg_attr.value;
*
* for(int i = 0; i < reg.bits.sub_device_count; i ++ ){
* if((1<<i) & reg.bits.sub_device_mask){
* printf("sub device %d can be selected", i);
* }
*}
* \endcode
*/
uint32_t sub_device_mask : 16;
} bits;
uint32_t value;
} VADisplayAttribValSubDevice;
/** Currently defined display attribute types */
typedef enum {
VADisplayAttribBrightness = 0,
VADisplayAttribContrast = 1,
VADisplayAttribHue = 2,
VADisplayAttribSaturation = 3,
/* client can specifiy a background color for the target window
* the new feature of video conference,
* the uncovered area of the surface is filled by this color
* also it will blend with the decoded video color
*/
VADisplayAttribBackgroundColor = 4,
/*
* this is a gettable only attribute. For some implementations that use the
* hardware overlay, after PutSurface is called, the surface can not be
* re-used until after the subsequent PutSurface call. If this is the case
* then the value for this attribute will be set to 1 so that the client
* will not attempt to re-use the surface right after returning from a call
* to PutSurface.
*
* Don't use it, use flag VASurfaceDisplaying of vaQuerySurfaceStatus since
* driver may use overlay or GPU alternatively
*/
VADisplayAttribDirectSurface = 5,
VADisplayAttribRotation = 6,
VADisplayAttribOutofLoopDeblock = 7,
/* PowerVR IEP Lite specific attributes */
VADisplayAttribBLEBlackMode = 8,
VADisplayAttribBLEWhiteMode = 9,
VADisplayAttribBlueStretch = 10,
VADisplayAttribSkinColorCorrection = 11,
/*
* For type VADisplayAttribCSCMatrix, "value" field is a pointer to the color
* conversion matrix. Each element in the matrix is float-point
*/
VADisplayAttribCSCMatrix = 12,
/* specify the constant color used to blend with video surface
* Cd = Cv*Cc*Ac + Cb *(1 - Ac) C means the constant RGB
* d: the final color to overwrite into the frame buffer
* v: decoded video after color conversion,
* c: video color specified by VADisplayAttribBlendColor
* b: background color of the drawable
*/
VADisplayAttribBlendColor = 13,
/*
* Indicate driver to skip painting color key ornot.
* only applicable if the render is overlay
*/
VADisplayAttribOverlayAutoPaintColorKey = 14,
/*
* customized overlay color key, the format is RGB888
* [23:16] = Red, [15:08] = Green, [07:00] = Blue.
*/
VADisplayAttribOverlayColorKey = 15,
/*
* The hint for the implementation of vaPutSurface
* normally, the driver could use an overlay or GPU to render the surface on the screen
* this flag provides APP the flexibity to switch the render dynamically
*/
VADisplayAttribRenderMode = 16,
/*
* specify if vaPutSurface needs to render into specified monitors
* one example is that one external monitor (e.g. HDMI) is enabled,
* but the window manager isnot aware of it, and there is no associated drawable
*/
VADisplayAttribRenderDevice = 17,
/*
* specify vaPutSurface render area if there is no drawable on the monitor
*/
VADisplayAttribRenderRect = 18,
/*
* HW attribute, read/write, specify the sub device configure
*/
VADisplayAttribSubDevice = 19,
/*
* HW attribute. read only. specify whether vaCopy support on current HW
* The value of each bit should equal to 1 << VA_EXEC_MODE_XXX to represent
* modes of vaCopy
*/
VADisplayAttribCopy = 20,
} VADisplayAttribType;
typedef struct _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 orOR'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
);
/**
* Query display attributes
* The caller must provide a "attr_list" array that can hold at
* least vaMaxNumDisplayAttributes() entries. The actual number of attributes
* returned in"attr_list"is returned in"num_attributes".
*/
VAStatus vaQueryDisplayAttributes(
VADisplay dpy,
VADisplayAttribute *attr_list, /* out */
int *num_attributes /* out */
);
/**
* Get display attributes
* This function returns the current attribute values in"attr_list".
* Only attributes returned with VA_DISPLAY_ATTRIB_GETTABLE set in the "flags" field
* from vaQueryDisplayAttributes() can have their values retrieved.
*/
VAStatus vaGetDisplayAttributes(
VADisplay dpy,
VADisplayAttribute *attr_list, /* in/out */
int num_attributes
);
/**
* Set display attributes
* Only attributes returned with VA_DISPLAY_ATTRIB_SETTABLE set in the "flags" field
* from vaQueryDisplayAttributes() can be set. If the attribute isnot settable or
* the value is out of range, the function returns VA_STATUS_ERROR_ATTR_NOT_SUPPORTED
*/
VAStatus vaSetDisplayAttributes(
VADisplay dpy,
VADisplayAttribute *attr_list,
int num_attributes
);
/****************************
* HEVC data structures
****************************/
/**
* \brief Description of picture properties of those in DPB surfaces.
*
* If only progressive scan is supported, each surface contains one whole
* frame picture.
* Otherwise, each surface contains two fields of whole picture.
* In this case, two entries of ReferenceFrames[] may share same picture_id
* value.
*/
typedef struct _VAPictureHEVC {
/** \brief reconstructed picture buffer surface index
* invalid when taking value VA_INVALID_SURFACE.
*/
VASurfaceID picture_id;
/** \brief picture order count.
* in HEVC, POCs for top and bottom fields of same picture should
* take different values.
*/
int32_t pic_order_cnt;
/* described below */
uint32_t flags;
/** \brief Reserved bytes for future use, must be zero */
uint32_t va_reserved[VA_PADDING_LOW];
} VAPictureHEVC;
/* flags in VAPictureHEVC could be OR of the following */ #define VA_PICTURE_HEVC_INVALID 0x00000001
/** \brief indication of interlace scan picture.
* should take same value for all the pictures in sequence.
*/ #define VA_PICTURE_HEVC_FIELD_PIC 0x00000002
/** \brief polarity of the field picture.
* top field takes even lines of buffer surface.
* bottom field takes odd lines of buffer surface.
*/ #define VA_PICTURE_HEVC_BOTTOM_FIELD 0x00000004
/** \brief Long term reference picture */ #define VA_PICTURE_HEVC_LONG_TERM_REFERENCE 0x00000008
/**
* VA_PICTURE_HEVC_RPS_ST_CURR_BEFORE, VA_PICTURE_HEVC_RPS_ST_CURR_AFTER
* and VA_PICTURE_HEVC_RPS_LT_CURR of any picture in ReferenceFrames[] should
* be exclusive. No more than one of them can be set for any picture.
* Sum of NumPocStCurrBefore, NumPocStCurrAfter and NumPocLtCurr
* equals NumPocTotalCurr, which should be equal to or smaller than 8.
* Application should provide valid values for both short format and long format.
* The pictures in DPB with any of these three flags turned on are referred by
* the current picture.
*/
/** \brief RefPicSetStCurrBefore of HEVC spec variable
* Number of ReferenceFrames[] entries with this bit set equals
* NumPocStCurrBefore.
*/ #define VA_PICTURE_HEVC_RPS_ST_CURR_BEFORE 0x00000010
/** \brief RefPicSetStCurrAfter of HEVC spec variable
* Number of ReferenceFrames[] entries with this bit set equals
* NumPocStCurrAfter.
*/ #define VA_PICTURE_HEVC_RPS_ST_CURR_AFTER 0x00000020
/** \brief RefPicSetLtCurr of HEVC spec variable
* Number of ReferenceFrames[] entries with this bit set equals
* NumPocLtCurr.
*/ #define VA_PICTURE_HEVC_RPS_LT_CURR 0x00000040
typedef union _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;
/** \brief Copies an object.
*
* Copies specified object (surface or buffer). If non-blocking copy
* is requested (VA_COPY_NONBLOCK), then need vaSyncBuffer or vaSyncSurface/vaSyncSurface2
* to sync the destination object.
*
* @param[in] dpy the VA display
* @param[in] dst Destination object to copy to
* @param[in] src Source object to copy from
* @param[in] option VA copy option
* @return VA_STATUS_SUCCESS if successful
*/
VAStatus vaCopy(VADisplay dpy, VACopyObject * dst, VACopyObject * src, VACopyOption option);
¤ 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.346Bemerkung:
¤
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.