Author: post
Date: 2009-09-05 14:31:57 +0200 (Sat, 05 Sep 2009)
New Revision: 142

Modified:
   RawSpeed/RawDecoder.cpp
   RawSpeed/Rw2Decoder.cpp
Log:
- RW2 reader optimized (40->55 MP/s)
- Print help information when camera with mode cannot be found.

Modified: RawSpeed/RawDecoder.cpp
===================================================================
--- RawSpeed/RawDecoder.cpp     2009-09-02 15:59:33 UTC (rev 141)
+++ RawSpeed/RawDecoder.cpp     2009-09-05 12:31:57 UTC (rev 142)
@@ -113,7 +113,7 @@
   Camera* cam = meta->getCamera(make, model, mode);
   if (!cam) {
     if (mode.length() == 0) 
-      printf("Unable to find camera in database: %s %s %s\nPlease upload file 
to ftp.rawstudio.org, thanks!\n", make.c_str(), model.c_str(), mode.c_str());
+      printf("Unable to find camera in database: %s %s %s\n", make.c_str(), 
model.c_str(), mode.c_str());
     
     return;    // Assume true.
   }
@@ -128,7 +128,7 @@
   TrimSpaces(model);
   Camera *cam = meta->getCamera(make, model, mode);
   if (!cam) {
-    printf("Unable to find camera in database: %s %s %s\n", make.c_str(), 
model.c_str(), mode.c_str());
+    printf("Unable to find camera in database: %s %s %s\nPlease upload file to 
ftp.rawstudio.org, thanks!\n", make.c_str(), model.c_str(), mode.c_str());
     return;
   }
 

Modified: RawSpeed/Rw2Decoder.cpp
===================================================================
--- RawSpeed/Rw2Decoder.cpp     2009-09-02 15:59:33 UTC (rev 141)
+++ RawSpeed/Rw2Decoder.cpp     2009-09-05 12:31:57 UTC (rev 142)
@@ -80,10 +80,12 @@
 
   for (y=0; y < h; y++) {
     gushort* dest = (gushort*)mRaw->getData(0,y);
+    i = 0;
     for (x=0; x < w; x++) {
-      if ((i = x % 14) == 0)
+      if (i == 0)
         pred[0] = pred[1] = nonz[0] = nonz[1] = 0;
-      if (i % 3 == 2) sh = 4 >> (3 - pana_bits(2));
+      else if (i % 3 == 2) 
+        sh = 4 >> (3 - pana_bits(2));
       if (nonz[i & 1]) {
         if ((j = pana_bits(8))) {
           if ((pred[i & 1] -= 0x80 << sh) < 0 || sh == 4)
@@ -93,6 +95,9 @@
       } else if ((nonz[i & 1] = pana_bits(8)) || i > 11)
         pred[i & 1] = nonz[i & 1] << 4 | pana_bits(4);
       dest[x] = pred[x&1];
+      i++;
+      if (i == 14)
+        i = 0;
     }
   }
 }


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

Reply via email to