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

Michael Niedermayer michaelni
Sat May 10 11:54:38 CEST 2008


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

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


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Democracy is the form of government in which you can choose your dictator
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080510/c5a9bace/attachment.pgp>



More information about the ffmpeg-devel mailing list