From: Loren Merritt Date: Tue, 22 Nov 2005 02:48:39 +0000 (+0000) Subject: after a 1pass ABR, print the value of --crf which would result in the same bitrate. X-Git-Url: http://www.zmx.ovh/git.videolan.org/?a=commitdiff_plain;h=bc478923aefe1e4aa5e0201b2214f1ed8ad8f719;p=x264.git after a 1pass ABR, print the value of --crf which would result in the same bitrate. git-svn-id: svn://svn.videolan.org/x264/trunk@371 df754926-b1dd-0310-bc7b-ec298dee348c --- diff --git a/encoder/encoder.c b/encoder/encoder.c index 9cbb28b1..457a34d1 100644 --- a/encoder/encoder.c +++ b/encoder/encoder.c @@ -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] + diff --git a/encoder/ratecontrol.c b/encoder/ratecontrol.c index 4a7cc5c5..cda87979 100644 --- a/encoder/ratecontrol.c +++ b/encoder/ratecontrol.c @@ -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; diff --git a/encoder/ratecontrol.h b/encoder/ratecontrol.h index a7a6a46e..ceb50830 100644 --- a/encoder/ratecontrol.h +++ b/encoder/ratecontrol.h @@ -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