#ifndef AVCODEC_GOLOMB_H
#define AVCODEC_GOLOMB_H
#include <stdint.h>
#include "get_bits.h"
#define INVALID_VLC …
extern const uint8_t ff_golomb_vlc_len[512];
extern const uint8_t ff_ue_golomb_vlc_code[512];
extern const int8_t ff_se_golomb_vlc_code[512];
extern const uint8_t ff_interleaved_golomb_vlc_len[256];
extern const uint8_t ff_interleaved_ue_golomb_vlc_code[256];
extern const int8_t ff_interleaved_se_golomb_vlc_code[256];
extern const uint8_t ff_interleaved_dirac_golomb_vlc_code[256];
static inline int get_ue_golomb(GetBitContext *gb)
{ … }
static inline unsigned get_ue_golomb_long(GetBitContext *gb)
{ … }
static inline int get_ue_golomb_31(GetBitContext *gb)
{ … }
static inline unsigned get_interleaved_ue_golomb(GetBitContext *gb)
{ … }
static inline int get_te0_golomb(GetBitContext *gb, int range)
{ … }
static inline int get_te_golomb(GetBitContext *gb, int range)
{ … }
static inline int get_se_golomb(GetBitContext *gb)
{ … }
static inline int get_se_golomb_long(GetBitContext *gb)
{ … }
static inline int get_interleaved_se_golomb(GetBitContext *gb)
{ … }
static inline int dirac_get_se_golomb(GetBitContext *gb)
{ … }
static inline int get_ur_golomb(GetBitContext *gb, int k, int limit,
int esc_len)
{ … }
static inline int get_ur_golomb_jpegls(GetBitContext *gb, int k, int limit,
int esc_len)
{ … }
static inline int get_sr_golomb(GetBitContext *gb, int k, int limit,
int esc_len)
{ … }
static inline int get_sr_golomb_flac(GetBitContext *gb, int k, int limit,
int esc_len)
{ … }
static inline unsigned int get_ur_golomb_shorten(GetBitContext *gb, int k)
{ … }
static inline int get_sr_golomb_shorten(GetBitContext *gb, int k)
{ … }
#ifdef TRACE
static inline int get_ue(GetBitContext *s, const char *file, const char *func,
int line)
{
int show = show_bits(s, 24);
int pos = get_bits_count(s);
int i = get_ue_golomb(s);
int len = get_bits_count(s) - pos;
int bits = show >> (24 - len);
av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d ue @%5d in %s %s:%d\n",
bits, len, i, pos, file, func, line);
return i;
}
static inline int get_se(GetBitContext *s, const char *file, const char *func,
int line)
{
int show = show_bits(s, 24);
int pos = get_bits_count(s);
int i = get_se_golomb(s);
int len = get_bits_count(s) - pos;
int bits = show >> (24 - len);
av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d se @%5d in %s %s:%d\n",
bits, len, i, pos, file, func, line);
return i;
}
static inline int get_te(GetBitContext *s, int r, char *file, const char *func,
int line)
{
int show = show_bits(s, 24);
int pos = get_bits_count(s);
int i = get_te0_golomb(s, r);
int len = get_bits_count(s) - pos;
int bits = show >> (24 - len);
av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d te @%5d in %s %s:%d\n",
bits, len, i, pos, file, func, line);
return i;
}
#define get_ue_golomb …
#define get_se_golomb …
#define get_te_golomb …
#define get_te0_golomb …
#endif
#endif