--- branches/dev-api-3/xvidcore/src/bitstream/mbcoding.c 2002/11/02 15:52:31 619 +++ branches/dev-api-3/xvidcore/src/bitstream/mbcoding.c 2002/12/14 09:39:42 721 @@ -69,8 +69,7 @@ VLC DCT3Dinter[4096]; /* not really MB related, but VLCs are only available here */ -void inline bs_put_spritetrajectory(Bitstream * bs, - const int val) +void bs_put_spritetrajectory(Bitstream * bs, const int val) { const int code = sprite_trajectory_code[val+16384].code; const int len = sprite_trajectory_code[val+16384].len; @@ -84,6 +83,19 @@ if (len) BitstreamPutBits(bs, code, len); } +int bs_get_spritetrajectory(Bitstream * bs) +{ + int i; + for (i = 0; i < 12; i++) + { + if (BitstreamShowBits(bs, sprite_trajectory_len[i].len) == sprite_trajectory_len[i].code) + { + BitstreamSkip(bs, sprite_trajectory_len[i].len); + return i; + } + } + return -1; +} void init_vlc_tables(void) @@ -428,13 +440,13 @@ if (frame->global_flags & XVID_INTERLACING) { if (pMB->cbp) { BitstreamPutBit(bs, pMB->field_dct); - DEBUG1("codep: field_dct: ", pMB->field_dct); + DPRINTF(DPRINTF_MB,"codep: field_dct: %i", pMB->field_dct); } // if inter block, write field ME flag if (pMB->mode == MODE_INTER || pMB->mode == MODE_INTER_Q) { BitstreamPutBit(bs, pMB->field_pred); - DEBUG1("codep: field_pred: ", pMB->field_pred); + DPRINTF(DPRINTF_MB,"codep: field_pred: %i", pMB->field_pred); // write field prediction references if (pMB->field_pred) { @@ -819,7 +831,7 @@ do { level = get_coeff(bs, &run, &last, 1, 0); if (run == -1) { - DEBUG("fatal: invalid run"); + DPRINTF(DPRINTF_ERROR,"fatal: invalid run"); break; } coeff += run; @@ -829,7 +841,7 @@ //DPRINTF(DPRINTF_COEFF,"block[%i] %i %08x", scan[coeff], level, BitstreamShowBits(bs, 32)); if (level < -127 || level > 127) { - DEBUG1("warning: intra_overflow", level); + DPRINTF(DPRINTF_ERROR,"warning: intra_overflow %i", level); } coeff++; } while (!last); @@ -852,7 +864,7 @@ do { level = get_coeff(bs, &run, &last, 0, 0); if (run == -1) { - DEBUG("fatal: invalid run"); + DPRINTF(DPRINTF_ERROR,"fatal: invalid run"); break; } p += run; @@ -863,7 +875,7 @@ // DPRINTF(DPRINTF_COEFF,"block[%i] %i %08x", scan[p], level, BitstreamShowBits(bs, 32)); if (level < -127 || level > 127) { - DEBUG1("warning: inter_overflow", level); + DPRINTF(DPRINTF_ERROR,"warning: inter overflow %i", level); } p++; } while (!last);