From 5e5470b2546478ceec5b7e70ac099b847c399f2b Mon Sep 17 00:00:00 2001 From: Jim Bankoski Date: Wed, 29 May 2013 12:34:10 -0700 Subject: [PATCH] fix valgrind warning scales for second reference frame vars are unitialized if the second ref frame is one of of those disallowed by refframeflags Change-Id: I4ce42de391178c1699dcaede18c5f12c84993c61 --- vp9/encoder/vp9_rdopt.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index 2eb3f9b29..cc1c480da 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -2567,11 +2567,6 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, this_mode = vp9_mode_order[mode_index].mode; ref_frame = vp9_mode_order[mode_index].ref_frame; - if (!(ref_frame == INTRA_FRAME - || (cpi->ref_frame_flags & flag_list[ref_frame]))) { - continue; - } - if (cpi->speed > 0 && bsize >= BLOCK_SIZE_SB8X8) { if (!(ref_frame_mask & (1 << ref_frame))) { continue; @@ -2589,6 +2584,15 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, mbmi->ref_frame = ref_frame; mbmi->second_ref_frame = vp9_mode_order[mode_index].second_ref_frame; + if (!(ref_frame == INTRA_FRAME + || (cpi->ref_frame_flags & flag_list[ref_frame]))) { + continue; + } + if (!(mbmi->second_ref_frame == NONE + || (cpi->ref_frame_flags & flag_list[mbmi->second_ref_frame]))) { + continue; + } + // TODO(jingning, jkoleszar): scaling reference frame not supported for // SPLITMV. if (mbmi->ref_frame > 0 &&