summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/arith.h
authorllornkcor <llornkcor>2002-07-01 23:24:08 (UTC)
committer llornkcor <llornkcor>2002-07-01 23:24:08 (UTC)
commit59222a752fa4c8a1e8c2a00ee2f9e22855f12bb2 (patch) (side-by-side diff)
treef148d4858859dac3b413e675c760acfdab24b8e6 /noncore/apps/opie-reader/arith.h
parentc08be8ae22dcc1bfb83cfdec807149b161d770f5 (diff)
downloadopie-59222a752fa4c8a1e8c2a00ee2f9e22855f12bb2.zip
opie-59222a752fa4c8a1e8c2a00ee2f9e22855f12bb2.tar.gz
opie-59222a752fa4c8a1e8c2a00ee2f9e22855f12bb2.tar.bz2
initial
Diffstat (limited to 'noncore/apps/opie-reader/arith.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/arith.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/noncore/apps/opie-reader/arith.h b/noncore/apps/opie-reader/arith.h
new file mode 100644
index 0000000..19ca646
--- a/dev/null
+++ b/noncore/apps/opie-reader/arith.h
@@ -0,0 +1,43 @@
+/*
+ * Encodage & décodage arithmétique
+ */
+
+#ifndef ARITH_H
+
+#define ARITH_H
+
+#include "utypes.h"
+#include <stdio.h>
+
+class PPM_ReadBuf
+{
+ FILE *my_file_in;
+public:
+ PPM_ReadBuf(FILE* f) : my_file_in(f) {}
+ UINT readbuf(UCHAR *buf,UINT len)
+ {
+ UINT len1;
+ len1=fread(buf,1,len,my_file_in);
+ return len1;
+ }
+};
+
+class ArithClass
+{
+
+UCHAR *ainbuf;
+UCHAR *apinbuf,*aendinbuf;
+UINT ainbufsize;
+USHORT avalue,alow,ahigh;
+PPM_ReadBuf* areadbuf;
+UCHAR abitcnt;
+USHORT abitbuf;
+
+ public:
+void Arith_DecodeInit(PPM_ReadBuf* readbuf,UCHAR *buf,UINT bufsize);
+UINT Arith_DecodeVal(UINT size);
+void Arith_Decode(UINT min,UINT max,UINT size);
+void Arith_DecodeEnd(void);
+
+};
+#endif