From: Jingning Han Date: Thu, 27 Mar 2014 18:44:19 +0000 (-0700) Subject: Fix segment_id assignment in update_state_rt for AQ mode X-Git-Tag: v1.4.0~1952 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4a42047b4e8daa2265c2f82096b4c07834044ae2;p=libvpx Fix segment_id assignment in update_state_rt for AQ mode Properly obtain and buffer the segment_id in non-RD mode information update process. Change-Id: I43230001872f6a986d12c0d94e98fdec0db3be2c --- diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index 7c23973b8..1e5890cda 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -1405,7 +1405,7 @@ static int sb_has_motion(const VP9_COMMON *cm, MODE_INFO **prev_mi_8x8) { return 0; } -static void update_state_rt(VP9_COMP *cpi, const PICK_MODE_CONTEXT *ctx, +static void update_state_rt(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx, int mi_row, int mi_col, int bsize) { VP9_COMMON *const cm = &cpi->common; MACROBLOCK *const x = &cpi->mb; @@ -1413,15 +1413,11 @@ static void update_state_rt(VP9_COMP *cpi, const PICK_MODE_CONTEXT *ctx, MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi; const struct segmentation *const seg = &cm->seg; - // TODO(jingning) We might need PICK_MODE_CONTEXT to buffer coding modes - // associated with variable block sizes. Otherwise, remove this ctx - // from argument list. - (void)ctx; - *(xd->mi_8x8[0]) = ctx->mic; - // Check for reseting segment_id and update cyclic map. - if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ && seg->enabled) { + // For in frame adaptive Q, check for reseting the segment_id and updating + // the cyclic refresh map. + if ((cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) && seg->enabled) { vp9_cyclic_refresh_update_segment(cpi, &xd->mi_8x8[0]->mbmi, mi_row, mi_col, bsize, 1); vp9_init_plane_quantizers(cpi, x); @@ -1448,6 +1444,7 @@ static void encode_b_rt(VP9_COMP *cpi, const TileInfo *const tile, if (x->ab_index > 0) return; } + set_offsets(cpi, tile, mi_row, mi_col, bsize); update_state_rt(cpi, get_block_context(x, bsize), mi_row, mi_col, bsize); diff --git a/vp9/encoder/vp9_pickmode.c b/vp9/encoder/vp9_pickmode.c index bd3be907b..c500a0163 100644 --- a/vp9/encoder/vp9_pickmode.c +++ b/vp9/encoder/vp9_pickmode.c @@ -255,7 +255,7 @@ int64_t vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, mbmi->interp_filter = cpi->common.interp_filter == SWITCHABLE ? EIGHTTAP : cpi->common.interp_filter; mbmi->skip = 0; - mbmi->segment_id = 0; + mbmi->segment_id = segment_id; xd->interp_kernel = vp9_get_interp_kernel(mbmi->interp_filter); for (ref_frame = LAST_FRAME; ref_frame <= LAST_FRAME ; ++ref_frame) {