READ_BUFFER_NUM 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 (THPHeader) and READ_BUFFER_NUM. If data reading speeds cause minor slowdowns, increasing the size of READ_BUFFER_NUM might remedy this issue. READ_BUFFER_NUM is defined as follows.
#define READ_BUFFER_NUM 10
DECODE_VIDEO_BUFFER_NUM and DECODE_AUDIO_BUFFER_NUM 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:
// Y texture buffer size (OSRoundUp32B(THP video data horizontal size × vertical size) // U texture buffer size +OSRoundUp32B(THP video data horizontal size × vertical size / 4) // V texture buffer size +OSRoundUp32B(THP video data horizontal size × vertical size / 4) ×DECODE_VIDEO_BUFFER_NUM// Size of buffer for reading THP audio data +OSRoundUp32B(THP audio data maximum number of samples × 4) ×DECODE_AUDIO_BUFFER_NUM
If the extraction process time causes any minor slowdowns, increasing the number of these buffers could remedy this issue. DECODE_VIDEO_BUFFER_NUM and DECODE_AUDIO_BUFFER_NUM are defined as follows:
#define DECODE_VIDEO_BUFFER_NUM 3 #define DECODE_AUDIO_BUFFER_NUM 6
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 READ_THREAD_PRIORITY, AUDIO_THREAD_PRIORITY, and VIDEO_THREAD_PRIORITY. 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.
(High)READ_THREAD_PRIORITY>AUDIO_THREAD_PRIORITY>VIDEO_THREAD_PRIORITY(Low)
To read smoothly from the optical disc and prevent sound gaps, be sure to assign high priorities to the read and audio decode threads. READ_THREAD_PRIORITY, AUDIO_THREAD_PRIORITY, and VIDEO_THREAD_PRIORITY are defined as follows.
#define READ_THREAD_PRIORITY 8 #define AUDIO_THREAD_PRIORITY 12 #define VIDEO_THREAD_PRIORITY 20
None.
2006/03/01 Initial version.
CONFIDENTIAL