1 
2 /*
3  * xa_qt.h
4  *
5  * Copyright (C) 1993-1998,1999 by Mark Podlipec.
6  * All rights reserved.
7  *
8  * This software may be freely used, copied and redistributed without
9  * fee for non-commerical purposes provided that this copyright
10  * notice is preserved intact on all copies.
11  *
12  * There is no warranty or other guarantee of fitness of this software.
13  * It is provided solely "as is". The author disclaims all
14  * responsibility and liability with respect to this software's usage
15  * or its effect upon hardware or computer systems.
16  *
17  */
18 
19 #include "xanim.h"
20 
21 #define QT_moov 0x6D6F6F76
22 #define QT_trak 0x7472616B
23 #define QT_mdia 0x6D646961
24 #define QT_minf 0x6D696E66
25 #define QT_stbl 0x7374626C
26 #define QT_rmra 0x726d7261
27 #define QT_cmov 0x636d6f76
28 #define QT_dcom 0x64636F6D
29 #define QT_zlib 0x7A6C6962
30 #define QT_cmvd 0x636D7664
31 #define QT_pnot 0x706E6F74
32 #define QT_PICT 0x50494354
33 /*-------------- LISTS ---------------------*/
34 #define QT_edts 0x65647473
35 /*-------------- STUFF ---------------------*/
36 #define QT_hdlr 0x68646C72
37 #define QT_mvhd 0x6D766864
38 #define QT_tkhd 0x746B6864
39 #define QT_elst 0x656C7374
40 #define QT_mdhd 0x6D646864
41 #define QT_stsd 0x73747364
42 #define QT_stts 0x73747473
43 #define QT_stss 0x73747373
44 #define QT_stsc 0x73747363
45 #define QT_stsz 0x7374737a
46 #define QT_stco 0x7374636f
47 /*-------------- VIDEO CODECS ---------------*/
48 #define QT_rle   0x726c6520
49 #define QT_smc   0x736D6320
50 #define QT_rpza  0x72707A61
51 #define QT_azpr  0x617A7072
52 #define QT_CVID  0x43564944
53 #define QT_cvid  0x63766964
54 #define QT_jpeg  0x6a706567
55 #define QT_MJPG  0x4d4a5047
56 #define QT_mjpg  0x6d6a7067
57 #define QT_mjpa  0x6d6a7061
58 #define QT_mjpb  0x6d6a7062
59 #define QT_SPIG  0x53504947
60 #define QT_yuv2  0x79757632
61 #define QT_PGVV  0x50475656
62 #define QT_YUV9  0x59565539
63 #define QT_YVU9  0x59555639
64 #define QT_RT21  0x52543231
65 #define QT_rt21  0x72743231
66 #define QT_IV31  0x49563331
67 #define QT_iv31  0x69763331
68 #define QT_IV32  0x49563332
69 #define QT_iv32  0x69763332
70 #define QT_IV41  0x49563431
71 #define QT_iv41  0x69763431
72 #define QT_kpcd  0x6b706364
73 #define QT_KPCD  0x4b504344
74 #define QT_cram 0x6372616D
75 #define QT_CRAM 0x4352414D
76 #define QT_wham 0x7768616d
77 #define QT_WHAM 0x5748414d
78 #define QT_msvc 0x6D737663
79 #define QT_MSVC 0x4d535643
80 #define QT_SVQ1 0x53565131
81 #define QT_UCOD 0x55434f44
82 #define QT_8BPS	0x38425053
83 
84 /* added by konstantin priblouda to support sgi converted quicktimes */
85 /* this represents luminance only 8 bit images, uncompressed */
86 /* I suppose sgi movie library goes far beyond apple ideas :) */
87 /* #define QT_sgi_raw_gray8  0x72617733   POD renamed to _raw3 */
88 #define QT_raw3	0x72617733
89 
90 
91 /*-------------- VIDEO/AUDIO CODECS ---------------*/
92 #define QT_raw   0x72617720
93 /*-------------- AUDIO CODECS ---------------*/
94 #define QT_raw00 0x00000000
95 #define QT_twos  0x74776f73
96 #define QT_sowt  0x736f7774
97 #define QT_MAC3  0x4d414333
98 #define QT_MAC6  0x4d414336
99 #define QT_ima4  0x696d6134
100 #define QT_ulaw  0x756c6177
101 #define QT_Qclp  0x51636c70
102 #define QT_QDMC	 0x51444d43
103 #define QT_agsm  0x6167736d
104 /*-------------- misc ----------------------*/
105 #define QT_free 0x66726565
106 #define QT_vmhd 0x766D6864
107 #define QT_dinf 0x64696e66
108 #define QT_appl 0x6170706C
109 #define QT_mdat 0x6D646174
110 #define QT_smhd 0x736d6864
111 #define QT_stgs 0x73746773
112 #define QT_udta 0x75647461
113 #define QT_skip 0x736B6970
114 #define QT_gmhd 0x676d6864
115 #define QT_text 0x74657874
116 #define QT_clip 0x636C6970   /* clip ??? contains crgn atom  */
117 #define QT_crgn 0x6372676E   /* crgn ??? contain coordinates?? */
118 #define QT_ctab 0x63746162   /* ctab: color table for 16/24 anims on 8 bit */
119 
120 typedef struct
121 {
122   xaULONG format;
123   xaULONG compression;
124   xaULONG dref_id;
125   xaULONG version;
126   xaULONG codec_rev;
127   xaULONG vendor;
128   xaUSHORT chan_num;
129   xaUSHORT bits_samp;
130   xaUSHORT comp_id;
131   xaUSHORT pack_size;
132   xaUSHORT samp_rate;
133   xaUSHORT pad;
134   xaULONG  bps;		/* convenience for me */
135 } QTS_CODEC_HDR;
136 
137 typedef struct
138 {
139   xaULONG version;                /* version/flags */
140   xaULONG creation;               /* creation time */
141   xaULONG modtime;                /* modification time */
142   xaULONG timescale;
143   xaULONG duration;
144   xaULONG rate;
145   xaUSHORT volume;
146   xaULONG  r1;
147   xaULONG  r2;
148   xaULONG matrix[3][3];
149   xaUSHORT r3;
150   xaULONG  r4;
151   xaULONG pv_time;
152   xaULONG pv_durat;
153   xaULONG post_time;
154   xaULONG sel_time;
155   xaULONG sel_durat;
156   xaULONG cur_time;
157   xaULONG nxt_tk_id;
158 } QT_MVHDR;
159 
160 typedef struct
161 {
162   xaULONG version;                /* version/flags */
163   xaULONG creation;               /* creation time */
164   xaULONG modtime;                /* modification time */
165   xaULONG trackid;
166   xaULONG timescale;
167   xaULONG duration;
168   xaULONG time_off;
169   xaULONG priority;
170   xaUSHORT layer;
171   xaUSHORT alt_group;
172   xaUSHORT volume;
173   xaULONG matrix[3][3];
174   xaULONG tk_width;
175   xaULONG tk_height;
176   xaUSHORT pad;
177 } QT_TKHDR;
178 
179 typedef struct
180 {
181   xaULONG version;                /* version/flags */
182   xaULONG creation;               /* creation time */
183   xaULONG modtime;                /* modification time */
184   xaULONG timescale;
185   xaULONG duration;
186   xaUSHORT language;
187   xaUSHORT quality;
188 } QT_MDHDR;
189 
190 typedef struct
191 {
192   xaULONG version;                /* version/flags */
193   xaULONG type;
194   xaULONG subtype;
195   xaULONG vendor;
196   xaULONG flags;
197   xaULONG mask;
198 } QT_HDLR_HDR;
199 
200 
201 typedef struct QT_FRAME_STRUCT
202 {
203   xaULONG time;
204   xaULONG timelo;
205   XA_ACTION *act;
206   struct QT_FRAME_STRUCT *next;
207 } QT_FRAME;
208 
209 typedef struct
210 {
211   xaULONG width;
212   xaULONG height;
213   xaULONG depth;
214   xaULONG compression;
215   xaULONG xapi_rev;
216   xaULONG (*decoder)();
217   void *dlta_extra;
218   XA_CHDR *chdr;
219 } QTV_CODEC_HDR;
220 
221 typedef struct
222 {
223   xaULONG first;
224   xaULONG num;
225   xaULONG tag;
226 } QT_S2CHUNK_HDR;
227 
228 typedef struct
229 {
230   xaULONG cnt;
231   xaULONG time;
232   xaULONG timelo;
233 } QT_T2SAMP_HDR;
234 
235 
236