comparison dv_tablegen.c @ 11979:59f399926c12 libavcodec

tableprint: use the type name as-is for the functions' names. This drops one parameter from the functions' macros, and require structures to be typedeffed, but ensures that it is possible to map 1-to-1 the type to the function name.
author flameeyes
date Sun, 27 Jun 2010 12:20:39 +0000
parents e03e3df6fb7d
children
comparison
equal deleted inserted replaced
11978:db5c3a602ddd 11979:59f399926c12
27 #endif 27 #endif
28 #include "dv_tablegen.h" 28 #include "dv_tablegen.h"
29 #include "tableprint.h" 29 #include "tableprint.h"
30 #include <inttypes.h> 30 #include <inttypes.h>
31 31
32 WRITE_1D_FUNC_ARGV(vlc_pair, struct dv_vlc_pair, 7, 32 WRITE_1D_FUNC_ARGV(dv_vlc_pair, 7,
33 "{0x%"PRIx32", %"PRId8"}", data[i].vlc, data[i].size) 33 "{0x%"PRIx32", %"PRId8"}", data[i].vlc, data[i].size)
34 WRITE_2D_FUNC(vlc_pair, struct dv_vlc_pair) 34 WRITE_2D_FUNC(dv_vlc_pair)
35 35
36 int main(void) 36 int main(void)
37 { 37 {
38 dv_vlc_map_tableinit(); 38 dv_vlc_map_tableinit();
39 39
40 write_fileheader(); 40 write_fileheader();
41 41
42 printf("static const struct dv_vlc_pair dv_vlc_map[DV_VLC_MAP_RUN_SIZE][DV_VLC_MAP_LEV_SIZE] = {\n"); 42 printf("static const struct dv_vlc_pair dv_vlc_map[DV_VLC_MAP_RUN_SIZE][DV_VLC_MAP_LEV_SIZE] = {\n");
43 write_vlc_pair_2d_array(dv_vlc_map, DV_VLC_MAP_RUN_SIZE, DV_VLC_MAP_LEV_SIZE); 43 write_dv_vlc_pair_2d_array(dv_vlc_map, DV_VLC_MAP_RUN_SIZE, DV_VLC_MAP_LEV_SIZE);
44 printf("};\n"); 44 printf("};\n");
45 45
46 return 0; 46 return 0;
47 } 47 }