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 HomePage Builder 2000 V4.0.6 for Windows"> 7<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css"> 8<title>THP Player Constants</title> 9</head> 10 11<body> 12 13<h1>THP Player Constants</h1> 14<h2><A NAME="READ_BUFFER_NUM">READ_BUFFER_NUM</A></h2> 15<p><CODE>READ_BUFFER_NUM</CODE> indicates the size of the read buffer for the optical disc drive maintained in the THP player. The buffer size actually allocated is the size obtained by multiplying the maximum frame size stored in the THP movie data header (<CODE>THPHeader</CODE>) and <CODE>READ_BUFFER_NUM</CODE>. If data reading speeds cause minor slowdowns, increasing the size of <CODE>READ_BUFFER_NUM</CODE> might remedy this issue. <CODE>READ_BUFFER_NUM</CODE> is defined as follows.</p> 16 17<dl><dd><pre class="construction"> 18#define READ_BUFFER_NUM 10 19</pre></dd></dl> 20 21<h2><A NAME="DECODE_BUFFER_NUM">DECODE_VIDEO_BUFFER_NUM / DECODE_AUDIO_BUFFER_NUM</A></h2> 22<p><CODE>DECODE_VIDEO_BUFFER_NUM</CODE> and <CODE>DECODE_AUDIO_BUFFER_NUM</CODE> indicate the number of buffers that store the decoded THP video and audio data within the THP player. The buffer sizes actually allocated are calculated as shown below:</p> 23 24<pre>// Y texture buffer size 25( <CODE>OSRoundUp32B</CODE> (THP video data horizontal size × vertical size) 26// U texture buffer size 27+ <CODE>OSRoundUp32B</CODE> (THP video data horizontal size × vertical size / 4) 28// V texture buffer size 29+ <CODE>OSRoundUp32B</CODE> (THP video data horizontal size × vertical size / 4) × <CODE>DECODE_VIDEO_BUFFER_NUM</CODE> 30// Size of buffer for reading THP audio data 31+ <CODE>OSRoundUp32B</CODE> (THP audio data maximum number of samples × 4) × <CODE>DECODE_AUDIO_BUFFER_NUM</CODE></pre> 32 33<p>If the extraction process time causes any minor slowdowns, increasing the number of these buffers could remedy this issue. <CODE>DECODE_VIDEO_BUFFER_NUM</CODE> and <CODE>DECODE_AUDIO_BUFFER_NUM</CODE> are defined as follows:</p> 34 35<dl><dd><pre class="construction"> 36#define DECODE_VIDEO_BUFFER_NUM 3 37#define DECODE_AUDIO_BUFFER_NUM 6 38</pre></dd></dl> 39 40<h2><A NAME="THREAD_PRIORITY">READ_THREAD_PRIORITY / AUDIO_THREAD_PRIORITY / VIDEO_THREAD_PRIORITY</A></h2> 41<p>The THP player creates a maximum of three threads. The read threads reads from the optical disc, the video decode thread extracts the THP video data, and the audio decode thread extracts the THP audio data. The priority of each thread is indicated by <CODE>READ_THREAD_PRIORITY</CODE>, <CODE>AUDIO_THREAD_PRIORITY</CODE>, and <CODE>VIDEO_THREAD_PRIORITY</CODE>. The priority of each thread is defined according to the demo program, so when you embed the THP player in a game, you need to modify the priorities for their respective environments. When modifying the priorities, preserve the following thread priority relationships.</p> 42 43<dl><dd> 44<pre>(High) <CODE>READ_THREAD_PRIORITY</CODE> > <CODE>AUDIO_THREAD_PRIORITY</CODE> > <CODE>VIDEO_THREAD_PRIORITY</CODE> (Low)</pre> 45</dd></dl> 46 47<p>To read smoothly from the optical disc and prevent sound gaps, be sure to assign high priorities to the read and audio decode threads. <CODE>READ_THREAD_PRIORITY</CODE>, <CODE>AUDIO_THREAD_PRIORITY</CODE>, and <CODE>VIDEO_THREAD_PRIORITY</CODE> are defined as follows.</p> 48 49<dl><dd><pre class="construction"> 50#define READ_THREAD_PRIORITY 8 51#define AUDIO_THREAD_PRIORITY 12 52#define VIDEO_THREAD_PRIORITY 20 53</pre></dd></dl> 54 55<H2>See Also</H2> 56<p>None.</p> 57 58<H2>Revision History</H2> 59<P> 602006/03/01 Initial version.<br> 61</P> 62 63<hr><p>CONFIDENTIAL</p></body> 64</html>