ref: 3397c507d521d6f33ca30c7f11550338d22cad08
parent: f9d37c7cf6a23a1c28015eebf53f2421c497b179
author: Sebastian Rasmussen <sebras@gmail.com>
date: Sun Sep 15 12:57:23 EDT 2019
jbig2dec: Add more references to specification.
--- a/jbig2_arith.c
+++ b/jbig2_arith.c
@@ -78,7 +78,7 @@
* that fact for the next byte we read.
*/
- /* Figure G.3 */
+ /* Figure F.3 */
B = (byte)((as->next_word >> 24) & 0xFF);
if (B == 0xFF) {
byte B1;
@@ -165,7 +165,7 @@
result->next_word_bytes = new_bytes;
result->offset = new_bytes;
- /* Figure E.20 */
+ /* Figure F.1 */
result->C = (~(result->next_word >> 8)) & 0xFF0000;
jbig2_arith_bytein(result);
@@ -261,7 +261,7 @@
pqe = &jbig2_arith_Qe[index];
- /* Figure E.15 */
+ /* Figure F.2 */
as->A -= pqe->Qe;
if ((as->C >> 16) < as->A) {
if ((as->A & 0x8000) == 0) {
--- a/jbig2_arith_iaid.c
+++ b/jbig2_arith_iaid.c
@@ -72,6 +72,7 @@
{
Jbig2ArithCx *IAIDx = actx->IAIDx;
int SBSYMCODELEN = actx->SBSYMCODELEN;
+ /* A.3 (1) */
int PREV = 1;
int D;
int i;
--- a/jbig2_symbol_dict.c
+++ b/jbig2_symbol_dict.c
@@ -282,6 +282,7 @@
jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number, "failed to allocate for symbol bitmap");
goto cleanup;
}
+ /* 6.5.5 (2) */
if (!params->SDREFAGG) {
SDNEWSYMWIDTHS = jbig2_new(ctx, uint32_t, params->SDNUMNEWSYMS);
if (SDNEWSYMWIDTHS == NULL) {
@@ -347,6 +348,7 @@
tparams.SBDSOFFSET = 0;
tparams.SBRTEMPLATE = params->SDRTEMPLATE;
+ /* 6.5.5 (1) */
SDNEWSYMS = jbig2_sd_new(ctx, params->SDNUMNEWSYMS);
if (SDNEWSYMS == NULL) {
jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number, "failed to allocate new symbols (%u)", params->SDNUMNEWSYMS);