Mercurial > libavcodec.hg
changeset 7093:544da38cb2c9 libavcodec
vp6: ensure that huffman decoding table is sorted with descending symbol order
Previous code worked by pure luck with glibc qsort implementation.
patch by Peter Ross pross _at_ xvid _dot_ org
author | aurel |
---|---|
date | Sun, 22 Jun 2008 13:20:41 +0000 |
parents | 359237c9a10b |
children | b0820b8bd4dd |
files | vp6.c |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/vp6.c Sun Jun 22 13:01:24 2008 +0000 +++ b/vp6.c Sun Jun 22 13:20:41 2008 +0000 @@ -202,10 +202,11 @@ model->vector_fdv[comp][node] = vp56_rac_gets_nn(c, 7); } +/* nodes must ascend by count, but with descending symbol order */ static int vp6_huff_cmp(const void *va, const void *vb) { const Node *a = va, *b = vb; - return a->count >= b->count; + return (a->count - b->count)*16 + (b->sym - a->sym); } static void vp6_build_huff_tree(vp56_context_t *s, uint8_t coeff_model[],