[FFmpeg-cvslog] r13887 - trunk/libavcodec/vp6.c
aurel
subversion
Sun Jun 22 15:20:42 CEST 2008
Author: aurel
Date: Sun Jun 22 15:20:41 2008
New Revision: 13887
Log:
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
Modified:
trunk/libavcodec/vp6.c
Modified: trunk/libavcodec/vp6.c
==============================================================================
--- trunk/libavcodec/vp6.c (original)
+++ trunk/libavcodec/vp6.c Sun Jun 22 15:20:41 2008
@@ -202,10 +202,11 @@ static void vp6_parse_vector_models(vp56
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[],
More information about the ffmpeg-cvslog
mailing list