61 lines
2 KiB
C
61 lines
2 KiB
C
/* mpeg-audio.c
|
|
*
|
|
* MPEG Audio header dissection
|
|
* Written by Shaun Jackman <sjackman@gmail.com>
|
|
* Copyright 2007 Shaun Jackman
|
|
*
|
|
* $Id$
|
|
*
|
|
* Wiretap Library
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation; either version 2
|
|
* of the License, or (at your option) any later version.
|
|
*
|
|
* This program 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 General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
*/
|
|
|
|
#include "mpeg-audio.h"
|
|
|
|
const int mpa_versions[4] = { 2, -1, 1, 0 };
|
|
const int mpa_layers[4] = { -1, 2, 1, 0 };
|
|
|
|
const unsigned mpa_samples[3][3] = {
|
|
{ 384, 1152, 1152 },
|
|
{ 384, 1152, 576 },
|
|
{ 384, 1152, 576 },
|
|
};
|
|
|
|
const unsigned mpa_bitrates[3][3][16] = { /* kb/s */
|
|
{
|
|
{ 0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448 },
|
|
{ 0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384 },
|
|
{ 0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320 },
|
|
},
|
|
{
|
|
{ 0, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256 },
|
|
{ 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160 },
|
|
{ 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160 },
|
|
},
|
|
{
|
|
{ 0, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256 },
|
|
{ 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160 },
|
|
{ 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160 },
|
|
},
|
|
};
|
|
|
|
const unsigned mpa_frequencies[3][4] = {
|
|
{ 44100, 48000, 32000 },
|
|
{ 22050, 24000, 16000 },
|
|
{ 11025, 12000, 8000 },
|
|
};
|
|
|
|
const unsigned mpa_padding[3] = { 4, 1, 1 };
|