FFmpeg
|
#include <stdint.h>
Go to the source code of this file.
Data Structures | |
struct | MJpegEncHuffmanContext |
struct | PTable |
Used to assign a occurrence count or "probability" to an input value. More... | |
struct | PackageMergerList |
Used to store intermediate lists in the package merge algorithm. More... | |
struct | HuffTable |
Used to store optimal huffman encoding results. More... | |
Functions | |
void | ff_mjpeg_encode_huffman_init (MJpegEncHuffmanContext *s) |
static void | ff_mjpeg_encode_huffman_increment (MJpegEncHuffmanContext *s, uint8_t val) |
void | ff_mjpeg_encode_huffman_close (MJpegEncHuffmanContext *s, uint8_t bits[17], uint8_t val[], int max_nval) |
Produces a Huffman encoding with a given input. More... | |
void | ff_mjpegenc_huffman_compute_bits (PTable *prob_table, HuffTable *distincts, int size, int max_length) |
Computes the length of the Huffman encoding for each distinct input value. More... | |
Huffman table generation for MJPEG encoder.
Definition in file mjpegenc_huffman.h.
void ff_mjpeg_encode_huffman_init | ( | MJpegEncHuffmanContext * | s | ) |
Definition at line 145 of file mjpegenc_huffman.c.
|
inlinestatic |
Definition at line 38 of file mjpegenc_huffman.h.
void ff_mjpeg_encode_huffman_close | ( | MJpegEncHuffmanContext * | s, |
uint8_t | bits[17], | ||
uint8_t | val[], | ||
int | max_nval | ||
) |
Produces a Huffman encoding with a given input.
s | input to encode |
bits | output array where the ith character represents how many input values have i length encoding |
val | output array of input values sorted by their encoded length |
max_nval | maximum number of distinct input values |
Definition at line 158 of file mjpegenc_huffman.c.
void ff_mjpegenc_huffman_compute_bits | ( | PTable * | prob_table, |
HuffTable * | distincts, | ||
int | size, | ||
int | max_length | ||
) |
Computes the length of the Huffman encoding for each distinct input value.
Uses package merge algorithm as follows:
All probabilities should be positive integers. The output is sorted by code, not by length.
prob_table | input array of a PTable for each distinct input value |
distincts | output array of a HuffTable that will be populated by this function |
size | size of the prob_table array |
max_length | max length of an encoding |
Definition at line 77 of file mjpegenc_huffman.c.
Referenced by check_lengths(), ff_mjpeg_encode_huffman_close(), and main().