FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
huffman.c File Reference

huffman tree builder and VLC generator More...

#include "avcodec.h"
#include "get_bits.h"
#include "huffman.h"

Go to the source code of this file.

Data Structures

struct  HeapElem
 

Macros

#define HNODE   -1
 

Functions

static void heap_sift (HeapElem *h, int root, int size)
 
void ff_huff_gen_len_table (uint8_t *dst, const uint64_t *stats)
 
static void get_tree_codes (uint32_t *bits, int16_t *lens, uint8_t *xlat, Node *nodes, int node, uint32_t pfx, int pl, int *pos, int no_zero_count)
 
static int build_huff_tree (VLC *vlc, Node *nodes, int head, int flags)
 
int ff_huff_build_tree (AVCodecContext *avctx, VLC *vlc, int nb_codes, Node *nodes, HuffCmp cmp, int flags)
 nodes size must be 2*nb_codes first nb_codes nodes.count must be set
 

Detailed Description

huffman tree builder and VLC generator

Definition in file huffman.c.

Macro Definition Documentation

#define HNODE   -1

Definition at line 32 of file huffman.c.

Referenced by ff_huff_build_tree(), and get_tree_codes().

Function Documentation

static void heap_sift ( HeapElem h,
int  root,
int  size 
)
static

Definition at line 39 of file huffman.c.

Referenced by ff_huff_gen_len_table().

void ff_huff_gen_len_table ( uint8_t dst,
const uint64_t *  stats 
)

Definition at line 53 of file huffman.c.

Referenced by encode_frame(), encode_init(), and encode_plane().

static void get_tree_codes ( uint32_t *  bits,
int16_t *  lens,
uint8_t xlat,
Node nodes,
int  node,
uint32_t  pfx,
int  pl,
int *  pos,
int  no_zero_count 
)
static

Definition at line 92 of file huffman.c.

Referenced by build_huff_tree().

static int build_huff_tree ( VLC vlc,
Node nodes,
int  head,
int  flags 
)
static

Definition at line 115 of file huffman.c.

Referenced by ff_huff_build_tree().

int ff_huff_build_tree ( AVCodecContext avctx,
VLC vlc,
int  nb_codes,
Node nodes,
HuffCmp  cmp,
int  flags 
)

nodes size must be 2*nb_codes first nb_codes nodes.count must be set

Definition at line 133 of file huffman.c.

Referenced by fraps2_decode_plane(), and vp6_build_huff_tree().