aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/qcelpdata.h
diff options
context:
space:
mode:
authorKenan Gillet <kenan.gillet@gmail.com>2008-11-11 18:50:38 +0000
committerVitor Sessak <vitor1001@gmail.com>2008-11-11 18:50:38 +0000
commit200de8c6bbe342f7ff2c87635d24fa1c0a2b21bc (patch)
tree3d3f47f1180102c61454ce0bcab539e2d752177c /libavcodec/qcelpdata.h
parente22192ecc3b679a54bf74e90b01d73e16f608413 (diff)
downloadffmpeg-200de8c6bbe342f7ff2c87635d24fa1c0a2b21bc.tar.gz
More OKed parts of the QCELP decoder
patch by Kenan Gillet, kenan.gillet gmail com Originally committed as revision 15802 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/qcelpdata.h')
-rw-r--r--libavcodec/qcelpdata.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/libavcodec/qcelpdata.h b/libavcodec/qcelpdata.h
index e5e9de5868..f5b39b6954 100644
--- a/libavcodec/qcelpdata.h
+++ b/libavcodec/qcelpdata.h
@@ -379,6 +379,38 @@ static const qcelp_vector * const qcelp_lspvq[5] = {
};
/**
+ * the final gain scalefactor before clipping into a usable output float
+ */
+#define QCELP_SCALE 8192.
+
+/**
+ * table for computing Ga (decoded linear codebook gain magnitude)
+ *
+ * @note The table could fit in int16_t in x*8 form, but it seems
+ * to be slower on x86
+ *
+ * TIA/EIA/IS-733 2.4.6.2.1-3
+ */
+
+static const float qcelp_g12ga[61] = {
+ 1.000/QCELP_SCALE, 1.125/QCELP_SCALE, 1.250/QCELP_SCALE, 1.375/QCELP_SCALE,
+ 1.625/QCELP_SCALE, 1.750/QCELP_SCALE, 2.000/QCELP_SCALE, 2.250/QCELP_SCALE,
+ 2.500/QCELP_SCALE, 2.875/QCELP_SCALE, 3.125/QCELP_SCALE, 3.500/QCELP_SCALE,
+ 4.000/QCELP_SCALE, 4.500/QCELP_SCALE, 5.000/QCELP_SCALE, 5.625/QCELP_SCALE,
+ 6.250/QCELP_SCALE, 7.125/QCELP_SCALE, 8.000/QCELP_SCALE, 8.875/QCELP_SCALE,
+ 10.000/QCELP_SCALE, 11.250/QCELP_SCALE, 12.625/QCELP_SCALE, 14.125/QCELP_SCALE,
+ 15.875/QCELP_SCALE, 17.750/QCELP_SCALE, 20.000/QCELP_SCALE, 22.375/QCELP_SCALE,
+ 25.125/QCELP_SCALE, 28.125/QCELP_SCALE, 31.625/QCELP_SCALE, 35.500/QCELP_SCALE,
+ 39.750/QCELP_SCALE, 44.625/QCELP_SCALE, 50.125/QCELP_SCALE, 56.250/QCELP_SCALE,
+ 63.125/QCELP_SCALE, 70.750/QCELP_SCALE, 79.375/QCELP_SCALE, 89.125/QCELP_SCALE,
+ 100.000/QCELP_SCALE, 112.250/QCELP_SCALE, 125.875/QCELP_SCALE, 141.250/QCELP_SCALE,
+ 158.500/QCELP_SCALE, 177.875/QCELP_SCALE, 199.500/QCELP_SCALE, 223.875/QCELP_SCALE,
+ 251.250/QCELP_SCALE, 281.875/QCELP_SCALE, 316.250/QCELP_SCALE, 354.875/QCELP_SCALE,
+ 398.125/QCELP_SCALE, 446.625/QCELP_SCALE, 501.125/QCELP_SCALE, 563.375/QCELP_SCALE,
+ 631.000/QCELP_SCALE, 708.000/QCELP_SCALE, 794.375/QCELP_SCALE, 891.250/QCELP_SCALE,
+ 1000.000/QCELP_SCALE};
+
+/**
* circular codebook for rate 1 frames in x*100 form
*
* TIA/EIA/IS-733 2.4.6.1-2
@@ -428,4 +460,18 @@ static const int8_t qcelp_rate_half_codebook[128] = {
};
#define QCELP_RATE_HALF_CODEBOOK_RATIO 0.5
+/**
+ * table for impulse response of BPF used to filter
+ * the white excitation for framerate 1/4 synthesis
+ *
+ * Only half the tables are needed because of symetry.
+ *
+ * TIA/EIA/IS-733 2.4.8.1.2-1.1
+ */
+static const double qcelp_rnd_fir_coefs[11] = {
+ -1.344519e-1, 1.735384e-2, -6.905826e-2, 2.434368e-2,
+ -8.210701e-2, 3.041388e-2, -9.251384e-2, 3.501983e-2,
+ -9.918777e-2, 3.749518e-2, 8.985137e-1
+};
+
#endif /* AVCODEC_QCELPDATA_H */