summaryrefslogtreecommitdiff
path: root/vp9/decoder/vp9_decodframe.c
diff options
context:
space:
mode:
authorDeb Mukherjee <debargha@google.com>2013-03-07 20:56:34 -0800
committerDeb Mukherjee <debargha@google.com>2013-03-08 16:37:08 -0800
commita28139c849b6c305ff293332c33e7c30a83a7b7b (patch)
tree984f87e84b7dcf4da6fa9260df81646f5b9490e6 /vp9/decoder/vp9_decodframe.c
parent0643c3f133a852d12423c1fc13d329a03a1a18e4 (diff)
downloadlibvpx-a28139c849b6c305ff293332c33e7c30a83a7b7b.tar
libvpx-a28139c849b6c305ff293332c33e7c30a83a7b7b.tar.gz
libvpx-a28139c849b6c305ff293332c33e7c30a83a7b7b.tar.bz2
libvpx-a28139c849b6c305ff293332c33e7c30a83a7b7b.zip
Continued experiment with nonzero count
Adds probability updates for extra bits for the nzcs, code for getting nzc stats, plus some minor cleanups and fixes. Change-Id: If2814e7f04fb52f5025ad9f400f3e6c50a00b543
Diffstat (limited to 'vp9/decoder/vp9_decodframe.c')
-rw-r--r--vp9/decoder/vp9_decodframe.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/vp9/decoder/vp9_decodframe.c b/vp9/decoder/vp9_decodframe.c
index 74b882c91..5b3e1bded 100644
--- a/vp9/decoder/vp9_decodframe.c
+++ b/vp9/decoder/vp9_decodframe.c
@@ -1169,6 +1169,25 @@ static void read_nzc_probs_common(VP9_COMMON *cm,
}
}
+static void read_nzc_pcat_probs(VP9_COMMON *cm, BOOL_DECODER* const bc) {
+ int c, t, b;
+ vp9_prob upd = NZC_UPDATE_PROB_PCAT;
+ if (!vp9_read_bit(bc)) {
+ return;
+ }
+ for (c = 0; c < MAX_NZC_CONTEXTS; ++c) {
+ for (t = 0; t < NZC_TOKENS_EXTRA; ++t) {
+ int bits = vp9_extranzcbits[t + NZC_TOKENS_NOEXTRA];
+ for (b = 0; b < bits; ++b) {
+ vp9_prob *p = &cm->fc.nzc_pcat_probs[c][t][b];
+ if (vp9_read(bc, upd)) {
+ *p = read_prob_diff_update(bc, *p);
+ }
+ }
+ }
+ }
+}
+
static void read_nzc_probs(VP9_COMMON *cm,
BOOL_DECODER* const bc) {
read_nzc_probs_common(cm, bc, 4);
@@ -1178,6 +1197,9 @@ static void read_nzc_probs(VP9_COMMON *cm,
read_nzc_probs_common(cm, bc, 16);
if (cm->txfm_mode > ALLOW_16X16)
read_nzc_probs_common(cm, bc, 32);
+#ifdef NZC_PCAT_UPDATE
+ read_nzc_pcat_probs(cm, bc);
+#endif
}
#endif // CONFIG_CODE_NONZEROCOUNT
@@ -1656,6 +1678,8 @@ int vp9_decode_frame(VP9D_COMP *pbi, const unsigned char **p_data_end) {
pbi->common.fc.nzc_probs_16x16);
vp9_copy(pbi->common.fc.pre_nzc_probs_32x32,
pbi->common.fc.nzc_probs_32x32);
+ vp9_copy(pbi->common.fc.pre_nzc_pcat_probs,
+ pbi->common.fc.nzc_pcat_probs);
#endif
vp9_zero(pbi->common.fc.coef_counts_4x4);
@@ -1679,6 +1703,7 @@ int vp9_decode_frame(VP9D_COMP *pbi, const unsigned char **p_data_end) {
vp9_zero(pbi->common.fc.nzc_counts_8x8);
vp9_zero(pbi->common.fc.nzc_counts_16x16);
vp9_zero(pbi->common.fc.nzc_counts_32x32);
+ vp9_zero(pbi->common.fc.nzc_pcat_counts);
#endif
read_coef_probs(pbi, &header_bc);