MPEG Encoder Modes ExplainedIn the beginning, there was Constant Bit Rate
encoding. Chiariglione spake, "Let
there be CBR," and CBR came to BE and he saw that it was
good... CBR works, it's simple to code (by MPEG standards, at any rate) and only planets are more predictable. But nothing good ever stays simple. From the humble CBR root sprang three major varieties of Variable Bit Rate encoding:
VariancesThere are four variables you can add to any of the three main VBR styles: you can ask it to keep a minimum, maximum or average bit rate, or you can ask it to keep to a given Q level. All of the modes above imply at least one of these variables. Common combinations are:
PredictabilityAs you've seen, there are two main parameters an encoder is able to vary: quality and bit rate. With CBR, you've fixed the bit rate to a particular value, so the encoder can only vary the quality level to achieve that bit rate. A 1-pass average-based VBR mode works this way as well: it mainly varies the quality level to manage the bit rate. It will also let the bit rate vary a little as well, but in general, simple VBR encoders won't give a wildly variable bit rate curve. Modes with adjustable Q levels give the least predictable bit rates. (Or, if you will, they give the best-optimized bit rates for the video conditions.) How "unpredictable" are adjustable-Q modes, exactly? Just as one example, in a previous version of my TMPGEnc review, I reported that I used a quality level of 45 to achieve 3 Mbit/s with my test video. When I revised the review to cover a new version of the encoder, I needed a quality level of 53 to hit the same bit rate with the same video clip. This only goes to show that it's pointless to try and become expert in guessing the Q value required to hit a particular bit rate. Any time the smallest thing changes — the encoder's algorithm, the video's color balance, the video prefiltering setup, or any of a hundred other things — all your hard-won expertise becomes worthless. The best you can do is learn how to minimize the amount of experimentation you require to zero in on an acceptable bit rate. Your other option is to give the unpredictable modes a miss and use one of the predictable modes: a simple average-based VBR mode, most any N-pass VBR mode, or CBR. The main problem is that these modes usually give worse quality than pure CQ modes. With CBR the encoder is forced to vary the quality level to stick to your chosen bit rate. N-pass VBR is significantly better than CBR mode, but it doesn't give quality as high as the CQ modes. N-pass VBR's real advantage is that it has predictable encoding time as well as a predictable bit rate. As a compromise, you can choose a modified CQ mode, if one is available to you. If you use a min/max/Q mode, you can set the min and max far apart to mimic a plain CQ mode. Then, by sliding the min and max closer together, you mimic N-pass VBR modes a little better: by giving up absolute quality assurances, you gain the ability to predict the final bit rate a little better. The closer the min and max come together in this kind of encoder, the closer you approach a simple 1-pass average-based VBR mode. If you have an N-pass VBR mode that allows 3 or more passes, you can approach CQ quality, but with the assurance that you will only have to encode once. (This as opposed to most CQ modes, where you may miss the bit rate target because you chose not to constrain the encoder's min, max or average bit rates. Then you have to adjust your encoding parameters and try again, doubling your effective encode time.) Working With CQ ModesBecause CQ modes always give better results than regular VBR modes in all the encoders I've tried, I'm willing to tolerate their unpredictability. I prefer the completely unpredictable pure CQ modes to the ones with min/average/max settings, because these latter modes work more like regular VBR modes: the quality level ends up varying to satisfy the min/average/max constraints you've set. I rarely get the result I want with CQ modes on the first try. Instead, I usually have to make several tries. To avoid re-encoding the entire clip multiple times, I usually do my initial tests on a short but representative sample of the video. Then when I've got that video encoding the way I want it, I use those settings to do the whole video. If I've picked a truly representative test sample, the final output is close to what I expect it to be. ConclusionVBR modes are worth using, when you're not forced to use CBR. And when you can get away with it, pure CQ modes are the best VBR types of all. You have to work harder to get good video, but you can achieve absolutely stunning results with a properly-tuned CQ encoder. |
| Updated Mon Sep 22 2008 12:15 MDT | Go back to Videographica | Go to my home page |