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

Annotation of /xvidcore/src/encoder.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (view) (download)

1 : Isibaar 1.1 /**************************************************************************
2 :     *
3 :     * Modifications:
4 :     *
5 :     * 22.08.2001 added support for EXT_MODE encoding mode
6 :     * support for EXTENDED API
7 :     * 22.08.2001 fixed bug in iDQtab
8 :     *
9 :     * Michael Militzer <isibaar@videocoding.de>
10 :     *
11 :     **************************************************************************/
12 :    
13 :     #ifndef _ENCODER_H_
14 :     #define _ENCODER_H_
15 :    
16 :    
17 :     #include "xvid.h"
18 :    
19 :     #include "portab.h"
20 :     #include "global.h"
21 :     #include "image/image.h"
22 :    
23 :    
24 :     #define H263_QUANT 0
25 :     #define MPEG4_QUANT 1
26 :    
27 :    
28 :     typedef uint32_t bool;
29 :    
30 :    
31 :     typedef enum
32 :     {
33 :     I_VOP = 0,
34 :     P_VOP = 1
35 :     }
36 :     VOP_TYPE;
37 :    
38 :     /***********************************
39 :    
40 :     Encoding Parameters
41 :    
42 :     ************************************/
43 :    
44 :     typedef struct
45 :     {
46 :     uint32_t width;
47 :     uint32_t height;
48 :    
49 :     uint32_t edged_width;
50 :     uint32_t edged_height;
51 :     uint32_t mb_width;
52 :     uint32_t mb_height;
53 :    
54 :     VOP_TYPE coding_type;
55 :    
56 :     /* rounding type; alternate 0-1 after each interframe */
57 :    
58 :     uint32_t rounding_type;
59 :    
60 :     /* 1 <= fixed_code <= 4
61 :     automatically adjusted using motion vector statistics inside
62 :     */
63 :    
64 :     uint32_t fixed_code;
65 :     uint32_t quant;
66 :     uint32_t quant_type;
67 :     uint32_t motion_flags;
68 :     uint32_t global_flags;
69 : h 1.3
70 :     HINTINFO * hint;
71 : Isibaar 1.1 } MBParam;
72 :    
73 :     typedef struct
74 :     {
75 :     int iTextBits;
76 :     float fMvPrevSigma;
77 :     int iMvSum;
78 :     int iMvCount;
79 :     int kblks;
80 :     int mblks;
81 :     int ublks;
82 :     }
83 :     Statistics;
84 :    
85 :    
86 :    
87 :     typedef struct
88 :     {
89 :     MBParam mbParam;
90 :    
91 :     int iFrameNum;
92 :     int iMaxKeyInterval;
93 :     int lum_masking;
94 :     int bitrate;
95 :    
96 :     // images
97 :    
98 :     IMAGE sCurrent;
99 :     IMAGE sReference;
100 : Isibaar 1.4 #ifdef _DEBUG
101 :     IMAGE sOriginal;
102 :     #endif
103 : Isibaar 1.1 IMAGE vInterH;
104 :     IMAGE vInterV;
105 : h 1.2 IMAGE vInterVf;
106 : Isibaar 1.1 IMAGE vInterHV;
107 : h 1.2 IMAGE vInterHVf;
108 : Isibaar 1.1
109 :     // macroblock
110 :    
111 :     MACROBLOCK * pMBs;
112 :    
113 :     Statistics sStat;
114 :     }
115 :     Encoder;
116 :    
117 :    
118 :     // indicates no quantizer changes in INTRA_Q/INTER_Q modes
119 :     #define NO_CHANGE 64
120 :    
121 :     void init_encoder(uint32_t cpu_flags);
122 :    
123 :     int encoder_create(XVID_ENC_PARAM * pParam);
124 :     int encoder_destroy(Encoder * pEnc);
125 :     int encoder_encode(Encoder * pEnc, XVID_ENC_FRAME * pFrame, XVID_ENC_STATS * pResult);
126 :    
127 :     static __inline uint8_t get_fcode(uint16_t sr)
128 :     {
129 :     if (sr <= 16)
130 :     return 1;
131 :    
132 :     else if (sr <= 32)
133 :     return 2;
134 :    
135 :     else if (sr <= 64)
136 :     return 3;
137 :    
138 :     else if (sr <= 128)
139 :     return 4;
140 :    
141 :     else if (sr <= 256)
142 :     return 5;
143 :    
144 :     else if (sr <= 512)
145 :     return 6;
146 :    
147 :     else if (sr <= 1024)
148 :     return 7;
149 :    
150 :     else
151 :     return 0;
152 :     }
153 :    
154 :     #endif /* _ENCODER_H_ */

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