Edited note, finished embedding multithread

This commit is contained in:
HistidineDwarf 2023-02-10 20:42:02 -08:00
parent 6b0cbecd79
commit 31e1064d2c
6 changed files with 15 additions and 3 deletions

View File

@ -23,6 +23,9 @@ u32 instructions
Add standard loadout
1. Multithreading
Embedding
Reading
1.5 Add final frame + pixel pointer to instruction
2. Find optimization tool
3. Optimize
4. u32/u64 instructions

File diff suppressed because one or more lines are too long

BIN
output.webm Normal file

Binary file not shown.

View File

@ -154,7 +154,7 @@ fn etch_pixel(frame: &mut EmbedSource, rgb: Vec<u8>, x: i32, y: i32) -> anyhow::
fn etch_bw(source: &mut EmbedSource, data: &Vec<bool>, global_index: &mut usize)
-> anyhow::Result<()> {
let _timer = Timer::new("Etching frame");
// let _timer = Timer::new("Etching frame");
let width = source.actual_size.width;
let height = source.actual_size.height;
@ -452,6 +452,7 @@ pub fn etch(path: &str, data: Data, settings: Settings) -> anyhow::Result<()> {
//Mess around with lossless codecs, png seems fine
//Fourcc is a code for video codecs, trying to use a lossless one
let fourcc = VideoWriter::fourcc('p', 'n', 'g', ' ')?;
// let fourcc = VideoWriter::fourcc('j', 'p', 'e', 'g')?;
// let fourcc = VideoWriter::fourcc('a', 'v', 'c', '1')?;
//Check if frame_size is flipped

BIN
src/tests/img1.7z Normal file

Binary file not shown.

View File

@ -8,7 +8,15 @@ pub struct Timer {
impl Drop for Timer {
fn drop(&mut self) {
println!("{} ended in {}ms", self.title, self.time.elapsed().as_millis());
let micros = self.time.elapsed().as_micros();
let millis = self.time.elapsed().as_millis();
if micros < 10000 {
println!("{} ended in {}us", self.title, self.time.elapsed().as_micros());
} else {
println!("{} ended in {}ms", self.title, self.time.elapsed().as_millis());
}
}
}