📄 arcode.cpp
字号:
#include <stdio.h>#include <stdlib.h>#include <string.h> #include "nrutil.h"#define NWK 20#define JTRY(j,k,m) ((long)((((double)(k))*((double)(j)))/((double)(m))))typedef unsigned char uchar;typedef unsigned long ulong;typedef struct { ulong *ilob,*iupb,*ncumfq,jdif,nc,minint,nch,ncum,nrad;} arithcode;/* Compress (isign = 1) or decompress (isign = -1) the single character ich into or out of
the character array *codep[1..lcode], starting with byte *codep[lcd] and (if necessary)
incrementing lcd so that, on return, lcd points to the first unused byte in *codep. Note
that the structure acode contains both information on the code, and also state information on
the particular output being written into the array *codep. An initializing call with isign=0
is required before beginning any *codep array, whether for encoding or decoding. This is in
addition to the initializing call to arcmak that is required to initialize the code itself. A call
with ich=nch (as set in arcmak) has the reserved meaning 揺nd of message.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -