summaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2013-06-19 02:41:59 +0200
committerMauro Carvalho Chehab <m.chehab@samsung.com>2013-08-18 13:49:07 +0200
commit3f359a7cb1847900bc87b3498f72c1ee848942a7 (patch)
tree8e3aa4ac57bca83681cef003de048886d51e578e /Documentation
parent[media] v4l: of: Drop acquired reference to node when getting next endpoint (diff)
downloadlinux-3f359a7cb1847900bc87b3498f72c1ee848942a7.tar.xz
linux-3f359a7cb1847900bc87b3498f72c1ee848942a7.zip
[media] v4l: Fix colorspace conversion error in sample code
The sample code erroneously scales the y1, pb and pr variables from the [0.0 .. 1.0] and [-0.5 .. 0.5] ranges to [0 .. 255] and [-128 .. 127]. Fix it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt.xml6
1 files changed, 3 insertions, 3 deletions
diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml b/Documentation/DocBook/media/v4l/pixfmt.xml
index 16db350848af..72d72bd67d0a 100644
--- a/Documentation/DocBook/media/v4l/pixfmt.xml
+++ b/Documentation/DocBook/media/v4l/pixfmt.xml
@@ -391,9 +391,9 @@ clamp (double x)
else return r;
}
-y1 = (255 / 219.0) * (Y1 - 16);
-pb = (255 / 224.0) * (Cb - 128);
-pr = (255 / 224.0) * (Cr - 128);
+y1 = (Y1 - 16) / 219.0;
+pb = (Cb - 128) / 224.0;
+pr = (Cr - 128) / 224.0;
r = 1.0 * y1 + 0 * pb + 1.402 * pr;
g = 1.0 * y1 - 0.344 * pb - 0.714 * pr;