Commit faf3c2cd authored by Debargha Mukherjee's avatar Debargha Mukherjee

Warped motion functions added

Change-Id: I5064ef1421e17c3ecafe70e7ff1fc7db0c16cc8f
parent 93921097
This diff is collapsed.
/*
* Copyright (c) 2016 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be
* found in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef VP10_COMMON_WARPED_MOTION_H
#define VP10_COMMON_WARPED_MOTION_H
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
#include <math.h>
#include <assert.h>
#include "./vpx_config.h"
#include "vpx_ports/mem.h"
#include "vpx_dsp/vpx_dsp_common.h"
// Bits of precision used for the model
#define WARPEDMODEL_PREC_BITS 8
// Bits of subpel precision for warped interpolation
#define WARPEDPIXEL_PREC_BITS 6
#define WARPEDPIXEL_PREC_SHIFTS (1 << WARPEDPIXEL_PREC_BITS)
// Taps for ntap filter
#define WARPEDPIXEL_FILTER_TAPS 6
// Precision of filter taps
#define WARPEDPIXEL_FILTER_BITS 7
#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
typedef enum {
UNKNOWN_TRANSFORM = -1,
HOMOGRAPHY, // homography, 8-parameter
AFFINE, // affine, 6-parameter
ROTZOOM, // simplified affine with rotation and zoom only, 4-parameter
TRANSLATION // translational motion 2-parameter
} TransformationType;
typedef struct {
TransformationType wmtype;
int wmmat[9];
} WarpedMotionParams;
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_col, int subsampling_row,
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
......@@ -96,6 +96,8 @@ VP10_CX_SRCS-yes += encoder/temporal_filter.c
VP10_CX_SRCS-yes += encoder/temporal_filter.h
VP10_CX_SRCS-yes += encoder/mbgraph.c
VP10_CX_SRCS-yes += encoder/mbgraph.h
VP10_CX_SRCS-$(CONFIG_GLOBAL_MOTION) += common/warped_motion.h
VP10_CX_SRCS-$(CONFIG_GLOBAL_MOTION) += common/warped_motion.c
VP10_CX_SRCS-$(HAVE_SSE2) += encoder/x86/temporal_filter_apply_sse2.asm
VP10_CX_SRCS-$(HAVE_SSE2) += encoder/x86/quantize_sse2.c
......
......@@ -51,6 +51,11 @@
(((value) < 0) ? -ROUND_POWER_OF_TWO(-(value), (n)) \
: ROUND_POWER_OF_TWO((value), (n)))
/* Shift down with rounding for signed integers, for use when n >= 0 */
#define ROUNDZ_POWER_OF_TWO_SIGNED(value, n) \
(((value) < 0) ? -ROUNDZ_POWER_OF_TWO(-(value), (n)) \
: ROUNDZ_POWER_OF_TWO((value), (n)))
#define ALIGN_POWER_OF_TWO(value, n) \
(((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment