[Libva] [PATCH 17/42] API: h264 encode: add max-frame-size misc buffer type.
Xiang, Haihao
haihao.xiang at intel.com
Mon May 13 00:51:41 PDT 2013
From: Gwenole Beauchesne <gwenole.beauchesne at intel.com>
---
va/va.h | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/va/va.h b/va/va.h
index b0985c8..89a6f82 100644
--- a/va/va.h
+++ b/va/va.h
@@ -701,6 +701,8 @@ typedef enum
VAEncMiscParameterTypeRateControl = 1,
VAEncMiscParameterTypeMaxSliceSize = 2,
VAEncMiscParameterTypeAIR = 3,
+ /** \brief Buffer type used to express a maximum frame size (in bits). */
+ VAEncMiscParameterTypeMaxFrameSize = 4,
} VAEncMiscParameterType;
/** \brief Packed header type. */
@@ -777,6 +779,19 @@ typedef struct _VAEncMiscParameterAIR
unsigned int air_auto; /* if set to 1 then hardware auto-tune the AIR threshold */
} VAEncMiscParameterAIR;
+/**
+ * \brief Defines a maximum frame size (in bits).
+ *
+ * This misc parameter buffer defines the maximum size of a frame (in
+ * bits). The encoder will try to make sure that each frame does not
+ * exceed this size. Otherwise, if the frame size exceeds this size,
+ * the \c status flag of #VACodedBufferSegment will contain
+ * #VA_CODED_BUF_STATUS_FRAME_SIZE_OVERFLOW.
+ */
+typedef struct _VAEncMiscParameterMaxFrameSize {
+ /** \brief Maximum size of a frame (in bits). */
+ unsigned int max_frame_size;
+} VAEncMiscParameterMaxFrameSize;
/*
* There will be cases where the bitstream buffer will not have enough room to hold
@@ -1530,6 +1545,14 @@ VAStatus vaBufferSetNumElements (
#define VA_CODED_BUF_STATUS_SLICE_OVERFLOW_MASK 0x200
#define VA_CODED_BUF_STATUS_BITRATE_OVERFLOW 0x400
#define VA_CODED_BUF_STATUS_BITRATE_HIGH 0x800
+/**
+ * \brief The frame has exceeded the maximum requested size.
+ *
+ * This flag indicates that the encoded frame size exceeds the value
+ * specified through a misc parameter buffer of type
+ * #VAEncMiscParameterTypeMaxFrameSize.
+ */
+#define VA_CODED_BUF_STATUS_FRAME_SIZE_OVERFLOW 0x1000
#define VA_CODED_BUF_STATUS_AIR_MB_OVER_THRESHOLD 0xff0000
/*
--
1.7.4.1
More information about the Libva
mailing list