[XviD-devel] basic gmc decoding
Christoph Lampert
xvid-devel@xvid.org
Sun, 3 Nov 2002 15:59:00 +0100 (CET)
On Mon, 4 Nov 2002, peter ross wrote:
> hi,
>
> its done. whew, about 40 lines of code. (basic == one warp point)
Great! If it also handles two warp points when second point is (0,0)
(as done by DivX5 and my XVID encoding) then it should be sufficient for
a while.
> michaeln, ive borrowed your trajectory value code. for encoding,
> christoph has used a rather large lookup table, but your method is
> much more elegant.
> if ((x >> (length - 1)) == 0) /* if MSB not set it is negative*/
> x = - (x ^ ((1 << length) - 1));
Yes, for decoding this is easy (because length is known). For encoding I
would have had to use a longer if-table to check for bounds of intervals
and I thought a table would be the easiest way.
Maybe it can be done easier, I never tried to do VLC before.
gruel
P.S. Btw. there is are two lookup tables with 512K entries in vlc_codes.h
Are those really used?