gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-


From: Sandro Santilli
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-1211-gcc0432d
Date: Sun, 23 Oct 2011 14:40:05 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  cc0432d61d00083ebefaa5133cc4a89bc420e101 (commit)
      from  be3bdc04b66c4abac6ed66ac0a2df315ca0f0218 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=cc0432d61d00083ebefaa5133cc4a89bc420e101


commit cc0432d61d00083ebefaa5133cc4a89bc420e101
Author: Sandro Santilli <address@hidden>
Date:   Sun Oct 23 16:39:27 2011 +0200

    Fix parsing of lossless 16bit bitmaps
    
    Fixes support for movies generated by the evil TechSmit Camtasia tool 
(#34625)

diff --git a/NEWS b/NEWS
index 11a7304..c4b33b0 100644
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,8 @@ Improvements since 0.8.9 release are:
  * Improved framebuffer GUI and touchscreen support.
  * Framebuffer now supports using multiple renderers.
  * Refactored input device support.
+ * Fix parsing of lossless 16bit bitmaps, fixing support for movies
+   generated by the evil TechSmit Camtasia tool (#34625).
 
 Gnash 0.8.9
 2011/03/19
diff --git a/libcore/swf/DefineBitsTag.cpp b/libcore/swf/DefineBitsTag.cpp
index bb84815..2976f58 100644
--- a/libcore/swf/DefineBitsTag.cpp
+++ b/libcore/swf/DefineBitsTag.cpp
@@ -518,25 +518,24 @@ readLossless(SWFStream& in, TagType tag)
         }
 
         case 4:
-            // 16 bits / pixel
+            // 15 bits / pixel
 
             for (size_t j = 0; j < height; ++j) {
 
                 boost::uint8_t* inRow = buffer.get() + j * pitch;
                 boost::uint8_t* outRow = scanline(*image, j);
                 for (size_t i = 0; i < width; ++i) {
-                    const boost::uint16_t pixel = inRow[i * 2] |
-                        (inRow[i * 2 + 1] << 8);
-
-                    // How is the data packed??? Whoever wrote this was
-                    // just guessing here that it's 565!
-                    outRow[i * channels + 0] = (pixel >> 8) & 0xF8;    // red
-                    outRow[i * channels + 1] = (pixel >> 3) & 0xFC;    // green
-                    outRow[i * channels + 2] = (pixel << 3) & 0xF8;    // blue
- 
-                    // This was saved to the first byte before, but that
-                    // can hardly be correct.
-                    // Real examples of this format are rare to non-existent.
+                    const boost::uint16_t pix = ( inRow[i * 2]     << 8 )
+                                              | ( inRow[i * 2 + 1]      ) ;
+                    const double g = 255.0/31.0; // gamma correction
+
+                    // 555 packing
+                    // For a testcase, see:
+                    // https://savannah.gnu.org/bugs/index.php?34625
+                    outRow[i * channels + 0] = ( (pix >> 10) & 0x1F ) * g; // R
+                    outRow[i * channels + 1] = ( (pix >>  5) & 0x1F ) * g; // G
+                    outRow[i * channels + 2] = ( (pix      ) & 0x1F ) * g; // B
+
                     if (alpha) {
                         outRow[i * channels + 3] = 255;
                     }

-----------------------------------------------------------------------

Summary of changes:
 NEWS                          |    2 ++
 libcore/swf/DefineBitsTag.cpp |   25 ++++++++++++-------------
 2 files changed, 14 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]