[FFmpeg-devel] [PATCH] fix vp6-huffman sort order
Aurelien Jacobs
aurel
Sun Jun 22 15:20:57 CEST 2008
pross at xvid.org wrote:
> On Sun, Jun 22, 2008 at 09:43:18AM +0100, M?ns Rullg?rd wrote:
> > pross at xvid.org writes:
> > > +/* sort comparator: 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)*12 + (b->sym - a->sym);
> > > }
> >
> > *16 would be faster. What is the range of ->count?
>
> Actually, it is at least 256.
>
> The vp6 maintainer will be able to provide further insight. Aurel?
count range is [0:256]
sym range is [0:11]
So *16 is OK and better.
Patch applied with *16.
Thanks.
Aurel
More information about the ffmpeg-devel
mailing list