Go to the documentation of this file.
30 #ifndef AVCODEC_GOLOMB_H
31 #define AVCODEC_GOLOMB_H
38 #define INVALID_VLC 0x80000000
59 #if CACHED_BITSTREAM_READER
62 if (buf >= (1 << 27)) {
68 int log = 2 *
av_log2(buf) - 31;
80 if (buf >= (1 << 27)) {
87 int log = 2 *
av_log2(buf) - 31;
124 #if CACHED_BITSTREAM_READER
147 #if CACHED_BITSTREAM_READER
150 if (buf & 0xAA800000) {
178 if (buf & 0xAA800000) {
243 #if CACHED_BITSTREAM_READER
246 if (buf >= (1 << 27)) {
252 int log = 2 *
av_log2(buf) - 31;
269 if (buf >= (1 << 27)) {
287 buf = ((buf >> 1) ^ sign) - sign;
297 int sign = (buf & 1) - 1;
298 return ((buf >> 1) ^ sign) + 1;
305 #if CACHED_BITSTREAM_READER
308 if (buf & 0xAA800000) {
318 if ((buf & 0xAAAAAAAA) == 0)
321 for (log = 31; (buf & 0x80000000) == 0; log--)
322 buf = (buf << 2) - ((buf << log) >> (log - 1)) + (buf >> 30);
326 return (
signed) (((((buf << log) >> log) - 1) ^ -(buf & 0x1)) + 1) >> 1;
333 if (buf & 0xAA800000) {
345 if ((buf & 0xAAAAAAAA) == 0)
348 for (log = 31; (buf & 0x80000000) == 0; log--)
349 buf = (buf << 2) - ((buf << log) >> (log - 1)) + (buf >> 30);
354 return (
signed) (((((buf << log) >> log) - 1) ^ -(buf & 0x1)) + 1) >> 1;
365 ret = (
ret ^ sign) - sign;
380 #if CACHED_BITSTREAM_READER
385 if (log > 31 - limit) {
387 buf += (30 - log) << k;
395 return buf + limit - 1;
404 if (log > 31 - limit) {
406 buf += (30
U - log) << k;
420 return buf + limit - 1;
434 #if CACHED_BITSTREAM_READER
439 if (log - k >= 1 && 32 - log < limit) {
441 buf += (30 - log) << k;
454 return buf + (
i << k);
455 }
else if (
i == limit - 1) {
474 buf += (30
U - log) << k;
512 }
else if (
i == limit - 1) {
533 return (v >> 1) ^ -(v & 1);
543 return (v >> 1) ^ -(v & 1);
560 return (uvar >> 1) ^ -(uvar & 1);
610 #define get_ue_golomb(a) get_ue(a, __FILE__, __func__, __LINE__)
611 #define get_se_golomb(a) get_se(a, __FILE__, __func__, __LINE__)
612 #define get_te_golomb(a, r) get_te(a, r, __FILE__, __func__, __LINE__)
613 #define get_te0_golomb(a, r) get_te(a, r, __FILE__, __func__, __LINE__)
685 put_bits(pb, e + k + 1, (1 << k) + av_mod_uintp2(
i, k));
687 put_bits(pb, limit + esc_len,
i - limit + 1);
694 int limit,
int esc_len)
737 int limit,
int esc_len)
int(* func)(AVBPrint *dst, const char *in, const char *arg)
static void skip_bits_long(GetBitContext *s, int n)
Skips the specified number of bits.
static unsigned int show_bits_long(GetBitContext *s, int n)
Show 0-32 bits.
static int get_bits_left(GetBitContext *gb)
static void set_sr_golomb_flac(PutBitContext *pb, int i, int k, int limit, int esc_len)
write signed golomb rice code (flac).
static int get_se_golomb_long(GetBitContext *gb)
static unsigned int get_bits_long(GetBitContext *s, int n)
Read 0-32 bits.
static void put_sbits(PutBitContext *pb, int n, int32_t value)
static int get_bits_count(const GetBitContext *s)
static unsigned get_interleaved_ue_golomb(GetBitContext *gb)
static int get_sr_golomb(GetBitContext *gb, int k, int limit, int esc_len)
read signed golomb rice code (ffv1).
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
static int get_ue_golomb(GetBitContext *gb)
Read an unsigned Exp-Golomb code in the range 0 to 8190.
static unsigned int get_ur_golomb_shorten(GetBitContext *gb, int k)
read unsigned golomb rice code (shorten).
static void set_ue_golomb_long(PutBitContext *pb, uint32_t i)
write unsigned exp golomb code.
static void put_bits64(PutBitContext *s, int n, uint64_t value)
Write up to 64 bits into a bitstream.
const uint8_t ff_interleaved_ue_golomb_vlc_code[256]
static int get_ur_golomb(GetBitContext *gb, int k, int limit, int esc_len)
read unsigned golomb rice code (ffv1).
#define UPDATE_CACHE(name, gb)
static void set_ur_golomb(PutBitContext *pb, int i, int k, int limit, int esc_len)
write unsigned golomb rice code (ffv1).
const uint8_t ff_ue_golomb_len[256]
#define GET_CACHE(name, gb)
static void skip_bits(GetBitContext *s, int n)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int get_ur_golomb_jpegls(GetBitContext *gb, int k, int limit, int esc_len)
read unsigned golomb rice code (jpegls).
#define CLOSE_READER(name, gb)
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
const uint8_t ff_interleaved_dirac_golomb_vlc_code[256]
#define SKIP_BITS(name, gb, num)
static void set_ur_golomb_jpegls(PutBitContext *pb, int i, int k, int limit, int esc_len)
write unsigned golomb rice code (jpegls).
static int get_se_golomb(GetBitContext *gb)
read signed exp golomb code.
static int get_te_golomb(GetBitContext *gb, int range)
read unsigned truncated exp golomb code.
static int get_sr_golomb_flac(GetBitContext *gb, int k, int limit, int esc_len)
read signed golomb rice code (flac).
static unsigned int get_bits1(GetBitContext *s)
#define LAST_SKIP_BITS(name, gb, num)
const uint8_t ff_golomb_vlc_len[512]
static void set_te_golomb(PutBitContext *pb, int i, int range)
write truncated unsigned exp golomb code.
static void set_sr_golomb(PutBitContext *pb, int i, int k, int limit, int esc_len)
write signed golomb rice code (ffv1).
static int get_interleaved_se_golomb(GetBitContext *gb)
const uint8_t ff_ue_golomb_vlc_code[512]
#define OPEN_READER(name, gb)
static int dirac_get_se_golomb(GetBitContext *gb)
static void set_ue_golomb(PutBitContext *pb, int i)
write unsigned exp golomb code.
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
#define i(width, name, range_min, range_max)
static unsigned int show_bits(GetBitContext *s, int n)
Show 1-25 bits.
static int get_sr_golomb_shorten(GetBitContext *gb, int k)
read signed golomb rice code (shorten).
FFmpeg Automated Testing Environment ************************************Introduction Using FATE from your FFmpeg source directory Submitting the results to the FFmpeg result aggregation server Uploading new samples to the fate suite FATE makefile targets and variables Makefile targets Makefile variables Examples Introduction **************FATE is an extended regression suite on the client side and a means for results aggregation and presentation on the server side The first part of this document explains how you can use FATE from your FFmpeg source directory to test your ffmpeg binary The second part describes how you can run FATE to submit the results to FFmpeg’s FATE server In any way you can have a look at the publicly viewable FATE results by visiting this as it can be seen if some test on some platform broke with their recent contribution This usually happens on the platforms the developers could not test on The second part of this document describes how you can run FATE to submit your results to FFmpeg’s FATE server If you want to submit your results be sure to check that your combination of OS and compiler is not already listed on the above mentioned website In the third part you can find a comprehensive listing of FATE makefile targets and variables Using FATE from your FFmpeg source directory **********************************************If you want to run FATE on your machine you need to have the samples in place You can get the samples via the build target fate rsync Use this command from the top level source this will cause FATE to fail NOTE To use a custom wrapper to run the pass ‘ target exec’ to ‘configure’ or set the TARGET_EXEC Make variable Submitting the results to the FFmpeg result aggregation server ****************************************************************To submit your results to the server you should run fate through the shell script ‘tests fate sh’ from the FFmpeg sources This script needs to be invoked with a configuration file as its first argument tests fate sh path to fate_config A configuration file template with comments describing the individual configuration variables can be found at ‘doc fate_config sh template’ Create a configuration that suits your based on the configuration template The ‘slot’ configuration variable can be any string that is not yet but it is suggested that you name it adhering to the following pattern ‘ARCH OS COMPILER COMPILER VERSION’ The configuration file itself will be sourced in a shell therefore all shell features may be used This enables you to setup the environment as you need it for your build For your first test runs the ‘fate_recv’ variable should be empty or commented out This will run everything as normal except that it will omit the submission of the results to the server The following files should be present in $workdir as specified in the configuration file
static int get_ue_golomb_31(GetBitContext *gb)
read unsigned exp golomb code, constraint to a max of 31.
#define SHOW_UBITS(name, gb, num)
const int8_t ff_se_golomb_vlc_code[512]
static unsigned get_ue_golomb_long(GetBitContext *gb)
Read an unsigned Exp-Golomb code in the range 0 to UINT32_MAX-1.
static int get_te0_golomb(GetBitContext *gb, int range)
read unsigned truncated exp golomb code.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
const int8_t ff_interleaved_se_golomb_vlc_code[256]
const uint8_t ff_interleaved_golomb_vlc_len[256]
#define BITS_AVAILABLE(name, gb)
static void set_se_golomb(PutBitContext *pb, int i)
write signed exp golomb code.