hbVPVideoEncode operator and hbVPVideoDecode operator's context description handle, which contains the description information necessary to run on the VPU. necessary to run on the VPU, and can be reused.
The video encoding type enumeration.
Member
| Member Name | Description |
|---|---|
HB_VP_VIDEO_TYPE_H264 | The H.264 video coding protocol. |
HB_VP_VIDEO_TYPE_H265 | The H.265 video coding protocol. |
Code rate control mode enumeration.
Member
| Member Name | Description |
|---|---|
HB_VP_VIDEO_RC_MODE_H264_CBR | H.264 coding protocol CBR bit rate control mode. |
HB_VP_VIDEO_RC_MODE_H264_VBR | H.264 coding protocol VBR bit rate control mode. |
HB_VP_VIDEO_RC_MODE_H264_AVBR | H.264 coding protocol AVBR bit rate control mode. |
HB_VP_VIDEO_RC_MODE_H264_FIXQP | H.264 coding protocol FixQp bit rate control mode. |
HB_VP_VIDEO_RC_MODE_H264_QPMAP | H.264 coding protocol QPMap bit rate control mode. |
HB_VP_VIDEO_RC_MODE_H265_CBR | H.265 coding protocol CBR bit rate control mode. |
HB_VP_VIDEO_RC_MODE_H265_VBR | H.265 coding protocol VBR bit rate control mode. |
HB_VP_VIDEO_RC_MODE_H265_AVBR | H.265 coding protocol AVBR bit rate control mode. |
HB_VP_VIDEO_RC_MODE_H265_FIXQP | H.265 coding protocol FIXQP bit rate control mode. |
HB_VP_VIDEO_RC_MODE_H265_QPMAP | H.265 coding protocol QPMAP bit rate control mode. |
H.264 coding protocol constant bit rate parameters.
Member
| Member Name | Description |
|---|---|
intraPeriod | I Frame Interval. Value range [0, 2047], default value 28. |
intraQp | I-frame QP value. Value range [0, 51], default value 30. |
bitRate | Target average bit rate in kbps. Value range [0, 700000], default value 1000. |
frameRate | Target frame rate in fps. Value range [0, 240], default value 30. |
initialRcQp | Initial QP value, when the value is not in the range of [0, 51], the encoder will decide the initial value internally. Value range [0, 63], default value 63. |
vbvBufferSize | Specifies the size of the video buffer in ms. Value range [10, 3000], default value 10. The size of the video buffer is bitRate*vbvBufferSize/1000(kb), and the size affects the encoding quality and bit rate control accuracy. When the video buffer is relatively small, the bit rate control is accurate, but the picture coding quality is poor; When this buffer is relatively large, the picture is encoded with high quality, but the code rate fluctuates a lot. |
mbLevelRcEnable | Enable macroblock-based frame-level rate control to dynamically adjust the encoding parameters of each macroblock according to the characteristics and requirements of the video content. Value range [0, 1], default value 0. |
minQpI | The minimum QP value for the I-frame. Value range [0, 51], default value 8. |
maxQpI | The maximum QP value for the I-frame. Value range [0, 51], default value 51. |
minQpP | The minimum QP value for the P-frame. Value range [0, 51], default value 8. |
maxQpP | The maximum QP value for the P-frame. Value range [0, 51], default value 51. |
minQpB | The minimum QP value for the B-frame. Value range [0, 51], default value 8. |
maxQpB | The maximum QP value for the B-frame. Value range [0, 51], default value 51. |
hvsQpEnable | The bitrate control can work at the subCTU level of control, the mode that adjusts the QP value of the sub-macroblock, which in turn improves the subjective image quality. Value range [0, 1], default value 1. |
hvsQpScale | Valid when hvsQpEnable is enabled, indicates the QP scaling factor. Value range [0, 4], default value 2. |
hvsMaxDeltaQp | Valid when hvsQpEnable is enabled, specifies the maximum deviation range of HVS QP values. Value range [0, 12], default value 10. |
qpMapEnable | Enable QP Map for ROI encoding. value range [0, 1], default value 0. |
H.264 coding protocol variable bit rate parameter.
Member
| Member Name | Description |
|---|---|
intraPeriod | I Frame Interval. Value range [0, 2047], default value 28. |
intraQp | Frame QP value. Value range [0, 51], default value 0. |
frameRate | Target frame rate in fps. Value range [0, 240], default value 30. |
qpMapEnable | Enable QP Map for ROI encoding. Value range [0, 1], default value 0. |
The H.264 coding protocol fixes the quantization parameters.
Member
| Member Name | Description |
|---|---|
intraPeriod | I Frame Interval. Value range [0, 2047], default value 28. |
frameRate | Target frame rate in fps. Value range [0, 240], default value 30. |
qpI | Forces the QP value of the I-frame. Value range [0, 51], default value 8. |
qpP | Forces the QP value of the P-frame. Value range [0, 51], default value 8. |
qpB | Forces the QP value of the B-frame. Value range [0, 51], default value 8. |
H.264 coding protocol QP mapping parameter.
Member
| Member Name | Description |
|---|---|
intraPeriod | I Frame Interval. Value range [0, 2047], default value 28. |
frameRate | Target frame rate in fps. Value range [0, 240], default value 30. |
qpMapArrayCount | Specifies the size of the QP Map table. The value range [0, 240], default value is 0. |
qpMapArray | Specify the QP Map table, the subCTU size of H.264 coding protocol is 32x32, you need to specify a QP value for each subCTU. Each QP value occupies one byte and is ordered by raster scan direction. The default value nullptr. |
H.265 coding protocol constant bit rate parameter.
Member
| Member Name | Description |
|---|---|
intraPeriod | I Frame Interval. Value range [0, 2047], default value 28. |
intraQp | I-frame QP value. Value range [0, 51], default value 30. |
bitRate | Target average bit rate in kbps. Value range [0, 700000], default value 1000. |
frameRate | Target frame rate in fps. Value range [0, 240], default value 30. |
initialRcQp | Initial QP value, when the value is not in the range of [0, 51], the encoder will decide the initial value internally. Value range [0, 63], default value 63. |
vbvBufferSize | Specifies the size of the video buffer in ms. Value range [10, 3000], default value 10. The size of the video buffer is bitRate*vbvBufferSize/1000(kb), and the size affects the encoding quality and bit rate control accuracy. When the video buffer is relatively small, the bit rate control is accurate, but the picture coding quality is poor; When this buffer is relatively large, the picture is encoded with high quality, but the code rate fluctuates a lot. |
ctuLevelRcEnable | Enable macroblock-based frame-level rate control to dynamically adjust the encoding parameters of each macroblock according to the characteristics and requirements of the video content. Value range [0, 1], default value 0. |
minQpI | The minimum QP value for the I-frame. Value range [0, 51], default value 8. |
maxQpI | The maximum QP value for the I-frame. Value range [0, 51], default value 51. |
minQpP | The minimum QP value for the P-frame. Value range [0, 51], default value 8. |
maxQpP | The maximum QP value for the P-frame. Value range [0, 51], default value 51. |
minQpB | The minimum QP value for the B-frame. Value range [0, 51], default value 8. |
maxQpB | The maximum QP value for the B-frame. Value range [0, 51], default value 51. |
hvsQpEnable | Enable the frame rate control of the encoded number unit. |
hvsQpScale | Valid when hvsQpEnable is enabled, indicates the QP scaling factor. Value range [0, 4], default value 2. |
hvsMaxDeltaQp | Valid when hvsQpEnable is enabled, specifies the maximum deviation range of HVS QP values. Value range [0, 12], default value 10. |
qpMapEnable | Enable QPMap for ROI encoding. Value range [0, 1], default value 0. |
H.264 coding protocol constant average target bit rate parameter.
H.265 coding protocol variable bit rate parameter.
H.265 coding protocol QP mapping parameter.
H.265 coding protocol fixed quantization parameter.
H.265 coding protocol constant average target bit rate parameter.
VPU coding protocol code rate control parameter.
Member
| Member Name | Description |
|---|---|
mode | Bit rate control mode. |
h264Cbr | The parameter of the H.264 coding protocol CBR bit rate control mode. |
h264Vbr | The parameter of the H.264 coding protocol CBR bit rate control mode. |
h264Avbr | The parameter of the H.264 coding protocol AVBR bit rate control mode. |
h264QpMap | The parameter of the H.264 coding protocol QpMap bit rate control mode. |
h264FixQp | The parameter of the H.264 coding protocol FixQp bit rate control mode. |
h265Cbr | The parameter of the H.265 coding protocol CBR bit rate control mode. |
h265Vbr | The parameter of the H.265 coding protocol VBR bit rate control mode. |
h265Avbr | The parameter of the H.265 coding protocol AVBR bit rate control mode. |
h265QpMap | The parameter of the H.265 coding protocol QpMap bit rate control mode. |
h265FixQp | The parameter of the H.265 coding protocol FixQp bit rate control mode. |
GOP structural parameter.
Member
| Member Name | Description |
|---|---|
decodingRefreshType | Specifies the type of decoding refresh to apply at the intra frame period. Range value [0, 2], default value 2. |
gopPresetIdx | GOP structure, default value 2. gopPresetIdx supports 0, 1, 2, 3, 6, 7 and 9. |
Profile enumeration under the H.264 encoding protocol.
Member
| Member Name | Description |
|---|---|
HB_VP_H264_PROFILE_UNSPECIFIED | Without specifying the encoding level, the VPU will automatically configure the encoding level according to the bit depth of the source picture. |
HB_VP_H264_PROFILE_BP | Baseline Profile, the basic picture quality, supports video sequences in 8bit and 4:2:0 sampling formats. |
HB_VP_H264_PROFILE_MP | Main Profile, mainstream picture quality, supports video sequences in 8bit and 4:2:0 sampling formats. |
HB_VP_H264_PROFILE_EXTENDED | Extended Profile, advanced picture quality, supports video sequences in 8bit and 4:2:0 sampling formats. |
HB_VP_H264_PROFILE_HP | High Profile, senior picture quality, supports video sequences in 8bit and 4:2:0 sampling formats. |
HB_VP_H264_PROFILE_HIGH10 | High Profile, senior picture quality, supports video sequences in 10bit and 4:2:0 sampling formats. |
HB_VP_H264_PROFILE_HIGH422 | High Profile, senior picture quality, supports video sequences in 8bit and 4:2:2 sampling formats. |
HB_VP_H264_PROFILE_HIGH444 | High Profile, senior picture quality, supports video sequences in 8bit and 4:4:4 sampling formats. |
Level enumeration under the H.264 coding protocol.
H.264 encoding protocol configuration parameter.
Member
| Member Name | Description |
|---|---|
h264Profile | Profile for the H.264 coding protocol. Value range [0, 4], default value HB_VP_H264_PROFILE_UNSPECIFIED. |
h264Level | Level of the H.264 coding protocol. default value HB_VP_H264_LEVEL_UNSPECIFIED |
Level enumeration under H.265 coding protocol.
H.265 encoding protocol configuration parameter.
Member
| Member Name | Description |
|---|---|
h265Tier | VPU supports main tier and high tier. Value range [0, 1], default value 0. |
transformSkipEnable | Enable transform_skip mode, value range [0, 1], default value 1. When the picture content and background similarity are higher, some unnecessary computations and data transmission are skipped to reduce the encoding time and data traffic, while maintaining high video quality and smoothness. |
losslessMode | Enable lossless encoding mode. Value range [0, 1], default value 0. |
tmvpEnable | Enable time motion vector prediction. Takes values in the range [0, 1], default value 1. |
wppEnable | Enable wavefront parallel processing. Value range [0, 1], default value 0. |
mainStillPictureProfileEnable | Enabling Profile for the main still frame provides better video quality and lower compression ratio. Value range [0, 1], default value 0. |
h265Level | Level of the H.265 coding protocol. default value HB_VP_H265_LEVEL_UNSPECIFIED. |
Parameter for Video encoding.
Member
| Member Name | Description |
|---|---|
pixelFormat | The pixel format of the input picture. The currently supported formats include HB_VP_IMAGE_FORMAT_NV12 and HB_VP_IMAGE_FORMAT_YUV420. |
width | The width of the input image should be aligned to 8. Range Values[256, 8192]. |
height | The height of the input image should be aligned to 8. Range Values[128, 8192]. |
outBufCount | Specifies the number of output Buffers inside the VPU. Range Values[1, 65536], default value 5. |
videoType | The type of encoding protocol. |
rcParam | Bit rate control parameter. |
gopParam | GOP parameter. |
h264EncConfig | H.264 encoding configuration parameter. |
h265EncConfig | H.265 encoding configuration parameter. |
Gets the encoder default encoding parameter.
param Pointer the encoding parameter.0 means the API was successfully executed, otherwise the execution failed.Create the encoder context API and initialize context to nullptr in advance before creation.
context Encoder context pointer.param Pointer the encoding parameter.0 means the API was successfully executed, otherwise the execution failed.Release the encoder context API.
context Encoder context pointer.0 means the API was successfully executed, otherwise the execution failed.The API for calling the VPU encoding
taskHandle Task handles are responsible for the interaction of the operator with the UCP architecture.srcImg Pointer the memory address where the encoded picture is stored.context Encoder context pointer.0 means the API was successfully executed, otherwise the execution failed.The API for calling to get the encoded data buffer.
taskHandle Task handles are responsible for the interaction of the operator with the UCP architecture.outBuf Pointer the memory address that holds the encoded data.0 means the API was successfully executed, otherwise the execution failed.outBuf is requested internally by the VPU.