[x264-devel] commit: Warn if direct auto wasn't set on the first pass ( Jason Garrett-Glaser )

git version control git at videolan.org
Sun Jan 18 09:09:36 CET 2009


x264 | branch: master | Jason Garrett-Glaser <darkshikari at gmail.com> | Sat Jan 17 15:16:37 2009 -0500| [bde164d50f1936b28a9cd66f8be8d9995cc5a01b] | committer: Jason Garrett-Glaser 

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.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=bde164d50f1936b28a9cd66f8be8d9995cc5a01b
---

 common/x86/quant-a.asm |    2 +-
 encoder/ratecontrol.c  |    6 ++++++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/common/x86/quant-a.asm b/common/x86/quant-a.asm
index 6bedf8e..394db3c 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 b74a056..af0a00a 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 )



More information about the x264-devel mailing list