On Thu, 12 Oct 2006, Balaji Raman wrote:

> I want to count the number of bits for each macroblock after VLD and IQ 
> task execution, also I want to count the number of bits for each 
> macroblock after IDCT and MC execution. Can you advice me how to do 
> this?

Hi Balaji,

Sounds fun! You should be able to do this by instrumenting 
libmpeg2/slice.c.

Correct me if I'm wrong, though, but are your quantities really that 
interesting/well-defined?

The output of inverse quantization (your first quantity) is a matrix of 
12-bit integer coefficients (clause 7.4.3). Isn't the size of this matrix 
(for a coded macroblock) just going to be the reconstructed size of the 
macroblock -- e.g., 8 * 8 * 6 elements for 4:2:0? If so, every coded 4:2:0 
macroblock is 12 * 8 * 8 * 6 bits at this stage -- not very interesting. 
You'd also have to add in the coded length of the as-yet-undecoded motion 
vectors (which, in fairness, require reference to previous macroblocks to 
decode; see cl. 7.6.3.1).

Your second quantity also seems unlikely to be that interesting if I 
understand you correctly. After you've done motion prediction, what left 
is there to do? You're done. The final decoded samples are just a matrix 
of 8-bit numbers (see cl. 7.6.8) the size of the reconstructed macroblock 
(e.g., 8 * 8 * 6 elements for 4:2:0). So a decoded 4:2:0 macroblock is 
always 8 * 8 * 8 * 6 bits.

So, if I understand you correctly, your first quantity is always just the 
length of the motion_vectors() in the macroblock() plus 4,608 (for coded 
4:2:0 macroblocks), and your second quantity is always 3,072 (for 4:2:0 
macroblocks with restricted slice structure).

Where am I going wrong?

-Keith

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Libmpeg2-devel mailing list
Libmpeg2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmpeg2-devel

Reply via email to