75 |
{ |
{ |
76 |
const uint32_t mult = multipliers[quant]; |
const uint32_t mult = multipliers[quant]; |
77 |
const uint16_t quant_m_2 = quant << 1; |
const uint16_t quant_m_2 = quant << 1; |
|
uint32_t sum = 0; |
|
78 |
int i; |
int i; |
79 |
|
|
80 |
coeff[0] = DIV_DIV(data[0], (int32_t) dcscalar); |
coeff[0] = DIV_DIV(data[0], (int32_t) dcscalar); |
|
sum += coeff[0]; |
|
81 |
|
|
82 |
for (i = 1; i < 64; i++) { |
for (i = 1; i < 64; i++) { |
83 |
int16_t acLevel = data[i]; |
int16_t acLevel = data[i]; |
89 |
continue; |
continue; |
90 |
} |
} |
91 |
acLevel = (acLevel * mult) >> SCALEBITS; |
acLevel = (acLevel * mult) >> SCALEBITS; |
|
sum += acLevel; |
|
92 |
coeff[i] = -acLevel; |
coeff[i] = -acLevel; |
93 |
} else { |
} else { |
94 |
if (acLevel < quant_m_2) { |
if (acLevel < quant_m_2) { |
96 |
continue; |
continue; |
97 |
} |
} |
98 |
acLevel = (acLevel * mult) >> SCALEBITS; |
acLevel = (acLevel * mult) >> SCALEBITS; |
|
sum += acLevel; |
|
99 |
coeff[i] = acLevel; |
coeff[i] = acLevel; |
100 |
} |
} |
101 |
} |
} |
102 |
|
|
103 |
return(sum); |
return(0); |
104 |
} |
} |
105 |
|
|
106 |
|
|