[FFmpeg-devel] [PATCH] TwinVQ decoder

Diego Biurrun diego
Wed May 6 19:20:05 CEST 2009


On Wed, May 06, 2009 at 05:09:50PM +0200, Vitor Sessak wrote:
> 
> New version attached...

You should really split this somehow, it's too big...

> static void mul_vec(int cont, const float *buf1, const float *buf2, float *buf3)
> {
>     while(cont--)

Extra good karma for K&R spaces between while/if/for/switch and (.  You
already do it in some places, just not consistently..

>         *buf3++ = (*buf1++)*(*buf2++);

This would be more readable with spaces around the *.

> static float eval_lpc_spectrum(const float *cos_lsp, float cos_val, int size)
> {
>     int i;
>     float a=1.;
>     float b=1.;
> 
>     for(i=0; i < size; i += 2) {
>         a *= 2*cos_val - cos_lsp[i  ];
>         b *= 2*cos_val - cos_lsp[i+1];
>     }
> 
>     return 1./(a*a*(1+cos_val) + b*b*(1-cos_val));

1.0?

extra good karma for some more spaces around = and other operators..

This is missing all the build system and documentation stuff and the
glue code..

Diego



More information about the ffmpeg-devel mailing list