Fix broken YCbCr subpixel positioning. Caught by the unit tests.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 31 Aug 2015 23:56:42 +0000 (01:56 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 31 Aug 2015 23:56:42 +0000 (01:56 +0200)
ycbcr.cpp

index 6dbcd9d..277ea9c 100644 (file)
--- 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;
        }
 }