summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbiocrasher <biocrasher@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2006-07-22 08:44:46 +0000
committerbiocrasher <biocrasher@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2006-07-22 08:44:46 +0000
commitdeb9526eda7913054486c4a9569fd1ec64f97ff2 (patch)
tree103dc5cf8624072864ef22cdd567752438acee25
parentfdaf6ea50e9b56904fbe8e60e2a034e817131e0a (diff)
more accurate rgb2yuv conversion
git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@26 f606c939-3180-4ac9-a4b8-4b8779d57d0a
-rw-r--r--recordmydesktop/src/bgr_to_yuv.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/recordmydesktop/src/bgr_to_yuv.c b/recordmydesktop/src/bgr_to_yuv.c
index c3730ad..e1774f9 100644
--- a/recordmydesktop/src/bgr_to_yuv.c
+++ b/recordmydesktop/src/bgr_to_yuv.c
@@ -29,25 +29,26 @@
void MakeMatrices(){
int i;
+
for(i=0;i<256;i++)
- Yr[i]=0.299*i;
+ Yr[i]=(2104.0*i)/8192.0+8.0;
for(i=0;i<256;i++)
- Yg[i]=0.587*i;
+ Yg[i]=(4130.0*i)/8192.0+8.0;
for(i=0;i<256;i++)
- Yb[i]=0.114*i;
+ Yb[i]=(802.0*i)/8192.0;
for(i=0;i<256;i++)
- Ur[i]=43.1-0.169*i;
+ Ur[i]=37.8-(1204.0*i)/8192.0+8.0;
for(i=0;i<256;i++)
- Ug[i]=84.41-0.331*i;
+ Ug[i]=74.2-(2384.0*i)/8192.0+8.0;
for(i=0;i<256;i++)
- Ub[i]=0.5*i;
+ Ub[i]=(3598.0*i)/8192.0 ;
for(i=0;i<256;i++)
- Vr[i]=0.5*i;
+ Vr[i]=(3598.0*i)/8192.0;
for(i=0;i<256;i++)
- Vg[i]=107-0.419*i;
+ Vg[i]=93.8-(3013.0*i)/8192.0+8.0;
for(i=0;i<256;i++)
- Vb[i]=21-0.081*i;
+ Vb[i]=18.2-(585.0*i)/8192.0+8.0;
}
© All Rights Reserved