[FFmpeg-devel] [PATCH] Add functions shared by AMR and SIPR
Vitor Sessak
vitor1001
Wed Oct 28 00:53:18 CET 2009
Vitor Sessak wrote:
> 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?
I suppose nobody had any more comments, so I've applied it. Please feel
free to flame me in -cvslogs.
-Vitor
More information about the ffmpeg-devel
mailing list