Merge "Limit mv search range for first pass and mbgraph"
This commit is contained in:
		@@ -534,10 +534,11 @@ void vp9_first_pass(VP9_COMP *cpi) {
 | 
				
			|||||||
    recon_yoffset = (mb_row * recon_y_stride * 16);
 | 
					    recon_yoffset = (mb_row * recon_y_stride * 16);
 | 
				
			||||||
    recon_uvoffset = (mb_row * recon_uv_stride * 8);
 | 
					    recon_uvoffset = (mb_row * recon_uv_stride * 8);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Set up limit values for motion vectors to prevent them extending outside the UMV borders
 | 
					    // Set up limit values for motion vectors to prevent them extending
 | 
				
			||||||
    x->mv_row_min = -((mb_row * 16) + (VP9BORDERINPIXELS - 8));
 | 
					    // outside the UMV borders
 | 
				
			||||||
 | 
					    x->mv_row_min = -((mb_row * 16) + BORDER_MV_PIXELS_B16);
 | 
				
			||||||
    x->mv_row_max = ((cm->mb_rows - 1 - mb_row) * 16)
 | 
					    x->mv_row_max = ((cm->mb_rows - 1 - mb_row) * 16)
 | 
				
			||||||
                    + (VP9BORDERINPIXELS - 8);
 | 
					                    + BORDER_MV_PIXELS_B16;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // for each macroblock col in image
 | 
					    // for each macroblock col in image
 | 
				
			||||||
    for (mb_col = 0; mb_col < cm->mb_cols; mb_col++) {
 | 
					    for (mb_col = 0; mb_col < cm->mb_cols; mb_col++) {
 | 
				
			||||||
@@ -583,9 +584,9 @@ void vp9_first_pass(VP9_COMP *cpi) {
 | 
				
			|||||||
      intra_error += (int64_t)this_error;
 | 
					      intra_error += (int64_t)this_error;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      // Set up limit values for motion vectors to prevent them extending outside the UMV borders
 | 
					      // Set up limit values for motion vectors to prevent them extending outside the UMV borders
 | 
				
			||||||
      x->mv_col_min = -((mb_col * 16) + (VP9BORDERINPIXELS - 8));
 | 
					      x->mv_col_min = -((mb_col * 16) + BORDER_MV_PIXELS_B16);
 | 
				
			||||||
      x->mv_col_max = ((cm->mb_cols - 1 - mb_col) * 16)
 | 
					      x->mv_col_max = ((cm->mb_cols - 1 - mb_col) * 16)
 | 
				
			||||||
                      + (VP9BORDERINPIXELS - 8);
 | 
					                      + BORDER_MV_PIXELS_B16;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      // Other than for the first frame do a motion search
 | 
					      // Other than for the first frame do a motion search
 | 
				
			||||||
      if (cm->current_video_frame > 0) {
 | 
					      if (cm->current_video_frame > 0) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,14 +10,17 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include <limits.h>
 | 
					#include <limits.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <vpx_mem/vpx_mem.h>
 | 
					#include "vpx_mem/vpx_mem.h"
 | 
				
			||||||
#include <vp9/encoder/vp9_encodeintra.h>
 | 
					#include "vp9/encoder/vp9_encodeintra.h"
 | 
				
			||||||
#include <vp9/encoder/vp9_rdopt.h>
 | 
					#include "vp9/encoder/vp9_rdopt.h"
 | 
				
			||||||
#include <vp9/common/vp9_blockd.h>
 | 
					#include "vp9/encoder/vp9_segmentation.h"
 | 
				
			||||||
#include <vp9/common/vp9_reconinter.h>
 | 
					#include "vp9/encoder/vp9_mcomp.h"
 | 
				
			||||||
#include <vp9/common/vp9_reconintra.h>
 | 
					#include "vp9/common/vp9_blockd.h"
 | 
				
			||||||
#include <vp9/common/vp9_systemdependent.h>
 | 
					#include "vp9/common/vp9_reconinter.h"
 | 
				
			||||||
#include <vp9/encoder/vp9_segmentation.h>
 | 
					#include "vp9/common/vp9_reconintra.h"
 | 
				
			||||||
 | 
					#include "vp9/common/vp9_systemdependent.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static unsigned int do_16x16_motion_iteration(VP9_COMP *cpi,
 | 
					static unsigned int do_16x16_motion_iteration(VP9_COMP *cpi,
 | 
				
			||||||
                                              int_mv *ref_mv,
 | 
					                                              int_mv *ref_mv,
 | 
				
			||||||
@@ -246,9 +249,8 @@ static void update_mbgraph_frame_stats(VP9_COMP *cpi,
 | 
				
			|||||||
  // Set up limit values for motion vectors to prevent them extending outside the UMV borders
 | 
					  // Set up limit values for motion vectors to prevent them extending outside the UMV borders
 | 
				
			||||||
  arf_top_mv.as_int = 0;
 | 
					  arf_top_mv.as_int = 0;
 | 
				
			||||||
  gld_top_mv.as_int = 0;
 | 
					  gld_top_mv.as_int = 0;
 | 
				
			||||||
  x->mv_row_min     = -(VP9BORDERINPIXELS - 8 - VP9_INTERP_EXTEND);
 | 
					  x->mv_row_min     = -BORDER_MV_PIXELS_B16;
 | 
				
			||||||
  x->mv_row_max     = (cm->mb_rows - 1) * 8 + VP9BORDERINPIXELS
 | 
					  x->mv_row_max     = (cm->mb_rows - 1) * 8 + BORDER_MV_PIXELS_B16;
 | 
				
			||||||
                      - 8 - VP9_INTERP_EXTEND;
 | 
					 | 
				
			||||||
  xd->up_available  = 0;
 | 
					  xd->up_available  = 0;
 | 
				
			||||||
  xd->plane[0].dst.stride  = buf->y_stride;
 | 
					  xd->plane[0].dst.stride  = buf->y_stride;
 | 
				
			||||||
  xd->plane[0].pre[0].stride  = buf->y_stride;
 | 
					  xd->plane[0].pre[0].stride  = buf->y_stride;
 | 
				
			||||||
@@ -267,9 +269,8 @@ static void update_mbgraph_frame_stats(VP9_COMP *cpi,
 | 
				
			|||||||
    // Set up limit values for motion vectors to prevent them extending outside the UMV borders
 | 
					    // Set up limit values for motion vectors to prevent them extending outside the UMV borders
 | 
				
			||||||
    arf_left_mv.as_int = arf_top_mv.as_int;
 | 
					    arf_left_mv.as_int = arf_top_mv.as_int;
 | 
				
			||||||
    gld_left_mv.as_int = gld_top_mv.as_int;
 | 
					    gld_left_mv.as_int = gld_top_mv.as_int;
 | 
				
			||||||
    x->mv_col_min      = -(VP9BORDERINPIXELS - 8 - VP9_INTERP_EXTEND);
 | 
					    x->mv_col_min      = -BORDER_MV_PIXELS_B16;
 | 
				
			||||||
    x->mv_col_max      = (cm->mb_cols - 1) * 8 + VP9BORDERINPIXELS
 | 
					    x->mv_col_max      = (cm->mb_cols - 1) * 8 + BORDER_MV_PIXELS_B16;
 | 
				
			||||||
                         - 8 - VP9_INTERP_EXTEND;
 | 
					 | 
				
			||||||
    xd->left_available = 0;
 | 
					    xd->left_available = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for (mb_col = 0; mb_col < cm->mb_cols; mb_col++) {
 | 
					    for (mb_col = 0; mb_col < cm->mb_cols; mb_col++) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -22,6 +22,10 @@
 | 
				
			|||||||
#define MAX_FULL_PEL_VAL ((1 << (MAX_MVSEARCH_STEPS)) - 1)
 | 
					#define MAX_FULL_PEL_VAL ((1 << (MAX_MVSEARCH_STEPS)) - 1)
 | 
				
			||||||
// Maximum size of the first step in full pel units
 | 
					// Maximum size of the first step in full pel units
 | 
				
			||||||
#define MAX_FIRST_STEP (1 << (MAX_MVSEARCH_STEPS-1))
 | 
					#define MAX_FIRST_STEP (1 << (MAX_MVSEARCH_STEPS-1))
 | 
				
			||||||
 | 
					// Allowed motion vector pixel distance outside image border
 | 
				
			||||||
 | 
					// for Block_16x16
 | 
				
			||||||
 | 
					#define BORDER_MV_PIXELS_B16 (16 + VP9_INTERP_EXTEND)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void vp9_clamp_mv_min_max(MACROBLOCK *x, MV *mv);
 | 
					void vp9_clamp_mv_min_max(MACROBLOCK *x, MV *mv);
 | 
				
			||||||
int vp9_mv_bit_cost(const MV *mv, const MV *ref,
 | 
					int vp9_mv_bit_cost(const MV *mv, const MV *ref,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user