From bde164d50f1936b28a9cd66f8be8d9995cc5a01b Mon Sep 17 00:00:00 2001 From: Jason Garrett-Glaser Date: Sat, 17 Jan 2009 15:16:37 -0500 Subject: [PATCH] Warn if direct auto wasn't set on the first pass And, if it wasn't, run direct auto as if it was the first pass, rather than simply forcing temporal direct mode on all frames. Also a small tweak to coeff_level_run asm. --- common/x86/quant-a.asm | 2 +- encoder/ratecontrol.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/common/x86/quant-a.asm b/common/x86/quant-a.asm index 6bedf8e7..394db3c3 100644 --- a/common/x86/quant-a.asm +++ b/common/x86/quant-a.asm @@ -826,7 +826,7 @@ cglobal x264_coeff_level_run%2_%1,0,7 mov t4d, %2-1 LZCOUNT t3d, t5d, 0x1f xor t6d, t6d - shl t5d, 1 + add t5d, t5d sub t4d, t3d shl t5d, t3b mov [t1], t4d diff --git a/encoder/ratecontrol.c b/encoder/ratecontrol.c index b74a0567..af0a00a0 100644 --- a/encoder/ratecontrol.c +++ b/encoder/ratecontrol.c @@ -441,6 +441,12 @@ int x264_ratecontrol_new( x264_t *h ) if( strstr( opts, "qp=0" ) && h->param.rc.i_rc_method == X264_RC_ABR ) x264_log( h, X264_LOG_WARNING, "1st pass was lossless, bitrate prediction will be inaccurate\n" ); + if( !strstr( opts, "direct=3" ) && h->param.analyse.i_direct_mv_pred == X264_DIRECT_PRED_AUTO ) + { + x264_log( h, X264_LOG_WARNING, "direct=auto not used on the first pass\n" ); + h->mb.b_direct_auto_write = 1; + } + if( ( p = strstr( opts, "b_adapt=" ) ) && sscanf( p, "b_adapt=%d", &i ) && i >= X264_B_ADAPT_NONE && i <= X264_B_ADAPT_TRELLIS ) h->param.i_bframe_adaptive = i; else if( h->param.i_bframe ) -- 2.47.3