From 2b85d54dac93d98400c78eff109750ad19c4219b Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Tue, 1 Sep 2015 01:56:42 +0200 Subject: [PATCH] Fix broken YCbCr subpixel positioning. Caught by the unit tests. --- ycbcr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ycbcr.cpp b/ycbcr.cpp index 6dbcd9d..277ea9c 100644 --- a/ycbcr.cpp +++ b/ycbcr.cpp @@ -52,7 +52,7 @@ float compute_chroma_offset(float pos, unsigned subsampling_factor, unsigned res // x + (-0) can be optimized away freely, as opposed to x + 0. return -0.0; } else { - return (local_chroma_pos - 0.5) / resolution; + return (0.5 - local_chroma_pos) / resolution; } } -- 2.39.2