Commit 06e6d56f authored by Frank Galligan's avatar Frank Galligan Committed by Gerrit Code Review

Revert "Remove struct params from vp8_denoiser_filter"

This reverts commit e516a425

Change-Id: I7c78712acc737ad5f580181cdab3aa76b23f3ca5
parent e516a425
......@@ -532,7 +532,7 @@ specialize qw/vp8_yv12_copy_partial_frame neon/;
# Denoiser filter
#
if (vpx_config("CONFIG_TEMPORAL_DENOISING") eq "yes") {
add_proto qw/int vp8_denoiser_filter/, "unsigned char *mc_running_avg_y, int mc_avg_y_stride, unsigned char *running_avg_y, int avg_y_stride, unsigned char *sig, int sig_stride, unsigned int motion_magnitude";
add_proto qw/int vp8_denoiser_filter/, "struct yv12_buffer_config* mc_running_avg, struct yv12_buffer_config* running_avg, struct macroblock* signal, unsigned int motion_magnitude2, int y_offset, int uv_offset";
specialize qw/vp8_denoiser_filter sse2 neon/;
}
......
......@@ -45,12 +45,10 @@
* [16, 255] 3 6 7
*/
int vp8_denoiser_filter_neon(unsigned char *mc_running_avg_y,
int mc_running_avg_y_stride,
unsigned char *running_avg_y,
int running_avg_y_stride,
unsigned char *sig, int sig_stride,
unsigned int motion_magnitude) {
int vp8_denoiser_filter_neon(YV12_BUFFER_CONFIG *mc_running_avg,
YV12_BUFFER_CONFIG *running_avg,
MACROBLOCK *signal, unsigned int motion_magnitude,
int y_offset, int uv_offset) {
/* If motion_magnitude is small, making the denoiser more aggressive by
* increasing the adjustment for each level, level1 adjustment is
* increased, the deltas stay the same.
......@@ -62,6 +60,14 @@ int vp8_denoiser_filter_neon(unsigned char *mc_running_avg_y,
const uint8x16_t v_level1_threshold = vdupq_n_u8(4);
const uint8x16_t v_level2_threshold = vdupq_n_u8(8);
const uint8x16_t v_level3_threshold = vdupq_n_u8(16);
/* Local variables for array pointers and strides. */
unsigned char *sig = signal->thismb;
int sig_stride = 16;
unsigned char *mc_running_avg_y = mc_running_avg->y_buffer + y_offset;
int mc_running_avg_y_stride = mc_running_avg->y_stride;
unsigned char *running_avg_y = running_avg->y_buffer + y_offset;
int running_avg_y_stride = running_avg->y_stride;
int64x2_t v_sum_diff_total = vdupq_n_s64(0);
/* Go over lines. */
......
......@@ -51,13 +51,17 @@ static const unsigned int SSE_THRESHOLD = 16 * 16 * 40;
* [16, 255] 6 7
*/
int vp8_denoiser_filter_c(unsigned char *mc_running_avg_y, int mc_avg_y_stride,
unsigned char *running_avg_y, int avg_y_stride,
unsigned char *sig, int sig_stride,
unsigned int motion_magnitude)
int vp8_denoiser_filter_c(YV12_BUFFER_CONFIG *mc_running_avg,
YV12_BUFFER_CONFIG *running_avg, MACROBLOCK *signal,
unsigned int motion_magnitude, int y_offset,
int uv_offset)
{
unsigned char *running_avg_y_start = running_avg_y;
unsigned char *sig_start = sig;
unsigned char *sig = signal->thismb;
int sig_stride = 16;
unsigned char *mc_running_avg_y = mc_running_avg->y_buffer + y_offset;
int mc_avg_y_stride = mc_running_avg->y_stride;
unsigned char *running_avg_y = running_avg->y_buffer + y_offset;
int avg_y_stride = running_avg->y_stride;
int r, c, i;
int sum_diff = 0;
int adj_val[3] = {3, 4, 6};
......@@ -126,7 +130,8 @@ int vp8_denoiser_filter_c(unsigned char *mc_running_avg_y, int mc_avg_y_stride,
if (abs(sum_diff) > SUM_DIFF_THRESHOLD)
return COPY_BLOCK;
vp8_copy_mem16x16(running_avg_y_start, avg_y_stride, sig_start, sig_stride);
vp8_copy_mem16x16(running_avg->y_buffer + y_offset, avg_y_stride,
signal->thismb, sig_stride);
return FILTER_BLOCK;
}
......@@ -280,17 +285,12 @@ void vp8_denoiser_denoise_mb(VP8_DENOISER *denoiser,
if (decision == FILTER_BLOCK)
{
unsigned char *mc_running_avg_y =
denoiser->yv12_mc_running_avg.y_buffer + recon_yoffset;
int mc_avg_y_stride = denoiser->yv12_mc_running_avg.y_stride;
unsigned char *running_avg_y =
denoiser->yv12_running_avg[INTRA_FRAME].y_buffer + recon_yoffset;
int avg_y_stride = denoiser->yv12_running_avg[INTRA_FRAME].y_stride;
/* Filter. */
decision = vp8_denoiser_filter(mc_running_avg_y, mc_avg_y_stride,
running_avg_y, avg_y_stride,
x->thismb, 16, motion_magnitude2);
decision = vp8_denoiser_filter(&denoiser->yv12_mc_running_avg,
&denoiser->yv12_running_avg[INTRA_FRAME],
x,
motion_magnitude2,
recon_yoffset, recon_uvoffset);
}
if (decision == COPY_BLOCK)
{
......
......@@ -22,14 +22,17 @@ union sum_union {
signed char e[16];
};
int vp8_denoiser_filter_sse2(unsigned char *mc_running_avg_y,
int mc_avg_y_stride,
unsigned char *running_avg_y, int avg_y_stride,
unsigned char *sig, int sig_stride,
unsigned int motion_magnitude)
int vp8_denoiser_filter_sse2(YV12_BUFFER_CONFIG *mc_running_avg,
YV12_BUFFER_CONFIG *running_avg,
MACROBLOCK *signal, unsigned int motion_magnitude,
int y_offset, int uv_offset)
{
unsigned char *running_avg_y_start = running_avg_y;
unsigned char *sig_start = sig;
unsigned char *sig = signal->thismb;
int sig_stride = 16;
unsigned char *mc_running_avg_y = mc_running_avg->y_buffer + y_offset;
int mc_avg_y_stride = mc_running_avg->y_stride;
unsigned char *running_avg_y = running_avg->y_buffer + y_offset;
int avg_y_stride = running_avg->y_stride;
int r;
__m128i acc_diff = _mm_setzero_si128();
const __m128i k_0 = _mm_setzero_si128();
......@@ -111,6 +114,7 @@ int vp8_denoiser_filter_sse2(unsigned char *mc_running_avg_y,
}
}
vp8_copy_mem16x16(running_avg_y_start, avg_y_stride, sig_start, sig_stride);
vp8_copy_mem16x16(running_avg->y_buffer + y_offset, avg_y_stride,
signal->thismb, sig_stride);
return FILTER_BLOCK;
}
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