ref: 89e73c63c0d7a4d57b7648f4d7c17474b33b3cfc
parent: 5271d478928cc0cf66b1fbbed1fca2bdc0abe5e9
author: Adrian Grange <[email protected]>
date: Thu Aug 1 05:04:15 EDT 2013
Fixed typos and added a few explanatory comments Change-Id: Ib4e4b41094b54874ee34343dd77c0c131ceed9d2
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -554,9 +554,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;
@@ -614,7 +617,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) {
@@ -748,9 +751,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);
@@ -1205,6 +1211,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;
@@ -1438,7 +1446,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,
@@ -1480,7 +1488,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,
@@ -1500,12 +1508,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);
@@ -1924,8 +1935,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
@@ -3451,7 +3451,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)
@@ -4046,7 +4046,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