Prevents zero-energy on LFE
authorJean-Marc Valin <jmvalin@jmvalin.ca>
Sun, 7 Jul 2013 04:39:35 +0000 (00:39 -0400)
committerJean-Marc Valin <jmvalin@jmvalin.ca>
Sun, 7 Jul 2013 04:39:35 +0000 (00:39 -0400)
celt/celt_encoder.c

index f5ff6ae..cad7388 100644 (file)
@@ -1517,7 +1517,10 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm,
    if (st->lfe)
    {
       for (i=2;i<st->end;i++)
+      {
          bandE[i] = IMIN(bandE[i], MULT16_32_Q15(QCONST16(1e-4f,15),bandE[0]));
+         bandE[i] = MAX32(bandE[i], EPSILON);
+      }
    }
    amp2Log2(mode, effEnd, st->end, bandE, bandLogE, C);
    if (st->energy_save)