• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

hardware/intel/libva


Commit MetaInfo

Révision48f89886953f1e311f2dc2a8ca45092f8eb7d2b8 (tree)
l'heure2016-05-09 17:48:52
Auteurpylee <penne.y.lee@inte...>
CommiterXiang, Haihao

Message de Log

Merge ROI patches from staging branch

Cherry-pick'ed from:
26cc3b0: Add Region-of-Interest (ROI) support for encoder based on user provided ROI rectangles.
84b90a3: ROI updates for encoder.

Signed-off-by: pylee <penne.y.lee@intel.com>
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Reviewed-By: Sean V Kelley <sean.v.kelley@intel.com>

Change Summary

Modification

--- a/va/va.h
+++ b/va/va.h
@@ -222,6 +222,14 @@ typedef int VAStatus; /** Return status type from functions */
222222 */
223223 const char *vaErrorStr(VAStatus error_status);
224224
225+typedef struct _VARectangle
226+{
227+ short x;
228+ short y;
229+ unsigned short width;
230+ unsigned short height;
231+} VARectangle;
232+
225233 /**
226234 * Initialization:
227235 * A display must be obtained by calling vaGetDisplay() before calling
@@ -452,6 +460,17 @@ typedef enum
452460 * externally skipped frames.
453461 */
454462 VAConfigAttribEncSkipFrame = 24,
463+ /**
464+ * \brief Encoding region-of-interest (ROI) attribute. Read-only.
465+ *
466+ * This attribute conveys whether the driver supports region-of-interest (ROI) encoding,
467+ * based on user provided ROI rectangles. The attribute value is partitioned into fields
468+ * as defined in the VAConfigAttribValEncROI union.
469+ *
470+ * If ROI encoding is supported, the ROI information is passed to the driver using
471+ * VAEncMiscParameterTypeROI.
472+ */
473+ VAConfigAttribEncROI = 25,
455474 /**@}*/
456475 VAConfigAttribTypeMax
457476 } VAConfigAttribType;
@@ -565,6 +584,21 @@ typedef union _VAConfigAttribValEncJPEG {
565584 unsigned int value;
566585 } VAConfigAttribValEncJPEG;
567586
587+/** \brief Attribute value for VAConfigAttribEncROI */
588+typedef union _VAConfigAttribValEncROI {
589+ struct {
590+ /** \brief The number of ROI regions supported, 0 if ROI is not supported. */
591+ unsigned int num_roi_regions : 8;
592+ /** \brief Indicates if ROI priority indication is supported when
593+ * VAConfigAttribRateControl != VA_RC_CQP, else only ROI delta QP added on top of
594+ * the frame level QP is supported when VAConfigAttribRateControl == VA_RC_CQP.
595+ */
596+ unsigned int roi_rc_priority_support : 1;
597+ unsigned int reserved : 23;
598+ } bits;
599+ unsigned int value;
600+} VAConfigAttribValEncROI;
601+
568602 /**
569603 * if an attribute is not applicable for a given
570604 * profile/entrypoint pair, then set the value to the following
@@ -1038,7 +1072,9 @@ typedef enum
10381072 VAEncMiscParameterTypeQualityLevel = 6,
10391073 /** \brief Buffer type used for sending skip frame parameters to the encoder's
10401074 * rate control, when the user has externally skipped frames. */
1041- VAEncMiscParameterTypeSkipFrame = 9
1075+ VAEncMiscParameterTypeSkipFrame = 9,
1076+ /** \brief Buffer type used for region-of-interest (ROI) parameters. */
1077+ VAEncMiscParameterTypeROI = 10
10421078 } VAEncMiscParameterType;
10431079
10441080 /** \brief Packed header type. */
@@ -1212,7 +1248,49 @@ typedef struct _VAEncMiscParameterSkipFrame {
12121248 unsigned int size_skip_frames;
12131249 } VAEncMiscParameterSkipFrame;
12141250
1215-/*
1251+/**
1252+ * \brief Encoding region-of-interest (ROI).
1253+ *
1254+ * The encoding ROI can be set through VAEncMiscParameterBufferROI, if the implementation
1255+ * supports ROI input. The ROI set through this structure is applicable only to the
1256+ * current frame or field, so must be sent every frame or field to be applied. The number of
1257+ * supported ROIs can be queried through the VAConfigAttribEncROI. The encoder will use the
1258+ * ROI information to adjust the QP values of the MB's that fall within the ROIs.
1259+ */
1260+typedef struct _VAEncROI
1261+{
1262+ /** \brief Defines the ROI boundary in pixels, the driver will map it to appropriate
1263+ * codec coding units. It is relative to frame coordinates for the frame case and
1264+ * to field coordinates for the field case. */
1265+ VARectangle roi_rectangle;
1266+ /** \brief When VAConfigAttribRateControl == VA_RC_CQP then roi_value specifes the
1267+ * delta QP that will be added on top of the frame level QP. For other rate control
1268+ * modes, roi_value specifies the priority of the ROI region relative to the non-ROI
1269+ * region. It can be positive (more important) or negative (less important) values
1270+ * and is compared with non-ROI region (taken as value 0).
1271+ * E.g. ROI region with roi_value -3 is less important than the non-ROI region
1272+ * (roi_value implied to be 0) which is less important than ROI region with
1273+ * roi_value +2. For overlapping regions, the roi_value that is first in the ROI
1274+ * array will have priority. */
1275+ char roi_value;
1276+} VAEncROI;
1277+
1278+typedef struct _VAEncMiscParameterBufferROI {
1279+ /** \brief Number of ROIs being sent.*/
1280+ unsigned int num_roi;
1281+
1282+ /** \brief Valid when VAConfigAttribRateControl != VA_RC_CQP, then the encoder's
1283+ * rate control will determine actual delta QPs. Specifies the max/min allowed delta
1284+ * QPs. */
1285+ char max_delta_qp;
1286+ char min_delta_qp;
1287+
1288+ /** \brief Pointer to a VAEncROI array with num_roi elements. It is relative to frame
1289+ * coordinates for the frame case and to field coordinates for the field case.*/
1290+ VAEncROI *roi;
1291+} VAEncMiscParameterBufferROI;
1292+
1293+/**
12161294 * There will be cases where the bitstream buffer will not have enough room to hold
12171295 * the data for the entire slice, and the following flags will be used in the slice
12181296 * parameter to signal to the server for the possible cases.
@@ -2618,14 +2696,6 @@ VAStatus vaDeassociateSubpicture (
26182696 int num_surfaces
26192697 );
26202698
2621-typedef struct _VARectangle
2622-{
2623- short x;
2624- short y;
2625- unsigned short width;
2626- unsigned short height;
2627-} VARectangle;
2628-
26292699 /**
26302700 * Display attributes
26312701 * Display attributes are used to control things such as contrast, hue, saturation,