shithub: jbig2

Download patch

ref: 1efb1d79e3dead9e474ff89cd0ce0d6c87d21ca3
parent: 508693c17eb8f052fbcc0ea4976cb326e746c2f0
author: giles <giles@ded80894-8fb9-0310-811b-c03f3676ab4d>
date: Tue Aug 17 21:03:14 EDT 2004

It looks like templates aren't shared between generic and generic refinement decoding, so split
the routines into separate files.


git-svn-id: http://svn.ghostscript.com/jbig2dec/trunk@319 ded80894-8fb9-0310-811b-c03f3676ab4d

--- a/jbig2_generic.c
+++ b/jbig2_generic.c
@@ -366,6 +366,9 @@
   return -1;
 }
 
+/** Handler for immediate generic region segments
+ *
+ */
 int
 jbig2_immediate_generic_region(Jbig2Ctx *ctx, Jbig2Segment *segment,
 			       const byte *segment_data)
@@ -456,34 +459,5 @@
   jbig2_free(ctx->allocator, GB_stats);
 
   return code;
-}
-
-
-/**
- * jbig2_decode_refinement_region: Decode a generic refinement region.
- * @ctx: The context for allocation and error reporting.
- * @segment: A segment reference for error reporting.
- * @params: Decoding parameter set.
- * @as: Arithmetic decoder state.
- * @image: Where to store the decoded data.
- * @GB_stats: Arithmetic stats.
- *
- * Decodes a generic region, according to section 6.2. The caller should
- * pass an already allocated Jbig2Image object for @image
- *
- * Because this API is based on an arithmetic decoding state, it is
- * not suitable for MMR decoding.
- *
- * Return code: 0 on success.
- **/
-int
-jbig2_decode_refinement_region(Jbig2Ctx *ctx,
-			    Jbig2Segment *segment,
-			    const Jbig2RefinementRegionParams *params,
-			    Jbig2ArithState *as,
-			    Jbig2Image *image,
-			    Jbig2ArithCx *GB_stats)
-{
-
 }
 
--- /dev/null
+++ b/jbig2_refinement.c
@@ -1,0 +1,70 @@
+/*
+    jbig2dec
+    
+    Copyright (c) 2002-2004 artofcode LLC.
+    
+    This software is provided AS-IS with no warranty,
+    either express or implied.
+                                                                                
+    This software is distributed under license and may not
+    be copied, modified or distributed except as expressly
+    authorized under the terms of the license contained in
+    the file LICENSE in this distribution.
+                                                                                
+    For information on commercial licensing, go to
+    http://www.artifex.com/licensing/ or contact
+    Artifex Software, Inc.,  101 Lucas Valley Road #110,
+    San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+                                                                                
+    $Id: jbig2_refinement.c 318 2004-08-13 00:00:17Z giles $
+*/
+
+/**
+ * Generic Refinement region handlers.
+ **/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif 
+#include "os_types.h"
+
+#include <stddef.h>
+#include <string.h> /* memcpy(), memset() */
+
+#ifdef OUTPUT_PBM
+#include <stdio.h>
+#endif
+
+#include "jbig2.h"
+#include "jbig2_priv.h"
+#include "jbig2_arith.h"
+#include "jbig2_generic.h"
+#include "jbig2_mmr.h"
+
+/**
+ * jbig2_decode_refinement_region: Decode a generic refinement region.
+ * @ctx: The context for allocation and error reporting.
+ * @segment: A segment reference for error reporting.
+ * @params: Decoding parameter set.
+ * @as: Arithmetic decoder state.
+ * @image: Where to store the decoded data.
+ * @GB_stats: Arithmetic stats.
+ *
+ * Decodes a generic region, according to section 6.2. The caller should
+ * pass an already allocated Jbig2Image object for @image
+ *
+ * Because this API is based on an arithmetic decoding state, it is
+ * not suitable for MMR decoding.
+ *
+ * Return code: 0 on success.
+ **/
+int
+jbig2_decode_refinement_region(Jbig2Ctx *ctx,
+			    Jbig2Segment *segment,
+			    const Jbig2RefinementRegionParams *params,
+			    Jbig2ArithState *as,
+			    Jbig2Image *image,
+			    Jbig2ArithCx *GB_stats)
+{
+
+}