92 |
uint32_t current_quant, |
uint32_t current_quant, |
93 |
int32_t iDcScaler, |
int32_t iDcScaler, |
94 |
int16_t predictors[8], |
int16_t predictors[8], |
95 |
const unsigned int bound_x, |
const int bound) |
|
const unsigned int bound_y) |
|
96 |
|
|
97 |
{ |
{ |
98 |
const unsigned bound = (bound_y * mb_width) + bound_x; |
const int mbpos = (y * mb_width) + x; |
|
const unsigned mbpos = (y * mb_width) + x; |
|
99 |
int16_t *left, *top, *diag, *current; |
int16_t *left, *top, *diag, *current; |
100 |
|
|
101 |
int32_t left_quant = current_quant; |
int32_t left_quant = current_quant; |
125 |
} |
} |
126 |
// top macroblock |
// top macroblock |
127 |
|
|
128 |
if (mbpos >= bound + mb_width && |
if (mbpos >= bound + (int)mb_width && |
129 |
(pMBs[index - mb_width].mode == MODE_INTRA || |
(pMBs[index - mb_width].mode == MODE_INTRA || |
130 |
pMBs[index - mb_width].mode == MODE_INTRA_Q)) { |
pMBs[index - mb_width].mode == MODE_INTRA_Q)) { |
131 |
|
|
134 |
} |
} |
135 |
// diag macroblock |
// diag macroblock |
136 |
|
|
137 |
if (x && mbpos >= bound + mb_width + 1 && |
if (x && mbpos >= bound + (int)mb_width + 1 && |
138 |
(pMBs[index - 1 - mb_width].mode == MODE_INTRA || |
(pMBs[index - 1 - mb_width].mode == MODE_INTRA || |
139 |
pMBs[index - 1 - mb_width].mode == MODE_INTRA_Q)) { |
pMBs[index - 1 - mb_width].mode == MODE_INTRA_Q)) { |
140 |
|
|
245 |
int16_t *pCurrent = pMB->pred_values[block]; |
int16_t *pCurrent = pMB->pred_values[block]; |
246 |
uint32_t i; |
uint32_t i; |
247 |
|
|
248 |
|
DPRINTF(DPRINTF_COEFF,"predictor[0] %i", predictors[0]); |
249 |
|
|
250 |
dct_codes[0] += predictors[0]; // dc prediction |
dct_codes[0] += predictors[0]; // dc prediction |
251 |
pCurrent[0] = dct_codes[0] * iDcScaler; |
pCurrent[0] = dct_codes[0] * iDcScaler; |
252 |
|
|
254 |
for (i = 1; i < 8; i++) { |
for (i = 1; i < 8; i++) { |
255 |
int level = dct_codes[i] + predictors[i]; |
int level = dct_codes[i] + predictors[i]; |
256 |
|
|
257 |
|
DPRINTF(DPRINTF_COEFF,"predictor[%i] %i",i, predictors[i]); |
258 |
|
|
259 |
dct_codes[i] = level; |
dct_codes[i] = level; |
260 |
pCurrent[i] = level; |
pCurrent[i] = level; |
261 |
pCurrent[i + 7] = dct_codes[i * 8]; |
pCurrent[i + 7] = dct_codes[i * 8]; |
263 |
} else if (acpred_direction == 2) { |
} else if (acpred_direction == 2) { |
264 |
for (i = 1; i < 8; i++) { |
for (i = 1; i < 8; i++) { |
265 |
int level = dct_codes[i * 8] + predictors[i]; |
int level = dct_codes[i * 8] + predictors[i]; |
266 |
|
DPRINTF(DPRINTF_COEFF,"predictor[%i] %i",i*8, predictors[i]); |
267 |
|
|
268 |
dct_codes[i * 8] = level; |
dct_codes[i * 8] = level; |
269 |
pCurrent[i + 7] = level; |
pCurrent[i + 7] = level; |
388 |
iDcScaler = get_dc_scaler(iQuant, (j < 4) ? 1 : 0); |
iDcScaler = get_dc_scaler(iQuant, (j < 4) ? 1 : 0); |
389 |
|
|
390 |
predict_acdc(frame->mbs, x, y, mb_width, j, &qcoeff[j * 64], |
predict_acdc(frame->mbs, x, y, mb_width, j, &qcoeff[j * 64], |
391 |
iQuant, iDcScaler, predictors[j], 0, 0); |
iQuant, iDcScaler, predictors[j], 0); |
392 |
|
|
393 |
S += calc_acdc(pMB, j, &qcoeff[j * 64], iDcScaler, predictors[j]); |
S += calc_acdc(pMB, j, &qcoeff[j * 64], iDcScaler, predictors[j]); |
394 |
|
|