Commit 4093192e authored by Jingning Han's avatar Jingning Han
Browse files

Change b_mode_info definition from union to struct

This commit defines b_mode_info as a struct type. This will allow
us to further remove the use of PARTITION_INFO in the encoding process.

Change-Id: I975b0f7d557b5e0f66545a61b472def76b671cce
parent 793c2d84
......@@ -101,10 +101,10 @@ static INLINE int inter_mode_offset(MB_PREDICTION_MODE mode) {
modes for the Y blocks to the left and above us; for interframes, there
is a single probability table. */
union b_mode_info {
typedef struct {
MB_PREDICTION_MODE as_mode;
int_mv as_mv[2]; // first, second inter predictor motion vectors
};
} b_mode_info;
typedef enum {
NONE = -1,
......@@ -154,7 +154,7 @@ typedef struct {
typedef struct {
MB_MODE_INFO mbmi;
union b_mode_info bmi[4];
b_mode_info bmi[4];
} MODE_INFO;
static INLINE int is_inter_block(const MB_MODE_INFO *mbmi) {
......
......@@ -57,7 +57,7 @@ void vp9_append_sub8x8_mvs_for_idx(VP9_COMMON *cm, MACROBLOCKD *xd,
vpx_memcpy(dst_list, mv_list, MAX_MV_REF_CANDIDATES * sizeof(int_mv));
} else if (block_idx == 1 || block_idx == 2) {
int dst = 0, n;
union b_mode_info *bmi = mi->bmi;
b_mode_info *bmi = mi->bmi;
dst_list[dst++].as_int = bmi[0].as_mv[ref_idx].as_int;
for (n = 0; dst < MAX_MV_REF_CANDIDATES &&
......@@ -66,7 +66,7 @@ void vp9_append_sub8x8_mvs_for_idx(VP9_COMMON *cm, MACROBLOCKD *xd,
dst_list[dst++].as_int = mv_list[n].as_int;
} else {
int dst = 0, n;
union b_mode_info *bmi = mi->bmi;
b_mode_info *bmi = mi->bmi;
assert(block_idx == 3);
dst_list[dst++].as_int = bmi[2].as_mv[ref_idx].as_int;
......
......@@ -3857,7 +3857,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
int intra_cost_penalty = 20 * vp9_dc_quant(cpi->common.base_qindex,
cpi->common.y_dc_delta_q);
int_mv seg_mvs[4][MAX_REF_FRAMES];
union b_mode_info best_bmodes[4];
b_mode_info best_bmodes[4];
PARTITION_INFO best_partition;
int best_skip2 = 0;
unsigned char best_zcoeff_blk[256] = { 0 };
......@@ -4100,7 +4100,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
int switchable_filter_index;
int_mv *second_ref = is_comp_pred ?
&mbmi->ref_mvs[second_ref_frame][0] : NULL;
union b_mode_info tmp_best_bmodes[16];
b_mode_info tmp_best_bmodes[16];
MB_MODE_INFO tmp_best_mbmode;
PARTITION_INFO tmp_best_partition;
BEST_SEG_INFO bsi[SWITCHABLE_FILTERS];
......@@ -4364,7 +4364,8 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
// TODO(debargha): enhance this test with a better distortion prediction
// based on qp, activity mask and history
if (cpi->sf.mode_search_skip_flags & FLAG_EARLY_TERMINATE) {
if ((cpi->sf.mode_search_skip_flags & FLAG_EARLY_TERMINATE) &&
(mode_index > MIN_EARLY_TERM_INDEX)) {
const int qstep = xd->plane[0].dequant[1];
// TODO(debargha): Enhance this by specializing for each mode_index
int scale = 4;
......
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