summaryrefslogtreecommitdiff
path: root/libavcodec/adpcm_data.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2012-12-01 14:52:22 +0000
committerPaul B Mahol <onemda@gmail.com>2013-07-05 18:10:27 +0000
commit6516a25f04edc90b8dbc8b7f48120b08b7517ae2 (patch)
treef64a179d4e4cd919bfa0c1867f1ead31b3da194b /libavcodec/adpcm_data.c
parent48f2750de8a47671aa4e09e91d7ab811558d2c2f (diff)
ADPCM IMA WAV 2, 3 and 5 bits decoder
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/adpcm_data.c')
-rw-r--r--libavcodec/adpcm_data.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/libavcodec/adpcm_data.c b/libavcodec/adpcm_data.c
index 0625fc9464..1d3e579a89 100644
--- a/libavcodec/adpcm_data.c
+++ b/libavcodec/adpcm_data.c
@@ -27,12 +27,33 @@
/* ff_adpcm_step_table[] and ff_adpcm_index_table[] are from the ADPCM
reference source */
-/* This is the index table: */
+static const int8_t adpcm_index_table2[4] = {
+ -1, 2,
+ -1, 2,
+};
+
+static const int8_t adpcm_index_table3[8] = {
+ -1, -1, 1, 2,
+ -1, -1, 1, 2,
+};
+
const int8_t ff_adpcm_index_table[16] = {
-1, -1, -1, -1, 2, 4, 6, 8,
-1, -1, -1, -1, 2, 4, 6, 8,
};
+static const int8_t adpcm_index_table5[32] = {
+ -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 4, 6, 8, 10, 13, 16,
+ -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 4, 6, 8, 10, 13, 16,
+};
+
+const int8_t const *ff_adpcm_index_tables[4] = {
+ &adpcm_index_table2[0],
+ &adpcm_index_table3[0],
+ &ff_adpcm_index_table[0],
+ &adpcm_index_table5[0],
+};
+
/**
* This is the step table. Note that many programs use slight deviations from
* this table, but such deviations are negligible: