Functions and Restrictions
Function Description
PNG Decoder (PNGD) decodes PNG images.
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
Restrictions on Image Formats, Width and Height Alignment, and Buffers
During image decoding, acldvppMalloc and acldvppFree are called to allocate and free the input and output buffers on the device. The buffer lifetime is managed by the user.
- The input buffer size is the size of space occupied by the input image.
- The output buffer size can be predicted by calling acldvppPngPredictDecSize.
For details about the definition of the output image format, see acldvppPixelFormat. For details about the concepts such as width stride and height stride, see Terminology.
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 acldvppPngPredictDecSize. |
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 acldvppPngPredictDecSize. |
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 acldvppPngPredictDecSize. |
RGBA8888 8-bit |
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 acldvppPngPredictDecSize. |
|
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 acldvppPngPredictDecSize. |
RGBA8888 8-bit |
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 acldvppPngPredictDecSize. |