[FFmpeg-devel] [PATCH 2/2] Add SIPR decoder for 5k0, 6k5 and 8k5 modes

Måns Rullgård mans
Mon Jan 11 19:14:21 CET 2010


"Ronald S. Bultje" <rsbultje at gmail.com> writes:

> Hi,
>
> On Sun, Jan 10, 2010 at 4:43 PM, Vitor Sessak <vitor1001 at gmail.com> wrote:
>> Now the patch that adds 16k support. I'm undecided if I should put this code
>> in a separated file...
>
> Index: libavcodec/siprdata.h
> [..]
> +static const float gain_cb_16k[32] =
> +{
> +    0.07499,     0.10593,     0.14125,     0.18836,
>
> Lots of spaces?
>
> [..]
>
> Index: libavcodec/sipr.c
> [..]
> +    int ma_pred_switch;        ///< switched MA predictor
>
> What's MA?

Moving average?

> +/**
> + * Convert an lsf vector into an lsp vector.
> + *
> + * @param lsf               input lsf vector
> + * @param lsp               output lsp vector
> + */
> +static void lsf2lsp(float *lsf, double *lsp)
> +{
> +    int i;
>
> -static void dequant(float *out, const int *idx, const float *cbs[])
> +    for (i = 0; i < LP_FILTER_ORDER_16k; i++)
> +        lsp[i] = cos(lsf[i]);
> +}
> +
> +static void dequant(float *out, const int *idx, const float *cbs[],
> +                    int mode_16k)
>
> I wish we could teach diff how silly this looks. Just look.
>
> You can mark lsf as const, maybe makes it a bit faster, since it's not
> changed in the function. the same could probably be done elsewhere
> also (not critical...).

It is generally a good idea to use const where possible.  There's a
slight chance of getting better code, and it avoids accidentally
modifying something.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list