1cabdff1aSopenharmony_ci/*
2cabdff1aSopenharmony_ci * Bluetooth low-complexity, subband codec (SBC)
3cabdff1aSopenharmony_ci *
4cabdff1aSopenharmony_ci * Copyright (C) 2017  Aurelien Jacobs <aurel@gnuage.org>
5cabdff1aSopenharmony_ci * Copyright (C) 2008-2010  Nokia Corporation
6cabdff1aSopenharmony_ci * Copyright (C) 2004-2010  Marcel Holtmann <marcel@holtmann.org>
7cabdff1aSopenharmony_ci * Copyright (C) 2004-2005  Henryk Ploetz <henryk@ploetzli.ch>
8cabdff1aSopenharmony_ci * Copyright (C) 2005-2006  Brad Midgley <bmidgley@xmission.com>
9cabdff1aSopenharmony_ci *
10cabdff1aSopenharmony_ci * This file is part of FFmpeg.
11cabdff1aSopenharmony_ci *
12cabdff1aSopenharmony_ci * FFmpeg is free software; you can redistribute it and/or
13cabdff1aSopenharmony_ci * modify it under the terms of the GNU Lesser General Public
14cabdff1aSopenharmony_ci * License as published by the Free Software Foundation; either
15cabdff1aSopenharmony_ci * version 2.1 of the License, or (at your option) any later version.
16cabdff1aSopenharmony_ci *
17cabdff1aSopenharmony_ci * FFmpeg is distributed in the hope that it will be useful,
18cabdff1aSopenharmony_ci * but WITHOUT ANY WARRANTY; without even the implied warranty of
19cabdff1aSopenharmony_ci * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20cabdff1aSopenharmony_ci * Lesser General Public License for more details.
21cabdff1aSopenharmony_ci *
22cabdff1aSopenharmony_ci * You should have received a copy of the GNU Lesser General Public
23cabdff1aSopenharmony_ci * License along with FFmpeg; if not, write to the Free Software
24cabdff1aSopenharmony_ci * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25cabdff1aSopenharmony_ci */
26cabdff1aSopenharmony_ci
27cabdff1aSopenharmony_ci/**
28cabdff1aSopenharmony_ci * @file
29cabdff1aSopenharmony_ci * SBC decoder tables
30cabdff1aSopenharmony_ci */
31cabdff1aSopenharmony_ci
32cabdff1aSopenharmony_ci#include <stdint.h>
33cabdff1aSopenharmony_ci#include "sbcdec_data.h"
34cabdff1aSopenharmony_ci#include "sbc.h"
35cabdff1aSopenharmony_ci
36cabdff1aSopenharmony_ci#define SS4(val)  ((int32_t)val >> 12)
37cabdff1aSopenharmony_ci#define SS8(val)  ((int32_t)val >> 14)
38cabdff1aSopenharmony_ci#define SN4(val)  ((int32_t)val >> 11 + 1 + SBCDEC_FIXED_EXTRA_BITS)
39cabdff1aSopenharmony_ci#define SN8(val)  ((int32_t)val >> 11 + 1 + SBCDEC_FIXED_EXTRA_BITS)
40cabdff1aSopenharmony_ci
41cabdff1aSopenharmony_ciconst int32_t ff_sbc_proto_4_40m0[] = {
42cabdff1aSopenharmony_ci    SS4(0x00000000), SS4(0xffa6982f), SS4(0xfba93848), SS4(0x0456c7b8),
43cabdff1aSopenharmony_ci    SS4(0x005967d1), SS4(0xfffb9ac7), SS4(0xff589157), SS4(0xf9c2a8d8),
44cabdff1aSopenharmony_ci    SS4(0x027c1434), SS4(0x0019118b), SS4(0xfff3c74c), SS4(0xff137330),
45cabdff1aSopenharmony_ci    SS4(0xf81b8d70), SS4(0x00ec1b8b), SS4(0xfff0b71a), SS4(0xffe99b00),
46cabdff1aSopenharmony_ci    SS4(0xfef84470), SS4(0xf6fb4370), SS4(0xffcdc351), SS4(0xffe01dc7)
47cabdff1aSopenharmony_ci};
48cabdff1aSopenharmony_ci
49cabdff1aSopenharmony_ciconst int32_t ff_sbc_proto_4_40m1[] = {
50cabdff1aSopenharmony_ci    SS4(0xffe090ce), SS4(0xff2c0475), SS4(0xf694f800), SS4(0xff2c0475),
51cabdff1aSopenharmony_ci    SS4(0xffe090ce), SS4(0xffe01dc7), SS4(0xffcdc351), SS4(0xf6fb4370),
52cabdff1aSopenharmony_ci    SS4(0xfef84470), SS4(0xffe99b00), SS4(0xfff0b71a), SS4(0x00ec1b8b),
53cabdff1aSopenharmony_ci    SS4(0xf81b8d70), SS4(0xff137330), SS4(0xfff3c74c), SS4(0x0019118b),
54cabdff1aSopenharmony_ci    SS4(0x027c1434), SS4(0xf9c2a8d8), SS4(0xff589157), SS4(0xfffb9ac7)
55cabdff1aSopenharmony_ci};
56cabdff1aSopenharmony_ci
57cabdff1aSopenharmony_ciconst int32_t ff_sbc_proto_8_80m0[] = {
58cabdff1aSopenharmony_ci    SS8(0x00000000), SS8(0xfe8d1970), SS8(0xee979f00), SS8(0x11686100),
59cabdff1aSopenharmony_ci    SS8(0x0172e690), SS8(0xfff5bd1a), SS8(0xfdf1c8d4), SS8(0xeac182c0),
60cabdff1aSopenharmony_ci    SS8(0x0d9daee0), SS8(0x00e530da), SS8(0xffe9811d), SS8(0xfd52986c),
61cabdff1aSopenharmony_ci    SS8(0xe7054ca0), SS8(0x0a00d410), SS8(0x006c1de4), SS8(0xffdba705),
62cabdff1aSopenharmony_ci    SS8(0xfcbc98e8), SS8(0xe3889d20), SS8(0x06af2308), SS8(0x000bb7db),
63cabdff1aSopenharmony_ci    SS8(0xffca00ed), SS8(0xfc3fbb68), SS8(0xe071bc00), SS8(0x03bf7948),
64cabdff1aSopenharmony_ci    SS8(0xffc4e05c), SS8(0xffb54b3b), SS8(0xfbedadc0), SS8(0xdde26200),
65cabdff1aSopenharmony_ci    SS8(0x0142291c), SS8(0xff960e94), SS8(0xff9f3e17), SS8(0xfbd8f358),
66cabdff1aSopenharmony_ci    SS8(0xdbf79400), SS8(0xff405e01), SS8(0xff7d4914), SS8(0xff8b1a31),
67cabdff1aSopenharmony_ci    SS8(0xfc1417b8), SS8(0xdac7bb40), SS8(0xfdbb828c), SS8(0xff762170)
68cabdff1aSopenharmony_ci};
69cabdff1aSopenharmony_ci
70cabdff1aSopenharmony_ciconst int32_t ff_sbc_proto_8_80m1[] = {
71cabdff1aSopenharmony_ci    SS8(0xff7c272c), SS8(0xfcb02620), SS8(0xda612700), SS8(0xfcb02620),
72cabdff1aSopenharmony_ci    SS8(0xff7c272c), SS8(0xff762170), SS8(0xfdbb828c), SS8(0xdac7bb40),
73cabdff1aSopenharmony_ci    SS8(0xfc1417b8), SS8(0xff8b1a31), SS8(0xff7d4914), SS8(0xff405e01),
74cabdff1aSopenharmony_ci    SS8(0xdbf79400), SS8(0xfbd8f358), SS8(0xff9f3e17), SS8(0xff960e94),
75cabdff1aSopenharmony_ci    SS8(0x0142291c), SS8(0xdde26200), SS8(0xfbedadc0), SS8(0xffb54b3b),
76cabdff1aSopenharmony_ci    SS8(0xffc4e05c), SS8(0x03bf7948), SS8(0xe071bc00), SS8(0xfc3fbb68),
77cabdff1aSopenharmony_ci    SS8(0xffca00ed), SS8(0x000bb7db), SS8(0x06af2308), SS8(0xe3889d20),
78cabdff1aSopenharmony_ci    SS8(0xfcbc98e8), SS8(0xffdba705), SS8(0x006c1de4), SS8(0x0a00d410),
79cabdff1aSopenharmony_ci    SS8(0xe7054ca0), SS8(0xfd52986c), SS8(0xffe9811d), SS8(0x00e530da),
80cabdff1aSopenharmony_ci    SS8(0x0d9daee0), SS8(0xeac182c0), SS8(0xfdf1c8d4), SS8(0xfff5bd1a)
81cabdff1aSopenharmony_ci};
82cabdff1aSopenharmony_ci
83cabdff1aSopenharmony_ciconst int32_t ff_synmatrix4[8][4] = {
84cabdff1aSopenharmony_ci    { SN4(0x05a82798), SN4(0xfa57d868), SN4(0xfa57d868), SN4(0x05a82798) },
85cabdff1aSopenharmony_ci    { SN4(0x030fbc54), SN4(0xf89be510), SN4(0x07641af0), SN4(0xfcf043ac) },
86cabdff1aSopenharmony_ci    { SN4(0x00000000), SN4(0x00000000), SN4(0x00000000), SN4(0x00000000) },
87cabdff1aSopenharmony_ci    { SN4(0xfcf043ac), SN4(0x07641af0), SN4(0xf89be510), SN4(0x030fbc54) },
88cabdff1aSopenharmony_ci    { SN4(0xfa57d868), SN4(0x05a82798), SN4(0x05a82798), SN4(0xfa57d868) },
89cabdff1aSopenharmony_ci    { SN4(0xf89be510), SN4(0xfcf043ac), SN4(0x030fbc54), SN4(0x07641af0) },
90cabdff1aSopenharmony_ci    { SN4(0xf8000000), SN4(0xf8000000), SN4(0xf8000000), SN4(0xf8000000) },
91cabdff1aSopenharmony_ci    { SN4(0xf89be510), SN4(0xfcf043ac), SN4(0x030fbc54), SN4(0x07641af0) }
92cabdff1aSopenharmony_ci};
93cabdff1aSopenharmony_ci
94cabdff1aSopenharmony_ciconst int32_t ff_synmatrix8[16][8] = {
95cabdff1aSopenharmony_ci    { SN8(0x05a82798), SN8(0xfa57d868), SN8(0xfa57d868), SN8(0x05a82798),
96cabdff1aSopenharmony_ci      SN8(0x05a82798), SN8(0xfa57d868), SN8(0xfa57d868), SN8(0x05a82798) },
97cabdff1aSopenharmony_ci    { SN8(0x0471ced0), SN8(0xf8275a10), SN8(0x018f8b84), SN8(0x06a6d988),
98cabdff1aSopenharmony_ci      SN8(0xf9592678), SN8(0xfe70747c), SN8(0x07d8a5f0), SN8(0xfb8e3130) },
99cabdff1aSopenharmony_ci    { SN8(0x030fbc54), SN8(0xf89be510), SN8(0x07641af0), SN8(0xfcf043ac),
100cabdff1aSopenharmony_ci      SN8(0xfcf043ac), SN8(0x07641af0), SN8(0xf89be510), SN8(0x030fbc54) },
101cabdff1aSopenharmony_ci    { SN8(0x018f8b84), SN8(0xfb8e3130), SN8(0x06a6d988), SN8(0xf8275a10),
102cabdff1aSopenharmony_ci      SN8(0x07d8a5f0), SN8(0xf9592678), SN8(0x0471ced0), SN8(0xfe70747c) },
103cabdff1aSopenharmony_ci    { SN8(0x00000000), SN8(0x00000000), SN8(0x00000000), SN8(0x00000000),
104cabdff1aSopenharmony_ci      SN8(0x00000000), SN8(0x00000000), SN8(0x00000000), SN8(0x00000000) },
105cabdff1aSopenharmony_ci    { SN8(0xfe70747c), SN8(0x0471ced0), SN8(0xf9592678), SN8(0x07d8a5f0),
106cabdff1aSopenharmony_ci      SN8(0xf8275a10), SN8(0x06a6d988), SN8(0xfb8e3130), SN8(0x018f8b84) },
107cabdff1aSopenharmony_ci    { SN8(0xfcf043ac), SN8(0x07641af0), SN8(0xf89be510), SN8(0x030fbc54),
108cabdff1aSopenharmony_ci      SN8(0x030fbc54), SN8(0xf89be510), SN8(0x07641af0), SN8(0xfcf043ac) },
109cabdff1aSopenharmony_ci    { SN8(0xfb8e3130), SN8(0x07d8a5f0), SN8(0xfe70747c), SN8(0xf9592678),
110cabdff1aSopenharmony_ci      SN8(0x06a6d988), SN8(0x018f8b84), SN8(0xf8275a10), SN8(0x0471ced0) },
111cabdff1aSopenharmony_ci    { SN8(0xfa57d868), SN8(0x05a82798), SN8(0x05a82798), SN8(0xfa57d868),
112cabdff1aSopenharmony_ci      SN8(0xfa57d868), SN8(0x05a82798), SN8(0x05a82798), SN8(0xfa57d868) },
113cabdff1aSopenharmony_ci    { SN8(0xf9592678), SN8(0x018f8b84), SN8(0x07d8a5f0), SN8(0x0471ced0),
114cabdff1aSopenharmony_ci      SN8(0xfb8e3130), SN8(0xf8275a10), SN8(0xfe70747c), SN8(0x06a6d988) },
115cabdff1aSopenharmony_ci    { SN8(0xf89be510), SN8(0xfcf043ac), SN8(0x030fbc54), SN8(0x07641af0),
116cabdff1aSopenharmony_ci      SN8(0x07641af0), SN8(0x030fbc54), SN8(0xfcf043ac), SN8(0xf89be510) },
117cabdff1aSopenharmony_ci    { SN8(0xf8275a10), SN8(0xf9592678), SN8(0xfb8e3130), SN8(0xfe70747c),
118cabdff1aSopenharmony_ci      SN8(0x018f8b84), SN8(0x0471ced0), SN8(0x06a6d988), SN8(0x07d8a5f0) },
119cabdff1aSopenharmony_ci    { SN8(0xf8000000), SN8(0xf8000000), SN8(0xf8000000), SN8(0xf8000000),
120cabdff1aSopenharmony_ci      SN8(0xf8000000), SN8(0xf8000000), SN8(0xf8000000), SN8(0xf8000000) },
121cabdff1aSopenharmony_ci    { SN8(0xf8275a10), SN8(0xf9592678), SN8(0xfb8e3130), SN8(0xfe70747c),
122cabdff1aSopenharmony_ci      SN8(0x018f8b84), SN8(0x0471ced0), SN8(0x06a6d988), SN8(0x07d8a5f0) },
123cabdff1aSopenharmony_ci    { SN8(0xf89be510), SN8(0xfcf043ac), SN8(0x030fbc54), SN8(0x07641af0),
124cabdff1aSopenharmony_ci      SN8(0x07641af0), SN8(0x030fbc54), SN8(0xfcf043ac), SN8(0xf89be510) },
125cabdff1aSopenharmony_ci    { SN8(0xf9592678), SN8(0x018f8b84), SN8(0x07d8a5f0), SN8(0x0471ced0),
126cabdff1aSopenharmony_ci      SN8(0xfb8e3130), SN8(0xf8275a10), SN8(0xfe70747c), SN8(0x06a6d988) }
127cabdff1aSopenharmony_ci};
128