summaryrefslogtreecommitdiff
path: root/vp9/common/vp9_entropy.h
diff options
context:
space:
mode:
authorDeb Mukherjee <debargha@google.com>2013-04-22 10:33:12 -0700
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2013-04-22 10:33:12 -0700
commit6ce718eb180467c3e18ee648403699ed762cc187 (patch)
treeae0daa2ed3db08570b0bf696586fd71a43c1a016 /vp9/common/vp9_entropy.h
parent6d5ac8f2e1ad259b66928e854904c2c2e6656084 (diff)
parent70d9f116fd90f130ec7798b16c2083c9e3853050 (diff)
downloadlibvpx-6ce718eb180467c3e18ee648403699ed762cc187.tar
libvpx-6ce718eb180467c3e18ee648403699ed762cc187.tar.gz
libvpx-6ce718eb180467c3e18ee648403699ed762cc187.tar.bz2
libvpx-6ce718eb180467c3e18ee648403699ed762cc187.zip
Merge "End of orientation zero group experiment" into experimental
Diffstat (limited to 'vp9/common/vp9_entropy.h')
-rw-r--r--vp9/common/vp9_entropy.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/vp9/common/vp9_entropy.h b/vp9/common/vp9_entropy.h
index 3cae94649..6b24ffc94 100644
--- a/vp9/common/vp9_entropy.h
+++ b/vp9/common/vp9_entropy.h
@@ -250,6 +250,62 @@ extern const int vp9_basenzcvalue[NZC32X32_TOKENS];
#endif // CONFIG_CODE_NONZEROCOUNT
+#if CONFIG_CODE_ZEROGROUP
+
+#define ZPC_STATS
+
+typedef enum {
+ HORIZONTAL = 0,
+ DIAGONAL,
+ VERTICAL,
+} OrientationType;
+
+/* Note EOB should become part of this symbol eventually,
+ * but holding off on this for now because that is a major
+ * change in the rest of the codebase */
+
+#define ZPC_ISOLATED (MAX_ENTROPY_TOKENS + 0) /* Isolated zero */
+
+/* ZPC_EOORIENT: All remaining coefficients in the same orientation are 0.
+ * In other words all remaining coeffs in the current subband, and all
+ * children of the current subband are zero. Subbands are defined by
+ * dyadic partitioning in the coeff domain */
+#define ZPC_EOORIENT (MAX_ENTROPY_TOKENS + 1) /* End of Orientation */
+
+/* Band limits over which the eoo bit is sent */
+#define ZPC_EOO_BAND_LOWER 0
+#define ZPC_EOO_BAND_UPPER 5
+
+#define USE_ZPC_EOORIENT 1 /* 0: not used */
+ /* 1: used */
+#define ZPC_NODES 1
+
+#define UNKNOWN_TOKEN 255 /* Not signalled, encoder only */
+
+#define ZPC_BANDS 3 /* context bands for izr */
+#define ZPC_PTOKS 3 /* context pt for zpcs */
+
+#define coef_to_zpc_band(b) ((b) >> 1)
+#define coef_to_zpc_ptok(p) ((p) > 2 ? 2 : (p))
+
+typedef vp9_prob vp9_zpc_probs[REF_TYPES][ZPC_BANDS]
+ [ZPC_PTOKS][ZPC_NODES];
+typedef unsigned int vp9_zpc_count[REF_TYPES][ZPC_BANDS]
+ [ZPC_PTOKS][ZPC_NODES][2];
+
+OrientationType vp9_get_orientation(int rc, TX_SIZE tx_size);
+int vp9_use_eoo(int c, int eob, const int *scan, TX_SIZE tx_size,
+ int *is_last_zero, int *is_eoo);
+int vp9_is_eoo(int c, int eob, const int *scan, TX_SIZE tx_size,
+ const int16_t *qcoeff_ptr, int *last_nz_pos);
+
+#define ZPC_USEEOO_THRESH 4
+#define ZPC_ZEROSSAVED_EOO 7 /* encoder only */
+
+void vp9_adapt_zpc_probs(struct VP9Common *cm);
+
+#endif // CONFIG_CODE_ZEROGROUP
+
#include "vp9/common/vp9_coefupdateprobs.h"
#endif // VP9_COMMON_VP9_ENTROPY_H_