annotate ac3dec_data.c @ 12530:63edd10ad4bc libavcodec tip

Try to fix crashes introduced by r25218 r25218 made assumptions about the existence of past reference frames that weren't necessarily true.
author darkshikari
date Tue, 28 Sep 2010 09:06:22 +0000
parents 7dd2a45249a9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7032
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
1 /*
7470
1a93d3bbe3ee cosmetics: make all references to AC-3 capitalized and hyphenated
jbr
parents: 7033
diff changeset
2 * AC-3 and E-AC-3 decoder tables
7032
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
3 * Copyright (c) 2007 Bartlomiej Wolowiec <bartek.wolowiec@gmail.com>
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
4 *
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
5 * This file is part of FFmpeg.
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
6 *
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
7 * FFmpeg is free software; you can redistribute it and/or
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
8 * modify it under the terms of the GNU Lesser General Public
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
9 * License as published by the Free Software Foundation; either
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
11 *
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
12 * FFmpeg is distributed in the hope that it will be useful,
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
15 * Lesser General Public License for more details.
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
16 *
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
18 * License along with FFmpeg; if not, write to the Free Software
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
20 */
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
21
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
22 /**
11644
7dd2a45249a9 Remove explicit filename from Doxygen @file commands.
diego
parents: 11559
diff changeset
23 * @file
9978
fe394fdc45e3 cosmetics: small typo fixes
diego
parents: 9681
diff changeset
24 * Tables taken directly from the AC-3 spec.
7032
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
25 */
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
26
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
27 #include "ac3dec_data.h"
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
28 #include "ac3.h"
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
29
7472
83c16f531a90 Hardcode the table for ungrouping 3 values in 5 bits. It will be reused by
jbr
parents: 7470
diff changeset
30 /**
9978
fe394fdc45e3 cosmetics: small typo fixes
diego
parents: 9681
diff changeset
31 * Table used to ungroup 3 values stored in 5 bits.
fe394fdc45e3 cosmetics: small typo fixes
diego
parents: 9681
diff changeset
32 * Used by bap=1 mantissas and GAQ.
7472
83c16f531a90 Hardcode the table for ungrouping 3 values in 5 bits. It will be reused by
jbr
parents: 7470
diff changeset
33 * ff_ac3_ungroup_3_in_5_bits_tab[i] = { i/9, (i%9)/3, (i%9)%3 }
83c16f531a90 Hardcode the table for ungrouping 3 values in 5 bits. It will be reused by
jbr
parents: 7470
diff changeset
34 */
83c16f531a90 Hardcode the table for ungrouping 3 values in 5 bits. It will be reused by
jbr
parents: 7470
diff changeset
35 const uint8_t ff_ac3_ungroup_3_in_5_bits_tab[32][3] = {
83c16f531a90 Hardcode the table for ungrouping 3 values in 5 bits. It will be reused by
jbr
parents: 7470
diff changeset
36 { 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 2 }, { 0, 1, 0 },
83c16f531a90 Hardcode the table for ungrouping 3 values in 5 bits. It will be reused by
jbr
parents: 7470
diff changeset
37 { 0, 1, 1 }, { 0, 1, 2 }, { 0, 2, 0 }, { 0, 2, 1 },
83c16f531a90 Hardcode the table for ungrouping 3 values in 5 bits. It will be reused by
jbr
parents: 7470
diff changeset
38 { 0, 2, 2 }, { 1, 0, 0 }, { 1, 0, 1 }, { 1, 0, 2 },
83c16f531a90 Hardcode the table for ungrouping 3 values in 5 bits. It will be reused by
jbr
parents: 7470
diff changeset
39 { 1, 1, 0 }, { 1, 1, 1 }, { 1, 1, 2 }, { 1, 2, 0 },
83c16f531a90 Hardcode the table for ungrouping 3 values in 5 bits. It will be reused by
jbr
parents: 7470
diff changeset
40 { 1, 2, 1 }, { 1, 2, 2 }, { 2, 0, 0 }, { 2, 0, 1 },
83c16f531a90 Hardcode the table for ungrouping 3 values in 5 bits. It will be reused by
jbr
parents: 7470
diff changeset
41 { 2, 0, 2 }, { 2, 1, 0 }, { 2, 1, 1 }, { 2, 1, 2 },
83c16f531a90 Hardcode the table for ungrouping 3 values in 5 bits. It will be reused by
jbr
parents: 7470
diff changeset
42 { 2, 2, 0 }, { 2, 2, 1 }, { 2, 2, 2 }, { 3, 0, 0 },
83c16f531a90 Hardcode the table for ungrouping 3 values in 5 bits. It will be reused by
jbr
parents: 7470
diff changeset
43 { 3, 0, 1 }, { 3, 0, 2 }, { 3, 1, 0 }, { 3, 1, 1 }
83c16f531a90 Hardcode the table for ungrouping 3 values in 5 bits. It will be reused by
jbr
parents: 7470
diff changeset
44 };
83c16f531a90 Hardcode the table for ungrouping 3 values in 5 bits. It will be reused by
jbr
parents: 7470
diff changeset
45
9980
ac31ff44d1a5 cosmetics: Reorder some tables/lines to make future diffs smaller.
diego
parents: 9978
diff changeset
46 /**
ac31ff44d1a5 cosmetics: Reorder some tables/lines to make future diffs smaller.
diego
parents: 9978
diff changeset
47 * Table of bin locations for rematrixing bands
ac31ff44d1a5 cosmetics: Reorder some tables/lines to make future diffs smaller.
diego
parents: 9978
diff changeset
48 * reference: Section 7.5.2 Rematrixing : Frequency Band Definitions
ac31ff44d1a5 cosmetics: Reorder some tables/lines to make future diffs smaller.
diego
parents: 9978
diff changeset
49 */
ac31ff44d1a5 cosmetics: Reorder some tables/lines to make future diffs smaller.
diego
parents: 9978
diff changeset
50 const uint8_t ff_ac3_rematrix_band_tab[5] = { 13, 25, 37, 61, 253 };
ac31ff44d1a5 cosmetics: Reorder some tables/lines to make future diffs smaller.
diego
parents: 9978
diff changeset
51
7032
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
52 const uint8_t ff_eac3_hebap_tab[64] = {
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
53 0, 1, 2, 3, 4, 5, 6, 7, 8, 8,
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
54 8, 8, 9, 9, 9, 10, 10, 10, 10, 11,
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
55 11, 11, 11, 12, 12, 12, 12, 13, 13, 13,
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
56 13, 14, 14, 14, 14, 15, 15, 15, 15, 16,
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
57 16, 16, 16, 17, 17, 17, 17, 18, 18, 18,
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
58 18, 18, 18, 18, 18, 19, 19, 19, 19, 19,
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
59 19, 19, 19, 19,
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
60 };
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
61
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
62 /**
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
63 * Table E2.16 Default Coupling Banding Structure
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
64 */
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
65 const uint8_t ff_eac3_default_cpl_band_struct[18] =
784a2b575226 add ac3dec_data.[c,h]
jbr
parents:
diff changeset
66 { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1 };
11559
444f4b594fdb Add spectral extension to the E-AC-3 decoder.
cehoyos
parents: 9983
diff changeset
67
444f4b594fdb Add spectral extension to the E-AC-3 decoder.
cehoyos
parents: 9983
diff changeset
68 /**
444f4b594fdb Add spectral extension to the E-AC-3 decoder.
cehoyos
parents: 9983
diff changeset
69 * Table E2.15 Default Spectral Extension Banding Structure
444f4b594fdb Add spectral extension to the E-AC-3 decoder.
cehoyos
parents: 9983
diff changeset
70 */
444f4b594fdb Add spectral extension to the E-AC-3 decoder.
cehoyos
parents: 9983
diff changeset
71 const uint8_t ff_eac3_default_spx_band_struct[17] =
444f4b594fdb Add spectral extension to the E-AC-3 decoder.
cehoyos
parents: 9983
diff changeset
72 { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1 };