Dear all I'm currently using a simple encoding implementation based on the encoding example delivered with theora. Now i tried to change the quality of the output file. Its my understanding, that either a bitrate can be set for Constant Bitrate (CBR) encoding, or a quality (0-63) for Variable Bitrate (VBR). As you might know, the basic Encoder Example uses the so-called 2-Pass method for encoding. As a comment in the example code suggests, a "estimated bitrate" must be set for the 2-pass method to success. My code runs smoothly when I set a bitrate, but then the quality parameter seems useless. When I try to run the 2-pass method with bitrate=0 (--> VBR) and a quality between 0-63, my implementation will crash though. Is there any possibility to run the existing 2-pass method with the 0-63 range quality parameter? Thank you for your suggestions. Kind regards, Stefan
On 05/17/2010 04:09 AM, Stefan Weber wrote:> Dear all > > I'm currently using a simple encoding implementation based on the > encoding example delivered with theora. > Now i tried to change the quality of the output file. Its my > understanding, that either a bitrate can be set for Constant Bitrate > (CBR) encoding, or a quality (0-63) for Variable Bitrate (VBR). > > As you might know, the basic Encoder Example uses the so-called 2-Pass > method for encoding. As a comment in the example code suggests, a > "estimated bitrate" must be set for the 2-pass method to success. > > My code runs smoothly when I set a bitrate, but then the quality > parameter seems useless. When I try to run the 2-pass method with > bitrate=0 (--> VBR) and a quality between 0-63, my implementation will > crash though. > Is there any possibility to run the existing 2-pass method with the 0-63 > range quality parameter? Thank you for your suggestions. > > Kind regards, > Stefan >The 2-pass method only works when a bitrate is specified. It will use the first pass to see which portions of the video stream need more bits and which need less, and then it will use the 2nd pass to assign those bits throughout, in effect giving a "constant quality" for the whole file, but averaging out at the given bitrate. If you are seeking, instead, to ensure the entire video is encoded at a constant quality, somewhere between 0 - 63, then simply specify that and use single-pass encoding. Two-pass encoding is not necessary to get the video to be a specific quality throughout. There's no advantage to be had.
> Timothy Terriberry estimates a simple self-training range-coding > backend could be reasonably expected to decrease bit usage overhead by > 15-20%. > > Is it really true? I found one implementation.... > http://svn.xiph.org/trunk/ghost/libentcode/ > > Did anyone verified this gain? How much is the exact gain?The number quoted there comes from the result of similar experiments performed during the development of H.264 (they're in the JVT archives somewhere, but it's been years since I actually looked for this particular one). I think I originally told Monty "12-20%", but the exact number isn't really important as it varies from sequence to sequence, and also depends on how one sets up the context modeling, which is still more of an art than a science. No one has measured an exact value for Theora, that I know of.