after a 1pass ABR, print the value of --crf which would result in the same bitrate.
authorLoren Merritt <pengvado@videolan.org>
Tue, 22 Nov 2005 02:48:39 +0000 (02:48 +0000)
committerLoren Merritt <pengvado@videolan.org>
Tue, 22 Nov 2005 02:48:39 +0000 (02:48 +0000)
git-svn-id: svn://svn.videolan.org/x264/trunk@371 df754926-b1dd-0310-bc7b-ec298dee348c

encoder/encoder.c
encoder/ratecontrol.c
encoder/ratecontrol.h

index 9cbb28b..457a34d 100644 (file)
@@ -1669,6 +1669,8 @@ void    x264_encoder_close  ( x264_t *h )
                   i_mb_count[B_SKIP]   / i_count );
     }
 
+    x264_ratecontrol_summary( h );
+
     if( h->stat.i_slice_count[SLICE_TYPE_I] + h->stat.i_slice_count[SLICE_TYPE_P] + h->stat.i_slice_count[SLICE_TYPE_B] > 0 )
     {
         const int i_count = h->stat.i_slice_count[SLICE_TYPE_I] +
index 4a7cc5c..cda8797 100644 (file)
@@ -437,6 +437,18 @@ static int parse_zones( x264_t *h )
     return 0;
 }
 
+void x264_ratecontrol_summary( x264_t *h )
+{
+    x264_ratecontrol_t *rc = h->rc;
+    if( rc->b_abr && !h->param.rc.i_rf_constant && !h->param.rc.i_vbv_max_bitrate )
+    {
+        double base_cplx = h->mb.i_mb_count * (h->param.i_bframe ? 120 : 80);
+        x264_log( h, X264_LOG_INFO, "final ratefactor: %.2f\n", 
+                  qscale2qp( pow( base_cplx, 1 - h->param.rc.f_qcompress )
+                             * rc->cplxr_sum / rc->wanted_bits_window ) );
+    }
+}
+
 void x264_ratecontrol_delete( x264_t *h )
 {
     x264_ratecontrol_t *rc = h->rc;
index a7a6a46..ceb5083 100644 (file)
@@ -32,6 +32,7 @@ int  x264_ratecontrol_slice_type( x264_t *, int i_frame );
 void x264_ratecontrol_mb( x264_t *, int bits );
 int  x264_ratecontrol_qp( x264_t * );
 void x264_ratecontrol_end( x264_t *, int bits );
+void x264_ratecontrol_summary( x264_t * );
 
 #endif