]> git.sesse.net Git - movit/blobdiff - ycbcr.cpp
Fix broken YCbCr subpixel positioning. Caught by the unit tests.
[movit] / ycbcr.cpp
index 6dbcd9d94691e1a1190d1fcabf36c1ff373e1919..277ea9c7b3a3de1c97cf95a51b1941661656bcbd 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;
        }
 }