diff options
Diffstat (limited to 'evc/src/codec')
-rw-r--r-- | evc/src/codec/decode.rs | 1 | ||||
-rw-r--r-- | evc/src/codec/encode/mod.rs | 16 | ||||
-rw-r--r-- | evc/src/codec/encode/simple.rs | 5 |
3 files changed, 16 insertions, 6 deletions
diff --git a/evc/src/codec/decode.rs b/evc/src/codec/decode.rs index 197028c..61234da 100644 --- a/evc/src/codec/decode.rs +++ b/evc/src/codec/decode.rs @@ -29,6 +29,7 @@ pub fn decode_block( config.max_threads, ); } + Block::CompressedLiteral(_) => todo!(), Block::Reference { translation } => target.copy_from(&prev.offset(*translation)), Block::AdvancedReference(r) => target.copy_from_sampler(&Sampler::from_refblock(prev, r)), } 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 }); |