Extend skip_txfm flag into array to cover YUV planes

Change-Id: Ieae182d72d625d0d3fd4ed7c7d24cb521a0f21b0
This commit is contained in:
Jingning Han 2014-08-05 15:42:12 -07:00
parent 3cf5908e24
commit 1a8d45f309
5 changed files with 24 additions and 24 deletions

View File

@ -115,7 +115,7 @@ struct macroblock {
int quant_fp;
// skip forward transform and quantization
int skip_txfm;
int skip_txfm[MAX_MB_PLANE];
// Used to store sub partition's choices.
MV pred_mv[MAX_REF_FRAMES];

View File

@ -33,7 +33,7 @@ typedef struct {
int is_coded;
int num_4x4_blk;
int skip;
int skip_txfm;
int skip_txfm[MAX_MB_PLANE];
int best_mode_index;
int hybrid_pred_diff;
int comp_pred_diff;

View File

@ -1321,7 +1321,7 @@ static void update_state_rt(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx,
}
x->skip = ctx->skip;
x->skip_txfm = mbmi->segment_id ? 0 : ctx->skip_txfm;
x->skip_txfm[0] = mbmi->segment_id ? 0 : ctx->skip_txfm[0];
}
static void encode_b_rt(VP9_COMP *cpi, const TileInfo *const tile,
@ -2650,7 +2650,7 @@ static void nonrd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col,
&this_rate, &this_dist, bsize, ctx);
ctx->mic.mbmi = xd->mi[0]->mbmi;
ctx->skip_txfm = x->skip_txfm;
ctx->skip_txfm[0] = x->skip_txfm[0];
ctx->skip = x->skip;
if (this_rate != INT_MAX) {
@ -2735,7 +2735,7 @@ static void nonrd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
&pc_tree->horizontal[0]);
pc_tree->horizontal[0].mic.mbmi = xd->mi[0]->mbmi;
pc_tree->horizontal[0].skip_txfm = x->skip_txfm;
pc_tree->horizontal[0].skip_txfm[0] = x->skip_txfm[0];
pc_tree->horizontal[0].skip = x->skip;
sum_rd = RDCOST(x->rdmult, x->rddiv, sum_rate, sum_dist);
@ -2747,7 +2747,7 @@ static void nonrd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
&pc_tree->horizontal[1]);
pc_tree->horizontal[1].mic.mbmi = xd->mi[0]->mbmi;
pc_tree->horizontal[1].skip_txfm = x->skip_txfm;
pc_tree->horizontal[1].skip_txfm[0] = x->skip_txfm[0];
pc_tree->horizontal[1].skip = x->skip;
if (this_rate == INT_MAX) {
@ -2779,7 +2779,7 @@ static void nonrd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
&this_rate, &this_dist, subsize,
&pc_tree->vertical[0]);
pc_tree->vertical[0].mic.mbmi = xd->mi[0]->mbmi;
pc_tree->vertical[0].skip_txfm = x->skip_txfm;
pc_tree->vertical[0].skip_txfm[0] = x->skip_txfm[0];
pc_tree->vertical[0].skip = x->skip;
sum_rd = RDCOST(x->rdmult, x->rddiv, sum_rate, sum_dist);
if (sum_rd < best_rd && mi_col + ms < cm->mi_cols) {
@ -2788,7 +2788,7 @@ static void nonrd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
&this_rate, &this_dist, subsize,
&pc_tree->vertical[1]);
pc_tree->vertical[1].mic.mbmi = xd->mi[0]->mbmi;
pc_tree->vertical[1].skip_txfm = x->skip_txfm;
pc_tree->vertical[1].skip_txfm[0] = x->skip_txfm[0];
pc_tree->vertical[1].skip = x->skip;
if (this_rate == INT_MAX) {
sum_rd = INT64_MAX;
@ -2879,20 +2879,20 @@ static void nonrd_use_partition(VP9_COMP *cpi,
nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col, totrate, totdist,
subsize, &pc_tree->none);
pc_tree->none.mic.mbmi = xd->mi[0]->mbmi;
pc_tree->none.skip_txfm = x->skip_txfm;
pc_tree->none.skip_txfm[0] = x->skip_txfm[0];
pc_tree->none.skip = x->skip;
break;
case PARTITION_VERT:
nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col, totrate, totdist,
subsize, &pc_tree->vertical[0]);
pc_tree->vertical[0].mic.mbmi = xd->mi[0]->mbmi;
pc_tree->vertical[0].skip_txfm = x->skip_txfm;
pc_tree->vertical[0].skip_txfm[0] = x->skip_txfm[0];
pc_tree->vertical[0].skip = x->skip;
if (mi_col + hbs < cm->mi_cols) {
nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col + hbs,
&rate, &dist, subsize, &pc_tree->vertical[1]);
pc_tree->vertical[1].mic.mbmi = xd->mi[0]->mbmi;
pc_tree->vertical[1].skip_txfm = x->skip_txfm;
pc_tree->vertical[1].skip_txfm[0] = x->skip_txfm[0];
pc_tree->vertical[1].skip = x->skip;
if (rate != INT_MAX && dist != INT64_MAX &&
*totrate != INT_MAX && *totdist != INT64_MAX) {
@ -2905,13 +2905,13 @@ static void nonrd_use_partition(VP9_COMP *cpi,
nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col, totrate, totdist,
subsize, &pc_tree->horizontal[0]);
pc_tree->horizontal[0].mic.mbmi = xd->mi[0]->mbmi;
pc_tree->horizontal[0].skip_txfm = x->skip_txfm;
pc_tree->horizontal[0].skip_txfm[0] = x->skip_txfm[0];
pc_tree->horizontal[0].skip = x->skip;
if (mi_row + hbs < cm->mi_rows) {
nonrd_pick_sb_modes(cpi, tile, mi_row + hbs, mi_col,
&rate, &dist, subsize, &pc_tree->horizontal[0]);
pc_tree->horizontal[1].mic.mbmi = xd->mi[0]->mbmi;
pc_tree->horizontal[1].skip_txfm = x->skip_txfm;
pc_tree->horizontal[1].skip_txfm[0] = x->skip_txfm[0];
pc_tree->horizontal[1].skip = x->skip;
if (rate != INT_MAX && dist != INT64_MAX &&
*totrate != INT_MAX && *totdist != INT64_MAX) {
@ -3218,7 +3218,7 @@ static void encode_frame_internal(VP9_COMP *cpi) {
set_prev_mi(cm);
x->quant_fp = cpi->sf.use_quant_fp;
x->skip_txfm = 0;
vp9_zero(x->skip_txfm);
if (sf->use_nonrd_pick_mode) {
// Initialize internal buffer pointers for rtc coding, where non-RD
// mode decision is used and hence no buffer pointer swap needed.

View File

@ -472,7 +472,7 @@ static void encode_block(int plane, int block, BLOCK_SIZE plane_bsize,
return;
}
if (x->skip_txfm == 0) {
if (x->skip_txfm[plane] == 0) {
// full forward transform and quantization
if (!x->skip_recode) {
if (x->quant_fp)
@ -480,7 +480,7 @@ static void encode_block(int plane, int block, BLOCK_SIZE plane_bsize,
else
vp9_xform_quant(x, plane, block, plane_bsize, tx_size);
}
} else if (x->skip_txfm == 2) {
} else if (x->skip_txfm[plane] == 2) {
// fast path forward transform and quantization
vp9_xform_quant_dc(x, plane, block, plane_bsize, tx_size);
} else {

View File

@ -212,11 +212,11 @@ static void model_rd_for_sb_y(VP9_COMP *cpi, BLOCK_SIZE bsize,
*sse_y = sse;
if (sse < dc_quant * dc_quant >> 6)
x->skip_txfm = 1;
x->skip_txfm[0] = 1;
else if (var < ac_quant * ac_quant >> 6)
x->skip_txfm = 2;
x->skip_txfm[0] = 2;
else
x->skip_txfm = 0;
x->skip_txfm[0] = 0;
if (cpi->common.tx_mode == TX_MODE_SELECT) {
if (sse > (var << 2))
@ -558,7 +558,7 @@ int64_t vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
if (cost < best_cost) {
best_filter = filter;
best_cost = cost;
skip_txfm = x->skip_txfm;
skip_txfm = x->skip_txfm[0];
if (cpi->sf.reuse_inter_pred_sby) {
if (this_mode_pred != current_pred) {
@ -584,7 +584,7 @@ int64_t vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
dist = pf_dist[mbmi->interp_filter];
var_y = pf_var[mbmi->interp_filter];
sse_y = pf_sse[mbmi->interp_filter];
x->skip_txfm = skip_txfm;
x->skip_txfm[0] = skip_txfm;
} else {
mbmi->interp_filter = (filter_ref == SWITCHABLE) ? EIGHTTAP: filter_ref;
vp9_build_inter_predictors_sby(xd, mi_row, mi_col, bsize);
@ -622,7 +622,7 @@ int64_t vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
best_pred_filter = mbmi->interp_filter;
best_tx_size = mbmi->tx_size;
best_ref_frame = ref_frame;
skip_txfm = x->skip_txfm;
skip_txfm = x->skip_txfm[0];
if (cpi->sf.reuse_inter_pred_sby) {
if (best_pred != NULL)
@ -664,7 +664,7 @@ int64_t vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
mbmi->ref_frame[0] = best_ref_frame;
mbmi->mv[0].as_int = frame_mv[best_mode][best_ref_frame].as_int;
xd->mi[0]->bmi[0].as_mv[0].as_int = mbmi->mv[0].as_int;
x->skip_txfm = skip_txfm;
x->skip_txfm[0] = skip_txfm;
// Perform intra prediction search, if the best SAD is above a certain
// threshold.
@ -726,7 +726,7 @@ int64_t vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
mbmi->uv_mode = this_mode;
mbmi->mv[0].as_int = INVALID_MV;
} else {
x->skip_txfm = skip_txfm;
x->skip_txfm[0] = skip_txfm;
}
}
}