]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/amrnbdec.c
Fix misspelled parameter names in Doxygen documentation.
[ffmpeg] / libavcodec / amrnbdec.c
index 08ad9525c8de148a78ddabf1f4ffc0586acd8a5e..d3fa7653f8c863c448f57b203fd39f8a5bbbcdc6 100644 (file)
@@ -796,7 +796,7 @@ static int synthesis(AMRContext *p, float *lpc,
                      float fixed_gain, const float *fixed_vector,
                      float *samples, uint8_t overflow)
 {
-    int i, overflow_temp = 0;
+    int i;
     float excitation[AMR_SUBFRAME_SIZE];
 
     // if an overflow has been detected, the pitch vector is scaled down by a
@@ -831,12 +831,10 @@ static int synthesis(AMRContext *p, float *lpc,
     // detect overflow
     for (i = 0; i < AMR_SUBFRAME_SIZE; i++)
         if (fabsf(samples[i]) > AMR_SAMPLE_BOUND) {
-            overflow_temp = 1;
-            samples[i] = av_clipf(samples[i], -AMR_SAMPLE_BOUND,
-                                               AMR_SAMPLE_BOUND);
+            return 1;
         }
 
-    return overflow_temp;
+    return 0;
 }
 
 /// @}
@@ -943,7 +941,7 @@ static void postfilter(AMRContext *p, float *lpc, float *buf_out)
     ff_tilt_compensation(&p->tilt_mem, tilt_factor(lpc_n, lpc_d), buf_out,
                          AMR_SUBFRAME_SIZE);
 
-    ff_adaptive_gain_control(buf_out, speech_gain, AMR_SUBFRAME_SIZE,
+    ff_adaptive_gain_control(buf_out, buf_out, speech_gain, AMR_SUBFRAME_SIZE,
                              AMR_AGC_ALPHA, &p->postfilter_agc);
 }
 
@@ -1044,14 +1042,11 @@ static int amrnb_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
         update_state(p);
     }
 
-    ff_acelp_apply_order_2_transfer_function(buf_out, highpass_zeros,
-                                             highpass_poles, highpass_gain,
+    ff_acelp_apply_order_2_transfer_function(buf_out, buf_out, highpass_zeros,
+                                             highpass_poles,
+                                             highpass_gain * AMR_SAMPLE_SCALE,
                                              p->high_pass_mem, AMR_BLOCK_SIZE);
 
-    for (i = 0; i < AMR_BLOCK_SIZE; i++)
-        buf_out[i] = av_clipf(buf_out[i] * AMR_SAMPLE_SCALE,
-                              -1.0, 32767.0 / 32768.0);
-
     /* Update averaged lsf vector (used for fixed gain smoothing).
      *
      * Note that lsf_avg should not incorporate the current frame's LSFs