diff options
author | Paul Wilkins <paulwilkins@google.com> | 2011-11-15 15:22:26 +0000 |
---|---|---|
committer | Paul Wilkins <paulwilkins@google.com> | 2011-11-15 15:22:26 +0000 |
commit | 6394ef28d719f74f2757f8aad245e43e5401c9e6 (patch) | |
tree | 5030146a8b4783fb7398b18516bae28246cb05de /vp8/decoder/decodemv.c | |
parent | 661b2c2dcf59bb56535332dcc88212ef8499b33f (diff) | |
download | libvpx-6394ef28d719f74f2757f8aad245e43e5401c9e6.tar libvpx-6394ef28d719f74f2757f8aad245e43e5401c9e6.tar.gz libvpx-6394ef28d719f74f2757f8aad245e43e5401c9e6.tar.bz2 libvpx-6394ef28d719f74f2757f8aad245e43e5401c9e6.zip |
Further clean up of Segmentation experiment code
Changed name and sense of segment_flag to "seg_id_predicted"
Added some additional comments and retested.
I also did some experimentation with a spatial prediction option
using a similar strategy to the temporal mode implemented.
This helps in some cases where temporal prediction is bad but
I suspect there is more overlap here with work on a larger scale
block structure and spatial correlation will likely be better
handled through that mechanism.
Next check in will remove #ifdefs and legacy mode code.
Change-Id: I3b382b65ed2a57bd7775ac0f3a01a9508a209cbc
Diffstat (limited to 'vp8/decoder/decodemv.c')
-rw-r--r-- | vp8/decoder/decodemv.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/vp8/decoder/decodemv.c b/vp8/decoder/decodemv.c index 416865cae..d75469f87 100644 --- a/vp8/decoder/decodemv.c +++ b/vp8/decoder/decodemv.c @@ -459,30 +459,34 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, if (xd->update_mb_segmentation_map) { #if CONFIG_SEGMENTATION + // Is temporal coding of the segment id for this mb enabled. if (xd->temporal_update) { + // Work out a context for decoding seg_id_predicted. pred_context = 0; - if (mb_col != 0) - pred_context += (mi-1)->mbmi.segment_flag; + pred_context += (mi-1)->mbmi.seg_id_predicted; if (mb_row != 0) pred_context += - (mi-pbi->common.mb_cols)->mbmi.segment_flag; + (mi-pbi->common.mb_cols)->mbmi.seg_id_predicted; + + mbmi->seg_id_predicted = + vp8_read(bc, + xd->mb_segment_pred_probs[pred_context]); - if (vp8_read(bc, - xd->mb_segment_pred_probs[pred_context]) == 0) + if ( mbmi->seg_id_predicted ) { mbmi->segment_id = pbi->segmentation_map[index]; - mbmi->segment_flag = 0; } + // If the segment id was not predicted decode it explicitly else { vp8_read_mb_segid(bc, &mi->mbmi, xd); - mbmi->segment_flag = 1; pbi->segmentation_map[index] = mbmi->segment_id; } } + // Normal unpredicted coding mode else { vp8_read_mb_segid(bc, &mi->mbmi, xd); |