[FFmpeg-soc] [soc]: r5007 - amr/amrnbdec.c

cmcq subversion at mplayerhq.hu
Sun Aug 9 14:52:58 CEST 2009


Author: cmcq
Date: Sun Aug  9 14:52:57 2009
New Revision: 5007

Log:
Const correctness

Modified:
   amr/amrnbdec.c

Modified: amr/amrnbdec.c
==============================================================================
--- amr/amrnbdec.c	Sun Aug  9 14:45:49 2009	(r5006)
+++ amr/amrnbdec.c	Sun Aug  9 14:52:57 2009	(r5007)
@@ -863,9 +863,9 @@ static void set_fixed_gain(AMRContext *p
  * @param fixed_gain smoothed gain
  * @param out space for modified vector if necessary
  */
-static float *anti_sparseness(AMRContext *p, AMRFixed *fixed_sparse,
-                              const float *fixed_vector,
-                              float fixed_gain, float *out)
+static const float *anti_sparseness(AMRContext *p, AMRFixed *fixed_sparse,
+                                    const float *fixed_vector,
+                                    float fixed_gain, float *out)
 {
     int i, k;
     int ir_filter_strength;
@@ -949,14 +949,14 @@ static float *anti_sparseness(AMRContext
             for (; k < AMR_SUBFRAME_SIZE; k++)
                 out[k] += y * filterp[                    k - x];
         }
-    } else
-       out = fixed_vector;
+        fixed_vector = out;
+    }
 
     // update ir filter strength history
     p->prev_ir_filter_strength = ir_filter_strength;
     p->prev_sparse_fixed_gain  = fixed_gain;
 
-    return out;
+    return fixed_vector;
 }
 
 /// @}
@@ -976,8 +976,8 @@ static float *anti_sparseness(AMRContext
  * @param overflow      16-bit overflow flag
  */
 static int synthesis(AMRContext *p, float *lpc,
-                     float fixed_gain, float *fixed_vector, float *samples,
-                     uint8_t overflow)
+                     float fixed_gain, const float *fixed_vector,
+                     float *samples, uint8_t overflow)
 {
     int i, overflow_temp = 0;
     float excitation[AMR_SUBFRAME_SIZE];
@@ -1171,7 +1171,7 @@ static int amrnb_decode_frame(AVCodecCon
     AMRFixed fixed_sparse;                   // fixed vector up to anti-sparseness processing
     float spare_vector[AMR_SUBFRAME_SIZE];   // extra stack space to hold result from anti-sparseness processing
     float synth_fixed_gain;                  // the fixed gain that synthesis should use
-    float *synth_fixed_vector;               // pointer to the fixed vector that synthesis should use
+    const float *synth_fixed_vector;         // pointer to the fixed vector that synthesis should use
 
     p->cur_frame_mode = unpack_bitstream(p, buf, buf_size);
     if (p->cur_frame_mode == MODE_DTX) {


More information about the FFmpeg-soc mailing list