Commit 7de5edd1 authored by Yaowu Xu's avatar Yaowu Xu

Rename B_PRED to I4X4_PRED

So it is consistent with I8x8_PRED.

Change-Id: Iefa65124b2419690d83e526c611129c0ede29d11
parent aa25f6a3
......@@ -84,8 +84,8 @@ typedef enum {
D27_PRED, /* Directional 22 deg prediction [anti-clockwise from 0 deg hor] */
D63_PRED, /* Directional 67 deg prediction [anti-clockwise from 0 deg hor] */
TM_PRED, /* Truemotion prediction */
I8X8_PRED, /* 8x8 based prediction, each 8x8 has its own prediction mode */
B_PRED, /* block based prediction, each block has its own prediction mode */
I8X8_PRED, /* 8x8 based prediction, each 8x8 has its own mode */
I4X4_PRED, /* 4x4 based prediction, each 4x4 has its own mode */
NEARESTMV,
NEARMV,
ZEROMV,
......@@ -120,7 +120,7 @@ typedef enum {
ADST_ADST = 3 // ADST in both directions
} TX_TYPE;
#define VP9_YMODES (B_PRED + 1)
#define VP9_YMODES (I4X4_PRED + 1)
#define VP9_UV_MODES (TM_PRED + 1)
#define VP9_I8X8_MODES (TM_PRED + 1)
#define VP9_I32X32_MODES (TM_PRED + 1)
......@@ -159,7 +159,7 @@ typedef enum {
#define VP9_SUBMVREFS (1 + NEW4X4 - LEFT4X4)
#if CONFIG_NEWBINTRAMODES
/* The number of B_PRED intra modes that are replaced by B_CONTEXT_PRED */
/* The number of I4X4_PRED intra modes that are replaced by B_CONTEXT_PRED */
#define CONTEXT_PRED_REPLACEMENTS 0
#define VP9_KF_BINTRAMODES (VP9_BINTRAMODES - 1)
#define VP9_NKF_BINTRAMODES (VP9_BINTRAMODES - CONTEXT_PRED_REPLACEMENTS)
......@@ -413,10 +413,14 @@ typedef struct macroblockd {
unsigned char mode_ref_lf_delta_update;
/* Delta values have the range +/- MAX_LOOP_FILTER */
signed char last_ref_lf_deltas[MAX_REF_LF_DELTAS]; /* 0 = Intra, Last, GF, ARF */
signed char ref_lf_deltas[MAX_REF_LF_DELTAS]; /* 0 = Intra, Last, GF, ARF */
signed char last_mode_lf_deltas[MAX_MODE_LF_DELTAS]; /* 0 = BPRED, ZERO_MV, MV, SPLIT */
signed char mode_lf_deltas[MAX_MODE_LF_DELTAS]; /* 0 = BPRED, ZERO_MV, MV, SPLIT */
/* 0 = Intra, Last, GF, ARF */
signed char last_ref_lf_deltas[MAX_REF_LF_DELTAS];
/* 0 = Intra, Last, GF, ARF */
signed char ref_lf_deltas[MAX_REF_LF_DELTAS];
/* 0 = I4X4_PRED, ZERO_MV, MV, SPLIT */
signed char last_mode_lf_deltas[MAX_MODE_LF_DELTAS];
/* 0 = I4X4_PRED, ZERO_MV, MV, SPLIT */
signed char mode_lf_deltas[MAX_MODE_LF_DELTAS];
/* Distance of MB away from frame edges */
int mb_to_left_edge;
......@@ -532,7 +536,7 @@ static TX_TYPE get_tx_type_4x4(const MACROBLOCKD *xd, int ib) {
return tx_type;
if (xd->lossless)
return DCT_DCT;
if (xd->mode_info_context->mbmi.mode == B_PRED &&
if (xd->mode_info_context->mbmi.mode == I4X4_PRED &&
xd->q_index < ACTIVE_HT) {
const BLOCKD *b = &xd->block[ib];
tx_type = txfm_map(
......@@ -700,7 +704,7 @@ void vp9_setup_block_dptrs(MACROBLOCKD *xd);
static void update_blockd_bmi(MACROBLOCKD *xd) {
const MB_PREDICTION_MODE mode = xd->mode_info_context->mbmi.mode;
if (mode == SPLITMV || mode == I8X8_PRED || mode == B_PRED) {
if (mode == SPLITMV || mode == I8X8_PRED || mode == I4X4_PRED) {
int i;
for (i = 0; i < 16; i++)
xd->block[i].bmi = xd->mode_info_context->bmi[i];
......
......@@ -85,7 +85,7 @@ void vp9_print_modes_and_motion_vectors(MODE_INFO *mi, int rows, int cols,
mb_index = (b_row >> 2) * (cols + 1) + (b_col >> 2);
bindex = (b_row & 3) * 4 + (b_col & 3);
if (mi[mb_index].mbmi.mode == B_PRED) {
if (mi[mb_index].mbmi.mode == I4X4_PRED) {
fprintf(mvs, "%2d ", mi[mb_index].bmi[bindex].as_mode.first);
} else
fprintf(mvs, "xx ");
......
......@@ -16,7 +16,7 @@
#include "vpx_mem/vpx_mem.h"
static const unsigned int kf_y_mode_cts[8][VP9_YMODES] = {
/* DC V H D45 135 117 153 D27 D63 TM i8x8 BPRED */
/* DC V H D45 135 117 153 D27 D63 TM i8x8 i4X4 */
{12, 6, 5, 5, 5, 5, 5, 5, 5, 2, 22, 200},
{25, 13, 13, 7, 7, 7, 7, 7, 7, 6, 27, 160},
{31, 17, 18, 8, 8, 8, 8, 8, 8, 9, 26, 139},
......@@ -28,7 +28,7 @@ static const unsigned int kf_y_mode_cts[8][VP9_YMODES] = {
};
static const unsigned int y_mode_cts [VP9_YMODES] = {
/* DC V H D45 135 117 153 D27 D63 TM i8x8 BPRED */
/* DC V H D45 135 117 153 D27 D63 TM i8x8 i4X4 */
98, 19, 15, 14, 14, 14, 14, 12, 12, 13, 16, 70
};
......@@ -45,11 +45,11 @@ static const unsigned int uv_mode_cts [VP9_YMODES] [VP9_UV_MODES] = {
{ 150, 15, 10, 10, 10, 10, 10, 10, 75, 6}, /* D63 */
{ 160, 30, 30, 10, 10, 10, 10, 10, 10, 16}, /* TM */
{ 132, 46, 40, 10, 10, 10, 10, 10, 10, 18}, /* i8x8 - never used */
{ 150, 35, 41, 10, 10, 10, 10, 10, 10, 10}, /* BPRED */
{ 150, 35, 41, 10, 10, 10, 10, 10, 10, 10}, /* i4X4 */
};
static const unsigned int i8x8_mode_cts [VP9_I8X8_MODES] = {
/* DC V H D45 135 117 153 D27 D63 TM */
/* DC V H D45 135 117 153 D27 D63 TM */
73, 49, 61, 30, 30, 30, 30, 30, 30, 13
};
......@@ -66,7 +66,7 @@ static const unsigned int kf_uv_mode_cts [VP9_YMODES] [VP9_UV_MODES] = {
{ 102, 33, 20, 20, 20, 20, 20, 20, 64, 14}, /* D63 */
{ 132, 36, 30, 20, 20, 20, 20, 20, 20, 18}, /* TM */
{ 122, 41, 35, 20, 20, 20, 20, 20, 20, 18}, /* i8x8 - never used */
{ 122, 41, 35, 20, 20, 20, 20, 20, 20, 18}, /* BPRED */
{ 122, 41, 35, 20, 20, 20, 20, 20, 20, 18}, /* I4X4 */
};
static const unsigned int bmode_cts[VP9_NKF_BINTRAMODES] = {
......@@ -217,7 +217,7 @@ const vp9_tree_index vp9_ymode_tree[VP9_YMODES * 2 - 2] = {
16, 18,
-V_PRED, -H_PRED,
-TM_PRED, 20,
-B_PRED, -I8X8_PRED
-I4X4_PRED, -I8X8_PRED
};
const vp9_tree_index vp9_kf_ymode_tree[VP9_YMODES * 2 - 2] = {
......@@ -231,7 +231,7 @@ const vp9_tree_index vp9_kf_ymode_tree[VP9_YMODES * 2 - 2] = {
16, 18,
-V_PRED, -H_PRED,
-TM_PRED, 20,
-B_PRED, -I8X8_PRED
-I4X4_PRED, -I8X8_PRED
};
const vp9_tree_index vp9_i8x8_mode_tree[VP9_I8X8_MODES * 2 - 2] = {
......@@ -642,7 +642,7 @@ static void set_default_lf_deltas(MACROBLOCKD *xd) {
xd->ref_lf_deltas[GOLDEN_FRAME] = -2;
xd->ref_lf_deltas[ALTREF_FRAME] = -2;
xd->mode_lf_deltas[0] = 4; // BPRED
xd->mode_lf_deltas[0] = 4; // I4X4_PRED
xd->mode_lf_deltas[1] = -2; // Zero
xd->mode_lf_deltas[2] = 2; // New mv
xd->mode_lf_deltas[3] = 4; // Split mv
......
......@@ -168,7 +168,7 @@ static B_PREDICTION_MODE left_block_mode(const MODE_INFO *cur_mb, int b) {
} else if (cur_mb->mbmi.mode == I8X8_PRED) {
return pred_mode_conv(
(MB_PREDICTION_MODE)(cur_mb->bmi + 3 + b)->as_mode.first);
} else if (cur_mb->mbmi.mode == B_PRED) {
} else if (cur_mb->mbmi.mode == I4X4_PRED) {
return ((cur_mb->bmi + 3 + b)->as_mode.first);
} else {
return B_DC_PRED;
......@@ -188,7 +188,7 @@ static B_PREDICTION_MODE above_block_mode(const MODE_INFO *cur_mb,
} else if (cur_mb->mbmi.mode == I8X8_PRED) {
return pred_mode_conv(
(MB_PREDICTION_MODE)(cur_mb->bmi + 12 + b)->as_mode.first);
} else if (cur_mb->mbmi.mode == B_PRED) {
} else if (cur_mb->mbmi.mode == I4X4_PRED) {
return ((cur_mb->bmi + 12 + b)->as_mode.first);
} else {
return B_DC_PRED;
......
......@@ -44,7 +44,7 @@ static void lf_init_lut(loop_filter_info_n *lfi) {
lfi->mode_lf_lut[V_PRED] = 1;
lfi->mode_lf_lut[H_PRED] = 1;
lfi->mode_lf_lut[TM_PRED] = 1;
lfi->mode_lf_lut[B_PRED] = 0;
lfi->mode_lf_lut[I4X4_PRED] = 0;
lfi->mode_lf_lut[I8X8_PRED] = 0;
lfi->mode_lf_lut[ZEROMV] = 1;
lfi->mode_lf_lut[NEARESTMV] = 2;
......@@ -149,8 +149,8 @@ void vp9_loop_filter_frame_init(VP9_COMMON *cm,
lvl_ref += xd->ref_lf_deltas[ref];
/* Apply delta for Intra modes */
mode = 0; /* B_PRED */
/* Only the split mode BPRED has a further special case */
mode = 0; /* I4X4_PRED */
/* Only the split mode I4X4_PRED has a further special case */
lvl_mode = clamp(lvl_ref + xd->mode_lf_deltas[mode], 0, 63);
lfi->lvl[seg][ref][mode] = lvl_mode;
......@@ -183,7 +183,7 @@ static int mb_lf_skip(const MB_MODE_INFO *const mbmi) {
const MB_PREDICTION_MODE mode = mbmi->mode;
const int skip_coef = mbmi->mb_skip_coeff;
const int tx_size = mbmi->txfm_size;
return mode != B_PRED && mode != I8X8_PRED && mode != SPLITMV &&
return mode != I4X4_PRED && mode != I8X8_PRED && mode != SPLITMV &&
(tx_size >= TX_16X16 || skip_coef);
}
......
......@@ -727,7 +727,7 @@ int vp9_post_proc_frame(VP9_COMMON *oci, YV12_BUFFER_CONFIG *dest,
for (i = 0; i < mb_rows; i++) {
for (j = 0; j < mb_cols; j++) {
char zz[4];
int dc_diff = !(mi[mb_index].mbmi.mode != B_PRED &&
int dc_diff = !(mi[mb_index].mbmi.mode != I4X4_PRED &&
mi[mb_index].mbmi.mode != SPLITMV &&
mi[mb_index].mbmi.mb_skip_coeff);
......@@ -913,8 +913,8 @@ int vp9_post_proc_frame(VP9_COMMON *oci, YV12_BUFFER_CONFIG *dest,
for (x = 0; x < width; x += 16) {
int Y = 0, U = 0, V = 0;
if (mi->mbmi.mode == B_PRED &&
((ppflags->display_mb_modes_flag & B_PRED) ||
if (mi->mbmi.mode == I4X4_PRED &&
((ppflags->display_mb_modes_flag & I4X4_PRED) ||
ppflags->display_b_modes_flag)) {
int by, bx;
uint8_t *yl, *ul, *vl;
......@@ -927,7 +927,7 @@ int vp9_post_proc_frame(VP9_COMMON *oci, YV12_BUFFER_CONFIG *dest,
for (by = 0; by < 16; by += 4) {
for (bx = 0; bx < 16; bx += 4) {
if ((ppflags->display_b_modes_flag & (1 << mi->mbmi.mode))
|| (ppflags->display_mb_modes_flag & B_PRED)) {
|| (ppflags->display_mb_modes_flag & I4X4_PRED)) {
Y = B_PREDICTION_MODE_colors[bmi->as_mode.first][0];
U = B_PREDICTION_MODE_colors[bmi->as_mode.first][1];
V = B_PREDICTION_MODE_colors[bmi->as_mode.first][2];
......
......@@ -403,7 +403,7 @@ void vp9_build_intra_predictors(uint8_t *src, int src_stride,
d63_predictor(ypred_ptr, y_stride, bw, bh, yabove_row, yleft_col);
break;
case I8X8_PRED:
case B_PRED:
case I4X4_PRED:
case NEARESTMV:
case NEARMV:
case ZEROMV:
......
......@@ -171,7 +171,7 @@ static void kfread_modes(VP9D_COMP *pbi,
m->mbmi.ref_frame = INTRA_FRAME;
if ((m->mbmi.mode = y_mode) == B_PRED) {
if ((m->mbmi.mode = y_mode) == I4X4_PRED) {
int i = 0;
do {
const B_PREDICTION_MODE a = above_block_mode(m, i, mis);
......@@ -214,7 +214,7 @@ static void kfread_modes(VP9D_COMP *pbi,
m->mbmi.txfm_size = TX_32X32;
} else if (cm->txfm_mode >= ALLOW_16X16 && m->mbmi.mode <= TM_PRED) {
m->mbmi.txfm_size = TX_16X16;
} else if (cm->txfm_mode >= ALLOW_8X8 && m->mbmi.mode != B_PRED) {
} else if (cm->txfm_mode >= ALLOW_8X8 && m->mbmi.mode != I4X4_PRED) {
m->mbmi.txfm_size = TX_8X8;
} else {
m->mbmi.txfm_size = TX_4X4;
......@@ -1065,8 +1065,8 @@ static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
pbi->common.fc.ymode_counts[mbmi->mode]++;
}
// If MB mode is BPRED read the block modes
if (mbmi->mode == B_PRED) {
// If MB mode is I4X4_PRED read the block modes
if (mbmi->mode == I4X4_PRED) {
int j = 0;
do {
int m = read_bmode(bc, pbi->common.fc.bmode_prob);
......@@ -1120,7 +1120,7 @@ static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
(mbmi->ref_frame != INTRA_FRAME && mbmi->mode != SPLITMV))) {
mbmi->txfm_size = TX_16X16;
} else if (cm->txfm_mode >= ALLOW_8X8 &&
(!(mbmi->ref_frame == INTRA_FRAME && mbmi->mode == B_PRED) &&
(!(mbmi->ref_frame == INTRA_FRAME && mbmi->mode == I4X4_PRED) &&
!(mbmi->ref_frame != INTRA_FRAME && mbmi->mode == SPLITMV &&
mbmi->partitioning == PARTITIONING_4X4))) {
mbmi->txfm_size = TX_8X8;
......
......@@ -369,7 +369,7 @@ static void decode_4x4(VP9D_COMP *pbi, MACROBLOCKD *xd,
*(b->base_dst) + b->dst, b->dst_stride, b->dst_stride,
xd->plane[2].eobs[i]);
}
} else if (mode == B_PRED) {
} else if (mode == I4X4_PRED) {
for (i = 0; i < 16; i++) {
BLOCKD *b = &xd->block[i];
int b_mode = xd->mode_info_context->bmi[i].as_mode.first;
......@@ -770,7 +770,7 @@ static void decode_mb(VP9D_COMP *pbi, MACROBLOCKD *xd,
vp9_reset_sb_tokens_context(xd, BLOCK_SIZE_MB16X16);
} else if (!bool_error(bc)) {
#if CONFIG_NEWBINTRAMODES
if (mode != B_PRED)
if (mode != I4X4_PRED)
#endif
eobtotal = vp9_decode_tokens(pbi, xd, bc, BLOCK_SIZE_MB16X16);
}
......@@ -781,7 +781,7 @@ static void decode_mb(VP9D_COMP *pbi, MACROBLOCKD *xd,
&pbi->common);
if (eobtotal == 0 &&
mode != B_PRED &&
mode != I4X4_PRED &&
mode != SPLITMV &&
mode != I8X8_PRED &&
!bool_error(bc)) {
......@@ -804,7 +804,7 @@ static void decode_mb(VP9D_COMP *pbi, MACROBLOCKD *xd,
if (xd->mode_info_context->mbmi.ref_frame == INTRA_FRAME) {
if (mode != I8X8_PRED) {
vp9_build_intra_predictors_sbuv_s(xd, BLOCK_SIZE_MB16X16);
if (mode != B_PRED)
if (mode != I4X4_PRED)
vp9_build_intra_predictors_sby_s(xd, BLOCK_SIZE_MB16X16);
}
} else {
......
......@@ -824,7 +824,7 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m,
else
write_ymode(bc, mode, pc->fc.ymode_prob);
if (mode == B_PRED) {
if (mode == I4X4_PRED) {
int j = 0;
do {
write_bmode(bc, m->bmi[j].as_mode.first,
......@@ -1042,7 +1042,7 @@ static void write_mb_modes_kf(const VP9_COMP *cpi,
c->kf_ymode_prob[c->kf_ymode_probs_index]);
}
if (ym == B_PRED) {
if (ym == I4X4_PRED) {
int i = 0;
do {
const B_PREDICTION_MODE A = above_block_mode(m, i, mis);
......
......@@ -463,7 +463,7 @@ static void update_state(VP9_COMP *cpi,
ctx->txfm_rd_diff[ALLOW_32X32] = ctx->txfm_rd_diff[ALLOW_16X16];
}
if (mb_mode == B_PRED) {
if (mb_mode == I4X4_PRED) {
for (i = 0; i < 16; i++) {
xd->block[i].bmi.as_mode = xd->mode_info_context->bmi[i].as_mode;
assert(xd->block[i].bmi.as_mode.first < B_MODE_COUNT);
......@@ -495,7 +495,7 @@ static void update_state(VP9_COMP *cpi,
if (cpi->common.frame_type == KEY_FRAME) {
// Restore the coding modes to that held in the coding context
// if (mb_mode == B_PRED)
// if (mb_mode == I4X4_PRED)
// for (i = 0; i < 16; i++)
// {
// xd->block[i].bmi.as_mode =
......@@ -515,7 +515,7 @@ static void update_state(VP9_COMP *cpi,
THR_D63_PRED /*D63_PRED*/,
THR_TM /*TM_PRED*/,
THR_I8X8_PRED /*I8X8_PRED*/,
THR_B_PRED /*B_PRED*/,
THR_B_PRED /*I4X4_PRED*/,
};
cpi->mode_chosen_counts[kf_mode_index[mb_mode]]++;
#endif
......@@ -1671,7 +1671,7 @@ static void sum_intra_stats(VP9_COMP *cpi, MACROBLOCK *x) {
++ (is_key ? uv_modes : inter_uv_modes)[uvm];
++ uv_modes_y[m][uvm];
if (m == B_PRED) {
if (m == I4X4_PRED) {
unsigned int *const bct = is_key ? b_modes : inter_b_modes;
int b = 0;
......@@ -1702,7 +1702,7 @@ static void sum_intra_stats(VP9_COMP *cpi, MACROBLOCK *x) {
cpi->i8x8_mode_count[xd->block[8].bmi.as_mode.first]++;
cpi->i8x8_mode_count[xd->block[10].bmi.as_mode.first]++;
}
if (m == B_PRED) {
if (m == I4X4_PRED) {
int b = 0;
do {
int m = xd->block[b].bmi.as_mode.first;
......@@ -1934,7 +1934,7 @@ static void encode_macroblock(VP9_COMP *cpi, TOKENEXTRA **t,
mbmi->txfm_size);
}
#endif
if (mbmi->mode == B_PRED) {
if (mbmi->mode == I4X4_PRED) {
vp9_encode_intra16x16mbuv(cm, x);
vp9_encode_intra4x4mby(x);
} else if (mbmi->mode == I8X8_PRED) {
......@@ -2098,7 +2098,7 @@ static void encode_macroblock(VP9_COMP *cpi, TOKENEXTRA **t,
!((cpi->common.mb_no_coeff_skip && mbmi->mb_skip_coeff) ||
(vp9_segfeature_active(&x->e_mbd, segment_id, SEG_LVL_SKIP)))) {
assert(mbmi->txfm_size <= TX_16X16);
if (mbmi->mode != B_PRED && mbmi->mode != I8X8_PRED &&
if (mbmi->mode != I4X4_PRED && mbmi->mode != I8X8_PRED &&
mbmi->mode != SPLITMV) {
cpi->txfm_count_16x16p[mbmi->txfm_size]++;
} else if (mbmi->mode == I8X8_PRED ||
......@@ -2106,10 +2106,10 @@ static void encode_macroblock(VP9_COMP *cpi, TOKENEXTRA **t,
mbmi->partitioning != PARTITIONING_4X4)) {
cpi->txfm_count_8x8p[mbmi->txfm_size]++;
}
} else if (mbmi->mode != B_PRED && mbmi->mode != I8X8_PRED &&
} else if (mbmi->mode != I4X4_PRED && mbmi->mode != I8X8_PRED &&
mbmi->mode != SPLITMV && cpi->common.txfm_mode >= ALLOW_16X16) {
mbmi->txfm_size = TX_16X16;
} else if (mbmi->mode != B_PRED &&
} else if (mbmi->mode != I4X4_PRED &&
!(mbmi->mode == SPLITMV &&
mbmi->partitioning == PARTITIONING_4X4) &&
cpi->common.txfm_mode >= ALLOW_8X8) {
......
......@@ -555,7 +555,7 @@ static void set_default_lf_deltas(VP9_COMP *cpi) {
cpi->mb.e_mbd.ref_lf_deltas[GOLDEN_FRAME] = -2;
cpi->mb.e_mbd.ref_lf_deltas[ALTREF_FRAME] = -2;
cpi->mb.e_mbd.mode_lf_deltas[0] = 4; // BPRED
cpi->mb.e_mbd.mode_lf_deltas[0] = 4; // I4X4_PRED
cpi->mb.e_mbd.mode_lf_deltas[1] = -2; // Zero
cpi->mb.e_mbd.mode_lf_deltas[2] = 2; // New mv
cpi->mb.e_mbd.mode_lf_deltas[3] = 4; // Split mv
......
......@@ -84,7 +84,7 @@ typedef struct {
// 0 = Intra, Last, GF, ARF
signed char last_ref_lf_deltas[MAX_REF_LF_DELTAS];
// 0 = BPRED, ZERO_MV, MV, SPLIT
// 0 = I4X4_PRED, ZERO_MV, MV, SPLIT
signed char last_mode_lf_deltas[MAX_MODE_LF_DELTAS];
vp9_coeff_probs coef_probs_4x4[BLOCK_TYPES];
......
......@@ -104,7 +104,7 @@ const MODE_DEFINITION vp9_mode_order[MAX_MODES] = {
{SPLITMV, GOLDEN_FRAME, NONE},
{SPLITMV, ALTREF_FRAME, NONE},
{B_PRED, INTRA_FRAME, NONE},
{I4X4_PRED, INTRA_FRAME, NONE},
{I8X8_PRED, INTRA_FRAME, NONE},
/* compound prediction modes */
......@@ -1026,7 +1026,7 @@ static int64_t rd_pick_intra4x4mby_modes(VP9_COMP *cpi, MACROBLOCK *mb,
int *Distortion, int64_t best_rd) {
int i;
MACROBLOCKD *const xd = &mb->e_mbd;
int cost = mb->mbmode_cost [xd->frame_type] [B_PRED];
int cost = mb->mbmode_cost[xd->frame_type][I4X4_PRED];
int distortion = 0;
int tot_rate_y = 0;
int64_t total_rd = 0;
......@@ -1042,7 +1042,7 @@ static int64_t rd_pick_intra4x4mby_modes(VP9_COMP *cpi, MACROBLOCK *mb,
ta = (ENTROPY_CONTEXT *)&t_above;
tl = (ENTROPY_CONTEXT *)&t_left;
xd->mode_info_context->mbmi.mode = B_PRED;
xd->mode_info_context->mbmi.mode = I4X4_PRED;
bmode_costs = mb->inter_bmode_costs;
for (i = 0; i < 16; i++) {
......@@ -3726,11 +3726,11 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
skippable = skippable &&
uv_intra_skippable[mbmi->txfm_size != TX_4X4];
break;
case B_PRED: {
case I4X4_PRED: {
int64_t tmp_rd;
// Note the rate value returned here includes the cost of coding
// the BPRED mode : x->mbmode_cost[xd->frame_type][BPRED];
// the I4X4_PRED mode : x->mbmode_cost[xd->frame_type][I4X4_PRED];
mbmi->txfm_size = TX_4X4;
tmp_rd = rd_pick_intra4x4mby_modes(cpi, x, &rate, &rate_y,
&distortion, best_yrd);
......@@ -4042,9 +4042,9 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
// Note index of best mode so far
best_mode_index = mode_index;
if (this_mode <= B_PRED) {
if (this_mode <= I4X4_PRED) {
if (mbmi->txfm_size != TX_4X4
&& this_mode != B_PRED
&& this_mode != I4X4_PRED
&& this_mode != I8X8_PRED)
mbmi->uv_mode = uv_intra_mode[TX_8X8];
else
......@@ -4065,7 +4065,7 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
vpx_memcpy(&best_mbmode, mbmi, sizeof(MB_MODE_INFO));
vpx_memcpy(&best_partition, x->partition_info, sizeof(PARTITION_INFO));
if ((this_mode == B_PRED)
if ((this_mode == I4X4_PRED)
|| (this_mode == I8X8_PRED)
|| (this_mode == SPLITMV))
for (i = 0; i < 16; i++) {
......@@ -4124,7 +4124,7 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
if (!mode_excluded && this_rd != INT64_MAX) {
for (i = 0; i < NB_TXFM_MODES; i++) {
int64_t adj_rd;
if (this_mode != B_PRED) {
if (this_mode != I4X4_PRED) {
const int64_t txfm_mode_diff =
txfm_cache[i] - txfm_cache[cm->txfm_mode];
adj_rd = this_rd + txfm_mode_diff;
......@@ -4142,7 +4142,7 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
assert((cm->mcomp_filter_type == SWITCHABLE) ||
(cm->mcomp_filter_type == best_mbmode.interp_filter) ||
(best_mbmode.mode <= B_PRED));
(best_mbmode.mode <= I4X4_PRED));
#if CONFIG_COMP_INTERINTRA_PRED
++cpi->interintra_select_count[is_best_interintra];
......@@ -4196,7 +4196,7 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
// macroblock modes
vpx_memcpy(mbmi, &best_mbmode, sizeof(MB_MODE_INFO));
if (best_mbmode.mode == B_PRED) {
if (best_mbmode.mode == I4X4_PRED) {
for (i = 0; i < 16; i++) {
xd->mode_info_context->bmi[i].as_mode = best_bmodes[i].as_mode;
xd->block[i].bmi.as_mode = xd->mode_info_context->bmi[i].as_mode;
......@@ -4376,7 +4376,7 @@ void vp9_rd_pick_intra_mode(VP9_COMP *cpi, MACROBLOCK *x,
} else if (error8x8 > error16x16) {
if (error4x4 < error16x16) {
rate = rateuv[TX_4X4] + rate4x4;
mbmi->mode = B_PRED;
mbmi->mode = I4X4_PRED;
mbmi->txfm_size = TX_4X4;
dist = dist4x4 + (distuv[TX_4X4] >> 2);
mbmi->uv_mode = modeuv[TX_4X4];
......@@ -4392,7 +4392,7 @@ void vp9_rd_pick_intra_mode(VP9_COMP *cpi, MACROBLOCK *x,
} else {
if (error4x4 < error8x8) {
rate = rateuv[TX_4X4] + rate4x4;
mbmi->mode = B_PRED;
mbmi->mode = I4X4_PRED;
mbmi->txfm_size = TX_4X4;
dist = dist4x4 + (distuv[TX_4X4] >> 2);
mbmi->uv_mode = modeuv[TX_4X4];
......@@ -4543,7 +4543,9 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
// if (!(cpi->ref_frame_flags & flag_list[ref_frame]))
// continue;
if (this_mode == I8X8_PRED || this_mode == B_PRED || this_mode == SPLITMV)
if (this_mode == I8X8_PRED ||
this_mode == I4X4_PRED ||
this_mode == SPLITMV)
continue;
// if (vp9_mode_order[mode_index].second_ref_frame == INTRA_FRAME)
// continue;
......@@ -4765,7 +4767,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
// Note index of best mode so far
best_mode_index = mode_index;
if (this_mode <= B_PRED) {
if (this_mode <= I4X4_PRED) {
/* required for left and above block mv */
mbmi->mv[0].as_int = 0;
}
......@@ -4831,7 +4833,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
if (!mode_excluded && this_rd != INT64_MAX) {
for (i = 0; i < NB_TXFM_MODES; i++) {
int64_t adj_rd;
if (this_mode != B_PRED) {
if (this_mode != I4X4_PRED) {
adj_rd = this_rd + txfm_cache[i] - txfm_cache[cm->txfm_mode];
} else {
adj_rd = this_rd;
......@@ -4847,7 +4849,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
assert((cm->mcomp_filter_type == SWITCHABLE) ||
(cm->mcomp_filter_type == best_mbmode.interp_filter) ||
(best_mbmode.mode <= B_PRED));
(best_mbmode.mode <= I4X4_PRED));
#if CONFIG_COMP_INTERINTRA_PRED
++cpi->interintra_select_count[is_best_interintra];
......
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