Commit 970eb39b authored by Dmitry Kovalev's avatar Dmitry Kovalev
Browse files

Cleaning up read_skip_coeff() function.

Making code easier to read and avoiding calculation of skip context twice.

Change-Id: I42c376b1a1811bc842bf6420bf81d2de7a1bf980
parent 25a2740a
......@@ -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,
static int read_skip_coeff(VP9_COMMON *cm, const MACROBLOCKD *xd,
int segment_id, vp9_reader *r) {
int skip_coeff = vp9_segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP);
if (!skip_coeff) {
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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment