diff options
Diffstat (limited to 'evc/src/codec')
-rw-r--r-- | evc/src/codec/encode.rs | 7 |
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; |