From c9155d3e9fbe646e2504c09b5b751f7279900522 Mon Sep 17 00:00:00 2001 From: Loren Merritt Date: Wed, 24 May 2006 03:59:19 +0000 Subject: [PATCH] convert non-fatal errors to message level "warning". git-svn-id: svn://svn.videolan.org/x264/trunk@527 df754926-b1dd-0310-bc7b-ec298dee348c --- encoder/cavlc.c | 2 +- encoder/encoder.c | 2 +- encoder/ratecontrol.c | 24 ++++++++++++------------ encoder/slicetype_decision.c | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/encoder/cavlc.c b/encoder/cavlc.c index 27a98e92..b6ee9306 100644 --- a/encoder/cavlc.c +++ b/encoder/cavlc.c @@ -209,7 +209,7 @@ static void block_residual_write_cavlc( x264_t *h, bs_t *s, int i_idx, int *l, i if( i_level_code >= ( 1 << 12 ) || i_level_code < 0 ) { - x264_log(h, X264_LOG_ERROR, "OVERFLOW levelcode=%d\n", i_level_code ); + x264_log(h, X264_LOG_WARNING, "OVERFLOW levelcode=%d\n", i_level_code ); } bs_write( s, 12, i_level_code ); /* check overflow ?? */ diff --git a/encoder/encoder.c b/encoder/encoder.c index 996d4b0a..08480af6 100644 --- a/encoder/encoder.c +++ b/encoder/encoder.c @@ -507,7 +507,7 @@ x264_t *x264_encoder_open ( x264_param_t *param ) h->param.vui.i_sar_height = 0; if( i_w == 0 || i_h == 0 ) { - x264_log( h, X264_LOG_ERROR, "cannot create valid sample aspect ratio\n" ); + x264_log( h, X264_LOG_WARNING, "cannot create valid sample aspect ratio\n" ); } else { diff --git a/encoder/ratecontrol.c b/encoder/ratecontrol.c index 51541281..410fdd12 100644 --- a/encoder/ratecontrol.c +++ b/encoder/ratecontrol.c @@ -218,7 +218,7 @@ int x264_ratecontrol_new( x264_t *h ) 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"); + x264_log(h, X264_LOG_WARNING, "VBV is incompatible with constant QP.\n"); if( h->param.rc.i_vbv_buffer_size && h->param.rc.b_cbr && h->param.rc.i_vbv_max_bitrate == 0 ) { @@ -227,13 +227,13 @@ int x264_ratecontrol_new( x264_t *h ) } if( h->param.rc.i_vbv_max_bitrate < h->param.rc.i_bitrate && h->param.rc.i_vbv_max_bitrate > 0) - x264_log(h, X264_LOG_ERROR, "max bitrate less than average bitrate, ignored.\n"); + x264_log(h, X264_LOG_WARNING, "max bitrate less than average bitrate, ignored.\n"); else if( h->param.rc.i_vbv_max_bitrate > 0 && h->param.rc.i_vbv_buffer_size > 0 ) { if( h->param.rc.i_vbv_buffer_size < 3 * h->param.rc.i_vbv_max_bitrate / rc->fps ) { h->param.rc.i_vbv_buffer_size = 3 * h->param.rc.i_vbv_max_bitrate / rc->fps; - x264_log( h, X264_LOG_ERROR, "VBV buffer size too small, using %d kbit\n", + x264_log( h, X264_LOG_WARNING, "VBV buffer size too small, using %d kbit\n", h->param.rc.i_vbv_buffer_size ); } rc->buffer_rate = h->param.rc.i_vbv_max_bitrate * 1000 / rc->fps; @@ -244,9 +244,9 @@ int x264_ratecontrol_new( x264_t *h ) rc->b_vbv = 1; } else if( h->param.rc.i_vbv_max_bitrate ) - x264_log(h, X264_LOG_ERROR, "VBV maxrate specified, but no bufsize.\n"); + x264_log(h, X264_LOG_WARNING, "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"); + x264_log(h, X264_LOG_WARNING, "bitrate tolerance too small, using .01\n"); rc->rate_tolerance = 0.01; } @@ -1473,27 +1473,27 @@ static int init_pass2( x264_t *h ) avgq += rcc->entry[i].new_qscale; avgq = qscale2qp(avgq / rcc->num_entries); - x264_log(h, X264_LOG_ERROR, "Error: 2pass curve failed to converge\n"); - x264_log(h, X264_LOG_ERROR, "target: %.2f kbit/s, expected: %.2f kbit/s, avg QP: %.4f\n", + x264_log(h, X264_LOG_WARNING, "Error: 2pass curve failed to converge\n"); + x264_log(h, X264_LOG_WARNING, "target: %.2f kbit/s, expected: %.2f kbit/s, avg QP: %.4f\n", (float)h->param.rc.i_bitrate, expected_bits * rcc->fps / (rcc->num_entries * 1000.), avgq); if(expected_bits < all_available_bits && avgq < h->param.rc.i_qp_min + 2) { if(h->param.rc.i_qp_min > 0) - x264_log(h, X264_LOG_ERROR, "try reducing target bitrate or reducing qp_min (currently %d)\n", h->param.rc.i_qp_min); + x264_log(h, X264_LOG_WARNING, "try reducing target bitrate or reducing qp_min (currently %d)\n", h->param.rc.i_qp_min); else - x264_log(h, X264_LOG_ERROR, "try reducing target bitrate\n"); + x264_log(h, X264_LOG_WARNING, "try reducing target bitrate\n"); } else if(expected_bits > all_available_bits && avgq > h->param.rc.i_qp_max - 2) { if(h->param.rc.i_qp_max < 51) - x264_log(h, X264_LOG_ERROR, "try increasing target bitrate or increasing qp_max (currently %d)\n", h->param.rc.i_qp_max); + x264_log(h, X264_LOG_WARNING, "try increasing target bitrate or increasing qp_max (currently %d)\n", h->param.rc.i_qp_max); else - x264_log(h, X264_LOG_ERROR, "try increasing target bitrate\n"); + x264_log(h, X264_LOG_WARNING, "try increasing target bitrate\n"); } else - x264_log(h, X264_LOG_ERROR, "internal error\n"); + x264_log(h, X264_LOG_WARNING, "internal error\n"); } return 0; diff --git a/encoder/slicetype_decision.c b/encoder/slicetype_decision.c index f6aff9f5..cfbc7305 100644 --- a/encoder/slicetype_decision.c +++ b/encoder/slicetype_decision.c @@ -393,7 +393,7 @@ void x264_slicetype_decide( x264_t *h ) if( frm->i_type == X264_TYPE_AUTO ) frm->i_type = X264_TYPE_IDR; if( frm->i_type != X264_TYPE_IDR ) - x264_log( h, X264_LOG_ERROR, "specified frame type (%d) is not compatible with keyframe interval\n", frm->i_type ); + x264_log( h, X264_LOG_WARNING, "specified frame type (%d) is not compatible with keyframe interval\n", frm->i_type ); } if( frm->i_type == X264_TYPE_IDR ) { @@ -413,7 +413,7 @@ void x264_slicetype_decide( x264_t *h ) || h->frames.next[bframes+1] == NULL ) { if( IS_X264_TYPE_B( frm->i_type ) ) - x264_log( h, X264_LOG_ERROR, "specified frame type is not compatible with max B-frames\n" ); + x264_log( h, X264_LOG_WARNING, "specified frame type is not compatible with max B-frames\n" ); if( frm->i_type == X264_TYPE_AUTO || IS_X264_TYPE_B( frm->i_type ) ) frm->i_type = X264_TYPE_P; -- 2.39.5