From 1e80b69b3717e019f6cbab071582f9812b85fa4d Mon Sep 17 00:00:00 2001 From: Loren Merritt Date: Thu, 3 Nov 2005 22:57:52 +0000 Subject: [PATCH] if p16x16 RD decides to code a MB as p_skip, then don't check smaller partitions. git-svn-id: svn://svn.videolan.org/x264/trunk@361 df754926-b1dd-0310-bc7b-ec298dee348c --- encoder/analyse.c | 4 ++++ encoder/rdo.c | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/encoder/analyse.c b/encoder/analyse.c index 1869a145..cdf785a4 100644 --- a/encoder/analyse.c +++ b/encoder/analyse.c @@ -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 ) diff --git a/encoder/rdo.c b/encoder/rdo.c index 988b4d4e..c596271e 100644 --- a/encoder/rdo.c +++ b/encoder/rdo.c @@ -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; -- 2.40.0