Commit c9071601 authored by Ronald S. Bultje's avatar Ronald S. Bultje

Remove compound intra-intra experiment.

This experiment gives little gains and adds relatively much code
complexity (and it hinders other experiments), so let's get rid of
it.

Change-Id: Id25e79a137a1b8a01138aa27a1fa0ba4a2df274a
parent 741fbe96
......@@ -238,7 +238,6 @@ HAVE_LIST="
"
EXPERIMENT_LIST="
csm
comp_intra_pred
lossless
new_mvref
implicit_segmentation
......
......@@ -215,9 +215,6 @@ union b_mode_info {
struct {
B_PREDICTION_MODE first;
TX_TYPE tx_type;
#if CONFIG_COMP_INTRA_PRED
B_PREDICTION_MODE second;
#endif
#if CONFIG_NEWBINTRAMODES
B_PREDICTION_MODE context;
#endif
......@@ -245,9 +242,6 @@ typedef enum {
typedef struct {
MB_PREDICTION_MODE mode, uv_mode;
#if CONFIG_COMP_INTRA_PRED
MB_PREDICTION_MODE second_mode, second_uv_mode;
#endif
#if CONFIG_COMP_INTERINTRA_PRED
MB_PREDICTION_MODE interintra_mode, interintra_uv_mode;
#endif
......
......@@ -87,9 +87,6 @@ void vp9_print_modes_and_motion_vectors(MODE_INFO *mi, int rows, int cols,
if (mi[mb_index].mbmi.mode == B_PRED) {
fprintf(mvs, "%2d ", mi[mb_index].bmi[bindex].as_mode.first);
#if CONFIG_COMP_INTRA_PRED
fprintf(mvs, "%2d ", mi[mb_index].bmi[bindex].as_mode.second);
#endif
} else
fprintf(mvs, "xx ");
......
......@@ -16,9 +16,6 @@
#define SUBMVREF_COUNT 5
#define VP9_NUMMBSPLITS 4
#if CONFIG_COMP_INTRA_PRED
#define DEFAULT_COMP_INTRA_PROB 32
#endif
#if CONFIG_COMP_INTERINTRA_PRED
#define VP9_DEF_INTERINTRA_PROB 248
......
......@@ -773,28 +773,6 @@ void vp9_build_intra_predictors_sb64y_s(MACROBLOCKD *xd) {
xd->up_available, xd->left_available);
}
#if CONFIG_COMP_INTRA_PRED
void vp9_build_comp_intra_predictors_mby(MACROBLOCKD *xd) {
uint8_t predictor[2][256];
int i;
vp9_build_intra_predictors_internal(xd->dst.y_buffer, xd->dst.y_stride,
predictor[0], 16,
xd->mode_info_context->mbmi.mode,
16, xd->up_available,
xd->left_available);
vp9_build_intra_predictors_internal(xd->dst.y_buffer, xd->dst.y_stride,
predictor[1], 16,
xd->mode_info_context->mbmi.second_mode,
16, xd->up_available,
xd->left_available);
for (i = 0; i < 256; i++) {
xd->predictor[i] = (predictor[0][i] + predictor[1][i] + 1) >> 1;
}
}
#endif
void vp9_build_intra_predictors_mbuv_internal(MACROBLOCKD *xd,
uint8_t *upred_ptr,
uint8_t *vpred_ptr,
......@@ -837,25 +815,6 @@ void vp9_build_intra_predictors_sb64uv_s(MACROBLOCKD *xd) {
32);
}
#if CONFIG_COMP_INTRA_PRED
void vp9_build_comp_intra_predictors_mbuv(MACROBLOCKD *xd) {
uint8_t predictor[2][2][64];
int i;
vp9_build_intra_predictors_mbuv_internal(
xd, predictor[0][0], predictor[1][0], 8,
xd->mode_info_context->mbmi.uv_mode, 8);
vp9_build_intra_predictors_mbuv_internal(
xd, predictor[0][1], predictor[1][1], 8,
xd->mode_info_context->mbmi.second_uv_mode, 8);
for (i = 0; i < 64; i++) {
xd->predictor[256 + i] = (predictor[0][0][i] + predictor[0][1][i] + 1) >> 1;
xd->predictor[256 + 64 + i] = (predictor[1][0][i] +
predictor[1][1][i] + 1) >> 1;
}
}
#endif
void vp9_intra8x8_predict(BLOCKD *xd,
int mode,
uint8_t *predictor) {
......@@ -864,24 +823,6 @@ void vp9_intra8x8_predict(BLOCKD *xd,
mode, 8, 1, 1);
}
#if CONFIG_COMP_INTRA_PRED
void vp9_comp_intra8x8_predict(BLOCKD *xd,
int mode, int second_mode,
uint8_t *out_predictor) {
uint8_t predictor[2][8 * 16];
int i, j;
vp9_intra8x8_predict(xd, mode, predictor[0]);
vp9_intra8x8_predict(xd, second_mode, predictor[1]);
for (i = 0; i < 8 * 16; i += 16) {
for (j = i; j < i + 8; j++) {
out_predictor[j] = (predictor[0][j] + predictor[1][j] + 1) >> 1;
}
}
}
#endif
void vp9_intra_uv4x4_predict(BLOCKD *xd,
int mode,
uint8_t *predictor) {
......@@ -890,24 +831,6 @@ void vp9_intra_uv4x4_predict(BLOCKD *xd,
mode, 4, 1, 1);
}
#if CONFIG_COMP_INTRA_PRED
void vp9_comp_intra_uv4x4_predict(BLOCKD *xd,
int mode, int mode2,
uint8_t *out_predictor) {
uint8_t predictor[2][8 * 4];
int i, j;
vp9_intra_uv4x4_predict(xd, mode, predictor[0]);
vp9_intra_uv4x4_predict(xd, mode2, predictor[1]);
for (i = 0; i < 4 * 8; i += 8) {
for (j = i; j < i + 4; j++) {
out_predictor[j] = (predictor[0][j] + predictor[1][j] + 1) >> 1;
}
}
}
#endif
/* TODO: try different ways of use Y-UV mode correlation
Current code assumes that a uv 4x4 block use same mode
as corresponding Y 8x8 area
......
......@@ -412,24 +412,6 @@ void vp9_intra4x4_predict(BLOCKD *x,
}
}
#if CONFIG_COMP_INTRA_PRED
void vp9_comp_intra4x4_predict_c(BLOCKD *x,
int b_mode, int b_mode2,
uint8_t *out_predictor) {
uint8_t predictor[2][4 * 16];
int i, j;
vp9_intra4x4_predict(x, b_mode, predictor[0]);
vp9_intra4x4_predict(x, b_mode2, predictor[1]);
for (i = 0; i < 16 * 4; i += 16) {
for (j = i; j < i + 4; j++) {
out_predictor[j] = (predictor[0][j] + predictor[1][j] + 1) >> 1;
}
}
}
#endif
/* copy 4 bytes from the above right down so that the 4x4 prediction modes using pixels above and
* to the right prediction have filled in pixels to use.
*/
......
......@@ -149,9 +149,6 @@ specialize vp9_build_intra_predictors_sbuv_s;
prototype void vp9_build_intra_predictors_mby "struct macroblockd *x"
specialize vp9_build_intra_predictors_mby;
prototype void vp9_build_comp_intra_predictors_mby "struct macroblockd *x"
specialize vp9_build_comp_intra_predictors_mby;
prototype void vp9_build_intra_predictors_mby_s "struct macroblockd *x"
specialize vp9_build_intra_predictors_mby_s;
......@@ -161,9 +158,6 @@ specialize vp9_build_intra_predictors_mbuv;
prototype void vp9_build_intra_predictors_mbuv_s "struct macroblockd *x"
specialize vp9_build_intra_predictors_mbuv_s;
prototype void vp9_build_comp_intra_predictors_mbuv "struct macroblockd *x"
specialize vp9_build_comp_intra_predictors_mbuv;
prototype void vp9_build_intra_predictors_sb64y_s "struct macroblockd *x"
specialize vp9_build_intra_predictors_sb64y_s;
......@@ -173,21 +167,12 @@ specialize vp9_build_intra_predictors_sb64uv_s;
prototype void vp9_intra4x4_predict "struct blockd *x, int b_mode, uint8_t *predictor"
specialize vp9_intra4x4_predict;
prototype void vp9_comp_intra4x4_predict "struct blockd *x, int b_mode, int second_mode, uint8_t *predictor"
specialize vp9_comp_intra4x4_predict;
prototype void vp9_intra8x8_predict "struct blockd *x, int b_mode, uint8_t *predictor"
specialize vp9_intra8x8_predict;
prototype void vp9_comp_intra8x8_predict "struct blockd *x, int b_mode, int second_mode, uint8_t *predictor"
specialize vp9_comp_intra8x8_predict;
prototype void vp9_intra_uv4x4_predict "struct blockd *x, int b_mode, uint8_t *predictor"
specialize vp9_intra_uv4x4_predict;
prototype void vp9_comp_intra_uv4x4_predict "struct blockd *x, int b_mode, int second_mode, uint8_t *predictor"
specialize vp9_comp_intra_uv4x4_predict;
#
# Loopfilter
#
......
......@@ -163,17 +163,11 @@ static void kfread_modes(VP9D_COMP *pbi,
y_mode = (MB_PREDICTION_MODE) read_kf_mb_ymode(bc,
pbi->common.kf_ymode_prob[pbi->common.kf_ymode_probs_index]);
}
#if CONFIG_COMP_INTRA_PRED
m->mbmi.second_mode = (MB_PREDICTION_MODE)(DC_PRED - 1);
#endif
m->mbmi.ref_frame = INTRA_FRAME;
if ((m->mbmi.mode = y_mode) == B_PRED) {
int i = 0;
#if CONFIG_COMP_INTRA_PRED
int use_comp_pred = vp9_read(bc, DEFAULT_COMP_INTRA_PROB);
#endif
do {
const B_PREDICTION_MODE A = above_block_mode(m, i, mis);
const B_PREDICTION_MODE L = left_block_mode(m, i);
......@@ -181,15 +175,6 @@ static void kfread_modes(VP9D_COMP *pbi,
m->bmi[i].as_mode.first =
(B_PREDICTION_MODE) read_kf_bmode(
bc, pbi->common.kf_bmode_prob [A] [L]);
#if CONFIG_COMP_INTRA_PRED
if (use_comp_pred) {
m->bmi[i].as_mode.second =
(B_PREDICTION_MODE) read_kf_bmode(
bc, pbi->common.kf_bmode_prob [A] [L]);
} else {
m->bmi[i].as_mode.second = (B_PREDICTION_MODE)(B_DC_PRED - 1);
}
#endif
} while (++i < 16);
}
if ((m->mbmi.mode = y_mode) == I8X8_PRED) {
......@@ -202,19 +187,10 @@ static void kfread_modes(VP9D_COMP *pbi,
m->bmi[ib + 1].as_mode.first = mode8x8;
m->bmi[ib + 4].as_mode.first = mode8x8;
m->bmi[ib + 5].as_mode.first = mode8x8;
#if CONFIG_COMP_INTRA_PRED
m->bmi[ib + 0].as_mode.second = (MB_PREDICTION_MODE)(DC_PRED - 1);
m->bmi[ib + 1].as_mode.second = (MB_PREDICTION_MODE)(DC_PRED - 1);
m->bmi[ib + 4].as_mode.second = (MB_PREDICTION_MODE)(DC_PRED - 1);
m->bmi[ib + 5].as_mode.second = (MB_PREDICTION_MODE)(DC_PRED - 1);
#endif
}
} else
m->mbmi.uv_mode = (MB_PREDICTION_MODE)read_uv_mode(bc,
pbi->common.kf_uv_mode_prob[m->mbmi.mode]);
#if CONFIG_COMP_INTRA_PRED
m->mbmi.second_uv_mode = (MB_PREDICTION_MODE)(DC_PRED - 1);
#endif
if (cm->txfm_mode == TX_MODE_SELECT && m->mbmi.mb_skip_coeff == 0 &&
m->mbmi.mode <= I8X8_PRED) {
......@@ -1138,16 +1114,10 @@ static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
read_ymode(bc, pbi->common.fc.ymode_prob);
pbi->common.fc.ymode_counts[mbmi->mode]++;
}
#if CONFIG_COMP_INTRA_PRED
mbmi->second_mode = (MB_PREDICTION_MODE)(DC_PRED - 1);
#endif
// If MB mode is BPRED read the block modes
if (mbmi->mode == B_PRED) {
int j = 0;
#if CONFIG_COMP_INTRA_PRED
int use_comp_pred = vp9_read(bc, DEFAULT_COMP_INTRA_PROB);
#endif
do {
int m;
m = mi->bmi[j].as_mode.first = (B_PREDICTION_MODE)
......@@ -1156,13 +1126,6 @@ static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
if (m == B_CONTEXT_PRED) m -= CONTEXT_PRED_REPLACEMENTS;
#endif
pbi->common.fc.bmode_counts[m]++;
#if CONFIG_COMP_INTRA_PRED
if (use_comp_pred) {
mi->bmi[j].as_mode.second = (B_PREDICTION_MODE)read_bmode(bc, pbi->common.fc.bmode_prob);
} else {
mi->bmi[j].as_mode.second = (B_PREDICTION_MODE)(B_DC_PRED - 1);
}
#endif
} while (++j < 16);
}
......@@ -1177,22 +1140,12 @@ static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
mi->bmi[ib + 4].as_mode.first = mode8x8;
mi->bmi[ib + 5].as_mode.first = mode8x8;
pbi->common.fc.i8x8_mode_counts[mode8x8]++;
#if CONFIG_COMP_INTRA_PRED
mi->bmi[ib + 0].as_mode.second = (MB_PREDICTION_MODE)(DC_PRED - 1);
mi->bmi[ib + 1].as_mode.second = (MB_PREDICTION_MODE)(DC_PRED - 1);
mi->bmi[ib + 4].as_mode.second = (MB_PREDICTION_MODE)(DC_PRED - 1);
mi->bmi[ib + 5].as_mode.second = (MB_PREDICTION_MODE)(DC_PRED - 1);
#endif
}
} else {
mbmi->uv_mode = (MB_PREDICTION_MODE)read_uv_mode(
bc, pbi->common.fc.uv_mode_prob[mbmi->mode]);
pbi->common.fc.uv_mode_counts[mbmi->mode][mbmi->uv_mode]++;
}
#if CONFIG_COMP_INTRA_PRED
mbmi->second_uv_mode = (MB_PREDICTION_MODE)(DC_PRED - 1);
#endif
}
if (cm->txfm_mode == TX_MODE_SELECT && mbmi->mb_skip_coeff == 0 &&
......
......@@ -418,9 +418,6 @@ static void decode_4x4(VP9D_COMP *pbi, MACROBLOCKD *xd,
assert(get_2nd_order_usage(xd) == 0);
for (i = 0; i < 16; i++) {
int b_mode;
#if CONFIG_COMP_INTRA_PRED
int b_mode2;
#endif
BLOCKD *b = &xd->block[i];
b_mode = xd->mode_info_context->bmi[i].as_mode.first;
#if CONFIG_NEWBINTRAMODES
......@@ -429,17 +426,8 @@ static void decode_4x4(VP9D_COMP *pbi, MACROBLOCKD *xd,
#endif
if (!xd->mode_info_context->mbmi.mb_skip_coeff)
eobtotal += vp9_decode_coefs_4x4(pbi, xd, bc, PLANE_TYPE_Y_WITH_DC, i);
#if CONFIG_COMP_INTRA_PRED
b_mode2 = xd->mode_info_context->bmi[i].as_mode.second;
if (b_mode2 == (B_PREDICTION_MODE)(B_DC_PRED - 1)) {
#endif
vp9_intra4x4_predict(b, b_mode, b->predictor);
#if CONFIG_COMP_INTRA_PRED
} else {
vp9_comp_intra4x4_predict(b, b_mode, b_mode2, b->predictor);
}
#endif
vp9_intra4x4_predict(b, b_mode, b->predictor);
tx_type = get_tx_type_4x4(xd, b);
if (tx_type != DCT_DCT) {
vp9_ht_dequant_idct_add_c(tx_type, b->qcoeff,
......
......@@ -778,23 +778,9 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m,
}
if (mode == B_PRED) {
int j = 0;
#if CONFIG_COMP_INTRA_PRED
int uses_second =
m->bmi[0].as_mode.second !=
(B_PREDICTION_MODE)(B_DC_PRED - 1);
vp9_write(bc, uses_second, DEFAULT_COMP_INTRA_PROB);
#endif
do {
#if CONFIG_COMP_INTRA_PRED
B_PREDICTION_MODE mode2 = m->bmi[j].as_mode.second;
#endif
write_bmode(bc, m->bmi[j].as_mode.first,
pc->fc.bmode_prob);
#if CONFIG_COMP_INTRA_PRED
if (uses_second) {
write_bmode(bc, mode2, pc->fc.bmode_prob);
}
#endif
} while (++j < 16);
}
if (mode == I8X8_PRED) {
......@@ -1025,30 +1011,16 @@ static void write_mb_modes_kf(const VP9_COMP *cpi,
if (ym == B_PRED) {
int i = 0;
#if CONFIG_COMP_INTRA_PRED
int uses_second =
m->bmi[0].as_mode.second !=
(B_PREDICTION_MODE)(B_DC_PRED - 1);
vp9_write(bc, uses_second, DEFAULT_COMP_INTRA_PROB);
#endif
do {
const B_PREDICTION_MODE A = above_block_mode(m, i, mis);
const B_PREDICTION_MODE L = left_block_mode(m, i);
const int bm = m->bmi[i].as_mode.first;
#if CONFIG_COMP_INTRA_PRED
const int bm2 = m->bmi[i].as_mode.second;
#endif
#ifdef ENTROPY_STATS
++intra_mode_stats [A] [L] [bm];
#endif
write_kf_bmode(bc, bm, c->kf_bmode_prob[A][L]);
#if CONFIG_COMP_INTRA_PRED
if (uses_second) {
write_kf_bmode(bc, bm2, c->kf_bmode_prob[A][L]);
}
#endif
} while (++i < 16);
}
if (ym == I8X8_PRED) {
......
......@@ -25,9 +25,6 @@ int vp9_encode_intra(VP9_COMP *cpi, MACROBLOCK *x, int use_16x16_pred) {
if (use_16x16_pred) {
mbmi->mode = DC_PRED;
#if CONFIG_COMP_INTRA_PRED
mbmi->second_mode = (MB_PREDICTION_MODE)(DC_PRED - 1);
#endif
mbmi->uv_mode = DC_PRED;
mbmi->ref_frame = INTRA_FRAME;
......@@ -53,17 +50,7 @@ void vp9_encode_intra4x4block(MACROBLOCK *x, int ib) {
b->bmi.as_mode.context = vp9_find_bpred_context(b);
#endif
#if CONFIG_COMP_INTRA_PRED
if (b->bmi.as_mode.second == (B_PREDICTION_MODE)(B_DC_PRED - 1)) {
#endif
vp9_intra4x4_predict(b, b->bmi.as_mode.first, b->predictor);
#if CONFIG_COMP_INTRA_PRED
} else {
vp9_comp_intra4x4_predict(b, b->bmi.as_mode.first, b->bmi.as_mode.second,
b->predictor);
}
#endif
vp9_intra4x4_predict(b, b->bmi.as_mode.first, b->predictor);
vp9_subtract_b(be, b, 16);
tx_type = get_tx_type_4x4(&x->e_mbd, b);
......@@ -93,14 +80,7 @@ void vp9_encode_intra16x16mby(MACROBLOCK *x) {
BLOCK *b = &x->block[0];
TX_SIZE tx_size = xd->mode_info_context->mbmi.txfm_size;
#if CONFIG_COMP_INTRA_PRED
if (xd->mode_info_context->mbmi.second_mode == (MB_PREDICTION_MODE)(DC_PRED - 1))
#endif
vp9_build_intra_predictors_mby(xd);
#if CONFIG_COMP_INTRA_PRED
else
vp9_build_comp_intra_predictors_mby(xd);
#endif
vp9_build_intra_predictors_mby(xd);
vp9_subtract_mby(x->src_diff, *(b->base_src), xd->predictor, b->src_stride);
......@@ -131,15 +111,7 @@ void vp9_encode_intra16x16mbuv(MACROBLOCK *x) {
MACROBLOCKD *xd = &x->e_mbd;
TX_SIZE tx_size = xd->mode_info_context->mbmi.txfm_size;
#if CONFIG_COMP_INTRA_PRED
if (xd->mode_info_context->mbmi.second_uv_mode == (MB_PREDICTION_MODE)(DC_PRED - 1)) {
#endif
vp9_build_intra_predictors_mbuv(xd);
#if CONFIG_COMP_INTRA_PRED
} else {
vp9_build_comp_intra_predictors_mbuv(xd);
}
#endif
vp9_build_intra_predictors_mbuv(xd);
vp9_subtract_mbuv(x->src_diff, x->src.u_buffer, x->src.v_buffer,
xd->predictor, x->src.uv_stride);
......@@ -169,16 +141,7 @@ void vp9_encode_intra8x8(MACROBLOCK *x, int ib) {
int i;
TX_TYPE tx_type;
#if CONFIG_COMP_INTRA_PRED
if (b->bmi.as_mode.second == (MB_PREDICTION_MODE)(DC_PRED - 1)) {
#endif
vp9_intra8x8_predict(b, b->bmi.as_mode.first, b->predictor);
#if CONFIG_COMP_INTRA_PRED
} else {
vp9_comp_intra8x8_predict(b, b->bmi.as_mode.first, b->bmi.as_mode.second,
b->predictor);
}
#endif
vp9_intra8x8_predict(b, b->bmi.as_mode.first, b->predictor);
// generate residual blocks
vp9_subtract_4b_c(be, b, 16);
......@@ -231,20 +194,12 @@ void vp9_encode_intra8x8mby(MACROBLOCK *x) {
}
}
void vp9_encode_intra_uv4x4(MACROBLOCK *x, int ib,
int mode, int second) {
static void encode_intra_uv4x4(MACROBLOCK *x, int ib,
int mode) {
BLOCKD *b = &x->e_mbd.block[ib];
BLOCK *be = &x->block[ib];
#if CONFIG_COMP_INTRA_PRED
if (second == -1) {
#endif
vp9_intra_uv4x4_predict(b, mode, b->predictor);
#if CONFIG_COMP_INTRA_PRED
} else {
vp9_comp_intra_uv4x4_predict(b, mode, second, b->predictor);
}
#endif
vp9_intra_uv4x4_predict(b, mode, b->predictor);
vp9_subtract_b(be, b, 8);
......@@ -257,21 +212,17 @@ void vp9_encode_intra_uv4x4(MACROBLOCK *x, int ib,
}
void vp9_encode_intra8x8mbuv(MACROBLOCK *x) {
int i, ib, mode, second;
int i, ib, mode;
BLOCKD *b;
for (i = 0; i < 4; i++) {
ib = vp9_i8x8_block[i];
b = &x->e_mbd.block[ib];
mode = b->bmi.as_mode.first;
#if CONFIG_COMP_INTRA_PRED
second = b->bmi.as_mode.second;
#else
second = -1;
#endif
/*u */
vp9_encode_intra_uv4x4(x, i + 16, mode, second);
encode_intra_uv4x4(x, i + 16, mode);
/*v */
vp9_encode_intra_uv4x4(x, i + 20, mode, second);
encode_intra_uv4x4(x, i + 20, mode);
}
}
This diff is collapsed.
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