arcode.cpp

来自「This document is intended to serve as an」· C++ 代码 · 共 24 行

CPP
24
字号
#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 + =
减小字号Ctrl + -
显示快捷键?