364 |
} |
} |
365 |
|
|
366 |
|
|
367 |
void MBPrediction(MBParam *pParam, uint32_t x, uint32_t y, |
void MBPrediction(MBParam *pParam, |
368 |
uint32_t mb_width, int16_t qcoeff[][64], MACROBLOCK *mbs) |
uint32_t x, |
369 |
|
uint32_t y, |
370 |
|
uint32_t mb_width, |
371 |
|
int16_t qcoeff[6*64], |
372 |
|
MACROBLOCK *mbs) |
373 |
{ |
{ |
374 |
|
|
375 |
int32_t j; |
int32_t j; |
376 |
int32_t iDcScaler, iQuant = pParam->quant; |
int32_t iDcScaler, iQuant = pParam->quant; |
377 |
int32_t S = 0; |
int32_t S = 0; |
385 |
{ |
{ |
386 |
iDcScaler = get_dc_scaler(iQuant, (j < 4) ? 1 : 0); |
iDcScaler = get_dc_scaler(iQuant, (j < 4) ? 1 : 0); |
387 |
|
|
388 |
predict_acdc(mbs, x, y, mb_width, j, qcoeff[j], iQuant, iDcScaler, predictors[j]); |
predict_acdc(mbs, |
389 |
S += calc_acdc(pMB, j, qcoeff[j], iDcScaler, predictors[j]); |
x, |
390 |
|
y, |
391 |
|
mb_width, |
392 |
|
j, |
393 |
|
&qcoeff[j*64], |
394 |
|
iQuant, |
395 |
|
iDcScaler, |
396 |
|
predictors[j]); |
397 |
|
|
398 |
|
S += calc_acdc(pMB, |
399 |
|
j, |
400 |
|
&qcoeff[j*64], |
401 |
|
iDcScaler, |
402 |
|
predictors[j]); |
403 |
|
|
404 |
} |
} |
405 |
|
|
406 |
if (S < 0) // dont predict |
if (S < 0) // dont predict |
414 |
{ |
{ |
415 |
for(j = 0; j < 6; j++) |
for(j = 0; j < 6; j++) |
416 |
{ |
{ |
417 |
apply_acdc(pMB, j, qcoeff[j], predictors[j]); |
apply_acdc(pMB, j, &qcoeff[j*64], predictors[j]); |
418 |
} |
} |
419 |
} |
} |
420 |
pMB->cbp = calc_cbp(qcoeff); |
pMB->cbp = calc_cbp(qcoeff); |
421 |
} |
} |
422 |
|
|
423 |
} |
} |