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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? trees.c

?? 在DSPF2812下
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* trees.c -- output deflated data using Huffman coding
 * Copyright (C) 1995-1998 Jean-loup Gailly
 * For conditions of distribution and use, see copyright notice in zlib.h 
 */

/*
 *  ALGORITHM
 *
 *      The "deflation" process uses several Huffman trees. The more
 *      common source values are represented by shorter bit sequences.
 *
 *      Each code tree is stored in a compressed form which is itself
 * a Huffman encoding of the lengths of all the code strings (in
 * ascending order by source values).  The actual code strings are
 * reconstructed from the lengths in the inflate process, as described
 * in the deflate specification.
 *
 *  REFERENCES
 *
 *      Deutsch, L.P.,"'Deflate' Compressed Data Format Specification".
 *      Available in ftp.uu.net:/pub/archiving/zip/doc/deflate-1.1.doc
 *
 *      Storer, James A.
 *          Data Compression:  Methods and Theory, pp. 49-50.
 *          Computer Science Press, 1988.  ISBN 0-7167-8156-5.
 *
 *      Sedgewick, R.
 *          Algorithms, p290.
 *          Addison-Wesley, 1983. ISBN 0-201-06672-6.
 */

/* @(#) $Id$ */

/* #define GEN_TREES_H */

#include "deflate.h"

#ifdef DEBUG
#  include <ctype.h>
#endif

/* ===========================================================================
 * Constants
 */

#define MAX_BL_BITS 7
/* Bit length codes must not exceed MAX_BL_BITS bits */

#define END_BLOCK 256
/* end of block literal code */

#define REP_3_6      16
/* repeat previous bit length 3-6 times (2 bits of repeat count) */

#define REPZ_3_10    17
/* repeat a zero length 3-10 times  (3 bits of repeat count) */

#define REPZ_11_138  18
/* repeat a zero length 11-138 times  (7 bits of repeat count) */

//add zhw 
const int extra_lbits[LENGTH_CODES] // extra bits for each length code 
   = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0};

const int extra_dbits[D_CODES] /* extra bits for each distance code */
   = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13};

const int extra_blbits[BL_CODES]/* extra bits for each bit length code */
   = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7};

const uch bl_order[BL_CODES]
   = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15};
/* The lengths of the bit length codes are sent in order of decreasing
 * probability, to avoid transmitting the lengths for unused bit length codes.
 */

#define Buf_size (8 * 2*sizeof(char))
/* Number of bits used within bi_buf. (bi_buf might be implemented on
 * more than 16 bits on some systems.)
 */

/* ===========================================================================
 * Local data. These are initialized only once.
 */

#define DIST_CODE_LEN  512 /* see definition of array dist_code below */

#if defined(GEN_TREES_H) || !defined(STDC)
/* non ANSI compilers may not accept trees.h */

extern local ct_data static_ltree[L_CODES+2];
/* The static literal tree. Since the bit lengths are imposed, there is no
 * need for the L_CODES extra codes used during heap construction. However
 * The codes 286 and 287 are needed to build a canonical tree (see _tr_init
 * below).
 */

extern local ct_data static_dtree[D_CODES];
/* The static distance tree. (Actually a trivial tree since all codes use
 * 5 bits.)
 */

extern local uch dist_code[DIST_CODE_LEN];
/* Distance codes. The first 256 values correspond to the distances
 * 3 .. 258, the last 256 values correspond to the top 8 bits of
 * the 15 bit distances.
 */

extern local uch length_code[MAX_MATCH-MIN_MATCH+1];
/* length code for each normalized match length (0 == MIN_MATCH) */

extern local int base_length[LENGTH_CODES];
/* First normalized length for each code (0 = MIN_MATCH) */

extern local int base_dist[D_CODES];
/* First normalized distance for each code (0 = distance of 1) */

#else
#  include "trees.h"
#endif /* GEN_TREES_H */

struct static_tree_desc_s {
    const ct_data *static_tree;  /* static tree or NULL */
    const intf *extra_bits;      /* extra bits for each code or NULL */
    int     extra_base;          /* base index for extra_bits */
    int     elems;               /* max number of elements in the tree */
    int     max_length;          /* max bit length for the codes */
};

local static_tree_desc  static_l_desc =
{static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS};

local static_tree_desc  static_d_desc =
{static_dtree, extra_dbits, 0,          D_CODES, MAX_BITS};

local static_tree_desc  static_bl_desc =
{(const ct_data *)0, extra_blbits, 0,   BL_CODES, MAX_BL_BITS};

/* ===========================================================================
 * Local (static) routines in this file.
 */

local void tr_static_init OF((void));
local void init_block     OF((deflate_state *s));
local void pqdownheap     OF((deflate_state *s, ct_data *tree, int k));
local void gen_bitlen     OF((deflate_state *s, tree_desc *desc));
local void gen_codes      OF((ct_data *tree, int max_code, ushf *bl_count));
local void build_tree     OF((deflate_state *s, tree_desc *desc));
local void scan_tree      OF((deflate_state *s, ct_data *tree, int max_code));
local void send_tree      OF((deflate_state *s, ct_data *tree, int max_code));
local int  build_bl_tree  OF((deflate_state *s));
local void send_all_trees OF((deflate_state *s, int lcodes, int dcodes,
                              int blcodes));
local void compress_block OF((deflate_state *s, ct_data *ltree,
                              ct_data *dtree));
local void set_data_type  OF((deflate_state *s));
local unsigned bi_reverse OF((unsigned value, int length));
local void bi_windup      OF((deflate_state *s));
local void bi_flush       OF((deflate_state *s));
local void copy_block     OF((deflate_state *s, charf *buf, unsigned len,
                              int header));

#ifdef GEN_TREES_H
local void gen_trees_header OF((void));
#endif

#ifndef DEBUG
#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
   /* Send a code of the given tree. c and tree must not have side effects */

#else /* DEBUG */
#  define send_code(s, c, tree) \
     { if (z_verbose>2) fprintf(stderr,"\ncd %3d ",(c)); \
       send_bits(s, tree[c].Code, tree[c].Len); }
#endif

#define d_code(dist) \
   ((dist) < 256 ? dist_code[dist] : dist_code[256+((dist)>>7)])
/* Mapping from a distance to a distance code. dist is the distance - 1 and
 * must not have side effects. dist_code[256] and dist_code[257] are never
 * used.
 */

/* ===========================================================================
 * Output a short LSB first on the stream.
 * IN assertion: there is enough room in pendingBuf.
 */
#define put_short(s, w) { \
    put_byte(s, (uch)((w) & 0xff)); \
    put_byte(s, (uch)((ush)(w) >> 8) & 0xff); \
}

/* ===========================================================================
 * Send a value on a given number of bits.
 * IN assertion: length <= 16 and value fits in length bits.
 */
 #define DEBUG_

#ifdef DEBUG_
local void send_bits      OF((deflate_state *s, int value, int length));

local void send_bits(s, value, length)
    deflate_state *s;
    int value;  /* value to send */
    int length; /* number of bits */
{
    ush i;
    ush k;
    Tracevv((stderr," l %2d v %4x ", length, value));
    Assert(length > 0 && length <= 15, "invalid length");
    
  //  s->bits_sent += (ulg)length;
  

    /* If not enough room in bi_buf, use (valid) bits from bi_buf and
     * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid))
     * unused bits in value.
     */
    if (s->bi_valid > (int)Buf_size - length) {
         
        i = value;
        for(k=0; k<s->bi_valid; k++)
            i= i<<1;
        s->bi_buf |=i;
        
      //  s->bi_buf |= ((value <<(s->bi_valid))) & 0x00ffff;
        put_short(s, s->bi_buf);
        s->bi_buf = (ush)value >> (Buf_size - s->bi_valid);
        s->bi_valid += length - Buf_size;
    } else {
        s->bi_buf |= value << s->bi_valid;
        s->bi_valid += length;
    }
}
#else /* !DEBUG */

#define send_bits(s, value, length) \
{ int len = length;\
  if (s->bi_valid > (int)Buf_size - len) {\
    int val = value;\
    s->bi_buf |= ((val << s->bi_valid) & 0xffff);\
    put_short(s, s->bi_buf);\
    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
    s->bi_valid += len - Buf_size;\
  } else {\
    s->bi_buf |= (value) << s->bi_valid;\
    s->bi_valid += len;\
  }\
}
#endif /* DEBUG */


#define MAX(a,b) (a >= b ? a : b)
/* the arguments must not have side effects */

/* ===========================================================================
 * Initialize the various 'constant' tables.
 */
local void tr_static_init()
{
#if defined(GEN_TREES_H) || !defined(STDC)
    static int static_init_done = 0;
    int n;        /* iterates over tree elements */
    int bits;     /* bit counter */
    int length;   /* length value */
    int code;     /* code value */
    int dist;     /* distance index */
    ush bl_count[MAX_BITS+1];
    /* number of codes at each bit length for an optimal tree */

    if (static_init_done) return;

    /* Initialize the mapping length (0..255) -> length code (0..28) */
    length = 0;
    for (code = 0; code < LENGTH_CODES-1; code++) {
        base_length[code] = length;
        for (n = 0; n < (1<<extra_lbits[code]); n++) {
            length_code[length++] = (uch)code;
        }
    }
    Assert (length == 256, "tr_static_init: length != 256");
    /* Note that the length 255 (match length 258) can be represented
     * in two different ways: code 284 + 5 bits or code 285, so we
     * overwrite length_code[255] to use the best encoding:
     */
    length_code[length-1] = (uch)code;

    /* Initialize the mapping dist (0..32K) -> dist code (0..29) */
    dist = 0;
    for (code = 0 ; code < 16; code++) {
        base_dist[code] = dist;
        for (n = 0; n < (1<<extra_dbits[code]); n++) {
            dist_code[dist++] = (uch)code;
        }
    }
    Assert (dist == 256, "tr_static_init: dist != 256");
    dist >>= 7; /* from now on, all distances are divided by 128 */
    for ( ; code < D_CODES; code++) {
        base_dist[code] = dist << 7;
        for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) {
            dist_code[256 + dist++] = (uch)code;
        }
    }
    Assert (dist == 256, "tr_static_init: 256+dist != 512");

    /* Construct the codes of the static literal tree */
    for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0;
    n = 0;
    while (n <= 143) static_ltree[n++].Len = 8, bl_count[8]++;
    while (n <= 255) static_ltree[n++].Len = 9, bl_count[9]++;
    while (n <= 279) static_ltree[n++].Len = 7, bl_count[7]++;
    while (n <= 287) static_ltree[n++].Len = 8, bl_count[8]++;
    /* Codes 286 and 287 do not exist, but we must include them in the
     * tree construction to get a canonical Huffman tree (longest code
     * all ones)
     */
    gen_codes((ct_data *)static_ltree, L_CODES+1, bl_count);

    /* The static distance tree is trivial: */
    for (n = 0; n < D_CODES; n++) {
        static_dtree[n].Len = 5;
        static_dtree[n].Code = bi_reverse((unsigned)n, 5);
    }
    static_init_done = 1;

#  ifdef GEN_TREES_H
    gen_trees_header();
#  endif
#endif /* defined(GEN_TREES_H) || !defined(STDC) */
}

/* ===========================================================================
 * Genererate the file trees.h describing the static trees.
 */
#ifdef GEN_TREES_H
#  ifndef DEBUG
#    include <stdio.h>
#  endif

#  define SEPARATOR(i, last, width) \
      ((i) == (last)? "\n};\n\n" :    \
       ((i) % (width) == (width)-1 ? ",\n" : ", "))

void gen_trees_header()
{
    FILE *header = fopen("trees.h", "w");
    int i;

    Assert (header != NULL, "Can't open trees.h");
    fprintf(header,
	    "/* header created automatically with -DGEN_TREES_H */\n\n");

    fprintf(header, "local const ct_data static_ltree[L_CODES+2] = {\n");
    for (i = 0; i < L_CODES+2; i++) {
	fprintf(header, "{{%3u},{%3u}}%s", static_ltree[i].Code,
		static_ltree[i].Len, SEPARATOR(i, L_CODES+1, 5));
    }

    fprintf(header, "local const ct_data static_dtree[D_CODES] = {\n");
    for (i = 0; i < D_CODES; i++) {
	fprintf(header, "{{%2u},{%2u}}%s", static_dtree[i].Code,
		static_dtree[i].Len, SEPARATOR(i, D_CODES-1, 5));
    }

    fprintf(header, "local const uch dist_code[DIST_CODE_LEN] = {\n");
    for (i = 0; i < DIST_CODE_LEN; i++) {
	fprintf(header, "%2u%s", dist_code[i],
		SEPARATOR(i, DIST_CODE_LEN-1, 20));
    }

    fprintf(header, "local const uch length_code[MAX_MATCH-MIN_MATCH+1]= {\n");
    for (i = 0; i < MAX_MATCH-MIN_MATCH+1; i++) {
	fprintf(header, "%2u%s", length_code[i],
		SEPARATOR(i, MAX_MATCH-MIN_MATCH, 20));
    }

    fprintf(header, "local const int base_length[LENGTH_CODES] = {\n");
    for (i = 0; i < LENGTH_CODES; i++) {
	fprintf(header, "%1u%s", base_length[i],
		SEPARATOR(i, LENGTH_CODES-1, 20));
    }

    fprintf(header, "local const int base_dist[D_CODES] = {\n");
    for (i = 0; i < D_CODES; i++) {
	fprintf(header, "%5u%s", base_dist[i],
		SEPARATOR(i, D_CODES-1, 10));
    }

    fclose(header);
}
#endif /* GEN_TREES_H */

/* ===========================================================================
 * Initialize the tree data structures for a new zlib stream.
 */
void _tr_init(s)
    deflate_state *s;
{
    tr_static_init();

    s->compressed_len = 0L;

    s->l_desc.dyn_tree = s->dyn_ltree;
    s->l_desc.stat_desc = &static_l_desc;

    s->d_desc.dyn_tree = s->dyn_dtree;
    s->d_desc.stat_desc = &static_d_desc;

    s->bl_desc.dyn_tree = s->bl_tree;
    s->bl_desc.stat_desc = &static_bl_desc;

    s->bi_buf = 0;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
麻豆91在线观看| 精品在线播放免费| www亚洲一区| 欧美综合一区二区| 国产成人免费在线观看不卡| 婷婷久久综合九色综合绿巨人| 中文字幕免费一区| 日韩精品一区二区三区四区| 色哟哟精品一区| 丰满放荡岳乱妇91ww| 蜜臀久久久99精品久久久久久| 一区二区成人在线| 国产精品欧美久久久久一区二区| 日韩视频永久免费| 欧美日韩色综合| 91搞黄在线观看| 91麻豆文化传媒在线观看| 国产夫妻精品视频| 久久99精品久久久久久国产越南 | av中文字幕亚洲| 九色综合狠狠综合久久| 日韩黄色免费电影| 亚洲国产视频a| 亚洲国产日产av| 亚洲最大的成人av| 亚洲卡通动漫在线| 亚洲欧美另类小说| 一区二区三区在线免费视频| 中文字幕在线不卡一区二区三区| 国产亚洲女人久久久久毛片| 337p粉嫩大胆色噜噜噜噜亚洲| 日韩免费性生活视频播放| 欧美一区二区免费| 91精品国产高清一区二区三区 | 中文字幕一区日韩精品欧美| 国产日韩欧美高清| 中文字幕欧美国产| 国产精品视频一二| 中文字幕一区二区三区精华液| 国产精品久久久久久久久免费丝袜 | www.欧美色图| 99国产精品久| 欧亚一区二区三区| 欧美日韩国产中文| 欧美一区二区人人喊爽| 日韩欧美一级二级三级| 欧美xxxxxxxx| 国产精品亲子伦对白| 日韩美女久久久| 亚洲一区二区三区美女| 婷婷一区二区三区| 亚洲成av人片在线| 日韩一区在线免费观看| 亚洲综合一二区| 香蕉久久夜色精品国产使用方法| 三级在线观看一区二区| 九色|91porny| 国产成人精品三级麻豆| 91啪亚洲精品| 91精品国产欧美一区二区18 | 成人美女视频在线看| 成人永久免费视频| 欧洲一区二区三区在线| 欧美成人在线直播| 中国av一区二区三区| 亚洲精品欧美二区三区中文字幕| 亚洲成a人v欧美综合天堂下载| 久久成人免费电影| 成人在线综合网| 欧美在线影院一区二区| 欧美大白屁股肥臀xxxxxx| 国产精品国产三级国产普通话三级 | 狠狠色丁香婷综合久久| 9i看片成人免费高清| 5858s免费视频成人| 国产欧美一区二区精品秋霞影院| 亚洲精品乱码久久久久久久久| 蜜桃av噜噜一区| 99亚偷拍自图区亚洲| 在线成人免费观看| 国产精品视频一二三区| 免费人成在线不卡| 91在线视频免费91| 欧美变态tickling挠脚心| 一区在线中文字幕| 狠狠色狠狠色合久久伊人| 色噜噜狠狠色综合欧洲selulu| 4438成人网| 亚洲美腿欧美偷拍| 国产一区二区在线观看免费| 欧美视频一区在线观看| 国产欧美精品一区二区三区四区| 午夜亚洲国产au精品一区二区| 成人精品视频.| 欧美成人性福生活免费看| 亚洲愉拍自拍另类高清精品| 成人做爰69片免费看网站| 欧美一级日韩免费不卡| 一区二区三区中文字幕电影 | 日本一区二区三区四区 | 日本韩国欧美在线| 久久精品人人做| 蜜桃在线一区二区三区| 欧美在线视频全部完| 国产精品视频免费看| 国模冰冰炮一区二区| 欧美三级三级三级| 18欧美亚洲精品| 风间由美一区二区av101| 亚洲最快最全在线视频| 国产成人午夜精品影院观看视频| 日韩欧美国产1| 五月天欧美精品| 欧美日韩精品一区二区三区蜜桃 | 欧美大片国产精品| 午夜久久电影网| 在线精品国精品国产尤物884a| 国产精品久久久久9999吃药| 国产一区二区看久久| 久久综合久久综合久久| 麻豆精品视频在线观看| 欧美一区二视频| 视频一区在线视频| 欧美乱熟臀69xxxxxx| 亚洲一区二区三区影院| 日本久久一区二区| 一区二区三区欧美日| 在线免费观看一区| 亚洲综合在线五月| 欧美视频一区在线观看| 亚洲成国产人片在线观看| 在线精品国精品国产尤物884a| 亚洲一区二区三区中文字幕| 91成人在线精品| 首页国产欧美日韩丝袜| 欧美一区二视频| 激情六月婷婷综合| 久久日一线二线三线suv| 国产综合色在线| 日本一区二区三区电影| www.亚洲激情.com| 亚洲伦理在线精品| 欧美日韩aaaaa| 毛片基地黄久久久久久天堂| 精品国产露脸精彩对白| 粉嫩高潮美女一区二区三区 | 正在播放亚洲一区| 美国一区二区三区在线播放| 精品国产凹凸成av人网站| 国产美女精品在线| 亚洲少妇屁股交4| 在线观看一区二区视频| 日本不卡一区二区三区高清视频| 欧美不卡一区二区| 成人av免费观看| 亚洲一区二区三区中文字幕| 欧美一级专区免费大片| 国产成人自拍网| 亚洲曰韩产成在线| 欧美大片顶级少妇| 91在线观看视频| 日韩高清在线一区| 国产欧美中文在线| 欧洲av在线精品| 国产一区二区三区在线观看免费 | 色老汉一区二区三区| 日韩va亚洲va欧美va久久| 久久久噜噜噜久久中文字幕色伊伊 | 91麻豆福利精品推荐| 五月综合激情网| 久久久www成人免费毛片麻豆 | 日韩精品视频网站| 日本一区二区在线不卡| 欧美日本高清视频在线观看| 激情图区综合网| 亚洲嫩草精品久久| 欧美成人高清电影在线| 97久久超碰国产精品| 免费观看在线色综合| 欧美激情一区二区三区四区| 欧美午夜精品久久久久久孕妇| 久久国产精品一区二区| 亚洲欧美一区二区三区极速播放| 91精品国模一区二区三区| 成人v精品蜜桃久久一区| 丝袜美腿高跟呻吟高潮一区| 中文字幕二三区不卡| 欧美日韩视频在线一区二区| 成人aa视频在线观看| 男女性色大片免费观看一区二区 | 欧美日本韩国一区| 99精品视频免费在线观看| 看国产成人h片视频| 一区二区高清在线| 国产欧美一二三区| 911精品产国品一二三产区| 99视频精品免费视频| 国产精选一区二区三区| 日韩不卡手机在线v区| 一区二区三区四区在线|