]> Creatis software - gdcm.git/blob - src/gdcmmpeg2/src/mpeg2enc/mpeg2enc.h
ENH: Continue cleaning of open/write/seek ...
[gdcm.git] / src / gdcmmpeg2 / src / mpeg2enc / mpeg2enc.h
1 /* mpg2enc.h, defines and types                                             */
2
3 /* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
4
5 /*
6  * Disclaimer of Warranty
7  *
8  * These software programs are available to the user without any license fee or
9  * royalty on an "as is" basis.  The MPEG Software Simulation Group disclaims
10  * any and all warranties, whether express, implied, or statuary, including any
11  * implied warranties or merchantability or of fitness for a particular
12  * purpose.  In no event shall the copyright-holder be liable for any
13  * incidental, punitive, or consequential damages of any kind whatsoever
14  * arising from the use of these programs.
15  *
16  * This disclaimer of warranty extends to the user of these programs and user's
17  * customers, employees, agents, transferees, successors, and assigns.
18  *
19  * The MPEG Software Simulation Group does not represent or warrant that the
20  * programs furnished hereunder are free of infringement of any third-party
21  * patents.
22  *
23  * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
24  * are subject to royalty fees to patent holders.  Many of these patents are
25  * general enough such that they are unavoidable regardless of implementation
26  * design.
27  *
28  */
29
30 #define PICTURE_START_CODE 0x100L
31 #define SLICE_MIN_START    0x101L
32 #define SLICE_MAX_START    0x1AFL
33 #define USER_START_CODE    0x1B2L
34 #define SEQ_START_CODE     0x1B3L
35 #define EXT_START_CODE     0x1B5L
36 #define SEQ_END_CODE       0x1B7L
37 #define GOP_START_CODE     0x1B8L
38 #define ISO_END_CODE       0x1B9L
39 #define PACK_START_CODE    0x1BAL
40 #define SYSTEM_START_CODE  0x1BBL
41
42 /* picture coding type */
43 #define I_TYPE 1
44 #define P_TYPE 2
45 #define B_TYPE 3
46 #define D_TYPE 4
47
48 /* picture structure */
49 #define TOP_FIELD     1
50 #define BOTTOM_FIELD  2
51 #define FRAME_PICTURE 3
52
53 /* macroblock type */
54 #define MB_INTRA    1
55 #define MB_PATTERN  2
56 #define MB_BACKWARD 4
57 #define MB_FORWARD  8
58 #define MB_QUANT    16
59
60 /* motion_type */
61 #define MC_FIELD 1
62 #define MC_FRAME 2
63 #define MC_16X8  2
64 #define MC_DMV   3
65
66 /* mv_format */
67 #define MV_FIELD 0
68 #define MV_FRAME 1
69
70 /* chroma_format */
71 #define CHROMA420 1
72 #define CHROMA422 2
73 #define CHROMA444 3
74
75 /* extension start code IDs */
76
77 #define SEQ_ID       1
78 #define DISP_ID      2
79 #define QUANT_ID     3
80 #define SEQSCAL_ID   5
81 #define PANSCAN_ID   7
82 #define CODING_ID    8
83 #define SPATSCAL_ID  9
84 #define TEMPSCAL_ID 10
85
86 /* inputtype */
87 #define T_Y_U_V 0
88 #define T_YUV   1
89 #define T_PPM   2
90
91 /* macroblock information */
92 struct mbinfo {
93   int mb_type; /* intra/forward/backward/interpolated */
94   int motion_type; /* frame/field/16x8/dual_prime */
95   int dct_type; /* field/frame DCT */
96   int mquant; /* quantization parameter */
97   int cbp; /* coded block pattern */
98   int skipped; /* skipped macroblock */
99   int MV[2][2][2]; /* motion vectors */
100   int mv_field_sel[2][2]; /* motion vertical field select */
101   int dmvector[2]; /* dual prime vectors */
102   double act; /* activity measure */
103   int var; /* for debugging */
104 };
105
106 /* motion data */
107 struct motion_data {
108   int forw_hor_f_code,forw_vert_f_code; /* vector range */
109   int sxf,syf; /* search range */
110   int back_hor_f_code,back_vert_f_code;
111   int sxb,syb;
112 };