1 /*---------------------------------------------------------------------------*
2   Project:  THP file format
3   File:     thpfile.h
4 
5   Copyright (C)2002-2006 Nintendo  All Rights Reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Log: thpfile.h,v $
14   Revision 1.2  02/08/2006 06:46:27  aka
15   Removed including revolution.h.
16 
17   Revision 1.1  02/03/2006 10:06:49  aka
18   Imported from Dolphin tree.
19 
20     3     03/09/15 9:38a Akagi
21 
22     2     03/07/01 3:12p Akagi
23     Modified to divide old THPConv.exe into 2 LIBs and 1 EXE by
24     Ohki-san@NTSC.
25 
26     1     02/05/14 11:54a Suzuki
27     Initial check-in.
28 
29   $NoKeywords: $
30 
31  *---------------------------------------------------------------------------*/
32 
33 #ifndef __THPFILE_H__
34 #define __THPFILE_H__
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 #define THP_VERSION  (0x11000)  // Version Infomation
41 #define THP_COMP_MAX (16)       // Max component num
42 
43 // Component number
44 typedef enum
45 {
46     THP_VIDEO_COMP,
47     THP_AUDIO_COMP,
48     THP_NOCOMP_COMP = 0xFF
49 } THPComponent;
50 
51 // VideoData Type
52 typedef enum
53 {
54     THP_VIDEO_NON_INTERLACE,
55     THP_VIDEO_ODD_INTERLACE,
56     THP_VIDEO_EVEN_INTERLACE
57 } THPVideoType;
58 
59 //--------------------------------------
60 // THPHeader
61 //--------------------------------------
62 typedef struct
63 {
64     char    magic[4];               // "THP\0"
65     u32     version;                // version number
66     u32     bufSize;                // max frame size for buffer computation
67     u32     audioMaxSamples;        // max samples of audio data
68     f32     frameRate;              // frame per seconds
69     u32     numFrames;
70     u32     firstFrameSize;         // how much to load
71     u32     movieDataSize;
72     u32     compInfoDataOffsets;    // offset to component infomation data
73     u32     offsetDataOffsets;      // offset to array of frame offsets
74     u32     movieDataOffsets;       // offset to first frame (start of movie data)
75     u32     finalFrameDataOffsets;  // offset to final frame
76 } THPHeader;
77 
78 //--------------------------------------
79 // THPFrameCompInfo
80 //--------------------------------------
81 typedef struct
82 {
83     u32     numComponents;            // a number of Components in a frame
84     u8      frameComp[THP_COMP_MAX];  // kind of Components
85 } THPFrameCompInfo;
86 
87 //--------------------------------------
88 // THPVideoInfo
89 //--------------------------------------
90 typedef struct
91 {
92     u32     xSize;      // width  of video
93     u32     ySize;      // height of video
94     u32     videoType;
95 } THPVideoInfo;
96 
97 // OLD Structer (Ver 1.0000)
98 typedef struct
99 {
100     u32     xSize;
101     u32     ySize;
102 } THPVideoInfoOld;
103 
104  //--------------------------------------
105 // THPAudioInfo
106 //--------------------------------------
107 typedef struct
108 {
109     u32     sndChannels;
110     u32     sndFrequency;
111     u32     sndNumSamples;
112     u32     sndNumTracks;   // number of Tracks
113 } THPAudioInfo;
114 
115 // OLD Structer
116 typedef struct
117 {
118     u32     sndChannels;
119     u32     sndFrequency;
120     u32     sndNumSamples;
121 } THPAudioInfoOld;
122 
123 //--------------------------------------
124 // THPFileHeader
125 //--------------------------------------
126 typedef struct
127 {
128     THPHeader           header;
129     THPFrameCompInfo    frameCompInfo;
130     THPVideoInfo        videoInfo;      // THP_COMP_VIDEO
131     THPAudioInfo        audioInfo;      // THP_COMP_AUDIO
132 } THPFileHeader;
133 
134 //--------------------------------------
135 // THPFrameHeader
136 //--------------------------------------
137 typedef struct
138 {
139     u32     frameSizeNext;
140     u32     frameSizePrevious;
141     u32     comp[THP_COMP_MAX];
142 } THPFrameHeader;
143 
144 #ifdef __cplusplus
145 }
146 #endif
147 
148 #endif // __THPFILE_H__
149