nn::jpeg::CTR::JpegMpDecoder::StartJpegDecoder Member Function

Syntax

#include <nn/jpeg.h>

size_t StartJpegDecoder(
     void * dst,
     size_t dstSize,
     const u8 * src,
     size_t srcSize,
     u32 maxWidth,
     u32 maxHeight,
     PixelFormat dstPixelFormat,
     bool decodeThumbnail
);

Arguments

Name Description
out dst Specifies the buffer that stores the decoded result.
Must be 4-byte aligned.
Must be 128-byte aligned if you are accessing the output buffer directly as a GPU texture. (This function won't perform this check.)
in dstSize Specifies the size of dst in bytes.
Specify the return value of GetDstBufferSize.
in src Specifies the JPEG data to decode.
in srcSize Specifies the size of src in bytes.
in maxWidth Specifies the maximum width (in pixels) of an image that can be decoded. (Up to 65536)
After decoding successfully completes, use the GetLastWidth function to get the width of the actual image and the GetLastOutputBufferWidth function to get the width in the buffer.
in maxHeight Specifies the maximum height (in pixels) of an image that can be decoded. (Up to 65536)
After decoding successfully completes, use the GetLastHeight function to get the height of the actual image and the GetLastOutputBufferHeight function to get the height in the buffer.
in dstPixelFormat Specifies the output pixel format.
in decodeThumbnail Specify true to decode the thumbnail.
Specify false to decode the main image.

Return Values

When the function succeeds, the resulting buffer size (in bytes) is returned.
If the function fails it returns 0.
Use the GetLastError function to get the reason for failure.

Description

Runs the JPEG decoder.

Processing takes longer if the image size is not a multiple of 8 or 16 pixels.
For the given pixel sampling formats, images that meet the following size conditions can be decoded faster:
・For PIXEL_SAMPLING_YUV444, images whose width and height are both multiples of 8.
・For PIXEL_SAMPLING_YUV420, images whose width and height are both multiples of 16.
・For PIXEL_SAMPLING_YUV422, images whose height is multiple of 8 and width is multiple of 16.

Revision History

2010/04/14
Initial version.

CONFIDENTIAL