X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=pdf2swf%2Fxpdf%2FJArithmeticDecoder.h;h=a40823ddb0f2540710ad8a253d4784fb1db1473c;hp=a348017d02c4ad8e187a98e9d0a2aee675cb5b72;hb=85c46a8011c7fd5e4bda282266006c972ea7606b;hpb=b0d012f83219d898e9cd92281d9996bc9ff13b5f diff --git a/pdf2swf/xpdf/JArithmeticDecoder.h b/pdf2swf/xpdf/JArithmeticDecoder.h index a348017..a40823d 100644 --- a/pdf2swf/xpdf/JArithmeticDecoder.h +++ b/pdf2swf/xpdf/JArithmeticDecoder.h @@ -53,12 +53,29 @@ public: JArithmeticDecoder(); ~JArithmeticDecoder(); + void setStream(Stream *strA) - { str = strA; dataLen = -1; } + { str = strA; dataLen = 0; limitStream = gFalse; } void setStream(Stream *strA, int dataLenA) - { str = strA; dataLen = dataLenA; } + { str = strA; dataLen = dataLenA; limitStream = gTrue; } + + // Start decoding on a new stream. This fills the byte buffers and + // runs INITDEC. void start(); + + // Restart decoding on an interrupted stream. This refills the + // buffers if needed, but does not run INITDEC. (This is used in + // JPEG 2000 streams when codeblock data is split across multiple + // packets/layers.) + void restart(int dataLenA); + + // Read any leftover data in the stream. + void cleanup(); + + // Decode one bit. int decodeBit(Guint context, JArithmeticDecoderStats *stats); + + // Decode eight bits. int decodeByte(Guint context, JArithmeticDecoderStats *stats); // Returns false for OOB, otherwise sets * and returns true. @@ -86,6 +103,7 @@ private: Stream *str; int dataLen; + GBool limitStream; }; #endif