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

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

?? comp_groupsmart.bas

?? 常用加密算法用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久久精品一区二区二区| 久久女同性恋中文字幕| 国产真实乱偷精品视频免| 97久久精品人人澡人人爽| 日韩欧美一级二级| 亚洲电影一区二区三区| 99在线精品免费| 国产欧美日韩久久| 久久91精品久久久久久秒播| 欧美色男人天堂| 亚洲在线视频网站| 一本一道久久a久久精品 | 成人在线视频首页| 日韩欧美国产不卡| 日韩电影在线一区二区三区| 欧美在线综合视频| 亚洲精品网站在线观看| 99re在线精品| 亚洲欧美经典视频| 91社区在线播放| 亚洲激情自拍视频| 在线看日本不卡| 亚洲国产日韩a在线播放| 一本久道久久综合中文字幕 | 久久综合一区二区| 激情久久五月天| 日韩三级电影网址| 蜜桃视频在线一区| 精品国产露脸精彩对白| 国产在线精品一区在线观看麻豆| 日韩精品中文字幕一区二区三区 | 国产精品亚洲人在线观看| 精品第一国产综合精品aⅴ| 精品一二线国产| www国产成人| www.激情成人| 亚洲综合激情另类小说区| 欧洲一区二区三区在线| 亚洲成av人**亚洲成av**| 555www色欧美视频| 国产综合色在线视频区| 亚洲国产成人在线| 在线视频你懂得一区| 五月天一区二区| 久久久久久免费网| 97超碰欧美中文字幕| 亚洲aⅴ怡春院| 精品sm捆绑视频| 99在线精品一区二区三区| 亚洲成人免费在线观看| 日韩欧美久久久| 成人伦理片在线| 午夜婷婷国产麻豆精品| 久久久精品天堂| 在线免费不卡电影| 国产乱码一区二区三区| 亚洲欧美国产毛片在线| 5858s免费视频成人| 成人午夜视频在线| 99久久婷婷国产| 婷婷中文字幕综合| 国产日韩欧美精品综合| 在线观看91视频| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 国产精品美女久久久久久| 91久久精品网| 狠狠色丁香久久婷婷综合丁香| 亚洲视频在线一区| 久久综合九色综合久久久精品综合| 97国产一区二区| 国产真实乱对白精彩久久| 亚洲在线视频免费观看| 久久久99久久精品欧美| 欧美日韩视频在线第一区| 国产很黄免费观看久久| 亚洲va国产天堂va久久en| 国产日韩欧美激情| 日韩三级视频中文字幕| 在线观看成人免费视频| 国产精品一区二区不卡| 日本不卡一区二区三区| 亚洲美女免费在线| 国产欧美一区二区精品婷婷| 欧美一区二区日韩一区二区| 色香蕉久久蜜桃| 成人黄色软件下载| 国产精品一区二区在线观看网站 | 国产日产欧美一区| 91精品国产91热久久久做人人| 91在线小视频| 成人a免费在线看| 国产精品亚洲成人| 精品一区二区三区在线观看国产 | 综合自拍亚洲综合图不卡区| 2024国产精品| 欧美成人一区二区| 日韩欧美在线网站| 欧美精品在线视频| 欧美精品v日韩精品v韩国精品v| 色网综合在线观看| 91视视频在线观看入口直接观看www | 91电影在线观看| 一本大道av伊人久久综合| 成人综合日日夜夜| 岛国精品在线观看| 欧美成人免费网站| 在线不卡中文字幕| 91精品国产91久久久久久最新毛片| 欧洲精品一区二区三区在线观看| 91免费在线看| 91黄视频在线观看| 欧美日韩午夜在线| 91麻豆精品国产综合久久久久久| 欧美巨大另类极品videosbest| 欧美午夜寂寞影院| 91 com成人网| 欧美成人免费网站| 久久九九全国免费| 中文字幕亚洲不卡| 一区二区三区四区中文字幕| 亚洲大尺度视频在线观看| 亚洲国产视频网站| 蜜桃视频在线一区| 国产成人精品三级麻豆| av在线不卡观看免费观看| 97精品久久久久中文字幕| 欧美亚洲综合网| 91精品国产入口| 久久网站最新地址| 中文字幕一区二区三区乱码在线 | 免费欧美高清视频| 国内精品写真在线观看| 丁香五精品蜜臀久久久久99网站 | av高清不卡在线| 欧美体内she精视频| 91精品国产美女浴室洗澡无遮挡| 精品久久久久久亚洲综合网| 日本一区二区三区久久久久久久久不 | 中文字幕视频一区| 亚洲国产精品麻豆| 国产一区久久久| 99国产精品99久久久久久| 欧美精品 日韩| 国产农村妇女精品| 五月激情六月综合| 粉嫩13p一区二区三区| 欧美午夜寂寞影院| 国产亚洲精品aa| 亚洲曰韩产成在线| 国产成人综合亚洲91猫咪| 欧美午夜片在线看| 国产偷v国产偷v亚洲高清| 亚洲福利视频一区| 夫妻av一区二区| 91精品国产综合久久精品麻豆| 国产蜜臀av在线一区二区三区| 午夜精品一区二区三区电影天堂 | 久久久精品人体av艺术| 一区二区三区在线免费观看| 精久久久久久久久久久| 在线精品视频一区二区三四| 欧美精品一区二区三| 亚洲午夜免费福利视频| 成人午夜视频网站| 欧美一级久久久| 亚洲一区二区三区中文字幕在线| 国产在线精品免费av| 欧美精品第1页| 一区二区三区日韩欧美精品| 国产91清纯白嫩初高中在线观看| 91精品婷婷国产综合久久竹菊| 亚洲欧洲精品一区二区三区 | 精品国产91亚洲一区二区三区婷婷| 国产精品久久三| 国产精品综合二区| 欧美电视剧在线观看完整版| 午夜欧美大尺度福利影院在线看| av中文字幕不卡| 国产精品人人做人人爽人人添| 久久97超碰国产精品超碰| 欧美一级久久久| 男男gaygay亚洲| 欧美人与禽zozo性伦| 亚洲精品高清在线观看| 91毛片在线观看| 自拍偷拍欧美精品| 99麻豆久久久国产精品免费| 国产亚洲女人久久久久毛片| 国产一区欧美日韩| 国产欧美视频一区二区三区| 国产精品一区二区久久不卡 | 国产精品一区在线观看乱码| 欧美不卡在线视频|