Go to the documentation of this file.
22 #define ASSERT_LEVEL 2
32 #define BITSTREAM_WRITER_LE
51 int main(
int argc,
char **argv)
67 random_seed = strtoul(argv[1],
NULL, 0);
71 fprintf(stderr,
"Testing with LFG seed: %"PRIu32
"\n", random_seed);
74 for (
unsigned i = 0;
i <
SIZE;
i++)
91 fprintf(stderr,
"%d read %u: %"PRIu64
"\n",
bits_tell(&bc) - count, count,
val);
99 count =
FFMAX(count, 1);
103 fprintf(stderr,
"%d read_nz %u: %"PRIu64
"\n",
bits_tell(&bc) - count, count,
val);
112 fprintf(stderr,
"%d read_bit: %"PRIu64
"\n",
bits_tell(&bc) - 1,
val);
120 fprintf(stderr,
"%d read_63 %u: %"PRIu64
"\n",
bits_tell(&bc) - count, count,
val);
128 fprintf(stderr,
"%d read_64 %u: %"PRIu64
"\n",
bits_tell(&bc) - count, count,
val);
137 fprintf(stderr,
"%d read_signed %u: %"PRId32
"\n",
bits_tell(&bc) - count, count, sval);
146 count =
FFMAX(count, 1);
150 fprintf(stderr,
"%d read_signed_nz %u: %"PRId32
"\n",
bits_tell(&bc) - count, count, sval);
160 fprintf(stderr,
"%d align %u\n",
bits_tell(&bc), count);
170 count =
FFMAX(count, 1);
178 fprintf(stderr,
"%d apply_sign %u %"PRId32
"\n",
179 bits_tell(&bc) - count - 1, count, sval);
192 for (
unsigned i = 0;
i <
SIZE;
i++)
193 if (buf[
i] != dst[
i]) {
194 fprintf(stderr,
"Mismatch at byte %u: %hhu %hhu; seed %"PRIu32
"\n",
195 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.
#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)