亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? aricacm.h

?? 完整的ezw小波編碼
?? H
字號:
#ifndef __ARICACM_H_
#define __ARICACM_H_

/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/	
/* $Copyright Issue
 * ----------------
 * Most of the code on arithemtic coding are modified from 
 * I.H. Witten, R.M. Neal, and J.G. Cleary, "Arithmetic coding for data
 * compression," Communnication ACM, vol 30, pp. 520-540, June 1987.
 *
 * The statistical table is implemented using Binary Index Tree as described in
 * P. M. Fenwick, "A new data structure for cumulative frequency tables,"
 * Softw. Pract. Exper. 24, 3 (Mar. 1994), 327-336.
 *
 * The idea of having the arithemetic coder to read/write bits directly was
 * from G. Davis code in "Wavelet Compression Construction Kit". His code
 * can only do write but has problem with synchronisation when doing read.
 * I fixed that with a virtual table approach.
 *
 * Mow-Song, Ng 2/9/2002
 * msng@mmu.edu.my
 * http://www.pesona.mmu.edu.my/~msng
 * 
 * I do not claim copyright to the code, but if you use them or modify them,
 * please drop me a mail.
 *
 */
/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/	
/* 
 * $LOG
 * ----
 * Data: 07-06-2002
 * - First version
 *
 * Date: 07-07-2002
 * - Added BasicCoder
 * - Some code shifting to arrange things better
 *
 * Date: 11-07-2002
 * - Added functions for writing arbitrary size code (up to 32 bits for 
 *	  one read/write)
 *
 * Date: 21-07-2002
 * - Modify the Context module. Now the maximum count is explicitly specified 
 *   by user.
 *
 * Date: 23-07-2002
 * - Fixed a bug in the count of number of bits outputed in the encoder
 *
 * Date: 24-07-2002
 * - Added nBitsInput to the arithmetic decoder
 *
 * Date: 15-08-2002
 * - Added BasicEscapeCoder
 * - Fixed some memory leak (pointers)
 *
 * Date: 16-08-2002
 * - Remove EntropyEncoderAdaptive & EntropyEncoderEscape
 * - Modified excape context behavior. Now we have an increasing decreament 
 *   size.
 *
 * $TODO
 * -----
 * - Check the escape coder, some how the performance is not as good as expected.
 *  + Checked! It seems that we have to tune the increment rate for a symbol and 
 *    the decrement rate of the escape symbol to obtain good results.
 *
 * - To extend BasicCoder to BasicEscapeCoder, which has an escape cotext in it
 *  + Done!
 * 
 * - Handle the EOF flag in the decoder.
 *
 * - Provide a threshold for the escape context. If the novel symbols count drop
 *   below a certain value, we do not use escape context at all.
 *   
 * - Order-1 coder (most likely not, the memory requirement is too high!)
 * 
 * - Upgrade to 27 bits!
 *
 */
/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/	
#include <stdlib.h>
#include <stdio.h>
#include "bitio.h"
#include "global.h"
#include "memchk.h"

/*----------------------------------------------------------------------------*/	
/*----------------------------------------------------------------------------*/	
#define CodeValueBits 16            
#define TopValue (((int)1<<CodeValueBits)-1)      
#define FirstQtr (TopValue/4+1)   
#define Half	  (2*FirstQtr)     
#define ThirdQtr (3*FirstQtr)     

/*----------------------------------------------------------------------------*/	
#define DefaultMaxFrequency 16383			

/*----------------------------------------------------------------------------*/	
typedef struct ContextStruct{
	int nSymbols;	
	int *Tree;	
	int p2half;
   int TotalFreq;
	int MaxCount;
} Context;

Context *ContextAlloc(void);
void ContextDealloc(Context *context);
int ContextInitialize(Context *context, int nSymbols, int MaxCount, int set);
int ContextGetCumul(Context *context, int Ix);
void ContextPutValue(Context *context, int val, int ix);
int ContextGetProb(Context *context, int ix);
void ContextScaleDown(Context *context);
int ContextGetSymbol(Context *context, int cumFreq);
void ContextUpdate(Context *context, int val, int ix);
double ContextGetCost(Context *context, int symbol);
void ContextPrintTable(Context *context, FILE *fp);

/*----------------------------------------------------------------------------*/	
/*----------------------------------------------------------------------------*/	
typedef struct ArithEncoderStruct{
	int low;
	int high;
	int range;
	int BitsToFollow;
	BIT_FILE *bs;
	int nBitsOutput;
} ArithEncoder;

ArithEncoder *ArithEncoderAlloc(BIT_FILE *bs);
void ArithEncoderDealloc(ArithEncoder *encoder);
void ArithEncoderStart(ArithEncoder *encoder);
void ArithEncoderEncode(ArithEncoder *encoder, int countLeft, int count, 
								int countTotal);
void ArithEncoderBitPlusFollow(ArithEncoder *encoder, int bit);
void ArithEncoderDone(ArithEncoder *encoder);
int  ArithEncoderNBitsOutput(ArithEncoder *encoder);

/*----------------------------------------------------------------------------*/	
/*----------------------------------------------------------------------------*/	
typedef struct ArithDecoderStruct {
	int low;
	int high;
	int range;
	int value;
	BIT_FILE *bs;
	int nBitsInput;
	int eof;
} ArithDecoder;

ArithDecoder *ArithDecoderAlloc(BIT_FILE *bs);
void ArithDecoderDealloc(ArithDecoder *decoder);
void ArithDecoderStart(ArithDecoder *decoder);
void ArithDecoderDecode(ArithDecoder *decoder, int countLeft, int count, 
								int countTotal );
int  ArithDecoderNBitsInput(ArithDecoder *decoder);


/*----------------------------------------------------------------------------*/	
/*----------------------------------------------------------------------------*/	
/* Note that the in the previous version, we have EntropyEncoderAdaptive and
 * EntropyEncoderEscape. They are tied to a fixed arithmetic coder. This 
 * prevents us from having just a single bit stream. The only way then is to 
 * arithmetic coded each data sets and then combine them into a single stream. 
 * The BasicCoder and BasicEscapeCoder requires a pointer to the arithemtic 
 * coder. Several coder can use the samearithmetic coder and produce a single 
 * bit streams. Conceptually, I see that the arithmetic coder does not perform 
 * compression/decompression, but just keeping track of the large floating 
 * number (which is about the same as the product of entropy from every 
 * symbols in the data set.
 *
 */

/*----------------------------------------------------------------------------*/	
/*----------------------------------------------------------------------------*/	
/* Refer to Davis 
 * The BasicCoder has a pointer to the context. The write operation requires 
 * a pointer to arithemetic coder. By freeing the coder from the arithmetic 
 * coder, we can use an arithmetic coder for several BasicCoder.
 */
typedef struct BasicCoderStruct{
	int nSymbols;
	int EndOfStreamSymbol;
	Context *context;
} BasicCoder;

BasicCoder *BasicCoderAlloc(int nSymbols, int MaxCount);

void BasicCoderDealloc(BasicCoder *coder);

double BasicCoderEncode(BasicCoder *coder, ArithEncoder *encoder, int symbol, 
								Boolean update);

int BasicCoderDecode(BasicCoder *coder, ArithDecoder *decoder, Boolean update);

void BasicCoderReset(BasicCoder *coder);

double BasicCoderGetCost(BasicCoder *coder, int symbol, Boolean update);

void BasicCoderSetNSymbols(BasicCoder *coder, int nSymbols, int MaxCount);

/*----------------------------------------------------------------------------*/	
/* 
 * The WriteNBits and ReadNBits functions are part of BasicCoder, but do not use
 * the data member of the module. This implementation allows read/write of symbols
 * and arbitrary bits value at any time without synchronisation problem.
 *
 */
void BasicCoderWriteNBits(ArithEncoder *encoder, int val, int nbits);
int BasicCoderReadNBits(ArithDecoder *decoder, int nbits);

/*----------------------------------------------------------------------------*/	
/*----------------------------------------------------------------------------*/	
/* BasicCoder with an escape context.
 */
typedef struct BasicEscapeCoderStruct{
	int nSymbols;
	int EndOfStreamSymbol, EscapeSymbol;
	char *NovelSymbol;
	Context *context;
	Context *escape;
	int EscapeDecreament;
	int EscapeDecreamentStart;
	int Thres;
	int nNovelSymbols;
} BasicEscapeCoder;

BasicEscapeCoder *BasicEscapeCoderAlloc(int nSymbols, int MaxCount, 
													 int EscapeDecreamentStart, int Thres);

void BasicEscapeCoderDealloc(BasicEscapeCoder *coder);

double BasicEscapeCoderEncode(BasicEscapeCoder *coder, ArithEncoder *encoder, 
										int symbol, Boolean update);

int BasicEscapeCoderDecode(BasicEscapeCoder *coder, ArithDecoder *decoder, 
									Boolean update);

void BasicEscapeCoderReset(BasicEscapeCoder *coder);

double BasicEscapeCoderGetCost(BasicEscapeCoder *coder, int symbol, 
										 Boolean update);

void BasicEscapeCoderSetNSymbols(BasicEscapeCoder *coder, int nSymbols, 
											int MaxCount, int EscapeDecreamentStart, 
											int Thres);

/*----------------------------------------------------------------------------*/	
/*----------------------------------------------------------------------------*/	
/* same as BasicCoderWriteNBits and BasicCoderReadNBits - should be used
 * from now on to streamlined the name.
 */
void CoderWriteNBits(ArithEncoder *encoder, int val, int nbits);
int CoderReadNBits(ArithDecoder *decoder, int nbits);

/*----------------------------------------------------------------------------*/	
/*----------------------------------------------------------------------------*/	
void CoderWarning(char *fmt, ...);
void CoderError(char *fmt, ...);

/*----------------------------------------------------------------------------*/	
/*----------------------------------------------------------------------------*/	

#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久不卡影院| 久久久久久久久久久久久久久99 | 91电影在线观看| 国产精品99久久久久久久vr| 精品在线播放免费| 老司机免费视频一区二区| 日韩精品1区2区3区| 老司机精品视频线观看86 | 国产精品12区| 国产宾馆实践打屁股91| 99久久婷婷国产综合精品| aa级大片欧美| 91搞黄在线观看| 欧美裸体一区二区三区| 日韩一级片网址| 精品1区2区在线观看| 久久久综合视频| 国产精品国产自产拍高清av| ●精品国产综合乱码久久久久| 一级精品视频在线观看宜春院| 亚洲成va人在线观看| 久久精品二区亚洲w码| 国产精品一区二区三区四区| 91亚洲精品久久久蜜桃| 91精品国产综合久久久久久久久久| 3d成人h动漫网站入口| 久久久不卡网国产精品一区| 亚洲欧美日韩一区二区| 日本不卡高清视频| 国产sm精品调教视频网站| 在线免费视频一区二区| 精品国产污污免费网站入口 | 亚洲黄色片在线观看| 日韩1区2区3区| 国产91精品一区二区麻豆亚洲| 色94色欧美sute亚洲线路一ni| 欧美一区二区三区在线| 亚洲天堂2014| 国产在线精品免费| 欧美日韩你懂得| 亚洲国产精品高清| 人人爽香蕉精品| 色婷婷久久久久swag精品| 精品毛片乱码1区2区3区| 一区二区三区在线免费播放| 国产一区视频导航| 欧美天堂亚洲电影院在线播放| 久久久久久亚洲综合影院红桃| 日韩综合一区二区| 色一情一乱一乱一91av| 国产网站一区二区| 美国十次综合导航| 欧美日韩视频在线观看一区二区三区 | 国产美女一区二区三区| 7878成人国产在线观看| 亚洲素人一区二区| 国产盗摄女厕一区二区三区| 91精品国产综合久久精品性色 | 午夜精品久久久久久久99水蜜桃 | 精品国产乱码久久久久久夜甘婷婷| 亚洲天堂久久久久久久| 高清久久久久久| 亚洲精品在线电影| 久久精品国内一区二区三区| 欧美精品一二三区| 亚洲大型综合色站| 欧美性感一类影片在线播放| 一区二区三区精品视频| 一本大道久久a久久精品综合| 国产亚洲成aⅴ人片在线观看| 日韩av中文字幕一区二区三区| 欧美色男人天堂| 亚洲动漫第一页| 欧美久久一二区| 五月激情丁香一区二区三区| 欧美喷潮久久久xxxxx| 亚洲国产精品久久久男人的天堂| 欧美优质美女网站| 丝袜美腿亚洲综合| 欧美精品久久99久久在免费线| 午夜成人在线视频| 91精品国产入口| 美日韩黄色大片| 久久综合九色欧美综合狠狠| 国产福利不卡视频| 中文字幕视频一区二区三区久| 91亚洲精华国产精华精华液| 亚洲精品国产无天堂网2021| 色婷婷一区二区三区四区| 亚洲一区视频在线| 7777精品久久久大香线蕉 | 国产日韩欧美一区二区三区综合| 国产成人av一区二区三区在线观看| 欧美xxxx在线观看| 成人性色生活片| 一区二区三区中文在线| 欧美精品乱码久久久久久| 久久99热国产| 国产精品免费观看视频| 欧美在线|欧美| 久久99精品久久久| 中文字幕欧美国产| 91福利视频久久久久| 久久精品国产免费| 一区视频在线播放| 91精品蜜臀在线一区尤物| 成人深夜视频在线观看| 亚洲综合激情网| 久久久久久亚洲综合| 欧美中文字幕一区| 国产在线精品一区二区| 怡红院av一区二区三区| 久久这里都是精品| 欧美性大战xxxxx久久久| 国模冰冰炮一区二区| 玉米视频成人免费看| 久久综合成人精品亚洲另类欧美| 99国产精品久| 久久精品国产一区二区| 一个色妞综合视频在线观看| 国产亚洲欧美日韩俺去了| 欧美在线色视频| 不卡在线视频中文字幕| 久久国产精品99精品国产| 一区二区三区四区乱视频| 26uuu色噜噜精品一区二区| 欧美日韩一区二区三区四区| 成人久久久精品乱码一区二区三区| 天天影视网天天综合色在线播放| 中文字幕精品一区| 欧美精品一区二区三区在线播放| 91福利精品第一导航| 成人av在线播放网址| 国产一区二区三区观看| 免费在线观看一区二区三区| 亚洲最新在线观看| 亚洲欧洲日韩综合一区二区| 久久婷婷国产综合国色天香| 欧美一区二区视频在线观看2022 | 欧美国产一区二区| 欧美精品一区二区三区一线天视频| 欧美日韩在线不卡| 在线免费观看日本一区| 色av一区二区| 91成人在线免费观看| 在线观看日产精品| 欧美图区在线视频| 欧美日韩综合不卡| 欧美色老头old∨ideo| 欧美日韩一区高清| 欧美日韩国产高清一区二区三区| 色综合亚洲欧洲| 色综合天天视频在线观看| 91在线视频免费91| 在线一区二区视频| 色欧美88888久久久久久影院| 91网页版在线| 欧美伊人久久大香线蕉综合69| 一道本成人在线| 欧美丝袜自拍制服另类| 欧美亚洲自拍偷拍| 91精品婷婷国产综合久久| 日韩欧美亚洲国产另类| 久久午夜色播影院免费高清| 青娱乐精品在线视频| a级精品国产片在线观看| 91福利精品第一导航| 日韩成人av影视| 精品一区二区三区日韩| 韩国女主播一区| 成人午夜视频福利| 91蝌蚪国产九色| 在线免费精品视频| 欧美一区国产二区| 久久久91精品国产一区二区三区| 国产欧美日韩在线观看| 亚洲欧洲精品一区二区三区 | 久久久精品国产免大香伊| 国产精品三级av| 亚洲激情校园春色| 蜜臀av一区二区在线观看 | 在线欧美日韩精品| 日韩欧美精品在线视频| 精品国产成人在线影院 | 日韩亚洲欧美高清| 欧美国产一区视频在线观看| 亚洲国产一二三| 国产iv一区二区三区| 在线观看欧美精品| 久久久久99精品国产片| 亚洲精品美国一| 国产揄拍国内精品对白| 欧美影片第一页| 国产亚洲午夜高清国产拍精品| 亚洲视频网在线直播| 精品系列免费在线观看| 欧美三级电影在线看| 中文字幕av一区二区三区| 天天免费综合色| 色综合久久久久综合体|