]> git.sesse.net Git - ffmpeg/commitdiff
cngdec: Update the LPC coefficients after averaging the reflection coefficients
authorMartin Storsjö <martin@martin.st>
Tue, 30 Oct 2012 10:26:39 +0000 (12:26 +0200)
committerMartin Storsjö <martin@martin.st>
Tue, 30 Oct 2012 14:51:12 +0000 (16:51 +0200)
I somehow messed up the placement of this one.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavcodec/cngdec.c

index c22fd5577c04670189f2b661e8d923fa2dde7dd5..8cfe9cfdbd73e21ce6e4f1e6177c605cc20bfd7c 100644 (file)
@@ -112,12 +112,12 @@ static int cng_decode_frame(AVCodecContext *avctx, void *data,
         for (i = 0; i < FFMIN(avpkt->size - 1, p->order); i++) {
             p->target_refl_coef[i] = (avpkt->data[1 + i] - 127) / 128.0;
         }
-        make_lpc_coefs(p->lpc_coef, p->refl_coef, p->order);
     }
 
     p->energy = p->energy / 2 + p->target_energy / 2;
     for (i = 0; i < p->order; i++)
         p->refl_coef[i] = 0.6 *p->refl_coef[i] + 0.4 * p->target_refl_coef[i];
+    make_lpc_coefs(p->lpc_coef, p->refl_coef, p->order);
 
     for (i = 0; i < p->order; i++)
         e *= 1.0 - p->refl_coef[i]*p->refl_coef[i];