[FFmpeg-devel] AMR-NB decoder

Colin McQuillan m.niloc
Fri Aug 7 21:23:53 CEST 2009


2009/8/6 Michael Niedermayer <michaelni at gmx.at>:
> On Wed, Aug 05, 2009 at 05:51:36PM +0100, Colin McQuillan wrote:
>> Attached is a patch for an AMR-NB decoder.

[...]

>>
>> +void ff_celp_convolve_circf(float* fc_out,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ?const float* fc_in,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ?const float* filter,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ?int len)
>> +{
>> + ? ?int i, k;
>> +
>> + ? ?memset(fc_out, 0, len * sizeof(float));
>> +
>> + ? ?/* Since there are few pulses over an entire subframe (i.e. almost
>> + ? ? ? all fc_in[i] are zero) it is faster to loop over fc_in first. */
>> + ? ?for (i = 0; i < len; i++) {
>> + ? ? ? ?if (fc_in[i]) {
>> + ? ? ? ? ? ?for (k = 0; k < i; k++)
>> + ? ? ? ? ? ? ? ?fc_out[k] += fc_in[i] * filter[len + k - i];
>> +
>> + ? ? ? ? ? ?for (k = i; k < len; k++)
>> + ? ? ? ? ? ? ? ?fc_out[k] += fc_in[i] * filter[ ? ? ?k - i];
>> + ? ? ? ?}
>> + ? ?}
>> +}
>> +
>> ?int ff_celp_lp_synthesis_filter(int16_t *out,
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?const int16_t* filter_coeffs,
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?const int16_t* in,
>> Index: libavcodec/celp_filters.h
>> ===================================================================
>> --- libavcodec/celp_filters.h (revision 19598)
>> +++ libavcodec/celp_filters.h (working copy)
>> @@ -42,6 +42,22 @@
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? int len);
>>
>> ?/**
>> + * Circularly convolve fixed vector with a phase dispersion impulse
>> + * ? ? ? ?response filter (D.6.2 of G.729 and 6.1.5 of AMR).
>> + * @param fc_out vector with filter applied
>> + * @param fc_in source vector
>> + * @param filter phase filter coefficients
>> + *
>> + * ?fc_out[n] = sum(i,0,len-1){ fc_in[i] * filter[(len + n - i)%len] }
>> + *
>> + * \note fc_in and fc_out should not overlap!
>> + */
>> +void ff_celp_convolve_circf(float* fc_out,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ?const float* fc_in,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ?const float* filter,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ?int len);
>> +
>> +/**
>> ? * LP synthesis filter.
>> ? * @param out [out] pointer to output buffer
>> ? * @param filter_coeffs filter coefficients (-0x8000 <= (3.12) < 0x8000)
>
> that should e a seperate patch

I'll leave this one until I investigate a version for sparse vectors. Attached:

1. Helper functions for gain control in floating-point codecs
I couldn't find a similar fixed point function to copy the function name.

2. Floating-point version of ff_acelp_high_pass_filter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: get-set-energyf.patch
Type: text/x-diff
Size: 2008 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090807/aabcf0fe/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: high-pass-filterf.patch
Type: text/x-diff
Size: 1237 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090807/aabcf0fe/attachment-0001.patch>



More information about the ffmpeg-devel mailing list