[theora-dev] Dynamic Change Parameters..
xiphmont at xiph.org
xiphmont at xiph.org
Fri Feb 1 03:14:05 PST 2008
On Feb 1, 2008 5:29 AM, Asanka Dilruk <adilruk at gmail.com> wrote:
> I am going to improve theora codec with dynamically changing way. In this
> case we want to change compression parameters like video_q
Although the mainline encoder does not currently treat it this way,
the video_q is intended to work like a Lagrange multiplier, and the
internal qi is adjusted to optimize the actual encoding mode to match
the desired R/D tradeoff.
There are two ways to govern encoding with theora; one is to set up a
bitrate range to which it must stick (the lagrange multiplier and qi
both are manipulated internally to match a bitrate traget) and a
constant-quality mode where the lagrange multiplier is fixed and the
qi (actually, three qis for a given frame) are chosen to acheive the
best possible rate/distortion ratio.
In neither case should the application be manipulating the qi directly
on the fly.
The 'sharpness' parameter, as provided by VP3 and passed through to
the Theora api in the mainline, is essentially nonfunctional. I'm not
sure why On2 called it 'sharpness' but that's not what it did. In the
'Thusnelda' encoder, which will become the new mainline encoder
shortly, there is no such setting.
Actual sharpness control is acheived by manipulating the quantization
matricies and process, something that has deep-reaching effects on
every aspect of the codec's tuning. These numbers are not altered
lightly (although they can be altered, and in fact should/probably
will be altered considerably from what they currently are).
> keyframe is generated.
Again, a toplevel application has very little business making ths
decision. Keyframes are generated for only two reasons: The max
interval between keyframes has passed, or a keyframe would require
fewer bits than a P frame. Only the theora internals have any way of
knowing this information. A Keyframe (I frame) and a P frame will
have the same distortion characteristics. A keyframe is not higher
quality than P frame, just (usually) bigger and allows seeking.
> When i set video quality parameter using
> cpi->pb.info.quality in CommpressKeyFrame in encoder_toplevel it will not
> change dynamically. Can you please help me to do this. Wich function should
> i cange to achieve my objective....
You have not actually stated your objective, just what you're
attemting to do with theora (which is not going to work, at least not
as you describe).
Could you explain the end funtionality you're attempting to acheive
(ie, what you're really trying to do, not how you're trying to do it)?
More information about the theora-dev