diff options
author | Siarhei Siamashka <siarhei.siamashka@gmail.com> | 2009-05-14 06:38:49 +0000 |
---|---|---|
committer | Siarhei Siamashka <siarhei.siamashka@gmail.com> | 2009-05-14 06:38:49 +0000 |
commit | 460c0abfbb6390533a8a04e661971ff0ad4c6cbd (patch) | |
tree | b330fba72094a87d33da6d7f49106c79413312ca | |
parent | 4601e76a4323deec30cc6b1d2cf1f192feedccbc (diff) | |
download | ffmpeg-460c0abfbb6390533a8a04e661971ff0ad4c6cbd.tar.gz |
Fix for issue #829 ("ffvorbis outputs crackling sound, libvorbis plays fine")
This was off-by-one bug which affects floor0 encoded files. Tracked down
by valgrind (was reported as the use of uninitialized memory).
With this patch applied, tiny_psnr now reports the following when ffvorbis
is compared to libvorbis-1.0beta4 output for 'lsp-test.ogg' sample:
stddev: 0.76 PSNR: 98.69 bytes: 3498380/ 3498452
Output from libvorbis-1.2 is substantially different:
stddev: 132.57 PSNR: 53.87 bytes: 3498424/ 3498496
Originally committed as revision 18821 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/vorbis_dec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/vorbis_dec.c b/libavcodec/vorbis_dec.c index 12a9fed761..b304e7be8f 100644 --- a/libavcodec/vorbis_dec.c +++ b/libavcodec/vorbis_dec.c @@ -1054,7 +1054,7 @@ static uint_fast8_t vorbis_floor0_decode(vorbis_context *vc, float two_cos_w=2.0f*cos(wstep*iter_cond); // needed all times /* similar part for the q and p products */ - for(j=0;j<order;j+=2) { + for(j=0;j+1<order;j+=2) { q *= lsp[j] -two_cos_w; p *= lsp[j+1]-two_cos_w; } |