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

cmcq subversion at mplayerhq.hu
Sat Aug 15 22:32:12 CEST 2009


Author: cmcq
Date: Sat Aug 15 22:32:12 2009
New Revision: 5147

Log:
Formatting

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

Modified: amr/amrnbdata.h
==============================================================================
--- amr/amrnbdata.h	Sat Aug 15 22:27:51 2009	(r5146)
+++ amr/amrnbdata.h	Sat Aug 15 22:32:12 2009	(r5147)
@@ -52,14 +52,14 @@
 
 /** Frame type (Table 1a in 3GPP TS 26.101) */
 enum Mode {
-    MODE_4k75 = 0,                         ///< 4.75 kbit/s
-    MODE_5k15,                             ///< 5.15 kbit/s
-    MODE_5k9,                              ///< 5.90 kbit/s
-    MODE_6k7,                              ///< 6.70 kbit/s
-    MODE_7k4,                              ///< 7.40 kbit/s
-    MODE_7k95,                             ///< 7.95 kbit/s
-    MODE_10k2,                             ///< 10.2 kbit/s
-    MODE_12k2,                             ///< 12.2 kbit/s
+    MODE_4k75 = 0,                        ///< 4.75 kbit/s
+    MODE_5k15,                            ///< 5.15 kbit/s
+    MODE_5k9,                             ///< 5.90 kbit/s
+    MODE_6k7,                             ///< 6.70 kbit/s
+    MODE_7k4,                             ///< 7.40 kbit/s
+    MODE_7k95,                            ///< 7.95 kbit/s
+    MODE_10k2,                            ///< 10.2 kbit/s
+    MODE_12k2,                            ///< 12.2 kbit/s
     MODE_DTX,                             ///< silent frame
     N_MODES,                              ///< number of modes
     NO_DATA = 15                          ///< no transmission
@@ -108,11 +108,11 @@ typedef struct {
 /** Specify a pitch gain bit */
 #define AMR_PGAIN(frame_num, bit)            AMR_OF(frame_num, p_gain, bit)
 /** Specify a fixed gain bit */
-#define AMR_FGAIN(frame_num, bit)       AMR_OF(frame_num, fixed_gain, bit)
+#define AMR_FGAIN(frame_num, bit)            AMR_OF(frame_num, fixed_gain, bit)
 /** Specify a pitch lag bit */
 #define AMR_PLAG(frame_num, bit)             AMR_OF(frame_num, p_lag, bit)
 /** Specify a pulse bit */
-#define AMR_PULSE(frame_num, pulse_id, bit) AMR_OF(frame_num, pulses[pulse_id], bit)
+#define AMR_PULSE(frame_num, pulse_id, bit)  AMR_OF(frame_num, pulses[pulse_id], bit)
 /** Specify an SID reference vector bit */
 #define AMR_SVECTOR(bit)                     AMR_BIT(sid_vector, bit)
 /** Specify an SID energy index bit */
@@ -1523,13 +1523,13 @@ static const float pred_fac[LP_FILTER_OR
 };
 
 /** Prediction factor for 12.2kbit/s mode */
-#define PRED_FAC_MODE_12k2              0.65
+#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_MAX                   143 ///< Upper bound on decoded lag search
 #define PITCH_LAG_MIN                    20 ///< Lower bound on decoded lag search
-#define PITCH_LAG_MIN_MODE_12k2           18 ///< Lower bound on decoded lag search in 12.2kbit/s mode
+#define PITCH_LAG_MIN_MODE_12k2          18 ///< Lower bound on decoded lag search in 12.2kbit/s mode
 
 /** b60 hamming windowed sinc function coefficients */
 static const float b60[61] = {
@@ -1786,7 +1786,7 @@ static const float ir_filter_medium[AMR_
  0.016998,  0.023804, -0.041779,  0.025696,  0.019989,
 };
 
-static const float *ir_filters_lookup[2]          = { ir_filter_strong,          ir_filter_medium };
+static const float *ir_filters_lookup[2]           = { ir_filter_strong,           ir_filter_medium };
 static const float *ir_filters_lookup_MODE_7k95[2] = { ir_filter_strong_MODE_7k95, ir_filter_medium };
 
 
@@ -1811,18 +1811,18 @@ static const float formant_low_n[10] = {
 static const float *formant_low_d = formant_high_n;
 
 /** Number of impulse response coefficients used for tilt factor */
-#define AMR_TILT_RESPONSE 22
+#define AMR_TILT_RESPONSE   22
 /** Tilt factor = 1st reflection coefficient * gamma_t */
-#define AMR_TILT_GAMMA_T 0.8
+#define AMR_TILT_GAMMA_T   0.8
 /** Adaptive gain control factor used in post-filter */
-#define AMR_AGC_ALPHA 0.9
+#define AMR_AGC_ALPHA      0.9
 
 
 // High-pass coefficients
 
 static const float highpass_zeros[2] = { -2.0, 1.0 };
 static const float highpass_poles[2] = { -1.933105469, 0.935913085 };
-static const float highpass_gain = 0.939819335;
+static const float highpass_gain     = 0.939819335;
 
 #endif /* AVCODEC_AMRNBDATA_H */
 

Modified: amr/amrnbdec.c
==============================================================================
--- amr/amrnbdec.c	Sat Aug 15 22:27:51 2009	(r5146)
+++ amr/amrnbdec.c	Sat Aug 15 22:32:12 2009	(r5147)
@@ -237,10 +237,10 @@ static void make_increasing(float *lsf)
  * @param update store data for computing the next frame's LSFs
  */
 static void lsf2lsp_for_mode12k2(AMRContext *p, float lsp[LP_FILTER_ORDER],
-                                const float lsf_no_r[LP_FILTER_ORDER],
-                                const int16_t *lsf_quantizer[5],
-                                const int quantizer_offset,
-                                const int sign, const int update)
+                                 const float lsf_no_r[LP_FILTER_ORDER],
+                                 const int16_t *lsf_quantizer[5],
+                                 const int quantizer_offset,
+                                 const int sign, const int update)
 {
     int16_t lsf_r[LP_FILTER_ORDER]; // residual LSF vector
     float lsf_q[LP_FILTER_ORDER]; // quantified LSF vector
@@ -580,11 +580,11 @@ static void decode_10_pulses_35bits(cons
  * Decode the algebraic codebook index to pulse positions and signs,
  * then construct the algebraic codebook vector.
  *
- *                           nb of pulses | bits encoding pulses
- * For MODE_4k75 or MODE_5k15,            2 | 1-3, 4-6, 7
- *                  MODE_5k9,            2 | 1,   2-4, 5-6, 7-9
- *                  MODE_6k7,            3 | 1-3, 4,   5-7, 8,  9-11
- *      MODE_7k4 or MODE_7k95,            4 | 1-3, 4-6, 7-9, 10, 11-13
+ *                              nb of pulses | bits encoding pulses
+ * For MODE_4k75 or MODE_5k15,             2 | 1-3, 4-6, 7
+ *                  MODE_5k9,              2 | 1,   2-4, 5-6, 7-9
+ *                  MODE_6k7,              3 | 1-3, 4,   5-7, 8,  9-11
+ *      MODE_7k4 or MODE_7k95,             4 | 1-3, 4-6, 7-9, 10, 11-13
  *
  * @param fixed_sparse pointer to the algebraic codebook vector
  * @param pulses       algebraic codebook indexes
@@ -823,8 +823,7 @@ static void decode_gains(AMRContext *p, 
             gains = gains_low [amr_subframe->p_gain];
         } else {
             // gain index is only coded in subframes 0,2 for MODE_4k75
-            gains = gains_MODE_4k75[(p->frame.subframe[subframe & 2].p_gain << 1)
-                                   + (subframe & 1)];
+            gains = gains_MODE_4k75[(p->frame.subframe[subframe & 2].p_gain << 1) + (subframe & 1)];
         }
 
         p->pitch_gain[4]   = gains[0] / 16384.0;


More information about the FFmpeg-soc mailing list