From: Geza Lore Date: Fri, 10 Jun 2016 08:32:21 +0000 (+0100) Subject: Select segment based loopfilter strength for supertx blocks. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=44b91a0e763e6f3c6ab148ba9d7ace371d5afa83;p=libvpx Select segment based loopfilter strength for supertx blocks. Segment based loopfilter strength for supertx coded blocks is now selected based on the minimum of all segment IDs within a supertx coded block (same as the quantiser settings). Change-Id: Ib056bd0d05f6a1d3b512a76deb4e2ad4db0f7dc4 --- diff --git a/vp10/common/loopfilter.c b/vp10/common/loopfilter.c index 17fb0f6f8..55715d7da 100644 --- a/vp10/common/loopfilter.c +++ b/vp10/common/loopfilter.c @@ -240,8 +240,16 @@ static void update_sharpness(loop_filter_info_n *lfi, int sharpness_lvl) { static uint8_t get_filter_level(const loop_filter_info_n *lfi_n, const MB_MODE_INFO *mbmi) { - return lfi_n->lvl[mbmi->segment_id][mbmi->ref_frame[0]] - [mode_lf_lut[mbmi->mode]]; +#if CONFIG_SUPERTX + const int segment_id = VPXMIN(mbmi->segment_id, mbmi->segment_id_supertx); + assert(IMPLIES(supertx_enabled(mbmi), + mbmi->segment_id_supertx != MAX_SEGMENTS)); + assert(IMPLIES(supertx_enabled(mbmi), + mbmi->segment_id_supertx <= mbmi->segment_id)); +#else + const int segment_id = mbmi->segment_id; +#endif // CONFIG_SUPERTX + return lfi_n->lvl[segment_id][mbmi->ref_frame[0]][mode_lf_lut[mbmi->mode]]; } void vp10_loop_filter_init(VP10_COMMON *cm) { diff --git a/vp10/decoder/decodeframe.c b/vp10/decoder/decodeframe.c index 53dbfcf87..437da9ac8 100644 --- a/vp10/decoder/decodeframe.c +++ b/vp10/decoder/decodeframe.c @@ -1309,6 +1309,8 @@ static void decode_block(VP10Decoder *const pbi, MACROBLOCKD *const xd, } #if CONFIG_SUPERTX + mbmi->segment_id_supertx = MAX_SEGMENTS; + if (supertx_enabled) { xd->corrupted |= vp10_reader_has_error(r); return; diff --git a/vp10/encoder/encodeframe.c b/vp10/encoder/encodeframe.c index 29492220e..014a87479 100644 --- a/vp10/encoder/encodeframe.c +++ b/vp10/encoder/encodeframe.c @@ -339,6 +339,10 @@ static void set_offsets(VP10_COMP *cpi, const TileInfo *const tile, mbmi->segment_id = 0; x->encode_breakout = cpi->encode_breakout; } + +#if CONFIG_SUPERTX + mbmi->segment_id_supertx = MAX_SEGMENTS; +#endif // CONFIG_SUPERTX } #if CONFIG_SUPERTX @@ -1329,6 +1333,7 @@ static void update_state_supertx(VP10_COMP *cpi, ThreadData *td, : cm->last_frame_seg_map; mi_addr->mbmi.segment_id = get_segment_id(cm, map, bsize, mi_row, mi_col); } + mi_addr->mbmi.segment_id_supertx = MAX_SEGMENTS; } // Restore the coding context of the MB to that that was in place