From: Jingning Han Date: Sat, 27 Apr 2013 04:52:53 +0000 (-0700) Subject: Add forward probability model update for partition X-Git-Tag: v1.3.0~1106^2~125 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9b935f99926d346d1034217dadf62b6545655472;p=libvpx Add forward probability model update for partition Enable forward model update for partition syntax coding. Change-Id: If47b423b6d12f34614c57f25d235dc9ba688efc5 --- diff --git a/vp9/decoder/vp9_decodemv.c b/vp9/decoder/vp9_decodemv.c index fbb7dbd6c..c51d0b243 100644 --- a/vp9/decoder/vp9_decodemv.c +++ b/vp9/decoder/vp9_decodemv.c @@ -475,7 +475,7 @@ static void mb_mode_mv_init(VP9D_COMP *pbi, vp9_reader *r) { } else { nmv_context *const nmvc = &pbi->common.fc.nmvc; MACROBLOCKD *const xd = &pbi->mb; - int i; + int i, j; if (cm->mcomp_filter_type == SWITCHABLE) read_switchable_interp_probs(pbi, r); @@ -509,6 +509,11 @@ static void mb_mode_mv_init(VP9D_COMP *pbi, vp9_reader *r) { for (i = 0; i < VP9_I32X32_MODES - 1; ++i) cm->fc.sb_ymode_prob[i] = vp9_read_prob(r); + for (j = 0; j < NUM_PARTITION_CONTEXTS; ++j) + if (vp9_read_bit(r)) + for (i = 0; i < PARTITION_TYPES - 1; ++i) + cm->fc.partition_prob[j][i] = vp9_read_prob(r); + read_nmvprobs(r, nmvc, xd->allow_high_precision_mv); } } diff --git a/vp9/encoder/vp9_bitstream.c b/vp9/encoder/vp9_bitstream.c index d099960f4..245305479 100644 --- a/vp9/encoder/vp9_bitstream.c +++ b/vp9/encoder/vp9_bitstream.c @@ -2257,6 +2257,14 @@ void vp9_pack_bitstream(VP9_COMP *cpi, unsigned char *dest, } update_mbintra_mode_probs(cpi, &header_bc); + for (i = 0; i < NUM_PARTITION_CONTEXTS; ++i) { + vp9_prob Pnew[PARTITION_TYPES - 1]; + unsigned int bct[PARTITION_TYPES - 1][2]; + update_mode(&header_bc, PARTITION_TYPES, vp9_partition_encodings, + vp9_partition_tree, Pnew, pc->fc.partition_prob[i], bct, + (unsigned int *)cpi->partition_count[i]); + } + vp9_write_nmv_probs(cpi, xd->allow_high_precision_mv, &header_bc); }