Fixes a bug where transient frames would use previous spreading
authorJean-Marc Valin <jmvalin@jmvalin.ca>
Thu, 8 Nov 2012 22:22:07 +0000 (17:22 -0500)
committerJean-Marc Valin <jmvalin@jmvalin.ca>
Thu, 8 Nov 2012 22:22:07 +0000 (17:22 -0500)
Also forces SPREAD_NORMAL in hybrid mode

celt/celt_encoder.c

index 994d664..d6bae41 100644 (file)
@@ -1282,10 +1282,12 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm,
 
    if (ec_tell(enc)+4<=total_bits)
    {
-      if (shortBlocks || st->complexity < 3 || nbAvailableBytes < 10*C)
+      if (shortBlocks || st->complexity < 3 || nbAvailableBytes < 10*C || st->start != 0)
       {
          if (st->complexity == 0)
             st->spread_decision = SPREAD_NONE;
+         else
+            st->spread_decision = SPREAD_NORMAL;
       } else {
          if (st->analysis.valid)
          {