API Call Sequence

If JPEG image decoding is involved during app development, ensure that your app contains the code logic for such image decoding. For details about the API call sequence, see API Call Sequence. For details about the JPEGD functions, see Functions and Restrictions.

Figure 1 JPEG image decoding

The current system supports .jpg, .jpeg, .JPG, and .JPEG image decoding. Different source image encoding formats lead to different output formats. The key APIs are described as follows:

  1. Call acldvppCreateChannel to create an image processing channel.

    Before creating a channel, call acldvppCreateChannelDesc to create a channel description.

  2. Before JPEG decoding, call acldvppMalloc to allocate the device buffer for storing the input or output data.

    Before allocating output buffer, call acldvppJpegPredictDecSize to predict the required output allocation size based on the JPEG image size.

  3. Call acldvppJpegDecodeAsync to run asynchronous decoding.

    Also call aclrtSynchronizeStream to wait for the stream tasks to complete.

  4. After the decoding is complete, call acldvppFree to free the input and output buffers in a timely manner.
  5. Call acldvppDestroyChannel to destroy the image processing channel.

    After destroying the channel, call acldvppDestroyChannelDesc to destroy the channel description.