vb@rchiv
VB Classic
VB.NET
ADO.NET
VBA
C#
TOP-Angebot: 17 bzw. 24 Entwickler-Vollversionen zum unschlagbaren Preis!  
 vb@rchiv Quick-Search: Suche startenErweiterte Suche starten   Impressum  | Datenschutz  | vb@rchiv CD Vol.6  | Shop Copyright ©2000-2024
 
zurück

 Sie sind aktuell nicht angemeldet.Funktionen: Einloggen  |  Neu registrieren  |  Suchen

Fortgeschrittene Programmierung
Re: Kennt jemand eine LZMA-Dll? 
Autor: luet
Datum: 18.02.10 07:49

Ich hab das hier gefunden.
Habe aber keine Ahnung, wie ich das umsetze??
Wer kann helfen?
thx
luet

Attribute VB_Name = "LZMA_Module"
'RAM requirements for LZMA:
'  for compression:   (dictSize * 11.5 + 6 MB) + state_size
'  for decompression: dictSize + state_size
'    state_size = (4 + (1.5 << (lc + lp))) KB
'    by default (lc=3, lp=0), state_size = 16 KB.
'
'LZMA properties (5 bytes) format
'    Offset Size  Description
'      0     1    lc, lp and pb in encoded form.
'      1     4    dictSize (little endian).
'½±°Ô  ÀÎÄÚµùÆû | »çÀü Å©±â (¸®Æ² ¿£µð¾È)
'      00         00 00 00 01
'*/
'
'/*
'LzmaCompress
'------------
'
'outPropsSize -
'     In:  the pointer to the size of outProps buffer; *outPropsSize = 
LZMA_PROPS_SIZE = 5.
'     Out: the pointer to the size of written properties in outProps buffer; 
*outPropsSize = LZMA_PROPS_SIZE = 5.
'
'  LZMA Encoder will use defult values for any parameter, if it is
'  -1  for any from: level, loc, lp, pb, fb, numThreads
'   0  for dictSize
'  algo = 0 means fast method
'  algo = 1 means normal method
'
'dictSize - The dictionary size in bytes. The maximum value is
'        128 MB = (1 << 27) bytes for 32-bit version
'          1 GB = (1 << 30) bytes for 64-bit version
'     The default value is 16 MB = (1 << 24) bytes.
'     It 's recommended to use the dictionary that is larger than 4 KB and
'     that can be calculated as (1 << N) or (3 << N) sizes.
'
'lc - The number of literal context bits (high bits of previous literal).
'     It can be in the range from 0 to 8. The default value is 3.
'     Sometimes lc=4 gives the gain for big files.
'
'lp - The number of literal pos bits (low bits of current position for 
literals).
'     It can be in the range from 0 to 4. The default value is 0.
'     The lp switch is intended for periodical data when the period is equal 
to 2^lp.
'     For example, for 32-bit (4 bytes) periodical data you can use lp=2. 
Often it's
'     better to set lc=0, if you change lp switch.
'
'pb - The number of pos bits (low bits of current position).
'     It can be in the range from 0 to 4. The default value is 2.
'     The pb switch is intended for periodical data when the period is equal 
2^pb.
'
'fb - Word size (the number of fast bytes).
'     It can be in the range from 5 to 273. The default value is 32.
'     Usually, a big number gives a little bit better compression ratio and
'     slower compression process.
'
'numThreads - The number of thereads. 1 or 2. The default value is 2.
'     Fast mode (algo = 0) can use only 1 thread.
 
Public Declare Function LzmaCompress Lib "LZMA.dll" (ByVal dest As Long, 
ByRef destLen As Long, ByVal src As Long, ByVal srcLen As Long, ByVal 
outProps As Long, ByRef outPropsSize As Long, _
  Optional ByVal level As Long = 5, _
  Optional ByVal dictSize As Long = 16777216, _
  Optional ByVal lc As Long = 3, _
  Optional ByVal lp As Long = 0, _
  Optional ByVal pb As Long = 2, _
  Optional ByVal fb As Long = 32, _
  Optional ByVal numThreads As Long = 2) As Long
 
Public Declare Function LzmaUncompress Lib "LZMA.dll" (ByVal dest As Long, 
ByRef destLen As Long, ByVal src As Long, ByRef srcLen As Long, ByVal 
outProps As Long, ByVal outPropsSize As Long) As Long
'outPropsSize=5
 
'/*
'LzmaUncompress
'--------------
'In:
'  dest     - output data
'  destLen  - output data size
'  src      - input data
'  srcLen   - input data size
'Out:
'  destLen  - processed output size
'  srcLen   - processed input size
'Returns:
'  SZ_OK -OK
'  SZ_ERROR_DATA        - Data error
'  SZ_ERROR_MEM         - Memory allocation arror
'  SZ_ERROR_UNSUPPORTED - Unsupported properties
'  SZ_ERROR_INPUT_EOF   - it needs more bytes in input buffer (src)
'*/
 
Public Function VB_LzmaCompress(ByRef dest() As Byte, ByRef src() As Byte, 
ByRef Props() As Byte, Optional ByVal level As Long = 5&, _
  Optional ByVal dictSize As Long = 16777216, _
  Optional ByVal lc As Long = 3&, _
  Optional ByVal lp As Long = 0&, _
  Optional ByVal pb As Long = 2&, _
  Optional ByVal fb As Long = 32&, _
  Optional ByVal numThreads As Long = 2&) As Long
Call LzmaCompress(VarPtr(dest(0)), VB_LzmaCompress, VarPtr(src(0)), 
UBound(src), VarPtr(Props(0)), 5&, level, dictSize, lc, lp, pb, fb, 
numThreads)
End Function
 
Public Function VB_LzmaUnCompress(ByRef dest() As Byte, ByRef src() As Byte, 
ByRef Props() As Byte) As Long
VB_LzmaUnCompress = LzmaUncompress(VarPtr(dest(0)), UBound(dest), 
VarPtr(src(0)), UBound(src), VarPtr(Props(0)), 5)
End Function
alle Nachrichten anzeigenGesamtübersicht  |  Zum Thema  |  Suchen

 ThemaViews  AutorDatum
Kennt jemand eine LZMA-Dll?4.003TBX12.01.10 12:17
Re: Kennt jemand eine LZMA-Dll?2.828ModeratorMartoeng18.01.10 14:15
Re: Kennt jemand eine LZMA-Dll?2.930TBX19.01.10 19:28
Re: Kennt jemand eine LZMA-Dll?2.828luet17.02.10 11:53
Re: Kennt jemand eine LZMA-Dll?2.904TBX17.02.10 19:27
Re: Kennt jemand eine LZMA-Dll?3.409luet18.02.10 07:49
Re: Kennt jemand eine LZMA-Dll?2.774TBX18.02.10 10:10
Re: Kennt jemand eine LZMA-Dll?2.731luet28.02.10 16:28
Re: Kennt jemand eine LZMA-Dll?2.673TBX01.03.10 09:58
Re: Kennt jemand eine LZMA-Dll?2.665luet03.03.10 19:50

Sie sind nicht angemeldet!
Um auf diesen Beitrag zu antworten oder neue Beiträge schreiben zu können, müssen Sie sich zunächst anmelden.

Einloggen  |  Neu registrieren

Funktionen:  Zum Thema  |  GesamtübersichtSuchen 

nach obenzurück
 
   

Copyright ©2000-2024 vb@rchiv Dieter Otter
Alle Rechte vorbehalten.
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein.

Diese Seiten wurden optimiert für eine Bildschirmauflösung von mind. 1280x1024 Pixel