[FFmpeg-devel] [PATCH] ALS decoder

Thilo Borgmann thilo.borgmann
Sun Aug 23 23:48:55 CEST 2009


>> +/** 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 = ...
> 

Done in revision 7.

Thanks!

-Thilo



More information about the ffmpeg-devel mailing list