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

Vitor Sessak vitor1001
Thu Jan 14 05:07:38 CET 2010


Ronald S. Bultje wrote:
> 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?
> 
> +/**
> + * 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...).

Done, I'm very favorable in marking buffers as const where possible, it 
really helps readability for me when I'm not familiar with the code.

-Vitor



More information about the ffmpeg-devel mailing list