File: mpeg.h

package info (click to toggle)
libmpeg1 1.3.1-2.1
  • links: PTS
  • area: main
  • in suites: sarge, woody
  • size: 784 kB
  • ctags: 644
  • sloc: ansic: 8,520; sh: 1,333; makefile: 169
file content (119 lines) | stat: -rw-r--r-- 3,058 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/* ----------------------------- MNI Header -----------------------------------
@NAME       : mpeg.h
@INPUT      : 
@OUTPUT     : 
@RETURNS    : 
@DESCRIPTION: Types and function prototypes needed for applications to
              use the Berkely MPEG decoding engine via the MNI front
              end.
@METHOD     : 
@GLOBALS    : Types defined:
                 ImageDesc  - structure giving height, width, etc.
                 DitherEnum - the different dither types supported by
                              the decoding engine
@CALLS      : 
@CREATED    : Greg Ward, 94/6/16.
@MODIFIED   : Greg Ward, 94/9/12 (based on John Cristy's fixes): made
              more amenable to use with other libraries that also
	      happen to define TRUE, FALSE, [Bb]oolean, and added
	      PROTO macro
---------------------------------------------------------------------------- */

#ifndef __MPEG_H
#define __MPEG_H

#include <stdio.h>

/* An attempt at a portable and integrable boolean type... */

#if (!defined(TRUE) || !defined(FALSE))
# define TRUE 1
# define FALSE 0
#endif

#if (!defined (BOOLEAN_TYPE_EXISTS))
typedef unsigned int Boolean;
#endif

typedef struct
{
   short red, green, blue;
} ColormapEntry;

typedef struct
{
   int	Height;			/* in pixels */
   int  Width;
   int  Depth;			/* image depth (bits) */
   int  PixelSize;              /* bits actually stored per pixel */
   int  Size;			/* bytes for whole image */
   int  BitmapPad;              /* "quantum" of a scanline -- each scanline */
				/* starts on an even interval of this */
                                /* many bits */
   int  PictureRate;		/* required number of frames/sec [?] */
   int  BitRate;		/* ??? */
   
   int  ColormapSize;
   ColormapEntry *Colormap;	/* an array of ColormapSize entries */
} ImageDesc;

typedef enum 
{
   HYBRID_DITHER,
   HYBRID2_DITHER,
   FS4_DITHER,
   FS2_DITHER,
   FS2FAST_DITHER,
   Twox2_DITHER,
   GRAY_DITHER,
   FULL_COLOR_DITHER,
   NO_DITHER,
   ORDERED_DITHER,
   MONO_DITHER,
   MONO_THRESHOLD,
   ORDERED2_DITHER,
   MBORDERED_DITHER
} DitherEnum;


typedef enum
{
   MPEG_DITHER,
   MPEG_QUIET,
   MPEG_LUM_RANGE,
   MPEG_CR_RANGE,
   MPEG_CB_RANGE,
   MPEG_CMAP_INDEX
} MPEGOptionEnum;

#ifdef __cplusplus
extern "C" {
#endif

/* 
 * Kludge so we can compile under ANSI or K&R.  (This only means
 * that programs that *use* mpeg_lib can be compiled with K&R;
 * the library itself must be compiled with an ANSI compiler.
 * Mixing and matching compilers, BTW, is not a good idea...)
 */
#undef PROTO
#if __STDC__ || __cplusplus
#define PROTO(formal_parameters) formal_parameters
#else
#define const
#define PROTO(formal_parameters) ()
#endif

/* Function prototypes (all are defined in wrapper.c) */

Boolean OpenMPEG PROTO((FILE *MPEGfile, ImageDesc *ImgInfo));
void    CloseMPEG PROTO((void));
Boolean RewindMPEG PROTO((FILE *MPEGfile, ImageDesc *Image));
void    SetMPEGOption PROTO((MPEGOptionEnum Option, int value));
Boolean GetMPEGFrame PROTO((char *Frame));

#ifdef __cplusplus
}
#endif

#endif   /* __MPEG_H */