summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Yuan <shengquan.yuan@intel.com>2014-07-22 14:25:23 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-07-22 14:25:23 +0000
commitdae2485cf87fe6f346ecc6efe9a8f29d5cf28aca (patch)
tree685e25e672ef93d8bdfaf6aa6fbeedbba7796f47
parentf930014b887c50193bdb00acb232312c743bac4a (diff)
parentc372815c7a2fb0e0b7fe89391eeca9a96a368b04 (diff)
downloadlibva-dae2485cf87fe6f346ecc6efe9a8f29d5cf28aca.tar.gz
am c372815c: sync with latest fdo version
* commit 'c372815c7a2fb0e0b7fe89391eeca9a96a368b04': sync with latest fdo version
-rwxr-xr-xva/va.h131
-rw-r--r--va/va_enc_vp8.h33
-rw-r--r--va/va_vpp.h47
3 files changed, 179 insertions, 32 deletions
diff --git a/va/va.h b/va/va.h
index cfd1508..06c7790 100755
--- a/va/va.h
+++ b/va/va.h
@@ -220,6 +220,14 @@ typedef int VAStatus; /* Return status type from functions */
*/
const char *vaErrorStr(VAStatus error_status);
+typedef struct _VARectangle
+{
+ short x;
+ short y;
+ unsigned short width;
+ unsigned short height;
+} VARectangle;
+
/*
* Initialization:
* A display must be obtained by calling vaGetDisplay() before calling
@@ -307,6 +315,15 @@ typedef enum
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. */
VAEntrypointMax
} VAEntrypoint;
@@ -464,6 +481,25 @@ typedef enum
* for encoding (e.g. adaptive intra refresh or rolling intra refresh).
*/
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 returned indicates the number
+ * of regions that are supported. e.g. A value of 0 means ROI encoding is not supported.
+ * If ROI encoding is supported, the ROI information is passed to the driver using
+ * VAEncMiscParameterTypeRoi.
+ */
+ VAConfigAttribEncRoi = 25,
+
/**@}*/
VAConfigAttribTypeMax
} VAConfigAttribType;
@@ -505,7 +541,12 @@ typedef struct _VAConfigAttrib {
#define VA_RC_CQP 0x00000010
/** \brief Variable bitrate with peak rate higher than average bitrate. */
#define VA_RC_VBR_CONSTRAINED 0x00000020
+/** \brief Constant rate factor. */
#define VA_RC_CRF 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
+
/**@}*/
/** @name Attribute values for VAConfigAttribDecSliceMode */
@@ -789,6 +830,9 @@ typedef enum {
VASurfaceAttribMemoryType,
/** \brief External buffer descriptor (pointer, write). */
VASurfaceAttribExternalBufferDescriptor,
+ /** \brief Surface usage hint, gives the driver a hint of intended usage
+ * to optimize allocation (e.g. tiling) (int, read/write). */
+ VASurfaceAttribUsageHint,
/** \brief Number of surface attributes. */
VASurfaceAttribCount
} VASurfaceAttribType;
@@ -860,6 +904,21 @@ typedef struct _VASurfaceAttribExternalBuffers {
/** \brief Memory is protected */
#define VA_SURFACE_EXTBUF_DESC_PROTECTED 0x80000000
+/** @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
+
/**@}*/
/**
@@ -1051,6 +1110,11 @@ typedef enum
VAEncMiscParameterTypeQualityLevel = 6,
VAEncMiscParameterTypeRIR = 7,
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
} VAEncMiscParameterType;
/** \brief Packed header type. */
@@ -1137,6 +1201,7 @@ typedef struct _VAEncMiscParameterRateControl
unsigned int reset : 1;
unsigned int disable_frame_skip : 1; /* Disable frame skip in rate control mode */
unsigned int disable_bit_stuffing : 1; /* Disable bit stuffing in rate control mode */
+ unsigned int mb_rate_control : 4; /* Control VA_RC_MB 0: default, 1: enable, 2: disable, other: reserved*/
} bits;
unsigned int value;
} rc_flags;
@@ -1288,6 +1353,64 @@ typedef struct _VAEncMiscParameterQuantization
} quantization_flags;
} VAEncMiscParameterQuantization;
+/**
+ * \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 this structure, if the implementation
+ * supports ROI input. The ROI set through this structure is applicable only to the
+ * current frame. 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 _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.*/
+ struct VAEncROI
+ {
+ /** \brief Defines the ROI boundary in pixels, the driver will map it to appropriate
+ * codec coding units. It is relative to the frame coordinates for both frame and field cases. */
+ VARectangle roi_rectangle;
+ /** \brief When VAConfigAttribRateControl == VA_RC_CQP then roi_value specifes the delta QP that
+ * will be added on top of the frame level QP. For other rate control modes, roi_value specifies the
+ * priority of the ROI region relative to the non-ROI region. It can positive (more important) or
+ * negative (less important) values and is compared with non-ROI region (taken as value 0).
+ * E.g. ROI region with roi_value -3 is less important than the non-ROI region (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. */
+ char roi_value;
+ } *ROI;
+} VAEncMiscParameterBufferROI;
+
/*
* 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
@@ -2677,14 +2800,6 @@ VAStatus vaDeassociateSubpicture (
int num_surfaces
);
-typedef struct _VARectangle
-{
- short x;
- short y;
- unsigned short width;
- unsigned short height;
-} VARectangle;
-
/*
* Display attributes
* Display attributes are used to control things such as contrast, hue, saturation,
diff --git a/va/va_enc_vp8.h b/va/va_enc_vp8.h
index ee0335b..1c46967 100644
--- a/va/va_enc_vp8.h
+++ b/va/va_enc_vp8.h
@@ -281,30 +281,6 @@ typedef struct _VAEncPictureParameterBufferVP8
} VAEncPictureParameterBufferVP8;
-
-/**
- * \brief VP8 MB Segmentation ID Buffer
- *
- * application provides buffer containing the initial segmentation id for each
- * MB, in raster scan order. Rate control may reassign it.
- * For an 640x480 video, the buffer has 1200 entries.
- * the value of each entry should be in the range [0..3], inclusive.
- * If segmentation is not enabled, application does not need to provide it.
- */
-typedef struct _VAEncMBMapBufferVP8
-{
- /**
- * number of MBs in the frame.
- * It is also the number of entries of mb_segment_id[];
- */
- unsigned int num_mbs;
- /**
- * per MB Segmentation ID Buffer
- */
- unsigned char *mb_segment_id;
-} VAEncMBMapBufferVP8;
-
-
/**
* \brief VP8 Quantization Matrix Buffer Structure
*
@@ -319,6 +295,15 @@ typedef struct _VAQMatrixBufferVP8
short quantization_index_delta[5];
} VAQMatrixBufferVP8;
+/**
+ * \brief VP8 MB Segmentation ID Buffer
+ *
+ * The application provides a buffer of VAEncMacroblockMapBufferType containing
+ * the initial segmentation id for each MB, one byte each, in raster scan order.
+ * Rate control may reassign it. For example, a 640x480 video, the buffer has 1200 entries.
+ * The value of each entry should be in the range [0..3], inclusive.
+ * If segmentation is not enabled, the application does not need to provide it.
+ */
/**@}*/
diff --git a/va/va_vpp.h b/va/va_vpp.h
index 4d1b395..637ccf9 100644
--- a/va/va_vpp.h
+++ b/va/va_vpp.h
@@ -255,6 +255,8 @@ typedef enum _VAProcFilterType {
VAProcFilterTotalColorCorrection,
/** \brief Non-Linear Anamorphic Scaling. */
VAProcFilterNonLinearAnamorphicScaling,
+ /** \brief Image Stabilization. */
+ VAProcFilterImageStabilization,
/** \brief Number of video filters. */
VAProcFilterCount
} VAProcFilterType;
@@ -343,6 +345,19 @@ typedef enum _VAProcTotalColorCorrectionType {
VAProcTotalColorCorrectionCount
} VAProcTotalColorCorrectionType;
+/** \brief ImageStabilization Types. */
+typedef enum _VAProcImageStabilizationType {
+ VAProcImageStabilizationTypeNone = 0,
+ /** \brief Mode Crop - crops the frame by the app provided percentage. */
+ VAProcImageStabilizationTypeCrop,
+ /** \brief Mode Crop Min Zoom - crops and then upscales the frame to half the black boundary. */
+ VAProcImageStabilizationTypeMinZoom,
+ /** \brief Mode Crop Full Zoom - crops and upscales the frame to original size. */
+ VAProcImageStabilizationTypeFullZoom,
+ /** \brief Number of Image Stabilization Type. */
+ VAProcImageStabilizationTypeCount
+} VAProcImageStabilizationType;
+
/** @name Video blending flags */
/**@{*/
/** \brief Global alpha blending. */
@@ -821,6 +836,26 @@ typedef struct _VAProcFilterParameterBufferTotalColorCorrection {
float value;
} VAProcFilterParameterBufferTotalColorCorrection;
+/** @name ImageStabilization Perf Types. */
+/**@{*/
+/** \brief Fast Mode. */
+#define VA_IMAGE_STABILIZATION_PERF_TYPE_FAST 0x0001
+ /** \brief Quality Mode. */
+#define VA_IMAGE_STABILIZATION_PERF_TYPE_QUALITY 0x0002
+/**@}*/
+
+/** \brief Image Stabilization filter parametrization. */
+typedef struct _VAProcFilterParameterBufferImageStabilization {
+ /** \brief Filter type. Shall be set to #VAProcFilterImageStabilization. */
+ VAProcFilterType type;
+ /** \brief Image Stabilization Mode. */
+ VAProcImageStabilizationType mode;
+ /** \brief Image Stabilization Crop percentage. */
+ float crop;
+ /** \brief Image Stabilization Perf type. */
+ unsigned int perf_type;
+} VAProcFilterParameterBufferImageStabilization;
+
/** \brief Non-Linear Anamorphic Scaling filter parametrization. */
typedef struct _VAProcFilterParameterBufferNonLinearAnamorphicScaling {
/** \brief filter type. Shall be set to #VAProcFilterNonLinearAnamorphicScaling. */
@@ -866,6 +901,18 @@ typedef struct _VAProcFilterCapTotalColorCorrection {
VAProcFilterValueRange range;
} VAProcFilterCapTotalColorCorrection;
+/** \brief Capabilities specification for the Image Stabilization filter. */
+typedef struct _VAProcFilterCapImageStabilization {
+ /** \brief IS modes supported. */
+ VAProcImageStabilizationType type[VAProcImageStabilizationTypeCount];
+ /** \brief Range of supported values for crop ratio. */
+ VAProcFilterValueRange crop_range;
+ /** \brief Maximum number of forward reference frames supported. */
+ unsigned int max_forward_reference;
+ /** \brief Maximum number of IS perf modes supported. */
+ unsigned int perf_type;
+} VAProcFilterCapImageStabilization;
+
/** \brief Capabilities specification for the Non-Linear Anamorphic Scaling filter. */
typedef struct _VAProcFilterCapNonLinearAnamorphicScaling {
/** \brief Range of supported values for the vertical crop. */