[JPEG 2000] Add support for resetContextProbabilities (bug 1731483)
This commit is contained in:
parent
4157d771c0
commit
9b9609a6d8
@ -337,9 +337,6 @@ class JpxImage {
|
||||
if (cod.selectiveArithmeticCodingBypass) {
|
||||
unsupported.push("selectiveArithmeticCodingBypass");
|
||||
}
|
||||
if (cod.resetContextProbabilities) {
|
||||
unsupported.push("resetContextProbabilities");
|
||||
}
|
||||
if (cod.terminationOnEachCodingPass) {
|
||||
unsupported.push("terminationOnEachCodingPass");
|
||||
}
|
||||
@ -1290,7 +1287,8 @@ function copyCoefficients(
|
||||
delta,
|
||||
mb,
|
||||
reversible,
|
||||
segmentationSymbolUsed
|
||||
segmentationSymbolUsed,
|
||||
resetContextProbabilities
|
||||
) {
|
||||
const x0 = subband.tbx0;
|
||||
const y0 = subband.tby0;
|
||||
@ -1356,6 +1354,11 @@ function copyCoefficients(
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (resetContextProbabilities) {
|
||||
bitModel.reset();
|
||||
}
|
||||
|
||||
currentCodingpassType = (currentCodingpassType + 1) % 3;
|
||||
}
|
||||
|
||||
@ -1404,6 +1407,8 @@ function transformTile(context, tile, c) {
|
||||
const scalarExpounded = quantizationParameters.scalarExpounded;
|
||||
const guardBits = quantizationParameters.guardBits;
|
||||
const segmentationSymbolUsed = codingStyleParameters.segmentationSymbolUsed;
|
||||
const resetContextProbabilities =
|
||||
codingStyleParameters.resetContextProbabilities;
|
||||
const precision = context.components[c].precision;
|
||||
|
||||
const reversible = codingStyleParameters.reversibleTransformation;
|
||||
@ -1455,7 +1460,8 @@ function transformTile(context, tile, c) {
|
||||
delta,
|
||||
mb,
|
||||
reversible,
|
||||
segmentationSymbolUsed
|
||||
segmentationSymbolUsed,
|
||||
resetContextProbabilities
|
||||
);
|
||||
}
|
||||
subbandCoefficients.push({
|
||||
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -303,6 +303,7 @@
|
||||
!issue14117.pdf
|
||||
!issue5070.pdf
|
||||
!issue5238.pdf
|
||||
!jp2k-resetprob.pdf
|
||||
!issue5244.pdf
|
||||
!issue5291.pdf
|
||||
!issue4398.pdf
|
||||
|
BIN
test/pdfs/jp2k-resetprob.pdf
Normal file
BIN
test/pdfs/jp2k-resetprob.pdf
Normal file
Binary file not shown.
@ -4922,6 +4922,13 @@
|
||||
"rounds": 1,
|
||||
"type": "eq"
|
||||
},
|
||||
{ "id": "jpx-resetContextProbabilities",
|
||||
"file": "pdfs/jp2k-resetprob.pdf",
|
||||
"md5": "fc9fb23e0a08d985b70cfb32fa9e9ca1",
|
||||
"rounds": 1,
|
||||
"type": "eq",
|
||||
"about": "Fixes one part of bug 1731483."
|
||||
},
|
||||
{ "id": "bug1140761",
|
||||
"file": "pdfs/bug1140761.pdf",
|
||||
"md5": "b74eced7634d4f248dc6265f8225d432",
|
||||
|
Loading…
Reference in New Issue
Block a user