FFmpeg
Macros | Functions
tableprint.h File Reference
#include <inttypes.h>
#include <stdio.h>
#include "libavutil/common.h"

Go to the source code of this file.

Macros

#define WRITE_1D_FUNC_ARGV(type, linebrk, fmtstr, ...)
 
#define WRITE_1D_FUNC(type, fmtstr, linebrk)   WRITE_1D_FUNC_ARGV(type, linebrk, fmtstr, data[i])
 
#define WRITE_2D_FUNC(type)
 
#define FMT   "zu"
 
#define WRITE_ARRAY_ALIGNED(prefix, align, type, name)
 
#define WRITE_ARRAY(prefix, type, name)
 
#define WRITE_2D_ARRAY(prefix, type, name)
 

Functions

static void write_fileheader (void)
 
Predefined functions for printing tables
void write_int8_t_array (const int8_t *, int)
 
void write_uint8_t_array (const uint8_t *, int)
 
void write_uint16_t_array (const uint16_t *, int)
 
void write_uint32_t_array (const uint32_t *, int)
 
void write_int32_t_array (const int32_t *, int)
 
void write_float_array (const float *, int)
 
void write_int8_t_2d_array (const void *, int, int)
 
void write_uint8_t_2d_array (const void *, int, int)
 
void write_uint32_t_2d_array (const void *, int, int)
 
void write_float_2d_array (const void *, int, int)
 

Macro Definition Documentation

◆ WRITE_1D_FUNC_ARGV

#define WRITE_1D_FUNC_ARGV (   type,
  linebrk,
  fmtstr,
  ... 
)
Value:
void write_##type##_array(const type *data, int len)\
{\
int i;\
printf(" ");\
for (i = 0; i < len - 1; i++) {\
printf(" "fmtstr",", __VA_ARGS__);\
if ((i & linebrk) == linebrk) printf("\n ");\
}\
printf(" "fmtstr"\n", __VA_ARGS__);\
}

Definition at line 31 of file tableprint.h.

◆ WRITE_1D_FUNC

#define WRITE_1D_FUNC (   type,
  fmtstr,
  linebrk 
)    WRITE_1D_FUNC_ARGV(type, linebrk, fmtstr, data[i])

Definition at line 43 of file tableprint.h.

◆ WRITE_2D_FUNC

#define WRITE_2D_FUNC (   type)
Value:
void write_##type##_2d_array(const void *arg, int len, int len2)\
{\
const type *data = arg;\
int i;\
printf(" {\n");\
for (i = 0; i < len; i++) {\
write_##type##_array(data + i * len2, len2);\
printf(i == len - 1 ? " }\n" : " }, {\n");\
}\
}

Definition at line 46 of file tableprint.h.

◆ FMT

#define FMT   "zu"

Definition at line 82 of file tableprint.h.

◆ WRITE_ARRAY_ALIGNED

#define WRITE_ARRAY_ALIGNED (   prefix,
  align,
  type,
  name 
)
Value:
do { \
const size_t array_size = FF_ARRAY_ELEMS(name); \
printf(prefix" DECLARE_ALIGNED("#align", " \
#type", "#name")[%"FMT"] = {\n", \
array_size); \
write_##type##_array(name, array_size); \
printf("};\n"); \
} while(0)

Definition at line 85 of file tableprint.h.

◆ WRITE_ARRAY

#define WRITE_ARRAY (   prefix,
  type,
  name 
)
Value:
do { \
const size_t array_size = FF_ARRAY_ELEMS(name); \
printf(prefix" "#type" "#name"[%"FMT"] = {\n", \
array_size); \
write_##type##_array(name, array_size); \
printf("};\n"); \
} while(0)

Definition at line 95 of file tableprint.h.

◆ WRITE_2D_ARRAY

#define WRITE_2D_ARRAY (   prefix,
  type,
  name 
)
Value:
do { \
const size_t array_size1 = FF_ARRAY_ELEMS(name); \
const size_t array_size2 = FF_ARRAY_ELEMS(name[0]); \
printf(prefix" "#type" "#name"[%"FMT"][%"FMT"] = {\n", \
array_size1, array_size2 ); \
write_##type##_2d_array(name, array_size1, array_size2); \
printf("};\n"); \
} while(0)

Definition at line 104 of file tableprint.h.

Function Documentation

◆ write_int8_t_array()

void write_int8_t_array ( const int8_t *  ,
int   
)

◆ write_uint8_t_array()

void write_uint8_t_array ( const uint8_t *  ,
int   
)

◆ write_uint16_t_array()

void write_uint16_t_array ( const uint16_t *  ,
int   
)

◆ write_uint32_t_array()

void write_uint32_t_array ( const uint32_t *  ,
int   
)

◆ write_int32_t_array()

void write_int32_t_array ( const int32_t ,
int   
)

◆ write_float_array()

void write_float_array ( const float ,
int   
)

Referenced by main().

◆ write_int8_t_2d_array()

void write_int8_t_2d_array ( const void *  ,
int  ,
int   
)

Referenced by main().

◆ write_uint8_t_2d_array()

void write_uint8_t_2d_array ( const void *  ,
int  ,
int   
)

◆ write_uint32_t_2d_array()

void write_uint32_t_2d_array ( const void *  ,
int  ,
int   
)

◆ write_float_2d_array()

void write_float_2d_array ( const void *  ,
int  ,
int   
)

◆ write_fileheader()

static void write_fileheader ( void  )
inlinestatic

Definition at line 128 of file tableprint.h.

name
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
Definition: writing_filters.txt:88
data
const char data[16]
Definition: mxf.c:143
type
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
Definition: writing_filters.txt:86
FF_ARRAY_ELEMS
#define FF_ARRAY_ELEMS(a)
Definition: sinewin_tablegen.c:29
FMT
#define FMT
Definition: tableprint.h:82
arg
const char * arg
Definition: jacosubdec.c:67
printf
printf("static const uint8_t my_array[100] = {\n")
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:269
len
int len
Definition: vorbis_enc_data.h:426