MediaCodec.ParameterKeyQpOffsetRects Field
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Set the region of interest as QpOffset-Rects on the next queued input frame.
[Android.Runtime.Register("PARAMETER_KEY_QP_OFFSET_RECTS", ApiSince=35)]
public const string ParameterKeyQpOffsetRects;
[<Android.Runtime.Register("PARAMETER_KEY_QP_OFFSET_RECTS", ApiSince=35)>]
val mutable ParameterKeyQpOffsetRects : string
Field Value
- Attributes
Remarks
Set the region of interest as QpOffset-Rects on the next queued input frame.
The associated value is a String in the format "Top1,Left1-Bottom1,Right1=Offset1;Top2, Left2-Bottom2,Right2=Offset2;...". Co-ordinates (Top, Left), (Top, Right), (Bottom, Left) and (Bottom, Right) form the vertices of bounding box of region of interest in pixels. Pixel (0, 0) points to the top-left corner of the frame. Offset is the suggested quantization parameter (QP) offset of the blocks in the bounding box. The bounding box will get stretched outwards to align to LCU boundaries during encoding. The Qp Offset is integral and shall be in the range [-128, 127]. The QP of target block will be calculated as frameQP + offsetQP. If the result exceeds minQP or maxQP configured then the value will be clamped. Negative offset results in blocks encoded at lower QP than frame QP and positive offsets will result in blocks encoded at higher QP than frame QP. If the areas of negative QP and positive QP are chosen wisely, the overall viewing experience can be improved.
If Roi rect is not valid that is bounding box width is < 0 or bounding box height is < 0, components may ignore the configuration silently. If Roi rect extends outside frame boundaries, then rect shall be clamped to the frame boundaries.
The scope of this key is throughout the encoding session until it is reconfigured during running state.
The maximum number of contours (rectangles) that can be specified for a given input frame is device specific. Implementations will drop/ignore the rectangles that are beyond their supported limit. Hence it is preferable to place the rects in descending order of importance. Transitively, if the bounding boxes overlap, then the most preferred rectangle's qp offset (earlier rectangle qp offset) will be used to quantize the block.
Java documentation for android.media.MediaCodec.PARAMETER_KEY_QP_OFFSET_RECTS
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.