[FFmpeg-devel] [PATCH] QCELP decoder
Michael Niedermayer
michaelni
Fri Nov 14 11:58:56 CET 2008
On Thu, Nov 13, 2008 at 11:46:40AM -0800, Kenan Gillet wrote:
> Thanks for your reviews,
>
> here is round 10 of the QCELP decoder patch:
> - it simplifies and optimizes qcelp_lspf2lpc and lps2poly
> - it removes bandwith_expansion_coeff from QCELPContext, and replaces it
> by a systematic recalculation as the benchmarks show it is faster
> - simplifies apply_gain_control,
> - adds FIXME comment an av_log_missing_features in apply_gain_control
> if the vector to control gain of is a zero vector.
> - various cosmetics
>
> Kenan
>
[...]
> Index: libavcodec/qcelp_lsp.c
> ===================================================================
> --- libavcodec/qcelp_lsp.c (revision 0)
> +++ libavcodec/qcelp_lsp.c (revision 0)
[...]
> +
> +/**
> + * Computes the Pa or Qa coefficients needed for LSP to LPC conversion.
> + * We only need to calculate the 6 first elements of the polynomial.
> + *
> + * @param lspf line spectral pair frequencies
> + * @param v_poly polynomial input/output as a vector
> + *
> + * TIA/EIA/IS-733 2.4.3.3.5-1/2
> + */
> +static void lsp2poly(const float *lspf,
> + float *v_poly) {
> + float val, *v;
> + int i;
> +
> + // optimization to simplify calculation in loop
> + v_poly++;
> +
> + for (i = 0; i < 10; i += 2) {
> + val = -2 * cos(M_PI * *lspf);
> + lspf += 2;
> + v = v_poly + FFMIN(4, i);
> +
> + if (i < 4) {
> + v[2] = v[0];
> + v[1] = v[0] * val + v[-1];
> + }
> + for ( ; v > v_poly; v--)
> + v[0] = v[0]
> + + v[-1] * val
> + + v[-2];
> + v[0] += v[-1] * val;
> + }
> +}
i thnink this can be optimized further see lsp2poly & ff_acelp_lsp2lpc
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Asymptotically faster algorithms should always be preferred if you have
asymptotical amounts of data
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081114/efe4c8c9/attachment.pgp>
More information about the ffmpeg-devel
mailing list