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>C Specification</h2>
17
18<dl>
19<dd><pre><code>#include &lt;revolution/thp.h&gt;</code></pre>
20  </dd>
21<dd><pre><CODE>s32 THPVideoDecode(void *file,
22    void *tileY,
23    void *tileU,
24    void *tileV,
25    void *work);</CODE></pre>
26  </dd>
27</dl>
28
29<h2>Arguments</h2>
30
31<table border="1" cellpadding="3" cellspacing="0.1">
32<tr>
33<td width="120" bgcolor="#ffffe8"><strong><em><FONT face="Courier New">file</FONT></em></strong></td>
34<td width="520">Pointer to the THP video data.</td>
35</tr>
36<tr>
37<td width="120" bgcolor="#ffffe8"><strong><em><FONT face="Courier New">tileY</FONT></em></strong></td>
38<td width="520">Pointer to buffer that stores the Y component of the extracted data.</td>
39</tr>
40<tr>
41<td width="120" bgcolor="#ffffe8"><strong><em><FONT face="Courier New">tileU</FONT></em></strong></td>
42<td width="520">Pointer to buffer that stores the U component of the extracted data.</td>
43</tr>
44<tr>
45<td width="120" bgcolor="#ffffe8"><strong><em><FONT face="Courier New">tileV</FONT></em></strong></td>
46<td width="520">Pointer to buffer that stores the V component of the extracted data.</td>
47</tr>
48<tr>
49<td width="120" bgcolor="#ffffe8"><strong><em><FONT face="Courier New">work</FONT></em></strong></td>
50<td width="520">Work buffer used.</td>
51</tr>
52</table>
53
54<h2>Return Values</h2>
55<p>Returns one of the following codes:</p>
56
57<table border="1" cellpadding="3" cellspacing="0.1">
58  <tbody>
59    <tr align="center">
60<td>Code</td>
61<td width=50>Value</td>
62<td>Description</td>
63    </tr>
64    <tr>
65<td><FONT face="Courier New"><CODE>THP_OK</CODE></FONT></td>
66      <td align="center">0</td>
67<td>The function ended normally.</td>
68    </tr>
69    <tr>
70<td><FONT face="Courier New"><CODE>THP_BAD_SYNTAX</CODE></FONT></td>
71      <td align="center">3</td>
72<td>The specified THP video data marker is invalid. </td>
73    </tr>
74    <tr>
75<td><FONT face="Courier New"><CODE>THP_UNSUPPORTED_QUANTIZATION</CODE></FONT></td>
76      <td align="center">9</td>
77<td>The specified THP video data quantization table count is invalid.  </td>
78    </tr>
79    <tr>
80<td><FONT face="Courier New"><CODE>THP_UNSUPPORTED_PRECISION</CODE></FONT></td>
81      <td align="center">10</td>
82<td>The specified THP video data bit precision is invalid. </td>
83    </tr>
84    <tr>
85<td><FONT face="Courier New"><CODE>THP_UNSUPPORTED_MARKER</CODE></FONT></td>
86      <td align="center">11</td>
87<td>There is an unsupported marker in the THP video data.  </td>
88    </tr>
89    <tr>
90<td><FONT face="Courier New"><CODE>THP_UNSUPPORTED_NUM_COMP</CODE></FONT></td>
91      <td align="center">12</td>
92<td>The specified number of components in the THP video data is invalid. </td>
93    </tr>
94    <tr>
95<td><FONT face="Courier New"><CODE>THP_UNSUPPORTED_NUM_HUFF</CODE></FONT></td>
96      <td align="center">13</td>
97<td>The specified number of Huffman tables in the THP video data is invalid.  </td>
98    </tr>
99    <tr>
100<td><FONT face="Courier New"><CODE>THP_BAD_SCAN_HEADER</CODE></FONT></td>
101      <td align="center">14</td>
102<td>The THP video data scan header is invalid. </td>
103    </tr>
104    <tr>
105<td><FONT face="Courier New"><CODE>THP_INVALID_HUFFTAB</CODE></FONT></td>
106      <td align="center">15</td>
107<td>The specified THP video data Huffman table is invalid. </td>
108    </tr>
109    <tr>
110<td><FONT face="Courier New"><CODE>THP_UNSUPPORTED_COMPS</CODE></FONT></td>
111      <td align="center">19</td>
112<td>The specified THP video data component is invalid. </td>
113    </tr>
114    <tr>
115<td><FONT face="Courier New"><CODE>THP_NO_INPUT_FILE</CODE></FONT></td>
116      <td align="center">25</td>
117<td>No input (THP video) data was specified. </td>
118    </tr>
119    <tr>
120<td><FONT face="Courier New"><CODE>THP_NO_WORK_AREA</CODE></FONT></td>
121      <td align="center">26</td>
122<td>No work buffer was specified. </td>
123    </tr>
124    <tr>
125<td><FONT face="Courier New"><CODE>THP_NO_OUTPUT_BUFFER</CODE></FONT></td>
126      <td align="center">27</td>
127<td>No extracted data output destination was specified. </td>
128    </tr>
129    <tr>
130<td><FONT face="Courier New"><CODE>THP_LC_NOT_ENABLED</CODE></FONT></td>
131      <td align="center">28</td>
132<td>A locked cache was not enabled. </td>
133    </tr>
134    <tr>
135<td><FONT face="Courier New"><CODE>THP_NOT_INITIALIZED</CODE></FONT></td>
136      <td align="center">29</td>
137<td>The <a href="THPInit.html"><code>THPInit</code></a> function was not called. </td>
138    </tr>
139  </tbody>
140</table>
141
142<H2>Description</H2>
143<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 work buffer used is specified as the fifth argument. The size of this work buffer is defined in the <CODE>thp.h</CODE> file as <CODE>THP_WORK_SIZE</CODE>. </p>
144
145<p>Call the <code>THPVideoDecode</code> function while a locked cache is enabled. </p>
146
147<p>The error codes for the return value can be divided into three types. They are 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 <code>THPVideoDecode</code> was not used correctly, correct the error and call it again. If the THP video data cannot be extracted, it is possible that the data specified by the first argument is not THP video data. Please check the specified address to see if it is correct.  </p>
148
149<p>The <code>THPVideoDecode</code> function outputs the extracted data as I8 textures to each component. The sizes of the component buffers specified for the function are as follows. The first address in each buffer must be 32-byte aligned.</p>
150
151<table border="1" cellpadding="3" cellspacing="0.1">
152  <tbody>
153    <tr align="center">
154<td>Component</td>
155<td>Size (in bytes)</td>
156    </tr>
157    <tr>
158<td align="center">Y</td>
159<td>(number of pixels in the horizontal direction) x (number of pixels in the vertical direction)</td>
160    </tr>
161    <tr>
162<td align="center">U</td>
163<td>(number of pixels in the horizontal direction) x (number of pixels in the vertical direction) / 4</td>
164    </tr>
165    <tr>
166<td align="center">V</td>
167<td>(number of pixels in the horizontal direction) x (number of pixels in the vertical direction) / 4</td>
168    </tr>
169  </tbody>
170</table>
171
172<p><strong>Note: The <code>THPVideoDecode</code> function uses a locked cache when extracting THP video data. For example, if locked cache is used also by a thread with a higher priority while executing the <code>THPVideoDecode</code> function in a thread, the calculation results of the <code>THPVideoDecode</code> function could be corrupted. Be aware of this when using this function.</strong></p>
173
174<H2>See Also</H2>
175<P><a href="THPInit.html"><code>THPInit</code></a></P>
176
177<H2>Revision History</H2>
178<P>03/01/2006 Initial version.</P>
179
180</body>
181</html>
182