[jbig2-cvs] rev 343 - trunk
giles at ghostscript.com
giles at ghostscript.com
Wed Dec 1 11:40:05 PST 2004
Author: giles
Date: 2004-12-01 11:40:05 -0800 (Wed, 01 Dec 2004)
New Revision: 343
Modified:
trunk/jbig2_symbol_dict.c
Log:
Trial implementation of separate GR_stats for refinement arithmetic coding.
Modified: trunk/jbig2_symbol_dict.c
===================================================================
--- trunk/jbig2_symbol_dict.c 2004-12-01 19:26:13 UTC (rev 342)
+++ trunk/jbig2_symbol_dict.c 2004-12-01 19:40:05 UTC (rev 343)
@@ -206,7 +206,8 @@
Jbig2Segment *segment,
const Jbig2SymbolDictParams *params,
const byte *data, size_t size,
- Jbig2ArithCx *GB_stats)
+ Jbig2ArithCx *GB_stats,
+ Jbig2ArithCx *GR_stats)
{
Jbig2SymbolDict *SDNEWSYMS;
Jbig2SymbolDict *SDEXSYMS;
@@ -396,7 +397,7 @@
rparams.TPGRON = 0;
memcpy(rparams.grat, params->sdrat, 4);
jbig2_decode_refinement_region(ctx, segment,
- &rparams, as, image, GB_stats);
+ &rparams, as, image, GR_stats);
SDNEWSYMS->glyphs[NSYMSDECODED] = image;
@@ -484,6 +485,7 @@
int sdat_bytes;
int offset;
Jbig2ArithCx *GB_stats = NULL;
+ Jbig2ArithCx *GR_stats = NULL;
if (segment->data_length < 10)
goto too_short;
@@ -570,6 +572,11 @@
params.SDTEMPLATE == 1 ? 8192 : 1024;
GB_stats = jbig2_alloc(ctx->allocator, stats_size);
memset(GB_stats, 0, stats_size);
+ if (!params.SDRTEMPLATE) {
+ stats_size = params.SDRTEMPLATE ? 1 << 1 : 1 << 13;
+ GR_stats = jbig2_alloc(ctx->allocator, stats_size);
+ memset(GR_stats, 0, stats_size);
+ }
}
if (flags & 0x0100) {
@@ -581,12 +588,12 @@
¶ms,
segment_data + offset,
segment->data_length - offset,
- GB_stats);
+ GB_stats, GR_stats);
#ifdef DUMP_SYMDICT
if (segment->result) jbig2_dump_symbol_dict(ctx, segment);
#endif
- /* todo: retain or free GB_stats */
+ /* todo: retain or free GB_stats, GR_stats */
return (segment->result != NULL) ? 0 : -1;
More information about the jbig2-cvs
mailing list