libavcodec/mpegaudiotab.h
de6d9b64
 /*
  * mpeg audio layer 2 tables. Most of them come from the mpeg audio
  * specification.
115329f1
  *
406792e7
  * Copyright (c) 2000, 2001 Fabrice Bellard
de6d9b64
  *
b78e7197
  * This file is part of FFmpeg.
  *
  * FFmpeg is free software; you can redistribute it and/or
712ae911
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
b78e7197
  * version 2.1 of the License, or (at your option) any later version.
712ae911
  *
b78e7197
  * FFmpeg is distributed in the hope that it will be useful,
712ae911
  * 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
b78e7197
  * License along with FFmpeg; if not, write to the Free Software
712ae911
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
de6d9b64
  */
 
983e3246
 /**
bad5537e
  * @file libavcodec/mpegaudiotab.h
115329f1
  * mpeg audio layer 2 tables.
983e3246
  * Most of them come from the mpeg audio specification.
  */
115329f1
 
98790382
 #ifndef AVCODEC_MPEGAUDIOTAB_H
 #define AVCODEC_MPEGAUDIOTAB_H
699b3f99
 
99545457
 #include <stdint.h>
 #include "mpegaudio.h"
 
de6d9b64
 #define SQRT2 1.41421356237309514547
 
 static const int costab32[30] = {
     FIX(0.54119610014619701222),
     FIX(1.3065629648763763537),
115329f1
 
de6d9b64
     FIX(0.50979557910415917998),
     FIX(2.5629154477415054814),
     FIX(0.89997622313641556513),
     FIX(0.60134488693504528634),
115329f1
 
de6d9b64
     FIX(0.5024192861881556782),
     FIX(5.1011486186891552563),
     FIX(0.78815462345125020249),
     FIX(0.64682178335999007679),
     FIX(0.56694403481635768927),
     FIX(1.0606776859903470633),
     FIX(1.7224470982383341955),
     FIX(0.52249861493968885462),
115329f1
 
de6d9b64
     FIX(10.19000812354803287),
     FIX(0.674808341455005678),
     FIX(1.1694399334328846596),
     FIX(0.53104259108978413284),
     FIX(2.0577810099534108446),
     FIX(0.58293496820613388554),
     FIX(0.83934964541552681272),
     FIX(0.50547095989754364798),
     FIX(3.4076084184687189804),
     FIX(0.62250412303566482475),
     FIX(0.97256823786196078263),
     FIX(0.51544730992262455249),
     FIX(1.4841646163141661852),
     FIX(0.5531038960344445421),
     FIX(0.74453627100229857749),
     FIX(0.5006029982351962726),
 };
 
 static const int bitinv32[32] = {
     0,  16,  8, 24,  4,  20,  12,  28,
     2,  18, 10, 26,  6,  22,  14,  30,
     1,  17,  9, 25,  5,  21,  13,  29,
     3,  19, 11, 27,  7,  23,  15,  31
 };
 
 
0c1a9eda
 static int16_t filter_bank[512];
de6d9b64
 
 static int scale_factor_table[64];
 #ifdef USE_FLOATS
 static float scale_factor_inv_table[64];
 #else
0c1a9eda
 static int8_t scale_factor_shift[64];
de6d9b64
 static unsigned short scale_factor_mult[64];
 #endif
 static unsigned char scale_diff_table[128];
 
2456e28d
 /* total number of bits per allocation group */
 static unsigned short total_quant_bits[17];
de6d9b64
 
 /* signal to noise ratio of each quantification step (could be
115329f1
    computed from quant_steps[]). The values are dB multiplied by 10
de6d9b64
 */
115329f1
 static const unsigned short quant_snr[17] = {
de6d9b64
      70, 110, 160, 208,
     253, 316, 378, 439,
115329f1
     499, 559, 620, 680,
     740, 800, 861, 920,
de6d9b64
     980
 };
 
 /* fixed psycho acoustic model. Values of SNR taken from the 'toolame'
    project */
2456e28d
 static const float fixed_smr[SBLIMIT] =  {
de6d9b64
     30, 17, 16, 10, 3, 12, 8, 2.5,
     5, 5, 6, 6, 5, 6, 10, 6,
     -4, -10, -21, -30, -42, -55, -68, -75,
     -75, -75, -75, -75, -91, -107, -110, -108
 };
 
2456e28d
 static const unsigned char nb_scale_factors[4] = { 3, 2, 1, 2 };
 
98790382
 #endif /* AVCODEC_MPEGAUDIOTAB_H */