30#define MAX_FORMATS 1000
37#define AV_READ_TIME(x) 0
44 void *fmt_opaque =
NULL;
59 "Failure of %s probing code with score=%d type=%d p=%X size=%d\n",
72 void *fmt_opaque =
NULL;
78 fprintf(stderr,
"%12"PRIu64
" cycles, %12s\n",
90 ret = strtol(
arg, &
arg, 0);
96int main(
int argc,
char **argv)
102 int retry_count= 4097;
103 int max_size = 65537;
106 for (j =
i = 1;
i<argc;
i++) {
109 }
else if (
read_int(argv[
i])>0 && j == 1) {
112 }
else if (
read_int(argv[
i])>0 && j == 2) {
116 fprintf(stderr,
"probetest [-f <input format>] [<retry_count> [<max_size>]]\n");
121 if (max_size > 1000000000U/8) {
122 fprintf(stderr,
"max_size out of bounds\n");
126 if (retry_count > 1000000000U) {
127 fprintf(stderr,
"retry_count out of bounds\n");
140 fprintf(stderr,
"out of memory\n");
146 fprintf(stderr,
"testing size=%d\n",
size);
148 for (retry = 0; retry < retry_count; retry +=
FFMAX(
size, 32)) {
150 for (p = 0; p < 4096; p++) {
159 for (
i = 0;
i <
size * 8;
i++) {
160 unsigned int p2 = hist ? p & 0x3F : (p >> 6);
167 for (
i = 0;
i <
size * 8;
i++) {
168 unsigned int p2 = (p >> (hist * 3)) & 7;
171 hist = (2 * hist + v) & 3;
179 if (
c >=
'a' &&
c <=
'z' && (p & 1))
181 else if (
c >=
'A' &&
c <=
'Z' && (p & 2))
183 else if (
c >=
'0' &&
c <=
'9' && (p & 4))
185 else if (
c ==
' ' && (p & 8))
187 else if (
c == 0 && (p & 16))
189 else if (
c == 1 && (p & 32))
#define i(width, name, range_min, range_max)
static int read_probe(const AVProbeData *p)
static const FFInputFormat * ffifmt(const AVInputFormat *fmt)
static struct @346255127015250356166251341105367306144006377143 state
const AVInputFormat * av_demuxer_iterate(void **opaque)
Iterate over all registered demuxers.
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
av_cold void av_lfg_init(AVLFG *c, unsigned int seed)
static unsigned int av_lfg_get(AVLFG *c)
Get the next random unsigned 32-bit number using an ALFG.
Memory handling functions.
static const char * single_format
static void print_times(void)
static int64_t time_array[MAX_FORMATS]
static void probe(AVProbeData *pd, int type, int p, int size)
static int read_int(char *arg)
static int score_array[MAX_FORMATS]
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
Context structure for the Lagged Fibonacci PRNG.
This structure contains the data a format has to probe a file.
int buf_size
Size of buf except extra allocated bytes.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
high precision timer, useful to profile code