blob: 26bc3ba513657a6fc5750ea638832e0a9282fc83 [file] [log] [blame]
/*
* BandIndexTables.cpp
*
* Copyright 2021 HIMSA II K/S - www.himsa.com. Represented by EHIMA -
* www.ehima.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// LC3 Specification d09r01.pdf
// Section 5.7.1 Band Tables Index I_fs
#include "BandIndexTables.hpp"
// LC3 Specification d09r01.pdf; Page 86 of 177
// LC3 Specification Section 3.7.2 (d09r04_*implementorComments*)
// Page 115 of 256
// Band tables index I_fs for 10 ms frame duration
int I_8000[65] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 51, 53,
55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 80};
int I_16000[65] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
22, 23, 24, 25, 26, 27, 28, 30, 32, 34, 36,
38, 40, 42, 44, 46, 48, 50, 52, 55, 58, 61,
64, 67, 70, 73, 76, 80, 84, 88, 92, 96, 101,
106, 111, 116, 121, 127, 133, 139, 146, 153, 160};
int I_24000[65] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
22, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41,
43, 46, 49, 52, 55, 58, 61, 64, 68, 72, 76,
80, 85, 90, 95, 100, 106, 112, 118, 125, 132, 139,
147, 155, 164, 173, 183, 193, 204, 215, 227, 240};
int I_32000[65] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22,
24, 26, 28, 30, 32, 34, 36, 38, 41, 44, 47,
50, 53, 56, 60, 64, 68, 72, 76, 81, 86, 91,
97, 103, 109, 116, 123, 131, 139, 148, 157, 166, 176,
187, 199, 211, 224, 238, 252, 268, 284, 302, 320};
int I_48000[65] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 17, 18, 20, 22, 24,
26, 28, 30, 32, 34, 36, 39, 42, 45, 48, 51,
55, 59, 63, 67, 71, 76, 81, 86, 92, 98, 105,
112, 119, 127, 135, 144, 154, 164, 175, 186, 198, 211,
225, 240, 256, 273, 291, 310, 330, 352, 375, 400};
// LC3 Specification Section 3.7.2 (d09r04_*implementorComments*)
// Page 115/116 of 256
// Band tables index I_fs for 7.5 ms frame duration
int I_8000_7p5ms[61] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
52, 53, 54, 55, 56, 57, 58, 59, 60};
int I_16000_7p5ms[65] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 65, 68,
71, 74, 77, 80, 83, 86, 90, 94, 98, 102, 106, 110, 115, 120};
int I_24000_7p5ms[65] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
22, 23, 24, 25, 26, 27, 29, 31, 33, 35, 37,
39, 41, 43, 45, 47, 49, 52, 55, 58, 61, 64,
67, 70, 74, 78, 82, 86, 90, 95, 100, 105, 110,
115, 121, 127, 134, 141, 148, 155, 163, 171, 180};
int I_32000_7p5ms[65] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
22, 23, 24, 26, 28, 30, 32, 34, 36, 38, 40,
42, 45, 48, 51, 54, 57, 60, 63, 67, 71, 75,
79, 84, 89, 94, 99, 105, 111, 117, 124, 131, 138,
146, 154, 163, 172, 182, 192, 203, 215, 227, 240};
int I_48000_7p5ms[65] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 43,
46, 49, 52, 55, 59, 63, 67, 71, 75, 80, 85,
90, 96, 102, 108, 115, 122, 129, 137, 146, 155, 165,
175, 186, 197, 209, 222, 236, 251, 266, 283, 300};