Move useInterpolatedNLSFs assert from encode_indices.c to silk/process_NLSFs.c.
authorGregory Maxwell <greg@xiph.org>
Tue, 4 Oct 2011 22:26:33 +0000 (18:26 -0400)
committerJean-Marc Valin <jmvalin@jmvalin.ca>
Wed, 5 Oct 2011 00:20:51 +0000 (20:20 -0400)
There were assert failures for test cases with mode switching and LBRR enabled.
(some similar problems remain)

Tim identified that the assert was falsely firing while encoding LBRR frames but
the flag doesn't matter while encoding the bitstream it only actually matters in
silk/process_NLSFs.c.

silk/encode_indices.c
silk/process_NLSFs.c

index aa4585f..6d8e82a 100644 (file)
@@ -127,7 +127,6 @@ void silk_encode_indices(
 
     /* Encode NLSF interpolation factor */
     if( psEncC->nb_subfr == MAX_NB_SUBFR ) {
-        silk_assert( psEncC->useInterpolatedNLSFs == 1 || psIndices->NLSFInterpCoef_Q2 == ( 1 << 2 ) );
         silk_assert( psIndices->NLSFInterpCoef_Q2 >= 0 && psIndices->NLSFInterpCoef_Q2 < 5 );
         ec_enc_icdf( psRangeEnc, psIndices->NLSFInterpCoef_Q2, silk_NLSF_interpolation_factor_iCDF, 8 );
     }
index 2c87f01..e077627 100644 (file)
@@ -48,6 +48,7 @@ void silk_process_NLSFs(
 
     silk_assert( psEncC->speech_activity_Q8 >=   0 );
     silk_assert( psEncC->speech_activity_Q8 <= SILK_FIX_CONST( 1.0, 8 ) );
+    silk_assert( psEncC->useInterpolatedNLSFs == 1 || psEncC->indices.NLSFInterpCoef_Q2 == ( 1 << 2 ) );
 
     /***********************/
     /* Calculate mu values */