aboutsummaryrefslogtreecommitdiff
path: root/evc/src
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2022-12-06 19:53:07 +0100
committermetamuffin <metamuffin@disroot.org>2022-12-06 19:53:07 +0100
commit437e092985e5633eee50874c337ccbdd0b76ff1e (patch)
tree7ab39a27de58c7ded9a0c3c62c1741038d8563d6 /evc/src
parent70514416c2ade2abe628efbd0a629a66febdeb13 (diff)
downloadvideo-codec-experiments-437e092985e5633eee50874c337ccbdd0b76ff1e.tar
video-codec-experiments-437e092985e5633eee50874c337ccbdd0b76ff1e.tar.bz2
video-codec-experiments-437e092985e5633eee50874c337ccbdd0b76ff1e.tar.zst
update scripts
Diffstat (limited to 'evc/src')
-rw-r--r--evc/src/codec/encode.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/evc/src/codec/encode.rs b/evc/src/codec/encode.rs
index 9ebbda1..7322fea 100644
--- a/evc/src/codec/encode.rs
+++ b/evc/src/codec/encode.rs
@@ -14,9 +14,10 @@ pub fn encode_block(view: View<&Frame>, prev: View<&Frame>, config: &EncodeConfi
} else if config.translate {
let mut best_diff = f64::INFINITY;
let mut best_translation = Vec2::ZERO;
- for x in [-32, -16, -8, -4, -2, -1, 0, 1, 2, 4, 8, 16, 32] {
- for y in [-32, -16, -8, -4, -2, -1, 0, 1, 2, 4, 8, 16, 32] {
- let translation = Vec2 { x, y };
+ const OFFSETS: &[isize] = &[-64, -32, -16, -8, -4, -2, -1, 0, 1, 2, 4, 8, 16, 32, 64];
+ for x in OFFSETS {
+ for y in OFFSETS {
+ let translation = Vec2 { x: *x, y: *y };
let diff = View::diff(&view, &prev.offset(translation)) / view.area() as f64;
if diff < best_diff {
best_translation = translation;