summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Kovalev <dkovalev@google.com>2013-08-12 14:28:00 -0700
committerDmitry Kovalev <dkovalev@google.com>2013-08-12 14:28:00 -0700
commit9a31d05e24ebcf4c14edd586c10f5fe6385cc395 (patch)
tree966eed943e6a6ef4ac380711f56b97a77bf83e46
parent3984b41c87a4c9db65ee6fbde8224e9f827f50d2 (diff)
downloadlibvpx-9a31d05e24ebcf4c14edd586c10f5fe6385cc395.tar
libvpx-9a31d05e24ebcf4c14edd586c10f5fe6385cc395.tar.gz
libvpx-9a31d05e24ebcf4c14edd586c10f5fe6385cc395.tar.bz2
libvpx-9a31d05e24ebcf4c14edd586c10f5fe6385cc395.zip
Removing unused convolve_avg_c function + cleanup.
Change-Id: Id2b126c6456627c25e4041a82e304d0151d951ba
-rw-r--r--vp9/common/vp9_convolve.c64
1 files changed, 11 insertions, 53 deletions
diff --git a/vp9/common/vp9_convolve.c b/vp9/common/vp9_convolve.c
index 6f1e41866..ca2f83841 100644
--- a/vp9/common/vp9_convolve.c
+++ b/vp9/common/vp9_convolve.c
@@ -237,44 +237,13 @@ static void convolve_c(const uint8_t *src, ptrdiff_t src_stride,
w, h, taps);
}
-static void convolve_avg_c(const uint8_t *src, ptrdiff_t src_stride,
- uint8_t *dst, ptrdiff_t dst_stride,
- const int16_t *filter_x, int x_step_q4,
- const int16_t *filter_y, int y_step_q4,
- int w, int h, int taps) {
- /* Fixed size intermediate buffer places limits on parameters.
- * Maximum intermediate_height is 135, for y_step_q4 == 32,
- * h == 64, taps == 8.
- */
- uint8_t temp[64 * 135];
- int intermediate_height = MAX(((h * y_step_q4) >> 4), 1) + taps - 1;
-
- assert(w <= 64);
- assert(h <= 64);
- assert(taps <= 8);
- assert(y_step_q4 <= 32);
- assert(x_step_q4 <= 32);
-
- if (intermediate_height < h)
- intermediate_height = h;
-
- convolve_horiz_c(src - src_stride * (taps / 2 - 1), src_stride,
- temp, 64,
- filter_x, x_step_q4, filter_y, y_step_q4,
- w, intermediate_height, taps);
- convolve_avg_vert_c(temp + 64 * (taps / 2 - 1), 64, dst, dst_stride,
- filter_x, x_step_q4, filter_y, y_step_q4,
- w, h, taps);
-}
-
void vp9_convolve8_horiz_c(const uint8_t *src, ptrdiff_t src_stride,
uint8_t *dst, ptrdiff_t 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_horiz_c(src, src_stride, dst, dst_stride,
- filter_x, x_step_q4, filter_y, y_step_q4,
- w, h, 8);
+ filter_x, x_step_q4, filter_y, y_step_q4, w, h, 8);
}
void vp9_convolve8_avg_horiz_c(const uint8_t *src, ptrdiff_t src_stride,
@@ -283,8 +252,7 @@ void vp9_convolve8_avg_horiz_c(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, int y_step_q4,
int w, int h) {
convolve_avg_horiz_c(src, src_stride, dst, dst_stride,
- filter_x, x_step_q4, filter_y, y_step_q4,
- w, h, 8);
+ filter_x, x_step_q4, filter_y, y_step_q4, w, h, 8);
}
void vp9_convolve8_vert_c(const uint8_t *src, ptrdiff_t src_stride,
@@ -293,8 +261,7 @@ void vp9_convolve8_vert_c(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, int y_step_q4,
int w, int h) {
convolve_vert_c(src, src_stride, dst, dst_stride,
- filter_x, x_step_q4, filter_y, y_step_q4,
- w, h, 8);
+ filter_x, x_step_q4, filter_y, y_step_q4, w, h, 8);
}
void vp9_convolve8_avg_vert_c(const uint8_t *src, ptrdiff_t src_stride,
@@ -303,8 +270,7 @@ void vp9_convolve8_avg_vert_c(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, int y_step_q4,
int w, int h) {
convolve_avg_vert_c(src, src_stride, dst, dst_stride,
- filter_x, x_step_q4, filter_y, y_step_q4,
- w, h, 8);
+ filter_x, x_step_q4, filter_y, y_step_q4, w, h, 8);
}
void vp9_convolve8_c(const uint8_t *src, ptrdiff_t src_stride,
@@ -313,8 +279,7 @@ void vp9_convolve8_c(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, int y_step_q4,
int w, int h) {
convolve_c(src, src_stride, dst, dst_stride,
- filter_x, x_step_q4, filter_y, y_step_q4,
- w, h, 8);
+ filter_x, x_step_q4, filter_y, y_step_q4, w, h, 8);
}
void vp9_convolve8_avg_c(const uint8_t *src, ptrdiff_t src_stride,
@@ -327,16 +292,9 @@ void vp9_convolve8_avg_c(const uint8_t *src, ptrdiff_t src_stride,
assert(w <= 64);
assert(h <= 64);
- vp9_convolve8(src, src_stride,
- temp, 64,
- filter_x, x_step_q4,
- filter_y, y_step_q4,
- w, h);
- vp9_convolve_avg(temp, 64,
- dst, dst_stride,
- NULL, 0, /* These unused parameter should be removed! */
- NULL, 0, /* These unused parameter should be removed! */
- w, h);
+ vp9_convolve8(src, src_stride, temp, 64,
+ filter_x, x_step_q4, filter_y, y_step_q4, w, h);
+ vp9_convolve_avg(temp, 64, dst, dst_stride, NULL, 0, NULL, 0, w, h);
}
void vp9_convolve_copy_c(const uint8_t *src, ptrdiff_t src_stride,
@@ -361,9 +319,9 @@ void vp9_convolve_avg_c(const uint8_t *src, ptrdiff_t src_stride,
int x, y;
for (y = 0; y < h; ++y) {
- for (x = 0; x < w; ++x) {
- dst[x] = (dst[x] + src[x] + 1) >> 1;
- }
+ for (x = 0; x < w; ++x)
+ dst[x] = ROUND_POWER_OF_TWO(dst[x] + src[x], 1);
+
src += src_stride;
dst += dst_stride;
}