27 #ifndef AVCODEC_MJPEGENC_HUFFMAN_H
28 #define AVCODEC_MJPEGENC_HUFFMAN_H
75 int size,
int max_length);
static double val(void *priv, double ch)
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.
void ff_mjpeg_encode_huffman_init(MJpegEncHuffmanContext *s)
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.
static void ff_mjpeg_encode_huffman_increment(MJpegEncHuffmanContext *s, uint8_t val)
Used to store optimal huffman encoding results.
int length
length of the encoding
int code
code is the input value
Used to assign a occurrence count or "probability" to an input value.
int prob
number of occurences of this value in input
Used to store intermediate lists in the package merge algorithm.
int probability[514]
probability of each item 3, 8, 18, 46
int items[257 *16]
chain of all individual values that make up items A, B, A, B, C, A, B, C, D, C, D,...
int item_idx[515]
index range for each item in items 0, 2, 5, 9, 13
int nitems
number of items in the list and probability ex. 4