50 |
* * |
* * |
51 |
******************************************************************************/ |
******************************************************************************/ |
52 |
|
|
53 |
|
#include <stdlib.h> |
54 |
|
|
55 |
#include "../global.h" |
#include "../global.h" |
56 |
#include "../encoder.h" |
#include "../encoder.h" |
57 |
#include "mbprediction.h" |
#include "mbprediction.h" |
214 |
// determine ac prediction direction & ac/dc predictor |
// determine ac prediction direction & ac/dc predictor |
215 |
// place rescaled ac/dc predictions into predictors[] for later use |
// place rescaled ac/dc predictions into predictors[] for later use |
216 |
|
|
217 |
if (ABS(pLeft[0] - pDiag[0]) < ABS(pDiag[0] - pTop[0])) { |
if (abs(pLeft[0] - pDiag[0]) < abs(pDiag[0] - pTop[0])) { |
218 |
*acpred_direction = 1; // vertical |
*acpred_direction = 1; // vertical |
219 |
predictors[0] = DIV_DIV(pTop[0], iDcScaler); |
predictors[0] = DIV_DIV(pTop[0], iDcScaler); |
220 |
for (i = 1; i < 8; i++) { |
for (i = 1; i < 8; i++) { |
320 |
int16_t level; |
int16_t level; |
321 |
|
|
322 |
level = qcoeff[i]; |
level = qcoeff[i]; |
323 |
S2 += ABS(level); |
S2 += abs(level); |
324 |
level -= predictors[i]; |
level -= predictors[i]; |
325 |
S1 += ABS(level); |
S1 += abs(level); |
326 |
predictors[i] = level; |
predictors[i] = level; |
327 |
} |
} |
328 |
} else // acpred_direction == 2 |
} else // acpred_direction == 2 |
331 |
int16_t level; |
int16_t level; |
332 |
|
|
333 |
level = qcoeff[i * 8]; |
level = qcoeff[i * 8]; |
334 |
S2 += ABS(level); |
S2 += abs(level); |
335 |
level -= predictors[i]; |
level -= predictors[i]; |
336 |
S1 += ABS(level); |
S1 += abs(level); |
337 |
predictors[i] = level; |
predictors[i] = level; |
338 |
} |
} |
339 |
|
|