PDA

View Full Version : create "stats" file and quantizer 2 file


bergi
9th August 2002, 11:53
Using a avs file with mpeg2 decoder, bicubic resize, noise filter uses much cpu power. My thoughts, create the status file of the first pass and a quantizer 2 file at the same time (i'm not sure but i think quantizer2 encode -> decode -> quantizer2 endcode, all with yuv colors you would become the same as the source file. Higher quantizer means less quality so quantizer2 would be enough). If you do the second pass, you don't have to do the mpeg2 decoder, bicubic resize, noise filter. I think this could save a lot of time, or i'm wrong with my thougts?

athos
9th August 2002, 12:33
I was thinking something similar, on how to improve 2-pass speed.

My take is that perhaps it would be possible to analyze the source file, often mpeg-2 video, and from this information create a .stats file. Of course the relative framesizes of the original video will not correspond exactly to those produced by xvid, but i think this process would be a lot faster than "true" 2-pass, and still better than single pass when it comes to distribution of bits and filesize predictability.

This would not work in VFW i guess, because it takes uncompressed video as input, but rather as a standalone application to produce the .stats file for the second pass.

Any thoughts?

bergi
9th August 2002, 12:57
In the first pass of xvid, the video is compressed by quantizer 2 and only the size of the frame is saved to the stats file, so the only thing to do is save the compressed video already in the first pass. I thing this isn't much difficult, but perhaps Koepi could give us answers.

Peters
9th August 2002, 13:10
Originally posted by bergi
In the first pass of xvid, the video is compressed by quantizer 2 and only the size of the frame is saved to the stats file, so the only thing to do is save the compressed video already in the first pass. I thing this isn't much difficult, but perhaps Koepi could give us answers.

I'm not sure to understand.
Just uncheck "Discard first pass" and you got the quantizer 2 file from the first pass.

Sure, you will get a speed improvment but I don't think it's a good idea imho

athos
9th August 2002, 13:17
I understand, but i was thinking that what you are interested in for the first pass is the relative size of each frame. My take is you could get this from the original source, without decoding it and encoding to xvid.

-h
9th August 2002, 20:49
My take is that perhaps it would be possible to analyze the source file, often mpeg-2 video, and from this information create a .stats file. Of course the relative framesizes of the original video will not correspond exactly to those produced by xvid, but i think this process would be a lot faster than "true" 2-pass, and still better than single pass when it comes to distribution of bits and filesize predictability.

This could probably be done by XviD by scanning the .d2v file (if that's the source). I guess anyway, I have no idea what's in a .d2v file.

However, you are removing the burden of bit distribution from XviD to whomever authored the DVD - they could have used CBR for some passages, too low a bitrate for others, etc. And of course MPEG-2 and MPEG-4 will behave quite differently given the same source material. Another issue would be that the B-frames in the MPEG-2 file would be significantly smaller than the surrounding P-frames, and would have to be compensated for.

But yes it would be a way to get significantly better 1-pass encodes, if the DVD was authored well.

-h