diff options
author | Fabrice Bellard <fabrice@bellard.org> | 2001-09-16 21:52:58 +0000 |
---|---|---|
committer | Fabrice Bellard <fabrice@bellard.org> | 2001-09-16 21:52:58 +0000 |
commit | 8d67072fea31e3b97e0a527e2a94e418745ba02a (patch) | |
tree | 85f381f673cbe7ce8b222f958cbccce740cd9846 /libavcodec/ac3enc.c | |
parent | 73120e555cb09db69f1354c0e912c013f91752dc (diff) | |
download | ffmpeg-8d67072fea31e3b97e0a527e2a94e418745ba02a.tar.gz |
fixed symetric quantization (better quality!)
Originally committed as revision 130 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ac3enc.c')
-rw-r--r-- | libavcodec/ac3enc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c index 0754c86570..d44347396b 100644 --- a/libavcodec/ac3enc.c +++ b/libavcodec/ac3enc.c @@ -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); |