[FFmpeg-devel] [PATCH] Add functions shared by AMR and SIPR

Robert Swain robert.swain
Sun Oct 25 11:01:34 CET 2009


Vitor Sessak wrote:
> Ronald S. Bultje wrote:
>> On Sun, Oct 18, 2009 at 7:41 PM, Vitor Sessak <vitor1001 at gmail.com> 
>> wrote:
>>> The SIPR decoder shares quite a few code with AMR. Most of those 
>>> functions
>>> are copied from the last AMR patch in -devel. An exception is
>>> ff_acelp_interpolatef(), that was copied from a fixed-point version 
>>> and is
>>> used in AMR in the function interp_pitch_vector().
>> [..]
>>> +void ff_set_max_dist_lsf(float *lsf, float min_spacing, int size)
>>> +{
>>> +    int i;
>>> +    float prev = 0.0;
>>> +    for (i = 0; i < size; i++)
>>> +        prev = lsf[i] = FFMAX(lsf[i], prev + min_spacing);
>>> +}
>>
>> ff_set_min_dist_lsf().
> 
> Changed that and Diego's cosmetics in the new version. Michael, ping?

Index: libavcodec/acelp_vectors.c
===================================================================
--- libavcodec/acelp_vectors.c	(revision 20368)
+++ libavcodec/acelp_vectors.c	(working copy)

[...]

@@ -155,3 +156,22 @@
          out[i] = weight_coeff_a * in_a[i]
                 + weight_coeff_b * in_b[i];
  }
+
+void ff_adaptative_gain_control(float *buf_out, float speech_energ,
+                                int size, float alpha, float *gain_mem)
+{
+    int i;
+    float postfilter_energ = ff_dot_productf(buf_out, buf_out, 48);

Why 48? IIRC it should be 40 in AMR-NB. Shouldn't it be replaced with 
'size'?

Regards,
Rob



More information about the ffmpeg-devel mailing list