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

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? lzss.cpp

?? zlib-1.2.3.tar是新的zlib庫(kù)藏 用于壓縮 等等
?? CPP
字號(hào):
/**************************************************************
	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>

#include "codec.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 */

static unsigned long int
        textsize = 0,   /* text size counter */
		codesize = 0,	/* code size counter */
		printcount = 0;	/* counter for reporting progress every 1K bytes */
static unsigned char
		text_buf[N + F - 1];	/* ring buffer of size N,
			with extra F-1 bytes to facilitate string comparison */
static 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. */
/* static FILE    *infile, *outfile;  input & output files */

static 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;
}

static 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 */
}

static 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;
}

int encode_lzss(void) /* was 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 = read_byte()) != EOF; len++)
		text_buf[r + len] = c;  /* Read F bytes into the last F bytes of
			the buffer */
	if ((textsize = len) == 0) return 0;  /* 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 */
                write_byte(code_buf[i]);     /* 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 = read_byte()) != 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++) write_byte(code_buf[i]);
		codesize += code_buf_ptr;
	}
#if 0     
	printf("In : %ld bytes\n", textsize);	/* Encoding is done. */
	printf("Out: %ld bytes\n", codesize);
	printf("Out/In: %.3f\n", (double)codesize / textsize);
#endif
    return 0;
}

int decode_lzss(void) /* was 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 = read_byte()) == EOF) break;
			flags = c | 0xff00;		/* uses higher byte cleverly */
		}							/* to count eight */
		if (flags & 1) {
            if ((c = read_byte()) == EOF) break;
            write_byte(c);  text_buf[r++] = c;  r &= (N - 1);
		} else {
            if ((i = read_byte()) == EOF) break;
            if ((j = read_byte()) == EOF) break;
			i |= ((j & 0xf0) << 4);  j = (j & 0x0f) + THRESHOLD;
			for (k = 0; k <= j; k++) {
				c = text_buf[(i + k) & (N - 1)];
                write_byte(c);  text_buf[r++] = c;  r &= (N - 1);
			}
		}
	}
    return 0;
}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美在线播放高清精品| 日韩中文字幕一区二区三区| 亚洲精品中文在线| 午夜精品久久久久久久蜜桃app| 日本不卡的三区四区五区| 国产精品中文有码| 色综合天天综合狠狠| 91精品国产综合久久福利 | 一区二区三区四区国产精品| 亚洲成人自拍偷拍| 国产一区 二区| 91视视频在线直接观看在线看网页在线看 | 欧美放荡的少妇| 国产亚洲污的网站| 香蕉影视欧美成人| 国产成人午夜99999| 欧美网站一区二区| 国产午夜精品一区二区三区嫩草| 亚洲免费色视频| 蜜桃91丨九色丨蝌蚪91桃色| 99久久99久久精品国产片果冻 | 午夜日韩在线观看| 国产91露脸合集magnet| 欧美午夜精品一区二区蜜桃| 久久综合色8888| 亚洲综合色成人| 国产自产视频一区二区三区| 在线免费观看日韩欧美| 久久久一区二区| 亚洲图片一区二区| 丁香婷婷综合色啪| 欧美高清性hdvideosex| 中文字幕免费不卡| 免费高清在线视频一区·| 91在线国内视频| 精品国产乱码久久久久久夜甘婷婷 | 国产成人夜色高潮福利影视| 欧美日韩性生活| 亚洲欧美在线视频| 国产伦精一区二区三区| 日韩一级片网址| 亚洲丰满少妇videoshd| 99re视频精品| 久久久久国产精品麻豆ai换脸| 婷婷久久综合九色国产成人| 99视频精品在线| 国产婷婷色一区二区三区| 日韩成人精品在线观看| 91成人免费电影| 中文字幕永久在线不卡| 国产乱码精品一区二区三区av| 欧美精品一二三| 日本不卡一区二区三区| 日本精品一级二级| 中文字幕乱码久久午夜不卡| 久久国内精品自在自线400部| 在线观看视频一区| 成人免费在线观看入口| 国产精品自拍毛片| 欧美成人a∨高清免费观看| 午夜精品在线视频一区| 欧美午夜精品一区| 亚洲一卡二卡三卡四卡五卡| 91麻豆swag| 亚洲色图在线看| 成人av中文字幕| 国产视频不卡一区| 国产尤物一区二区| 精品久久久久久久人人人人传媒 | 欧美日韩免费视频| 亚洲精品免费视频| 色呦呦网站一区| 一区二区三区中文免费| 91在线国产观看| 亚洲精品精品亚洲| 在线中文字幕一区二区| 亚洲一区在线视频| 欧美亚洲综合另类| 亚洲18影院在线观看| 9191久久久久久久久久久| 天堂成人免费av电影一区| 777奇米成人网| 久久99久久99| 精品毛片乱码1区2区3区| 精品写真视频在线观看| 国产亚洲精品资源在线26u| 粉嫩绯色av一区二区在线观看| 久久久av毛片精品| caoporm超碰国产精品| 国产精品久久久99| 欧洲精品在线观看| 日韩高清国产一区在线| 欧美一区二区三区在线观看视频| 麻豆成人在线观看| 国产欧美日韩视频一区二区| av在线这里只有精品| 亚洲精品va在线观看| 欧美精品在欧美一区二区少妇| 美国毛片一区二区| 国产欧美日韩另类一区| 91在线码无精品| 午夜国产不卡在线观看视频| 日韩欧美电影一二三| 国产成人综合自拍| 亚洲人成7777| 91麻豆精品国产综合久久久久久| 国产一区二区三区在线观看免费视频 | 亚欧色一区w666天堂| 精品国产一区二区精华| 粉嫩av亚洲一区二区图片| 亚洲午夜久久久久中文字幕久| 91精品国产日韩91久久久久久| 国产成人三级在线观看| 一区二区三区在线观看国产| 日韩欧美亚洲国产另类| av亚洲精华国产精华精华| 午夜精品福利视频网站| 国产亚洲一区二区三区在线观看 | 一区二区三区精品视频在线| 91精品国产色综合久久不卡蜜臀 | 亚洲精品免费视频| 欧美电影免费观看完整版| 99re热这里只有精品免费视频| 视频一区中文字幕| 中文字幕av一区 二区| 欧美精品vⅰdeose4hd| 成人av网址在线| 奇米影视7777精品一区二区| 国产精品每日更新在线播放网址| 欧美高清hd18日本| a美女胸又www黄视频久久| 日本不卡视频在线观看| 亚洲三级电影网站| 精品国产91乱码一区二区三区 | 视频精品一区二区| 国产精品青草综合久久久久99| 欧美人与z0zoxxxx视频| a4yy欧美一区二区三区| 久久精品国产精品青草| 一区二区三区在线视频播放| 欧美激情在线观看视频免费| 日韩一区二区在线免费观看| 99国产麻豆精品| 国产成人精品亚洲日本在线桃色| 亚洲午夜电影在线观看| 中文字幕不卡在线播放| 欧美成人aa大片| 欧美日韩国产另类不卡| 91婷婷韩国欧美一区二区| 韩国av一区二区三区四区 | 久久午夜免费电影| 欧美日韩色综合| 色老汉一区二区三区| 成人午夜大片免费观看| 久久国产精品99久久久久久老狼| 亚洲午夜私人影院| 亚洲天堂成人在线观看| 国产日产欧美一区| 精品免费视频一区二区| 欧美日本一道本在线视频| 91免费版在线| caoporen国产精品视频| 成人小视频免费观看| 国产伦精一区二区三区| 国产在线国偷精品产拍免费yy| 日韩**一区毛片| 午夜精品久久久久久不卡8050| 一区二区三区在线观看动漫| 亚洲美女少妇撒尿| 一区二区中文视频| 国产精品网友自拍| 久久久久久久免费视频了| 26uuu亚洲| 精品精品欲导航| 欧美不卡激情三级在线观看| 欧美一区二区在线免费观看| 91精品国产综合久久久久久漫画 | 青青草精品视频| 青青青伊人色综合久久| 日本欧美韩国一区三区| 日韩高清不卡在线| 日韩—二三区免费观看av| 婷婷夜色潮精品综合在线| 性感美女久久精品| 日本亚洲最大的色成网站www| 日韩av中文字幕一区二区三区| 日韩精品一级中文字幕精品视频免费观看 | 韩国一区二区三区| 国产在线视视频有精品| 国产一区二区三区国产| 国产精品99久久久| 国产mv日韩mv欧美| yourporn久久国产精品| 色偷偷久久人人79超碰人人澡| 色天使色偷偷av一区二区| 欧美私人免费视频| 7777精品伊人久久久大香线蕉| 精品三级在线看| 国产午夜精品在线观看| 亚洲人成人一区二区在线观看|