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
This commit is contained in:
parent
741fbe9656
commit
c9071601a2
1
configure
vendored
1
configure
vendored
@ -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
|
||||
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_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_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_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
|
||||
// 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_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);
|
||||
}
|
||||
}
|
||||
|
@ -1082,20 +1082,12 @@ static void copy_predictor_8x8(uint8_t *dst, const uint8_t *predictor) {
|
||||
|
||||
static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, BLOCK *be,
|
||||
BLOCKD *b, B_PREDICTION_MODE *best_mode,
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
B_PREDICTION_MODE *best_second_mode,
|
||||
int allow_comp,
|
||||
#endif
|
||||
int *bmode_costs,
|
||||
ENTROPY_CONTEXT *a, ENTROPY_CONTEXT *l,
|
||||
int *bestrate, int *bestratey,
|
||||
int *bestdistortion) {
|
||||
B_PREDICTION_MODE mode;
|
||||
MACROBLOCKD *xd = &x->e_mbd;
|
||||
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
B_PREDICTION_MODE mode2;
|
||||
#endif
|
||||
int64_t best_rd = LLONG_MAX;
|
||||
int rate = 0;
|
||||
int distortion;
|
||||
@ -1116,28 +1108,16 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, BLOCK *be,
|
||||
b->bmi.as_mode.context = vp9_find_bpred_context(b);
|
||||
#endif
|
||||
for (mode = B_DC_PRED; mode < LEFT4X4; mode++) {
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
for (mode2 = (allow_comp ? 0 : (B_DC_PRED - 1));
|
||||
mode2 != (allow_comp ? (mode + 1) : 0); mode2++) {
|
||||
#endif
|
||||
int64_t this_rd;
|
||||
int ratey;
|
||||
|
||||
#if CONFIG_NEWBINTRAMODES
|
||||
if (xd->frame_type == KEY_FRAME) {
|
||||
if (mode == B_CONTEXT_PRED) continue;
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
if (mode2 == B_CONTEXT_PRED) continue;
|
||||
#endif
|
||||
} else {
|
||||
if (mode >= B_CONTEXT_PRED - CONTEXT_PRED_REPLACEMENTS &&
|
||||
mode < B_CONTEXT_PRED)
|
||||
continue;
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
if (mode2 >= B_CONTEXT_PRED - CONTEXT_PRED_REPLACEMENTS &&
|
||||
mode2 < B_CONTEXT_PRED)
|
||||
continue;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1149,22 +1129,7 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, BLOCK *be,
|
||||
rate = bmode_costs[mode];
|
||||
#endif
|
||||
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
if (mode2 == (B_PREDICTION_MODE)(B_DC_PRED - 1)) {
|
||||
#endif
|
||||
vp9_intra4x4_predict(b, mode, b->predictor);
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
} else {
|
||||
vp9_comp_intra4x4_predict(b, mode, mode2, b->predictor);
|
||||
#if CONFIG_NEWBINTRAMODES
|
||||
rate += bmode_costs[
|
||||
mode2 == B_CONTEXT_PRED ?
|
||||
mode2 - CONTEXT_PRED_REPLACEMENTS : mode2];
|
||||
#else
|
||||
rate += bmode_costs[mode2];
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
vp9_subtract_b(be, b, 16);
|
||||
|
||||
b->bmi.as_mode.first = mode;
|
||||
@ -1193,23 +1158,13 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, BLOCK *be,
|
||||
best_rd = this_rd;
|
||||
*best_mode = mode;
|
||||
best_tx_type = tx_type;
|
||||
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
*best_second_mode = mode2;
|
||||
#endif
|
||||
*a = tempa;
|
||||
*l = templ;
|
||||
copy_predictor(best_predictor, b->predictor);
|
||||
vpx_memcpy(best_dqcoeff, b->dqcoeff, 32);
|
||||
}
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
}
|
||||
#endif
|
||||
}
|
||||
b->bmi.as_mode.first = (B_PREDICTION_MODE)(*best_mode);
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
b->bmi.as_mode.second = (B_PREDICTION_MODE)(*best_second_mode);
|
||||
#endif
|
||||
|
||||
// inverse transform
|
||||
if (best_tx_type != DCT_DCT)
|
||||
@ -1222,11 +1177,9 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, BLOCK *be,
|
||||
return best_rd;
|
||||
}
|
||||
|
||||
static int64_t rd_pick_intra4x4mby_modes(VP9_COMP *cpi, MACROBLOCK *mb, int *Rate,
|
||||
int *rate_y, int *Distortion, int64_t best_rd,
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
int allow_comp,
|
||||
#endif
|
||||
static int64_t rd_pick_intra4x4mby_modes(VP9_COMP *cpi, MACROBLOCK *mb,
|
||||
int *Rate, int *rate_y,
|
||||
int *Distortion, int64_t best_rd,
|
||||
int update_contexts) {
|
||||
int i;
|
||||
MACROBLOCKD *const xd = &mb->e_mbd;
|
||||
@ -1258,9 +1211,6 @@ static int64_t rd_pick_intra4x4mby_modes(VP9_COMP *cpi, MACROBLOCK *mb, int *Rat
|
||||
MODE_INFO *const mic = xd->mode_info_context;
|
||||
const int mis = xd->mode_info_stride;
|
||||
B_PREDICTION_MODE UNINITIALIZED_IS_SAFE(best_mode);
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
B_PREDICTION_MODE UNINITIALIZED_IS_SAFE(best_second_mode);
|
||||
#endif
|
||||
int UNINITIALIZED_IS_SAFE(r), UNINITIALIZED_IS_SAFE(ry), UNINITIALIZED_IS_SAFE(d);
|
||||
|
||||
if (xd->frame_type == KEY_FRAME) {
|
||||
@ -1275,9 +1225,6 @@ static int64_t rd_pick_intra4x4mby_modes(VP9_COMP *cpi, MACROBLOCK *mb, int *Rat
|
||||
|
||||
total_rd += rd_pick_intra4x4block(
|
||||
cpi, mb, mb->block + i, xd->block + i, &best_mode,
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
& best_second_mode, allow_comp,
|
||||
#endif
|
||||
bmode_costs, ta + vp9_block2above[TX_4X4][i],
|
||||
tl + vp9_block2left[TX_4X4][i], &r, &ry, &d);
|
||||
|
||||
@ -1286,9 +1233,6 @@ static int64_t rd_pick_intra4x4mby_modes(VP9_COMP *cpi, MACROBLOCK *mb, int *Rat
|
||||
tot_rate_y += ry;
|
||||
|
||||
mic->bmi[i].as_mode.first = best_mode;
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
mic->bmi[i].as_mode.second = best_second_mode;
|
||||
#endif
|
||||
|
||||
#if 0 // CONFIG_NEWBINTRAMODES
|
||||
printf("%d %d\n", mic->bmi[i].as_mode.first, mic->bmi[i].as_mode.context);
|
||||
@ -1301,9 +1245,6 @@ static int64_t rd_pick_intra4x4mby_modes(VP9_COMP *cpi, MACROBLOCK *mb, int *Rat
|
||||
if (total_rd >= best_rd)
|
||||
return LLONG_MAX;
|
||||
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
cost += vp9_cost_bit(128, allow_comp);
|
||||
#endif
|
||||
*Rate = cost;
|
||||
*rate_y = tot_rate_y;
|
||||
*Distortion = distortion;
|
||||
@ -1401,10 +1342,6 @@ static int64_t rd_pick_intra16x16mby_mode(VP9_COMP *cpi,
|
||||
MB_PREDICTION_MODE mode;
|
||||
TX_SIZE txfm_size = 0;
|
||||
MB_PREDICTION_MODE UNINITIALIZED_IS_SAFE(mode_selected);
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
MB_PREDICTION_MODE mode2;
|
||||
MB_PREDICTION_MODE UNINITIALIZED_IS_SAFE(mode2_selected);
|
||||
#endif
|
||||
MACROBLOCKD *const xd = &x->e_mbd;
|
||||
MB_MODE_INFO *const mbmi = &xd->mode_info_context->mbmi;
|
||||
int rate, ratey;
|
||||
@ -1422,18 +1359,7 @@ static int64_t rd_pick_intra16x16mby_mode(VP9_COMP *cpi,
|
||||
|
||||
mbmi->mode = mode;
|
||||
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
for (mode2 = DC_PRED - 1; mode2 != TM_PRED + 1; mode2++) {
|
||||
mbmi->second_mode = mode2;
|
||||
if (mode2 == (MB_PREDICTION_MODE)(DC_PRED - 1)) {
|
||||
#endif
|
||||
vp9_build_intra_predictors_mby(xd);
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
} else {
|
||||
continue; // i.e. disable for now
|
||||
vp9_build_comp_intra_predictors_mby(xd);
|
||||
}
|
||||
#endif
|
||||
|
||||
macro_block_yrd(cpi, x, &ratey, &distortion, &skip, local_txfm_cache);
|
||||
|
||||
@ -1446,9 +1372,6 @@ static int64_t rd_pick_intra16x16mby_mode(VP9_COMP *cpi,
|
||||
if (this_rd < best_rd) {
|
||||
mode_selected = mode;
|
||||
txfm_size = mbmi->txfm_size;
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
mode2_selected = mode2;
|
||||
#endif
|
||||
best_rd = this_rd;
|
||||
*Rate = rate;
|
||||
*rate_y = ratey;
|
||||
@ -1463,35 +1386,22 @@ static int64_t rd_pick_intra16x16mby_mode(VP9_COMP *cpi,
|
||||
txfm_cache[i] = adj_rd;
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
mbmi->txfm_size = txfm_size;
|
||||
mbmi->mode = mode_selected;
|
||||
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
mbmi->second_mode = mode2_selected;
|
||||
#endif
|
||||
return best_rd;
|
||||
}
|
||||
|
||||
|
||||
static int64_t rd_pick_intra8x8block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
|
||||
B_PREDICTION_MODE *best_mode,
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
B_PREDICTION_MODE *best_second_mode,
|
||||
#endif
|
||||
int *mode_costs,
|
||||
ENTROPY_CONTEXT *a, ENTROPY_CONTEXT *l,
|
||||
int *bestrate, int *bestratey,
|
||||
int *bestdistortion) {
|
||||
MB_PREDICTION_MODE mode;
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
MB_PREDICTION_MODE mode2;
|
||||
#endif
|
||||
MACROBLOCKD *xd = &x->e_mbd;
|
||||
int64_t best_rd = LLONG_MAX;
|
||||
int distortion = 0, rate = 0;
|
||||
@ -1513,9 +1423,6 @@ static int64_t rd_pick_intra8x8block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
|
||||
int idx = (ib & 0x02) ? (ib + 2) : ib;
|
||||
|
||||
for (mode = DC_PRED; mode <= TM_PRED; mode++) {
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
for (mode2 = DC_PRED - 1; mode2 != TM_PRED + 1; mode2++) {
|
||||
#endif
|
||||
int64_t this_rd;
|
||||
int rate_t = 0;
|
||||
|
||||
@ -1523,16 +1430,7 @@ static int64_t rd_pick_intra8x8block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
|
||||
rate = mode_costs[mode];
|
||||
b->bmi.as_mode.first = mode;
|
||||
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
if (mode2 == (MB_PREDICTION_MODE)(DC_PRED - 1)) {
|
||||
#endif
|
||||
vp9_intra8x8_predict(b, mode, b->predictor);
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
} else {
|
||||
continue; // i.e. disable for now
|
||||
vp9_comp_intra8x8_predict(b, mode, mode2, b->predictor);
|
||||
}
|
||||
#endif
|
||||
|
||||
vp9_subtract_4b_c(be, b, 16);
|
||||
|
||||
@ -1599,21 +1497,12 @@ static int64_t rd_pick_intra8x8block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
|
||||
bestl1 = tl1;
|
||||
best_rd = this_rd;
|
||||
*best_mode = mode;
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
*best_second_mode = mode2;
|
||||
#endif
|
||||
copy_predictor_8x8(best_predictor, b->predictor);
|
||||
vpx_memcpy(best_dqcoeff, b->dqcoeff, 64);
|
||||
vpx_memcpy(best_dqcoeff + 32, b->dqcoeff + 64, 64);
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
b->bmi.as_mode.first = (*best_mode);
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
b->bmi.as_mode.second = (*best_second_mode);
|
||||
#endif
|
||||
vp9_encode_intra8x8(x, ib);
|
||||
|
||||
if (xd->mode_info_context->mbmi.txfm_size == TX_8X8) {
|
||||
@ -1656,25 +1545,16 @@ static int64_t rd_pick_intra8x8mby_modes(VP9_COMP *cpi, MACROBLOCK *mb,
|
||||
for (i = 0; i < 4; i++) {
|
||||
MODE_INFO *const mic = xd->mode_info_context;
|
||||
B_PREDICTION_MODE UNINITIALIZED_IS_SAFE(best_mode);
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
B_PREDICTION_MODE UNINITIALIZED_IS_SAFE(best_second_mode);
|
||||
#endif
|
||||
int UNINITIALIZED_IS_SAFE(r), UNINITIALIZED_IS_SAFE(ry), UNINITIALIZED_IS_SAFE(d);
|
||||
|
||||
ib = vp9_i8x8_block[i];
|
||||
total_rd += rd_pick_intra8x8block(
|
||||
cpi, mb, ib, &best_mode,
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
& best_second_mode,
|
||||
#endif
|
||||
i8x8mode_costs, ta, tl, &r, &ry, &d);
|
||||
cost += r;
|
||||
distortion += d;
|
||||
tot_rate_y += ry;
|
||||
mic->bmi[ib].as_mode.first = best_mode;
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
mic->bmi[ib].as_mode.second = best_second_mode;
|
||||
#endif
|
||||
}
|
||||
|
||||
*Rate = cost;
|
||||
@ -1887,10 +1767,6 @@ static void rd_pick_intra_mbuv_mode(VP9_COMP *cpi,
|
||||
int *skippable) {
|
||||
MB_PREDICTION_MODE mode;
|
||||
MB_PREDICTION_MODE UNINITIALIZED_IS_SAFE(mode_selected);
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
MB_PREDICTION_MODE mode2;
|
||||
MB_PREDICTION_MODE UNINITIALIZED_IS_SAFE(mode2_selected);
|
||||
#endif
|
||||
MACROBLOCKD *xd = &x->e_mbd;
|
||||
MB_MODE_INFO * mbmi = &x->e_mbd.mode_info_context->mbmi;
|
||||
int64_t best_rd = LLONG_MAX;
|
||||
@ -1898,25 +1774,12 @@ static void rd_pick_intra_mbuv_mode(VP9_COMP *cpi,
|
||||
int rate_to, UNINITIALIZED_IS_SAFE(skip);
|
||||
|
||||
for (mode = DC_PRED; mode <= TM_PRED; mode++) {
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
for (mode2 = DC_PRED - 1; mode2 != TM_PRED + 1; mode2++) {
|
||||
#endif
|
||||
int rate;
|
||||
int distortion;
|
||||
int64_t this_rd;
|
||||
|
||||
mbmi->uv_mode = mode;
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
mbmi->second_uv_mode = mode2;
|
||||
if (mode2 == (MB_PREDICTION_MODE)(DC_PRED - 1)) {
|
||||
#endif
|
||||
vp9_build_intra_predictors_mbuv(&x->e_mbd);
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
} else {
|
||||
continue;
|
||||
vp9_build_comp_intra_predictors_mbuv(&x->e_mbd);
|
||||
}
|
||||
#endif
|
||||
|
||||
vp9_subtract_mbuv(x->src_diff, x->src.u_buffer, x->src.v_buffer,
|
||||
x->e_mbd.predictor, x->src.uv_stride);
|
||||
@ -1938,10 +1801,6 @@ static void rd_pick_intra_mbuv_mode(VP9_COMP *cpi,
|
||||
r = rate;
|
||||
*rate_tokenonly = rate_to;
|
||||
mode_selected = mode;
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
mode2_selected = mode2;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -1950,9 +1809,6 @@ static void rd_pick_intra_mbuv_mode(VP9_COMP *cpi,
|
||||
*skippable = skip;
|
||||
|
||||
mbmi->uv_mode = mode_selected;
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
mbmi->second_uv_mode = mode2_selected;
|
||||
#endif
|
||||
}
|
||||
|
||||
static void rd_pick_intra_mbuv_mode_8x8(VP9_COMP *cpi,
|
||||
@ -3100,24 +2956,17 @@ static void mv_pred(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
x->mv_best_ref_index[ref_frame] = best_index;
|
||||
}
|
||||
|
||||
static void set_i8x8_block_modes(MACROBLOCK *x, int modes[2][4]) {
|
||||
static void set_i8x8_block_modes(MACROBLOCK *x, int modes[4]) {
|
||||
int i;
|
||||
MACROBLOCKD *xd = &x->e_mbd;
|
||||
for (i = 0; i < 4; i++) {
|
||||
int ib = vp9_i8x8_block[i];
|
||||
xd->mode_info_context->bmi[ib + 0].as_mode.first = modes[0][i];
|
||||
xd->mode_info_context->bmi[ib + 1].as_mode.first = modes[0][i];
|
||||
xd->mode_info_context->bmi[ib + 4].as_mode.first = modes[0][i];
|
||||
xd->mode_info_context->bmi[ib + 5].as_mode.first = modes[0][i];
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
xd->mode_info_context->bmi[ib + 0].as_mode.second = modes[1][i];
|
||||
xd->mode_info_context->bmi[ib + 1].as_mode.second = modes[1][i];
|
||||
xd->mode_info_context->bmi[ib + 4].as_mode.second = modes[1][i];
|
||||
xd->mode_info_context->bmi[ib + 5].as_mode.second = modes[1][i];
|
||||
#endif
|
||||
// printf("%d,%d,%d,%d %d,%d,%d,%d\n",
|
||||
// modes[0][0], modes[0][1], modes[0][2], modes[0][3],
|
||||
// modes[1][0], modes[1][1], modes[1][2], modes[1][3]);
|
||||
xd->mode_info_context->bmi[ib + 0].as_mode.first = modes[i];
|
||||
xd->mode_info_context->bmi[ib + 1].as_mode.first = modes[i];
|
||||
xd->mode_info_context->bmi[ib + 4].as_mode.first = modes[i];
|
||||
xd->mode_info_context->bmi[ib + 5].as_mode.first = modes[i];
|
||||
// printf("%d,%d,%d,%d\n",
|
||||
// modes[0], modes[1], modes[2], modes[3]);
|
||||
}
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
@ -3676,7 +3525,7 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
MB_PREDICTION_MODE best_mode = DC_PRED;
|
||||
MB_MODE_INFO * mbmi = &xd->mode_info_context->mbmi;
|
||||
int i, best_mode_index = 0;
|
||||
int mode8x8[2][4];
|
||||
int mode8x8[4];
|
||||
unsigned char segment_id = mbmi->segment_id;
|
||||
|
||||
int mode_index;
|
||||
@ -3834,10 +3683,6 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
continue;
|
||||
|
||||
// current coding mode under rate-distortion optimization test loop
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
mbmi->second_mode = (MB_PREDICTION_MODE)(DC_PRED - 1);
|
||||
mbmi->second_uv_mode = (MB_PREDICTION_MODE)(DC_PRED - 1);
|
||||
#endif
|
||||
#if CONFIG_COMP_INTERINTRA_PRED
|
||||
mbmi->interintra_mode = (MB_PREDICTION_MODE)(DC_PRED - 1);
|
||||
mbmi->interintra_uv_mode = (MB_PREDICTION_MODE)(DC_PRED - 1);
|
||||
@ -3952,10 +3797,8 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
// Note the rate value returned here includes the cost of coding
|
||||
// the BPRED mode : x->mbmode_cost[xd->frame_type][BPRED];
|
||||
mbmi->txfm_size = TX_4X4;
|
||||
tmp_rd = rd_pick_intra4x4mby_modes(cpi, x, &rate, &rate_y, &distortion, best_yrd,
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
0,
|
||||
#endif
|
||||
tmp_rd = rd_pick_intra4x4mby_modes(cpi, x, &rate, &rate_y,
|
||||
&distortion, best_yrd,
|
||||
cpi->update_context);
|
||||
rate2 += rate;
|
||||
rate2 += intra_cost_penalty;
|
||||
@ -3981,16 +3824,10 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
mbmi->txfm_size = TX_4X4;
|
||||
tmp_rd_4x4 = rd_pick_intra8x8mby_modes(cpi, x, &r4x4, &tok4x4,
|
||||
&d4x4, best_yrd);
|
||||
mode8x8[0][0] = xd->mode_info_context->bmi[0].as_mode.first;
|
||||
mode8x8[0][1] = xd->mode_info_context->bmi[2].as_mode.first;
|
||||
mode8x8[0][2] = xd->mode_info_context->bmi[8].as_mode.first;
|
||||
mode8x8[0][3] = xd->mode_info_context->bmi[10].as_mode.first;
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
mode8x8[1][0] = xd->mode_info_context->bmi[0].as_mode.second;
|
||||
mode8x8[1][1] = xd->mode_info_context->bmi[2].as_mode.second;
|
||||
mode8x8[1][2] = xd->mode_info_context->bmi[8].as_mode.second;
|
||||
mode8x8[1][3] = xd->mode_info_context->bmi[10].as_mode.second;
|
||||
#endif
|
||||
mode8x8[0] = xd->mode_info_context->bmi[0].as_mode.first;
|
||||
mode8x8[1] = xd->mode_info_context->bmi[2].as_mode.first;
|
||||
mode8x8[2] = xd->mode_info_context->bmi[8].as_mode.first;
|
||||
mode8x8[3] = xd->mode_info_context->bmi[10].as_mode.first;
|
||||
mbmi->txfm_size = TX_8X8;
|
||||
tmp_rd_8x8 = rd_pick_intra8x8mby_modes(cpi, x, &r8x8, &tok8x8,
|
||||
&d8x8, best_yrd);
|
||||
@ -4014,16 +3851,10 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
mbmi->txfm_size = TX_8X8;
|
||||
tmp_rd = tmp_rd_8x8s;
|
||||
|
||||
mode8x8[0][0] = xd->mode_info_context->bmi[0].as_mode.first;
|
||||
mode8x8[0][1] = xd->mode_info_context->bmi[2].as_mode.first;
|
||||
mode8x8[0][2] = xd->mode_info_context->bmi[8].as_mode.first;
|
||||
mode8x8[0][3] = xd->mode_info_context->bmi[10].as_mode.first;
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
mode8x8[1][0] = xd->mode_info_context->bmi[0].as_mode.second;
|
||||
mode8x8[1][1] = xd->mode_info_context->bmi[2].as_mode.second;
|
||||
mode8x8[1][2] = xd->mode_info_context->bmi[8].as_mode.second;
|
||||
mode8x8[1][3] = xd->mode_info_context->bmi[10].as_mode.second;
|
||||
#endif
|
||||
mode8x8[0] = xd->mode_info_context->bmi[0].as_mode.first;
|
||||
mode8x8[1] = xd->mode_info_context->bmi[2].as_mode.first;
|
||||
mode8x8[2] = xd->mode_info_context->bmi[8].as_mode.first;
|
||||
mode8x8[3] = xd->mode_info_context->bmi[10].as_mode.first;
|
||||
}
|
||||
} else if (cm->txfm_mode == ONLY_4X4) {
|
||||
rate = r4x4;
|
||||
@ -4038,16 +3869,10 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
mbmi->txfm_size = TX_8X8;
|
||||
tmp_rd = tmp_rd_8x8;
|
||||
|
||||
mode8x8[0][0] = xd->mode_info_context->bmi[0].as_mode.first;
|
||||
mode8x8[0][1] = xd->mode_info_context->bmi[2].as_mode.first;
|
||||
mode8x8[0][2] = xd->mode_info_context->bmi[8].as_mode.first;
|
||||
mode8x8[0][3] = xd->mode_info_context->bmi[10].as_mode.first;
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
mode8x8[1][0] = xd->mode_info_context->bmi[0].as_mode.second;
|
||||
mode8x8[1][1] = xd->mode_info_context->bmi[2].as_mode.second;
|
||||
mode8x8[1][2] = xd->mode_info_context->bmi[8].as_mode.second;
|
||||
mode8x8[1][3] = xd->mode_info_context->bmi[10].as_mode.second;
|
||||
#endif
|
||||
mode8x8[0] = xd->mode_info_context->bmi[0].as_mode.first;
|
||||
mode8x8[1] = xd->mode_info_context->bmi[2].as_mode.first;
|
||||
mode8x8[2] = xd->mode_info_context->bmi[8].as_mode.first;
|
||||
mode8x8[3] = xd->mode_info_context->bmi[10].as_mode.first;
|
||||
}
|
||||
|
||||
rate2 += rate;
|
||||
@ -4519,10 +4344,6 @@ void vp9_rd_pick_intra_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
MACROBLOCKD *xd = &x->e_mbd;
|
||||
MB_MODE_INFO * mbmi = &x->e_mbd.mode_info_context->mbmi;
|
||||
int64_t error4x4, error16x16;
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
int64_t error4x4d;
|
||||
int rate4x4d, dist4x4d;
|
||||
#endif
|
||||
int rate4x4, rate16x16 = 0, rateuv, rateuv8x8;
|
||||
int dist4x4 = 0, dist16x16 = 0, distuv = 0, distuv8x8 = 0;
|
||||
int rate;
|
||||
@ -4533,7 +4354,7 @@ void vp9_rd_pick_intra_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
int rate8x8_tokenonly=0;
|
||||
int rate8x8, dist8x8;
|
||||
int mode16x16;
|
||||
int mode8x8[2][4];
|
||||
int mode8x8[4];
|
||||
int dist;
|
||||
int modeuv, uv_intra_skippable, uv_intra_skippable_8x8;
|
||||
int y_intra16x16_skippable = 0;
|
||||
@ -4566,30 +4387,15 @@ void vp9_rd_pick_intra_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
mbmi->txfm_size = (cm->txfm_mode == ONLY_4X4) ? TX_4X4 : TX_8X8;
|
||||
error8x8 = rd_pick_intra8x8mby_modes(cpi, x, &rate8x8, &rate8x8_tokenonly,
|
||||
&dist8x8, error16x16);
|
||||
mode8x8[0][0]= xd->mode_info_context->bmi[0].as_mode.first;
|
||||
mode8x8[0][1]= xd->mode_info_context->bmi[2].as_mode.first;
|
||||
mode8x8[0][2]= xd->mode_info_context->bmi[8].as_mode.first;
|
||||
mode8x8[0][3]= xd->mode_info_context->bmi[10].as_mode.first;
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
mode8x8[1][0] = xd->mode_info_context->bmi[0].as_mode.second;
|
||||
mode8x8[1][1] = xd->mode_info_context->bmi[2].as_mode.second;
|
||||
mode8x8[1][2] = xd->mode_info_context->bmi[8].as_mode.second;
|
||||
mode8x8[1][3] = xd->mode_info_context->bmi[10].as_mode.second;
|
||||
#endif
|
||||
mode8x8[0]= xd->mode_info_context->bmi[0].as_mode.first;
|
||||
mode8x8[1]= xd->mode_info_context->bmi[2].as_mode.first;
|
||||
mode8x8[2]= xd->mode_info_context->bmi[8].as_mode.first;
|
||||
mode8x8[3]= xd->mode_info_context->bmi[10].as_mode.first;
|
||||
|
||||
error4x4 = rd_pick_intra4x4mby_modes(cpi, x,
|
||||
&rate4x4, &rate4x4_tokenonly,
|
||||
&dist4x4, error16x16,
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
0,
|
||||
#endif
|
||||
cpi->update_context);
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
error4x4d = rd_pick_intra4x4mby_modes(cpi, x,
|
||||
&rate4x4d, &rate4x4_tokenonly,
|
||||
&dist4x4d, error16x16, 1,
|
||||
cpi->update_context);
|
||||
#endif
|
||||
|
||||
mbmi->mb_skip_coeff = 0;
|
||||
if (cpi->common.mb_no_coeff_skip &&
|
||||
@ -4606,17 +4412,7 @@ void vp9_rd_pick_intra_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
sizeof(x->mb_context[xd->sb_index][xd->mb_index].txfm_rd_diff));
|
||||
} else if (error8x8 > error16x16) {
|
||||
if (error4x4 < error16x16) {
|
||||
rate = rateuv;
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
rate += (error4x4d < error4x4) ? rate4x4d : rate4x4;
|
||||
if (error4x4d >= error4x4) // FIXME save original modes etc.
|
||||
error4x4 = rd_pick_intra4x4mby_modes(cpi, x, &rate4x4,
|
||||
&rate4x4_tokenonly,
|
||||
&dist4x4, error16x16, 0,
|
||||
cpi->update_context);
|
||||
#else
|
||||
rate += rate4x4;
|
||||
#endif
|
||||
rate = rateuv + rate4x4;
|
||||
mbmi->mode = B_PRED;
|
||||
mbmi->txfm_size = TX_4X4;
|
||||
dist = dist4x4 + (distuv >> 2);
|
||||
@ -4636,17 +4432,7 @@ void vp9_rd_pick_intra_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
rate += vp9_cost_bit(vp9_get_pred_prob(cm, xd, PRED_MBSKIP), 0);
|
||||
} else {
|
||||
if (error4x4 < error8x8) {
|
||||
rate = rateuv;
|
||||
#if CONFIG_COMP_INTRA_PRED
|
||||
rate += (error4x4d < error4x4) ? rate4x4d : rate4x4;
|
||||
if (error4x4d >= error4x4) // FIXME save original modes etc.
|
||||
error4x4 = rd_pick_intra4x4mby_modes(cpi, x, &rate4x4,
|
||||
&rate4x4_tokenonly,
|
||||
&dist4x4, error16x16, 0,
|
||||
cpi->update_context);
|
||||
#else
|
||||
rate += rate4x4;
|
||||
#endif
|
||||
rate = rateuv + rate4x4;
|
||||
mbmi->mode = B_PRED;
|
||||
mbmi->txfm_size = TX_4X4;
|
||||
dist = dist4x4 + (distuv >> 2);
|
||||
@ -4817,10 +4603,6 @@ static 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_INTRA_PRED
|
||||
mbmi->second_mode = (MB_PREDICTION_MODE)(DC_PRED - 1);
|
||||
mbmi->second_uv_mode = (MB_PREDICTION_MODE)(DC_PRED - 1);
|
||||
#endif
|
||||
#if CONFIG_COMP_INTERINTRA_PRED
|
||||
mbmi->interintra_mode = (MB_PREDICTION_MODE)(DC_PRED - 1);
|
||||
mbmi->interintra_uv_mode = (MB_PREDICTION_MODE)(DC_PRED - 1);
|
||||
|
Loading…
Reference in New Issue
Block a user