ref: 944999a4bd52b9eef0139ad122bf2c77ee319a36
parent: 4f08ba8f347c51f7dd6467f03ab9947fc3fe19e8
author: Sebastian Rasmussen <[email protected]>
date: Tue Apr 24 19:57:18 EDT 2018
jbig2dec: Move arithmetic decoder test logging inside test. Also take the opportunity to make the test stream static.
--- a/jbig2_arith.c
+++ b/jbig2_arith.c
@@ -149,14 +149,6 @@
}
}
-#if defined(JBIG2_DEBUG) || defined(JBIG2_DEBUG_ARITH)
-static void
-jbig2_arith_trace(Jbig2ArithState *as, Jbig2ArithCx cx)
-{
- fprintf(stderr, "I = %2d, MPS = %d, A = %04x, CT = %2d, C = %08x\n", cx & 0x7f, cx >> 7, as->A, as->CT, as->C);
-}
-#endif
-
/** Allocate and initialize a new arithmetic coding state
* the returned pointer can simply be freed; this does
* not affect the associated Jbig2WordStream.
@@ -336,12 +328,20 @@
#ifdef TEST
-const byte test_stream[] = {
+static const byte test_stream[] = {
0x84, 0xC7, 0x3B, 0xFC, 0xE1, 0xA1, 0x43, 0x04, 0x02, 0x20, 0x00, 0x00,
0x41, 0x0D, 0xBB, 0x86, 0xF4, 0x31, 0x7F, 0xFF, 0x88, 0xFF, 0x37, 0x47,
0x1A, 0xDB, 0x6A, 0xDF, 0xFF, 0xAC,
0x00, 0x00
};
+
+#if defined(JBIG2_DEBUG) || defined(JBIG2_DEBUG_ARITH)
+static void
+jbig2_arith_trace(Jbig2ArithState *as, Jbig2ArithCx cx)
+{
+ fprintf(stderr, "I = %2d, MPS = %d, A = %04x, CT = %2d, C = %08x\n", cx & 0x7f, cx >> 7, as->A, as->CT, as->C);
+}
+#endif
static int
test_get_word(Jbig2WordStream *self, size_t offset, uint32_t *word)