FFmpeg
Data Structures | Macros | Functions
vlc.h File Reference
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  VLC
 
struct  RL_VLC_ELEM
 

Macros

#define VLC_TYPE   int16_t
 
#define init_vlc(vlc, nb_bits, nb_codes, bits, bits_wrap, bits_size, codes, codes_wrap, codes_size, flags)
 
#define INIT_VLC_LE   2
 
#define INIT_VLC_USE_NEW_STATIC   4
 
#define INIT_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, h, i, j, static_size)
 
#define INIT_LE_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, h, i, j, static_size)
 
#define INIT_VLC_STATIC(vlc, bits, a, b, c, d, e, f, g, static_size)   INIT_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, NULL, 0, 0, static_size)
 
#define INIT_LE_VLC_STATIC(vlc, bits, a, b, c, d, e, f, g, static_size)   INIT_LE_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, NULL, 0, 0, static_size)
 

Functions

int ff_init_vlc_sparse (VLC *vlc, int nb_bits, int nb_codes, const void *bits, int bits_wrap, int bits_size, const void *codes, int codes_wrap, int codes_size, const void *symbols, int symbols_wrap, int symbols_size, int flags)
 
void ff_free_vlc (VLC *vlc)
 

Macro Definition Documentation

◆ VLC_TYPE

#define VLC_TYPE   int16_t

Definition at line 24 of file vlc.h.

◆ init_vlc

#define init_vlc (   vlc,
  nb_bits,
  nb_codes,
  bits,
  bits_wrap,
  bits_size,
  codes,
  codes_wrap,
  codes_size,
  flags 
)
Value:
ff_init_vlc_sparse(vlc, nb_bits, nb_codes, \
bits, bits_wrap, bits_size, \
codes, codes_wrap, codes_size, \
NULL, 0, 0, flags)

Definition at line 38 of file vlc.h.

◆ INIT_VLC_LE

#define INIT_VLC_LE   2

Definition at line 54 of file vlc.h.

◆ INIT_VLC_USE_NEW_STATIC

#define INIT_VLC_USE_NEW_STATIC   4

Definition at line 55 of file vlc.h.

◆ INIT_VLC_SPARSE_STATIC

#define INIT_VLC_SPARSE_STATIC (   vlc,
  bits,
  a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  i,
  j,
  static_size 
)
Value:
do { \
static VLC_TYPE table[static_size][2]; \
(vlc)->table = table; \
(vlc)->table_allocated = static_size; \
ff_init_vlc_sparse(vlc, bits, a, b, c, d, e, f, g, h, i, j, \
} while (0)

Definition at line 57 of file vlc.h.

◆ INIT_LE_VLC_SPARSE_STATIC

#define INIT_LE_VLC_SPARSE_STATIC (   vlc,
  bits,
  a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  i,
  j,
  static_size 
)
Value:
do { \
static VLC_TYPE table[static_size][2]; \
(vlc)->table = table; \
(vlc)->table_allocated = static_size; \
ff_init_vlc_sparse(vlc, bits, a, b, c, d, e, f, g, h, i, j, \
} while (0)

Definition at line 66 of file vlc.h.

◆ INIT_VLC_STATIC

#define INIT_VLC_STATIC (   vlc,
  bits,
  a,
  b,
  c,
  d,
  e,
  f,
  g,
  static_size 
)    INIT_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, NULL, 0, 0, static_size)

Definition at line 75 of file vlc.h.

◆ INIT_LE_VLC_STATIC

#define INIT_LE_VLC_STATIC (   vlc,
  bits,
  a,
  b,
  c,
  d,
  e,
  f,
  g,
  static_size 
)    INIT_LE_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, NULL, 0, 0, static_size)

Definition at line 78 of file vlc.h.

Function Documentation

◆ ff_init_vlc_sparse()

int ff_init_vlc_sparse ( VLC vlc,
int  nb_bits,
int  nb_codes,
const void *  bits,
int  bits_wrap,
int  bits_size,
const void *  codes,
int  codes_wrap,
int  codes_size,
const void *  symbols,
int  symbols_wrap,
int  symbols_size,
int  flags 
)

◆ ff_free_vlc()

void ff_free_vlc ( VLC vlc)
b
#define b
Definition: input.c:41
table
static const uint16_t table[]
Definition: prosumer.c:206
INIT_VLC_LE
#define INIT_VLC_LE
Definition: vlc.h:54
VLC_TYPE
#define VLC_TYPE
Definition: vlc.h:24
g
const char * g
Definition: vf_curves.c:115
bits
uint8_t bits
Definition: vp3data.h:202
f
#define f(width, name)
Definition: cbs_vp9.c:255
NULL
#define NULL
Definition: coverity.c:32
INIT_VLC_USE_NEW_STATIC
#define INIT_VLC_USE_NEW_STATIC
Definition: vlc.h:55
c
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
Definition: undefined.txt:32
a
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
Definition: undefined.txt:41
ff_init_vlc_sparse
int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, const void *bits, int bits_wrap, int bits_size, const void *codes, int codes_wrap, int codes_size, const void *symbols, int symbols_wrap, int symbols_size, int flags)
Definition: bitstream.c:273
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:269
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:565
h
h
Definition: vp9dsp_template.c:2038