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

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

?? aricacm.h

?? 基于wavelet算法的視頻圖像壓縮
?? 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一区二区三区免费野_久草精品视频
91精品国产综合久久小美女| 国产精品久久久久影视| 欧美精品一区二区精品网| 亚洲欧洲国产专区| 亚洲1区2区3区视频| 成人免费黄色大片| 欧美一级淫片007| 亚洲美女一区二区三区| 国产精品中文欧美| 欧美另类一区二区三区| 中文字幕制服丝袜成人av| 麻豆免费精品视频| 欧美三级电影网站| 亚洲欧美一区二区三区久本道91| 另类小说图片综合网| 欧美人妇做爰xxxⅹ性高电影| 一区精品在线播放| 国产精华液一区二区三区| 91精品国产一区二区三区香蕉 | 欧美日韩免费一区二区三区视频| 26uuu亚洲| 麻豆精品蜜桃视频网站| 91麻豆精品国产91久久久久久| 亚洲美女在线一区| 97se亚洲国产综合自在线观| 国产欧美一区二区精品性| 国内精品伊人久久久久av影院| 欧美精品乱码久久久久久| 亚洲国产日韩在线一区模特 | 麻豆91免费观看| 欧美区一区二区三区| 亚洲第一成人在线| 欧美日韩极品在线观看一区| 亚洲丶国产丶欧美一区二区三区| 一本到高清视频免费精品| 亚洲精品免费播放| 在线日韩av片| 视频一区视频二区中文字幕| 欧美日韩aaaaa| 日本亚洲一区二区| 日韩视频不卡中文| 激情久久五月天| 久久亚洲综合av| 国产高清一区日本| 亚洲视频电影在线| 欧美在线观看你懂的| 日韩中文字幕不卡| 日韩欧美国产成人一区二区| 久久成人免费日本黄色| 久久久美女艺术照精彩视频福利播放| 国产精品自产自拍| 国产精品国模大尺度视频| 在线精品视频一区二区| 丝袜美腿亚洲色图| 久久精品男人天堂av| 不卡的电视剧免费网站有什么| 亚洲特黄一级片| 欧美精品在线观看一区二区| 久久精品999| 中文字幕日韩一区二区| 欧美婷婷六月丁香综合色| 奇米一区二区三区av| 久久精品视频一区二区| 日本大香伊一区二区三区| 日本美女视频一区二区| 国产精品你懂的在线欣赏| 欧美探花视频资源| 国产综合久久久久影院| 亚洲专区一二三| 精品国产免费一区二区三区四区| 成人福利在线看| 日本不卡一区二区三区| 国产精品的网站| 日韩欧美在线影院| 91丨porny丨国产| 久久精品国产99国产| 中文字幕一区二区三| 欧美一区二区福利在线| av毛片久久久久**hd| 蜜桃视频一区二区三区 | 国产日韩欧美一区二区三区综合| 91色porny蝌蚪| 精品在线一区二区| 亚洲第一久久影院| 国产精品久久久久久久浪潮网站| 欧美一区二区美女| 色天天综合久久久久综合片| 国产精品夜夜嗨| 日韩精品一级中文字幕精品视频免费观看 | 久久久激情视频| 欧美疯狂做受xxxx富婆| bt欧美亚洲午夜电影天堂| 久久精品国产在热久久| 五月天久久比比资源色| 国产精品伦理一区二区| 欧美va在线播放| 欧美日韩成人激情| 日本精品一级二级| 成人精品免费看| 国产一区二区三区香蕉| 蜜臀久久99精品久久久画质超高清| 亚洲女人****多毛耸耸8| 日本一区二区视频在线观看| 欧美不卡一区二区三区四区| 欧美日韩久久久一区| 91在线小视频| 成人av电影观看| 成人精品视频.| fc2成人免费人成在线观看播放| 国内成+人亚洲+欧美+综合在线| 日本不卡免费在线视频| 午夜不卡av免费| 午夜成人在线视频| 日韩专区欧美专区| 日韩va亚洲va欧美va久久| 亚洲成a人片在线不卡一二三区| 亚洲老妇xxxxxx| 亚洲一区二区视频在线观看| 亚洲欧美视频一区| 亚洲一区二区三区四区中文字幕| 亚洲天堂免费在线观看视频| 亚洲另类在线一区| 午夜久久久久久久久久一区二区| 亚洲国产精品影院| 丝袜诱惑制服诱惑色一区在线观看 | 国产精品你懂的| 自拍偷在线精品自拍偷无码专区 | 欧美精品一区二区三区一线天视频| 日韩欧美在线影院| 久久蜜桃一区二区| 日本一区二区在线不卡| 亚洲欧美日韩国产成人精品影院| 一区二区三区高清| 免费观看在线综合色| 国产一区二区按摩在线观看| 国产999精品久久| 91视频国产资源| 欧美天天综合网| 精品久久国产老人久久综合| 欧美经典三级视频一区二区三区| 国产精品福利影院| 亚洲成人7777| 国产麻豆精品95视频| 不卡一区二区在线| 欧美理论电影在线| 欧美—级在线免费片| 亚洲二区在线观看| 国产在线日韩欧美| 欧洲精品视频在线观看| 日韩一级精品视频在线观看| 国产精品麻豆欧美日韩ww| 亚洲www啪成人一区二区麻豆| 韩国在线一区二区| 日本丶国产丶欧美色综合| 精品国产99国产精品| 国产精品福利影院| 蜜桃视频在线一区| 色综合天天综合网国产成人综合天 | 成人精品免费网站| 欧美日本一区二区| 中文字幕视频一区| 国产在线视频精品一区| 欧美日本视频在线| 亚洲欧洲另类国产综合| 日日夜夜精品免费视频| 成人av网站在线观看免费| 欧美一区二区三区在线观看| 国产精品日韩成人| 精品无人区卡一卡二卡三乱码免费卡| av成人免费在线观看| 精品久久五月天| 亚洲第一福利一区| 93久久精品日日躁夜夜躁欧美| 欧美一个色资源| 亚洲国产成人精品视频| 成人性生交大合| 精品少妇一区二区三区在线视频| 一区二区三区四区在线免费观看 | 国产女人18毛片水真多成人如厕| 日本麻豆一区二区三区视频| 欧美在线视频不卡| 亚洲欧洲韩国日本视频| 国产精品白丝jk白祙喷水网站| 欧美一区二区三区四区五区| 亚洲精品乱码久久久久久| 成人免费av在线| 久久精品一区二区三区不卡| 免费人成在线不卡| 欧美日韩国产首页| 亚洲成人免费看| 欧美日韩五月天| 五月天一区二区三区| 欧美中文字幕久久| 一区二区在线观看av| 91女厕偷拍女厕偷拍高清| 成人欧美一区二区三区在线播放| 成人一区二区三区视频在线观看| 久久久久久电影| 国产精品18久久久久久久久久久久 | 欧美日韩精品欧美日韩精品一|