Commit b1641150 authored by Ronald S. Bultje's avatar Ronald S. Bultje
Browse files

Merge cnvcontext experiment.

Change-Id: I35e64998b25694a3bb4a62164bba3c03c1db4bc7
parent f3fdb4c3
...@@ -242,8 +242,6 @@ EXPERIMENT_LIST=" ...@@ -242,8 +242,6 @@ EXPERIMENT_LIST="
implicit_segmentation implicit_segmentation
newbintramodes newbintramodes
comp_interintra_pred comp_interintra_pred
tx64x64
cnvcontext
enable_6tap enable_6tap
abovesprefmv abovesprefmv
" "
......
...@@ -110,15 +110,12 @@ static int decode_coefs(VP9D_COMP *dx, const MACROBLOCKD *xd, ...@@ -110,15 +110,12 @@ static int decode_coefs(VP9D_COMP *dx, const MACROBLOCKD *xd,
case TX_8X8: case TX_8X8:
coef_probs = fc->coef_probs_8x8; coef_probs = fc->coef_probs_8x8;
coef_counts = fc->coef_counts_8x8; coef_counts = fc->coef_counts_8x8;
#if CONFIG_CNVCONTEXT
above_ec = (A0[aidx] + A0[aidx + 1]) != 0; above_ec = (A0[aidx] + A0[aidx + 1]) != 0;
left_ec = (L0[lidx] + L0[lidx + 1]) != 0; left_ec = (L0[lidx] + L0[lidx + 1]) != 0;
#endif
break; break;
case TX_16X16: case TX_16X16:
coef_probs = fc->coef_probs_16x16; coef_probs = fc->coef_probs_16x16;
coef_counts = fc->coef_counts_16x16; coef_counts = fc->coef_counts_16x16;
#if CONFIG_CNVCONTEXT
if (type == PLANE_TYPE_UV) { if (type == PLANE_TYPE_UV) {
ENTROPY_CONTEXT *A1 = (ENTROPY_CONTEXT *) (xd->above_context + 1); ENTROPY_CONTEXT *A1 = (ENTROPY_CONTEXT *) (xd->above_context + 1);
ENTROPY_CONTEXT *L1 = (ENTROPY_CONTEXT *) (xd->left_context + 1); ENTROPY_CONTEXT *L1 = (ENTROPY_CONTEXT *) (xd->left_context + 1);
...@@ -128,12 +125,10 @@ static int decode_coefs(VP9D_COMP *dx, const MACROBLOCKD *xd, ...@@ -128,12 +125,10 @@ static int decode_coefs(VP9D_COMP *dx, const MACROBLOCKD *xd,
above_ec = (A0[aidx] + A0[aidx + 1] + A0[aidx + 2] + A0[aidx + 3]) != 0; above_ec = (A0[aidx] + A0[aidx + 1] + A0[aidx + 2] + A0[aidx + 3]) != 0;
left_ec = (L0[lidx] + L0[lidx + 1] + L0[lidx + 2] + L0[lidx + 3]) != 0; left_ec = (L0[lidx] + L0[lidx + 1] + L0[lidx + 2] + L0[lidx + 3]) != 0;
} }
#endif
break; break;
case TX_32X32: case TX_32X32:
coef_probs = fc->coef_probs_32x32; coef_probs = fc->coef_probs_32x32;
coef_counts = fc->coef_counts_32x32; coef_counts = fc->coef_counts_32x32;
#if CONFIG_CNVCONTEXT
if (type == PLANE_TYPE_UV) { if (type == PLANE_TYPE_UV) {
ENTROPY_CONTEXT *A1 = (ENTROPY_CONTEXT *) (xd->above_context + 1); ENTROPY_CONTEXT *A1 = (ENTROPY_CONTEXT *) (xd->above_context + 1);
ENTROPY_CONTEXT *L1 = (ENTROPY_CONTEXT *) (xd->left_context + 1); ENTROPY_CONTEXT *L1 = (ENTROPY_CONTEXT *) (xd->left_context + 1);
...@@ -153,7 +148,6 @@ static int decode_coefs(VP9D_COMP *dx, const MACROBLOCKD *xd, ...@@ -153,7 +148,6 @@ static int decode_coefs(VP9D_COMP *dx, const MACROBLOCKD *xd,
left_ec = (L0[lidx] + L0[lidx + 1] + L0[lidx + 2] + L0[lidx + 3] + left_ec = (L0[lidx] + L0[lidx + 1] + L0[lidx + 2] + L0[lidx + 3] +
L1[lidx] + L1[lidx + 1] + L1[lidx + 2] + L1[lidx + 3]) != 0; L1[lidx] + L1[lidx + 1] + L1[lidx + 2] + L1[lidx + 3]) != 0;
} }
#endif
break; break;
} }
......
...@@ -597,13 +597,8 @@ void vp9_optimize_mby_8x8(MACROBLOCK *x) { ...@@ -597,13 +597,8 @@ void vp9_optimize_mby_8x8(MACROBLOCK *x) {
for (b = 0; b < 16; b += 4) { for (b = 0; b < 16; b += 4) {
ENTROPY_CONTEXT *const a = ta + vp9_block2above[TX_8X8][b]; ENTROPY_CONTEXT *const a = ta + vp9_block2above[TX_8X8][b];
ENTROPY_CONTEXT *const l = tl + vp9_block2left[TX_8X8][b]; ENTROPY_CONTEXT *const l = tl + vp9_block2left[TX_8X8][b];
#if CONFIG_CNVCONTEXT
ENTROPY_CONTEXT above_ec = (a[0] + a[1]) != 0; ENTROPY_CONTEXT above_ec = (a[0] + a[1]) != 0;
ENTROPY_CONTEXT left_ec = (l[0] + l[1]) != 0; ENTROPY_CONTEXT left_ec = (l[0] + l[1]) != 0;
#else
ENTROPY_CONTEXT above_ec = a[0];
ENTROPY_CONTEXT left_ec = l[0];
#endif
optimize_b(x, b, PLANE_TYPE_Y_WITH_DC, &above_ec, &left_ec, TX_8X8); optimize_b(x, b, PLANE_TYPE_Y_WITH_DC, &above_ec, &left_ec, TX_8X8);
a[1] = a[0] = above_ec; a[1] = a[0] = above_ec;
l[1] = l[0] = left_ec; l[1] = l[0] = left_ec;
...@@ -621,13 +616,8 @@ void vp9_optimize_mbuv_8x8(MACROBLOCK *x) { ...@@ -621,13 +616,8 @@ void vp9_optimize_mbuv_8x8(MACROBLOCK *x) {
for (b = 16; b < 24; b += 4) { for (b = 16; b < 24; b += 4) {
ENTROPY_CONTEXT *const a = ta + vp9_block2above[TX_8X8][b]; ENTROPY_CONTEXT *const a = ta + vp9_block2above[TX_8X8][b];
ENTROPY_CONTEXT *const l = tl + vp9_block2left[TX_8X8][b]; ENTROPY_CONTEXT *const l = tl + vp9_block2left[TX_8X8][b];
#if CONFIG_CNVCONTEXT
ENTROPY_CONTEXT above_ec = (a[0] + a[1]) != 0; ENTROPY_CONTEXT above_ec = (a[0] + a[1]) != 0;
ENTROPY_CONTEXT left_ec = (l[0] + l[1]) != 0; ENTROPY_CONTEXT left_ec = (l[0] + l[1]) != 0;
#else
ENTROPY_CONTEXT above_ec = a[0];
ENTROPY_CONTEXT left_ec = l[0];
#endif
optimize_b(x, b, PLANE_TYPE_UV, &above_ec, &left_ec, TX_8X8); optimize_b(x, b, PLANE_TYPE_UV, &above_ec, &left_ec, TX_8X8);
} }
} }
...@@ -645,13 +635,8 @@ void vp9_optimize_mby_16x16(MACROBLOCK *x) { ...@@ -645,13 +635,8 @@ void vp9_optimize_mby_16x16(MACROBLOCK *x) {
if (!t_above || !t_left) if (!t_above || !t_left)
return; return;
#if CONFIG_CNVCONTEXT
ta = (t_above->y1[0] + t_above->y1[1] + t_above->y1[2] + t_above->y1[3]) != 0; ta = (t_above->y1[0] + t_above->y1[1] + t_above->y1[2] + t_above->y1[3]) != 0;
tl = (t_left->y1[0] + t_left->y1[1] + t_left->y1[2] + t_left->y1[3]) != 0; tl = (t_left->y1[0] + t_left->y1[1] + t_left->y1[2] + t_left->y1[3]) != 0;
#else
ta = t_above->y1[0];
tl = t_left->y1[0];
#endif
optimize_b(x, 0, PLANE_TYPE_Y_WITH_DC, &ta, &tl, TX_16X16); optimize_b(x, 0, PLANE_TYPE_Y_WITH_DC, &ta, &tl, TX_16X16);
} }
......
...@@ -402,12 +402,10 @@ static INLINE int cost_coeffs(MACROBLOCK *mb, ...@@ -402,12 +402,10 @@ static INLINE int cost_coeffs(MACROBLOCK *mb,
unsigned int (*token_costs)[PREV_COEF_CONTEXTS][MAX_ENTROPY_TOKENS] = unsigned int (*token_costs)[PREV_COEF_CONTEXTS][MAX_ENTROPY_TOKENS] =
mb->token_costs[tx_size][type][ref]; mb->token_costs[tx_size][type][ref];
ENTROPY_CONTEXT a_ec = *a, l_ec = *l; ENTROPY_CONTEXT a_ec = *a, l_ec = *l;
#if CONFIG_CNVCONTEXT
ENTROPY_CONTEXT *const a1 = a + ENTROPY_CONTEXT *const a1 = a +
sizeof(ENTROPY_CONTEXT_PLANES)/sizeof(ENTROPY_CONTEXT); sizeof(ENTROPY_CONTEXT_PLANES)/sizeof(ENTROPY_CONTEXT);
ENTROPY_CONTEXT *const l1 = l + ENTROPY_CONTEXT *const l1 = l +
sizeof(ENTROPY_CONTEXT_PLANES)/sizeof(ENTROPY_CONTEXT); sizeof(ENTROPY_CONTEXT_PLANES)/sizeof(ENTROPY_CONTEXT);
#endif
switch (tx_size) { switch (tx_size) {
case TX_4X4: case TX_4X4:
...@@ -422,10 +420,8 @@ static INLINE int cost_coeffs(MACROBLOCK *mb, ...@@ -422,10 +420,8 @@ static INLINE int cost_coeffs(MACROBLOCK *mb,
} }
break; break;
case TX_8X8: case TX_8X8:
#if CONFIG_CNVCONTEXT
a_ec = (a[0] + a[1]) != 0; a_ec = (a[0] + a[1]) != 0;
l_ec = (l[0] + l[1]) != 0; l_ec = (l[0] + l[1]) != 0;
#endif
scan = vp9_default_zig_zag1d_8x8; scan = vp9_default_zig_zag1d_8x8;
seg_eob = 64; seg_eob = 64;
break; break;
...@@ -435,25 +431,21 @@ static INLINE int cost_coeffs(MACROBLOCK *mb, ...@@ -435,25 +431,21 @@ static INLINE int cost_coeffs(MACROBLOCK *mb,
if (type == PLANE_TYPE_UV) { if (type == PLANE_TYPE_UV) {
const int uv_idx = ib - 16; const int uv_idx = ib - 16;
qcoeff_ptr = xd->sb_coeff_data.qcoeff + 1024 + 64 * uv_idx; qcoeff_ptr = xd->sb_coeff_data.qcoeff + 1024 + 64 * uv_idx;
#if CONFIG_CNVCONTEXT
a_ec = (a[0] + a[1] + a1[0] + a1[1]) != 0; a_ec = (a[0] + a[1] + a1[0] + a1[1]) != 0;
l_ec = (l[0] + l[1] + l1[0] + l1[1]) != 0; l_ec = (l[0] + l[1] + l1[0] + l1[1]) != 0;
} else { } else {
a_ec = (a[0] + a[1] + a[2] + a[3]) != 0; a_ec = (a[0] + a[1] + a[2] + a[3]) != 0;
l_ec = (l[0] + l[1] + l[2] + l[3]) != 0; l_ec = (l[0] + l[1] + l[2] + l[3]) != 0;
#endif
} }
break; break;
case TX_32X32: case TX_32X32:
scan = vp9_default_zig_zag1d_32x32; scan = vp9_default_zig_zag1d_32x32;
seg_eob = 1024; seg_eob = 1024;
qcoeff_ptr = xd->sb_coeff_data.qcoeff; qcoeff_ptr = xd->sb_coeff_data.qcoeff;
#if CONFIG_CNVCONTEXT
a_ec = (a[0] + a[1] + a[2] + a[3] + a_ec = (a[0] + a[1] + a[2] + a[3] +
a1[0] + a1[1] + a1[2] + a1[3]) != 0; a1[0] + a1[1] + a1[2] + a1[3]) != 0;
l_ec = (l[0] + l[1] + l[2] + l[3] + l_ec = (l[0] + l[1] + l[2] + l[3] +
l1[0] + l1[1] + l1[2] + l1[3]) != 0; l1[0] + l1[1] + l1[2] + l1[3]) != 0;
#endif
break; break;
default: default:
abort(); abort();
...@@ -482,7 +474,6 @@ static INLINE int cost_coeffs(MACROBLOCK *mb, ...@@ -482,7 +474,6 @@ static INLINE int cost_coeffs(MACROBLOCK *mb,
// is eob first coefficient; // is eob first coefficient;
pt = (c > 0); pt = (c > 0);
*a = *l = pt; *a = *l = pt;
#if CONFIG_CNVCONTEXT
if (tx_size >= TX_8X8) { if (tx_size >= TX_8X8) {
a[1] = l[1] = pt; a[1] = l[1] = pt;
if (tx_size >= TX_16X16) { if (tx_size >= TX_16X16) {
...@@ -497,7 +488,6 @@ static INLINE int cost_coeffs(MACROBLOCK *mb, ...@@ -497,7 +488,6 @@ static INLINE int cost_coeffs(MACROBLOCK *mb,
} }
} }
} }
#endif
return cost; return cost;
} }
......
...@@ -145,17 +145,14 @@ static void tokenize_b(VP9_COMP *cpi, ...@@ -145,17 +145,14 @@ static void tokenize_b(VP9_COMP *cpi,
probs = cpi->common.fc.coef_probs_4x4; probs = cpi->common.fc.coef_probs_4x4;
break; break;
case TX_8X8: case TX_8X8:
#if CONFIG_CNVCONTEXT
a_ec = (a[0] + a[1]) != 0; a_ec = (a[0] + a[1]) != 0;
l_ec = (l[0] + l[1]) != 0; l_ec = (l[0] + l[1]) != 0;
#endif
seg_eob = 64; seg_eob = 64;
scan = vp9_default_zig_zag1d_8x8; scan = vp9_default_zig_zag1d_8x8;
counts = cpi->coef_counts_8x8; counts = cpi->coef_counts_8x8;
probs = cpi->common.fc.coef_probs_8x8; probs = cpi->common.fc.coef_probs_8x8;
break; break;
case TX_16X16: case TX_16X16:
#if CONFIG_CNVCONTEXT
if (type != PLANE_TYPE_UV) { if (type != PLANE_TYPE_UV) {
a_ec = (a[0] + a[1] + a[2] + a[3]) != 0; a_ec = (a[0] + a[1] + a[2] + a[3]) != 0;
l_ec = (l[0] + l[1] + l[2] + l[3]) != 0; l_ec = (l[0] + l[1] + l[2] + l[3]) != 0;
...@@ -163,7 +160,6 @@ static void tokenize_b(VP9_COMP *cpi, ...@@ -163,7 +160,6 @@ static void tokenize_b(VP9_COMP *cpi,
a_ec = (a[0] + a[1] + a1[0] + a1[1]) != 0; a_ec = (a[0] + a[1] + a1[0] + a1[1]) != 0;
l_ec = (l[0] + l[1] + l1[0] + l1[1]) != 0; l_ec = (l[0] + l[1] + l1[0] + l1[1]) != 0;
} }
#endif
seg_eob = 256; seg_eob = 256;
scan = vp9_default_zig_zag1d_16x16; scan = vp9_default_zig_zag1d_16x16;
counts = cpi->coef_counts_16x16; counts = cpi->coef_counts_16x16;
...@@ -174,14 +170,12 @@ static void tokenize_b(VP9_COMP *cpi, ...@@ -174,14 +170,12 @@ static void tokenize_b(VP9_COMP *cpi,
} }
break; break;
case TX_32X32: case TX_32X32:
#if CONFIG_CNVCONTEXT
a_ec = a[0] + a[1] + a[2] + a[3] + a_ec = a[0] + a[1] + a[2] + a[3] +
a1[0] + a1[1] + a1[2] + a1[3]; a1[0] + a1[1] + a1[2] + a1[3];
l_ec = l[0] + l[1] + l[2] + l[3] + l_ec = l[0] + l[1] + l[2] + l[3] +
l1[0] + l1[1] + l1[2] + l1[3]; l1[0] + l1[1] + l1[2] + l1[3];
a_ec = a_ec != 0; a_ec = a_ec != 0;
l_ec = l_ec != 0; l_ec = l_ec != 0;
#endif
seg_eob = 1024; seg_eob = 1024;
scan = vp9_default_zig_zag1d_32x32; scan = vp9_default_zig_zag1d_32x32;
counts = cpi->coef_counts_32x32; counts = cpi->coef_counts_32x32;
...@@ -635,15 +629,12 @@ static INLINE void stuff_b(VP9_COMP *cpi, ...@@ -635,15 +629,12 @@ static INLINE void stuff_b(VP9_COMP *cpi,
probs = cpi->common.fc.coef_probs_4x4; probs = cpi->common.fc.coef_probs_4x4;
break; break;
case TX_8X8: case TX_8X8:
#if CONFIG_CNVCONTEXT
a_ec = (a[0] + a[1]) != 0; a_ec = (a[0] + a[1]) != 0;
l_ec = (l[0] + l[1]) != 0; l_ec = (l[0] + l[1]) != 0;
#endif
counts = cpi->coef_counts_8x8; counts = cpi->coef_counts_8x8;
probs = cpi->common.fc.coef_probs_8x8; probs = cpi->common.fc.coef_probs_8x8;
break; break;
case TX_16X16: case TX_16X16:
#if CONFIG_CNVCONTEXT
if (type != PLANE_TYPE_UV) { if (type != PLANE_TYPE_UV) {
a_ec = (a[0] + a[1] + a[2] + a[3]) != 0; a_ec = (a[0] + a[1] + a[2] + a[3]) != 0;
l_ec = (l[0] + l[1] + l[2] + l[3]) != 0; l_ec = (l[0] + l[1] + l[2] + l[3]) != 0;
...@@ -651,19 +642,16 @@ static INLINE void stuff_b(VP9_COMP *cpi, ...@@ -651,19 +642,16 @@ static INLINE void stuff_b(VP9_COMP *cpi,
a_ec = (a[0] + a[1] + a1[0] + a1[1]) != 0; a_ec = (a[0] + a[1] + a1[0] + a1[1]) != 0;
l_ec = (l[0] + l[1] + l1[0] + l1[1]) != 0; l_ec = (l[0] + l[1] + l1[0] + l1[1]) != 0;
} }
#endif
counts = cpi->coef_counts_16x16; counts = cpi->coef_counts_16x16;
probs = cpi->common.fc.coef_probs_16x16; probs = cpi->common.fc.coef_probs_16x16;
break; break;
case TX_32X32: case TX_32X32:
#if CONFIG_CNVCONTEXT
a_ec = a[0] + a[1] + a[2] + a[3] + a_ec = a[0] + a[1] + a[2] + a[3] +
a1[0] + a1[1] + a1[2] + a1[3]; a1[0] + a1[1] + a1[2] + a1[3];
l_ec = l[0] + l[1] + l[2] + l[3] + l_ec = l[0] + l[1] + l[2] + l[3] +
l1[0] + l1[1] + l1[2] + l1[3]; l1[0] + l1[1] + l1[2] + l1[3];
a_ec = a_ec != 0; a_ec = a_ec != 0;
l_ec = l_ec != 0; l_ec = l_ec != 0;
#endif
counts = cpi->coef_counts_32x32; counts = cpi->coef_counts_32x32;
probs = cpi->common.fc.coef_probs_32x32; probs = cpi->common.fc.coef_probs_32x32;
break; break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment