Subversion Repositories shark

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 pj 1
/*
2
 * Copyright (c) 1994 by Gregory P. Ward.
3
 * All rights reserved.
4
 *
5
 * This file is part of the MNI front end of the Berkeley MPEG decoder.
6
 *
7
 * Permission to use, copy, modify, and distribute this software and its
8
 * documentation for any purpose, without fee, and without written agreement is
9
 * hereby granted, provided that the above copyright notice and the following
10
 * two paragraphs appear in all copies of this software.
11
 *
12
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT,
13
 * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
14
 * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE
15
 * UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
16
 * SUCH DAMAGE.
17
 *
18
 * THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT
19
 * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20
 * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER
21
 * IS ON AN "AS IS" BASIS, AND THE AUTHOR HAS NO OBLIGATION TO PROVIDE
22
 * MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.  
23
 */
24
/*
25
 * Portions of this software Copyright (c) 1995 Brown University.
26
 * All rights reserved.
27
 *
28
 * Permission to use, copy, modify, and distribute this software and its
29
 * documentation for any purpose, without fee, and without written agreement
30
 * is hereby granted, provided that the above copyright notice and the
31
 * following two paragraphs appear in all copies of this software.
32
 *
33
 * IN NO EVENT SHALL BROWN UNIVERSITY BE LIABLE TO ANY PARTY FOR DIRECT,
34
 * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
35
 * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF BROWN
36
 * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37
 *
38
 * BROWN UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
39
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
40
 * PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"
41
 * BASIS, AND BROWN UNIVERSITY HAS NO OBLIGATION TO PROVIDE MAINTENANCE,
42
 * SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
43
 */
44
 
45
/* ----------------------------- MNI Header -----------------------------------
46
@NAME       : mpeg.h
47
@INPUT      :
48
@OUTPUT     :
49
@RETURNS    :
50
@DESCRIPTION: Types and function prototypes needed for applications to
51
              use the Berkely MPEG decoding engine via the MNI front
52
              end.
53
@METHOD     :
54
@GLOBALS    : Types defined:
55
                 ImageDesc  - structure giving height, width, etc.
56
                 DitherEnum - the different dither types supported by
57
                              the decoding engine
58
@CALLS      :
59
@CREATED    : Greg Ward, 94/6/16.
60
@MODIFIED   : Greg Ward, 94/9/12 (based on John Cristy's fixes): made
61
              more amenable to use with other libraries that also
62
              happen to define TRUE, FALSE, [Bb]oolean, and added
63
              PROTO macro
64
---------------------------------------------------------------------------- */
65
 
66
#ifndef __MPEG_H
67
#define __MPEG_H
68
 
69
#include <stdio.h>
70
 
71
/* An attempt at a portable and integrable boolean type... */
72
 
73
#if (!defined(TRUE) || !defined(FALSE))
74
# define TRUE (char) 1
75
# define FALSE (char) 0
76
#endif
77
 
78
#ifndef BOOLEAN_TYPE_EXISTS
79
typedef char Boolean;
80
#define BOOLEAN_TYPE_EXISTS
81
#endif
82
 
83
typedef struct
84
{
85
   short red, green, blue;
86
} ColormapEntry;
87
 
88
typedef struct
89
{
90
   int  Height;                 /* in pixels */
91
   int  Width;
92
   int  Depth;                  /* image depth (bits) */
93
   int  PixelSize;              /* bits actually stored per pixel */
94
   int  Size;                   /* bytes for whole image */
95
   int  BitmapPad;              /* "quantum" of a scanline -- each scanline */
96
                                /* starts on an even interval of this */
97
                                /* many bits */
98
   int  PictureRate;            /* required number of frames/sec [?] */
99
   int  BitRate;                /* ??? */
100
 
101
   VidStream *vid_stream;       /* Pointer to the vid stream itself */
102
 
103
   int  ColormapSize;
104
   ColormapEntry *Colormap;     /* an array of ColormapSize entries */
105
} ImageDesc;
106
 
107
#define DitherEnum int
108
 
109
typedef enum
110
{
111
   MPEG_DITHER,
112
   MPEG_QUIET,
113
   MPEG_LUM_RANGE,
114
   MPEG_CR_RANGE,
115
   MPEG_CB_RANGE,
116
   MPEG_CMAP_INDEX
117
} MPEGOptionEnum;
118
 
119
/* Kludge so we can compile under ANSI or K&R */
120
 
121
#undef PROTO
122
#if defined(__STDC__) || defined(__cplusplus)
123
#define PROTO(formal_parameters) formal_parameters
124
#else
125
#define const
126
#define PROTO(formal_parameters) ()
127
#endif
128
 
129
/* Function prototypes (all are defined in wrapper.c) */
130
 
131
Boolean OpenMPEG PROTO((FILE *MPEGfile, ImageDesc *ImgInfo));
132
void    CloseMPEG PROTO((ImageDesc *ImgInfo));
133
void    RewindMPEG PROTO((FILE *MPEGfile, ImageDesc *Image));
134
void    SetMPEGOption PROTO((ImageDesc *Info, MPEGOptionEnum Option, int value));
135
Boolean GetMPEGFrame PROTO((ImageDesc *image, char *Frame));
136
 
137
#endif   /* __MPEG_H */