Commit 10e22ddb authored by glantau's avatar glantau

fixed symetric quantization (better quality!)


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@130 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent d55bd275
......@@ -842,10 +842,12 @@ static inline int sym_quant(int c, int e, int levels)
int v;
if (c >= 0) {
v = (levels * (c << e)) >> 25;
v = (levels * (c << e)) >> 24;
v = (v + 1) >> 1;
v = (levels >> 1) + v;
} else {
v = (levels * ((-c) << e)) >> 25;
v = (levels * ((-c) << e)) >> 24;
v = (v + 1) >> 1;
v = (levels >> 1) - v;
}
assert (v >= 0 && v < levels);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment