diff options
author | Peter Schlaile <peter@schlaile.de> | 2008-06-22 19:48:12 +0400 |
---|---|---|
committer | Peter Schlaile <peter@schlaile.de> | 2008-06-22 19:48:12 +0400 |
commit | 63060128ec1947287cae8ea0a1c041f2cabca87f (patch) | |
tree | 79a9719c134e647d33950dd7fd98c21f3f5a006f | |
parent | 5372def2b069699809cf9439381b03364137adb5 (diff) |
== Redcode ==
Doing image comparison revealed, that Kb = Kr = 0.0 for redcode :)
-rw-r--r-- | extern/libredcode/debayer.c | 24 |
1 files changed, 9 insertions, 15 deletions
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; |