Edited note, finished embedding multithread
This commit is contained in:
parent
6b0cbecd79
commit
31e1064d2c
3
note.txt
3
note.txt
@ -23,6 +23,9 @@ u32 instructions
|
|||||||
Add standard loadout
|
Add standard loadout
|
||||||
|
|
||||||
1. Multithreading
|
1. Multithreading
|
||||||
|
Embedding
|
||||||
|
Reading
|
||||||
|
1.5 Add final frame + pixel pointer to instruction
|
||||||
2. Find optimization tool
|
2. Find optimization tool
|
||||||
3. Optimize
|
3. Optimize
|
||||||
4. u32/u64 instructions
|
4. u32/u64 instructions
|
||||||
|
File diff suppressed because one or more lines are too long
BIN
output.webm
Normal file
BIN
output.webm
Normal file
Binary file not shown.
@ -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)
|
fn etch_bw(source: &mut EmbedSource, data: &Vec<bool>, global_index: &mut usize)
|
||||||
-> anyhow::Result<()> {
|
-> anyhow::Result<()> {
|
||||||
let _timer = Timer::new("Etching frame");
|
// let _timer = Timer::new("Etching frame");
|
||||||
|
|
||||||
let width = source.actual_size.width;
|
let width = source.actual_size.width;
|
||||||
let height = source.actual_size.height;
|
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
|
//Mess around with lossless codecs, png seems fine
|
||||||
//Fourcc is a code for video codecs, trying to use a lossless one
|
//Fourcc is a code for video codecs, trying to use a lossless one
|
||||||
let fourcc = VideoWriter::fourcc('p', 'n', 'g', ' ')?;
|
let fourcc = VideoWriter::fourcc('p', 'n', 'g', ' ')?;
|
||||||
|
// let fourcc = VideoWriter::fourcc('j', 'p', 'e', 'g')?;
|
||||||
// let fourcc = VideoWriter::fourcc('a', 'v', 'c', '1')?;
|
// let fourcc = VideoWriter::fourcc('a', 'v', 'c', '1')?;
|
||||||
|
|
||||||
//Check if frame_size is flipped
|
//Check if frame_size is flipped
|
||||||
|
BIN
src/tests/img1.7z
Normal file
BIN
src/tests/img1.7z
Normal file
Binary file not shown.
@ -8,8 +8,16 @@ pub struct Timer {
|
|||||||
|
|
||||||
impl Drop for Timer {
|
impl Drop for Timer {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
|
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());
|
println!("{} ended in {}ms", self.title, self.time.elapsed().as_millis());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Timer {
|
impl Timer {
|
||||||
|
Loading…
Reference in New Issue
Block a user