arith.h

来自「此源码为vc++实现的小波算法,可以对图像进行三次小波变换」· C头文件 代码 · 共 54 行

H
54
字号
// Copyright 1996 John M. Danskin 7/30/96//// Permission is granted to use this software for any purpose as// long as this notice stays attached to this software.//// These objects implement arithmetic coding as described in// Bell, Cleary, and Witten "Text Compression" Prentice Hall.#ifndef _ARITH_CODER_#define _ARITH_CODER_#include <iostream.h>#include "iHisto.h"#include "BitIO.h"class CodingValues {public:    long low, high, value;    static const int CodeValueBits;    static const long MaxFreq;    static const long One;    static const long Qtr;    static const long Half;    static const long ThreeQtr;};		class ArithEncoder : public CodingValues {        BitOut &output;    inline void bpf(int bit)    {	output.output_bit(bit);	for (int i = 0; i < bitsToFollow; i++) {	    output.output_bit(1 - bit);	}	bitsToFollow = 0;    }public:    ArithEncoder(BitOut &bo);    void Encode(int count, int countLeft, int countTot);    void flush(void);    int bitsToFollow;};class ArithDecoder : public CodingValues {    BitIn &input;public:    ArithDecoder(BitIn &bi);    int Decode(iHistogram &h);};#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?