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

reynaldo subversion at mplayerhq.hu
Mon Sep 3 00:25:21 CEST 2007


Author: reynaldo
Date: Mon Sep  3 00:25:21 2007
New Revision: 1285

Log:
Removes pointless macro stating spec has errors -- Another from Michael's review

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

Modified: qcelp/qcelpdata.h
==============================================================================
--- qcelp/qcelpdata.h	(original)
+++ qcelp/qcelpdata.h	Mon Sep  3 00:25:21 2007
@@ -26,16 +26,6 @@
  */
 
 /**
- * TIA/EIA/IS-733 Spec has errors on the predictor determination formula
- * at equation 2.4.6.1-4 -- The predictor there needs 6 to be subtracted
- * from it to give RI compliants results. The problem is it ignores the
- * fact that codebook subframes 4,8,12 and 16 on a FULL_RATE frame use a
- * different quantizer table.
- */
-
-#define QCELP_FIX_SPEC_PREDICTOR(p) (p-6)
-
-/**
  * TIA/EIA/IS-733 Spec has an omission on the codebook index determination
  * formula for RATE_FULL and RATE_HALF frames at section 2.4.8.1.1. It says
  * you have to subtract the decoded index parameter to the given scaled

Modified: qcelp/qcelpdec.c
==============================================================================
--- qcelp/qcelpdec.c	(original)
+++ qcelp/qcelpdec.c	Mon Sep  3 00:25:21 2007
@@ -160,14 +160,17 @@ void qcelp_decode_params(AVCodecContext 
                 g0[i]=4*cbgain[i];
 
                 /*
-                 * Spec has errors on the predictor determination formula
-                 * it needs 6 to be subtracted from it to give RI results.
+                 * TIA/EIA/IS-733 Spec has errors on the predictor determination
+                 * formula at equation 2.4.6.1-4 -- The predictor there needs 6
+                 * to be subtracted from it to give RI compliants results. The
+                 * problem is it ignores the fact that codebook subframes 4, 8,
+                 * 12 and 16 on a FULL_RATE frame use a different quantizer
+                 * table.
                  */
 
                 if(frame->rate == RATE_FULL && i > 0 && !((i+1) & 3))
-                    predictor=QCELP_FIX_SPEC_PREDICTOR
-                              (av_clip(floor((g1[i-1]+g1[i-2]+g1[i-3])/3.0), 6,
-                              38));
+                    predictor=av_clip(floor((g1[i-1]+g1[i-2]+g1[i-3])/3.0), 6,
+                              38)-6;
                 else
                     predictor=0;
 



More information about the FFmpeg-soc mailing list