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

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

?? mini_inflate.c

?? ARM的bootloader代碼.rar
?? C
字號:
/*------------------------------------------------------------------------- * Filename:      mini_inflate.c * Copyright:     Copyright (C) 2001, Russ Dill * Author:        Russ Dill <Russ.Dill@asu.edu> * Description:   Mini inflate implementation (RFC 1951) *-----------------------------------------------------------------------*//* * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA * */#include <config.h>#if (CONFIG_COMMANDS & CFG_CMD_JFFS2)#include <jffs2/mini_inflate.h>/* The order that the code lengths in section 3.2.7 are in */static unsigned char huffman_order[] = {16, 17, 18,  0,  8,  7,  9,  6, 10,  5,					11,  4, 12,  3, 13,  2, 14,  1, 15};inline void cramfs_memset(int *s, const int c, size n){	n--;	for (;n > 0; n--) s[n] = c;	s[0] = c;}/* associate a stream with a block of data and reset the stream */static void init_stream(struct bitstream *stream, unsigned char *data,			void *(*inflate_memcpy)(void *, const void *, size)){	stream->error = NO_ERROR;	stream->memcpy = inflate_memcpy;	stream->decoded = 0;	stream->data = data;	stream->bit = 0;	/* The first bit of the stream is the lsb of the				 * first byte */	/* really sorry about all this initialization, think of a better way,	 * let me know and it will get cleaned up */	stream->codes.bits = 8;	stream->codes.num_symbols = 19;	stream->codes.lengths = stream->code_lengths;	stream->codes.symbols = stream->code_symbols;	stream->codes.count = stream->code_count;	stream->codes.first = stream->code_first;	stream->codes.pos = stream->code_pos;	stream->lengths.bits = 16;	stream->lengths.num_symbols = 288;	stream->lengths.lengths = stream->length_lengths;	stream->lengths.symbols = stream->length_symbols;	stream->lengths.count = stream->length_count;	stream->lengths.first = stream->length_first;	stream->lengths.pos = stream->length_pos;	stream->distance.bits = 16;	stream->distance.num_symbols = 32;	stream->distance.lengths = stream->distance_lengths;	stream->distance.symbols = stream->distance_symbols;	stream->distance.count = stream->distance_count;	stream->distance.first = stream->distance_first;	stream->distance.pos = stream->distance_pos;}/* pull 'bits' bits out of the stream. The last bit pulled it returned as the * msb. (section 3.1.1) */inline unsigned long pull_bits(struct bitstream *stream,			       const unsigned int bits){	unsigned long ret;	int i;	ret = 0;	for (i = 0; i < bits; i++) {		ret += ((*(stream->data) >> stream->bit) & 1) << i;		/* if, before incrementing, we are on bit 7,		 * go to the lsb of the next byte */		if (stream->bit++ == 7) {			stream->bit = 0;			stream->data++;		}	}	return ret;}inline int pull_bit(struct bitstream *stream){	int ret = ((*(stream->data) >> stream->bit) & 1);	if (stream->bit++ == 7) {		stream->bit = 0;		stream->data++;	}	return ret;}/* discard bits up to the next whole byte */static void discard_bits(struct bitstream *stream){	if (stream->bit != 0) {		stream->bit = 0;		stream->data++;	}}/* No decompression, the data is all literals (section 3.2.4) */static void decompress_none(struct bitstream *stream, unsigned char *dest){	unsigned int length;	discard_bits(stream);	length = *(stream->data++);	length += *(stream->data++) << 8;	pull_bits(stream, 16);	/* throw away the inverse of the size */	stream->decoded += length;	stream->memcpy(dest, stream->data, length);	stream->data += length;}/* Read in a symbol from the stream (section 3.2.2) */static int read_symbol(struct bitstream *stream, struct huffman_set *set){	int bits = 0;	int code = 0;	while (!(set->count[bits] && code < set->first[bits] +					     set->count[bits])) {		code = (code << 1) + pull_bit(stream);		if (++bits > set->bits) {			/* error decoding (corrupted data?) */			stream->error = CODE_NOT_FOUND;			return -1;		}	}	return set->symbols[set->pos[bits] + code - set->first[bits]];}/* decompress a stream of data encoded with the passed length and distance * huffman codes */static void decompress_huffman(struct bitstream *stream, unsigned char *dest){	struct huffman_set *lengths = &(stream->lengths);	struct huffman_set *distance = &(stream->distance);	int symbol, length, dist, i;	do {		if ((symbol = read_symbol(stream, lengths)) < 0) return;		if (symbol < 256) {			*(dest++) = symbol; /* symbol is a literal */			stream->decoded++;		} else if (symbol > 256) {			/* Determine the length of the repitition			 * (section 3.2.5) */			if (symbol < 265) length = symbol - 254;			else if (symbol == 285) length = 258;			else {				length = pull_bits(stream, (symbol - 261) >> 2);				length += (4 << ((symbol - 261) >> 2)) + 3;				length += ((symbol - 1) % 4) <<					  ((symbol - 261) >> 2);			}			/* Determine how far back to go */			if ((symbol = read_symbol(stream, distance)) < 0)				return;			if (symbol < 4) dist = symbol + 1;			else {				dist = pull_bits(stream, (symbol - 2) >> 1);				dist += (2 << ((symbol - 2) >> 1)) + 1;				dist += (symbol % 2) << ((symbol - 2) >> 1);			}			stream->decoded += length;			for (i = 0; i < length; i++) {				*dest = dest[-dist];				dest++;			}		}	} while (symbol != 256); /* 256 is the end of the data block */}/* Fill the lookup tables (section 3.2.2) */static void fill_code_tables(struct huffman_set *set){	int code = 0, i, length;	/* fill in the first code of each bit length, and the pos pointer */	set->pos[0] = 0;	for (i = 1; i < set->bits; i++) {		code = (code + set->count[i - 1]) << 1;		set->first[i] = code;		set->pos[i] = set->pos[i - 1] + set->count[i - 1];	}	/* Fill in the table of symbols in order of their huffman code */	for (i = 0; i < set->num_symbols; i++) {		if ((length = set->lengths[i]))			set->symbols[set->pos[length]++] = i;	}	/* reset the pos pointer */	for (i = 1; i < set->bits; i++) set->pos[i] -= set->count[i];}static void init_code_tables(struct huffman_set *set){	cramfs_memset(set->lengths, 0, set->num_symbols);	cramfs_memset(set->count, 0, set->bits);	cramfs_memset(set->first, 0, set->bits);}/* read in the huffman codes for dynamic decoding (section 3.2.7) */static void decompress_dynamic(struct bitstream *stream, unsigned char *dest){	/* I tried my best to minimize the memory footprint here, while still	 * keeping up performance. I really dislike the _lengths[] tables, but	 * I see no way of eliminating them without a sizable performance	 * impact. The first struct table keeps track of stats on each bit	 * length. The _length table keeps a record of the bit length of each	 * symbol. The _symbols table is for looking up symbols by the huffman	 * code (the pos element points to the first place in the symbol table	 * where that bit length occurs). I also hate the initization of these	 * structs, if someone knows how to compact these, lemme know. */	struct huffman_set *codes = &(stream->codes);	struct huffman_set *lengths = &(stream->lengths);	struct huffman_set *distance = &(stream->distance);	int hlit = pull_bits(stream, 5) + 257;	int hdist = pull_bits(stream, 5) + 1;	int hclen = pull_bits(stream, 4) + 4;	int length, curr_code, symbol, i, last_code;	last_code = 0;	init_code_tables(codes);	init_code_tables(lengths);	init_code_tables(distance);	/* fill in the count of each bit length' as well as the lengths	 * table */	for (i = 0; i < hclen; i++) {		length = pull_bits(stream, 3);		codes->lengths[huffman_order[i]] = length;		if (length) codes->count[length]++;	}	fill_code_tables(codes);	/* Do the same for the length codes, being carefull of wrap through	 * to the distance table */	curr_code = 0;	while (curr_code < hlit) {		if ((symbol = read_symbol(stream, codes)) < 0) return;		if (symbol == 0) {			curr_code++;			last_code = 0;		} else if (symbol < 16) { /* Literal length */			lengths->lengths[curr_code] =  last_code = symbol;			lengths->count[symbol]++;			curr_code++;		} else if (symbol == 16) { /* repeat the last symbol 3 - 6					    * times */			length = 3 + pull_bits(stream, 2);			for (;length; length--, curr_code++)				if (curr_code < hlit) {					lengths->lengths[curr_code] =						last_code;					lengths->count[last_code]++;				} else { /* wrap to the distance table */					distance->lengths[curr_code - hlit] =						last_code;					distance->count[last_code]++;				}		} else if (symbol == 17) { /* repeat a bit length 0 */			curr_code += 3 + pull_bits(stream, 3);			last_code = 0;		} else { /* same, but more times */			curr_code += 11 + pull_bits(stream, 7);			last_code = 0;		}	}	fill_code_tables(lengths);	/* Fill the distance table, don't need to worry about wrapthrough	 * here */	curr_code -= hlit;	while (curr_code < hdist) {		if ((symbol = read_symbol(stream, codes)) < 0) return;		if (symbol == 0) {			curr_code++;			last_code = 0;		} else if (symbol < 16) {			distance->lengths[curr_code] = last_code = symbol;			distance->count[symbol]++;			curr_code++;		} else if (symbol == 16) {			length = 3 + pull_bits(stream, 2);			for (;length; length--, curr_code++) {				distance->lengths[curr_code] =					last_code;				distance->count[last_code]++;			}		} else if (symbol == 17) {			curr_code += 3 + pull_bits(stream, 3);			last_code = 0;		} else {			curr_code += 11 + pull_bits(stream, 7);			last_code = 0;		}	}	fill_code_tables(distance);	decompress_huffman(stream, dest);}/* fill in the length and distance huffman codes for fixed encoding * (section 3.2.6) */static void decompress_fixed(struct bitstream *stream, unsigned char *dest){	/* let gcc fill in the initial values */	struct huffman_set *lengths = &(stream->lengths);	struct huffman_set *distance = &(stream->distance);	cramfs_memset(lengths->count, 0, 16);	cramfs_memset(lengths->first, 0, 16);	cramfs_memset(lengths->lengths, 8, 144);	cramfs_memset(lengths->lengths + 144, 9, 112);	cramfs_memset(lengths->lengths + 256, 7, 24);	cramfs_memset(lengths->lengths + 280, 8, 8);	lengths->count[7] = 24;	lengths->count[8] = 152;	lengths->count[9] = 112;	cramfs_memset(distance->count, 0, 16);	cramfs_memset(distance->first, 0, 16);	cramfs_memset(distance->lengths, 5, 32);	distance->count[5] = 32;	fill_code_tables(lengths);	fill_code_tables(distance);	decompress_huffman(stream, dest);}/* returns the number of bytes decoded, < 0 if there was an error. Note that * this function assumes that the block starts on a byte boundry * (non-compliant, but I don't see where this would happen). section 3.2.3 */long decompress_block(unsigned char *dest, unsigned char *source,		      void *(*inflate_memcpy)(void *, const void *, size)){	int bfinal, btype;	struct bitstream stream;	init_stream(&stream, source, inflate_memcpy);	do {		bfinal = pull_bit(&stream);		btype = pull_bits(&stream, 2);		if (btype == NO_COMP) decompress_none(&stream, dest + stream.decoded);		else if (btype == DYNAMIC_COMP)			decompress_dynamic(&stream, dest + stream.decoded);		else if (btype == FIXED_COMP) decompress_fixed(&stream, dest + stream.decoded);		else stream.error = COMP_UNKNOWN;	} while (!bfinal && !stream.error);#if 0	putstr("decompress_block start\r\n");	putLabeledWord("stream.error = ",stream.error);	putLabeledWord("stream.decoded = ",stream.decoded);	putLabeledWord("dest = ",dest);	putstr("decompress_block end\r\n");#endif	return stream.error ? -stream.error : stream.decoded;}#endif /* CFG_CMD_JFFS2 */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久婷婷一区二区三区| 亚洲综合精品自拍| 国产老妇另类xxxxx| 国产欧美日本一区视频| 99精品久久99久久久久| 日本成人超碰在线观看| 国产精品第13页| 国产精品不卡一区| 欧美日韩高清一区二区| 成人高清免费观看| 免费一区二区视频| 亚洲综合色噜噜狠狠| 亚洲国产岛国毛片在线| 日韩一区二区在线观看视频播放| 国v精品久久久网| 国产原创一区二区三区| 麻豆成人久久精品二区三区红| 亚洲一区在线观看免费| 国产精品久久精品日日| 国产亚洲福利社区一区| 日韩欧美视频在线| 欧美一区二区网站| 欧美三区免费完整视频在线观看| 国产成人免费视| 在线观看欧美精品| 成人毛片老司机大片| 成人夜色视频网站在线观看| 国产精品夜夜爽| 国产精品一级黄| 国产91丝袜在线播放0| 成人午夜电影网站| 97久久精品人人做人人爽50路| 成人av网址在线| 在线观看不卡一区| 91精品国产91热久久久做人人 | 亚洲高清不卡在线观看| 亚洲成av人片一区二区梦乃| 亚洲国产日日夜夜| 日韩av成人高清| 国产一区二区美女诱惑| 91最新地址在线播放| 欧美日本不卡视频| 久久久久久久久久美女| 亚洲亚洲精品在线观看| 久久99热狠狠色一区二区| 99综合影院在线| 欧美一区二区三区思思人| 国产精品你懂的在线欣赏| 婷婷久久综合九色国产成人| 成人午夜在线播放| 日韩视频免费观看高清在线视频| 中文字幕综合网| 精品午夜一区二区三区在线观看| av电影在线观看完整版一区二区| 2欧美一区二区三区在线观看视频| 亚洲少妇最新在线视频| 精久久久久久久久久久| 欧美日韩亚洲综合在线| 亚洲人成伊人成综合网小说| 国产乱码精品一区二区三区忘忧草| 欧美无乱码久久久免费午夜一区| 国产精品嫩草久久久久| 狂野欧美性猛交blacked| 欧美精品视频www在线观看| 亚洲色图在线视频| www.av精品| 亚洲区小说区图片区qvod| 99天天综合性| 亚洲精品欧美激情| 欧美日韩精品免费| 日本欧美肥老太交大片| 日韩一区二区在线观看| 精品一区二区三区久久久| 精品粉嫩超白一线天av| 久久99这里只有精品| 国产欧美视频一区二区| 9l国产精品久久久久麻豆| 亚洲午夜电影在线观看| 制服丝袜在线91| 国内精品久久久久影院薰衣草| 久久精品视频一区二区三区| 成人久久视频在线观看| 亚洲国产欧美在线| 久久综合九色综合欧美就去吻| 成人app在线| 亚洲国产精品欧美一二99| 精品国产91久久久久久久妲己| 国产麻豆午夜三级精品| 亚洲人被黑人高潮完整版| 91精品国产免费久久综合| 床上的激情91.| 午夜不卡在线视频| 国产精品久久久久久久久晋中| 欧美日韩免费电影| 国产成人aaa| 国产精品夜夜爽| 日韩av中文字幕一区二区三区 | 精品毛片乱码1区2区3区| 99精品视频一区二区| 国产乱人伦偷精品视频免下载| 亚洲男帅同性gay1069| 精品对白一区国产伦| 日韩欧美国产不卡| 91精品国产综合久久精品| 91视频免费播放| 99re成人在线| 成人sese在线| 色综合视频在线观看| 成人av资源在线观看| 不卡的看片网站| 91电影在线观看| 日本高清不卡在线观看| 欧洲视频一区二区| 欧美日韩国产综合一区二区三区| 91精彩视频在线观看| 91色九色蝌蚪| 欧美三区在线观看| 日韩免费视频一区| 国产视频亚洲色图| 亚洲人成网站影音先锋播放| 一二三区精品福利视频| 丝袜a∨在线一区二区三区不卡| 香蕉成人伊视频在线观看| 美女在线视频一区| 粉嫩绯色av一区二区在线观看| 从欧美一区二区三区| 欧美va亚洲va香蕉在线| 国产精品网站在线观看| 亚洲自拍偷拍网站| 国产资源在线一区| 欧美日韩在线播| 国产欧美精品国产国产专区| 亚洲免费观看视频| 激情久久五月天| 欧美日韩视频在线一区二区| 久久久精品日韩欧美| 亚洲成年人影院| 色综合一区二区| 国产精品成人一区二区艾草 | 欧美丝袜丝交足nylons| 精品日韩在线一区| 亚洲第一久久影院| 成人av在线播放网站| 久久久久久日产精品| 免费成人在线观看| 欧美精品一卡二卡| 午夜久久久影院| 精品视频在线看| 婷婷久久综合九色国产成人| 欧美在线观看一二区| 中文字幕中文乱码欧美一区二区| 麻豆精品在线播放| 精品区一区二区| 国产一区二区h| 国产午夜一区二区三区| 国产精品伊人色| 国产欧美在线观看一区| 国产麻豆日韩欧美久久| 国产精品久久久久久久久动漫 | 国产精品主播直播| 中文字幕av一区二区三区高 | 奇米精品一区二区三区在线观看一| 欧美日韩激情在线| 麻豆一区二区三区| 国产精品理论在线观看| 日本高清不卡一区| 免费一级片91| 欧美激情资源网| 在线观看免费成人| 美国三级日本三级久久99| 精品国产91久久久久久久妲己| 国产成人激情av| 免费成人小视频| 椎名由奈av一区二区三区| 欧美精品视频www在线观看 | 美女一区二区三区| 亚洲一区在线视频| 久久久精品影视| 欧美一级生活片| 色又黄又爽网站www久久| 久久国产尿小便嘘嘘尿| 亚洲福利视频一区二区| 久久久久久久久伊人| 日韩美女一区二区三区| 色婷婷亚洲精品| 91老师国产黑色丝袜在线| 美女视频黄a大片欧美| 亚洲一区二区三区四区的| 亚洲丝袜美腿综合| 国产精品国产三级国产普通话蜜臀| 日韩精品一区二区三区在线观看| 成人黄色777网| jlzzjlzz欧美大全| 91猫先生在线| 在线看国产日韩| 在线观看国产精品网站| 欧美日韩激情一区二区| 欧美午夜电影一区| 欧美美女直播网站| 欧美成人激情免费网|