hi_venc_rc_attr

Description

Defines the 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.

  • CBR ensures that the encoding bit rate is smooth within the statistical time of the bit rate.
  • VBR means that the encoding bit rate can fluctuate within the bit rate statistical period. In this way, stable encoding picture quality can be ensured.
  • AVBR means that the encoding bit rate can fluctuate within the bit rate statistical period. In this way, stable encoding picture quality 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.
  • QVBR is a variable bit rate based on subjective image quality. In QVBR bit rate control mode, the bit rate is dynamically controlled by the real-time peak signal-to-noise ratio (PSNR). The PSNR is an image quality objective assessment index that helps ensure stable quality of the encoded image. When the PSNR is low, the target bit rate is increased. When the PSNR is high, the target bit rate is decreased.
  • CVBR is a bit rate control algorithm based on VBR. It aims to provide stable picture quality and limit the bit rate of 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 picture quality in complex scenarios and save the bit rate in simple scenarios.
  • Fix quantization parameter (FIXQP) indicates that the QP values of all macroblocks of encoded images are the same within the statistical time 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.

The attribute variables of each RC mode are consistent across the protocols. 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.

h264_qpmap

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

mjpeg_cbr

CBR mode attributes of an 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.

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