1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html xmlns="http://www.w3.org/1999/xhtml"> 3<head> 4<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5<meta http-equiv="Content-Style-Type" content="text/css" /> 6<title>SSP_StartJpegDecoderFast</title> 7<link rel="stylesheet" href="../../css/nitro.css" type="text/css" /> 8</head> 9<body> 10 11<h1>SSP_StartJpegDecoderFast <img src="../../image/NTR.gif" align="middle"><img src="../../image/TWL.gif" align="middle"></H1> 12<H2>Syntax</H2> 13 14<pre><code> 15BOOL SSP_StartJpegDecoderFast(SSPJpegDecoderFastContext* pCtx, u8* data, u32 size, void* dst, u32 maxWidth, u32 maxHeight, u32 option); 16</code></pre> 17 18<h2>Arguments</h2> 19<table style="width:100%"> 20<tbody> 21<tr> 22<td style="width:13%"><em><strong>pCtx</strong></em></td> 23<td style="width:87%">Context structure. Must have 4-byte alignment.</td> 24</tr> 25<tr> 26<td style="width:13%"><em><strong>data</strong></em></td> 27<td style="width:87%">JPEG file to decode.</td> 28</tr> 29<tr> 30<td style="width:13%"><em><strong>size</strong></em></td> 31<td style="width:87%">Size of the JPEG file to decode.</td> 32</tr> 33<tr> 34<td style="width:13%"><em><strong>dst</strong></em></td> 35<td style="width:87%">Buffer used to store a decoded image.<br>A buffer of the size <SPAN class="argument">width</SPAN> * <SPAN class="argument">height</SPAN> * 2 is required; and it must have 4-byte alignment.</td> 36</tr> 37<tr> 38<td style="width:13%"><em><strong>maxWidth</strong></em></td> 39<td style="width:87%">Maximum width allowed (in pixels) for the image to decode.<br>When decoding has finished, the width of the image decoded in <SPAN class="argument">pCtx</SPAN>-><CODE>width</CODE> is stored here.</td> 40</tr> 41<tr> 42<td style="width:13%"><em><strong>maxHeight</strong></em></td> 43<td style="width:87%">Maximum height allowed (in pixels) for the image to decode. When decoding has finished, the height of the image decoded in <SPAN class="argument">pCtx</SPAN>-><CODE>height</CODE> is stored here.</td> 44</tr> 45<tr> 46<td style="width:13%"><em><strong>option</strong></em></td> 47<td style="width:87%">Decoding options (<CODE>SSP_JPEG_RGB555</CODE>, <CODE>SSP_JPEG_THUMBNAIL</CODE>).<br>You must always specify <CODE>SSP_JPEG_RGB555</CODE>.</code></td> 48</tr> 49</tbody> 50</table> 51 52 53<h2>Return Values</h2> 54<p>If successful, returns <CODE>TRUE</CODE>.<br>If failed, an error code of the <code><a href="SSPJpegDecoderErrorCode.html">SSPJpegDecoderErrorCode</a></code> type is stored in <SPAN class="argument">pCtx</SPAN>-><CODE>errorCode</CODE>.</p> 55 56<h2>Description</h2> 57<p>Decodes a JPEG file into RGB555 image data. JPEG files can be decoded only from the YUV420, YUV422, and YUV444 formats. <br>This function decodes images faster than the <a href="SSP_StartJpegDecoder.html"><CODE>SSP_StartJpegDecoder</CODE></a> function, but the image must be a multiple of either 8 pixels or 16 pixels.<br>There are also several differences from the <a href="SSP_StartJpegDecoder.html"><CODE>SSP_StartJpegDecoder</CODE></a> function.<br> 58<ul> 59<li>You must pass the work buffer as <SPAN class="argument">pCtx</SPAN>. Because the context structure is large, do not allocate a region from the stack like local variables. 60<li>The vertical and horizontal sizes of the decoded image are returned replaced by the members of the context structure. Get these from the <SPAN class="argument">pCtx</SPAN>-><CODE>width</CODE> and <SPAN class="argument">pCtx</SPAN>-><CODE>height</CODE>. 61<li>You must specify <code>SSP_JPEG_RGB555</code> for the decoding option. 62</ul> 63</p> 64<p> 65If <CODE>SSP_JPEG_THUMBNAIL</CODE> is also specified for <SPAN class="argument">option</SPAN>, this function decodes a thumbnail image. If only <code>SSP_JPEG_RGB555</code> is specified, it decodes the main image.<br><br> <font color="red">Note:</font><br> This decoder is only guaranteed to decode JPEG files created using the SSP encoder.<br> Note that some JPEG files created with other software cannot be decoded.<br> Decoding often fails due to additional EXIF information.<br> When this happens, omit the EXIF information from the image .<br> 66</p> 67 68<h2>See Also</h2> 69<p><code><a href="SSPJpegDecoderErrorCode.html">SSPJpegDecoderErrorCode</a></code></p> 70 71<h2>Revision History</h2> 72<p> 732009/09/17 Added a description of when JPEG files fail to decode.<br>2009/07/28 Revised the description of specifying options.<br>2009/06/23 Initial version.<br> 74</p> 75<hr><p>CONFIDENTIAL</p></body> 76</html> 77