diff options
author | Suman Sunkara <sunkaras@google.com> | 2010-08-31 20:43:14 -0400 |
---|---|---|
committer | Suman Sunkara <sunkaras@google.com> | 2010-09-13 10:01:21 -0400 |
commit | be7e4e854c82bd9e8b5db0586873ea19156cfeef (patch) | |
tree | d6b242603f1fd2452107dc1a18cf93831e8a9cc2 /vp8/decoder/decodemv.c | |
parent | f4020e2338a1786b1db0f67075ceb7d9c01be6a3 (diff) | |
download | libvpx-be7e4e854c82bd9e8b5db0586873ea19156cfeef.tar libvpx-be7e4e854c82bd9e8b5db0586873ea19156cfeef.tar.gz libvpx-be7e4e854c82bd9e8b5db0586873ea19156cfeef.tar.bz2 libvpx-be7e4e854c82bd9e8b5db0586873ea19156cfeef.zip |
Delta updates to segmentation map using left and above contexts.
-Updates by making use of spatial correlation.
-Checks if the segment_id is same as above or left context and encodes only the update to the map instead of updating individual segment_ids.
Change-Id: Ib861df97e8aa2b37516219eeddcdbaf552b6a249
Diffstat (limited to 'vp8/decoder/decodemv.c')
-rw-r--r-- | vp8/decoder/decodemv.c | 45 |
1 files changed, 42 insertions, 3 deletions
diff --git a/vp8/decoder/decodemv.c b/vp8/decoder/decodemv.c index 6035f3e6a..de85e8f6d 100644 --- a/vp8/decoder/decodemv.c +++ b/vp8/decoder/decodemv.c @@ -120,7 +120,10 @@ void vp8_decode_mode_mvs(VP8D_COMP *pbi) MV_CONTEXT *const mvc = pc->fc.mvc; int mb_row = -1; - +#if CONFIG_SEGMENTATION + int left_id, above_id; + int i; +#endif vp8_prob prob_intra; vp8_prob prob_last; vp8_prob prob_gf; @@ -171,7 +174,6 @@ void vp8_decode_mode_mvs(VP8D_COMP *pbi) MACROBLOCKD *xd = &pbi->mb; vp8dx_bool_decoder_fill(bc); - // Distance of Mb to the various image edges. // These specified to 8th pel as they are always compared to MV values that are in 1/8th pel units xd->mb_to_left_edge = -((mb_col * 16) << 3); @@ -181,7 +183,44 @@ void vp8_decode_mode_mvs(VP8D_COMP *pbi) // If required read in new segmentation data for this MB if (pbi->mb.update_mb_segmentation_map) - vp8_read_mb_features(bc, mbmi, &pbi->mb); + { +#if CONFIG_SEGMENTATION + xd->up_available = (mb_row != 0); + xd->left_available = (mb_col != 0); + + if(xd->left_available) + left_id = (mi-1)->mbmi.segment_id; + else + left_id = 0; + + if(xd->up_available) + above_id = (mi-pc->mb_cols)->mbmi.segment_id; + else + above_id = 0; + + if (vp8_read(bc, xd->mb_segment_tree_probs[0])) + { + for(i = 0; i < MAX_MB_SEGMENTS; i++) + { + if((left_id != i) && (above_id != i)) + { + if (vp8_read(bc, xd->mb_segment_tree_probs[2+i]) == 0) + mbmi->segment_id = i; + } + } + } + else + { + if (vp8_read(bc, xd->mb_segment_tree_probs[1])) + mbmi->segment_id = above_id; + else + mbmi->segment_id = left_id; + + } +#else + vp8_read_mb_features(bc, &mi->mbmi, &pbi->mb); +#endif + } // Read the macroblock coeff skip flag if this feature is in use, else default to 0 if (pc->mb_no_coeff_skip) |