--- mbcoding.c 2002/12/14 09:39:42 1.25.2.6 +++ mbcoding.c 2003/01/04 06:14:33 1.25.2.9 @@ -52,6 +52,7 @@ #include #include "../portab.h" +#include "../global.h" #include "bitstream.h" #include "zigzag.h" #include "vlc_codes.h" @@ -59,11 +60,8 @@ #include "../utils/mbfunctions.h" -#define ABS(X) (((X)>0)?(X):-(X)) -#define CLIP(X,A) (X > A) ? (A) : (X) - -VLC intra_table[524032]; -VLC inter_table[524032]; +VLC intra_table[4*2048*64]; +VLC inter_table[4*2048*64]; VLC DCT3Dintra[4096]; VLC DCT3Dinter[4096]; @@ -683,7 +681,7 @@ uint32_t index; - index = CLIP(BitstreamShowBits(bs, 9), 256); + index = MIN(BitstreamShowBits(bs, 9), 256); BitstreamSkip(bs, mcbpc_inter_table[index].len); @@ -840,7 +838,7 @@ DPRINTF(DPRINTF_COEFF,"block[%i] %i", scan[coeff], level); //DPRINTF(DPRINTF_COEFF,"block[%i] %i %08x", scan[coeff], level, BitstreamShowBits(bs, 32)); - if (level < -127 || level > 127) { + if (level < -2047 || level > 2047) { DPRINTF(DPRINTF_ERROR,"warning: intra_overflow %i", level); } coeff++; @@ -874,7 +872,7 @@ DPRINTF(DPRINTF_COEFF,"block[%i] %i", scan[p], level); // DPRINTF(DPRINTF_COEFF,"block[%i] %i %08x", scan[p], level, BitstreamShowBits(bs, 32)); - if (level < -127 || level > 127) { + if (level < -2047 || level > 2047) { DPRINTF(DPRINTF_ERROR,"warning: inter overflow %i", level); } p++;