diff options
author | Paul Wilkins <paulwilkins@google.com> | 2013-01-28 15:22:53 +0000 |
---|---|---|
committer | Paul Wilkins <paulwilkins@google.com> | 2013-01-28 17:28:04 +0000 |
commit | 0ff9b033b09fcf21a6c929102bf45b0e473eed0e (patch) | |
tree | 31c45b5fb5007502485be44c94003fc73241e319 /vp9/encoder | |
parent | 8e2c03fbfd7a1add56c03fc265600e714fcd0cd8 (diff) | |
download | libvpx-0ff9b033b09fcf21a6c929102bf45b0e473eed0e.tar libvpx-0ff9b033b09fcf21a6c929102bf45b0e473eed0e.tar.gz libvpx-0ff9b033b09fcf21a6c929102bf45b0e473eed0e.tar.bz2 libvpx-0ff9b033b09fcf21a6c929102bf45b0e473eed0e.zip |
Segment Skip Flag
First step in simplifying the segment mode and
segment EOB flags into a simpler segment skip
flag that implies 0,0 mv and EOB at position 0.
Change-Id: Ib750cac31a7a02dc21082580498efd9f7d8d72a5
Diffstat (limited to 'vp9/encoder')
-rw-r--r-- | vp9/encoder/vp9_bitstream.c | 34 | ||||
-rw-r--r-- | vp9/encoder/vp9_encodeframe.c | 21 | ||||
-rw-r--r-- | vp9/encoder/vp9_onyx_if.c | 29 | ||||
-rw-r--r-- | vp9/encoder/vp9_quantize.c | 39 | ||||
-rw-r--r-- | vp9/encoder/vp9_rdopt.c | 60 | ||||
-rw-r--r-- | vp9/encoder/vp9_tokenize.c | 10 |
6 files changed, 69 insertions, 124 deletions
diff --git a/vp9/encoder/vp9_bitstream.c b/vp9/encoder/vp9_bitstream.c index 34d27d1be..27d505bce 100644 --- a/vp9/encoder/vp9_bitstream.c +++ b/vp9/encoder/vp9_bitstream.c @@ -729,8 +729,7 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m, if (!pc->mb_no_coeff_skip) { skip_coeff = 0; - } else if (vp9_segfeature_active(xd, segment_id, SEG_LVL_EOB) && - vp9_get_segdata(xd, segment_id, SEG_LVL_EOB) == 0) { + } else if (vp9_segfeature_active(xd, segment_id, SEG_LVL_SKIP)) { skip_coeff = 1; } else { const int nmbs = mb_size; @@ -750,24 +749,18 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m, } // Encode the reference frame. - if (!vp9_segfeature_active(xd, segment_id, SEG_LVL_MODE) - || vp9_get_segdata(xd, segment_id, SEG_LVL_MODE) >= NEARESTMV) { - encode_ref_frame(bc, pc, xd, segment_id, rf); - } else { - assert(rf == INTRA_FRAME); - } + encode_ref_frame(bc, pc, xd, segment_id, rf); if (rf == INTRA_FRAME) { #ifdef ENTROPY_STATS active_section = 6; #endif - if (!vp9_segfeature_active(xd, segment_id, SEG_LVL_MODE)) { - if (m->mbmi.sb_type) - write_sb_ymode(bc, mode, pc->fc.sb_ymode_prob); - else - write_ymode(bc, mode, pc->fc.ymode_prob); - } + if (m->mbmi.sb_type) + write_sb_ymode(bc, mode, pc->fc.sb_ymode_prob); + else + write_ymode(bc, mode, pc->fc.ymode_prob); + if (mode == B_PRED) { int j = 0; do { @@ -798,8 +791,8 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m, active_section = 3; #endif - // Is the segment coding of mode enabled - if (!vp9_segfeature_active(xd, segment_id, SEG_LVL_MODE)) { + // Is segment skip is not enabled code the mode. + if (!vp9_segfeature_active(xd, segment_id, SEG_LVL_SKIP)) { if (mi->sb_type) { write_sb_mv_ref(bc, mode, mv_ref_p); } else { @@ -942,8 +935,7 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m, mi->partitioning == PARTITIONING_4X4))) && pc->txfm_mode == TX_MODE_SELECT && !((pc->mb_no_coeff_skip && skip_coeff) || - (vp9_segfeature_active(xd, segment_id, SEG_LVL_EOB) && - vp9_get_segdata(xd, segment_id, SEG_LVL_EOB) == 0))) { + (vp9_segfeature_active(xd, segment_id, SEG_LVL_SKIP)))) { TX_SIZE sz = mi->txfm_size; // FIXME(rbultje) code ternary symbol once all experiments are merged vp9_write(bc, sz != TX_4X4, pc->prob_tx[0]); @@ -972,8 +964,7 @@ static void write_mb_modes_kf(const VP9_COMP *cpi, if (!c->mb_no_coeff_skip) { skip_coeff = 0; - } else if (vp9_segfeature_active(xd, segment_id, SEG_LVL_EOB) && - vp9_get_segdata(xd, segment_id, SEG_LVL_EOB) == 0) { + } else if (vp9_segfeature_active(xd, segment_id, SEG_LVL_SKIP)) { skip_coeff = 1; } else { const int nmbs = 1 << m->mbmi.sb_type; @@ -1032,8 +1023,7 @@ static void write_mb_modes_kf(const VP9_COMP *cpi, if (ym <= I8X8_PRED && c->txfm_mode == TX_MODE_SELECT && !((c->mb_no_coeff_skip && skip_coeff) || - (vp9_segfeature_active(xd, segment_id, SEG_LVL_EOB) && - vp9_get_segdata(xd, segment_id, SEG_LVL_EOB) == 0))) { + (vp9_segfeature_active(xd, segment_id, SEG_LVL_SKIP)))) { TX_SIZE sz = m->mbmi.txfm_size; // FIXME(rbultje) code ternary symbol once all experiments are merged vp9_write(bc, sz != TX_4X4, c->prob_tx[0]); diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index 8a4b7e662..b26c60b03 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -488,8 +488,7 @@ static void update_state(VP9_COMP *cpi, { int segment_id = mbmi->segment_id; - if (!vp9_segfeature_active(xd, segment_id, SEG_LVL_EOB) || - vp9_get_segdata(xd, segment_id, SEG_LVL_EOB)) { + if (!vp9_segfeature_active(xd, segment_id, SEG_LVL_SKIP)) { for (i = 0; i < NB_TXFM_MODES; i++) { cpi->rd_tx_select_diff[i] += ctx->txfm_rd_diff[i]; } @@ -1392,8 +1391,7 @@ static void reset_skip_txfm_size_mb(VP9_COMP *cpi, const int segment_id = mbmi->segment_id; xd->mode_info_context = mi; - assert((vp9_segfeature_active(xd, segment_id, SEG_LVL_EOB) && - vp9_get_segdata(xd, segment_id, SEG_LVL_EOB) == 0) || + assert((vp9_segfeature_active(xd, segment_id, SEG_LVL_SKIP)) || (cm->mb_no_coeff_skip && mbmi->mb_skip_coeff)); mbmi->txfm_size = txfm_max; } @@ -1437,8 +1435,7 @@ static void reset_skip_txfm_size_sb32(VP9_COMP *cpi, MODE_INFO *mi, const int xmbs = MIN(2, mb_cols_left); xd->mode_info_context = mi; - assert((vp9_segfeature_active(xd, segment_id, SEG_LVL_EOB) && - vp9_get_segdata(xd, segment_id, SEG_LVL_EOB) == 0) || + assert((vp9_segfeature_active(xd, segment_id, SEG_LVL_SKIP)) || (cm->mb_no_coeff_skip && get_skip_flag(mi, mis, ymbs, xmbs))); set_txfm_flag(mi, mis, ymbs, xmbs, txfm_max); } @@ -1458,8 +1455,7 @@ static void reset_skip_txfm_size_sb64(VP9_COMP *cpi, MODE_INFO *mi, const int xmbs = MIN(4, mb_cols_left); xd->mode_info_context = mi; - assert((vp9_segfeature_active(xd, segment_id, SEG_LVL_EOB) && - vp9_get_segdata(xd, segment_id, SEG_LVL_EOB) == 0) || + assert((vp9_segfeature_active(xd, segment_id, SEG_LVL_SKIP)) || (cm->mb_no_coeff_skip && get_skip_flag(mi, mis, ymbs, xmbs))); set_txfm_flag(mi, mis, ymbs, xmbs, txfm_max); } @@ -2231,8 +2227,7 @@ static void encode_macroblock(VP9_COMP *cpi, TOKENEXTRA **t, int segment_id = mbmi->segment_id; if (cpi->common.txfm_mode == TX_MODE_SELECT && !((cpi->common.mb_no_coeff_skip && mbmi->mb_skip_coeff) || - (vp9_segfeature_active(&x->e_mbd, segment_id, SEG_LVL_EOB) && - vp9_get_segdata(&x->e_mbd, segment_id, SEG_LVL_EOB) == 0))) { + (vp9_segfeature_active(&x->e_mbd, segment_id, SEG_LVL_SKIP)))) { assert(mbmi->txfm_size <= TX_16X16); if (mbmi->mode != B_PRED && mbmi->mode != I8X8_PRED && mbmi->mode != SPLITMV) { @@ -2469,8 +2464,7 @@ static void encode_superblock32(VP9_COMP *cpi, TOKENEXTRA **t, if (output_enabled) { if (cm->txfm_mode == TX_MODE_SELECT && !((cm->mb_no_coeff_skip && skip[0] && skip[1] && skip[2] && skip[3]) || - (vp9_segfeature_active(xd, segment_id, SEG_LVL_EOB) && - vp9_get_segdata(xd, segment_id, SEG_LVL_EOB) == 0))) { + (vp9_segfeature_active(xd, segment_id, SEG_LVL_SKIP)))) { cpi->txfm_count_32x32p[mi->mbmi.txfm_size]++; } else { TX_SIZE sz = (cm->txfm_mode == TX_MODE_SELECT) ? @@ -2733,8 +2727,7 @@ static void encode_superblock64(VP9_COMP *cpi, TOKENEXTRA **t, skip[4] && skip[5] && skip[6] && skip[7] && skip[8] && skip[9] && skip[10] && skip[11] && skip[12] && skip[13] && skip[14] && skip[15]))) || - (vp9_segfeature_active(xd, segment_id, SEG_LVL_EOB) && - vp9_get_segdata(xd, segment_id, SEG_LVL_EOB) == 0))) { + (vp9_segfeature_active(xd, segment_id, SEG_LVL_SKIP)))) { cpi->txfm_count_32x32p[mi->mbmi.txfm_size]++; } else { int x, y; diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c index a14165752..878844683 100644 --- a/vp9/encoder/vp9_onyx_if.c +++ b/vp9/encoder/vp9_onyx_if.c @@ -446,7 +446,7 @@ static void init_seg_features(VP9_COMP *cpi) { else if (xd->segmentation_enabled) { // First normal frame in a valid gf or alt ref group if (cpi->common.frames_since_golden == 0) { - // Set up segment features for normal frames in an af group + // Set up segment features for normal frames in an arf group if (cpi->source_alt_ref_active) { xd->update_mb_segmentation_map = 0; xd->update_mb_segmentation_data = 1; @@ -463,16 +463,9 @@ static void init_seg_features(VP9_COMP *cpi) { // Segment coding disabled for compred testing if (high_q || (cpi->static_mb_pct == 100)) { - // set_segref(xd, 1, LAST_FRAME); vp9_set_segref(xd, 1, ALTREF_FRAME); vp9_enable_segfeature(xd, 1, SEG_LVL_REF_FRAME); - - vp9_set_segdata(xd, 1, SEG_LVL_MODE, ZEROMV); - vp9_enable_segfeature(xd, 1, SEG_LVL_MODE); - - // EOB segment coding not fixed for 8x8 yet - vp9_set_segdata(xd, 1, SEG_LVL_EOB, 0); - vp9_enable_segfeature(xd, 1, SEG_LVL_EOB); + vp9_enable_segfeature(xd, 1, SEG_LVL_SKIP); } } // Disable segmentation and clear down features if alt ref @@ -491,29 +484,23 @@ static void init_seg_features(VP9_COMP *cpi) { } // Special case where we are coding over the top of a previous - // alt ref frame + // alt ref frame. // Segment coding disabled for compred testing else if (cpi->is_src_frame_alt_ref) { - // Enable mode and ref frame features for segment 0 as well + // Enable ref frame features for segment 0 as well vp9_enable_segfeature(xd, 0, SEG_LVL_REF_FRAME); - vp9_enable_segfeature(xd, 0, SEG_LVL_MODE); vp9_enable_segfeature(xd, 1, SEG_LVL_REF_FRAME); - vp9_enable_segfeature(xd, 1, SEG_LVL_MODE); - // All mbs should use ALTREF_FRAME, ZEROMV exclusively + // All mbs should use ALTREF_FRAME vp9_clear_segref(xd, 0); vp9_set_segref(xd, 0, ALTREF_FRAME); vp9_clear_segref(xd, 1); vp9_set_segref(xd, 1, ALTREF_FRAME); - vp9_set_segdata(xd, 0, SEG_LVL_MODE, ZEROMV); - vp9_set_segdata(xd, 1, SEG_LVL_MODE, ZEROMV); - // Skip all MBs if high Q + // Skip all MBs if high Q (0,0 mv and skip coeffs) if (high_q) { - vp9_enable_segfeature(xd, 0, SEG_LVL_EOB); - vp9_set_segdata(xd, 0, SEG_LVL_EOB, 0); - vp9_enable_segfeature(xd, 1, SEG_LVL_EOB); - vp9_set_segdata(xd, 1, SEG_LVL_EOB, 0); + vp9_enable_segfeature(xd, 0, SEG_LVL_SKIP); + vp9_enable_segfeature(xd, 1, SEG_LVL_SKIP); } // Enable data udpate xd->update_mb_segmentation_data = 1; diff --git a/vp9/encoder/vp9_quantize.c b/vp9/encoder/vp9_quantize.c index 2f0a55a8a..f5a2f38e8 100644 --- a/vp9/encoder/vp9_quantize.c +++ b/vp9/encoder/vp9_quantize.c @@ -556,16 +556,12 @@ void vp9_mb_init_quantizer(VP9_COMP *cpi, MACROBLOCK *x) { x->block[i].zrun_zbin_boost = cpi->zrun_zbin_boost_y1[QIndex]; x->block[i].zbin_extra = (int16_t)zbin_extra; - // Segment max eob offset feature. - if (vp9_segfeature_active(xd, segment_id, SEG_LVL_EOB)) { - x->block[i].eob_max_offset = - vp9_get_segdata(xd, segment_id, SEG_LVL_EOB); - x->block[i].eob_max_offset_8x8 = - vp9_get_segdata(xd, segment_id, SEG_LVL_EOB); - x->block[i].eob_max_offset_16x16 = - vp9_get_segdata(xd, segment_id, SEG_LVL_EOB); - x->block[i].eob_max_offset_32x32 = - vp9_get_segdata(xd, segment_id, SEG_LVL_EOB); + // Segment skip feature. + if (vp9_segfeature_active(xd, segment_id, SEG_LVL_SKIP)) { + x->block[i].eob_max_offset = 0; + x->block[i].eob_max_offset_8x8 = 0; + x->block[i].eob_max_offset_16x16 = 0; + x->block[i].eob_max_offset_32x32 = 0; } else { x->block[i].eob_max_offset = 16; x->block[i].eob_max_offset_8x8 = 64; @@ -590,14 +586,11 @@ void vp9_mb_init_quantizer(VP9_COMP *cpi, MACROBLOCK *x) { x->block[i].zbin_extra = (int16_t)zbin_extra; - // Segment max eob offset feature. - if (vp9_segfeature_active(xd, segment_id, SEG_LVL_EOB)) { - x->block[i].eob_max_offset = - vp9_get_segdata(xd, segment_id, SEG_LVL_EOB); - x->block[i].eob_max_offset_8x8 = - vp9_get_segdata(xd, segment_id, SEG_LVL_EOB); - x->block[i].eob_max_offset_16x16 = - vp9_get_segdata(xd, segment_id, SEG_LVL_EOB); + // Segment skip feature. + if (vp9_segfeature_active(xd, segment_id, SEG_LVL_SKIP)) { + x->block[i].eob_max_offset = 0; + x->block[i].eob_max_offset_8x8 = 0; + x->block[i].eob_max_offset_16x16 = 0; } else { x->block[i].eob_max_offset = 16; x->block[i].eob_max_offset_8x8 = 64; @@ -620,12 +613,10 @@ void vp9_mb_init_quantizer(VP9_COMP *cpi, MACROBLOCK *x) { x->block[24].zbin_extra = (int16_t)zbin_extra; // TBD perhaps not use for Y2 - // Segment max eob offset feature. - if (vp9_segfeature_active(xd, segment_id, SEG_LVL_EOB)) { - x->block[24].eob_max_offset = - vp9_get_segdata(xd, segment_id, SEG_LVL_EOB); - x->block[24].eob_max_offset_8x8 = - vp9_get_segdata(xd, segment_id, SEG_LVL_EOB); + // Segment skip feature. + if (vp9_segfeature_active(xd, segment_id, SEG_LVL_SKIP)) { + x->block[24].eob_max_offset = 0; + x->block[24].eob_max_offset_8x8 = 0; } else { x->block[24].eob_max_offset = 16; x->block[24].eob_max_offset_8x8 = 4; diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index f860e94ca..45c72bcc5 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -498,8 +498,8 @@ static int cost_coeffs(MACROBLOCK *mb, pn = pt; #endif - if (vp9_segfeature_active(xd, segment_id, SEG_LVL_EOB)) - seg_eob = vp9_get_segdata(xd, segment_id, SEG_LVL_EOB); + if (vp9_segfeature_active(xd, segment_id, SEG_LVL_SKIP)) + seg_eob = 0; if (tx_type != DCT_DCT) { for (; c < eob; c++) { @@ -2082,12 +2082,8 @@ int vp9_cost_mv_ref(VP9_COMP *cpi, MACROBLOCKD *xd = &cpi->mb.e_mbd; int segment_id = xd->mode_info_context->mbmi.segment_id; - // If the mode coding is done entirely at the segment level - // we should not account for it at the per mb level in rd code. - // Note that if the segment level coding is expanded from single mode - // to multiple mode masks as per reference frame coding we will need - // to do something different here. - if (!vp9_segfeature_active(xd, segment_id, SEG_LVL_MODE)) { + // Dont account for mode here if segment skip is enabled. + if (!vp9_segfeature_active(xd, segment_id, SEG_LVL_SKIP)) { VP9_COMMON *pc = &cpi->common; vp9_prob p [VP9_MVREFS - 1]; @@ -3695,18 +3691,16 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, if (vp9_segfeature_active(xd, segment_id, SEG_LVL_REF_FRAME) && !vp9_check_segref(xd, segment_id, mbmi->ref_frame)) { continue; - // If the segment mode feature is enabled.... + // If the segment skip feature is enabled.... // then do nothing if the current mode is not allowed.. - } else if (vp9_segfeature_active(xd, segment_id, SEG_LVL_MODE) && - (this_mode != - vp9_get_segdata(xd, segment_id, SEG_LVL_MODE))) { + } else if (vp9_segfeature_active(xd, segment_id, SEG_LVL_SKIP) && + (this_mode != ZEROMV)) { continue; - // Disable this drop out case if either the mode or ref frame - // segment level feature is enabled for this segment. This is to + // Disable this drop out case if the ref frame segment + // level feature is enabled for this segment. This is to // prevent the possibility that the we end up unable to pick any mode. - } else if (!vp9_segfeature_active(xd, segment_id, SEG_LVL_REF_FRAME) && - !vp9_segfeature_active(xd, segment_id, SEG_LVL_MODE)) { - // Only consider ZEROMV/ALTREF_FRAME for alt ref frame, + } else if (!vp9_segfeature_active(xd, segment_id, SEG_LVL_REF_FRAME)) { + // Only consider ZEROMV/ALTREF_FRAME for alt ref frame overlay, // unless ARNR filtering is enabled in which case we want // an unfiltered alternative if (cpi->is_src_frame_alt_ref && (cpi->oxcf.arnr_max_frames == 0)) { @@ -3997,10 +3991,8 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, if (cpi->common.mb_no_coeff_skip) { int mb_skip_allowed; - // Is Mb level skip allowed for this mb. - mb_skip_allowed = - !vp9_segfeature_active(xd, segment_id, SEG_LVL_EOB) || - vp9_get_segdata(xd, segment_id, SEG_LVL_EOB); + // Is Mb level skip allowed (i.e. not coded at segment level). + mb_skip_allowed = !vp9_segfeature_active(xd, segment_id, SEG_LVL_SKIP); if (skippable) { mbmi->mb_skip_coeff = 1; @@ -4206,12 +4198,11 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, cpi->rd_thresh_mult[best_mode_index]; } - // This code force Altref,0,0 and skip for the frame that overlays a + // This code forces Altref,0,0 and skip for the frame that overlays a // an alrtef unless Altref is filtered. However, this is unsafe if - // segment level coding of ref frame or mode is enabled for this + // segment level coding of ref frame is enabled for this // segment. if (!vp9_segfeature_active(xd, segment_id, SEG_LVL_REF_FRAME) && - !vp9_segfeature_active(xd, segment_id, SEG_LVL_MODE) && cpi->is_src_frame_alt_ref && (cpi->oxcf.arnr_max_frames == 0) && (best_mbmode.mode != ZEROMV || best_mbmode.ref_frame != ALTREF_FRAME)) { @@ -4675,16 +4666,15 @@ static int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, if (vp9_segfeature_active(xd, segment_id, SEG_LVL_REF_FRAME) && !vp9_check_segref(xd, segment_id, ref_frame)) { continue; - // If the segment mode feature is enabled.... + // If the segment skip feature is enabled.... // then do nothing if the current mode is not allowed.. - } else if (vp9_segfeature_active(xd, segment_id, SEG_LVL_MODE) && - (this_mode != vp9_get_segdata(xd, segment_id, SEG_LVL_MODE))) { + } else if (vp9_segfeature_active(xd, segment_id, SEG_LVL_SKIP) && + (this_mode != ZEROMV)) { continue; - // Disable this drop out case if either the mode or ref frame + // Disable this drop out case if the ref frame // segment level feature is enabled for this segment. This is to // prevent the possibility that we end up unable to pick any mode. - } else if (!vp9_segfeature_active(xd, segment_id, SEG_LVL_REF_FRAME) && - !vp9_segfeature_active(xd, segment_id, SEG_LVL_MODE)) { + } else if (!vp9_segfeature_active(xd, segment_id, SEG_LVL_REF_FRAME)) { // Only consider ZEROMV/ALTREF_FRAME for alt ref frame, // unless ARNR filtering is enabled in which case we want // an unfiltered alternative @@ -4773,10 +4763,8 @@ static int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, if (cpi->common.mb_no_coeff_skip) { int mb_skip_allowed; - // Is Mb level skip allowed for this mb. - mb_skip_allowed = - !vp9_segfeature_active(xd, segment_id, SEG_LVL_EOB) || - vp9_get_segdata(xd, segment_id, SEG_LVL_EOB); + // Is Mb level skip allowed (i.e. not coded at segment level). + mb_skip_allowed = !vp9_segfeature_active(xd, segment_id, SEG_LVL_SKIP); if (skippable) { // Back out the coefficient coding costs @@ -4960,10 +4948,8 @@ static int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, // This code forces Altref,0,0 and skip for the frame that overlays a // an alrtef unless Altref is filtered. However, this is unsafe if - // segment level coding of ref frame or mode is enabled for this - // segment. + // segment level coding of ref frame is enabled for this segment. if (!vp9_segfeature_active(xd, segment_id, SEG_LVL_REF_FRAME) && - !vp9_segfeature_active(xd, segment_id, SEG_LVL_MODE) && cpi->is_src_frame_alt_ref && (cpi->oxcf.arnr_max_frames == 0) && (best_mbmode.mode != ZEROMV || best_mbmode.ref_frame != ALTREF_FRAME)) { diff --git a/vp9/encoder/vp9_tokenize.c b/vp9/encoder/vp9_tokenize.c index fc99311ae..0d444b80d 100644 --- a/vp9/encoder/vp9_tokenize.c +++ b/vp9/encoder/vp9_tokenize.c @@ -233,8 +233,8 @@ static void tokenize_b(VP9_COMP *cpi, pn = pt; #endif - if (vp9_segfeature_active(xd, segment_id, SEG_LVL_EOB)) - seg_eob = vp9_get_segdata(xd, segment_id, SEG_LVL_EOB); + if (vp9_segfeature_active(xd, segment_id, SEG_LVL_SKIP)) + seg_eob = 0; do { const int band = bands[c]; @@ -390,8 +390,7 @@ void vp9_tokenize_sb(VP9_COMP *cpi, (ENTROPY_CONTEXT *) (xd->left_context + 1), }; const int mb_skip_context = vp9_get_pred_context(cm, xd, PRED_MBSKIP); const int segment_id = mbmi->segment_id; - const int skip_inc = !vp9_segfeature_active(xd, segment_id, SEG_LVL_EOB) || - (vp9_get_segdata(xd, segment_id, SEG_LVL_EOB) != 0); + const int skip_inc = !vp9_segfeature_active(xd, segment_id, SEG_LVL_SKIP); int b; mbmi->mb_skip_coeff = sb_is_skippable_32x32(xd); @@ -441,8 +440,7 @@ void vp9_tokenize_mb(VP9_COMP *cpi, int skip_inc; int segment_id = xd->mode_info_context->mbmi.segment_id; - if (!vp9_segfeature_active(xd, segment_id, SEG_LVL_EOB) || - (vp9_get_segdata(xd, segment_id, SEG_LVL_EOB) != 0)) { + if (!vp9_segfeature_active(xd, segment_id, SEG_LVL_SKIP)) { skip_inc = 1; } else skip_inc = 0; |