#include <inttypes.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "libavutil/attributes.h"
#include "libavutil/avassert.h"
#include "libavutil/error.h"
#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/log.h"
#include "libavutil/macros.h"
#include "libavutil/mem.h"
#include "libavutil/qsort.h"
#include "libavutil/reverse.h"
#include "vlc.h"
#define GET_DATA(v, table, i, wrap, size) …
static int alloc_table(VLC *vlc, int size, int use_static)
{ … }
#define LOCALBUF_ELEMS …
static av_always_inline uint32_t bitswap_32(uint32_t x)
{ … }
VLCcode;
static int vlc_common_init(VLC *vlc, int nb_bits, int nb_codes,
VLCcode **buf, int flags)
{ … }
static int compare_vlcspec(const void *a, const void *b)
{ … }
static int build_table(VLC *vlc, int table_nb_bits, int nb_codes,
VLCcode *codes, int flags)
{ … }
static int vlc_common_end(VLC *vlc, int nb_bits, int nb_codes, VLCcode *codes,
int flags, VLCcode localbuf[LOCALBUF_ELEMS])
{ … }
int ff_vlc_init_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)
{ … }
int ff_vlc_init_from_lengths(VLC *vlc, int nb_bits, int nb_codes,
const int8_t *lens, int lens_wrap,
const void *symbols, int symbols_wrap, int symbols_size,
int offset, int flags, void *logctx)
{ … }
av_cold void ff_vlc_init_table_from_lengths(VLCElem table[], int table_size,
int nb_bits, int nb_codes,
const int8_t *lens, int lens_wrap,
const void *symbols, int symbols_wrap, int symbols_size,
int offset, int flags)
{ … }
av_cold const VLCElem *ff_vlc_init_tables_from_lengths(VLCInitState *state,
int nb_bits, int nb_codes,
const int8_t *lens, int lens_wrap,
const void *symbols, int symbols_wrap, int symbols_size,
int offset, int flags)
{ … }
av_cold void ff_vlc_init_table_sparse(VLCElem table[], int table_size,
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)
{ … }
av_cold const VLCElem *ff_vlc_init_tables_sparse(VLCInitState *state,
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)
{ … }
static void add_level(VLC_MULTI_ELEM *table, const int is16bit,
const int num, const int numbits,
const VLCcode *buf,
uint32_t curcode, int curlen,
int curlimit, int curlevel,
const int minlen, const int max,
unsigned* levelcnt, VLC_MULTI_ELEM info)
{ … }
static int vlc_multi_gen(VLC_MULTI_ELEM *table, const VLC *single,
const int is16bit, const int nb_codes, const int numbits,
VLCcode *buf, void *logctx)
{ … }
int ff_vlc_init_multi_from_lengths(VLC *vlc, VLC_MULTI *multi, int nb_bits, int nb_elems,
int nb_codes, const int8_t *lens, int lens_wrap,
const void *symbols, int symbols_wrap, int symbols_size,
int offset, int flags, void *logctx)
{ … }
void ff_vlc_free_multi(VLC_MULTI *vlc)
{ … }
void ff_vlc_free(VLC *vlc)
{ … }