hi_venc_rc_attr

Description

Defines the rate controller (RC) attributes of an encoding channel.

Prototype

typedef struct {
    hi_venc_rc_mode rc_mode; 
    union {
        hi_venc_h264_cbr h264_cbr;
        hi_venc_h264_vbr h264_vbr;
        hi_venc_h264_avbr h264_avbr;
        hi_venc_h264_qvbr h264_qvbr;
        hi_venc_h264_cvbr h264_cvbr;
        hi_venc_h264_fixqp h264_fixqp;
        hi_venc_h264_qpmap h264_qpmap;

        hi_venc_mjpeg_cbr mjpeg_cbr;
        hi_venc_mjpeg_vbr mjpeg_vbr;
        hi_venc_mjpeg_fixqp mjpeg_fixqp;

        hi_venc_h265_cbr h265_cbr;
        hi_venc_h265_vbr h265_vbr;
        hi_venc_h265_avbr h265_avbr;
        hi_venc_h265_qvbr h265_qvbr;
        hi_venc_h265_cvbr h265_cvbr;
        hi_venc_h265_fixqp h265_fixqp;
        hi_venc_h265_qpmap h265_qpmap;
    };
} hi_venc_rc_attr;

Members

Member

Description

rc_mode

RC mode.

  • Constant Bit Rate (CBR) ensures that the encoding bit rate is smooth within the statistical period of the bit rate.
  • Variable Bit Rate (VBR) means that the encoding bit rate can fluctuate within the bit rate statistical period. In this way, stable quality of encoded images can be ensured.
  • Adaptive Variable Bit Rate (AVBR) means that the encoding bit rate can fluctuate within the bit rate statistical period. In this way, stable quality of encoded images can be ensured. The RC detects the motion status of the current scenario, and improves the encoding bit rate in the motion scenario and reduces the target bit rate in the static scenario.
  • Quality Variable Bit Rate (QVBR) is a variable bit rate based on subjective image quality. In QVBR control mode, the bit rate is dynamically controlled by the real-time peak signal-to-noise ratio (PSNR). The PSNR is an objective image quality assessment index that helps ensure stable quality of encoded images. When the PSNR is low, the target bit rate is increased. When the PSNR is high, the target bit rate is decreased.
  • Constrained Variable Bit Rate (CVBR) is a bit rate control algorithm based on VBR. It aims to provide stable image quality and limit the VBR to meet the requirements of transmission bandwidth and storage space. Specifically, CVBR sets limits on instantaneous, short-term, and long-term bit rates. The limitation of the instantaneous bit rate ensures the transmission requirement of the network bandwidth. The limitation of the long-term bit rate ensures that the storage device has sufficient space to store data during long-term video recording. In addition, the short-term bit rate is adjusted based on the long-term bit rate setting and actual usage to provide more stable image quality in complex scenarios and save the bit rate in simple scenarios.
  • Fix Quantisation Parameter (FIXQP) indicates that the QP values of all macroblocks of encoded images are the same within the statistical period of the bit rate, and the user-defined QP value is used. The QP values of the I-frame and P-frame can be set separately.

For different protocols, the attribute variables in the same RC mode are the same. Table 1 describes the common attributes of the RC modes.

h264_cbr

CBR mode attributes of an H.264 encoding channel.

h264_vbr

VBR mode attributes of an H.264 encoding channel.

h264_avbr

AVBR mode attributes of an H.264 encoding channel.

h264_qvbr

QVBR mode attributes of an H.264 encoding channel.

h264_cvbr

CVBR mode attributes of an H.264 encoding channel.

h264_fixqp

FIXQP mode attributes of an H.264 encoding channel.

For the Atlas A3 training products/Atlas A3 inference products, this parameter is not supported.

For the Atlas A2 training products/Atlas A2 inference products, this parameter is not supported.

For the Atlas inference products, this parameter is reserved.

h264_qpmap

QPMAP mode attributes of an H.264 encoding channel. Reserved.

mjpeg_cbr

CBR mode attributes of a motion Joint Photographic Experts Group (MJPEG) encoding channel. Reserved.

mjpeg_vbr

VBR mode attributes of an MJPEG encoding channel. Reserved.

mjpeg_fixqp

FIXQP mode attributes of an MJPEG encoding channel. Reserved.

h265_cbr

CBR mode attributes of an H.265 encoding channel.

h265_vbr

VBR mode attributes of an H.265 encoding channel.

h265_avbr

AVBR mode attributes of an H.265 encoding channel.

h265_qvbr

QVBR mode attributes of an H.265 encoding channel.

h265_cvbr

CVBR mode attributes of an H.265 encoding channel.

h265_fixqp

FIXQP mode attributes of an H.265 encoding channel.

For the Atlas A3 training products/Atlas A3 inference products, this parameter is not supported.

For the Atlas A2 training products/Atlas A2 inference products, this parameter is not supported.

For the Atlas inference products, this parameter is reserved.

h265_qpmap

QPMAP mode attributes of an H.265 encoding channel. Reserved.

References

Table 1 Restrictions on RC attributes

RC Mode

GOP

StatTime(s)

FrmRate (src_frame_rate/dst_frame_rate)

CBR

≥1

≥1

src_frame_rate ≥ dst_frame_rate

VBR

≥1

≥1

src_frame_rate ≥ dst_frame_rate

AVBR

≥1

≥1

src_frame_rate ≥ dst_frame_rate

FIXQP

≥1

≥1

src_frame_rate ≥ dst_frame_rate

QPMAP

≥1

≥1

src_frame_rate ≥ dst_frame_rate