hbVPVideoEncode
hbVPVideoEncode operator and hbVPVideoDecode operator's context description handle, which contains the description information necessary to run on the Video Process Unit and can be reused.
The video encoding type enumeration.
-
Member
Code rate control mode enumeration.
-
Member
H.264 coding protocol constant bit rate parameters.
-
Member
H.264 coding protocol variable bit rate parameter.
-
Member
The H.264 coding protocol fixes the quantization parameters.
-
Member
H.264 coding protocol QP mapping parameter.
-
Member
H.264 coding protocol constant average target bit rate parameter.
-
Member
H.265 coding protocol variable bit rate parameter, the parameter range is restricted in the same way as hbVPVideoH264Cbr.
H.265 coding protocol variable bit rate parameter, the parameter range is restricted in the same way as hbVPVideoH264Vbr.
H.265 coding protocol constant average target bit rate parameter, the parameter range is restricted in the same way as hbVPVideoH264AVbr.
H.265 coding protocol fixed quantization parameter, the parameter range is restricted in the same way as hbVPVideoH264FixQp.
H.265 coding protocol QP mapping parameter. The calculation formula for qpMapArrayCount is
(ALIGN64(width)>>5) * (ALIGN64(height)>>5) , with a value range of [32, 8192x4096/(32x32)]
and a recommended value of 0. The macroblock size is 32x32 , and each macroblock
requires a specified QP value. The parameter range is restricted in the same way as hbVPVideoH264QpMap.
Video Process Unit coding protocol code rate control parameter.
-
Member
GOP structural parameter.
-
Member
Parameter for Video encoding.
-
Member
Gets the default encoding parameters for the encoder, where pixelFormat is set to HB_VP_IMAGE_FORMAT_YUV420 by default, and width and height default to 0, requiring specification based on actual dimensions. The outBufCount defaults to 5, decodingRefreshType to 2, and gopPresetIdx to 2. The bitrate mode is determined by the videoType parameter: When videoType=HB_VP_VIDEO_TYPE_H264, the bitrate control mode is HB_VP_VIDEO_RC_MODE_H264_CBR. Specific parameters can be found in the recommended settings of the hbVPVideoH264Cbr structure. When videoType=HB_VP_VIDEO_TYPE_H265, the bitrate control mode is HB_VP_VIDEO_RC_MODE_H265_CBR. Specific parameters can be found in the recommended settings of the hbVPVideoH265Cbr structure.
- Parameter
- [in]
paramPointer the encoding parameter.
- [in]
- Return Value
- Return
0means the API was successfully executed, otherwise the execution failed.
- Return
- Description of interface limitations
- Before calling the interface, you need to specify the videoType as
HB_VP_VIDEO_TYPE_H264orHB_VP_VIDEO_TYPE_H265.
- Before calling the interface, you need to specify the videoType as
Create the encoder context API and initialize context to nullptr in advance before creation.
- Parameter
- [out]
contextEncoder context. - [in]
paramPointer the encoding parameter.
- [out]
- Return Value
- Return
0means the API was successfully executed, otherwise the execution failed.
- Return
- Description of interface limitations
- The Video Process Unit supports the creation of the highest 32 encoding or decoding contexts.
- The encoder does not support codestream encoding of backward reference frames containing B frames.
Release the encoder context API.
- Parameter
- [in]
contextEncoder context.
- [in]
- Return Value
- Return
0means the API was successfully executed, otherwise the execution failed.
- Return
The API for calling the Video Process Unit encoding.
- Parameter
- [out]
taskHandleTask handles are responsible for the interaction of the operator with the UCP architecture. - [in]
srcImgInput YUV Image. - [in]
contextEncoder context.
- [out]
- Return Value
- Return
0means the API was successfully executed, otherwise the execution failed.
- Return
- Description of interface limitations
- Creating tasks using asynchronous methods is only supported.
- Due to hardware limitations of the Video Processing Unit (VPU), the VPU supports a maximum of 31 tasks being submitted simultaneously for encoding or decoding operations.
- To avoid wasting system resources and improve Video Processing Unit encoding performance, it is recommended to reuse input addresses.
The API for calling to get the encoded data buffer.
- Parameter
- [out]
outBufOutput stream file. - [in]
taskHandleTask handles are responsible for the interaction of the operator with the UCP architecture.
- [out]
- Return Value
- Return
0means the API was successfully executed, otherwise the execution failed.
- Return
- Description of interface limitations
- The output buffer
outBufis requested internally by the Video Process Unit. - The buffer contains valid data upon the task is successfully completed, and is released during the task release phase.
- The output buffer
