2 |
* |
* |
3 |
* Modifications: |
* Modifications: |
4 |
* |
* |
5 |
|
* 29.03.2002 removed MBFieldToFrame - no longer used (transfers instead) |
6 |
* 26.03.2002 interlacing support |
* 26.03.2002 interlacing support |
7 |
* 02.12.2001 motion estimation/compensation split |
* 02.12.2001 motion estimation/compensation split |
8 |
* 16.11.2001 const/uint32_t changes to MBMotionEstComp() |
* 16.11.2001 const/uint32_t changes to MBMotionEstComp() |
22 |
|
|
23 |
/** MotionEstimation **/ |
/** MotionEstimation **/ |
24 |
|
|
25 |
bool MotionEstimation( |
bool MotionEstimation(MBParam * const pParam, |
26 |
MACROBLOCK * const pMBs, |
FRAMEINFO * const current, |
27 |
MBParam * const pParam, |
FRAMEINFO * const reference, |
|
const IMAGE * const pRef, |
|
28 |
const IMAGE * const pRefH, |
const IMAGE * const pRefH, |
29 |
const IMAGE * const pRefV, |
const IMAGE * const pRefV, |
30 |
const IMAGE * const pRefHV, |
const IMAGE * const pRefHV, |
|
IMAGE * const pCurrent, |
|
31 |
const uint32_t iLimit); |
const uint32_t iLimit); |
32 |
|
|
33 |
|
|
34 |
/** MBMotionCompensation **/ |
bool SMP_MotionEstimation(MBParam * const pParam, |
35 |
void MBMotionCompensation( |
FRAMEINFO * const current, |
36 |
MACROBLOCK * const pMB, |
FRAMEINFO * const reference, |
|
const uint32_t j, |
|
|
const uint32_t i, |
|
|
const IMAGE * const pRef, |
|
37 |
const IMAGE * const pRefH, |
const IMAGE * const pRefH, |
38 |
const IMAGE * const pRefV, |
const IMAGE * const pRefV, |
39 |
const IMAGE * const pRefHV, |
const IMAGE * const pRefHV, |
40 |
IMAGE * const pCurrent, |
const uint32_t iLimit); |
41 |
int16_t dct_codes[][64], |
|
42 |
|
|
43 |
|
|
44 |
|
/** MBMotionCompensation **/ |
45 |
|
|
46 |
|
void |
47 |
|
MBMotionCompensation(MACROBLOCK * const mb, |
48 |
|
const uint32_t i, |
49 |
|
const uint32_t j, |
50 |
|
const IMAGE * const ref, |
51 |
|
const IMAGE * const refh, |
52 |
|
const IMAGE * const refv, |
53 |
|
const IMAGE * const refhv, |
54 |
|
const IMAGE * const refGMC, |
55 |
|
IMAGE * const cur, |
56 |
|
int16_t * dct_codes, |
57 |
const uint32_t width, |
const uint32_t width, |
58 |
const uint32_t height, |
const uint32_t height, |
59 |
const uint32_t edged_width, |
const uint32_t edged_width, |
60 |
const uint32_t rounding); |
const int32_t quarterpel, |
61 |
|
const int reduced_resolution, |
62 |
|
const int32_t rounding); |
63 |
|
|
64 |
/** MBTransQuant.c **/ |
/** MBTransQuant.c **/ |
65 |
|
|
66 |
|
|
67 |
void MBTransQuantIntra(const MBParam *pParam, |
void MBTransQuantIntra(const MBParam *pParam, |
68 |
|
FRAMEINFO * frame, |
69 |
MACROBLOCK * pMB, |
MACROBLOCK * pMB, |
70 |
const uint32_t x_pos, /* <-- The x position of the MB to be searched */ |
const uint32_t x_pos, /* <-- The x position of the MB to be searched */ |
71 |
|
|
72 |
const uint32_t y_pos, /* <-- The y position of the MB to be searched */ |
const uint32_t y_pos, /* <-- The y position of the MB to be searched */ |
73 |
int16_t data[][64], /* <-> the data of the MB to be coded */ |
|
74 |
int16_t qcoeff[][64], /* <-> the quantized DCT coefficients */ |
int16_t data[6 * 64], /* <-> the data of the MB to be coded */ |
75 |
IMAGE * const pCurrent /* <-> the reconstructed image ( function will update one |
|
76 |
MB in it with data from data[] ) */ |
int16_t qcoeff[6 * 64] /* <-> the quantized DCT coefficients */ |
77 |
); |
); |
78 |
|
|
79 |
|
|
80 |
uint8_t MBTransQuantInter(const MBParam *pParam, /* <-- the parameter for DCT transformation |
void MBTransQuantIntra2(const MBParam * pParam, |
81 |
and Quantization */ |
FRAMEINFO * frame, |
82 |
MACROBLOCK * pMB, |
MACROBLOCK * pMB, |
83 |
const uint32_t x_pos, /* <-- The x position of the MB to be searched */ |
const uint32_t x_pos, /* <-- The x position of the MB to be searched */ |
84 |
|
|
85 |
const uint32_t y_pos, /* <-- The y position of the MB to be searched */ |
const uint32_t y_pos, /* <-- The y position of the MB to be searched */ |
86 |
int16_t data[][64], /* <-> the data of the MB to be coded */ |
|
87 |
int16_t qcoeff[][64], /* <-> the quantized DCT coefficients */ |
int16_t data[6 * 64], /* <-> the data of the MB to be coded */ |
88 |
IMAGE * const pCurrent /* <-> the reconstructed image ( function will |
|
89 |
update one MB in it with data from data[] ) */ |
int16_t qcoeff[6 * 64] /* <-> the quantized DCT coefficients */ |
90 |
); |
); |
91 |
|
|
92 |
|
|
93 |
|
uint8_t MBTransQuantInter(const MBParam * pParam, |
94 |
|
FRAMEINFO * frame, |
95 |
|
MACROBLOCK * pMB, |
96 |
|
const uint32_t x_pos, |
97 |
|
const uint32_t y_pos, |
98 |
|
int16_t data[6 * 64], |
99 |
|
int16_t qcoeff[6 * 64]); |
100 |
|
|
101 |
|
|
102 |
|
uint8_t MBTransQuantInter2(const MBParam * pParam, |
103 |
|
FRAMEINFO * frame, |
104 |
|
MACROBLOCK * pMB, |
105 |
|
const uint32_t x_pos, |
106 |
|
const uint32_t y_pos, |
107 |
|
int16_t data[6 * 64], |
108 |
|
int16_t qcoeff[6 * 64]); |
109 |
|
|
110 |
|
uint8_t MBTransQuantInterBVOP(const MBParam * pParam, |
111 |
|
FRAMEINFO * frame, |
112 |
|
MACROBLOCK * pMB, |
113 |
|
int16_t data[6 * 64], |
114 |
|
int16_t qcoeff[6 * 64]); |
115 |
|
|
116 |
|
void MBTrans(const MBParam * pParam, |
117 |
|
FRAMEINFO * frame, |
118 |
|
MACROBLOCK * pMB, |
119 |
|
const uint32_t x_pos, |
120 |
|
const uint32_t y_pos, |
121 |
|
int16_t data[6 * 64]); |
122 |
|
|
123 |
|
void MBfDCT(const MBParam * pParam, |
124 |
|
FRAMEINFO * frame, |
125 |
|
MACROBLOCK * pMB, |
126 |
|
int16_t data[6 * 64]); |
127 |
|
|
128 |
|
uint8_t MBQuantInter( const MBParam * pParam, |
129 |
|
const int iQuant, |
130 |
|
int16_t data[6 * 64], |
131 |
|
int16_t qcoeff[6 * 64]); |
132 |
|
|
133 |
|
void MBQuantDeQuantIntra(const MBParam * pParam, |
134 |
|
FRAMEINFO * frame, |
135 |
|
MACROBLOCK *pMB, |
136 |
|
int16_t qcoeff[6 * 64], |
137 |
|
int16_t data[6*64]); |
138 |
|
|
139 |
|
void MBQuantIntra( const MBParam * pParam, |
140 |
|
FRAMEINFO * frame, |
141 |
|
MACROBLOCK *pMB, |
142 |
|
int16_t qcoeff[6 * 64], |
143 |
|
int16_t data[6*64]); |
144 |
|
|
145 |
|
void MBDeQuantIntra(const MBParam * pParam, |
146 |
|
const int iQuant, |
147 |
|
int16_t qcoeff[6 * 64], |
148 |
|
int16_t data[6*64]); |
149 |
|
|
150 |
|
void MBDeQuantInter(const MBParam * pParam, |
151 |
|
const int iQuant, |
152 |
|
int16_t data[6 * 64], |
153 |
|
int16_t qcoeff[6 * 64], |
154 |
|
const uint8_t cbp); |
155 |
|
|
156 |
|
|
157 |
|
void MBiDCT( int16_t data[6 * 64], |
158 |
|
const uint8_t cbp); |
159 |
|
|
160 |
|
|
161 |
|
void MBTransAdd( const MBParam * pParam, |
162 |
|
FRAMEINFO * frame, |
163 |
|
MACROBLOCK * pMB, |
164 |
|
const uint32_t x_pos, |
165 |
|
const uint32_t y_pos, |
166 |
|
int16_t data[6 * 64], |
167 |
|
const uint8_t cbp); |
168 |
|
|
169 |
|
|
170 |
|
|
171 |
/** interlacing **/ |
/** interlacing **/ |
172 |
|
|
173 |
uint32_t MBDecideFieldDCT(int16_t data[][64]); /* <- decide whether to use field-based DCT |
uint32_t MBDecideFieldDCT(int16_t data[6 * 64]); /* <- decide whether to use field-based DCT |
174 |
for interlacing */ |
for interlacing */ |
175 |
|
|
176 |
void MBFrameToField(int16_t data[][64]); /* de-interlace vertical Y blocks */ |
typedef uint32_t (MBFIELDTEST) (int16_t data[6 * 64]); /* function pointer for field test */ |
177 |
|
typedef MBFIELDTEST *MBFIELDTEST_PTR; |
178 |
|
|
179 |
|
/* global field test pointer for xvid.c */ |
180 |
|
extern MBFIELDTEST_PTR MBFieldTest; |
181 |
|
|
182 |
|
/* field test implementations */ |
183 |
|
MBFIELDTEST MBFieldTest_c; |
184 |
|
MBFIELDTEST MBFieldTest_mmx; |
185 |
|
|
186 |
void MBFieldToFrame(int16_t data[][64]); /* re-interlace vertical Y blocks */ |
void MBFrameToField(int16_t data[6 * 64]); /* de-interlace vertical Y blocks */ |
187 |
|
|
188 |
|
|
189 |
/** MBCoding.c **/ |
/** MBCoding.c **/ |
190 |
|
|
191 |
void MBCoding(const MBParam *pParam, /* <-- the parameter for coding of the bitstream */ |
/* void MBSkip(Bitstream * bs); just the bitstream. Since MB is skipped, no info is needed */ |
192 |
|
|
193 |
|
|
194 |
|
void MBCoding(const FRAMEINFO * const frame, /* <-- the parameter for coding of the bitstream */ |
195 |
|
|
196 |
MACROBLOCK *pMB, /* <-- Info of the MB to be coded */ |
MACROBLOCK *pMB, /* <-- Info of the MB to be coded */ |
197 |
int16_t qcoeff[][64], /* <-- the quantized DCT coefficients */ |
|
198 |
|
int16_t qcoeff[6 * 64], /* <-- the quantized DCT coefficients */ |
199 |
|
|
200 |
Bitstream * bs, /* <-> the bitstream */ |
Bitstream * bs, /* <-> the bitstream */ |
201 |
|
|
202 |
Statistics * pStat /* <-> statistical data collected for current frame */ |
Statistics * pStat /* <-> statistical data collected for current frame */ |
203 |
); |
); |
204 |
|
|