[x264-devel] Re: [MOD] [PATCH] Rate control
Måns Rullgård
mru at mru.ath.cx
Wed Aug 11 22:21:16 CEST 2004
Loren Merritt <lorenm at u.washington.edu> writes:
> On Tue, 10 Aug 2004, [iso-8859-1] Måns Rullgård wrote:
>
>> OK, so my rate control is working after all? For bitrates I think
>> traditionally 1k is considered to be equal to 1000, as your patch
>> changes the output to. I'll leave it to Laurent to decide what to do
>> with the patch though.
>
> Working? I didn't say that.
Is it non-working in some specific manner?
> The 1000->1024 was just the first bug I find. Here is (hopefully)
> the rest of the patch. Then I can return to 2-pass rate control.
>
> --Loren Merritt
>
> Index: encoder/ratecontrol.c
> ===================================================================
> --- encoder/ratecontrol.c (revision 24)
> +++ encoder/ratecontrol.c (working copy)
> @@ -83,7 +83,7 @@
> rc->qpa = rc->qp;
> rc->qpm = rc->qp;
>
> - rc->buffer_size = h->param.i_rc_buffer_size;
> + rc->buffer_size = h->param.i_rc_buffer_size * 1000;
That's just a matter of taste. If I apply that I'll have change all
my configuration files to use kilobits instead. Maybe guessing
whether the user was thinking in bits or kilobits based on the size of
the number would work. What would be a reasonable threshold? Is it
safe to assume that anything below 10000 is kilobits rather than bits?
The same method could be used for the bitrate. Or would this just be
a bad case of trying to be smart?
> - if(rc->fbits > 0.8 * maxbits)
> + if(rc->fbits > 0.9 * maxbits)
Oh, how embarrassing for me. I'm fixing it right away.
--
Måns Rullgård
mru at mru.ath.cx
--
This is the x264-devel mailing-list
If you are in trouble, please contact <postmaster at videolan.org>
More information about the x264-devel
mailing list