hbVPVideoDecode
Parameter for Video decoding.
-
Member
Get the decoder's default decoding parameter,where the pixelFormat parameter
is HB_VP_IMAGE_FORMAT_YUV420 , the inBufSize parameter is set to 10 * 1024 * 1024 (which equals 10 MB), the outBufCount parameter is set to 5, and the backend parameter is set to HB_UCP_VPU_CORE_0.
- Parameter
- [in]
paramDecode the 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
The API for calling to create decoder context and initialize context to nullptr in advance before creation.
- Parameter
- [out]
contextDecoder context. - [in]
paramDecode the parameter.
- [out]
- Return Value
- Return
0means the API was successfully executed, otherwise the execution failed.
- Return
- Description of interface limitations
- The Video Process Unit highest supports the creation of 32 decoding contexts for one core; howerver, constrained by device buffer limitations, the maximum number may be less than 32.
- The first frame of the decoder must be an IDR frame containing the header information of VPS+SPS+PPS, otherwise it cannot be decoded properly.
- The decoder does not support decoding of B-frame streams containing backward reference frames.
- Due to hardware limitations, the H264 encoding adopts a 16x16 alignment method. The decoded data will also be decoded in line with the alignment requirements set during encoding. Specifically, the resolution after decoding will be aligned to multiples of 16x16.
The API for calling to release the decoder context.
- Parameter
- [in]
contextDecoder context.
- [in]
- Return Value
- Return
0means the API was successfully executed, otherwise the execution failed.
- Return
The API for calling the Video Process Unit decoding.
- Parameter
- [out]
taskHandleTask handles are responsible for the interaction of the operator with the UCP architecture. - [in]
srcBufInput stream file. - [in]
contextDecoder context.
- [out]
- Return Value
- Return
0means the API was successfully executed, otherwise the execution failed.
- Return
- Description of interface limitations
- Create the task using asynchronous methods is only supported.
- During video decoding, the supported resolution ranges from a minimum of 256x128 to a maximum of 8192x4096.
- Due to hardware limitations of the Video Processing Unit, the Video Processing Unit supports a maximum of 31 tasks being submitted simultaneously for either encoding or decoding.
- To avoid wasting system resources and improve Video Processing Unit decoding performance, it is recommended to reuse input addresses.
The API calling for to get the decoded data buffer.
- Parameter
- [out]
outImgOutput YUV Image. - [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
outImgis 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
