--- trunk/xvidcore/src/bitstream/mbcoding.c 2002/09/10 22:30:18 468 +++ trunk/xvidcore/src/bitstream/mbcoding.c 2002/09/10 22:52:13 469 @@ -29,7 +29,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: mbcoding.c,v 1.29 2002-09-10 21:29:03 edgomez Exp $ + * $Id: mbcoding.c,v 1.30 2002-09-10 22:52:12 edgomez Exp $ * ****************************************************************************/ @@ -437,144 +437,6 @@ return; } -#if 0 -/*************************************************************** - * bframe encoding start - ***************************************************************/ - -/* - mbtype - 0 1b direct(h263) mvdb - 1 01b interpolate mc+q dbquant, mvdf, mvdb - 2 001b backward mc+q dbquant, mvdb - 3 0001b forward mc+q dbquant, mvdf -*/ - -void -put_bvop_mbtype(Bitstream * bs, - int value) -{ - switch (value) { - case 0: - BitstreamPutBit(bs, 1); - return; - - case 1: - BitstreamPutBit(bs, 0); - BitstreamPutBit(bs, 1); - return; - - case 2: - BitstreamPutBit(bs, 0); - BitstreamPutBit(bs, 0); - BitstreamPutBit(bs, 1); - return; - - case 3: - BitstreamPutBit(bs, 0); - BitstreamPutBit(bs, 0); - BitstreamPutBit(bs, 0); - BitstreamPutBit(bs, 1); - return; - - default:; // invalid! - - } - -} - -/* - dbquant - -2 10b - 0 0b - +2 11b -*/ - -void -put_bvop_dbquant(Bitstream * bs, - int value) -{ - switch (value) { - case 0: - BitstreamPutBit(bs, 0); - return; - - case -2: - BitstreamPutBit(bs, 1); - BitstreamPutBit(bs, 0); - return; - - case 2: - BitstreamPutBit(bs, 1); - BitstreamPutBit(bs, 1); - return; - - default:; // invalid - } -} - -void -MBCodingBVOP(const MACROBLOCK * mb, - const int16_t qcoeff[6 * 64], - const int32_t fcode, - const int32_t bcode, - Bitstream * bs, - Statistics * pStat) -{ - int i; - -/* ------------------------------------------------------------------ - when a block is skipped it is decoded DIRECT(0,0) - hence is interpolated from forward & backward frames - ------------------------------------------------------------------ */ - - if (mb->mode == MODE_DIRECT_NONE_MV) { - BitstreamPutBit(bs, 1); // skipped - return; - } - - BitstreamPutBit(bs, 0); // not skipped - - if (mb->cbp == 0) { - BitstreamPutBit(bs, 1); // cbp == 0 - } else { - BitstreamPutBit(bs, 0); // cbp == xxx - } - - put_bvop_mbtype(bs, mb->mode); - - if (mb->cbp) { - BitstreamPutBits(bs, mb->cbp, 6); - } - - if (mb->mode != MODE_DIRECT && mb->cbp != 0) { - put_bvop_dbquant(bs, 0); // todo: mb->dquant = 0 - } - - if (mb->mode == MODE_INTERPOLATE || mb->mode == MODE_FORWARD) { - CodeVector(bs, mb->pmvs[0].x, fcode, pStat); - CodeVector(bs, mb->pmvs[0].y, fcode, pStat); - } - - if (mb->mode == MODE_INTERPOLATE || mb->mode == MODE_BACKWARD) { - CodeVector(bs, mb->b_pmvs[0].x, bcode, pStat); - CodeVector(bs, mb->b_pmvs[0].y, bcode, pStat); - } - - if (mb->mode == MODE_DIRECT) { - CodeVector(bs, mb->deltamv.x, 1, pStat); /* fcode is always 1 for delta vector */ - CodeVector(bs, mb->deltamv.y, 1, pStat); /* prediction is always (0,0) */ - } - - for (i = 0; i < 6; i++) { - if (mb->cbp & (1 << (5 - i))) { - CodeCoeff(bs, &qcoeff[i * 64], inter_table, scan_tables[0], 0); - } - } -} -#endif - - /***************************************************************************** * decoding stuff starts here ****************************************************************************/