View Full Version : Quantization factor definetion needed
poopity poop
30th April 2002, 04:51
I was doing some tests with DIvX 5 and I set it at CQ at DRF 2 ( 100%) and I Was getting a bitrate of around 1500Kbps. Then for kicks I did a 1-pass and jecked the bitrate to 10000Kbps, again I got a birate of 1500Kbps. This and the definition of quantization from Physics leads me to believe this
Tell me if wha tI say is correct:
if I was an encoder and I need to encode a frame, I have a choise of ONLY 31 bitrates to set it at. a DRF of 2, 3, 4, 5, etc. Its not like I can set the bits of a frame to 245 or 246 or 396, I have to set it to a DRF? Or does the encoder say I want to encode this at 3 DRF and due to the complexit it comes out to differnt bits. Again I'm talking about individual frames.
Someone explain how an encoder actual works. I really want to know so I can make better decisions
Acaila
30th April 2002, 10:30
if I was an encoder and I need to encode a frame...
Now, wouldn't that be fun :D
I was doing some tests with DIvX 5 and I set it at CQ at DRF 2 ( 100%) and I Was getting a bitrate of around 1500Kbps. Then for kicks I did a 1-pass and jecked the bitrate to 10000Kbps, again I got a birate of 1500Kbps.
When you set the bitrate for 10000Kbps the encoder will try to use this many bits, but it has a lower limit of quants of 2 to achieve this bitrate. Thus every frame will get a "2" and you'll get the same file a your first encode.
Anyway, this is how I see it:
First pass:
Each frame is checked for what the complexity and motion is and this info is saved in the logfile.
There's a big difference here between DivX4/5 <-> DivX3/XviD, because the first already use calculated quantizers to get as close to the bitrate as possible, while the latter uses fixed quantizers of 2 to calculate the second pass from the maximum quality perspective.
Second pass:
The codec reads the info from the log to find the current frame's properties, and reads the target bitrate you have set yourself. With these things in hand it calculates at what quantizer this frame will achieve the amount of bits that would correspond to the bitrate you have set. With a certain flexibility. The frame gets quantized like calculated and the encoder proceeds to the next frame. Here the same process starts again, checking properties, bitrate and calculating quantizer. However because the final size of all already encoded frames in now known it takes this "deviation" also into the equation. So if the proceding frames are too big to achieve the target bitrate it will compensate by quantizing the current frame more, so the final deviation will be reduced.
That's just a rough explanation though.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.