vp9: SVC: Increase the partiiton and acskip thresholds
Increase the partition and acskip thresholds for temporal enhancement layers. ~1-2% speedup, with negligible loss in quality. Change-Id: Id527398a05855298ad9ddac10ada972482415627
This commit is contained in:
@@ -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.
|
// Scale/increase the partition threshold for denoiser speed-up.
|
||||||
int64_t vp9_scale_part_thresh(int64_t threshold, VP9_DENOISER_LEVEL 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) {
|
||||||
if ((content_state == kLowSadLowSumdiff) ||
|
if ((content_state == kLowSadLowSumdiff) ||
|
||||||
(content_state == kHighSadLowSumdiff) ||
|
(content_state == kHighSadLowSumdiff) ||
|
||||||
(content_state == kLowVarHighSumdiff) || noise_level == kDenHigh)
|
(content_state == kLowVarHighSumdiff) || (noise_level == kDenHigh) ||
|
||||||
return (3 * threshold) >> 1;
|
(temporal_layer_id != 0)) {
|
||||||
else
|
int64_t scaled_thr =
|
||||||
|
(temporal_layer_id < 2) ? (3 * threshold) >> 1 : (7 * threshold) >> 2;
|
||||||
|
return scaled_thr;
|
||||||
|
} else {
|
||||||
return (5 * threshold) >> 2;
|
return (5 * threshold) >> 2;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Scale/increase the ac skip threshold for denoiser speed-up.
|
// Scale/increase the ac skip threshold for denoiser speed-up.
|
||||||
int64_t vp9_scale_acskip_thresh(int64_t threshold,
|
int64_t vp9_scale_acskip_thresh(int64_t threshold,
|
||||||
VP9_DENOISER_LEVEL noise_level,
|
VP9_DENOISER_LEVEL noise_level, int abs_sumdiff,
|
||||||
int abs_sumdiff) {
|
int temporal_layer_id) {
|
||||||
if (noise_level >= kDenLow && abs_sumdiff < 5)
|
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
|
else
|
||||||
return threshold;
|
return threshold;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,11 +95,11 @@ void vp9_denoiser_free(VP9_DENOISER *denoiser);
|
|||||||
void vp9_denoiser_set_noise_level(VP9_DENOISER *denoiser, int noise_level);
|
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,
|
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,
|
int64_t vp9_scale_acskip_thresh(int64_t threshold,
|
||||||
VP9_DENOISER_LEVEL noise_level,
|
VP9_DENOISER_LEVEL noise_level, int abs_sumdiff,
|
||||||
int abs_sumdiff);
|
int temporal_layer_id);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
|
|||||||
@@ -540,8 +540,9 @@ static void set_vbp_thresholds(VP9_COMP *cpi, int64_t thresholds[], int q,
|
|||||||
#if CONFIG_VP9_TEMPORAL_DENOISING
|
#if CONFIG_VP9_TEMPORAL_DENOISING
|
||||||
if (cpi->oxcf.noise_sensitivity > 0 && denoise_svc(cpi) &&
|
if (cpi->oxcf.noise_sensitivity > 0 && denoise_svc(cpi) &&
|
||||||
cpi->oxcf.speed > 5 && cpi->denoiser.denoising_level >= kDenLow)
|
cpi->oxcf.speed > 5 && cpi->denoiser.denoising_level >= kDenLow)
|
||||||
threshold_base = vp9_scale_part_thresh(
|
threshold_base =
|
||||||
threshold_base, cpi->denoiser.denoising_level, content_state);
|
vp9_scale_part_thresh(threshold_base, cpi->denoiser.denoising_level,
|
||||||
|
content_state, cpi->svc.temporal_layer_id);
|
||||||
else
|
else
|
||||||
threshold_base =
|
threshold_base =
|
||||||
scale_part_thresh_sumdiff(threshold_base, cpi->oxcf.speed, cm->width,
|
scale_part_thresh_sumdiff(threshold_base, cpi->oxcf.speed, cm->width,
|
||||||
|
|||||||
@@ -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) &&
|
if (cpi->oxcf.noise_sensitivity > 0 && denoise_svc(cpi) &&
|
||||||
cpi->oxcf.speed > 5)
|
cpi->oxcf.speed > 5)
|
||||||
ac_thr = vp9_scale_acskip_thresh(ac_thr, cpi->denoiser.denoising_level,
|
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
|
else
|
||||||
ac_thr *= ac_thr_factor(cpi->oxcf.speed, cpi->common.width,
|
ac_thr *= ac_thr_factor(cpi->oxcf.speed, cpi->common.width,
|
||||||
cpi->common.height, abs(sum) >> (bw + bh));
|
cpi->common.height, abs(sum) >> (bw + bh));
|
||||||
|
|||||||
Reference in New Issue
Block a user