From 970eb39bdc931986c84c717afbc488cf4966dc0b Mon Sep 17 00:00:00 2001 From: Dmitry Kovalev Date: Thu, 31 Oct 2013 14:53:18 -0700 Subject: [PATCH] Cleaning up read_skip_coeff() function. Making code easier to read and avoiding calculation of skip context twice. Change-Id: I42c376b1a1811bc842bf6420bf81d2de7a1bf980 --- vp9/decoder/vp9_decodemv.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/vp9/decoder/vp9_decodemv.c b/vp9/decoder/vp9_decodemv.c index 475a29977..1ca578621 100644 --- a/vp9/decoder/vp9_decodemv.c +++ b/vp9/decoder/vp9_decodemv.c @@ -149,16 +149,17 @@ static int read_inter_segment_id(VP9_COMMON *const cm, MACROBLOCKD *const xd, return segment_id; } -static uint8_t read_skip_coeff(VP9_COMMON *const cm, MACROBLOCKD *const xd, - int segment_id, vp9_reader *r) { - int skip_coeff = vp9_segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP); - if (!skip_coeff) { +static int read_skip_coeff(VP9_COMMON *cm, const MACROBLOCKD *xd, + int segment_id, vp9_reader *r) { + if (vp9_segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP)) { + return 1; + } else { const int ctx = vp9_get_pred_context_mbskip(xd); - skip_coeff = vp9_read(r, vp9_get_pred_prob_mbskip(cm, xd)); + const int skip = vp9_read(r, cm->fc.mbskip_probs[ctx]); if (!cm->frame_parallel_decoding_mode) - ++cm->counts.mbskip[ctx][skip_coeff]; + ++cm->counts.mbskip[ctx][skip]; + return skip; } - return skip_coeff; } static void read_intra_frame_mode_info(VP9_COMMON *const cm, -- 2.40.0