diff options
author | Oded Shimon <ods15@ods15.dyndns.org> | 2006-10-02 06:08:55 +0000 |
---|---|---|
committer | Oded Shimon <ods15@ods15.dyndns.org> | 2006-10-02 06:08:55 +0000 |
commit | 68e75e4dec6b5f46a190118eecbba1e95c396e3d (patch) | |
tree | b897710bee0491326823dd537993bbd0abf7762c /libavcodec/vorbis_enc.c | |
parent | 9b9941bee65b3ee86d13ed5c3f43a9c92b3e2d4b (diff) | |
download | ffmpeg-68e75e4dec6b5f46a190118eecbba1e95c396e3d.tar.gz |
Original Commit: r90 | ods15 | 2006-09-29 22:14:40 +0300 (Fri, 29 Sep 2006) | 3 lines
much better magic for floor, the first psychoacoustic in this encoder!
now creates valid, 175kbps audio, which sounds good! :)
Originally committed as revision 6494 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/vorbis_enc.c')
-rw-r--r-- | libavcodec/vorbis_enc.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/libavcodec/vorbis_enc.c b/libavcodec/vorbis_enc.c index 4e45c7e628..581ab41bb1 100644 --- a/libavcodec/vorbis_enc.c +++ b/libavcodec/vorbis_enc.c @@ -780,13 +780,11 @@ static void floor_fit(venc_context_t * venc, floor_t * fc, float * coeffs, int * int end = fc->list[fc->list[FFMIN(i+1, fc->values - 1)].sort].x; int j; float average = 0; - begin = (position + begin) / 2; - end = (position + end ) / 2; assert(end <= samples); for (j = begin; j < end; j++) average += fabs(coeffs[j]); average /= end - begin; - average /= 32; // MAGIC! + average /= pow(4, 1 - position/400.); // MAGIC! for (j = 0; j < range - 1; j++) if (floor1_inverse_db_table[j * fc->multiplier] > average) break; posts[fc->list[i].sort] = j; } |