[FFmpeg-devel] [PATCH] Common ACELP code & G.729 [1/7] - filters

Diego Biurrun diego
Sat May 10 09:33:08 CEST 2008


On Sat, May 10, 2008 at 12:44:25PM +0700, Vladimir Voroshilov wrote:
> 
> Is clarification in attached patch ok ?
> 
> If so, i'll commit patch.
> 
> --- /dev/null
> +++ b/libavcodec/acelp_filters.c
> @@ -0,0 +1,125 @@
> +/*
> + * Various filters for ACELP-based codecs

various

> +    /* Since there are few pulses over all subframe (i.e. almost all

subframeS

> +       fc_in[i] are zero, in case of G.729D buffer contains two non-zero

the buffer

> +       samples before call to ff_acelp_enhance_harmonics, and (due to

the call

> +       pitch_delay bounded to [20; 143]) maximum four non-zero samples

a maximum of

> +       of total 40 after call to it), it is faster to swap two loops

for a total of 40 after the call to it

> +       and process non-zero samples only. This will reduce number of
> +       multiplications from 40*40 to 4*40 for G.729D */

the number

> --- /dev/null
> +++ b/libavcodec/acelp_filters.h
> @@ -0,0 +1,113 @@
> +/*
> + * Various filters for ACELP-based codecs

various

> + * \brief Circularly convolve fixed vector with a phase dispersion impulse
> + *        response filter (D.6.2 of G.729 and 6.1.5 of AMR)

.

> + * \note output buffer must contain 10 samples of past
> + *       speech data before pointer

.

> + * Routine applies 1/A(z) filter to given speech data

.

> + * \brief Calculates coefficients of weighted A(z/weight) filter

.

> + * \param out [out] resulted weighted A(z/weight)

weighted A(z/weight) result

> + * Filter has a cut-off frequency 100Hz

The filter has a cut-off frequency of 100Hz.

or

The filter has cut-off frequency 100Hz.

> + * \note Two items before top of out buffer must contain two items from the

before the top of the out buffer

> + *       tail of previous subframe.

the previous

> + * \remark It is safe to pass the same array in in and out parameters

.

> + * \remark AMR uses mostly the same filter (cut-off frequency 60Hz, same formula,
> + *         but constants differs in 5th sign after comma). Fortunately in
> + *         fixed-point all coefficients are the same as in G.729. Thus this
> + *         routine can be used for fixed-point AMR decoder too.

can be used for the fixed-point AMR decoder, too.

Diego




More information about the ffmpeg-devel mailing list