Commit 65fd09f7 authored by Josh Holmer's avatar Josh Holmer Committed by GitHub

Add --speed-test option for testing speed settings in isolation (#1008)

This setting is hidden from the CLI help message, since it is intended
to be for benchmarking purposes only.
parent f8265556
......@@ -121,6 +121,24 @@ pub struct SpeedSettings {
pub rdo_tx_decision: bool,
pub prediction_modes: PredictionModesSetting,
pub include_near_mvs: bool,
pub no_scene_detection: bool,
}
impl Default for SpeedSettings {
fn default() -> Self {
SpeedSettings {
min_block_size: BlockSize::BLOCK_32X32,
multiref: false,
fast_deblock: false,
reduced_tx_set: false,
tx_domain_distortion: false,
encode_bottomup: false,
rdo_tx_decision: false,
prediction_modes: PredictionModesSetting::Simple,
include_near_mvs: false,
no_scene_detection: false,
}
}
}
impl SpeedSettings {
......@@ -135,6 +153,7 @@ impl SpeedSettings {
rdo_tx_decision: Self::rdo_tx_decision_preset(speed),
prediction_modes: Self::prediction_modes_preset(speed),
include_near_mvs: Self::include_near_mvs_preset(speed),
no_scene_detection: Self::no_scene_detection_preset(speed),
}
}
......@@ -189,6 +208,10 @@ impl SpeedSettings {
fn include_near_mvs_preset(speed: usize) -> bool {
speed <= 2
}
fn no_scene_detection_preset(speed: usize) -> bool {
speed == 10
}
}
#[allow(dead_code, non_camel_case_types)]
......@@ -781,6 +804,13 @@ impl Context {
if frame_number == 0 {
return FrameType::KEY;
}
if self.config.enc.speed_settings.no_scene_detection {
if frame_number % self.config.enc.max_key_frame_interval == 0 {
return FrameType::KEY;
} else {
return FrameType::INTER;
}
}
let prev_keyframe = self.keyframes.iter()
.rfind(|&&keyframe| keyframe < frame_number)
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment