Skip to content

Commit 54b667c

Browse files
committed
Remove scale factor parameter for medium scenecut detection.
It is redundant with THRESH_MAX and THRESH_MIN. No change on AWCY. https://beta.arewecompressedyet.com/?job=sc-cleanup-2%402021-09-01T05%3A08%3A17.086Z&job=sc-cleanup-1%402021-08-31T13%3A05%3A27.050Z
1 parent afcda68 commit 54b667c

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/scenechange/mod.rs

+5-7
Original file line numberDiff line numberDiff line change
@@ -377,12 +377,10 @@ impl<T: Pixel> SceneChangeDetector<T> {
377377
// `THRESH_MAX` determines how likely we are
378378
// to choose a keyframe, between 0.0-1.0.
379379
// Higher values mean we are more likely to choose a keyframe.
380-
// `0.4` was chosen based on trials of the `scenecut-720p` set in AWCY,
381-
// as it appeared to provide the best average compression.
382-
// This also matches the default scenecut threshold in x264.
383-
const THRESH_MAX: f64 = 0.4;
384-
const THRESH_MIN: f64 = THRESH_MAX * 0.25;
385-
const SCALE_FACTOR: f64 = 3.6;
380+
// `0.833` was chosen based on trials using the new
381+
// adaptive scenecut code.
382+
const THRESH_MAX: f64 = 0.833;
383+
const THRESH_MIN: f64 = 0.75;
386384
let distance_from_keyframe = frameno - previous_keyframe;
387385
let min_keyint = self.encoder_config.min_key_frame_interval;
388386
let max_keyint = self.encoder_config.max_key_frame_interval;
@@ -394,7 +392,7 @@ impl<T: Pixel> SceneChangeDetector<T> {
394392

395393
// Adaptive threshold for medium version, static thresholf for the slow one
396394
let threshold = if self.speed_mode == SceneDetectionSpeed::Medium {
397-
intra_cost * (1.0 - bias) / SCALE_FACTOR
395+
intra_cost * (1.0 - bias)
398396
} else {
399397
self.threshold as f64
400398
};

0 commit comments

Comments
 (0)