[FFmpeg-devel] [PATCH] ALS decoder

Thilo Borgmann thilo.borgmann
Mon Aug 24 12:45:37 CEST 2009


M?ns Rullg?rd schrieb:
> 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.
> 
Will be in revision 8, thanks!

-Thilo



More information about the ffmpeg-devel mailing list