ref: 60ff1235367444c5064da38343a607e9c18d8275
parent: 075b11f004fae83f57231be4c4b419090c5e12e6
parent: 89e73c63c0d7a4d57b7648f4d7c17474b33b3cfc
author: Adrian Grange <[email protected]>
date: Fri Aug 2 07:37:47 EDT 2013
Merge "Fixed typos and added a few explanatory comments"
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -572,9 +572,12 @@
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 @@
}
// 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 @@
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 @@
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 @@
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 @@
}
// 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 @@
(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 @@
} 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);
}
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -3448,7 +3448,7 @@
}
}
- // 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 @@
(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