84 |
int *acpred_direction = &pMBs[index].acpred_directions[block]; |
int *acpred_direction = &pMBs[index].acpred_directions[block]; |
85 |
uint32_t i; |
uint32_t i; |
86 |
|
|
87 |
left = top = diag = current = 0; |
left = top = diag = current = NULL; |
88 |
|
|
89 |
/* grab left,top and diag macroblocks */ |
/* grab left,top and diag macroblocks */ |
90 |
|
|
94 |
(pMBs[index - 1].mode == MODE_INTRA || |
(pMBs[index - 1].mode == MODE_INTRA || |
95 |
pMBs[index - 1].mode == MODE_INTRA_Q)) { |
pMBs[index - 1].mode == MODE_INTRA_Q)) { |
96 |
|
|
97 |
left = pMBs[index - 1].pred_values[0]; |
left = (int16_t*)pMBs[index - 1].pred_values[0]; |
98 |
left_quant = pMBs[index - 1].quant; |
left_quant = pMBs[index - 1].quant; |
99 |
} |
} |
100 |
/* top macroblock */ |
/* top macroblock */ |
103 |
(pMBs[index - mb_width].mode == MODE_INTRA || |
(pMBs[index - mb_width].mode == MODE_INTRA || |
104 |
pMBs[index - mb_width].mode == MODE_INTRA_Q)) { |
pMBs[index - mb_width].mode == MODE_INTRA_Q)) { |
105 |
|
|
106 |
top = pMBs[index - mb_width].pred_values[0]; |
top = (int16_t*)pMBs[index - mb_width].pred_values[0]; |
107 |
top_quant = pMBs[index - mb_width].quant; |
top_quant = pMBs[index - mb_width].quant; |
108 |
} |
} |
109 |
/* diag macroblock */ |
/* diag macroblock */ |
112 |
(pMBs[index - 1 - mb_width].mode == MODE_INTRA || |
(pMBs[index - 1 - mb_width].mode == MODE_INTRA || |
113 |
pMBs[index - 1 - mb_width].mode == MODE_INTRA_Q)) { |
pMBs[index - 1 - mb_width].mode == MODE_INTRA_Q)) { |
114 |
|
|
115 |
diag = pMBs[index - 1 - mb_width].pred_values[0]; |
diag = (int16_t*)pMBs[index - 1 - mb_width].pred_values[0]; |
116 |
} |
} |
117 |
|
|
118 |
current = pMBs[index].pred_values[0]; |
current = (int16_t*)pMBs[index].pred_values[0]; |
119 |
|
|
120 |
/* now grab pLeft, pTop, pDiag _blocks_ */ |
/* now grab pLeft, pTop, pDiag _blocks_ */ |
121 |
|
|
219 |
const int bsversion) |
const int bsversion) |
220 |
{ |
{ |
221 |
uint8_t acpred_direction = pMB->acpred_directions[block]; |
uint8_t acpred_direction = pMB->acpred_directions[block]; |
222 |
int16_t *pCurrent = pMB->pred_values[block]; |
int16_t *pCurrent = (int16_t*)pMB->pred_values[block]; |
223 |
uint32_t i; |
uint32_t i; |
224 |
|
|
225 |
DPRINTF(XVID_DEBUG_COEFF,"predictor[0] %i\n", predictors[0]); |
DPRINTF(XVID_DEBUG_COEFF,"predictor[0] %i\n", predictors[0]); |
270 |
S2 = sum of all qcoeff |
S2 = sum of all qcoeff |
271 |
*/ |
*/ |
272 |
|
|
273 |
int |
static int |
274 |
calc_acdc_coeff(MACROBLOCK * pMB, |
calc_acdc_coeff(MACROBLOCK * pMB, |
275 |
uint32_t block, |
uint32_t block, |
276 |
int16_t qcoeff[64], |
int16_t qcoeff[64], |
277 |
uint32_t iDcScaler, |
uint32_t iDcScaler, |
278 |
int16_t predictors[8]) |
int16_t predictors[8]) |
279 |
{ |
{ |
280 |
int16_t *pCurrent = pMB->pred_values[block]; |
int16_t *pCurrent = (int16_t*)pMB->pred_values[block]; |
281 |
uint32_t i; |
uint32_t i; |
282 |
int S1 = 0, S2 = 0; |
int S1 = 0, S2 = 0; |
283 |
|
|
327 |
|
|
328 |
/* returns the bits *saved* if prediction is enabled */ |
/* returns the bits *saved* if prediction is enabled */ |
329 |
|
|
330 |
int |
static int |
331 |
calc_acdc_bits(MACROBLOCK * pMB, |
calc_acdc_bits(MACROBLOCK * pMB, |
332 |
uint32_t block, |
uint32_t block, |
333 |
int16_t qcoeff[64], |
int16_t qcoeff[64], |
335 |
int16_t predictors[8]) |
int16_t predictors[8]) |
336 |
{ |
{ |
337 |
const int direction = pMB->acpred_directions[block]; |
const int direction = pMB->acpred_directions[block]; |
338 |
int16_t *pCurrent = pMB->pred_values[block]; |
int16_t *pCurrent = (int16_t*)pMB->pred_values[block]; |
339 |
int16_t tmp[8]; |
int16_t tmp[8]; |
340 |
unsigned int i; |
unsigned int i; |
341 |
int Z1, Z2; |
int Z1, Z2; |
386 |
|
|
387 |
/* apply predictors[] to qcoeff */ |
/* apply predictors[] to qcoeff */ |
388 |
|
|
389 |
void |
static void |
390 |
apply_acdc(MACROBLOCK * pMB, |
apply_acdc(MACROBLOCK * pMB, |
391 |
uint32_t block, |
uint32_t block, |
392 |
int16_t qcoeff[64], |
int16_t qcoeff[64], |