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

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

?? trees.c

?? SDL文件。SDL_ERROwenjian.....
?? C
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
/* ===========================================================================
 * Initialize a new block.
 */
local void init_block(s)
    deflate_state *s;
{
    int n; /* iterates over tree elements */

    /* Initialize the trees. */
    for (n = 0; n < L_CODES;  n++) s->dyn_ltree[n].Freq = 0;
    for (n = 0; n < D_CODES;  n++) s->dyn_dtree[n].Freq = 0;
    for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;

    s->dyn_ltree[END_BLOCK].Freq = 1;
    s->opt_len = s->static_len = 0L;
    s->last_lit = s->matches = 0;
}

#define SMALLEST 1
/* Index within the heap array of least frequent node in the Huffman tree */


/* ===========================================================================
 * Remove the smallest element from the heap and recreate the heap with
 * one less element. Updates heap and heap_len.
 */
#define pqremove(s, tree, top) \
{\
    top = s->heap[SMALLEST]; \
    s->heap[SMALLEST] = s->heap[s->heap_len--]; \
    pqdownheap(s, tree, SMALLEST); \
}

/* ===========================================================================
 * Compares to subtrees, using the tree depth as tie breaker when
 * the subtrees have equal frequency. This minimizes the worst case length.
 */
#define smaller(tree, n, m, depth) \
   (tree[n].Freq < tree[m].Freq || \
   (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))

/* ===========================================================================
 * Restore the heap property by moving down the tree starting at node k,
 * exchanging a node with the smallest of its two sons if necessary, stopping
 * when the heap property is re-established (each father smaller than its
 * two sons).
 */
local void pqdownheap(s, tree, k)
    deflate_state *s;
    ct_data *tree;  /* the tree to restore */
    int k;               /* node to move down */
{
    int v = s->heap[k];
    int j = k << 1;  /* left son of k */
    while (j <= s->heap_len) {
        /* Set j to the smallest of the two sons: */
        if (j < s->heap_len &&
            smaller(tree, s->heap[j+1], s->heap[j], s->depth)) {
            j++;
        }
        /* Exit if v is smaller than both sons */
        if (smaller(tree, v, s->heap[j], s->depth)) break;

        /* Exchange v with the smallest son */
        s->heap[k] = s->heap[j];  k = j;

        /* And continue down the tree, setting j to the left son of k */
        j <<= 1;
    }
    s->heap[k] = v;
}

/* ===========================================================================
 * Compute the optimal bit lengths for a tree and update the total bit length
 * for the current block.
 * IN assertion: the fields freq and dad are set, heap[heap_max] and
 *    above are the tree nodes sorted by increasing frequency.
 * OUT assertions: the field len is set to the optimal bit length, the
 *     array bl_count contains the frequencies for each bit length.
 *     The length opt_len is updated; static_len is also updated if stree is
 *     not null.
 */
local void gen_bitlen(s, desc)
    deflate_state *s;
    tree_desc *desc;    /* the tree descriptor */
{
    ct_data *tree        = desc->dyn_tree;
    int max_code         = desc->max_code;
    const ct_data *stree = desc->stat_desc->static_tree;
    const intf *extra    = desc->stat_desc->extra_bits;
    int base             = desc->stat_desc->extra_base;
    int max_length       = desc->stat_desc->max_length;
    int h;              /* heap index */
    int n, m;           /* iterate over the tree elements */
    int bits;           /* bit length */
    int xbits;          /* extra bits */
    ush f;              /* frequency */
    int overflow = 0;   /* number of elements with bit length too large */

    for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0;

    /* In a first pass, compute the optimal bit lengths (which may
     * overflow in the case of the bit length tree).
     */
    tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */

    for (h = s->heap_max+1; h < HEAP_SIZE; h++) {
        n = s->heap[h];
        bits = tree[tree[n].Dad].Len + 1;
        if (bits > max_length) bits = max_length, overflow++;
        tree[n].Len = (ush)bits;
        /* We overwrite tree[n].Dad which is no longer needed */

        if (n > max_code) continue; /* not a leaf node */

        s->bl_count[bits]++;
        xbits = 0;
        if (n >= base) xbits = extra[n-base];
        f = tree[n].Freq;
        s->opt_len += (ulg)f * (bits + xbits);
        if (stree) s->static_len += (ulg)f * (stree[n].Len + xbits);
    }
    if (overflow == 0) return;

    Trace((stderr,"\nbit length overflow\n"));
    /* This happens for example on obj2 and pic of the Calgary corpus */

    /* Find the first bit length which could increase: */
    do {
        bits = max_length-1;
        while (s->bl_count[bits] == 0) bits--;
        s->bl_count[bits]--;      /* move one leaf down the tree */
        s->bl_count[bits+1] += 2; /* move one overflow item as its brother */
        s->bl_count[max_length]--;
        /* The brother of the overflow item also moves one step up,
         * but this does not affect bl_count[max_length]
         */
        overflow -= 2;
    } while (overflow > 0);

    /* Now recompute all bit lengths, scanning in increasing frequency.
     * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
     * lengths instead of fixing only the wrong ones. This idea is taken
     * from 'ar' written by Haruhiko Okumura.)
     */
    for (bits = max_length; bits != 0; bits--) {
        n = s->bl_count[bits];
        while (n != 0) {
            m = s->heap[--h];
            if (m > max_code) continue;
            if ((unsigned) tree[m].Len != (unsigned) bits) {
                Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
                s->opt_len += ((long)bits - (long)tree[m].Len)
                              *(long)tree[m].Freq;
                tree[m].Len = (ush)bits;
            }
            n--;
        }
    }
}

/* ===========================================================================
 * Generate the codes for a given tree and bit counts (which need not be
 * optimal).
 * IN assertion: the array bl_count contains the bit length statistics for
 * the given tree and the field len is set for all tree elements.
 * OUT assertion: the field code is set for all tree elements of non
 *     zero code length.
 */
local void gen_codes (tree, max_code, bl_count)
    ct_data *tree;             /* the tree to decorate */
    int max_code;              /* largest code with non zero frequency */
    ushf *bl_count;            /* number of codes at each bit length */
{
    ush next_code[MAX_BITS+1]; /* next code value for each bit length */
    ush code = 0;              /* running code value */
    int bits;                  /* bit index */
    int n;                     /* code index */

    /* The distribution counts are first used to generate the code values
     * without bit reversal.
     */
    for (bits = 1; bits <= MAX_BITS; bits++) {
        next_code[bits] = code = (code + bl_count[bits-1]) << 1;
    }
    /* Check that the bit counts in bl_count are consistent. The last code
     * must be all ones.
     */
    Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,
            "inconsistent bit counts");
    Tracev((stderr,"\ngen_codes: max_code %d ", max_code));

    for (n = 0;  n <= max_code; n++) {
        int len = tree[n].Len;
        if (len == 0) continue;
        /* Now reverse the bits */
        tree[n].Code = bi_reverse(next_code[len]++, len);

        Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
             n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));
    }
}

/* ===========================================================================
 * Construct one Huffman tree and assigns the code bit strings and lengths.
 * Update the total bit length for the current block.
 * IN assertion: the field freq is set for all tree elements.
 * OUT assertions: the fields len and code are set to the optimal bit length
 *     and corresponding code. The length opt_len is updated; static_len is
 *     also updated if stree is not null. The field max_code is set.
 */
local void build_tree(s, desc)
    deflate_state *s;
    tree_desc *desc; /* the tree descriptor */
{
    ct_data *tree         = desc->dyn_tree;
    const ct_data *stree  = desc->stat_desc->static_tree;
    int elems             = desc->stat_desc->elems;
    int n, m;          /* iterate over heap elements */
    int max_code = -1; /* largest code with non zero frequency */
    int node;          /* new node being created */

    /* Construct the initial heap, with least frequent element in
     * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
     * heap[0] is not used.
     */
    s->heap_len = 0, s->heap_max = HEAP_SIZE;

    for (n = 0; n < elems; n++) {
        if (tree[n].Freq != 0) {
            s->heap[++(s->heap_len)] = max_code = n;
            s->depth[n] = 0;
        } else {
            tree[n].Len = 0;
        }
    }

    /* The pkzip format requires that at least one distance code exists,
     * and that at least one bit should be sent even if there is only one
     * possible code. So to avoid special checks later on we force at least
     * two codes of non zero frequency.
     */
    while (s->heap_len < 2) {
        node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0);
        tree[node].Freq = 1;
        s->depth[node] = 0;
        s->opt_len--; if (stree) s->static_len -= stree[node].Len;
        /* node 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 = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n);

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

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

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

    } while (s->heap_len >= 2);

    s->heap[--(s->heap_max)] = s->heap[SMALLEST];

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

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

/* ===========================================================================
 * Scan a literal or distance tree to determine the frequencies of the codes
 * in the bit length tree.
 */
local void scan_tree (s, tree, max_code)
    deflate_state *s;
    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) {
            s->bl_tree[curlen].Freq += count;
        } else if (curlen != 0) {
            if (curlen != prevlen) s->bl_tree[curlen].Freq++;
            s->bl_tree[REP_3_6].Freq++;
        } else if (count <= 10) {
            s->bl_tree[REPZ_3_10].Freq++;
        } else {
            s->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.
 */
local void send_tree (s, tree, max_code)
    deflate_state *s;
    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(s, curlen, s->bl_tree); } while (--count != 0);

        } else if (curlen != 0) {
            if (curlen != prevlen) {
                send_code(s, curlen, s->bl_tree); count--;
            }
            Assert(count >= 3 && count <= 6, " 3_6?");
            send_code(s, REP_3_6, s->bl_tree); send_bits(s, count-3, 2);

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

        } else {
            send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, 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.
 */
local int build_bl_tree(s)
    deflate_state *s;
{
    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(s, (ct_data *)s->dyn_ltree, s->l_desc.max_code);
    scan_tree(s, (ct_data *)s->dyn_dtree, s->d_desc.max_code);

    /* Build the bit length tree: */
    build_tree(s, (tree_desc *)(&(s->bl_desc)));
    /* opt_len now includes the length of the tree representations, except

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美午夜一区二区| 亚洲色图另类专区| 一本一道久久a久久精品 | 国产精品久久三区| 欧美精品日韩精品| av爱爱亚洲一区| 麻豆精品视频在线观看免费| 国产精品福利影院| 久久久久9999亚洲精品| 5858s免费视频成人| 99久久综合精品| 国产麻豆精品久久一二三| 夜夜嗨av一区二区三区四季av| 欧美不卡一区二区三区四区| 在线免费亚洲电影| 成人av网站在线观看免费| 国产精品久久精品日日| 日韩一区二区三免费高清| 成av人片一区二区| 中文字幕第一区二区| 91精品国产综合久久精品app| 亚洲成人午夜影院| 欧美做爰猛烈大尺度电影无法无天| 麻豆精品视频在线观看| 婷婷综合另类小说色区| 亚洲欧美日韩一区| 国产精品麻豆99久久久久久| 精品国产乱码久久久久久浪潮| 欧美午夜电影网| 视频一区二区中文字幕| 亚洲欧美日韩国产手机在线| 国产女人水真多18毛片18精品视频| 精品理论电影在线观看| 色又黄又爽网站www久久| 成人一区二区三区在线观看 | 久久精品国产秦先生| 丝袜脚交一区二区| 图片区小说区区亚洲影院| 亚洲欧美一区二区三区孕妇| 亚洲欧美日韩系列| 国产日韩欧美综合在线| 337p日本欧洲亚洲大胆色噜噜| 欧美一区二区三区色| 欧美一区二区在线看| 7777精品伊人久久久大香线蕉| 在线视频你懂得一区| 国产精品一区在线观看你懂的| 精品一区二区三区日韩| 精品一区二区国语对白| 国产午夜精品美女毛片视频| 欧美电影精品一区二区| 欧美v日韩v国产v| 欧美一级片免费看| 欧美一区二区三区影视| 岛国精品一区二区| 成人激情黄色小说| 91国偷自产一区二区三区观看| 91猫先生在线| 欧美精品tushy高清| 欧美成人乱码一区二区三区| 欧美日韩国产成人在线91| 欧美日韩国产在线播放网站| 欧美三级乱人伦电影| 91精品国产日韩91久久久久久| 成人a级免费电影| 色呦呦一区二区三区| 欧美午夜精品久久久| 91精品国产品国语在线不卡| 精品国产乱码久久久久久老虎| 中文字幕免费一区| 26uuu国产电影一区二区| 中文无字幕一区二区三区| 亚洲免费观看高清完整版在线| 亚洲在线中文字幕| 精品一区二区三区视频在线观看 | 亚洲成人免费影院| 蜜桃视频在线观看一区| 成人美女视频在线观看18| 欧美性感一类影片在线播放| 欧美v亚洲v综合ⅴ国产v| 国产精品女主播av| 午夜a成v人精品| 国产精品亚洲第一区在线暖暖韩国| 色综合久久综合| 91免费国产视频网站| 日韩一区二区精品葵司在线 | 亚洲国产精品一区二区尤物区| 久久精品久久99精品久久| 精品视频免费看| 欧美va亚洲va| 夜夜爽夜夜爽精品视频| 久久精品av麻豆的观看方式| 91年精品国产| 日韩欧美一二三区| 亚洲精品免费在线| 免费高清成人在线| 9色porny自拍视频一区二区| 色婷婷香蕉在线一区二区| 日韩一区二区三区免费看| 国产精品国产精品国产专区不蜜 | 亚洲嫩草精品久久| 国产一区二区三区蝌蚪| 欧美体内she精视频| 一区在线观看视频| 国产精品人成在线观看免费 | 日韩精品在线看片z| 亚洲美女一区二区三区| 亚洲三级在线免费| 韩国成人精品a∨在线观看| av在线不卡网| 久久久久久久久久久久电影 | 亚洲大型综合色站| 成人性生交大片免费看视频在线| 欧美精品三级日韩久久| 亚洲天堂成人网| 久久99久久99| 欧美人与z0zoxxxx视频| 亚洲国产sm捆绑调教视频 | 日韩av一二三| 99re这里都是精品| 久久久91精品国产一区二区精品| 亚洲影院久久精品| 99视频在线观看一区三区| 欧美精品一区二区三区在线播放| 亚洲综合激情另类小说区| 日韩电影在线一区二区三区| caoporn国产一区二区| 久久久综合九色合综国产精品| 爽好久久久欧美精品| 色综合天天在线| 国产精品欧美经典| 国产精品香蕉一区二区三区| 日韩三级中文字幕| 午夜视频一区二区| 色一情一乱一乱一91av| 中文久久乱码一区二区| 国产在线精品免费av| 91一区二区在线| 国产精品久线观看视频| 蜜臀精品一区二区三区在线观看| 久久日一线二线三线suv| 日韩精品一二三区| 欧美日韩大陆在线| 水蜜桃久久夜色精品一区的特点| 欧美日韩一区二区欧美激情| 亚洲手机成人高清视频| 色先锋aa成人| 欧美精品1区2区3区| 日韩电影免费在线观看网站| 这里只有精品电影| 麻豆精品新av中文字幕| 欧美久久久久久蜜桃| 国产69精品久久777的优势| 国产蜜臀97一区二区三区 | caoporen国产精品视频| 婷婷久久综合九色综合绿巨人| 精品国产髙清在线看国产毛片| 91视频国产资源| 激情综合色播激情啊| 一区二区三区四区国产精品| 精品成人佐山爱一区二区| 一本一本大道香蕉久在线精品| 久久成人综合网| 一区二区视频在线看| 久久久精品国产99久久精品芒果 | 亚洲青青青在线视频| 日韩欧美国产综合一区| 一本色道久久综合精品竹菊| 国产一区在线精品| 亚洲成人免费观看| 亚洲视频一二区| 26uuu欧美| 欧美剧情电影在线观看完整版免费励志电影 | 国产一区二区三区精品欧美日韩一区二区三区| 亚洲视频香蕉人妖| 国产午夜精品一区二区三区四区 | 一区av在线播放| 国产偷国产偷精品高清尤物| 7777精品伊人久久久大香线蕉完整版| 波多野结衣在线一区| 久久se精品一区精品二区| 一区二区视频在线看| 日本一二三四高清不卡| 91精品国产综合久久香蕉麻豆| 在线看国产一区二区| 51精品国自产在线| 91亚洲精品久久久蜜桃网站| 麻豆精品视频在线| 婷婷综合在线观看| 夜夜爽夜夜爽精品视频| 国产精品久久久久久久岛一牛影视 | 亚洲专区一二三| 国产精品电影一区二区| 久久网站热最新地址| 欧美一二三区在线观看| 欧美三级在线播放| 欧美中文字幕不卡| 色综合久久99| 色哟哟亚洲精品| 色婷婷av一区二区三区软件 |