[Pkg-javascript-commits] [pdf.js] 33/161: Optmized decodeRefinement, moving the prediction error outside the inner loop

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 2b6cb317db1e64017036bb0f7d35ee940d6133ef
Author: p01 <p01 at opera.com>
Date:   Mon Mar 10 14:58:32 2014 +0100

    Optmized decodeRefinement, moving the prediction error outside the inner loop
    
    There is no need to slow down the inner loop with a test for ltp as it can only
    change if prediction is true in which case it only changes in the outer loop.
---
 src/core/jbig2.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/core/jbig2.js b/src/core/jbig2.js
index 0b9a154..23d4bd5 100755
--- a/src/core/jbig2.js
+++ b/src/core/jbig2.js
@@ -376,13 +376,13 @@ var Jbig2Image = (function Jbig2ImageClosure() {
       if (prediction) {
         var sltp = decoder.readBit(contexts, pseudoPixelContext);
         ltp ^= sltp;
+        if (ltp) {
+          error('JBIG2 error: prediction is not supported');
+        }
       }
       var row = new Uint8Array(width);
       bitmap.push(row);
       for (var j = 0; j < width; j++) {
-        if (ltp) {
-          error('JBIG2 error: prediction is not supported');
-        }
 
         var contextLabel = 0;
         for (var k = 0; k < codingTemplateLength; k++) {

-- 
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