[FFmpeg-devel] [PATCH] ALS decoder

Justin Ruggles justin.ruggles
Sun Aug 23 19:56:45 CEST 2009


Thilo Borgmann wrote:

> Revision 6 attached.
> 

> +/** Converts PARCOR coefficient k to direct filter coefficient.
> + */
> +static void parcor_to_lpc(unsigned int k, int64_t *par, int64_t *cof)
> +{
> +    int i;
> +
> +    for (i = 0; i < (k+1) >> 1; i++) {
> +        int32_t tmp1, tmp2;
> +
> +        tmp1 = cof[    i    ] + ((par[k] * cof[k - i - 1] + (1 << 19)) >> 20);
> +        tmp2 = cof[k - i - 1] + ((par[k] * cof[    i    ] + (1 << 19)) >> 20);
> +        cof[k - i - 1] = tmp2;
> +        cof[    i    ] = tmp1;
> +    }
> +
> +    cof[k] = par[k];
> +}
> +

You can use 32-bit for the PARCOR and LPC coefficients like is done in
the specification.  You just have to make sure the multiplication is 64-bit.

Also, your declarations can be inline with the code.
int32_t tmp1 = ...
int32_t tmp2 = ...


-Justin



More information about the ffmpeg-devel mailing list