summaryrefslogtreecommitdiff
path: root/libavcodec/qdm2_tablegen.c
diff options
context:
space:
mode:
authorDiego Pettenò <flameeyes@gmail.com>2010-06-27 12:21:12 +0000
committerDiego Pettenò <flameeyes@gmail.com>2010-06-27 12:21:12 +0000
commit350120d269033f4cc206850b3c81f797ed2cb9c6 (patch)
treef6c92e9142bea1123d8154f75c3f8b17967220ae /libavcodec/qdm2_tablegen.c
parentac014798ff719c69a895aff0189a794ed9046554 (diff)
downloadffmpeg-350120d269033f4cc206850b3c81f797ed2cb9c6.tar.gz
tablegen: implement and use WRITE_ARRAY macros
Two macros (WRITE_ARRAY and WRITE_ARRAY_2D) take the prefix (modifiers) (not all tables are static, and they might not be constant either), the type, and the name of the array. It'll be copied with same name and type, and with the correct size of the currently-defined object. Originally committed as revision 23821 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/qdm2_tablegen.c')
-rw-r--r--libavcodec/qdm2_tablegen.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/libavcodec/qdm2_tablegen.c b/libavcodec/qdm2_tablegen.c
index d11599b6dd..a7a9fb6643 100644
--- a/libavcodec/qdm2_tablegen.c
+++ b/libavcodec/qdm2_tablegen.c
@@ -33,25 +33,12 @@ int main(void)
write_fileheader();
- printf("static const uint16_t softclip_table[HARDCLIP_THRESHOLD - SOFTCLIP_THRESHOLD + 1] = {\n");
- write_uint16_t_array(softclip_table, HARDCLIP_THRESHOLD - SOFTCLIP_THRESHOLD + 1);
- printf("};\n");
+ WRITE_ARRAY("static const", uint16_t, softclip_table);
+ WRITE_ARRAY("static const", float, noise_table);
+ WRITE_ARRAY("static const", float, noise_samples);
- printf("static const float noise_table[4096] = {\n");
- write_float_array(noise_table, 4096);
- printf("};\n");
-
- printf("static const uint8_t random_dequant_index[256][5] = {\n");
- write_uint8_t_2d_array(random_dequant_index, 256, 5);
- printf("};\n");
-
- printf("static const uint8_t random_dequant_type24[128][3] = {\n");
- write_uint8_t_2d_array(random_dequant_type24, 128, 3);
- printf("};\n");
-
- printf("static const float noise_samples[128] = {\n");
- write_float_array(noise_samples, 128);
- printf("};\n");
+ WRITE_2D_ARRAY("static const", uint8_t, random_dequant_index);
+ WRITE_2D_ARRAY("static const", uint8_t, random_dequant_type24);
return 0;
}