ref: fa71882e63e193402f4bb8296936c78535407301
parent: fd6c4c71d6184c4c86c7274fff4fc9e008a6d7da
parent: f1d3e5e4d689122bd41b3c60cbf5cce3b01998b3
author: Paul Wilkins <[email protected]>
date: Thu Oct 3 05:48:49 EDT 2013
Merge "make use last partition consider motion"
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -949,6 +949,26 @@
}
}
+static int sb_has_motion(VP9_COMP *cpi, MODE_INFO **prev_mi_8x8) {
+ VP9_COMMON *const cm = &cpi->common;
+ const int mis = cm->mode_info_stride;
+ int block_row, block_col;
+
+ if (cm->prev_mi) {
+ for (block_row = 0; block_row < 8; ++block_row) {
+ for (block_col = 0; block_col < 8; ++block_col) {
+ MODE_INFO * prev_mi = prev_mi_8x8[block_row * mis + block_col];
+ if (prev_mi) {
+ if (abs(prev_mi->mbmi.mv[0].as_mv.row) >= 8 ||
+ abs(prev_mi->mbmi.mv[0].as_mv.col) >= 8)
+ return 1;
+ }
+ }
+ }
+ }
+ return 0;
+}
+
static void rd_use_partition(VP9_COMP *cpi, MODE_INFO **mi_8x8,
TOKENEXTRA **tp, int mi_row, int mi_col,
BLOCK_SIZE bsize, int *rate, int64_t *dist,
@@ -1760,7 +1780,8 @@
|| cm->prev_mi == 0
|| cpi->common.show_frame == 0
|| cpi->common.frame_type == KEY_FRAME
- || cpi->is_src_frame_alt_ref) {
+ || cpi->is_src_frame_alt_ref
+ || sb_has_motion(cpi, prev_mi_8x8)) {
// If required set upper and lower partition size limits
if (cpi->sf.auto_min_max_partition_size) {
set_offsets(cpi, mi_row, mi_col, BLOCK_64X64);