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 | |
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')
-rw-r--r-- | evc/src/codec/encode/mod.rs | 16 | ||||
-rw-r--r-- | evc/src/codec/encode/simple.rs | 5 |
2 files changed, 15 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, } diff --git a/evc/src/codec/encode/simple.rs b/evc/src/codec/encode/simple.rs index cabbc15..2a971af 100644 --- a/evc/src/codec/encode/simple.rs +++ b/evc/src/codec/encode/simple.rs @@ -45,6 +45,11 @@ pub fn fast( } }; + probe(offset + Vec2 { x: 8, y: 0 }); + probe(offset + Vec2 { x: -8, y: 0 }); + probe(offset + Vec2 { x: 0, y: 8 }); + probe(offset + Vec2 { x: 0, y: -8 }); + probe(offset + Vec2 { x: 1, y: 0 }); probe(offset + Vec2 { x: -1, y: 0 }); probe(offset + Vec2 { x: 0, y: 1 }); |