[FFmpeg-devel] [PATCH] Replace hardcoded LP filter order with parameter in lsp.c

Vladimir Voroshilov voroshil
Sat May 10 18:55:16 CEST 2008


2008/5/10 Michael Niedermayer <michaelni at gmx.at>:
> On Sat, May 10, 2008 at 01:41:39PM +0700, Vladimir Voroshilov wrote:
>> Hi, All
>>
>> Comparing SIPR decoder with current lsp.c code i've found that
>> most of LSP routines are mostly the same.
>>
>> The only difference are order of used filter.
>> G.729 and AMR uses 10th order LP filter, while
>> SIPR's 16k mode used 16th order filter.
>>
>> Attached patch removes hardcoded filter order from loops and
>> replaces it with parameter.
>>
>> P.S. cosmetics long-line-break (declarations only) patch will be applied
>> separately (should i post that trivial patch here ?)
> [...]
>> diff --git a/libavcodec/lsp.c b/libavcodec/lsp.c
>> index 9a09f8d..abe6380 100644
>> --- a/libavcodec/lsp.c
>> +++ b/libavcodec/lsp.c
>> @@ -28,30 +28,30 @@
>>  #include "lsp.h"
>>  #include "acelp_math.h"
>>
>> -void ff_acelp_reorder_lsf(int16_t* lsfq, int lsfq_min_distance, int lsfq_min, int lsfq_max)
>> +void ff_acelp_reorder_lsf(int16_t* lsfq, int16_t lsfq_min_distance, int16_t lsfq_min, int16_t lsfq_max, int lp_order)
>
> unrelated changes

Removed

>
> [...]
>> -void ff_acelp_lsp2lpc(int16_t* lp, const int16_t* lsp)
>> +void ff_acelp_lsp2lpc(int16_t* lp, const int16_t* lsp, int lp_order)
>>  {
>>      int i;
>> -    int f1[6]; // (3.22)
>> -    int f2[6]; // (3.22)
>> +    int lp_half_order = lp_order >> 1;
>
> passing lp_half_order would be cleaner IMHO, especially as odd lp_order
> wont work i think

Fixed




-- 
Regards,
Vladimir Voroshilov     mailto:voroshil at gmail.com
JID: voroshil at gmail.com, voroshil at jabber.ru
ICQ: 95587719
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 09_lsp_46.diff
Type: text/x-diff
Size: 6009 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080510/ab7e74f0/attachment.diff>



More information about the ffmpeg-devel mailing list