2008-06-08 21:08:57 +00:00
|
|
|
/*
|
2008-08-03 16:42:32 +00:00
|
|
|
* AC-3 and E-AC-3 decoder tables
|
2008-06-08 21:08:57 +00:00
|
|
|
* Copyright (c) 2007 Bartlomiej Wolowiec <bartek.wolowiec@gmail.com>
|
|
|
|
*
|
2011-03-18 17:35:10 +00:00
|
|
|
* This file is part of Libav.
|
2008-06-08 21:08:57 +00:00
|
|
|
*
|
2011-03-18 17:35:10 +00:00
|
|
|
* Libav is free software; you can redistribute it and/or
|
2008-06-08 21:08:57 +00:00
|
|
|
* 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.
|
|
|
|
*
|
2011-03-18 17:35:10 +00:00
|
|
|
* Libav is distributed in the hope that it will be useful,
|
2008-06-08 21:08:57 +00:00
|
|
|
* 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
|
2011-03-18 17:35:10 +00:00
|
|
|
* License along with Libav; if not, write to the Free Software
|
2008-06-08 21:08:57 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2010-04-20 14:45:34 +00:00
|
|
|
* @file
|
2009-07-22 22:43:43 +00:00
|
|
|
* Tables taken directly from the AC-3 spec.
|
2008-06-08 21:08:57 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ac3dec_data.h"
|
|
|
|
#include "ac3.h"
|
|
|
|
|
2008-08-03 21:42:43 +00:00
|
|
|
/**
|
2009-07-22 22:43:43 +00:00
|
|
|
* Table used to ungroup 3 values stored in 5 bits.
|
|
|
|
* Used by bap=1 mantissas and GAQ.
|
2008-08-03 21:42:43 +00:00
|
|
|
* ff_ac3_ungroup_3_in_5_bits_tab[i] = { i/9, (i%9)/3, (i%9)%3 }
|
|
|
|
*/
|
|
|
|
const uint8_t ff_ac3_ungroup_3_in_5_bits_tab[32][3] = {
|
|
|
|
{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 2 }, { 0, 1, 0 },
|
|
|
|
{ 0, 1, 1 }, { 0, 1, 2 }, { 0, 2, 0 }, { 0, 2, 1 },
|
|
|
|
{ 0, 2, 2 }, { 1, 0, 0 }, { 1, 0, 1 }, { 1, 0, 2 },
|
|
|
|
{ 1, 1, 0 }, { 1, 1, 1 }, { 1, 1, 2 }, { 1, 2, 0 },
|
|
|
|
{ 1, 2, 1 }, { 1, 2, 2 }, { 2, 0, 0 }, { 2, 0, 1 },
|
|
|
|
{ 2, 0, 2 }, { 2, 1, 0 }, { 2, 1, 1 }, { 2, 1, 2 },
|
|
|
|
{ 2, 2, 0 }, { 2, 2, 1 }, { 2, 2, 2 }, { 3, 0, 0 },
|
|
|
|
{ 3, 0, 1 }, { 3, 0, 2 }, { 3, 1, 0 }, { 3, 1, 1 }
|
|
|
|
};
|
|
|
|
|
2008-06-08 21:08:57 +00:00
|
|
|
const uint8_t ff_eac3_hebap_tab[64] = {
|
|
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 8,
|
|
|
|
8, 8, 9, 9, 9, 10, 10, 10, 10, 11,
|
|
|
|
11, 11, 11, 12, 12, 12, 12, 13, 13, 13,
|
|
|
|
13, 14, 14, 14, 14, 15, 15, 15, 15, 16,
|
|
|
|
16, 16, 16, 17, 17, 17, 17, 18, 18, 18,
|
|
|
|
18, 18, 18, 18, 18, 19, 19, 19, 19, 19,
|
|
|
|
19, 19, 19, 19,
|
|
|
|
};
|
|
|
|
|
2010-03-30 22:09:14 +00:00
|
|
|
/**
|
|
|
|
* Table E2.15 Default Spectral Extension Banding Structure
|
|
|
|
*/
|
|
|
|
const uint8_t ff_eac3_default_spx_band_struct[17] =
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1 };
|