Commit 00269a24 authored by Ronald S. Bultje's avatar Ronald S. Bultje

Remove unused stuffing function.

Change-Id: I2bc8d775f8d698bf8582f4eecabc2329452e8d9b
parent e3167b8c
......@@ -802,242 +802,3 @@ void print_context_counters() {
void vp9_tokenize_initialize() {
fill_value_tokens();
}
static void stuff_b(VP9_COMP *cpi,
MACROBLOCKD *xd,
const int ib,
TOKENEXTRA **tp,
PLANE_TYPE type,
TX_SIZE tx_size,
int dry_run) {
MB_MODE_INFO *mbmi = &xd->mode_info_context->mbmi;
const BLOCK_SIZE_TYPE sb_type = mbmi->sb_type;
vp9_coeff_count *counts;
vp9_coeff_probs *probs;
int pt, band;
TOKENEXTRA *t = *tp;
const int ref = mbmi->ref_frame != INTRA_FRAME;
ENTROPY_CONTEXT *a, *l, *a1, *l1, *a2, *l2, *a3, *l3, a_ec, l_ec;
if (sb_type == BLOCK_SIZE_SB64X64) {
a = (ENTROPY_CONTEXT *)xd->above_context +
vp9_block2above_sb64[tx_size][ib];
l = (ENTROPY_CONTEXT *)xd->left_context + vp9_block2left_sb64[tx_size][ib];
a1 = a + sizeof(ENTROPY_CONTEXT_PLANES) / sizeof(ENTROPY_CONTEXT);
l1 = l + sizeof(ENTROPY_CONTEXT_PLANES) / sizeof(ENTROPY_CONTEXT);
a2 = a1 + sizeof(ENTROPY_CONTEXT_PLANES) / sizeof(ENTROPY_CONTEXT);
l2 = l1 + sizeof(ENTROPY_CONTEXT_PLANES) / sizeof(ENTROPY_CONTEXT);
a3 = a2 + sizeof(ENTROPY_CONTEXT_PLANES) / sizeof(ENTROPY_CONTEXT);
l3 = l2 + sizeof(ENTROPY_CONTEXT_PLANES) / sizeof(ENTROPY_CONTEXT);
} else if (sb_type == BLOCK_SIZE_SB32X32) {
a = (ENTROPY_CONTEXT *)xd->above_context + vp9_block2above_sb[tx_size][ib];
l = (ENTROPY_CONTEXT *)xd->left_context + vp9_block2left_sb[tx_size][ib];
a1 = a + sizeof(ENTROPY_CONTEXT_PLANES) / sizeof(ENTROPY_CONTEXT);
l1 = l + sizeof(ENTROPY_CONTEXT_PLANES) / sizeof(ENTROPY_CONTEXT);
a2 = l2 = a3 = l3 = NULL;
} else {
a = (ENTROPY_CONTEXT *)xd->above_context + vp9_block2above[tx_size][ib];
l = (ENTROPY_CONTEXT *)xd->left_context + vp9_block2left[tx_size][ib];
a1 = l1 = a2 = l2 = a3 = l3 = NULL;
}
switch (tx_size) {
default:
case TX_4X4:
a_ec = a[0];
l_ec = l[0];
counts = cpi->coef_counts_4x4;
probs = cpi->common.fc.coef_probs_4x4;
break;
case TX_8X8:
a_ec = (a[0] + a[1]) != 0;
l_ec = (l[0] + l[1]) != 0;
counts = cpi->coef_counts_8x8;
probs = cpi->common.fc.coef_probs_8x8;
break;
case TX_16X16:
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;
} else {
a_ec = (a[0] + a[1] + a1[0] + a1[1]) != 0;
l_ec = (l[0] + l[1] + l1[0] + l1[1]) != 0;
}
counts = cpi->coef_counts_16x16;
probs = cpi->common.fc.coef_probs_16x16;
break;
case TX_32X32:
if (type != PLANE_TYPE_UV) {
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;
} else {
a_ec = (a[0] + a[1] + a1[0] + a1[1] +
a2[0] + a2[1] + a3[0] + a3[1]) != 0;
l_ec = (l[0] + l[1] + l1[0] + l1[1] +
l2[0] + l2[1] + l3[0] + l3[1]) != 0;
}
counts = cpi->coef_counts_32x32;
probs = cpi->common.fc.coef_probs_32x32;
break;
}
pt = combine_entropy_contexts(a_ec, l_ec);
band = 0;
t->token = DCT_EOB_TOKEN;
t->context_tree = probs[type][ref][band][pt];
t->skip_eob_node = 0;
#if CONFIG_CODE_ZEROGROUP
t->skip_coef_val = 0;
#endif
++t;
*tp = t;
if (!dry_run) {
++counts[type][ref][band][pt][DCT_EOB_TOKEN];
}
*a = *l = 0;
if (tx_size == TX_8X8) {
a[1] = 0;
l[1] = 0;
} else if (tx_size == TX_16X16) {
if (type != PLANE_TYPE_UV) {
a[1] = a[2] = a[3] = 0;
l[1] = l[2] = l[3] = 0;
} else {
a1[0] = a1[1] = a[1] = a_ec;
l1[0] = l1[1] = l[1] = l_ec;
}
} else if (tx_size == TX_32X32) {
if (type != PLANE_TYPE_Y_WITH_DC) {
a[1] = a[2] = a[3] = a_ec;
l[1] = l[2] = l[3] = l_ec;
a1[0] = a1[1] = a1[2] = a1[3] = a_ec;
l1[0] = l1[1] = l1[2] = l1[3] = l_ec;
} else {
a[1] = a1[0] = a1[1] = a_ec;
l[1] = l1[0] = l1[1] = l_ec;
a2[0] = a2[1] = a3[0] = a3[1] = a_ec;
l2[0] = l2[1] = l3[0] = l3[1] = l_ec;
}
}
}
static void stuff_mb_8x8(VP9_COMP *cpi, MACROBLOCKD *xd,
TOKENEXTRA **t, int dry_run) {
int b;
for (b = 0; b < 16; b += 4)
stuff_b(cpi, xd, b, t, PLANE_TYPE_Y_WITH_DC, TX_8X8, dry_run);
for (b = 16; b < 24; b += 4)
stuff_b(cpi, xd, b, t, PLANE_TYPE_UV, TX_8X8, dry_run);
}
static void stuff_mb_16x16(VP9_COMP *cpi, MACROBLOCKD *xd,
TOKENEXTRA **t, int dry_run) {
int b;
stuff_b(cpi, xd, 0, t, PLANE_TYPE_Y_WITH_DC, TX_16X16, dry_run);
for (b = 16; b < 24; b += 4) {
stuff_b(cpi, xd, b, t, PLANE_TYPE_UV, TX_8X8, dry_run);
}
}
static void stuff_mb_4x4(VP9_COMP *cpi, MACROBLOCKD *xd,
TOKENEXTRA **t, int dry_run) {
int b;
for (b = 0; b < 16; b++)
stuff_b(cpi, xd, b, t, PLANE_TYPE_Y_WITH_DC, TX_4X4, dry_run);
for (b = 16; b < 24; b++)
stuff_b(cpi, xd, b, t, PLANE_TYPE_UV, TX_4X4, dry_run);
}
static void stuff_mb_8x8_4x4uv(VP9_COMP *cpi, MACROBLOCKD *xd,
TOKENEXTRA **t, int dry_run) {
int b;
for (b = 0; b < 16; b += 4)
stuff_b(cpi, xd, b, t, PLANE_TYPE_Y_WITH_DC, TX_8X8, dry_run);
for (b = 16; b < 24; b++)
stuff_b(cpi, xd, b, t, PLANE_TYPE_UV, TX_4X4, dry_run);
}
void vp9_stuff_mb(VP9_COMP *cpi, MACROBLOCKD *xd, TOKENEXTRA **t, int dry_run) {
TX_SIZE tx_size = xd->mode_info_context->mbmi.txfm_size;
TOKENEXTRA * const t_backup = *t;
if (tx_size == TX_16X16) {
stuff_mb_16x16(cpi, xd, t, dry_run);
} else if (tx_size == TX_8X8) {
if (xd->mode_info_context->mbmi.mode == I8X8_PRED ||
xd->mode_info_context->mbmi.mode == SPLITMV) {
stuff_mb_8x8_4x4uv(cpi, xd, t, dry_run);
} else {
stuff_mb_8x8(cpi, xd, t, dry_run);
}
} else {
stuff_mb_4x4(cpi, xd, t, dry_run);
}
if (dry_run) {
*t = t_backup;
}
}
void vp9_stuff_sb(VP9_COMP *cpi, MACROBLOCKD *xd, TOKENEXTRA **t, int dry_run,
BLOCK_SIZE_TYPE bsize) {
MB_MODE_INFO *mbmi = &xd->mode_info_context->mbmi;
const int bwl = mb_width_log2(bsize) + 2, bhl = mb_height_log2(bsize) + 2;
const TX_SIZE txfm_size = mbmi->txfm_size;
const TX_SIZE uv_txfm_size = (bsize < BLOCK_SIZE_SB32X32 &&
txfm_size == TX_16X16) ? TX_8X8 :
(bsize < BLOCK_SIZE_SB64X64 &&
txfm_size == TX_32X32) ? TX_16X16 : txfm_size;
int b;
const int n_y = (1 << (bwl + bhl)), n_uv = (n_y * 3) >> 1;
TOKENEXTRA * const t_backup = *t;
switch (txfm_size) {
case TX_32X32:
for (b = 0; b < n_y; b += 64)
stuff_b(cpi, xd, b, t, PLANE_TYPE_Y_WITH_DC, TX_32X32, dry_run);
if (uv_txfm_size == TX_32X32) {
assert(bsize == BLOCK_SIZE_SB64X64);
stuff_b(cpi, xd, 256, t, PLANE_TYPE_UV, TX_32X32, dry_run);
stuff_b(cpi, xd, 320, t, PLANE_TYPE_UV, TX_32X32, dry_run);
} else {
for (; b < n_uv; b += 16)
stuff_b(cpi, xd, b, t, PLANE_TYPE_UV, TX_16X16, dry_run);
}
break;
case TX_16X16:
for (b = 0; b < n_y; b += 16)
stuff_b(cpi, xd, b, t, PLANE_TYPE_Y_WITH_DC, TX_16X16, dry_run);
if (uv_txfm_size == TX_16X16) {
for (; b < n_uv; b += 16)
stuff_b(cpi, xd, b, t, PLANE_TYPE_UV, TX_16X16, dry_run);
} else {
for (; b < n_uv; b += 4)
stuff_b(cpi, xd, b, t, PLANE_TYPE_UV, TX_8X8, dry_run);
}
break;
case TX_8X8:
for (b = 0; b < n_y; b += 4)
stuff_b(cpi, xd, b, t, PLANE_TYPE_Y_WITH_DC, TX_8X8, dry_run);
for (; b < n_uv; b += 4)
stuff_b(cpi, xd, b, t, PLANE_TYPE_UV, TX_8X8, dry_run);
break;
case TX_4X4:
for (b = 0; b < n_y; b++)
stuff_b(cpi, xd, b, t, PLANE_TYPE_Y_WITH_DC, TX_4X4, dry_run);
for (; b < n_uv; b++)
stuff_b(cpi, xd, b, t, PLANE_TYPE_UV, TX_4X4, dry_run);
break;
default: assert(0);
}
if (dry_run) {
*t = t_backup;
}
}
......@@ -44,11 +44,6 @@ void vp9_tokenize_mb(struct VP9_COMP *cpi, MACROBLOCKD *xd,
void vp9_tokenize_sb(struct VP9_COMP *cpi, MACROBLOCKD *xd,
TOKENEXTRA **t, int dry_run, BLOCK_SIZE_TYPE bsize);
void vp9_stuff_mb(struct VP9_COMP *cpi, MACROBLOCKD *xd,
TOKENEXTRA **t, int dry_run);
void vp9_stuff_sb(struct VP9_COMP *cpi, MACROBLOCKD *xd,
TOKENEXTRA **t, int dry_run, BLOCK_SIZE_TYPE bsize);
#ifdef ENTROPY_STATS
void init_context_counters();
void print_context_counters();
......
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