Commit 6c97bba4 authored by Jingning Han's avatar Jingning Han Committed by Gerrit Code Review
Browse files

Merge "further clean-ups on intra4x4 coding" into experimental

parents 88a4d4c5 4729a6f3
...@@ -402,7 +402,7 @@ void vp9_predict_intra_block(MACROBLOCKD *xd, ...@@ -402,7 +402,7 @@ void vp9_predict_intra_block(MACROBLOCKD *xd,
(block_idx >> bwl) || xd->up_available; (block_idx >> bwl) || xd->up_available;
const int have_left = const int have_left =
(block_idx & wmask) || xd->left_available; (block_idx & wmask) || xd->left_available;
const int have_right = ((block_idx & wmask) != wmask); int have_right = ((block_idx & wmask) != wmask);
const int txfm_block_size = 4 << tx_size; const int txfm_block_size = 4 << tx_size;
assert(bwl >= 0); assert(bwl >= 0);
......
...@@ -117,7 +117,6 @@ struct macroblock { ...@@ -117,7 +117,6 @@ struct macroblock {
int mbmode_cost[2][MB_MODE_COUNT]; int mbmode_cost[2][MB_MODE_COUNT];
int intra_uv_mode_cost[2][MB_MODE_COUNT]; int intra_uv_mode_cost[2][MB_MODE_COUNT];
int bmode_costs[VP9_BINTRAMODES][VP9_BINTRAMODES][VP9_BINTRAMODES]; int bmode_costs[VP9_BINTRAMODES][VP9_BINTRAMODES][VP9_BINTRAMODES];
int inter_bmode_costs[INTRA_MODE_COUNT];
int switchable_interp_costs[VP9_SWITCHABLE_FILTERS + 1] int switchable_interp_costs[VP9_SWITCHABLE_FILTERS + 1]
[VP9_SWITCHABLE_FILTERS]; [VP9_SWITCHABLE_FILTERS];
......
...@@ -614,6 +614,7 @@ static void encode_block_intra(int plane, int block, BLOCK_SIZE_TYPE bsize, ...@@ -614,6 +614,7 @@ static void encode_block_intra(int plane, int block, BLOCK_SIZE_TYPE bsize,
struct encode_b_args* const args = arg; struct encode_b_args* const args = arg;
MACROBLOCK* const x = args->x; MACROBLOCK* const x = args->x;
MACROBLOCKD* const xd = &x->e_mbd; MACROBLOCKD* const xd = &x->e_mbd;
MB_MODE_INFO* const mbmi = &xd->mode_info_context->mbmi;
const TX_SIZE tx_size = (TX_SIZE)(ss_txfrm_size / 2); const TX_SIZE tx_size = (TX_SIZE)(ss_txfrm_size / 2);
const int bw = 4 << (b_width_log2(bsize) - xd->plane[plane].subsampling_x); const int bw = 4 << (b_width_log2(bsize) - xd->plane[plane].subsampling_x);
const int raster_block = txfrm_block_to_raster_block(xd, bsize, plane, const int raster_block = txfrm_block_to_raster_block(xd, bsize, plane,
...@@ -638,9 +639,9 @@ static void encode_block_intra(int plane, int block, BLOCK_SIZE_TYPE bsize, ...@@ -638,9 +639,9 @@ static void encode_block_intra(int plane, int block, BLOCK_SIZE_TYPE bsize,
TX_TYPE tx_type; TX_TYPE tx_type;
int mode, b_mode; int mode, b_mode;
mode = plane == 0? xd->mode_info_context->mbmi.mode: mode = plane == 0? mbmi->mode: mbmi->uv_mode;
xd->mode_info_context->mbmi.uv_mode; if (mbmi->sb_type < BLOCK_SIZE_SB8X8 && plane == 0 &&
if (bsize <= BLOCK_SIZE_SB8X8 && mode == I4X4_PRED && plane == 0) mbmi->ref_frame == INTRA_FRAME)
b_mode = xd->mode_info_context->bmi[ib].as_mode.first; b_mode = xd->mode_info_context->bmi[ib].as_mode.first;
else else
b_mode = mode; b_mode = mode;
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
void vp9_init_mode_costs(VP9_COMP *c) { void vp9_init_mode_costs(VP9_COMP *c) {
VP9_COMMON *x = &c->common; VP9_COMMON *x = &c->common;
const vp9_tree_p T = vp9_bmode_tree;
const vp9_tree_p KT = vp9_bmode_tree; const vp9_tree_p KT = vp9_bmode_tree;
int i, j; int i, j;
...@@ -28,8 +27,6 @@ void vp9_init_mode_costs(VP9_COMP *c) { ...@@ -28,8 +27,6 @@ void vp9_init_mode_costs(VP9_COMP *c) {
} }
} }
vp9_cost_tokens((int *)c->mb.inter_bmode_costs, x->fc.bmode_prob, T);
// TODO(rbultje) separate tables for superblock costing? // TODO(rbultje) separate tables for superblock costing?
vp9_cost_tokens(c->mb.mbmode_cost[1], x->fc.sb_ymode_prob, vp9_cost_tokens(c->mb.mbmode_cost[1], x->fc.sb_ymode_prob,
vp9_sb_ymode_tree); vp9_sb_ymode_tree);
......
...@@ -614,7 +614,6 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib, ...@@ -614,7 +614,6 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
int64_t this_rd; int64_t this_rd;
int ratey = 0; int ratey = 0;
xd->mode_info_context->bmi[ib].as_mode.first = mode;
if (cm->frame_type == KEY_FRAME) if (cm->frame_type == KEY_FRAME)
rate = bmode_costs[mode]; rate = bmode_costs[mode];
else else
...@@ -656,9 +655,6 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib, ...@@ -656,9 +655,6 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
distortion += vp9_block_error(coeff, BLOCK_OFFSET(xd->plane[0].dqcoeff, distortion += vp9_block_error(coeff, BLOCK_OFFSET(xd->plane[0].dqcoeff,
block, 16), 16) >> 2; block, 16), 16) >> 2;
vp9_intra4x4_predict(xd, block, BLOCK_SIZE_SB8X8, mode,
dst, xd->plane[0].dst.stride);
if (best_tx_type != DCT_DCT) if (best_tx_type != DCT_DCT)
vp9_short_iht4x4_add(BLOCK_OFFSET(xd->plane[0].dqcoeff, block, 16), vp9_short_iht4x4_add(BLOCK_OFFSET(xd->plane[0].dqcoeff, block, 16),
dst, xd->plane[0].dst.stride, best_tx_type); dst, xd->plane[0].dst.stride, best_tx_type);
...@@ -734,7 +730,7 @@ static int64_t rd_pick_intra4x4mby_modes(VP9_COMP *cpi, MACROBLOCK *mb, ...@@ -734,7 +730,7 @@ static int64_t rd_pick_intra4x4mby_modes(VP9_COMP *cpi, MACROBLOCK *mb,
vpx_memcpy(t_left, xd->plane[0].left_context, sizeof(t_left)); vpx_memcpy(t_left, xd->plane[0].left_context, sizeof(t_left));
xd->mode_info_context->mbmi.mode = I4X4_PRED; xd->mode_info_context->mbmi.mode = I4X4_PRED;
bmode_costs = mb->inter_bmode_costs; bmode_costs = mb->mbmode_cost[cpi->common.frame_type];
for (idy = 0; idy < 2; idy += bh) { for (idy = 0; idy < 2; idy += bh) {
for (idx = 0; idx < 2; idx += bw) { for (idx = 0; idx < 2; idx += bw) {
...@@ -2687,8 +2683,6 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, ...@@ -2687,8 +2683,6 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
if (this_mode == I4X4_PRED) { if (this_mode == I4X4_PRED) {
int rate; int rate;
// Note the rate value returned here includes the cost of coding
// the I4X4_PRED mode : x->mbmode_cost[xd->frame_type][I4X4_PRED];
mbmi->txfm_size = TX_4X4; mbmi->txfm_size = TX_4X4;
rd_pick_intra4x4mby_modes(cpi, x, &rate, &rate_y, rd_pick_intra4x4mby_modes(cpi, x, &rate, &rate_y,
&distortion_y, INT64_MAX); &distortion_y, INT64_MAX);
......
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