shithub: opus

Download patch

ref: f8eb44e83aa4d61fb758dcd7c64cc14140c06021
parent: bd477ce2bcafdfb5a09f99c508b1ada9fcd0ab94
author: Jean-Marc Valin <[email protected]>
date: Fri May 17 19:22:09 EDT 2013

Making sure redundant frames never use outdated analysis info

--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -1691,6 +1691,10 @@
        ec_enc_shrink(&enc, nb_compr_bytes);
     }
 
+#ifndef FIXED_POINT
+    if (redundancy || st->mode != MODE_SILK_ONLY)
+       celt_encoder_ctl(celt_enc, CELT_SET_ANALYSIS(analysis_info));
+#endif
 
     /* 5 ms redundant frame for CELT->SILK */
     if (redundancy && celt_to_silk)
@@ -1724,9 +1728,6 @@
         /* If false, we already busted the budget and we'll end up with a "PLC packet" */
         if (ec_tell(&enc) <= 8*nb_compr_bytes)
         {
-#ifndef FIXED_POINT
-           celt_encoder_ctl(celt_enc, CELT_SET_ANALYSIS(analysis_info));
-#endif
            ret = celt_encode_with_ec(celt_enc, pcm_buf, frame_size, NULL, nb_compr_bytes, &enc);
            if (ret < 0)
            {