Commit d25ef8c6 authored by Sarah Parker's avatar Sarah Parker

Change rectangular vartx recursion depth to 2

0.15% improvement on lowres set

Change-Id: If16a8e07797c64508f9e2d9b26ae874ac53c57a4
parent 415c8f1f
......@@ -78,6 +78,8 @@ extern "C" {
#if CONFIG_VAR_TX
#define MAX_VARTX_DEPTH 2
#define SQR_VARTX_DEPTH_INIT 0
#define RECT_VARTX_DEPTH_INIT 0
#endif
#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
......
......@@ -2917,12 +2917,14 @@ static void read_inter_frame_mode_info(AV1Decoder *const pbi,
const int width = block_size_wide[bsize] >> tx_size_wide_log2[0];
const int height = block_size_high[bsize] >> tx_size_wide_log2[0];
int idx, idy;
int init_depth =
(height != width) ? RECT_VARTX_DEPTH_INIT : SQR_VARTX_DEPTH_INIT;
mbmi->min_tx_size = TX_SIZES_ALL;
for (idy = 0; idy < height; idy += bh)
for (idx = 0; idx < width; idx += bw)
read_tx_size_vartx(cm, xd, mbmi, xd->counts, max_tx_size,
height != width, idy, idx, r);
read_tx_size_vartx(cm, xd, mbmi, xd->counts, max_tx_size, init_depth,
idy, idx, r);
#if CONFIG_RECT_TX_EXT
if (is_quarter_tx_allowed(xd, mbmi, inter_block) &&
mbmi->tx_size == max_tx_size) {
......
......@@ -1765,11 +1765,13 @@ static void pack_inter_mode_mvs(AV1_COMP *cpi, const int mi_row,
const int bw = tx_size_wide_unit[max_tx_size];
const int width = block_size_wide[bsize] >> tx_size_wide_log2[0];
const int height = block_size_high[bsize] >> tx_size_wide_log2[0];
int init_depth =
(height != width) ? RECT_VARTX_DEPTH_INIT : SQR_VARTX_DEPTH_INIT;
int idx, idy;
for (idy = 0; idy < height; idy += bh)
for (idx = 0; idx < width; idx += bw)
write_tx_size_vartx(cm, xd, mbmi, max_tx_size, height != width, idy,
idx, w);
write_tx_size_vartx(cm, xd, mbmi, max_tx_size, init_depth, idy, idx,
w);
#if CONFIG_RECT_TX_EXT
if (is_quarter_tx_allowed(xd, mbmi, is_inter_block(mbmi)) &&
quarter_txsize_lookup[bsize] != max_tx_size &&
......
......@@ -6072,6 +6072,8 @@ static void tx_partition_count_update(const AV1_COMMON *const cm, MACROBLOCK *x,
const int bh = tx_size_high_unit[max_tx_size];
const int bw = tx_size_wide_unit[max_tx_size];
int idx, idy;
int init_depth =
(mi_height != mi_width) ? RECT_VARTX_DEPTH_INIT : SQR_VARTX_DEPTH_INIT;
xd->above_txfm_context =
cm->above_txfm_context + (mi_col << TX_UNIT_WIDE_LOG2);
......@@ -6080,8 +6082,7 @@ static void tx_partition_count_update(const AV1_COMMON *const cm, MACROBLOCK *x,
for (idy = 0; idy < mi_height; idy += bh)
for (idx = 0; idx < mi_width; idx += bw)
update_txfm_count(x, xd, td_counts, max_tx_size, mi_width != mi_height,
idy, idx);
update_txfm_count(x, xd, td_counts, max_tx_size, init_depth, idy, idx);
}
static void set_txfm_context(MACROBLOCKD *xd, TX_SIZE tx_size, int blk_row,
......
......@@ -4991,6 +4991,8 @@ static void inter_block_yrd(const AV1_COMP *cpi, MACROBLOCK *x,
const int bw = tx_size_wide_unit[max_tx_size];
int idx, idy;
int block = 0;
int init_depth =
(mi_height != mi_width) ? RECT_VARTX_DEPTH_INIT : SQR_VARTX_DEPTH_INIT;
int step = tx_size_wide_unit[max_tx_size] * tx_size_high_unit[max_tx_size];
ENTROPY_CONTEXT ctxa[2 * MAX_MIB_SIZE];
ENTROPY_CONTEXT ctxl[2 * MAX_MIB_SIZE];
......@@ -5006,10 +5008,9 @@ static void inter_block_yrd(const AV1_COMP *cpi, MACROBLOCK *x,
for (idy = 0; idy < mi_height; idy += bh) {
for (idx = 0; idx < mi_width; idx += bw) {
select_tx_block(cpi, x, idy, idx, 0, block, max_tx_size,
mi_height != mi_width, plane_bsize, ctxa, ctxl,
tx_above, tx_left, &pn_rd_stats, ref_best_rd - this_rd,
&is_cost_valid);
select_tx_block(cpi, x, idy, idx, 0, block, max_tx_size, init_depth,
plane_bsize, ctxa, ctxl, tx_above, tx_left,
&pn_rd_stats, ref_best_rd - this_rd, &is_cost_valid);
if (pn_rd_stats.rate == INT_MAX) {
av1_invalid_rd_stats(rd_stats);
return;
......
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