summaryrefslogtreecommitdiff
path: root/libavcodec/huffman.c
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2008-03-08 17:57:13 +0000
committerAurelien Jacobs <aurel@gnuage.org>2008-03-08 17:57:13 +0000
commitbac02ed3c5004f4944cdeb97c4341925196b50d8 (patch)
tree51ef0c506016446ecf69dab94d3fcc0aad8e2e65 /libavcodec/huffman.c
parent409e1d71eaf2897f97f9d95e01079f93cac266ee (diff)
downloadffmpeg-bac02ed3c5004f4944cdeb97c4341925196b50d8.tar.gz
huffman: pass hnode_first as a flag instead of as an argument on its own
Originally committed as revision 12373 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/huffman.c')
-rw-r--r--libavcodec/huffman.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/huffman.c b/libavcodec/huffman.c
index 43a78558e7..0bc1bc6b0f 100644
--- a/libavcodec/huffman.c
+++ b/libavcodec/huffman.c
@@ -64,7 +64,7 @@ static int build_huff_tree(VLC *vlc, Node *nodes, int head)
* first nb_codes nodes.count must be set
*/
int ff_huff_build_tree(AVCodecContext *avctx, VLC *vlc, int nb_codes,
- Node *nodes, huff_cmp_t cmp, int hnode_first)
+ Node *nodes, huff_cmp_t cmp, int flags)
{
int i, j;
int cur_node;
@@ -90,7 +90,8 @@ int ff_huff_build_tree(AVCodecContext *avctx, VLC *vlc, int nb_codes,
for(j = cur_node; j > 0; j--){
if(nodes[j].count > nodes[j-1].count ||
(nodes[j].count == nodes[j-1].count &&
- (!hnode_first || nodes[j].n0==j-1 || nodes[j].n0==j-2 ||
+ (!(flags & FF_HUFFMAN_FLAG_HNODE_FIRST) ||
+ nodes[j].n0==j-1 || nodes[j].n0==j-2 ||
(nodes[j].sym!=HNODE && nodes[j-1].sym!=HNODE))))
break;
FFSWAP(Node, nodes[j], nodes[j-1]);