[x264-devel] Re: [MOD] [PATCH] Rate control

Loren Merritt lorenm at u.washington.edu
Tue Aug 10 22:30:18 CEST 2004


On Sun, 8 Aug 2004, [iso-8859-1] Måns Rullgård wrote:

> Laurent Aimar <fenrir at via.ecp.fr> writes:
>
> >  It seems to work pretty well :) but from my (really too) limited tests,
> > it seems to always produce lower bitrate than requested (semething like
> > 5-7%).
>
> Which number did you look at?  The rate printed by x264_encoder_close
> is always a bit lower than the actual file size.  Which of these
> should be the target?

I noticed that the rate printed by x264 was always less than the rate
printed by mencoder (which was equal to my requested bitrate). Then I
noticed that my requested bitrate was in k=1000 while the reported
rate was in k=1024.

--Loren Merritt
-------------- next part --------------
Index: encoder/encoder.c
===================================================================
--- encoder/encoder.c	(revision 23)
+++ encoder/encoder.c	(working copy)
@@ -1316,7 +1316,7 @@
 
                  x264_psnr( h->stat.i_sqe_global[SLICE_TYPE_I] + h->stat.i_sqe_global[SLICE_TYPE_P]+ h->stat.i_sqe_global[SLICE_TYPE_B],
                             i_count * i_yuv_size ),
-                 h->param.f_fps * 8*(h->stat.i_slice_size[SLICE_TYPE_I]+h->stat.i_slice_size[SLICE_TYPE_P]+h->stat.i_slice_size[SLICE_TYPE_B]) / i_count / 1024,
+                 h->param.f_fps * 8*(h->stat.i_slice_size[SLICE_TYPE_I]+h->stat.i_slice_size[SLICE_TYPE_P]+h->stat.i_slice_size[SLICE_TYPE_B]) / i_count / 1000,
                  (double)1000000.0 * (double)i_count / (double)i_mtime_encode_frame );
     }
 #endif


More information about the x264-devel mailing list