19 |
* along with this program ; if not, write to the Free Software |
* along with this program ; if not, write to the Free Software |
20 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 |
* |
* |
22 |
* $Id: quant_h263.c,v 1.7.2.2 2003-10-07 13:02:35 edgomez Exp $ |
* $Id: quant_h263.c,v 1.7.2.3 2003-10-09 18:50:22 edgomez Exp $ |
23 |
* |
* |
24 |
****************************************************************************/ |
****************************************************************************/ |
25 |
|
|
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 |
|
|