[FFmpeg-devel] [PATCH] TwinVQ decoder

Diego Biurrun diego
Mon Jul 13 16:06:31 CEST 2009


On Mon, Jul 13, 2009 at 03:45:58PM +0200, Vitor Sessak wrote:
> 
> #define PPC_SHAPE_CB_SIZE 64
> #define SUB_AMP_MAX 4500.
> #define MULAW_MU 100.
> #define GAIN_BITS 8
> #define AMP_MAX 13000.
> #define SUB_GAIN_BITS 5
> #define WINDOW_TYPE_BITS 4
> #define PGAIN_MU 200

I think this would be more readable aligned.  Am I the only one who
thinks that float constants ending in '.' instead of '.0' are confusing?


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

while (

You use the same inconsistently below.

> /**
>  * Evaluate a single LPC amplitude spectrum envelope coefficient from the line
>  * spectrum pairs

End sentences in a period please.

>     int j;
>     float p=0.5f;
>     float q=0.5f;
>     float two_cos_w=2.0f*cos_val;
> 
>     for(j=0;j+1<order;j+=2) {

Please consistently use K&R style.  You also sometimes put spaces around
'=', sometimes you don't.  I suggest adding spaces as K&R would, it's
more readable.

>     return clip*FFSIGN(y)*(exp(log(1+mu)*fabs(y))-1)/mu;

That line could use a few spaces.

>     // For the last block, be careful not to go beyond the end of the buffer
>     center = very_broken_op(period, i);
>     for (j= -width/2; j < (width+1)/2 && shape < shape_end; j++) {
>         speech[j+center] += ppc_gain * *shape++;
>     }

useless {}

> static void decode_ppc(int period_coef, const float *shape, float ppc_gain,
>                         float *speech, TwinContext *tctx)

indentation

> static void imdctw_win_block(const float *in, float *out, float *hist, int window_type,
>                     enum FrameType ftype, const ModeTab *mtab)

ditto

> /**
>  * Intepret the input data as in the following table:

inteRpret

Diego



More information about the ffmpeg-devel mailing list