/* * Copyright (c) 2007-2009 Intel Corporation. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. * IN NO EVENT SHALL INTEL AND/OR ITS SUPPLIERS BE LIABLE FOR * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /* * Video Acceleration (VA) API Specification * * Rev. 0.30 * <jonathan.bian@intel.com> * * Revision History: * rev 0.10 (12/10/2006 Jonathan Bian) - Initial draft * rev 0.11 (12/15/2006 Jonathan Bian) - Fixed some errors * rev 0.12 (02/05/2007 Jonathan Bian) - Added VC-1 data structures for slice level decode * rev 0.13 (02/28/2007 Jonathan Bian) - Added GetDisplay() * rev 0.14 (04/13/2007 Jonathan Bian) - Fixed MPEG-2 PictureParameter structure, cleaned up a few funcs. * rev 0.15 (04/20/2007 Jonathan Bian) - Overhauled buffer management * rev 0.16 (05/02/2007 Jonathan Bian) - Added error codes and fixed some issues with configuration * rev 0.17 (05/07/2007 Jonathan Bian) - Added H.264/AVC data structures for slice level decode. * rev 0.18 (05/14/2007 Jonathan Bian) - Added data structures for MPEG-4 slice level decode * and MPEG-2 motion compensation. * rev 0.19 (08/06/2007 Jonathan Bian) - Removed extra type for bitplane data. * rev 0.20 (08/08/2007 Jonathan Bian) - Added missing fields to VC-1 PictureParameter structure. * rev 0.21 (08/20/2007 Jonathan Bian) - Added image and subpicture support. * rev 0.22 (08/27/2007 Jonathan Bian) - Added support for chroma-keying and global alpha. * rev 0.23 (09/11/2007 Jonathan Bian) - Fixed some issues with images and subpictures. * rev 0.24 (09/18/2007 Jonathan Bian) - Added display attributes. * rev 0.25 (10/18/2007 Jonathan Bian) - Changed to use IDs only for some types. * rev 0.26 (11/07/2007 Waldo Bastian) - Change vaCreateBuffer semantics * rev 0.27 (11/19/2007 Matt Sottek) - Added DeriveImage * rev 0.28 (12/06/2007 Jonathan Bian) - Added new versions of PutImage and AssociateSubpicture * to enable scaling * rev 0.29 (02/07/2008 Jonathan Bian) - VC1 parameter fixes, * added VA_STATUS_ERROR_RESOLUTION_NOT_SUPPORTED * rev 0.30 (03/01/2009 Jonathan Bian) - Added encoding support for H.264 BP and MPEG-4 SP and fixes * for ISO C conformance. * rev 0.31 (09/02/2009 Gwenole Beauchesne) - VC-1/H264 fields change for VDPAU and XvBA backend * Application needs to relink with the new library. * * rev 0.31.1 (03/29/2009) - Data structure for JPEG encode * rev 0.31.2 (01/13/2011 Anthony Pabon)- Added a flag to indicate Subpicture coordinates are screen * screen relative rather than source video relative. * rev 0.32.0 (01/13/2011 Xiang Haihao) - Add profile into VAPictureParameterBufferVC1 * update VAAPI to 0.32.0 * * Acknowledgements: * Some concepts borrowed from XvMC and XvImage. * Waldo Bastian (Intel), Matt Sottek (Intel), Austin Yuan (Intel), and Gwenole Beauchesne (SDS) * contributed to various aspects of the API.
*/
/** * \file va.h * \brief The Core API * * This file contains the \ref api_core "Core API".
*/
/** * \mainpage Video Acceleration (VA) API * * \section intro Introduction * * The main motivation for VA-API (Video Acceleration API) is to * enable hardware accelerated video decode and encode at various * entry-points (VLD, IDCT, Motion Compensation etc.) for the * prevailing coding standards today (MPEG-2, MPEG-4 ASP/H.263, MPEG-4 * AVC/H.264, VC-1/VMW3, and JPEG, HEVC/H265, VP8, VP9) and video pre/post * processing * * VA-API is split into several modules: * - \ref api_core * - Encoder (H264, HEVC, JPEG, MPEG2, VP8, VP9) * - \ref api_enc_h264 * - \ref api_enc_hevc * - \ref api_enc_jpeg * - \ref api_enc_mpeg2 * - \ref api_enc_vp8 * - \ref api_enc_vp9 * - Decoder (HEVC, JPEG, VP8, VP9, AV1) * - \ref api_dec_hevc * - \ref api_dec_jpeg * - \ref api_dec_vp8 * - \ref api_dec_vp9 * - \ref api_dec_av1 * - \ref api_vpp * - \ref api_prot * - FEI (H264, HEVC) * - \ref api_fei * - \ref api_fei_h264 * - \ref api_fei_hevc * * \section threading Multithreading Guide * All VAAPI functions implemented in libva are thread-safe. For any VAAPI * function that requires the implementation of a backend (e.g. hardware driver), * the backend must ensure that its implementation is also thread-safe. If the * backend implementation of a VAAPI function is not thread-safe then this should * be considered as a bug against the backend implementation. * * It is assumed that none of the VAAPI functions will be called from signal * handlers. * * Thread-safety in this context means that when VAAPI is being called by multiple * concurrent threads, it will not crash or hang the OS, and VAAPI internal * data structures will not be corrupted. When multiple threads are operating on * the same VAAPI objects, it is the application's responsibility to synchronize * these operations in order to generate the expected results. For example, using * a single VAContext from multiple threads may generate unexpected results. * * Following pseudo code illustrates a multithreaded transcoding scenario, where * one thread is handling the decoding operation and another thread is handling * the encoding operation, while synchronizing the use of a common pool of * surfaces. * * \code * // Initialization * dpy = vaGetDisplayDRM(fd); * vaInitialize(dpy, ...); * * // Create surfaces required for decoding and subsequence encoding * vaCreateSurfaces(dpy, VA_RT_FORMAT_YUV420, width, height, &surfaces[0], ...); * * // Set up a queue for the surfaces shared between decode and encode threads * surface_queue = queue_create(); * * // Create decode_thread * pthread_create(&decode_thread, NULL, decode, ...); * * // Create encode_thread * pthread_create(&encode_thread, NULL, encode, ...); * * // Decode thread function * decode() { * // Find the decode entrypoint for H.264 * vaQueryConfigEntrypoints(dpy, h264_profile, entrypoints, ...); * * // Create a config for H.264 decode * vaCreateConfig(dpy, h264_profile, VAEntrypointVLD, ...); * * // Create a context for decode * vaCreateContext(dpy, config, width, height, VA_PROGRESSIVE, surfaces, * num_surfaces, &decode_context); * * // Decode frames in the bitstream * for (;;) { * // Parse one frame and decode * vaBeginPicture(dpy, decode_context, surfaces[surface_index]); * vaRenderPicture(dpy, decode_context, buf, ...); * vaEndPicture(dpy, decode_context); * // Poll the decoding status and enqueue the surface in display order after * // decoding is complete * vaQuerySurfaceStatus(); * enqueue(surface_queue, surface_index); * } * } * * // Encode thread function * encode() { * // Find the encode entrypoint for HEVC * vaQueryConfigEntrypoints(dpy, hevc_profile, entrypoints, ...); * * // Create a config for HEVC encode * vaCreateConfig(dpy, hevc_profile, VAEntrypointEncSlice, ...); * * // Create a context for encode * vaCreateContext(dpy, config, width, height, VA_PROGRESSIVE, surfaces, * num_surfaces, &encode_context); * * // Encode frames produced by the decoder * for (;;) { * // Dequeue the surface enqueued by the decoder * surface_index = dequeue(surface_queue); * // Encode using this surface as the source * vaBeginPicture(dpy, encode_context, surfaces[surface_index]); * vaRenderPicture(dpy, encode_context, buf, ...); * vaEndPicture(dpy, encode_context); * } * } * \endcode
*/
/** * \defgroup api_core Core API * * @{
*/
/** Overview
The VA API is intended to provide an interface between a video decode/encode/processing application (client) and a hardware accelerator (server), to off-load video decode/encode/processing operations from the host to the hardware accelerator at various entry-points.
The basic operation steps are:
- Negotiate a mutually acceptable configuration with the server to lock down profile, entrypoints, and other attributes that will not change on a frame-by-frame basis. - Create a video decode, encode or processing context which represents a "virtualized" hardware device - Get and fill the render buffers with the corresponding data (depending on profiles and entrypoints) - Pass the render buffers to the server to handle the current frame
Initialization & Configuration Management
- Find out supported profiles - Find out entrypoints for a given profile - Find out configuration attributes for a given profile/entrypoint pair - Create a configuration for use by the application
*/
typedefvoid* VADisplay; /* window system dependent */
typedefint VAStatus; /** Return status type from functions */ /** Values for the return status */ #define VA_STATUS_SUCCESS 0x00000000 #define VA_STATUS_ERROR_OPERATION_FAILED 0x00000001 #define VA_STATUS_ERROR_ALLOCATION_FAILED 0x00000002 #define VA_STATUS_ERROR_INVALID_DISPLAY 0x00000003 #define VA_STATUS_ERROR_INVALID_CONFIG 0x00000004 #define VA_STATUS_ERROR_INVALID_CONTEXT 0x00000005 #define VA_STATUS_ERROR_INVALID_SURFACE 0x00000006 #define VA_STATUS_ERROR_INVALID_BUFFER 0x00000007 #define VA_STATUS_ERROR_INVALID_IMAGE 0x00000008 #define VA_STATUS_ERROR_INVALID_SUBPICTURE 0x00000009 #define VA_STATUS_ERROR_ATTR_NOT_SUPPORTED 0x0000000a #define VA_STATUS_ERROR_MAX_NUM_EXCEEDED 0x0000000b #define VA_STATUS_ERROR_UNSUPPORTED_PROFILE 0x0000000c #define VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT 0x0000000d #define VA_STATUS_ERROR_UNSUPPORTED_RT_FORMAT 0x0000000e #define VA_STATUS_ERROR_UNSUPPORTED_BUFFERTYPE 0x0000000f #define VA_STATUS_ERROR_SURFACE_BUSY 0x00000010 #define VA_STATUS_ERROR_FLAG_NOT_SUPPORTED 0x00000011 #define VA_STATUS_ERROR_INVALID_PARAMETER 0x00000012 #define VA_STATUS_ERROR_RESOLUTION_NOT_SUPPORTED 0x00000013 #define VA_STATUS_ERROR_UNIMPLEMENTED 0x00000014 #define VA_STATUS_ERROR_SURFACE_IN_DISPLAYING 0x00000015 #define VA_STATUS_ERROR_INVALID_IMAGE_FORMAT 0x00000016 #define VA_STATUS_ERROR_DECODING_ERROR 0x00000017 #define VA_STATUS_ERROR_ENCODING_ERROR 0x00000018 /** * \brief An invalid/unsupported value was supplied. * * This is a catch-all error code for invalid or unsupported values. * e.g. value exceeding the valid range, invalid type in the context * of generic attribute values.
*/ #define VA_STATUS_ERROR_INVALID_VALUE 0x00000019 /** \brief An unsupported filter was supplied. */ #define VA_STATUS_ERROR_UNSUPPORTED_FILTER 0x00000020 /** \brief An invalid filter chain was supplied. */ #define VA_STATUS_ERROR_INVALID_FILTER_CHAIN 0x00000021 /** \brief Indicate HW busy (e.g. run multiple encoding simultaneously). */ #define VA_STATUS_ERROR_HW_BUSY 0x00000022 /** \brief An unsupported memory type was supplied. */ #define VA_STATUS_ERROR_UNSUPPORTED_MEMORY_TYPE 0x00000024 /** \brief Indicate allocated buffer size is not enough for input or output. */ #define VA_STATUS_ERROR_NOT_ENOUGH_BUFFER 0x00000025 /** \brief Indicate an operation isn't completed because time-out interval elapsed. */ #define VA_STATUS_ERROR_TIMEDOUT 0x00000026 #define VA_STATUS_ERROR_UNKNOWN 0xFFFFFFFF
/** * Enabled the positioning/cropping/blending feature: * 1, specify the video playback position in the isurface * 2, specify the cropping info for video playback * 3, encoded video will blend with background color
*/ #define VA_ENABLE_BLEND 0x00000004 /* video area blend with the constant color */
/** * Clears the drawable with background color. * for hardware overlay based implementation this flag * can be used to turn off the overlay
*/ #define VA_CLEAR_DRAWABLE 0x00000008
/** Color space conversion flags for vaPutSurface() */ #define VA_SRC_COLOR_MASK 0x000000f0 #define VA_SRC_BT601 0x00000010 #define VA_SRC_BT709 0x00000020 #define VA_SRC_SMPTE_240 0x00000040
/* Values used to describe device features. */ /** The feature is not supported by the device. * * Any corresponding feature flag must not be set.
*/ #define VA_FEATURE_NOT_SUPPORTED 0 /** The feature is supported by the device. * * The user may decide whether or not to use this feature. * * Note that support for a feature only indicates that the hardware * is able to use it; whether it is actually a positive change to * enable it in a given situation will depend on other factors * including the input provided by the user.
*/ #define VA_FEATURE_SUPPORTED 1 /** The feature is required by the device. * * The device does not support not enabling this feature, so any * corresponding feature flag must be set and any additional * configuration needed by the feature must be supplied.
*/ #define VA_FEATURE_REQUIRED 2
/** * Returns a short english description of error_status
*/ constchar *vaErrorStr(VAStatus error_status);
/** \brief Generic motion vector data structure. */ typedefstruct _VAMotionVector { /** \mv0[0]: horizontal motion vector for past reference */ /** \mv0[1]: vertical motion vector for past reference */ /** \mv1[0]: horizontal motion vector for future reference */ /** \mv1[1]: vertical motion vector for future reference */
int16_t mv0[2]; /* past reference */
int16_t mv1[2]; /* future reference */
} VAMotionVector;
/** Type of a message callback, used for both error and info log. */ typedefvoid (*VAMessageCallback)(void *user_context, constchar *message);
/** * Set the callback for error messages, or NULL for no logging. * Returns the previous one, or NULL if it was disabled.
*/
VAMessageCallback vaSetErrorCallback(VADisplay dpy, VAMessageCallback callback, void *user_context);
/** * Set the callback for info messages, or NULL for no logging. * Returns the previous one, or NULL if it was disabled.
*/
VAMessageCallback vaSetInfoCallback(VADisplay dpy, VAMessageCallback callback, void *user_context);
/** * Initialization: * A display must be obtained by calling vaGetDisplay() before calling * vaInitialize() and other functions. This connects the API to the * native window system. * For X Windows, native_dpy would be from XOpenDisplay()
*/ typedefvoid* VANativeDisplay; /* window system dependent */
int vaDisplayIsValid(VADisplay dpy);
/** * Set the override driver name instead of queried driver driver.
*/
VAStatus vaSetDriverName(VADisplay dpy, char *driver_name
);
/** * Initialize the library
*/
VAStatus vaInitialize(
VADisplay dpy, int *major_version, /* out */ int *minor_version /* out */
);
/** * After this call, all library internal resources will be cleaned up
*/
VAStatus vaTerminate(
VADisplay dpy
);
/** * vaQueryVendorString returns a pointer to a zero-terminated string * describing some aspects of the VA implemenation on a specific * hardware accelerator. The format of the returned string is vendor * specific and at the discretion of the implementer. * e.g. for the Intel GMA500 implementation, an example would be: * "Intel GMA500 - 2.0.0.32L.0005"
*/ constchar *vaQueryVendorString(
VADisplay dpy
);
typedefint (*VAPrivFunc)(void);
/** * Return a function pointer given a function name in the library. * This allows private interfaces into the library
*/
VAPrivFunc vaGetLibFunc(
VADisplay dpy, constchar *func
);
/** * Currently defined entrypoints
*/ typedefenum {
VAEntrypointVLD = 1,
VAEntrypointIZZ = 2,
VAEntrypointIDCT = 3,
VAEntrypointMoComp = 4,
VAEntrypointDeblocking = 5,
VAEntrypointEncSlice = 6, /* slice level encode */
VAEntrypointEncPicture = 7, /* pictuer encode, JPEG, etc */ /* * For an implementation that supports a low power/high performance variant * for slice level encode, it can choose to expose the * VAEntrypointEncSliceLP entrypoint. Certain encoding tools may not be * available with this entrypoint (e.g. interlace, MBAFF) and the * application can query the encoding configuration attributes to find * out more details if this entrypoint is supported.
*/
VAEntrypointEncSliceLP = 8,
VAEntrypointVideoProc = 10, /**< Video pre/post-processing. */ /** * \brief VAEntrypointFEI * * The purpose of FEI (Flexible Encoding Infrastructure) is to allow applications to * have more controls and trade off quality for speed with their own IPs. * The application can optionally provide input to ENC for extra encode control * and get the output from ENC. Application can chose to modify the ENC * output/PAK input during encoding, but the performance impact is significant. * * On top of the existing buffers for normal encode, there will be * one extra input buffer (VAEncMiscParameterFEIFrameControl) and * three extra output buffers (VAEncFEIMVBufferType, VAEncFEIMBModeBufferType * and VAEncFEIDistortionBufferType) for VAEntrypointFEI entry function. * If separate PAK is set, two extra input buffers * (VAEncFEIMVBufferType, VAEncFEIMBModeBufferType) are needed for PAK input.
**/
VAEntrypointFEI = 11, /** * \brief VAEntrypointStats * * A pre-processing function for getting some statistics and motion vectors is added, * and some extra controls for Encode pipeline are provided. The application can * optionally call the statistics function to get motion vectors and statistics like * variances, distortions before calling Encode function via this entry point. * * Checking whether Statistics is supported can be performed with vaQueryConfigEntrypoints(). * If Statistics entry point is supported, then the list of returned entry-points will * include #VAEntrypointStats. Supported pixel format, maximum resolution and statistics * specific attributes can be obtained via normal attribute query. One input buffer * (VAStatsStatisticsParameterBufferType) and one or two output buffers * (VAStatsStatisticsBufferType, VAStatsStatisticsBottomFieldBufferType (for interlace only) * and VAStatsMVBufferType) are needed for this entry point.
**/
VAEntrypointStats = 12, /** * \brief VAEntrypointProtectedTEEComm * * A function for communicating with TEE (Trusted Execution Environment).
**/
VAEntrypointProtectedTEEComm = 13, /** * \brief VAEntrypointProtectedContent * * A function for protected content to decrypt encrypted content.
**/
VAEntrypointProtectedContent = 14,
} VAEntrypoint;
/** @name Attributes for decoding */ /**@{*/ /** * \brief Slice Decoding mode. Read/write. * * This attribute determines what mode the driver supports for slice * decoding, through vaGetConfigAttributes(); and what mode the user * will be providing to the driver, through vaCreateConfig(), if the * driver supports those. If this attribute is not set by the user then * it is assumed that VA_DEC_SLICE_MODE_NORMAL mode is used. * * See \c VA_DEC_SLICE_MODE_xxx for the list of slice decoding modes.
*/
VAConfigAttribDecSliceMode = 6, /** * \brief JPEG decoding attribute. Read-only. * * This attribute exposes a number of capabilities of the underlying * JPEG implementation. The attribute value is partitioned into fields as defined in the * VAConfigAttribValDecJPEG union.
*/
VAConfigAttribDecJPEG = 7, /** * \brief Decode processing support. Read/write. * * This attribute determines if the driver supports video processing * with decoding using the decoding context in a single call, through * vaGetConfigAttributes(); and if the user may use this feature, * through vaCreateConfig(), if the driver supports the user scenario. * The user will essentially create a regular decode VAContext. Therefore, * the parameters of vaCreateContext() such as picture_width, picture_height * and render_targets are in relation to the decode output parameters * (not processing output parameters) as normal. * If this attribute is not set by the user then it is assumed that no * extra processing is done after decoding for this decode context. * * Since essentially the application is creating a decoder config and context, * all function calls that take in the config (e.g. vaQuerySurfaceAttributes()) * or context are in relation to the decoder, except those video processing * function specified in the next paragraph. * * Once the decode config and context are created, the user must further * query the supported processing filters using vaQueryVideoProcFilters(), * vaQueryVideoProcFilterCaps(), vaQueryVideoProcPipelineCaps() by specifying * the created decode context. The user must provide processing information * and extra processing output surfaces as "additional_outputs" to the driver * through VAProcPipelineParameterBufferType. The render_target specified * at vaBeginPicture() time refers to the decode output surface. The * target surface for the output of processing needs to be a different * surface since the decode process requires the original reconstructed buffer. * The “surface” member of VAProcPipelineParameterBuffer should be set to the * same as “render_target” set in vaBeginPicture(), but the driver may choose * to ignore this parameter.
*/
VAConfigAttribDecProcessing = 8, /** @name Attributes for encoding */ /**@{*/ /** * \brief Packed headers mode. Read/write. * * This attribute determines what packed headers the driver supports, * through vaGetConfigAttributes(); and what packed headers the user * will be providing to the driver, through vaCreateConfig(), if the * driver supports those. * * See \c VA_ENC_PACKED_HEADER_xxx for the list of packed headers.
*/
VAConfigAttribEncPackedHeaders = 10, /** * \brief Interlaced mode. Read/write. * * This attribute determines what kind of interlaced encoding mode * the driver supports. * * See \c VA_ENC_INTERLACED_xxx for the list of interlaced modes.
*/
VAConfigAttribEncInterlaced = 11, /** * \brief Maximum number of reference frames. Read-only. * * This attribute determines the maximum number of reference * frames supported for encoding. * * Note: for H.264 encoding, the value represents the maximum number * of reference frames for both the reference picture list 0 (bottom * 16 bits) and the reference picture list 1 (top 16 bits).
*/
VAConfigAttribEncMaxRefFrames = 13, /** * \brief Maximum number of slices per frame. Read-only. * * This attribute determines the maximum number of slices the * driver can support to encode a single frame.
*/
VAConfigAttribEncMaxSlices = 14, /** * \brief Slice structure. Read-only. * * This attribute determines slice structures supported by the * driver for encoding. This attribute is a hint to the user so * that he can choose a suitable surface size and how to arrange * the encoding process of multiple slices per frame. * * More specifically, for H.264 encoding, this attribute * determines the range of accepted values to * VAEncSliceParameterBufferH264::macroblock_address and * VAEncSliceParameterBufferH264::num_macroblocks. * * See \c VA_ENC_SLICE_STRUCTURE_xxx for the supported slice * structure types.
*/
VAConfigAttribEncSliceStructure = 15, /** * \brief Macroblock information. Read-only. * * This attribute determines whether the driver supports extra * encoding information per-macroblock. e.g. QP. * * More specifically, for H.264 encoding, if the driver returns a non-zero * value for this attribute, this means the application can create * additional #VAEncMacroblockParameterBufferH264 buffers referenced * through VAEncSliceParameterBufferH264::macroblock_info.
*/
VAConfigAttribEncMacroblockInfo = 16, /** * \brief Maximum picture width. Read-only. * * This attribute determines the maximum picture width the driver supports * for a given configuration.
*/
VAConfigAttribMaxPictureWidth = 18, /** * \brief Maximum picture height. Read-only. * * This attribute determines the maximum picture height the driver supports * for a given configuration.
*/
VAConfigAttribMaxPictureHeight = 19, /** * \brief JPEG encoding attribute. Read-only. * * This attribute exposes a number of capabilities of the underlying * JPEG implementation. The attribute value is partitioned into fields as defined in the * VAConfigAttribValEncJPEG union.
*/
VAConfigAttribEncJPEG = 20, /** * \brief Encoding quality range attribute. Read-only. * * This attribute conveys whether the driver supports different quality level settings * for encoding. A value less than or equal to 1 means that the encoder only has a single * quality setting, and a value greater than 1 represents the number of quality levels * that can be configured. e.g. a value of 2 means there are two distinct quality levels.
*/
VAConfigAttribEncQualityRange = 21, /** * \brief Encoding quantization attribute. Read-only. * * This attribute conveys whether the driver supports certain types of quantization methods * for encoding (e.g. trellis). See \c VA_ENC_QUANTIZATION_xxx for the list of quantization methods
*/
VAConfigAttribEncQuantization = 22, /** * \brief Encoding intra refresh attribute. Read-only. * * This attribute conveys whether the driver supports certain types of intra refresh methods * for encoding (e.g. adaptive intra refresh or rolling intra refresh). * See \c VA_ENC_INTRA_REFRESH_xxx for intra refresh methods
*/
VAConfigAttribEncIntraRefresh = 23, /** * \brief Encoding skip frame attribute. Read-only. * * This attribute conveys whether the driver supports sending skip frame parameters * (VAEncMiscParameterTypeSkipFrame) to the encoder's rate control, when the user has * externally skipped frames.
*/
VAConfigAttribEncSkipFrame = 24, /** * \brief Encoding region-of-interest (ROI) attribute. Read-only. * * This attribute conveys whether the driver supports region-of-interest (ROI) encoding, * based on user provided ROI rectangles. The attribute value is partitioned into fields * as defined in the VAConfigAttribValEncROI union. * * If ROI encoding is supported, the ROI information is passed to the driver using * VAEncMiscParameterTypeROI.
*/
VAConfigAttribEncROI = 25, /** * \brief Encoding extended rate control attribute. Read-only. * * This attribute conveys whether the driver supports any extended rate control features * The attribute value is partitioned into fields as defined in the * VAConfigAttribValEncRateControlExt union.
*/
VAConfigAttribEncRateControlExt = 26, /** * \brief Processing rate reporting attribute. Read-only. * * This attribute conveys whether the driver supports reporting of * encode/decode processing rate based on certain set of parameters * (i.e. levels, I frame internvals) for a given configuration. * If this is supported, vaQueryProcessingRate() can be used to get * encode or decode processing rate. * See \c VA_PROCESSING_RATE_xxx for encode/decode processing rate
*/
VAConfigAttribProcessingRate = 27, /** * \brief Encoding dirty rectangle. Read-only. * * This attribute conveys whether the driver supports dirty rectangle. * encoding, based on user provided ROI rectangles which indicate the rectangular areas * where the content has changed as compared to the previous picture. The regions of the * picture that are not covered by dirty rect rectangles are assumed to have not changed * compared to the previous picture. The encoder may do some optimizations based on * this information. The attribute value returned indicates the number of regions that * are supported. e.g. A value of 0 means dirty rect encoding is not supported. If dirty * rect encoding is supported, the ROI information is passed to the driver using * VAEncMiscParameterTypeDirtyRect.
*/
VAConfigAttribEncDirtyRect = 28, /** * \brief Parallel Rate Control (hierachical B) attribute. Read-only. * * This attribute conveys whether the encoder supports parallel rate control. * It is a integer value 0 - unsupported, > 0 - maximum layer supported. * This is the way when hireachical B frames are encoded, multiple independent B frames * on the same layer may be processed at same time. If supported, app may enable it by * setting enable_parallel_brc in VAEncMiscParameterRateControl,and the number of B frames * per layer per GOP will be passed to driver through VAEncMiscParameterParallelRateControl * structure.Currently three layers are defined.
*/
VAConfigAttribEncParallelRateControl = 29, /** * \brief Dynamic Scaling Attribute. Read-only. * * This attribute conveys whether encoder is capable to determine dynamic frame * resolutions adaptive to bandwidth utilization and processing power, etc. * It is a boolean value 0 - unsupported, 1 - supported. * If it is supported,for VP9, suggested frame resolution can be retrieved from VACodedBufferVP9Status.
*/
VAConfigAttribEncDynamicScaling = 30, /** * \brief frame size tolerance support * it indicates the tolerance of frame size
*/
VAConfigAttribFrameSizeToleranceSupport = 31, /** * \brief Encode function type for FEI. * * This attribute conveys whether the driver supports different function types for encode. * It can be VA_FEI_FUNCTION_ENC, VA_FEI_FUNCTION_PAK, or VA_FEI_FUNCTION_ENC_PAK. Currently * it is for FEI entry point only. * Default is VA_FEI_FUNCTION_ENC_PAK.
*/
VAConfigAttribFEIFunctionType = 32, /** * \brief Maximum number of FEI MV predictors. Read-only. * * This attribute determines the maximum number of MV predictors the driver * can support to encode a single frame. 0 means no MV predictor is supported. * Currently it is for FEI entry point only.
*/
VAConfigAttribFEIMVPredictors = 33, /** * \brief Statistics attribute. Read-only. * * This attribute exposes a number of capabilities of the VAEntrypointStats entry * point. The attribute value is partitioned into fields as defined in the * VAConfigAttribValStats union. Currently it is for VAEntrypointStats only.
*/
VAConfigAttribStats = 34, /** * \brief Tile Support Attribute. Read-only. * * This attribute conveys whether encoder is capable to support tiles. * If not supported, the tile related parameters sent to encoder, such as * tiling structure, should be ignored. 0 - unsupported, 1 - supported.
*/
VAConfigAttribEncTileSupport = 35, /** * \brief whether accept rouding setting from application. Read-only. * This attribute is for encode quality, if it is report, * application can change the rounding setting by VAEncMiscParameterTypeCustomRoundingControl
*/
VAConfigAttribCustomRoundingControl = 36, /** * \brief Encoding QP info block size attribute. Read-only. * This attribute conveys the block sizes that underlying driver * support for QP info for buffer #VAEncQpBuffer.
*/
VAConfigAttribQPBlockSize = 37, /** * \brief encode max frame size attribute. Read-only * attribute value \c VAConfigAttribValMaxFrameSize represent max frame size support
*/
VAConfigAttribMaxFrameSize = 38, /** \brief inter frame prediction directrion attribute. Read-only. * this attribute conveys the prediction direction (backward or forword) for specific config * the value could be VA_PREDICTION_DIRECTION_XXXX. it can be combined with VAConfigAttribEncMaxRefFrames * to describe reference list , and the prediction direction. if this attrib is not present,both direction * should be supported, no restriction. * for example: normal HEVC encoding , maximum reference frame number in reflist 0 and reflist 1 is deduced * by VAConfigAttribEncMaxRefFrames. so there are typical P frame, B frame, * if VAConfigAttribPredictionDirection is also present. it will stipulate prediction direction in both * reference list. if only one prediction direction present(such as PREVIOUS),all reference frame should be * previous frame (PoC < current).
*/
VAConfigAttribPredictionDirection = 39, /** \brief combined submission of multiple frames from different streams, it is optimization for different HW * implementation, multiple frames encode/decode can improve HW concurrency
*/
VAConfigAttribMultipleFrame = 40, /** \brief priority setting for the context. Read-Write * attribute value is \c VAConfigAttribValContextPriority * this setting also could be update by \c VAContextParameterUpdateBuffer
*/
VAConfigAttribContextPriority = 41, /** \brief AV1 decoding features. Read-only. * * This attribute describes the supported features of an * AV1 decoder configuration. The value returned uses the * VAConfigAttribValDecAV1Features type.
*/
VAConfigAttribDecAV1Features = 42, /** \brief TEE could be any HW secure device. Read-only */
VAConfigAttribTEEType = 43, /** \brief TEE type client is a specific module supporting specific functions in TEE. Read-only*/
VAConfigAttribTEETypeClient = 44, /** * \brief Cipher algorithm of the protected content session. * * This attribute specifies the cipher algorithm of the protected content session. It * could be \c VA_PC_CIPHER_AES, etc....
*/
VAConfigAttribProtectedContentCipherAlgorithm = 45, /** * \brief Cipher block size of the protected content session. * * This attribute specifies the block size of the protected content session. It could be * \c VA_PC_BLOCK_SIZE_128, \c VA_PC_BLOCK_SIZE_192, or \c VA_PC_BLOCK_SIZE_256, etc....
*/
VAConfigAttribProtectedContentCipherBlockSize = 46, /** * \brief Cipher mode of the protected content session. * * This attribute specifies the cipher mode of the protected content session. It could * be \c VA_PC_CIPHER_MODE_ECB, \c VA_PC_CIPHER_MODE_CBC, \c VA_PC_CIPHER_MODE_CTR, etc...
*/
VAConfigAttribProtectedContentCipherMode = 47, /** * \brief Decryption sample type of the protected content session. * * This attribute specifies the decryption sample type of the protected content session. * It could be \c VA_PC_SAMPLE_TYPE_FULLSAMPLE or \c VA_PC_SAMPLE_TYPE_SUBSAMPLE.
*/
VAConfigAttribProtectedContentCipherSampleType = 48, /** * \brief Special usage attribute of the protected session. * * The attribute specifies the flow for the protected session could be used. For * example, it could be \c VA_PC_USAGE_DEFAULT, \c VA_PC_USAGE_WIDEVINE, etc....
*/
VAConfigAttribProtectedContentUsage = 49,
/** \brief HEVC/H.265 encoding features. Read-only. * * This attribute describes the supported features of an * HEVC/H.265 encoder configuration. The value returned uses the * VAConfigAttribValEncHEVCFeatures type. * * If this attribute is supported by a driver then it must also * support the VAConfigAttribEncHEVCBlockSizes attribute.
*/
VAConfigAttribEncHEVCFeatures = 50, /** \brief HEVC/H.265 encoding block sizes. Read-only. * * This attribute describes the supported coding tree and transform * block sizes of an HEVC/H.265 encoder configuration. The value * returned uses the VAConfigAttribValEncHEVCBlockSizes type. * * If this attribute is supported by a driver then it must also * support the VAConfigAttribEncHEVCFeatures attribute.
*/
VAConfigAttribEncHEVCBlockSizes = 51, /**@}*/
VAConfigAttribTypeMax
} VAConfigAttribType;
/** * Configuration attributes * If there is more than one value for an attribute, a default * value will be assigned to the attribute if the client does not * specify the attribute when creating a configuration
*/ typedefstruct _VAConfigAttrib {
VAConfigAttribType type;
uint32_t value; /* OR'd flags (bits) for this attribute */
} VAConfigAttrib;
/* Attribute values for VAConfigAttribRTFormat. */
#define VA_RT_FORMAT_RGB16 0x00010000 ///< Packed RGB, 16 bits per pixel. #define VA_RT_FORMAT_RGB32 0x00020000 ///< Packed RGB, 32 bits per pixel, 8 bits per colour sample. #define VA_RT_FORMAT_RGBP 0x00100000 ///< Planar RGB, 8 bits per sample. #define VA_RT_FORMAT_RGB32_10 0x00200000 ///< Packed RGB, 32 bits per pixel, 10 bits per colour sample.
#define VA_RT_FORMAT_PROTECTED 0x80000000
#define VA_RT_FORMAT_RGB32_10BPP VA_RT_FORMAT_RGB32_10 ///< @deprecated use VA_RT_FORMAT_RGB32_10 instead. #define VA_RT_FORMAT_YUV420_10BPP VA_RT_FORMAT_YUV420_10 ///< @deprecated use VA_RT_FORMAT_YUV420_10 instead.
/** @name Attribute values for VAConfigAttribRateControl */ /**@{*/ /** \brief Driver does not support any form of rate control. */ #define VA_RC_NONE 0x00000001 /** \brief Constant bitrate. */ #define VA_RC_CBR 0x00000002 /** \brief Variable bitrate. */ #define VA_RC_VBR 0x00000004 /** \brief Video conference mode. */ #define VA_RC_VCM 0x00000008 /** \brief Constant QP. */ #define VA_RC_CQP 0x00000010 /** \brief Variable bitrate with peak rate higher than average bitrate. */ #define VA_RC_VBR_CONSTRAINED 0x00000020 /** \brief Intelligent Constant Quality. Provided an initial ICQ_quality_factor,
* adjusts QP at a frame and MB level based on motion to improve subjective quality. */ #define VA_RC_ICQ 0x00000040 /** \brief Macroblock based rate control. Per MB control is decided
* internally in the encoder. It may be combined with other RC modes, except CQP. */ #define VA_RC_MB 0x00000080 /** \brief Constant Frame Size, it is used for small tolerent */ #define VA_RC_CFS 0x00000100 /** \brief Parallel BRC, for hierachical B. * * For hierachical B, B frames can be refered by other B frames. * Currently three layers of hierachy are defined: * B0 - regular B, no reference to other B frames. * B1 - reference to only I, P and regular B0 frames. * B2 - reference to any other frames, including B1. * In Hierachical B structure, B frames on the same layer can be processed * simultaneously. And BRC would adjust accordingly. This is so called
* Parallel BRC. */ #define VA_RC_PARALLEL 0x00000200 /** \brief Quality defined VBR * Use Quality factor to determine the good enough QP for each MB such that * good enough quality can be obtained without waste of bits * for this BRC mode, you must set all legacy VBR parameters * and reuse quality_factor in \c VAEncMiscParameterRateControl
* */ #define VA_RC_QVBR 0x00000400 /** \brief Average VBR * Average variable bitrate control algorithm focuses on overall encoding * quality while meeting the specified target bitrate, within the accuracy * range, after a convergence period. * bits_per_second in VAEncMiscParameterRateControl is target bitrate for AVBR. * Convergence is specified in the unit of frame. * window_size in VAEncMiscParameterRateControl is equal to convergence for AVBR. * Accuracy is in the range of [1,100], 1 means one percent, and so on. * target_percentage in VAEncMiscParameterRateControl is equal to accuracy for AVBR.
* */ #define VA_RC_AVBR 0x00000800 /** \brief Transport Controlled BRC * Specific bitrate control for real time streaming. * TCBRC can instantly react to channel change to remove or significantly reduce the delay. * Application (transport) provides channel feedback to driver through TargetFrameSize. * When channel condition is very good (almost no constraint on instant frame size), * the app should set target frame size as zero. Otherwise, channel capacity divided by fps * should be used.
* */ #define VA_RC_TCBRC 0x00001000
/**@}*/
/** @name Attribute values for VAConfigAttribDecSliceMode */ /**@{*/ /** \brief Driver supports normal mode for slice decoding */ #define VA_DEC_SLICE_MODE_NORMAL 0x00000001 /** \brief Driver supports base mode for slice decoding */ #define VA_DEC_SLICE_MODE_BASE 0x00000002
/** @name Attribute values for VAConfigAttribDecJPEG */ /**@{*/ typedefunion _VAConfigAttribValDecJPEG { struct { /** \brief Set to (1 << VA_ROTATION_xxx) for supported rotation angles. */
uint32_t rotation : 4; /** \brief Reserved for future use. */
uint32_t reserved : 28;
} bits;
uint32_t value;
} VAConfigAttribValDecJPEG; /** @name Attribute values for VAConfigAttribDecProcessing */ /**@{*/ /** \brief No decoding + processing in a single decoding call. */ #define VA_DEC_PROCESSING_NONE 0x00000000 /** \brief Decode + processing in a single decoding call. */ #define VA_DEC_PROCESSING 0x00000001 /**@}*/
/** @name Attribute values for VAConfigAttribEncPackedHeaders */ /**@{*/ /** \brief Driver does not support any packed headers mode. */ #define VA_ENC_PACKED_HEADER_NONE 0x00000000 /** * \brief Driver supports packed sequence headers. e.g. SPS for H.264. * * Application must provide it to driver once this flag is returned through * vaGetConfigAttributes()
*/ #define VA_ENC_PACKED_HEADER_SEQUENCE 0x00000001 /** * \brief Driver supports packed picture headers. e.g. PPS for H.264. * * Application must provide it to driver once this falg is returned through * vaGetConfigAttributes()
*/ #define VA_ENC_PACKED_HEADER_PICTURE 0x00000002 /** * \brief Driver supports packed slice headers. e.g. slice_header() for H.264. * * Application must provide it to driver once this flag is returned through * vaGetConfigAttributes()
*/ #define VA_ENC_PACKED_HEADER_SLICE 0x00000004 /** * \brief Driver supports misc packed headers. e.g. SEI for H.264. * * @deprecated * This is a deprecated packed header flag, All applications can use * \c VA_ENC_PACKED_HEADER_RAW_DATA to pass the corresponding packed * header data buffer to the driver
*/ #define VA_ENC_PACKED_HEADER_MISC 0x00000008 /** \brief Driver supports raw packed header, see VAEncPackedHeaderRawData */ #define VA_ENC_PACKED_HEADER_RAW_DATA 0x00000010 /**@}*/
/** @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 * for all slices except for the last one, which must be equal or smaller
* 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 * if max_frame_size == 1, VAEncMiscParameterTypeMaxFrameSize/VAEncMiscParameterBufferMaxFrameSize * could be used to set the frame size, if multiple_pass also equal 1, VAEncMiscParameterTypeMultiPassFrameSize * VAEncMiscParameterBufferMultiPassFrameSize could be used to set frame size and pass information
*/
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) * can work with the VAConfigAttribEncMaxRefFrames. for example: low delay B frame of HEVC. * these value can be OR'd together. typical value should be VA_PREDICTION_DIRECTION_PREVIOUS * or VA_PREDICTION_DIRECTION_PREVIOUS | VA_PREDICTION_DIRECTION_FUTURE, theoretically, there * are no stream only include future reference frame.
*/ #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; /** * \brief A flag indicates whether ROI priority is supported * * \ref roi_rc_priority_support equal to 1 specifies the underlying driver supports * ROI priority when VAConfigAttribRateControl != VA_RC_CQP, user can use \c roi_value * in #VAEncROI to set ROI priority. \ref roi_rc_priority_support equal to 0 specifies * the underlying driver doesn't support ROI priority. * * User should ignore \ref roi_rc_priority_support when VAConfigAttribRateControl == VA_RC_CQP * because ROI delta QP is always required when VAConfigAttribRateControl == VA_RC_CQP.
*/
uint32_t roi_rc_priority_support : 1; /** * \brief A flag indicates whether ROI delta QP is supported * * \ref roi_rc_qp_delta_support equal to 1 specifies the underlying driver supports * ROI delta QP when VAConfigAttribRateControl != VA_RC_CQP, user can use \c roi_value * in #VAEncROI to set ROI delta QP. \ref roi_rc_qp_delta_support equal to 0 specifies * the underlying driver doesn't support ROI delta QP. * * User should ignore \ref roi_rc_qp_delta_support when VAConfigAttribRateControl == VA_RC_CQP * because ROI delta QP is always required when VAConfigAttribRateControl == VA_RC_CQP.
*/
uint32_t roi_rc_qp_delta_support : 1;
uint32_t reserved : 22;
} bits;
uint32_t value;
} VAConfigAttribValEncROI;
/** \brief Attribute value for VAConfigAttribEncRateControlExt */ typedefunion _VAConfigAttribValEncRateControlExt { struct { /** * \brief The maximum number of temporal layers minus 1 * * \ref max_num_temporal_layers_minus1 plus 1 specifies the maximum number of temporal * layers that supported by the underlying driver. \ref max_num_temporal_layers_minus1 * equal to 0 implies the underlying driver doesn't support encoding with temporal layer.
*/
uint32_t max_num_temporal_layers_minus1 : 8;
/** * /brief support temporal layer bit-rate control flag * * \ref temporal_layer_bitrate_control_flag equal to 1 specifies the underlying driver * can support bit-rate control per temporal layer when (#VAConfigAttribRateControl == #VA_RC_CBR || * #VAConfigAttribRateControl == #VA_RC_VBR). * * The underlying driver must set \ref temporal_layer_bitrate_control_flag to 0 when * \c max_num_temporal_layers_minus1 is equal to 0 * * To use bit-rate control per temporal layer, an application must send the right layer * structure via #VAEncMiscParameterTemporalLayerStructure at the beginning of a coded sequence * and then followed by #VAEncMiscParameterRateControl and #VAEncMiscParameterFrameRate structures * for each layer, using the \c temporal_id field as the layer identifier. Otherwise * the driver doesn't use bitrate control per temporal layer if an application doesn't send the * layer structure via #VAEncMiscParameterTemporalLayerStructure to the driver. The driver returns * VA_STATUS_ERROR_INVALID_PARAMETER if an application sends a wrong layer structure or doesn't send * #VAEncMiscParameterRateControl and #VAEncMiscParameterFrameRate for each layer. * * The driver will ignore #VAEncMiscParameterTemporalLayerStructure and the \c temporal_id field * in #VAEncMiscParameterRateControl and #VAEncMiscParameterFrameRate if * \ref temporal_layer_bitrate_control_flag is equal to 0 or #VAConfigAttribRateControl == #VA_RC_CQP
*/
uint32_t temporal_layer_bitrate_control_flag : 1;
uint32_t reserved : 23;
} bits;
uint32_t value;
} VAConfigAttribValEncRateControlExt;
/** \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 * if mixed_quality_level == 0, same quality level setting for multple streams is required
* 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;
/** @name Attribute values for VAConfigAttribProcessingRate. */ /**@{*/ /** \brief Driver does not support processing rate report */ #define VA_PROCESSING_RATE_NONE 0x00000000 /** \brief Driver supports encode processing rate report */ #define VA_PROCESSING_RATE_ENCODE 0x00000001 /** \brief Driver supports decode processing rate report */ #define VA_PROCESSING_RATE_DECODE 0x00000002 /**@}*/ /** * if an attribute is not applicable for a given * profile/entrypoint pair, then set the value to the following
*/ #define VA_ATTRIB_NOT_SUPPORTED 0x80000000
/** Get maximum number of profiles supported by the implementation */ int vaMaxNumProfiles(
VADisplay dpy
);
/** Get maximum number of entrypoints supported by the implementation */ int vaMaxNumEntrypoints(
VADisplay dpy
);
/** Get maximum number of attributs supported by the implementation */ int vaMaxNumConfigAttributes(
VADisplay dpy
);
/** * Query supported profiles * The caller must provide a "profile_list" array that can hold at * least vaMaxNumProfile() entries. The actual number of profiles * returned in "profile_list" is returned in "num_profile".
*/
VAStatus vaQueryConfigProfiles(
VADisplay dpy,
VAProfile *profile_list, /* out */ int *num_profiles /* out */
);
/** * Query supported entrypoints for a given profile * The caller must provide an "entrypoint_list" array that can hold at * least vaMaxNumEntrypoints() entries. The actual number of entrypoints * returned in "entrypoint_list" is returned in "num_entrypoints".
*/
VAStatus vaQueryConfigEntrypoints(
VADisplay dpy,
VAProfile profile,
VAEntrypoint *entrypoint_list, /* out */ int *num_entrypoints /* out */
);
/** * Get attributes for a given profile/entrypoint pair * The caller must provide an "attrib_list" with all attributes to be * retrieved. Upon return, the attributes in "attrib_list" have been * updated with their value. Unknown attributes or attributes that are * not supported for the given profile/entrypoint pair will have their * value set to VA_ATTRIB_NOT_SUPPORTED
*/
VAStatus vaGetConfigAttributes(
VADisplay dpy,
VAProfile profile,
VAEntrypoint entrypoint,
VAConfigAttrib *attrib_list, /* in/out */ int num_attribs
);
/** Generic ID type, can be re-typed for specific implementation */ typedefunsignedint VAGenericID;
typedef VAGenericID VAConfigID;
/** * Create a configuration for the video decode/encode/processing pipeline * it passes in the attribute list that specifies the attributes it cares * about, with the rest taking default values.
*/
VAStatus vaCreateConfig(
VADisplay dpy,
VAProfile profile,
VAEntrypoint entrypoint,
VAConfigAttrib *attrib_list, int num_attribs,
VAConfigID *config_id /* out */
);
/** * Free resources associdated with a given config
*/
VAStatus vaDestroyConfig(
VADisplay dpy,
VAConfigID config_id
);
/** * Query all attributes for a given configuration * The profile of the configuration is returned in "profile" * The entrypoint of the configuration is returned in "entrypoint" * The caller must provide an "attrib_list" array that can hold at least * vaMaxNumConfigAttributes() entries. The actual number of attributes * returned in "attrib_list" is returned in "num_attribs"
*/
VAStatus vaQueryConfigAttributes(
VADisplay dpy,
--> --------------------
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.