audio_codec_mp3_tables.h

来自「AMLOGIC DPF source code」· C头文件 代码 · 共 1,553 行 · 第 1/5 页

H
1,553
字号
	},
	{
		0x08080808,
		0x08080808,
		0x0c0c080c,
		0x10141010,
		0x18181414,
		0x1c1c181c,
		0x24022424,
		0x02020202,
		0x02020202,
		0x1a001a1a
	},
	{
		0x0c040c0c,
		0x08080404,
		0x0c0c080c,
		0x10141010,
		0x18181414,
		0x1c1c181c,
		0x24022424,
		0x02020202,
		0x02020202,
		0x1a001a1a
	}
};

static
unsigned const BITRATE_TAB[90] =  {
   0,  32000,  64000,  96000, 128000, 160000, 192000, 224000,  /* Layer I   */
       256000, 288000, 320000, 352000, 384000, 416000, 448000,
  /* MPEG-2 LSF */
   0,  32000,  48000,  56000,  64000,  80000,  96000, 112000,  /* Layer I   */
       128000, 144000, 160000, 176000, 192000, 224000, 256000, 
            
   0,  32000,  48000,  56000,  64000,  80000,  96000, 112000,  /* Layer II  */
       128000, 160000, 192000, 224000, 256000, 320000, 384000, 
   /* MPEG-2 LSF */
   0,   8000,  16000,  24000,  32000,  40000,  48000,  56000,  /* Layers    */
        64000,  80000,  96000, 112000, 128000, 144000, 160000,  /* II & III  */
             
   0,  32000,  40000,  48000,  56000,  64000,  80000,  96000,  /* Layer III */
       112000, 128000, 160000, 192000, 224000, 256000, 320000, 
   /* MPEG-2 LSF */
   0,   8000,  16000,  24000,  32000,  40000,  48000,  56000,  /* Layers    */
        64000,  80000,  96000, 112000, 128000, 144000, 160000  /* II & III  */
} ;   

static
struct {
  unsigned char slen1;
  unsigned char slen2;
} const SFLEN_TAB[16] = {
  { 0, 0 }, { 0, 1 }, { 0, 2 }, { 0, 3 },
  { 3, 0 }, { 1, 1 }, { 1, 2 }, { 1, 3 },
  { 2, 1 }, { 2, 2 }, { 2, 3 }, { 3, 1 },
  { 3, 2 }, { 3, 3 }, { 4, 2 }, { 4, 3 }
};

static
unsigned char const nsfb_table[6][3][4] = {
  { {  6,  5,  5, 5 },
    {  9,  9,  9, 9 },
    {  6,  9,  9, 9 } },

  { {  6,  5,  7, 3 },
    {  9,  9, 12, 6 },
    {  6,  9, 12, 6 } },

  { { 11, 10,  0, 0 },
    { 18, 18,  0, 0 },
    { 15, 18,  0, 0 } },

  { {  7,  7,  7, 0 },
    { 12, 12, 12, 0 },
    {  6, 15, 12, 0 } },

  { {  6,  6,  6, 3 },
    { 12,  9,  9, 6 },
    {  6, 12,  9, 6 } },

  { {  8,  8,  5, 0 },
    { 15, 12,  9, 0 },
    {  6, 18,  9, 0 } }
};

static 
unsigned int const COS_TABLE[32]={
/*#  define costab0	*/		(0x0fffffff>>5),  /* 0.999999999 */
/*#  define costab1	*/		(0x0ffb10f2>>5),  /* 0.998795456 */
/*#  define costab2	*/		(0x0fec46d2>>5),  /* 0.995184727 */
/*#  define costab3	*/		(0x0fd3aac0>>5),  /* 0.989176510 */
/*#  define costab4	*/		(0x0fb14be8>>5),  /* 0.980785280 */
/*#  define costab5	*/		(0x0f853f7e>>5),  /* 0.970031253 */
/*#  define costab6	*/		(0x0f4fa0ab>>5),  /* 0.956940336 */
/*#  define costab7	*/		(0x0f109082>>5),  /* 0.941544065 */
/*#  define costab8	*/		(0x0ec835e8>>5),  /* 0.923879533 */
/*#  define costab9	*/		(0x0e76bd7a>>5),  /* 0.903989293 */
/*#  define costab10*/		(0x0e1c5979>>5),  /* 0.881921264 */
/*#  define costab11*/		(0x0db941a3>>5),  /* 0.857728610 */
/*#  define costab12*/		(0x0d4db315>>5),  /* 0.831469612 */
/*#  define costab13*/		(0x0cd9f024>>5),  /* 0.803207531 */
/*#  define costab14*/		(0x0c5e4036>>5),  /* 0.773010453 */
/*#  define costab15*/		(0x0bdaef91>>5),  /* 0.740951125 */
/*#  define costab16*/		(0x0b504f33>>5),  /* 0.707106781 */
/*#  define costab17*/		(0x0abeb49a>>5),  /* 0.671558955 */
/*#  define costab18*/		(0x0a267993>>5),  /* 0.634393284 */
/*#  define costab19*/		(0x0987fbfe>>5),  /* 0.595699304 */
/*#  define costab20*/		(0x08e39d9d>>5),  /* 0.555570233 */
/*#  define costab21*/		(0x0839c3cd>>5),  /* 0.514102744 */
/*#  define costab22*/		(0x078ad74e>>5),  /* 0.471396737 */
/*#  define costab23*/		(0x06d74402>>5),  /* 0.427555093 */
/*#  define costab24*/		(0x061f78aa>>5),  /* 0.382683432 */
/*#  define costab25*/		(0x0563e69d>>5),  /* 0.336889853 */
/*#  define costab26*/		(0x04a5018c>>5),  /* 0.290284677 */
/*#  define costab27*/		(0x03e33f2f>>5),  /* 0.242980180 */
/*#  define costab28*/		(0x031f1708>>5),  /* 0.195090322 */
/*#  define costab29*/		(0x0259020e>>5),  /* 0.146730474 */
/*#  define costab30*/		(0x01917a6c>>5),  /* 0.098017140 */
/*#  define costab31*/		(0x00c8fb30>>5)   /* 0.049067674 */
};
static
signed int const is_table[8]/*[7]*/ = {
  (0x00000000>>5) /* 0.000000000 */,
  (0x0361962f>>5) /* 0.211324865 */,
  (0x05db3d74>>5) /* 0.366025404 */,
  (0x08000000>>5) /* 0.500000000 */,
  (0x0a24c28c>>5) /* 0.633974596 */,
  (0x0c9e69d1>>5) /* 0.788675135 */,
  (0x10000000>>5) /* 1.000000000 */,
  0
};

static
signed int const is_lsf_table[32]/*[2][15]*/ = {
    (0x0d744fcd>>5) /* 0.840896415 */,
    (0x0b504f33>>5) /* 0.707106781 */,
    (0x09837f05>>5) /* 0.594603558 */,
    (0x08000000>>5) /* 0.500000000 */,
    (0x06ba27e6>>5) /* 0.420448208 */,
    (0x05a8279a>>5) /* 0.353553391 */,
    (0x04c1bf83>>5) /* 0.297301779 */,
    (0x04000000>>5) /* 0.250000000 */,
    (0x035d13f3>>5) /* 0.210224104 */,
    (0x02d413cd>>5) /* 0.176776695 */,
    (0x0260dfc1>>5) /* 0.148650889 */,
    (0x02000000>>5) /* 0.125000000 */,
    (0x01ae89fa>>5) /* 0.105112052 */,
    (0x016a09e6>>5) /* 0.088388348 */,
    (0x01306fe1>>5) /* 0.074325445 */,
    (0x0b504f33>>5) /* 0.707106781 */,
    (0x08000000>>5) /* 0.500000000 */,
    (0x05a8279a>>5) /* 0.353553391 */,
    (0x04000000>>5) /* 0.250000000 */,
    (0x02d413cd>>5) /* 0.176776695 */,
    (0x02000000>>5) /* 0.125000000 */,
    (0x016a09e6>>5) /* 0.088388348 */,
    (0x01000000>>5) /* 0.062500000 */,
    (0x00b504f3>>5) /* 0.044194174 */,
    (0x00800000>>5) /* 0.031250000 */,
    (0x005a827a>>5) /* 0.022097087 */,
    (0x00400000>>5) /* 0.015625000 */,
    (0x002d413d>>5) /* 0.011048543 */,
    (0x00200000>>5) /* 0.007812500 */,
    (0x0016a09e>>5) /* 0.005524272 */,
    0,
    0
};

static
struct fixedfloat {
  unsigned long mantissa  : 27;
  unsigned short exponent :  5;
} const rq_table[8207] = {
/*
 * This is the lookup table used to compute x^(4/3) for Layer III
 * requantization. To maintain the best possible accuracy, the value is
 * stored as a normalized mantissa with exponent. The requantization
 * algorithm recombines these parts with appropriate scaling.
 */

  /*    0 */  { (0x00000000) /* 0.000000000 */,  0 },
  /*    1 */  { (0x04000000) /* 0.250000000 */,  2 },
  /*    2 */  { (0x050a28be) /* 0.314980262 */,  3 },
  /*    3 */  { (0x0453a5cd) /* 0.270421794 */,  4 },
  /*    4 */  { (0x06597fa9) /* 0.396850263 */,  4 },
  /*    5 */  { (0x04466275) /* 0.267183742 */,  5 },
  /*    6 */  { (0x05738c72) /* 0.340710111 */,  5 },
  /*    7 */  { (0x06b1fc81) /* 0.418453696 */,  5 },
  /*    8 */  { (0x04000000) /* 0.250000000 */,  6 },
  /*    9 */  { (0x04ae20d7) /* 0.292511788 */,  6 },
  /*   10 */  { (0x0562d694) /* 0.336630420 */,  6 },
  /*   11 */  { (0x061dae96) /* 0.382246578 */,  6 },
  /*   12 */  { (0x06de47f4) /* 0.429267841 */,  6 },
  /*   13 */  { (0x07a44f7a) /* 0.477614858 */,  6 },
  /*   14 */  { (0x0437be65) /* 0.263609310 */,  7 },
  /*   15 */  { (0x049fc824) /* 0.289009227 */,  7 },

  /*   16 */  { (0x050a28be) /* 0.314980262 */,  7 },
  /*   17 */  { (0x0576c6f5) /* 0.341498336 */,  7 },
  /*   18 */  { (0x05e58c0b) /* 0.368541759 */,  7 },
  /*   19 */  { (0x06566361) /* 0.396090870 */,  7 },
  /*   20 */  { (0x06c93a2e) /* 0.424127753 */,  7 },
  /*   21 */  { (0x073dff3e) /* 0.452635998 */,  7 },
  /*   22 */  { (0x07b4a2bc) /* 0.481600510 */,  7 },
  /*   23 */  { (0x04168b05) /* 0.255503674 */,  8 },
  /*   24 */  { (0x0453a5cd) /* 0.270421794 */,  8 },
  /*   25 */  { (0x04919b6a) /* 0.285548607 */,  8 },
  /*   26 */  { (0x04d065fb) /* 0.300878507 */,  8 },
  /*   27 */  { (0x05100000) /* 0.316406250 */,  8 },
  /*   28 */  { (0x05506451) /* 0.332126919 */,  8 },
  /*   29 */  { (0x05918e15) /* 0.348035890 */,  8 },
  /*   30 */  { (0x05d378bb) /* 0.364128809 */,  8 },
  /*   31 */  { (0x06161ff3) /* 0.380401563 */,  8 },

  /*   32 */  { (0x06597fa9) /* 0.396850263 */,  8 },
  /*   33 */  { (0x069d9400) /* 0.413471222 */,  8 },
  /*   34 */  { (0x06e2594c) /* 0.430260942 */,  8 },
  /*   35 */  { (0x0727cc11) /* 0.447216097 */,  8 },
  /*   36 */  { (0x076de8fc) /* 0.464333519 */,  8 },
  /*   37 */  { (0x07b4ace3) /* 0.481610189 */,  8 },
  /*   38 */  { (0x07fc14bf) /* 0.499043224 */,  8 },
  /*   39 */  { (0x04220ed7) /* 0.258314934 */,  9 },
  /*   40 */  { (0x04466275) /* 0.267183742 */,  9 },
  /*   41 */  { (0x046b03e7) /* 0.276126771 */,  9 },
  /*   42 */  { (0x048ff1e8) /* 0.285142811 */,  9 },
  /*   43 */  { (0x04b52b3f) /* 0.294230696 */,  9 },
  /*   44 */  { (0x04daaec0) /* 0.303389310 */,  9 },
  /*   45 */  { (0x05007b49) /* 0.312617576 */,  9 },
  /*   46 */  { (0x05268fc6) /* 0.321914457 */,  9 },
  /*   47 */  { (0x054ceb2a) /* 0.331278957 */,  9 },

  /*   48 */  { (0x05738c72) /* 0.340710111 */,  9 },
  /*   49 */  { (0x059a72a5) /* 0.350206992 */,  9 },
  /*   50 */  { (0x05c19cd3) /* 0.359768701 */,  9 },
  /*   51 */  { (0x05e90a12) /* 0.369394372 */,  9 },
  /*   52 */  { (0x0610b982) /* 0.379083164 */,  9 },
  /*   53 */  { (0x0638aa48) /* 0.388834268 */,  9 },
  /*   54 */  { (0x0660db91) /* 0.398646895 */,  9 },
  /*   55 */  { (0x06894c90) /* 0.408520284 */,  9 },
  /*   56 */  { (0x06b1fc81) /* 0.418453696 */,  9 },
  /*   57 */  { (0x06daeaa1) /* 0.428446415 */,  9 },
  /*   58 */  { (0x07041636) /* 0.438497744 */,  9 },
  /*   59 */  { (0x072d7e8b) /* 0.448607009 */,  9 },
  /*   60 */  { (0x075722ef) /* 0.458773552 */,  9 },
  /*   61 */  { (0x078102b8) /* 0.468996735 */,  9 },
  /*   62 */  { (0x07ab1d3e) /* 0.479275937 */,  9 },
  /*   63 */  { (0x07d571e0) /* 0.489610555 */,  9 },

  /*   64 */  { (0x04000000) /* 0.250000000 */, 10 },
  /*   65 */  { (0x04156381) /* 0.255221850 */, 10 },
  /*   66 */  { (0x042ae32a) /* 0.260470548 */, 10 },
  /*   67 */  { (0x04407eb1) /* 0.265745823 */, 10 },
  /*   68 */  { (0x045635cf) /* 0.271047409 */, 10 },
  /*   69 */  { (0x046c083e) /* 0.276375048 */, 10 },
  /*   70 */  { (0x0481f5bb) /* 0.281728487 */, 10 },
  /*   71 */  { (0x0497fe03) /* 0.287107481 */, 10 },
  /*   72 */  { (0x04ae20d7) /* 0.292511788 */, 10 },
  /*   73 */  { (0x04c45df6) /* 0.297941173 */, 10 },
  /*   74 */  { (0x04dab524) /* 0.303395408 */, 10 },
  /*   75 */  { (0x04f12624) /* 0.308874267 */, 10 },
  /*   76 */  { (0x0507b0bc) /* 0.314377532 */, 10 },
  /*   77 */  { (0x051e54b1) /* 0.319904987 */, 10 },
  /*   78 */  { (0x053511cb) /* 0.325456423 */, 10 },
  /*   79 */  { (0x054be7d4) /* 0.331031635 */, 10 },

  /*   80 */  { (0x0562d694) /* 0.336630420 */, 10 },
  /*   81 */  { (0x0579ddd8) /* 0.342252584 */, 10 },
  /*   82 */  { (0x0590fd6c) /* 0.347897931 */, 10 },
  /*   83 */  { (0x05a8351c) /* 0.353566275 */, 10 },
  /*   84 */  { (0x05bf84b8) /* 0.359257429 */, 10 },
  /*   85 */  { (0x05d6ec0e) /* 0.364971213 */, 10 },
  /*   86 */  { (0x05ee6aef) /* 0.370707448 */, 10 },
  /*   87 */  { (0x0606012b) /* 0.376465960 */, 10 },
  /*   88 */  { (0x061dae96) /* 0.382246578 */, 10 },
  /*   89 */  { (0x06357302) /* 0.388049134 */, 10 },
  /*   90 */  { (0x064d4e43) /* 0.393873464 */, 10 },
  /*   91 */  { (0x0665402d) /* 0.399719406 */, 10 },
  /*   92 */  { (0x067d4896) /* 0.405586801 */, 10 },
  /*   93 */  { (0x06956753) /* 0.411475493 */, 10 },
  /*   94 */  { (0x06ad9c3d) /* 0.417385331 */, 10 },
  /*   95 */  { (0x06c5e72b) /* 0.423316162 */, 10 },

  /*   96 */  { (0x06de47f4) /* 0.429267841 */, 10 },
  /*   97 */  { (0x06f6be73) /* 0.435240221 */, 10 },
  /*   98 */  { (0x070f4a80) /* 0.441233161 */, 10 },
  /*   99 */  { (0x0727ebf7) /* 0.447246519 */, 10 },
  /*  100 */  { (0x0740a2b2) /* 0.453280160 */, 10 },
  /*  101 */  { (0x07596e8d) /* 0.459333946 */, 10 },
  /*  102 */  { (0x07724f64) /* 0.465407744 */, 10 },
  /*  103 */  { (0x078b4514) /* 0.471501425 */, 10 },
  /*  104 */  { (0x07a44f7a) /* 0.477614858 */, 10 },
  /*  105 */  { (0x07bd6e75) /* 0.483747918 */, 10 },
  /*  106 */  { (0x07d6a1e2) /* 0.489900479 */, 10 },
  /*  107 */  { (0x07efe9a1) /* 0.496072418 */, 10 },
  /*  108 */  { (0x0404a2c9) /* 0.251131807 */, 11 },
  /*  109 */  { (0x04115aca) /* 0.254236974 */, 11 },
  /*  110 */  { (0x041e1cc4) /* 0.257351652 */, 11 },
  /*  111 */  { (0x042ae8a7) /* 0.260475783 */, 11 },

  /*  112 */  { (0x0437be65) /* 0.263609310 */, 11 },
  /*  113 */  { (0x04449dee) /* 0.266752177 */, 11 },
  /*  114 */  { (0x04518733) /* 0.269904329 */, 11 },
  /*  115 */  { (0x045e7a26) /* 0.273065710 */, 11 },
  /*  116 */  { (0x046b76b9) /* 0.276236269 */, 11 },
  /*  117 */  { (0x04787cdc) /* 0.279415952 */, 11 },
  /*  118 */  { (0x04858c83) /* 0.282604707 */, 11 },
  /*  119 */  { (0x0492a59f) /* 0.285802482 */, 11 },
  /*  120 */  { (0x049fc824) /* 0.289009227 */, 11 },
  /*  121 */  { (0x04acf402) /* 0.292224893 */, 11 },
  /*  122 */  { (0x04ba292e) /* 0.295449429 */, 11 },

⌨️ 快捷键说明

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