[FFmpeg-devel] [PATCH] ALS decoder

Måns Rullgård mans
Mon Aug 24 12:11:35 CEST 2009


Justin Ruggles <justin.ruggles at gmail.com> writes:

> 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.

For 32x32->64 multiplication, use the MUL64 macro from mathops.h, or
gcc will bite you.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list