@@ -377,12 +377,10 @@ impl<T: Pixel> SceneChangeDetector<T> {
377
377
// `THRESH_MAX` determines how likely we are
378
378
// to choose a keyframe, between 0.0-1.0.
379
379
// 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 ;
386
384
let distance_from_keyframe = frameno - previous_keyframe;
387
385
let min_keyint = self . encoder_config . min_key_frame_interval ;
388
386
let max_keyint = self . encoder_config . max_key_frame_interval ;
@@ -394,7 +392,7 @@ impl<T: Pixel> SceneChangeDetector<T> {
394
392
395
393
// Adaptive threshold for medium version, static thresholf for the slow one
396
394
let threshold = if self . speed_mode == SceneDetectionSpeed :: Medium {
397
- intra_cost * ( 1.0 - bias) / SCALE_FACTOR
395
+ intra_cost * ( 1.0 - bias)
398
396
} else {
399
397
self . threshold as f64
400
398
} ;
0 commit comments