hardware/intel/common/libva
Revision | 250b3dc8f370bc6d85be767c9722fd98e8b02ebb (tree) |
---|---|
Time | 2018-09-20 16:13:28 |
Author | Wang, Chengwei C <chengwei.c.wang@inte...> |
Commiter | XinfengZhang |
Add max frame size parameters for multiple pass case in legacy mode
Add new data structure and parameter buffer type for max frame size parameters in multiple pass case.
Signed-off-by: Wang, Chengwei C <chengwei.c.wang@intel.com>
@@ -1748,6 +1748,8 @@ typedef enum | ||
1748 | 1748 | VAEncMiscParameterTypeSkipFrame = 9, |
1749 | 1749 | /** \brief Buffer type used for region-of-interest (ROI) parameters. */ |
1750 | 1750 | VAEncMiscParameterTypeROI = 10, |
1751 | + /** \brief Buffer type used to express a maximum frame size (in bytes) settings for multiple pass. */ | |
1752 | + VAEncMiscParameterTypeMultiPassFrameSize = 11, | |
1751 | 1753 | /** \brief Buffer type used for temporal layer structure */ |
1752 | 1754 | VAEncMiscParameterTypeTemporalLayerStructure = 12, |
1753 | 1755 | /** \brief Buffer type used for dirty region-of-interest (ROI) parameters. */ |
@@ -2116,6 +2118,31 @@ typedef struct _VAEncMiscParameterBufferMaxFrameSize { | ||
2116 | 2118 | } VAEncMiscParameterBufferMaxFrameSize; |
2117 | 2119 | |
2118 | 2120 | /** |
2121 | + * \brief Maximum frame size (in bytes) settings for multiple pass. | |
2122 | + * | |
2123 | + * This misc parameter buffer defines the maximum size of a frame (in | |
2124 | + * bytes) settings for multiple pass. currently only AVC encoder can | |
2125 | + * support this settings in multiple pass case. If the frame size exceeds | |
2126 | + * this size, the encoder will do more pak passes to adjust the QP value | |
2127 | + * to control the frame size. | |
2128 | + */ | |
2129 | +typedef struct _VAEncMiscParameterBufferMultiPassFrameSize { | |
2130 | + /** \brief Type. Shall be set to #VAEncMiscParameterTypeMultiPassMaxFrameSize. */ | |
2131 | + VAEncMiscParameterType type; | |
2132 | + /** \brief Maximum size of a frame (in byte) */ | |
2133 | + uint32_t max_frame_size; | |
2134 | + /** \brief Reserved bytes for future use, must be zero */ | |
2135 | + uint32_t reserved; | |
2136 | + /** \brief number of passes, every pass has different QP, currently AVC encoder can support up to 4 passes */ | |
2137 | + uint8_t num_passes; | |
2138 | + /** \brief delta QP list for every pass */ | |
2139 | + uint8_t *delta_qp; | |
2140 | + | |
2141 | + /** \brief Reserved bytes for future use, must be zero */ | |
2142 | + unsigned long va_reserved[VA_PADDING_LOW]; | |
2143 | +} VAEncMiscParameterBufferMultiPassFrameSize; | |
2144 | + | |
2145 | +/** | |
2119 | 2146 | * \brief Encoding quality level. |
2120 | 2147 | * |
2121 | 2148 | * The encoding quality could be set through this structure, if the implementation |
@@ -3241,6 +3241,18 @@ static void va_TraceVAEncMiscParameterBuffer( | ||
3241 | 3241 | va_TraceMsg(trace_ctx, "\tmax_frame_size = %d\n", p->max_frame_size); |
3242 | 3242 | break; |
3243 | 3243 | } |
3244 | + case VAEncMiscParameterTypeMultiPassFrameSize: | |
3245 | + { | |
3246 | + int i; | |
3247 | + VAEncMiscParameterBufferMultiPassFrameSize *p = (VAEncMiscParameterBufferMultiPassFrameSize *)tmp->data; | |
3248 | + | |
3249 | + va_TraceMsg(trace_ctx, "\t--VAEncMiscParameterTypeMultiPassFrameSize\n"); | |
3250 | + va_TraceMsg(trace_ctx, "\tmax_frame_size = %d\n", p->max_frame_size); | |
3251 | + va_TraceMsg(trace_ctx, "\tnum_passes = %d\n", p->num_passes); | |
3252 | + for(i = 0; i<p->num_passes; ++i) | |
3253 | + va_TraceMsg(trace_ctx, "\tdelta_qp[%d] = %d\n", i, p->delta_qp[i]); | |
3254 | + break; | |
3255 | + } | |
3244 | 3256 | case VAEncMiscParameterTypeQualityLevel: |
3245 | 3257 | { |
3246 | 3258 | VAEncMiscParameterBufferQualityLevel *p = (VAEncMiscParameterBufferQualityLevel *)tmp->data; |