summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
authorJingning Han <jingning@google.com>2015-01-07 18:36:47 -0800
committerJingning Han <jingning@google.com>2015-01-08 12:32:28 -0800
commite3f0b19f3f12f5a46d485ea4b767fd2885e72012 (patch)
treedefde8f0af4783e7ccecc7455775e72317616676 /vp9
parente535ad50672e3e9c2c874eec38adbe9dc4e4ed99 (diff)
downloadlibvpx-e3f0b19f3f12f5a46d485ea4b767fd2885e72012.tar
libvpx-e3f0b19f3f12f5a46d485ea4b767fd2885e72012.tar.gz
libvpx-e3f0b19f3f12f5a46d485ea4b767fd2885e72012.tar.bz2
libvpx-e3f0b19f3f12f5a46d485ea4b767fd2885e72012.zip
Use lookup table to find pixel numbers in block
This could save one multiplication in each threshold funtion called by the denoiser per block. Change-Id: I35f437e09999f0a087180878ef7805f0d86e5819
Diffstat (limited to 'vp9')
-rw-r--r--vp9/encoder/vp9_denoiser.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/vp9/encoder/vp9_denoiser.c b/vp9/encoder/vp9_denoiser.c
index febad495b..5a99ecade 100644
--- a/vp9/encoder/vp9_denoiser.c
+++ b/vp9/encoder/vp9_denoiser.c
@@ -49,9 +49,7 @@ static int noise_motion_thresh(BLOCK_SIZE bs, int increase_denoising) {
}
static unsigned int sse_thresh(BLOCK_SIZE bs, int increase_denoising) {
- return (4 << b_width_log2_lookup[bs]) *
- (4 << b_height_log2_lookup[bs]) *
- (increase_denoising ? 60 : 40);
+ return (1 << num_pels_log2_lookup[bs]) * (increase_denoising ? 60 : 40);
}
static int sse_diff_thresh(BLOCK_SIZE bs, int increase_denoising,
@@ -60,19 +58,16 @@ static int sse_diff_thresh(BLOCK_SIZE bs, int increase_denoising,
noise_motion_thresh(bs, increase_denoising)) {
return 0;
} else {
- return (4 << b_width_log2_lookup[bs]) *
- (4 << b_height_log2_lookup[bs]) * 20;
+ return (1 << num_pels_log2_lookup[bs]) * 20;
}
}
int total_adj_strong_thresh(BLOCK_SIZE bs, int increase_denoising) {
- return (4 << b_width_log2_lookup[bs]) *
- (4 << b_height_log2_lookup[bs]) * (increase_denoising ? 3 : 2);
+ return (1 << num_pels_log2_lookup[bs]) * (increase_denoising ? 3 : 2);
}
static int total_adj_weak_thresh(BLOCK_SIZE bs, int increase_denoising) {
- return (4 << b_width_log2_lookup[bs]) *
- (4 << b_height_log2_lookup[bs]) * (increase_denoising ? 3 : 2);
+ return (1 << num_pels_log2_lookup[bs]) * (increase_denoising ? 3 : 2);
}
// TODO(jackychen): If increase_denoising is enabled in the future,