summaryrefslogtreecommitdiff
path: root/libavcodec/qcelp_lsp.c
diff options
context:
space:
mode:
authorReynaldo H. Verdejo Pinochet <reynaldo@opendot.cl>2009-03-04 01:33:56 +0000
committerReynaldo H. Verdejo Pinochet <reynaldo@opendot.cl>2009-03-04 01:33:56 +0000
commit87574416f7fa256080321bfc0806dab4f0e05345 (patch)
tree5f04a7abf99ec7483f32f0f47c884edfc1886245 /libavcodec/qcelp_lsp.c
parent77bd18e117176213bdb4e7cbcf7b17662ab99300 (diff)
Part 2 of 2 of Kenan Gillet's 'make ff_qcelp_lspf2lpc
more general' changeset. This one relocates the QCELP especific code to the qcelpdec.* files. Originally committed as revision 17800 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/qcelp_lsp.c')
-rw-r--r--libavcodec/qcelp_lsp.c43
1 files changed, 2 insertions, 41 deletions
diff --git a/libavcodec/qcelp_lsp.c b/libavcodec/qcelp_lsp.c
index 7f920f5f1d..af8e7c98f6 100644
--- a/libavcodec/qcelp_lsp.c
+++ b/libavcodec/qcelp_lsp.c
@@ -30,15 +30,6 @@
#include "libavutil/mathematics.h"
/**
- * initial coefficient to perform bandwidth expansion on LPC
- *
- * @note: 0.9883 looks like an approximation of 253/256.
- *
- * TIA/EIA/IS-733 2.4.3.3.6 6
- */
-#define QCELP_BANDWITH_EXPANSION_COEFF 0.9883
-
-/**
* Computes the Pa / (1 + z(-1)) or Qa / (1 - z(-1)) coefficients
* needed for LSP to LPC conversion.
* We only need to calculate the 6 first elements of the polynomial.
@@ -84,37 +75,7 @@ void ff_celp_lspf2lpc(const double *lspf, float *lpc)
double paf = pa[i+1] + pa[i];
double qaf = qa[i+1] - qa[i];
- lpc[i ] = 0.5 * (paf+qaf);
- lpc[9-i] = 0.5 * (paf-qaf);
- }
-}
-
-/**
- * Reconstructs LPC coefficients from the line spectral pair frequencies
- * and performs bandwidth expansion.
- *
- * @param lspf line spectral pair frequencies
- * @param lpc linear predictive coding coefficients
- *
- * @note: bandwith_expansion_coeff could be precalculated into a table
- * but it seems to be slower on x86
- *
- * TIA/EIA/IS-733 2.4.3.3.5
- */
-void ff_qcelp_lspf2lpc(const float *lspf, float *lpc)
-{
- double lsf[10];
- double bandwith_expansion_coeff = QCELP_BANDWITH_EXPANSION_COEFF;
- int i;
-
- for (i=0; i<10; i++)
- lsf[i] = cos(M_PI * lspf[i]);
-
- ff_celp_lspf2lpc(lsf, lpc);
-
- for (i=0; i<10; i++)
- {
- lpc[i] *= bandwith_expansion_coeff;
- bandwith_expansion_coeff *= QCELP_BANDWITH_EXPANSION_COEFF;
+ lpc[i ] = 0.5*(paf+qaf);
+ lpc[9-i] = 0.5*(paf-qaf);
}
}