1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3 4<head> 5<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 6<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 6.5.0.0 for Windows"> 7<META http-equiv="Content-Style-Type" content="text/css"> 8<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css"> 9<title>THPVideoDecode</title> 10</head> 11 12<body> 13 14<h1>THPVideoDecode</h1> 15 16<h2>Syntax</h2> 17<dl><dd><pre class="construction"> 18#include <revolution/thp.h> 19 20s32 THPVideoDecode(void *file, 21 void *tileY, 22 void *tileU, 23 void *tileV, 24 void *work); 25</pre></dd></dl> 26 27<h2>Arguments</h2> 28<TABLE class="arguments" border="1" > 29<tr> 30<th><STRONG><EM><CODE>file</CODE></EM></STRONG></th> 31<td>Pointer to THP video data.</td> 32</tr> 33<tr> 34<th>tileY</th> 35<td>Pointer to buffer that stores the Y component of the extracted data.</td> 36</tr> 37<tr> 38<th>tileU</th> 39<td>Pointer to buffer that stores the U component of the extracted data.</td> 40</tr> 41<tr> 42<th>tileV</th> 43<td>Pointer to buffer that stores the V component of the extracted data.</td> 44</tr> 45<tr> 46<th>work</th> 47<td>Work area to use.</td> 48</tr> 49</table> 50 51<h2>Return Values</h2> 52<p>Returns one of the following codes.</p> 53<TABLE class="arguments" border="1" > 54 <tbody> 55 <tr align="center"> 56 <td bgcolor="#CCCCCC">Code</td> 57 <td bgcolor="#CCCCCC" width=50>Value</td> 58 <td bgcolor="#CCCCCC">Description</td> 59 </tr> 60 <tr> 61 <th>THP_OK</th> 62 <td align="center">0</td> 63<td>The function ended normally.</td> 64 </tr> 65 <tr> 66 <th>THP_BAD_SYNTAX</th> 67 <td align="center">3</td> 68<td>The specification of the THP video data marker is invalid.</td> 69 </tr> 70 <tr> 71 <th>THP_UNSUPPORTED_QUANTIZATION</th> 72 <td align="center">9</td> 73<td>The specification for the THP video data quantization table count is invalid.</td> 74 </tr> 75 <tr> 76 <th>THP_UNSUPPORTED_PRECISION</th> 77 <td align="center">10</td> 78<td>The specification for the THP video data bit precision is invalid.</td> 79 </tr> 80 <tr> 81 <th>THP_UNSUPPORTED_MARKER</th> 82 <td align="center">11</td> 83<td>There is an unsupported marker in the THP video data.</td> 84 </tr> 85 <tr> 86 <th>THP_UNSUPPORTED_NUM_COMP</th> 87 <td align="center">12</td> 88<td>The specification for the number of components in the THP video data is invalid.</td> 89 </tr> 90 <tr> 91 <th>THP_UNSUPPORTED_NUM_HUFF</th> 92 <td align="center">13</td> 93<td>The specification for the number of huffman tables in the THP video data is invalid.</td> 94 </tr> 95 <tr> 96 <th>THP_BAD_SCAN_HEADER</th> 97 <td align="center">14</td> 98<td>THP video data scan header is invalid.</td> 99 </tr> 100 <tr> 101 <th>THP_INVALID_HUFFTAB</th> 102 <td align="center">15</td> 103<td>The specification for the THP video data huffman table is invalid.</td> 104 </tr> 105 <tr> 106 <th>THP_UNSUPPORTED_COMPS</th> 107 <td align="center">19</td> 108<td>The specification for the THP video data component is invalid.</td> 109 </tr> 110 <tr> 111 <th>THP_NO_INPUT_FILE</th> 112 <td align="center">25</td> 113<td>No input data (THP video data) was specified.</td> 114 </tr> 115 <tr> 116 <th>THP_NO_WORK_AREA</th> 117 <td align="center">26</td> 118<td>No work area was specified.</td> 119 </tr> 120 <tr> 121 <th>THP_NO_OUTPUT_BUFFER</th> 122 <td align="center">27</td> 123<td>No extracted data output destination was specified.</td> 124 </tr> 125 <tr> 126 <th>THP_LC_NOT_ENABLED</th> 127 <td align="center">28</td> 128<td>Locked cache was not enabled.</td> 129 </tr> 130 <tr> 131 <th>THP_NOT_INITIALIZED</th> 132 <td align="center">29</td> 133<td>The <a href="THPInit.html"><code>THPInit</code></a> function was not called.</td> 134 </tr> 135 </tbody> 136</table> 137 138<H2>Description</H2> 139<p>The <code>THPVideoDecode</code> function extracts the THP video data specified by the first argument, writes the Y component of the extracted data to the buffer specified by the second component, writes the U component of the extracted data to the buffer specified by the third component, and writes the V component of the extracted data to the buffer specified by the fourth argument. The fifth argument specifies the work area used by the <code>THPVideoDecode</code> function. The size of this work area is defined in the <CODE>thp.h</CODE> file as <CODE>THP_WORK_SIZE</CODE>.</p> 140 141<p>Please call the <code>THPVideoDecode</code> function when locked cache is enabled.</p> 142 143<p>The error codes that are returned can be divided into three types: Those returned when the function ends normally, (<CODE>THP_OK</CODE>), those returned when the function was not used correctly (<CODE>THP_NO_INPUT_FILE</CODE> etc.), and those returned when the THP video data cannot be extracted (<CODE>THP_BAD_SYNTAX</CODE> etc.). If the function was not used correctly, correct the error and call <code>THPVideoDecode</code> again. If the THP video data cannot be extracted, the data specified by the first argument may not be THP video data. Please check the specified address to see if it is correct.</p> 144 145<p>The <code>THPVideoDecode</code> function outputs the extracted data as I8 textures for each component. Sizes of the component buffers specified for the <code>THPVideoDecode</code> function are as follows. The first address in each buffer must be 32-byte aligned.</p> 146 147<table border="1" cellpadding="3" cellspacing="1"> 148 <tbody> 149 <tr align="center"> 150<td>Component</td> 151<td>The size (in bytes)</td> 152 </tr> 153 <tr> 154<td align="center">Y</td> 155<td>Num of pixels in the horizontal direction x Num of pixels in the vertical direction</td> 156 </tr> 157 <tr> 158<td align="center">U</td> 159<td>Num of pixels in the horizontal direction x Num of pixels in the vertical direction ÷ 4</td> 160 </tr> 161 <tr> 162<td align="center">V</td> 163<td>Num of pixels in the horizontal direction x Num of pixels in the vertical direction ÷ 4</td> 164 </tr> 165 </tbody> 166</table> 167 168<p><strong>Note: The <code>THPVideoDecode</code> function uses locked cache when extracting THP video data. For example, if while running <code>THPVideoDecode</code> in a thread and a locked cache is used, even by a thread with a higher priority, the calculation results of <code>THPVideoDecode</code> could be corrupted. Keep this in mind and use the <code>THPVideoDecode</code> function carefully.</strong></p> 169 170<H2>See Also</H2> 171<P class="reference"> 172<a href="THPInit.html">THPInit</a> 173</P> 174 175<H2>Revision History</H2> 176<P> 1772006/03/01 Initial version.<br> 178</P> 179 180<hr><p>CONFIDENTIAL</p></body> 181</html> 182