summaryrefslogtreecommitdiff
path: root/vp9/common
diff options
context:
space:
mode:
authorPaul Wilkins <paulwilkins@google.com>2013-02-11 12:56:02 +0000
committerPaul Wilkins <paulwilkins@google.com>2013-02-13 15:12:17 +0000
commit6a9f0c61a4988bc368bee628ca1622815d4b3026 (patch)
tree1954f169de1b1f8c0f0ddcadede4a921dae9e279 /vp9/common
parent649be94cf0d2c4c1e9a6a65708b6289799643462 (diff)
downloadlibvpx-6a9f0c61a4988bc368bee628ca1622815d4b3026.tar
libvpx-6a9f0c61a4988bc368bee628ca1622815d4b3026.tar.gz
libvpx-6a9f0c61a4988bc368bee628ca1622815d4b3026.tar.bz2
libvpx-6a9f0c61a4988bc368bee628ca1622815d4b3026.zip
Remove NEWCOEFCONTEXT experiment.
Removal of the NEWCOEFCONTEXT experiment to reduce code clutter and make it easier to experiment with some other changes to the coefficient coding context. Change-Id: Icd17b421384c354df6117cc714747647c5eb7e98
Diffstat (limited to 'vp9/common')
-rw-r--r--vp9/common/vp9_alloccommon.c4
-rw-r--r--vp9/common/vp9_entropy.c140
-rw-r--r--vp9/common/vp9_entropy.h22
3 files changed, 0 insertions, 166 deletions
diff --git a/vp9/common/vp9_alloccommon.c b/vp9/common/vp9_alloccommon.c
index 01fa63fdb..c3d6dae93 100644
--- a/vp9/common/vp9_alloccommon.c
+++ b/vp9/common/vp9_alloccommon.c
@@ -219,8 +219,4 @@ void vp9_initialize_common() {
vp9_entropy_mode_init();
vp9_entropy_mv_init();
-
-#if CONFIG_NEWCOEFCONTEXT
- vp9_init_neighbors();
-#endif
}
diff --git a/vp9/common/vp9_entropy.c b/vp9/common/vp9_entropy.c
index 03f89ac87..31ea2b5ef 100644
--- a/vp9/common/vp9_entropy.c
+++ b/vp9/common/vp9_entropy.c
@@ -318,146 +318,6 @@ vp9_extra_bit_struct vp9_extra_bits[12] = {
#include "vp9/common/vp9_default_coef_probs.h"
-#if CONFIG_NEWCOEFCONTEXT
-
-// Neighborhood 5-tuples for various scans and blocksizes,
-// in {top, left, topleft, topright, bottomleft} order
-// for each position in raster scan order.
-// -1 indicates the neighbor does not exist.
-DECLARE_ALIGNED(16, int,
- vp9_default_zig_zag1d_4x4_neighbors[16 * MAX_NEIGHBORS]);
-DECLARE_ALIGNED(16, int,
- vp9_col_scan_4x4_neighbors[16 * MAX_NEIGHBORS]);
-DECLARE_ALIGNED(16, int,
- vp9_row_scan_4x4_neighbors[16 * MAX_NEIGHBORS]);
-DECLARE_ALIGNED(16, int,
- vp9_default_zig_zag1d_8x8_neighbors[64 * MAX_NEIGHBORS]);
-DECLARE_ALIGNED(16, int,
- vp9_default_zig_zag1d_16x16_neighbors[256 * MAX_NEIGHBORS]);
-DECLARE_ALIGNED(16, int,
- vp9_default_zig_zag1d_32x32_neighbors[1024 * MAX_NEIGHBORS]);
-
-static int find_in_scan(const int *scan, int l, int m) {
- int i, l2 = l * l;
- for (i = 0; i < l2; ++i) {
- if (scan[i] == m)
- return i;
- }
- return -1;
-}
-
-static void init_scan_neighbors(const int *scan, int l, int *neighbors) {
- int l2 = l * l;
- int m, n, i, j, k;
- for (n = 0; n < l2; ++n) {
- int locn = find_in_scan(scan, l, n);
- int z = -1;
- i = n / l;
- j = n % l;
- for (k = 0; k < MAX_NEIGHBORS; ++k)
- neighbors[MAX_NEIGHBORS * n + k] = -1;
- if (i - 1 >= 0) {
- m = (i - 1) * l + j;
- if (find_in_scan(scan, l, m) < locn) {
- neighbors[MAX_NEIGHBORS * n] = m;
- if (m == 0) z = 0;
- }
- }
- if (j - 1 >= 0) {
- m = i * l + j - 1;
- if (find_in_scan(scan, l, m) < locn) {
- neighbors[MAX_NEIGHBORS * n + 1] = m;
- if (m == 0) z = 1;
- }
- }
- if (i - 1 >= 0 && j - 1 >= 0) {
- m = (i - 1) * l + j - 1;
- if (find_in_scan(scan, l, m) < locn) {
- neighbors[MAX_NEIGHBORS * n + 2] = m;
- if (m == 0) z = 2;
- }
- }
- if (i - 1 >= 0 && j + 1 < l) {
- m = (i - 1) * l + j + 1;
- if (find_in_scan(scan, l, m) < locn) {
- neighbors[MAX_NEIGHBORS * n + 3] = m;
- if (m == 0) z = 3;
- }
- }
- if (i + 1 < l && j - 1 >= 0) {
- m = (i + 1) * l + j - 1;
- if (find_in_scan(scan, l, m) < locn) {
- neighbors[MAX_NEIGHBORS * n + 4] = m;
- if (m == 0) z = 4;
- }
- }
- if (z != -1) { // zero exists
- int v = 0;
- for (k = 0; k < MAX_NEIGHBORS; ++k)
- v += (neighbors[MAX_NEIGHBORS * n + k] > 0);
- if (v) {
- neighbors[MAX_NEIGHBORS * n + z] = -1;
- }
- }
- }
-}
-
-void vp9_init_neighbors() {
- init_scan_neighbors(vp9_default_zig_zag1d_4x4, 4,
- vp9_default_zig_zag1d_4x4_neighbors);
- init_scan_neighbors(vp9_row_scan_4x4, 4,
- vp9_row_scan_4x4_neighbors);
- init_scan_neighbors(vp9_col_scan_4x4, 4,
- vp9_col_scan_4x4_neighbors);
- init_scan_neighbors(vp9_default_zig_zag1d_8x8, 8,
- vp9_default_zig_zag1d_8x8_neighbors);
- init_scan_neighbors(vp9_default_zig_zag1d_16x16, 16,
- vp9_default_zig_zag1d_16x16_neighbors);
- init_scan_neighbors(vp9_default_zig_zag1d_32x32, 32,
- vp9_default_zig_zag1d_32x32_neighbors);
-}
-
-const int *vp9_get_coef_neighbors_handle(const int *scan) {
- if (scan == vp9_default_zig_zag1d_4x4) {
- return vp9_default_zig_zag1d_4x4_neighbors;
- } else if (scan == vp9_row_scan_4x4) {
- return vp9_row_scan_4x4_neighbors;
- } else if (scan == vp9_col_scan_4x4) {
- return vp9_col_scan_4x4_neighbors;
- } else if (scan == vp9_default_zig_zag1d_8x8) {
- return vp9_default_zig_zag1d_8x8_neighbors;
- } else if (scan == vp9_default_zig_zag1d_16x16) {
- return vp9_default_zig_zag1d_16x16_neighbors;
- } else if (scan == vp9_default_zig_zag1d_32x32) {
- return vp9_default_zig_zag1d_32x32_neighbors;
- }
- return vp9_default_zig_zag1d_4x4_neighbors;
-}
-
-int vp9_get_coef_neighbor_context(const short int *qcoeff_ptr, int nodc,
- const int *neigbor_handle, int rc) {
- static int neighbors_used = MAX_NEIGHBORS; // maximum is MAX_NEIGHBORS
- const int *nb = neigbor_handle + rc * MAX_NEIGHBORS;
- int i, v, val = 0, n = 0;
- for (i = 0; i < neighbors_used; ++i) {
- if (nb[i] == -1 || (nb[i] == 0 && nodc)) {
- continue;
- }
- v = abs(qcoeff_ptr[nb[i]]);
- val = (v > val ? v : val);
- n++;
- }
- if (n == 0)
- return 0;
- else if (val <= 1)
- return val;
- else if (val < 4)
- return 2;
- else
- return 3;
-}
-#endif /* CONFIG_NEWCOEFCONTEXT */
-
void vp9_default_coef_probs(VP9_COMMON *pc) {
vpx_memcpy(pc->fc.coef_probs_4x4, default_coef_probs_4x4,
sizeof(pc->fc.coef_probs_4x4));
diff --git a/vp9/common/vp9_entropy.h b/vp9/common/vp9_entropy.h
index 84e5255c2..c6f51e0c6 100644
--- a/vp9/common/vp9_entropy.h
+++ b/vp9/common/vp9_entropy.h
@@ -129,26 +129,4 @@ static void vp9_reset_mb_tokens_context(MACROBLOCKD* const xd) {
vpx_memset(xd->left_context, 0, sizeof(ENTROPY_CONTEXT_PLANES));
}
-#if CONFIG_NEWCOEFCONTEXT
-
-#define MAX_NEIGHBORS 5
-#define NEWCOEFCONTEXT_BAND_COND(b) ((b) >= 1)
-void vp9_init_neighbors(void);
-
-const int *vp9_get_coef_neighbors_handle(const int *scan);
-int vp9_get_coef_neighbor_context(const short int *qcoeff_ptr, int nodc,
- const int *neigbor_handle, int rc);
-extern DECLARE_ALIGNED(16, int, vp9_default_zig_zag1d_4x4_neighbors[
- 16 * MAX_NEIGHBORS]);
-extern DECLARE_ALIGNED(16, int, vp9_row_scan_4x4_neighbors[
- 16 * MAX_NEIGHBORS]);
-extern DECLARE_ALIGNED(16, int, vp9_col_scan_4x4_neighbors[
- 16 * MAX_NEIGHBORS]);
-extern DECLARE_ALIGNED(16, int, vp9_default_zig_zag1d_8x8_neighbors[
- 64 * MAX_NEIGHBORS]);
-extern DECLARE_ALIGNED(16, int, vp9_default_zig_zag1d_16x16_neighbors[
- 256 * MAX_NEIGHBORS]);
-extern DECLARE_ALIGNED(16, int, vp9_default_zig_zag1d_32x32_neighbors[
- 1024 * MAX_NEIGHBORS]);
-#endif // CONFIG_NEWCOEFCONTEXT
#endif // VP9_COMMON_VP9_ENTROPY_H_