12 #define TVEDGE(x1,y1,x2,y2) \
13 fabs(Input[HorizontalOffset[x1] + VerticalOffset[y1]] \
14 - Input[HorizontalOffset[x2] + VerticalOffset[y2]])
23 #define WEIGHT_AXIAL 4.545454545454546e-02
24 #define WEIGHT_PI_8 1.181325147609750e-02
25 #define WEIGHT_GREEN_MU 1.111167799007432e+00
26 #define WEIGHT_GREEN_DIAGONAL 5.050762722761053e-02
27 #define WEIGHT_REDBLUE_MU 1.111167799007432e+00
28 #define WEIGHT_REDBLUE_DIAGONAL 5.050762722761053e-02
52 int Width,
int Height,
int RedX,
int RedY)
54 const int Green = 1 - ((RedX + RedY) & 1);
58 int *VerticalOffset = Offsets + (3*NEIGHRADIUS + 1);
62 || Width < NEIGHRADIUS + 1 || Height < NEIGHRADIUS + 1)
65 HorizontalOffset[0] = VerticalOffset[0] = 0;
67 for(y = 0; y < Height; y++)
71 VerticalOffset[-k] = (y >= k) ? -k*Width : (k - 2*y)*Width;
72 VerticalOffset[k] = (y < Height - k) ?
73 k*Width : 2*(Height - k - y)*Width;
76 for(x = 0; x < Width; x++, Input++, Stencil++)
80 HorizontalOffset[-k] = (x >= k) ? -k : (k - 2*x);
81 HorizontalOffset[k] = (x < Width - k) ?
82 k : 2*(Width - k - x);
85 TV[0] =
TVEDGE(-1,-2, 1,-2)
96 TV[4] =
TVEDGE(-1, 0, -1,-2)
108 if(((x + y) & 1) == Green)
110 TV[2] =
TVEDGE(-1,-1, 0,-2)
120 TV[6] =
TVEDGE( 1,-1, 0,-2)
143 TV[2] =
TVEDGE(-2,-1, -1,-2)
154 TV[6] =
TVEDGE( 0,-1, -1,-2)