Merge "Fixed typos and added a few explanatory comments"
This commit is contained in:
Коммит
60ff123536
|
@ -572,9 +572,12 @@ static void pick_sb_modes(VP9_COMP *cpi, int mi_row, int mi_col,
|
|||
|
||||
x->rd_search = 1;
|
||||
|
||||
if (bsize < BLOCK_SIZE_SB8X8)
|
||||
if (bsize < BLOCK_SIZE_SB8X8) {
|
||||
// When ab_index = 0 all sub-blocks are handled, so for ab_index != 0
|
||||
// there is nothing to be done.
|
||||
if (xd->ab_index != 0)
|
||||
return;
|
||||
}
|
||||
|
||||
set_offsets(cpi, mi_row, mi_col, bsize);
|
||||
xd->mode_info_context->mbmi.sb_type = bsize;
|
||||
|
@ -632,7 +635,7 @@ static void update_stats(VP9_COMP *cpi) {
|
|||
}
|
||||
|
||||
// TODO(jingning): the variables used here are little complicated. need further
|
||||
// refactoring on organizing the the temporary buffers, when recursive
|
||||
// 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) {
|
||||
|
@ -766,9 +769,12 @@ static void encode_b(VP9_COMP *cpi, TOKENEXTRA **tp, int mi_row, int mi_col,
|
|||
if (sub_index != -1)
|
||||
*(get_sb_index(xd, bsize)) = sub_index;
|
||||
|
||||
if (bsize < BLOCK_SIZE_SB8X8)
|
||||
if (bsize < BLOCK_SIZE_SB8X8) {
|
||||
// When ab_index = 0 all sub-blocks are handled, so for ab_index != 0
|
||||
// there is nothing to be done.
|
||||
if (xd->ab_index > 0)
|
||||
return;
|
||||
}
|
||||
set_offsets(cpi, mi_row, mi_col, bsize);
|
||||
update_state(cpi, get_block_context(x, bsize), bsize, output_enabled);
|
||||
encode_superblock(cpi, tp, output_enabled, mi_row, mi_col, bsize);
|
||||
|
@ -1223,6 +1229,8 @@ static void rd_use_partition(VP9_COMP *cpi, MODE_INFO *m, TOKENEXTRA **tp,
|
|||
subsize = get_subsize(bsize, partition);
|
||||
|
||||
if (bsize < BLOCK_SIZE_SB8X8) {
|
||||
// When ab_index = 0 all sub-blocks are handled, so for ab_index != 0
|
||||
// there is nothing to be done.
|
||||
if (xd->ab_index != 0) {
|
||||
*rate = 0;
|
||||
*dist = 0;
|
||||
|
@ -1456,7 +1464,7 @@ static BLOCK_SIZE_TYPE max_partition_size[BLOCK_SIZE_TYPES] =
|
|||
BLOCK_64X64, BLOCK_64X64, BLOCK_64X64, BLOCK_64X64, BLOCK_64X64 };
|
||||
|
||||
|
||||
// Look at neighbouring blocks and set a min and max partition size based on
|
||||
// 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,
|
||||
|
@ -1498,7 +1506,7 @@ static void rd_auto_partition_range(VP9_COMP *cpi,
|
|||
}
|
||||
|
||||
// TODO(jingning,jimbankoski,rbultje): properly skip partition types that are
|
||||
// unlikely to be selected depending on previously rate-distortion optimization
|
||||
// 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,
|
||||
|
@ -1518,12 +1526,15 @@ static void rd_pick_partition(VP9_COMP *cpi, TOKENEXTRA **tp, int mi_row,
|
|||
|
||||
(void) *tp_orig;
|
||||
|
||||
if (bsize < BLOCK_SIZE_SB8X8)
|
||||
if (bsize < BLOCK_SIZE_SB8X8) {
|
||||
// When ab_index = 0 all sub-blocks are handled, so for ab_index != 0
|
||||
// there is nothing to be done.
|
||||
if (xd->ab_index != 0) {
|
||||
*rate = 0;
|
||||
*dist = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
assert(mi_height_log2(bsize) == mi_width_log2(bsize));
|
||||
|
||||
save_context(cpi, mi_row, mi_col, a, l, sa, sl, bsize);
|
||||
|
@ -1941,8 +1952,7 @@ static void encode_sb_row(VP9_COMP *cpi, int mi_row, TOKENEXTRA **tp,
|
|||
} else {
|
||||
// If required set upper and lower partition size limits
|
||||
if (cpi->sf.auto_min_max_partition_size) {
|
||||
rd_auto_partition_range(cpi,
|
||||
&cpi->sf.min_partition_size,
|
||||
rd_auto_partition_range(cpi, &cpi->sf.min_partition_size,
|
||||
&cpi->sf.max_partition_size);
|
||||
}
|
||||
|
||||
|
|
|
@ -3448,7 +3448,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
|
|||
}
|
||||
}
|
||||
|
||||
// Select predictors
|
||||
// Select prediction reference frames.
|
||||
for (i = 0; i < MAX_MB_PLANE; i++) {
|
||||
xd->plane[i].pre[0] = yv12_mb[ref_frame][i];
|
||||
if (comp_pred)
|
||||
|
@ -4043,7 +4043,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
|
|||
(cm->mcomp_filter_type == best_mbmode.interp_filter) ||
|
||||
(best_mbmode.ref_frame[0] == INTRA_FRAME));
|
||||
|
||||
// Updating rd_thresh_freq_fact[] here means that the differnt
|
||||
// Updating rd_thresh_freq_fact[] here means that the different
|
||||
// partition/block sizes are handled independently based on the best
|
||||
// choice for the current partition. It may well be better to keep a scaled
|
||||
// best rd so far value and update rd_thresh_freq_fact based on the mode/size
|
||||
|
|
Загрузка…
Ссылка в новой задаче