[Pkg-javascript-commits] [pdf.js] 32/161: Reuse the row Uint8Array in JBIG2's decodeBitmap

David Prévot taffit at moszumanska.debian.org
Sat Apr 19 14:16:20 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 840d9d40b6e7c4e3dc0b341b8f52bf68c7d3e53b
Author: p01 <p01 at opera.com>
Date:   Fri Mar 7 17:30:24 2014 +0100

    Reuse the row Uint8Array in JBIG2's decodeBitmap
---
 src/core/jbig2.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/core/jbig2.js b/src/core/jbig2.js
index 35f0a47..0b9a154 100755
--- a/src/core/jbig2.js
+++ b/src/core/jbig2.js
@@ -273,6 +273,7 @@ var Jbig2Image = (function Jbig2ImageClosure() {
     var sbb_right = width - maxX;
 
     var pseudoPixelContext = ReusedContexts[templateIndex];
+    var row = new Uint8Array(width);
     var bitmap = [];
 
     var decoder = decodingContext.decoder;
@@ -284,11 +285,11 @@ var Jbig2Image = (function Jbig2ImageClosure() {
         var sltp = decoder.readBit(contexts, pseudoPixelContext);
         ltp ^= sltp;
         if (ltp) {
-          bitmap[i] = row;//bitmap[i - 1]); // duplicate previous row
+          bitmap.push(row); // duplicate previous row
           continue;
         }
       }
-      var row = new Uint8Array(width);
+      row = new Uint8Array(row);
       bitmap.push(row);
       for (j = 0; j < width; j++) {
         if (useskip && skip[i][j]) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list