diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2011-02-13 01:01:18 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2011-02-13 01:01:18 +0000 |
commit | 93867b8c2f86de0cb99847d10c33112fb0fafc93 (patch) | |
tree | a7e8fefbaab6ab2bcebe73751ee0511f7d5a9bb2 | |
parent | 2a8178a1aab7df2b6445d1d4068fccf1759b68f0 (diff) | |
download | netpbm-mirror-93867b8c2f86de0cb99847d10c33112fb0fafc93.tar.gz netpbm-mirror-93867b8c2f86de0cb99847d10c33112fb0fafc93.tar.xz netpbm-mirror-93867b8c2f86de0cb99847d10c33112fb0fafc93.zip |
cleanup
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1405 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r-- | converter/pbm/g3topbm.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/converter/pbm/g3topbm.c b/converter/pbm/g3topbm.c index 9ae21430..b0d08f9e 100644 --- a/converter/pbm/g3topbm.c +++ b/converter/pbm/g3topbm.c @@ -196,7 +196,7 @@ readBitAndDetectEol(struct bitStream * const bitStreamP, Same as readBit(), but iff the bit read is the final bit of an EOL mark, return *eolP == TRUE. - An EOL mark is 11 zero bits in a row. + An EOL mark is 11 zero bits followed by a one. -----------------------------------------------------------------------------*/ readBit(bitStreamP, bitP, errorP); if (!*errorP) { @@ -387,7 +387,11 @@ processG3Code(const g3TableEntry * const teP, unsigned int * const colP, bit * const colorP, unsigned int * const countP) { - +/*---------------------------------------------------------------------------- + 'teP' is a pointer into the mtable/ttable. Note that the thing it points + to is irrelevant to us; it is only the position in the table that + matters. +-----------------------------------------------------------------------------*/ enum g3tableId const teId = (teP > mtable ? 2 : 0) + (teP - ttable) % 2; @@ -403,17 +407,17 @@ processG3Code(const g3TableEntry * const teP, switch (teId) { case TERMWHITE: case TERMBLACK: { - unsigned int runLengthSoFar; + unsigned int totalRunLength; unsigned int col; col = *colP; - runLengthSoFar = MIN(*countP + teCount, MAXCOLS - col); + totalRunLength = MIN(*countP + teCount, MAXCOLS - col); - if (runLengthSoFar > 0) { + if (totalRunLength > 0) { if (*colorP == PBM_BLACK) - writeBlackBitSpan(packedBitrow, runLengthSoFar, col); + writeBlackBitSpan(packedBitrow, totalRunLength, col); /* else : Row was initialized to white, so we just skip */ - col += runLengthSoFar; + col += totalRunLength; } *colorP = !*colorP; *countP = 0; |