blob: f3d70fbe31cf544e3ae9691997fcbc69d82346c4
1 | /* |
2 | * AAC encoder data |
3 | * Copyright (c) 2015 Rostislav Pehlivanov ( atomnuker gmail com ) |
4 | * |
5 | * This file is part of FFmpeg. |
6 | * |
7 | * FFmpeg is free software; you can redistribute it and/or |
8 | * modify it under the terms of the GNU Lesser General Public |
9 | * License as published by the Free Software Foundation; either |
10 | * version 2.1 of the License, or (at your option) any later version. |
11 | * |
12 | * FFmpeg is distributed in the hope that it will be useful, |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 | * Lesser General Public License for more details. |
16 | * |
17 | * You should have received a copy of the GNU Lesser General Public |
18 | * License along with FFmpeg; if not, write to the Free Software |
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
20 | */ |
21 | |
22 | #include "aacenctab.h" |
23 | |
24 | static const uint8_t swb_size_128_96[] = { |
25 | 4, 4, 4, 4, 4, 4, 8, 8, 8, 16, 28, 36 |
26 | }; |
27 | |
28 | static const uint8_t swb_size_128_64[] = { |
29 | 4, 4, 4, 4, 4, 4, 8, 8, 8, 16, 28, 36 |
30 | }; |
31 | |
32 | static const uint8_t swb_size_128_48[] = { |
33 | 4, 4, 4, 4, 4, 8, 8, 8, 12, 12, 12, 16, 16, 16 |
34 | }; |
35 | |
36 | static const uint8_t swb_size_128_24[] = { |
37 | 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 12, 12, 16, 16, 20 |
38 | }; |
39 | |
40 | static const uint8_t swb_size_128_16[] = { |
41 | 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 12, 12, 16, 20, 20 |
42 | }; |
43 | |
44 | static const uint8_t swb_size_128_8[] = { |
45 | 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 12, 16, 20, 20 |
46 | }; |
47 | |
48 | static const uint8_t swb_size_1024_96[] = { |
49 | 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, |
50 | 12, 12, 12, 12, 12, 16, 16, 24, 28, 36, 44, |
51 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 |
52 | }; |
53 | |
54 | static const uint8_t swb_size_1024_64[] = { |
55 | 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, |
56 | 12, 12, 12, 16, 16, 16, 20, 24, 24, 28, 36, |
57 | 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40 |
58 | }; |
59 | |
60 | static const uint8_t swb_size_1024_48[] = { |
61 | 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, |
62 | 12, 12, 12, 12, 16, 16, 20, 20, 24, 24, 28, 28, |
63 | 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, |
64 | 96 |
65 | }; |
66 | |
67 | static const uint8_t swb_size_1024_32[] = { |
68 | 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, |
69 | 12, 12, 12, 12, 16, 16, 20, 20, 24, 24, 28, 28, |
70 | 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32 |
71 | }; |
72 | |
73 | static const uint8_t swb_size_1024_24[] = { |
74 | 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, |
75 | 12, 12, 12, 12, 16, 16, 16, 20, 20, 24, 24, 28, 28, |
76 | 32, 36, 36, 40, 44, 48, 52, 52, 64, 64, 64, 64, 64 |
77 | }; |
78 | |
79 | static const uint8_t swb_size_1024_16[] = { |
80 | 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, |
81 | 12, 12, 12, 12, 12, 12, 12, 12, 12, 16, 16, 16, 16, 20, 20, 20, 24, 24, 28, 28, |
82 | 32, 36, 40, 40, 44, 48, 52, 56, 60, 64, 64, 64 |
83 | }; |
84 | |
85 | static const uint8_t swb_size_1024_8[] = { |
86 | 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, |
87 | 16, 16, 16, 16, 16, 16, 16, 20, 20, 20, 20, 24, 24, 24, 28, 28, |
88 | 32, 36, 36, 40, 44, 48, 52, 56, 60, 64, 80 |
89 | }; |
90 | |
91 | const uint8_t *ff_aac_swb_size_128[] = { |
92 | swb_size_128_96, swb_size_128_96, swb_size_128_64, |
93 | swb_size_128_48, swb_size_128_48, swb_size_128_48, |
94 | swb_size_128_24, swb_size_128_24, swb_size_128_16, |
95 | swb_size_128_16, swb_size_128_16, swb_size_128_8, |
96 | swb_size_128_8 |
97 | }; |
98 | |
99 | const uint8_t *ff_aac_swb_size_1024[] = { |
100 | swb_size_1024_96, swb_size_1024_96, swb_size_1024_64, |
101 | swb_size_1024_48, swb_size_1024_48, swb_size_1024_32, |
102 | swb_size_1024_24, swb_size_1024_24, swb_size_1024_16, |
103 | swb_size_1024_16, swb_size_1024_16, swb_size_1024_8, |
104 | swb_size_1024_8 |
105 | }; |
106 | |
107 | const int ff_aac_swb_size_128_len = FF_ARRAY_ELEMS(ff_aac_swb_size_128); |
108 | const int ff_aac_swb_size_1024_len = FF_ARRAY_ELEMS(ff_aac_swb_size_1024); |
109 |