Mercurial > libavcodec.hg
comparison vorbis_dec.c @ 9639:ccb862ffe15a libavcodec
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
author | serge |
---|---|
date | Thu, 14 May 2009 06:38:49 +0000 |
parents | 0dce4fe6e6f3 |
children | 67a20f0eb42c |
comparison
equal
deleted
inserted
replaced
9638:cbd09311872d | 9639:ccb862ffe15a |
---|---|
1052 float p=0.5f; | 1052 float p=0.5f; |
1053 float q=0.5f; | 1053 float q=0.5f; |
1054 float two_cos_w=2.0f*cos(wstep*iter_cond); // needed all times | 1054 float two_cos_w=2.0f*cos(wstep*iter_cond); // needed all times |
1055 | 1055 |
1056 /* similar part for the q and p products */ | 1056 /* similar part for the q and p products */ |
1057 for(j=0;j<order;j+=2) { | 1057 for(j=0;j+1<order;j+=2) { |
1058 q *= lsp[j] -two_cos_w; | 1058 q *= lsp[j] -two_cos_w; |
1059 p *= lsp[j+1]-two_cos_w; | 1059 p *= lsp[j+1]-two_cos_w; |
1060 } | 1060 } |
1061 if(j==order) { // even order | 1061 if(j==order) { // even order |
1062 p *= p*(2.0f-two_cos_w); | 1062 p *= p*(2.0f-two_cos_w); |