]> granicus.if.org Git - libx264/commitdiff
if p16x16 RD decides to code a MB as p_skip, then don't check smaller partitions.
authorLoren Merritt <pengvado@videolan.org>
Thu, 3 Nov 2005 22:57:52 +0000 (22:57 +0000)
committerLoren Merritt <pengvado@videolan.org>
Thu, 3 Nov 2005 22:57:52 +0000 (22:57 +0000)
git-svn-id: svn://svn.videolan.org/x264/trunk@361 df754926-b1dd-0310-bc7b-ec298dee348c

encoder/analyse.c
encoder/rdo.c

index 1869a145e2812f15d458633b9251028e4485cb4f..cdf785a46dd03c70bf1e6d777f3cc1a749d1b8cd 100644 (file)
@@ -1686,6 +1686,10 @@ void x264_macroblock_analyse( x264_t *h )
             x264_mb_analyse_load_costs( h, &analysis );
 
             x264_mb_analyse_inter_p16x16( h, &analysis );
+
+            if( analysis.b_mbrd && h->mb.i_type == P_SKIP )
+                return;
+
             if( flags & X264_ANALYSE_PSUB16x16 )
             {
                 if( h->param.analyse.b_mixed_references )
index 988b4d4ea0748524318b8b7fec684b4021fa6072..c596271eebec772c1bdd13af1d933f07260cf4d8 100644 (file)
@@ -49,8 +49,6 @@
 
 static int x264_rd_cost_mb( x264_t *h, int i_lambda2 )
 {
-    // backup mb_type because x264_macroblock_encode may change it to skip
-    int i_type_bak = h->mb.i_type;
     int b_transform_bak = h->mb.b_transform_8x8;
     int i_ssd;
     int i_bits;
@@ -82,7 +80,7 @@ static int x264_rd_cost_mb( x264_t *h, int i_lambda2 )
         x264_macroblock_size_cavlc( h, &bs_tmp );
         i_bits = bs_tmp.i_bits_encoded * i_lambda2;
     }
-    h->mb.i_type = i_type_bak;
+
     h->mb.b_transform_8x8 = b_transform_bak;
 
     return i_ssd + i_bits;