[FFmpeg-soc] [soc]: r399 - in qcelp: doc/TODO qcelpdec.c

reynaldo subversion at mplayerhq.hu
Sat Jul 14 07:28:57 CEST 2007


Author: reynaldo
Date: Sat Jul 14 07:28:57 2007
New Revision: 399

Log:
scaled codebook vector generation for rates 1 and 1/2

Modified:
   qcelp/doc/TODO
   qcelp/qcelpdec.c

Modified: qcelp/doc/TODO
==============================================================================
--- qcelp/doc/TODO	(original)
+++ qcelp/doc/TODO	Sat Jul 14 07:28:57 2007
@@ -3,7 +3,7 @@ Clear:
 - finish the codebook transmission code's conversion to gain, index and
   (when needed) cbseed (almost done).
 - review rates 1 and 1/2 gain predictor calculations.
-- code function to generate scaled codebook vector.
+- review qcelp_compute_cdn().
 
 Still somewhat fuzzy:
 

Modified: qcelp/qcelpdec.c
==============================================================================
--- qcelp/qcelpdec.c	(original)
+++ qcelp/qcelpdec.c	Sat Jul 14 07:28:57 2007
@@ -208,6 +208,10 @@ void qcelp_ctc2GI(const QCELPFrame *fram
 /**
  * Computes the scaled codebook vector Cdn From INDEX and GAIN
  * For all rates
+ *
+ * FIXME:
+ * - Needs outbound reading checks and error propagation if weirdness
+ *   is detected :-).
  */
 static int qcelp_compute_cdn(qcelp_packet_rate rate, const float *gain,
            const int *index, uint16_t cbseed, float *cdn_vector)
@@ -219,7 +223,14 @@ static int qcelp_compute_cdn(qcelp_packe
     switch(rate)
     {
         case RATE_FULL:
+             for(i=0; i<160; i++)
+                cdn_vector[i]=
+                gain[i/10]*qcelp_fullrate_ccodebook[(i+1-index[i/10]) & 127];
+             break;
         case RATE_HALF:
+             for(i=0; i<160; i++)
+                cdn_vector[i]=
+                gain[i/40]*qcelp_halfrate_ccodebook[(i+1-index[i/40]) & 127];
              break;
         case RATE_QUARTER:
             for(i=0; i<160; i++)



More information about the FFmpeg-soc mailing list