[FFmpeg-devel] [PATCH] QCELP decoder

Michael Niedermayer michaelni
Mon Dec 1 23:05:18 CET 2008


On Mon, Dec 01, 2008 at 12:45:09PM -0800, Kenan Gillet wrote:
> Hi,
> On Mon, Dec 1, 2008 at 8:24 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
> > On Mon, Dec 01, 2008 at 08:17:52AM -0800, Kenan Gillet wrote:
> >>
> >> On Dec 1, 2008, at 4:52 AM, Michael Niedermayer wrote:
> >>
> >> > On Sun, Nov 30, 2008 at 05:04:07PM -0800, Kenan Gillet wrote:
> >> >> Hi,
> >> >> On Nov 30, 2008, at 7:50 AM, Michael Niedermayer wrote:
> >> >>
> >> >>> On Sat, Nov 29, 2008 at 10:39:58AM -0800, Kenan Gillet wrote:
> > [...]
> >> > [...]
> >> >>>> +    /**
> >> >>>> +     * reserved bits on all bitrate but bitrate 1/2 packets
> >> >>>
> >> >>> this is unclear, field that is on all but ... , vs. field that
> >> >>> exists always but
> >> >>> is reserved on all but .....
> >> >>>
> >> >>
> >> >> is "reserved bits only set for bitrate 1, 1/4 and 1/8" better ?
> >> >
> >> > no, because setting them means error IIRC
> >> > also IIRC there is no indication of the existence of other fields
> >> > for the
> >> > other rates ...
> >> >
> >>
> >> reserved bits only present in bitrate 1, 1/4 and 1/8 packets
> >>
> >> ?
> >
> > ok
> >
> > [...]
> 
> here is an updated round 14 of the patches,
> which is getting smaller and smaller :)
> 
> Kenan

[...]

> +/**
> + * initial coefficient to perform bandwidth expansion on LPC
> + *
> + * TIA/EIA/IS-733 2.4.3.3.6 6
> + */

> +#define QCELP_BANDWITH_EXPANSION_COEFF 0.9883

i suspect that is supposed to be an approximation of 253/256


> +
> +/**
> + * Computes the Pa / (1 + z(-1)) or Qa / (1 - z(-1)) coefficients
> + * needed for LSP to LPC conversion.
> + * We only need to calculate the 6 first elements of the polynomial.
> + *
> + * @param lspf line spectral pair frequencies
> + * @param f [out] polynomial input/output as a vector
> + *
> + * TIA/EIA/IS-733 2.4.3.3.5-1/2
> + */
> +static void lsp2polyf(const float *lspf, double *f, int lp_half_order)
> +{
> +    int i, j;
> +
> +    f[0] = 1.0;
> +    f[1] = -2 * cos(M_PI * lspf[0]);
> +    lspf -= 2;
> +    for(i=2; i<=lp_half_order; i++)
> +    {
> +        double val = -2 * cos(M_PI * lspf[2*i]);
> +        f[i] = val * f[i-1] + 2*f[i-2];
> +        for(j=i-1; j>1; j--)

> +            f[j] = f[j] + f[j-1] * val + f[j-2];

f[j] += f[j-1] * val + f[j-2];


> +        f[1] += val;
> +    }
> +}
> +
> +/**
> + * Reconstructs LPC coefficients from the line spectral pair frequencies
> + * and performs bandwidth expansion.
> + *
> + * @param lspf line spectral pair frequencies
> + * @param lpc linear predictive coding coefficients
> + *
> + * @note: bandwith_expansion_coeff could be precalculated into a table
> + *        but it seems to be slower on x86
> + *
> + * TIA/EIA/IS-733 2.4.3.3.5
> + */

> +void qcelp_lspf2lpc(const float *lspf, float *lpc)

missing ff_ prefix againt name clashes

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- Plato 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081201/de70cbf8/attachment.pgp>



More information about the ffmpeg-devel mailing list