annotate mpegaudio_tablegen.c @ 11050:170c9ce34d14 libavcodec

vp56: check buffer size to fix a potential segfault patch by Laurent Aimar fenrir _at_ videolan _dot_ org
author aurel
date Thu, 28 Jan 2010 23:49:46 +0000
parents 23ca6d60184d
children e03e3df6fb7d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10469
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
1 /*
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
2 * Generate a header file for hardcoded mpegaudiodec tables
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
3 *
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
4 * Copyright (c) 2009 Reimar Döffinger <Reimar.Doeffinger@gmx.de>
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
5 *
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
6 * This file is part of FFmpeg.
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
7 *
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
8 * FFmpeg is free software; you can redistribute it and/or
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
9 * modify it under the terms of the GNU Lesser General Public
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
10 * License as published by the Free Software Foundation; either
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
11 * version 2.1 of the License, or (at your option) any later version.
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
12 *
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
13 * FFmpeg is distributed in the hope that it will be useful,
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
16 * Lesser General Public License for more details.
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
17 *
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
18 * You should have received a copy of the GNU Lesser General Public
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
19 * License along with FFmpeg; if not, write to the Free Software
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
21 */
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
22
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
23 #include <stdlib.h>
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
24 #define CONFIG_HARDCODED_TABLES 0
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
25 #include "mpegaudio_tablegen.h"
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
26 #include "tableprint.h"
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
27
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
28 void tableinit(void)
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
29 {
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
30 mpegaudio_tableinit();
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
31 }
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
32
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
33 const struct tabledef tables[] = {
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
34 {
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
35 "static const int8_t table_4_3_exp[TABLE_4_3_SIZE]",
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
36 write_int8_array,
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
37 table_4_3_exp,
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
38 TABLE_4_3_SIZE
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
39 },
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
40 {
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
41 "static const uint32_t table_4_3_value[TABLE_4_3_SIZE]",
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
42 write_uint32_array,
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
43 table_4_3_value,
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
44 TABLE_4_3_SIZE
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
45 },
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
46 {
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
47 "static const uint32_t exp_table[512]",
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
48 write_uint32_array,
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
49 exp_table,
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
50 512
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
51 },
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
52 {
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
53 "static const uint32_t expval_table[512][16]",
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
54 write_uint32_2d_array,
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
55 expval_table,
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
56 512,
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
57 16
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
58 },
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
59 { NULL }
23ca6d60184d Add support for hardcoding the mpegaudiodec tables.
reimar
parents:
diff changeset
60 };