Go to the documentation of this file.
22 #define ASSERT_LEVEL 2
32 #define BITSTREAM_WRITER_LE
51 int main(
int argc,
char **argv)
68 random_seed = strtoul(argv[1],
NULL, 0);
72 fprintf(stderr,
"Testing with LFG seed: %"PRIu32
"\n", random_seed);
75 for (
unsigned i = 0;
i <
SIZE;
i++)
93 fprintf(stderr,
"%d read %u: %"PRIu64
"\n",
bits_tell(&bc) - count, count,
val);
101 count =
FFMAX(count, 1);
105 fprintf(stderr,
"%d read_nz %u: %"PRIu64
"\n",
bits_tell(&bc) - count, count,
val);
114 fprintf(stderr,
"%d read_bit: %"PRIu64
"\n",
bits_tell(&bc) - 1,
val);
122 fprintf(stderr,
"%d read_63 %u: %"PRIu64
"\n",
bits_tell(&bc) - count, count,
val);
130 fprintf(stderr,
"%d read_64 %u: %"PRIu64
"\n",
bits_tell(&bc) - count, count,
val);
139 fprintf(stderr,
"%d read_signed %u: %"PRId32
"\n",
bits_tell(&bc) - count, count, sval);
148 count =
FFMAX(count, 1);
152 fprintf(stderr,
"%d read_signed_nz %u: %"PRId32
"\n",
bits_tell(&bc) - count, count, sval);
162 fprintf(stderr,
"%d align %u\n",
bits_tell(&bc), count);
172 count =
FFMAX(count, 1);
180 fprintf(stderr,
"%d apply_sign %u %"PRId32
"\n",
181 bits_tell(&bc) - count - 1, count, sval);
194 for (
unsigned i = 0;
i <
SIZE;
i++)
195 if (buf[
i] !=
dst[
i]) {
196 fprintf(stderr,
"Mismatch at byte %u: %hhu %hhu; seed %"PRIu32
"\n",
197 i, buf[
i],
dst[
i], random_seed);
static void av_unused put_bits32(PutBitContext *s, uint32_t value)
Write exactly 32 bits into a bitstream.
av_cold void av_lfg_init(AVLFG *c, unsigned int seed)
static void put_sbits(PutBitContext *pb, int n, int32_t value)
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
#define bits_read_signed_nz
static void put_bits64(PutBitContext *s, int n, uint64_t value)
Write up to 64 bits into a bitstream.
#define bits_peek_signed_nz
uint32_t av_get_random_seed(void)
Get a seed to use in conjunction with random functions.
static double val(void *priv, double ch)
static unsigned int av_lfg_get(AVLFG *c)
Get the next random unsigned 32-bit number using an ALFG.
static int op(uint8_t **dst, const uint8_t *dst_end, GetByteContext *gb, int pixel, int count, int *x, int width, int linesize)
Perform decode operation.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
Context structure for the Lagged Fibonacci PRNG.
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
#define i(width, name, range_min, range_max)
#define AV_INPUT_BUFFER_PADDING_SIZE
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
int main(int argc, char **argv)