Commit 611b26bb authored by Deb Mukherjee's avatar Deb Mukherjee Committed by Gerrit Code Review
Browse files

Merge "Removing the implicit compound inter experiment" into experimental

parents 366ff224 735febf1
......@@ -326,11 +326,7 @@ struct scale_factors {
int den,
int offset_q4);
#if CONFIG_IMPLICIT_COMPOUNDINTER_WEIGHT
convolve_fn_t predict[2][2][8]; // horiz, vert, weight (0 - 7)
#else
convolve_fn_t predict[2][2][2]; // horiz, vert, avg
#endif
};
enum { MAX_MB_PLANE = 3 };
......
......@@ -122,78 +122,6 @@ static void convolve_avg_horiz_c(const uint8_t *src, int src_stride,
}
}
#if CONFIG_IMPLICIT_COMPOUNDINTER_WEIGHT
static inline uint8_t combine_qtr(uint8_t a, uint8_t b) {
return (((a) + (b) * 3 + 2) >> 2);
}
static inline uint8_t combine_3qtr(uint8_t a, uint8_t b) {
return (((a) * 3 + (b) + 2) >> 2);
}
static inline uint8_t combine_1by8(uint8_t a, uint8_t b) {
return (((a) * 1 + (b) * 7 + 4) >> 3);
}
static inline uint8_t combine_3by8(uint8_t a, uint8_t b) {
return (((a) * 3 + (b) * 5 + 4) >> 3);
}
static inline uint8_t combine_5by8(uint8_t a, uint8_t b) {
return (((a) * 5 + (b) * 3 + 4) >> 3);
}
static inline uint8_t combine_7by8(uint8_t a, uint8_t b) {
return (((a) * 7 + (b) * 1 + 4) >> 3);
}
// TODO(debargha): Implment with a separate weight parameter
static void convolve_wtd_horiz_c(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x0, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
int w, int h, int taps,
uint8_t (*combine)(uint8_t a, uint8_t b)) {
int x, y, k, sum;
const int16_t *filter_x_base = filter_x0;
#if ALIGN_FILTERS_256
filter_x_base = (const int16_t *)(((intptr_t)filter_x0) & ~(intptr_t)0xff);
#endif
/* Adjust base pointer address for this source line */
src -= taps / 2 - 1;
for (y = 0; y < h; ++y) {
/* Pointer to filter to use */
const int16_t *filter_x = filter_x0;
/* Initial phase offset */
int x0_q4 = (filter_x - filter_x_base) / taps;
int x_q4 = x0_q4;
for (x = 0; x < w; ++x) {
/* Per-pixel src offset */
int src_x = (x_q4 - x0_q4) >> 4;
for (sum = 0, k = 0; k < taps; ++k) {
sum += src[src_x + k] * filter_x[k];
}
sum += (VP9_FILTER_WEIGHT >> 1);
dst[x] = combine(dst[x], clip_pixel(sum >> VP9_FILTER_SHIFT));
/* Adjust source and filter to use for the next pixel */
x_q4 += x_step_q4;
filter_x = filter_x_base + (x_q4 & 0xf) * taps;
}
src += src_stride;
dst += dst_stride;
}
}
#endif
static void convolve_vert_c(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int x_step_q4,
......@@ -279,52 +207,6 @@ static void convolve_avg_vert_c(const uint8_t *src, int src_stride,
}
}
#if CONFIG_IMPLICIT_COMPOUNDINTER_WEIGHT
static void convolve_wtd_vert_c(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y0, int y_step_q4,
int w, int h, int taps,
uint8_t (*combine)(uint8_t a, uint8_t b)) {
int x, y, k, sum;
const int16_t *filter_y_base = filter_y0;
#if ALIGN_FILTERS_256
filter_y_base = (const int16_t *)(((intptr_t)filter_y0) & ~(intptr_t)0xff);
#endif
/* Adjust base pointer address for this source column */
src -= src_stride * (taps / 2 - 1);
for (x = 0; x < w; ++x) {
/* Pointer to filter to use */
const int16_t *filter_y = filter_y0;
/* Initial phase offset */
int y0_q4 = (filter_y - filter_y_base) / taps;
int y_q4 = y0_q4;
for (y = 0; y < h; ++y) {
/* Per-pixel src offset */
int src_y = (y_q4 - y0_q4) >> 4;
for (sum = 0, k = 0; k < taps; ++k) {
sum += src[(src_y + k) * src_stride] * filter_y[k];
}
sum += (VP9_FILTER_WEIGHT >> 1);
dst[y * dst_stride] = combine(dst[y * dst_stride],
clip_pixel(sum >> VP9_FILTER_SHIFT));
/* Adjust source and filter to use for the next pixel */
y_q4 += y_step_q4;
filter_y = filter_y_base + (y_q4 & 0xf) * taps;
}
++src;
++dst;
}
}
#endif
static void convolve_c(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int x_step_q4,
......@@ -403,68 +285,6 @@ void vp9_convolve8_avg_horiz_c(const uint8_t *src, int src_stride,
w, h, 8);
}
#if CONFIG_IMPLICIT_COMPOUNDINTER_WEIGHT
void vp9_convolve8_1by8_horiz_c(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
int w, int h) {
convolve_wtd_horiz_c(src, src_stride, dst, dst_stride,
filter_x, x_step_q4, filter_y, y_step_q4,
w, h, 8, combine_1by8);
}
void vp9_convolve8_qtr_horiz_c(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
int w, int h) {
convolve_wtd_horiz_c(src, src_stride, dst, dst_stride,
filter_x, x_step_q4, filter_y, y_step_q4,
w, h, 8, combine_qtr);
}
void vp9_convolve8_3by8_horiz_c(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
int w, int h) {
convolve_wtd_horiz_c(src, src_stride, dst, dst_stride,
filter_x, x_step_q4, filter_y, y_step_q4,
w, h, 8, combine_3by8);
}
void vp9_convolve8_5by8_horiz_c(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
int w, int h) {
convolve_wtd_horiz_c(src, src_stride, dst, dst_stride,
filter_x, x_step_q4, filter_y, y_step_q4,
w, h, 8, combine_5by8);
}
void vp9_convolve8_3qtr_horiz_c(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
int w, int h) {
convolve_wtd_horiz_c(src, src_stride, dst, dst_stride,
filter_x, x_step_q4, filter_y, y_step_q4,
w, h, 8, combine_3qtr);
}
void vp9_convolve8_7by8_horiz_c(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
int w, int h) {
convolve_wtd_horiz_c(src, src_stride, dst, dst_stride,
filter_x, x_step_q4, filter_y, y_step_q4,
w, h, 8, combine_7by8);
}
#endif
void vp9_convolve8_vert_c(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int x_step_q4,
......@@ -485,68 +305,6 @@ void vp9_convolve8_avg_vert_c(const uint8_t *src, int src_stride,
w, h, 8);
}
#if CONFIG_IMPLICIT_COMPOUNDINTER_WEIGHT
void vp9_convolve8_1by8_vert_c(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
int w, int h) {
convolve_wtd_vert_c(src, src_stride, dst, dst_stride,
filter_x, x_step_q4, filter_y, y_step_q4,
w, h, 8, combine_1by8);
}
void vp9_convolve8_qtr_vert_c(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
int w, int h) {
convolve_wtd_vert_c(src, src_stride, dst, dst_stride,
filter_x, x_step_q4, filter_y, y_step_q4,
w, h, 8, combine_qtr);
}
void vp9_convolve8_3by8_vert_c(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
int w, int h) {
convolve_wtd_vert_c(src, src_stride, dst, dst_stride,
filter_x, x_step_q4, filter_y, y_step_q4,
w, h, 8, combine_3by8);
}
void vp9_convolve8_5by8_vert_c(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
int w, int h) {
convolve_wtd_vert_c(src, src_stride, dst, dst_stride,
filter_x, x_step_q4, filter_y, y_step_q4,
w, h, 8, combine_5by8);
}
void vp9_convolve8_3qtr_vert_c(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
int w, int h) {
convolve_wtd_vert_c(src, src_stride, dst, dst_stride,
filter_x, x_step_q4, filter_y, y_step_q4,
w, h, 8, combine_3qtr);
}
void vp9_convolve8_7by8_vert_c(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
int w, int h) {
convolve_wtd_vert_c(src, src_stride, dst, dst_stride,
filter_x, x_step_q4, filter_y, y_step_q4,
w, h, 8, combine_7by8);
}
#endif
void vp9_convolve8_c(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int x_step_q4,
......@@ -579,140 +337,6 @@ void vp9_convolve8_avg_c(const uint8_t *src, int src_stride,
w, h);
}
#if CONFIG_IMPLICIT_COMPOUNDINTER_WEIGHT
void vp9_convolve8_1by8_c(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
int w, int h) {
/* Fixed size intermediate buffer places limits on parameters. */
DECLARE_ALIGNED_ARRAY(16, uint8_t, temp, 16 * 16);
assert(w <= 16);
assert(h <= 16);
vp9_convolve8(src, src_stride,
temp, 16,
filter_x, x_step_q4,
filter_y, y_step_q4,
w, h);
vp9_convolve_1by8(temp, 16,
dst, dst_stride,
NULL, 0, /* These unused parameter should be removed! */
NULL, 0, /* These unused parameter should be removed! */
w, h);
}
void vp9_convolve8_qtr_c(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
int w, int h) {
/* Fixed size intermediate buffer places limits on parameters. */
DECLARE_ALIGNED_ARRAY(16, uint8_t, temp, 16 * 16);
assert(w <= 16);
assert(h <= 16);
vp9_convolve8(src, src_stride,
temp, 16,
filter_x, x_step_q4,
filter_y, y_step_q4,
w, h);
vp9_convolve_qtr(temp, 16,
dst, dst_stride,
NULL, 0, /* These unused parameter should be removed! */
NULL, 0, /* These unused parameter should be removed! */
w, h);
}
void vp9_convolve8_3by8_c(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
int w, int h) {
/* Fixed size intermediate buffer places limits on parameters. */
DECLARE_ALIGNED_ARRAY(16, uint8_t, temp, 16 * 16);
assert(w <= 16);
assert(h <= 16);
vp9_convolve8(src, src_stride,
temp, 16,
filter_x, x_step_q4,
filter_y, y_step_q4,
w, h);
vp9_convolve_3by8(temp, 16,
dst, dst_stride,
NULL, 0, /* These unused parameter should be removed! */
NULL, 0, /* These unused parameter should be removed! */
w, h);
}
void vp9_convolve8_5by8_c(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
int w, int h) {
/* Fixed size intermediate buffer places limits on parameters. */
DECLARE_ALIGNED_ARRAY(16, uint8_t, temp, 16 * 16);
assert(w <= 16);
assert(h <= 16);
vp9_convolve8(src, src_stride,
temp, 16,
filter_x, x_step_q4,
filter_y, y_step_q4,
w, h);
vp9_convolve_5by8(temp, 16,
dst, dst_stride,
NULL, 0, /* These unused parameter should be removed! */
NULL, 0, /* These unused parameter should be removed! */
w, h);
}
void vp9_convolve8_3qtr_c(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
int w, int h) {
/* Fixed size intermediate buffer places limits on parameters. */
DECLARE_ALIGNED_ARRAY(16, uint8_t, temp, 16 * 16);
assert(w <= 16);
assert(h <= 16);
vp9_convolve8(src, src_stride,
temp, 16,
filter_x, x_step_q4,
filter_y, y_step_q4,
w, h);
vp9_convolve_3qtr(temp, 16,
dst, dst_stride,
NULL, 0, /* These unused parameter should be removed! */
NULL, 0, /* These unused parameter should be removed! */
w, h);
}
void vp9_convolve8_7by8_c(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
int w, int h) {
/* Fixed size intermediate buffer places limits on parameters. */
DECLARE_ALIGNED_ARRAY(16, uint8_t, temp, 16 * 16);
assert(w <= 16);
assert(h <= 16);
vp9_convolve8(src, src_stride,
temp, 16,
filter_x, x_step_q4,
filter_y, y_step_q4,
w, h);
vp9_convolve_7by8(temp, 16,
dst, dst_stride,
NULL, 0, /* These unused parameter should be removed! */
NULL, 0, /* These unused parameter should be removed! */
w, h);
}
#endif
void vp9_convolve_copy(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int filter_x_stride,
......@@ -750,101 +374,3 @@ void vp9_convolve_avg(const uint8_t *src, int src_stride,
dst += dst_stride;
}
}
#if CONFIG_IMPLICIT_COMPOUNDINTER_WEIGHT
void vp9_convolve_1by8(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int filter_x_stride,
const int16_t *filter_y, int filter_y_stride,
int w, int h) {
int x, y;
for (y = 0; y < h; ++y) {
for (x = 0; x < w; ++x) {
dst[x] = combine_1by8(dst[x], src[x]);
}
src += src_stride;
dst += dst_stride;
}
}
void vp9_convolve_qtr(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int filter_x_stride,
const int16_t *filter_y, int filter_y_stride,
int w, int h) {
int x, y;
for (y = 0; y < h; ++y) {
for (x = 0; x < w; ++x) {
dst[x] = combine_qtr(dst[x], src[x]);
}
src += src_stride;
dst += dst_stride;
}
}
void vp9_convolve_3by8(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int filter_x_stride,
const int16_t *filter_y, int filter_y_stride,
int w, int h) {
int x, y;
for (y = 0; y < h; ++y) {
for (x = 0; x < w; ++x) {
dst[x] = combine_3by8(dst[x], src[x]);
}
src += src_stride;
dst += dst_stride;
}
}
void vp9_convolve_5by8(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int filter_x_stride,
const int16_t *filter_y, int filter_y_stride,
int w, int h) {
int x, y;
for (y = 0; y < h; ++y) {
for (x = 0; x < w; ++x) {
dst[x] = combine_5by8(dst[x], src[x]);
}
src += src_stride;
dst += dst_stride;
}
}
void vp9_convolve_3qtr(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int filter_x_stride,
const int16_t *filter_y, int filter_y_stride,
int w, int h) {
int x, y;
for (y = 0; y < h; ++y) {
for (x = 0; x < w; ++x) {
dst[x] = combine_3qtr(dst[x], src[x]);
}
src += src_stride;
dst += dst_stride;
}
}
void vp9_convolve_7by8(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int filter_x_stride,
const int16_t *filter_y, int filter_y_stride,
int w, int h) {
int x, y;
for (y = 0; y < h; ++y) {
for (x = 0; x < w; ++x) {
dst[x] = combine_7by8(dst[x], src[x]);
}
src += src_stride;
dst += dst_stride;
}
}
#endif
......@@ -33,50 +33,6 @@ void vp9_convolve_avg(const uint8_t *src, int src_stride,
const int16_t *filter_y, int y_step_q4,
int w, int h);
#if CONFIG_IMPLICIT_COMPOUNDINTER_WEIGHT
// Not a convolution, a block wtd (1/8, 7/8) average for (dst, src)
void vp9_convolve_1by8(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
int w, int h);
// Not a convolution, a block wtd (1/4, 3/4) average for (dst, src)
void vp9_convolve_qtr(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
int w, int h);
// Not a convolution, a block wtd (3/8, 5/8) average for (dst, src)
void vp9_convolve_3by8(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
int w, int h);
// Not a convolution, a block wtd (5/8, 3/8) average for (dst, src)
void vp9_convolve_5by8(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
int w, int h);
// Not a convolution, a block wtd (3/4, 1/4) average for (dst, src)
void vp9_convolve_3qtr(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
int w, int h);
// Not a convolution, a block wtd (7/8, 1/8) average for (dst, src)
void vp9_convolve_7by8(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
int w, int h);
#endif
struct subpix_fn_table {
const int16_t (*filter_x)[8];
const int16_t (*filter_y)[8];
......
This diff is collapsed.
......@@ -230,62 +230,6 @@ specialize vp9_convolve8_avg_horiz ssse3
prototype void vp9_convolve8_avg_vert "const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h"
specialize vp9_convolve8_avg_vert ssse3
#if CONFIG_IMPLICIT_COMPOUNDINTER_WEIGHT
prototype void vp9_convolve8_1by8 "const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h"
specialize vp9_convolve8_1by8
prototype void vp9_convolve8_qtr "const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h"
specialize vp9_convolve8_qtr
prototype void vp9_convolve8_3by8 "const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h"
specialize vp9_convolve8_3by8
prototype void vp9_convolve8_5by8 "const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h"
specialize vp9_convolve8_5by8
prototype void vp9_convolve8_3qtr "const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h"
specialize vp9_convolve8_3qtr
prototype void vp9_convolve8_7by8 "const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h"
specialize vp9_convolve8_7by8