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

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

?? deflate.c

?? mp3 source code decoder & encoder
?? C
?? 第 1 頁 / 共 3 頁
字號:

    zmemcpy(strm->next_out, strm->state->pending_out, len);
    strm->next_out  += len;
    strm->state->pending_out  += len;
    strm->total_out += len;
    strm->avail_out  -= len;
    strm->state->pending -= len;
    if (strm->state->pending == 0) {
        strm->state->pending_out = strm->state->pending_buf;
    }
}

/* ========================================================================= */
int deflate (strm, flush)
    z_streamp strm;
    int flush;
{
    int old_flush; /* value of flush param for previous deflate call */
    deflate_state *s;

    if (strm == Z_NULL || strm->state == Z_NULL ||
	flush > Z_FINISH || flush < 0) {
        return Z_STREAM_ERROR;
    }
    s = strm->state;

    if (strm->next_out == Z_NULL ||
        (strm->next_in == Z_NULL && strm->avail_in != 0) ||
	(s->status == FINISH_STATE && flush != Z_FINISH)) {
        ERR_RETURN(strm, Z_STREAM_ERROR);
    }
    if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR);

    s->strm = strm; /* just in case */
    old_flush = s->last_flush;
    s->last_flush = flush;

    /* Write the zlib header */
    if (s->status == INIT_STATE) {

        uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8;
        uInt level_flags = (s->level-1) >> 1;

        if (level_flags > 3) level_flags = 3;
        header |= (level_flags << 6);
	if (s->strstart != 0) header |= PRESET_DICT;
        header += 31 - (header % 31);

        s->status = BUSY_STATE;
        putShortMSB(s, header);

	/* Save the adler32 of the preset dictionary: */
	if (s->strstart != 0) {
	    putShortMSB(s, (uInt)(strm->adler >> 16));
	    putShortMSB(s, (uInt)(strm->adler & 0xffff));
	}
	strm->adler = 1L;
    }

    /* Flush as much pending output as possible */
    if (s->pending != 0) {
        flush_pending(strm);
        if (strm->avail_out == 0) {
	    /* Since avail_out is 0, deflate will be called again with
	     * more output space, but possibly with both pending and
	     * avail_in equal to zero. There won't be anything to do,
	     * but this is not an error situation so make sure we
	     * return OK instead of BUF_ERROR at next call of deflate:
             */
	    s->last_flush = -1;
	    return Z_OK;
	}

    /* Make sure there is something to do and avoid duplicate consecutive
     * flushes. For repeated and useless calls with Z_FINISH, we keep
     * returning Z_STREAM_END instead of Z_BUFF_ERROR.
     */
    } else if (strm->avail_in == 0 && flush <= old_flush &&
	       flush != Z_FINISH) {
        ERR_RETURN(strm, Z_BUF_ERROR);
    }

    /* User must not provide more input after the first FINISH: */
    if (s->status == FINISH_STATE && strm->avail_in != 0) {
        ERR_RETURN(strm, Z_BUF_ERROR);
    }

    /* Start a new block or continue the current one.
     */
    if (strm->avail_in != 0 || s->lookahead != 0 ||
        (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {
        block_state bstate;

	bstate = (*(configuration_table[s->level].func))(s, flush);

        if (bstate == finish_started || bstate == finish_done) {
            s->status = FINISH_STATE;
        }
        if (bstate == need_more || bstate == finish_started) {
	    if (strm->avail_out == 0) {
	        s->last_flush = -1; /* avoid BUF_ERROR next call, see above */
	    }
	    return Z_OK;
	    /* If flush != Z_NO_FLUSH && avail_out == 0, the next call
	     * of deflate should use the same flush parameter to make sure
	     * that the flush is complete. So we don't have to output an
	     * empty block here, this will be done at next call. This also
	     * ensures that for a very small output buffer, we emit at most
	     * one empty block.
	     */
	}
        if (bstate == block_done) {
            if (flush == Z_PARTIAL_FLUSH) {
                _tr_align(s);
            } else { /* FULL_FLUSH or SYNC_FLUSH */
                _tr_stored_block(s, (char*)0, 0L, 0);
                /* For a full flush, this empty block will be recognized
                 * as a special marker by inflate_sync().
                 */
                if (flush == Z_FULL_FLUSH) {
                    CLEAR_HASH(s);             /* forget history */
                }
            }
            flush_pending(strm);
	    if (strm->avail_out == 0) {
	      s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */
	      return Z_OK;
	    }
        }
    }
    Assert(strm->avail_out > 0, "bug2");

    if (flush != Z_FINISH) return Z_OK;
    if (s->noheader) return Z_STREAM_END;

    /* Write the zlib trailer (adler32) */
    putShortMSB(s, (uInt)(strm->adler >> 16));
    putShortMSB(s, (uInt)(strm->adler & 0xffff));
    flush_pending(strm);
    /* If avail_out is zero, the application will call deflate again
     * to flush the rest.
     */
    s->noheader = -1; /* write the trailer only once! */
    return s->pending != 0 ? Z_OK : Z_STREAM_END;
}

/* ========================================================================= */
int deflateEnd (strm)
    z_streamp strm;
{
    int status;

    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;

    /* Deallocate in reverse order of allocations: */
    TRY_FREE(strm, strm->state->pending_buf);
    TRY_FREE(strm, strm->state->head);
    TRY_FREE(strm, strm->state->prev);
    TRY_FREE(strm, strm->state->window);

    status = strm->state->status;
    ZFREE(strm, strm->state);
    strm->state = Z_NULL;

    return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK;
}

/* ========================================================================= */
int deflateCopy (z_streamp dest, z_streamp source)
{
    if (source == Z_NULL || dest == Z_NULL || source->state == Z_NULL) {
        return Z_STREAM_ERROR;
    }
    *dest = *source;
    return Z_STREAM_ERROR; /* to be implemented */
#if 0
    dest->state = (struct internal_state FAR *)
        (*dest->zalloc)(1, sizeof(deflate_state));
    if (dest->state == Z_NULL) return Z_MEM_ERROR;

    *(dest->state) = *(source->state);
    return Z_OK;
#endif
}

/* ===========================================================================
 * Read a new buffer from the current input stream, update the adler32
 * and total number of bytes read.  All deflate() input goes through
 * this function so some applications may wish to modify it to avoid
 * allocating a large strm->next_in buffer and copying from it.
 * (See also flush_pending()).
 */
local int read_buf(z_streamp strm, charf *buf, unsigned size)
{
    unsigned len = strm->avail_in;

    if (len > size) len = size;
    if (len == 0) return 0;

    strm->avail_in  -= len;

    if (!strm->state->noheader) {
        strm->adler = adler32(strm->adler, strm->next_in, len);
    }
    zmemcpy(buf, strm->next_in, len);
    strm->next_in  += len;
    strm->total_in += len;

    return (int)len;
}

/* ===========================================================================
 * Initialize the "longest match" routines for a new zlib stream
 */
local void lm_init (s)
    deflate_state *s;
{
    s->window_size = (ulg)2L*s->w_size;

    CLEAR_HASH(s);

    /* Set the default configuration parameters:
     */
    s->max_lazy_match   = configuration_table[s->level].max_lazy;
    s->good_match       = configuration_table[s->level].good_length;
    s->nice_match       = configuration_table[s->level].nice_length;
    s->max_chain_length = configuration_table[s->level].max_chain;

    s->strstart = 0;
    s->block_start = 0L;
    s->lookahead = 0;
    s->match_length = s->prev_length = MIN_MATCH-1;
    s->match_available = 0;
    s->ins_h = 0;
#ifdef ASMV
    match_init(); /* initialize the asm code */
#endif
}

/* ===========================================================================
 * Set match_start to the longest match starting at the given string and
 * return its length. Matches shorter or equal to prev_length are discarded,
 * in which case the result is equal to prev_length and match_start is
 * garbage.
 * IN assertions: cur_match is the head of the hash chain for the current
 *   string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
 * OUT assertion: the match length is not greater than s->lookahead.
 */
#ifndef ASMV
/* For 80x86 and 680x0, an optimized version will be provided in match.asm or
 * match.S. The code will be functionally equivalent.
 */
local uInt longest_match(deflate_state *s, IPos cur_match)
/* cur_match      current match */
{
    unsigned chain_length = s->max_chain_length;/* max hash chain length */
    register Bytef *scan = s->window + s->strstart; /* current string */
    register Bytef *match;                       /* matched string */
    register int len;                           /* length of current match */
    int best_len = s->prev_length;              /* best match length so far */
    int nice_match = s->nice_match;             /* stop if match long enough */
    IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
        s->strstart - (IPos)MAX_DIST(s) : NIL;
    /* Stop when cur_match becomes <= limit. To simplify the code,
     * we prevent matches with the string of window index 0.
     */
    Posf *prev = s->prev;
    uInt wmask = s->w_mask;

#ifdef UNALIGNED_OK
    /* Compare two bytes at a time. Note: this is not always beneficial.
     * Try with and without -DUNALIGNED_OK to check.
     */
    register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
    register ush scan_start = *(ushf*)scan;
    register ush scan_end   = *(ushf*)(scan+best_len-1);
#else
    register Bytef *strend = s->window + s->strstart + MAX_MATCH;
    register Byte scan_end1  = scan[best_len-1];
    register Byte scan_end   = scan[best_len];
#endif

    /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
     * It is easy to get rid of this optimization if necessary.
     */
    Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");

    /* Do not waste too much time if we already have a good match: */
    if (s->prev_length >= s->good_match) {
        chain_length >>= 2;
    }
    /* Do not look for matches beyond the end of the input. This is necessary
     * to make deflate deterministic.
     */
    if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;

    Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");

    do {
        Assert(cur_match < s->strstart, "no future");
        match = s->window + cur_match;

        /* Skip to next match if the match length cannot increase
         * or if the match length is less than 2:
         */
#if (defined(UNALIGNED_OK) && MAX_MATCH == 258)
        /* This code assumes sizeof(unsigned short) == 2. Do not use
         * UNALIGNED_OK if your compiler uses a different size.
         */
        if (*(ushf*)(match+best_len-1) != scan_end ||
            *(ushf*)match != scan_start) continue;

        /* It is not necessary to compare scan[2] and match[2] since they are
         * always equal when the other bytes match, given that the hash keys
         * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at
         * strstart+3, +5, ... up to strstart+257. We check for insufficient
         * lookahead only every 4th comparison; the 128th check will be made
         * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is
         * necessary to put more guard bytes at the end of the window, or
         * to check more often for insufficient lookahead.
         */
        Assert(scan[2] == match[2], "scan[2]?");
        scan++, match++;
        do {
        } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
                 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
                 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
                 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
                 scan < strend);
        /* The funny "do {}" generates better code on most compilers */

        /* Here, scan <= window+strstart+257 */
        Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
        if (*scan == *match) scan++;

        len = (MAX_MATCH - 1) - (int)(strend-scan);
        scan = strend - (MAX_MATCH-1);

#else /* UNALIGNED_OK */

        if (match[best_len]   != scan_end  ||
            match[best_len-1] != scan_end1 ||
            *match            != *scan     ||
            *++match          != scan[1])      continue;

        /* The check at best_len-1 can be removed because it will be made
         * again later. (This heuristic is not always a win.)
         * It is not necessary to compare scan[2] and match[2] since they
         * are always equal when the other bytes match, given that
         * the hash keys are equal and that HASH_BITS >= 8.
         */
        scan += 2, match++;
        Assert(*scan == *match, "match[2]?");

        /* We check for insufficient lookahead only every 8th comparison;
         * the 256th check will be made at strstart+258.
         */
        do {
        } while (*++scan == *++match && *++scan == *++match &&
                 *++scan == *++match && *++scan == *++match &&
                 *++scan == *++match && *++scan == *++match &&
                 *++scan == *++match && *++scan == *++match &&
                 scan < strend);

        Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");

        len = MAX_MATCH - (int)(strend - scan);
        scan = strend - MAX_MATCH;

#endif /* UNALIGNED_OK */

        if (len > best_len) {
            s->match_start = cur_match;
            best_len = len;
            if (len >= nice_match) break;
#ifdef UNALIGNED_OK
            scan_end = *(ushf*)(scan+best_len-1);
#else
            scan_end1  = scan[best_len-1];
            scan_end   = scan[best_len];
#endif
        }
    } while ((cur_match = prev[cur_match & wmask]) > limit
             && --chain_length != 0);

    if ((uInt)best_len <= s->lookahead) return best_len;
    return s->lookahead;
}
#endif /* ASMV */

#ifdef DEBUG
/* ===========================================================================
 * Check that the match at match_start is indeed a match.
 */
local void check_match(s, start, match, length)
    deflate_state *s;
    IPos start, match;
    int length;
{
    /* check that the match is indeed a match */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产大陆a不卡| 午夜久久电影网| 风间由美中文字幕在线看视频国产欧美| 91麻豆精品国产| 日韩黄色小视频| 欧美成人免费网站| 国产一区二区成人久久免费影院| 26uuuu精品一区二区| 国产酒店精品激情| 国产精品视频一二三| 91老师国产黑色丝袜在线| 夜夜亚洲天天久久| 欧美理论片在线| 蓝色福利精品导航| 国产精品毛片高清在线完整版| 成人的网站免费观看| 亚洲午夜久久久久久久久电影网| 欧美一区二区三区四区视频| 国产在线视频一区二区三区| 国产精品国产馆在线真实露脸| 92精品国产成人观看免费| 亚洲va韩国va欧美va| 久久亚洲免费视频| 91麻豆免费观看| 日韩高清一区二区| 亚洲国产成人午夜在线一区| 欧美在线播放高清精品| 青草av.久久免费一区| 久久久www成人免费毛片麻豆| 91久久免费观看| 蜜桃一区二区三区四区| 国产精品视频免费| 欧美肥妇bbw| 99久久精品99国产精品| 久久精品国产**网站演员| 亚洲欧洲成人自拍| 欧美一级精品大片| 91福利在线观看| 国产原创一区二区| 亚洲福利视频导航| 中文字幕成人av| 日韩亚洲电影在线| 日本久久一区二区三区| 国产成人免费av在线| 香蕉加勒比综合久久| 国产精品美女视频| 欧美大片顶级少妇| 欧美日韩免费电影| 成人福利视频在线| 国产一区二区三区在线看麻豆| 亚洲高清免费在线| 亚洲视频一区二区在线| 久久久噜噜噜久噜久久综合| 欧美日韩性生活| 日本黄色一区二区| 99re这里只有精品6| 福利视频网站一区二区三区| 激情都市一区二区| 日韩av中文在线观看| 亚洲一区二区三区视频在线| 中文字幕一区三区| 国产欧美一区二区三区鸳鸯浴 | 精品一区二区国语对白| 亚洲图片自拍偷拍| 国产精品福利av| 中文字幕欧美日韩一区| 久久综合五月天婷婷伊人| 欧美另类变人与禽xxxxx| 一本久久a久久免费精品不卡| 成人理论电影网| 国产成人av电影| 国产在线一区二区| 极品销魂美女一区二区三区| 免费观看在线色综合| 全国精品久久少妇| 麻豆国产欧美日韩综合精品二区 | 91欧美一区二区| voyeur盗摄精品| 大白屁股一区二区视频| 高清国产一区二区| 成人av网址在线| 成人精品一区二区三区四区| 成人av在线电影| 成人亚洲一区二区一| 不卡的电影网站| caoporn国产精品| 91丨porny丨国产| 99久久综合99久久综合网站| 91色九色蝌蚪| 91成人免费在线视频| 欧美精品九九99久久| 日韩欧美一二三区| 国产午夜亚洲精品理论片色戒| 国产精品嫩草99a| 国产精品国产馆在线真实露脸| 亚洲欧美色一区| 天天综合天天综合色| 狠狠色丁香久久婷婷综合丁香| 国产成人av一区二区三区在线观看| 东方欧美亚洲色图在线| av在线一区二区| 91视频国产观看| 欧美优质美女网站| 日韩一区二区三区视频在线观看| 久久综合国产精品| 国产精品情趣视频| 亚洲自拍与偷拍| 裸体歌舞表演一区二区| 成人午夜免费视频| 在线观看亚洲a| 日韩欧美亚洲国产精品字幕久久久| 久久久久久久久久久久久夜| 亚洲色欲色欲www在线观看| 婷婷综合久久一区二区三区| 国产一区二区三区日韩| 91国产丝袜在线播放| 欧美成人r级一区二区三区| 国产精品久久久久一区二区三区共 | 亚洲男同1069视频| 麻豆91精品91久久久的内涵| 99久久久精品| 日韩三级av在线播放| ...中文天堂在线一区| 日韩精品欧美成人高清一区二区| 国产成人免费视频网站| 欧美日韩国产高清一区二区三区 | 色婷婷精品久久二区二区蜜臀av| 91精品国产综合久久福利软件| 日本一区二区成人| 日韩**一区毛片| 91麻豆免费视频| 久久综合色之久久综合| 亚洲老妇xxxxxx| 国产自产v一区二区三区c| 欧美日韩小视频| 亚洲欧洲另类国产综合| 精品无码三级在线观看视频| 欧美在线观看你懂的| 国产精品高潮久久久久无| 蜜桃视频在线一区| 91国偷自产一区二区开放时间 | 欧美男男青年gay1069videost| 久久久久久免费网| 图片区日韩欧美亚洲| 在线免费观看日本欧美| 国产精品污污网站在线观看| 久久99精品国产.久久久久久| 欧美日韩在线播放一区| 国产精品久久精品日日| 国产福利精品导航| 久久婷婷久久一区二区三区| 老司机精品视频在线| 91麻豆精品国产91久久久资源速度| 亚洲精品成人天堂一二三| 成人av免费在线观看| 国产欧美一区二区精品仙草咪| 毛片不卡一区二区| 在线成人免费观看| 亚洲一区二区成人在线观看| 91免费在线看| 亚洲视频电影在线| 99久久精品情趣| 亚洲人快播电影网| 99久久精品国产一区二区三区 | 国产精品主播直播| 精品久久久久久久久久久久包黑料| 亚洲成人动漫精品| 欧美日韩一区二区三区在线看| 一区二区三区在线观看视频| 一本大道久久精品懂色aⅴ| 国产精品久久久久久久久免费相片| 国产成人综合亚洲91猫咪| 国产亚洲精品精华液| av一区二区三区四区| 亚洲欧美视频一区| 91国偷自产一区二区使用方法| 亚洲综合另类小说| 欧美日韩电影一区| 视频一区视频二区中文字幕| 欧美一区二区三区精品| 日本欧美韩国一区三区| 日韩欧美一区中文| 久久爱www久久做| 久久免费的精品国产v∧| 福利一区在线观看| 亚洲精品你懂的| 欧美久久久久免费| 精品一区二区免费看| 国产精品视频观看| 欧美视频在线一区二区三区| 麻豆精品在线视频| 国产亚洲欧美激情| 一本色道综合亚洲| 日本va欧美va欧美va精品| 久久九九国产精品| 99久久久无码国产精品| 视频一区二区三区在线| 亚洲精品一区二区三区99| 成人免费观看男女羞羞视频| 亚洲黄色av一区|