diff options
author | metamuffin <metamuffin@disroot.org> | 2022-12-17 18:01:51 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2022-12-17 18:01:51 +0100 |
commit | 0a346b8372140b56bf65a6df1c00e2cd6c6cdf86 (patch) | |
tree | e52234d5904939323e19586128d8ac2d345e450e /evc/src/codec/encode/mod.rs | |
parent | 82eedf3594bf21c8b780580050a95f0bdb5fd667 (diff) | |
download | video-codec-experiments-0a346b8372140b56bf65a6df1c00e2cd6c6cdf86.tar video-codec-experiments-0a346b8372140b56bf65a6df1c00e2cd6c6cdf86.tar.bz2 video-codec-experiments-0a346b8372140b56bf65a6df1c00e2cd6c6cdf86.tar.zst |
small optimizations and info binary
Diffstat (limited to 'evc/src/codec/encode/mod.rs')
-rw-r--r-- | evc/src/codec/encode/mod.rs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/evc/src/codec/encode/mod.rs b/evc/src/codec/encode/mod.rs index 2ccac64..336f298 100644 --- a/evc/src/codec/encode/mod.rs +++ b/evc/src/codec/encode/mod.rs @@ -69,15 +69,19 @@ pub fn encode_block(view: View<&Frame>, prev: View<&Frame>, config: &EncodeConfi let config = unsafe { std::mem::transmute::<_, &'static EncodeConfig>(config) }; // only bother to do multithreading, when the block is big. - let (a, b) = both_par( - || encode_block(av, ap, config), - || encode_block(bv, bp, config), - config.max_threads, - ); + let (a, b) = if view.area() > 100 { + both_par( + || encode_block(av, ap, config), + || encode_block(bv, bp, config), + config.max_threads, + ) + } else { + (encode_block(av, ap, config), encode_block(bv, bp, config)) + }; if a.is_literal() && b.is_literal() { Block::Literal(view.pixels()) - } else if a.is_ref_without_translation() && b.is_ref_without_translation() { + } else if Block::identical_ref(&a, &b) { Block::Reference { translation: Vec2::<isize>::ZERO, } |