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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3 - (view) (download)

1 : Isibaar 3 /**************************************************************************
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 :     } MBParam;
70 :    
71 :     typedef struct
72 :     {
73 :     int iTextBits;
74 :     float fMvPrevSigma;
75 :     int iMvSum;
76 :     int iMvCount;
77 :     int kblks;
78 :     int mblks;
79 :     int ublks;
80 :     }
81 :     Statistics;
82 :    
83 :    
84 :    
85 :     typedef struct
86 :     {
87 :     MBParam mbParam;
88 :    
89 :     int iFrameNum;
90 :     int iMaxKeyInterval;
91 :     int lum_masking;
92 :     int bitrate;
93 :    
94 :     // images
95 :    
96 :     IMAGE sCurrent;
97 :     IMAGE sReference;
98 :     IMAGE vInterH;
99 :     IMAGE vInterV;
100 :     IMAGE vInterHV;
101 :    
102 :     // macroblock
103 :    
104 :     MACROBLOCK * pMBs;
105 :    
106 :     Statistics sStat;
107 :     }
108 :     Encoder;
109 :    
110 :    
111 :     // indicates no quantizer changes in INTRA_Q/INTER_Q modes
112 :     #define NO_CHANGE 64
113 :    
114 :     void init_encoder(uint32_t cpu_flags);
115 :    
116 :     int encoder_create(XVID_ENC_PARAM * pParam);
117 :     int encoder_destroy(Encoder * pEnc);
118 :     int encoder_encode(Encoder * pEnc, XVID_ENC_FRAME * pFrame, XVID_ENC_STATS * pResult);
119 :    
120 :     static __inline uint8_t get_fcode(uint16_t sr)
121 :     {
122 :     if (sr <= 16)
123 :     return 1;
124 :    
125 :     else if (sr <= 32)
126 :     return 2;
127 :    
128 :     else if (sr <= 64)
129 :     return 3;
130 :    
131 :     else if (sr <= 128)
132 :     return 4;
133 :    
134 :     else if (sr <= 256)
135 :     return 5;
136 :    
137 :     else if (sr <= 512)
138 :     return 6;
139 :    
140 :     else if (sr <= 1024)
141 :     return 7;
142 :    
143 :     else
144 :     return 0;
145 :     }
146 :    
147 :     #endif /* _ENCODER_H_ */

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