[cvs] / xvidcore / src / global.h Repository:
ViewVC logotype

Diff of /xvidcore/src/global.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.21.2.2, Sun Mar 16 12:04:14 2003 UTC revision 1.21.2.9, Tue Sep 30 18:20:31 2003 UTC
# Line 1  Line 1 
1    /*****************************************************************************
2     *
3     *  XVID MPEG-4 VIDEO CODEC
4     *  - Global definitions  -
5     *
6     *  Copyright(C) 2002 Michael Militzer <isibaar@xvid.org>
7     *
8     *  This program is free software ; you can redistribute it and/or modify
9     *  it under the terms of the GNU General Public License as published by
10     *  the Free Software Foundation ; either version 2 of the License, or
11     *  (at your option) any later version.
12     *
13     *  This program is distributed in the hope that it will be useful,
14     *  but WITHOUT ANY WARRANTY ; without even the implied warranty of
15     *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16     *  GNU General Public License for more details.
17     *
18     *  You should have received a copy of the GNU General Public License
19     *  along with this program ; if not, write to the Free Software
20     *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21     *
22     * $Id$
23     *
24     ****************************************************************************/
25    
26  #ifndef _GLOBAL_H_  #ifndef _GLOBAL_H_
27  #define _GLOBAL_H_  #define _GLOBAL_H_
28    
# Line 24  Line 49 
49  #define MODE_DIRECT_NO4V        5  #define MODE_DIRECT_NO4V        5
50    
51    
52  // vop coding types  /*
53  // intra, prediction, backward, sprite, not_coded   * vop coding types
54     * intra, prediction, backward, sprite, not_coded
55     */
56  #define I_VOP   0  #define I_VOP   0
57  #define P_VOP   1  #define P_VOP   1
58  #define B_VOP   2  #define B_VOP   2
# Line 71  Line 98 
98    
99  typedef struct  typedef struct
100  {  {
101          int num_wp;             //      [input]: 0=none, 1=translation, 2,3 = warping          int num_wp;             /* [input]: 0=none, 1=translation, 2,3 = warping */
102                                                          //  a value of -1 means: "structure not initialized!"                                                          /* a value of -1 means: "structure not initialized!" */
103          int s;                                  //  [input]: calc is done with 1/s pel resolution          int s;                                  /* [input]: calc is done with 1/s pel resolution */
104    
105          int W;          int W;
106          int H;          int H;
# Line 105  Line 132 
132          int dxF, dyF, dxG, dyG;          int dxF, dyF, dxG, dyG;
133          int Fo, Go;          int Fo, Go;
134          int cFo, cGo;          int cFo, cGo;
135  }  } GMC_DATA;
 GMC_DATA;  
136    
137    typedef struct _NEW_GMC_DATA
138    {
139       /*  0=none, 1=translation, 2,3 = warping
140            *  a value of -1 means: "structure not initialized!" */
141            int num_wp;
142    
143            /* {0,1,2,3}  =>   {1/2,1/4,1/8,1/16} pel */
144            int accuracy;
145    
146            /* sprite size * 16 */
147            int sW, sH;
148    
149            /* gradient, calculated from warp points */
150            int dU[2], dV[2], Uo, Vo, Uco, Vco;
151    
152            void (*predict_16x16)(const struct _NEW_GMC_DATA * const This,
153                                                      uint8_t *dst, const uint8_t *src,
154                                                      int dststride, int srcstride, int x, int y, int rounding);
155            void (*predict_8x8)  (const struct _NEW_GMC_DATA * const This,
156                                                      uint8_t *uDst, const uint8_t *uSrc,
157                                                      uint8_t *vDst, const uint8_t *vSrc,
158                                                      int dststride, int srcstride, int x, int y, int rounding);
159            void (*get_average_mv)(const struct _NEW_GMC_DATA * const Dsp, VECTOR * const mv,
160                                                       int x, int y, int qpel);
161    } NEW_GMC_DATA;
162    
163  typedef struct  typedef struct
164  {  {
# Line 127  Line 178 
178          uint32_t *tail;          uint32_t *tail;
179          uint32_t *start;          uint32_t *start;
180          uint32_t length;          uint32_t length;
181            uint32_t initpos;
182  }  }
183  Bitstream;  Bitstream;
184    
# Line 136  Line 188 
188    
189  typedef struct  typedef struct
190  {  {
191          // decoder/encoder          /* decoder/encoder */
192          VECTOR mvs[4];          VECTOR mvs[4];
193    
194          short int pred_values[6][MBPRED_SIZE];          short int pred_values[6][MBPRED_SIZE];
195          int acpred_directions[6];          int acpred_directions[6];
196    
197          int mode;          int mode;
198          int quant;                                      // absolute quant          int quant;                                      /* absolute quant */
199    
200          int field_dct;          int field_dct;
201          int field_pred;          int field_pred;
202          int field_for_top;          int field_for_top;
203          int field_for_bot;          int field_for_bot;
204    
205          // encoder specific          /* encoder specific */
206    
207          VECTOR mv16;          VECTOR mv16;
208          VECTOR pmvs[4];          VECTOR pmvs[4];
209          VECTOR qmvs[4];                         // mvs in quarter pixel resolution          VECTOR qmvs[4];                         /* mvs in quarter pixel resolution */
210    
211          int32_t sad8[4];                        // SAD values for inter4v-VECTORs          int32_t sad8[4];                        /* SAD values for inter4v-VECTORs */
212          int32_t sad16;                          // SAD value for inter-VECTOR          int32_t sad16;                          /* SAD value for inter-VECTOR */
213    
214          int dquant;          int dquant;
215          int cbp;          int cbp;
216    
217          // bframe stuff          /* bframe stuff */
218    
219          VECTOR b_mvs[4];          VECTOR b_mvs[4];
220          VECTOR b_qmvs[4];          VECTOR b_qmvs[4];
221    
222          int mb_type;          int mb_type;
223    
224          // stuff for block based ME (needed for Qpel ME)          /*
225          // backup of last integer ME vectors/sad           * stuff for block based ME (needed for Qpel ME)
226             * backup of last integer ME vectors/sad
227             */
228    
229          VECTOR amv; // average motion vectors from GMC          VECTOR amv; /* average motion vectors from GMC  */
230          int32_t mcsel;          int32_t mcsel;
231    
232  /* This structure has become way to big! What to do? Split it up?   */  /* This structure has become way to big! What to do? Split it up?   */
# Line 202  Line 256 
256                  return quant - 6;                  return quant - 6;
257  }  }
258    
259  // useful macros  /* useful macros */
260    
261  #define MIN(X, Y) ((X)<(Y)?(X):(Y))  #define MIN(X, Y) ((X)<(Y)?(X):(Y))
262  #define MAX(X, Y) ((X)>(Y)?(X):(Y))  #define MAX(X, Y) ((X)>(Y)?(X):(Y))
263  #define ABS(X)    (((X)>0)?(X):-(X))  /* #define ABS(X)    (((X)>0)?(X):-(X)) */
264  #define SIGN(X)   (((X)>0)?1:-1)  #define SIGN(X)   (((X)>0)?1:-1)
265  #define CLIP(X,AMIN,AMAX)   (((X)<(AMIN)) ? (AMIN) : ((X)>(AMAX)) ? (AMAX) : (X))  #define CLIP(X,AMIN,AMAX)   (((X)<(AMIN)) ? (AMIN) : ((X)>(AMAX)) ? (AMAX) : (X))
266  #define DIV_DIV(a,b)    (((a)>0) ? ((a)+((b)>>1))/(b) : ((a)-((b)>>1))/(b))  #define DIV_DIV(a,b)    (((a)>0) ? ((a)+((b)>>1))/(b) : ((a)-((b)>>1))/(b))

Legend:
Removed from v.1.21.2.2  
changed lines
  Added in v.1.21.2.9

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4