View Full Version : About 1-pass stats file
MoonWalker
19th August 2002, 08:19
Where can I find some info about this?? How can I read it, cause I suppose it's not a txt file :)..
Thanks,
MoonWalker
Gannjunior
19th August 2002, 09:38
Try to use the "nandub stats files reader v 0.6".You can find it in Nandub section of Koepi's site.I have to try it,but I suppose it works with Xvid'stats too.
ciao :D
MoonWalker
19th August 2002, 10:04
Well I know the progs to read the stats file..The thing I want to do is to write my prog...And my question is : what is the struct of the stats file?How can I read it from C/C++??
Thanks anyway
MoonWalker
DaveEL
19th August 2002, 12:17
Right i havnt done any work with stats files for a while but i think the first 4 bytes are a version number (-21 should be the value iirc) then after that each frame has this info in the file ( from vfw/src/codec.h) not sure if all of this is still used as its the old nandub format
typedef struct
{
/* frame length (bytes) */
DWORD bytes;
/* ignored & zero'd by gk
xvid specific: dk_v = frame header bytes
*/
int dk_v, dk_u, dk_y;
int dd_v, dd_u, dd_y;
int mk_u, mk_y;
int md_u, md_y;
/* q used for this frame
set bit 31 for keyframe */
int quant;
/* key, motion, not-coded macroblocks */
int kblk, mblk, ublk;
/* lum_noise is actually a double (as 8 bytes)
for some reason msvc6.0 stores doubles as 12 bytes!?
lum_noise is not used so it doesnt matter */
float lum_noise[2];
} NNSTATS;
hope this helps
DaveEL
Aktan
20th August 2002, 19:03
I think DaveEl is right. When I looked at a stats with a hex editor, I got this:
int = 4 bytes
double = 8 bytes (tho it said in the comment it took 12 bytes, I didn't see it happening)
ver num? (int), frame size (frame0)(int), dk_v? (int), dk_u? (int), dk_y? (int), dd_v? (int), dd_u? (int), dd_y? (int), mk_u? (int), mk_y? (int), md_u? (int), md_y? (int), quant/? (should be 2 all the time :) )( the first 2 bytes (second?) is quant, the other 2 bytes i dunno what it is)(int), kblocks (frame0)(int), mblocks (frame0)(int), ublock? (int), lum_noise? (double), frame size (frame1)(int),....
I also noticed that whenever kblocks = 1160 (dec) and mblocks = 0 , then it is an intra frame (keyframe).
Koepi
20th August 2002, 19:31
Hm, you keyframe observation is only "half true".
The value depends on the total amount of blocks (16x16 pixels) of your video frame size, thus can be 880 or nearly anything ;)
We have a keyframe flag.
#define NNSTATS_KEYFRAME (1<<31)
You can get it with
(NNSTATS.quant & NNSTATS_KEYFRAME) ? is_keyframe : is_no_keyframe;
Regards,
Koepi
Aktan
20th August 2002, 21:47
Thx Koepi, I should have read the source posted by DaveEL more carefully :) .
So basicly if the quant int in the stats file is other than 2, then it is a intra frame. Aka if the quant int = 2147483650 Unsigned or -2147483646 Signed (31st bit is 1).
stax76
20th October 2002, 14:39
has somebody written some .NET code to read the XviD stats file, I want to make a compressibility test for XviD. Too bad I don't know how to deal with binary data. Maybe it's time now to learn about it
TheUnforgiven
22nd October 2002, 18:28
@dolemite
i have the code in VB6. i don't know about the changes in .net
stax76
22nd October 2002, 20:00
that's funny the code for DivX Comp Test was also VB6, Llemor helped me on that. But XviD is probably not so easy because it's binary. It would be great if you could support DVX. I'm not very experienced in coding and creating DivX copies. After I finished quite a few advanced features like special credits treatment, overhead calculation and compatibility with all XviD releases, I want to release a new beta soon :)
TheUnforgiven
22nd October 2002, 22:06
i wrote this code for perfectXviD
its my pleasure to help DVX
send me email to unforgiven@soon.com and i'll reply
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.