+ * \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. When set to 0, default quality
+ * level is used.
+ */
+ unsigned int quality_level;
+} VAEncMiscParameterBufferQualityLevel;
+
+/**
+ * \brief Encoding skip frame.
+ *
+ * The application may choose to skip frames externally to the encoder (e.g. drop completely or
+ * code as all skip's). For rate control purposes the encoder will need to know the size and number
+ * of skipped frames. Skip frame(s) indicated through this structure is applicable only to the
+ * current frame. It is allowed for the application to still send in packed headers for the driver to
+ * pack, although no frame will be encoded (e.g. for HW to encrypt the frame).
+ */
+typedef struct _VAEncMiscParameterSkipFrame {
+ /** \brief Indicates skip frames as below.
+ * 0: Encode as normal, no skip.
+ * 1: One or more frames were skipped prior to the current frame, encode the current frame as normal.
+ * 2: The current frame is to be skipped, do not encode it but pack/encrypt the packed header contents
+ * (all except VAEncPackedHeaderSlice) which could contain actual frame contents (e.g. pack the frame
+ * in VAEncPackedHeaderPicture). */
+ unsigned char skip_frame_flag;
+ /** \brief The number of frames skipped prior to the current frame. Valid when skip_frame_flag = 1. */
+ unsigned char 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. */
+ unsigned int size_skip_frames;
+} VAEncMiscParameterSkipFrame;
+
+/**
+ * \brief Encoding region-of-interest (ROI).
+ *
+ * The encoding ROI can be set through VAEncMiscParameterBufferROI, if the implementation
+ * supports ROI input. The ROI set through this structure is applicable only to the
+ * current frame or field, so must be sent every frame or field to be applied. The number of
+ * supported ROIs can be queried through the VAConfigAttribEncROI. The encoder will use the
+ * ROI information to adjust the QP values of the MB's that fall within the ROIs.
+ */
+typedef struct _VAEncROI
+{
+ /** \brief Defines the ROI boundary in pixels, the driver will map it to appropriate
+ * codec coding units. It is relative to frame coordinates for the frame case and
+ * to field coordinates for the field case. */
+ VARectangle roi_rectangle;
+ /**
+ * \brief ROI value
+ *
+ * \ref roi_value specifies ROI delta QP or ROI priority.
+ * -- ROI delta QP is the value that will be added on top of the frame level QP.
+ * -- ROI priority specifies the priority of a region, it can be positive (more important)
+ * or negative (less important) values and is compared with non-ROI region (taken as value 0),
+ * E.g. ROI region with \ref roi_value -3 is less important than the non-ROI region (\ref roi_value
+ * implied to be 0) which is less important than ROI region with roi_value +2. For overlapping
+ * regions, the roi_value that is first in the ROI array will have priority.
+ *
+ * \ref roi_value always specifes ROI delta QP when VAConfigAttribRateControl == VA_RC_CQP, no matter
+ * the value of \c roi_value_is_qp_delta in #VAEncMiscParameterBufferROI.
+ *
+ * \ref roi_value depends on \c roi_value_is_qp_delta in #VAEncMiscParameterBufferROI when
+ * VAConfigAttribRateControl != VA_RC_CQP. \ref roi_value specifies ROI_delta QP if \c roi_value_is_qp_delta
+ * in VAEncMiscParameterBufferROI is 1, otherwise \ref roi_value specifies ROI priority.
+ */
+ char roi_value;
+} VAEncROI;
+
+typedef struct _VAEncMiscParameterBufferROI {
+ /** \brief Number of ROIs being sent.*/
+ unsigned int num_roi;
+
+ /** \brief Valid when VAConfigAttribRateControl != VA_RC_CQP, then the encoder's
+ * rate control will determine actual delta QPs. Specifies the max/min allowed delta
+ * QPs. */
+ char max_delta_qp;
+ char 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 {
+ /**
+ * \brief An indication for roi value.
+ *
+ * \ref roi_value_is_qp_delta equal to 1 indicates \c roi_value in #VAEncROI should
+ * be used as ROI delta QP. \ref roi_value_is_qp_delta equal to 0 indicates \c roi_value
+ * in #VAEncROI should be used as ROI priority.
+ *
+ * \ref roi_value_is_qp_delta is only available when VAConfigAttribRateControl != VA_RC_CQP,
+ * the setting must comply with \c roi_rc_priority_support and \c roi_rc_qp_delat_support in
+ * #VAConfigAttribValEncROI. The underlying driver should ignore this field
+ * when VAConfigAttribRateControl == VA_RC_CQP.
+ */
+ uint32_t roi_value_is_qp_delta : 1;
+ uint32_t reserved : 31;
+ } bits;
+ uint32_t value;
+ } roi_flags;
+} VAEncMiscParameterBufferROI;
+
+/**