[svn] / branches / dev-api-3 / xvidcore / src / global.h Repository:
ViewVC logotype

Diff of /branches/dev-api-3/xvidcore/src/global.h

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

trunk/xvidcore/src/global.h revision 101, Fri Apr 5 14:40:36 2002 UTC branches/dev-api-3/xvidcore/src/global.h revision 530, Mon Sep 23 20:36:02 2002 UTC
# Line 4  Line 4 
4  #include "xvid.h"  #include "xvid.h"
5  #include "portab.h"  #include "portab.h"
6    
7  /* --- macroblock stuff --- */  /* --- macroblock modes --- */
8    
9  #define MODE_INTER              0  #define MODE_INTER              0
10  #define MODE_INTER_Q    1  #define MODE_INTER_Q    1
# Line 14  Line 14 
14  #define MODE_STUFFING   7  #define MODE_STUFFING   7
15  #define MODE_NOT_CODED  16  #define MODE_NOT_CODED  16
16    
17    /* --- bframe specific --- */
18    
19    #define MODE_DIRECT                     0
20    #define MODE_INTERPOLATE        1
21    #define MODE_BACKWARD           2
22    #define MODE_FORWARD            3
23    #define MODE_DIRECT_NONE_MV     4
24    #define MODE_DIRECT_NO4V        5
25    
26    
27  typedef struct  typedef struct
28  {  {
29          uint32_t bufa;          uint32_t bufa;
# Line 34  Line 44 
44  {  {
45          // decoder/encoder          // decoder/encoder
46          VECTOR mvs[4];          VECTOR mvs[4];
         uint32_t sad8[4];               // SAD values for inter4v-VECTORs  
         uint32_t sad16;                 // SAD value for inter-VECTOR  
47    
48      short int pred_values[6][MBPRED_SIZE];      short int pred_values[6][MBPRED_SIZE];
49      int acpred_directions[6];      int acpred_directions[6];
# Line 50  Line 58 
58    
59          // encoder specific          // encoder specific
60    
61            VECTOR mv16;
62          VECTOR pmvs[4];          VECTOR pmvs[4];
63    
64            int32_t sad8[4];                        // SAD values for inter4v-VECTORs
65            int32_t sad16;                          // SAD value for inter-VECTOR
66    
67          int dquant;          int dquant;
68          int cbp;          int cbp;
69    
70  } MACROBLOCK;          // bframe stuff
71    
72  static __inline int8_t get_dc_scaler(int32_t quant, uint32_t lum)          VECTOR b_mvs[4];
73  {  //      VECTOR b_pmvs[1];
     int8_t dc_scaler;  
74    
75          if(quant > 0 && quant < 5) {          // bframe direct mode
         dc_scaler = 8;  
                 return dc_scaler;  
         }  
76    
77          if(quant < 25 && !lum) {  //      VECTOR directmv[4];
78          dc_scaler = (quant + 13) >> 1;  //      VECTOR deltamv;
                 return dc_scaler;  
         }  
79    
80          if(quant < 9) {          int mb_type;
81          dc_scaler = quant << 1;          int dbquant;
82                  return dc_scaler;  
83          }          // stuff for block based ME (needed for Qpel ME)
84            // backup of last integer ME vectors/sad
85    
86            VECTOR i_mv16;
87            VECTOR i_mvs[4];
88    
89            int32_t i_sad8[4];      // SAD values for inter4v-VECTORs
90            int32_t i_sad16;        // SAD value for inter-VECTOR
91    
     if(quant < 25) {  
         dc_scaler = quant + 8;  
                 return dc_scaler;  
92          }          }
93    MACROBLOCK;
94    
95    static __inline int8_t
96    get_dc_scaler(uint32_t quant,
97                              uint32_t lum)
98    {
99            if (quant < 5)
100                    return 8;
101    
102            if (quant < 25 && !lum)
103                    return (quant + 13) / 2;
104    
105            if (quant < 9)
106                    return 2 * quant;
107    
108            if (quant < 25)
109                    return quant + 8;
110    
111          if(lum)          if(lum)
112                  dc_scaler = (quant << 1) - 16;                  return 2 * quant - 16;
113          else          else
114          dc_scaler = quant - 6;                  return quant - 6;
   
     return dc_scaler;  
115  }  }
116    
117    // useful macros
118    
119    #define MIN(X, Y) ((X)<(Y)?(X):(Y))
120    #define MAX(X, Y) ((X)>(Y)?(X):(Y))
121    #define ABS(X)    (((X)>0)?(X):-(X))
122    #define SIGN(X)   (((X)>0)?1:-1)
123    
124    
125  #endif /* _GLOBAL_H_ */  #endif /* _GLOBAL_H_ */

Legend:
Removed from v.101  
changed lines
  Added in v.530

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