00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef AVCODEC_TABLEPRINT_H
00024 #define AVCODEC_TABLEPRINT_H
00025
00026 #include <stdint.h>
00027 #include <stdio.h>
00028
00029 #define WRITE_1D_FUNC_ARGV(name, type, linebrk, fmtstr, ...)\
00030 void write_##name##_array(const type *data, int len)\
00031 {\
00032 int i;\
00033 printf(" ");\
00034 for (i = 0; i < len - 1; i++) {\
00035 printf(" "fmtstr",", __VA_ARGS__);\
00036 if ((i & linebrk) == linebrk) printf("\n ");\
00037 }\
00038 printf(" "fmtstr"\n", __VA_ARGS__);\
00039 }
00040
00041 #define WRITE_1D_FUNC(name, type, fmtstr, linebrk)\
00042 WRITE_1D_FUNC_ARGV(name, type, linebrk, fmtstr, data[i])
00043
00044 #define WRITE_2D_FUNC(name, type)\
00045 void write_##name##_2d_array(const void *arg, int len, int len2)\
00046 {\
00047 const type *data = arg;\
00048 int i;\
00049 printf(" {\n");\
00050 for (i = 0; i < len; i++) {\
00051 write_##name##_array(data + i * len2, len2);\
00052 printf(i == len - 1 ? " }\n" : " }, {\n");\
00053 }\
00054 }
00055
00061 void write_int8_array (const int8_t *, int);
00062 void write_uint8_array (const uint8_t *, int);
00063 void write_uint16_array (const uint16_t *, int);
00064 void write_uint32_array (const uint32_t *, int);
00065 void write_float_array (const float *, int);
00066 void write_int8_2d_array (const void *, int, int);
00067 void write_uint8_2d_array (const void *, int, int);
00068 void write_uint32_2d_array(const void *, int, int);
00069 void write_float_2d_array (const void *, int, int);
00071
00073 void write_fileheader(void);
00074
00075 #endif