[theora] Theora 1.1 rate controller
Thomas de Buman
tdbuman at gmail.com
Wed Jul 8 09:40:12 PDT 2009
I'm currently developing an adaptive videoconferencing application based on
Ekiga which uses TFRC as a congestion control mechanism to adapt the video
encoding rate according to the quality of the network experienced. My goal
was to use the open-source Theora codec for video transmission.
Unfortunately, it seemed that Theora 1.0 did not properly implement any
correct CBR mode. The encoding rates can be adjusted "on-the-fly" during
encoding by adjusting the "target_bitrate" and the "keyframe_target_bitrate"
variables of the "theora_info" structure, but the resulting average bitrate
is largely below the target bitrate desired. Furthermore, the bitrates vary
depending on the amount of motion captured, which is a typical VBR feature.
Here are the bitrates I measured (VGA resolution):
tx = target_bitrate (Mbps); ox = max rate observed at output of encoder
tx: 0.7 --> ox: 0.7
tx: 1.0 --> ox: 0.9
tx: 1.6 --> ox: 1.1
tx: 2.0 --> ox: 1.3
tx: 4.0 --> ox: 2.4
tx: 6.0 --> ox: 3.4
tx: 8.0 --> ox: 5.6
I also tested Theora 1.1 Thusnelda but no considerable improvement coud be
noticed, though I found contradictory information:
"According to Xiph.org's Ralph Giles, the most noticeable improvement in 1.1
is proper rate control, particularly for fixed bit rate encoding, where the
user specifies either the number of bits per second desired in the output (a
common use case for streaming applications), or the desired file size. "The
1.0 encoder relies a lot on heuristics, instead of trying to optimize
directly the trade-off between quality of the coded images and the number of
bits used to represent them," he said, "More significantly, the fixed
bitrate mode in the 1.0 reference encoder didn't really work; it just
guessed how to meet its target and often missed the requested bitrate,
sometimes by quite a bit, which was a problem for streaming and fixed-size
What is the exact behavior of rate controller in Theora and is or will be
CBR possible to use? At least, adaptive quantization is implemented (
http://wiki.xiph.org/Theora) but apparently not correctly to support CBR, or
am I missing something? I found that the quantizer values are adapted in
oc_enc_select_qi() and oc_enc_calc_lamba() without being able to define the
actual behavior of these functions...
Having a constant bitrate that does not adapt to variations in the image
content is really a crucial feature for my application.
Thank you for your inputs and clarifications! :)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the theora