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

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

?? lz.c

?? tinyos2.0版本驅動
?? C
?? 第 1 頁 / 共 2 頁
字號:
/************************************************************************** Name:        lz.c* Author:      Marcus Geelnard* Description: LZ77 coder/decoder implementation.* Reentrant:   Yes** The LZ77 compression scheme is a substitutional compression scheme* proposed by Abraham Lempel and Jakob Ziv in 1977. It is very simple in* its design, and uses no fancy bit level compression.** This is my first attempt at an implementation of a LZ77 code/decoder.** The principle of the LZ77 compression algorithm is to store repeated* occurrences of strings as references to previous occurrences of the same* string. The point is that the reference consumes less space than the* string itself, provided that the string is long enough (in this* implementation, the string has to be at least 4 bytes long, since the* minimum coded reference is 3 bytes long). Also note that the term* "string" refers to any kind of byte sequence (it does not have to be* an ASCII string, for instance).** The coder uses a brute force approach to finding string matches in the* history buffer (or "sliding window", if you wish), which is very, very* slow. I recon the complexity is somewhere between O(n^2) and O(n^3),* depending on the input data.** There is also a faster implementation that uses a large working buffer* in which a "jump table" is stored, which is used to quickly find* possible string matches (see the source code for LZ_CompressFast() for* more information). The faster method is an order of magnitude faster,* but still quite slow compared to other compression methods.** The upside is that decompression is very fast, and the compression ratio* is often very good.** The reference to a string is coded as a (length,offset) pair, where the* length indicates the length of the string, and the offset gives the* offset from the current data position. To distinguish between string* references and literal strings (uncompressed bytes), a string reference* is preceded by a marker byte, which is chosen as the least common byte* symbol in the input data stream (this marker byte is stored in the* output stream as the first byte).** Occurrences of the marker byte in the stream are encoded as the marker* byte followed by a zero byte, which means that occurrences of the marker* byte have to be coded with two bytes.** The lengths and offsets are coded in a variable length fashion, allowing* values of any magnitude (up to 4294967295 in this implementation).** With this compression scheme, the worst case compression result is* (257/256)*insize + 1.**-------------------------------------------------------------------------* Copyright (c) 2003-2006 Marcus Geelnard** This software is provided 'as-is', without any express or implied* warranty. In no event will the authors be held liable for any damages* arising from the use of this software.** Permission is granted to anyone to use this software for any purpose,* including commercial applications, and to alter it and redistribute it* freely, subject to the following restrictions:** 1. The origin of this software must not be misrepresented; you must not*    claim that you wrote the original software. If you use this software*    in a product, an acknowledgment in the product documentation would*    be appreciated but is not required.** 2. Altered source versions must be plainly marked as such, and must not*    be misrepresented as being the original software.** 3. This notice may not be removed or altered from any source*    distribution.** Marcus Geelnard* marcus.geelnard at home.se*************************************************************************//************************************************************************** Constants used for LZ77 coding*************************************************************************//* Maximum offset (can be any size < 2^31). Lower values give faster   compression, while higher values gives better compression. The default   value of 100000 is quite high. Experiment to see what works best for   you. */#define LZ_MAX_OFFSET 100000/**************************************************************************                           INTERNAL FUNCTIONS                           **************************************************************************//************************************************************************** _LZ_StringCompare() - Return maximum length string match.*************************************************************************/static uint32_t _LZ_StringCompare( unsigned char * str1,  unsigned char * str2, uint32_t minlen, uint32_t maxlen ){    uint32_t len;    for( len = minlen; (len < maxlen) && (str1[len] == str2[len]); ++ len );    return len;}/************************************************************************** _LZ_WriteVarSize() - Write uint32_teger with variable number of* bytes depending on value.*************************************************************************/static int _LZ_WriteVarSize( uint32_t x, unsigned char * buf ){    uint32_t y;    int num_bytes, i, b;    /* Determine number of bytes needed to store the number x */    y = x >> 3;    for( num_bytes = 5; num_bytes >= 2; -- num_bytes )    {        if( y & 0xfe000000 ) break;        y <<= 7;    }    /* Write all bytes, seven bits in each, with 8:th bit set for all */    /* but the last byte. */    for( i = num_bytes-1; i >= 0; -- i )    {        b = (x >> (i*7)) & 0x0000007f;        if( i > 0 )        {            b |= 0x00000080;        }        *buf ++ = (unsigned char) b;    }    /* Return number of bytes written */    return num_bytes;}/************************************************************************** _LZ_ReadVarSize() - Read uint32_teger with variable number of* bytes depending on value.*************************************************************************/static int _LZ_ReadVarSize( uint32_t * x, unsigned char * buf ){    uint32_t y, b, num_bytes;    /* Read complete value (stop when byte contains zero in 8:th bit) */    y = 0;    num_bytes = 0;    do    {        b = (uint32_t) (*buf ++);        y = (y << 7) | (b & 0x0000007f);        ++ num_bytes;    }    while( b & 0x00000080 );    /* Store value in x */    *x = y;    /* Return number of bytes read */    return num_bytes;}/**************************************************************************                            PUBLIC FUNCTIONS                            **************************************************************************//************************************************************************** LZ_Compress() - Compress a block of data using an LZ77 coder.*  in     - Input (uncompressed) buffer.*  out    - Output (compressed) buffer. This buffer must be 0.4% larger*           than the input buffer, plus one byte.*  insize - Number of input bytes.* The function returns the size of the compressed data.*************************************************************************/int LZ_Compress( unsigned char *in, unsigned char *out,    uint32_t insize ){    unsigned char marker, symbol;    uint32_t  inpos, outpos, bytesleft, i;    uint32_t  maxoffset, offset, bestoffset;    uint32_t  maxlength, length, bestlength;    uint32_t  histogram[ 256 ];    unsigned char *ptr1, *ptr2;    /* Do we have anything to compress? */    if( insize < 1 )    {        return 0;    }    /* Create histogram */    for( i = 0; i < 256; ++ i )    {        histogram[ i ] = 0;    }    for( i = 0; i < insize; ++ i )    {        ++ histogram[ in[ i ] ];    }    /* Find the least common byte, and use it as the marker symbol */    marker = 0;    for( i = 1; i < 256; ++ i )    {        if( histogram[ i ] < histogram[ marker ] )        {            marker = i;        }    }    /* Remember the marker symbol for the decoder */    out[ 0 ] = marker;    /* Start of compression */    inpos = 0;    outpos = 1;    /* Main compression loop */    bytesleft = insize;    do    {        /* Determine most distant position */        if( inpos > LZ_MAX_OFFSET ) {          maxoffset = LZ_MAX_OFFSET;        }        else {        maxoffset = inpos;        }        /* Get pointer to current position */        ptr1 = &in[ inpos ];        /* Search history window for maximum length string match */        bestlength = 3;        bestoffset = 0;        for( offset = 3; offset <= maxoffset; ++ offset )        {            /* Get pointer to candidate string */            ptr2 = &ptr1[ -(int)offset ];            /* Quickly determine if this is a candidate (for speed) */            if( (ptr1[ 0 ] == ptr2[ 0 ]) &&                (ptr1[ bestlength ] == ptr2[ bestlength ]) )            {                /* Determine maximum length for this offset */                maxlength = (bytesleft < offset ? bytesleft : offset);                /* Count maximum length match at this offset */                length = _LZ_StringCompare( ptr1, ptr2, 0, maxlength );                /* Better match than any previous match? */                if( length > bestlength )                {                    bestlength = length;                    bestoffset = offset;                }            }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品视频一二三区| 972aa.com艺术欧美| 欧美一区二区性放荡片| 午夜影院在线观看欧美| 欧美伊人久久久久久午夜久久久久| 国产精品丝袜91| 99久久国产免费看| 亚洲精选视频在线| 在线观看亚洲一区| 性做久久久久久免费观看| 欧美精选一区二区| 久久精品国产精品青草| 久久久精品2019中文字幕之3| 高清在线不卡av| 亚洲欧洲日产国码二区| 91麻豆国产精品久久| 一区二区三区不卡视频在线观看| 欧美日本一区二区| 美国一区二区三区在线播放| 久久精品日产第一区二区三区高清版| 成人美女在线观看| 一区二区在线电影| 在线播放日韩导航| 韩国精品主播一区二区在线观看| 国产精品国产三级国产a| 欧美视频中文字幕| 精品一区二区三区免费毛片爱| 久久精品免视看| 色婷婷综合久久久中文一区二区| 日本不卡不码高清免费观看| 欧美国产1区2区| 欧美三级在线看| 国产精品亚洲第一| 亚洲国产一区二区三区青草影视| 精品国产乱码久久| 91碰在线视频| 狠狠色综合播放一区二区| 中文字幕在线观看不卡视频| 日韩一二在线观看| 99精品视频在线观看| 亚洲午夜久久久久久久久电影网| 2023国产精品视频| 91极品视觉盛宴| 国产另类ts人妖一区二区| 亚洲日本va在线观看| 久久综合九色综合97婷婷| 色婷婷av一区二区三区软件| 国产麻豆91精品| 天天影视涩香欲综合网| 国产精品污www在线观看| 在线成人av网站| 一本一道久久a久久精品| 国产一区二区精品久久| 日韩黄色免费网站| 一区二区三区欧美激情| 国产日韩欧美亚洲| 日韩一区二区高清| 欧美视频中文一区二区三区在线观看| 国产超碰在线一区| 麻豆高清免费国产一区| 亚洲一区二区三区在线看| 中文字幕亚洲精品在线观看| 精品久久久久久久久久久院品网| 欧美日韩国产精选| 91小宝寻花一区二区三区| 国产精品自在欧美一区| 久久精品国产999大香线蕉| 亚洲国产精品一区二区尤物区| 亚洲同性gay激情无套| 国产欧美精品一区二区色综合 | 一区二区三区欧美| 久久天堂av综合合色蜜桃网| 欧美一区二区在线视频| 欧美影院一区二区| 91福利视频网站| 色妹子一区二区| 色综合色狠狠天天综合色| av网站免费线看精品| 国产精品一品二品| 国产精品1区二区.| 国产毛片一区二区| 韩国三级中文字幕hd久久精品| 久久超碰97中文字幕| 久久99在线观看| 国产一区二区三区在线看麻豆| 精品一区二区三区久久久| 久久精品久久99精品久久| 免费成人性网站| 久久国产精品99精品国产| 国产中文字幕精品| 国产白丝精品91爽爽久久| 国产精品自拍在线| 成人免费av资源| 91久久国产综合久久| 欧美日本在线视频| 日韩欧美在线123| 2023国产精品视频| 国产精品狼人久久影院观看方式| 亚洲色图欧美偷拍| 亚洲在线视频网站| 强制捆绑调教一区二区| 国产一区二区成人久久免费影院| 粉嫩在线一区二区三区视频| 日本高清不卡aⅴ免费网站| 欧美三级电影网站| 欧美一区二区大片| 久久久蜜桃精品| 亚洲欧美日韩国产综合| 亚洲国产cao| 国产呦萝稀缺另类资源| 国产成人福利片| 色哟哟一区二区在线观看| 9191精品国产综合久久久久久| 26uuu久久天堂性欧美| 国产精品乱码妇女bbbb| 亚洲国产日韩在线一区模特| 久久国产人妖系列| 99re这里只有精品6| 欧美美女bb生活片| 久久久久久**毛片大全| 亚洲在线视频一区| 国产一区二区精品久久99| 色综合久久天天综合网| 日韩一区和二区| 中文字幕亚洲成人| 久久国产人妖系列| 日本久久一区二区| 久久亚洲私人国产精品va媚药| 一卡二卡欧美日韩| 狠狠v欧美v日韩v亚洲ⅴ| 色婷婷av久久久久久久| 精品国产在天天线2019| 亚洲蜜臀av乱码久久精品| 另类小说欧美激情| 色成年激情久久综合| 久久嫩草精品久久久久| 亚洲在线视频免费观看| 国产激情视频一区二区在线观看 | 一本色道**综合亚洲精品蜜桃冫| 日韩欧美一二区| 亚洲黄网站在线观看| 国产激情一区二区三区| 欧美一区二区视频观看视频| 亚洲男人的天堂一区二区| 韩国一区二区视频| 欧美无砖专区一中文字| 国产日韩欧美精品综合| 热久久久久久久| 欧美在线你懂得| ㊣最新国产の精品bt伙计久久| 国产一区福利在线| 777亚洲妇女| 亚洲最新视频在线观看| 成人免费毛片片v| 2024国产精品| 精品一区二区国语对白| 欧美日本一区二区| 亚洲一区二区三区国产| 色综合久久天天综合网| 国产精品国产三级国产aⅴ无密码| 国产精品456露脸| 久久久影视传媒| 久久99精品久久久久久国产越南| 欧美日韩1区2区| 午夜影院久久久| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 国产精品美女www爽爽爽| 国产精品乡下勾搭老头1| 精品国产一区二区国模嫣然| 精品一区二区久久| 欧美www视频| 国内不卡的二区三区中文字幕 | 91麻豆国产福利在线观看| 国产精品视频观看| 成人性生交大片免费看在线播放| 中文字幕欧美日韩一区| 成人午夜精品在线| 国产欧美综合在线| 懂色中文一区二区在线播放| 国产精品欧美综合在线| 成人a免费在线看| 亚洲欧美国产毛片在线| 色综合久久久久综合| 亚洲影院理伦片| 正在播放一区二区| 久久国产精品一区二区| 久久久美女毛片| 成人18精品视频| 亚洲自拍偷拍麻豆| 日韩亚洲欧美在线观看| 国产精品一区二区三区99| 国产精品美女www爽爽爽| 一本大道久久a久久综合婷婷| 亚洲成av人片一区二区三区| 日韩欧美国产麻豆| 国产黄色精品视频| 亚洲精品网站在线观看| 欧美精品色一区二区三区| 黄页视频在线91| 亚洲欧美二区三区|