Renaming BLOCK_SIZE_TYPES constant to BLOCK_SIZES.
There will be another change set to rename BLOCK_SIZE_TYPE enum to BLOCK_SIZE. Change-Id: I8d1dfc873d6186fa5e554262f5169e929978085e
This commit is contained in:
parent
e7c5ca8983
commit
3c43ec206c
@ -39,7 +39,7 @@ TEST_P(VP9SubtractBlockTest, SimpleSubtract) {
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
|
||||
// FIXME(rbultje) split in its own file
|
||||
for (BLOCK_SIZE_TYPE bsize = BLOCK_4X4; bsize < BLOCK_SIZE_TYPES;
|
||||
for (BLOCK_SIZE_TYPE bsize = BLOCK_4X4; bsize < BLOCK_SIZES;
|
||||
bsize = static_cast<BLOCK_SIZE_TYPE>(static_cast<int>(bsize) + 1)) {
|
||||
const int block_width = 4 << b_width_log2(bsize);
|
||||
const int block_height = 4 << b_height_log2(bsize);
|
||||
|
@ -313,8 +313,8 @@ static INLINE int partition_plane_context(MACROBLOCKD *xd,
|
||||
|
||||
static BLOCK_SIZE_TYPE get_subsize(BLOCK_SIZE_TYPE bsize,
|
||||
PARTITION_TYPE partition) {
|
||||
BLOCK_SIZE_TYPE subsize = subsize_lookup[partition][bsize];
|
||||
assert(subsize != BLOCK_SIZE_TYPES);
|
||||
const BLOCK_SIZE_TYPE subsize = subsize_lookup[partition][bsize];
|
||||
assert(subsize < BLOCK_SIZES);
|
||||
return subsize;
|
||||
}
|
||||
|
||||
@ -396,7 +396,7 @@ static BLOCK_SIZE_TYPE get_plane_block_size(BLOCK_SIZE_TYPE bsize,
|
||||
struct macroblockd_plane *pd) {
|
||||
BLOCK_SIZE_TYPE bs = ss_size_lookup[bsize]
|
||||
[pd->subsampling_x][pd->subsampling_y];
|
||||
assert(bs < BLOCK_SIZE_TYPES);
|
||||
assert(bs < BLOCK_SIZES);
|
||||
return bs;
|
||||
}
|
||||
|
||||
|
@ -13,33 +13,33 @@
|
||||
#include "vp9/common/vp9_common_data.h"
|
||||
|
||||
// Log 2 conversion lookup tables for block width and height
|
||||
const int b_width_log2_lookup[BLOCK_SIZE_TYPES] =
|
||||
const int b_width_log2_lookup[BLOCK_SIZES] =
|
||||
{0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4};
|
||||
const int b_height_log2_lookup[BLOCK_SIZE_TYPES] =
|
||||
const int b_height_log2_lookup[BLOCK_SIZES] =
|
||||
{0, 1, 0, 1, 2, 1, 2, 3, 2, 3, 4, 3, 4};
|
||||
const int num_4x4_blocks_wide_lookup[BLOCK_SIZE_TYPES] =
|
||||
const int num_4x4_blocks_wide_lookup[BLOCK_SIZES] =
|
||||
{1, 1, 2, 2, 2, 4, 4, 4, 8, 8, 8, 16, 16};
|
||||
const int num_4x4_blocks_high_lookup[BLOCK_SIZE_TYPES] =
|
||||
const int num_4x4_blocks_high_lookup[BLOCK_SIZES] =
|
||||
{1, 2, 1, 2, 4, 2, 4, 8, 4, 8, 16, 8, 16};
|
||||
// Log 2 conversion lookup tables for modeinfo width and height
|
||||
const int mi_width_log2_lookup[BLOCK_SIZE_TYPES] =
|
||||
const int mi_width_log2_lookup[BLOCK_SIZES] =
|
||||
{0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3};
|
||||
const int num_8x8_blocks_wide_lookup[BLOCK_SIZE_TYPES] =
|
||||
const int num_8x8_blocks_wide_lookup[BLOCK_SIZES] =
|
||||
{1, 1, 1, 1, 1, 2, 2, 2, 4, 4, 4, 8, 8};
|
||||
const int mi_height_log2_lookup[BLOCK_SIZE_TYPES] =
|
||||
const int mi_height_log2_lookup[BLOCK_SIZES] =
|
||||
{0, 0, 0, 0, 1, 0, 1, 2, 1, 2, 3, 2, 3};
|
||||
const int num_8x8_blocks_high_lookup[BLOCK_SIZE_TYPES] =
|
||||
const int num_8x8_blocks_high_lookup[BLOCK_SIZES] =
|
||||
{1, 1, 1, 1, 2, 1, 2, 4, 2, 4, 8, 4, 8};
|
||||
|
||||
// MIN(3, MIN(b_width_log2(bsize), b_height_log2(bsize)))
|
||||
const int size_group_lookup[BLOCK_SIZE_TYPES] =
|
||||
const int size_group_lookup[BLOCK_SIZES] =
|
||||
{0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3};
|
||||
|
||||
const int num_pels_log2_lookup[BLOCK_SIZE_TYPES] =
|
||||
const int num_pels_log2_lookup[BLOCK_SIZES] =
|
||||
{4, 5, 5, 6, 7, 7, 8, 9, 9, 10, 11, 11, 12};
|
||||
|
||||
|
||||
const PARTITION_TYPE partition_lookup[][BLOCK_SIZE_TYPES] = {
|
||||
const PARTITION_TYPE partition_lookup[][BLOCK_SIZES] = {
|
||||
{ // 4X4
|
||||
// 4X4, 4X8,8X4,8X8,8X16,16X8,16X16,16X32,32X16,32X32,32X64,64X32,64X64
|
||||
PARTITION_NONE, PARTITION_INVALID, PARTITION_INVALID,
|
||||
@ -74,7 +74,7 @@ const PARTITION_TYPE partition_lookup[][BLOCK_SIZE_TYPES] = {
|
||||
}
|
||||
};
|
||||
|
||||
const BLOCK_SIZE_TYPE subsize_lookup[PARTITION_TYPES][BLOCK_SIZE_TYPES] = {
|
||||
const BLOCK_SIZE_TYPE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] = {
|
||||
{ // PARTITION_NONE
|
||||
BLOCK_4X4, BLOCK_4X8, BLOCK_8X4,
|
||||
BLOCK_8X8, BLOCK_8X16, BLOCK_16X8,
|
||||
@ -102,20 +102,20 @@ const BLOCK_SIZE_TYPE subsize_lookup[PARTITION_TYPES][BLOCK_SIZE_TYPES] = {
|
||||
}
|
||||
};
|
||||
|
||||
const TX_SIZE max_txsize_lookup[BLOCK_SIZE_TYPES] = {
|
||||
const TX_SIZE max_txsize_lookup[BLOCK_SIZES] = {
|
||||
TX_4X4, TX_4X4, TX_4X4,
|
||||
TX_8X8, TX_8X8, TX_8X8,
|
||||
TX_16X16, TX_16X16, TX_16X16,
|
||||
TX_32X32, TX_32X32, TX_32X32, TX_32X32
|
||||
};
|
||||
const TX_SIZE max_uv_txsize_lookup[BLOCK_SIZE_TYPES] = {
|
||||
const TX_SIZE max_uv_txsize_lookup[BLOCK_SIZES] = {
|
||||
TX_4X4, TX_4X4, TX_4X4,
|
||||
TX_4X4, TX_4X4, TX_4X4,
|
||||
TX_8X8, TX_8X8, TX_8X8,
|
||||
TX_16X16, TX_16X16, TX_16X16, TX_32X32
|
||||
};
|
||||
|
||||
const BLOCK_SIZE_TYPE ss_size_lookup[BLOCK_SIZE_TYPES][2][2] = {
|
||||
const BLOCK_SIZE_TYPE ss_size_lookup[BLOCK_SIZES][2][2] = {
|
||||
// ss_x == 0 ss_x == 0 ss_x == 1 ss_x == 1
|
||||
// ss_y == 0 ss_y == 1 ss_y == 0 ss_y == 1
|
||||
{{BLOCK_4X4, BLOCK_INVALID}, {BLOCK_INVALID, BLOCK_INVALID}},
|
||||
|
@ -13,20 +13,20 @@
|
||||
|
||||
#include "vp9/common/vp9_enums.h"
|
||||
|
||||
extern const int b_width_log2_lookup[BLOCK_SIZE_TYPES];
|
||||
extern const int b_height_log2_lookup[BLOCK_SIZE_TYPES];
|
||||
extern const int mi_width_log2_lookup[BLOCK_SIZE_TYPES];
|
||||
extern const int mi_height_log2_lookup[BLOCK_SIZE_TYPES];
|
||||
extern const int num_8x8_blocks_wide_lookup[BLOCK_SIZE_TYPES];
|
||||
extern const int num_8x8_blocks_high_lookup[BLOCK_SIZE_TYPES];
|
||||
extern const int num_4x4_blocks_high_lookup[BLOCK_SIZE_TYPES];
|
||||
extern const int num_4x4_blocks_wide_lookup[BLOCK_SIZE_TYPES];
|
||||
extern const int size_group_lookup[BLOCK_SIZE_TYPES];
|
||||
extern const int num_pels_log2_lookup[BLOCK_SIZE_TYPES];
|
||||
extern const PARTITION_TYPE partition_lookup[][BLOCK_SIZE_TYPES];
|
||||
extern const BLOCK_SIZE_TYPE subsize_lookup[PARTITION_TYPES][BLOCK_SIZE_TYPES];
|
||||
extern const TX_SIZE max_txsize_lookup[BLOCK_SIZE_TYPES];
|
||||
extern const TX_SIZE max_uv_txsize_lookup[BLOCK_SIZE_TYPES];
|
||||
extern const BLOCK_SIZE_TYPE ss_size_lookup[BLOCK_SIZE_TYPES][2][2];
|
||||
extern const int b_width_log2_lookup[BLOCK_SIZES];
|
||||
extern const int b_height_log2_lookup[BLOCK_SIZES];
|
||||
extern const int mi_width_log2_lookup[BLOCK_SIZES];
|
||||
extern const int mi_height_log2_lookup[BLOCK_SIZES];
|
||||
extern const int num_8x8_blocks_wide_lookup[BLOCK_SIZES];
|
||||
extern const int num_8x8_blocks_high_lookup[BLOCK_SIZES];
|
||||
extern const int num_4x4_blocks_high_lookup[BLOCK_SIZES];
|
||||
extern const int num_4x4_blocks_wide_lookup[BLOCK_SIZES];
|
||||
extern const int size_group_lookup[BLOCK_SIZES];
|
||||
extern const int num_pels_log2_lookup[BLOCK_SIZES];
|
||||
extern const PARTITION_TYPE partition_lookup[][BLOCK_SIZES];
|
||||
extern const BLOCK_SIZE_TYPE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES];
|
||||
extern const TX_SIZE max_txsize_lookup[BLOCK_SIZES];
|
||||
extern const TX_SIZE max_uv_txsize_lookup[BLOCK_SIZES];
|
||||
extern const BLOCK_SIZE_TYPE ss_size_lookup[BLOCK_SIZES][2][2];
|
||||
|
||||
#endif // VP9_COMMON_VP9_COMMON_DATA_H
|
||||
|
@ -35,8 +35,8 @@ typedef enum BLOCK_SIZE_TYPE {
|
||||
BLOCK_32X64,
|
||||
BLOCK_64X32,
|
||||
BLOCK_64X64,
|
||||
BLOCK_SIZE_TYPES,
|
||||
BLOCK_INVALID = BLOCK_SIZE_TYPES
|
||||
BLOCK_SIZES,
|
||||
BLOCK_INVALID = BLOCK_SIZES
|
||||
} BLOCK_SIZE_TYPE;
|
||||
|
||||
typedef enum PARTITION_TYPE {
|
||||
|
@ -70,7 +70,7 @@ static const int counter_to_context[19] = {
|
||||
BOTH_INTRA // 18
|
||||
};
|
||||
|
||||
static const MV mv_ref_blocks[BLOCK_SIZE_TYPES][MVREF_NEIGHBOURS] = {
|
||||
static const MV mv_ref_blocks[BLOCK_SIZES][MVREF_NEIGHBOURS] = {
|
||||
// 4X4
|
||||
{{-1, 0}, {0, -1}, {-1, -1}, {-2, 0}, {0, -2}, {-2, -1}, {-1, -2}, {-2, -2}},
|
||||
// 4X8
|
||||
|
@ -1457,11 +1457,11 @@ static void rd_use_partition(VP9_COMP *cpi, MODE_INFO *m, TOKENEXTRA **tp,
|
||||
*dist = chosen_dist;
|
||||
}
|
||||
|
||||
static BLOCK_SIZE_TYPE min_partition_size[BLOCK_SIZE_TYPES] =
|
||||
static const BLOCK_SIZE_TYPE min_partition_size[BLOCK_SIZES] =
|
||||
{ BLOCK_4X4, BLOCK_4X4, BLOCK_4X4, BLOCK_4X4,
|
||||
BLOCK_4X4, BLOCK_4X4, BLOCK_8X8, BLOCK_8X8,
|
||||
BLOCK_8X8, BLOCK_16X16, BLOCK_16X16, BLOCK_16X16, BLOCK_16X16 };
|
||||
static BLOCK_SIZE_TYPE max_partition_size[BLOCK_SIZE_TYPES] =
|
||||
static const BLOCK_SIZE_TYPE max_partition_size[BLOCK_SIZES] =
|
||||
{ BLOCK_8X8, BLOCK_16X16, BLOCK_16X16, BLOCK_16X16,
|
||||
BLOCK_32X32, BLOCK_32X32, BLOCK_32X32, BLOCK_64X64,
|
||||
BLOCK_64X64, BLOCK_64X64, BLOCK_64X64, BLOCK_64X64, BLOCK_64X64 };
|
||||
|
@ -772,7 +772,7 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
|
||||
sf->use_avoid_tested_higherror = 1;
|
||||
sf->adaptive_rd_thresh = 1;
|
||||
if (speed == 1) {
|
||||
sf->comp_inter_joint_search_thresh = BLOCK_SIZE_TYPES;
|
||||
sf->comp_inter_joint_search_thresh = BLOCK_SIZES;
|
||||
sf->less_rectangular_check = 1;
|
||||
sf->tx_size_search_method = ((cpi->common.frame_type == KEY_FRAME ||
|
||||
cpi->common.intra_only ||
|
||||
@ -804,7 +804,7 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
|
||||
sf->adjust_thresholds_by_speed = 1;
|
||||
sf->less_rectangular_check = 1;
|
||||
sf->use_square_partition_only = 1;
|
||||
sf->comp_inter_joint_search_thresh = BLOCK_SIZE_TYPES;
|
||||
sf->comp_inter_joint_search_thresh = BLOCK_SIZES;
|
||||
sf->use_lastframe_partitioning = 1;
|
||||
sf->adjust_partitioning_from_last_frame = 1;
|
||||
sf->last_partitioning_redo_frequency = 3;
|
||||
@ -834,7 +834,7 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
|
||||
sf->use_fast_lpf_pick = 1;
|
||||
}
|
||||
if (speed == 3) {
|
||||
sf->comp_inter_joint_search_thresh = BLOCK_SIZE_TYPES;
|
||||
sf->comp_inter_joint_search_thresh = BLOCK_SIZES;
|
||||
sf->partition_by_variance = 1;
|
||||
sf->tx_size_search_method = ((cpi->common.frame_type == KEY_FRAME ||
|
||||
cpi->common.intra_only ||
|
||||
@ -856,7 +856,7 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
|
||||
sf->subpel_iters_per_step = 1;
|
||||
}
|
||||
if (speed == 4) {
|
||||
sf->comp_inter_joint_search_thresh = BLOCK_SIZE_TYPES;
|
||||
sf->comp_inter_joint_search_thresh = BLOCK_SIZES;
|
||||
sf->use_one_partition_size_always = 1;
|
||||
sf->always_this_block_size = BLOCK_16X16;
|
||||
sf->tx_size_search_method = ((cpi->common.frame_type == KEY_FRAME ||
|
||||
|
@ -374,9 +374,9 @@ typedef struct VP9_COMP {
|
||||
int set_ref_frame_mask;
|
||||
|
||||
int rd_thresh_mult[MAX_MODES];
|
||||
int rd_baseline_thresh[BLOCK_SIZE_TYPES][MAX_MODES];
|
||||
int rd_threshes[BLOCK_SIZE_TYPES][MAX_MODES];
|
||||
int rd_thresh_freq_fact[BLOCK_SIZE_TYPES][MAX_MODES];
|
||||
int rd_baseline_thresh[BLOCK_SIZES][MAX_MODES];
|
||||
int rd_threshes[BLOCK_SIZES][MAX_MODES];
|
||||
int rd_thresh_freq_fact[BLOCK_SIZES][MAX_MODES];
|
||||
|
||||
int64_t rd_comp_pred_diff[NB_PREDICTION_TYPES];
|
||||
// FIXME(rbultje) int64_t?
|
||||
@ -540,7 +540,7 @@ typedef struct VP9_COMP {
|
||||
vp9_full_search_fn_t full_search_sad;
|
||||
vp9_refining_search_fn_t refining_search_sad;
|
||||
vp9_diamond_search_fn_t diamond_search_sad;
|
||||
vp9_variance_fn_ptr_t fn_ptr[BLOCK_SIZE_TYPES];
|
||||
vp9_variance_fn_ptr_t fn_ptr[BLOCK_SIZES];
|
||||
uint64_t time_receive_data;
|
||||
uint64_t time_compress_data;
|
||||
uint64_t time_pick_lpf;
|
||||
|
@ -102,7 +102,7 @@ const MODE_DEFINITION vp9_mode_order[MAX_MODES] = {
|
||||
// certain modes are assumed to be based on 8x8 blocks.
|
||||
// This table is used to correct for blocks size.
|
||||
// The factors here are << 2 (2 = x0.5, 32 = x8 etc).
|
||||
static int rd_thresh_block_size_factor[BLOCK_SIZE_TYPES] =
|
||||
static int rd_thresh_block_size_factor[BLOCK_SIZES] =
|
||||
{2, 3, 3, 4, 6, 6, 8, 12, 12, 16, 24, 24, 32};
|
||||
|
||||
#define BASE_RD_THRESH_FREQ_FACT 16
|
||||
@ -199,7 +199,7 @@ void vp9_initialize_rd_consts(VP9_COMP *cpi, int qindex) {
|
||||
cpi->RDDIV = 1;
|
||||
cpi->RDMULT /= 100;
|
||||
|
||||
for (bsize = 0; bsize < BLOCK_SIZE_TYPES; ++bsize) {
|
||||
for (bsize = 0; bsize < BLOCK_SIZES; ++bsize) {
|
||||
for (i = 0; i < MAX_MODES; ++i) {
|
||||
// Threshold here seem unecessarily harsh but fine given actual
|
||||
// range of values used for cpi->sf.thresh_mult[]
|
||||
@ -224,7 +224,7 @@ void vp9_initialize_rd_consts(VP9_COMP *cpi, int qindex) {
|
||||
} else {
|
||||
cpi->RDDIV = 100;
|
||||
|
||||
for (bsize = 0; bsize < BLOCK_SIZE_TYPES; ++bsize) {
|
||||
for (bsize = 0; bsize < BLOCK_SIZES; ++bsize) {
|
||||
for (i = 0; i < MAX_MODES; i++) {
|
||||
// Threshold here seem unecessarily harsh but fine given actual
|
||||
// range of values used for cpi->sf.thresh_mult[]
|
||||
@ -3506,7 +3506,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
// Disable intra modes other than DC_PRED for blocks with low variance
|
||||
// Threshold for intra skipping based on source variance
|
||||
// TODO(debargha): Specialize the threshold for super block sizes
|
||||
static const int skip_intra_var_thresh[BLOCK_SIZE_TYPES] = {
|
||||
static const int skip_intra_var_thresh[BLOCK_SIZES] = {
|
||||
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
|
||||
};
|
||||
if ((cpi->sf.mode_search_skip_flags & FLAG_SKIP_INTRA_LOWVAR) &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user