diff options
author | metamuffin <metamuffin@disroot.org> | 2023-03-09 22:01:20 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-03-09 22:01:20 +0100 |
commit | 7494981595712cf42681823e8fd79977b9b5f9dc (patch) | |
tree | 7f85af24f4c1e56b6cf1c7baf6fe8a6cd798c7b3 /lvc/codec/src/impls.rs | |
parent | 11b78570656bd0ca67594472765fc629aa25fd25 (diff) | |
download | video-codec-experiments-7494981595712cf42681823e8fd79977b9b5f9dc.tar video-codec-experiments-7494981595712cf42681823e8fd79977b9b5f9dc.tar.bz2 video-codec-experiments-7494981595712cf42681823e8fd79977b9b5f9dc.tar.zst |
web!
Diffstat (limited to 'lvc/codec/src/impls.rs')
-rw-r--r-- | lvc/codec/src/impls.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lvc/codec/src/impls.rs b/lvc/codec/src/impls.rs index 098db39..b4cc119 100644 --- a/lvc/codec/src/impls.rs +++ b/lvc/codec/src/impls.rs @@ -1,6 +1,19 @@ use crate::{Frame, Pixel, Ref, View, P2}; use std::ops::{Add, AddAssign, Index, IndexMut, Sub}; +#[cfg(feature = "parallel")] +pub use rayon::join; +#[cfg(not(feature = "parallel"))] +pub fn join<A, B, RA, RB>(oper_a: A, oper_b: B) -> (RA, RB) +where + A: FnOnce() -> RA + Send, + B: FnOnce() -> RB + Send, + RA: Send, + RB: Send, +{ + (oper_a(), oper_b()) +} + impl Frame { pub fn export(&self, view: View) -> Vec<Pixel> { let mut o = vec![]; |