-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handling jpx images with multiple precincts per resolution level #5479
Conversation
Please remove the second commit, since it doesn't contain anything that's needed for this PR. |
i can confirm that this commit makes https://www.dropbox.com/s/wnkhdtqgpduk5fl/cabs_1tile_bw_puniform_lrcp.pdf?dl=0 render correctly. well done! Besides that the linting errors are that your comment lines are too long (80 char limit) and we use === instead of == |
Ideally yes, but we need to obtain permission first. I've just asked about this in the issue. |
This reverts commit cfc166e.
this looks good. can you please squash the commits? (https://github.com/mozilla/pdf.js/wiki/Squashing-Commits) |
Allow localization of the placement of percent signs in the zoom box
…oadingBar Fix loadingBar hiding when disableAutoFetch is enabled (issue 3590)
Prevent text selection in Presentation Mode (bug 1018882)
@@ -498,7 +515,9 @@ var JpxImage = (function JpxImageClosure() { | |||
precinctHeight: precinctHeight, | |||
numprecinctswide: numprecinctswide, | |||
numprecinctshigh: numprecinctshigh, | |||
numprecincts: numprecincts | |||
numprecincts: numprecincts, | |||
cblkGroupWidth:cblkGroupWidth, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: space after ':'
// (u, v) = (ceil(x/2), ceil(y/2)) where (x, y) and (u, v) are the | ||
// coordinates of a point in the LL band and child subband, respectively. | ||
var isZeroRes = resolution.resLevel === 0; | ||
var cblkGroupWidth = 1 << (dimensions.PPx + (isZeroRes ? 0 : -1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you rename cblkGroupWidth
to subbandCodeblockWidth
and cblkGroupHeight
to subbandCodeblockHeight
?
Per "B.7 Division of the sub-bands into code-blocks": "The code-block size for each sub-band at a particular resolution level is determined as 2^xcb ́ by 2^ycb ́ ...."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
Section B. 6 specifies how to divide a resolution level into rectangular blocks called precincts, and section B.7 specifies how to divide a subband into rectangular blocks called codeblocks. Surprisingly, there is no direct specification of how to map codeblocks into precincts. That is why the Jasper library had to establish a new term, called _Codeblock-Group_ to derive the correct mapping, and I have decided to use this variable name.
For this reason I have to disagree with you about the naming, but I will change it if you should insist.
Please note that subbandCodeblockWidth/Height
is a misleading variable name, since it does not describe neither the codeblock dimensions nor the subbands' dimensions.
What it should describe is the number of samples in a subband that map to a whole precinct.
Maybe a more descriptive name is subbandSamplesPerPrecinctWidth/Height
?
Paul
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, subbandSamplesPerPrecinctWidth
is good too (but takes more space and might add more code lines). If it's too ugly, will subbandWidthPerPrecinct
work?
Looks good after comments above addressed and commits squashed. |
…nYcckToRgb Use fewer multiplications for Ycck to Rgb conversion
Conflicts: src/core/jpx.js
I am new to Git, so squashing the commits did not go very smoothly, Thank you, Paul |
yeah looks quite a mess :-) the main issue is that you did the changes on master, rather an issue branch :) |
Fixed by #5485 |
As discussed in the comment thread for issue 5475
introduced a small change at how codeblocks of each resolution are mapped to their precincts,
for the non-degenerate case.
Has been tested with large images (5K x 3K approx.) RGB, multiple quality layers, 6 resolution levels
with the following test cases: