233 |
|
|
234 |
if (ABS(pLeft[0] - pDiag[0]) < ABS(pDiag[0] - pTop[0])) { |
if (ABS(pLeft[0] - pDiag[0]) < ABS(pDiag[0] - pTop[0])) { |
235 |
*acpred_direction = 1; /* vertical */ |
*acpred_direction = 1; /* vertical */ |
236 |
predictors[0] = DIV_DIV(pTop[0], iDcScaler); |
predictors[0] = (int16_t)(DIV_DIV(pTop[0], iDcScaler)); |
237 |
for (i = 1; i < 8; i++) { |
for (i = 1; i < 8; i++) { |
238 |
predictors[i] = rescale(top_quant, current_quant, pTop[i]); |
predictors[i] = rescale(top_quant, current_quant, pTop[i]); |
239 |
} |
} |
240 |
} else { |
} else { |
241 |
*acpred_direction = 2; /* horizontal */ |
*acpred_direction = 2; /* horizontal */ |
242 |
predictors[0] = DIV_DIV(pLeft[0], iDcScaler); |
predictors[0] = (int16_t)(DIV_DIV(pLeft[0], iDcScaler)); |
243 |
for (i = 1; i < 8; i++) { |
for (i = 1; i < 8; i++) { |
244 |
predictors[i] = rescale(left_quant, current_quant, pLeft[i + 7]); |
predictors[i] = rescale(left_quant, current_quant, pLeft[i + 7]); |
245 |
} |
} |
266 |
DPRINTF(DPRINTF_COEFF,"predictor[0] %i", predictors[0]); |
DPRINTF(DPRINTF_COEFF,"predictor[0] %i", predictors[0]); |
267 |
|
|
268 |
dct_codes[0] += predictors[0]; /* dc prediction */ |
dct_codes[0] += predictors[0]; /* dc prediction */ |
269 |
pCurrent[0] = dct_codes[0] * iDcScaler; |
pCurrent[0] = (int16_t)(dct_codes[0] * iDcScaler); |
270 |
|
|
271 |
if (acpred_direction == 1) { |
if (acpred_direction == 1) { |
272 |
for (i = 1; i < 8; i++) { |
for (i = 1; i < 8; i++) { |
324 |
|
|
325 |
/* store current coeffs to pred_values[] for future prediction */ |
/* store current coeffs to pred_values[] for future prediction */ |
326 |
|
|
327 |
pCurrent[0] = qcoeff[0] * iDcScaler; |
pCurrent[0] = (int16_t)(qcoeff[0] * iDcScaler); |
328 |
for (i = 1; i < 8; i++) { |
for (i = 1; i < 8; i++) { |
329 |
pCurrent[i] = qcoeff[i]; |
pCurrent[i] = qcoeff[i]; |
330 |
pCurrent[i + 7] = qcoeff[i * 8]; |
pCurrent[i + 7] = qcoeff[i * 8]; |