Functions and Restrictions

Description

PNG Decoder (PNGD) decodes PNG images using hardware.

PNGD supports retaining the source image format during image decoding. To achieve this function, set the output image format to PIXEL_FORMAT_UNKNOWN in the PNGD API call.

The image encoding formats before and after decoding remain consistent. For example, if the source format is RGB, the destination format is RGB888.

Resolution Restrictions

  • Input resolution range:

    32 x 32 to 4096 x 4096

  • Output resolution range:

    PNGD only decodes images and does not change the image resolution. Therefore, the resolution of the output image is the same as that of the input image.

Restrictions on Image Formats, Width and Height Alignment, and Buffers

When the image decoding function is implemented, the acl.media.dvpp_malloc API needs to be called to allocate the input and output buffers on the device, and the acl.media.dvpp_free API needs to be called to release the input and output buffers. The lifecycle of the buffers is managed by the user.

For details about the output image format, see acldvppPixelFormat. For details about the width stride and height stride, see Terminology.

Table 1 Restrictions on the image format, width and height alignment, and buffer size

Input Format

Output Format

Output Width and Height

Output Width Stride, Height Stride, and Buffer Size

RGB

RGB888

No alignment requirement.

Width stride: Round up the width to the nearest multiple of 128 and multiply the result by 3.

Height stride: Round up the height to the nearest multiple of 16.

The output buffer size can be predicted by calling acl.media.dvpp_png_predict_dec_size.

GRAY

RGB888

No alignment requirement.

Width stride: Round up the width to the nearest multiple of 128 and multiply the result by 3.

Height stride: Round up the height to the nearest multiple of 16.

The output buffer size can be predicted by calling acl.media.dvpp_png_predict_dec_size.

RGBA

RGB888

No alignment requirement.

Width stride: Round up the width to the nearest multiple of 128 and multiply the result by 3.

Height stride: Round up the height to the nearest multiple of 16.

The output buffer size can be predicted by calling acl.media.dvpp_png_predict_dec_size.

RGBA8888 8bit

No alignment requirement.

Width stride: Round up the width to the nearest multiple of 128 and multiply the result by 4.

Height stride: Round up the height to the nearest multiple of 16.

The output buffer size can be predicted by calling acl.media.dvpp_png_predict_dec_size.

AGRAY

RGB888

No alignment requirement.

Width stride: Round up the width to the nearest multiple of 128 and multiply the result by 3.

Height stride: Round up the height to the nearest multiple of 16.

The output buffer size can be predicted by calling acl.media.dvpp_png_predict_dec_size.

RGBA8888 8bit

No alignment requirement.

Width stride: Round up the width to the nearest multiple of 128 and multiply the result by 4.

Height stride: Round up the height to the nearest multiple of 16.

The output buffer size can be predicted by calling acl.media.dvpp_png_predict_dec_size.