From 63060128ec1947287cae8ea0a1c041f2cabca87f Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Sun, 22 Jun 2008 15:48:12 +0000 Subject: == Redcode == Doing image comparison revealed, that Kb = Kr = 0.0 for redcode :) --- extern/libredcode/debayer.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'extern') diff --git a/extern/libredcode/debayer.c b/extern/libredcode/debayer.c index f7f22e1cc54..de7bec510cb 100644 --- a/extern/libredcode/debayer.c +++ b/extern/libredcode/debayer.c @@ -9,8 +9,6 @@ void redcode_ycbcr2rgb_fullscale( int x,y; int pix_max = 4096; int mask = pix_max - 1; - float Kb = 0.0722; - float Kr = 0.2126; float *o; for (y = 0; y < height; y++) { @@ -25,9 +23,9 @@ void redcode_ycbcr2rgb_fullscale( float y2 = (planes[3][i] & mask); float y2p = (planes[3][i_p] & mask); - float b_ = cb * (1.0 - Kb)/(pix_max/2); - float r_ = cr * (1.0 - Kr)/(pix_max/2); - float g_ = (- Kr * r_ - Kb * b_)/(1.0 - Kr - Kb); + float b_ = cb /(pix_max/2); + float r_ = cr /(pix_max/2); + float g_ = 0.0; float y_[4] = {y1 / pix_max, (y2 + y2p)/2 / pix_max, @@ -68,8 +66,6 @@ void redcode_ycbcr2rgb_halfscale( int x,y; int pix_max = 4096; int mask = pix_max - 1; - float Kb = 0.0722; - float Kr = 0.2126; for (y = 0; y < height; y++) { float *o = out + width * (height - y - 1); @@ -80,9 +76,9 @@ void redcode_ycbcr2rgb_halfscale( float cr = (planes[2][i] & mask) - pix_max/2; float y2 = (planes[3][i] & mask); - float b_ = cb * (1.0 - Kb)/(pix_max/2); - float r_ = cr * (1.0 - Kr)/(pix_max/2); - float g_ = (- Kr * r_ - Kb * b_)/(1.0 - Kr - Kb); + float b_ = cb /(pix_max/2); + float r_ = cr /(pix_max/2); + float g_ = 0.0; float y = (y1 + y2)/2 / pix_max; @@ -101,8 +97,6 @@ void redcode_ycbcr2rgb_quarterscale( int x,y; int pix_max = 4096; int mask = pix_max - 1; - float Kb = 0.0722; - float Kr = 0.2126; for (y = 0; y < height; y += 2) { float *o = out + (width/2) * (height/2 - y/2 - 1); @@ -113,9 +107,9 @@ void redcode_ycbcr2rgb_quarterscale( float cr = (planes[2][i] & mask) - pix_max/2; float y2 = planes[3][i] & mask; - float b_ = cb * (1.0 - Kb)/(pix_max/2); - float r_ = cr * (1.0 - Kr)/(pix_max/2); - float g_ = (- Kr * r_ - Kb * b_)/(1.0 - Kr - Kb); + float b_ = cb /(pix_max/2); + float r_ = cr /(pix_max/2); + float g_ = 0.0; float y = (y1 + y2)/2 / pix_max; -- cgit v1.2.3