comparison mpegaudio_tablegen.c @ 11570:e03e3df6fb7d libavcodec

Change/simplify the tableprint/tablegen API.
author reimar
date Thu, 01 Apr 2010 17:11:47 +0000
parents 23ca6d60184d
children a0f514fb84d6
comparison
equal deleted inserted replaced
11569:731050abce41 11570:e03e3df6fb7d
23 #include <stdlib.h> 23 #include <stdlib.h>
24 #define CONFIG_HARDCODED_TABLES 0 24 #define CONFIG_HARDCODED_TABLES 0
25 #include "mpegaudio_tablegen.h" 25 #include "mpegaudio_tablegen.h"
26 #include "tableprint.h" 26 #include "tableprint.h"
27 27
28 void tableinit(void) 28 int main(void)
29 { 29 {
30 mpegaudio_tableinit(); 30 mpegaudio_tableinit();
31
32 write_fileheader();
33
34 printf("static const int8_t table_4_3_exp[TABLE_4_3_SIZE] = {\n");
35 write_int8_array(table_4_3_exp, TABLE_4_3_SIZE);
36 printf("};\n");
37
38 printf("static const uint32_t table_4_3_value[TABLE_4_3_SIZE] = {\n");
39 write_uint32_array(table_4_3_value, TABLE_4_3_SIZE);
40 printf("};\n");
41
42 printf("static const uint32_t exp_table[512] = {\n");
43 write_uint32_array(exp_table, 512);
44 printf("};\n");
45
46 printf("static const uint32_t expval_table[512][16] = {\n");
47 write_uint32_2d_array(expval_table, 512, 16);
48 printf("};\n");
49
50 return 0;
31 } 51 }
32
33 const struct tabledef tables[] = {
34 {
35 "static const int8_t table_4_3_exp[TABLE_4_3_SIZE]",
36 write_int8_array,
37 table_4_3_exp,
38 TABLE_4_3_SIZE
39 },
40 {
41 "static const uint32_t table_4_3_value[TABLE_4_3_SIZE]",
42 write_uint32_array,
43 table_4_3_value,
44 TABLE_4_3_SIZE
45 },
46 {
47 "static const uint32_t exp_table[512]",
48 write_uint32_array,
49 exp_table,
50 512
51 },
52 {
53 "static const uint32_t expval_table[512][16]",
54 write_uint32_2d_array,
55 expval_table,
56 512,
57 16
58 },
59 { NULL }
60 };