3 |
* XVID MPEG-4 VIDEO CODEC |
* XVID MPEG-4 VIDEO CODEC |
4 |
* - MB prediction header file - |
* - MB prediction header file - |
5 |
* |
* |
6 |
|
* Copyright(C) 2002 Christoph Lampert <gruel@web.de> |
7 |
|
* 2002 Peter Ross <pross@xvid.org> |
8 |
|
* |
9 |
* This program is an implementation of a part of one or more MPEG-4 |
* This program is an implementation of a part of one or more MPEG-4 |
10 |
* Video tools as specified in ISO/IEC 14496-2 standard. Those intending |
* Video tools as specified in ISO/IEC 14496-2 standard. Those intending |
11 |
* to use this software module in hardware or software products are |
* to use this software module in hardware or software products are |
141 |
lpos = lx + ly * mb_width; |
lpos = lx + ly * mb_width; |
142 |
rpos = rx + ry * mb_width; |
rpos = rx + ry * mb_width; |
143 |
tpos = tx + ty * mb_width; |
tpos = tx + ty * mb_width; |
144 |
num_cand = 0; |
last_cand = num_cand = 0; |
145 |
|
|
146 |
if (lpos >= bound && lx >= 0) { |
if (lpos >= bound && lx >= 0) { |
147 |
num_cand++; |
num_cand++; |
167 |
pmv[3] = zeroMV; |
pmv[3] = zeroMV; |
168 |
} |
} |
169 |
|
|
170 |
/* if only one valid candidate predictor, the invalid candiates are set to the canidate */ |
/* |
171 |
|
* If there're more than one candidate, we return the median vector |
172 |
|
* edgomez : the special case "no candidates" is handled the same way |
173 |
|
* because all vectors are set to zero. So the median vector |
174 |
|
* is {0,0}, and this is exactly the vector we must return |
175 |
|
* according to the mpeg4 specs. |
176 |
|
*/ |
177 |
|
|
178 |
if (num_cand != 1) { |
if (num_cand != 1) { |
179 |
/* set median */ |
/* set median */ |
180 |
|
|
248 |
lpos = lx + ly * mb_width; |
lpos = lx + ly * mb_width; |
249 |
rpos = rx + ry * mb_width; |
rpos = rx + ry * mb_width; |
250 |
tpos = tx + ty * mb_width; |
tpos = tx + ty * mb_width; |
251 |
num_cand = 0; |
last_cand = num_cand = 0; |
252 |
|
|
253 |
if (lpos >= bound && lx >= 0) { |
if (lpos >= bound && lx >= 0) { |
254 |
num_cand++; |
num_cand++; |
366 |
lpos = lx + ly * mb_width; |
lpos = lx + ly * mb_width; |
367 |
rpos = rx + ry * mb_width; |
rpos = rx + ry * mb_width; |
368 |
tpos = tx + ty * mb_width; |
tpos = tx + ty * mb_width; |
369 |
num_cand = 0; |
last_cand = num_cand = 0; |
370 |
|
|
371 |
if (lpos >= bound && lx >= 0) { |
if (lpos >= bound && lx >= 0) { |
372 |
num_cand++; |
num_cand++; |
451 |
lpos = lx + ly * mb_width; |
lpos = lx + ly * mb_width; |
452 |
rpos = rx + ry * mb_width; |
rpos = rx + ry * mb_width; |
453 |
tpos = tx + ty * mb_width; |
tpos = tx + ty * mb_width; |
454 |
num_cand = 0; |
last_cand = num_cand = 0; |
455 |
|
|
456 |
if (lpos >= bound && lx >= 0) { |
if (lpos >= bound && lx >= 0) { |
457 |
num_cand++; |
num_cand++; |