[FFmpeg-soc] [soc]: r1104 - in qcelp: qcelpdata.h qcelpdec.c

reynaldo subversion at mplayerhq.hu
Mon Aug 20 23:36:16 CEST 2007


Author: reynaldo
Date: Mon Aug 20 23:36:15 2007
New Revision: 1104

Log:
TRIVIAL + COSMETIC: give macros a context_ name and shorten a overly long comment

Modified:
   qcelp/qcelpdata.h
   qcelp/qcelpdec.c

Modified: qcelp/qcelpdata.h
==============================================================================
--- qcelp/qcelpdata.h	(original)
+++ qcelp/qcelpdata.h	Mon Aug 20 23:36:15 2007
@@ -24,7 +24,7 @@
  * QCELP decoder
  */
 
-#define FXQ(v)  (roundf(16384.0*v)/16384.0)
+#define QCELP_FXQ(v)  (roundf(16384.0*v)/16384.0)
 
 /**
  * TIA/EIA/IS-733 Spec has errors on the predictor determination formula
@@ -34,7 +34,7 @@
  * different quantizer table.
  */
 
-#define FIX_SPEC_PREDICTOR(p) (p-6)
+#define QCELP_FIX_SPEC_PREDICTOR(p) (p-6)
 
 /**
  * TIA/EIA/IS-733 Spec has an omission on the codebook index determination
@@ -50,7 +50,7 @@
  * the given formula is simply not clear enough without this missing info.
  */
 
-#define FIX_SPEC_MISSING_CLAMP(n) ((n<9)? n+1:0)
+#define QCELP_FIX_SPEC_MISSING_CLAMP(n) ((n<9)? n+1:0)
 
 typedef enum
 {

Modified: qcelp/qcelpdec.c
==============================================================================
--- qcelp/qcelpdec.c	(original)
+++ qcelp/qcelpdec.c	Mon Aug 20 23:36:15 2007
@@ -189,7 +189,7 @@ void qcelp_decode_params(AVCodecContext 
                  */
 
                 if(frame->rate == RATE_FULL && i > 0 && !((i+1) & 3))
-                    predictor=FIX_SPEC_PREDICTOR
+                    predictor=QCELP_FIX_SPEC_PREDICTOR
                               (av_clip(floor((g1[i-1]+g1[i-2]+g1[i-3])/3.0), 6,
                               38));
                 else
@@ -271,12 +271,11 @@ static int qcelp_compute_svector(qcelp_p
 
 
     /**
-     * TIA/EIA/IS-733 Has some missing info on the scaled codebook vector
-     * computation formula. Briefly:
+     * Spec has some missing info here:
      *
      * 'j' should go from 0 to 9 emulating a per codebook-subframe computation.
-     * For a longer explanation see FIX_SPEC_MISSING_CLAMP macro definition
-     * at the qcelpdata.h header in this software distribution.
+     * For a longer explanation see QCELP_FIX_SPEC_MISSING_CLAMP macro
+     * definition at the qcelpdata.h header in this software distribution.
      */
 
     j=0;
@@ -290,7 +289,7 @@ static int qcelp_compute_svector(qcelp_p
                 cdn_vector[i]=
                 gain[i/10]*qcelp_fullrate_ccodebook[(j-index[i/10]) & 127];
 
-                j=FIX_SPEC_MISSING_CLAMP(j);
+                j=QCELP_FIX_SPEC_MISSING_CLAMP(j);
             }
             break;
         case RATE_HALF:
@@ -300,7 +299,7 @@ static int qcelp_compute_svector(qcelp_p
                 cdn_vector[i]=
                 gain[i/40]*qcelp_halfrate_ccodebook[(j-index[i/40]) & 127];
 
-                j=FIX_SPEC_MISSING_CLAMP(j);
+                j=QCELP_FIX_SPEC_MISSING_CLAMP(j);
             }
             break;
         case RATE_QUARTER:



More information about the FFmpeg-soc mailing list