misc/libphysfs/lzma/CPP/7zip/Compress/LZMA_Alone/LzmaRam.h
changeset 12213 bb5522e88ab2
equal deleted inserted replaced
12212:ea891871f481 12213:bb5522e88ab2
       
     1 // LzmaRam.h
       
     2 
       
     3 #ifndef __LzmaRam_h
       
     4 #define __LzmaRam_h
       
     5 
       
     6 #include <stdlib.h>
       
     7 #include "../../../Common/Types.h"
       
     8 
       
     9 /*
       
    10 LzmaRamEncode: BCJ + LZMA RAM->RAM compressing.
       
    11 It uses .lzma format, but it writes one additional byte to .lzma file:
       
    12   0: - no filter
       
    13   1: - x86(BCJ) filter.
       
    14 
       
    15 To provide best compression ratio dictionarySize mustbe >= inSize
       
    16 
       
    17 LzmaRamEncode allocates Data with MyAlloc/BigAlloc functions.
       
    18 RAM Requirements:
       
    19   RamSize = dictionarySize * 9.5 + 6MB + FilterBlockSize 
       
    20     FilterBlockSize = 0, if useFilter == false
       
    21     FilterBlockSize = inSize, if useFilter == true
       
    22 
       
    23   Return code:
       
    24     0 - OK
       
    25     1 - Unspecified Error
       
    26     2 - Memory allocating error
       
    27     3 - Output buffer OVERFLOW
       
    28 
       
    29 If you use SZ_FILTER_AUTO mode, then encoder will use 2 or 3 passes:
       
    30   2 passes when FILTER_NO provides better compression.
       
    31   3 passes when FILTER_YES provides better compression.
       
    32 */
       
    33 
       
    34 enum ESzFilterMode 
       
    35 {
       
    36   SZ_FILTER_NO,
       
    37   SZ_FILTER_YES,
       
    38   SZ_FILTER_AUTO
       
    39 };
       
    40 
       
    41 int LzmaRamEncode(
       
    42     const Byte *inBuffer, size_t inSize, 
       
    43     Byte *outBuffer, size_t outSize, size_t *outSizeProcessed, 
       
    44     UInt32 dictionarySize, ESzFilterMode filterMode);
       
    45 
       
    46 #endif