Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/videolan/dav1d.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Conrad <david_conrad@apple.com>2022-06-08 01:05:12 +0300
committerDavid Conrad <david_conrad@apple.com>2022-09-15 03:28:22 +0300
commite202fa082b6699e60ec2806c067f34a82750b4fa (patch)
treec5f3278feef4c8f266031795ae8f76a2562c1a94
parentee98592ba27aa0c958778eef998ed89a664e252d (diff)
Fix rounding in the calculation of initialSubpelX
The spec divides err by two, rounding to 0, instead of >>1, which rounds towards negative infinity
-rw-r--r--src/decode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/decode.c b/src/decode.c
index 8a1ef7c..126a39e 100644
--- a/src/decode.c
+++ b/src/decode.c
@@ -3483,7 +3483,7 @@ int dav1d_decode_frame(Dav1dFrameContext *const f) {
static int get_upscale_x0(const int in_w, const int out_w, const int step) {
const int err = out_w * step - (in_w << 14);
- const int x0 = (-((out_w - in_w) << 13) + (out_w >> 1)) / out_w + 128 - (err >> 1);
+ const int x0 = (-((out_w - in_w) << 13) + (out_w >> 1)) / out_w + 128 - (err / 2);
return x0 & 0x3fff;
}