From 6c16be92c56a8f136790510e06817a21241c9fe9 Mon Sep 17 00:00:00 2001 From: Jonathan Bian Date: Thu, 13 Jun 2013 22:04:30 -0700 Subject: Added VAConfigEncQualityRange attribute and VAEncMiscParameterBufferQualityLevel to support encoder quality settings. (cherry picked from commit 24a14f9d13e6fe0c25d4094c4884aa4076ed05bc) Conflicts: va/va.h --- va/va.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/va/va.h b/va/va.h index 979328a..adb0d6e 100644 --- a/va/va.h +++ b/va/va.h @@ -386,6 +386,15 @@ typedef enum * through VAEncSliceParameterBufferH264::macroblock_info. */ VAConfigAttribEncMacroblockInfo = 16, + /** + * \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, /**@}*/ VAConfigAttribTypeMax } VAConfigAttribType; @@ -939,6 +948,7 @@ typedef enum VAEncMiscParameterTypeMaxFrameSize = 4, /** \brief Buffer type used for HRD parameters. */ VAEncMiscParameterTypeHRD = 5, + VAEncMiscParameterTypeQualityLevel = 6, } VAEncMiscParameterType; /** \brief Packed header type. */ @@ -1071,6 +1081,22 @@ typedef struct _VAEncMiscParameterBufferMaxFrameSize { } VAEncMiscParameterBufferMaxFrameSize; /** + * \brief Encoding quality level. + * + * The encoding quality could be set through this structure, if the implementation + * supports multiple quality levels. The quality level set through this structure is + * persistent over the entire coded sequence, or until a new structure is being sent. + * The quality level range can be queried through the VAConfigAttribEncQualityRange + * attribute. A lower value means higher quality, and a value of 1 represents the highest + * quality. The quality level setting is used as a trade-off between quality and speed/power + * consumption, with higher quality corresponds to lower speed and higher power consumption. + */ +typedef struct _VAEncMiscParameterBufferQualityLevel { + /** \brief Encoding quality level setting. */ + unsigned int quality_level; +} VAEncMiscParameterBufferQualityLevel; + +/* * There will be cases where the bitstream buffer will not have enough room to hold * the data for the entire slice, and the following flags will be used in the slice * parameter to signal to the server for the possible cases. -- cgit v1.2.1