diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2010-03-14 19:30:25 +0000 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2010-03-14 19:30:25 +0000 |
commit | 062777b3436cb51c7e4908b54dc899c0a42518f7 (patch) | |
tree | e61c7c81ec759649dffea3591283747bb1f6bdbd /libavcodec/qdm2_tablegen.c | |
parent | 108d262c5614bd4e8113dc24b1a9c29d8c3cd6d7 (diff) | |
download | ffmpeg-062777b3436cb51c7e4908b54dc899c0a42518f7.tar.gz |
Allow hard-coding several QDM2 tables (about 32 kB size).
Originally committed as revision 22525 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/qdm2_tablegen.c')
-rw-r--r-- | libavcodec/qdm2_tablegen.c | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/libavcodec/qdm2_tablegen.c b/libavcodec/qdm2_tablegen.c new file mode 100644 index 0000000000..b311e7f4db --- /dev/null +++ b/libavcodec/qdm2_tablegen.c @@ -0,0 +1,73 @@ +/* + * Generate a header file for hardcoded QDM2 tables + * + * Copyright (c) 2010 Reimar Döffinger <Reimar.Doeffinger@gmx.de> + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * 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. + * + * FFmpeg is distributed in the hope that it will be useful, + * 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 + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <stdlib.h> +#define av_cold +#define CONFIG_HARDCODED_TABLES 0 +#include "qdm2_tablegen.h" +#include "tableprint.h" + +void tableinit(void) +{ + softclip_table_init(); + rnd_table_init(); + init_noise_samples(); +} + +const struct tabledef tables[] = { + { + "static const uint16_t softclip_table[HARDCLIP_THRESHOLD - SOFTCLIP_THRESHOLD + 1]", + write_uint16_array, + softclip_table, + HARDCLIP_THRESHOLD - SOFTCLIP_THRESHOLD + 1, + 0 + }, + { + "static const float noise_table[4096]", + write_float_array, + noise_table, + 4096, + 0 + }, + { + "static const uint8_t random_dequant_index[256][5]", + write_uint8_2d_array, + random_dequant_index, + 256, + 5 + }, + { + "static const uint8_t random_dequant_type24[128][3]", + write_uint8_2d_array, + random_dequant_type24, + 128, + 3 + }, + { + "static const float noise_samples[128]", + write_float_array, + noise_samples, + 128, + 0 + }, + { NULL } +}; |