From c4644d878dc82f8812482f660f651948d53d4b43 Mon Sep 17 00:00:00 2001 From: Anton Mitrofanov Date: Sun, 9 Oct 2011 01:13:29 +0400 Subject: [PATCH] Fix use of uninitialized MVs in sub8x8 RDO --- encoder/analyse.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/encoder/analyse.c b/encoder/analyse.c index 579c2263..98a77c37 100644 --- a/encoder/analyse.c +++ b/encoder/analyse.c @@ -2659,10 +2659,12 @@ static void x264_mb_analyse_p_rd( x264_t *h, x264_mb_analysis_t *a, int i_satd ) for( subtype = D_L0_4x4; subtype <= D_L0_8x8; subtype++ ) { uint64_t cost; - if( costs[subtype] > sub8x8_thresh || (subtype == D_L0_8x8 && bcost == COST_MAX64) ) + if( costs[subtype] > sub8x8_thresh ) continue; h->mb.i_sub_partition[i] = subtype; x264_mb_cache_mv_p8x8( h, a, i ); + if( subtype == btype ) + continue; cost = x264_rd_cost_part( h, a->i_lambda2, i<<2, PIXEL_8x8 ); COPY2_IF_LT( bcost, cost, btype, subtype ); } -- 2.47.3