[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 101 - (view) (download)

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

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