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

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

?? lzss.c

?? 包含Lzw,Huff1,Dhuff等等多種壓縮算法的源代碼包
?? C
字號:
/**************************************************************
	LZSS.C -- A Data Compression Program
	(tab = 4 spaces)
***************************************************************
	4/6/1989 Haruhiko Okumura
	Use, distribute, and modify this program freely.
	Please send me your improved versions.
		PC-VAN		SCIENCE
		NIFTY-Serve	PAF01022
		CompuServe	74050,1022
**************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

#define N		 4096	/* size of ring buffer */
#define F		   18	/* upper limit for match_length */
#define THRESHOLD	2   /* encode string into position and length
						   if match_length is greater than this */
#define NIL			N	/* index for root of binary search trees */

unsigned long int
		textsize = 0,	/* text size counter */
		codesize = 0,	/* code size counter */
		printcount = 0;	/* counter for reporting progress every 1K bytes */
unsigned char
		text_buf[N + F - 1];	/* ring buffer of size N,
			with extra F-1 bytes to facilitate string comparison */
int		match_position, match_length,  /* of longest match.  These are
			set by the InsertNode() procedure. */
		lson[N + 1], rson[N + 257], dad[N + 1];  /* left & right children &
			parents -- These constitute binary search trees. */
FILE	*infile, *outfile;  /* input & output files */

void InitTree(void)  /* initialize trees */
{
	int  i;

	/* For i = 0 to N - 1, rson[i] and lson[i] will be the right and
	   left children of node i.  These nodes need not be initialized.
	   Also, dad[i] is the parent of node i.  These are initialized to
	   NIL (= N), which stands for 'not used.'
	   For i = 0 to 255, rson[N + i + 1] is the root of the tree
	   for strings that begin with character i.  These are initialized
	   to NIL.  Note there are 256 trees. */

	for (i = N + 1; i <= N + 256; i++) rson[i] = NIL;
	for (i = 0; i < N; i++) dad[i] = NIL;
}

void InsertNode(int r)
	/* Inserts string of length F, text_buf[r..r+F-1], into one of the
	   trees (text_buf[r]'th tree) and returns the longest-match position
	   and length via the global variables match_position and match_length.
	   If match_length = F, then removes the old node in favor of the new
	   one, because the old one will be deleted sooner.
	   Note r plays double role, as tree node and position in buffer. */
{
	int  i, p, cmp;
	unsigned char  *key;

	cmp = 1;  key = &text_buf[r];  p = N + 1 + key[0];
	rson[r] = lson[r] = NIL;  match_length = 0;
	for ( ; ; ) {
		if (cmp >= 0) {
			if (rson[p] != NIL) p = rson[p];
			else {  rson[p] = r;  dad[r] = p;  return;  }
		} else {
			if (lson[p] != NIL) p = lson[p];
			else {  lson[p] = r;  dad[r] = p;  return;  }
		}
		for (i = 1; i < F; i++)
			if ((cmp = key[i] - text_buf[p + i]) != 0)  break;
		if (i > match_length) {
			match_position = p;
			if ((match_length = i) >= F)  break;
		}
	}
	dad[r] = dad[p];  lson[r] = lson[p];  rson[r] = rson[p];
	dad[lson[p]] = r;  dad[rson[p]] = r;
	if (rson[dad[p]] == p) rson[dad[p]] = r;
	else                   lson[dad[p]] = r;
	dad[p] = NIL;  /* remove p */
}

void DeleteNode(int p)  /* deletes node p from tree */
{
	int  q;
	
	if (dad[p] == NIL) return;  /* not in tree */
	if (rson[p] == NIL) q = lson[p];
	else if (lson[p] == NIL) q = rson[p];
	else {
		q = lson[p];
		if (rson[q] != NIL) {
			do {  q = rson[q];  } while (rson[q] != NIL);
			rson[dad[q]] = lson[q];  dad[lson[q]] = dad[q];
			lson[q] = lson[p];  dad[lson[p]] = q;
		}
		rson[q] = rson[p];  dad[rson[p]] = q;
	}
	dad[q] = dad[p];
	if (rson[dad[p]] == p) rson[dad[p]] = q;  else lson[dad[p]] = q;
	dad[p] = NIL;
}

void Encode(void)
{
	int  i, c, len, r, s, last_match_length, code_buf_ptr;
	unsigned char  code_buf[17], mask;
	
	InitTree();  /* initialize trees */
	code_buf[0] = 0;  /* code_buf[1..16] saves eight units of code, and
		code_buf[0] works as eight flags, "1" representing that the unit
		is an unencoded letter (1 byte), "0" a position-and-length pair
		(2 bytes).  Thus, eight units require at most 16 bytes of code. */
	code_buf_ptr = mask = 1;
	s = 0;  r = N - F;
	for (i = s; i < r; i++) text_buf[i] = ' ';  /* Clear the buffer with
		any character that will appear often. */
	for (len = 0; len < F && (c = getc(infile)) != EOF; len++)
		text_buf[r + len] = c;  /* Read F bytes into the last F bytes of
			the buffer */
	if ((textsize = len) == 0) return;  /* text of size zero */
	for (i = 1; i <= F; i++) InsertNode(r - i);  /* Insert the F strings,
		each of which begins with one or more 'space' characters.  Note
		the order in which these strings are inserted.  This way,
		degenerate trees will be less likely to occur. */
	InsertNode(r);  /* Finally, insert the whole string just read.  The
		global variables match_length and match_position are set. */
	do {
		if (match_length > len) match_length = len;  /* match_length
			may be spuriously long near the end of text. */
		if (match_length <= THRESHOLD) {
			match_length = 1;  /* Not long enough match.  Send one byte. */
			code_buf[0] |= mask;  /* 'send one byte' flag */
			code_buf[code_buf_ptr++] = text_buf[r];  /* Send uncoded. */
		} else {
			code_buf[code_buf_ptr++] = (unsigned char) match_position;
			code_buf[code_buf_ptr++] = (unsigned char)
				(((match_position >> 4) & 0xf0)
			  | (match_length - (THRESHOLD + 1)));  /* Send position and
					length pair. Note match_length > THRESHOLD. */
		}
		if ((mask <<= 1) == 0) {  /* Shift mask left one bit. */
			for (i = 0; i < code_buf_ptr; i++)  /* Send at most 8 units of */
				putc(code_buf[i], outfile);     /* code together */
			codesize += code_buf_ptr;
			code_buf[0] = 0;  code_buf_ptr = mask = 1;
		}
		last_match_length = match_length;
		for (i = 0; i < last_match_length &&
				(c = getc(infile)) != EOF; i++) {
			DeleteNode(s);		/* Delete old strings and */
			text_buf[s] = c;	/* read new bytes */
			if (s < F - 1) text_buf[s + N] = c;  /* If the position is
				near the end of buffer, extend the buffer to make
				string comparison easier. */
			s = (s + 1) & (N - 1);  r = (r + 1) & (N - 1);
				/* Since this is a ring buffer, increment the position
				   modulo N. */
			InsertNode(r);	/* Register the string in text_buf[r..r+F-1] */
		}
		if ((textsize += i) > printcount) {
			printf("%12ld\r", textsize);  printcount += 1024;
				/* Reports progress each time the textsize exceeds
				   multiples of 1024. */
		}
		while (i++ < last_match_length) {	/* After the end of text, */
			DeleteNode(s);					/* no need to read, but */
			s = (s + 1) & (N - 1);  r = (r + 1) & (N - 1);
			if (--len) InsertNode(r);		/* buffer may not be empty. */
		}
	} while (len > 0);	/* until length of string to be processed is zero */
	if (code_buf_ptr > 1) {		/* Send remaining code. */
		for (i = 0; i < code_buf_ptr; i++) putc(code_buf[i], outfile);
		codesize += code_buf_ptr;
	}
	printf("In : %ld bytes\n", textsize);	/* Encoding is done. */
	printf("Out: %ld bytes\n", codesize);
	printf("Out/In: %.3f\n", (double)codesize / textsize);
}

void Decode(void)	/* Just the reverse of Encode(). */
{
	int  i, j, k, r, c;
	unsigned int  flags;
	
	for (i = 0; i < N - F; i++) text_buf[i] = ' ';
	r = N - F;  flags = 0;
	for ( ; ; ) {
		if (((flags >>= 1) & 256) == 0) {
			if ((c = getc(infile)) == EOF) break;
			flags = c | 0xff00;		/* uses higher byte cleverly */
		}							/* to count eight */
		if (flags & 1) {
			if ((c = getc(infile)) == EOF) break;
			putc(c, outfile);  text_buf[r++] = c;  r &= (N - 1);
		} else {
			if ((i = getc(infile)) == EOF) break;
			if ((j = getc(infile)) == EOF) break;
			i |= ((j & 0xf0) << 4);  j = (j & 0x0f) + THRESHOLD;
			for (k = 0; k <= j; k++) {
				c = text_buf[(i + k) & (N - 1)];
				putc(c, outfile);  text_buf[r++] = c;  r &= (N - 1);
			}
		}
	}
}

int main(int argc, char *argv[])
{
	char  *s;
	
	if (argc != 4) {
		printf("'lzss e file1 file2' encodes file1 into file2.\n"
			   "'lzss d file2 file1' decodes file2 into file1.\n");
		return EXIT_FAILURE;
	}
	if ((s = argv[1], s[1] || strpbrk(s, "DEde") == NULL)
	 || (s = argv[2], (infile  = fopen(s, "rb")) == NULL)
	 || (s = argv[3], (outfile = fopen(s, "wb")) == NULL)) {
		printf("??? %s\n", s);  return EXIT_FAILURE;
	}
	if (toupper(*argv[1]) == 'E') Encode();  else Decode();
	fclose(infile);  fclose(outfile);
	return EXIT_SUCCESS;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产三级三级三级精品8ⅰ区| 国产日韩精品一区二区三区 | 99久久伊人网影院| 久久精品国产久精国产爱| 奇米色777欧美一区二区| 日韩有码一区二区三区| 日本在线不卡视频一二三区| 日韩av成人高清| 激情综合网激情| 成人中文字幕在线| 99久久婷婷国产| 日本久久精品电影| 欧美在线|欧美| 91精品婷婷国产综合久久性色 | 国产一区二区在线影院| 国内精品免费**视频| 丁香婷婷综合网| 欧美日韩色综合| 久久影院午夜片一区| 国产精品久久精品日日| 亚洲国产精品久久久久婷婷884| 亚洲自拍偷拍综合| 欧美做爰猛烈大尺度电影无法无天| 成人手机电影网| 91网页版在线| 欧美一二三区在线观看| 久久久久成人黄色影片| 亚洲精品第一国产综合野| 日韩制服丝袜av| 国产69精品久久久久毛片| 91麻豆福利精品推荐| 欧美一区二区三区在线| 中文字幕亚洲在| 青草av.久久免费一区| 豆国产96在线|亚洲| 欧美视频一区二区三区| 久久久久久久久久久久久久久99| 亚洲精品国产一区二区精华液| 美日韩一区二区三区| 91小视频在线观看| 欧美成人福利视频| 亚洲国产一区视频| 国产白丝精品91爽爽久久| 欧美日韩在线亚洲一区蜜芽| 欧美激情艳妇裸体舞| 青青青爽久久午夜综合久久午夜| 成人综合在线观看| 欧美一级二级三级蜜桃| 亚洲三级小视频| 国产成人在线观看| 日韩一区二区视频| 亚洲一区二区中文在线| 国产a级毛片一区| 欧美tk丨vk视频| 亚洲一区二区黄色| 色综合久久久久久久久久久| 久久久久久久久久久电影| 毛片av中文字幕一区二区| 欧美在线观看你懂的| 综合av第一页| 99久久精品国产一区二区三区| 久久久一区二区| 国产一区二区三区美女| www日韩大片| 久久国产精品99久久人人澡| 欧美一级理论性理论a| 日韩精品三区四区| 欧美猛男男办公室激情| 亚洲第一成人在线| 欧美天天综合网| 亚洲国产欧美在线人成| 欧美三级资源在线| 午夜欧美一区二区三区在线播放| 欧美影院午夜播放| 亚洲不卡在线观看| 欧美日韩高清一区二区| 日韩福利电影在线观看| 日韩欧美一级二级三级| 免费观看一级特黄欧美大片| 日韩精品一区二区三区在线播放| 美女www一区二区| 久久久久亚洲蜜桃| 成人app网站| 亚洲综合一二区| 欧美一区二区三区在线电影| 久草在线在线精品观看| 国产视频在线观看一区二区三区| 国产传媒久久文化传媒| 中文字幕一区二区三| 欧美性受xxxx| 蜜臀a∨国产成人精品| 久久日一线二线三线suv| 国产盗摄视频一区二区三区| 专区另类欧美日韩| 欧美日韩一区视频| 青青国产91久久久久久| 国产亚洲精品7777| 在线视频一区二区三区| 青草av.久久免费一区| 国产午夜精品一区二区三区嫩草 | 最好看的中文字幕久久| 欧美卡1卡2卡| 成人天堂资源www在线| 亚洲自拍偷拍麻豆| 久久久美女毛片| 在线观看亚洲一区| 国产+成+人+亚洲欧洲自线| 亚洲欧美二区三区| 精品乱码亚洲一区二区不卡| 成人avav影音| 久久电影网电视剧免费观看| 国产精品久久久久久久岛一牛影视| 欧美日韩在线播| 成人一区二区视频| 日韩1区2区3区| 亚洲视频在线观看三级| 日韩精品中文字幕一区二区三区 | 国产亚洲精品福利| 欧美精品视频www在线观看| 国产激情一区二区三区四区 | 粉嫩在线一区二区三区视频| 亚洲成年人网站在线观看| 久久久精品欧美丰满| 91.xcao| 色综合视频一区二区三区高清| 久久精品999| 天天综合日日夜夜精品| 一区二区三区鲁丝不卡| 国产精品色婷婷| 精品国产制服丝袜高跟| 欧美一区二区三区日韩| 91福利精品第一导航| 成人精品国产福利| 国产精品综合网| 裸体歌舞表演一区二区| 天堂久久一区二区三区| 亚洲精品国产精华液| 国产精品久久网站| 国产精品污网站| 国产亚洲精品精华液| 久久久久国产精品人| 精品成人一区二区| 欧美精品一区二区三区在线| 日韩欧美一级二级三级久久久| 777精品伊人久久久久大香线蕉| 在线免费观看日韩欧美| 一本大道久久a久久精品综合| 成人动漫视频在线| 不卡大黄网站免费看| 白白色 亚洲乱淫| 成人av先锋影音| 成人av在线电影| 91成人免费在线视频| 欧美制服丝袜第一页| 色综合色综合色综合| 欧美性受极品xxxx喷水| 欧美久久久一区| 在线综合视频播放| 精品国产一区二区三区忘忧草| 欧美v国产在线一区二区三区| 欧美成人vps| 国产丝袜在线精品| 国产精品成人一区二区艾草| 综合久久久久久久| 香港成人在线视频| 久久91精品久久久久久秒播| 国产成人在线影院| 日本精品一级二级| 91精品国产综合久久福利软件| 欧美变态tickle挠乳网站| 国产日韩精品一区| 亚洲精品成人精品456| 日韩精品电影在线| 国产二区国产一区在线观看| 99久久久久久| 日韩欧美一级二级| 亚洲丝袜自拍清纯另类| 亚洲成av人综合在线观看| 极品销魂美女一区二区三区| 99久久久免费精品国产一区二区| 精品视频全国免费看| 久久在线免费观看| 亚洲一卡二卡三卡四卡| 国产在线不卡视频| 欧美视频你懂的| 久久久www免费人成精品| 亚洲欧美日韩小说| 麻豆成人综合网| 一本大道久久a久久精二百| 日韩精品一区二| 一区二区三区四区在线免费观看 | 国产三区在线成人av| 亚洲一区二区三区视频在线播放| 久久99国产精品免费| 日本乱人伦一区| 337p粉嫩大胆色噜噜噜噜亚洲| 中文字幕日本不卡| 国产精品小仙女| 欧美一区二区三区四区五区| 亚洲人成在线观看一区二区|