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=windows-1252" /> 5<meta http-equiv="Content-Style-Type" content="text/css" /> 6<title>SSP_ConvertJpegEncodeData</title> 7<link rel="stylesheet" href="../../css/nitro.css" type="text/css" /> 8</head> 9<body> 10 11<h1>SSP_ConvertJpegEncodeData <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_ConvertJpegEncodeData(const void* src, u8 *wrk, u32 width, u32 height, u32 sampling, 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>src</strong></em></td> 23<td style="width:87%">Image data to encode (RGB555 or YUV422). Must be 4-byte aligned.</td> 24</tr> 25<tr> 26<td style="width:13%"><em><strong>wrk</strong></em></td> 27<td style="width:87%">Working buffer. This must be 4-byte aligned. You can use the <code><a href="SSP_GetJpegEncoderBufferSize.html">SSP_GetJpegEncoderBufferSize</a></code> function to calculate the required size.</td> 28</tr> 29<tr> 30<td style="width:13%"><em><strong>width</strong></em></td> 31<td style="width:87%">Width (in pixels) of the image to encode.</td> 32</tr> 33<tr> 34<td style="width:13%"><em><strong>height</strong></em></td> 35<td style="width:87%">Height (in pixels) of the image to encode.</td> 36</tr> 37<tr> 38<td style="width:13%"><em><strong>sampling</strong></em></td> 39<td style="width:87%">Main image output format (<CODE>SSP_JPEG_OUTPUT_YUV444</CODE>, <CODE>SSP_JPEG_OUTPUT_YUV420</CODE>, or <CODE>SSP_JPEG_OUTPUT_YUV422</CODE>) to use at time of encoding.</td> 40</tr> 41<tr> 42<td style="width:13%"><em><strong>option</strong></em></td> 43<td style="width:87%">Encoding options (<CODE>SSP_JPEG_RGB555</CODE>, <CODE>SSP_JPEG_YUV422</CODE>, or <CODE>SSP_JPEG_THUMBNAIL</CODE>).</td> 44</tr> 45</tbody> 46</table> 47 48 49<h2>Return Values</h2> 50<p><CODE>TRUE</CODE> if successful.</p> 51 52<h2>Description</h2> 53<p>Converts image data into a format used for encoding in a JPEG file.<br>RGB555 and YUV422 formats can be used for the image data to be encoded. When you specify YUV422 image data as <SPAN class="argument">src</SPAN>, you must specify <code>SSP_JPEG_YUV422</code> in <SPAN class="argument">option</SPAN>. If you want to encode a thumbnail icon, you must specify <code>SSP_JPEG_THUMBNAIL</code> in <SPAN class="argument">option</SPAN>.<br>Therefore, to encode a YUV422 image along with a thumbnail icon, you must specify <code>SSP_JPEG_YUV422|SSP_JPEG_THUMBNAIL</code> in <SPAN class="argument">option</SPAN>.<br><br>The height and width of an image that can be encoded differs depending on the value of <SPAN class="argument">sampling</SPAN>.<br>If <code>SSP_JPEG_OUTPUT_YUV444</code> is specified, both the height and width of the image must be a multiple of 8.<br>If <code>SSP_JPEG_OUTPUT_YUV420</code> is specified, both the height and width of the image must be a multiple of 16.<br>If <code>SSP_JPEG_OUTPUT_YUV422</code> is specified, the height must be a multiple of 8, and the width a multiple of 16.<br><br><br>Because actual encoding is performed using the <a href="SSP_StartJpegEncoderWithEncodeData.html"><CODE>SSP_StartJpegEncoderWithEncodeData</CODE></a> function, <SPAN class="argument">src</SPAN>, which represents input source data, can be destroyed without problem upon termination of this function. 54</p> 55 56<h2>See Also</h2> 57<p><a href="SSP_StartJpegEncoderWithEncodeData.html"><CODE>SSP_StartJpegEncoderWithEncodeData</CODE></a><BR> <a href="SSP_GetJpegEncoderBufferSize.html"><CODE>SSP_GetJpegEncoderBufferSize</CODE></a></p> 58 59<h2>Revision History</h2> 60<p> 612009/04/28 Added information on alignment restrictions. <br>2008/11/14 Initial version. 62</p> 63<hr><p>CONFIDENTIAL</p></body> 64</html> 65