Merge cnvcontext experiment.

Change-Id: I35e64998b25694a3bb4a62164bba3c03c1db4bc7
This commit is contained in:
Ronald S. Bultje 2013-02-26 10:37:49 -08:00
parent f3fdb4c37d
commit b1641150b1
5 changed files with 0 additions and 45 deletions

2
configure vendored
View File

@ -242,8 +242,6 @@ EXPERIMENT_LIST="
implicit_segmentation
newbintramodes
comp_interintra_pred
tx64x64
cnvcontext
enable_6tap
abovesprefmv
"

View File

@ -110,15 +110,12 @@ static int decode_coefs(VP9D_COMP *dx, const MACROBLOCKD *xd,
case TX_8X8:
coef_probs = fc->coef_probs_8x8;
coef_counts = fc->coef_counts_8x8;
#if CONFIG_CNVCONTEXT
above_ec = (A0[aidx] + A0[aidx + 1]) != 0;
left_ec = (L0[lidx] + L0[lidx + 1]) != 0;
#endif
break;
case TX_16X16:
coef_probs = fc->coef_probs_16x16;
coef_counts = fc->coef_counts_16x16;
#if CONFIG_CNVCONTEXT
if (type == PLANE_TYPE_UV) {
ENTROPY_CONTEXT *A1 = (ENTROPY_CONTEXT *) (xd->above_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,
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;
}
#endif
break;
case TX_32X32:
coef_probs = fc->coef_probs_32x32;
coef_counts = fc->coef_counts_32x32;
#if CONFIG_CNVCONTEXT
if (type == PLANE_TYPE_UV) {
ENTROPY_CONTEXT *A1 = (ENTROPY_CONTEXT *) (xd->above_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,
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;
}
#endif
break;
}

View File

@ -597,13 +597,8 @@ void vp9_optimize_mby_8x8(MACROBLOCK *x) {
for (b = 0; b < 16; b += 4) {
ENTROPY_CONTEXT *const a = ta + vp9_block2above[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 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);
a[1] = a[0] = above_ec;
l[1] = l[0] = left_ec;
@ -621,13 +616,8 @@ void vp9_optimize_mbuv_8x8(MACROBLOCK *x) {
for (b = 16; b < 24; b += 4) {
ENTROPY_CONTEXT *const a = ta + vp9_block2above[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 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);
}
}
@ -645,13 +635,8 @@ void vp9_optimize_mby_16x16(MACROBLOCK *x) {
if (!t_above || !t_left)
return;
#if CONFIG_CNVCONTEXT
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;
#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);
}

View File

@ -402,12 +402,10 @@ static INLINE int cost_coeffs(MACROBLOCK *mb,
unsigned int (*token_costs)[PREV_COEF_CONTEXTS][MAX_ENTROPY_TOKENS] =
mb->token_costs[tx_size][type][ref];
ENTROPY_CONTEXT a_ec = *a, l_ec = *l;
#if CONFIG_CNVCONTEXT
ENTROPY_CONTEXT *const a1 = a +
sizeof(ENTROPY_CONTEXT_PLANES)/sizeof(ENTROPY_CONTEXT);
ENTROPY_CONTEXT *const l1 = l +
sizeof(ENTROPY_CONTEXT_PLANES)/sizeof(ENTROPY_CONTEXT);
#endif
switch (tx_size) {
case TX_4X4:
@ -422,10 +420,8 @@ static INLINE int cost_coeffs(MACROBLOCK *mb,
}
break;
case TX_8X8:
#if CONFIG_CNVCONTEXT
a_ec = (a[0] + a[1]) != 0;
l_ec = (l[0] + l[1]) != 0;
#endif
scan = vp9_default_zig_zag1d_8x8;
seg_eob = 64;
break;
@ -435,25 +431,21 @@ static INLINE int cost_coeffs(MACROBLOCK *mb,
if (type == PLANE_TYPE_UV) {
const int uv_idx = ib - 16;
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;
l_ec = (l[0] + l[1] + l1[0] + l1[1]) != 0;
} else {
a_ec = (a[0] + a[1] + a[2] + a[3]) != 0;
l_ec = (l[0] + l[1] + l[2] + l[3]) != 0;
#endif
}
break;
case TX_32X32:
scan = vp9_default_zig_zag1d_32x32;
seg_eob = 1024;
qcoeff_ptr = xd->sb_coeff_data.qcoeff;
#if CONFIG_CNVCONTEXT
a_ec = (a[0] + a[1] + a[2] + a[3] +
a1[0] + a1[1] + a1[2] + a1[3]) != 0;
l_ec = (l[0] + l[1] + l[2] + l[3] +
l1[0] + l1[1] + l1[2] + l1[3]) != 0;
#endif
break;
default:
abort();
@ -482,7 +474,6 @@ static INLINE int cost_coeffs(MACROBLOCK *mb,
// is eob first coefficient;
pt = (c > 0);
*a = *l = pt;
#if CONFIG_CNVCONTEXT
if (tx_size >= TX_8X8) {
a[1] = l[1] = pt;
if (tx_size >= TX_16X16) {
@ -497,7 +488,6 @@ static INLINE int cost_coeffs(MACROBLOCK *mb,
}
}
}
#endif
return cost;
}

View File

@ -145,17 +145,14 @@ static void tokenize_b(VP9_COMP *cpi,
probs = cpi->common.fc.coef_probs_4x4;
break;
case TX_8X8:
#if CONFIG_CNVCONTEXT
a_ec = (a[0] + a[1]) != 0;
l_ec = (l[0] + l[1]) != 0;
#endif
seg_eob = 64;
scan = vp9_default_zig_zag1d_8x8;
counts = cpi->coef_counts_8x8;
probs = cpi->common.fc.coef_probs_8x8;
break;
case TX_16X16:
#if CONFIG_CNVCONTEXT
if (type != PLANE_TYPE_UV) {
a_ec = (a[0] + a[1] + a[2] + a[3]) != 0;
l_ec = (l[0] + l[1] + l[2] + l[3]) != 0;
@ -163,7 +160,6 @@ static void tokenize_b(VP9_COMP *cpi,
a_ec = (a[0] + a[1] + a1[0] + a1[1]) != 0;
l_ec = (l[0] + l[1] + l1[0] + l1[1]) != 0;
}
#endif
seg_eob = 256;
scan = vp9_default_zig_zag1d_16x16;
counts = cpi->coef_counts_16x16;
@ -174,14 +170,12 @@ static void tokenize_b(VP9_COMP *cpi,
}
break;
case TX_32X32:
#if CONFIG_CNVCONTEXT
a_ec = a[0] + a[1] + a[2] + a[3] +
a1[0] + a1[1] + a1[2] + a1[3];
l_ec = l[0] + l[1] + l[2] + l[3] +
l1[0] + l1[1] + l1[2] + l1[3];
a_ec = a_ec != 0;
l_ec = l_ec != 0;
#endif
seg_eob = 1024;
scan = vp9_default_zig_zag1d_32x32;
counts = cpi->coef_counts_32x32;
@ -635,15 +629,12 @@ static INLINE void stuff_b(VP9_COMP *cpi,
probs = cpi->common.fc.coef_probs_4x4;
break;
case TX_8X8:
#if CONFIG_CNVCONTEXT
a_ec = (a[0] + a[1]) != 0;
l_ec = (l[0] + l[1]) != 0;
#endif
counts = cpi->coef_counts_8x8;
probs = cpi->common.fc.coef_probs_8x8;
break;
case TX_16X16:
#if CONFIG_CNVCONTEXT
if (type != PLANE_TYPE_UV) {
a_ec = (a[0] + a[1] + a[2] + a[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,
a_ec = (a[0] + a[1] + a1[0] + a1[1]) != 0;
l_ec = (l[0] + l[1] + l1[0] + l1[1]) != 0;
}
#endif
counts = cpi->coef_counts_16x16;
probs = cpi->common.fc.coef_probs_16x16;
break;
case TX_32X32:
#if CONFIG_CNVCONTEXT
a_ec = a[0] + a[1] + a[2] + a[3] +
a1[0] + a1[1] + a1[2] + a1[3];
l_ec = l[0] + l[1] + l[2] + l[3] +
l1[0] + l1[1] + l1[2] + l1[3];
a_ec = a_ec != 0;
l_ec = l_ec != 0;
#endif
counts = cpi->coef_counts_32x32;
probs = cpi->common.fc.coef_probs_32x32;
break;