Commit 67246764 authored by Dmitry Kovalev's avatar Dmitry Kovalev

Replacing macros with inline functions.

Change-Id: Ibde8fb45594cd259fc3281d7874de8fc877fd4f2
parent d2bb0c51
......@@ -174,8 +174,10 @@ void vp9_init3smotion_compensation(MACROBLOCK *x, int stride) {
error_per_bit + 4096) >> 13 : 0)
#define SP(x) (((x) & 7) << 1) // convert motion vector component to offset
// for svf calc
// convert motion vector component to offset for svf calc
static INLINE int sp(int x) {
return (x & 7) << 1;
}
#define IFMVCV(r, c, s, e) \
if (c >= minc && c <= maxc && r >= minr && r <= maxr) \
......@@ -183,12 +185,14 @@ void vp9_init3smotion_compensation(MACROBLOCK *x, int stride) {
else \
e;
/* pointer to predictor base of a motionvector */
#define PRE(r, c) (y + (((r) >> 3) * y_stride + ((c) >> 3) -(offset)))
static INLINE uint8_t *pre(uint8_t *buf, int stride, int r, int c, int offset) {
return &buf[(r >> 3) * stride + (c >> 3) - offset];
}
/* returns subpixel variance error function */
#define DIST(r, c) \
vfp->svf(PRE(r, c), y_stride, SP(c), SP(r), z, src_stride, &sse)
vfp->svf(pre(y, y_stride, r, c, offset), y_stride, sp(c), sp(r), z, \
src_stride, &sse)
/* checks if (r, c) has better score than previous best */
#define CHECK_BETTER(v, r, c) \
......@@ -358,7 +362,7 @@ int vp9_find_best_sub_pixel_tree(MACROBLOCK *x,
#undef DIST
/* returns subpixel variance error function */
#define DIST(r, c) \
vfp->svaf(PRE(r, c), y_stride, SP(c), SP(r), \
vfp->svaf(pre(y, y_stride, r, c, offset), y_stride, sp(c), sp(r), \
z, src_stride, &sse, second_pred)
int vp9_find_best_sub_pixel_comp_tree(MACROBLOCK *x,
......
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