summaryrefslogtreecommitdiff
path: root/libavcodec/amrnbdec.c
diff options
context:
space:
mode:
authorMarcelo Galvăo Póvoa <marspeoplester@gmail.com>2010-09-07 20:44:41 +0000
committerVitor Sessak <vitor1001@gmail.com>2010-09-07 20:44:41 +0000
commit1d96cc08652072730e64ecb45df81b608a015a38 (patch)
treea685761cce72c9d4acde9a2e08620a7c454ff9a6 /libavcodec/amrnbdec.c
parentb33451eeacaa31a7b4f15daf3f106763a4093aa0 (diff)
Move AMRNB lsf2lsp() function to common code for using in future AMRWB decoder.
Patch by Marcelo Galvăo Póvoa Originally committed as revision 25061 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/amrnbdec.c')
-rw-r--r--libavcodec/amrnbdec.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/libavcodec/amrnbdec.c b/libavcodec/amrnbdec.c
index d3fa7653f8..616be9710e 100644
--- a/libavcodec/amrnbdec.c
+++ b/libavcodec/amrnbdec.c
@@ -222,20 +222,6 @@ static enum Mode unpack_bitstream(AMRContext *p, const uint8_t *buf,
/// @{
/**
- * Convert an lsf vector into an lsp vector.
- *
- * @param lsf input lsf vector
- * @param lsp output lsp vector
- */
-static void lsf2lsp(const float *lsf, double *lsp)
-{
- int i;
-
- for (i = 0; i < LP_FILTER_ORDER; i++)
- lsp[i] = cos(2.0 * M_PI * lsf[i]);
-}
-
-/**
* Interpolate the LSF vector (used for fixed gain smoothing).
* The interpolation is done over all four subframes even in MODE_12k2.
*
@@ -293,7 +279,7 @@ static void lsf2lsp_for_mode12k2(AMRContext *p, double lsp[LP_FILTER_ORDER],
if (update)
interpolate_lsf(p->lsf_q, lsf_q);
- lsf2lsp(lsf_q, lsp);
+ ff_acelp_lsf2lspd(lsp, lsf_q, LP_FILTER_ORDER);
}
/**
@@ -357,7 +343,7 @@ static void lsf2lsp_3(AMRContext *p)
interpolate_lsf(p->lsf_q, lsf_q);
memcpy(p->prev_lsf_r, lsf_r, LP_FILTER_ORDER * sizeof(*lsf_r));
- lsf2lsp(lsf_q, p->lsp[3]);
+ ff_acelp_lsf2lspd(p->lsp[3], lsf_q, LP_FILTER_ORDER);
// interpolate LSP vectors at subframes 1, 2 and 3
for (i = 1; i <= 3; i++)