API Call Sequence

If PNG 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 PNGD functions, see Functions and Restrictions.

Figure 1 PNG image decoding

The current system supports PNG image decoding and output of RGB and RGBA images. 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 PNG decoding, call acldvppMalloc to allocate the device buffer for storing the input or output data.

    Before allocating output buffer, call acldvppPngPredictDecSize to predict the required buffer allocation for the decoding output based on the size of the PNG image.

  3. Call acldvppPngDecodeAsync 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.