1280 |
} |
} |
1281 |
|
|
1282 |
/* because we might use something like IF (dx>max_dx) THEN dx=max_dx; */ |
/* because we might use something like IF (dx>max_dx) THEN dx=max_dx; */ |
1283 |
bPredEq = get_pmvdata(pMBs, x, y, iWcount, 0, pmv, psad); |
bPredEq = get_pmvdata(pMBs, x, y, iWcount, 0, pmv, psad, 0, 0); |
1284 |
|
|
1285 |
if ((x == 0) && (y == 0)) { |
if ((x == 0) && (y == 0)) { |
1286 |
threshA = 512; |
threshA = 512; |
1699 |
|
|
1700 |
/* because we might use IF (dx>max_dx) THEN dx=max_dx; */ |
/* because we might use IF (dx>max_dx) THEN dx=max_dx; */ |
1701 |
bPredEq = |
bPredEq = |
1702 |
get_pmvdata(pMBs, (x >> 1), (y >> 1), iWcount, iSubBlock, pmv, psad); |
get_pmvdata(pMBs, (x >> 1), (y >> 1), iWcount, iSubBlock, pmv, psad, 0, 0); |
1703 |
|
|
1704 |
if ((x == 0) && (y == 0)) { |
if ((x == 0) && (y == 0)) { |
1705 |
threshA = 512 / 4; |
threshA = 512 / 4; |
2009 |
max_dy = EVEN(max_dy); |
max_dy = EVEN(max_dy); |
2010 |
} |
} |
2011 |
/* because we might use something like IF (dx>max_dx) THEN dx=max_dx; */ |
/* because we might use something like IF (dx>max_dx) THEN dx=max_dx; */ |
2012 |
bPredEq = get_pmvdata(pMBs, x, y, iWcount, 0, pmv, psad); |
bPredEq = get_pmvdata(pMBs, x, y, iWcount, 0, pmv, psad, 0, 0); |
2013 |
|
|
2014 |
/* Step 4: Calculate SAD around the Median prediction. |
/* Step 4: Calculate SAD around the Median prediction. |
2015 |
MinSAD=SAD |
MinSAD=SAD |
2287 |
max_dy = EVEN(max_dy); |
max_dy = EVEN(max_dy); |
2288 |
} |
} |
2289 |
/* because we might use something like IF (dx>max_dx) THEN dx=max_dx; */ |
/* because we might use something like IF (dx>max_dx) THEN dx=max_dx; */ |
2290 |
bPredEq = get_pmvdata(pMBs, x >> 1, y >> 1, iWcount, iSubBlock, pmv, psad); |
bPredEq = get_pmvdata(pMBs, x >> 1, y >> 1, iWcount, iSubBlock, pmv, psad, 0, 0); |
2291 |
|
|
2292 |
|
|
2293 |
/* Step 4: Calculate SAD around the Median prediction. |
/* Step 4: Calculate SAD around the Median prediction. |
2521 |
mb->b_mvs[0].y = 0; |
mb->b_mvs[0].y = 0; |
2522 |
continue; |
continue; |
2523 |
} |
} |
2524 |
|
/* force F_SAD16 |
2525 |
|
f_sad16 = 100; |
2526 |
|
b_sad16 = 65535; |
2527 |
|
|
2528 |
|
mb->mode = MODE_FORWARD; |
2529 |
|
mb->mvs[0].x = 1; |
2530 |
|
mb->mvs[0].y = 1; |
2531 |
|
mb->b_mvs[0].x = 1; |
2532 |
|
mb->b_mvs[0].y = 1; |
2533 |
|
continue; |
2534 |
|
^^ force F_SAD16 */ |
2535 |
|
|
2536 |
|
|
2537 |
// forward search |
// forward search |
2538 |
f_sad16 = |
f_sad16 = |
2539 |
SEARCH16(f_ref->y, f_refH->y, f_refV->y, f_refHV->y, |
SEARCH16(f_ref->y, f_refH->y, f_refV->y, f_refHV->y, |
2540 |
&frame->image, i, j, frame->motion_flags, |
&frame->image, i, j, frame->motion_flags, |
2541 |
frame->quant, frame->fcode, pParam, f_mbs, |
frame->quant, frame->fcode, pParam, |
2542 |
f_mbs /* todo */ , |
f_mbs, f_mbs, /* todo */ |
2543 |
&mb->mvs[0], &pmv_dontcare); // ignore pmv |
&mb->mvs[0], &pmv_dontcare); // ignore pmv |
2544 |
|
|
2545 |
// backward search |
// backward search |
2546 |
b_sad16 = SEARCH16(b_ref->y, b_refH->y, b_refV->y, b_refHV->y, &frame->image, i, j, frame->motion_flags, frame->quant, frame->bcode, pParam, b_mbs, b_mbs, /* todo */ |
b_sad16 = SEARCH16(b_ref->y, b_refH->y, b_refV->y, b_refHV->y, |
2547 |
|
&frame->image, i, j, frame->motion_flags, |
2548 |
|
frame->quant, frame->bcode, pParam, |
2549 |
|
b_mbs, b_mbs, /* todo */ |
2550 |
&mb->b_mvs[0], &pmv_dontcare); // ignore pmv |
&mb->b_mvs[0], &pmv_dontcare); // ignore pmv |
2551 |
|
|
2552 |
// interpolate search (simple, but effective) |
// interpolate search (simple, but effective) |