Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/speex.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmvalin <jmvalin@0101bb08-14d6-0310-b084-bc0e0c8e3800>2002-04-08 23:08:28 +0400
committerjmvalin <jmvalin@0101bb08-14d6-0310-b084-bc0e0c8e3800>2002-04-08 23:08:28 +0400
commitd1bf208859cdcb8fd4ea961ebd7149f1035655e2 (patch)
tree5a551aa82b12e758f86866945026666c2a52e600
parentb217ab52c502ee5657960e533e5f7d04b7bdf7c3 (diff)
Added LSP quantization for SB-CELP
git-svn-id: http://svn.xiph.org/trunk/speex@3225 0101bb08-14d6-0310-b084-bc0e0c8e3800
-rw-r--r--libspeex/Makefile.am5
-rw-r--r--libspeex/high_lsp_tables.c200
-rw-r--r--libspeex/quant_lsp.c30
-rw-r--r--libspeex/quant_lsp.h3
-rw-r--r--libspeex/sb_celp.c13
5 files changed, 247 insertions, 4 deletions
diff --git a/libspeex/Makefile.am b/libspeex/Makefile.am
index d78dcdd..fc22653 100644
--- a/libspeex/Makefile.am
+++ b/libspeex/Makefile.am
@@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in. -*-Makefile-*-
-# $Id: Makefile.am,v 1.19 2002/04/08 06:23:54 jmvalin Exp $
+# $Id: Makefile.am,v 1.20 2002/04/08 19:08:27 jmvalin Exp $
# Disable automatic dependency tracking if using other tools than gcc and gmake
#AUTOMAKE_OPTIONS = no-dependencies
@@ -30,7 +30,8 @@ libspeex_la_SOURCES = speex.c \
vq.c \
matrix.c \
mpulse.c \
- exc_sb_table.c
+ exc_sb_table.c \
+ high_lsp_tables.c
include_HEADERS = speex.h \
diff --git a/libspeex/high_lsp_tables.c b/libspeex/high_lsp_tables.c
new file mode 100644
index 0000000..0dfe06f
--- /dev/null
+++ b/libspeex/high_lsp_tables.c
@@ -0,0 +1,200 @@
+
+float high_lsp_cdbk[]={ 0.900897, 1.10787, 1.32056, 1.60977, 1.88662, 2.07497, 2.36135, 2.64174 ,
+ 0.625515, 0.786019, 1.11138, 1.95421, 2.30258, 2.4915, 2.75879, 2.95663 ,
+ 0.701032, 0.8744, 1.19428, 1.40445, 1.68166, 1.9846, 2.3907, 2.70916 ,
+ 0.595375, 0.954938, 1.69693, 2.04884, 2.2668, 2.48784, 2.73804, 2.94838 ,
+ 0.675963, 0.877268, 1.26411, 1.52041, 1.86296, 2.19717, 2.59516, 2.88722 ,
+ 0.596691, 0.706862, 1.02068, 1.20737, 1.62385, 2.35285, 2.66247, 2.91429 ,
+ 0.679885, 0.848547, 1.13975, 1.33147, 1.78225, 2.17073, 2.51837, 2.87438 ,
+ 0.564229, 0.768788, 1.5306, 1.79631, 1.96222, 2.20393, 2.76103, 2.97197 ,
+ 0.894535, 1.13618, 1.38035, 1.60828, 1.87978, 2.15068, 2.55605, 2.83958 ,
+ 0.614111, 0.794961, 1.06427, 1.86134, 2.10636, 2.31026, 2.80869, 2.988 ,
+ 0.748886, 0.948934, 1.23733, 1.46418, 1.8046, 2.00561, 2.34012, 2.78773 ,
+ 0.675432, 1.08134, 1.51032, 1.74184, 1.9622, 2.22285, 2.68671, 2.90622 ,
+ 0.770113, 0.969813, 1.21708, 1.44491, 1.90975, 2.2059, 2.54015, 2.87317 ,
+ 0.678985, 0.881768, 1.0954, 1.38527, 2.16822, 2.39547, 2.75226, 2.94178 ,
+ 0.436959, 0.788956, 1.10049, 1.43683, 1.78215, 2.111, 2.47292, 2.80775 ,
+ 0.630492, 0.91305, 1.30119, 1.61407, 1.9431, 2.43756, 2.75585, 2.93082 ,
+ 0.777488, 1.00221, 1.31621, 1.59532, 1.91055, 2.18193, 2.4636, 2.7198 ,
+ 0.654402, 0.838828, 1.39477, 2.03571, 2.24812, 2.47196, 2.72985, 2.95867 ,
+ 0.71346, 0.878679, 1.13955, 1.31049, 1.62055, 1.82681, 2.545, 2.90327 ,
+ 0.579661, 0.778326, 1.49421, 1.80022, 1.98379, 2.56286, 2.81226, 2.96326 ,
+ 0.612124, 0.841254, 1.37395, 1.67409, 1.89992, 2.12989, 2.61394, 2.91584 ,
+ 0.591876, 0.766358, 1.06462, 1.5014, 2.04819, 2.63043, 2.84152, 2.97657 ,
+ 0.785803, 0.968014, 1.20606, 1.40117, 1.77548, 2.04291, 2.68893, 2.95787 ,
+ 0.64058, 0.854373, 1.44726, 1.79954, 2.07679, 2.312, 2.6103, 2.89507 ,
+ 0.77195, 1.01193, 1.46403, 1.71313, 1.93237, 2.17451, 2.48106, 2.7913 ,
+ 0.633438, 0.798419, 1.12701, 1.71021, 2.09233, 2.27733, 2.57191, 2.94841 ,
+ 0.830828, 1.01082, 1.26954, 1.46508, 1.80808, 1.99889, 2.53003, 2.77628 ,
+ 0.731788, 0.998233, 1.35422, 1.69096, 2.174, 2.41164, 2.67338, 2.9085 ,
+ 0.760357, 1.00404, 1.35296, 1.62318, 1.94028, 2.28006, 2.64938, 2.88504 ,
+ 0.58446, 0.744376, 1.06173, 1.34642, 2.05329, 2.31627, 2.58741, 2.92384 ,
+ 0.583319, 0.794846, 1.19666, 1.59413, 1.89123, 2.19883, 2.76549, 2.96107 ,
+ 0.580373, 0.841854, 1.32992, 1.73453, 2.21054, 2.61954, 2.794, 2.97438 ,
+ 0.962585, 1.15002, 1.3815, 1.71713, 1.95184, 2.14265, 2.44417, 2.73278 ,
+ 0.600791, 0.791514, 1.029, 1.66704, 2.29103, 2.45949, 2.75528, 2.95746 ,
+ 0.701102, 0.857014, 1.13369, 1.34783, 1.65353, 1.8694, 2.24009, 2.72294 ,
+ 0.617686, 0.916319, 1.61599, 1.90062, 2.12864, 2.37546, 2.70577, 2.93131 ,
+ 0.683289, 0.881779, 1.26042, 1.53953, 1.85277, 2.12357, 2.47201, 2.77189 ,
+ 0.610608, 0.770967, 1.09391, 1.34368, 1.81425, 2.19674, 2.70622, 2.94531 ,
+ 0.691263, 0.840756, 1.12691, 1.30464, 1.67054, 2.01666, 2.72396, 2.93966 ,
+ 0.571786, 0.749738, 1.32848, 1.75715, 1.97377, 2.32412, 2.75949, 2.95915 ,
+ 0.899899, 1.18256, 1.4662, 1.70422, 1.99477, 2.39002, 2.68146, 2.88048 ,
+ 0.580793, 0.758511, 1.01993, 1.59273, 2.05498, 2.30038, 2.83645, 3.00035 ,
+ 0.750818, 0.955741, 1.26726, 1.51488, 1.78218, 1.98922, 2.26571, 2.59018 ,
+ 0.737619, 1.19566, 1.59529, 1.84902, 2.14194, 2.39684, 2.7014, 2.90694 ,
+ 0.721569, 0.924473, 1.21146, 1.44345, 1.80891, 2.32615, 2.67202, 2.8986 ,
+ 0.555084, 0.723232, 0.999475, 1.43099, 2.3579, 2.58485, 2.77349, 2.9745 ,
+ 0.476691, 0.786327, 1.13261, 1.52429, 1.84908, 2.14391, 2.58104, 2.9101 ,
+ 0.555395, 0.754204, 1.14652, 1.49167, 1.877, 2.43942, 2.74522, 2.91323 ,
+ 0.732831, 0.966355, 1.40123, 1.62039, 1.85108, 2.03836, 2.39732, 2.83117 ,
+ 0.583681, 0.737925, 1.26616, 1.91907, 2.14221, 2.39037, 2.74634, 2.94725 ,
+ 0.645269, 0.785205, 1.06326, 1.26046, 1.61887, 2.01882, 2.49417, 2.81442 ,
+ 0.628643, 1.05662, 1.50334, 1.74605, 1.97584, 2.47932, 2.75426, 2.91623 ,
+ 0.748448, 0.977425, 1.33611, 1.58349, 1.86792, 2.12168, 2.58066, 2.85984 ,
+ 0.588999, 0.708473, 0.984256, 1.21464, 1.84748, 2.53482, 2.78585, 2.97513 ,
+ 0.674938, 0.867934, 1.22563, 1.45783, 1.76618, 2.03868, 2.55348, 2.85871 ,
+ 0.720564, 0.942049, 1.3423, 1.6285, 2.00248, 2.25632, 2.52398, 2.84037 ,
+ 0.878535, 1.14353, 1.49859, 1.75551, 2.0035, 2.2375, 2.54953, 2.83569 ,
+ 0.524102, 0.74718, 1.23851, 1.60101, 2.1758, 2.42991, 2.66784, 2.89363 ,
+ 0.760541, 0.959297, 1.18736, 1.34677, 1.73991, 1.98855, 2.397, 2.94952 ,
+ 0.747122, 0.959243, 1.29856, 1.85752, 2.04052, 2.41195, 2.77644, 2.95661 ,
+ 0.715981, 0.926759, 1.27138, 1.54038, 2.02695, 2.35022, 2.64139, 2.90408 ,
+ 0.585509, 0.730402, 0.974624, 1.19069, 2.20431, 2.4857, 2.733, 2.97594 ,
+ 0.565662, 0.824217, 1.21986, 1.53378, 1.93506, 2.30822, 2.58425, 2.807 ,
+ 0.587677, 0.774772, 1.18869, 1.77068, 1.98442, 2.58481, 2.82984, 2.97613
+};
+
+
+
+float high_lsp_cdbk2[]={ -0.0695071, -0.121743, 0.0121208, -0.0166051, -0.0193199, -0.0282422, -0.109601, 0.0456291 ,
+ 0.00219775, -0.0514731, 0.0443709, -0.0931758, -0.0336273, 0.0230806, 0.0164131, -0.0133171 ,
+ 0.0448851, 0.0558215, -0.0701103, -0.0538382, -0.0112296, -0.0567799, -0.0331999, -0.0104556 ,
+ 0.0774377, 0.0449653, 0.0199516, 0.0196765, -0.0905352, -0.025612, 0.0708746, 0.0118903 ,
+ 0.00759809, -0.059434, -0.0571868, 0.121812, 0.0631061, -0.0626254, -0.00139203, 0.0420999 ,
+ -0.0267224, 0.00100804, -0.00845314, -0.0429234, -0.0875976, 0.00349892, 0.105481, 0.00751181 ,
+ -0.0590695, -0.111007, -0.114921, -0.024305, 0.0522492, -0.00680341, -0.0600723, 0.0165144 ,
+ -0.0182165, 0.00970619, 0.02006, -0.0274602, 0.0630403, 0.128723, 0.0362394, 0.0177918 ,
+ 0.00433203, -0.0493929, -0.0720672, 0.0448096, -0.0287945, 0.0347651, -0.0733498, -0.061145 ,
+ 0.00991612, -0.016644, -0.0401588, 0.028753, 9.24967e-06, 0.043496, 0.120309, 0.05882 ,
+ 0.0297513, -0.0232181, -0.0271914, -0.0900359, 0.149562, 0.040633, 0.0635735, 0.00596448 ,
+ 0.066955, 0.0560969, -0.0369491, 0.0969856, 0.00470388, 0.0205806, 0.0180673, -0.0732947 ,
+ -0.0237736, -0.0725639, 0.120731, 0.0023843, -0.0294184, 0.106121, 0.0621488, 0.0116827 ,
+ 0.00331175, -0.0466983, 0.0399494, 0.0690205, -0.0408836, 0.0038821, 0.0379528, 0.0470881 ,
+ -0.0257837, 0.10747, 0.00830832, 0.0179244, 0.0764986, -0.0373471, 0.0582784, -0.00117714 ,
+ -0.0407814, 0.142485, 0.106327, 0.063894, 0.0147364, 0.0347142, 0.00524228, 0.0283411 ,
+ 0.0114424, -0.0379694, -0.0911194, 0.0113485, -0.00524431, -0.0936771, -0.0971688, 0.00148808 ,
+ 0.0502636, 0.0392479, 0.0147508, -0.044151, -0.0984283, 0.126979, -0.0277841, -0.106466 ,
+ -0.0337064, -0.060753, -0.0725563, -0.055196, 0.102754, -0.00199715, -0.0333278, -0.102772 ,
+ 0.00204324, 0.110691, 0.0216316, -0.0148612, -0.0485134, -0.0581643, -0.0713926, 0.125513 ,
+ 0.00995272, -0.101981, -0.0877369, 0.0297788, 0.0445941, 0.0599068, 0.0294074, 0.0279822 ,
+ -0.0480395, 0.0475015, 0.0638423, -0.00436017, -0.0863753, -0.110349, -0.0351078, 0.0123864 ,
+ -0.0404845, -0.08396, 0.00825833, -0.0236106, 0.0328273, -0.0721019, 0.0386807, -0.0194912 ,
+ 0.0665627, 0.0283493, 0.00334842, 0.0289059, 0.107058, 0.040115, -0.0212, -0.0607637 ,
+ -0.0121541, 0.0907864, 0.0487099, 0.0304616, -0.0183866, -0.048846, -0.0155478, -0.12164 ,
+ 0.0551738, 0.0328555, 0.0391203, -0.0618573, -0.0559424, 0.0500026, 0.0590186, 0.0482032 ,
+ -0.0362322, 0.00370788, -0.0316148, -0.0323496, 0.0514021, -0.0998079, 0.00403207, 0.0979284 ,
+ 0.08205, 0.0373259, -0.128004, 0.0447588, 0.057539, -0.00326545, 0.00603181, 0.0368639 ,
+ -0.0374949, -0.0715924, 0.0621236, 0.029251, 0.0125025, 0.0589754, -0.0661333, 0.0262932 ,
+ 0.0220161, -0.0105118, 0.0789802, 0.0608396, 0.0195662, -0.0828807, 0.00784423, -0.0182908 ,
+ 0.0501325, -0.0176654, -0.136196, 0.0337154, -0.00347529, -0.0454507, 0.0386676, -0.0438613 ,
+ -0.107053, 0.0995714, -0.0472424, -0.0610313, 0.0434156, -0.0425068, 0.0299788, -0.0254909 ,
+ 0.0059024, -0.0193895, -0.0551167, -0.0315405, 0.110276, 0.00757209, -0.123977, 0.0212322 ,
+ -0.0353953, -0.029437, -0.0350108, -0.0737782, -0.069129, 0.0312959, -0.0134269, 0.065866 ,
+ -0.00171012, -0.0418012, -0.0956765, -0.0926644, 0.0178509, -0.07166, 0.0135008, 0.0161761 ,
+ 0.134618, 0.108208, 0.0382699, 0.0125834, -0.0640921, -0.0878187, -0.0200501, -0.0173696 ,
+ 0.0118251, -0.0180997, 0.0224979, 0.137863, 0.0287081, -0.00543836, -0.0814043, -0.0129653 ,
+ -0.0471477, 0.0631965, -0.0681794, -0.00298484, -0.0824977, -0.0336339, -0.00920516, -0.000696037 ,
+ -0.00312108, -0.0644865, -0.106102, 0.0255984, -0.0243821, -0.0655106, 0.0925618, 0.0450483 ,
+ 0.0369854, 0.106825, 0.0131161, -0.0150813, 0.145465, 0.0610157, 0.027499, 0.0314512 ,
+ -0.0446083, -0.051592, 0.0362006, 0.0235958, -0.0344927, -0.0952349, -0.0549161, -0.0608623 ,
+ -0.0400372, 0.0044753, -0.0276783, -0.0381734, -0.0913398, 0.152209, 0.0787204, 0.0260304 ,
+ -0.0440918, -0.0207627, 0.0415107, -0.0113774, 0.0355734, 0.00202164, 0.0925523, 0.0103866 ,
+ 0.0747799, 0.0678898, 0.0626315, 0.0898505, 0.0430954, 0.0164957, 0.0255663, 0.0302863 ,
+ -0.0270266, 0.0343068, 0.0987643, 0.0380018, 0.0785728, 0.0765865, 0.0219729, -0.0504371 ,
+ -0.00207459, -0.0329759, 0.0917119, 0.00391555, -0.103101, -0.0283777, 0.0612987, -0.0435224 ,
+ 0.0736739, 0.0400409, -0.0301787, -0.0313009, 0.0106387, -0.0637337, 0.104067, 0.0300705 ,
+ -0.0742807, 0.168891, 0.0209321, -0.00577545, -0.0468723, 0.0966533, 0.0248904, -0.00790545 ,
+ -0.0224189, -0.0345383, 0.0539775, 0.0398592, -0.0226228, -0.0519057, -0.0515, 0.0683381 ,
+ -0.0485457, -0.0678161, -0.00547457, -0.0393177, -0.119427, 0.0593033, 0.0193868, -0.108057 ,
+ -0.0240689, -0.0431026, -0.102113, -0.104914, -0.0275324, 0.0376461, -0.0623195, -0.0226375 ,
+ 0.0870358, 0.0286015, -0.015005, -0.0935254, -0.0166874, 0.0223159, -0.0632521, 0.0165191 ,
+ -0.0314317, -0.0664871, -0.0251121, 0.099945, 0.0344499, 0.0745556, -0.0029785, -0.0620544 ,
+ -0.0337106, 0.0435103, -0.00312811, -0.0342076, -0.0539812, -0.136604, 0.115672, 0.0533276 ,
+ -0.0549867, -0.0375244, -0.0195702, -0.0383781, -0.0166768, -0.018522, -0.016552, -0.0405824 ,
+ 0.0414621, -0.0164346, 0.0680435, -0.00430594, 0.0886475, -0.00557574, -0.0178056, 0.0226157 ,
+ -0.000700676, 0.0593239, 0.0129205, -0.0755711, 0.0832985, 0.051936, -0.0744651, -0.177541 ,
+ 0.0587115, 0.0509146, 0.0362115, -0.10812, -0.00794099, 0.122601, 0.0273113, -0.0328152 ,
+ 0.026095, 0.0177657, 0.024841, 0.00313313, 0.0134212, 0.00746243, 0.0124376, 0.11954 ,
+ 0.140157, -0.00210686, -0.0329585, 0.0561928, -0.00270902, -0.0430224, -0.0339884, 0.0161285 ,
+ -0.055436, -0.0714211, 0.122479, 0.0866705, 0.079476, 0.00521312, 0.00457928, 0.0273343 ,
+ 0.0172835, -0.0114374, 0.146801, -0.0154712, -0.0139577, -0.0243635, -0.0301924, -0.0226744 ,
+ 0.0249044, 0.0166562, -0.00693308, 0.057989, -0.0428676, -0.127517, 0.0294918, 0.000426488 ,
+ -0.0886251, 0.00684491, -0.00742141, 0.00114553, 0.00910756, 0.0430428, 0.0224492, 0.0452493 ,
+ -0.0302511, -0.031954, 0.00509753, -0.0989059, 0.015746, -0.0462963, -0.0975262, 0.0227756 ,
+ -0.0272914, -0.0960476, -0.0106954, -0.00921241, -0.048788, 0.0955163, 0.00173234, 0.00567258 ,
+ 0.0393768, 0.0152949, -0.0134421, -0.0751339, -0.0470751, -0.0402463, 0.00880368, -0.0764733 ,
+ 0.0767858, 0.0615158, 0.102679, 0.0493502, -0.051608, 0.0040567, -0.00655613, 0.0420687 ,
+ -0.0629682, -0.017306, -0.0518643, 0.0954335, 0.141831, 0.04682, 0.0196848, 0.0249652 ,
+ -0.00303423, -0.016195, -0.0204016, -0.0792809, -0.206713, 0.0294099, 0.0669551, 0.00600849 ,
+ -0.0568883, -0.112668, -0.0587245, 0.103579, -0.00971315, -0.10324, 0.0193381, -0.017467 ,
+ 0.0213221, 0.110503, -0.0663632, -0.0705413, 0.0125183, 0.0940899, 0.0576453, 0.01367 ,
+ 0.0554037, 0.0122983, 0.0229933, 0.0480986, -0.0996129, -0.00220003, -0.0400339, -0.0718127 ,
+ 0.0193375, -0.00316961, -0.0389522, -0.0154834, -0.00780556, 0.0317733, 0.0370749, 0.0135064 ,
+ -0.016172, -0.0309708, -0.0687748, -0.150779, 0.0814392, 0.0658302, 0.0487806, 0.0182148 ,
+ -0.0345645, 0.0413045, -0.0696469, 0.0870123, 0.0482333, -0.0144405, -0.050436, -0.104372 ,
+ 0.0569785, 0.00434023, 0.0690953, 0.0155187, 0.00259757, 0.0893959, -0.00464084, -0.0103146 ,
+ -0.0708468, -0.0366344, 0.0801576, 0.0713829, -0.0444759, -0.0721368, 0.102247, 0.0527785 ,
+ 0.0526234, 0.0746996, -0.0138061, -0.0732027, 0.0932015, -0.0409793, -0.0140227, -0.0236912 ,
+ -0.0827809, 0.0827393, 0.0971476, 0.0447351, 0.0393027, -0.0748125, -0.0356258, 0.0340884 ,
+ -0.0829232, 0.0335248, -0.0183957, 0.027148, 0.0118298, -0.0818305, -0.178992, -0.0289737 ,
+ -0.0748472, 0.0552944, 0.0110182, -0.053186, -0.048632, 0.0623481, -0.0444972, -0.0716376 ,
+ -0.00813886, -0.00667363, -0.053011, -0.030748, 0.0459517, 0.0733536, -0.0236483, -0.0620818 ,
+ 0.0878289, 0.0765585, 0.031417, -0.0259407, -0.0140571, -0.0525068, -0.161868, 0.0479526 ,
+ 0.0265817, 0.00156193, -0.0635967, 0.0508962, 0.0740876, 0.0920805, -0.0196143, 0.0313904 ,
+ 0.000807986, -0.0631773, 0.0728142, -0.0313072, -0.0530621, -0.126036, 0.0257419, 0.0521973 ,
+ -0.0668439, -0.0878822, -0.0463316, -0.0613995, 0.00289469, 0.028381, 0.0806422, 0.00761245 ,
+ 0.107955, 0.111574, 0.0441073, -0.0221506, 0.014786, 0.0337778, -0.0384768, -0.0118457 ,
+ 0.0426901, 0.0134767, 0.0241199, 0.0292849, 0.0311943, -0.0202812, -0.117131, -0.0916539 ,
+ 0.0858302, 0.109032, 0.00589887, -0.0130951, -0.136191, 0.0901743, 0.0795308, 0.037215 ,
+ -0.0321187, -0.0106212, -0.05312, -0.0201695, 0.111239, -0.0154123, 0.0268581, 0.053411 ,
+ 0.0336515, 0.0277378, -0.0668082, 0.0633596, -0.0205824, 0.00917134, -0.0560038, 0.0703007 ,
+ -0.0746292, -0.14589, 0.0592153, 0.0311723, -0.0399371, 0.00109958, 0.0438172, -0.0194015 ,
+ 0.024055, -0.00506985, 0.0156919, -0.00795243, -9.76444e-05, -0.0417707, -0.046737, -0.0186231 ,
+ 0.0254085, 0.016631, -0.0493584, 0.0136092, 0.0623024, -0.0747781, 0.0533978, -0.0848835 ,
+ -0.140383, 0.0697836, 0.0018611, 0.0670091, 0.0375836, 0.0266415, 0.0186809, -0.062674 ,
+ -0.0083917, -0.0146902, -0.00107862, -0.0965068, 0.0664225, 0.0927056, -0.0740597, 0.0191192 ,
+ 0.0157086, 0.0101736, 0.00108207, -0.00971385, -0.0546632, 0.0826991, -0.0693034, 0.0444916 ,
+ -0.00911297, 0.015469, -0.0292181, -0.137629, 0.0083572, -0.0374547, 0.0562913, 0.0402947 ,
+ 0.00851508, 0.170673, 0.0699259, 0.00984883, -0.0559335, -0.075433, 0.0369671, 0.00955664 ,
+ -0.0547643, -0.037649, 0.0223304, 0.0422583, 0.0593296, -0.00824345, -0.0426235, -0.0250914 ,
+ 0.0417276, -0.00753315, -0.019198, -0.0436765, -0.0864709, -0.0627689, -0.0242012, 0.0581236 ,
+ -0.0302866, -0.0716426, -0.119892, 0.0796269, -0.0825285, 0.0484189, 0.0568031, 0.0104485 ,
+ -0.00962265, 0.0649045, 0.054108, 0.00364708, 0.0646238, 0.048711, -0.0794854, 0.0573383 ,
+ -0.0212269, -0.0606325, -0.0096119, -0.0105239, -0.0529471, -0.0394191, -0.0712795, -0.155244 ,
+ 0.00907619, 0.00298866, 0.0240653, 0.0773591, -0.0657041, 0.102437, 0.0609385, 0.00402456 ,
+ -0.0474278, -0.0912632, 0.00814772, -0.0153087, 0.0937477, 0.0495095, 0.00626519, 0.0134655 ,
+ 0.0249779, 0.0677322, 0.0226216, 0.0218691, -0.000142101, 0.0166646, 0.00321935, -0.00557719 ,
+ -0.00341116, -0.00244767, 0.0199277, 0.0895517, 0.051582, 0.0381371, 0.0606676, 0.0138904 ,
+ 0.0249148, 0.036259, 0.098966, 0.0233548, 0.00734275, -0.0352884, 0.0981101, 0.0466649 ,
+ 0.0379758, 0.0594753, 0.0556635, -0.0639415, -0.00183442, -0.076188, 0.0148839, 0.0260033 ,
+ -0.0862757, 0.0906465, 0.0716768, 0.0169337, -0.0938389, 0.00623499, 0.0510639, -0.0180898 ,
+ 0.00900658, -0.028452, 0.00757161, 0.070373, -0.0182628, -0.0947012, -0.161926, 0.0851348 ,
+ -0.00980075, -0.0655202, 0.0214944, -0.0599685, -0.141497, 0.0326514, -0.0655401, -0.0275017 ,
+ 0.0169971, -0.0131753, -0.109, -0.0688291, -0.072697, 0.0506545, 0.0392459, -0.0219979 ,
+ 0.0260611, 0.0379369, 0.0178956, -0.0431849, -0.0718496, -0.0328998, -0.100749, -0.0186077 ,
+ -0.0200489, -0.00721977, -0.00893238, 0.0197346, -0.0099905, 0.0646164, 0.0613826, -0.106381 ,
+ -0.0503207, -0.029987, -0.0623819, -0.0725563, -0.0919437, -0.146702, 0.0204917, 0.00545739 ,
+ -0.0318056, -0.0919411, -0.0347556, -0.0189904, -0.0714609, -0.0526471, 0.00332301, 0.00972325 ,
+ 0.0742942, 0.0256242, -0.00296636, -0.0419211, 0.0518006, 0.0342492, 0.0510838, 0.0129255 ,
+ -0.0541281, -0.0690745, 0.0842726, -0.00670743, 0.0833226, 0.0279385, -0.0493912, -0.131585 ,
+ 0.122471, 0.0512221, -0.0496659, -0.00688482, -0.0223241, 0.102942, 0.0097632, -0.00157186 ,
+ -0.0167822, -0.0743127, 0.0101354, -0.00699891, 0.0193884, 0.00488478, 0.00949343, 0.0870224 ,
+ 0.0776426, 0.0475574, -0.00150135, 0.0614496, 0.0477526, -0.0465502, -0.0817078, 0.0246776 ,
+ -0.107869, -0.160918, 0.00856104, 0.114301, 0.0860587, 0.0233218, -0.0372312, 0.00456625 ,
+ -0.0250357, -0.00584851, 0.083229, 0.0656938, -0.0283454, 0.0258023, -0.0490814, -0.0495548 ,
+ 0.0206697, 0.0460204, -0.0433367, 0.116472, 0.0153387, -0.0614313, 0.0550699, 0.0389318 ,
+ -0.142362, -0.00167351, -0.0671481, 0.0385051, -0.00507441, -0.0257264, -0.00171372, 0.0235077
+};
+
+
diff --git a/libspeex/quant_lsp.c b/libspeex/quant_lsp.c
index aeded5f..9c994cb 100644
--- a/libspeex/quant_lsp.c
+++ b/libspeex/quant_lsp.c
@@ -253,3 +253,33 @@ void lsp_unquant_wb(float *lsp, int order, FrameBits *bits)
lsp[i+12] += lsp_cdbk_wb42[id*4+i];
}
+
+extern float high_lsp_cdbk[];
+extern float high_lsp_cdbk2[];
+
+
+void lsp_quant_high(float *lsp, float *qlsp, int order, FrameBits *bits)
+{
+ int i;
+ float tmp1, tmp2;
+ int id;
+ for (i=0;i<order;i++)
+ qlsp[i]=lsp[i];
+
+ quant_weight[0] = 1/(qlsp[1]-qlsp[0]);
+ quant_weight[order-1] = 1/(qlsp[order-1]-qlsp[order-2]);
+ for (i=1;i<order-1;i++)
+ {
+ tmp1 = 1/(qlsp[i]-qlsp[i-1]);
+ tmp2 = 1/(qlsp[i+1]-qlsp[i]);
+ quant_weight[i] = tmp1 > tmp2 ? tmp1 : tmp2;
+ }
+ id = lsp_quant(qlsp, high_lsp_cdbk, 64, order);
+ frame_bits_pack(bits, id, 6);
+
+ id = lsp_weight_quant(qlsp, quant_weight, high_lsp_cdbk2, 64, order);
+ frame_bits_pack(bits, id, 6);
+
+ for (i=0;i<order;i++)
+ qlsp[i]=lsp[i]-qlsp[i];
+}
diff --git a/libspeex/quant_lsp.h b/libspeex/quant_lsp.h
index f113176..1814ed8 100644
--- a/libspeex/quant_lsp.h
+++ b/libspeex/quant_lsp.h
@@ -49,4 +49,7 @@ void lsp_quant_wb(float *lsp, float *qlsp, int order, FrameBits *bits);
/* Decodes quantized wideband LSPs */
void lsp_unquant_wb(float *lsp, int order, FrameBits *bits);
+/* Quantizes high-band LSPs with 12 bits */
+void lsp_quant_high(float *lsp, float *qlsp, int order, FrameBits *bits);
+
#endif
diff --git a/libspeex/sb_celp.c b/libspeex/sb_celp.c
index 4b00a89..4c133c3 100644
--- a/libspeex/sb_celp.c
+++ b/libspeex/sb_celp.c
@@ -27,6 +27,7 @@
#include <stdio.h>
#include "stack_alloc.h"
#include "cb_search.h"
+#include "quant_lsp.h"
#ifndef M_PI
#define M_PI 3.14159265358979323846 /* pi */
@@ -340,10 +341,18 @@ void sb_encode(SBEncState *st, float *in, FrameBits *bits)
/* x-domain to angle domain*/
for (i=0;i<st->lpcSize;i++)
st->lsp[i] = acos(st->lsp[i]);
+
+ /* LSP quantization */
+ lsp_quant_high(st->lsp, st->qlsp, st->lpcSize, bits);
- /* FIXME: Need to really quantize the LSPs*/
+ /*printf ("high_lsp:");
+ for (i=0;i<st->lpcSize;i++)
+ printf (" %f", st->lsp[i]);
+ printf ("\n");
for (i=0;i<st->lpcSize;i++)
- st->qlsp[i]=st->lsp[i];
+ st->qlsp[i]=st->lsp[i];
+ */
+
if (st->first)
{
for (i=0;i<st->lpcSize;i++)