/*
* TwinVQ decoder
* Copyright (c) 2009 Vitor Sessak
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_TWINVQ_DATA_H
#define AVCODEC_TWINVQ_DATA_H
#include <stddef.h>
#include <stdint.h>
/*
* The bark_tab_* tables are constructed so that
*
* /i-1 \
* |-- |
* bark |\ bark_tab[j] | == i
* |/ |
* |-- |
* \j=0 /
*
*
* for some slightly nonconventional bark-scale function
*/
static const uint16_t bark_tab_l08_512[] = {
7, 8, 7, 8, 8, 8, 8, 8, 8, 9,
9, 10, 10, 11, 11, 12, 12, 14, 15, 16,
18, 19, 21, 24, 27, 30, 35, 40, 46, 53
};
static const uint16_t bark_tab_l11_512[] = {
6, 6, 6, 6, 6, 6, 7, 6, 7, 7,
8, 8, 8, 9, 10, 10, 11, 13, 13, 15,
17, 18, 21, 25, 27, 33, 38, 45, 54, 66
};
static const uint16_t bark_tab_l16_1024[] = {
9, 9, 8, 9, 10, 9, 10, 10, 10, 12,
11, 13, 13, 14, 16, 17, 19, 20, 24, 26,
30, 35, 40, 48, 56, 68, 83, 102, 128, 165
};
static const uint16_t bark_tab_l22_1024[] = {
6, 7, 6, 6, 7, 7, 7, 7, 7, 8,
9, 8, 10, 10, 11, 12, 13, 15, 16, 18,
21, 24, 27, 33, 38, 46, 55, 68, 84, 107,
140, 191
};
static const uint16_t bark_tab_l22_512[] = {
3, 3, 3, 4, 3, 3, 4, 3, 4, 4,
4, 5, 4, 5, 6, 6, 7, 7, 8, 9,
10, 12, 14, 16, 20, 22, 28, 34, 42, 53,
71, 95
};
static const uint16_t bark_tab_l44_2048[] = {
5, 6, 5, 6, 5, 6, 6, 6, 6, 6,
7, 7, 7, 8, 8, 9, 9, 10, 11, 11,
13, 14, 16, 17, 19, 22, 25, 29, 33, 39,
46, 54, 64, 79, 98, 123, 161, 220, 320, 512
};
static const uint16_t bark_tab_m08_256[] = {
6, 5, 6, 6, 6, 6, 7, 7, 8, 8,
9, 10, 11, 13, 15, 18, 20, 25, 31, 39
};
static const uint16_t bark_tab_m11_256[] = {
4, 5, 4, 5, 5, 5, 6, 5, 7, 7,
8, 9, 10, 12, 15, 17, 22, 28, 35, 47
};
static const uint16_t bark_tab_m16_512[] = {
7, 6, 7, 7, 7, 8, 9, 9, 10, 11,
14, 15, 18, 22, 27, 34, 44, 59, 81, 117
};
static const uint16_t bark_tab_m22_256[] = {
3, 2, 3, 2, 3, 3, 4, 3, 4, 5,
5, 7, 8, 9, 13, 16, 22, 30, 44, 70
};
static const uint16_t bark_tab_m22_512[] = {
5, 5, 5, 6, 5, 7, 6, 7, 9, 9,
11, 13, 15, 20, 24, 33, 43, 61, 88, 140
};
static const uint16_t bark_tab_m44_512[] = {
3, 2, 3, 3, 3, 4, 3, 5, 4, 6,
7, 8, 10, 14, 18, 25, 36, 55, 95, 208
};
static const uint16_t bark_tab_s08_64[] = {
3, 3, 3, 3, 4, 5, 6, 8, 12, 17
};
static const uint16_t bark_tab_s11_64[] = {
2, 3, 2, 3, 3, 4, 6, 8, 12, 21
};
static const uint16_t bark_tab_s16_128[] = {
3, 4, 4, 4, 5, 7, 10, 16, 26, 49
};
static const uint16_t bark_tab_s22_128[] = {
3, 2, 3, 4, 4, 6, 9, 14, 26, 57
};
static const uint16_t bark_tab_s44_128[] = {
1, 2, 1, 2, 3, 4, 6, 10, 23, 76
};
/**
* TwinVQ codebooks. They are coded in a struct so we can use code such as
*
* float val = tab.fcb0808l[get_bits(gb, 12)];
*
* without risking a segfault on malformed files.
*/#endif /* AVCODEC_TWINVQ_DATA_H */