mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-28 02:12:28 +00:00
huffman: use a named identifer for the bits constant
Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
parent
9ad1e0c12c
commit
5a19bce2ff
@ -112,7 +112,7 @@ static int fraps2_decode_plane(FrapsContext *s, uint8_t *dst, int stride, int w,
|
||||
init_get_bits(&gb, s->tmpbuf, size * 8);
|
||||
for (j = 0; j < h; j++) {
|
||||
for (i = 0; i < w*step; i += step) {
|
||||
dst[i] = get_vlc2(&gb, vlc.table, 9, 3);
|
||||
dst[i] = get_vlc2(&gb, vlc.table, FF_HUFFMAN_BITS, 3);
|
||||
/* lines are stored as deltas between previous lines
|
||||
* and we need to add 0x80 to the first lines of chroma planes
|
||||
*/
|
||||
|
@ -124,7 +124,7 @@ static int build_huff_tree(VLC *vlc, Node *nodes, int head, int flags)
|
||||
|
||||
get_tree_codes(bits, lens, xlat, nodes, head, 0, 0,
|
||||
&pos, no_zero_count);
|
||||
return ff_init_vlc_sparse(vlc, 9, pos, lens, 2, 2, bits, 4, 4, xlat, 1, 1, 0);
|
||||
return ff_init_vlc_sparse(vlc, FF_HUFFMAN_BITS, pos, lens, 2, 2, bits, 4, 4, xlat, 1, 1, 0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -37,6 +37,7 @@ typedef struct Node {
|
||||
|
||||
#define FF_HUFFMAN_FLAG_HNODE_FIRST 0x01
|
||||
#define FF_HUFFMAN_FLAG_ZERO_COUNT 0x02
|
||||
#define FF_HUFFMAN_BITS 9
|
||||
|
||||
typedef int (*HuffCmp)(const void *va, const void *vb);
|
||||
int ff_huff_build_tree(AVCodecContext *avctx, VLC *vlc, int nb_codes,
|
||||
|
@ -402,11 +402,11 @@ static void vp6_parse_coeff_huffman(VP56Context *s)
|
||||
} else {
|
||||
if (get_bits_left(&s->gb) <= 0)
|
||||
return;
|
||||
coeff = get_vlc2(&s->gb, vlc_coeff->table, 9, 3);
|
||||
coeff = get_vlc2(&s->gb, vlc_coeff->table, FF_HUFFMAN_BITS, 3);
|
||||
if (coeff == 0) {
|
||||
if (coeff_idx) {
|
||||
int pt = (coeff_idx >= 6);
|
||||
run += get_vlc2(&s->gb, s->runv_vlc[pt].table, 9, 3);
|
||||
run += get_vlc2(&s->gb, s->runv_vlc[pt].table, FF_HUFFMAN_BITS, 3);
|
||||
if (run >= 9)
|
||||
run += get_bits(&s->gb, 6);
|
||||
} else
|
||||
|
Loading…
Reference in New Issue
Block a user