Author: post
Date: 2009-08-17 17:06:41 +0200 (Mon, 17 Aug 2009)
New Revision: 117

Modified:
   RawSpeed/LJpegDecompressor.cpp
   cameras.xml
Log:
- Official support for Sony A330.
- Cosmetics to avoid compiler warning and usual line endings.

Modified: RawSpeed/LJpegDecompressor.cpp
===================================================================
--- RawSpeed/LJpegDecompressor.cpp      2009-08-16 19:53:28 UTC (rev 116)
+++ RawSpeed/LJpegDecompressor.cpp      2009-08-17 15:06:41 UTC (rev 117)
@@ -22,59 +22,59 @@
     http://www.klauspost.com
 */
 
-/*
-* Huffman table generation:
-* LJpegDecompressor::HuffDecode, 
-* LJpegDecompressor::createHuffmanTable
-* and used data structures are originally grabbed from the IJG software, 
-* and adapted by Hubert Figuiere.
-*
-* Copyright (C) 1991, 1992, Thomas G. Lane.
-* Part of the Independent JPEG Group's software.
-* See the file Copyright for more details.
-*
-* Copyright (c) 1993 Brian C. Smith, The Regents of the University
-* of California
-* All rights reserved.
-* 
-* Copyright (c) 1994 Kongji Huang and Brian C. Smith.
-* Cornell University
-* All rights reserved.
-* 
-* Permission to use, copy, modify, and distribute this software and its
-* documentation for any purpose, without fee, and without written agreement is
-* hereby granted, provided that the above copyright notice and the following
-* two paragraphs appear in all copies of this software.
-* 
-* IN NO EVENT SHALL CORNELL UNIVERSITY BE LIABLE TO ANY PARTY FOR
-* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
-* OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF CORNELL
-* UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-* 
-* CORNELL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
-* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
-* AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
-* ON AN "AS IS" BASIS, AND CORNELL UNIVERSITY HAS NO OBLIGATION TO
-* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+/*
+* Huffman table generation:
+* LJpegDecompressor::HuffDecode, 
+* LJpegDecompressor::createHuffmanTable
+* and used data structures are originally grabbed from the IJG software, 
+* and adapted by Hubert Figuiere.
+*
+* Copyright (C) 1991, 1992, Thomas G. Lane.
+* Part of the Independent JPEG Group's software.
+* See the file Copyright for more details.
+*
+* Copyright (c) 1993 Brian C. Smith, The Regents of the University
+* of California
+* All rights reserved.
+* 
+* Copyright (c) 1994 Kongji Huang and Brian C. Smith.
+* Cornell University
+* All rights reserved.
+* 
+* Permission to use, copy, modify, and distribute this software and its
+* documentation for any purpose, without fee, and without written agreement is
+* hereby granted, provided that the above copyright notice and the following
+* two paragraphs appear in all copies of this software.
+* 
+* IN NO EVENT SHALL CORNELL UNIVERSITY BE LIABLE TO ANY PARTY FOR
+* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
+* OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF CORNELL
+* UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+* 
+* CORNELL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+* AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
+* ON AN "AS IS" BASIS, AND CORNELL UNIVERSITY HAS NO OBLIGATION TO
+* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 */ 
 
-const guint bitMask[] = {  0xffffffff, 0x7fffffff, 
-0x3fffffff, 0x1fffffff,
-0x0fffffff, 0x07ffffff, 
-0x03ffffff, 0x01ffffff,
-0x00ffffff, 0x007fffff, 
-0x003fffff, 0x001fffff,
-0x000fffff, 0x0007ffff, 
-0x0003ffff, 0x0001ffff,
-0x0000ffff, 0x00007fff, 
-0x00003fff, 0x00001fff,
-0x00000fff, 0x000007ff, 
-0x000003ff, 0x000001ff,
-0x000000ff, 0x0000007f, 
-0x0000003f, 0x0000001f,
-0x0000000f, 0x00000007, 
-0x00000003, 0x00000001};
-
+const guint bitMask[] = {  0xffffffff, 0x7fffffff, 
+0x3fffffff, 0x1fffffff,
+0x0fffffff, 0x07ffffff, 
+0x03ffffff, 0x01ffffff,
+0x00ffffff, 0x007fffff, 
+0x003fffff, 0x001fffff,
+0x000fffff, 0x0007ffff, 
+0x0003ffff, 0x0001ffff,
+0x0000ffff, 0x00007fff, 
+0x00003fff, 0x00001fff,
+0x00000fff, 0x000007ff, 
+0x000003ff, 0x000001ff,
+0x000000ff, 0x0000007f, 
+0x0000003f, 0x0000001f,
+0x0000000f, 0x00000007, 
+0x00000003, 0x00000001};
+
 LJpegDecompressor::LJpegDecompressor(FileMap* file, RawImage img): 
  mFile(file), mRaw(img)
 {
@@ -574,16 +574,19 @@
     return -32768;
   }
 
-  /*
-  * Section F.2.2.1: decode the difference and
-  * Figure F.12: extend sign bit
-  */
-  if ((rv+l)>24)  // Ensure we have enough bits
+  // Ensure we have enough bits
+  if ((rv+l)>24) {
     if (rv>16) // There is no values above 16 bits.   
       ThrowRDE("Corrupt JPEG data: Too many bits requested.");
     else
       bits->fill();
+  }
 
+  /*
+  * Section F.2.2.1: decode the difference and
+  * Figure F.12: extend sign bit
+  */
+  
   if (rv) {
     gint x = bits->getBitsNoFill(rv);
     if ((x & (1 << (rv-1))) == 0)

Modified: cameras.xml
===================================================================
--- cameras.xml 2009-08-16 19:53:28 UTC (rev 116)
+++ cameras.xml 2009-08-17 15:06:41 UTC (rev 117)
@@ -763,6 +763,16 @@
     <Crop x="0" y="0" width="3878" height="2600"/>
     <Sensor black="0" white="4095"/>
   </Camera>
+  <Camera make="SONY" model="DSLR-A330">
+    <CFA width="2" height="2">
+      <Color x="0" y="0">RED</Color>
+      <Color x="1" y="0">GREEN</Color>
+      <Color x="0" y="1">GREEN</Color>
+      <Color x="1" y="1">BLUE</Color>
+    </CFA>
+    <Crop x="0" y="0" width="3878" height="2600"/>
+    <Sensor black="0" white="4095"/>
+  </Camera>
   <Camera make="SONY" model="DSLR-A350">
     <CFA width="2" height="2">
       <Color x="0" y="0">RED</Color>


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

Reply via email to