[x264-devel] ratecontrol_new: Simplify an expression in HRD timescale calculation

Henrik Gramner git at videolan.org
Tue Sep 20 20:57:51 CEST 2016


x264 | branch: master | Henrik Gramner <henrik at gramner.com> | Thu Jul 28 19:33:57 2016 +0200| [1e4fb55a283ba90fef346033027af851f2a04468] | committer: Anton Mitrofanov

ratecontrol_new: Simplify an expression in HRD timescale calculation

Also gets rid of a false positive static analyser integer division warning.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=1e4fb55a283ba90fef346033027af851f2a04468
---

 encoder/ratecontrol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/encoder/ratecontrol.c b/encoder/ratecontrol.c
index 99277f1..301ba0f 100644
--- a/encoder/ratecontrol.c
+++ b/encoder/ratecontrol.c
@@ -786,7 +786,7 @@ int x264_ratecontrol_new( x264_t *h )
         x264_reduce_fraction64( &num, &denom );
         rc->hrd_multiply_denom = 90000 / num;
 
-        double bits_required = log2( 90000 / rc->hrd_multiply_denom )
+        double bits_required = log2( num )
                              + log2( h->sps->vui.i_time_scale )
                              + log2( h->sps->vui.hrd.i_cpb_size_unscaled );
         if( bits_required >= 63 )



More information about the x264-devel mailing list