summaryrefslogtreecommitdiff
path: root/libavcodec/lsp.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/lsp.c
parentb33451eeacaa31a7b4f15daf3f106763a4093aa0 (diff)
downloadffmpeg-1d96cc08652072730e64ecb45df81b608a015a38.tar.gz
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/lsp.c')
-rw-r--r--libavcodec/lsp.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/lsp.c b/libavcodec/lsp.c
index 7112492001..fa7152737a 100644
--- a/libavcodec/lsp.c
+++ b/libavcodec/lsp.c
@@ -65,6 +65,14 @@ void ff_acelp_lsf2lsp(int16_t *lsp, const int16_t *lsf, int lp_order)
lsp[i] = ff_cos(lsf[i] * 20861 >> 15); // divide by PI and (0,13) -> (0,14)
}
+void ff_acelp_lsf2lspd(double *lsp, const float *lsf, int lp_order)
+{
+ int i;
+
+ for(i = 0; i < lp_order; i++)
+ lsp[i] = cos(2.0 * M_PI * lsf[i]);
+}
+
/**
* \brief decodes polynomial coefficients from LSP
* \param f [out] decoded polynomial coefficients (-0x20000000 <= (3.22) <= 0x1fffffff)