ref: 9da4cd94f561903272d23d500279ff39497e16fc
parent: 82481405ab7db2f2b0bd720d966f14c682308c92
parent: 1a8d45f309504aab820cd86ecb1e0270bcd0693a
author: Jingning Han <[email protected]>
date: Mon Aug 11 04:53:25 EDT 2014
Merge "Extend skip_txfm flag into array to cover YUV planes"
--- a/vp9/encoder/vp9_block.h
+++ b/vp9/encoder/vp9_block.h
@@ -115,7 +115,7 @@
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];
--- a/vp9/encoder/vp9_context_tree.h
+++ b/vp9/encoder/vp9_context_tree.h
@@ -33,7 +33,7 @@
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;
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -1319,7 +1319,7 @@
}
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,
@@ -2752,7 +2752,7 @@
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) {
@@ -2837,7 +2837,7 @@
&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);
@@ -2849,7 +2849,7 @@
&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) {
@@ -2881,7 +2881,7 @@
&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) {
@@ -2890,7 +2890,7 @@
&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;
@@ -2981,7 +2981,7 @@
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:
@@ -2988,13 +2988,13 @@
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) {
@@ -3007,13 +3007,13 @@
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) {
@@ -3322,7 +3322,7 @@
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.
--- a/vp9/encoder/vp9_encodemb.c
+++ b/vp9/encoder/vp9_encodemb.c
@@ -475,7 +475,7 @@
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)
@@ -483,7 +483,7 @@
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 {
--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -212,11 +212,11 @@
*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 @@
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 @@
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 @@
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 @@
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 @@
mbmi->uv_mode = this_mode;
mbmi->mv[0].as_int = INVALID_MV;
} else {
- x->skip_txfm = skip_txfm;
+ x->skip_txfm[0] = skip_txfm;
}
}
}