From 6da9fc956cdafd6dde4c334568c18bd7bef292c1 Mon Sep 17 00:00:00 2001 From: Loren Merritt Date: Mon, 23 Jan 2006 02:02:50 +0000 Subject: [PATCH] print --nr in sei params. tweak ratecontrol param checking. git-svn-id: svn://svn.videolan.org/x264/trunk@409 df754926-b1dd-0310-bc7b-ec298dee348c --- common/common.c | 7 +++++-- encoder/ratecontrol.c | 9 ++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/common/common.c b/common/common.c index f309dc31..927eeb48 100644 --- a/common/common.c +++ b/common/common.c @@ -457,6 +457,7 @@ char *x264_param2string( x264_param_t *p, int b_res ) s += sprintf( s, " cqm=%d", p->i_cqm_preset ); s += sprintf( s, " chroma_qp_offset=%d", p->analyse.i_chroma_qp_offset ); s += sprintf( s, " slices=%d", p->i_threads ); + s += sprintf( s, " nr=%d", p->analyse.i_noise_reduction ); s += sprintf( s, " bframes=%d", p->i_bframe ); if( p->i_bframe ) @@ -470,7 +471,9 @@ char *x264_param2string( x264_param_t *p, int b_res ) s += sprintf( s, " keyint=%d keyint_min=%d scenecut=%d", p->i_keyint_max, p->i_keyint_min, p->i_scenecut_threshold ); - s += sprintf( s, " pass=%d", p->rc.b_stat_read ? 2 : 1 ); + s += sprintf( s, " rc=%s", p->rc.b_stat_read && p->rc.b_cbr ? "2pass" : + p->rc.b_cbr ? p->rc.i_vbv_buffer_size ? "cbr" : "abr" : + p->rc.i_rf_constant ? "crf" : "cqp" ); if( p->rc.b_cbr || p->rc.i_rf_constant ) { if( p->rc.i_rf_constant ) @@ -484,7 +487,7 @@ char *x264_param2string( x264_param_t *p, int b_res ) if( p->rc.b_stat_read ) s += sprintf( s, " cplxblur=%.1f qblur=%.1f", p->rc.f_complexity_blur, p->rc.f_qblur ); - if( p->rc.i_vbv_max_bitrate && p->rc.i_vbv_buffer_size ) + if( p->rc.i_vbv_buffer_size ) s += sprintf( s, " vbv_maxrate=%d vbv_bufsize=%d", p->rc.i_vbv_max_bitrate, p->rc.i_vbv_buffer_size ); } diff --git a/encoder/ratecontrol.c b/encoder/ratecontrol.c index b9b4363d..94927e47 100644 --- a/encoder/ratecontrol.c +++ b/encoder/ratecontrol.c @@ -189,8 +189,11 @@ int x264_ratecontrol_new( x264_t *h ) rc->last_non_b_pict_type = -1; rc->cbr_decay = 1.0; - if( rc->b_2pass && h->param.rc.i_rf_constant ) + if( h->param.rc.i_rf_constant && h->param.rc.b_stat_read ) + { x264_log(h, X264_LOG_ERROR, "constant rate-factor is incompatible with 2pass.\n"); + return -1; + } if( h->param.rc.i_vbv_buffer_size && !h->param.rc.b_cbr && !h->param.rc.i_rf_constant ) x264_log(h, X264_LOG_ERROR, "VBV is incompatible with constant QP.\n"); if( h->param.rc.i_vbv_buffer_size && h->param.rc.b_cbr @@ -216,8 +219,8 @@ int x264_ratecontrol_new( x264_t *h ) rc->cbr_decay = 1.0 - rc->buffer_rate / rc->buffer_size * 0.5 * X264_MAX(0, 1.5 - rc->buffer_rate * rc->fps / rc->bitrate); } - else if( h->param.rc.i_vbv_max_bitrate || h->param.rc.i_vbv_buffer_size ) - x264_log(h, X264_LOG_ERROR, "VBV maxrate or buffer size specified, but not both.\n"); + else if( h->param.rc.i_vbv_max_bitrate ) + x264_log(h, X264_LOG_ERROR, "VBV maxrate specified, but no bufsize.\n"); if(rc->rate_tolerance < 0.01) { x264_log(h, X264_LOG_ERROR, "bitrate tolerance too small, using .01\n"); rc->rate_tolerance = 0.01; -- 2.40.0