[FFmpeg-devel] [PATCH] Add functions shared by AMR and SIPR
Vitor Sessak
vitor1001
Sun Oct 25 21:39:11 CET 2009
Robert Swain wrote:
> 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'?
Ok, 10l, now actually tested with both AMR and SIPR ;)
I've attached a modified amrnbdec.c that uses this patch to give an idea
of how my patch fit with it. Collin, do you have any opinion on this patch?
-Vitor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: amr_and_sipr3.diff
Type: text/x-diff
Size: 6022 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091025/8cc536a7/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: amrnbdec.c
Type: text/x-csrc
Size: 46051 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091025/8cc536a7/attachment.c>
More information about the ffmpeg-devel
mailing list