Author: post
Date: 2009-08-26 22:53:22 +0200 (Wed, 26 Aug 2009)
New Revision: 121

Modified:
   RawSpeed/ArwDecoder.cpp
   credits.txt
Log:
- Apply curve to uncompressed ARW2 files. May help Sony decoding.

Modified: RawSpeed/ArwDecoder.cpp
===================================================================
--- RawSpeed/ArwDecoder.cpp     2009-08-24 21:19:01 UTC (rev 120)
+++ RawSpeed/ArwDecoder.cpp     2009-08-26 20:53:22 UTC (rev 121)
@@ -154,7 +154,22 @@
     return;
   } // End bpp = 8
   if (bpp==12) {
-    Decode12BitRaw(input,w,h);
+    guchar* data = mRaw->getData();
+    guint pitch = mRaw->pitch;
+    const guchar *in = input.getData();
+    if (input.getRemainSize()< (w*h*3/2) ) {
+      h = input.getRemainSize() / (w*3/2) - 1;
+    }
+    for (guint y=0; y < h; y++) {
+      gushort* dest = (gushort*)&data[y*pitch];
+      for(guint x =0 ; x < w; x+=2) {
+        guint g1 = curve[*in++];
+        guint g2 = curve[*in++];
+        dest[x] = g1 | ((g2&0xf)<<8);
+        guint g3 = curve[*in++];
+        dest[x+1] = (g2>>2) | (g3<<4);
+      }
+    }
     return;
   }
   ThrowRDE("Unsupported bit depth");

Modified: credits.txt
===================================================================
--- credits.txt 2009-08-24 21:19:01 UTC (rev 120)
+++ credits.txt 2009-08-26 20:53:22 UTC (rev 121)
@@ -17,4 +17,5 @@
 
  * Laurent Clevy for his excellent CR2 documentation project:
  * http://lclevy.free.fr/cr2/index.html
-
+ * All who supplied RAW test images to Rawstudio
+ * Of course all involved with the Rawstudio project
\ No newline at end of file


_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit

Reply via email to