ref: 6462afe0889215041099e064954f0c52df929b11
parent: 28164eb9624f716a92e65b8b82c7164a38a44ec0
author: Ronald S. Bultje <[email protected]>
date: Fri Jun 7 07:54:20 EDT 2013
Fix ref_frame segment feature when it is intra. Change-Id: Ifbf790c14cee0c08a27f6728e3c637404e1f8477
--- a/vp9/decoder/vp9_decodemv.c
+++ b/vp9/decoder/vp9_decodemv.c
@@ -525,9 +525,15 @@
mbmi->mb_skip_coeff = vp9_read(r, vp9_get_pred_prob(cm, xd, PRED_MBSKIP));
// Read the reference frame
- mbmi->ref_frame[0] = vp9_read(r, vp9_get_pred_prob(cm, xd, PRED_INTRA_INTER));
- cm->fc.intra_inter_count[vp9_get_pred_context(cm, xd, PRED_INTRA_INTER)]
- [mbmi->ref_frame[0] != INTRA_FRAME]++;
+ if (!vp9_segfeature_active(xd, mbmi->segment_id, SEG_LVL_REF_FRAME)) {
+ mbmi->ref_frame[0] =
+ vp9_read(r, vp9_get_pred_prob(cm, xd, PRED_INTRA_INTER));
+ cm->fc.intra_inter_count[vp9_get_pred_context(cm, xd, PRED_INTRA_INTER)]
+ [mbmi->ref_frame[0] != INTRA_FRAME]++;
+ } else {
+ mbmi->ref_frame[0] =
+ vp9_get_segdata(xd, mbmi->segment_id, SEG_LVL_REF_FRAME) != INTRA_FRAME;
+ }
if (cm->txfm_mode == TX_MODE_SELECT &&
(mbmi->mb_skip_coeff == 0 || mbmi->ref_frame[0] == INTRA_FRAME) &&
--- a/vp9/encoder/vp9_bitstream.c
+++ b/vp9/encoder/vp9_bitstream.c
@@ -561,7 +561,9 @@
vp9_get_pred_prob(pc, xd, PRED_MBSKIP));
}
- vp9_write(bc, rf != INTRA_FRAME, vp9_get_pred_prob(pc, xd, PRED_INTRA_INTER));
+ if (!vp9_segfeature_active(xd, segment_id, SEG_LVL_REF_FRAME))
+ vp9_write(bc, rf != INTRA_FRAME,
+ vp9_get_pred_prob(pc, xd, PRED_INTRA_INTER));
if (mi->sb_type >= BLOCK_SIZE_SB8X8 && pc->txfm_mode == TX_MODE_SELECT &&
!(rf != INTRA_FRAME &&
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -631,15 +631,17 @@
if (cm->frame_type != KEY_FRAME) {
int segment_id, seg_ref_active;
- cpi->intra_inter_count[vp9_get_pred_context(cm, xd, PRED_INTRA_INTER)]
- [mbmi->ref_frame[0] > INTRA_FRAME]++;
+ segment_id = mbmi->segment_id;
+ seg_ref_active = vp9_segfeature_active(xd, segment_id,
+ SEG_LVL_REF_FRAME);
+ if (!seg_ref_active)
+ cpi->intra_inter_count[vp9_get_pred_context(cm, xd, PRED_INTRA_INTER)]
+ [mbmi->ref_frame[0] > INTRA_FRAME]++;
+
// If the segment reference feature is enabled we have only a single
// reference frame allowed for the segment so exclude it from
// the reference frame counts used to work out probabilities.
- segment_id = mbmi->segment_id;
- seg_ref_active = vp9_segfeature_active(xd, segment_id,
- SEG_LVL_REF_FRAME);
if ((mbmi->ref_frame[0] > INTRA_FRAME) && !seg_ref_active) {
if (cm->comp_pred_mode == HYBRID_PREDICTION)
cpi->comp_inter_count[vp9_get_pred_context(cm, xd,