Fixed an low bit-rate ultrawideband encoder bug (not that people should
authorjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Wed, 14 Mar 2007 13:56:24 +0000 (13:56 +0000)
committerjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Wed, 14 Mar 2007 13:56:24 +0000 (13:56 +0000)
actually use that in the first place...).

git-svn-id: http://svn.xiph.org/trunk/speex@12757 0101bb08-14d6-0310-b084-bc0e0c8e3800

libspeex/sb_celp.c

index 5282973..933eb7c 100644 (file)
@@ -629,7 +629,11 @@ int sb_encode(void *state, void *vin, SpeexBits *bits)
                quant=31;
             speex_bits_pack(bits, quant, 5);
          }
-
+         if (st->innov_rms_save)
+         {
+            st->innov_rms_save[sub] = eh;
+         }
+         st->exc_rms[sub] = eh;
       } else {
          spx_word16_t gc;       /*Q7*/
          spx_word32_t scale;    /*Q14*/
@@ -716,11 +720,11 @@ int sb_encode(void *state, void *vin, SpeexBits *bits)
          {
             st->innov_rms_save[sub] = MULT16_16_Q15(QCONST16(.70711f, 15), compute_rms(innov, st->subframeSize));
          }
+         st->exc_rms[sub] = compute_rms16(exc, st->subframeSize);
          
 
       }
 
-      st->exc_rms[sub] = compute_rms16(exc, st->subframeSize);
       
       /*Keep the previous memory*/
       for (i=0;i<st->lpcSize;i++)