aboutsummaryrefslogtreecommitdiff
path: root/lvc/app/src/bin/main.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-03-09 22:48:33 +0100
committermetamuffin <metamuffin@disroot.org>2023-03-09 22:48:33 +0100
commit680b08e6b9d64284b7992fb52a23e5f891291406 (patch)
treeabe30a9f18be09ef931b4b6357d216f6ba982095 /lvc/app/src/bin/main.rs
parentc45f80a14ecd00914eb1d4e8f628b74a713667ba (diff)
downloadvideo-codec-experiments-680b08e6b9d64284b7992fb52a23e5f891291406.tar
video-codec-experiments-680b08e6b9d64284b7992fb52a23e5f891291406.tar.bz2
video-codec-experiments-680b08e6b9d64284b7992fb52a23e5f891291406.tar.zst
rename + readme
Diffstat (limited to 'lvc/app/src/bin/main.rs')
-rw-r--r--lvc/app/src/bin/main.rs68
1 files changed, 0 insertions, 68 deletions
diff --git a/lvc/app/src/bin/main.rs b/lvc/app/src/bin/main.rs
deleted file mode 100644
index 0b3596e..0000000
--- a/lvc/app/src/bin/main.rs
+++ /dev/null
@@ -1,68 +0,0 @@
-use bv1::{
- encode::{encode, EncodeConfig},
- P2, decode,
-};
-use clap::{Parser, Subcommand};
-use std::io::{stdin, stdout};
-
-#[derive(Parser)]
-#[clap(about, version)]
-struct Args {
- // Width of the video signal
- #[arg(short = 'W', long)]
- width: u16,
- // Height of the video signal
- #[arg(short = 'H', long)]
- height: u16,
- #[clap(subcommand)]
- action: Action,
-}
-
-#[derive(Clone, Subcommand)]
-enum Action {
- // Compress video
- Encode {
- #[arg(short, long, default_value_t = 800)]
- max_block_size: usize,
- #[arg(short, long, default_value_t = 10_000)]
- attention_split: u32,
- #[arg(short, long, default_value_t = 10.)]
- threshold: f32,
- #[arg(short, long, default_value_t = 10)]
- keyframe_interval: usize,
- },
- // Decompress video
- Decode {
- #[arg(short, long)]
- debug: bool,
- },
-}
-
-fn main() {
- let args = Args::parse();
-
- let size = P2 {
- x: args.width as i32,
- y: args.height as i32,
- };
- match args.action {
- Action::Encode {
- max_block_size,
- threshold,
- attention_split,
- keyframe_interval,
- } => {
- let config = EncodeConfig {
- threshold,
- max_block_size,
- attention_split,
- keyframe_interval,
- };
-
- encode(config, size, stdin(), stdout()).unwrap();
- }
- Action::Decode { debug } => {
- decode(size, debug, stdin(), stdout()).unwrap();
- }
- }
-}