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

Annotation of /trunk/xvidcore/src/global.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3 - (view) (download)

1 : Isibaar 3 #ifndef _GLOBAL_H_
2 :     #define _GLOBAL_H_
3 :    
4 :     #include "portab.h"
5 :    
6 :     /* --- macroblock stuff --- */
7 :    
8 :     #define MODE_INTER 0
9 :     #define MODE_INTER_Q 1
10 :     #define MODE_INTER4V 2
11 :     #define MODE_INTRA 3
12 :     #define MODE_INTRA_Q 4
13 :     #define MODE_STUFFING 7
14 :     #define MODE_NOT_CODED 16
15 :    
16 :     typedef struct
17 :     {
18 :     int x;
19 :     int y;
20 :     } VECTOR;
21 :    
22 :    
23 :     #define MBPRED_SIZE 15
24 :    
25 :    
26 :     typedef struct
27 :     {
28 :     // decoder/encoder
29 :     VECTOR mvs[4];
30 :     uint32_t sad8[4]; // SAD values for inter4v-VECTORs
31 :     uint32_t sad16; // SAD value for inter-VECTOR
32 :    
33 :     short int pred_values[6][MBPRED_SIZE];
34 :     int acpred_directions[6];
35 :    
36 :     int mode;
37 :     int quant; // absolute quant
38 :    
39 :     // encoder specific
40 :    
41 :     VECTOR pmvs[4];
42 :     int dquant;
43 :     int cbp;
44 :    
45 :     } MACROBLOCK;
46 :    
47 :     static __inline int8_t get_dc_scaler(int32_t quant, uint32_t lum)
48 :     {
49 :     int8_t dc_scaler;
50 :    
51 :     if(quant > 0 && quant < 5) {
52 :     dc_scaler = 8;
53 :     return dc_scaler;
54 :     }
55 :    
56 :     if(quant < 25 && !lum) {
57 :     dc_scaler = (quant + 13) >> 1;
58 :     return dc_scaler;
59 :     }
60 :    
61 :     if(quant < 9) {
62 :     dc_scaler = quant << 1;
63 :     return dc_scaler;
64 :     }
65 :    
66 :     if(quant < 25) {
67 :     dc_scaler = quant + 8;
68 :     return dc_scaler;
69 :     }
70 :    
71 :     if(lum)
72 :     dc_scaler = (quant << 1) - 16;
73 :     else
74 :     dc_scaler = quant - 6;
75 :    
76 :     return dc_scaler;
77 :     }
78 :    
79 :     #endif /* _GLOBAL_H_ */

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