Commit fc087a0a authored by Romain Vimont's avatar Romain Vimont Committed by Thomas Daede

Add command line arguments for tiling

Add --tile-cols-log2 and --tile-rows-log2 to configure tiling.

This configuration is made available in FrameInvariants.
parent 77cfa28b
......@@ -75,6 +75,8 @@ pub struct EncoderConfig {
pub quantizer: usize,
pub bitrate: i32,
pub tune: Tune,
pub tile_cols_log2: usize,
pub tile_rows_log2: usize,
pub speed_settings: SpeedSettings,
/// `None` for one-pass encode. `Some(1)` or `Some(2)` for two-pass encoding.
pub pass: Option<u8>,
......@@ -111,6 +113,8 @@ impl EncoderConfig {
quantizer: 100,
bitrate: 0,
tune: Tune::default(),
tile_cols_log2: 0,
tile_rows_log2: 0,
speed_settings: SpeedSettings::from_preset(speed),
pass: None,
show_psnr: false,
......
......@@ -174,6 +174,20 @@ pub fn parse_cli() -> CliOptions {
.default_value("Psychovisual")
.case_insensitive(true)
)
.arg(
Arg::with_name("TILE_ROWS_LOG2")
.help("Log2 of number of tile rows")
.long("tile-rows-log2")
.takes_value(true)
.default_value("0")
)
.arg(
Arg::with_name("TILE_COLS_LOG2")
.help("Log2 of number of tile columns")
.long("tile-cols-log2")
.takes_value(true)
.default_value("0")
)
// MASTERING
.arg(
Arg::with_name("PIXEL_RANGE")
......@@ -426,6 +440,14 @@ fn parse_config(matches: &ArgMatches<'_>) -> EncoderConfig {
None
};
cfg.tune = matches.value_of("TUNE").unwrap().parse().unwrap();
cfg.tile_cols_log2 = matches.value_of("TILE_COLS_LOG2").unwrap().parse().unwrap();
cfg.tile_rows_log2 = matches.value_of("TILE_ROWS_LOG2").unwrap().parse().unwrap();
if cfg.tile_cols_log2 > 6 || cfg.tile_rows_log2 > 6 {
panic!("Log2 of tile columns and rows may not be greater than 6");
}
cfg.low_latency = matches.value_of("LOW_LATENCY").unwrap().parse().unwrap();
cfg.train_rdo = train_rdo;
cfg
......
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