Go to the documentation of this file.
29 #define MAX_FORMATS 1000 //this must be larger than the number of formats
36 #define AV_READ_TIME(x) 0
43 void *fmt_opaque =
NULL;
58 "Failure of %s probing code with score=%d type=%d p=%X size=%d\n",
71 void *fmt_opaque =
NULL;
77 fprintf(stderr,
"%12"PRIu64
" cycles, %12s\n",
95 int main(
int argc,
char **argv)
101 int retry_count= 4097;
102 int max_size = 65537;
105 for (j =
i = 1;
i<argc;
i++) {
108 }
else if (
read_int(argv[
i])>0 && j == 1) {
111 }
else if (
read_int(argv[
i])>0 && j == 2) {
115 fprintf(stderr,
"probetest [-f <input format>] [<retry_count> [<max_size>]]\n");
120 if (max_size > 1000000000
U/8) {
121 fprintf(stderr,
"max_size out of bounds\n");
125 if (retry_count > 1000000000
U) {
126 fprintf(stderr,
"retry_count out of bounds\n");
139 fprintf(stderr,
"out of memory\n");
145 fprintf(stderr,
"testing size=%d\n",
size);
147 for (retry = 0; retry < retry_count; retry +=
FFMAX(
size, 32)) {
149 for (p = 0; p < 4096; p++) {
158 for (
i = 0;
i <
size * 8;
i++) {
159 unsigned int p2 = hist ? p & 0x3F : (p >> 6);
166 for (
i = 0;
i <
size * 8;
i++) {
167 unsigned int p2 = (p >> (hist * 3)) & 7;
170 hist = (2 * hist + v) & 3;
178 if (
c >=
'a' &&
c <=
'z' && (p & 1))
180 else if (
c >=
'A' &&
c <=
'Z' && (p & 2))
182 else if (
c >=
'0' &&
c <=
'9' && (p & 4))
184 else if (
c ==
' ' && (p & 8))
186 else if (
c == 0 && (p & 16))
188 else if (
c == 1 && (p & 32))
av_cold void av_lfg_init(AVLFG *c, unsigned int seed)
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
int main(int argc, char **argv)
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
int buf_size
Size of buf except extra allocated bytes.
static int score_array[MAX_FORMATS]
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
static unsigned int av_lfg_get(AVLFG *c)
Get the next random unsigned 32-bit number using an ALFG.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
static int read_int(char *arg)
static int64_t time_array[MAX_FORMATS]
This structure contains the data a format has to probe a file.
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Context structure for the Lagged Fibonacci PRNG.
const AVInputFormat * av_demuxer_iterate(void **opaque)
Iterate over all registered demuxers.
#define i(width, name, range_min, range_max)
static const char * single_format
static const FFInputFormat * ffifmt(const AVInputFormat *fmt)
static int read_probe(const AVProbeData *p)
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
static void print_times(void)
static void probe(AVProbeData *pd, int type, int p, int size)
void * av_realloc(void *ptr, size_t size)
Allocate, reallocate, or free a block of memory.