Commit a9eae87e authored by Jingning Han's avatar Jingning Han
Browse files

Refactor transform block operating loop

Control the loop over transform blocks in the unit of smallest
transform block size. This would provide scalability to support
smaller transform block sizes.

Change-Id: I6a8167cf91f71c5d4af4e244c628f378866a607c
parent 48876390
......@@ -14,6 +14,7 @@
#include "aom_ports/system_state.h"
#include "av1/common/blockd.h"
#include "av1/common/onyxc_int.h"
PREDICTION_MODE av1_left_block_mode(const MODE_INFO *cur_mi,
const MODE_INFO *left_mi, int b) {
......@@ -130,8 +131,6 @@ void av1_foreach_transformed_block_in_plane(
// transform size varies per plane, look it up in a common way.
const TX_SIZE tx_size = plane ? get_uv_tx_size(mbmi, pd) : mbmi->tx_size;
const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
const int num_4x4_w = block_size_wide[plane_bsize];
const int num_4x4_h = block_size_high[plane_bsize];
const uint8_t txw_unit = tx_size_wide_unit[tx_size];
const uint8_t txh_unit = tx_size_high_unit[tx_size];
const int step = txw_unit * txh_unit;
......@@ -140,19 +139,8 @@ void av1_foreach_transformed_block_in_plane(
// If mb_to_right_edge is < 0 we are in a situation in which
// the current block size extends into the UMV and we won't
// visit the sub blocks that are wholly within the UMV.
int max_blocks_wide =
num_4x4_w + (xd->mb_to_right_edge >= 0 ? 0 : xd->mb_to_right_edge >>
(3 + pd->subsampling_x));
int max_blocks_high =
num_4x4_h + (xd->mb_to_bottom_edge >= 0
? 0
: xd->mb_to_bottom_edge >> (3 + pd->subsampling_y));
const int extra_step =
((num_4x4_w - max_blocks_wide) >> tx_size_wide_log2[tx_size]) * step;
// Scale to the transform block unit.
max_blocks_wide >>= tx_size_wide_log2[0];
max_blocks_high >>= tx_size_high_log2[0];
const int max_blocks_wide = max_block_wide(xd, plane_bsize, plane);
const int max_blocks_high = max_block_high(xd, plane_bsize, plane);
// Keep track of the row and column of the blocks we use so that we know
// if we are in the unrestricted motion border.
......@@ -162,7 +150,6 @@ void av1_foreach_transformed_block_in_plane(
visit(plane, i, r, c, plane_bsize, tx_size, arg);
i += step;
}
i += extra_step;
}
}
......
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