[Ffmpeg-devel] Quick question about snow
Wed May 24 23:25:19 CEST 2006
On Wed, 24 May 2006, Luca Abeni wrote:
> I am doing some experiments with the snow codec, and I am wondering how
> difficult would it be to implement 1-pass rate control in snow...
> I do not know much about the rate control code, but I'd like to encode
> snow video in real-time, respecting some bandwidth constraints. Would it
> be possible to encode snow video respecting rc_max_rate, rc_min_rate,
> and rc_buffer_size?
> How difficult would it be to do this?
The reason snow can easily reuse the 2nd pass ratecontrol but not
1pass CBR, is that snow runs motion estimation differently than lavc's
mpeg-* codecs. Rate-constrained ME needs to know the quantizer, but
ratecontrol needs to know the complexity of the current frame, which
depends on the results of ME.
lavc's mpeg-* solve this circular dependency by running ME in two parts:
first a fullpel precision search over the whole frame, then ratecontrol,
then subpel search and final encode. (This is needed for fcode/bcode
Snow (in "fast" modes) currently runs ME all at once. Iterative ME does
allow the separation for ratecontrol, but iterative ME is way too slow to
consider for realtime. (Also too slow to be recommended for the 1st pass
of a 2pass encode.)
Yes, it would be possible to use the split fullpel/subpel search in snow.
I don't know how much it would help or hurt speed or quality.
Further possible refinements: lavc's 1pass ratecontrol isn't all that
strict about enforcing CBR limits. One could refine the estimate of the
frame's complexity after running the DWT but before quantizing.
More information about the ffmpeg-devel