]> granicus.if.org Git - libvpx/commitdiff
Limit mv range to be based on partition size
authorYaowu Xu <yaowu@google.com>
Fri, 23 Aug 2013 20:29:32 +0000 (13:29 -0700)
committerYaowu Xu <yaowu@google.com>
Fri, 23 Aug 2013 22:43:57 +0000 (15:43 -0700)
Previous change c4048dbd limits the mv search range assuming max block
size of 64x64, this commit change the search range using actual block
size instead.

Change-Id: Ibe07ab02b62bf64bd9f8675d2b997af20a2c7e11

vp9/common/vp9_enums.h
vp9/encoder/vp9_encodeframe.c

index ef9398d4d091afa925839812e14af272b21c164b..9fab56ff9c57f8bef39e6fc96f99bf1367c2418b 100644 (file)
@@ -16,7 +16,6 @@
 #define MI_SIZE_LOG2 3
 #define MI_BLOCK_SIZE_LOG2 (6 - MI_SIZE_LOG2)  // 64 = 2^6
 
-#define MAX_BLOCK_SIZE (1 << 6)  // max block size in pixel
 #define MI_SIZE (1 << MI_SIZE_LOG2)  // pixels per mi-unit
 #define MI_BLOCK_SIZE (1 << MI_BLOCK_SIZE_LOG2)  // mi-units per max block
 
index 2f83212549c91aa836e004f48237cd4da09a9e02..898573155a9b6f8476c36119ff8bcb1d0eb997c2 100644 (file)
@@ -503,8 +503,8 @@ static void set_offsets(VP9_COMP *cpi, int mi_row, int mi_col,
 
   // Set up limit values for MV components
   // mv beyond the range do not produce new/different prediction block
-  x->mv_row_min = -((mi_row * MI_SIZE) + MAX_BLOCK_SIZE + VP9_INTERP_EXTEND);
-  x->mv_col_min = -((mi_col * MI_SIZE) + MAX_BLOCK_SIZE + VP9_INTERP_EXTEND);
+  x->mv_row_min = -(((mi_row + mi_height) * MI_SIZE) + VP9_INTERP_EXTEND);
+  x->mv_col_min = -(((mi_col + mi_width) * MI_SIZE) + VP9_INTERP_EXTEND);
   x->mv_row_max = (cm->mi_rows - mi_row) * MI_SIZE + VP9_INTERP_EXTEND;
   x->mv_col_max = (cm->mi_cols - mi_col) * MI_SIZE + VP9_INTERP_EXTEND;