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

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

?? lzss78.c

?? LZSS78.C -- A Data Compression Program Haruhiko Okumura 4/6/1989
?? 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一区二区三区免费野_久草精品视频
精品乱人伦一区二区三区| 337p粉嫩大胆色噜噜噜噜亚洲| 免费在线看一区| 国产欧美一区二区精品性| 欧日韩精品视频| 成人永久看片免费视频天堂| 亚洲成人av在线电影| 久久精品网站免费观看| 欧美精品在线一区二区三区| 91丨九色丨国产丨porny| 韩国av一区二区三区四区| 亚洲一区二区三区激情| 国产精品久久午夜夜伦鲁鲁| 欧美成人性战久久| 欧美日本一区二区在线观看| 99精品久久久久久| 国产美女精品在线| 日本不卡免费在线视频| 亚洲一区在线观看免费| 中文在线资源观看网站视频免费不卡| 日韩西西人体444www| 欧美色网站导航| 色综合久久久网| 成人av在线一区二区三区| 国产精品一级黄| 久久精品国产精品亚洲红杏| 婷婷开心激情综合| 亚洲午夜免费福利视频| 亚洲精品五月天| 国产精品久久久久久久久免费桃花 | 亚洲精品成人在线| 国产精品久久三| 国产欧美一区二区精品性色超碰 | 色婷婷av一区二区三区软件| 成人精品小蝌蚪| 不卡大黄网站免费看| 高清在线成人网| 国产成人免费视频一区| 国产一区二区0| 国产乱子轮精品视频| 国产在线一区观看| 国产在线精品一区二区| 国产精品综合二区| 国产酒店精品激情| 国产**成人网毛片九色 | 成人av综合在线| 不卡在线视频中文字幕| 成人免费精品视频| 99re热这里只有精品免费视频| av电影天堂一区二区在线观看| 99天天综合性| 一本色道a无线码一区v| 一本大道久久a久久精二百| 91老师片黄在线观看| 在线免费观看日本欧美| 欧美日韩在线观看一区二区 | 蜜桃视频在线一区| 国产美女一区二区| 99精品热视频| 欧美日韩在线电影| 26uuu精品一区二区三区四区在线| 精品欧美一区二区三区精品久久| 久久综合久久综合久久综合| 久久精品夜色噜噜亚洲a∨| 国产精品久久久久毛片软件| 亚洲精品伦理在线| 丝袜脚交一区二区| 国产综合色视频| www.亚洲精品| 欧美亚州韩日在线看免费版国语版| 欧美精品123区| 2023国产精华国产精品| 亚洲欧美影音先锋| 亚洲va欧美va国产va天堂影院| 日韩国产欧美三级| 国产成人精品三级麻豆| 91福利在线导航| 精品蜜桃在线看| 亚洲色图色小说| 青青草97国产精品免费观看| 国产传媒欧美日韩成人| 91福利在线导航| 久久亚洲综合色一区二区三区| 亚洲欧美怡红院| 蓝色福利精品导航| 97久久超碰精品国产| 91麻豆精品国产91久久久使用方法 | 麻豆一区二区三区| av综合在线播放| 日韩一级片网址| 亚洲区小说区图片区qvod| 免费在线观看一区二区三区| 99久久国产综合精品色伊| 欧美一卡在线观看| 国产精品三级av在线播放| 青青草国产成人av片免费| 99久久伊人网影院| 欧美大度的电影原声| 亚洲视频一区二区免费在线观看| 免费在线看成人av| 欧美性受xxxx黑人xyx性爽| 精品久久国产字幕高潮| 一区二区三区在线观看视频| 国产精品亚洲综合一区在线观看| 欧美性大战久久久久久久蜜臀| 国产午夜精品一区二区三区视频| 午夜视频一区二区三区| 国产成人精品三级| 日韩亚洲欧美一区二区三区| 亚洲精品国产视频| 高清不卡一区二区在线| 欧美电视剧在线看免费| 午夜成人在线视频| 色综合咪咪久久| 欧美激情在线观看视频免费| 久久精品二区亚洲w码| 欧美三级电影网站| 亚洲男人的天堂在线aⅴ视频| 国产精品一卡二| 26uuu精品一区二区在线观看| 免费看日韩a级影片| 欧美日韩视频一区二区| 一区二区三区资源| 91免费视频网址| 国产精品成人网| 成人国产免费视频| 国产三级一区二区| 国产精选一区二区三区| 久久亚洲一级片| 国内外精品视频| 久久蜜桃一区二区| 毛片av一区二区三区| 日韩亚洲欧美一区| 九一九一国产精品| 精品国产伦理网| 狠狠色综合日日| 久久嫩草精品久久久精品| 精品一区二区av| 久久久噜噜噜久噜久久综合| 狠狠色综合播放一区二区| 久久久久久夜精品精品免费| 国产一区二区三区电影在线观看| 精品卡一卡二卡三卡四在线| 久久成人综合网| 久久伊人蜜桃av一区二区| 国产一区视频网站| 亚洲国产精品av| www.亚洲激情.com| 亚洲精品中文在线影院| 欧美日韩精品欧美日韩精品| 日韩一区精品视频| 欧美大片一区二区| 国产91在线|亚洲| 国产精品国产三级国产普通话99 | 人人爽香蕉精品| 精品国产乱码久久久久久久| 国产精品系列在线播放| 国产精品免费视频网站| 一本久久综合亚洲鲁鲁五月天| 香蕉av福利精品导航| 欧美刺激脚交jootjob| 国产成人亚洲综合a∨婷婷图片 | 日韩不卡一区二区三区| 精品欧美一区二区在线观看| 成人爱爱电影网址| 亚洲成人第一页| 久久久久久一级片| 在线影院国内精品| 毛片不卡一区二区| 中文字幕一区二区三区色视频| 欧美视频一区二区三区| 国产一区二区调教| 成人免费视频在线观看| 在线电影国产精品| 粉嫩蜜臀av国产精品网站| 一区二区三区日韩精品| 欧美成人国产一区二区| www.亚洲在线| 天天做天天摸天天爽国产一区 | 裸体一区二区三区| 国产日韩欧美精品电影三级在线| 高清在线观看日韩| 捆绑紧缚一区二区三区视频| 中文字幕精品一区二区精品绿巨人| 成人一级片网址| 婷婷六月综合网| 久久久99久久精品欧美| 色综合中文综合网| 久久99久久99| 欧美三级三级三级爽爽爽| 韩国精品主播一区二区在线观看| 国产欧美日韩亚州综合| 欧美亚洲动漫精品| 成人午夜短视频| 一区二区三区日韩精品| 精品女同一区二区| 国内国产精品久久| 亚洲h精品动漫在线观看| 精品国产乱码久久久久久蜜臀 | 不卡影院免费观看|