Commit 92922be8 authored by Geza Lore's avatar Geza Lore

Remove skip_txfm optimization.

Commit 0d6980d7 removed some use
of the skip_txfm optimization, and the rest are not productive.

The current use of this optimization is only used with --good
and --cpu-used >= 3, however the overhead of this is higher than the
speedup it yields.

Removing this, and subsequently simplifying model_rd_for_sb yields
a net encoder speedup:
--cpu-used=0    ~1.5% faster
--cpu-used=3    ~2.0% faster

The code simplification is also significant.

Change-Id: I1dd668c32de15a2e912c59c42379d0f9e1032ff8
parent 7458f117
......@@ -165,14 +165,6 @@ struct macroblock {
// use fast quantization process
int quant_fp;
// skip forward transform and quantization
uint8_t skip_txfm[MAX_MB_PLANE][MAX_TX_BLOCKS_IN_MAX_SB];
#define SKIP_TXFM_NONE 0
#define SKIP_TXFM_AC_DC 1
#define SKIP_TXFM_AC_ONLY 2
int64_t bsse[MAX_MB_PLANE][MAX_TX_BLOCKS_IN_MAX_SB];
// Used to store sub partition's choices.
MV pred_mv[MAX_REF_FRAMES];
......
......@@ -2294,8 +2294,6 @@ static void encode_sb(VP10_COMP *cpi, ThreadData *td,
set_segment_id_supertx(cpi, x, mi_row, mi_col, bsize);
if (!x->skip) {
memset(x->skip_txfm, 0, sizeof(x->skip_txfm));
x->skip_optimize = 0;
x->use_lp32x32fdct = cpi->sf.use_lp32x32fdct;
......@@ -4608,7 +4606,6 @@ static void encode_frame_internal(VP10_COMP *cpi) {
cm->prev_mip + cm->mi_stride + 1 : NULL;
x->quant_fp = cpi->sf.use_quant_fp;
vp10_zero(x->skip_txfm);
#if CONFIG_VAR_TX
#if CONFIG_REF_MV
vp10_zero(x->blk_skip_drl);
......@@ -4990,8 +4987,6 @@ static void encode_superblock(VP10_COMP *cpi, ThreadData *td,
const int mi_width = num_8x8_blocks_wide_lookup[bsize];
const int mi_height = num_8x8_blocks_high_lookup[bsize];
memset(x->skip_txfm, 0, sizeof(x->skip_txfm));
x->skip_optimize = ctx->is_coded;
ctx->is_coded = 1;
x->use_lp32x32fdct = cpi->sf.use_lp32x32fdct;
......@@ -6107,13 +6102,6 @@ static void rd_supertx_sb(VP10_COMP *cpi, ThreadData *td,
set_offsets_without_segment_id(cpi, tile, x, mi_row, mi_col, bsize);
set_segment_id_supertx(cpi, x, mi_row, mi_col, bsize);
// These skip_txfm flags are previously set by the non-supertx RD search.
// vp10_txfm_rd_in_plane_supertx calls block_rd_txfm, which checks these
// to reuse distortion values from the RD estimation, so we reset these
// flags here before evaluating RD for supertx coding.
for (plane = 0 ; plane < MAX_MB_PLANE ; plane++)
x->skip_txfm[plane][0] = SKIP_TXFM_NONE;
mbmi = &xd->mi[0]->mbmi;
best_tx_nostx = mbmi->tx_type;
......
......@@ -998,61 +998,13 @@ static void encode_block(int plane, int block, int blk_row, int blk_col,
#else
{
#endif
if (x->quant_fp) {
// Encoding process for rtc mode
if (x->skip_txfm[0][0] == SKIP_TXFM_AC_DC && plane == 0) {
// skip forward transform
p->eobs[block] = 0;
*a = *l = 0;
return;
} else {
#if CONFIG_NEW_QUANT
vp10_xform_quant_fp_nuq(x, plane, block, blk_row, blk_col, plane_bsize,
tx_size, ctx);
#else
vp10_xform_quant(x, plane, block, blk_row, blk_col, plane_bsize,
tx_size, VP10_XFORM_QUANT_FP);
#endif
}
} else {
if (max_txsize_lookup[plane_bsize] == tx_size) {
int blk_index = (block >> (tx_size << 1));
if (x->skip_txfm[plane][blk_index] == SKIP_TXFM_NONE) {
// full forward transform and quantization
#if CONFIG_NEW_QUANT
vp10_xform_quant_fp_nuq(x, plane, block, blk_row, blk_col,
plane_bsize, tx_size, ctx);
#else
vp10_xform_quant(x, plane, block, blk_row, blk_col, plane_bsize,
tx_size, VP10_XFORM_QUANT_FP);
#endif // CONFIG_NEW_QUANT
} else if (x->skip_txfm[plane][blk_index] == SKIP_TXFM_AC_ONLY) {
// fast path forward transform and quantization
#if CONFIG_NEW_QUANT
vp10_xform_quant_dc_fp_nuq(x, plane, block, blk_row, blk_col,
plane_bsize, tx_size, ctx);
vp10_xform_quant_fp_nuq(x, plane, block, blk_row, blk_col, plane_bsize,
tx_size, ctx);
#else
vp10_xform_quant(x, plane, block, blk_row, blk_col, plane_bsize,
tx_size, VP10_XFORM_QUANT_DC);
vp10_xform_quant(x, plane, block, blk_row, blk_col, plane_bsize,
tx_size, VP10_XFORM_QUANT_FP);
#endif // CONFIG_NEW_QUANT
} else {
// skip forward transform
p->eobs[block] = 0;
*a = *l = 0;
#if !CONFIG_VAR_TX
return;
#endif
}
} else {
#if CONFIG_NEW_QUANT
vp10_xform_quant_fp_nuq(x, plane, block, blk_row, blk_col, plane_bsize,
tx_size, ctx);
#else
vp10_xform_quant(x, plane, block, blk_row, blk_col, plane_bsize,
tx_size, VP10_XFORM_QUANT_FP);
#endif // CONFIG_NEW_QUANT
}
}
}
#if CONFIG_VAR_TX
else {
......
This diff is collapsed.
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