Mercurial > libavcodec.hg
annotate qdm2_tablegen.c @ 11489:1aba21918874 libavcodec
Allow hard-coding of the 32kB cubic-root table for AAC.
author | reimar |
---|---|
date | Sun, 14 Mar 2010 19:59:47 +0000 |
parents | 424b8482f316 |
children | 8bef88bc329d |
rev | line source |
---|---|
11488
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
1 /* |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
2 * Generate a header file for hardcoded QDM2 tables |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
3 * |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
4 * Copyright (c) 2010 Reimar Döffinger <Reimar.Doeffinger@gmx.de> |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
5 * |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
6 * This file is part of FFmpeg. |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
7 * |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
8 * FFmpeg is free software; you can redistribute it and/or |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
9 * modify it under the terms of the GNU Lesser General Public |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
10 * License as published by the Free Software Foundation; either |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
11 * version 2.1 of the License, or (at your option) any later version. |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
12 * |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
13 * FFmpeg is distributed in the hope that it will be useful, |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
16 * Lesser General Public License for more details. |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
17 * |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
18 * You should have received a copy of the GNU Lesser General Public |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
19 * License along with FFmpeg; if not, write to the Free Software |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
21 */ |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
22 |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
23 #include <stdlib.h> |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
24 #define av_cold |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
25 #define CONFIG_HARDCODED_TABLES 0 |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
26 #include "qdm2_tablegen.h" |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
27 #include "tableprint.h" |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
28 |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
29 void tableinit(void) |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
30 { |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
31 softclip_table_init(); |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
32 rnd_table_init(); |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
33 init_noise_samples(); |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
34 } |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
35 |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
36 const struct tabledef tables[] = { |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
37 { |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
38 "static const uint16_t softclip_table[HARDCLIP_THRESHOLD - SOFTCLIP_THRESHOLD + 1]", |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
39 write_uint16_array, |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
40 softclip_table, |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
41 HARDCLIP_THRESHOLD - SOFTCLIP_THRESHOLD + 1, |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
42 0 |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
43 }, |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
44 { |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
45 "static const float noise_table[4096]", |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
46 write_float_array, |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
47 noise_table, |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
48 4096, |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
49 0 |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
50 }, |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
51 { |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
52 "static const uint8_t random_dequant_index[256][5]", |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
53 write_uint8_2d_array, |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
54 random_dequant_index, |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
55 256, |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
56 5 |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
57 }, |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
58 { |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
59 "static const uint8_t random_dequant_type24[128][3]", |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
60 write_uint8_2d_array, |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
61 random_dequant_type24, |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
62 128, |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
63 3 |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
64 }, |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
65 { |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
66 "static const float noise_samples[128]", |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
67 write_float_array, |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
68 noise_samples, |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
69 128, |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
70 0 |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
71 }, |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
72 { NULL } |
424b8482f316
Allow hard-coding several QDM2 tables (about 32 kB size).
reimar
parents:
diff
changeset
|
73 }; |