diff options
author | Jingning Han <jingning@google.com> | 2013-04-23 10:12:18 -0700 |
---|---|---|
committer | Jingning Han <jingning@google.com> | 2013-04-24 14:23:14 -0700 |
commit | ff2b8aa2c9f95a8456306d2a9ce28803eb90b38a (patch) | |
tree | 09e31a05f10c4376c535cb804e51d7ce95f27746 /vp9/common/vp9_onyxc_int.h | |
parent | 41a8a95bd1ca23cb8ab4bfbbe2fc1e219ea5243a (diff) | |
download | libvpx-ff2b8aa2c9f95a8456306d2a9ce28803eb90b38a.tar libvpx-ff2b8aa2c9f95a8456306d2a9ce28803eb90b38a.tar.gz libvpx-ff2b8aa2c9f95a8456306d2a9ce28803eb90b38a.tar.bz2 libvpx-ff2b8aa2c9f95a8456306d2a9ce28803eb90b38a.zip |
Contextual entropy coding of partition syntax
This commit enables selecting probability models for recursive block
partition information syntax, depending on its above/left partition
information, as well as the current block size. These conditional
probability models are reasonably stationary and consistent across
frames, hence the backward adaptive approach is used to maintain and
update the contextual models.
It achieves coding performance gains (on top of enabling rectangular
block sizes):
derf: 0.242%
yt: 0.391%
hd: 0.376%
stdhd: 0.645%
Change-Id: Ie513d9673337f0d27abd65fb566b711d0844ec2e
Diffstat (limited to 'vp9/common/vp9_onyxc_int.h')
-rw-r--r-- | vp9/common/vp9_onyxc_int.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/vp9/common/vp9_onyxc_int.h b/vp9/common/vp9_onyxc_int.h index dc734b87f..3e09c864c 100644 --- a/vp9/common/vp9_onyxc_int.h +++ b/vp9/common/vp9_onyxc_int.h @@ -68,7 +68,7 @@ typedef struct frame_contexts { vp9_prob i8x8_mode_prob[VP9_I8X8_MODES - 1]; vp9_prob sub_mv_ref_prob[SUBMVREF_COUNT][VP9_SUBMVREFS - 1]; vp9_prob mbsplit_prob[VP9_NUMMBSPLITS - 1]; - vp9_prob partition_prob[PARTITION_PLANES][PARTITION_TYPES - 1]; + vp9_prob partition_prob[NUM_PARTITION_CONTEXTS][PARTITION_TYPES - 1]; vp9_coeff_probs coef_probs_4x4[BLOCK_TYPES]; vp9_coeff_probs coef_probs_8x8[BLOCK_TYPES]; @@ -90,7 +90,7 @@ typedef struct frame_contexts { vp9_prob pre_i8x8_mode_prob[VP9_I8X8_MODES - 1]; vp9_prob pre_sub_mv_ref_prob[SUBMVREF_COUNT][VP9_SUBMVREFS - 1]; vp9_prob pre_mbsplit_prob[VP9_NUMMBSPLITS - 1]; - vp9_prob pre_partition_prob[PARTITION_PLANES][PARTITION_TYPES - 1]; + vp9_prob pre_partition_prob[NUM_PARTITION_CONTEXTS][PARTITION_TYPES - 1]; unsigned int bmode_counts[VP9_NKF_BINTRAMODES]; unsigned int ymode_counts[VP9_YMODES]; /* interframe intra mode probs */ unsigned int sb_ymode_counts[VP9_I32X32_MODES]; @@ -98,7 +98,7 @@ typedef struct frame_contexts { unsigned int i8x8_mode_counts[VP9_I8X8_MODES]; /* interframe intra probs */ unsigned int sub_mv_ref_counts[SUBMVREF_COUNT][VP9_SUBMVREFS]; unsigned int mbsplit_counts[VP9_NUMMBSPLITS]; - unsigned int partition_counts[PARTITION_PLANES][PARTITION_TYPES]; + unsigned int partition_counts[NUM_PARTITION_CONTEXTS][PARTITION_TYPES]; vp9_coeff_probs pre_coef_probs_4x4[BLOCK_TYPES]; vp9_coeff_probs pre_coef_probs_8x8[BLOCK_TYPES]; @@ -251,6 +251,10 @@ typedef struct VP9Common { ENTROPY_CONTEXT_PLANES *above_context; /* row of context for each plane */ ENTROPY_CONTEXT_PLANES left_context[4]; /* (up to) 4 contexts "" */ + // partition contexts + PARTITION_CONTEXT *above_seg_context; + PARTITION_CONTEXT left_seg_context[4]; + /* keyframe block modes are predicted by their above, left neighbors */ vp9_prob kf_bmode_prob[VP9_KF_BINTRAMODES] @@ -333,6 +337,10 @@ static void ref_cnt_fb(int *buf, int *idx, int new_idx) { buf[new_idx]++; } +static int mb_cols_aligned_to_sb(VP9_COMMON *cm) { + return (cm->mb_cols + 3) & ~3; +} + // TODO(debargha): merge the two functions static void set_mb_row(VP9_COMMON *cm, MACROBLOCKD *xd, int mb_row, int block_size) { |