]> granicus.if.org Git - libx264/commitdiff
ratecontrol_new: Simplify an expression in HRD timescale calculation
authorHenrik Gramner <henrik@gramner.com>
Thu, 28 Jul 2016 17:33:57 +0000 (19:33 +0200)
committerAnton Mitrofanov <BugMaster@narod.ru>
Tue, 20 Sep 2016 18:01:54 +0000 (21:01 +0300)
Also gets rid of a false positive static analyser integer division warning.

encoder/ratecontrol.c

index 99277f1d7a4a890730a05ac23d34306bee900ec8..301ba0f7c41d2cc9691761678df0864699af5d09 100644 (file)
@@ -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 )