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

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

?? comp_groupsmart.bas

?? 20多種VB軟件的加密與壓縮模塊
?? BAS
?? 第 1 頁 / 共 2 頁
字號:
Attribute VB_Name = "Comp_GroupSmart"


Option Explicit

'This is a 1 run method

'This method is the smartgrouping method
'it will search for follower bytes within a curtain range wich
'will fit into a curtain bitlenght
'It will search as long as needed to find the best compression
'if it finds followers of 12*0 and 4*1 = 16 bytes it will be compressed
'because 0 - 0 and 1 - 0 will both fit into 1 bit, it will fit
'in 16*1 bit wich will lead to to the following
'in 17 headerbits and 16 codebits = 33 bits = 4 bytes and 1 bit
'if it finds followers of 12*0 and 4*173 = 16 bytes it will be compressed
'because 0 - 0 will fit in 1 bit and 173 - 173 will fit into 1 bit it will fit
'in 12*1 bit and 4*1 bit wich will lead to to the following
'in 17 headerbits and 12 codebits = 29 bits = 3 bytes and 5 bits
'in 17 headerbits and 4 codebits = 21 bits = 2 bytes and 3 bits
'wich get a total of 6 bytes

Private OutPos As Long              'invoeg positie voor de output array
Private OutBitCount As Integer
Private OutByteBuf As Byte
Private ReadBitPos As Integer
Private NumExtBits(7) As Byte

Private Type Grouping
    LowValue As Long
    HighValue As Long
    NumInGroup As Long
End Type
   
Private Sub Init_Grouping()
    OutPos = 0              'Next position in the output stream
    OutBitCount = 0         'Number of bits stored in the output buffer
    OutByteBuf = 0          'byte wich will be stores in outputstream if it is filled with 8 bits
    ReadBitPos = 0          'next position wich will be read
'This array is used to determen the amount of bits used to store a number
    NumExtBits(0) = 3       '<8
    NumExtBits(1) = 3       '<16
    NumExtBits(2) = 4       '<32
    NumExtBits(3) = 5       '<64
    NumExtBits(4) = 6       '<128
    NumExtBits(5) = 7       '<256
    NumExtBits(6) = 8       '<512
    NumExtBits(7) = 16      'the rest
End Sub

Public Sub Compress_SmartGrouping(ByteArray() As Byte)
    Dim OutStream() As Byte         'The output array
    Dim BeginGroup As Long          'Start for the next bytes wich will be compressed
    Dim BestGroup As Integer        'Best grouping method to get the best result
    Dim NewBest As Integer          'used to check if there is maybe a better method
    Dim BitsDeep As Integer         'This is used as a dummy
    Dim X As Long
    Dim TotFileLen As Long          'total file len
    Dim Group(1 To 8) As Grouping
    TotFileLen = UBound(ByteArray)
    ReDim OutStream(TotFileLen + (TotFileLen / 7))  'Worst case scenario
    BeginGroup = 0
'whe start by setting the beginvalues
    Call Init_Grouping
'lets check if we have done the whole file
    Do While BeginGroup < TotFileLen
        Group(8).LowValue = 0
        Group(8).HighValue = 255
        Group(8).NumInGroup = TotFileLen - BeginGroup + 1
'If where not ready yet whe assume the best method of compression is no compression
'That is indeed the best method cause nocompression needs 9 additional bits and compression uses 17
        BestGroup = 8
'lets check if there is maybe a better way
        NewBest = CheckForBetterWithin(ByteArray, Group, BestGroup, BeginGroup)
        Do While BestGroup <> NewBest
'yes there is, lets check again to be shure
            BestGroup = NewBest
            NewBest = CheckForBetterWithin(ByteArray, Group, BestGroup, BeginGroup)
        Loop
'whe have found the best method
        If BestGroup = 8 Then
            BitsDeep = 0            'No compression
        Else
            BitsDeep = BestGroup
        End If
'here we will store the header in into the outputstream
        Call AddGroupCodeToStream(OutStream, Group(BestGroup).NumInGroup, BitsDeep)
'If we have found compression then we must store also the lowest value of the group
'opslaan minimum waarde van de groep
        If BestGroup <> 8 Then
            Call AddBitsToStream(OutStream, CLng(Group(BestGroup).LowValue), 8)
        End If
'here we will read the bytes from the inputstream, convert them, and store them
'into the output stream
        For X = BeginGroup To BeginGroup + Group(BestGroup).NumInGroup - 1
            Call AddBitsToStream(OutStream, CLng(ByteArray(X) - Group(BestGroup).LowValue), BestGroup)
        Next
        BeginGroup = BeginGroup + Group(BestGroup).NumInGroup
    Loop
'if the grouping part is complete we have to store the EOF-marker = 0
'0 = no compression ,marker for less than 8 bytes, and 0 bytes to store
    Call AddGroupCodeToStream(OutStream, 0, 0)
'maybe we have some bits leftover so lets store them
    If OutBitCount < 8 Then
        Do While OutBitCount < 8
            OutByteBuf = OutByteBuf * 2
            OutBitCount = OutBitCount + 1
        Loop
        OutStream(OutPos) = OutByteBuf: OutPos = OutPos + 1
    End If
    OutPos = OutPos - 1
    ReDim ByteArray(OutPos)
'lets copy the outputstream into the inputstream so that we can return the compressed file
'to the caller
    Call CopyMem(ByteArray(0), OutStream(0), OutPos + 1)
End Sub

'This part is used to select the extra bits used to store a value
Private Function GetExtraBitsNum(Number As Long)
    Select Case Number
    Case Is < 8
        GetExtraBitsNum = 0
    Case Is < 16
        GetExtraBitsNum = 1
    Case Is < 32
        GetExtraBitsNum = 2
    Case Is < 64
        GetExtraBitsNum = 3
    Case Is < 128
        GetExtraBitsNum = 4
    Case Is < 256
        GetExtraBitsNum = 5
    Case Is < 512
        GetExtraBitsNum = 6
    Case Else
        GetExtraBitsNum = 7
    End Select
End Function

Private Sub AddGroupCodeToStream(ToStream() As Byte, Number As Long, GroupNum As Integer)
    Dim NumVal As Byte
    Dim X As Long
'Store 3 bits to say what grouping method is used
    Call AddBitsToStream(ToStream, CLng(GroupNum), 3)
    NumVal = GetExtraBitsNum(Number)
'store 3 bits to with will tell the amount of bits to be read to get the groupsize
    Call AddBitsToStream(ToStream, CLng(NumVal), 3)
'store 3 to 16 bits to put in the groepsize
    Call AddBitsToStream(ToStream, Number, CInt(NumExtBits(NumVal)))
End Sub

'this sub will add an amount of bits into the outputstream
Private Sub AddBitsToStream(ToStream() As Byte, Number As Long, Numbits As Integer)
    Dim X As Long
    For X = Numbits - 1 To 0 Step -1
        OutByteBuf = OutByteBuf * 2 + (-1 * ((Number And 2 ^ X) > 0))
        OutBitCount = OutBitCount + 1
        If OutBitCount = 8 Then: ToStream(OutPos) = OutByteBuf: OutBitCount = 0: OutByteBuf = 0: OutPos = OutPos + 1
    Next
End Sub

'This is Smart part of the grouping method
'it will look for the way to get the best compression
Private Function CheckForBetterWithin(InArray() As Byte, Group() As Grouping, MaxGroup As Integer, StartPositie As Long)
    Dim LowInGroup As Integer               'lowest value found
    Dim HighInGroup As Integer              'highest value found
    Dim GroupSize As Integer                'size of the group 1-7
    Dim NumInGroup As Long                  'total numbers in group
    Dim RealBegin As Long
    Dim BestGroep As Integer                'the best group found
    Dim NewBestGroep As Integer             'check for bestgroup
    Dim StartGroep As Integer               'startgroup to hold the group wich will be checked for better comp.
    Dim BestCompression As Long             'maximum compression (for now)
    Dim WheHaveCompression As Boolean       'whe have found a better method
    Dim Char As Integer                     'character found in input stream
    Dim BitsNoComp As Long                  'bits used if no comp.
    Dim BitsComp As Long                    'bits used if comp.
    Dim CheckLen As Long                    'maximum bytes to check
    Dim StartPos As Long                    'startposition where the check will start
    StartPos = StartPositie
    RealBegin = StartPos
    StartGroep = MaxGroup
    CheckForBetterWithin = MaxGroup

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美性一二三区| 91精品国产aⅴ一区二区| 91原创在线视频| 欧美色综合久久| 欧美岛国在线观看| 国产精品久久毛片av大全日韩| 亚洲视频一区在线观看| 青青草原综合久久大伊人精品 | 成人激情校园春色| 日本韩国精品在线| 欧美不卡在线视频| 亚洲人成亚洲人成在线观看图片 | 欧美日韩黄视频| 亚洲精品在线网站| 亚洲精品综合在线| 精品一区二区三区在线视频| 一本色道久久综合狠狠躁的推荐| 91精品国产乱码久久蜜臀| 国产日韩一级二级三级| 亚洲线精品一区二区三区| 国产中文一区二区三区| 97精品久久久久中文字幕| 3751色影院一区二区三区| 亚洲国产精华液网站w| 日韩激情在线观看| 99精品视频一区| 久久亚洲春色中文字幕久久久| 一区二区三区在线播| 国产久卡久卡久卡久卡视频精品| 欧洲一区二区av| 国产欧美日韩亚州综合| 三级欧美在线一区| 一本久久综合亚洲鲁鲁五月天| 韩国v欧美v日本v亚洲v| 日本韩国精品一区二区在线观看| 久久综合给合久久狠狠狠97色69| 午夜电影一区二区| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 欧美日韩视频一区二区| 国产精品丝袜91| 久久精品国产一区二区| 在线影视一区二区三区| 国产精品入口麻豆九色| 精品一区二区影视| 宅男噜噜噜66一区二区66| 亚洲人123区| 粉嫩在线一区二区三区视频| 欧美一区二区精品在线| 一区av在线播放| 99视频超级精品| 国产亚洲欧美日韩日本| 久久成人免费网站| 欧美精品久久99| 亚洲影视资源网| 色综合久久综合网欧美综合网 | 国产精品一区二区久久精品爱涩| 欧美日韩成人综合| 一区二区国产盗摄色噜噜| 91免费精品国自产拍在线不卡| 国产视频在线观看一区二区三区| 精品一区二区在线免费观看| 日韩亚洲欧美综合| 青青国产91久久久久久| 欧美一区二区成人| 秋霞午夜av一区二区三区| 7777精品伊人久久久大香线蕉超级流畅| 一区二区三区在线不卡| 欧美制服丝袜第一页| 亚洲一区二区三区在线看| 欧洲精品一区二区三区在线观看| 亚洲人一二三区| 97久久人人超碰| 亚洲三级电影全部在线观看高清| 91免费视频网| 一区二区三区日韩欧美精品| 色嗨嗨av一区二区三区| 亚洲一区二区精品3399| 欧美私人免费视频| 天堂精品中文字幕在线| 69p69国产精品| 精品在线观看免费| 久久久久久久久久久黄色| 国产成人av电影在线播放| 中文字幕+乱码+中文字幕一区| 国产99久久久国产精品潘金网站| 日本一区二区三区在线观看| 成人激情图片网| 最新国产の精品合集bt伙计| 色综合久久久久综合体桃花网| 亚洲精品高清在线| 91精品在线麻豆| 狠狠色综合日日| 中文字幕的久久| 国产精品的网站| 色综合天天综合网天天看片| 亚洲资源中文字幕| 日韩一区二区三区电影在线观看| 久久成人羞羞网站| 国产精品麻豆欧美日韩ww| 在线免费观看日本一区| 日韩av网站免费在线| 国产午夜亚洲精品午夜鲁丝片| 成人一二三区视频| 亚洲女同女同女同女同女同69| 欧美精品乱码久久久久久| 国产综合色视频| 亚洲视频在线一区二区| 7777女厕盗摄久久久| 国产成人综合网| 亚洲最快最全在线视频| 日韩欧美高清dvd碟片| 成人亚洲精品久久久久软件| 亚洲精品成人a在线观看| 欧美一级二级在线观看| 成人午夜视频福利| 亚洲国产aⅴ成人精品无吗| 精品久久五月天| 色哟哟国产精品免费观看| 日韩av一区二区在线影视| 国产精品久久一卡二卡| 欧美日韩中字一区| 成人一道本在线| 喷白浆一区二区| 亚洲欧美中日韩| 91麻豆精品91久久久久同性| 成人激情av网| 麻豆精品久久久| 亚洲人123区| 久久精品人人做人人综合| 欧美在线观看一区| 国产成人午夜99999| 亚洲成人资源在线| 中文字幕一区二区三区精华液| 91精品福利在线一区二区三区| 成人黄色av电影| 精品一二三四区| 亚洲国产一区二区视频| 国产精品卡一卡二| 久久亚洲精华国产精华液 | 免费观看30秒视频久久| 成人欧美一区二区三区1314| 日韩亚洲欧美综合| 在线日韩av片| 粉嫩aⅴ一区二区三区四区五区| 午夜精品福利在线| 亚洲欧美日韩在线| 久久精品人人做人人爽97| 91精品国产91久久综合桃花| 日本精品裸体写真集在线观看| 国产福利精品一区二区| 免费观看一级特黄欧美大片| 亚洲一区二区中文在线| 亚洲欧洲色图综合| 国产日韩精品久久久| 日韩免费视频线观看| 9191久久久久久久久久久| 在线一区二区三区四区五区 | 97久久精品人人做人人爽50路| 久久99精品久久只有精品| 亚州成人在线电影| 亚洲一二三四区不卡| 亚洲欧美激情插| 1区2区3区欧美| 国产精品久久夜| 国产精品狼人久久影院观看方式| 国产午夜亚洲精品理论片色戒| 精品国产一区二区三区久久久蜜月| 91精品国产综合久久精品| 欧美日本高清视频在线观看| 欧美日韩一区二区在线视频| 色视频成人在线观看免| 成人91在线观看| 成人免费看黄yyy456| 成人一级黄色片| 成a人片亚洲日本久久| 成人激情动漫在线观看| 不卡的av网站| 成人av电影在线| 99久久久免费精品国产一区二区| 成人午夜免费电影| 99久久精品国产网站| 99在线精品观看| 91日韩在线专区| 在线一区二区三区| 欧美色图12p| 欧美日韩国产首页在线观看| 在线电影欧美成精品| 91麻豆精品国产91久久久久久久久 | 日韩精品自拍偷拍| 26uuu亚洲综合色| 久久精品一区蜜桃臀影院| 亚洲国产精品成人综合| 亚洲日本丝袜连裤袜办公室| 一区二区在线免费| 性做久久久久久| 美女mm1313爽爽久久久蜜臀| 国产一区二区三区av电影| 国产sm精品调教视频网站| 97久久超碰国产精品电影| 欧美少妇一区二区|