Deprecate comp_interintra_pred experiment.

Delete code under the CONFIG_COMP_INTERINTRA_PRED
flag.

Change-Id: I3d1079cf46305c08f7e11d738596ea112e7b547f
This commit is contained in:
Paul Wilkins 2013-05-07 16:42:21 +01:00 committed by Gerrit Code Review
parent 0bfcd30768
commit 1ed57a6a62
16 changed files with 4 additions and 557 deletions

1
configure vendored
View File

@ -240,7 +240,6 @@ HAVE_LIST="
EXPERIMENT_LIST="
csm
implicit_segmentation
comp_interintra_pred
modelcoefprob
loop_dering
scatterscan

View File

@ -234,9 +234,6 @@ static INLINE int mi_height_log2(BLOCK_SIZE_TYPE sb_type) {
typedef struct {
MB_PREDICTION_MODE mode, uv_mode;
#if CONFIG_COMP_INTERINTRA_PRED
MB_PREDICTION_MODE interintra_mode, interintra_uv_mode;
#endif
MV_REFERENCE_FRAME ref_frame, second_ref_frame;
TX_SIZE txfm_size;
int_mv mv[2]; // for each reference frame used

View File

@ -256,9 +256,6 @@ void vp9_init_mbmode_probs(VP9_COMMON *x) {
vpx_memcpy(x->fc.partition_prob, vp9_partition_probs,
sizeof(vp9_partition_probs));
#if CONFIG_COMP_INTERINTRA_PRED
x->fc.interintra_prob = VP9_DEF_INTERINTRA_PROB;
#endif
x->ref_pred_probs[0] = DEFAULT_PRED_PROB_0;
x->ref_pred_probs[1] = DEFAULT_PRED_PROB_1;
x->ref_pred_probs[2] = DEFAULT_PRED_PROB_2;
@ -493,13 +490,6 @@ void vp9_adapt_mode_probs(VP9_COMMON *cm) {
for (t = 0; t < VP9_NUMMBSPLITS; ++t)
printf("%d, ", fc->mbsplit_counts[t]);
printf("};\n");
#if CONFIG_COMP_INTERINTRA_PRED
printf("static const unsigned int\ninterintra_counts"
"[2] = {\n");
for (t = 0; t < 2; ++t)
printf("%d, ", fc->interintra_counts[t]);
printf("};\n");
#endif
#endif
update_mode_probs(VP9_YMODES, vp9_ymode_tree,
@ -523,20 +513,6 @@ void vp9_adapt_mode_probs(VP9_COMMON *cm) {
vp9_sub_mv_ref_tree, fc->sub_mv_ref_counts[i],
fc->pre_sub_mv_ref_prob[i], fc->sub_mv_ref_prob[i],
LEFT4X4);
#if CONFIG_COMP_INTERINTRA_PRED
if (cm->use_interintra) {
int factor, interintra_prob, count;
interintra_prob = get_binary_prob(fc->interintra_counts[0],
fc->interintra_counts[1]);
count = fc->interintra_counts[0] + fc->interintra_counts[1];
count = count > MODE_COUNT_SAT ? MODE_COUNT_SAT : count;
factor = (MODE_MAX_UPDATE_FACTOR * count / MODE_COUNT_SAT);
fc->interintra_prob = weighted_prob(fc->pre_interintra_prob,
interintra_prob, factor);
}
#endif
for (i = 0; i < NUM_PARTITION_CONTEXTS; i++)
update_mode_probs(PARTITION_TYPES, vp9_partition_tree,
fc->partition_counts[i], fc->pre_partition_prob[i],

View File

@ -16,13 +16,6 @@
#define SUBMVREF_COUNT 5
#if CONFIG_COMP_INTERINTRA_PRED
#define VP9_DEF_INTERINTRA_PROB 248
#define VP9_UPD_INTERINTRA_PROB 192
// whether to use a separate uv mode (1) or use the same as the y mode (0)
#define SEPARATE_INTERINTRA_UV 0
#endif
extern int vp9_mv_cont(const int_mv *l, const int_mv *a);
extern const vp9_prob vp9_sub_mv_ref_prob2[SUBMVREF_COUNT][VP9_SUBMVREFS - 1];

View File

@ -112,11 +112,6 @@ typedef struct frame_contexts {
nmv_context_counts NMVcount;
vp9_prob switchable_interp_prob[VP9_SWITCHABLE_FILTERS + 1]
[VP9_SWITCHABLE_FILTERS - 1];
#if CONFIG_COMP_INTERINTRA_PRED
unsigned int interintra_counts[2];
vp9_prob interintra_prob;
vp9_prob pre_interintra_prob;
#endif
int vp9_mode_contexts[INTER_MODE_CONTEXTS][4];
unsigned int mv_ref_ct[INTER_MODE_CONTEXTS][4][2];
@ -292,10 +287,6 @@ typedef struct VP9Common {
struct postproc_state postproc_state;
#endif
#if CONFIG_COMP_INTERINTRA_PRED
int use_interintra;
#endif
int error_resilient_mode;
int frame_parallel_decoding_mode;

View File

@ -416,23 +416,9 @@ void vp9_build_inter_predictors_sbuv(MACROBLOCKD *xd,
void vp9_build_inter_predictors_sb(MACROBLOCKD *xd,
int mi_row, int mi_col,
BLOCK_SIZE_TYPE bsize) {
#if CONFIG_COMP_INTERINTRA_PRED
uint8_t *const y = xd->plane[0].dst.buf;
uint8_t *const u = xd->plane[1].dst.buf;
uint8_t *const v = xd->plane[2].dst.buf;
const int y_stride = xd->plane[0].dst.stride;
const int uv_stride = xd->plane[1].dst.stride;
#endif
vp9_build_inter_predictors_sby(xd, mi_row, mi_col, bsize);
vp9_build_inter_predictors_sbuv(xd, mi_row, mi_col, bsize);
#if CONFIG_COMP_INTERINTRA_PRED
if (xd->mode_info_context->mbmi.second_ref_frame == INTRA_FRAME)
vp9_build_interintra_predictors(xd, y, u, v,
y_stride, uv_stride,
bsize);
#endif
}
/*encoder only*/

View File

@ -363,186 +363,6 @@ void vp9_build_intra_predictors(uint8_t *src, int src_stride,
}
}
#if CONFIG_COMP_INTERINTRA_PRED
static void combine_interintra(MB_PREDICTION_MODE mode,
uint8_t *interpred,
int interstride,
uint8_t *intrapred,
int intrastride,
int bw, int bh) {
// TODO(debargha): Explore different ways of combining predictors
// or designing the tables below
static const int scale_bits = 8;
static const int scale_max = 256; // 1 << scale_bits;
static const int scale_round = 127; // (1 << (scale_bits - 1));
// This table is a function A + B*exp(-kx), where x is hor. index
static const int weights1d[64] = {
128, 125, 122, 119, 116, 114, 111, 109,
107, 105, 103, 101, 99, 97, 96, 94,
93, 91, 90, 89, 88, 86, 85, 84,
83, 82, 81, 81, 80, 79, 78, 78,
77, 76, 76, 75, 75, 74, 74, 73,
73, 72, 72, 71, 71, 71, 70, 70,
70, 70, 69, 69, 69, 69, 68, 68,
68, 68, 68, 67, 67, 67, 67, 67,
};
int size = MAX(bw, bh);
int size_scale = (size >= 64 ? 1:
size == 32 ? 2 :
size == 16 ? 4 :
size == 8 ? 8 : 16);
int i, j;
switch (mode) {
case V_PRED:
for (i = 0; i < bh; ++i) {
for (j = 0; j < bw; ++j) {
int k = i * interstride + j;
int scale = weights1d[i * size_scale];
interpred[k] =
((scale_max - scale) * interpred[k] +
scale * intrapred[i * intrastride + j] + scale_round)
>> scale_bits;
}
}
break;
case H_PRED:
for (i = 0; i < bh; ++i) {
for (j = 0; j < bw; ++j) {
int k = i * interstride + j;
int scale = weights1d[j * size_scale];
interpred[k] =
((scale_max - scale) * interpred[k] +
scale * intrapred[i * intrastride + j] + scale_round)
>> scale_bits;
}
}
break;
case D63_PRED:
case D117_PRED:
for (i = 0; i < bh; ++i) {
for (j = 0; j < bw; ++j) {
int k = i * interstride + j;
int scale = (weights1d[i * size_scale] * 3 +
weights1d[j * size_scale]) >> 2;
interpred[k] =
((scale_max - scale) * interpred[k] +
scale * intrapred[i * intrastride + j] + scale_round)
>> scale_bits;
}
}
break;
case D27_PRED:
case D153_PRED:
for (i = 0; i < bh; ++i) {
for (j = 0; j < bw; ++j) {
int k = i * interstride + j;
int scale = (weights1d[j * size_scale] * 3 +
weights1d[i * size_scale]) >> 2;
interpred[k] =
((scale_max - scale) * interpred[k] +
scale * intrapred[i * intrastride + j] + scale_round)
>> scale_bits;
}
}
break;
case D135_PRED:
for (i = 0; i < bh; ++i) {
for (j = 0; j < bw; ++j) {
int k = i * interstride + j;
int scale = weights1d[(i < j ? i : j) * size_scale];
interpred[k] =
((scale_max - scale) * interpred[k] +
scale * intrapred[i * intrastride + j] + scale_round)
>> scale_bits;
}
}
break;
case D45_PRED:
for (i = 0; i < bh; ++i) {
for (j = 0; j < bw; ++j) {
int k = i * interstride + j;
int scale = (weights1d[i * size_scale] +
weights1d[j * size_scale]) >> 1;
interpred[k] =
((scale_max - scale) * interpred[k] +
scale * intrapred[i * intrastride + j] + scale_round)
>> scale_bits;
}
}
break;
case TM_PRED:
case DC_PRED:
default:
// simple average
for (i = 0; i < bh; ++i) {
for (j = 0; j < bw; ++j) {
int k = i * interstride + j;
interpred[k] = (interpred[k] + intrapred[i * intrastride + j]) >> 1;
}
}
break;
}
}
void vp9_build_interintra_predictors(MACROBLOCKD *xd,
uint8_t *ypred,
uint8_t *upred,
uint8_t *vpred,
int ystride, int uvstride,
BLOCK_SIZE_TYPE bsize) {
vp9_build_interintra_predictors_sby(xd, ypred, ystride, bsize);
vp9_build_interintra_predictors_sbuv(xd, upred, vpred, uvstride, bsize);
}
void vp9_build_interintra_predictors_sby(MACROBLOCKD *xd,
uint8_t *ypred,
int ystride,
BLOCK_SIZE_TYPE bsize) {
int bwl = mi_width_log2(bsize), bw = MI_SIZE << bwl;
int bhl = mi_height_log2(bsize), bh = MI_SIZE << bhl;
uint8_t intrapredictor[4096];
vp9_build_intra_predictors(
xd->plane[0].dst.buf, xd->plane[0].dst.stride,
intrapredictor, bw,
xd->mode_info_context->mbmi.interintra_mode, bw, bh,
xd->up_available, xd->left_available, xd->right_available);
combine_interintra(xd->mode_info_context->mbmi.interintra_mode,
ypred, ystride, intrapredictor, bw, bw, bh);
}
void vp9_build_interintra_predictors_sbuv(MACROBLOCKD *xd,
uint8_t *upred,
uint8_t *vpred,
int uvstride,
BLOCK_SIZE_TYPE bsize) {
int bwl = mi_width_log2(bsize), bw = MI_UV_SIZE << bwl;
int bhl = mi_height_log2(bsize), bh = MI_UV_SIZE << bhl;
uint8_t uintrapredictor[1024];
uint8_t vintrapredictor[1024];
vp9_build_intra_predictors(
xd->plane[1].dst.buf, xd->plane[1].dst.stride,
uintrapredictor, bw,
xd->mode_info_context->mbmi.interintra_uv_mode, bw, bh,
xd->up_available, xd->left_available, xd->right_available);
vp9_build_intra_predictors(
xd->plane[2].dst.buf, xd->plane[1].dst.stride,
vintrapredictor, bw,
xd->mode_info_context->mbmi.interintra_uv_mode, bw, bh,
xd->up_available, xd->left_available, xd->right_available);
combine_interintra(xd->mode_info_context->mbmi.interintra_uv_mode,
upred, uvstride, uintrapredictor, bw, bw, bh);
combine_interintra(xd->mode_info_context->mbmi.interintra_uv_mode,
vpred, uvstride, vintrapredictor, bw, bw, bh);
}
#endif // CONFIG_COMP_INTERINTRA_PRED
void vp9_build_intra_predictors_sby_s(MACROBLOCKD *xd,
BLOCK_SIZE_TYPE bsize) {
const int bwl = b_width_log2(bsize), bw = 4 << bwl;

View File

@ -21,25 +21,4 @@ B_PREDICTION_MODE vp9_find_dominant_direction(uint8_t *ptr,
B_PREDICTION_MODE vp9_find_bpred_context(MACROBLOCKD *xd, int block,
uint8_t *ptr, int stride);
#if CONFIG_COMP_INTERINTRA_PRED
void vp9_build_interintra_predictors(MACROBLOCKD *xd,
uint8_t *ypred,
uint8_t *upred,
uint8_t *vpred,
int ystride,
int uvstride,
BLOCK_SIZE_TYPE bsize);
void vp9_build_interintra_predictors_sby(MACROBLOCKD *xd,
uint8_t *ypred,
int ystride,
BLOCK_SIZE_TYPE bsize);
void vp9_build_interintra_predictors_sbuv(MACROBLOCKD *xd,
uint8_t *upred,
uint8_t *vpred,
int uvstride,
BLOCK_SIZE_TYPE bsize);
#endif // CONFIG_COMP_INTERINTRA_PRED
#endif // VP9_COMMON_VP9_RECONINTRA_H_

View File

@ -439,12 +439,7 @@ static void mb_mode_mv_init(VP9D_COMP *pbi, vp9_reader *r) {
if (cm->mcomp_filter_type == SWITCHABLE)
read_switchable_interp_probs(pbi, r);
#if CONFIG_COMP_INTERINTRA_PRED
if (cm->use_interintra) {
if (vp9_read(r, VP9_UPD_INTERINTRA_PROB))
cm->fc.interintra_prob = vp9_read_prob(r);
}
#endif
// Baseline probabilities for decoding reference frame
cm->prob_intra_coded = vp9_read_prob(r);
cm->prob_last_coded = vp9_read_prob(r);
@ -693,33 +688,6 @@ static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
}
}
} else {
#if CONFIG_COMP_INTERINTRA_PRED
if (pbi->common.use_interintra &&
mbmi->mode >= NEARESTMV && mbmi->mode < SPLITMV &&
mbmi->second_ref_frame == NONE) {
mbmi->second_ref_frame = (vp9_read(r, pbi->common.fc.interintra_prob) ?
INTRA_FRAME : NONE);
// printf("-- %d (%d)\n", mbmi->second_ref_frame == INTRA_FRAME,
// pbi->common.fc.interintra_prob);
pbi->common.fc.interintra_counts[
mbmi->second_ref_frame == INTRA_FRAME]++;
if (mbmi->second_ref_frame == INTRA_FRAME) {
mbmi->interintra_mode = read_ymode(r, pbi->common.fc.ymode_prob);
pbi->common.fc.ymode_counts[mbmi->interintra_mode]++;
#if SEPARATE_INTERINTRA_UV
mbmi->interintra_uv_mode = read_uv_mode(r,
pbi->common.fc.uv_mode_prob[mbmi->interintra_mode]);
pbi->common.fc.uv_mode_counts[mbmi->interintra_mode]
[mbmi->interintra_uv_mode]++;
#else
mbmi->interintra_uv_mode = mbmi->interintra_mode;
#endif
// printf("** %d %d\n",
// mbmi->interintra_mode, mbmi->interintra_uv_mode);
}
}
#endif
}
mbmi->uv_mode = DC_PRED;

View File

@ -856,11 +856,6 @@ static void update_frame_context(FRAME_CONTEXT *fc) {
vp9_zero(fc->mv_ref_ct);
vp9_zero(fc->partition_counts);
#if CONFIG_COMP_INTERINTRA_PRED
fc->pre_interintra_prob = fc->interintra_prob;
vp9_zero(fc->interintra_counts);
#endif
#if CONFIG_CODE_ZEROGROUP
vp9_copy(fc->pre_zpc_probs_4x4, fc->zpc_probs_4x4);
vp9_copy(fc->pre_zpc_probs_8x8, fc->zpc_probs_8x8);
@ -1092,10 +1087,6 @@ int vp9_decode_frame(VP9D_COMP *pbi, const uint8_t **p_data_end) {
xd->allow_high_precision_mv = vp9_read_bit(&header_bc);
pc->mcomp_filter_type = read_mcomp_filter_type(&header_bc);
#if CONFIG_COMP_INTERINTRA_PRED
pc->use_interintra = vp9_read_bit(&header_bc);
#endif
// To enable choice of different interpolation filters
vp9_setup_interp_filters(xd, pc->mcomp_filter_type, pc);
}

View File

@ -706,27 +706,6 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m,
vp9_write(bc, mi->second_ref_frame > INTRA_FRAME,
vp9_get_pred_prob(pc, xd, PRED_COMP));
}
#if CONFIG_COMP_INTERINTRA_PRED
if (cpi->common.use_interintra &&
mode >= NEARESTMV && mode < SPLITMV &&
mi->second_ref_frame <= INTRA_FRAME) {
vp9_write(bc, mi->second_ref_frame == INTRA_FRAME,
pc->fc.interintra_prob);
// if (!cpi->dummy_packing)
// printf("-- %d (%d)\n", mi->second_ref_frame == INTRA_FRAME,
// pc->fc.interintra_prob);
if (mi->second_ref_frame == INTRA_FRAME) {
// if (!cpi->dummy_packing)
// printf("** %d %d\n", mi->interintra_mode,
// mi->interintra_uv_mode);
write_ymode(bc, mi->interintra_mode, pc->fc.ymode_prob);
#if SEPARATE_INTERINTRA_UV
write_uv_mode(bc, mi->interintra_uv_mode,
pc->fc.uv_mode_prob[mi->interintra_mode]);
#endif
}
}
#endif
switch (mode) { /* new, split require MVs */
case NEWMV:
@ -1908,15 +1887,6 @@ void vp9_pack_bitstream(VP9_COMP *cpi, uint8_t *dest, unsigned long *size) {
vp9_write_bit(&header_bc, (pc->mcomp_filter_type == SWITCHABLE));
if (pc->mcomp_filter_type != SWITCHABLE)
vp9_write_literal(&header_bc, (pc->mcomp_filter_type), 2);
#if CONFIG_COMP_INTERINTRA_PRED
// printf("Counts: %d %d\n", cpi->interintra_count[0],
// cpi->interintra_count[1]);
if (!cpi->dummy_packing && pc->use_interintra)
pc->use_interintra = (cpi->interintra_count[1] > 0);
vp9_write_bit(&header_bc, pc->use_interintra);
if (!pc->use_interintra)
vp9_zero(cpi->interintra_count);
#endif
}
if (!pc->error_resilient_mode) {
@ -2049,9 +2019,6 @@ void vp9_pack_bitstream(VP9_COMP *cpi, uint8_t *dest, unsigned long *size) {
vp9_copy(cpi->common.fc.pre_sub_mv_ref_prob, cpi->common.fc.sub_mv_ref_prob);
vp9_copy(cpi->common.fc.pre_partition_prob, cpi->common.fc.partition_prob);
cpi->common.fc.pre_nmvc = cpi->common.fc.nmvc;
#if CONFIG_COMP_INTERINTRA_PRED
cpi->common.fc.pre_interintra_prob = cpi->common.fc.interintra_prob;
#endif
vp9_zero(cpi->sub_mv_ref_count);
vp9_zero(cpi->common.fc.mv_ref_ct);
@ -2084,15 +2051,6 @@ void vp9_pack_bitstream(VP9_COMP *cpi, uint8_t *dest, unsigned long *size) {
if (pc->mcomp_filter_type == SWITCHABLE)
update_switchable_interp_probs(cpi, &header_bc);
#if CONFIG_COMP_INTERINTRA_PRED
if (pc->use_interintra) {
vp9_cond_prob_update(&header_bc,
&pc->fc.interintra_prob,
VP9_UPD_INTERINTRA_PROB,
cpi->interintra_count);
}
#endif
vp9_write_prob(&header_bc, pc->prob_intra_coded);
vp9_write_prob(&header_bc, pc->prob_last_coded);
vp9_write_prob(&header_bc, pc->prob_gf_coded);

View File

@ -487,20 +487,7 @@ static void update_state(VP9_COMP *cpi,
for (i = 0; i < bw; ++i)
xd->mode_info_context[mis * j + i].mbmi = *mbmi;
}
#if CONFIG_COMP_INTERINTRA_PRED
if (mbmi->mode >= NEARESTMV && mbmi->mode < SPLITMV &&
mbmi->second_ref_frame <= INTRA_FRAME) {
if (mbmi->second_ref_frame == INTRA_FRAME) {
++cpi->interintra_count[1];
++cpi->ymode_count[mbmi->interintra_mode];
#if SEPARATE_INTERINTRA_UV
++cpi->y_uv_mode_count[mbmi->interintra_mode][mbmi->interintra_uv_mode];
#endif
} else {
++cpi->interintra_count[0];
}
}
#endif
if (cpi->common.mcomp_filter_type == SWITCHABLE &&
is_inter_mode(mbmi->mode)) {
++cpi->switchable_interp_count
@ -1439,11 +1426,6 @@ static void init_encode_frame_mb_context(VP9_COMP *cpi) {
vp9_zero(cpi->sb_ymode_count)
vp9_zero(cpi->partition_count);
#if CONFIG_COMP_INTERINTRA_PRED
vp9_zero(cpi->interintra_count);
vp9_zero(cpi->interintra_select_count);
#endif
// Note: this memset assumes above_context[0], [1] and [2]
// are allocated as part of the same buffer.
vpx_memset(cm->above_context[0], 0, sizeof(ENTROPY_CONTEXT) * 4 *

View File

@ -651,24 +651,6 @@ static void set_rd_speed_thresholds(VP9_COMP *cpi, int mode, int speed) {
sf->thresh_mult[THR_COMP_SPLITGA ] += speed_multiplier * 4500;
sf->thresh_mult[THR_COMP_SPLITLG ] += speed_multiplier * 4500;
#if CONFIG_COMP_INTERINTRA_PRED
sf->thresh_mult[THR_COMP_INTERINTRA_ZEROL ] += speed_multiplier * 1500;
sf->thresh_mult[THR_COMP_INTERINTRA_ZEROG ] += speed_multiplier * 1500;
sf->thresh_mult[THR_COMP_INTERINTRA_ZEROA ] += speed_multiplier * 1500;
sf->thresh_mult[THR_COMP_INTERINTRA_NEARESTL] += speed_multiplier * 1500;
sf->thresh_mult[THR_COMP_INTERINTRA_NEARESTG] += speed_multiplier * 1500;
sf->thresh_mult[THR_COMP_INTERINTRA_NEARESTA] += speed_multiplier * 1500;
sf->thresh_mult[THR_COMP_INTERINTRA_NEARL ] += speed_multiplier * 1500;
sf->thresh_mult[THR_COMP_INTERINTRA_NEARG ] += speed_multiplier * 1500;
sf->thresh_mult[THR_COMP_INTERINTRA_NEARA ] += speed_multiplier * 1500;
sf->thresh_mult[THR_COMP_INTERINTRA_NEWL ] += speed_multiplier * 2000;
sf->thresh_mult[THR_COMP_INTERINTRA_NEWG ] += speed_multiplier * 2000;
sf->thresh_mult[THR_COMP_INTERINTRA_NEWA ] += speed_multiplier * 2000;
#endif
/* disable frame modes if flags not set */
if (!(cpi->ref_frame_flags & VP9_LAST_FLAG)) {
sf->thresh_mult[THR_NEWMV ] = INT_MAX;
@ -676,12 +658,6 @@ static void set_rd_speed_thresholds(VP9_COMP *cpi, int mode, int speed) {
sf->thresh_mult[THR_ZEROMV ] = INT_MAX;
sf->thresh_mult[THR_NEARMV ] = INT_MAX;
sf->thresh_mult[THR_SPLITMV ] = INT_MAX;
#if CONFIG_COMP_INTERINTRA_PRED
sf->thresh_mult[THR_COMP_INTERINTRA_ZEROL ] = INT_MAX;
sf->thresh_mult[THR_COMP_INTERINTRA_NEARESTL] = INT_MAX;
sf->thresh_mult[THR_COMP_INTERINTRA_NEARL ] = INT_MAX;
sf->thresh_mult[THR_COMP_INTERINTRA_NEWL ] = INT_MAX;
#endif
}
if (!(cpi->ref_frame_flags & VP9_GOLD_FLAG)) {
sf->thresh_mult[THR_NEARESTG ] = INT_MAX;
@ -689,12 +665,6 @@ static void set_rd_speed_thresholds(VP9_COMP *cpi, int mode, int speed) {
sf->thresh_mult[THR_NEARG ] = INT_MAX;
sf->thresh_mult[THR_NEWG ] = INT_MAX;
sf->thresh_mult[THR_SPLITG ] = INT_MAX;
#if CONFIG_COMP_INTERINTRA_PRED
sf->thresh_mult[THR_COMP_INTERINTRA_ZEROG ] = INT_MAX;
sf->thresh_mult[THR_COMP_INTERINTRA_NEARESTG] = INT_MAX;
sf->thresh_mult[THR_COMP_INTERINTRA_NEARG ] = INT_MAX;
sf->thresh_mult[THR_COMP_INTERINTRA_NEWG ] = INT_MAX;
#endif
}
if (!(cpi->ref_frame_flags & VP9_ALT_FLAG)) {
sf->thresh_mult[THR_NEARESTA ] = INT_MAX;
@ -702,12 +672,6 @@ static void set_rd_speed_thresholds(VP9_COMP *cpi, int mode, int speed) {
sf->thresh_mult[THR_NEARA ] = INT_MAX;
sf->thresh_mult[THR_NEWA ] = INT_MAX;
sf->thresh_mult[THR_SPLITA ] = INT_MAX;
#if CONFIG_COMP_INTERINTRA_PRED
sf->thresh_mult[THR_COMP_INTERINTRA_ZEROA ] = INT_MAX;
sf->thresh_mult[THR_COMP_INTERINTRA_NEARESTA] = INT_MAX;
sf->thresh_mult[THR_COMP_INTERINTRA_NEARA ] = INT_MAX;
sf->thresh_mult[THR_COMP_INTERINTRA_NEWA ] = INT_MAX;
#endif
}
if ((cpi->ref_frame_flags & (VP9_LAST_FLAG | VP9_GOLD_FLAG)) !=
@ -2542,20 +2506,6 @@ void vp9_select_interp_filter_type(VP9_COMP *cpi) {
}
}
#if CONFIG_COMP_INTERINTRA_PRED
static void select_interintra_mode(VP9_COMP *cpi) {
static const double threshold = 0.01;
VP9_COMMON *cm = &cpi->common;
// FIXME(debargha): Make this RD based
int sum = cpi->interintra_select_count[1] + cpi->interintra_select_count[0];
if (sum) {
double fraction = (double) cpi->interintra_select_count[1] / sum;
// printf("fraction: %f\n", fraction);
cm->use_interintra = (fraction > threshold);
}
}
#endif
static void scale_references(VP9_COMP *cpi) {
VP9_COMMON *cm = &cpi->common;
int i;
@ -2912,12 +2862,6 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
set_mvcost(&cpi->mb);
}
#if CONFIG_COMP_INTERINTRA_PRED
if (cm->current_video_frame == 0) {
cm->use_interintra = 1;
}
#endif
#if CONFIG_POSTPROC
if (cpi->oxcf.noise_sensitivity > 0) {
@ -3303,9 +3247,6 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
vp9_copy(cpi->common.fc.bmode_counts, cpi->bmode_count);
vp9_copy(cpi->common.fc.sub_mv_ref_counts, cpi->sub_mv_ref_count);
vp9_copy(cpi->common.fc.partition_counts, cpi->partition_count);
#if CONFIG_COMP_INTERINTRA_PRED
vp9_copy(cpi->common.fc.interintra_counts, cpi->interintra_count);
#endif
cpi->common.fc.NMVcount = cpi->NMVcount;
if (!cpi->common.error_resilient_mode &&
!cpi->common.frame_parallel_decoding_mode) {
@ -3314,10 +3255,6 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
vp9_adapt_nmv_probs(&cpi->common, cpi->mb.e_mbd.allow_high_precision_mv);
}
}
#if CONFIG_COMP_INTERINTRA_PRED
if (cm->frame_type != KEY_FRAME)
select_interintra_mode(cpi);
#endif
/* Move storing frame_type out of the above loop since it is also
* needed in motion search besides loopfilter */

View File

@ -47,11 +47,7 @@
#define KEY_FRAME_CONTEXT 5
#if CONFIG_COMP_INTERINTRA_PRED
#define MAX_MODES 53
#else
#define MAX_MODES 41
#endif
#define MIN_THRESHMULT 32
#define MAX_THRESHMULT 512
@ -104,9 +100,6 @@ typedef struct {
vp9_prob switchable_interp_prob[VP9_SWITCHABLE_FILTERS + 1]
[VP9_SWITCHABLE_FILTERS - 1];
#if CONFIG_COMP_INTERINTRA_PRED
vp9_prob interintra_prob;
#endif
int mv_ref_ct[INTER_MODE_CONTEXTS][4][2];
int vp9_mode_contexts[INTER_MODE_CONTEXTS][4];
@ -224,22 +217,6 @@ typedef enum {
THR_COMP_SPLITLG,
THR_COMP_SPLITLA,
THR_COMP_SPLITGA,
#if CONFIG_COMP_INTERINTRA_PRED
THR_COMP_INTERINTRA_ZEROL,
THR_COMP_INTERINTRA_NEARESTL,
THR_COMP_INTERINTRA_NEARL,
THR_COMP_INTERINTRA_NEWL,
THR_COMP_INTERINTRA_ZEROG,
THR_COMP_INTERINTRA_NEARESTG,
THR_COMP_INTERINTRA_NEARG,
THR_COMP_INTERINTRA_NEWG,
THR_COMP_INTERINTRA_ZEROA,
THR_COMP_INTERINTRA_NEARESTA,
THR_COMP_INTERINTRA_NEARA,
THR_COMP_INTERINTRA_NEWA,
#endif
}
THR_MODES;
@ -452,10 +429,6 @@ typedef struct VP9_COMP {
int sub_mv_ref_count[SUBMVREF_COUNT][VP9_SUBMVREFS];
int y_uv_mode_count[VP9_YMODES][VP9_UV_MODES];
unsigned int partition_count[NUM_PARTITION_CONTEXTS][PARTITION_TYPES];
#if CONFIG_COMP_INTERINTRA_PRED
unsigned int interintra_count[2];
unsigned int interintra_select_count[2];
#endif
nmv_context_counts NMVcount;

View File

@ -167,9 +167,7 @@ void vp9_save_coding_context(VP9_COMP *cpi) {
vp9_copy(cc->coef_probs_16x16, cm->fc.coef_probs_16x16);
vp9_copy(cc->coef_probs_32x32, cm->fc.coef_probs_32x32);
vp9_copy(cc->switchable_interp_prob, cm->fc.switchable_interp_prob);
#if CONFIG_COMP_INTERINTRA_PRED
cc->interintra_prob = cm->fc.interintra_prob;
#endif
#if CONFIG_CODE_ZEROGROUP
vp9_copy(cc->zpc_probs_4x4, cm->fc.zpc_probs_4x4);
vp9_copy(cc->zpc_probs_8x8, cm->fc.zpc_probs_8x8);
@ -227,9 +225,7 @@ void vp9_restore_coding_context(VP9_COMP *cpi) {
vp9_copy(cm->fc.coef_probs_16x16, cc->coef_probs_16x16);
vp9_copy(cm->fc.coef_probs_32x32, cc->coef_probs_32x32);
vp9_copy(cm->fc.switchable_interp_prob, cc->switchable_interp_prob);
#if CONFIG_COMP_INTERINTRA_PRED
cm->fc.interintra_prob = cc->interintra_prob;
#endif
#if CONFIG_CODE_ZEROGROUP
vp9_copy(cm->fc.zpc_probs_4x4, cc->zpc_probs_4x4);
vp9_copy(cm->fc.zpc_probs_8x8, cc->zpc_probs_8x8);

View File

@ -123,24 +123,6 @@ const MODE_DEFINITION vp9_mode_order[MAX_MODES] = {
{SPLITMV, LAST_FRAME, GOLDEN_FRAME},
{SPLITMV, ALTREF_FRAME, LAST_FRAME },
{SPLITMV, GOLDEN_FRAME, ALTREF_FRAME},
#if CONFIG_COMP_INTERINTRA_PRED
/* compound inter-intra prediction */
{ZEROMV, LAST_FRAME, INTRA_FRAME},
{NEARESTMV, LAST_FRAME, INTRA_FRAME},
{NEARMV, LAST_FRAME, INTRA_FRAME},
{NEWMV, LAST_FRAME, INTRA_FRAME},
{ZEROMV, GOLDEN_FRAME, INTRA_FRAME},
{NEARESTMV, GOLDEN_FRAME, INTRA_FRAME},
{NEARMV, GOLDEN_FRAME, INTRA_FRAME},
{NEWMV, GOLDEN_FRAME, INTRA_FRAME},
{ZEROMV, ALTREF_FRAME, INTRA_FRAME},
{NEARESTMV, ALTREF_FRAME, INTRA_FRAME},
{NEARMV, ALTREF_FRAME, INTRA_FRAME},
{NEWMV, ALTREF_FRAME, INTRA_FRAME},
#endif
};
static void fill_token_costs(vp9_coeff_count *c,
@ -1936,9 +1918,6 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
int mdcounts[4], int64_t txfm_cache[],
int *rate2, int *distortion, int *skippable,
int *compmode_cost,
#if CONFIG_COMP_INTERINTRA_PRED
int *compmode_interintra_cost,
#endif
int *rate_y, int *distortion_y,
int *rate_uv, int *distortion_uv,
int *mode_excluded, int *disable_skip,
@ -1955,9 +1934,6 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
MACROBLOCKD *xd = &x->e_mbd;
MB_MODE_INFO *mbmi = &xd->mode_info_context->mbmi;
const int is_comp_pred = (mbmi->second_ref_frame > 0);
#if CONFIG_COMP_INTERINTRA_PRED
const int is_comp_interintra_pred = (mbmi->second_ref_frame == INTRA_FRAME);
#endif
const int num_refs = is_comp_pred ? 2 : 1;
const int this_mode = mbmi->mode;
int i;
@ -2099,20 +2075,6 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
is_comp_pred);
*rate2 += vp9_cost_mv_ref(cpi, this_mode,
mbmi->mb_mode_context[mbmi->ref_frame]);
#if CONFIG_COMP_INTERINTRA_PRED
if (!is_comp_pred) {
*compmode_interintra_cost = vp9_cost_bit(cm->fc.interintra_prob,
is_comp_interintra_pred);
if (is_comp_interintra_pred) {
*compmode_interintra_cost +=
x->mbmode_cost[xd->frame_type][mbmi->interintra_mode];
#if SEPARATE_INTERINTRA_UV
*compmode_interintra_cost +=
x->intra_uv_mode_cost[xd->frame_type][mbmi->interintra_uv_mode];
#endif
}
}
#endif
pred_exists = 0;
interpolating_intpel_seen = 0;
@ -2287,9 +2249,6 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
} else {
*mode_excluded = (cpi->common.comp_pred_mode == COMP_PREDICTION_ONLY);
}
#if CONFIG_COMP_INTERINTRA_PRED
if (is_comp_interintra_pred && !cm->use_interintra) *mode_excluded = 1;
#endif
}
return this_rd; // if 0, this will be re-calculated by caller
@ -2389,14 +2348,6 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
int j;
int mode_index, best_mode_index = 0;
unsigned int ref_costs[MAX_REF_FRAMES];
#if CONFIG_COMP_INTERINTRA_PRED
int is_best_interintra = 0;
int64_t best_intra16_rd = INT64_MAX;
int best_intra16_mode = DC_PRED;
#if SEPARATE_INTERINTRA_UV
int best_intra16_uv_mode = DC_PRED;
#endif
#endif
int64_t best_overall_rd = INT64_MAX;
INTERPOLATIONFILTERTYPE best_filter = SWITCHABLE;
INTERPOLATIONFILTERTYPE tmp_best_filter = SWITCHABLE;
@ -2498,9 +2449,6 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
int distortion2 = 0, distortion_y = 0, distortion_uv = 0;
int skippable;
int64_t txfm_cache[NB_TXFM_MODES];
#if CONFIG_COMP_INTERINTRA_PRED
int compmode_interintra_cost = 0;
#endif
// Test best rd so far against threshold for trying this mode.
if (best_rd <= cpi->rd_threshes[mode_index] ||
@ -2552,10 +2500,6 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
comp_pred = mbmi->second_ref_frame > INTRA_FRAME;
mbmi->mode = this_mode;
mbmi->uv_mode = DC_PRED;
#if CONFIG_COMP_INTERINTRA_PRED
mbmi->interintra_mode = (MB_PREDICTION_MODE)(DC_PRED - 1);
mbmi->interintra_uv_mode = (MB_PREDICTION_MODE)(DC_PRED - 1);
#endif
// Evaluate all sub-pel filters irrespective of whether we can use
// them for this frame.
@ -2589,10 +2533,6 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
mode_excluded =
mode_excluded ?
mode_excluded : cm->comp_pred_mode == COMP_PREDICTION_ONLY;
#if CONFIG_COMP_INTERINTRA_PRED
else
mode_excluded = mode_excluded ? mode_excluded : !cm->use_interintra;
#endif
}
}
@ -2809,24 +2749,10 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
if (cpi->scaled_ref_idx[fb] != cm->ref_frame_map[fb])
scaled_ref_frame = &cm->yv12_fb[cpi->scaled_ref_idx[fb]];
#if CONFIG_COMP_INTERINTRA_PRED
if (mbmi->second_ref_frame == INTRA_FRAME) {
if (best_intra16_mode == DC_PRED - 1) continue;
mbmi->interintra_mode = best_intra16_mode;
#if SEPARATE_INTERINTRA_UV
mbmi->interintra_uv_mode = best_intra16_uv_mode;
#else
mbmi->interintra_uv_mode = best_intra16_mode;
#endif
}
#endif
this_rd = handle_inter_mode(cpi, x, bsize,
mdcounts, txfm_cache,
&rate2, &distortion2, &skippable,
&compmode_cost,
#if CONFIG_COMP_INTERINTRA_PRED
&compmode_interintra_cost,
#endif
&rate_y, &distortion_y,
&rate_uv, &distortion_uv,
&mode_excluded, &disable_skip,
@ -2836,11 +2762,6 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
continue;
}
#if CONFIG_COMP_INTERINTRA_PRED
if (cpi->common.use_interintra) {
rate2 += compmode_interintra_cost;
}
#endif
if (cpi->common.comp_pred_mode == HYBRID_PREDICTION) {
rate2 += compmode_cost;
}
@ -2898,18 +2819,6 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
*returnintra = distortion2;
}
#endif
#if CONFIG_COMP_INTERINTRA_PRED
if ((mbmi->ref_frame == INTRA_FRAME) &&
(this_mode <= TM_PRED) &&
(this_rd < best_intra16_rd)) {
best_intra16_rd = this_rd;
best_intra16_mode = this_mode;
#if SEPARATE_INTERINTRA_UV
best_intra16_uv_mode = (mbmi->txfm_size != TX_4X4 ?
mode_uv_8x8 : mode_uv_4x4);
#endif
}
#endif
if (!disable_skip && mbmi->ref_frame == INTRA_FRAME)
for (i = 0; i < NB_PREDICTION_TYPES; ++i)
@ -2919,9 +2828,6 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
best_overall_rd = this_rd;
best_filter = tmp_best_filter;
best_mode = this_mode;
#if CONFIG_COMP_INTERINTRA_PRED
is_best_interintra = (mbmi->second_ref_frame == INTRA_FRAME);
#endif
}
// Store the respective mode distortions for later use.
@ -3060,11 +2966,6 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
(cm->mcomp_filter_type == best_mbmode.interp_filter) ||
(best_mbmode.mode <= I4X4_PRED));
#if CONFIG_COMP_INTERINTRA_PRED
++cpi->interintra_select_count[is_best_interintra];
// if (is_best_interintra) printf("best_interintra\n");
#endif
// Accumulate filter usage stats
// TODO(agrange): Use RD criteria to select interpolation filter mode.
if (is_inter_mode(best_mode))