[x264-devel] Improve mb_info constant mb optimization

Jason Garrett-Glaser git at videolan.org
Wed Sep 5 21:07:21 CEST 2012


x264 | branch: master | Jason Garrett-Glaser <jason at x264.com> | Mon Aug  6 14:55:35 2012 -0700| [174cfac6344a9fad1577cd1f449b7d0e625d6e28] | committer: Jason Garrett-Glaser

Improve mb_info constant mb optimization
Allow fast skipping even if the pskip MV isn't zero.

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

 encoder/analyse.c |   16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/encoder/analyse.c b/encoder/analyse.c
index 1c8a681..4f37067 100644
--- a/encoder/analyse.c
+++ b/encoder/analyse.c
@@ -3048,10 +3048,21 @@ intra_analysis:
         {
             /* Special fast-skip logic using information from mb_info. */
             if( h->fenc->mb_info && !SLICE_MBAFF && (h->fenc->mb_info[h->mb.i_mb_xy]&X264_MBINFO_CONSTANT) &&
-                !M32(h->mb.cache.pskip_mv) && (h->fenc->i_frame - h->fref[0][0]->i_frame) == 1 && !h->sh.b_weighted_pred &&
+                 (h->fenc->i_frame - h->fref[0][0]->i_frame) == 1 && !h->sh.b_weighted_pred &&
                 h->fref[0][0]->effective_qp[h->mb.i_mb_xy] <= h->mb.i_qp )
             {
-                b_skip = 1;
+                /* Use the P-SKIP MV if we can... */
+                if( !M32(h->mb.cache.pskip_mv) )
+                    b_skip = 1;
+                /* Otherwise, just force a 16x16 block. */
+                else
+                {
+                    h->mb.i_type = P_L0;
+                    h->mb.i_partition = D_16x16;
+                    analysis.l0.me16x16.i_ref = 0;
+                    M32( analysis.l0.me16x16.mv ) = 0;
+                    goto skip_analysis;
+                }
             }
             else
             {
@@ -3083,6 +3094,7 @@ intra_analysis:
             h->mb.i_type = P_SKIP;
             h->mb.i_partition = D_16x16;
             assert( h->mb.cache.pskip_mv[1] <= h->mb.mv_max_spel[1] || h->i_thread_frames == 1 );
+skip_analysis:
             /* Set up MVs for future predictors */
             for( int i = 0; i < h->mb.pic.i_fref[0]; i++ )
                 M32( h->mb.mvr[0][i][h->mb.i_mb_xy] ) = 0;



More information about the x264-devel mailing list