Renaming BLOCK_SIZE_TYPE to BLOCK_SIZE in the encoder.
Change-Id: I62bb07c377f947cb72fac68add7a6b199e42c6b9
This commit is contained in:
@@ -40,8 +40,6 @@ typedef enum BLOCK_SIZE {
|
||||
BLOCK_INVALID = BLOCK_SIZES
|
||||
} BLOCK_SIZE;
|
||||
|
||||
typedef BLOCK_SIZE BLOCK_SIZE_TYPE;
|
||||
|
||||
typedef enum PARTITION_TYPE {
|
||||
PARTITION_NONE,
|
||||
PARTITION_HORZ,
|
||||
|
||||
@@ -199,7 +199,7 @@ static void update_mbintra_mode_probs(VP9_COMP* const cpi,
|
||||
}
|
||||
|
||||
static void write_selected_tx_size(const VP9_COMP *cpi, TX_SIZE tx_size,
|
||||
BLOCK_SIZE_TYPE bsize, vp9_writer *w) {
|
||||
BLOCK_SIZE bsize, vp9_writer *w) {
|
||||
const MACROBLOCKD *const xd = &cpi->mb.e_mbd;
|
||||
const vp9_prob *tx_probs = get_tx_probs2(xd, &cpi->common.fc.tx_probs);
|
||||
vp9_write(w, tx_size != TX_4X4, tx_probs[0]);
|
||||
@@ -407,7 +407,7 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m, vp9_writer *bc) {
|
||||
const MB_PREDICTION_MODE mode = mi->mode;
|
||||
const int segment_id = mi->segment_id;
|
||||
int skip_coeff;
|
||||
const BLOCK_SIZE_TYPE bsize = mi->sb_type;
|
||||
const BLOCK_SIZE bsize = mi->sb_type;
|
||||
const int allow_hp = xd->allow_high_precision_mv;
|
||||
|
||||
x->partition_info = x->pi + (m - pc->mi);
|
||||
@@ -606,8 +606,7 @@ static void write_modes_b(VP9_COMP *cpi, MODE_INFO *m, vp9_writer *bc,
|
||||
|
||||
static void write_modes_sb(VP9_COMP *cpi, MODE_INFO *m, vp9_writer *bc,
|
||||
TOKENEXTRA **tok, TOKENEXTRA *tok_end,
|
||||
int mi_row, int mi_col,
|
||||
BLOCK_SIZE_TYPE bsize) {
|
||||
int mi_row, int mi_col, BLOCK_SIZE bsize) {
|
||||
VP9_COMMON *const cm = &cpi->common;
|
||||
MACROBLOCKD *xd = &cpi->mb.e_mbd;
|
||||
const int mis = cm->mode_info_stride;
|
||||
@@ -615,7 +614,7 @@ static void write_modes_sb(VP9_COMP *cpi, MODE_INFO *m, vp9_writer *bc,
|
||||
int bs = (1 << bsl) / 4; // mode_info step for subsize
|
||||
int n;
|
||||
PARTITION_TYPE partition = PARTITION_NONE;
|
||||
BLOCK_SIZE_TYPE subsize;
|
||||
BLOCK_SIZE subsize;
|
||||
|
||||
if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols)
|
||||
return;
|
||||
|
||||
@@ -170,10 +170,10 @@ struct macroblock {
|
||||
PICK_MODE_CONTEXT sb64_context;
|
||||
int partition_cost[NUM_PARTITION_CONTEXTS][PARTITION_TYPES];
|
||||
|
||||
BLOCK_SIZE_TYPE b_partitioning[4][4][4];
|
||||
BLOCK_SIZE_TYPE mb_partitioning[4][4];
|
||||
BLOCK_SIZE_TYPE sb_partitioning[4];
|
||||
BLOCK_SIZE_TYPE sb64_partitioning;
|
||||
BLOCK_SIZE b_partitioning[4][4][4];
|
||||
BLOCK_SIZE mb_partitioning[4][4];
|
||||
BLOCK_SIZE sb_partitioning[4];
|
||||
BLOCK_SIZE sb64_partitioning;
|
||||
|
||||
void (*fwd_txm4x4)(int16_t *input, int16_t *output, int pitch);
|
||||
void (*fwd_txm8x4)(int16_t *input, int16_t *output, int pitch);
|
||||
|
||||
@@ -47,7 +47,7 @@ int enc_debug = 0;
|
||||
#endif
|
||||
|
||||
static void encode_superblock(VP9_COMP *cpi, TOKENEXTRA **t, int output_enabled,
|
||||
int mi_row, int mi_col, BLOCK_SIZE_TYPE bsize);
|
||||
int mi_row, int mi_col, BLOCK_SIZE bsize);
|
||||
|
||||
static void adjust_act_zbin(VP9_COMP *cpi, MACROBLOCK *x);
|
||||
|
||||
@@ -78,7 +78,7 @@ static const uint8_t VP9_VAR_OFFS[64] = {
|
||||
};
|
||||
|
||||
static unsigned int get_sby_perpixel_variance(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
BLOCK_SIZE_TYPE bs) {
|
||||
BLOCK_SIZE bs) {
|
||||
unsigned int var, sse;
|
||||
var = cpi->fn_ptr[bs].vf(x->plane[0].src.buf,
|
||||
x->plane[0].src.stride,
|
||||
@@ -336,7 +336,7 @@ void vp9_activity_masking(VP9_COMP *cpi, MACROBLOCK *x) {
|
||||
}
|
||||
|
||||
static void update_state(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx,
|
||||
BLOCK_SIZE_TYPE bsize, int output_enabled) {
|
||||
BLOCK_SIZE bsize, int output_enabled) {
|
||||
int i, x_idx, y;
|
||||
VP9_COMMON *const cm = &cpi->common;
|
||||
MACROBLOCK *const x = &cpi->mb;
|
||||
@@ -469,10 +469,10 @@ void vp9_setup_src_planes(MACROBLOCK *x, const YV12_BUFFER_CONFIG *src,
|
||||
}
|
||||
|
||||
static void set_offsets(VP9_COMP *cpi, int mi_row, int mi_col,
|
||||
BLOCK_SIZE_TYPE bsize) {
|
||||
MACROBLOCK * const x = &cpi->mb;
|
||||
VP9_COMMON * const cm = &cpi->common;
|
||||
MACROBLOCKD * const xd = &x->e_mbd;
|
||||
BLOCK_SIZE bsize) {
|
||||
MACROBLOCK *const x = &cpi->mb;
|
||||
VP9_COMMON *const cm = &cpi->common;
|
||||
MACROBLOCKD *const xd = &x->e_mbd;
|
||||
MB_MODE_INFO *mbmi;
|
||||
const int dst_fb_idx = cm->new_fb_idx;
|
||||
const int idx_str = xd->mode_info_stride * mi_row + mi_col;
|
||||
@@ -553,7 +553,7 @@ static void set_offsets(VP9_COMP *cpi, int mi_row, int mi_col,
|
||||
|
||||
static void pick_sb_modes(VP9_COMP *cpi, int mi_row, int mi_col,
|
||||
int *totalrate, int64_t *totaldist,
|
||||
BLOCK_SIZE_TYPE bsize, PICK_MODE_CONTEXT *ctx,
|
||||
BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx,
|
||||
int64_t best_rd) {
|
||||
VP9_COMMON *const cm = &cpi->common;
|
||||
MACROBLOCK *const x = &cpi->mb;
|
||||
@@ -637,9 +637,8 @@ static void update_stats(VP9_COMP *cpi) {
|
||||
// TODO(jingning): the variables used here are little complicated. need further
|
||||
// refactoring on organizing the temporary buffers, when recursive
|
||||
// partition down to 4x4 block size is enabled.
|
||||
static PICK_MODE_CONTEXT *get_block_context(MACROBLOCK *x,
|
||||
BLOCK_SIZE_TYPE bsize) {
|
||||
MACROBLOCKD * const xd = &x->e_mbd;
|
||||
static PICK_MODE_CONTEXT *get_block_context(MACROBLOCK *x, BLOCK_SIZE bsize) {
|
||||
MACROBLOCKD *const xd = &x->e_mbd;
|
||||
|
||||
switch (bsize) {
|
||||
case BLOCK_64X64:
|
||||
@@ -674,9 +673,8 @@ static PICK_MODE_CONTEXT *get_block_context(MACROBLOCK *x,
|
||||
}
|
||||
}
|
||||
|
||||
static BLOCK_SIZE_TYPE *get_sb_partitioning(MACROBLOCK *x,
|
||||
BLOCK_SIZE_TYPE bsize) {
|
||||
MACROBLOCKD *xd = &x->e_mbd;
|
||||
static BLOCK_SIZE *get_sb_partitioning(MACROBLOCK *x, BLOCK_SIZE bsize) {
|
||||
MACROBLOCKD *const xd = &x->e_mbd;
|
||||
switch (bsize) {
|
||||
case BLOCK_64X64:
|
||||
return &x->sb64_partitioning;
|
||||
@@ -696,7 +694,7 @@ static void restore_context(VP9_COMP *cpi, int mi_row, int mi_col,
|
||||
ENTROPY_CONTEXT a[16 * MAX_MB_PLANE],
|
||||
ENTROPY_CONTEXT l[16 * MAX_MB_PLANE],
|
||||
PARTITION_CONTEXT sa[8], PARTITION_CONTEXT sl[8],
|
||||
BLOCK_SIZE_TYPE bsize) {
|
||||
BLOCK_SIZE bsize) {
|
||||
VP9_COMMON *const cm = &cpi->common;
|
||||
MACROBLOCK *const x = &cpi->mb;
|
||||
MACROBLOCKD *const xd = &x->e_mbd;
|
||||
@@ -727,7 +725,7 @@ static void save_context(VP9_COMP *cpi, int mi_row, int mi_col,
|
||||
ENTROPY_CONTEXT a[16 * MAX_MB_PLANE],
|
||||
ENTROPY_CONTEXT l[16 * MAX_MB_PLANE],
|
||||
PARTITION_CONTEXT sa[8], PARTITION_CONTEXT sl[8],
|
||||
BLOCK_SIZE_TYPE bsize) {
|
||||
BLOCK_SIZE bsize) {
|
||||
const VP9_COMMON *const cm = &cpi->common;
|
||||
const MACROBLOCK *const x = &cpi->mb;
|
||||
const MACROBLOCKD *const xd = &x->e_mbd;
|
||||
@@ -758,7 +756,7 @@ static void save_context(VP9_COMP *cpi, int mi_row, int mi_col,
|
||||
}
|
||||
|
||||
static void encode_b(VP9_COMP *cpi, TOKENEXTRA **tp, int mi_row, int mi_col,
|
||||
int output_enabled, BLOCK_SIZE_TYPE bsize, int sub_index) {
|
||||
int output_enabled, BLOCK_SIZE bsize, int sub_index) {
|
||||
VP9_COMMON * const cm = &cpi->common;
|
||||
MACROBLOCK * const x = &cpi->mb;
|
||||
MACROBLOCKD * const xd = &x->e_mbd;
|
||||
@@ -788,15 +786,15 @@ static void encode_b(VP9_COMP *cpi, TOKENEXTRA **tp, int mi_row, int mi_col,
|
||||
}
|
||||
|
||||
static void encode_sb(VP9_COMP *cpi, TOKENEXTRA **tp, int mi_row, int mi_col,
|
||||
int output_enabled, BLOCK_SIZE_TYPE bsize) {
|
||||
int output_enabled, BLOCK_SIZE bsize) {
|
||||
VP9_COMMON * const cm = &cpi->common;
|
||||
MACROBLOCK * const x = &cpi->mb;
|
||||
MACROBLOCKD * const xd = &x->e_mbd;
|
||||
BLOCK_SIZE_TYPE c1 = BLOCK_8X8;
|
||||
BLOCK_SIZE c1 = BLOCK_8X8;
|
||||
const int bsl = b_width_log2(bsize), bs = (1 << bsl) / 4;
|
||||
int UNINITIALIZED_IS_SAFE(pl);
|
||||
PARTITION_TYPE partition;
|
||||
BLOCK_SIZE_TYPE subsize;
|
||||
BLOCK_SIZE subsize;
|
||||
int i;
|
||||
|
||||
if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols)
|
||||
@@ -853,8 +851,7 @@ static void encode_sb(VP9_COMP *cpi, TOKENEXTRA **tp, int mi_row, int mi_col,
|
||||
}
|
||||
}
|
||||
|
||||
static void set_partitioning(VP9_COMP *cpi, MODE_INFO *m,
|
||||
BLOCK_SIZE_TYPE bsize) {
|
||||
static void set_partitioning(VP9_COMP *cpi, MODE_INFO *m, BLOCK_SIZE bsize) {
|
||||
VP9_COMMON *const cm = &cpi->common;
|
||||
const int mis = cm->mode_info_stride;
|
||||
int block_row, block_col;
|
||||
@@ -877,7 +874,7 @@ static void copy_partitioning(VP9_COMP *cpi, MODE_INFO *m, MODE_INFO *p) {
|
||||
}
|
||||
|
||||
static void set_block_size(VP9_COMMON * const cm, MODE_INFO *m,
|
||||
BLOCK_SIZE_TYPE bsize, int mis, int mi_row,
|
||||
BLOCK_SIZE bsize, int mis, int mi_row,
|
||||
int mi_col) {
|
||||
int row, col;
|
||||
int bwl = b_width_log2(bsize);
|
||||
@@ -929,9 +926,9 @@ typedef enum {
|
||||
V64X64,
|
||||
} TREE_LEVEL;
|
||||
|
||||
static void tree_to_node(void *data, BLOCK_SIZE_TYPE block_size, vt_node *node) {
|
||||
static void tree_to_node(void *data, BLOCK_SIZE bsize, vt_node *node) {
|
||||
int i;
|
||||
switch (block_size) {
|
||||
switch (bsize) {
|
||||
case BLOCK_64X64: {
|
||||
v64x64 *vt = (v64x64 *) data;
|
||||
node->vt = &vt->vt;
|
||||
@@ -988,9 +985,9 @@ void sum_2_variances(var *r, var *a, var*b) {
|
||||
a->sum_error + b->sum_error, a->count + b->count);
|
||||
}
|
||||
|
||||
static void fill_variance_tree(void *data, BLOCK_SIZE_TYPE block_size) {
|
||||
static void fill_variance_tree(void *data, BLOCK_SIZE bsize) {
|
||||
vt_node node;
|
||||
tree_to_node(data, block_size, &node);
|
||||
tree_to_node(data, bsize, &node);
|
||||
sum_2_variances(&node.vt->horz[0], node.split[0], node.split[1]);
|
||||
sum_2_variances(&node.vt->horz[1], node.split[2], node.split[3]);
|
||||
sum_2_variances(&node.vt->vert[0], node.split[0], node.split[2]);
|
||||
@@ -1000,7 +997,7 @@ static void fill_variance_tree(void *data, BLOCK_SIZE_TYPE block_size) {
|
||||
|
||||
#if PERFORM_RANDOM_PARTITIONING
|
||||
static int set_vt_partitioning(VP9_COMP *cpi, void *data, MODE_INFO *m,
|
||||
BLOCK_SIZE_TYPE block_size, int mi_row,
|
||||
BLOCK_SIZE block_size, int mi_row,
|
||||
int mi_col, int mi_size) {
|
||||
VP9_COMMON * const cm = &cpi->common;
|
||||
vt_node vt;
|
||||
@@ -1039,27 +1036,27 @@ static int set_vt_partitioning(VP9_COMP *cpi, void *data, MODE_INFO *m,
|
||||
#else // !PERFORM_RANDOM_PARTITIONING
|
||||
|
||||
static int set_vt_partitioning(VP9_COMP *cpi, void *data, MODE_INFO *m,
|
||||
BLOCK_SIZE_TYPE block_size, int mi_row,
|
||||
BLOCK_SIZE bsize, int mi_row,
|
||||
int mi_col, int mi_size) {
|
||||
VP9_COMMON * const cm = &cpi->common;
|
||||
vt_node vt;
|
||||
const int mis = cm->mode_info_stride;
|
||||
int64_t threshold = 50 * cpi->common.base_qindex;
|
||||
|
||||
tree_to_node(data, block_size, &vt);
|
||||
tree_to_node(data, bsize, &vt);
|
||||
|
||||
// split none is available only if we have more than half a block size
|
||||
// in width and height inside the visible image
|
||||
if (mi_col + mi_size < cm->mi_cols && mi_row + mi_size < cm->mi_rows
|
||||
&& vt.vt->none.variance < threshold) {
|
||||
set_block_size(cm, m, block_size, mis, mi_row, mi_col);
|
||||
set_block_size(cm, m, bsize, mis, mi_row, mi_col);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// vertical split is available on all but the bottom border
|
||||
if (mi_row + mi_size < cm->mi_rows && vt.vt->vert[0].variance < threshold
|
||||
&& vt.vt->vert[1].variance < threshold) {
|
||||
set_block_size(cm, m, get_subsize(block_size, PARTITION_VERT), mis, mi_row,
|
||||
set_block_size(cm, m, get_subsize(bsize, PARTITION_VERT), mis, mi_row,
|
||||
mi_col);
|
||||
return 1;
|
||||
}
|
||||
@@ -1067,7 +1064,7 @@ static int set_vt_partitioning(VP9_COMP *cpi, void *data, MODE_INFO *m,
|
||||
// horizontal split is available on all but the right border
|
||||
if (mi_col + mi_size < cm->mi_cols && vt.vt->horz[0].variance < threshold
|
||||
&& vt.vt->horz[1].variance < threshold) {
|
||||
set_block_size(cm, m, get_subsize(block_size, PARTITION_HORZ), mis, mi_row,
|
||||
set_block_size(cm, m, get_subsize(bsize, PARTITION_HORZ), mis, mi_row,
|
||||
mi_col);
|
||||
return 1;
|
||||
}
|
||||
@@ -1192,7 +1189,7 @@ static void choose_partitioning(VP9_COMP *cpi, MODE_INFO *m, int mi_row,
|
||||
}
|
||||
|
||||
static void rd_use_partition(VP9_COMP *cpi, MODE_INFO *m, TOKENEXTRA **tp,
|
||||
int mi_row, int mi_col, BLOCK_SIZE_TYPE bsize,
|
||||
int mi_row, int mi_col, BLOCK_SIZE bsize,
|
||||
int *rate, int64_t *dist, int do_recon) {
|
||||
VP9_COMMON * const cm = &cpi->common;
|
||||
MACROBLOCK * const x = &cpi->mb;
|
||||
@@ -1206,7 +1203,7 @@ static void rd_use_partition(VP9_COMP *cpi, MODE_INFO *m, TOKENEXTRA **tp,
|
||||
int bss = (1 << bsl) / 4;
|
||||
int i, pl;
|
||||
PARTITION_TYPE partition = PARTITION_NONE;
|
||||
BLOCK_SIZE_TYPE subsize;
|
||||
BLOCK_SIZE subsize;
|
||||
ENTROPY_CONTEXT l[16 * MAX_MB_PLANE], a[16 * MAX_MB_PLANE];
|
||||
PARTITION_CONTEXT sl[8], sa[8];
|
||||
int last_part_rate = INT_MAX;
|
||||
@@ -1217,9 +1214,9 @@ static void rd_use_partition(VP9_COMP *cpi, MODE_INFO *m, TOKENEXTRA **tp,
|
||||
int64_t none_dist = INT_MAX;
|
||||
int chosen_rate = INT_MAX;
|
||||
int64_t chosen_dist = INT_MAX;
|
||||
BLOCK_SIZE_TYPE sub_subsize = BLOCK_4X4;
|
||||
BLOCK_SIZE sub_subsize = BLOCK_4X4;
|
||||
int splits_below = 0;
|
||||
BLOCK_SIZE_TYPE bs_type = m->mbmi.sb_type;
|
||||
BLOCK_SIZE bs_type = m->mbmi.sb_type;
|
||||
|
||||
if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols)
|
||||
return;
|
||||
@@ -1366,7 +1363,7 @@ static void rd_use_partition(VP9_COMP *cpi, MODE_INFO *m, TOKENEXTRA **tp,
|
||||
&& partition != PARTITION_SPLIT && bsize > BLOCK_8X8
|
||||
&& (mi_row + ms < cm->mi_rows || mi_row + (ms >> 1) == cm->mi_rows)
|
||||
&& (mi_col + ms < cm->mi_cols || mi_col + (ms >> 1) == cm->mi_cols)) {
|
||||
BLOCK_SIZE_TYPE split_subsize = get_subsize(bsize, PARTITION_SPLIT);
|
||||
BLOCK_SIZE split_subsize = get_subsize(bsize, PARTITION_SPLIT);
|
||||
split_rate = 0;
|
||||
split_dist = 0;
|
||||
restore_context(cpi, mi_row, mi_col, a, l, sa, sl, bsize);
|
||||
@@ -1454,14 +1451,17 @@ static void rd_use_partition(VP9_COMP *cpi, MODE_INFO *m, TOKENEXTRA **tp,
|
||||
*dist = chosen_dist;
|
||||
}
|
||||
|
||||
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 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 };
|
||||
static const BLOCK_SIZE 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 const BLOCK_SIZE 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
|
||||
};
|
||||
|
||||
// Look at all the mode_info entries for blocks that are part of this
|
||||
// partition and find the min and max values for sb_type.
|
||||
@@ -1471,8 +1471,8 @@ static const BLOCK_SIZE_TYPE max_partition_size[BLOCK_SIZES] =
|
||||
// The min and max are assumed to have been initialized prior to calling this
|
||||
// function so repeat calls can accumulate a min and max of more than one sb64.
|
||||
static void get_sb_partition_size_range(VP9_COMP *cpi, MODE_INFO * mi,
|
||||
BLOCK_SIZE_TYPE * min_block_size,
|
||||
BLOCK_SIZE_TYPE * max_block_size ) {
|
||||
BLOCK_SIZE *min_block_size,
|
||||
BLOCK_SIZE *max_block_size ) {
|
||||
MACROBLOCKD *const xd = &cpi->mb.e_mbd;
|
||||
int sb_width_in_blocks = MI_BLOCK_SIZE;
|
||||
int sb_height_in_blocks = MI_BLOCK_SIZE;
|
||||
@@ -1482,8 +1482,8 @@ static void get_sb_partition_size_range(VP9_COMP *cpi, MODE_INFO * mi,
|
||||
// Check the sb_type for each block that belongs to this region.
|
||||
for (i = 0; i < sb_height_in_blocks; ++i) {
|
||||
for (j = 0; j < sb_width_in_blocks; ++j) {
|
||||
*min_block_size = MIN(*min_block_size, mi[index+j].mbmi.sb_type);
|
||||
*max_block_size = MAX(*max_block_size, mi[index+j].mbmi.sb_type);
|
||||
*min_block_size = MIN(*min_block_size, mi[index + j].mbmi.sb_type);
|
||||
*max_block_size = MAX(*max_block_size, mi[index + j].mbmi.sb_type);
|
||||
}
|
||||
index += xd->mode_info_stride;
|
||||
}
|
||||
@@ -1492,8 +1492,8 @@ static void get_sb_partition_size_range(VP9_COMP *cpi, MODE_INFO * mi,
|
||||
// Look at neighboring blocks and set a min and max partition size based on
|
||||
// what they chose.
|
||||
static void rd_auto_partition_range(VP9_COMP *cpi,
|
||||
BLOCK_SIZE_TYPE * min_block_size,
|
||||
BLOCK_SIZE_TYPE * max_block_size) {
|
||||
BLOCK_SIZE *min_block_size,
|
||||
BLOCK_SIZE *max_block_size) {
|
||||
MACROBLOCKD *const xd = &cpi->mb.e_mbd;
|
||||
MODE_INFO *mi = xd->mode_info_context;
|
||||
MODE_INFO *above_sb64_mi;
|
||||
@@ -1544,8 +1544,7 @@ static void rd_auto_partition_range(VP9_COMP *cpi,
|
||||
}
|
||||
}
|
||||
|
||||
static void compute_fast_motion_search_level(VP9_COMP *const cpi,
|
||||
const BLOCK_SIZE_TYPE bsize) {
|
||||
static void compute_fast_motion_search_level(VP9_COMP *cpi, BLOCK_SIZE bsize) {
|
||||
VP9_COMMON *const cm = &cpi->common;
|
||||
MACROBLOCK *const x = &cpi->mb;
|
||||
MACROBLOCKD *const xd = &x->e_mbd;
|
||||
@@ -1644,7 +1643,7 @@ static void compute_fast_motion_search_level(VP9_COMP *const cpi,
|
||||
// unlikely to be selected depending on previous rate-distortion optimization
|
||||
// results, for encoding speed-up.
|
||||
static void rd_pick_partition(VP9_COMP *cpi, TOKENEXTRA **tp, int mi_row,
|
||||
int mi_col, BLOCK_SIZE_TYPE bsize, int *rate,
|
||||
int mi_col, BLOCK_SIZE bsize, int *rate,
|
||||
int64_t *dist, int do_recon, int64_t best_rd) {
|
||||
VP9_COMMON * const cm = &cpi->common;
|
||||
MACROBLOCK * const x = &cpi->mb;
|
||||
@@ -1655,7 +1654,7 @@ static void rd_pick_partition(VP9_COMP *cpi, TOKENEXTRA **tp, int mi_row,
|
||||
PARTITION_CONTEXT sl[8], sa[8];
|
||||
TOKENEXTRA *tp_orig = *tp;
|
||||
int i, pl;
|
||||
BLOCK_SIZE_TYPE subsize;
|
||||
BLOCK_SIZE subsize;
|
||||
int this_rate, sum_rate = 0, best_rate = INT_MAX;
|
||||
int64_t this_dist, sum_dist = 0, best_dist = INT64_MAX;
|
||||
int64_t sum_rd = 0;
|
||||
@@ -2229,8 +2228,7 @@ static void set_txfm_flag(MODE_INFO *mi, int mis, int ymbs, int xmbs,
|
||||
|
||||
static void reset_skip_txfm_size_b(VP9_COMP *cpi, MODE_INFO *mi, int mis,
|
||||
TX_SIZE max_tx_size, int bw, int bh,
|
||||
int mi_row, int mi_col,
|
||||
BLOCK_SIZE_TYPE bsize) {
|
||||
int mi_row, int mi_col, BLOCK_SIZE bsize) {
|
||||
VP9_COMMON *const cm = &cpi->common;
|
||||
MB_MODE_INFO *const mbmi = &mi->mbmi;
|
||||
|
||||
@@ -2252,7 +2250,7 @@ static void reset_skip_txfm_size_b(VP9_COMP *cpi, MODE_INFO *mi, int mis,
|
||||
|
||||
static void reset_skip_txfm_size_sb(VP9_COMP *cpi, MODE_INFO *mi,
|
||||
TX_SIZE max_tx_size, int mi_row, int mi_col,
|
||||
BLOCK_SIZE_TYPE bsize) {
|
||||
BLOCK_SIZE bsize) {
|
||||
const VP9_COMMON *const cm = &cpi->common;
|
||||
const int mis = cm->mode_info_stride;
|
||||
int bw, bh;
|
||||
@@ -2278,7 +2276,7 @@ static void reset_skip_txfm_size_sb(VP9_COMP *cpi, MODE_INFO *mi,
|
||||
reset_skip_txfm_size_b(cpi, mi + hbs, mis, max_tx_size, hbs, bs, mi_row,
|
||||
mi_col + hbs, bsize);
|
||||
} else {
|
||||
const BLOCK_SIZE_TYPE subsize = subsize_lookup[PARTITION_SPLIT][bsize];
|
||||
const BLOCK_SIZE subsize = subsize_lookup[PARTITION_SPLIT][bsize];
|
||||
int n;
|
||||
|
||||
assert(bw < bs && bh < bs);
|
||||
@@ -2517,7 +2515,7 @@ void vp9_encode_frame(VP9_COMP *cpi) {
|
||||
static void sum_intra_stats(VP9_COMP *cpi, const MODE_INFO *mi) {
|
||||
const MB_PREDICTION_MODE y_mode = mi->mbmi.mode;
|
||||
const MB_PREDICTION_MODE uv_mode = mi->mbmi.uv_mode;
|
||||
const BLOCK_SIZE_TYPE bsize = mi->mbmi.sb_type;
|
||||
const BLOCK_SIZE bsize = mi->mbmi.sb_type;
|
||||
|
||||
++cpi->y_uv_mode_count[y_mode][uv_mode];
|
||||
|
||||
@@ -2555,7 +2553,7 @@ static void adjust_act_zbin(VP9_COMP *cpi, MACROBLOCK *x) {
|
||||
}
|
||||
|
||||
static void encode_superblock(VP9_COMP *cpi, TOKENEXTRA **t, int output_enabled,
|
||||
int mi_row, int mi_col, BLOCK_SIZE_TYPE bsize) {
|
||||
int mi_row, int mi_col, BLOCK_SIZE bsize) {
|
||||
VP9_COMMON * const cm = &cpi->common;
|
||||
MACROBLOCK * const x = &cpi->mb;
|
||||
MACROBLOCKD * const xd = &x->e_mbd;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include "vp9/encoder/vp9_onyx_int.h"
|
||||
|
||||
int vp9_encode_intra(MACROBLOCK *x, int use_16x16_pred);
|
||||
void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE_TYPE plane_bsize,
|
||||
void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
|
||||
TX_SIZE tx_size, void *arg);
|
||||
|
||||
#endif // VP9_ENCODER_VP9_ENCODEINTRA_H_
|
||||
|
||||
@@ -69,7 +69,7 @@ static void inverse_transform_b_16x16_add(int eob,
|
||||
vp9_short_idct16x16_add(dqcoeff, dest, stride);
|
||||
}
|
||||
|
||||
static void subtract_plane(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize, int plane) {
|
||||
static void subtract_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) {
|
||||
struct macroblock_plane *const p = &x->plane[plane];
|
||||
const MACROBLOCKD *const xd = &x->e_mbd;
|
||||
const struct macroblockd_plane *const pd = &xd->plane[plane];
|
||||
@@ -81,18 +81,18 @@ static void subtract_plane(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize, int plane) {
|
||||
pd->dst.buf, pd->dst.stride);
|
||||
}
|
||||
|
||||
void vp9_subtract_sby(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) {
|
||||
void vp9_subtract_sby(MACROBLOCK *x, BLOCK_SIZE bsize) {
|
||||
subtract_plane(x, bsize, 0);
|
||||
}
|
||||
|
||||
void vp9_subtract_sbuv(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) {
|
||||
void vp9_subtract_sbuv(MACROBLOCK *x, BLOCK_SIZE bsize) {
|
||||
int i;
|
||||
|
||||
for (i = 1; i < MAX_MB_PLANE; i++)
|
||||
subtract_plane(x, bsize, i);
|
||||
}
|
||||
|
||||
void vp9_subtract_sb(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) {
|
||||
void vp9_subtract_sb(MACROBLOCK *x, BLOCK_SIZE bsize) {
|
||||
vp9_subtract_sby(x, bsize);
|
||||
vp9_subtract_sbuv(x, bsize);
|
||||
}
|
||||
@@ -142,7 +142,7 @@ static int trellis_get_coeff_context(const int16_t *scan,
|
||||
}
|
||||
|
||||
static void optimize_b(MACROBLOCK *mb,
|
||||
int plane, int block, BLOCK_SIZE_TYPE plane_bsize,
|
||||
int plane, int block, BLOCK_SIZE plane_bsize,
|
||||
ENTROPY_CONTEXT *a, ENTROPY_CONTEXT *l,
|
||||
TX_SIZE tx_size) {
|
||||
MACROBLOCKD *const xd = &mb->e_mbd;
|
||||
@@ -370,7 +370,7 @@ static void optimize_b(MACROBLOCK *mb,
|
||||
*a = *l = (final_eob > 0);
|
||||
}
|
||||
|
||||
void vp9_optimize_b(int plane, int block, BLOCK_SIZE_TYPE plane_bsize,
|
||||
void vp9_optimize_b(int plane, int block, BLOCK_SIZE plane_bsize,
|
||||
TX_SIZE tx_size, MACROBLOCK *mb, struct optimize_ctx *ctx) {
|
||||
int x, y;
|
||||
txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &x, &y);
|
||||
@@ -378,11 +378,11 @@ void vp9_optimize_b(int plane, int block, BLOCK_SIZE_TYPE plane_bsize,
|
||||
&ctx->ta[plane][x], &ctx->tl[plane][y], tx_size);
|
||||
}
|
||||
|
||||
static void optimize_init_b(int plane, BLOCK_SIZE_TYPE bsize,
|
||||
static void optimize_init_b(int plane, BLOCK_SIZE bsize,
|
||||
struct encode_b_args *args) {
|
||||
const MACROBLOCKD *xd = &args->x->e_mbd;
|
||||
const struct macroblockd_plane* const pd = &xd->plane[plane];
|
||||
const BLOCK_SIZE_TYPE plane_bsize = get_plane_block_size(bsize, pd);
|
||||
const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
|
||||
const int num_4x4_w = num_4x4_blocks_wide_lookup[plane_bsize];
|
||||
const int num_4x4_h = num_4x4_blocks_high_lookup[plane_bsize];
|
||||
const MB_MODE_INFO *mbmi = &xd->mode_info_context->mbmi;
|
||||
@@ -419,7 +419,7 @@ static void optimize_init_b(int plane, BLOCK_SIZE_TYPE bsize,
|
||||
}
|
||||
}
|
||||
|
||||
void vp9_xform_quant(int plane, int block, BLOCK_SIZE_TYPE plane_bsize,
|
||||
void vp9_xform_quant(int plane, int block, BLOCK_SIZE plane_bsize,
|
||||
TX_SIZE tx_size, void *arg) {
|
||||
struct encode_b_args* const args = arg;
|
||||
MACROBLOCK* const x = args->x;
|
||||
@@ -492,7 +492,7 @@ void vp9_xform_quant(int plane, int block, BLOCK_SIZE_TYPE plane_bsize,
|
||||
}
|
||||
}
|
||||
|
||||
static void encode_block(int plane, int block, BLOCK_SIZE_TYPE plane_bsize,
|
||||
static void encode_block(int plane, int block, BLOCK_SIZE plane_bsize,
|
||||
TX_SIZE tx_size, void *arg) {
|
||||
struct encode_b_args *const args = arg;
|
||||
MACROBLOCK *const x = args->x;
|
||||
@@ -536,7 +536,7 @@ static void encode_block(int plane, int block, BLOCK_SIZE_TYPE plane_bsize,
|
||||
}
|
||||
}
|
||||
|
||||
void vp9_encode_sby(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) {
|
||||
void vp9_encode_sby(MACROBLOCK *x, BLOCK_SIZE bsize) {
|
||||
MACROBLOCKD *const xd = &x->e_mbd;
|
||||
struct optimize_ctx ctx;
|
||||
struct encode_b_args arg = {x, &ctx};
|
||||
@@ -548,7 +548,7 @@ void vp9_encode_sby(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) {
|
||||
foreach_transformed_block_in_plane(xd, bsize, 0, encode_block, &arg);
|
||||
}
|
||||
|
||||
void vp9_encode_sb(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) {
|
||||
void vp9_encode_sb(MACROBLOCK *x, BLOCK_SIZE bsize) {
|
||||
MACROBLOCKD *const xd = &x->e_mbd;
|
||||
struct optimize_ctx ctx;
|
||||
struct encode_b_args arg = {x, &ctx};
|
||||
@@ -564,7 +564,7 @@ void vp9_encode_sb(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) {
|
||||
foreach_transformed_block(xd, bsize, encode_block, &arg);
|
||||
}
|
||||
|
||||
void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE_TYPE plane_bsize,
|
||||
void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
|
||||
TX_SIZE tx_size, void *arg) {
|
||||
struct encode_b_args* const args = arg;
|
||||
MACROBLOCK *const x = args->x;
|
||||
@@ -714,7 +714,7 @@ void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE_TYPE plane_bsize,
|
||||
}
|
||||
}
|
||||
|
||||
void vp9_encode_intra_block_y(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) {
|
||||
void vp9_encode_intra_block_y(MACROBLOCK *x, BLOCK_SIZE bsize) {
|
||||
MACROBLOCKD* const xd = &x->e_mbd;
|
||||
struct optimize_ctx ctx;
|
||||
struct encode_b_args arg = {x, &ctx};
|
||||
@@ -722,7 +722,7 @@ void vp9_encode_intra_block_y(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) {
|
||||
foreach_transformed_block_in_plane(xd, bsize, 0, vp9_encode_block_intra,
|
||||
&arg);
|
||||
}
|
||||
void vp9_encode_intra_block_uv(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) {
|
||||
void vp9_encode_intra_block_uv(MACROBLOCK *x, BLOCK_SIZE bsize) {
|
||||
MACROBLOCKD* const xd = &x->e_mbd;
|
||||
struct optimize_ctx ctx;
|
||||
struct encode_b_args arg = {x, &ctx};
|
||||
|
||||
@@ -32,18 +32,18 @@ struct encode_b_args {
|
||||
struct optimize_ctx *ctx;
|
||||
};
|
||||
|
||||
void vp9_encode_sb(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize);
|
||||
void vp9_encode_sby(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize);
|
||||
void vp9_encode_sb(MACROBLOCK *x, BLOCK_SIZE bsize);
|
||||
void vp9_encode_sby(MACROBLOCK *x, BLOCK_SIZE bsize);
|
||||
|
||||
void vp9_xform_quant(int plane, int block, BLOCK_SIZE_TYPE plane_bsize,
|
||||
void vp9_xform_quant(int plane, int block, BLOCK_SIZE plane_bsize,
|
||||
TX_SIZE tx_size, void *arg);
|
||||
|
||||
void vp9_subtract_sby(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize);
|
||||
void vp9_subtract_sbuv(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize);
|
||||
void vp9_subtract_sb(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize);
|
||||
void vp9_subtract_sby(MACROBLOCK *x, BLOCK_SIZE bsize);
|
||||
void vp9_subtract_sbuv(MACROBLOCK *x, BLOCK_SIZE bsize);
|
||||
void vp9_subtract_sb(MACROBLOCK *x, BLOCK_SIZE bsize);
|
||||
|
||||
void vp9_encode_intra_block_y(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize);
|
||||
void vp9_encode_intra_block_uv(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize);
|
||||
void vp9_encode_intra_block_y(MACROBLOCK *x, BLOCK_SIZE bsize);
|
||||
void vp9_encode_intra_block_uv(MACROBLOCK *x, BLOCK_SIZE bsize);
|
||||
|
||||
|
||||
#endif // VP9_ENCODER_VP9_ENCODEMB_H_
|
||||
|
||||
@@ -273,12 +273,12 @@ typedef struct {
|
||||
int use_square_partition_only;
|
||||
int unused_mode_skip_lvl;
|
||||
int reference_masking;
|
||||
BLOCK_SIZE_TYPE always_this_block_size;
|
||||
BLOCK_SIZE always_this_block_size;
|
||||
int auto_min_max_partition_size;
|
||||
int auto_min_max_partition_interval;
|
||||
int auto_min_max_partition_count;
|
||||
BLOCK_SIZE_TYPE min_partition_size;
|
||||
BLOCK_SIZE_TYPE max_partition_size;
|
||||
BLOCK_SIZE min_partition_size;
|
||||
BLOCK_SIZE max_partition_size;
|
||||
int adjust_partitioning_from_last_frame;
|
||||
int last_partitioning_redo_frequency;
|
||||
int disable_splitmv;
|
||||
|
||||
@@ -364,7 +364,7 @@ static void model_rd_from_var_lapndz(int var, int n, int qstep,
|
||||
vp9_clear_system_state();
|
||||
}
|
||||
|
||||
static void model_rd_for_sb(VP9_COMP *cpi, BLOCK_SIZE_TYPE bsize,
|
||||
static void model_rd_for_sb(VP9_COMP *cpi, BLOCK_SIZE bsize,
|
||||
MACROBLOCK *x, MACROBLOCKD *xd,
|
||||
int *out_rate_sum, int64_t *out_dist_sum) {
|
||||
// Note our transform coeffs are 8 times an orthogonal transform.
|
||||
@@ -375,7 +375,7 @@ static void model_rd_for_sb(VP9_COMP *cpi, BLOCK_SIZE_TYPE bsize,
|
||||
for (i = 0; i < MAX_MB_PLANE; ++i) {
|
||||
struct macroblock_plane *const p = &x->plane[i];
|
||||
struct macroblockd_plane *const pd = &xd->plane[i];
|
||||
const BLOCK_SIZE_TYPE bs = get_plane_block_size(bsize, pd);
|
||||
const BLOCK_SIZE bs = get_plane_block_size(bsize, pd);
|
||||
unsigned int sse;
|
||||
int rate;
|
||||
int64_t dist;
|
||||
@@ -393,13 +393,13 @@ static void model_rd_for_sb(VP9_COMP *cpi, BLOCK_SIZE_TYPE bsize,
|
||||
*out_dist_sum = dist_sum << 4;
|
||||
}
|
||||
|
||||
static void model_rd_for_sb_y_tx(VP9_COMP *cpi, BLOCK_SIZE_TYPE bsize,
|
||||
static void model_rd_for_sb_y_tx(VP9_COMP *cpi, BLOCK_SIZE bsize,
|
||||
TX_SIZE tx_size,
|
||||
MACROBLOCK *x, MACROBLOCKD *xd,
|
||||
int *out_rate_sum, int64_t *out_dist_sum,
|
||||
int *out_skip) {
|
||||
int j, k;
|
||||
BLOCK_SIZE_TYPE bs;
|
||||
BLOCK_SIZE bs;
|
||||
struct macroblock_plane *const p = &x->plane[0];
|
||||
struct macroblockd_plane *const pd = &xd->plane[0];
|
||||
const int width = 4 << num_4x4_blocks_wide_lookup[bsize];
|
||||
@@ -576,7 +576,7 @@ static void dist_block(int plane, int block, TX_SIZE tx_size, void *arg) {
|
||||
}
|
||||
}
|
||||
|
||||
static void rate_block(int plane, int block, BLOCK_SIZE_TYPE plane_bsize,
|
||||
static void rate_block(int plane, int block, BLOCK_SIZE plane_bsize,
|
||||
TX_SIZE tx_size, void *arg) {
|
||||
struct rdcost_block_args* args = arg;
|
||||
|
||||
@@ -589,7 +589,7 @@ static void rate_block(int plane, int block, BLOCK_SIZE_TYPE plane_bsize,
|
||||
args->scan, args->nb);
|
||||
}
|
||||
|
||||
static void block_yrd_txfm(int plane, int block, BLOCK_SIZE_TYPE plane_bsize,
|
||||
static void block_yrd_txfm(int plane, int block, BLOCK_SIZE plane_bsize,
|
||||
TX_SIZE tx_size, void *arg) {
|
||||
struct rdcost_block_args *args = arg;
|
||||
MACROBLOCK *const x = args->x;
|
||||
@@ -623,10 +623,10 @@ static void txfm_rd_in_plane(MACROBLOCK *x,
|
||||
int *rate, int64_t *distortion,
|
||||
int *skippable, int64_t *sse,
|
||||
int64_t ref_best_rd, int plane,
|
||||
BLOCK_SIZE_TYPE bsize, TX_SIZE tx_size) {
|
||||
BLOCK_SIZE bsize, TX_SIZE tx_size) {
|
||||
MACROBLOCKD *const xd = &x->e_mbd;
|
||||
struct macroblockd_plane *const pd = &xd->plane[plane];
|
||||
const BLOCK_SIZE_TYPE bs = get_plane_block_size(bsize, pd);
|
||||
const BLOCK_SIZE bs = get_plane_block_size(bsize, pd);
|
||||
const int num_4x4_blocks_wide = num_4x4_blocks_wide_lookup[bs];
|
||||
const int num_4x4_blocks_high = num_4x4_blocks_high_lookup[bs];
|
||||
int i;
|
||||
@@ -684,7 +684,7 @@ static void choose_largest_txfm_size(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
int *rate, int64_t *distortion,
|
||||
int *skip, int64_t *sse,
|
||||
int64_t ref_best_rd,
|
||||
BLOCK_SIZE_TYPE bs) {
|
||||
BLOCK_SIZE bs) {
|
||||
const TX_SIZE max_txfm_size = max_txsize_lookup[bs];
|
||||
VP9_COMMON *const cm = &cpi->common;
|
||||
MACROBLOCKD *const xd = &x->e_mbd;
|
||||
@@ -714,7 +714,7 @@ static void choose_txfm_size_from_rd(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
int64_t *d, int64_t *distortion,
|
||||
int *s, int *skip,
|
||||
int64_t tx_cache[TX_MODES],
|
||||
BLOCK_SIZE_TYPE bs) {
|
||||
BLOCK_SIZE bs) {
|
||||
const TX_SIZE max_tx_size = max_txsize_lookup[bs];
|
||||
VP9_COMMON *const cm = &cpi->common;
|
||||
MACROBLOCKD *const xd = &x->e_mbd;
|
||||
@@ -817,7 +817,7 @@ static void choose_txfm_size_from_modelrd(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
int64_t *d, int64_t *distortion,
|
||||
int *s, int *skip, int64_t *sse,
|
||||
int64_t ref_best_rd,
|
||||
BLOCK_SIZE_TYPE bs) {
|
||||
BLOCK_SIZE bs) {
|
||||
const TX_SIZE max_txfm_size = max_txsize_lookup[bs];
|
||||
VP9_COMMON *const cm = &cpi->common;
|
||||
MACROBLOCKD *const xd = &x->e_mbd;
|
||||
@@ -908,7 +908,7 @@ static void choose_txfm_size_from_modelrd(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
|
||||
static void super_block_yrd(VP9_COMP *cpi,
|
||||
MACROBLOCK *x, int *rate, int64_t *distortion,
|
||||
int *skip, int64_t *psse, BLOCK_SIZE_TYPE bs,
|
||||
int *skip, int64_t *psse, BLOCK_SIZE bs,
|
||||
int64_t txfm_cache[TX_MODES],
|
||||
int64_t ref_best_rd) {
|
||||
int r[TX_SIZES][2], s[TX_SIZES];
|
||||
@@ -993,8 +993,7 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
|
||||
ENTROPY_CONTEXT *a, ENTROPY_CONTEXT *l,
|
||||
int *bestrate, int *bestratey,
|
||||
int64_t *bestdistortion,
|
||||
BLOCK_SIZE_TYPE bsize,
|
||||
int64_t rd_thresh) {
|
||||
BLOCK_SIZE bsize, int64_t rd_thresh) {
|
||||
MB_PREDICTION_MODE mode;
|
||||
MACROBLOCKD *xd = &x->e_mbd;
|
||||
int64_t best_rd = rd_thresh;
|
||||
@@ -1128,7 +1127,7 @@ static int64_t rd_pick_intra_sub_8x8_y_mode(VP9_COMP * const cpi,
|
||||
int64_t best_rd) {
|
||||
int i, j;
|
||||
MACROBLOCKD *const xd = &mb->e_mbd;
|
||||
BLOCK_SIZE_TYPE bsize = xd->mode_info_context->mbmi.sb_type;
|
||||
const BLOCK_SIZE bsize = xd->mode_info_context->mbmi.sb_type;
|
||||
const int num_4x4_blocks_wide = num_4x4_blocks_wide_lookup[bsize];
|
||||
const int num_4x4_blocks_high = num_4x4_blocks_high_lookup[bsize];
|
||||
int idx, idy;
|
||||
@@ -1194,7 +1193,7 @@ static int64_t rd_pick_intra_sub_8x8_y_mode(VP9_COMP * const cpi,
|
||||
static int64_t rd_pick_intra_sby_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
int *rate, int *rate_tokenonly,
|
||||
int64_t *distortion, int *skippable,
|
||||
BLOCK_SIZE_TYPE bsize,
|
||||
BLOCK_SIZE bsize,
|
||||
int64_t tx_cache[TX_MODES],
|
||||
int64_t best_rd) {
|
||||
MB_PREDICTION_MODE mode;
|
||||
@@ -1266,7 +1265,7 @@ static int64_t rd_pick_intra_sby_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
|
||||
static void super_block_uvrd(VP9_COMMON *const cm, MACROBLOCK *x,
|
||||
int *rate, int64_t *distortion, int *skippable,
|
||||
int64_t *sse, BLOCK_SIZE_TYPE bsize,
|
||||
int64_t *sse, BLOCK_SIZE bsize,
|
||||
int64_t ref_best_rd) {
|
||||
MACROBLOCKD *const xd = &x->e_mbd;
|
||||
MB_MODE_INFO *const mbmi = &xd->mode_info_context->mbmi;
|
||||
@@ -1309,7 +1308,7 @@ static void super_block_uvrd(VP9_COMMON *const cm, MACROBLOCK *x,
|
||||
static int64_t rd_pick_intra_sbuv_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
int *rate, int *rate_tokenonly,
|
||||
int64_t *distortion, int *skippable,
|
||||
BLOCK_SIZE_TYPE bsize) {
|
||||
BLOCK_SIZE bsize) {
|
||||
MB_PREDICTION_MODE mode;
|
||||
MB_PREDICTION_MODE mode_selected = DC_PRED;
|
||||
int64_t best_rd = INT64_MAX, this_rd;
|
||||
@@ -1351,7 +1350,7 @@ static int64_t rd_pick_intra_sbuv_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
static int64_t rd_sbuv_dcpred(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
int *rate, int *rate_tokenonly,
|
||||
int64_t *distortion, int *skippable,
|
||||
BLOCK_SIZE_TYPE bsize) {
|
||||
BLOCK_SIZE bsize) {
|
||||
int64_t this_rd;
|
||||
int64_t this_sse;
|
||||
|
||||
@@ -1365,7 +1364,7 @@ static int64_t rd_sbuv_dcpred(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
return this_rd;
|
||||
}
|
||||
|
||||
static void choose_intra_uv_mode(VP9_COMP *cpi, BLOCK_SIZE_TYPE bsize,
|
||||
static void choose_intra_uv_mode(VP9_COMP *cpi, BLOCK_SIZE bsize,
|
||||
int *rate_uv, int *rate_uv_tokenonly,
|
||||
int64_t *dist_uv, int *skip_uv,
|
||||
MB_PREDICTION_MODE *mode_uv) {
|
||||
@@ -1407,13 +1406,13 @@ void vp9_set_mbmode_and_mvs(MACROBLOCK *x, MB_PREDICTION_MODE mb, int_mv *mv) {
|
||||
}
|
||||
|
||||
static void joint_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
BLOCK_SIZE_TYPE bsize,
|
||||
BLOCK_SIZE bsize,
|
||||
int_mv *frame_mv,
|
||||
int mi_row, int mi_col,
|
||||
int_mv single_newmv[MAX_REF_FRAMES],
|
||||
int *rate_mv);
|
||||
static void single_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
BLOCK_SIZE_TYPE bsize,
|
||||
BLOCK_SIZE bsize,
|
||||
int mi_row, int mi_col,
|
||||
int_mv *tmp_mv, int *rate_mv);
|
||||
|
||||
@@ -1501,7 +1500,7 @@ static int64_t encode_inter_mb_segment(VP9_COMP *cpi,
|
||||
MACROBLOCKD *xd = &x->e_mbd;
|
||||
struct macroblockd_plane *const pd = &xd->plane[0];
|
||||
MODE_INFO *const mi = xd->mode_info_context;
|
||||
const BLOCK_SIZE_TYPE bsize = mi->mbmi.sb_type;
|
||||
const BLOCK_SIZE bsize = mi->mbmi.sb_type;
|
||||
const int width = plane_block_width(bsize, pd);
|
||||
const int height = plane_block_height(bsize, pd);
|
||||
int idx, idy;
|
||||
@@ -1644,7 +1643,7 @@ static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
int64_t this_segment_rd = 0;
|
||||
int label_mv_thresh;
|
||||
int segmentyrate = 0;
|
||||
BLOCK_SIZE_TYPE bsize = mbmi->sb_type;
|
||||
const BLOCK_SIZE bsize = mbmi->sb_type;
|
||||
const int num_4x4_blocks_wide = num_4x4_blocks_wide_lookup[bsize];
|
||||
const int num_4x4_blocks_high = num_4x4_blocks_high_lookup[bsize];
|
||||
vp9_variance_fn_ptr_t *v_fn_ptr;
|
||||
@@ -2069,7 +2068,7 @@ static int64_t rd_pick_best_mbsegmentation(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
|
||||
static void mv_pred(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
uint8_t *ref_y_buffer, int ref_y_stride,
|
||||
int ref_frame, BLOCK_SIZE_TYPE block_size ) {
|
||||
int ref_frame, BLOCK_SIZE block_size ) {
|
||||
MACROBLOCKD *xd = &x->e_mbd;
|
||||
MB_MODE_INFO *mbmi = &xd->mode_info_context->mbmi;
|
||||
int_mv this_mv;
|
||||
@@ -2238,7 +2237,7 @@ static void setup_pred_block(const MACROBLOCKD *xd,
|
||||
|
||||
static void setup_buffer_inter(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
int idx, MV_REFERENCE_FRAME frame_type,
|
||||
BLOCK_SIZE_TYPE block_size,
|
||||
BLOCK_SIZE block_size,
|
||||
int mi_row, int mi_col,
|
||||
int_mv frame_nearest_mv[MAX_REF_FRAMES],
|
||||
int_mv frame_near_mv[MAX_REF_FRAMES],
|
||||
@@ -2301,7 +2300,7 @@ static INLINE int get_switchable_rate(const MACROBLOCK *x) {
|
||||
}
|
||||
|
||||
static void single_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
BLOCK_SIZE_TYPE bsize,
|
||||
BLOCK_SIZE bsize,
|
||||
int mi_row, int mi_col,
|
||||
int_mv *tmp_mv, int *rate_mv) {
|
||||
MACROBLOCKD *xd = &x->e_mbd;
|
||||
@@ -2314,7 +2313,7 @@ static void single_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
int_mv mvp_full;
|
||||
int ref = mbmi->ref_frame[0];
|
||||
int_mv ref_mv = mbmi->ref_mvs[ref][0];
|
||||
const BLOCK_SIZE_TYPE block_size = get_plane_block_size(bsize, &xd->plane[0]);
|
||||
const BLOCK_SIZE block_size = get_plane_block_size(bsize, &xd->plane[0]);
|
||||
|
||||
int tmp_col_min = x->mv_col_min;
|
||||
int tmp_col_max = x->mv_col_max;
|
||||
@@ -2427,7 +2426,7 @@ static void single_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
}
|
||||
|
||||
static void joint_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
BLOCK_SIZE_TYPE bsize,
|
||||
BLOCK_SIZE bsize,
|
||||
int_mv *frame_mv,
|
||||
int mi_row, int mi_col,
|
||||
int_mv single_newmv[MAX_REF_FRAMES],
|
||||
@@ -2438,7 +2437,7 @@ static void joint_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
int refs[2] = { mbmi->ref_frame[0],
|
||||
(mbmi->ref_frame[1] < 0 ? 0 : mbmi->ref_frame[1]) };
|
||||
int_mv ref_mv[2];
|
||||
const BLOCK_SIZE_TYPE block_size = get_plane_block_size(bsize, &xd->plane[0]);
|
||||
const BLOCK_SIZE block_size = get_plane_block_size(bsize, &xd->plane[0]);
|
||||
int ite;
|
||||
// Prediction buffer from second frame.
|
||||
uint8_t *second_pred = vpx_memalign(16, pw * ph * sizeof(uint8_t));
|
||||
@@ -2584,7 +2583,7 @@ static void joint_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
}
|
||||
|
||||
static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
BLOCK_SIZE_TYPE bsize,
|
||||
BLOCK_SIZE bsize,
|
||||
int64_t txfm_cache[],
|
||||
int *rate2, int64_t *distortion,
|
||||
int *skippable,
|
||||
@@ -2868,9 +2867,8 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
if (cpi->active_map_enabled && x->active_ptr[0] == 0)
|
||||
x->skip = 1;
|
||||
else if (x->encode_breakout) {
|
||||
const BLOCK_SIZE_TYPE y_size = get_plane_block_size(bsize, &xd->plane[0]);
|
||||
const BLOCK_SIZE_TYPE uv_size = get_plane_block_size(bsize,
|
||||
&xd->plane[1]);
|
||||
const BLOCK_SIZE y_size = get_plane_block_size(bsize, &xd->plane[0]);
|
||||
const BLOCK_SIZE uv_size = get_plane_block_size(bsize, &xd->plane[1]);
|
||||
unsigned int var, sse;
|
||||
// Skipping threshold for ac.
|
||||
unsigned int thresh_ac;
|
||||
@@ -2996,7 +2994,7 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
|
||||
void vp9_rd_pick_intra_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
int *returnrate, int64_t *returndist,
|
||||
BLOCK_SIZE_TYPE bsize,
|
||||
BLOCK_SIZE bsize,
|
||||
PICK_MODE_CONTEXT *ctx, int64_t best_rd) {
|
||||
VP9_COMMON *const cm = &cpi->common;
|
||||
MACROBLOCKD *const xd = &x->e_mbd;
|
||||
@@ -3048,14 +3046,14 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
int mi_row, int mi_col,
|
||||
int *returnrate,
|
||||
int64_t *returndistortion,
|
||||
BLOCK_SIZE_TYPE bsize,
|
||||
BLOCK_SIZE bsize,
|
||||
PICK_MODE_CONTEXT *ctx,
|
||||
int64_t best_rd_so_far) {
|
||||
VP9_COMMON *cm = &cpi->common;
|
||||
MACROBLOCKD *xd = &x->e_mbd;
|
||||
MB_MODE_INFO *mbmi = &xd->mode_info_context->mbmi;
|
||||
const struct segmentation *seg = &cm->seg;
|
||||
const BLOCK_SIZE_TYPE block_size = get_plane_block_size(bsize, &xd->plane[0]);
|
||||
const BLOCK_SIZE block_size = get_plane_block_size(bsize, &xd->plane[0]);
|
||||
MB_PREDICTION_MODE this_mode;
|
||||
MV_REFERENCE_FRAME ref_frame, second_ref_frame;
|
||||
unsigned char segment_id = xd->mode_info_context->mbmi.segment_id;
|
||||
|
||||
@@ -20,12 +20,12 @@ void vp9_initialize_rd_consts(VP9_COMP *cpi, int qindex);
|
||||
void vp9_initialize_me_consts(VP9_COMP *cpi, int qindex);
|
||||
|
||||
void vp9_rd_pick_intra_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
int *r, int64_t *d, BLOCK_SIZE_TYPE bsize,
|
||||
int *r, int64_t *d, BLOCK_SIZE bsize,
|
||||
PICK_MODE_CONTEXT *ctx, int64_t best_rd);
|
||||
|
||||
int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
int mi_row, int mi_col,
|
||||
int *r, int64_t *d, BLOCK_SIZE_TYPE bsize,
|
||||
int *r, int64_t *d, BLOCK_SIZE bsize,
|
||||
PICK_MODE_CONTEXT *ctx, int64_t best_rd);
|
||||
|
||||
void vp9_init_me_luts();
|
||||
|
||||
@@ -138,7 +138,7 @@ static void count_segs(VP9_COMP *cpi, MODE_INFO *mi,
|
||||
|
||||
// Temporal prediction not allowed on key frames
|
||||
if (cm->frame_type != KEY_FRAME) {
|
||||
const BLOCK_SIZE_TYPE bsize = mi->mbmi.sb_type;
|
||||
const BLOCK_SIZE bsize = mi->mbmi.sb_type;
|
||||
// Test to see if the segment id matches the predicted value.
|
||||
const int pred_segment_id = vp9_get_segment_id(cm, cm->last_frame_seg_map,
|
||||
bsize, mi_row, mi_col);
|
||||
@@ -161,7 +161,7 @@ static void count_segs_sb(VP9_COMP *cpi, MODE_INFO *mi,
|
||||
int (*temporal_predictor_count)[2],
|
||||
int *t_unpred_seg_counts,
|
||||
int mi_row, int mi_col,
|
||||
BLOCK_SIZE_TYPE bsize) {
|
||||
BLOCK_SIZE bsize) {
|
||||
const VP9_COMMON *const cm = &cpi->common;
|
||||
const int mis = cm->mode_info_stride;
|
||||
int bw, bh;
|
||||
@@ -187,7 +187,7 @@ static void count_segs_sb(VP9_COMP *cpi, MODE_INFO *mi,
|
||||
count_segs(cpi, mi + hbs, no_pred_segcounts, temporal_predictor_count,
|
||||
t_unpred_seg_counts, hbs, bs, mi_row, mi_col + hbs);
|
||||
} else {
|
||||
const BLOCK_SIZE_TYPE subsize = subsize_lookup[PARTITION_SPLIT][bsize];
|
||||
const BLOCK_SIZE subsize = subsize_lookup[PARTITION_SPLIT][bsize];
|
||||
int n;
|
||||
|
||||
assert(bw < bs && bh < bs);
|
||||
|
||||
@@ -97,8 +97,7 @@ struct tokenize_b_args {
|
||||
TX_SIZE tx_size;
|
||||
};
|
||||
|
||||
static void set_entropy_context_b(int plane, int block,
|
||||
BLOCK_SIZE_TYPE plane_bsize,
|
||||
static void set_entropy_context_b(int plane, int block, BLOCK_SIZE plane_bsize,
|
||||
TX_SIZE tx_size, void *arg) {
|
||||
struct tokenize_b_args* const args = arg;
|
||||
MACROBLOCKD *const xd = args->xd;
|
||||
@@ -108,7 +107,7 @@ static void set_entropy_context_b(int plane, int block,
|
||||
set_contexts(xd, pd, plane_bsize, tx_size, pd->eobs[block] > 0, aoff, loff);
|
||||
}
|
||||
|
||||
static void tokenize_b(int plane, int block, BLOCK_SIZE_TYPE plane_bsize,
|
||||
static void tokenize_b(int plane, int block, BLOCK_SIZE plane_bsize,
|
||||
TX_SIZE tx_size, void *arg) {
|
||||
struct tokenize_b_args* const args = arg;
|
||||
VP9_COMP *cpi = args->cpi;
|
||||
@@ -222,20 +221,20 @@ struct is_skippable_args {
|
||||
};
|
||||
|
||||
static void is_skippable(int plane, int block,
|
||||
BLOCK_SIZE_TYPE plane_bsize, TX_SIZE tx_size,
|
||||
BLOCK_SIZE plane_bsize, TX_SIZE tx_size,
|
||||
void *argv) {
|
||||
struct is_skippable_args *args = argv;
|
||||
args->skippable[0] &= (!args->xd->plane[plane].eobs[block]);
|
||||
}
|
||||
|
||||
int vp9_sb_is_skippable(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) {
|
||||
int vp9_sb_is_skippable(MACROBLOCKD *xd, BLOCK_SIZE bsize) {
|
||||
int result = 1;
|
||||
struct is_skippable_args args = {xd, &result};
|
||||
foreach_transformed_block(xd, bsize, is_skippable, &args);
|
||||
return result;
|
||||
}
|
||||
|
||||
int vp9_is_skippable_in_plane(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize,
|
||||
int vp9_is_skippable_in_plane(MACROBLOCKD *xd, BLOCK_SIZE bsize,
|
||||
int plane) {
|
||||
int result = 1;
|
||||
struct is_skippable_args args = {xd, &result};
|
||||
@@ -244,7 +243,7 @@ int vp9_is_skippable_in_plane(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize,
|
||||
}
|
||||
|
||||
void vp9_tokenize_sb(VP9_COMP *cpi, TOKENEXTRA **t, int dry_run,
|
||||
BLOCK_SIZE_TYPE bsize) {
|
||||
BLOCK_SIZE bsize) {
|
||||
VP9_COMMON *const cm = &cpi->common;
|
||||
MACROBLOCKD *const xd = &cpi->mb.e_mbd;
|
||||
MB_MODE_INFO *const mbmi = &xd->mode_info_context->mbmi;
|
||||
|
||||
@@ -31,13 +31,13 @@ typedef struct {
|
||||
typedef int64_t vp9_coeff_accum[REF_TYPES][COEF_BANDS][PREV_COEF_CONTEXTS]
|
||||
[MAX_ENTROPY_TOKENS + 1];
|
||||
|
||||
int vp9_sb_is_skippable(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize);
|
||||
int vp9_is_skippable_in_plane(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize,
|
||||
int vp9_sb_is_skippable(MACROBLOCKD *xd, BLOCK_SIZE bsize);
|
||||
int vp9_is_skippable_in_plane(MACROBLOCKD *xd, BLOCK_SIZE bsize,
|
||||
int plane);
|
||||
struct VP9_COMP;
|
||||
|
||||
void vp9_tokenize_sb(struct VP9_COMP *cpi, TOKENEXTRA **t, int dry_run,
|
||||
BLOCK_SIZE_TYPE bsize);
|
||||
BLOCK_SIZE bsize);
|
||||
|
||||
#ifdef ENTROPY_STATS
|
||||
void init_context_counters();
|
||||
|
||||
Reference in New Issue
Block a user