FFmpeg
Loading...
Searching...
No Matches
huffman.c File Reference

huffman tree builder and VLC generator More...

#include <stdint.h>
#include "libavutil/error.h"
#include "libavutil/log.h"
#include "libavutil/macros.h"
#include "libavutil/mem.h"
#include "libavutil/qsort.h"
#include "huffman.h"
#include "vlc.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)
 
int ff_huff_gen_len_table (uint8_t *dst, const uint64_t *stats, int stats_size, int skip0)
 
static void get_tree_codes (int8_t *lens, uint8_t *xlat, Node *nodes, int node, int pl, int *pos, int no_zero_count)
 
static int build_huff_tree (VLC *vlc, Node *nodes, int head, int flags, int nb_bits, void *logctx)
 
int ff_huff_build_tree (void *logctx, VLC *vlc, int nb_codes, int nb_bits, 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

◆ HNODE

#define HNODE   -1

Definition at line 39 of file huffman.c.

Referenced by ff_huff_build_tree(), and get_tree_codes().

Function Documentation

◆ heap_sift()

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

Definition at line 49 of file huffman.c.

Referenced by ff_huff_gen_len_table().

◆ ff_huff_gen_len_table()

int ff_huff_gen_len_table ( uint8_t * dst,
const uint64_t * stats,
int stats_size,
int skip0 )

Definition at line 63 of file huffman.c.

Referenced by encode_plane(), and store_huffman_tables().

◆ get_tree_codes()

static void get_tree_codes ( int8_t * lens,
uint8_t * xlat,
Node * nodes,
int node,
int pl,
int * pos,
int no_zero_count )
static

Definition at line 121 of file huffman.c.

Referenced by build_huff_tree(), and get_tree_codes().

◆ build_huff_tree()

static int build_huff_tree ( VLC * vlc,
Node * nodes,
int head,
int flags,
int nb_bits,
void * logctx )
static

Definition at line 140 of file huffman.c.

Referenced by ff_huff_build_tree().

◆ ff_huff_build_tree()

int ff_huff_build_tree ( void * logctx,
VLC * vlc,
int nb_codes,
int nb_bits,
Node * nodes,
HuffCmp cmp,
int flags )

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

Definition at line 158 of file huffman.c.

Referenced by fraps2_decode_plane(), and vp6_build_huff_tree().