[FFmpeg-soc] [soc] soc g723.1 57a9ec97a9febb4244437c1ff2bdf0150ce4e8c7

Benjamin Larsson banan at ludd.ltu.se
Tue Jun 15 23:43:25 CEST 2010


> +/*
> + * Quantize LSP frequencies by interpolation and convert them to
> + * the corresponding LPC coefficients.
> + *
> + * @param lpc      buffer for LPC coefficients
> + * @param cur_lsp  the current LSP vector
> + * @param prev_lsp the previous LSP vector
> + */
> +static void lsp_interpolate(int16_t *lpc, int16_t *cur_lsp, int16_t *prev_lsp)
> +{
> +    int i, j;
> +    int16_t *ptr = lpc;

Can you name this better? lpc_ptr or something.

> +
> +    // cur_lsp * 0.25 + prev_lsp * 0.75
> +    ff_acelp_weighted_vector_sum(&lpc[1], cur_lsp, prev_lsp,
> +                                 4096, 12288, 1 << 13, 14, LPC_ORDER);
> +    ff_acelp_weighted_vector_sum(&lpc[LPC_ORDER + 1], cur_lsp, prev_lsp,
> +                                 8192, 8192, 1 << 13, 14, LPC_ORDER);
> +    ff_acelp_weighted_vector_sum(&lpc[LPC_ORDER * 2 + 2], cur_lsp, prev_lsp,
> +                                 12288, 4096, 1 << 13, 14, LPC_ORDER);
> +    memcpy(&lpc[LPC_ORDER * 3 + 3], cur_lsp, LPC_ORDER * sizeof(int16_t));
> +
> +    for (i = 0; i < SUBFRAMES; i++) {
> +        // Calculate cosine
> +        for (j = 1; j <= LPC_ORDER; j++) {
> +            int index      = ptr[j] >> 7;
> +            int offset     = ptr[j] & 0x7f;
> +            int64_t temp1  = cos_tab[index] << 16;
> +            int temp2      = (cos_tab[index + 1] - cos_tab[index]) *
> +                             ((offset << 8) + 0x80) << 1;
> +            ptr[j] = av_clipl_int32(((temp1 + temp2) << 1) + (1 << 15)) >> 16;
> +        }
> +
> +        ff_acelp_lsp2lpc(ptr, ptr, LPC_ORDER >> 1);
> +        ptr += LPC_ORDER + 1;
> +    }
> +}
> +

Is it bit exact compared to the ref decoder ?

MvH
Benjamin Larsson


More information about the FFmpeg-soc mailing list