#if CONFIG_OBMC
#include "vp10/common/onyxc_int.h"
#endif // CONFIG_OBMC
+#if CONFIG_GLOBAL_MOTION
+#include "vp10/common/warped_motion.h"
+#endif // CONFIG_GLOBAL_MOTION
#if CONFIG_EXT_INTER
#endif // CONFIG_OBMC
const int is_compound = has_second_ref(&mi->mbmi);
int ref;
+#if CONFIG_GLOBAL_MOTION
+ Global_Motion_Params *gm[2];
+ int is_global[2];
+ for (ref = 0; ref < 1 + is_compound; ++ref) {
+ gm[ref] = &xd->global_motion[mi->mbmi.ref_frame[ref]];
+ is_global[ref] = (get_y_mode(mi, block) == ZEROMV &&
+ get_gmtype(gm[ref]) > GLOBAL_ZERO);
+ }
+ // TODO(sarahparker) remove these once gm works with all experiments
+ (void) gm;
+ (void) is_global;
+#endif // CONFIG_GLOBAL_MOTION
+// TODO(sarahparker) enable the use of DUAL_FILTER in warped motion functions
+// in order to allow GLOBAL_MOTION and DUAL_FILTER to work together
#if CONFIG_DUAL_FILTER
if (mi->mbmi.sb_type < BLOCK_8X8 && plane > 0) {
// block size in log2
#endif // CONFIG_SUPERTX
xd);
else
+#else // CONFIG_EXT_INTER
+#if CONFIG_GLOBAL_MOTION
+ if (is_global[ref])
+ vp10_warp_plane(&(gm[ref]->motion_params),
+#if CONFIG_VP9_HIGHBITDEPTH
+ xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH, xd->bd,
+#endif // CONFIG_VP9_HIGHBITDEPTH
+ pre_buf->buf0, pre_buf->width, pre_buf->height,
+ pre_buf->stride, dst, (mi_x >> pd->subsampling_x) + x,
+ (mi_y >> pd->subsampling_y) + y, w, h, dst_buf->stride,
+ pd->subsampling_x, pd->subsampling_y, xs, ys);
+ else
+#endif // CONFIG_GLOBAL_MOTION
#endif // CONFIG_EXT_INTER
vp10_make_inter_predictor(pre, pre_buf->stride, dst, dst_buf->stride,
subpel_x, subpel_y, sf, w, h, ref,
}
}
-void vp10_warp_plane(WarpedMotionParams *wm,
- uint8_t *ref,
- int width, int height, int stride,
- uint8_t *pred,
- int p_col, int p_row,
- int p_width, int p_height, int p_stride,
- int subsampling_x, int subsampling_y,
- int x_scale, int y_scale) {
+static void warp_plane(WarpedMotionParams *wm,
+ uint8_t *ref,
+ int width, int height, int stride,
+ uint8_t *pred,
+ int p_col, int p_row,
+ int p_width, int p_height, int p_stride,
+ int subsampling_x, int subsampling_y,
+ int x_scale, int y_scale) {
int i, j;
projectPointsType projectPoints = get_projectPointsType(wm->wmtype);
if (projectPoints == NULL)
for (i = p_row; i < p_row + p_height; ++i) {
for (j = p_col; j < p_col + p_width; ++j) {
int in[2], out[2];
+ in[0] = j;
+ in[1] = i;
projectPoints(wm->wmmat, in, out, 1, 2, 2, subsampling_x, subsampling_y);
out[0] = ROUND_POWER_OF_TWO_SIGNED(out[0] * x_scale, 4);
out[1] = ROUND_POWER_OF_TWO_SIGNED(out[1] * y_scale, 4);
}
}
-void vp10_highbd_warp_plane(WarpedMotionParams *wm,
- uint8_t *ref8,
- int width, int height, int stride,
- uint8_t *pred8,
- int p_col, int p_row,
- int p_width, int p_height, int p_stride,
- int subsampling_x, int subsampling_y,
- int x_scale, int y_scale,
- int bd) {
+static void highbd_warp_plane(WarpedMotionParams *wm,
+ uint8_t *ref8,
+ int width, int height, int stride,
+ uint8_t *pred8,
+ int p_col, int p_row,
+ int p_width, int p_height, int p_stride,
+ int subsampling_x, int subsampling_y,
+ int x_scale, int y_scale,
+ int bd) {
int i, j;
projectPointsType projectPoints = get_projectPointsType(wm->wmtype);
uint16_t *pred = CONVERT_TO_SHORTPTR(pred8);
for (i = p_row; i < p_row + p_height; ++i) {
for (j = p_col; j < p_col + p_width; ++j) {
int in[2], out[2];
+ in[0] = j;
+ in[1] = i;
projectPoints(wm->wmmat, in, out, 1, 2, 2, subsampling_x, subsampling_y);
out[0] = ROUND_POWER_OF_TWO_SIGNED(out[0] * x_scale, 4);
out[1] = ROUND_POWER_OF_TWO_SIGNED(out[1] * y_scale, 4);
}
}
#endif // CONFIG_VP9_HIGHBITDEPTH
+
+void vp10_warp_plane(WarpedMotionParams *wm,
+#if CONFIG_VP9_HIGHBITDEPTH
+ int use_hbd, int bd,
+#endif // CONFIG_VP9_HIGHBITDEPTH
+ uint8_t *ref,
+ int width, int height, int stride,
+ uint8_t *pred,
+ int p_col, int p_row,
+ int p_width, int p_height, int p_stride,
+ int subsampling_x, int subsampling_y,
+ int x_scale, int y_scale) {
+#if CONFIG_VP9_HIGHBITDEPTH
+ if (use_hbd)
+ highbd_warp_plane(wm, ref, width, height, stride,
+ pred, p_col, p_row,
+ p_width, p_height, p_stride,
+ subsampling_x, subsampling_y,
+ x_scale, y_scale, bd);
+ else
+#endif // CONFIG_VP9_HIGHBITDEPTH
+ warp_plane(wm, ref, width, height, stride,
+ pred, p_col, p_row,
+ p_width, p_height, p_stride,
+ subsampling_x, subsampling_y,
+ x_scale, y_scale);
+}
} WarpedMotionParams;
void vp10_warp_plane(WarpedMotionParams *wm,
+#if CONFIG_VP9_HIGHBITDEPTH
+ int use_hbd, int bd,
+#endif // CONFIG_VP9_HIGHBITDEPTH
uint8_t *ref,
int width, int height, int stride,
uint8_t *pred,
int p_col, int p_row,
int p_width, int p_height, int p_stride,
- int subsampling_col, int subsampling_row,
+ int subsampling_x, int subsampling_y,
int x_scale, int y_scale);
-#if CONFIG_VP9_HIGHBITDEPTH
-void vp10_highbd_warp_plane(WarpedMotionParams *wm,
- uint8_t *ref,
- int width, int height, int stride,
- uint8_t *pred,
- int p_col, int p_row,
- int p_width, int p_height, int p_stride,
- int subsampling_col, int subsampling_row,
- int x_scale, int y_scale,
- int bd);
-#endif // CONFIG_VP9_HIGHBITDEPTH
#endif // VP10_COMMON_WARPED_MOTION_H