hi_mpi_venc_set_roi_attr

Description

Sets the ROI attributes of an H.264/H.265 channel. This is used to limit the QP value of the ROI so that it is different from that of other ROIs. For details about the ROI encoding function, see ROI Encoding Function.

The Ascend 310 AI Processor does not support this API in the current version.

The Ascend 910 AI Processor does not support this API in the current version.

The Ascend 310P AI Processor does not support this API in the current version.

Restrictions

Prototype

hi_s32 hi_mpi_venc_set_roi_attr(hi_venc_chn chn, const hi_venc_roi_attr *roi_attr)

Parameters

Parameter

Input/Output

Description

chn

Input

Encoding channel ID.

The value range of the encoding channel ID is [0, 256). The maximum number of channels is 256.

roi_attr

Input

Pointer to the ROI parameters.

Returns

ROI Encoding Function

ROI encoding is used to encode a region of interest (ROI).

You can configure an ROI to limit its QP value. This can limit the QP value of the ROI so that it is different from that of other ROIs. Currently, only H.264 and H.265 channels support ROI settings. Eight ROIs are provided for users at the same time.

The eight ROIs can be overlaid with each other, in an ascending overlaying priority according to the index numbers 0–7. The overlaying priority refers to the final QP value of an ROI according to the ROI with the highest priority when overlaying occurs. ROIs can be configured in absolute or relative QP mode.

The following figure is used as an example, where the QP values of all macroblocks in the image are 25. ROI 0 is set to the absolute QP mode, with the QP value of 10 and the index of 0. ROI 1 is set to the relative QP mode, with the QP value of –10 and the index of 1. The index of ROI 0 is smaller than that of ROI 1. Therefore, the overlapping ROI is set according to the QP value of the ROI with a higher priority (ROI 1). The QP value of ROI 0 except the overlapping part is 10. The QP value of ROI 1 is 15 (25 – 10).