[xiph-commits] r10118 - trunk/speex/libspeex
jm at svn.xiph.org
jm at svn.xiph.org
Tue Oct 4 23:09:33 PDT 2005
Author: jm
Date: 2005-10-04 23:09:30 -0700 (Tue, 04 Oct 2005)
New Revision: 10118
Added:
trunk/speex/libspeex/curves.c
Modified:
trunk/speex/libspeex/Makefile.am
Log:
Starting work so I can use the Vorbis psychoacoustics
Modified: trunk/speex/libspeex/Makefile.am
===================================================================
--- trunk/speex/libspeex/Makefile.am 2005-10-05 06:08:06 UTC (rev 10117)
+++ trunk/speex/libspeex/Makefile.am 2005-10-05 06:09:30 UTC (rev 10118)
@@ -9,41 +9,13 @@
lib_LTLIBRARIES = libspeex.la
# Sources for compilation in the library
-libspeex_la_SOURCES = nb_celp.c \
- sb_celp.c \
- lpc.c \
- ltp.c \
- lsp.c \
- quant_lsp.c \
- lsp_tables_nb.c \
- gain_table.c \
- gain_table_lbr.c \
- cb_search.c \
- filters.c \
- bits.c \
- modes.c \
- speex.c \
- vq.c \
- high_lsp_tables.c \
- vbr.c \
- hexc_table.c \
- exc_5_256_table.c \
- exc_5_64_table.c \
- exc_8_128_table.c \
- exc_10_32_table.c \
- exc_10_16_table.c \
- exc_20_32_table.c \
- hexc_10_32_table.c \
- misc.c \
- speex_header.c \
- speex_callbacks.c \
- math_approx.c \
- stereo.c \
- preprocess.c \
- smallft.c \
- lbr_48k_tables.c \
- jitter.c \
- mdf.c
+libspeex_la_SOURCES = nb_celp.c sb_celp.c lpc.c ltp.c lsp.c quant_lsp.c \
+ lsp_tables_nb.c gain_table.c gain_table_lbr.c cb_search.c filters.c bits.c \
+ modes.c speex.c vq.c high_lsp_tables.c vbr.c hexc_table.c \
+ exc_5_256_table.c exc_5_64_table.c exc_8_128_table.c exc_10_32_table.c \
+ exc_10_16_table.c exc_20_32_table.c hexc_10_32_table.c misc.c speex_header.c \
+ speex_callbacks.c math_approx.c stereo.c preprocess.c smallft.c lbr_48k_tables.c \
+ jitter.c mdf.c curves.c
noinst_HEADERS = lsp.h \
nb_celp.h \
Added: trunk/speex/libspeex/curves.c
===================================================================
--- trunk/speex/libspeex/curves.c 2005-10-05 06:08:06 UTC (rev 10117)
+++ trunk/speex/libspeex/curves.c 2005-10-05 06:09:30 UTC (rev 10118)
@@ -0,0 +1,57 @@
+/* Copyright (C) 2005 Jean-Marc Valin / CSIRO
+ File: curves
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ - Neither the name of the Xiph.org Foundation nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifdef VORBIS_PSYCHO
+
+
+#include "smallft.h"
+#include "lpc.h"
+
+struct drft_lookup lookup;
+
+/* */
+void curve_to_lpc(float *curve, int len, float *ak, int ord)
+{
+ int i;
+ float ac[len*2];
+ for (i=0;i<2*len;i++)
+ ac[i] = 0;
+ for (i=1;i<len;i++)
+ ac[2*i-1] = curve[i];
+ ac[0] = curve[0];
+ ac[2*len-1] = curve[len-1];
+
+ spx_drft_backward(&lookup, ac);
+ _spx_lpc(ak, ac, ord);
+}
+
+
+#endif
\ No newline at end of file
More information about the commits
mailing list