[XviD-devel] Statistics question

Michael Militzer michael at xvid.org
Thu Jan 19 23:24:29 CET 2006


Hi,

CodeBlockIntra/CodeBlockInter store how _many_ MBs of the current frame were
coded using intra or inter prediction type.

The number of bits required to code the motion vectors is really not 
included in the statistics. But you're right, for completeness it should.
I have added a iMVBits entry to the stats to the code on CVS HEAD. 

But even if you can't update to latest CVS version, it's rather easy to 
count the motion vector bits. You just need to wrap your counter around the
calls to CodeVector() in bitstream/mbcoding.c. Refer to latest CVS code.

Regard,
Michael


Quoting Sang-Uok Kum <ksu at unc.edu>:

> 
> I had a few questions about the Statistics calculated in the xvid encoder,
> and was wondering if someone could verify the following
> 
> 1. Statistics iTextBits: Sum of bits need to encode coefficents.
>    The only place I see them is in mbcoding.c
>    - CodeBlockIntra it only adds number of bits used to encode the
>      coefficients.
>    - CodeBlockInter it only adds number of bits used to encode the
>      coefficients.
> 
> 2. Statistics iMvCount: Total number of motion vectors in the frame. 
>    (in estimation_pvop.c motionStatsPVOP)
> 
> 3. Statistics iMvSum: Sum of (motion vector size)*(motion vector size)
>    (in estimation_pvop.c motionStatsPVOP)
> 
> 4. xvid_enc_stats_t hlength: The comment says
>      '/* [out] header length (bytes) */' but looking at the source code
>      it is 'frame->length - (frame->sStat.iTextBits / 8);' (in encoder.c 
>      call_plugins) it seems to be total of bytes used for encoding except 
>      the coefficients. Which means for Inter MBs the number of bits 
>      needed to encode the motion vectors is also included in the hlength.
> 
> I'm trying to calculate the number of bits needed to encode the motion
> vectors and was wondering if it is already done before I start putting
> in my own code.
> 
> thanks.
> _______________________________________________
> XviD-devel mailing list
> XviD-devel at xvid.org
> http://list.xvid.org/mailman/listinfo/xvid-devel
> 






More information about the XviD-devel mailing list