Using Frame Skipping of VDEC to Reduce Buffer Allocation

Background

In the video decoding+model inference scenario, if the number of video frames is large and not all frames need to be inferred, you are advised to set the current frame not to be displayed and the decoding result not to be output when calling the hi_mpi_vdec_send_stream API to decode the frames that do not need to be inferred.

Principles

Video decoding requires continuous data and needs to output YUV data. Therefore, after each frame of data is decoded, VDEC needs to decompress and resize data and convert its format by using VPC.

If you do not want to obtain the decoding result of a frame, set the current frame output not to be displayed when calling hi_mpi_vdec_send_stream. In this way, you do not need to allocate the output buffer, and the VDEC does not perform decompression, scaling, and format conversion by using the VPC module. This reduces buffer allocation and VPC workload to improve performance.

Instructions for Use

For details, see the description of the need_display parameter in the hi_vdec_stream structure of the hi_mpi_vdec_send_stream interface.