[x264-devel] clarification on rate control

Daniel Rogers daniel at phasevelocity.org
Wed Apr 5 21:42:15 CEST 2006


Hi,

Can someone please explain the rate control parameters to me?
This is going to be long, but I hope anyone reading this will just
answer the questions that they know, and move on from there.

As extra motivation, I'd be happy to write documentation for these
parameters if someone would only explain them to me.

questions 5, 6, 7, 8, and 9 are the most important ones to me.
Everything else is really there just to test my assumptions.

Q1: So, in the rc struct the first four parameters (all prefixed with
i_qp) are constant, min, max and step.  This is referred to CQP, which I
assume means Constant QP.  Am I correct in noticing that this affects
non-bitrate constrained video files and:
qp is either constant or it is a range defined by "min" and "max", and
the encoder is allowed to step up or step down qp between frames by the
about "step?"

Q2: if I am correct about Q1, does that mean that you can reduce the bit
rate of a constant qp file by increasing qp_min and qp_max and qp_step,
as well as increase the bit rate by lowering min, max and step?

Q3: if qp_constant is set, are min, max and step ignored?

Q2: Are the next block of parameters (cbr, bitrate, rf_constant,
rate_tolerance, vbv_max_bitrate, vbv_buffer_size, vbv_buffer_init,
ip_factor, bp_factor) are for a defined bitrate encoding, which is known
only as VBR? (I see the abbreviation ABR too, but not in the header file
and I don't know what it means).

Q4:  What is rf_constant?

Q5: how does rate_tolerance affect the variability of the bitrate?  (e.g
is it a percentange variability, or what?)

Q6: I get the feeling that the vbv_X parameters are the ones that are
most powerful for controlling maximum bit rate.  I want to understand
how to set a max bitrate in a file.  If my max_bitrate is, for example,
768, and I want the stream to be encoded as baseline (or main) level 1.3
so for conformance I cannot _ever_ exceed this value, what length of
vbv_buffer_size to I need to choose to ensure this happens?
Essentially, I want ffmpeg (or QuickTime) to report that the bitrate of
the file as more more than 768.  Another way of asking this question is,
how is the bitrate of the entire stream caculated, and how to I pick a
vbv_buffer_size and vbv_max_bitrate such that vbv_max_bitrate is greater
than or equal to the bitrate of the entire file?

Q7: My guess here is that the max 1 second long bit rate in the stream
determines the bitrate of the entire stream.  If so, does this mean that
a vbv_buffer_size equal to one second at my desired max bitrate will
suit me?  How does picking a larger or smaller vbv_buffer_size affect
the final bitrate of the stream.  Also, as an important clarification,
what are the units of vbv_buffer_size (ie bits or bytes)?

Q8: How do vbv_max_bitrate and rate_tolerance affect each other?

Q9: I belive that vbv_buffer_init represents how "full" the vbv_buffer
is considered at the beginning.  How is this value useful in limiting
the bitrate?  My guess is that it keeps the bitrate from getting too
high in the beginning.  Is this correct?

the next block (labeled 2pass) is obvious to me.

Q10: the 2pass params section doesn't make sense to me.  If anyone wants
to clarify these, I'd be grateful.

-- 
This is the x264-devel mailing-list
To unsubscribe, go to: http://developers.videolan.org/lists.html



More information about the x264-devel mailing list