⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sbc_tables.h

📁 蓝牙blue tooth sco协议栈
💻 H
字号:
/* * *  Bluetooth low-complexity, subband codec (SBC) library * *  Copyright (C) 2004  Marcel Holtmann <marcel@holtmann.org> *  Copyright (C) 2004  Henryk Ploetz <henryk@ploetzli.ch> * * *  This library 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. * *  This library 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 this library; if not, write to the Free Software *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA * */#ifndef __SBC_TABLES_H#define __SBC_TABLES_H/* A2DP specification: Appendix B, page 69 */static const int sbc_offset4[4][4] = {	{ -1, 0, 0, 0 },	{ -2, 0, 0, 1 },	{ -2, 0, 0, 1 },	{ -2, 0, 0, 1 }};/* A2DP specification: Appendix B, page 69 */static const int sbc_offset8[4][8] = {	{ -2, 0, 0, 0, 0, 0, 0, 1 },	{ -3, 0, 0, 0, 0, 0, 1, 2 },	{ -4, 0, 0, 0, 0, 0, 1, 2 },	{ -4, 0, 0, 0, 0, 0, 1, 2 }};/* A2DP specification: Appendix B, page 70 */static const float sbc_proto_4_40[40] = {	 0.00000000E+00,  5.36548976E-04,  1.49188357E-03,  2.73370904E-03,	 3.83720193E-03,  3.89205149E-03,  1.86581691E-03, -3.06012286E-03,	 1.09137620E-02,  2.04385087E-02,  2.88757392E-02,  3.21939290E-02,	 2.58767811E-02,  6.13245186E-03, -2.88217274E-02, -7.76463494E-02,	 1.35593274E-01,  1.94987841E-01,  2.46636662E-01,  2.81828203E-01,	 2.94315332E-01,  2.81828203E-01,  2.46636662E-01,  1.94987841E-01,	-1.35593274E-01, -7.76463494E-02, -2.88217274E-02,  6.13245186E-03,	 2.58767811E-02,  3.21939290E-02,  2.88757392E-02,  2.04385087E-02,	-1.09137620E-02, -3.06012286E-03,  1.86581691E-03,  3.89205149E-03,	 3.83720193E-03,  2.73370904E-03,  1.49188357E-03,  5.36548976E-04};/* A2DP specification: Appendix B, page 70 */static const float sbc_proto_8_80[80] = {	 0.00000000E+00,  1.56575398E-04,  3.43256425E-04,  5.54620202E-04,	 8.23919506E-04,  1.13992507E-03,  1.47640169E-03,  1.78371725E-03,	 2.01182542E-03,  2.10371989E-03,  1.99454554E-03,  1.61656283E-03,	 9.02154502E-04, -1.78805361E-04, -1.64973098E-03, -3.49717454E-03,	 5.65949473E-03,  8.02941163E-03,  1.04584443E-02,  1.27472335E-02,	 1.46525263E-02,  1.59045603E-02,  1.62208471E-02,  1.53184106E-02,	 1.29371806E-02,  8.85757540E-03,  2.92408442E-03, -4.91578024E-03,	-1.46404076E-02, -2.61098752E-02, -3.90751381E-02, -5.31873032E-02,	 6.79989431E-02,  8.29847578E-02,  9.75753918E-02,  1.11196689E-01,	 1.23264548E-01,  1.33264415E-01,  1.40753505E-01,  1.45389847E-01,	 1.46955068E-01,  1.45389847E-01,  1.40753505E-01,  1.33264415E-01,	 1.23264548E-01,  1.11196689E-01,  9.75753918E-02,  8.29847578E-02,	-6.79989431E-02, -5.31873032E-02, -3.90751381E-02, -2.61098752E-02,	-1.46404076E-02, -4.91578024E-03,  2.92408442E-03,  8.85757540E-03,	 1.29371806E-02,  1.53184106E-02,  1.62208471E-02,  1.59045603E-02,	 1.46525263E-02,  1.27472335E-02,  1.04584443E-02,  8.02941163E-03,	-5.65949473E-03, -3.49717454E-03, -1.64973098E-03, -1.78805361E-04,	 9.02154502E-04,  1.61656283E-03,  1.99454554E-03,  2.10371989E-03,	 2.01182542E-03,  1.78371725E-03,  1.47640169E-03,  1.13992507E-03,	 8.23919506E-04,  5.54620202E-04,  3.43256425E-04,  1.56575398E-04};/* Precomputed: synmatrix4[k][i] = cos( (i+0.5) * (k+2.0) * pi/4.0 ) */static const float synmatrix4[8][4] =  {	{  0.707106781186548, -0.707106781186547, -0.707106781186548,  0.707106781186547 },	{  0.38268343236509,  -0.923879532511287,  0.923879532511287, -0.38268343236509  },	{  0,                  0,                  0,                  0                 },	{ -0.38268343236509,   0.923879532511287, -0.923879532511287,  0.382683432365091 },	{ -0.707106781186547,  0.707106781186548,  0.707106781186547, -0.707106781186547 },	{ -0.923879532511287, -0.38268343236509,   0.382683432365091,  0.923879532511288 },	{ -1,                 -1,                 -1,                 -1                 },	{ -0.923879532511287, -0.382683432365091,  0.38268343236509,   0.923879532511287 }};/* Precomputed: synmatrix8[k][i] = cos( (i+0.5) * (k+4.0) * pi/8.0 ) */static const float synmatrix8[16][8] = {	{  0.707106781186548, -0.707106781186547, -0.707106781186548,  0.707106781186547,	   0.707106781186548, -0.707106781186547, -0.707106781186547,  0.707106781186547 },	{  0.555570233019602, -0.98078528040323,   0.195090322016128,  0.831469612302545,	  -0.831469612302545, -0.195090322016128,  0.980785280403231, -0.555570233019602 },	{  0.38268343236509,  -0.923879532511287,  0.923879532511287, -0.38268343236509,	  -0.382683432365091,  0.923879532511287, -0.923879532511286,  0.38268343236509  },	{  0.195090322016128, -0.555570233019602,  0.831469612302545, -0.980785280403231,	   0.98078528040323,  -0.831469612302545,  0.555570233019602, -0.195090322016129 },	{  0,                  0,                  0,                  0,	   0,                  0,                  0,                  0                 },	{ -0.195090322016128,  0.555570233019602, -0.831469612302545,  0.98078528040323,	  -0.980785280403231,  0.831469612302545, -0.555570233019603,  0.19509032201613  },	{ -0.38268343236509,   0.923879532511287, -0.923879532511287,  0.382683432365091,	   0.38268343236509,  -0.923879532511287,  0.923879532511288, -0.382683432365091 },	{ -0.555570233019602,  0.98078528040323,  -0.195090322016128, -0.831469612302545,	   0.831469612302545,  0.195090322016128, -0.98078528040323,   0.555570233019606 },	{ -0.707106781186547,  0.707106781186548,  0.707106781186547, -0.707106781186547,	  -0.707106781186546,  0.707106781186548,  0.707106781186546, -0.707106781186548 },	{ -0.831469612302545,  0.195090322016129,  0.980785280403231,  0.555570233019602,	  -0.555570233019603, -0.98078528040323,  -0.195090322016128,  0.831469612302547 },	{ -0.923879532511287, -0.38268343236509,   0.382683432365091,  0.923879532511288,	   0.923879532511287,  0.382683432365089, -0.382683432365091, -0.923879532511287 },	{ -0.98078528040323,  -0.831469612302545, -0.555570233019602, -0.195090322016129,	   0.19509032201613,   0.555570233019606,  0.831469612302547,  0.980785280403231 },	{ -1,                 -1,                 -1,                 -1,	  -1,                 -1,                 -1,                 -1                 },	{ -0.98078528040323,  -0.831469612302546, -0.555570233019603, -0.19509032201613,	   0.195090322016128,  0.555570233019604,  0.831469612302545,  0.98078528040323  },	{ -0.923879532511287, -0.382683432365091,  0.38268343236509,   0.923879532511287,	   0.923879532511288,  0.382683432365088, -0.382683432365089, -0.923879532511285 },	{ -0.831469612302545,  0.195090322016127,  0.98078528040323,   0.555570233019603,	  -0.555570233019601, -0.98078528040323,  -0.195090322016131,  0.831469612302545 }};/* Precomputed: anamatrix4[i][k] = cos( (i+0.5) * (k-2) * pi/4 ) */static const float anamatrix4[4][8] = {	{  0.707106781186548,  0.923879532511287,  1,                  0.923879532511287,	   0.707106781186548,  0.38268343236509,   0,                 -0.38268343236509  },	{ -0.707106781186547,  0.38268343236509,   1,                  0.38268343236509,	  -0.707106781186547, -0.923879532511287,  0,                  0.923879532511287 },	{ -0.707106781186548, -0.38268343236509,   1,                 -0.38268343236509,	  -0.707106781186548,  0.923879532511287,  0,                 -0.923879532511287 },	{  0.707106781186547, -0.923879532511287,  1,                 -0.923879532511287,	   0.707106781186547, -0.38268343236509,   0,                  0.382683432365091 }};/* Precomputed: anamatrix8[i][k] = cos( (i+0.5) * (k-4) * pi/8) */static const float anamatrix8[8][16] = {	{  0.923879532511287,  0.98078528040323,   1,                  0.98078528040323,	   0.923879532511287,  0.831469612302545,  0.707106781186548,  0.555570233019602,	   0.38268343236509,   0.195090322016128,  0,                 -0.195090322016128,	  -0.38268343236509,  -0.555570233019602, -0.707106781186547, -0.831469612302545 },	{  0.38268343236509,   0.831469612302545,  1,                  0.831469612302545,	   0.38268343236509,  -0.195090322016128, -0.707106781186547, -0.98078528040323,	  -0.923879532511287, -0.555570233019602,  0,                  0.555570233019602,	   0.923879532511287,  0.98078528040323,   0.707106781186548,  0.195090322016129 },	{ -0.38268343236509,   0.555570233019602,  1,                  0.555570233019602,	  -0.38268343236509,  -0.98078528040323,  -0.707106781186548,  0.195090322016128,	   0.923879532511287,  0.831469612302545,  0,                 -0.831469612302545,	  -0.923879532511287, -0.195090322016128,  0.707106781186547,  0.980785280403231 },	{ -0.923879532511287,  0.195090322016128,  1,                  0.195090322016128,	  -0.923879532511287, -0.555570233019602,  0.707106781186547,  0.831469612302545,	  -0.38268343236509,  -0.980785280403231,  0,                  0.98078528040323,	   0.382683432365091, -0.831469612302545, -0.707106781186547,  0.555570233019602 },	{ -0.923879532511287, -0.195090322016128,  1,                 -0.195090322016128,	  -0.923879532511287,  0.555570233019602,  0.707106781186548, -0.831469612302545,	  -0.382683432365091,  0.98078528040323,   0,                 -0.980785280403231,	   0.38268343236509,   0.831469612302545, -0.707106781186546, -0.555570233019603 },	{ -0.38268343236509,  -0.555570233019602,  1,                 -0.555570233019602,	  -0.38268343236509,   0.98078528040323,  -0.707106781186547, -0.195090322016128,	   0.923879532511287, -0.831469612302545,  0,                  0.831469612302545,	  -0.923879532511287,  0.195090322016128,  0.707106781186548, -0.98078528040323  },	{  0.38268343236509,  -0.831469612302545,  1,                 -0.831469612302545,	   0.38268343236509,   0.195090322016129, -0.707106781186547,  0.980785280403231,	  -0.923879532511286,  0.555570233019602,  0,                 -0.555570233019603,	   0.923879532511288, -0.98078528040323,   0.707106781186546, -0.195090322016128 },	{  0.923879532511287, -0.98078528040323,   1,                 -0.98078528040323,	   0.923879532511287, -0.831469612302545,  0.707106781186547, -0.555570233019602,	   0.38268343236509,  -0.195090322016129,  0,                  0.19509032201613,	  -0.382683432365091,  0.555570233019606, -0.707106781186548,  0.831469612302547 }};#endif /* __SBC_TABLES_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -