summaryrefslogtreecommitdiff
path: root/libavcodec/mpegaudio_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/mpegaudio_tablegen.c
parentac014798ff719c69a895aff0189a794ed9046554 (diff)
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/mpegaudio_tablegen.c')
-rw-r--r--libavcodec/mpegaudio_tablegen.c29
1 files changed, 6 insertions, 23 deletions
diff --git a/libavcodec/mpegaudio_tablegen.c b/libavcodec/mpegaudio_tablegen.c
index 57e239c166..0888e78620 100644
--- a/libavcodec/mpegaudio_tablegen.c
+++ b/libavcodec/mpegaudio_tablegen.c
@@ -31,29 +31,12 @@ int main(void)
write_fileheader();
- printf("static const int8_t table_4_3_exp[TABLE_4_3_SIZE] = {\n");
- write_int8_t_array(table_4_3_exp, TABLE_4_3_SIZE);
- printf("};\n");
-
- printf("static const uint32_t table_4_3_value[TABLE_4_3_SIZE] = {\n");
- write_uint32_t_array(table_4_3_value, TABLE_4_3_SIZE);
- printf("};\n");
-
- printf("static const uint32_t exp_table[512] = {\n");
- write_uint32_t_array(exp_table, 512);
- printf("};\n");
-
- printf("static const float exp_table_float[512] = {\n");
- write_float_array(exp_table_float, 512);
- printf("};\n");
-
- printf("static const uint32_t expval_table[512][16] = {\n");
- write_uint32_t_2d_array(expval_table, 512, 16);
- printf("};\n");
-
- printf("static const float expval_table_float[512][16] = {\n");
- write_float_2d_array(expval_table_float, 512, 16);
- printf("};\n");
+ WRITE_ARRAY("static const", int8_t, table_4_3_exp);
+ WRITE_ARRAY("static const", uint32_t, table_4_3_value);
+ WRITE_ARRAY("static const", uint32_t, exp_table);
+ WRITE_ARRAY("static const", float, exp_table_float);
+ WRITE_2D_ARRAY("static const", uint32_t, expval_table);
+ WRITE_2D_ARRAY("static const", float, expval_table_float);
return 0;
}