[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.5, Sat Apr 13 16:30:01 2002 UTC revision 1.13.2.4, Sun Dec 8 05:38:56 2002 UTC
# Line 11  Line 11 
11  #define MODE_INTER4V    2  #define MODE_INTER4V    2
12  #define MODE_INTRA              3  #define MODE_INTRA              3
13  #define MODE_INTRA_Q    4  #define MODE_INTRA_Q    4
 #define MODE_STUFFING   7  
14  #define MODE_NOT_CODED  16  #define MODE_NOT_CODED  16
15    
16  /* --- bframe specific --- */  /* --- bframe specific --- */
# Line 20  Line 19 
19  #define MODE_INTERPOLATE        1  #define MODE_INTERPOLATE        1
20  #define MODE_BACKWARD           2  #define MODE_BACKWARD           2
21  #define MODE_FORWARD            3  #define MODE_FORWARD            3
22    #define MODE_DIRECT_NONE_MV     4
23    #define MODE_DIRECT_NO4V        5
24    
25    
26  typedef struct  typedef struct
# Line 42  Line 43 
43  {  {
44          // decoder/encoder          // decoder/encoder
45          VECTOR mvs[4];          VECTOR mvs[4];
         uint32_t sad8[4];               // SAD values for inter4v-VECTORs  
         uint32_t sad16;                 // SAD value for inter-VECTOR  
46    
47      short int pred_values[6][MBPRED_SIZE];      short int pred_values[6][MBPRED_SIZE];
48      int acpred_directions[6];      int acpred_directions[6];
# Line 58  Line 57 
57    
58          // encoder specific          // encoder specific
59    
60            VECTOR mv16;
61          VECTOR pmvs[4];          VECTOR pmvs[4];
62            VECTOR qmvs[4];                         // mvs in quarter pixel resolution
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          // bframe stuff          // bframe stuff
71    
72          VECTOR b_mvs[4];          VECTOR b_mvs[4];
73          VECTOR b_pmvs[4];          VECTOR b_qmvs[4];
74    //      VECTOR b_pmvs[1];
75    
76  } MACROBLOCK;          // bframe direct mode
77    
78  static __inline int8_t get_dc_scaler(int32_t quant, uint32_t lum)  //      VECTOR directmv[4];
79  {  //      VECTOR deltamv;
     int8_t dc_scaler;  
80    
81          if(quant > 0 && quant < 5) {          int mb_type;
82          dc_scaler = 8;          int dbquant;
                 return dc_scaler;  
         }  
83    
84          if(quant < 25 && !lum) {          // stuff for block based ME (needed for Qpel ME)
85          dc_scaler = (quant + 13) >> 1;          // backup of last integer ME vectors/sad
86                  return dc_scaler;  
87          }  //      VECTOR i_mv16;
88            VECTOR i_mvs[4];
89    
90            int32_t i_sad8[4];      // SAD values for inter4v-VECTORs
91    //      int32_t i_sad16;        // SAD value for inter-VECTOR
92    
         if(quant < 9) {  
         dc_scaler = quant << 1;  
                 return dc_scaler;  
         }  
93    
     if(quant < 25) {  
         dc_scaler = quant + 8;  
                 return dc_scaler;  
94          }          }
95    MACROBLOCK;
96    
97    static __inline int8_t
98    get_dc_scaler(uint32_t quant,
99                              uint32_t lum)
100    {
101            if (quant < 5)
102                    return 8;
103    
104            if (quant < 25 && !lum)
105                    return (quant + 13) / 2;
106    
107            if (quant < 9)
108                    return 2 * quant;
109    
110            if (quant < 25)
111                    return quant + 8;
112    
113          if(lum)          if(lum)
114                  dc_scaler = (quant << 1) - 16;                  return 2 * quant - 16;
115          else          else
116          dc_scaler = quant - 6;                  return quant - 6;
   
     return dc_scaler;  
117  }  }
118    
   
119  // useful macros  // useful macros
120    
121  #define MIN(X, Y) ((X)<(Y)?(X):(Y))  #define MIN(X, Y) ((X)<(Y)?(X):(Y))

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.13.2.4

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