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

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

?? lzh.pas

?? themeengine6源碼
?? PAS
?? 第 1 頁 / 共 2 頁
字號:
{-----------------------------------------------------------------------------
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/MPL-1.1.html

Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either expressed or implied. See the License for
the specific language governing rights and limitations under the License.

The Original Code is: cDIB.PAS, released August 28, 2000.

The Initial Developer of the Original Code is Peter Morris (pete@stuckindoors.com),
Portions created by Peter Morris are Copyright (C) 2000 Peter Morris.
All Rights Reserved.

Purpose of file:
This is the main drawing engine.

Contributor(s):
None as yet


Last Modified: March 18, 2001
Current Version: 1.8

-----------------------------------------------------------------------------}

unit Lzh;

{$R-}

interface

uses Sysutils, Classes;

const
  //LZss parameters
  cStringBufferSize = 4096; //Size of string buffer
  cLookAheadSize = 60; //Size of look-ahead buffer
  cThreshHold = 2;
  cNull = cStringBufferSize; //End of the tree's node


  //Huffman parameters
  cNumChars = 256 - cThreshHold + cLookAheadSize;
  cTableSize  = (cNumChars * 2) - 1;  //Size of table
  cRootPos =	cTableSize - 1; //Root position
  cMaximumFreq = $8000; //Update when cummulative Freq hits this value

  //Tables FOR encoding/decoding upper 6 bits of sliding dictionary pointer
  //Encoder table
  cEncTableLen: array[0..63] of byte = ($03, $04, $04, $04, $05, $05, $05, $05,
    $05, $05, $05, $05, $06, $06, $06, $06, $06, $06, $06, $06, $06, $06, $06,
    $06, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07,
    $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $08, $08, $08, $08, $08,
    $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08);

  cEncTableCode: array [0..63] of byte = ($00, $20, $30, $40, $50, $58, $60,
    $68, $70, $78, $80, $88, $90, $94, $98, $9C, $A0, $A4, $A8, $AC, $B0, $B4,
    $B8, $BC, $C0, $C2, $C4, $C6, $C8, $CA, $CC, $CE, $D0, $D2, $D4, $D6, $D8,
    $DA, $DC, $DE, $E0, $E2, $E4, $E6, $E8, $EA, $EC, $EE, $F0, $F1, $F2, $F3,
    $F4, $F5, $F6, $F7, $F8, $F9, $FA, $FB, $FC, $FD, $FE, $FF);

  //Decoder table
  cDecTableLen: array[0..255] of byte = ($03, $03, $03, $03, $03, $03, $03, $03,
    $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03,
    $03, $03, $03, $03, $03, $03, $03, $03, $03, $04, $04, $04, $04, $04, $04,
    $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04,
    $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04,
    $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $05, $05, $05,
    $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05,
    $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05,
    $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05,
    $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05,
    $05, $06, $06, $06, $06, $06, $06, $06, $06, $06, $06, $06, $06, $06, $06,
    $06, $06, $06, $06, $06, $06, $06, $06, $06, $06, $06, $06, $06, $06, $06,
    $06, $06, $06, $06, $06, $06, $06, $06, $06, $06, $06, $06, $06, $06, $06,
    $06, $06, $06, $06, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07,
    $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07,
    $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07,
    $07, $07, $07, $07, $07, $07, $07, $08, $08, $08, $08, $08, $08, $08, $08,
	  $08, $08, $08, $08, $08, $08, $08, $08);

  cDecTableCode: array [0..255] of byte = ($00, $00, $00, $00, $00, $00, $00,
    $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00,
    $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $01, $01, $01, $01, $01,
    $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $02, $02, $02, $02,
    $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $03, $03, $03,
    $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $04, $04,
    $04, $04, $04, $04, $04, $04, $05, $05, $05, $05, $05, $05, $05, $05, $06,
    $06, $06, $06, $06, $06, $06, $06, $07, $07, $07, $07, $07, $07, $07, $07,
    $08, $08, $08, $08, $08, $08, $08, $08, $09, $09, $09, $09, $09, $09, $09,
    $09, $0A, $0A, $0A, $0A, $0A, $0A, $0A, $0A, $0B, $0B, $0B, $0B, $0B, $0B,
    $0B, $0B, $0C, $0C, $0C, $0C, $0D, $0D, $0D, $0D, $0E, $0E, $0E, $0E, $0F,
    $0F, $0F, $0F, $10, $10, $10, $10, $11, $11, $11, $11, $12, $12, $12, $12,
    $13, $13, $13, $13, $14, $14, $14, $14, $15, $15, $15, $15, $16, $16, $16,
    $16, $17, $17, $17, $17, $18, $18, $19, $19, $1A, $1A, $1B, $1B, $1C, $1C,
    $1D, $1D, $1E, $1E, $1F, $1F, $20, $20, $21, $21, $22, $22, $23, $23, $24,
    $24, $25, $25, $26, $26, $27, $27, $28, $28, $29, $29, $2A, $2A, $2B, $2B,
    $2C, $2C, $2D, $2D, $2E, $2E, $2F, $2F, $30, $31, $32, $33, $34, $35, $36,
    $37, $38, $39, $3A, $3B, $3C, $3D, $3E, $3F);


type
  TLZHAction = (acCompress, acDecompress);
  ElzhException = Class(Exception);

  //====================
  PFrequency = ^TFrequency;
  TFrequency = array [0..cTableSize] of word;

  PParent = ^TParent;
  TParent = array [0..pred(cTableSize + cNumChars)] of SmallInt;

  PChild = ^TChild;
  TChild = array [0..PRED(cTableSize)] of SmallInt;

  PTextBuffer = ^TTextBuffer;
  TTextBuffer = array [0..cStringBufferSize + cLookAheadSize - 2] of byte;

  PLinkArray = ^TLinkArray;
  TLinkArray = array [0..cStringBufferSize] of SmallInt;

  PLinkBackArray = ^TLinkBackArray;
  TLinkBackArray = array [0..cStringBufferSize + 256] of SmallInt;

  TLZHStream = class
  private
    { Private declarations }
    FAction: TLZHAction;

    Code,
    Len,
    PutBuf,
    GetBuf: Word;

    GetLen,
    PutLen: Byte;

    FUncompressedSize,
    FBytesWritten,
    FBytesRead,
    OrigSize,
    CodeSize,
    PrintCount: Longint;

    MatchPos,
    MatchLen: SmallInt;


    TextBuff: PTextBuffer;

    LeftLeaf,
    ParentLeaf: PLinkArray;
    RightLeaf: PLinkBackArray;
    
    Freq: PFrequency;

    Parent: PParent;
    Child: PChild;

    FSource,
    FDest                     : TStream;
    //Initialize the tree
    procedure InitTree;

    //Insert a new node
    procedure InsertNode(r : SmallInt);

    //Delete a node from the tree
    procedure DeleteNode(p: SmallInt);

    //Get a bit from the stream
    function GetBit: SmallInt;

    //Get a byte from the stream
    function GetByte: SmallInt;

    //Update a char
    procedure update(c : SmallInt);

    //Start huffman encoding
    procedure StartHuff;

    //Output some results
    procedure Putcode(l : SmallInt; c: WORD);

    //Reconstruct frequency tree
    procedure Reconstruct;

    //Encode a character
    procedure EncodeChar(c: WORD);

    //Encode a string position in the tree
    procedure EncodePosition(c : WORD);

    //Output "endcode end" flag
    procedure EncodeEnd;

    //Decode a character
    function DecodeChar: SmallInt;

    //Decode a string from the tree
    function DecodePosition: Word;

    //Start LZH
    procedure InitLZH;

    //End LZH
    procedure EndLZH;
  protected
    procedure InternalRead(var Data; Size : Word; var BytesRead: Word);
    procedure InternalWrite(const Data; Size : Word; var BytesWritten: Word);
    procedure ReadData(var Data; Size : Word; var BytesRead: Word);
    procedure WriteData(const Data; Size : Word; var BytesWritten: Word);
  public
    constructor Create(Source, Dest : TStream);
    function Pack(OrigSize: Longint): Longint;
    procedure Unpack;
  end;

implementation {===============================================================}

procedure TLZHStream.InitTree;
var
  I: SmallInt;
begin
  for I := cStringBufferSize + 1 to cStringBufferSize + 256 do
    RightLeaf[i] := cNull;  // ROOT !!

  for I := 0 TO cStringBufferSize do
    ParentLeaf[i] := cNull; //NODE
end;

Procedure TLZHStream.InsertNode(r : SmallInt);
var
  tmp,i, p, cmp : SmallInt;
  key : PTextBuffer;
  c : WORD;
begin
  cmp := 1;
  key := @TextBuff[r];
  p := SUCC(cStringBufferSize) + key[0];
  RightLeaf[r] := cNull;
  LeftLeaf[r] := cNull;
  MatchLen := 0;
  while MatchLen < cLookAheadSize do begin
    if (cmp >= 0) then begin
	    if (RightLeaf[p] <> cNull) then
        p := RightLeaf[p]
      else begin
	      RightLeaf[p] := r;
		    ParentLeaf[r] := p;
		    exit;
      end;
    end else begin
      if (LeftLeaf[p] <> cNull) then
	       p := LeftLeaf[p]
      else begin
        LeftLeaf[p] := r;
		    ParentLeaf[r] := p;
		    exit;
      end;
    end;

    i := 0;
    cmp := 0;
	  while (i < cLookAheadSize) and (cmp = 0) do begin
      inc(i);
      cmp := key[i] - TextBuff[p + i];
    end;

    if (i > cThreshHold) then begin
      tmp := PRED((r - p) and PRED(cStringBufferSize));
	    if (i > MatchLen) then begin
        MatchPos := tmp;
        MatchLen := i;
      end;

	    if (MatchLen < cLookAheadSize) and (i = MatchLen) then begin
        c := tmp;
		    if (c < MatchPos) then begin
          MatchPos := c;
        end;
      end;
    end; { if i > threshold }
  end; { WHILE match_length < F }

  ParentLeaf[r] := ParentLeaf[p];
  LeftLeaf[r] := LeftLeaf[p];
  RightLeaf[r] := RightLeaf[p];
  ParentLeaf[LeftLeaf[p]] := r;
  ParentLeaf[RightLeaf[p]] := r;
  if (RightLeaf[ParentLeaf[p]] = p) then
    RightLeaf[ParentLeaf[p]] := r
  else
    LeftLeaf[ParentLeaf[p]] := r;

  ParentLeaf[p] := cNull;  { remove p }
end;

procedure TLZHStream.DeleteNode(p: SmallInt);
var
  q : SmallInt;
begin
  if (ParentLeaf[p] = cNull) then exit; //Unregistered node

  if RightLeaf[p] = cNull then
   q := LeftLeaf[p]
  else begin
    if (LeftLeaf[p] = cNull) then
      q := RightLeaf[p]
    else begin
      q := LeftLeaf[p];
      if (RightLeaf[q] <> cNull) then begin
        repeat
          q := RightLeaf[q];
        until (RightLeaf[q] = cNull);

        RightLeaf[ParentLeaf[q]] := LeftLeaf[q];
        ParentLeaf[LeftLeaf[q]] := ParentLeaf[q];
        LeftLeaf[q] := LeftLeaf[p];
        ParentLeaf[LeftLeaf[p]] := q;
      end;

      RightLeaf[q] := RightLeaf[p];
      ParentLeaf[RightLeaf[p]] := q;
    end;
  end;
  ParentLeaf[q] := ParentLeaf[p];

  if (RightLeaf[ParentLeaf[p]] = p) then
    RightLeaf[ParentLeaf[p]] := q
  else
    LeftLeaf[ParentLeaf[p]] := q;

  ParentLeaf[p] := cNull;
end;


{ Huffman coding parameters }
function TLZHStream.GetBit: SmallInt;
var
  i: BYTE;
  i2: SmallInt;
  Wresult: Word;
begin
  while (getlen <= 8) do begin
    InternalRead(i,1,Wresult);
    if Wresult = 1 then
      i2 := i
    else
      i2 := 0;

    getbuf := getbuf OR (i2 SHL (8 - getlen));
    inc(getlen,8);
  end;

  i2 := getbuf;
  getbuf := getbuf SHL 1;
  dec(getlen);
  getbit := SmallInt((i2 < 0));
end;

function TLZHStream.GetByte: SmallInt;
var
  j: BYTE;
  i,Wresult: WORD;
begin
  while (getlen <= 8) do begin
    InternalRead(j,1,Wresult);
    if Wresult = 1 then
      i := j
    else
      i := 0;

    getbuf := getbuf OR (i SHL (8 - getlen));
    inc(getlen,8);
  end;

  i := getbuf;
  getbuf := getbuf SHL 8;
  dec(getlen,8);
  getbyte := SmallInt(i SHR 8);
end;

procedure TLZHStream.Putcode(l : SmallInt; c: WORD);
var
  Temp: byte;
  Got: Word;
begin
  putbuf := putbuf OR (c SHR putlen);
  inc(putlen,l);

  if (putlen >= 8) then begin
    Temp := putbuf SHR 8;
    InternalWrite(Temp,1,Got);
    dec(putlen,8);
    if (putlen  >= 8) then begin
      Temp := Lo(PutBuf);
      InternalWrite(Temp,1,Got);
      inc(codesize,2);
      dec(putlen,8);
      putbuf := c SHL (l - putlen);
    end else begin
	    putbuf := putbuf SHL 8;
	    inc(codesize);
    end;
  end;
end;

procedure TLZHStream.StartHuff;
var

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产日本亚洲高清| 国产精品久久久久久户外露出 | 粉嫩绯色av一区二区在线观看 | 亚洲人成小说网站色在线| 91福利精品第一导航| 日韩av成人高清| 久久婷婷综合激情| 色婷婷综合在线| 成人高清视频在线| 亚洲激情在线激情| 精品噜噜噜噜久久久久久久久试看| 国产福利不卡视频| 亚洲一区二区三区国产| 中文字幕欧美激情一区| 国产原创一区二区| 九九九精品视频| 久久精品av麻豆的观看方式| 久久精品国产久精国产爱| 美日韩一级片在线观看| 一区二区三区四区蜜桃| 亚洲视频在线观看一区| 亚洲色图欧洲色图| 亚洲一级在线观看| 午夜a成v人精品| 日本女人一区二区三区| 日本在线不卡一区| 久久99精品久久久久久动态图| 九九**精品视频免费播放| 成人午夜短视频| 欧日韩精品视频| 欧美久久久一区| 久久久另类综合| 一区二区三区产品免费精品久久75| 亚洲一区二区偷拍精品| 日韩 欧美一区二区三区| 精品一区二区三区av| 粉嫩aⅴ一区二区三区四区五区| 99综合电影在线视频| 欧美日韩激情在线| 久久久久久久综合日本| 一区二区三区在线不卡| 青青草国产成人av片免费| 成人手机在线视频| 日韩一区二区三免费高清| 久久久久99精品一区| 一区二区三区中文字幕精品精品| 蜜臀av性久久久久蜜臀av麻豆| 成人国产免费视频| 精品捆绑美女sm三区| 1区2区3区国产精品| 狠狠色狠狠色合久久伊人| 一区免费观看视频| 九一久久久久久| 精品久久久久久最新网址| 亚洲在线观看免费| 成人高清视频免费观看| 久久综合狠狠综合久久激情| 亚洲一区二区欧美| 色婷婷久久一区二区三区麻豆| 精品免费视频.| 免费人成精品欧美精品 | 国产成人av影院| 欧美精品一区二区三区一线天视频| 亚洲精品成人在线| 99r精品视频| 亚洲欧美色一区| 色婷婷综合久久久中文字幕| 国产精品国产三级国产aⅴ无密码| 国产成人精品免费| 久久久综合激的五月天| 国产一区二区三区观看| 337p粉嫩大胆色噜噜噜噜亚洲| 国内精品自线一区二区三区视频| 久久久久久97三级| 成人av动漫网站| 亚洲欧美偷拍卡通变态| 日本高清不卡视频| 午夜精品aaa| 精品福利一二区| 成人午夜精品一区二区三区| 亚洲激情综合网| 亚洲综合色区另类av| 日韩丝袜情趣美女图片| 国产成人99久久亚洲综合精品| 国产精品久久久久影视| 色吧成人激情小说| 美女性感视频久久| 亚洲国产精华液网站w| 精品国产百合女同互慰| 国产肉丝袜一区二区| 国产精品不卡视频| 欧美日本在线看| 色婷婷精品大视频在线蜜桃视频| 麻豆精品一区二区综合av| 亚洲成人tv网| 亚洲激情欧美激情| 亚洲私人影院在线观看| 欧美在线免费播放| 久久福利资源站| 亚洲女子a中天字幕| 日韩亚洲欧美成人一区| 99在线精品免费| 秋霞影院一区二区| 亚洲美女视频在线| 国产亚洲精品aa午夜观看| 在线观看国产日韩| 国产成人av一区二区三区在线观看| 亚洲欧美激情小说另类| 亚洲精品在线网站| 欧洲一区二区av| 国产成人在线视频网址| 美女看a上一区| 水蜜桃久久夜色精品一区的特点 | 日韩一区二区三区观看| 日韩视频免费观看高清完整版| 99这里只有久久精品视频| 豆国产96在线|亚洲| 高清免费成人av| 97久久精品人人做人人爽50路| 成人一区二区三区在线观看| av亚洲精华国产精华精华| 日本久久电影网| 欧美性感一类影片在线播放| 欧美日韩精品一区二区三区蜜桃| 欧美日韩免费观看一区二区三区| 欧美午夜在线一二页| 这里只有精品免费| 欧美大尺度电影在线| 国产亚洲一区字幕| 日韩一区有码在线| 一区二区三区久久| 久久精品99国产精品日本| 成人综合激情网| 91超碰这里只有精品国产| 欧美xxx久久| 一区二区激情视频| 国产一区二区中文字幕| 在线欧美小视频| 精品久久久久久久久久久久久久久久久 | 亚洲欧美色综合| 国产电影一区在线| 91丨porny丨首页| 精一区二区三区| 亚洲午夜在线观看视频在线| 国产精品亚洲第一| 日韩欧美中文一区| 日韩午夜电影在线观看| 欧美日韩一级二级三级| 欧美一区二区不卡视频| 欧美成人在线直播| 国产三级一区二区| 麻豆精品一区二区三区| 欧美特级限制片免费在线观看| 国产精品成人免费在线| 国产一区三区三区| 精品美女在线播放| 精品一区二区三区在线视频| 欧美一级视频精品观看| 日本中文字幕不卡| 日韩美女视频在线| 激情五月激情综合网| 在线日韩av片| 一本一本大道香蕉久在线精品 | 亚洲成av人片一区二区梦乃| 欧美tk丨vk视频| 国产精品视频在线看| 久久精品在这里| 亚洲色图欧洲色图婷婷| 日韩精品三区四区| 精品久久久久一区二区国产| 日本网站在线观看一区二区三区| 处破女av一区二区| 日韩免费观看高清完整版在线观看| 蜜臀久久久99精品久久久久久| 国产精品久久久一本精品| 日本sm残虐另类| 欧美四级电影网| 亚洲精品日产精品乱码不卡| 五月综合激情婷婷六月色窝| 91一区二区在线| 国产精品视频线看| 青青青爽久久午夜综合久久午夜| 欧美吻胸吃奶大尺度电影| 欧美日韩国产免费| 亚洲天堂2016| 2023国产精品自拍| 欧美在线视频日韩| 精品国产91久久久久久久妲己 | 久久99精品国产麻豆婷婷洗澡| 成人美女视频在线观看18| 亚洲美女在线国产| 久久这里只有精品首页| 欧美日韩一区二区三区高清| 国产福利视频一区二区三区| 国产精品卡一卡二| 日韩免费福利电影在线观看| 欧美一区二区三区性视频| 国产乱码精品一区二区三区五月婷| 亚洲午夜激情av| 亚洲欧美一区二区在线观看|