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

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

?? infblock.c

?? < VC++視頻音頻開發>> 這本書的源碼
?? C
字號:
/* infblock.c -- interpret and process block types to last block
 * Copyright (C) 1995-2002 Mark Adler
 * For conditions of distribution and use, see copyright notice in zlib.h 
 */

#include "zutil.h"
#include "infblock.h"
#include "inftrees.h"
#include "infcodes.h"
#include "infutil.h"

struct inflate_codes_state {int dummy;}; /* for buggy compilers */

/* simplify the use of the inflate_huft type with some defines */
#define exop word.what.Exop
#define bits word.what.Bits

/* Table for deflate from PKZIP's appnote.txt. */
local const uInt border[] = { /* Order of the bit length code lengths */
        16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};

/*
   Notes beyond the 1.93a appnote.txt:

   1. Distance pointers never point before the beginning of the output
      stream.
   2. Distance pointers can point back across blocks, up to 32k away.
   3. There is an implied maximum of 7 bits for the bit length table and
      15 bits for the actual data.
   4. If only one code exists, then it is encoded using one bit.  (Zero
      would be more efficient, but perhaps a little confusing.)  If two
      codes exist, they are coded using one bit each (0 and 1).
   5. There is no way of sending zero distance codes--a dummy must be
      sent if there are none.  (History: a pre 2.0 version of PKZIP would
      store blocks with no distance codes, but this was discovered to be
      too harsh a criterion.)  Valid only for 1.93a.  2.04c does allow
      zero distance codes, which is sent as one code of zero bits in
      length.
   6. There are up to 286 literal/length codes.  Code 256 represents the
      end-of-block.  Note however that the static length tree defines
      288 codes just to fill out the Huffman codes.  Codes 286 and 287
      cannot be used though, since there is no length base or extra bits
      defined for them.  Similarily, there are up to 30 distance codes.
      However, static trees define 32 codes (all 5 bits) to fill out the
      Huffman codes, but the last two had better not show up in the data.
   7. Unzip can check dynamic Huffman blocks for complete code sets.
      The exception is that a single code would not be complete (see #4).
   8. The five bits following the block type is really the number of
      literal codes sent minus 257.
   9. Length codes 8,16,16 are interpreted as 13 length codes of 8 bits
      (1+6+6).  Therefore, to output three times the length, you output
      three codes (1+1+1), whereas to output four times the same length,
      you only need two codes (1+3).  Hmm.
  10. In the tree reconstruction algorithm, Code = Code + Increment
      only if BitLength(i) is not zero.  (Pretty obvious.)
  11. Correction: 4 Bits: # of Bit Length codes - 4     (4 - 19)
  12. Note: length code 284 can represent 227-258, but length code 285
      really is 258.  The last length deserves its own, short code
      since it gets used a lot in very redundant files.  The length
      258 is special since 258 - 3 (the min match length) is 255.
  13. The literal/length and distance code bit lengths are read as a
      single stream of lengths.  It is possible (and advantageous) for
      a repeat code (16, 17, or 18) to go across the boundary between
      the two sets of lengths.
 */


void inflate_blocks_reset(s, z, c)
inflate_blocks_statef *s;
z_streamp z;
uLongf *c;
{
  if (c != Z_NULL)
    *c = s->check;
  if (s->mode == BTREE || s->mode == DTREE)
    ZFREE(z, s->sub.trees.blens);
  if (s->mode == CODES)
    inflate_codes_free(s->sub.decode.codes, z);
  s->mode = TYPE;
  s->bitk = 0;
  s->bitb = 0;
  s->read = s->write = s->window;
  if (s->checkfn != Z_NULL)
    z->adler = s->check = (*s->checkfn)(0L, (const Bytef *)Z_NULL, 0);
  Tracev((stderr, "inflate:   blocks reset\n"));
}


inflate_blocks_statef *inflate_blocks_new(z, c, w)
z_streamp z;
check_func c;
uInt w;
{
  inflate_blocks_statef *s;

  if ((s = (inflate_blocks_statef *)ZALLOC
       (z,1,sizeof(struct inflate_blocks_state))) == Z_NULL)
    return s;
  if ((s->hufts =
       (inflate_huft *)ZALLOC(z, sizeof(inflate_huft), MANY)) == Z_NULL)
  {
    ZFREE(z, s);
    return Z_NULL;
  }
  if ((s->window = (Bytef *)ZALLOC(z, 1, w)) == Z_NULL)
  {
    ZFREE(z, s->hufts);
    ZFREE(z, s);
    return Z_NULL;
  }
  s->end = s->window + w;
  s->checkfn = c;
  s->mode = TYPE;
  Tracev((stderr, "inflate:   blocks allocated\n"));
  inflate_blocks_reset(s, z, Z_NULL);
  return s;
}


int inflate_blocks(s, z, r)
inflate_blocks_statef *s;
z_streamp z;
int r;
{
  uInt t;               /* temporary storage */
  uLong b;              /* bit buffer */
  uInt k;               /* bits in bit buffer */
  Bytef *p;             /* input data pointer */
  uInt n;               /* bytes available there */
  Bytef *q;             /* output window write pointer */
  uInt m;               /* bytes to end of window or read pointer */

  /* copy input/output information to locals (UPDATE macro restores) */
  LOAD

  /* process input based on current state */
  while (1) switch (s->mode)
  {
    case TYPE:
      NEEDBITS(3)
      t = (uInt)b & 7;
      s->last = t & 1;
      switch (t >> 1)
      {
        case 0:                         /* stored */
          Tracev((stderr, "inflate:     stored block%s\n",
                 s->last ? " (last)" : ""));
          DUMPBITS(3)
          t = k & 7;                    /* go to byte boundary */
          DUMPBITS(t)
          s->mode = LENS;               /* get length of stored block */
          break;
        case 1:                         /* fixed */
          Tracev((stderr, "inflate:     fixed codes block%s\n",
                 s->last ? " (last)" : ""));
          {
            uInt bl, bd;
            inflate_huft *tl, *td;

            inflate_trees_fixed(&bl, &bd, &tl, &td, z);
            s->sub.decode.codes = inflate_codes_new(bl, bd, tl, td, z);
            if (s->sub.decode.codes == Z_NULL)
            {
              r = Z_MEM_ERROR;
              LEAVE
            }
          }
          DUMPBITS(3)
          s->mode = CODES;
          break;
        case 2:                         /* dynamic */
          Tracev((stderr, "inflate:     dynamic codes block%s\n",
                 s->last ? " (last)" : ""));
          DUMPBITS(3)
          s->mode = TABLE;
          break;
        case 3:                         /* illegal */
          DUMPBITS(3)
          s->mode = BAD;
          z->msg = (char*)"invalid block type";
          r = Z_DATA_ERROR;
          LEAVE
      }
      break;
    case LENS:
      NEEDBITS(32)
      if ((((~b) >> 16) & 0xffff) != (b & 0xffff))
      {
        s->mode = BAD;
        z->msg = (char*)"invalid stored block lengths";
        r = Z_DATA_ERROR;
        LEAVE
      }
      s->sub.left = (uInt)b & 0xffff;
      b = k = 0;                      /* dump bits */
      Tracev((stderr, "inflate:       stored length %u\n", s->sub.left));
      s->mode = s->sub.left ? STORED : (s->last ? DRY : TYPE);
      break;
    case STORED:
      if (n == 0)
        LEAVE
      NEEDOUT
      t = s->sub.left;
      if (t > n) t = n;
      if (t > m) t = m;
      zmemcpy(q, p, t);
      p += t;  n -= t;
      q += t;  m -= t;
      if ((s->sub.left -= t) != 0)
        break;
      Tracev((stderr, "inflate:       stored end, %lu total out\n",
              z->total_out + (q >= s->read ? q - s->read :
              (s->end - s->read) + (q - s->window))));
      s->mode = s->last ? DRY : TYPE;
      break;
    case TABLE:
      NEEDBITS(14)
      s->sub.trees.table = t = (uInt)b & 0x3fff;
#ifndef PKZIP_BUG_WORKAROUND
      if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29)
      {
        s->mode = BAD;
        z->msg = (char*)"too many length or distance symbols";
        r = Z_DATA_ERROR;
        LEAVE
      }
#endif
      t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f);
      if ((s->sub.trees.blens = (uIntf*)ZALLOC(z, t, sizeof(uInt))) == Z_NULL)
      {
        r = Z_MEM_ERROR;
        LEAVE
      }
      DUMPBITS(14)
      s->sub.trees.index = 0;
      Tracev((stderr, "inflate:       table sizes ok\n"));
      s->mode = BTREE;
    case BTREE:
      while (s->sub.trees.index < 4 + (s->sub.trees.table >> 10))
      {
        NEEDBITS(3)
        s->sub.trees.blens[border[s->sub.trees.index++]] = (uInt)b & 7;
        DUMPBITS(3)
      }
      while (s->sub.trees.index < 19)
        s->sub.trees.blens[border[s->sub.trees.index++]] = 0;
      s->sub.trees.bb = 7;
      t = inflate_trees_bits(s->sub.trees.blens, &s->sub.trees.bb,
                             &s->sub.trees.tb, s->hufts, z);
      if (t != Z_OK)
      {
        r = t;
        if (r == Z_DATA_ERROR)
        {
          ZFREE(z, s->sub.trees.blens);
          s->mode = BAD;
        }
        LEAVE
      }
      s->sub.trees.index = 0;
      Tracev((stderr, "inflate:       bits tree ok\n"));
      s->mode = DTREE;
    case DTREE:
      while (t = s->sub.trees.table,
             s->sub.trees.index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f))
      {
        inflate_huft *h;
        uInt i, j, c;

        t = s->sub.trees.bb;
        NEEDBITS(t)
        h = s->sub.trees.tb + ((uInt)b & inflate_mask[t]);
        t = h->bits;
        c = h->base;
        if (c < 16)
        {
          DUMPBITS(t)
          s->sub.trees.blens[s->sub.trees.index++] = c;
        }
        else /* c == 16..18 */
        {
          i = c == 18 ? 7 : c - 14;
          j = c == 18 ? 11 : 3;
          NEEDBITS(t + i)
          DUMPBITS(t)
          j += (uInt)b & inflate_mask[i];
          DUMPBITS(i)
          i = s->sub.trees.index;
          t = s->sub.trees.table;
          if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) ||
              (c == 16 && i < 1))
          {
            ZFREE(z, s->sub.trees.blens);
            s->mode = BAD;
            z->msg = (char*)"invalid bit length repeat";
            r = Z_DATA_ERROR;
            LEAVE
          }
          c = c == 16 ? s->sub.trees.blens[i - 1] : 0;
          do {
            s->sub.trees.blens[i++] = c;
          } while (--j);
          s->sub.trees.index = i;
        }
      }
      s->sub.trees.tb = Z_NULL;
      {
        uInt bl, bd;
        inflate_huft *tl, *td;
        inflate_codes_statef *c;

        bl = 9;         /* must be <= 9 for lookahead assumptions */
        bd = 6;         /* must be <= 9 for lookahead assumptions */
        t = s->sub.trees.table;
        t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f),
                                  s->sub.trees.blens, &bl, &bd, &tl, &td,
                                  s->hufts, z);
        if (t != Z_OK)
        {
          if (t == (uInt)Z_DATA_ERROR)
          {
            ZFREE(z, s->sub.trees.blens);
            s->mode = BAD;
          }
          r = t;
          LEAVE
        }
        Tracev((stderr, "inflate:       trees ok\n"));
        if ((c = inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL)
        {
          r = Z_MEM_ERROR;
          LEAVE
        }
        s->sub.decode.codes = c;
      }
      ZFREE(z, s->sub.trees.blens);
      s->mode = CODES;
    case CODES:
      UPDATE
      if ((r = inflate_codes(s, z, r)) != Z_STREAM_END)
        return inflate_flush(s, z, r);
      r = Z_OK;
      inflate_codes_free(s->sub.decode.codes, z);
      LOAD
      Tracev((stderr, "inflate:       codes end, %lu total out\n",
              z->total_out + (q >= s->read ? q - s->read :
              (s->end - s->read) + (q - s->window))));
      if (!s->last)
      {
        s->mode = TYPE;
        break;
      }
      s->mode = DRY;
    case DRY:
      FLUSH
      if (s->read != s->write)
        LEAVE
      s->mode = DONE;
    case DONE:
      r = Z_STREAM_END;
      LEAVE
    case BAD:
      r = Z_DATA_ERROR;
      LEAVE
    default:
      r = Z_STREAM_ERROR;
      LEAVE
  }
}


int inflate_blocks_free(s, z)
inflate_blocks_statef *s;
z_streamp z;
{
  inflate_blocks_reset(s, z, Z_NULL);
  ZFREE(z, s->window);
  ZFREE(z, s->hufts);
  ZFREE(z, s);
  Tracev((stderr, "inflate:   blocks freed\n"));
  return Z_OK;
}


void inflate_set_dictionary(s, d, n)
inflate_blocks_statef *s;
const Bytef *d;
uInt  n;
{
  zmemcpy(s->window, d, n);
  s->read = s->write = s->window + n;
}


/* Returns true if inflate is currently at the end of a block generated
 * by Z_SYNC_FLUSH or Z_FULL_FLUSH. 
 * IN assertion: s != Z_NULL
 */
int inflate_blocks_sync_point(s)
inflate_blocks_statef *s;
{
  return s->mode == LENS;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美成人激情免费网| 欧美激情一区在线观看| 亚洲午夜精品17c| 成人国产精品免费观看动漫| 精品黑人一区二区三区久久| 丝袜亚洲另类欧美综合| 欧洲另类一二三四区| 亚洲欧美另类小说视频| 99视频热这里只有精品免费| 欧美国产一区在线| 国产成人免费视| 国产日韩av一区二区| 国产精品中文字幕一区二区三区| 精品国产污污免费网站入口 | 日韩欧美123| 免播放器亚洲一区| 日韩视频123| 精品一区二区三区免费观看| 精品欧美一区二区三区精品久久| 免费成人在线播放| 欧美tickling网站挠脚心| 蜜臀99久久精品久久久久久软件 | 91成人免费在线| 亚洲美女淫视频| 欧美午夜精品久久久久久孕妇| 一区二区三区四区不卡视频| 欧美伊人久久久久久久久影院| 性欧美疯狂xxxxbbbb| 在线成人av网站| 久久成人羞羞网站| 欧美国产日韩在线观看| 99久久国产综合精品麻豆| 日韩美女啊v在线免费观看| 91啪在线观看| 香蕉影视欧美成人| 精品国产免费人成电影在线观看四季| 精品写真视频在线观看| 久久久久成人黄色影片| 99久久精品国产一区二区三区| 一区二区三区免费网站| 欧美日韩精品一区二区三区四区| 麻豆精品国产91久久久久久| 久久日韩精品一区二区五区| 成人免费毛片嘿嘿连载视频| 亚洲人成精品久久久久| 欧美日韩精品高清| 激情另类小说区图片区视频区| 国产视频一区二区在线观看| 91在线小视频| 日韩电影在线看| 久久九九久精品国产免费直播| 色综合天天视频在线观看| 午夜影院久久久| 久久蜜桃av一区精品变态类天堂| 99久久99久久精品国产片果冻| 亚洲va欧美va人人爽| 久久一日本道色综合| 一本一道综合狠狠老| 日韩精品欧美成人高清一区二区| 久久网站最新地址| 在线观看免费视频综合| 久久国产综合精品| 最新中文字幕一区二区三区| 91超碰这里只有精品国产| 国产一区 二区 三区一级| 最新热久久免费视频| 欧美一卡2卡3卡4卡| 成人精品亚洲人成在线| 午夜精品一区在线观看| 国产色爱av资源综合区| 欧美色爱综合网| 国产精品66部| 午夜av区久久| 国产精品视频看| 欧美顶级少妇做爰| 9i在线看片成人免费| 日本大胆欧美人术艺术动态| 日本一二三不卡| 91精品婷婷国产综合久久性色| 99视频有精品| 国内精品久久久久影院色| 亚洲一区二区三区在线| 国产三区在线成人av| 91精品国产综合久久久久| 91在线观看成人| 国内精品视频一区二区三区八戒| 亚洲国产精品久久久久婷婷884| 久久蜜桃av一区二区天堂 | 久久综合久久综合亚洲| 欧美在线观看视频在线| 风流少妇一区二区| 老司机精品视频在线| 一区二区免费看| 国产精品素人一区二区| 欧美成人乱码一区二区三区| 色香色香欲天天天影视综合网| 国产精品影视天天线| 日韩电影在线免费观看| 亚洲综合成人在线视频| 国产精品久久久久9999吃药| 精品精品国产高清a毛片牛牛| 欧美日韩一卡二卡三卡| 972aa.com艺术欧美| 国产精品99精品久久免费| 久久国产麻豆精品| 五月天欧美精品| 亚洲午夜久久久久久久久久久| 国产精品国产三级国产普通话蜜臀| 欧美videos大乳护士334| 91精品欧美久久久久久动漫| 欧美综合在线视频| 91麻豆产精品久久久久久| 成人免费视频免费观看| 国产精品18久久久久久vr| 麻豆91精品91久久久的内涵| 亚洲成人精品一区二区| 一区二区三区四区中文字幕| 国产精品成人网| 亚洲国产精品成人久久综合一区| 久久综合久久综合亚洲| 欧美精品一区男女天堂| 91精品福利在线一区二区三区 | 亚洲国产高清在线| 久久久久久99久久久精品网站| 日韩欧美高清在线| 欧美一区日韩一区| 欧美一区二区三区小说| 欧美精品在线观看播放| 欧美日韩免费高清一区色橹橹| 色88888久久久久久影院按摩| 99re热这里只有精品视频| av不卡免费在线观看| 99国产精品视频免费观看| 91在线精品秘密一区二区| 成人国产亚洲欧美成人综合网 | 美腿丝袜在线亚洲一区| 日韩av网站免费在线| 奇米色777欧美一区二区| 日本欧美久久久久免费播放网| 日本不卡一二三区黄网| 日本中文字幕一区| 麻豆91免费观看| 国产精品一区二区三区99| 国产成人综合在线| www.色精品| 色综合久久88色综合天天| 色94色欧美sute亚洲线路一久| 欧美视频在线一区二区三区| 欧美日韩另类一区| 日韩欧美中文字幕精品| 精品国产91乱码一区二区三区| 久久亚洲精精品中文字幕早川悠里| 久久青草国产手机看片福利盒子| 久久青草欧美一区二区三区| 国产欧美日韩亚州综合| 中文字幕一区二区三区色视频| 亚洲欧洲国产日本综合| 一级做a爱片久久| 青青草97国产精品免费观看无弹窗版| 久久国产尿小便嘘嘘尿| 成人午夜视频免费看| 91麻豆免费看片| 欧美精品黑人性xxxx| 精品盗摄一区二区三区| 国产欧美一区二区精品仙草咪| 成人免费一区二区三区视频| 亚洲国产中文字幕| 精彩视频一区二区| 91视频在线看| 制服丝袜激情欧洲亚洲| 久久久久成人黄色影片| 亚洲美女免费视频| 日韩成人一级片| 成人蜜臀av电影| 欧美性xxxxx极品少妇| 日韩欧美色综合网站| 中文字幕不卡在线观看| 亚洲制服丝袜一区| 国产在线日韩欧美| 色欧美日韩亚洲| 欧美tickle裸体挠脚心vk| 中文字幕亚洲成人| 日产国产高清一区二区三区 | 国产高清一区日本| 在线这里只有精品| 精品噜噜噜噜久久久久久久久试看| 国产精品网站在线播放| 亚洲成a人片综合在线| 国产一区二区影院| 在线观看亚洲专区| 久久精品一区二区三区不卡| 一区二区三区免费网站| 国产尤物一区二区| 在线观看视频一区二区| 久久婷婷国产综合国色天香| 亚洲综合色成人| 国产成人精品免费| 欧美久久久久久久久中文字幕| 国产午夜精品一区二区三区四区| 亚洲一区二区免费视频|