summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Paniconi <marpan@google.com>2017-05-11 23:37:30 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-05-11 23:37:32 +0000
commitc64667c3387cbbb399174bf81f8f9b500c62b5bf (patch)
treedb75b4391173b90aa9b354153a68dd1e107d48e9
parent37cdd3bfc27ef2e73da8d07e6f0fc571f52f62f5 (diff)
parentc5c31b9eb6ddbcf413d5333b7a5bd77b89a15b78 (diff)
downloadlibvpx-c64667c3387cbbb399174bf81f8f9b500c62b5bf.tar
libvpx-c64667c3387cbbb399174bf81f8f9b500c62b5bf.tar.gz
libvpx-c64667c3387cbbb399174bf81f8f9b500c62b5bf.tar.bz2
libvpx-c64667c3387cbbb399174bf81f8f9b500c62b5bf.zip
Merge "vp9: SVC: Increase the partiiton and acskip thresholds"
-rw-r--r--vp9/encoder/vp9_denoiser.c19
-rw-r--r--vp9/encoder/vp9_denoiser.h6
-rw-r--r--vp9/encoder/vp9_encodeframe.c5
-rw-r--r--vp9/encoder/vp9_pickmode.c3
4 files changed, 20 insertions, 13 deletions
diff --git a/vp9/encoder/vp9_denoiser.c b/vp9/encoder/vp9_denoiser.c
index 975a39b66..e6933f00d 100644
--- a/vp9/encoder/vp9_denoiser.c
+++ b/vp9/encoder/vp9_denoiser.c
@@ -572,21 +572,26 @@ void vp9_denoiser_set_noise_level(VP9_DENOISER *denoiser, int noise_level) {
// Scale/increase the partition threshold for denoiser speed-up.
int64_t vp9_scale_part_thresh(int64_t threshold, VP9_DENOISER_LEVEL noise_level,
- int content_state) {
+ int content_state, int temporal_layer_id) {
if ((content_state == kLowSadLowSumdiff) ||
(content_state == kHighSadLowSumdiff) ||
- (content_state == kLowVarHighSumdiff) || noise_level == kDenHigh)
- return (3 * threshold) >> 1;
- else
+ (content_state == kLowVarHighSumdiff) || (noise_level == kDenHigh) ||
+ (temporal_layer_id != 0)) {
+ int64_t scaled_thr =
+ (temporal_layer_id < 2) ? (3 * threshold) >> 1 : (7 * threshold) >> 2;
+ return scaled_thr;
+ } else {
return (5 * threshold) >> 2;
+ }
}
// Scale/increase the ac skip threshold for denoiser speed-up.
int64_t vp9_scale_acskip_thresh(int64_t threshold,
- VP9_DENOISER_LEVEL noise_level,
- int abs_sumdiff) {
+ VP9_DENOISER_LEVEL noise_level, int abs_sumdiff,
+ int temporal_layer_id) {
if (noise_level >= kDenLow && abs_sumdiff < 5)
- return threshold *= (noise_level == kDenLow) ? 2 : 6;
+ return threshold *=
+ (noise_level == kDenLow) ? 2 : (temporal_layer_id == 2) ? 10 : 6;
else
return threshold;
}
diff --git a/vp9/encoder/vp9_denoiser.h b/vp9/encoder/vp9_denoiser.h
index 9bded2176..f0845e113 100644
--- a/vp9/encoder/vp9_denoiser.h
+++ b/vp9/encoder/vp9_denoiser.h
@@ -95,11 +95,11 @@ void vp9_denoiser_free(VP9_DENOISER *denoiser);
void vp9_denoiser_set_noise_level(VP9_DENOISER *denoiser, int noise_level);
int64_t vp9_scale_part_thresh(int64_t threshold, VP9_DENOISER_LEVEL noise_level,
- int content_state);
+ int content_state, int temporal_layer_id);
int64_t vp9_scale_acskip_thresh(int64_t threshold,
- VP9_DENOISER_LEVEL noise_level,
- int abs_sumdiff);
+ VP9_DENOISER_LEVEL noise_level, int abs_sumdiff,
+ int temporal_layer_id);
#ifdef __cplusplus
} // extern "C"
diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c
index f58993d9f..0bd8bdbf5 100644
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -540,8 +540,9 @@ static void set_vbp_thresholds(VP9_COMP *cpi, int64_t thresholds[], int q,
#if CONFIG_VP9_TEMPORAL_DENOISING
if (cpi->oxcf.noise_sensitivity > 0 && denoise_svc(cpi) &&
cpi->oxcf.speed > 5 && cpi->denoiser.denoising_level >= kDenLow)
- threshold_base = vp9_scale_part_thresh(
- threshold_base, cpi->denoiser.denoising_level, content_state);
+ threshold_base =
+ vp9_scale_part_thresh(threshold_base, cpi->denoiser.denoising_level,
+ content_state, cpi->svc.temporal_layer_id);
else
threshold_base =
scale_part_thresh_sumdiff(threshold_base, cpi->oxcf.speed, cm->width,
diff --git a/vp9/encoder/vp9_pickmode.c b/vp9/encoder/vp9_pickmode.c
index 40e6d4776..b05f4184b 100644
--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -363,7 +363,8 @@ static void model_rd_for_sb_y_large(VP9_COMP *cpi, BLOCK_SIZE bsize,
if (cpi->oxcf.noise_sensitivity > 0 && denoise_svc(cpi) &&
cpi->oxcf.speed > 5)
ac_thr = vp9_scale_acskip_thresh(ac_thr, cpi->denoiser.denoising_level,
- (abs(sum) >> (bw + bh)));
+ (abs(sum) >> (bw + bh)),
+ cpi->svc.temporal_layer_id);
else
ac_thr *= ac_thr_factor(cpi->oxcf.speed, cpi->common.width,
cpi->common.height, abs(sum) >> (bw + bh));