aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-05-21 13:37:00 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-05-21 13:51:04 +0200
commitb9ea6a84143a2a8fb5d1ba891e7378924ec76b6b (patch)
treee431675947e0a01ce3df6cecd4f5eb0bcd03133f
parent1d7e6a6bde73a83dc8175c20598dbb4b9f53e637 (diff)
downloadffmpeg-b9ea6a84143a2a8fb5d1ba891e7378924ec76b6b.tar.gz
avcodec/huffman: use named identifer for the bits constant
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/fraps.c2
-rw-r--r--libavcodec/huffman.c2
-rw-r--r--libavcodec/huffman.h1
-rw-r--r--libavcodec/vp6.c4
4 files changed, 5 insertions, 4 deletions
diff --git a/libavcodec/fraps.c b/libavcodec/fraps.c
index 00a38c6169..c53367c1b1 100644
--- a/libavcodec/fraps.c
+++ b/libavcodec/fraps.c
@@ -105,7 +105,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
*/
diff --git a/libavcodec/huffman.c b/libavcodec/huffman.c
index 27fed9f022..6e388292c2 100644
--- a/libavcodec/huffman.c
+++ b/libavcodec/huffman.c
@@ -122,7 +122,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);
}
diff --git a/libavcodec/huffman.h b/libavcodec/huffman.h
index 4f9ccbad50..a04753f2db 100644
--- a/libavcodec/huffman.h
+++ b/libavcodec/huffman.h
@@ -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,
diff --git a/libavcodec/vp6.c b/libavcodec/vp6.c
index 6e385ce1de..cc0ac6c3d7 100644
--- a/libavcodec/vp6.c
+++ b/libavcodec/vp6.c
@@ -388,11 +388,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