[PATCH 0/2] Projective transformation accuracy fixes for the xrandr tool

Siarhei Siamashka siarhei.siamashka at gmail.com
Wed Aug 20 20:31:05 PDT 2014


As revealed in http://lists.x.org/archives/xorg-devel/2014-August/043624.html
by Keith Packard, there are some accuracy issues in the way how the xrandr
tool is handling projective transformations. Because being off by several
pixels is a bit too much, some xrandr users are not very happy.

The first patch fixes a very trivial and very obvious rounding problem.

The second patch implements matrix rescaling to ensure that the rounding
errors are significantly reduced specifically for the most critical G and
H matrix coefficients.

As a result, now projective transformations should be pixel accurate for
anything sane that can be done with xrandr and modern high resolution
monitors. But only testing can show. I would be very interested to know
if there are still some problematic use cases remaining.

The search for the optimal matrix scaling factors is relatively computationally
intensive and may have a lot of room for improvement. This should not be a
problem for the xrandr command line tool though, because it does not have to
deal with millions of matrices. Only a single matrix is used per run.

    https://github.com/ssvb/xrandr/tree/transform-accuracy

Siarhei Siamashka (2):
  xrandr: Use rounding when converting from float to fixed point matrix
  xrandr: Rescale matrix to improve projective transformations accuracy

 xrandr.c | 185 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 180 insertions(+), 5 deletions(-)

-- 
1.8.3.2



More information about the xorg-devel mailing list