Adding vp9_is_scaled function.

Change-Id: Ieb7077ca3586b9491912027eed450a4f6fd38d30
This commit is contained in:
Dmitry Kovalev 2013-08-22 14:04:59 -07:00
parent 8b810c7a78
commit 640dea4d9d
3 changed files with 9 additions and 8 deletions

View File

@ -257,8 +257,7 @@ void vp9_setup_scale_factors(VP9_COMMON *cm, int i) {
fb->y_crop_width, fb->y_crop_height, fb->y_crop_width, fb->y_crop_height,
cm->width, cm->height); cm->width, cm->height);
if (sf->x_scale_fp != VP9_REF_NO_SCALE || if (vp9_is_scaled(sf))
sf->y_scale_fp != VP9_REF_NO_SCALE)
vp9_extend_frame_borders(fb, cm->subsampling_x, cm->subsampling_y); vp9_extend_frame_borders(fb, cm->subsampling_x, cm->subsampling_y);
} }
} }

View File

@ -40,4 +40,9 @@ void vp9_setup_scale_factors_for_frame(struct VP9Common *cm,
int other_w, int other_h, int other_w, int other_h,
int this_w, int this_h); int this_w, int this_h);
static int vp9_is_scaled(const struct scale_factors *sf) {
return sf->x_scale_fp != VP9_REF_NO_SCALE ||
sf->y_scale_fp != VP9_REF_NO_SCALE;
}
#endif // VP9_COMMON_VP9_SCALE_H_ #endif // VP9_COMMON_VP9_SCALE_H_

View File

@ -2285,8 +2285,7 @@ static void setup_buffer_inter(VP9_COMP *cpi, MACROBLOCK *x,
// Further refinement that is encode side only to test the top few candidates // Further refinement that is encode side only to test the top few candidates
// in full and choose the best as the centre point for subsequent searches. // in full and choose the best as the centre point for subsequent searches.
// The current implementation doesn't support scaling. // The current implementation doesn't support scaling.
if (scale[frame_type].x_scale_fp == VP9_REF_NO_SCALE && if (!vp9_is_scaled(&scale[frame_type]))
scale[frame_type].y_scale_fp == VP9_REF_NO_SCALE)
mv_pred(cpi, x, yv12_mb[frame_type][0].buf, yv12->y_stride, mv_pred(cpi, x, yv12_mb[frame_type][0].buf, yv12->y_stride,
frame_type, block_size); frame_type, block_size);
} }
@ -3272,14 +3271,12 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
// TODO(jingning, jkoleszar): scaling reference frame not supported for // TODO(jingning, jkoleszar): scaling reference frame not supported for
// SPLITMV. // SPLITMV.
if (ref_frame > 0 && if (ref_frame > 0 &&
(scale_factor[ref_frame].x_scale_fp != VP9_REF_NO_SCALE || vp9_is_scaled(&scale_factor[ref_frame]) &&
scale_factor[ref_frame].y_scale_fp != VP9_REF_NO_SCALE) &&
this_mode == SPLITMV) this_mode == SPLITMV)
continue; continue;
if (second_ref_frame > 0 && if (second_ref_frame > 0 &&
(scale_factor[second_ref_frame].x_scale_fp != VP9_REF_NO_SCALE || vp9_is_scaled(&scale_factor[second_ref_frame]) &&
scale_factor[second_ref_frame].y_scale_fp != VP9_REF_NO_SCALE) &&
this_mode == SPLITMV) this_mode == SPLITMV)
continue; continue;