[FFmpeg-devel] [PATCH] Common ACELP routines (3/3) - LPC decoding routines

Robert Swain robert.swain
Wed Apr 23 15:02:50 CEST 2008


On 23 Apr 2008, at 01:38, Michael Niedermayer wrote:
> On Tue, Apr 22, 2008 at 01:21:24AM +0700, Vladimir Voroshilov wrote:
>> This patch contains several routines related to LP filter  
>> coefficients
>> decoding (not all, but those which
>> looks like AMR's).
>
> [...]
>
>> diff --git a/libavcodec/acelp_lpc.c b/libavcodec/acelp_lpc.c
>> new file mode 100644
>> index 0000000..65b870d
>> --- /dev/null
>> +++ b/libavcodec/acelp_lpc.c
>
> lsp.c

I'd prefer *lpc.* as the code relates to linear predictive coding  
functions and not just line spectral pairs. But as you please - what  
is in a name? :)

Isn't there some LPC code in FLAC? Is any of that useful?

> [...]
>> +void ff_acelp_reorder_lsf(int16_t* lsfq, int16_t  
>> lsfq_min_distance, int16_t lsfq_min, int16_t lsfq_max)
>> +{
>> +    int i;
>> +
>> +    lsfq[0] = FFMAX(lsfq[0], lsfq_min); //Is warning required ?
>> +
>> +    for(i=0;i<9; i++)
>> +        lsfq[i+1] = FFMAX(lsfq[i+1], lsfq[i] + lsfq_min_distance);
>
> simplification stolen from soc/amrnbdec.c:
>
> for(i=0; i<10; i++){
>    lsf[i] = FFMAX(lsf[i], lsf_min);
>    lsf_min = lsf[i] + min_distance;
> }
>
> also id make lsfq_min_distance and lsfq_min/max int
>
> ahh, and reorder_lsf() in soc/amrnbdec.c is buggy (uninitalized var)

Fixed. :)

I haven't looked at these patches yet. I'll try to take a look now.  
I've forgotten the fixed point code because I didn't like fixed point,  
gave up on it, rewrote the spec on the wiki and wrote a float version  
which is in the debugging phase. I'll see if I have any useful  
comments on the patches though as I would like to have shared code. :)

Thanks,
Rob




More information about the ffmpeg-devel mailing list