]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Move the *-1 to a more sane place as well.
authormichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Wed, 16 Apr 2008 15:30:04 +0000 (15:30 +0000)
committermichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Wed, 16 Apr 2008 15:30:04 +0000 (15:30 +0000)
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@12857 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/nellymoserdec.c

index 4aa7966af2cf5e3c34917b56d2bbafd4509fc1fa..d20db9f40aba2d1772d8258b6d711c0431e50264 100644 (file)
@@ -279,7 +279,7 @@ void nelly_decode_block(NellyMoserDecodeContext *s, const unsigned char block[NE
     for (i=0 ; i<NELLY_BANDS ; i++) {
         if (i > 0)
             val += nelly_delta_table[get_bits(&s->gb, 5)];
-        pval = pow(2, val/2048) * s->scale_bias;
+        pval = -pow(2, val/2048) * s->scale_bias;
         for (j = 0; j < nelly_band_sizes_table[i]; j++) {
             *bptr++ = val;
             *pptr++ = pval;
@@ -298,11 +298,11 @@ void nelly_decode_block(NellyMoserDecodeContext *s, const unsigned char block[NE
         for (j = 0; j < NELLY_FILL_LEN; j++) {
             if (bits[j] <= 0) {
                 aptr[j] = M_SQRT1_2*pows[j];
-                if (!(av_random(&s->random_state) & 1))
+                if (av_random(&s->random_state) & 1)
                     aptr[j] *= -1.0;
             } else {
                 v = get_bits(&s->gb, bits[j]);
-                aptr[j] = -dequantization_table[(1<<bits[j])-1+v]*pows[j];
+                aptr[j] = dequantization_table[(1<<bits[j])-1+v]*pows[j];
             }
         }
         memset(&aptr[NELLY_FILL_LEN], 0,