[FFmpeg-soc] [soc]: r5591 - in amr: amrnbdata.h amrnbdec.c

vitor subversion at mplayerhq.hu
Mon Jan 25 00:51:12 CET 2010


Author: vitor
Date: Mon Jan 25 00:51:11 2010
New Revision: 5591

Log:
Move #defines from amrnbdata.h to amrnbdec.c when possible

Modified:
   amr/amrnbdata.h
   amr/amrnbdec.c

Modified: amr/amrnbdata.h
==============================================================================
--- amr/amrnbdata.h	Sun Jan 24 15:18:33 2010	(r5590)
+++ amr/amrnbdata.h	Mon Jan 25 00:51:11 2010	(r5591)
@@ -34,21 +34,7 @@
 #include "libavutil/common.h"      /* offsetof */
 #include "libavutil/mathematics.h" /* M_PI */
 
-#define AMR_BLOCK_SIZE              160   ///< samples per frame
 #define AMR_SUBFRAME_SIZE            40   ///< samples per subframe
-#define AMR_SAMPLE_BOUND        32768.0   ///< threshold for synthesis overflow
-
-/**
- * Scale from constructed speech to [-1,1]
- *
- * AMR is designed to produce 16-bit PCM samples (3GPP TS 26.090 4.2) but
- * upscales by two (section 6.2.2).
- *
- * Fundamentally, this scale is determined by energy_mean through
- * the fixed vector contribution to the excitation vector.
- */
-#define AMR_SAMPLE_SCALE  (2.0 / 32768.0)
-
 
 /** Frame type (Table 1a in 3GPP TS 26.101) */
 enum Mode {
@@ -1449,14 +1435,6 @@ static const float pred_fac[LP_FILTER_OR
     0.355560, 0.323120, 0.298065, 0.262238, 0.197876,
 };
 
-/** Prediction factor for 12.2kbit/s mode */
-#define PRED_FAC_MODE_12k2             0.65
-
-#define LSF_R_FAC          (8000.0 / 32768.0) ///< LSF residual tables to Hertz
-#define MIN_LSF_SPACING             50.0488   ///< Ensures stability of LPC filter
-#define PITCH_LAG_MIN_MODE_12k2          18   ///< Lower bound on decoded lag search in 12.2kbit/s mode
-
-
 // fixed tables
 
 /**
@@ -1475,9 +1453,6 @@ static const uint8_t gray_decode[8] = { 
 
 // gain tables
 
-/** Initial energy in dB. Also used for bad frames (unimplemented). */
-#define MIN_ENERGY -14.0
-
 /** scalar quantized pitch gain table for 7.95 and 12.2 kbps modes */
 static const uint16_t qua_gain_pit[16] = {
      0,  3277,  6556,  8192,  9830, 11469, 12288, 13107,
@@ -1664,13 +1639,6 @@ static const uint16_t gains_low[64][2] =
 
 // pre-processing tables
 
-/** Maximum sharpening factor
- *
- * The specification says 0.8, which should be 13107, but the reference C code
- * uses 13017 instead. (Amusingly the same applies to SHARP_MAX in g729dec.c.)
- */
-#define SHARP_MAX 0.79449462890625
-
 /** impulse response filter tables converted to float from Q15 int32_t
  * used for anti-sparseness processing */
 static const float ir_filter_strong_MODE_7k95[AMR_SUBFRAME_SIZE] = {
@@ -1707,15 +1675,6 @@ static const float *ir_filters_lookup_MO
     ir_filter_strong_MODE_7k95, ir_filter_medium
 };
 
-
-/** Number of impulse response coefficients used for tilt factor */
-#define AMR_TILT_RESPONSE   22
-/** Tilt factor = 1st reflection coefficient * gamma_t */
-#define AMR_TILT_GAMMA_T   0.8
-/** Adaptive gain control factor used in post-filter */
-#define AMR_AGC_ALPHA      0.9
-
-
 // High-pass coefficients
 
 static const float highpass_zeros[2] = { -2.0, 1.0 };

Modified: amr/amrnbdec.c
==============================================================================
--- amr/amrnbdec.c	Sun Jan 24 15:18:33 2010	(r5590)
+++ amr/amrnbdec.c	Mon Jan 25 00:51:11 2010	(r5591)
@@ -55,6 +55,44 @@
 
 #include "amrnbdata.h"
 
+#define AMR_BLOCK_SIZE              160   ///< samples per frame
+#define AMR_SAMPLE_BOUND        32768.0   ///< threshold for synthesis overflow
+
+/**
+ * Scale from constructed speech to [-1,1]
+ *
+ * AMR is designed to produce 16-bit PCM samples (3GPP TS 26.090 4.2) but
+ * upscales by two (section 6.2.2).
+ *
+ * Fundamentally, this scale is determined by energy_mean through
+ * the fixed vector contribution to the excitation vector.
+ */
+#define AMR_SAMPLE_SCALE  (2.0 / 32768.0)
+
+/** Prediction factor for 12.2kbit/s mode */
+#define PRED_FAC_MODE_12k2             0.65
+
+#define LSF_R_FAC          (8000.0 / 32768.0) ///< LSF residual tables to Hertz
+#define MIN_LSF_SPACING             50.0488   ///< Ensures stability of LPC filter
+#define PITCH_LAG_MIN_MODE_12k2          18   ///< Lower bound on decoded lag search in 12.2kbit/s mode
+
+/** Initial energy in dB. Also used for bad frames (unimplemented). */
+#define MIN_ENERGY -14.0
+
+/** Maximum sharpening factor
+ *
+ * The specification says 0.8, which should be 13107, but the reference C code
+ * uses 13017 instead. (Amusingly the same applies to SHARP_MAX in g729dec.c.)
+ */
+#define SHARP_MAX 0.79449462890625
+
+/** Number of impulse response coefficients used for tilt factor */
+#define AMR_TILT_RESPONSE   22
+/** Tilt factor = 1st reflection coefficient * gamma_t */
+#define AMR_TILT_GAMMA_T   0.8
+/** Adaptive gain control factor used in post-filter */
+#define AMR_AGC_ALPHA      0.9
+
 typedef struct AMRContext {
     AMRNBFrame                        frame; ///< decoded AMR parameters (lsf coefficients, codebook indexes, etc)
     uint8_t             bad_frame_indicator; ///< bad frame ? 1 : 0


More information about the FFmpeg-soc mailing list