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

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

?? zip.cpp

?? zip解壓源碼.
?? CPP
?? 第 1 頁 / 共 4 頁
字號:
    while (heap_len < 2) 
	{int i = heap[++heap_len] = (max_code < 2 ? ++max_code : 0);
        desc->dyn_tree[i].Freq = 1;
        depth[i] = 0;
        opt_len--; 
		if (desc->static_tree) static_len -= desc->static_tree[i].Len;
        /* i is 0 or 1 so it does not have extra bits */
    }
    desc->max_code = max_code;

    /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
     * establish sub-heaps of increasing lengths:
     */
    for (n = heap_len/2; n >= 1; n--) pqdownheap( zipdate,desc->dyn_tree, n);

    /* Construct the Huffman tree by repeatedly combining the least two
     * frequent nodes.
     */
    do {
        pqremove(desc->dyn_tree, n);   /* n = node of least frequency */
        m = heap[SMALLEST];  /* m = node of next least frequency */

        heap[--heap_max] = n; /* keep the nodes sorted by frequency */
        heap[--heap_max] = m;

        /* Create a new node father of n and m */
        desc->dyn_tree[node].Freq = desc->dyn_tree[n].Freq + desc->dyn_tree[m].Freq;
        depth[node] = (uch) (MAX(depth[n], depth[m]) + 1);
        desc->dyn_tree[n].Dad = desc->dyn_tree[m].Dad = (ush)node;
#ifdef DUMP_BL_TREE
        if (desc->dyn_tree == bl_tree) {
            fprintf(stderr,"\nnode %d(%d), sons %d(%d) %d(%d)",
                    node, desc->dyn_tree[node].Freq, n, desc->dyn_tree[n].Freq, m, desc->dyn_tree[m].Freq);
        }
#endif
        /* and insert the new node in the heap */
        heap[SMALLEST] = node++;
        pqdownheap( zipdate,desc->dyn_tree, SMALLEST);

    } while (heap_len >= 2);

    heap[--heap_max] = heap[SMALLEST];

    /* At this point, the fields freq and dad are set. We can now
     * generate the bit lengths.
     */
    gen_bitlen( zipdate,(tree_desc *)desc);

    /* The field len is now set, we can generate the bit codes */
    gen_codes( zipdate,(ct_data *)desc->dyn_tree, max_code);
}

/* ===========================================================================
 * Scan a literal or distance tree to determine the frequencies of the codes
 * in the bit length tree. Updates opt_len to take into account the repeat
 * counts. (The contribution of the bit length codes will be added later
 * during the construction of bl_tree.)
 */
void scan_tree(ZipDate* zipdate,ct_data *tree, /* the tree to be scanned */
					int			max_code)       /* and its largest code of non zero frequency */
{
    int n;                     /* iterates over all tree elements */
    int prevlen = -1;          /* last emitted length */
    int curlen;                /* length of current code */
    int nextlen = tree[0].Len; /* length of next code */
    int count = 0;             /* repeat count of the current code */
    int max_count = 7;         /* max repeat count */
    int min_count = 4;         /* min repeat count */

    if (nextlen == 0) max_count = 138, min_count = 3;
    tree[max_code+1].Len = (ush)0xffff; /* guard */

    for (n = 0; n <= max_code; n++) {
        curlen = nextlen; nextlen = tree[n+1].Len;
        if (++count < max_count && curlen == nextlen) {
            continue;
        } else if (count < min_count) {
            bl_tree[curlen].Freq += count;
        } else if (curlen != 0) {
            if (curlen != prevlen) bl_tree[curlen].Freq++;
            bl_tree[REP_3_6].Freq++;
        } else if (count <= 10) {
            bl_tree[REPZ_3_10].Freq++;
        } else {
            bl_tree[REPZ_11_138].Freq++;
        }
        count = 0; prevlen = curlen;
        if (nextlen == 0) {
            max_count = 138, min_count = 3;
        } else if (curlen == nextlen) {
            max_count = 6, min_count = 3;
        } else {
            max_count = 7, min_count = 4;
        }
    }
}

/* ===========================================================================
 * Send a literal or distance tree in compressed form, using the codes in
 * bl_tree.
 */
void send_tree (ZipDate* zipdate,ct_data *tree, /* the tree to be scanned */
						int max_code)       /* and its largest code of non zero frequency */
{
    int n;                     /* iterates over all tree elements */
    int prevlen = -1;          /* last emitted length */
    int curlen;                /* length of current code */
    int nextlen = tree[0].Len; /* length of next code */
    int count = 0;             /* repeat count of the current code */
    int max_count = 7;         /* max repeat count */
    int min_count = 4;         /* min repeat count */

    /* tree[max_code+1].Len = -1; */  /* guard already set */
    if (nextlen == 0) max_count = 138, min_count = 3;

    for (n = 0; n <= max_code; n++) {
        curlen = nextlen; nextlen = tree[n+1].Len;
        if (++count < max_count && curlen == nextlen) {
            continue;
        } else if (count < min_count) {
            do { send_code(curlen, bl_tree); } while (--count != 0);

        } else if (curlen != 0) {
            if (curlen != prevlen) {
                send_code(curlen, bl_tree); count--;
            }
            send_code(REP_3_6, bl_tree); send_bits( zipdate,count-3, 2);

        } else if (count <= 10) {
            send_code(REPZ_3_10, bl_tree); send_bits( zipdate,count-3, 3);

        } else {
            send_code(REPZ_11_138, bl_tree); send_bits( zipdate,count-11, 7);
        }
        count = 0; prevlen = curlen;
        if (nextlen == 0) {
            max_count = 138, min_count = 3;
        } else if (curlen == nextlen) {
            max_count = 6, min_count = 3;
        } else {
            max_count = 7, min_count = 4;
        }
    }
}

/* ===========================================================================
 * Construct the Huffman tree for the bit lengths and return the index in
 * bl_order of the last bit length code to send.
 */
int build_bl_tree(ZipDate* zipdate)
{
    int max_blindex;  /* index of last bit length code of non zero freq */

    /* Determine the bit length frequencies for literal and distance trees */
    scan_tree( zipdate,(ct_data *)dyn_ltree, l_desc.max_code);
    scan_tree( zipdate,(ct_data *)dyn_dtree, d_desc.max_code);

    /* Build the bit length tree: */
    build_tree( zipdate,(tree_desc *)(&bl_desc));
    for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {
        if (bl_tree[bl_order[max_blindex]].Len != 0) break;
    }
    /* Update opt_len to include the bit length tree and counts */
    opt_len += 3*(max_blindex+1) + 5+5+4;
    Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld", opt_len, static_len));

    return max_blindex;
}

/* ===========================================================================
 * Send the header for a block using dynamic Huffman trees: the counts, the
 * lengths of the bit length codes, the literal tree and the distance tree.
 * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
 */
void send_all_trees(ZipDate* zipdate,int lcodes, int dcodes, int blcodes)
    /* number of codes for each tree */
{
    int rank;                    /* index in bl_order */

    Tracev((stderr, "\nbl counts: "));
    send_bits( zipdate,lcodes-257, 5); /* not +255 as stated in appnote.txt */
    send_bits( zipdate,dcodes-1,   5);
    send_bits( zipdate,blcodes-4,  4); /* not -3 as stated in appnote.txt */
    for (rank = 0; rank < blcodes; rank++) {
        Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
        send_bits( zipdate,bl_tree[bl_order[rank]].Len, 3);
    }

    send_tree( zipdate,(ct_data *)dyn_ltree, lcodes-1); /* send the literal tree */

    send_tree( zipdate,(ct_data *)dyn_dtree, dcodes-1); /* send the distance tree */
}

/* ===========================================================================
 * Determine the best encoding for the current block: dynamic trees, static
 * trees or store, and output the encoded block to the zip file. This function
 * returns the total compressed length for the file so far.
 */
ulg flush_block(ZipDate* zipdate,char *	buf,        /* input block, or NULL if too old */
				ulg		stored_len,   /* length of input block */
				int		eof)          /* true if this is the last block for a file */
{
    ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */
    int max_blindex;  /* index of last bit length code of non zero freq */

    flag_buf[last_flags] = flags; /* Save the flags for the last 8 items */

    if (file_type == (ush)UNKNOWN) set_file_type( zipdate);

    /* Construct the literal and distance trees */
    build_tree( zipdate,(tree_desc *)(&l_desc));
    build_tree( zipdate,(tree_desc *)(&d_desc));

    max_blindex = build_bl_tree( zipdate);

    opt_lenb = (opt_len+3+7)>>3;
    static_lenb = (static_len+3+7)>>3;
    input_len += stored_len; /* for debugging only */

    if (static_lenb <= opt_lenb) opt_lenb = static_lenb;


    if (stored_len+4 <= opt_lenb && buf != (char*)0) 
	{	send_bits( zipdate,(STORED_BLOCK<<1)+eof, 3);  /* send block type */
		compressed_len = (compressed_len + 3 + 7) & ~7L;
		compressed_len += (stored_len + 4) << 3;
		copy_block( zipdate,buf, (unsigned)stored_len, 1); /* with header */
    } else if (static_lenb == opt_lenb) 
	{	send_bits( zipdate,(STATIC_TREES<<1)+eof, 3);
		compress_block( zipdate,(ct_data *)static_ltree, (ct_data near *)static_dtree);
		compressed_len += 3 + static_len;
    } else 
	{	send_bits( zipdate,(DYN_TREES<<1)+eof, 3);
		send_all_trees( zipdate,l_desc.max_code+1, d_desc.max_code+1, max_blindex+1);
		compress_block( zipdate,(ct_data *)dyn_ltree, (ct_data near *)dyn_dtree);
		compressed_len += 3 + opt_len;
    }
    
	init_block( zipdate);

    if (eof) {
        bi_windup( zipdate);
        compressed_len += 7;  /* align on byte boundary */
    }
    return compressed_len >> 3;
}

/* ===========================================================================
 * Save the match info and tally the frequency counts. Return true if
 * the current block must be flushed.
 */
int ct_tally (ZipDate* zipdate,int dist,  /* distance of matched string */
			 int lc)    /* match length-MIN_MATCH or unmatched char (if dist==0) */
{
    l_buf[last_lit++] = (uch)lc;
    if (dist == 0) {
        /* lc is the unmatched char */
        dyn_ltree[lc].Freq++;
    } else {
        /* Here, lc is the match length - MIN_MATCH */
        dist--;             /* dist = match distance - 1 */

        dyn_ltree[length_code[lc]+LITERALS+1].Freq++;
        dyn_dtree[d_code(dist)].Freq++;

        d_buf[last_dist++] = (ush)dist;
        flags |= flag_bit;
    }
    flag_bit <<= 1;

    /* Output the flags if they fill a byte: */
    if ((last_lit & 7) == 0) {
        flag_buf[last_flags++] = flags;
        flags = 0, flag_bit = 1;
    }
    /* Try to guess if it is profitable to stop the current block here */
    if (level > 2 && (last_lit & 0xfff) == 0) 
	{   /* Compute an upper bound for the compressed length */
        ulg out_length = (ulg)last_lit*8L;
        ulg in_length = (ulg)strstart-block_start;
        int dcode;
        for (dcode = 0; dcode < D_CODES; dcode++) {
            out_length += (ulg)dyn_dtree[dcode].Freq*(5L+extra_dbits[dcode]);
        }
        out_length >>= 3;
        Trace((stderr,"\nlast_lit %u, last_dist %u, in %ld, out ~%ld(%ld%%) ",
               last_lit, last_dist, in_length, out_length,
               100L - out_length*100L/in_length));
        if (last_dist < last_lit/2 && out_length < in_length/2) return 1;
    }
    return (last_lit == LIT_BUFSIZE-1 || last_dist == DIST_BUFSIZE);
    /* We avoid equality with LIT_BUFSIZE because of wraparound at 64K
     * on 16 bit machines and because stored blocks are restricted to
     * 64K-1 bytes.
     */
}

/* ===========================================================================
 * Send the block data compressed using the given Huffman trees
 */
void compress_block(ZipDate* zipdate,	ct_data *ltree, /* literal tree */
							ct_data *dtree) /* distance tree */
{
    unsigned dist;      /* distance of matched string */
    int lc;             /* match length or unmatched char (if dist == 0) */
    unsigned lx = 0;    /* running index in l_buf */
    unsigned dx = 0;    /* running index in d_buf */
    unsigned fx = 0;    /* running index in flag_buf */
    uch flag = 0;       /* current flags */
    unsigned code;      /* the code to send */
    int extra;          /* number of extra bits to send */

    if (last_lit != 0) do {
        if ((lx & 7) == 0) flag = flag_buf[fx++];
        lc = l_buf[lx++];
        if ((flag & 1) == 0) {
            send_code(lc, ltree); /* send a literal byte */
            Tracecv(isgraph(lc), (stderr," '%c' ", lc));
        } else {
            /* Here, lc is the match length - MIN_MATCH */
            code = length_code[lc];
            send_code(code+LITERALS+1, ltree); /* send the length code */
            extra = extra_lbits[code];
            if (extra != 0) {
                lc -= base_length[code];
                send_bits( zipdate,lc, extra);        /* send the extra length bits */
            }
            dist = d_buf[dx++];
            /* Here, dist is the match distance - 1 */
            code = d_code(dist);

            send_code(code, dtree);       /* send the distance code */
            extra = extra_dbits[code];
            if (extra != 0) {
                dist -= base_dist[code];
                send_bits( zipdate,dist, extra);   /* send the extra distance bits */
            }
        } /* literal or match pair ? */
        flag >>= 1;
    } while (lx < last_lit);

    send_code(END_BLOCK, ltree);
	lx=lx;
}

//====================================================
void set_file_type(ZipDate* zipdate)
{
    int n = 0;
    unsigned ascii_freq = 0;
    unsigned bin_freq = 0;

    while (n < 7)        bin_freq += dyn_ltree[n++].Freq;
    while (n < 128)    ascii_freq += dyn_ltree[n++].Freq;
    while (n < LITERALS) bin_freq += dyn_ltree[n++].Freq;
    
	file_type = bin_freq > (ascii_freq >> 2) ? BINARY : ASCII;
}

//===============================================

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲黄色片在线观看| 日本二三区不卡| 免费高清视频精品| 亚洲一卡二卡三卡四卡五卡| 亚洲人成7777| 一区二区三区日韩精品视频| 亚洲精品ww久久久久久p站| 亚洲色图欧美激情| 夜夜夜精品看看| 亚洲国产裸拍裸体视频在线观看乱了| 亚洲国产一区视频| 日韩二区三区四区| 蜜芽一区二区三区| 久久99精品国产.久久久久久 | 91视频在线观看免费| fc2成人免费人成在线观看播放| 99这里都是精品| 色先锋资源久久综合| 欧美视频精品在线观看| 91精品国产麻豆国产自产在线 | 国产欧美日韩不卡免费| 国产精品久久久久久久久久久免费看 | 一本色道综合亚洲| 欧美日本免费一区二区三区| 91精品国产品国语在线不卡| 久久亚洲精华国产精华液 | 亚洲人精品午夜| 亚瑟在线精品视频| 国产一区二区电影| jizz一区二区| 欧美精品第一页| 久久精品亚洲精品国产欧美kt∨| 中文字幕日本乱码精品影院| 亚洲一卡二卡三卡四卡无卡久久| 日韩成人免费在线| 丁香亚洲综合激情啪啪综合| 欧美性做爰猛烈叫床潮| 久久综合色8888| 亚洲精品视频观看| 理论片日本一区| 91美女视频网站| 日韩无一区二区| 亚洲欧美日韩一区二区 | 欧美性一区二区| 欧美xxxx在线观看| 一区二区视频免费在线观看| 免费av成人在线| 日本韩国欧美三级| 精品国产乱码久久久久久1区2区 | 日韩经典中文字幕一区| 国产成人精品免费视频网站| 欧美日韩一级二级三级| 欧美激情一二三区| 日韩精彩视频在线观看| 国产精品一区不卡| 欧美麻豆精品久久久久久| 国产精品毛片a∨一区二区三区| 午夜精品爽啪视频| 成人免费视频caoporn| 欧美一区二区三区电影| 亚洲欧洲99久久| 精品一区二区日韩| 在线亚洲人成电影网站色www| 亚洲精品一线二线三线无人区| 一区二区三区在线免费视频| 国产·精品毛片| 337p亚洲精品色噜噜| 亚洲美女淫视频| 国产69精品一区二区亚洲孕妇| 欧美浪妇xxxx高跟鞋交| 亚洲色图在线播放| 成人性生交大片免费看在线播放| 91精品国产综合久久精品图片| 亚洲乱码国产乱码精品精98午夜 | 九色综合国产一区二区三区| 欧美三级资源在线| 国产精品国产三级国产有无不卡| 国产综合色在线视频区| 在线电影一区二区三区| 亚洲综合清纯丝袜自拍| 色综合久久综合中文综合网| 国产女同性恋一区二区| 国产真实乱子伦精品视频| 日韩午夜av一区| 热久久国产精品| 欧美裸体bbwbbwbbw| 一区二区成人在线观看| 91丨九色丨蝌蚪富婆spa| 国产精品乱码久久久久久| 国产一区高清在线| 欧美精品一区二区三区久久久 | 一本色道久久综合亚洲91 | 久久99日本精品| 日韩一区二区在线播放| 亚洲一区二区三区四区五区黄 | 国产精品视频九色porn| 国产福利一区二区三区| 久久精品亚洲乱码伦伦中文| 国产精品一区二区在线播放| 久久婷婷成人综合色| 美美哒免费高清在线观看视频一区二区| 欧美日韩激情一区| 天天综合日日夜夜精品| 欧美一区二区三区日韩视频| 肉丝袜脚交视频一区二区| 欧美久久免费观看| 琪琪久久久久日韩精品| 777a∨成人精品桃花网| 日韩av中文字幕一区二区三区| 欧美电影在线免费观看| 免费在线观看视频一区| 欧美大片国产精品| 国产一区二区在线看| 2023国产精品| 不卡的av电影| 一区二区三区不卡在线观看| 欧美中文一区二区三区| 水野朝阳av一区二区三区| 欧美一区在线视频| 国产在线精品一区二区三区不卡| 国产目拍亚洲精品99久久精品| 成人黄色小视频| 亚洲人成伊人成综合网小说| 欧美日韩一本到| 久久精品久久99精品久久| 久久精品欧美日韩| 91免费视频网址| 日日摸夜夜添夜夜添亚洲女人| 精品国产91乱码一区二区三区| 成人黄页在线观看| 亚洲一级电影视频| 欧美成va人片在线观看| 不卡一区中文字幕| 天堂va蜜桃一区二区三区| 精品日韩av一区二区| 国产91在线看| 亚洲伊人色欲综合网| 欧美白人最猛性xxxxx69交| 成人性生交大片| 亚洲国产精品麻豆| 久久久久久97三级| 一本色道久久加勒比精品 | 91网站视频在线观看| 天天综合色天天综合色h| 国产午夜精品美女毛片视频| 在线免费观看成人短视频| 精品一区二区三区久久| 一区二区三区精品在线观看| 精品奇米国产一区二区三区| 成人动漫视频在线| 日韩精品高清不卡| ㊣最新国产の精品bt伙计久久| 欧美高清hd18日本| 丁香六月久久综合狠狠色| 亚洲电影激情视频网站| 久久精品一区二区三区av| 欧美午夜精品免费| 成人一区二区三区视频在线观看| 亚洲成人免费观看| 中文字幕乱码一区二区免费| 欧美久久久久中文字幕| 99精品视频在线观看免费| 久久国产综合精品| 亚洲电影第三页| 中文字幕制服丝袜一区二区三区| 欧美一区二区三区成人| 欧美主播一区二区三区| 成人综合婷婷国产精品久久蜜臀| 日韩综合一区二区| 樱桃视频在线观看一区| 久久久久九九视频| 日韩女优毛片在线| 欧美性猛片aaaaaaa做受| 成人一级片网址| 激情五月激情综合网| 日韩精品乱码av一区二区| 伊人婷婷欧美激情| 国产精品美女久久久久久2018| 精品国产3级a| 欧美一区在线视频| 欧美日本高清视频在线观看| 色视频一区二区| 99久久精品国产麻豆演员表| 激情五月婷婷综合网| 强制捆绑调教一区二区| 无码av免费一区二区三区试看| 亚洲日本一区二区| 国产精品久久久久久久久果冻传媒| 久久久久国产成人精品亚洲午夜| 欧美一区二区成人6969| 欧美日韩一区二区三区视频| 91视频观看免费| 97aⅴ精品视频一二三区| 成人网男人的天堂| 国产99久久久国产精品潘金网站| 国内精品伊人久久久久av一坑| 久久国产欧美日韩精品| 麻豆精品久久精品色综合| 秋霞电影一区二区| 蜜臀av亚洲一区中文字幕|