Subversion Repositories shark

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 pj 1
/*
2
 * Copyright (c) 1995 The Regents of the University of California.
3
 * All rights reserved.
4
 *
5
 * Permission to use, copy, modify, and distribute this software and its
6
 * documentation for any purpose, without fee, and without written agreement is
7
 * hereby granted, provided that the above copyright notice and the following
8
 * two paragraphs appear in all copies of this software.
9
 *
10
 * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
11
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
12
 * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
13
 * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
 *
15
 * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
16
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
17
 * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
18
 * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
19
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
20
 */
21
 
22
/*
23
 * Portions of this software Copyright (c) 1995 Brown University.
24
 * All rights reserved.
25
 *
26
 * Permission to use, copy, modify, and distribute this software and its
27
 * documentation for any purpose, without fee, and without written agreement
28
 * is hereby granted, provided that the above copyright notice and the
29
 * following two paragraphs appear in all copies of this software.
30
 *
31
 * IN NO EVENT SHALL BROWN UNIVERSITY BE LIABLE TO ANY PARTY FOR
32
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
33
 * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF BROWN
34
 * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35
 *
36
 * BROWN UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
37
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
38
 * PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"
39
 * BASIS, AND BROWN UNIVERSITY HAS NO OBLIGATION TO PROVIDE MAINTENANCE,
40
 * SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
41
 */
42
 
43
#ifdef __STDC__
44
# define        P(s) s
45
#include <stdlib.h>     /* used by almost all modules */
46
#else
47
# define P(s) ()
48
#endif
49
 
50
/* util.c */
51
void correct_underflow P((VidStream *vid_stream ));
52
int next_bits P((int num , unsigned int mask , VidStream *vid_stream ));
53
char *get_ext_data P((VidStream *vid_stream ));
54
int next_start_code P((VidStream *vid_stream));
55
char *get_extra_bit_info P((VidStream *vid_stream ));
56
 
57
/* video.c */
58
void init_stats P((void ));
59
void PrintAllStats P((VidStream *vid_stream ));
60
double ReadSysClock P((void ));
61
void PrintTimeInfo P(( VidStream *vid_stream ));
62
void InitCrop P((void ));
63
VidStream *NewVidStream P((unsigned int buffer_len ));
64
#ifndef NOCONTROLS
65
void ResetVidStream P((VidStream *vid ));
66
#endif
67
void DestroyVidStream P((VidStream *astream, XInfo *xinfo ));
68
PictImage *NewPictImage P(( VidStream *vid_stream, XInfo *xinfo ));
69
void DestroyPictImage P((PictImage *apictimage, XInfo *xinfo ));
70
VidStream *mpegVidRsrc P((TimeStamp time_stamp,VidStream *vid_stream, int first , XInfo *xinfo));
71
void SetBFlag P((BOOLEAN val ));
72
void SetPFlag P((BOOLEAN val ));
73
 
74
/* parseblock.c */
75
void ParseReconBlock P((int n, VidStream *vid_stream ));
76
void ParseAwayBlock P((int n , VidStream *vid_stream ));
77
 
78
/* motionvector.c */
79
void ComputeForwVector P((int *recon_right_for_ptr , int *recon_down_for_ptr , VidStream *the_stream ));
80
void ComputeBackVector P((int *recon_right_back_ptr , int *recon_down_back_ptr, VidStream *the_stream ));
81
 
82
/* decoders.c */
83
void init_tables P((void ));
84
void decodeDCTDCSizeLum P((unsigned int *value ));
85
void decodeDCTDCSizeChrom P((unsigned int *value ));
86
void decodeDCTCoeffFirst P((unsigned int *run , int *level ));
87
void decodeDCTCoeffNext P((unsigned int *run , int *level ));
88
 
89
/* from main.c or equivalent */
90
void DoDitherImage P(( VidStream *vid_stream ));
91
 
92
/* gdith.c */
93
void InitColor P((void ));
94
/*int HandleXError P((Display *dpy , XErrorEvent *event ));
95
void InstallXErrorHandler P(( Display *display ));
96
void DeInstallXErrorHandler P(( Display *display ));*/
97
void ResizeDisplay P((unsigned int w , unsigned int h, XInfo *xinfo ));
98
void InitDisplay P((char *name , XInfo *xinfo ));
99
void InitGrayDisplay P((char *name, XInfo *xinfo ));
100
void InitGray256Display P((char *name, XInfo *xinfo ));
101
void InitMonoDisplay P((char *name, XInfo *xinfo ));
102
void InitColorDisplay P((char *name , XInfo *xinfo ));
103
#ifndef NOCONTROLS
104
void ExecuteDisplay P((VidStream *vid_stream , int frame_increment , XInfo *xinfo));
105
#else
106
void ExecuteDisplay P((VidStream *vid_stream, XInfo *xinfo ));
107
#endif
108
void ExecutePPM P((VidStream *vid_stream ));
109
#ifdef NO_GETTIMEOFDAY
110
struct timeval {long tv_sec, tv_usec;}; /* secs and usecs since 1-jan-1970 */
111
int gettimeofday P((struct timeval * retval, void * unused));
112
#endif
113
 
114
/* fs2.c */
115
void InitFS2Dither P((void ));
116
void FS2DitherImage P((unsigned char *lum , unsigned char *cr , unsigned char *cb , unsigned char *disp , int rows , int cols ));
117
 
118
/* fs2fast.c */
119
void InitFS2FastDither P((void ));
120
void FS2FastDitherImage P((unsigned char *lum , unsigned char *cr , unsigned char *cb , unsigned char *out , int h , int w ));
121
 
122
/* fs4.c */
123
void InitFS4Dither P((void ));
124
void FS4DitherImage P((unsigned char *lum , unsigned char *cr , unsigned char *cb , unsigned char *disp , int rows , int cols ));
125
 
126
/* hybrid.c */
127
void InitHybridDither P((void ));
128
void HybridDitherImage P((unsigned char *lum , unsigned char *cr , unsigned char *cb , unsigned char *out , int h , int w ));
129
 
130
/* hybriderr.c */
131
void InitHybridErrorDither P((void ));
132
void HybridErrorDitherImage P((unsigned char *lum , unsigned char *cr , unsigned char *cb , unsigned char *out , int h , int w ));
133
 
134
/* 2x2.c */
135
void Init2x2Dither P((void ));
136
void RandInit P((int h , int w ));
137
void PostInit2x2Dither P((void ));
138
void Twox2DitherImage P((unsigned char *lum , unsigned char *cr , unsigned char *cb , unsigned char *out , int h , int w ));
139
 
140
/* gray.c */
141
void GrayDitherImage P((unsigned char *lum , unsigned char *cr , unsigned char *cb , unsigned char *out , int h , int w ));
142
void Gray2DitherImage P((unsigned char *lum , unsigned char *cr , unsigned char *cb , unsigned char *out , int h , int w ));
143
void Gray16DitherImage P((unsigned char *lum , unsigned char *cr , unsigned char *cb , unsigned char *out , int h , int w ));
144
void Gray216DitherImage P((unsigned char *lum , unsigned char *cr , unsigned char *cb , unsigned char *out , int h , int w ));
145
void Gray32DitherImage P((unsigned char *lum , unsigned char *cr , unsigned char *cb , unsigned char *out , int h , int w ));
146
void Gray232DitherImage P((unsigned char *lum , unsigned char *cr , unsigned char *cb , unsigned char *out , int h , int w ));
147
 
148
/* mono.c */
149
void MonoThresholdImage(unsigned char *lum, unsigned char *cr, unsigned char *cb, unsigned char *out, int h, int w);
150
void MonoDitherImage(unsigned char *lum, unsigned char *cr, unsigned char *cb, unsigned char *out, int h, int w);
151
 
152
/* jrevdct.c */
153
void init_pre_idct P((void ));
154
void j_rev_dct_sparse P((DCTBLOCK data , int pos ));
155
void j_rev_dct P((DCTBLOCK data ));
156
void j_rev_dct_sparse P((DCTBLOCK data , int pos ));
157
void j_rev_dct P((DCTBLOCK data ));
158
 
159
/* floatdct.c */
160
void init_float_idct P((void ));
161
void float_idct P((short* block ));
162
 
163
/* 16bit.c */
164
void InitColorDither P((int ));
165
void Color16DitherImage P((unsigned char *lum , unsigned char *cr , unsigned char *cb , unsigned char *out , int rows , int cols ));
166
void Color32DitherImage P((unsigned char *lum , unsigned char *cr , unsigned char *cb , unsigned char *out , int rows , int cols ));
167
 
168
/* 16bit2x2.c */
169
void Twox2Color16DitherImage P((unsigned char *lum , unsigned char *cr , unsigned char *cb , unsigned char *out , int rows , int cols ));
170
void Twox2Color32DitherImage P((unsigned char *lum , unsigned char *cr , unsigned char *cb , unsigned char *out , int rows , int cols ));
171
 
172
/* util32.c */
173
/*Visual *FindFullColorVisual P((Display *dpy , int *depth ));
174
void CreateFullColorWindow P(( XInfo *xinfo));*/
175
 
176
/* ordered.c */
177
void InitOrderedDither P((void ));
178
void OrderedDitherImage P((unsigned char *lum , unsigned char *cr , unsigned char *cb , unsigned char *out , int h , int w ));
179
 
180
/* ordered2.c */
181
void InitOrdered2Dither P((void ));
182
void Ordered2DitherImage P((unsigned char *lum , unsigned char *cr , unsigned char *cb , unsigned char *out , int h , int w ));
183
 
184
/* mb_ordered.c */
185
void InitMBOrderedDither P((void ));
186
void MBOrderedDitherImage P((unsigned char *lum , unsigned char *cr , unsigned char *cb , unsigned char *out , int h , int w, char *ditherFlags ));
187
void MBOrderedDitherDisplayCopy P((VidStream *vid_stream , int mb_addr , int motion_forw , int r_right_forw , int r_down_forw , int motion_back , int r_right_back , int r_down_back , unsigned char *past , unsigned char *future ));
188
 
189
/* readfile.c */
190
void SeekStream P((VidStream *vid_stream ));
191
void clear_data_stream P(( VidStream *vid_stream));
192
int get_more_data P(( VidStream *vid_stream ));
193
int pure_get_more_data P((unsigned int *buf_start , int max_length , int *length_ptr , unsigned int **buf_ptr, VidStream *vid_stream ));
194
int read_sys P(( VidStream *vid_stream, unsigned int start ));
195
int ReadStartCode P(( unsigned int *startCode, VidStream *vid_stream ));
196
 
197
int ReadPackHeader P((
198
   double *systemClockTime,
199
   unsigned long *muxRate,
200
   VidStream *vid_stream ));
201
 
202
int ReadSystemHeader P(( VidStream *vid_stream ));
203
 
204
int find_start_code P(( FILE *input ));
205
 
206
int ReadPacket P(( unsigned char packetID, VidStream *vid_stream ));
207
 
208
void ReadTimeStamp P((
209
   unsigned char *inputBuffer,
210
   unsigned char *hiBit,
211
   unsigned long *low4Bytes));
212
 
213
void ReadSTD P((
214
   unsigned char *inputBuffer,
215
   unsigned char *stdBufferScale,
216
   unsigned long *stdBufferSize));
217
 
218
void ReadRate P((
219
   unsigned char *inputBuffer,
220
   unsigned long *rate));
221
 
222
int MakeFloatClockTime P((
223
   unsigned char hiBit,
224
   unsigned long low4Bytes,
225
   double *floatClockTime));
226
 
227
 
228
#ifndef NOCONTROLS
229
/* ctrlbar.c */
230
double StopWatch P((int action ));
231
Bool WindowMapped P((Display *dsp, XEvent *xev, char *window ));
232
Bool IfEventType P((Display *dsp, XEvent *xev, char *type ));
233
void MakeControlBar P(( XInfo *xinfo ));
234
void UpdateFrameTotal P((Display *display));
235
void UpdateControlDisplay P((Display *display));
236
void ControlBar P((VidStream **vid_stream, XInfo *xinfo, int numMovies ));
237
void ControlLoop P((VidStream **theStream, XInfo *xinfo, int numStreams ));
238
#endif /* !NOCONTROLS */
239
 
240
#undef P