# SSP_StartJpegDecoderFast

## Syntax

    BOOL SSP_StartJpegDecoderFast(SSPJpegDecoderFastContext* pCtx, u8* data, u32 size, void* dst, u32 maxWidth, u32 maxHeight, u32 option);

## Arguments

pCtx | Context structure. Must have 4-byte alignment.
data | JPEG file to decode.
size | Size of the JPEG file to decode.
dst | Buffer used to store a decoded image. A buffer of the size width * height * 2 is required; and it must have 4-byte alignment.
maxWidth | Maximum width allowed (in pixels) for the image to decode. When decoding has finished, the width of the image decoded in pCtx->`width` is stored here.
maxHeight | Maximum height allowed (in pixels) for the image to decode. When decoding has finished, the height of the image decoded in pCtx->`height` is stored here.
option | Decoding options (`SSP_JPEG_RGB555`, `SSP_JPEG_THUMBNAIL`). You must always specify `SSP_JPEG_RGB555`.

## Return Values

If successful, returns `TRUE`.
If failed, an error code of the `SSPJpegDecoderErrorCode` type is stored in pCtx->`errorCode`.

## Description

Decodes a JPEG file into RGB555 image data. JPEG files can be decoded only from the YUV420, YUV422, and YUV444 formats.
This function decodes images faster than the `SSP_StartJpegDecoder` function, but the image must be a multiple of either 8 pixels or 16 pixels.
There are also several differences from the `SSP_StartJpegDecoder` function.

- You must pass the work buffer as pCtx. Because the context structure is large, do not allocate a region from the stack like local variables.
- The vertical and horizontal sizes of the decoded image are returned replaced by the members of the context structure. Get these from the pCtx->`width` and pCtx->`height`.
- You must specify `SSP_JPEG_RGB555` for the decoding option.

If `SSP_JPEG_THUMBNAIL` is also specified for option, this function decodes a thumbnail image. If only `SSP_JPEG_RGB555` is specified, it decodes the main image.

## See Also

`SSPJpegDecoderErrorCode`

## Revision History

2009/07/28 Revised the explanation of option specifications.
2009/06/23 Initial version.

CONFIDENTIAL