diff options
author | metamuffin <metamuffin@disroot.org> | 2023-11-18 02:39:47 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-11-18 02:39:47 +0100 |
commit | 28af3138598e5c5f7e4d7c70218c26f4d2f46208 (patch) | |
tree | 83a8e1559f4798b2f33cc59e35cd5d1931be2683 /flowy/src/main.rs | |
parent | ebd59fb09a4e094701f195d86662e1a9d00fed2b (diff) | |
download | video-codec-experiments-28af3138598e5c5f7e4d7c70218c26f4d2f46208.tar video-codec-experiments-28af3138598e5c5f7e4d7c70218c26f4d2f46208.tar.bz2 video-codec-experiments-28af3138598e5c5f7e4d7c70218c26f4d2f46208.tar.zst |
works very well
Diffstat (limited to 'flowy/src/main.rs')
-rw-r--r-- | flowy/src/main.rs | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/flowy/src/main.rs b/flowy/src/main.rs index 557417f..1f84e3b 100644 --- a/flowy/src/main.rs +++ b/flowy/src/main.rs @@ -1,5 +1,6 @@ pub mod motion; +use log::debug; use motion::{dec::MotionDecoder, enc::MotionEncoder, CommonBuffers, Params}; use pollster::FutureExt; use std::io::{stdin, stdout, Read, Write}; @@ -11,6 +12,8 @@ use wgpu::{ use crate::motion::RoundParams; fn main() { + env_logger::init_from_env("LOG"); + let instance = Instance::new(InstanceDescriptor { backends: Backends::all(), ..Default::default() @@ -38,6 +41,7 @@ fn main() { .unwrap(); let (width, height) = (1920, 1080); + let bsize = 8; let params = Params { width, height, @@ -46,11 +50,11 @@ fn main() { height: height as u32, depth_or_array_layers: 1, }, - blocks_x: width / 8, - blocks_y: height / 8, - block_width: 8, - block_height: 8, - blocks: (width / 8) * (height / 8), + blocks_x: width / bsize, + blocks_y: height / bsize, + block_width: bsize, + block_height: bsize, + blocks: (width / bsize) * (height / bsize), }; let bufs = CommonBuffers::create(&device, ¶ms); @@ -65,13 +69,13 @@ fn main() { let mut i = 0; loop { let rp = RoundParams { swap: i % 2 }; - eprintln!("read"); + debug!("read"); stdin().read_exact(&mut buffer).unwrap(); - eprintln!("upload"); + debug!("upload"); bufs.upload(&queue, ¶ms, &rp, &buffer); - eprintln!("compute"); + debug!("compute"); let mut encoder = device.create_command_encoder(&Default::default()); @@ -84,10 +88,10 @@ fn main() { queue.submit(Some(encoder.finish())); device.poll(MaintainBase::Wait); - eprintln!("download"); + debug!("download"); bufs.download(&device, &mut buffer); - eprintln!("write"); + debug!("write"); stdout().write_all(&buffer).unwrap(); i += 1; } |