540
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1997 by eXept Software AG
|
|
3 |
All Rights Reserved
|
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
525
|
12 |
|
|
13 |
RIFFReader subclass:#AVIReader
|
|
14 |
instanceVariableNames:'frames nframes frameBuffer frameBufferSize imageBuffer redPalette
|
|
15 |
greenPalette bluePalette flags frameDelay streamType depth
|
|
16 |
compression colorTable numColors deltaMethod'
|
|
17 |
classVariableNames:'MAXCOLORS UnsupportedFormatErrorSignal'
|
|
18 |
poolDictionaries:''
|
|
19 |
category:'Graphics-Images-Support'
|
|
20 |
!
|
|
21 |
|
|
22 |
!AVIReader class methodsFor:'documentation'!
|
|
23 |
|
526
|
24 |
copyright
|
|
25 |
"
|
|
26 |
COPYRIGHT (c) 1997 by eXept Software AG
|
|
27 |
All Rights Reserved
|
|
28 |
|
|
29 |
This software is furnished under a license and may be used
|
|
30 |
only in accordance with the terms of that license and with the
|
|
31 |
inclusion of the above copyright notice. This software may not
|
|
32 |
be provided or otherwise made available to, or used by, any
|
|
33 |
other person. No title to or ownership of the software is
|
|
34 |
hereby transferred.
|
|
35 |
"
|
|
36 |
!
|
|
37 |
|
525
|
38 |
documentation
|
|
39 |
"
|
526
|
40 |
This is not yet completed.
|
525
|
41 |
|
540
|
42 |
Read frames from a AVI file.
|
|
43 |
|
|
44 |
this is a very first attempt in reading AVI files;
|
616
|
45 |
(a first experiment in reading that fileFormat)
|
|
46 |
|
|
47 |
Its very experimental, preliminary and will certainly change.
|
|
48 |
(will introduce a new class hierarchy based upon some MovieReader ...).
|
525
|
49 |
|
|
50 |
When used like an imageReader, #fromFile: will return
|
|
51 |
the very first frame.
|
|
52 |
|
|
53 |
Warning: right now, the complete movie is read and huge
|
540
|
54 |
amounts of memory are allocated. The interface will be changed
|
525
|
55 |
to allow stream operation ...
|
|
56 |
|
|
57 |
[author:]
|
|
58 |
Claus Gittinger
|
|
59 |
|
|
60 |
[see also:]
|
|
61 |
ImageReader
|
|
62 |
"
|
|
63 |
!
|
|
64 |
|
|
65 |
examples
|
|
66 |
"
|
|
67 |
|reader film view tNext|
|
|
68 |
|
553
|
69 |
reader := AVIReader readFile:'/cdrom/program/mcitest/flug.avi'.
|
525
|
70 |
reader isNil ifTrue:[^ nil].
|
|
71 |
film := reader images.
|
|
72 |
view := StandardSystemView extent:(film first extent).
|
|
73 |
view openAndWait.
|
|
74 |
|
|
75 |
tNext := Time millisecondClockValue + (reader frameDelay).
|
|
76 |
film do:[:frame |
|
|
77 |
frame displayOn:view x:0 y:0.
|
|
78 |
(Delay untilMilliseconds:tNext) wait.
|
|
79 |
tNext := tNext + (reader frameDelay).
|
|
80 |
].
|
|
81 |
"
|
|
82 |
! !
|
|
83 |
|
|
84 |
!AVIReader class methodsFor:'class initialization'!
|
|
85 |
|
|
86 |
initialize
|
|
87 |
MAXCOLORS := 256.
|
|
88 |
|
|
89 |
UnsupportedFormatErrorSignal isNil ifTrue:[
|
|
90 |
UnsupportedFormatErrorSignal := ErrorSignal newSignalMayProceed:true.
|
|
91 |
UnsupportedFormatErrorSignal nameClass:self message:#unsupportedFormatErrorSignal.
|
|
92 |
].
|
|
93 |
|
|
94 |
"
|
|
95 |
AVIReader initialize
|
|
96 |
"
|
|
97 |
|
|
98 |
"Created: 4.4.1997 / 22:35:52 / cg"
|
|
99 |
"Modified: 5.4.1997 / 14:37:08 / cg"
|
|
100 |
! !
|
|
101 |
|
|
102 |
!AVIReader class methodsFor:'testing'!
|
|
103 |
|
|
104 |
isValidImageFile:aFileName
|
|
105 |
"return true, if aFileName contains an AVI-movie"
|
|
106 |
|
|
107 |
|data1 len data3 inStream|
|
|
108 |
|
|
109 |
inStream := self streamReadingFile:aFileName.
|
|
110 |
inStream isNil ifTrue:[^ false].
|
|
111 |
inStream binary.
|
|
112 |
|
|
113 |
data1 := String new:4.
|
|
114 |
inStream nextBytes:4 into:data1.
|
|
115 |
len := inStream nextLongMSB:true.
|
|
116 |
data3 := String new:4.
|
|
117 |
inStream nextBytes:4 into:data3.
|
|
118 |
|
|
119 |
((data1 = 'RIFF')
|
|
120 |
and:[data3 = 'AVI ']) ifTrue:[
|
|
121 |
^ true
|
|
122 |
].
|
|
123 |
inStream close.
|
|
124 |
^ false.
|
|
125 |
|
|
126 |
"
|
|
127 |
AVIReader isValidImageFile:'bitmaps/magtape.xpm'
|
|
128 |
AVIReader isValidImageFile:'/home2/pd_stuff/movies/avi/drlair.avi'
|
|
129 |
"
|
|
130 |
|
|
131 |
"Created: 4.4.1997 / 22:35:52 / cg"
|
|
132 |
"Modified: 4.4.1997 / 23:15:39 / cg"
|
|
133 |
! !
|
|
134 |
|
|
135 |
!AVIReader methodsFor:'accessing'!
|
|
136 |
|
|
137 |
frameDelay
|
|
138 |
"return the value of the instance variable 'frameDelay' (automatically generated)"
|
|
139 |
|
|
140 |
^ frameDelay
|
|
141 |
|
|
142 |
"Created: 4.4.1997 / 22:35:52 / cg"
|
|
143 |
!
|
|
144 |
|
|
145 |
images
|
|
146 |
"return a collection of all images as represented by myself"
|
|
147 |
|
622
|
148 |
|image depth|
|
525
|
149 |
|
|
150 |
depth := self bitsPerPixel.
|
622
|
151 |
1 to:imageSequence size do:[:i |
|
|
152 |
|frame|
|
525
|
153 |
|
622
|
154 |
frame := imageSequence at:i.
|
|
155 |
|
|
156 |
frame isImage ifFalse:[
|
|
157 |
image := (Image implementorForDepth:depth) new.
|
|
158 |
image
|
|
159 |
width:width
|
|
160 |
height:height
|
|
161 |
photometric:photometric
|
|
162 |
samplesPerPixel:samplesPerPixel
|
|
163 |
bitsPerSample:bitsPerSample
|
|
164 |
colorMap:colorMap
|
|
165 |
bits:frame
|
|
166 |
mask:mask.
|
|
167 |
imageSequence at:i put:image.
|
|
168 |
].
|
525
|
169 |
].
|
622
|
170 |
^ imageSequence
|
525
|
171 |
|
|
172 |
"Created: 4.4.1997 / 22:35:52 / cg"
|
622
|
173 |
"Modified: 24.6.1997 / 15:57:17 / cg"
|
525
|
174 |
! !
|
|
175 |
|
|
176 |
!AVIReader methodsFor:'decoders'!
|
|
177 |
|
|
178 |
AVI_Decode_CRAM:data
|
|
179 |
"
|
|
180 |
|
|
181 |
/*
|
|
182 |
* Routine to Decode an AVI CRAM chunk
|
|
183 |
*/
|
|
184 |
|
|
185 |
#define AVI_CRAM_C1(ip,clr,rdec) { \
|
|
186 |
*ip++ = clr; *ip++ = clr; *ip++ = clr; *ip = clr; ip -= rdec; \
|
|
187 |
*ip++ = clr; *ip++ = clr; *ip++ = clr; *ip = clr; ip -= rdec; \
|
|
188 |
*ip++ = clr; *ip++ = clr; *ip++ = clr; *ip = clr; ip -= rdec; \
|
|
189 |
*ip++ = clr; *ip++ = clr; *ip++ = clr; *ip = clr; }
|
|
190 |
|
|
191 |
#define AVI_CRAM_C2(ip,flag,cA,cB,rdec) { \
|
|
192 |
*ip++ =(flag&0x01)?(cB):(cA); *ip++ =(flag&0x02)?(cB):(cA); \
|
|
193 |
*ip++ =(flag&0x04)?(cB):(cA); *ip =(flag&0x08)?(cB):(cA); ip-=rdec; \
|
|
194 |
*ip++ =(flag&0x10)?(cB):(cA); *ip++ =(flag&0x20)?(cB):(cA); \
|
|
195 |
*ip++ =(flag&0x40)?(cB):(cA); *ip =(flag&0x80)?(cB):(cA); }
|
|
196 |
|
|
197 |
#define AVI_CRAM_C4(ip,flag,cA0,cA1,cB0,cB1,rdec) { \
|
|
198 |
*ip++ =(flag&0x01)?(cB0):(cA0); *ip++ =(flag&0x02)?(cB0):(cA0); \
|
|
199 |
*ip++ =(flag&0x04)?(cB1):(cA1); *ip =(flag&0x08)?(cB1):(cA1); ip-=rdec; \
|
|
200 |
*ip++ =(flag&0x10)?(cB0):(cA0); *ip++ =(flag&0x20)?(cB0):(cA0); \
|
|
201 |
*ip++ =(flag&0x40)?(cB1):(cA1); *ip =(flag&0x80)?(cB1):(cA1); }
|
|
202 |
|
|
203 |
#define AVI_MIN_MAX_CHECK(x,y,min_x,max_x,min_y,max_y) { \
|
|
204 |
if (x < min_x) min_x = x; if (y > max_y) max_y = y; \
|
|
205 |
if (x > max_x) max_x = x; if (y < min_y) min_y = y; }
|
|
206 |
|
|
207 |
#define AVI_BLOCK_INC(x,y,imagex) { x += 4; if (x>=imagex) { x=0; y -= 4; } }
|
|
208 |
|
|
209 |
#define AVI_GET_16(data,dptr) { data = *dptr++; data |= (*dptr++) << 8; }
|
|
210 |
|
|
211 |
#define AVI_CRAM_rgbC1(ip,r,g,b) { \
|
|
212 |
*ip++=r; *ip++=g; *ip++=b; *ip++=r; *ip++=g; *ip++=b; \
|
|
213 |
*ip++=r; *ip++=g; *ip++=b; *ip++=r; *ip++=g; *ip =b; }
|
|
214 |
|
|
215 |
#define AVI_CRAM_rgbC2(ip,flag,rA,gA,bA,rB,gB,bB) { \
|
|
216 |
if (flag&0x01) {*ip++=rB; *ip++=gB; *ip++=bB;} \
|
|
217 |
else {*ip++=rA; *ip++=gA; *ip++=bA;} \
|
|
218 |
if (flag&0x02) {*ip++=rB; *ip++=gB; *ip++=bB;} \
|
|
219 |
else {*ip++=rA; *ip++=gA; *ip++=bA;} \
|
|
220 |
if (flag&0x04) {*ip++=rB; *ip++=gB; *ip++=bB;} \
|
|
221 |
else {*ip++=rA; *ip++=gA; *ip++=bA;} \
|
|
222 |
if (flag&0x08) {*ip++=rB; *ip++=gB; *ip =bB;} \
|
|
223 |
else {*ip++=rA; *ip++=gA; *ip =bA;} }
|
|
224 |
|
|
225 |
#define AVI_CRAM_rgbC4(ip,flag,rA,gA,bA,rB,gB,bB) { \
|
|
226 |
if (flag&0x01) {*ip++=rB; *ip++=gB; *ip++=bB;} \
|
|
227 |
else {*ip++=rA; *ip++=gA; *ip++=bA;} \
|
|
228 |
if (flag&0x02) {*ip++=rB; *ip++=gB; *ip =bB;} \
|
|
229 |
else {*ip++=rA; *ip++=gA; *ip =bA;} }
|
|
230 |
|
|
231 |
#define AVI_Get_RGBColor(r,g,b,color) \
|
|
232 |
{ register ULONG _r,_g,_b; \
|
|
233 |
_r = (color >> 10) & 0x1f; r = (_r << 3) | (_r >> 2); \
|
|
234 |
_g = (color >> 5) & 0x1f; g = (_g << 3) | (_g >> 2); \
|
|
235 |
_b = color & 0x1f; b = (_b << 3) | (_b >> 2); \
|
|
236 |
if (xa_gamma_flag==TRUE) { r = xa_gamma_adj[r]>>8; \
|
|
237 |
g = xa_gamma_adj[g]>>8; b = xa_gamma_adj[b]>>8; } }
|
|
238 |
|
|
239 |
|
|
240 |
ULONG
|
|
241 |
AVI_Decode_CRAM(image,delta,dsize,chdr,map,map_flag,imagex,imagey,imaged,
|
|
242 |
xs,ys,xe,ye,special,extra)
|
|
243 |
UBYTE *image; /* Image Buffer. */
|
|
244 |
UBYTE *delta; /* delta data. */
|
|
245 |
ULONG dsize; /* delta size */
|
|
246 |
XA_CHDR *chdr; /* color map info */
|
|
247 |
ULONG *map; /* used if it's going to be remapped. */
|
|
248 |
ULONG map_flag; /* whether or not to use remap_map info. */
|
|
249 |
ULONG imagex,imagey; /* Size of image buffer. */
|
|
250 |
ULONG imaged; /* Depth of Image. (IFF specific) */
|
|
251 |
ULONG *xs,*ys; /* pos of changed area. */
|
|
252 |
ULONG *xe,*ye; /* size of changed area. */
|
|
253 |
ULONG special; /* Special Info. */
|
|
254 |
void *extra; /* extra info needed to decode delta */
|
|
255 |
{
|
|
256 |
ULONG row_dec,exitflag,changed,block_cnt;
|
|
257 |
ULONG code0,code1;
|
|
258 |
LONG x,y,min_x,max_x,min_y,max_y;
|
|
259 |
UBYTE *dptr;
|
|
260 |
|
|
261 |
changed = 0;
|
|
262 |
max_x = max_y = 0; min_x = imagex; min_y = imagey;
|
|
263 |
dptr = delta;
|
|
264 |
row_dec = imagex + 3;
|
|
265 |
x = 0;
|
|
266 |
y = imagey - 1;
|
|
267 |
exitflag = 0;
|
|
268 |
block_cnt = ((imagex * imagey) >> 4) + 1;
|
|
269 |
|
|
270 |
if (map_flag == TRUE)
|
|
271 |
{
|
|
272 |
if (x11_bytes_pixel == 4)
|
|
273 |
{
|
|
274 |
while(!!exitflag)
|
|
275 |
{
|
|
276 |
code0 = *dptr++; code1 = *dptr++; block_cnt--;
|
|
277 |
if ( ((code1==0) && (code0==0) && !!block_cnt) || (y<0)) exitflag = 1;
|
|
278 |
else
|
|
279 |
{
|
|
280 |
if ((code1 >= 0x84) && (code1 <= 0x87)) /* skip */
|
|
281 |
{ ULONG skip = ((code1 - 0x84) << 8) + code0;
|
|
282 |
block_cnt -= (skip-1); while(skip--) AVI_BLOCK_INC(x,y,imagex);
|
|
283 |
}
|
|
284 |
else /* single block encoded */
|
|
285 |
{
|
|
286 |
if (code1 >= 0x90) /* 8 color quadrant encoding */
|
|
287 |
{ ULONG cA0,cA1,cB0,cB1;
|
|
288 |
ULONG *i_ptr = (ULONG *)(image + ((y * imagex + x) << 2) );
|
|
289 |
cB0 = (ULONG)map[*dptr++]; cA0 = (ULONG)map[*dptr++];
|
|
290 |
cB1 = (ULONG)map[*dptr++]; cA1 = (ULONG)map[*dptr++];
|
|
291 |
AVI_CRAM_C4(i_ptr,code0,cA0,cA1,cB0,cB1,row_dec); i_ptr -=row_dec;
|
|
292 |
cB0 = (ULONG)map[*dptr++]; cA0 = (ULONG)map[*dptr++];
|
|
293 |
cB1 = (ULONG)map[*dptr++]; cA1 = (ULONG)map[*dptr++];
|
|
294 |
AVI_CRAM_C4(i_ptr,code1,cA0,cA1,cB0,cB1,row_dec);
|
|
295 |
} else if (code1 < 0x80) /* 2 color encoding */
|
|
296 |
{ register ULONG clr_A,clr_B;
|
|
297 |
ULONG *i_ptr = (ULONG *)(image + ((y * imagex + x) << 2) );
|
|
298 |
clr_B = (ULONG)map[*dptr++]; clr_A = (ULONG)map[*dptr++];
|
|
299 |
AVI_CRAM_C2(i_ptr,code0,clr_A,clr_B,row_dec); i_ptr -= row_dec;
|
|
300 |
AVI_CRAM_C2(i_ptr,code1,clr_A,clr_B,row_dec);
|
|
301 |
}
|
|
302 |
else /* 1 color encoding */
|
|
303 |
{ ULONG clr = (ULONG)map[code0];
|
|
304 |
ULONG *i_ptr = (ULONG *)(image + ((y * imagex + x) << 2) );
|
|
305 |
AVI_CRAM_C1(i_ptr,clr,row_dec);
|
|
306 |
}
|
|
307 |
AVI_MIN_MAX_CHECK(x,y,min_x,max_x,min_y,max_y);
|
|
308 |
changed = 1; AVI_BLOCK_INC(x,y,imagex);
|
|
309 |
} /* end of single block */
|
|
310 |
} /* end of not term code */
|
|
311 |
} /* end of not while exit */
|
|
312 |
} /* end of 4 bytes pixel */
|
|
313 |
else if (x11_bytes_pixel == 2)
|
|
314 |
{
|
|
315 |
while(!!exitflag)
|
|
316 |
{
|
|
317 |
code0 = *dptr++; code1 = *dptr++; block_cnt--;
|
|
318 |
if ( ((code1==0) && (code0==0) && !!block_cnt) || (y<0)) exitflag = 1;
|
|
319 |
else
|
|
320 |
{
|
|
321 |
if ((code1 >= 0x84) && (code1 <= 0x87)) /* skip */
|
|
322 |
{ ULONG skip = ((code1 - 0x84) << 8) + code0;
|
|
323 |
block_cnt -= (skip-1); while(skip--) AVI_BLOCK_INC(x,y,imagex);
|
|
324 |
} else /* single block encoded */
|
|
325 |
{
|
|
326 |
if (code1 >= 0x90) /* 8 color quadrant encoding */
|
|
327 |
{
|
|
328 |
USHORT cA0,cA1,cB0,cB1;
|
|
329 |
USHORT *i_ptr = (USHORT *)(image + ((y * imagex + x) << 1) );
|
|
330 |
cB0 = map[*dptr++]; cA0 = map[*dptr++];
|
|
331 |
cB1 = map[*dptr++]; cA1 = map[*dptr++];
|
|
332 |
AVI_CRAM_C4(i_ptr,code0,cA0,cA1,cB0,cB1,row_dec); i_ptr -=row_dec;
|
|
333 |
cB0 = map[*dptr++]; cA0 = map[*dptr++];
|
|
334 |
cB1 = map[*dptr++]; cA1 = map[*dptr++];
|
|
335 |
AVI_CRAM_C4(i_ptr,code1,cA0,cA1,cB0,cB1,row_dec);
|
|
336 |
} /* end of 8 color quadrant encoding */
|
|
337 |
else if (code1 < 0x80) /* 2 color encoding */
|
|
338 |
{ USHORT clr_A,clr_B;
|
|
339 |
USHORT *i_ptr = (USHORT *)(image + ((y * imagex + x) << 1) );
|
|
340 |
clr_B = (USHORT)map[*dptr++]; clr_A = (USHORT)map[*dptr++];
|
|
341 |
AVI_CRAM_C2(i_ptr,code0,clr_A,clr_B,row_dec); i_ptr -= row_dec;
|
|
342 |
AVI_CRAM_C2(i_ptr,code1,clr_A,clr_B,row_dec);
|
|
343 |
} /* end of 2 color */
|
|
344 |
else /* 1 color encoding */
|
|
345 |
{ USHORT clr = (USHORT)map[code0];
|
|
346 |
USHORT *i_ptr = (USHORT *)(image + ((y * imagex + x) << 1) );
|
|
347 |
AVI_CRAM_C1(i_ptr,clr,row_dec);
|
|
348 |
}
|
|
349 |
AVI_MIN_MAX_CHECK(x,y,min_x,max_x,min_y,max_y);
|
|
350 |
changed = 1; AVI_BLOCK_INC(x,y,imagex);
|
|
351 |
} /* end of single block */
|
|
352 |
} /* end of not term code */
|
|
353 |
} /* end of not while exit */
|
|
354 |
} /* end of 2 bytes pixel */
|
|
355 |
else /* (x11_bytes_pixel == 1) */
|
|
356 |
{
|
|
357 |
while(!!exitflag)
|
|
358 |
{
|
|
359 |
code0 = *dptr++; code1 = *dptr++; block_cnt--;
|
|
360 |
if ( ((code1==0) && (code0==0) && !!block_cnt) || (y<0)) exitflag = 1;
|
|
361 |
else
|
|
362 |
{
|
|
363 |
if ((code1 >= 0x84) && (code1 <= 0x87)) /* skip */
|
|
364 |
{ ULONG skip = ((code1 - 0x84) << 8) + code0;
|
|
365 |
block_cnt -= (skip-1); while(skip--) AVI_BLOCK_INC(x,y,imagex);
|
|
366 |
} else /* single block encoded */
|
|
367 |
{
|
|
368 |
if (code1 >= 0x90) /* 8 color quadrant encoding */
|
|
369 |
{ UBYTE cA0,cA1,cB0,cB1;
|
|
370 |
UBYTE *i_ptr = (UBYTE *)(image + y * imagex + x);
|
|
371 |
cB0 = (UBYTE)map[*dptr++]; cA0 = (UBYTE)map[*dptr++];
|
|
372 |
cB1 = (UBYTE)map[*dptr++]; cA1 = (UBYTE)map[*dptr++];
|
|
373 |
AVI_CRAM_C4(i_ptr,code0,cA0,cA1,cB0,cB1,row_dec); i_ptr -=row_dec;
|
|
374 |
cB0 = (UBYTE)map[*dptr++]; cA0 = (UBYTE)map[*dptr++];
|
|
375 |
cB1 = (UBYTE)map[*dptr++]; cA1 = (UBYTE)map[*dptr++];
|
|
376 |
AVI_CRAM_C4(i_ptr,code1,cA0,cA1,cB0,cB1,row_dec);
|
|
377 |
}
|
|
378 |
else if (code1 < 0x80) /* 2 color encoding */
|
|
379 |
{ UBYTE clr_A,clr_B;
|
|
380 |
UBYTE *i_ptr = (UBYTE *)(image + y * imagex + x);
|
|
381 |
clr_B = (UBYTE)map[*dptr++]; clr_A = (UBYTE)map[*dptr++];
|
|
382 |
AVI_CRAM_C2(i_ptr,code0,clr_A,clr_B,row_dec); i_ptr -= row_dec;
|
|
383 |
AVI_CRAM_C2(i_ptr,code1,clr_A,clr_B,row_dec);
|
|
384 |
}
|
|
385 |
else /* 1 color encoding */
|
|
386 |
{ UBYTE clr = (UBYTE)map[code0];
|
|
387 |
UBYTE *i_ptr = (UBYTE *)(image + y * imagex + x);
|
|
388 |
AVI_CRAM_C1(i_ptr,clr,row_dec);
|
|
389 |
}
|
|
390 |
AVI_MIN_MAX_CHECK(x,y,min_x,max_x,min_y,max_y);
|
|
391 |
changed = 1; AVI_BLOCK_INC(x,y,imagex);
|
|
392 |
} /* end of single block */
|
|
393 |
} /* end of not term code */
|
|
394 |
} /* end of not while exit */
|
|
395 |
} /* end of 1 bytes pixel */
|
|
396 |
} /* end of map is TRUE */
|
|
397 |
else
|
|
398 |
{
|
|
399 |
while(!!exitflag)
|
|
400 |
{
|
|
401 |
code0 = *dptr++; code1 = *dptr++; block_cnt--;
|
|
402 |
if ( ((code1==0) && (code0==0) && !!block_cnt) || (y<0)) exitflag = 1;
|
|
403 |
else
|
|
404 |
{
|
|
405 |
if ((code1 >= 0x84) && (code1 <= 0x87)) /* skip */
|
|
406 |
{ ULONG skip = ((code1 - 0x84) << 8) + code0;
|
|
407 |
block_cnt -= (skip-1); while(skip--) AVI_BLOCK_INC(x,y,imagex);
|
|
408 |
} else /* single block encoded */
|
|
409 |
{
|
|
410 |
if (code1 >= 0x90) /* 8 color quadrant encoding */
|
|
411 |
{
|
|
412 |
UBYTE cA0,cA1,cB0,cB1;
|
|
413 |
UBYTE *i_ptr = (UBYTE *)(image + y * imagex + x);
|
|
414 |
cB0 = (UBYTE)*dptr++; cA0 = (UBYTE)*dptr++;
|
|
415 |
cB1 = (UBYTE)*dptr++; cA1 = (UBYTE)*dptr++;
|
|
416 |
AVI_CRAM_C4(i_ptr,code0,cA0,cA1,cB0,cB1,row_dec); i_ptr -=row_dec;
|
|
417 |
cB0 = (UBYTE)*dptr++; cA0 = (UBYTE)*dptr++;
|
|
418 |
cB1 = (UBYTE)*dptr++; cA1 = (UBYTE)*dptr++;
|
|
419 |
AVI_CRAM_C4(i_ptr,code1,cA0,cA1,cB0,cB1,row_dec);
|
|
420 |
}
|
|
421 |
else if (code1 < 0x80) /* 2 color encoding */
|
|
422 |
{ UBYTE clr_A,clr_B;
|
|
423 |
UBYTE *i_ptr = (UBYTE *)(image + y * imagex + x);
|
|
424 |
clr_B = (UBYTE)*dptr++; clr_A = (UBYTE)*dptr++;
|
|
425 |
AVI_CRAM_C2(i_ptr,code0,clr_A,clr_B,row_dec); i_ptr -= row_dec;
|
|
426 |
AVI_CRAM_C2(i_ptr,code1,clr_A,clr_B,row_dec);
|
|
427 |
} /* end of 2 color */
|
|
428 |
else /* 1 color encoding */
|
|
429 |
{
|
|
430 |
UBYTE clr = (UBYTE)code0;
|
|
431 |
UBYTE *i_ptr = (UBYTE *)(image + y * imagex + x);
|
|
432 |
AVI_CRAM_C1(i_ptr,clr,row_dec);
|
|
433 |
}
|
|
434 |
AVI_MIN_MAX_CHECK(x,y,min_x,max_x,min_y,max_y);
|
|
435 |
changed = 1; AVI_BLOCK_INC(x,y,imagex);
|
|
436 |
} /* end of single block */
|
|
437 |
} /* end of not term code */
|
|
438 |
} /* end of not while exit */
|
|
439 |
}
|
|
440 |
if (xa_optimize_flag == TRUE)
|
|
441 |
{
|
|
442 |
if (changed) { *xs=min_x; *ys=min_y - 3; *xe=max_x + 4; *ye=max_y + 1; }
|
|
443 |
else { *xs = *ys = *xe = *ye = 0; return(ACT_DLTA_NOP); }
|
|
444 |
}
|
|
445 |
else { *xs = *ys = 0; *xe = imagex; *ye = imagey; }
|
|
446 |
if (map_flag) return(ACT_DLTA_MAPD);
|
|
447 |
else return(ACT_DLTA_NORM);
|
|
448 |
}
|
|
449 |
|
|
450 |
"
|
|
451 |
|
|
452 |
'AVI_Decode_CRAM' infoPrint.
|
|
453 |
|
|
454 |
"
|
|
455 |
AVIReader fromFile:'/home2/pd_stuff/movies/avi/hangldm.avi'
|
|
456 |
"
|
|
457 |
|
|
458 |
"Created: 5.4.1997 / 16:06:10 / cg"
|
|
459 |
"Modified: 11.4.1997 / 14:03:32 / cg"
|
|
460 |
! !
|
|
461 |
|
|
462 |
!AVIReader methodsFor:'helpers'!
|
|
463 |
|
|
464 |
alignHeightTo:multiple
|
|
465 |
"make height a multiple of the argument"
|
|
466 |
|
|
467 |
height := multiple * ((height + multiple - 1) // multiple).
|
|
468 |
|
|
469 |
"Modified: 5.4.1997 / 14:47:36 / cg"
|
|
470 |
!
|
|
471 |
|
|
472 |
alignTo:multiple
|
|
473 |
"make width & height a multiple of the argument"
|
|
474 |
|
|
475 |
width := multiple * ((width + multiple - 1) // multiple).
|
|
476 |
height := multiple * ((height + multiple - 1) // multiple).
|
|
477 |
|
|
478 |
"Created: 5.4.1997 / 14:47:54 / cg"
|
|
479 |
!
|
|
480 |
|
|
481 |
alignWidthTo:multiple
|
|
482 |
"make height a multiple of the argument"
|
|
483 |
|
|
484 |
width := multiple * ((width + multiple - 1) // multiple).
|
|
485 |
|
|
486 |
"Created: 5.4.1997 / 14:47:16 / cg"
|
|
487 |
"Modified: 5.4.1997 / 14:47:41 / cg"
|
|
488 |
! !
|
|
489 |
|
|
490 |
!AVIReader methodsFor:'reading from stream'!
|
|
491 |
|
|
492 |
fromStream:aStream
|
|
493 |
"read a AVI-movie from aStream. Return a frame sequence."
|
|
494 |
|
|
495 |
inStream := aStream.
|
|
496 |
inStream binary.
|
|
497 |
|
|
498 |
[inStream atEnd] whileFalse:[
|
|
499 |
self getChunk
|
|
500 |
].
|
|
501 |
|
|
502 |
"/ return the first frame as image
|
|
503 |
|
|
504 |
colorMap := Colormap
|
|
505 |
redVector:redPalette
|
|
506 |
greenVector:greenPalette
|
|
507 |
blueVector:bluePalette.
|
|
508 |
|
|
509 |
photometric := #palette.
|
|
510 |
samplesPerPixel := 1.
|
|
511 |
bitsPerSample := #(8).
|
|
512 |
|
|
513 |
"
|
|
514 |
AVIReader fromFile:'/home2/pd_stuff/movies/avi/drlair.avi'
|
|
515 |
AVIReader fromFile:'/home2/pd_stuff/movies/avi/hangldm.avi'
|
|
516 |
"
|
|
517 |
|
|
518 |
"Created: 4.4.1997 / 22:35:53 / cg"
|
622
|
519 |
"Modified: 24.6.1997 / 15:58:29 / cg"
|
525
|
520 |
! !
|
|
521 |
|
|
522 |
!AVIReader ignoredMethodsFor:'reading from stream'!
|
|
523 |
|
|
524 |
getChunk
|
|
525 |
"get a single chunk"
|
|
526 |
|
|
527 |
|id sel sTyp|
|
|
528 |
|
|
529 |
'getChunk -> ' infoPrint.
|
|
530 |
|
|
531 |
id := ' '.
|
|
532 |
inStream nextBytes:4 into:id startingAt:1.
|
|
533 |
chunkSize := inStream nextLongMSB:false.
|
|
534 |
|
|
535 |
(id at:1) == $0 ifTrue:[
|
|
536 |
sTyp := streamTypes at:((id at:2) digitValue + 1).
|
|
537 |
sel := 'getChunk_' , sTyp , '_' , (id copyFrom:3).
|
|
538 |
|
|
539 |
"/id infoPrint. ' -> ' infoPrint. sel infoPrintCR.
|
|
540 |
sel := sel asSymbolIfInterned.
|
|
541 |
(sel isNil or:[(self respondsTo:sel) not]) ifTrue:[
|
|
542 |
sel := 'getChunk_' , sTyp , '_Unknown'.
|
|
543 |
"/' ' infoPrint. id infoPrint. ' -> ' infoPrint. sel infoPrintCR.
|
|
544 |
sel := sel asSymbolIfInterned.
|
|
545 |
(sel isNil or:[(self respondsTo:sel) not]) ifTrue:[
|
|
546 |
'[' infoPrint. ('getChunk_' , sTyp , '_' , (id copyFrom:3)) infoPrint. '] ' infoPrint.
|
|
547 |
sel := #'getChunk_Unknown'.
|
|
548 |
"/' ' infoPrint. id infoPrint. ' -> ' infoPrint. sel infoPrintCR.
|
|
549 |
].
|
|
550 |
]
|
|
551 |
] ifFalse:[
|
|
552 |
(id at:4) == Character space ifTrue:[
|
|
553 |
id := id copyTo:3
|
|
554 |
].
|
|
555 |
sel := ('getChunk_' , id) asSymbolIfInterned.
|
|
556 |
(sel isNil or:[(self respondsTo:sel) not]) ifTrue:[
|
|
557 |
'[' infoPrint. ('getChunk_' , id) infoPrint. '] ' infoPrint.
|
|
558 |
sel := #'getChunk_Unknown'
|
|
559 |
].
|
|
560 |
"/id infoPrint. ' -> ' infoPrint. sel infoPrintCR.
|
|
561 |
].
|
|
562 |
|
|
563 |
self perform:sel.
|
|
564 |
'' infoPrintCR.
|
|
565 |
|
|
566 |
"
|
|
567 |
AVIReader fromFile:'/home2/pd_stuff/movies/avi/hangldm.avi'
|
|
568 |
"
|
|
569 |
|
|
570 |
"Created: 4.4.1997 / 22:50:13 / cg"
|
|
571 |
"Modified: 5.4.1997 / 15:47:48 / cg"
|
|
572 |
! !
|
|
573 |
|
|
574 |
!AVIReader methodsFor:'reading from stream'!
|
|
575 |
|
|
576 |
getChunk_DISP
|
|
577 |
"process (ignore) a DISP chunk"
|
|
578 |
|
|
579 |
'getChunk_DISP -> ' infoPrint.
|
|
580 |
|
|
581 |
self skipChunk
|
|
582 |
|
|
583 |
"Created: 5.4.1997 / 15:19:10 / cg"
|
|
584 |
!
|
|
585 |
|
|
586 |
getChunk_ISBJ
|
|
587 |
"process (ignore) a ISBJ chunk"
|
|
588 |
|
|
589 |
'getChunk_ISBJ -> ' infoPrint.
|
|
590 |
|
|
591 |
self skipChunk
|
|
592 |
|
|
593 |
"Created: 5.4.1997 / 15:19:17 / cg"
|
|
594 |
!
|
|
595 |
|
|
596 |
getChunk_JUNK
|
|
597 |
"ignore JUNK chunk"
|
|
598 |
|
|
599 |
'getChunk_JUNK -> ' infoPrint.
|
|
600 |
|
|
601 |
self skipChunk
|
|
602 |
|
|
603 |
"
|
|
604 |
AVIReader fromFile:'/home2/pd_stuff/movies/avi/hangldm.avi'
|
|
605 |
"
|
|
606 |
|
|
607 |
"Created: 5.4.1997 / 14:12:27 / cg"
|
|
608 |
"Modified: 5.4.1997 / 14:34:47 / cg"
|
|
609 |
!
|
|
610 |
|
|
611 |
getChunk_LIST
|
|
612 |
"process a LIST chunk"
|
|
613 |
|
|
614 |
'getChunk_LIST' infoPrint.
|
|
615 |
|
|
616 |
inStream skip:4.
|
|
617 |
|
|
618 |
"
|
|
619 |
AVIReader fromFile:'/home2/pd_stuff/movies/avi/hangldm.avi'
|
|
620 |
"
|
|
621 |
|
|
622 |
"Created: 4.4.1997 / 23:18:33 / cg"
|
|
623 |
"Modified: 5.4.1997 / 14:34:45 / cg"
|
|
624 |
!
|
|
625 |
|
|
626 |
getChunk_RIFF
|
|
627 |
"process a RIFF chunk"
|
|
628 |
|
|
629 |
'getChunk_RIFF' infoPrint.
|
|
630 |
|
|
631 |
inStream skip:4.
|
|
632 |
|
|
633 |
"
|
|
634 |
AVIReader fromFile:'/home2/pd_stuff/movies/avi/hangldm.avi'
|
|
635 |
"
|
|
636 |
|
|
637 |
"Created: 4.4.1997 / 23:18:08 / cg"
|
|
638 |
"Modified: 5.4.1997 / 14:34:42 / cg"
|
|
639 |
!
|
|
640 |
|
|
641 |
getChunk_Unknown
|
|
642 |
"ignore any other chunk"
|
|
643 |
|
|
644 |
'getChunk_Unknown -> ' infoPrint.
|
|
645 |
|
|
646 |
self skipChunk
|
|
647 |
|
|
648 |
"
|
|
649 |
AVIReader fromFile:'/home2/pd_stuff/movies/avi/hangldm.avi'
|
|
650 |
"
|
|
651 |
|
|
652 |
"Created: 5.4.1997 / 00:03:43 / cg"
|
|
653 |
"Modified: 5.4.1997 / 14:34:39 / cg"
|
|
654 |
!
|
|
655 |
|
|
656 |
getChunk_auds
|
|
657 |
"process an auds chunk"
|
|
658 |
|
|
659 |
|format channels rate av_bps align size|
|
|
660 |
|
|
661 |
'getChunk_auds' infoPrint.
|
|
662 |
|
|
663 |
format := inStream nextShortMSB:false.
|
|
664 |
channels := inStream nextShortMSB:false.
|
|
665 |
rate := inStream nextLongMSB:false.
|
|
666 |
av_bps := inStream nextLongMSB:false.
|
|
667 |
align := inStream nextShortMSB:false.
|
|
668 |
size := inStream nextShortMSB:false.
|
|
669 |
|
|
670 |
inStream skip:(chunkSize - 16).
|
|
671 |
|
|
672 |
"
|
|
673 |
AVIReader fromFile:'/home2/pd_stuff/movies/avi/hangldm.avi'
|
|
674 |
"
|
|
675 |
|
|
676 |
"Created: 5.4.1997 / 00:01:15 / cg"
|
|
677 |
"Modified: 5.4.1997 / 14:34:36 / cg"
|
|
678 |
!
|
|
679 |
|
|
680 |
getChunk_auds_wb
|
|
681 |
"process (ignore for now) an auds chunk"
|
|
682 |
|
|
683 |
'getChunk_auds_wb -> ' infoPrint.
|
|
684 |
|
|
685 |
self skipChunk
|
|
686 |
|
|
687 |
"
|
|
688 |
AVIReader fromFile:'/home2/pd_stuff/movies/avi/hangldm.avi'
|
|
689 |
"
|
|
690 |
|
|
691 |
"Created: 5.4.1997 / 13:57:56 / cg"
|
|
692 |
"Modified: 5.4.1997 / 14:34:33 / cg"
|
|
693 |
!
|
|
694 |
|
|
695 |
getChunk_avih
|
|
696 |
"process an avih chunk"
|
|
697 |
|
|
698 |
|us_frame max_bps pad_gram flags tot_frames init_frames nstreams
|
|
699 |
sug_bsize scale rate start length|
|
|
700 |
|
|
701 |
'getChunk_avih' infoPrint.
|
|
702 |
|
|
703 |
chunkSize ~~ 56 ifTrue:[
|
|
704 |
self halt:'bad chunk size'.
|
|
705 |
].
|
|
706 |
|
|
707 |
us_frame := inStream nextLongMSB:false.
|
|
708 |
max_bps := inStream nextLongMSB:false.
|
|
709 |
pad_gram := inStream nextLongMSB:false.
|
|
710 |
flags := inStream nextLongMSB:false.
|
|
711 |
tot_frames := inStream nextLongMSB:false.
|
|
712 |
init_frames := inStream nextLongMSB:false.
|
|
713 |
nstreams := inStream nextLongMSB:false.
|
|
714 |
sug_bsize := inStream nextLongMSB:false.
|
|
715 |
width := inStream nextLongMSB:false.
|
|
716 |
height := inStream nextLongMSB:false.
|
|
717 |
scale := inStream nextLongMSB:false.
|
|
718 |
rate := inStream nextLongMSB:false.
|
|
719 |
start := inStream nextLongMSB:false.
|
|
720 |
length := inStream nextLongMSB:false.
|
|
721 |
|
|
722 |
streamTypes := OrderedCollection new:nstreams.
|
|
723 |
|
|
724 |
"
|
|
725 |
AVIReader fromFile:'/home2/pd_stuff/movies/avi/hangldm.avi'
|
|
726 |
"
|
|
727 |
|
|
728 |
"Created: 4.4.1997 / 23:19:37 / cg"
|
|
729 |
"Modified: 5.4.1997 / 14:34:30 / cg"
|
|
730 |
!
|
|
731 |
|
|
732 |
getChunk_hdrl
|
|
733 |
"process (ignore) a hdrl chunk"
|
|
734 |
|
|
735 |
'getChunk_hdrl -> ' infoPrint.
|
|
736 |
|
|
737 |
self skipChunk
|
|
738 |
|
|
739 |
"Created: 5.4.1997 / 15:18:07 / cg"
|
|
740 |
!
|
|
741 |
|
|
742 |
getChunk_idx1
|
|
743 |
"process (ignore) a idx1 chunk"
|
|
744 |
|
|
745 |
'getChunk_idx1 -> ' infoPrint.
|
|
746 |
|
|
747 |
self skipChunk
|
|
748 |
|
|
749 |
"Created: 5.4.1997 / 15:17:53 / cg"
|
|
750 |
!
|
|
751 |
|
|
752 |
getChunk_strf
|
|
753 |
"process a strf chunk"
|
|
754 |
|
|
755 |
|sel|
|
|
756 |
|
|
757 |
'getChunk_strf -> ' infoPrint.
|
|
758 |
|
|
759 |
sel := ('getChunk_' , streamType) asSymbolIfInterned.
|
|
760 |
(sel isNil or:[(self respondsTo:sel) not]) ifTrue:[
|
|
761 |
'[' infoPrint. ('getChunk_' , streamType) infoPrint. '] ' infoPrint.
|
|
762 |
sel := #'getChunk_Unknown'
|
|
763 |
].
|
|
764 |
self perform:sel.
|
|
765 |
|
|
766 |
"
|
|
767 |
AVIReader fromFile:'/home2/pd_stuff/movies/avi/hangldm.avi'
|
|
768 |
"
|
|
769 |
|
|
770 |
"Created: 4.4.1997 / 23:41:09 / cg"
|
|
771 |
"Modified: 5.4.1997 / 15:05:00 / cg"
|
|
772 |
!
|
|
773 |
|
|
774 |
getChunk_strh
|
|
775 |
"process a strh chunk"
|
|
776 |
|
|
777 |
|fcc_type fcc_handler priority flags rate init_frames streams
|
|
778 |
sug_bsize scale start length quality samp_size size|
|
|
779 |
|
|
780 |
'getChunk_strh' infoPrint.
|
|
781 |
|
|
782 |
chunkSize < 48 ifTrue:[
|
|
783 |
self halt:'bad chunk size'.
|
|
784 |
].
|
|
785 |
|
|
786 |
fcc_type := String new:4.
|
|
787 |
inStream nextBytes:4 into:fcc_type.
|
|
788 |
fcc_handler := inStream nextLongMSB:true.
|
|
789 |
flags := inStream nextLongMSB:false.
|
|
790 |
priority := inStream nextLongMSB:false.
|
|
791 |
init_frames := inStream nextLongMSB:false.
|
|
792 |
scale := inStream nextLongMSB:false.
|
|
793 |
rate := inStream nextLongMSB:false.
|
|
794 |
start := inStream nextLongMSB:false.
|
|
795 |
length := inStream nextLongMSB:false.
|
|
796 |
sug_bsize := inStream nextLongMSB:false.
|
|
797 |
quality := inStream nextLongMSB:false.
|
|
798 |
samp_size := inStream nextLongMSB:false.
|
|
799 |
|
|
800 |
size := chunkSize.
|
|
801 |
(size bitTest:1) ifTrue:[
|
|
802 |
size := size + 1
|
|
803 |
].
|
|
804 |
inStream skip:(size - 48).
|
|
805 |
|
|
806 |
streamTypes add:fcc_type.
|
|
807 |
streamType := fcc_type.
|
|
808 |
|
|
809 |
"
|
|
810 |
AVIReader fromFile:'/home2/pd_stuff/movies/avi/hangldm.avi'
|
|
811 |
"
|
|
812 |
|
|
813 |
"Created: 4.4.1997 / 23:25:54 / cg"
|
|
814 |
"Modified: 5.4.1997 / 14:34:23 / cg"
|
|
815 |
!
|
|
816 |
|
|
817 |
getChunk_strl
|
|
818 |
"process (ignore) a strl chunk"
|
|
819 |
|
|
820 |
'getChunk_strl -> ' infoPrint.
|
|
821 |
|
|
822 |
self skipChunk
|
|
823 |
|
|
824 |
"Created: 5.4.1997 / 15:18:01 / cg"
|
|
825 |
!
|
|
826 |
|
|
827 |
getChunk_vedt
|
|
828 |
"process (ignore) a vedt chunk"
|
|
829 |
|
|
830 |
'getChunk_vedt -> ' infoPrint.
|
|
831 |
|
|
832 |
self skipChunk
|
|
833 |
|
|
834 |
"Created: 5.4.1997 / 15:17:43 / cg"
|
|
835 |
!
|
|
836 |
|
|
837 |
getChunk_vids
|
|
838 |
"process a vids chunk"
|
|
839 |
|
|
840 |
|size sz
|
|
841 |
width height planes image_size
|
|
842 |
xpels_meter ypels_meter num_colors imp_colors
|
|
843 |
sel nMore|
|
|
844 |
|
|
845 |
'getChunk_vids -> ' infoPrint.
|
|
846 |
|
|
847 |
sz := chunkSize.
|
|
848 |
(sz bitTest:1) ifTrue:[
|
|
849 |
sz := sz + 1
|
|
850 |
].
|
|
851 |
colorTable := true.
|
|
852 |
|
|
853 |
size := inStream nextLongMSB:false.
|
|
854 |
width := inStream nextLongMSB:false.
|
|
855 |
height := inStream nextLongMSB:false.
|
|
856 |
planes := inStream nextShortMSB:false.
|
|
857 |
depth := inStream nextShortMSB:false.
|
|
858 |
compression := String new:4.
|
|
859 |
inStream nextBytes:4 into:compression.
|
|
860 |
image_size := inStream nextLongMSB:false.
|
|
861 |
xpels_meter := inStream nextLongMSB:false.
|
|
862 |
ypels_meter := inStream nextLongMSB:false.
|
|
863 |
num_colors := inStream nextLongMSB:false.
|
|
864 |
imp_colors := inStream nextLongMSB:false.
|
|
865 |
sz := sz - 40.
|
|
866 |
|
|
867 |
numColors := num_colors.
|
|
868 |
(numColors == 0 and:[depth <= 8]) ifTrue:[
|
|
869 |
numColors := 1 bitShift:depth.
|
|
870 |
].
|
|
871 |
|
|
872 |
sel := ('setupData_vids_' , compression) asSymbolIfInterned.
|
|
873 |
(sel isNil or:[(self respondsTo:sel) not]) ifTrue:[
|
|
874 |
'[' infoPrint. ('setupData_vids_' , compression) infoPrint. '] ' infoPrint.
|
|
875 |
sel := #'setupData_vids_Unknown'
|
|
876 |
].
|
|
877 |
|
|
878 |
"/ setup compression-specific data
|
|
879 |
self perform:sel.
|
|
880 |
|
|
881 |
"/ read a colorTable - if any
|
|
882 |
((depth <= 8) and:[colorTable]) ifTrue:[
|
|
883 |
redPalette := ByteArray new:256.
|
|
884 |
greenPalette := ByteArray new:256.
|
|
885 |
bluePalette := ByteArray new:256.
|
|
886 |
|
|
887 |
1 to:numColors do:[:i |
|
|
888 |
sz > 0 ifTrue:[
|
|
889 |
bluePalette at:i put:(inStream nextByte).
|
|
890 |
greenPalette at:i put:(inStream nextByte).
|
|
891 |
redPalette at:i put:(inStream nextByte).
|
|
892 |
inStream nextByte. "/ padding
|
|
893 |
sz := sz - 4.
|
|
894 |
].
|
|
895 |
]
|
|
896 |
].
|
|
897 |
|
|
898 |
"/ read more compression-specific data
|
|
899 |
sel := ('readData_vids2_' , compression) asSymbolIfInterned.
|
|
900 |
(sel isNil or:[(self respondsTo:sel) not]) ifTrue:[
|
|
901 |
] ifFalse:[
|
|
902 |
nMore := self perform:sel.
|
|
903 |
sz := sz - nMore.
|
|
904 |
].
|
|
905 |
|
|
906 |
inStream skip:sz.
|
|
907 |
|
|
908 |
"
|
|
909 |
AVIReader fromFile:'/home2/pd_stuff/movies/avi/hangldm.avi'
|
|
910 |
"
|
|
911 |
|
|
912 |
"Created: 4.4.1997 / 23:25:54 / cg"
|
|
913 |
"Modified: 5.4.1997 / 15:32:10 / cg"
|
|
914 |
!
|
|
915 |
|
|
916 |
getChunk_vids_dc
|
|
917 |
"process a vids chunk"
|
|
918 |
|
|
919 |
|sz data sel|
|
|
920 |
|
|
921 |
'getChunk_vids_dc -> ' infoPrint.
|
|
922 |
|
|
923 |
sz := chunkSize.
|
|
924 |
(sz bitTest:1) ifTrue:[
|
|
925 |
sz := sz + 1
|
|
926 |
].
|
|
927 |
|
|
928 |
sz == 0 ifTrue:[
|
|
929 |
"/ NOP wait frame
|
|
930 |
^ self
|
|
931 |
].
|
|
932 |
|
|
933 |
data := ByteArray new:sz.
|
|
934 |
inStream nextBytes:sz into:data startingAt:1.
|
|
935 |
|
|
936 |
sel := deltaMethod.
|
|
937 |
(self respondsTo:sel) not ifTrue:[
|
|
938 |
'[' infoPrint. deltaMethod infoPrint. '] ' infoPrint.
|
|
939 |
^ self
|
|
940 |
].
|
|
941 |
|
|
942 |
self perform:deltaMethod with:data.
|
|
943 |
|
|
944 |
"
|
|
945 |
AVIReader fromFile:'/home2/pd_stuff/movies/avi/hangldm.avi'
|
|
946 |
"
|
|
947 |
|
|
948 |
"Created: 5.4.1997 / 01:01:37 / cg"
|
|
949 |
"Modified: 5.4.1997 / 15:44:46 / cg"
|
|
950 |
!
|
|
951 |
|
|
952 |
readData_vids2_IJPG
|
|
953 |
"more extra data here"
|
|
954 |
|
|
955 |
|offset jsize format cspace|
|
|
956 |
|
|
957 |
'readData_vids2_IJPG' infoPrint.
|
|
958 |
|
|
959 |
offset := inStream nextLongMSB:false.
|
|
960 |
jsize := inStream nextLongMSB:false.
|
|
961 |
format := inStream nextLongMSB:false.
|
|
962 |
cspace := inStream nextLongMSB:false.
|
|
963 |
|
|
964 |
self JFIF_Read_IJPG_Tables.
|
|
965 |
|
|
966 |
^ 16 + 128.
|
|
967 |
|
|
968 |
"Created: 5.4.1997 / 15:08:04 / cg"
|
|
969 |
!
|
|
970 |
|
|
971 |
readData_vids2_JPEG
|
|
972 |
"more extra data here"
|
|
973 |
|
|
974 |
|offset jsize format cspace bits hsubsamp vsubsamp|
|
|
975 |
|
|
976 |
'readData_vids2_IJPG' infoPrint.
|
|
977 |
|
|
978 |
offset := inStream nextLongMSB:false.
|
|
979 |
jsize := inStream nextLongMSB:false.
|
|
980 |
format := inStream nextLongMSB:false.
|
|
981 |
cspace := inStream nextLongMSB:false.
|
|
982 |
bits := inStream nextLongMSB:false.
|
|
983 |
hsubsamp := inStream nextLongMSB:false.
|
|
984 |
vsubsamp := inStream nextLongMSB:false.
|
|
985 |
|
|
986 |
^ 28.
|
|
987 |
|
|
988 |
"Created: 5.4.1997 / 15:08:43 / cg"
|
|
989 |
!
|
|
990 |
|
|
991 |
setupData_vids_CRAM
|
|
992 |
"CRAM specific setup"
|
|
993 |
|
|
994 |
'setupData_vids_CRAM' infoPrint.
|
|
995 |
|
|
996 |
"/ need to be multiple of 4
|
|
997 |
self alignTo:4.
|
|
998 |
|
|
999 |
depth == 8 ifTrue:[
|
|
1000 |
deltaMethod := #AVI_Decode_CRAM:
|
|
1001 |
] ifFalse:[
|
|
1002 |
depth == 16 ifTrue:[
|
|
1003 |
deltaMethod := #AVI_Decode_CRAM16:
|
|
1004 |
] ifFalse:[
|
|
1005 |
"/ 'AVI [info]: CRAM but depth ~~ 8/16 format not supported' errorPrintCR.
|
|
1006 |
UnsupportedFormatErrorSignal raiseErrorString:'CRAM but depth ~~ 8/16'.
|
|
1007 |
]
|
|
1008 |
]
|
|
1009 |
|
|
1010 |
"Modified: 5.4.1997 / 15:42:12 / cg"
|
|
1011 |
!
|
|
1012 |
|
|
1013 |
setupData_vids_CVID
|
|
1014 |
"CVID specific setup"
|
|
1015 |
|
|
1016 |
'setupData_vids_CVID' infoPrint.
|
|
1017 |
|
|
1018 |
"/ 'AVI [info]: Radius Cinepak format not supported' errorPrintCR.
|
|
1019 |
UnsupportedFormatErrorSignal raiseErrorString:'Radius Cinepak format not supported'.
|
|
1020 |
|
|
1021 |
"Modified: 5.4.1997 / 15:42:38 / cg"
|
|
1022 |
!
|
|
1023 |
|
|
1024 |
setupData_vids_IJPG
|
|
1025 |
"IJPG specific setup"
|
|
1026 |
|
|
1027 |
'setupData_vids_IJPG' infoPrint.
|
|
1028 |
|
|
1029 |
"/ need to be multiple of 4@2
|
|
1030 |
self alignWidthTo:4.
|
|
1031 |
self alignHeightTo:2.
|
|
1032 |
|
|
1033 |
depth > 8 ifTrue:[
|
|
1034 |
self QT_Gen_YUV_Tabs.
|
|
1035 |
] ifFalse:[
|
|
1036 |
colorTable := false
|
|
1037 |
].
|
|
1038 |
self jpg_alloc_MCU_bufs:width.
|
|
1039 |
|
|
1040 |
depth ~~ 24 ifTrue:[
|
|
1041 |
"/ 'AVI [info]: IJPG but depth ~~ 24' errorPrintCR.
|
|
1042 |
UnsupportedFormatErrorSignal raiseErrorString:'IJPG but depth ~~ 24'.
|
|
1043 |
^ self
|
|
1044 |
].
|
|
1045 |
deltaMethod := #JFIF_Decode_JPEG:
|
|
1046 |
|
|
1047 |
"Modified: 5.4.1997 / 15:55:55 / cg"
|
|
1048 |
!
|
|
1049 |
|
|
1050 |
setupData_vids_IV31
|
|
1051 |
"IV31 specific setup"
|
|
1052 |
|
|
1053 |
'setupData_vids_IV31' infoPrint.
|
|
1054 |
|
|
1055 |
"/ 'AVI [info]: AVI: Intel Indeo Video Codec Not Supported' errorPrintCR.
|
|
1056 |
UnsupportedFormatErrorSignal raiseErrorString:'AVI: Intel Indeo Video Codec Not Supported'.
|
|
1057 |
|
|
1058 |
"Created: 5.4.1997 / 15:56:43 / cg"
|
|
1059 |
!
|
|
1060 |
|
|
1061 |
setupData_vids_IV32
|
|
1062 |
"IV32 specific setup"
|
|
1063 |
|
|
1064 |
'setupData_vids_IV32' infoPrint.
|
|
1065 |
|
|
1066 |
"/ 'AVI [info]: AVI: Intel Indeo Video Codec Not Supported' errorPrintCR.
|
|
1067 |
UnsupportedFormatErrorSignal raiseErrorString:'AVI: Intel Indeo Video Codec Not Supported'.
|
|
1068 |
|
|
1069 |
"Created: 5.4.1997 / 15:56:49 / cg"
|
|
1070 |
!
|
|
1071 |
|
|
1072 |
setupData_vids_JPEG
|
|
1073 |
"JPEG specific setup"
|
|
1074 |
|
|
1075 |
'setupData_vids_JPEG' infoPrint.
|
|
1076 |
|
|
1077 |
"/ need to be multiple of 4@2
|
|
1078 |
self alignWidthTo:4.
|
|
1079 |
self alignHeightTo:2.
|
|
1080 |
|
|
1081 |
depth > 8 ifTrue:[
|
|
1082 |
self QT_Gen_YUV_Tabs.
|
|
1083 |
] ifFalse:[
|
|
1084 |
colorTable := false
|
|
1085 |
].
|
|
1086 |
self jpg_alloc_MCU_bufs:width.
|
|
1087 |
|
|
1088 |
depth ~~ 8 ifTrue:[
|
|
1089 |
depth ~~ 24 ifTrue:[
|
|
1090 |
"/ 'AVI [info]: JPEG but depth ~~ 8/24' errorPrintCR.
|
|
1091 |
UnsupportedFormatErrorSignal raiseErrorString:'JPEG but depth ~~ 8/24'.
|
|
1092 |
^ self
|
|
1093 |
]
|
|
1094 |
].
|
|
1095 |
deltaMethod := #JFIF_Decode_JPEG:
|
|
1096 |
|
|
1097 |
"Created: 5.4.1997 / 15:29:54 / cg"
|
|
1098 |
"Modified: 5.4.1997 / 15:55:05 / cg"
|
|
1099 |
!
|
|
1100 |
|
|
1101 |
setupData_vids_MJPG
|
|
1102 |
"MJPG specific setup"
|
|
1103 |
|
|
1104 |
'setupData_vids_MJPG' infoPrint.
|
|
1105 |
|
|
1106 |
UnsupportedFormatErrorSignal raiseErrorString:'MJPG not yet supported'.
|
|
1107 |
|
|
1108 |
"/ need to be multiple of 4@2
|
|
1109 |
self alignWidthTo:4.
|
|
1110 |
self alignHeightTo:2.
|
|
1111 |
|
|
1112 |
depth > 8 ifTrue:[
|
|
1113 |
self QT_Gen_YUV_Tabs.
|
|
1114 |
] ifFalse:[
|
|
1115 |
colorTable := false
|
|
1116 |
].
|
|
1117 |
self jpg_alloc_MCU_bufs:width.
|
|
1118 |
|
|
1119 |
"Created: 5.4.1997 / 15:29:54 / cg"
|
|
1120 |
"Modified: 5.4.1997 / 15:53:08 / cg"
|
|
1121 |
!
|
|
1122 |
|
|
1123 |
setupData_vids_MSVC
|
|
1124 |
"MSVC specific setup"
|
|
1125 |
|
|
1126 |
'setupData_vids_MSVC' infoPrint.
|
|
1127 |
|
|
1128 |
"/ need to be multiple of 4
|
|
1129 |
self alignTo:4.
|
|
1130 |
|
|
1131 |
depth == 8 ifTrue:[
|
|
1132 |
deltaMethod := #AVI_Decode_CRAM:
|
|
1133 |
] ifFalse:[
|
|
1134 |
depth == 16 ifTrue:[
|
|
1135 |
deltaMethod := #AVI_Decode_CRAM16:
|
|
1136 |
] ifFalse:[
|
|
1137 |
"/ 'AVI [info]: MSVC but depth ~~ 8/16 format not supported' errorPrintCR.
|
|
1138 |
UnsupportedFormatErrorSignal raiseErrorString:'MSVC but depth ~~ 8/16'.
|
|
1139 |
]
|
|
1140 |
]
|
|
1141 |
|
|
1142 |
"Created: 5.4.1997 / 15:29:54 / cg"
|
|
1143 |
"Modified: 5.4.1997 / 15:41:56 / cg"
|
|
1144 |
!
|
|
1145 |
|
|
1146 |
setupData_vids_NONE
|
|
1147 |
"NONE specific setup"
|
|
1148 |
|
|
1149 |
'setupData_vids_NONE' infoPrint.
|
|
1150 |
|
|
1151 |
"Created: 5.4.1997 / 15:29:54 / cg"
|
|
1152 |
"Modified: 5.4.1997 / 15:34:25 / cg"
|
|
1153 |
!
|
|
1154 |
|
|
1155 |
setupData_vids_PACK
|
|
1156 |
"PACK specific setup"
|
|
1157 |
|
|
1158 |
'setupData_vids_PACK' infoPrint.
|
|
1159 |
|
|
1160 |
"Created: 5.4.1997 / 15:29:54 / cg"
|
|
1161 |
"Modified: 5.4.1997 / 15:34:31 / cg"
|
|
1162 |
!
|
|
1163 |
|
|
1164 |
setupData_vids_RGB
|
|
1165 |
"RGB specific setup"
|
|
1166 |
|
|
1167 |
'setupData_vids_RGB' infoPrint.
|
|
1168 |
|
|
1169 |
depth == 8 ifTrue:[
|
|
1170 |
deltaMethod := #AVI_Decode_RGB:
|
|
1171 |
] ifFalse:[
|
|
1172 |
depth == 24 ifTrue:[
|
|
1173 |
deltaMethod := #AVI_Decode_RGB24:
|
|
1174 |
] ifFalse:[
|
|
1175 |
"/ 'AVI [info]: RGB but depth ~~ 8/24 format not supported' errorPrintCR.
|
|
1176 |
UnsupportedFormatErrorSignal raiseErrorString:'RGB but depth ~~ 8/24'.
|
|
1177 |
]
|
|
1178 |
]
|
|
1179 |
|
|
1180 |
"Modified: 5.4.1997 / 15:41:56 / cg"
|
|
1181 |
"Created: 5.4.1997 / 15:48:47 / cg"
|
|
1182 |
!
|
|
1183 |
|
|
1184 |
setupData_vids_RLE4
|
|
1185 |
"RLE4 specific setup"
|
|
1186 |
|
|
1187 |
'setupData_vids_RLE4' infoPrint.
|
|
1188 |
|
|
1189 |
"Created: 5.4.1997 / 15:29:54 / cg"
|
|
1190 |
"Modified: 5.4.1997 / 15:34:38 / cg"
|
|
1191 |
!
|
|
1192 |
|
|
1193 |
setupData_vids_RLE8
|
|
1194 |
"RLE8 specific setup"
|
|
1195 |
|
|
1196 |
'setupData_vids_RLE8' infoPrint.
|
|
1197 |
|
|
1198 |
depth ~~ 8 ifTrue:[
|
|
1199 |
"/ 'AVI [info]: RLE8 but depth ~~ 8 format not supported' errorPrintCR.
|
|
1200 |
UnsupportedFormatErrorSignal raiseErrorString:'RLE8 but depth ~~ 8'.
|
|
1201 |
^ self
|
|
1202 |
].
|
|
1203 |
deltaMethod := #AVI_Decode_RLE8:
|
|
1204 |
|
|
1205 |
"Created: 5.4.1997 / 15:29:54 / cg"
|
|
1206 |
"Modified: 5.4.1997 / 15:43:22 / cg"
|
|
1207 |
!
|
|
1208 |
|
|
1209 |
setupData_vids_RT21
|
|
1210 |
"RT21 specific setup"
|
|
1211 |
|
|
1212 |
'setupData_vids_RT21' infoPrint.
|
|
1213 |
|
|
1214 |
"/ 'AVI [info]: AVI: Intel Indeo Video Codec Not Supported' errorPrintCR.
|
|
1215 |
UnsupportedFormatErrorSignal raiseErrorString:'AVI: Intel Indeo Video Codec Not Supported'.
|
|
1216 |
|
|
1217 |
"Created: 5.4.1997 / 15:56:37 / cg"
|
|
1218 |
!
|
|
1219 |
|
|
1220 |
setupData_vids_TRAN
|
|
1221 |
"TRAN specific setup"
|
|
1222 |
|
|
1223 |
'setupData_vids_TRAN' infoPrint.
|
|
1224 |
|
|
1225 |
"Created: 5.4.1997 / 15:29:54 / cg"
|
|
1226 |
"Modified: 5.4.1997 / 15:34:53 / cg"
|
|
1227 |
!
|
|
1228 |
|
|
1229 |
setupData_vids_ULTI
|
|
1230 |
"ULTI specific setup"
|
|
1231 |
|
|
1232 |
'setupData_vids_ULTI' infoPrint.
|
|
1233 |
|
|
1234 |
depth == 16 ifTrue:[
|
|
1235 |
deltaMethod := #AVI_Decode_ULTI:
|
|
1236 |
] ifFalse:[
|
|
1237 |
"/ 'AVI [info]: ULTI depth ~~ 16 format not supported' errorPrintCR.
|
|
1238 |
UnsupportedFormatErrorSignal raiseErrorString:'ULTI depth ~~ 16'.
|
|
1239 |
^ self.
|
|
1240 |
].
|
|
1241 |
|
|
1242 |
"/ need to be multiple of 8
|
|
1243 |
self alignTo:8.
|
|
1244 |
|
|
1245 |
self AVI_ULTI_Gen_YUV.
|
|
1246 |
self AVI_Ulti_Gen_LTC.
|
|
1247 |
|
|
1248 |
"Created: 5.4.1997 / 15:29:54 / cg"
|
|
1249 |
"Modified: 5.4.1997 / 15:46:14 / cg"
|
|
1250 |
!
|
|
1251 |
|
|
1252 |
setupData_vids_Unknown
|
|
1253 |
"ignore an unknown vids chunk"
|
|
1254 |
|
|
1255 |
'setupData_vids_Unknown' infoPrint.
|
|
1256 |
|
|
1257 |
"Created: 5.4.1997 / 15:29:54 / cg"
|
|
1258 |
"Modified: 5.4.1997 / 15:32:52 / cg"
|
|
1259 |
!
|
|
1260 |
|
|
1261 |
setupData_vids_XMPG
|
|
1262 |
"XMPG specific setup"
|
|
1263 |
|
|
1264 |
'setupData_vids_XMPG' infoPrint.
|
|
1265 |
|
|
1266 |
"/ need to be multiple of 4
|
|
1267 |
self alignTo:4.
|
|
1268 |
|
|
1269 |
self QT_Gen_YUV_Tabs.
|
|
1270 |
self jpg_alloc_MCU_bufs:width.
|
|
1271 |
self jpg_setup_samp_limit_table.
|
|
1272 |
self mpg_init_stuff.
|
|
1273 |
|
|
1274 |
deltaMethod := #MPG_Decode_I:
|
|
1275 |
|
|
1276 |
"Modified: 5.4.1997 / 15:49:53 / cg"
|
|
1277 |
!
|
|
1278 |
|
|
1279 |
setupData_vids_YUV9
|
|
1280 |
"YUV9 specific setup"
|
|
1281 |
|
|
1282 |
'setupData_vids_YUV9' infoPrint.
|
|
1283 |
|
|
1284 |
self QT_Gen_YUV_Tabs.
|
|
1285 |
self jpg_setup_samp_limit_table.
|
|
1286 |
|
|
1287 |
"/ need to be multiple of 4
|
|
1288 |
self alignTo:4.
|
|
1289 |
|
|
1290 |
deltaMethod := #AVI_Decode_YUV9:
|
|
1291 |
|
|
1292 |
"Created: 5.4.1997 / 15:29:54 / cg"
|
|
1293 |
"Modified: 5.4.1997 / 15:49:19 / cg"
|
|
1294 |
!
|
|
1295 |
|
|
1296 |
setupData_vids_YVU9
|
|
1297 |
"YVU9 specific setup"
|
|
1298 |
|
|
1299 |
'setupData_vids_YVU9' infoPrint.
|
|
1300 |
|
|
1301 |
self QT_Gen_YUV_Tabs.
|
|
1302 |
self jpg_setup_samp_limit_table.
|
|
1303 |
|
|
1304 |
"/ need to be multiple of 4
|
|
1305 |
self alignTo:4.
|
|
1306 |
|
|
1307 |
deltaMethod := #AVI_Decode_YUV9:
|
|
1308 |
|
|
1309 |
"Modified: 5.4.1997 / 15:49:32 / cg"
|
|
1310 |
!
|
|
1311 |
|
|
1312 |
setupData_vids_cvid
|
|
1313 |
"same as CVID"
|
|
1314 |
|
|
1315 |
'setupData_vids_cvid' infoPrint.
|
|
1316 |
compression := 'CVID'.
|
|
1317 |
^ self setupData_vids_CVID.
|
|
1318 |
|
|
1319 |
"Created: 5.4.1997 / 15:29:54 / cg"
|
|
1320 |
"Modified: 5.4.1997 / 15:35:32 / cg"
|
|
1321 |
!
|
|
1322 |
|
|
1323 |
setupData_vids_iv31
|
|
1324 |
"same as IV31"
|
|
1325 |
|
|
1326 |
'setupData_vids_iv31' infoPrint.
|
|
1327 |
compression := 'IV31'.
|
|
1328 |
^ self setupData_vids_IV31.
|
|
1329 |
|
|
1330 |
"Created: 5.4.1997 / 15:29:54 / cg"
|
|
1331 |
"Modified: 5.4.1997 / 15:35:39 / cg"
|
|
1332 |
!
|
|
1333 |
|
|
1334 |
setupData_vids_iv32
|
|
1335 |
"same as IV32"
|
|
1336 |
|
|
1337 |
'setupData_vids_iv32' infoPrint.
|
|
1338 |
compression := 'IV32'.
|
|
1339 |
^ self setupData_vids_IV32.
|
|
1340 |
|
|
1341 |
"Created: 5.4.1997 / 15:29:55 / cg"
|
|
1342 |
"Modified: 5.4.1997 / 15:35:45 / cg"
|
|
1343 |
!
|
|
1344 |
|
|
1345 |
setupData_vids_jpeg
|
|
1346 |
"same as JPEG"
|
|
1347 |
|
|
1348 |
'setupData_vids_jpeg' infoPrint.
|
|
1349 |
compression := 'JPEG'.
|
|
1350 |
^ self setupData_vids_JPEG.
|
|
1351 |
|
|
1352 |
"Created: 5.4.1997 / 15:29:55 / cg"
|
|
1353 |
"Modified: 5.4.1997 / 15:35:53 / cg"
|
|
1354 |
!
|
|
1355 |
|
|
1356 |
setupData_vids_none
|
|
1357 |
"same as NONE"
|
|
1358 |
|
|
1359 |
'setupData_vids_none' infoPrint.
|
|
1360 |
compression := 'NONE'.
|
|
1361 |
^ self setupData_vids_NONE.
|
|
1362 |
|
|
1363 |
"Created: 5.4.1997 / 15:29:55 / cg"
|
|
1364 |
"Modified: 5.4.1997 / 15:36:02 / cg"
|
|
1365 |
!
|
|
1366 |
|
|
1367 |
setupData_vids_pack
|
|
1368 |
"same as PACK"
|
|
1369 |
|
|
1370 |
'setupData_vids_pack' infoPrint.
|
|
1371 |
compression := 'PACK'.
|
|
1372 |
^ self setupData_vids_PACK.
|
|
1373 |
|
|
1374 |
"Created: 5.4.1997 / 15:29:55 / cg"
|
|
1375 |
"Modified: 5.4.1997 / 15:36:08 / cg"
|
|
1376 |
!
|
|
1377 |
|
|
1378 |
setupData_vids_rle4
|
|
1379 |
"same as RLE4"
|
|
1380 |
|
|
1381 |
'setupData_vids_rle4' infoPrint.
|
|
1382 |
compression := 'RLE4'.
|
|
1383 |
^ self setupData_vids_RLE4.
|
|
1384 |
|
|
1385 |
"Created: 5.4.1997 / 15:29:55 / cg"
|
|
1386 |
"Modified: 5.4.1997 / 15:36:14 / cg"
|
|
1387 |
!
|
|
1388 |
|
|
1389 |
setupData_vids_rle8
|
|
1390 |
"same as RLE8"
|
|
1391 |
|
|
1392 |
'setupData_vids_rle8' infoPrint.
|
|
1393 |
compression := 'RLE8'.
|
|
1394 |
^ self setupData_vids_RLE8.
|
|
1395 |
|
|
1396 |
"Created: 5.4.1997 / 15:29:55 / cg"
|
|
1397 |
"Modified: 5.4.1997 / 15:36:21 / cg"
|
|
1398 |
!
|
|
1399 |
|
|
1400 |
setupData_vids_rt21
|
|
1401 |
"same as RT21"
|
|
1402 |
|
|
1403 |
'setupData_vids_rt21' infoPrint.
|
|
1404 |
compression := 'RT21'.
|
|
1405 |
^ self setupData_vids_RT21.
|
|
1406 |
|
|
1407 |
"Created: 5.4.1997 / 15:29:55 / cg"
|
|
1408 |
"Modified: 5.4.1997 / 15:36:28 / cg"
|
|
1409 |
!
|
|
1410 |
|
|
1411 |
setupData_vids_tran
|
|
1412 |
"same as TRAN"
|
|
1413 |
|
|
1414 |
'setupData_vids_tran' infoPrint.
|
|
1415 |
compression := 'TRAN'.
|
|
1416 |
^ self setupData_vids_TRAN.
|
|
1417 |
|
|
1418 |
"Created: 5.4.1997 / 15:29:55 / cg"
|
|
1419 |
"Modified: 5.4.1997 / 15:36:35 / cg"
|
|
1420 |
!
|
|
1421 |
|
|
1422 |
setupData_vids_xmpg
|
|
1423 |
"same as XMPG"
|
|
1424 |
|
|
1425 |
'setupData_vids_xmpg' infoPrint.
|
|
1426 |
compression := 'XMPG'.
|
|
1427 |
^ self setupData_vids_XMPG.
|
|
1428 |
|
|
1429 |
"Created: 5.4.1997 / 15:29:55 / cg"
|
|
1430 |
"Modified: 5.4.1997 / 15:36:43 / cg"
|
|
1431 |
!
|
|
1432 |
|
|
1433 |
skipChunk
|
|
1434 |
"skip a chunk"
|
|
1435 |
|
|
1436 |
|sz|
|
|
1437 |
|
|
1438 |
'skipChunk' infoPrint.
|
|
1439 |
|
|
1440 |
sz := chunkSize.
|
|
1441 |
(sz bitTest:1) ifTrue:[
|
|
1442 |
sz := sz + 1
|
|
1443 |
].
|
|
1444 |
|
|
1445 |
inStream skip:sz.
|
|
1446 |
|
|
1447 |
"
|
|
1448 |
AVIReader fromFile:'/home2/pd_stuff/movies/avi/hangldm.avi'
|
|
1449 |
"
|
|
1450 |
|
|
1451 |
"Created: 5.4.1997 / 14:13:43 / cg"
|
|
1452 |
"Modified: 5.4.1997 / 14:34:07 / cg"
|
|
1453 |
! !
|
|
1454 |
|
|
1455 |
!AVIReader class methodsFor:'documentation'!
|
|
1456 |
|
|
1457 |
version
|
622
|
1458 |
^ '$Header: /cvs/stx/stx/libview2/AVIReader.st,v 1.7 1997-06-24 14:19:35 cg Exp $'
|
525
|
1459 |
! !
|
|
1460 |
AVIReader initialize!
|