[FFmpeg-devel] [PATCH] QCELP decoder

Michael Niedermayer michaelni
Tue Nov 11 19:08:05 CET 2008


On Sun, Nov 09, 2008 at 09:49:20PM -0800, Kenan Gillet wrote:
> Hi,
> On Nov 8, 2008, at 3:57 PM, Michael Niedermayer wrote:
[...]

> Index: libavcodec/qcelp_lsp.c
> ===================================================================
> --- libavcodec/qcelp_lsp.c	(revision 0)
> +++ libavcodec/qcelp_lsp.c	(revision 0)
[...]

> +#include <string.h>
> +
> +#include "dsputil.h"

why?


> +#include "libavutil/common.h"
> +
> +/**
> + * Computes the Pa or Qa 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 v_in input vector, also used as a buffer
> + * @param v_poly polynomial output as a vector
> + *
> + * TIA/EIA/IS-733 2.4.3.3.5-1/2
> + */
> +static void lsp2poly(const float *lspf,
> +                     float *v_in,
> +                     float *v_poly) {
> +    float *v1, *v2;
> +    float val;
> +    int   len, i;
> +
> +    for (i = 0; i < 10; i += 2) {
> +        v1 = v_poly + 1;
> +        v2 = v_in;
> +        val = -2 * cos(M_PI * *lspf);
> +        lspf += 2;
> +        len = FFMIN(4, i);
> +

> +        *v1++ = v2[1] + *v2 * val;
> +        for (; len > 0; len--) {
> +            *v1++ = v2[2]
> +                  + v2[1] * val
> +                  + v2[0];

*v2 and v2[0] are mixed and i think v2[0] is clearer in this context.
also v1/v2 are redundant with v_poly/v_in and it should be possible to
do this cleaner with 1 array instead of swaping 2 around, that is
multiply the factors inplace into a polynom


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

Frequently ignored awnser#1 FFmpeg bugs should be sent to our bugtracker. User
questions about the command line tools should be sent to the ffmpeg-user ML.
And questions about how to use libav* should be sent to the libav-user ML.
-------------- 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/20081111/54c94d0a/attachment.pgp>



More information about the ffmpeg-devel mailing list