blob: 46606637884bebce7dc0111459cb38569d95cc13 [file] [log] [blame]
/*
* TemporalNoiseShapingTables.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.4 Temporal Noise Shaping
#include "TemporalNoiseShapingTables.hpp"
// LC3 Specification d09r01.pdf; Page 109 of 177
short ac_tns_order_bits[2][8] = {
{17234, 13988, 11216, 8694, 6566, 4977, 3961, 3040},
{12683, 9437, 6874, 5541, 5121, 5170, 5359, 5056}};
short ac_tns_order_freq[2][8] = {{3, 9, 23, 54, 111, 190, 268, 366},
{14, 42, 100, 157, 181, 178, 167, 185}};
short ac_tns_order_cumfreq[2][8] = {{0, 3, 12, 35, 89, 200, 390, 658},
{0, 14, 56, 156, 313, 494, 672, 839}};
// LC3 Specification d09r01.pdf; Page 110 of 177
short ac_tns_coef_bits[8][17] = {
{20480, 15725, 12479, 10334, 8694, 7320, 6964, 6335, 5504, 5637, 6566, 6758,
8433, 11348, 15186, 20480, 20480},
{20480, 20480, 20480, 20480, 12902, 9368, 7057, 5901, 5254, 5485, 5598,
6076, 7608, 10742, 15186, 20480, 20480},
{20480, 20480, 20480, 20480, 13988, 9368, 6702, 4841, 4585, 4682, 5859,
7764, 12109, 20480, 20480, 20480, 20480},
{20480, 20480, 20480, 20480, 18432, 13396, 8982, 4767, 3779, 3658, 6335,
9656, 13988, 20480, 20480, 20480, 20480},
{20480, 20480, 20480, 20480, 20480, 14731, 9437, 4275, 3249, 3493, 8483,
13988, 17234, 20480, 20480, 20480, 20480},
{20480, 20480, 20480, 20480, 20480, 20480, 12902, 4753, 3040, 2953, 9105,
15725, 20480, 20480, 20480, 20480, 20480},
{20480, 20480, 20480, 20480, 20480, 20480, 12902, 3821, 3346, 3000, 12109,
20480, 20480, 20480, 20480, 20480, 20480},
{20480, 20480, 20480, 20480, 20480, 20480, 15725, 3658, 20480, 1201, 10854,
18432, 20480, 20480, 20480, 20480, 20480}};
short ac_tns_coef_freq[8][17] = {
{1, 5, 15, 31, 54, 86, 97, 120, 159, 152, 111, 104, 59, 22, 6, 1, 1},
{1, 1, 1, 1, 13, 43, 94, 139, 173, 160, 154, 131, 78, 27, 6, 1, 1},
{1, 1, 1, 1, 9, 43, 106, 199, 217, 210, 141, 74, 17, 1, 1, 1, 1},
{1, 1, 1, 1, 2, 11, 49, 204, 285, 297, 120, 39, 9, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 7, 42, 241, 341, 314, 58, 9, 3, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 13, 205, 366, 377, 47, 5, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 13, 281, 330, 371, 17, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 5, 297, 1, 682, 26, 2, 1, 1, 1, 1, 1}};
short ac_tns_coef_cumfreq[8][17] = {{0, 1, 6, 21, 52, 106, 192, 289, 409, 568,
720, 831, 935, 994, 1016, 1022, 1023},
{0, 1, 2, 3, 4, 17, 60, 154, 293, 466, 626,
780, 911, 989, 1016, 1022, 1023},
{0, 1, 2, 3, 4, 13, 56, 162, 361, 578, 788,
929, 1003, 1020, 1021, 1022, 1023},
{0, 1, 2, 3, 4, 6, 17, 66, 270, 555, 852,
972, 1011, 1020, 1021, 1022, 1023},
{0, 1, 2, 3, 4, 5, 12, 54, 295, 636, 950,
1008, 1017, 1020, 1021, 1022, 1023},
{0, 1, 2, 3, 4, 5, 6, 19, 224, 590, 967,
1014, 1019, 1020, 1021, 1022, 1023},
{0, 1, 2, 3, 4, 5, 6, 19, 300, 630, 1001,
1018, 1019, 1020, 1021, 1022, 1023},
{0, 1, 2, 3, 4, 5, 6, 11, 308, 309, 991,
1017, 1019, 1020, 1021, 1022, 1023}};