Commit 18e90d74 authored by Deb Mukherjee's avatar Deb Mukherjee
Browse files

Supporting high precision 1/8-pel motion vectors

This is the initial patch for supporting 1/8th pel
motion. Currently if we configure with enable-high-precision-mv,
all motion vectors would default to 1/8 pel. Encode and
decode syncs fine with the current code. In the next phase
the code will be refactored so that we can choose the 1/8
pel mode adaptively at a frame/segment/mb level.

Derf results:
http://www.corp.google.com/~debargha/vp8_results/enhinterp_hpmv.html
(about 0.83% better than 8-tap interpoaltion)

Patch 3: Rebased. Also adding 1/16th pel interpolation for U and V

Patch 4: HD results.
http://www.corp.google.com/~debargha/vp8_results/enhinterp_hd_hpmv.html
Seems impressive (unless I am doing something wrong).

Patch 5: Added mmx/sse for bilateral filtering, as well as enforced
use of c-versions of subpel filters with 8-taps and 1/16th pel;
Also redesigned the 8-tap filters to reduce the cut-off in order to
introduce a denoising effect. There is a new configure option
sixteenth-subpel-uv which will use 1/16 th pel interpolation for
uv, if the motion vectors have 1/8 pel accuracy.

With the fixes the results are promising on the derf set. The enhanced
interpolation option with 8-taps alone gives 3% improvement over thei
derf set:
http://www.corp.google.com/~debargha/vp8_results/enhinterpn.html

Results on high precision mv and on the hd set are to follow.

Patch 6: Adding a missing condition for CONFIG_SIXTEENTH_SUBPEL_UV in
vp8/common/x86/x86_systemdependent.c

Patch 7: Cleaning up various debug messages.

Patch 8: Merge conflict

Change-Id: I5b1d844457aefd7414a9e4e0e06c6ed38fd8cc04
parent 3c872b6c
......@@ -226,6 +226,8 @@ EXPERIMENT_LIST="
enhanced_interp
superblocks
featureupdates
high_precision_mv
sixteenth_subpel_uv
"
CONFIG_LIST="
external_build
......
......@@ -290,8 +290,8 @@ typedef struct MacroBlockD
/* Delta values have the range +/- MAX_LOOP_FILTER */
signed char last_ref_lf_deltas[MAX_REF_LF_DELTAS]; /* 0 = Intra, Last, GF, ARF */
signed char ref_lf_deltas[MAX_REF_LF_DELTAS]; /* 0 = Intra, Last, GF, ARF */
signed char last_mode_lf_deltas[MAX_MODE_LF_DELTAS]; /* 0 = BPRED, ZERO_MV, MV, SPLIT */
signed char mode_lf_deltas[MAX_MODE_LF_DELTAS]; /* 0 = BPRED, ZERO_MV, MV, SPLIT */
signed char last_mode_lf_deltas[MAX_MODE_LF_DELTAS]; /* 0 = BPRED, ZERO_MV, MV, SPLIT */
signed char mode_lf_deltas[MAX_MODE_LF_DELTAS]; /* 0 = BPRED, ZERO_MV, MV, SPLIT */
/* Distance of MB away from frame edges */
int mb_to_left_edge;
......@@ -310,6 +310,9 @@ typedef struct MacroBlockD
vp8_subpix_fn_t subpixel_predict16x16;
vp8_subpix_fn_t subpixel_predict_avg8x8;
vp8_subpix_fn_t subpixel_predict_avg16x16;
#if CONFIG_HIGH_PRECISION_MV
int allow_high_precision_mv;
#endif /* CONFIG_HIGH_PRECISION_MV */
void *current_bc;
......
......@@ -225,6 +225,28 @@ struct vp8_token_struct vp8_mbsplit_encodings [VP8_NUMMBSPLITS];
struct vp8_token_struct vp8_mv_ref_encoding_array [VP8_MVREFS];
struct vp8_token_struct vp8_sub_mv_ref_encoding_array [VP8_SUBMVREFS];
#if CONFIG_HIGH_PRECISION_MV
const vp8_tree_index vp8_small_mvtree [30] =
{
2, 16,
4, 10,
6, 8,
-0, -1,
-2, -3,
12, 14,
-4, -5,
-6, -7,
18, 24,
20, 22,
-8, -9,
-10, -11,
26, 28,
-12, -13,
-14, -15
};
struct vp8_token_struct vp8_small_mvencodings [16];
#else
const vp8_tree_index vp8_small_mvtree [14] =
{
......@@ -236,9 +258,11 @@ const vp8_tree_index vp8_small_mvtree [14] =
-4, -5,
-6, -7
};
struct vp8_token_struct vp8_small_mvencodings [8];
#endif /* CONFIG_HIGH_PRECISION_MV */
void vp8_init_mbmode_probs(VP8_COMMON *x)
{
unsigned int bct [VP8_YMODES] [2]; /* num Ymodes > num UV modes */
......@@ -489,4 +513,3 @@ void print_mv_ref_cts(VP8_COMMON *pc)
printf("\n");
}
}
......@@ -57,7 +57,11 @@ extern struct vp8_token_struct vp8_sub_mv_ref_encoding_array [VP8_SUBMVREFS];
extern const vp8_tree_index vp8_small_mvtree[];
#if CONFIG_HIGH_PRECISION_MV
extern struct vp8_token_struct vp8_small_mvencodings [16];
#else
extern struct vp8_token_struct vp8_small_mvencodings [8];
#endif
void vp8_entropy_mode_init(void);
......
......@@ -11,6 +11,40 @@
#include "entropymv.h"
#if CONFIG_HIGH_PRECISION_MV
const MV_CONTEXT vp8_mv_update_probs[2] =
{
{{
237,
246,
253, 253, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254,
254, 254, 254, 254, 254, 250, 250, 252, 254, 254, 254
}},
{{
231,
243,
245, 253, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254,
254, 254, 254, 254, 254, 251, 251, 254, 254, 254, 254
}}
};
const MV_CONTEXT vp8_default_mv_context[2] =
{
{{
/* row */
162, /* is short */
128, /* sign */
230, 215, 175, 140, 160, 180, 160, 140, 180, 214, 150, 39, 120, 156, 160, /* short tree */
128, 129, 132, 75, 145, 178, 206, 239, 254, 254, 254 /* long bits */
}},
{{
/* same for column */
164, /* is short */
128,
220, 204, 180, 170, 140, 119, 180, 235, 180, 140, 185, 230, 229, 228, 200,
128, 130, 130, 74, 148, 180, 203, 236, 254, 254, 254 /* long bits */
}}
};
#else
const MV_CONTEXT vp8_mv_update_probs[2] =
{
{{
......@@ -35,15 +69,12 @@ const MV_CONTEXT vp8_default_mv_context[2] =
225, 146, 172, 147, 214, 39, 156, /* short tree */
128, 129, 132, 75, 145, 178, 206, 239, 254, 254 /* long bits */
}},
{{
/* same for column */
164, /* is short */
128,
204, 170, 119, 235, 140, 230, 228,
128, 130, 130, 74, 148, 180, 203, 236, 254, 254 /* long bits */
}}
};
#endif /* CONFIG_HIGH_PRECISION_MV */
......@@ -13,16 +13,32 @@
#define __INC_ENTROPYMV_H
#include "treecoder.h"
#include "vpx_config.h"
#if CONFIG_HIGH_PRECISION_MV
#define MV_SHIFT 0
#else
#define MV_SHIFT 1
#endif
enum
{
#if CONFIG_HIGH_PRECISION_MV
mv_max = 2047, /* max absolute value of a MV component */
MVvals = (2 * mv_max) + 1, /* # possible values "" */
mvlong_width = 11, /* Large MVs have 9 bit magnitudes */
mvnum_short = 16, /* magnitudes 0 through 15 */
mvnum_short_bits = 4, /* number of bits for short mvs */
#else
mv_max = 1023, /* max absolute value of a MV component */
MVvals = (2 * mv_max) + 1, /* # possible values "" */
mvfp_max = 255, /* max absolute value of a full pixel MV component */
MVfpvals = (2 * mvfp_max) +1, /* # possible full pixel MV values */
mvlong_width = 10, /* Large MVs have 9 bit magnitudes */
mvnum_short = 8, /* magnitudes 0 through 7 */
mvnum_short_bits = 3, /* number of bits for short mvs */
#endif
mvfp_max = 255, /* max absolute value of a full pixel MV component */
MVfpvals = (2 * mvfp_max) + 1, /* # possible full pixel MV values */
/* probability offsets for coding each MV component */
......
......@@ -13,8 +13,28 @@
#include "filter.h"
#include "vpx_ports/mem.h"
DECLARE_ALIGNED(16, const short, vp8_bilinear_filters[8][2]) =
//#define ANNOUNCE_FUNCTION
DECLARE_ALIGNED(16, const short, vp8_bilinear_filters[SUBPEL_SHIFTS][2]) =
{
#if SUBPEL_SHIFTS==16
{ 128, 0 },
{ 120, 8 },
{ 112, 16 },
{ 104, 24 },
{ 96, 32 },
{ 88, 40 },
{ 80, 48 },
{ 72, 56 },
{ 64, 64 },
{ 56, 72 },
{ 48, 80 },
{ 40, 88 },
{ 32, 96 },
{ 24, 104 },
{ 16, 112 },
{ 8, 120 }
#else
{ 128, 0 },
{ 112, 16 },
{ 96, 32 },
......@@ -23,11 +43,12 @@ DECLARE_ALIGNED(16, const short, vp8_bilinear_filters[8][2]) =
{ 48, 80 },
{ 32, 96 },
{ 16, 112 }
#endif /* SUBPEL_SHIFTS==16 */
};
#if CONFIG_ENHANCED_INTERP
#define FILTER_ALPHA 875
DECLARE_ALIGNED(16, const short, vp8_sub_pel_filters[8][2*INTERP_EXTEND]) =
#define FILTER_ALPHA 65
DECLARE_ALIGNED(16, const short, vp8_sub_pel_filters[SUBPEL_SHIFTS][2*INTERP_EXTEND]) =
{
/* Generated using MATLAB:
* alpha = 0.875;
......@@ -37,37 +58,151 @@ DECLARE_ALIGNED(16, const short, vp8_sub_pel_filters[8][2*INTERP_EXTEND]) =
* % Now normalize the powers of the polyphase components
* disp(num2str(ba, '%d,'))
*/
#if FILTER_ALPHA == 90
/* alpha = 0.9 */
#if SUBPEL_SHIFTS==16
#if FILTER_ALPHA == 80
/* alpha = 0.80 */
{ 0, 0, 0, 128, 0, 0, 0, 0},
{-3, 6, -13, 126, 18, -8, 5, -3},
{-6, 11, -22, 118, 39, -16, 9, -5},
{-8, 14, -27, 104, 62, -23, 13, -7},
{-8, 14, -27, 85, 85, -27, 14, -8},
{-7, 13, -23, 62, 104, -27, 14, -8},
{-5, 9, -16, 39, 118, -22, 11, -6},
{-3, 5, -8, 18, 126, -13, 6, -3}
#elif FILTER_ALPHA == 875
/* alpha = 0.875 */
{-1, 2, -6, 127, 9, -4, 2, -1},
{-2, 5, -12, 124, 18, -7, 4, -2},
{-2, 7, -16, 119, 28, -11, 5, -2},
{-3, 8, -19, 114, 38, -14, 7, -3},
{-3, 9, -22, 107, 49, -17, 8, -3},
{-4, 10, -23, 99, 60, -20, 10, -4},
{-4, 11, -23, 90, 70, -22, 10, -4},
{-4, 11, -23, 80, 80, -23, 11, -4},
{-4, 10, -22, 70, 90, -23, 11, -4},
{-4, 10, -20, 60, 99, -23, 10, -4},
{-3, 8, -17, 49, 107, -22, 9, -3},
{-3, 7, -14, 38, 114, -19, 8, -3},
{-2, 5, -11, 28, 119, -16, 7, -2},
{-2, 4, -7, 18, 124, -12, 5, -2},
{-1, 2, -4, 9, 127, -6, 2, -1}
#elif FILTER_ALPHA == 75
/* alpha = 0.75 */
{ 0, 0, 0, 128, 0, 0, 0, 0},
{-1, 2, -6, 126, 9, -3, 2, -1},
{-1, 4, -11, 123, 18, -7, 3, -1},
{-2, 6, -16, 119, 28, -10, 5, -2},
{-2, 7, -19, 113, 38, -13, 6, -2},
{-3, 8, -21, 106, 49, -16, 7, -2},
{-3, 9, -22, 99, 59, -19, 8, -3},
{-3, 9, -23, 90, 70, -21, 9, -3},
{-3, 9, -22, 80, 80, -22, 9, -3},
{-3, 9, -21, 70, 90, -23, 9, -3},
{-3, 8, -19, 59, 99, -22, 9, -3},
{-2, 7, -16, 49, 106, -21, 8, -3},
{-2, 6, -13, 38, 113, -19, 7, -2},
{-2, 5, -10, 28, 119, -16, 6, -2},
{-1, 3, -7, 18, 123, -11, 4, -1},
{-1, 2, -3, 9, 126, -6, 2, -1}
#elif FILTER_ALPHA == 70
/* alpha = 0.70 */
{ 0, 0, 0, 128, 0, 0, 0, 0},
{ 0, 2, -6, 126, 8, -3, 1, 0},
{-1, 4, -11, 123, 18, -7, 3, -1},
{-1, 5, -15, 119, 27, -10, 4, -1},
{-2, 6, -18, 113, 38, -13, 5, -1},
{-2, 7, -20, 106, 49, -16, 6, -2},
{-2, 8, -22, 98, 59, -18, 7, -2},
{-2, 8, -22, 89, 69, -20, 8, -2},
{-2, 8, -21, 79, 79, -21, 8, -2},
{-2, 8, -20, 69, 89, -22, 8, -2},
{-2, 7, -18, 59, 98, -22, 8, -2},
{-2, 6, -16, 49, 106, -20, 7, -2},
{-1, 5, -13, 38, 113, -18, 6, -2},
{-1, 4, -10, 27, 119, -15, 5, -1},
{-1, 3, -7, 18, 123, -11, 4, -1},
{ 0, 1, -3, 8, 126, -6, 2, 0}
#elif FILTER_ALPHA == 65
/* alpha = 0.65 */
{ 0, 0, 0, 128, 0, 0, 0, 0},
{ 0, 2, -6, 126, 8, -3, 1, 0},
{-1, 3, -10, 123, 18, -6, 2, -1},
{-1, 5, -14, 118, 27, -10, 4, -1},
{-1, 5, -17, 112, 38, -13, 5, -1},
{-2, 6, -19, 106, 48, -15, 5, -1},
{-2, 7, -21, 98, 59, -17, 6, -2},
{-2, 7, -21, 89, 69, -19, 7, -2},
{-2, 7, -20, 79, 79, -20, 7, -2},
{-2, 7, -19, 69, 89, -21, 7, -2},
{-2, 6, -17, 59, 98, -21, 7, -2},
{-1, 5, -15, 48, 106, -19, 6, -2},
{-1, 5, -13, 38, 112, -17, 5, -1},
{-1, 4, -10, 27, 118, -14, 5, -1},
{-1, 2, -6, 18, 123, -10, 3, -1},
{0, 1, -3, 8, 126, -6, 2, 0}
#elif FILTER_ALPHA == 60
/* alpha = 0.60 */
{ 0, 0, 0, 128, 0, 0, 0, 0},
{-3, 6, -13, 126, 18, -8, 4, -2},
{-5, 10, -22, 118, 39, -16, 9, -5},
{-7, 13, -26, 104, 62, -23, 12, -7},
{-7, 13, -27, 85, 85, -27, 13, -7},
{-7, 12, -23, 62, 104, -26, 13, -7},
{-5, 9, -16, 39, 118, -22, 10, -5},
{-2, 4, -8, 18, 126, -13, 6, -3}
#elif FILTER_ALPHA == 85
/* alpha = 0.85 */
{ 0, 2, -6, 126, 8, -3, 1, 0},
{-1, 3, -10, 123, 18, -6, 2, -1},
{-1, 4, -14, 118, 28, -9, 3, -1},
{-1, 5, -17, 112, 38, -12, 4, -1},
{-1, 6, -19, 105, 48, -15, 5, -1},
{-1, 6, -20, 97, 58, -17, 6, -1},
{-1, 6, -20, 88, 69, -19, 6, -1},
{-1, 6, -20, 79, 79, -20, 6, -1},
{-1, 6, -19, 69, 88, -20, 6, -1},
{-1, 6, -17, 58, 97, -20, 6, -1},
{-1, 5, -15, 48, 105, -19, 6, -1},
{-1, 4, -12, 38, 112, -17, 5, -1},
{-1, 3, -9, 28, 118, -14, 4, -1},
{-1, 2, -6, 18, 123, -10, 3, -1},
{0, 1, -3, 8, 126, -6, 2, 0}
#endif /* FILTER_ALPHA */
#else /* SUBPEL_SHIFTS==16 */
#if FILTER_ALPHA == 80
/* alpha = 0.80 */
{ 0, 0, 0, 128, 0, 0, 0, 0},
{-2, 5, -12, 124, 18, -7, 4, -2},
{-4, 10, -20, 114, 39, -15, 8, -4},
{-5, 12, -24, 100, 60, -21, 11, -5},
{-5, 12, -24, 81, 81, -24, 12, -5},
{-5, 11, -21, 60, 100, -24, 12, -5},
{-4, 8, -15, 39, 114, -20, 10, -4},
{-3, 8, -19, 114, 38, -14, 7, -3},
{-4, 10, -23, 99, 60, -20, 10, -4},
{-4, 11, -23, 80, 80, -23, 11, -4},
{-4, 10, -20, 60, 99, -23, 10, -4},
{-3, 7, -14, 38, 114, -19, 8, -3},
{-2, 4, -7, 18, 124, -12, 5, -2}
#endif
#elif FILTER_ALPHA == 75
/* alpha = 0.75 */
{ 0, 0, 0, 128, 0, 0, 0, 0},
{-1, 4, -11, 123, 18, -7, 3, -1},
{-2, 7, -19, 113, 38, -13, 6, -2},
{-3, 9, -22, 99, 59, -19, 8, -3},
{-3, 9, -22, 80, 80, -22, 9, -3},
{-3, 8, -19, 59, 99, -22, 9, -3},
{-2, 6, -13, 38, 113, -19, 7, -2},
{-1, 3, -7, 18, 123, -11, 4, -1}
#elif FILTER_ALPHA == 70
/* alpha = 0.70 */
{ 0, 0, 0, 128, 0, 0, 0, 0},
{-1, 4, -11, 123, 18, -7, 3, -1},
{-2, 6, -18, 113, 38, -13, 5, -1},
{-2, 8, -22, 98, 59, -18, 7, -2},
{-2, 8, -21, 79, 79, -21, 8, -2},
{-2, 7, -18, 59, 98, -22, 8, -2},
{-1, 5, -13, 38, 113, -18, 6, -2},
{-1, 3, -7, 18, 123, -11, 4, -1}
#elif FILTER_ALPHA == 65
/* alpha = 0.65 */
{ 0, 0, 0, 128, 0, 0, 0, 0},
{-1, 3, -10, 123, 18, -6, 2, -1},
{-1, 5, -17, 112, 38, -13, 5, -1},
{-2, 7, -21, 98, 59, -17, 6, -2},
{-2, 7, -20, 79, 79, -20, 7, -2},
{-2, 6, -17, 59, 98, -21, 7, -2},
{-1, 5, -13, 38, 112, -17, 5, -1},
{-1, 2, -6, 18, 123, -10, 3, -1}
#elif FILTER_ALPHA == 60
/* alpha = 0.60 */
{ 0, 0, 0, 128, 0, 0, 0, 0},
{-1, 3, -10, 123, 18, -6, 2, -1},
{-1, 5, -17, 112, 38, -12, 4, -1},
{-1, 6, -20, 97, 58, -17, 6, -1},
{-1, 6, -20, 79, 79, -20, 6, -1},
{-1, 6, -17, 58, 97, -20, 6, -1},
{-1, 4, -12, 38, 112, -17, 5, -1},
{-1, 2, -6, 18, 123, -10, 3, -1}
#endif /* FILTER_ALPHA */
#endif /* SUBPEL_SHIFTS==16 */
};
#if EDGE_PIXEL_FILTER > 0
......@@ -76,139 +211,660 @@ DECLARE_ALIGNED(16, const short, vp8_sub_pel_filters[8][2*INTERP_EXTEND]) =
#define EDGE_GRAD_THRESH 128
#define EDGE_GRADS2X2_THRESH 4
/* TODO: Refine these filters */
DECLARE_ALIGNED(16, const short, vp8_sub_pel_filters_ns[64][4*EDGE_PIXEL_FILTER_EXTEND*EDGE_PIXEL_FILTER_EXTEND]) =
DECLARE_ALIGNED(16, const short, vp8_sub_pel_filters_ns[SUBPEL_SHIFTS*SUBPEL_SHIFTS][4*EDGE_PIXEL_FILTER_EXTEND*EDGE_PIXEL_FILTER_EXTEND]) =
{
#if EDGE_PIXEL_FILTER_EXTEND == 4
#if SUBPEL_SHIFTS==16
#if EDGE_PIXEL_FILTER_EXTEND == 2
{0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, -8, 124, 13, -1, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, -11, 112, 30, -3, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, -11, 94, 51, -6, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, -9, 73, 73, -9, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, -6, 51, 94, -11, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, -3, 30, 112, -11, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, -1, 13, 124, -8, 0, 0, 0, 0, 0, 0, 0, 0},
{0, -8, 0, 0, 0, 124, 0, 0, 0, 13, 0, 0, 0, -1, 0, 0},
{0, -8, -1, 0, -7, 120, 12, 0, -1, 12, 1, 0, 0, 0, 0, 0},
{1, -7, -2, 0, -11, 108, 29, -3, -1, 11, 3, 0, 0, 0, 0, 0},
{0, -6, -3, 0, -10, 91, 49, -6, -1, 9, 5, 0, 0, 0, 0, 0},
{0, -4, -4, 0, -8, 70, 70, -8, -1, 7, 7, -1, 0, 0, 0, 0},
{0, -3, -6, 0, -6, 49, 91, -10, 0, 5, 9, -1, 0, 0, 0, 0},
{0, -2, -7, 1, -3, 29, 108, -11, 0, 3, 11, -1, 0, 0, 0, 0},
{0, -1, -8, 0, 0, 12, 120, -7, 0, 1, 12, -1, 0, 0, 0, 0},
{0, -11, 0, 0, 0, 112, 0, 0, 0, 30, 0, 0, 0, -3, 0, 0},
{1, -11, -1, 0, -7, 108, 11, 0, -2, 29, 3, 0, 0, -3, 0, 0},
{1, -10, -2, 0, -10, 98, 26, -3, -2, 26, 7, 0, 0, -3, 0, 0},
{1, -8, -4, 0, -10, 82, 44, -5, -2, 22, 12, -1, 0, -2, -1, 0},
{0, -6, -6, 0, -7, 64, 64, -7, -2, 17, 17, -2, 0, -2, -2, 0},
{0, -4, -8, 1, -5, 44, 82, -10, -1, 12, 22, -2, 0, -1, -2, 0},
{0, -2, -10, 1, -3, 26, 98, -10, 0, 7, 26, -2, 0, 0, -3, 0},
{0, -1, -11, 1, 0, 11, 108, -7, 0, 3, 29, -2, 0, 0, -3, 0},
{0, -11, 0, 0, 0, 94, 0, 0, 0, 51, 0, 0, 0, -6, 0, 0},
{0, -10, -1, 0, -6, 91, 9, 0, -3, 49, 5, 0, 0, -6, 0, 0},
{1, -10, -2, 0, -8, 82, 22, -2, -4, 44, 12, -1, 0, -5, -1, 0},
{0, -8, -4, 0, -8, 70, 37, -4, -4, 37, 20, -2, 0, -4, -2, 0},
{0, -6, -6, 0, -6, 54, 54, -6, -3, 28, 28, -3, 0, -3, -3, 0},
{0, -4, -8, 0, -4, 37, 70, -8, -2, 20, 37, -4, 0, -2, -4, 0},
{0, -2, -10, 1, -2, 22, 82, -8, -1, 12, 44, -4, 0, -1, -5, 0},
{0, -1, -10, 0, 0, 9, 91, -6, 0, 5, 49, -3, 0, 0, -6, 0},
{0, -9, 0, 0, 0, 73, 0, 0, 0, 73, 0, 0, 0, -9, 0, 0},
{0, -8, -1, 0, -4, 70, 7, 0, -4, 70, 7, 0, 0, -8, -1, 0},
{0, -7, -2, 0, -6, 64, 17, -2, -6, 64, 17, -2, 0, -7, -2, 0},
{0, -6, -3, 0, -6, 54, 28, -3, -6, 54, 28, -3, 0, -6, -3, 0},
{0, -5, -5, 0, -5, 42, 42, -5, -5, 42, 42, -5, 0, -5, -5, 0},
{0, -3, -6, 0, -3, 28, 54, -6, -3, 28, 54, -6, 0, -3, -6, 0},
{0, -2, -7, 0, -2, 17, 64, -6, -2, 17, 64, -6, 0, -2, -7, 0},
{0, -1, -8, 0, 0, 7, 70, -4, 0, 7, 70, -4, 0, -1, -8, 0},
{0, -6, 0, 0, 0, 51, 0, 0, 0, 94, 0, 0, 0, -11, 0, 0},
{0, -6, 0, 0, -3, 49, 5, 0, -6, 91, 9, 0, 0, -10, -1, 0},
{0, -5, -1, 0, -4, 44, 12, -1, -8, 82, 22, -2, 1, -10, -2, 0},
{0, -4, -2, 0, -4, 37, 20, -2, -8, 70, 37, -4, 0, -8, -4, 0},
{0, -3, -3, 0, -3, 28, 28, -3, -6, 54, 54, -6, 0, -6, -6, 0},
{0, -2, -4, 0, -2, 20, 37, -4, -4, 37, 70, -8, 0, -4, -8, 0},
{0, -1, -5, 0, -1, 12, 44, -4, -2, 22, 82, -8, 0, -2, -10, 1},
{0, 0, -6, 0, 0, 5, 49, -3, 0, 9, 91, -6, 0, -1, -10, 0},
{0, -3, 0, 0, 0, 30, 0, 0, 0, 112, 0, 0, 0, -11, 0, 0},
{0, -3, 0, 0, -2, 29, 3, 0, -7, 108, 11, 0, 1, -11, -1, 0},
{0, -3, 0, 0, -2, 26, 7, 0, -10, 98, 26, -3, 1, -10, -2, 0},
{0, -2, -1, 0, -2, 22, 12, -1, -10, 82, 44, -5, 1, -8, -4, 0},
{0, -2, -2, 0, -2, 17, 17, -2, -7, 64, 64, -7, 0, -6, -6, 0},
{0, -1, -2, 0, -1, 12, 22, -2, -5, 44, 82, -10, 0, -4, -8, 1},
{0, 0, -3, 0, 0, 7, 26, -2, -3, 26, 98, -10, 0, -2, -10, 1},
{0, 0, -3, 0, 0, 3, 29, -2, 0, 11, 108, -7, 0, -1, -11, 1},
{0, -1, 0, 0, 0, 13, 0, 0, 0, 124, 0, 0, 0, -8, 0, 0},
{0, 0, 0, 0, -1, 12, 1, 0, -8, 120, 12, 0, 0, -7, -1, 0},
{0, 0, 0, 0, -1, 11, 3, 0, -11, 108, 29, -3, 1, -7, -2, 0},
{0, 0, 0, 0, -1, 9, 5, 0, -10, 91, 49, -6, 0, -6, -3, 0},
{0, 0, 0, 0, -1, 7, 7, -1, -8, 70, 70, -8, 0, -4, -4, 0},
{0, 0, 0, 0, 0, 5, 9, -1, -6, 49, 91, -10, 0, -3, -6, 0},
{0, 0, 0, 0, 0, 3, 11, -1, -3, 29, 108, -11, 0, -2, -7, 1},
{0, 0, 0, 0, 0, 1, 12, -1, 0, 12, 120, -8, 0, -1, -7, 0}
#elif EDGE_PIXEL_FILTER_EXTEND == 6
{0, 1, 0, 0, -7, 128, 9, -3, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 1, 1, 1, -13, 125, 18, -7, 0, 1, 1, 0, 0, 0, 0, 0},
{0, 1, 1, 1, -18, 121, 28, -11, 0, 1, 1, 1, 1, 1, 0, 0},
{0, 1, 1, 1, -22, 116, 39, -15, 0, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, -24, 109, 50, -19, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, -25, 101, 61, -21, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, -25, 92, 72, -23, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, -25, 83, 83, -25, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, -23, 72, 92, -25, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, -21, 61, 101, -25, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, -19, 50, 109, -24, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 0, -15, 39, 116, -22, 1, 1, 1, 0, 1, 1, 1, 1},
{1, 1, 1, 0, -11, 28, 121, -18, 1, 1, 1, 0, 1, 1, 0, 0},
{1, 1, 1, 0, -7, 18, 125, -13, 0, 1, 1, 0, 0, 0, 0, 0},
{0, 0, 1, 0, -3, 9, 128, -7, 0, 0, 0, 0, 0, 0, 0, 0},
{0, -7, 0, 0, 1, 128, 0, 0, 0, 9, 0, 0, 0, -3, 0, 0},
{0, -7, -1, 0, -7, 126, 8, 0, 0, 8, 1, 0, 0, 0, 0, 0},
{1, -7, -1, 1, -13, 124, 18, -7, 0, 9, 2, 1, 0, 0, 0, 0},
{2, -6, -1, 1, -18, 120, 28, -11, -1, 8, 2, 1, 1, 1, 1, 0},
{2, -6, -1, 1, -22, 115, 39, -15, -1, 8, 3, 1, 1, 1, 1, 1},
{2, -5, -2, 1, -24, 109, 50, -18, -1, 8, 4, 0, 1, 1, 1, 1},
{3, -5, -2, 1, -25, 101, 60, -21, -1, 8, 5, 0, 1, 1, 1, 1},
{3, -4, -3, 3, -26, 92, 71, -23, -1, 7, 6, -1, 1, 1, 1, 1},
{3, -3, -3, 3, -25, 82, 82, -25, -1, 6, 6, -1, 1, 1, 1, 1},
{3, -3, -4, 3, -23, 71, 92, -26, -1, 6, 7, -1, 1, 1, 1, 1},
{1, -2, -5, 3, -21, 60, 101, -25, 0, 5, 8, -1, 1, 1, 1, 1},
{1, -2, -5, 2, -18, 50, 109, -24, 0, 4, 8, -1, 1, 1, 1, 1},
{1, -1, -6, 2, -15, 39, 115, -22, 1, 3, 8, -1, 1, 1, 1, 1},
{1, -1, -6, 2, -11, 28, 120, -18, 1, 2, 8, -1, 1, 1, 1, 0},
{1, -1, -7, 1, -7, 18, 124, -13, 1, 2, 9, 0, 0, 0, 0, 0},
{0, -1, -7, 0, 0, 8, 126, -7, 0, 1, 8, 0, 0, 0, 0, 0},
{0, -13, 0, 1, 1, 125, 1, 0, 1, 18, 1, 0, 0, -7, 0, 0},
{1, -13, 0, 1, -7, 124, 9, 1, -1, 18, 2, 0, 0, -7, 0, 0},
{2, -12, -1, 1, -12, 122, 18, -7, -1, 18, 3, 1, 1, -7, 1, 1},
{3, -12, -2, 1, -17, 119, 28, -11, -2, 18, 5, 1, 1, -6, 1, 1},
{4, -11, -3, 1, -21, 114, 38, -14, -2, 17, 7, 1, 1, -6, 1, 1},
{4, -10, -4, 2, -23, 107, 49, -17, -2, 16, 8, -1, 2, -5, 1, 1},
{4, -9, -5, 2, -24, 99, 60, -20, -2, 15, 10, -2, 2, -5, 2, 1},
{4, -8, -6, 4, -25, 90, 70, -22, -2, 14, 11, -2, 2, -4, 1, 1},
{4, -8, -8, 4, -24, 80, 80, -24, -2, 12, 12, -2, 1, 1, 1, 1},
{4, -6, -8, 4, -22, 70, 90, -25, -2, 11, 14, -2, 2, 1, -4, 1},
{2, -5, -9, 4, -20, 60, 99, -24, -2, 10, 15, -2, 2, 2, -5, 1},
{2, -4, -10, 4, -17, 49, 107, -23, -1, 8, 16, -2, 2, 1, -5, 1},
{1, -3, -11, 4, -14, 38, 114, -21, 1, 7, 17, -2, 1, 1, -6, 1},
{1, -2, -12, 3, -11, 28, 119, -17, 1, 5, 18, -2, 1, 1, -6, 1},
{1, -1, -12, 2, -7, 18, 122, -12, 1, 3, 18, -1, 1, 1, -7, 1},
{1, 0, -13, 1, 1, 9, 124, -7, 0, 2, 18, -1, 0, 0, -7, 0},
{0, -18, 0, 1, 1, 121, 1, 1, 1, 28, 1, 1, 1, -11, 0, 0},
{2, -18, -1, 1, -6, 120, 8, 1, -1, 28, 2, 1, 1, -11, 1, 0},
{3, -17, -2, 1, -12, 119, 18, -6, -2, 28, 5, 1, 1, -11, 1, 1},
{4, -16, -3, 2, -16, 115, 27, -10, -3, 27, 7, 1, 1, -10, 1, 1},
{5, -15, -4, 2, -20, 110, 37, -13, -3, 26, 10, -2, 2, -9, 1, 1},
{5, -14, -6, 2, -22, 104, 48, -17, -4, 25, 12, -3, 2, -8, 2, 2},
{6, -12, -7, 2, -23, 96, 59, -19, -4, 24, 15, -3, 2, -7, -3, 2},
{6, -11, -8, 2, -23, 88, 69, -21, -4, 22, 17, -3, 2, -6, -4, 2},
{6, -10, -10, 6, -23, 79, 79, -23, -4, 19, 19, -4, 2, -5, -5, 2},
{2, -8, -11, 6, -21, 69, 88, -23, -3, 17, 22, -4, 2, -4, -6, 2},
{2, -7, -12, 6, -19, 59, 96, -23, -3, 15, 24, -4, 2, -3, -7, 2},
{2, -6, -14, 5, -17, 48, 104, -22, -3, 12, 25, -4, 2, 2, -8, 2},
{2, -4, -15, 5, -13, 37, 110, -20, -2, 10, 26, -3, 2, 1, -9, 1},
{2, -3, -16, 4, -10, 27, 115, -16, 1, 7, 27, -3, 1, 1, -10, 1},
{1, -2, -17, 3, -6, 18, 119, -12, 1, 5, 28, -2, 1, 1, -11, 1},
{1, -1, -18, 2, 1, 8, 120, -6, 1, 2, 28, -1, 1, 1, -11, 0},
{0, -22, 0, 1, 1, 116, 1, 1, 1, 39, 1, 1, 1, -15, 1, 1},
{2, -22, -1, 1, -6, 115, 8, 1, -1, 39, 3, 1, 1, -15, 1, 1},
{4, -21, -2, 1, -11, 114, 17, -6, -3, 38, 7, 1, 1, -14, 1, 1},
{5, -20, -3, 2, -15, 110, 26, -9, -4, 37, 10, 2, 1, -13, -2, 1},
{6, -18, -5, 2, -18, 106, 36, -12, -5, 36, 13, -2, 2, -12, -3, 2},
{7, -17, -6, 2, -20, 100, 46, -15, -5, 34, 17, -4, 2, -11, -4, 2},
{7, -15, -8, 2, -21, 93, 56, -18, -5, 32, 20, -4, 2, -10, -5, 2},
{7, -13, -10, 3, -22, 84, 66, -20, -5, 30, 24, -5, 2, -9, -6, 2},
{3, -12, -12, 3, -21, 76, 76, -21, -5, 27, 27, -5, 3, -7, -7, 3},
{3, -10, -13, 7, -20, 66, 84, -22, -5, 24, 30, -5, 2, -6, -9, 2},
{2, -8, -15, 7, -18, 56, 93, -21, -4, 20, 32, -5, 2, -5, -10, 2},
{2, -6, -17, 7, -15, 46, 100, -20, -4, 17, 34, -5, 2, -4, -11, 2},
{2, -5, -18, 6, -12, 36, 106, -18, -2, 13, 36, -5, 2, -3, -12, 2},
{2, -3, -20, 5, -9, 26, 110, -15, 2, 10, 37, -4, 1, -2, -13, 1},
{1, -2, -21, 4, -6, 17, 114, -11, 1, 7, 38, -3, 1, 1, -14, 1},
{1, -1, -22, 2, 1, 8, 115, -6, 1, 3, 39, -1, 1, 1, -15, 1},
{1, -24, 1, 1, 1, 109, 1, 1, 1, 50, 1, 1, 1, -19, 1, 1},
{2, -24, -1, 1, -5, 109, 8, 1, -2, 50, 4, 1, 1, -18, 0, 1},
{4, -23, -2, 2, -10, 107, 16, -5, -4, 49, 8, 2, 1, -17, -1, 1},
{5, -22, -4, 2, -14, 104, 25, -8, -6, 48, 12, 2, 2, -17, -3, 2},
{7, -20, -5, 2, -17, 100, 34, -11, -6, 46, 17, -4, 2, -15, -4, 2},
{7, -19, -7, 3, -19, 94, 44, -14, -7, 44, 21, -5, 3, -14, -5, 2},
{8, -17, -9, 3, -20, 87, 53, -16, -8, 41, 25, -6, 3, -12, -6, 2},
{3, -15, -11, 3, -20, 80, 63, -18, -7, 38, 30, -6, 3, -11, -7, 3},
{3, -13, -13, 3, -19, 72, 72, -19, -7, 34, 34, -7, 3, -9, -9, 3},
{3, -11, -15, 3, -18, 63, 80, -20, -6, 30, 38, -7, 3, -7, -11, 3},
{3, -9, -17, 8, -16, 53, 87, -20, -6, 25, 41, -8, 3, -6, -12, 2},
{3, -7, -19, 7, -14, 44, 94, -19, -5, 21, 44, -7, 3, -5, -14, 2},
{2, -5, -20, 7, -11, 34, 100, -17, -4, 17, 46, -6, 2, -4, -15, 2},
{2, -4, -22, 5, -8, 25, 104, -14, 2, 12, 48, -6, 2, -3, -17, 2},
{2, -2, -23, 4, -5, 16, 107, -10, 2, 8, 49, -4, 1, -1, -17, 1},
{1, -1, -24, 2, 1, 8, 109, -5, 1, 4, 50, -2, 1, 0, -18, 1},
{1, -25, 1, 1, 1, 101, 1, 1, 1, 61, 1, 1, 1, -21, 1, 1},
{3, -25, -1, 1, -5, 101, 8, 1, -2, 60, 5, 1, 1, -21, 0, 1},
{4, -24, -2, 2, -9, 99, 15, -5, -5, 60, 10, 2, 2, -20, -2, 1},
{6, -23, -4, 2, -12, 96, 24, -7, -7, 59, 15, -3, 2, -19, -3, 2},
{7, -21, -5, 2, -15, 93, 32, -10, -8, 56, 20, -5, 2, -18, -4, 2},
{8, -20, -8, 3, -17, 87, 41, -12, -9, 53, 25, -6, 3, -16, -6, 2},
{3, -18, -9, 3, -18, 81, 50, -14, -9, 50, 31, -7, 3, -14, -7, 3},
{3, -16, -11, 3, -18, 75, 59, -16, -9, 46, 36, -8, 3, -13, -9, 3},
{3, -13, -13, 3, -17, 67, 67, -17, -9, 41, 41, -9, 3, -11, -11, 3},
{3, -11, -16, 3, -16, 59, 75, -18, -8, 36, 46, -9, 3, -9, -13, 3},
{3, -9, -18, 3, -14, 50, 81, -18, -7, 31, 50, -9, 3, -7, -14, 3},
{3, -8, -20, 8, -12, 41, 87, -17, -6, 25, 53, -9, 3, -6, -16, 2},
{2, -5, -21, 7, -10, 32, 93, -15, -5, 20, 56, -8, 2, -4, -18, 2},
{2, -4, -23, 6, -7, 24, 96, -12, -3, 15, 59, -7, 2, -3, -19, 2},