--- trunk/xvidcore/src/bitstream/mbcoding.c 2005/09/13 12:12:15 1632 +++ trunk/xvidcore/src/bitstream/mbcoding.c 2006/01/19 22:25:23 1677 @@ -19,7 +19,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.52 2005-09-13 12:12:15 suxen_drol Exp $ + * $Id: mbcoding.c,v 1.53 2006-01-19 22:25:23 Isibaar Exp $ * ****************************************************************************/ @@ -572,6 +572,9 @@ #endif } } + + bits = BitstreamPos(bs); + /* code motion vector(s) if motion is local */ if (!pMB->mcsel) for (i = 0; i < (pMB->mode == MODE_INTER4V ? 4 : 1); i++) { @@ -579,6 +582,9 @@ CodeVector(bs, pMB->pmvs[i].y, frame->fcode); } + bits = BitstreamPos(bs) - bits; + pStat->iMVBits += bits; + bits = BitstreamPos(bs); /* code block coeffs */ @@ -746,6 +752,7 @@ } } + bits = BitstreamPos(bs); switch (mb->mode) { case MODE_INTERPOLATE: @@ -762,6 +769,7 @@ CodeVector(bs, mb->pmvs[3].y, 1); /* prediction is always (0,0) */ default: break; } + pStat->iMVBits += BitstreamPos(bs) - bits; bits = BitstreamPos(bs); for (i = 0; i < 6; i++) {