RetroArch
Classes | Macros | Typedefs | Functions | Variables
LzmaEnc.c File Reference
#include <stdint.h>
#include <string.h>
#include <boolean.h>
#include "LzmaEnc.h"
#include "LzFind.h"
Include dependency graph for LzmaEnc.c:

Classes

struct  COptimal
 
struct  CLenEnc
 
struct  CLenPriceEnc
 
struct  CRangeEnc
 
struct  CSaveState
 
struct  CLzmaEnc
 
struct  CSeqOutStreamBuf
 

Macros

#define LzmaEnckMaxHistorySize   ((uint32_t)3 << 29)
 
#define kBlockSizeMax   ((1 << LZMA_NUM_BLOCK_SIZE_BITS) - 1)
 
#define kBlockSize   (9 << 10)
 
#define kUnpackBlockSize   (1 << 18)
 
#define kMatchArraySize   (1 << 21)
 
#define kMatchRecordMaxSize   ((LZMA_MATCH_LEN_MAX * 2 + 3) * LZMA_MATCH_LEN_MAX)
 
#define kNumMaxDirectBits   (31)
 
#define kNumTopBits   24
 
#define kTopValue   ((uint32_t)1 << kNumTopBits)
 
#define kNumBitModelTotalBits   11
 
#define kBitModelTotal   (1 << kNumBitModelTotalBits)
 
#define kNumMoveBits   5
 
#define kProbInitValue   (kBitModelTotal >> 1)
 
#define kNumMoveReducingBits   4
 
#define kNumBitPriceShiftBits   4
 
#define kBitPrice   (1 << kNumBitPriceShiftBits)
 
#define kNumLogBits   (9 + sizeof(size_t) / 2)
 
#define kDicLogSizeMaxCompress   ((kNumLogBits - 1) * 2 + 7)
 
#define BSR2_RET(pos, res)
 
#define GetPosSlot1(pos)   p->g_FastPos[pos]
 
#define GetPosSlot2(pos, res)   { BSR2_RET(pos, res); }
 
#define GetPosSlot(pos, res)   { if (pos < kNumFullDistances) res = p->g_FastPos[pos]; else BSR2_RET(pos, res); }
 
#define LZMA_NUM_REPS   4
 
#define kNumOpts   (1 << 12)
 
#define kNumLenToPosStates   4
 
#define kNumPosSlotBits   6
 
#define kDicLogSizeMin   0
 
#define kDicLogSizeMax   32
 
#define kDistTableSizeMax   (kDicLogSizeMax * 2)
 
#define kNumAlignBits   4
 
#define kAlignTableSize   (1 << kNumAlignBits)
 
#define kAlignMask   (kAlignTableSize - 1)
 
#define kStartPosModelIndex   4
 
#define kEndPosModelIndex   14
 
#define kNumPosModels   (kEndPosModelIndex - kStartPosModelIndex)
 
#define kNumFullDistances   (1 << (kEndPosModelIndex >> 1))
 
#define CLzmaProb   uint16_t
 
#define LZMA_PB_MAX   4
 
#define LZMA_LC_MAX   8
 
#define LZMA_LP_MAX   4
 
#define LZMA_NUM_PB_STATES_MAX   (1 << LZMA_PB_MAX)
 
#define kLenNumLowBits   3
 
#define kLenNumLowSymbols   (1 << kLenNumLowBits)
 
#define kLenNumMidBits   3
 
#define kLenNumMidSymbols   (1 << kLenNumMidBits)
 
#define kLenNumHighBits   8
 
#define kLenNumHighSymbols   (1 << kLenNumHighBits)
 
#define kLenNumSymbolsTotal   (kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols)
 
#define LZMA_MATCH_LEN_MIN   2
 
#define LZMA_MATCH_LEN_MAX   (LZMA_MATCH_LEN_MIN + kLenNumSymbolsTotal - 1)
 
#define kNumStates   12
 
#define IsCharState(s)   ((s) < 7)
 
#define GetLenToPosState(len)   (((len) < kNumLenToPosStates + 1) ? (len) - 2 : kNumLenToPosStates - 1)
 
#define kInfinityPrice   (1 << 30)
 
#define RangeEnc_GetProcessed(p)   ((p)->processed + ((p)->buf - (p)->bufBase) + (p)->cacheSize)
 
#define RC_BUF_SIZE   (1 << 16)
 
#define GET_PRICE(prob, symbol)   p->ProbPrices[((prob) ^ (((-(int)(symbol))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits];
 
#define GET_PRICEa(prob, symbol)   ProbPrices[((prob) ^ ((-((int)(symbol))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits];
 
#define GET_PRICE_0(prob)   p->ProbPrices[(prob) >> kNumMoveReducingBits]
 
#define GET_PRICE_1(prob)   p->ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits]
 
#define GET_PRICE_0a(prob)   ProbPrices[(prob) >> kNumMoveReducingBits]
 
#define GET_PRICE_1a(prob)   ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits]
 
#define MakeAsChar(p)   (p)->backPrev = (uint32_t)(-1); (p)->prev1IsChar = false;
 
#define MakeAsShortRep(p)   (p)->backPrev = 0; (p)->prev1IsChar = false;
 
#define IsShortRep(p)   ((p)->backPrev == 0)
 
#define LIT_PROBS(pos, prevByte)   (p->litProbs + ((((pos) & p->lpMask) << p->lc) + ((prevByte) >> (8 - p->lc))) * (uint32_t)0x300)
 
#define ChangePair(smallDist, bigDist)   (((bigDist) >> 7) > (smallDist))
 
#define kBigHashDicLimit   ((uint32_t)1 << 24)
 

Typedefs

typedef unsigned CState
 

Functions

void LzmaEncProps_Init (CLzmaEncProps *p)
 
void LzmaEncProps_Normalize (CLzmaEncProps *p)
 
uint32_t LzmaEncProps_GetDictSize (const CLzmaEncProps *props2)
 
static void LzmaEnc_FastPosInit (unsigned char *g_FastPos)
 
void LzmaEnc_SaveState (CLzmaEncHandle pp)
 
void LzmaEnc_RestoreState (CLzmaEncHandle pp)
 
SRes LzmaEnc_SetProps (CLzmaEncHandle pp, const CLzmaEncProps *props2)
 
static void RangeEnc_Construct (CRangeEnc *p)
 
static int RangeEnc_Alloc (CRangeEnc *p, ISzAlloc *alloc)
 
static void RangeEnc_Free (CRangeEnc *p, ISzAlloc *alloc)
 
static void RangeEnc_Init (CRangeEnc *p)
 
static void RangeEnc_FlushStream (CRangeEnc *p)
 
static void MY_FAST_CALL RangeEnc_ShiftLow (CRangeEnc *p)
 
static void RangeEnc_FlushData (CRangeEnc *p)
 
static void RangeEnc_EncodeDirectBits (CRangeEnc *p, uint32_t value, unsigned numBits)
 
static void RangeEnc_EncodeBit (CRangeEnc *p, CLzmaProb *prob, uint32_t symbol)
 
static void LitEnc_Encode (CRangeEnc *p, CLzmaProb *probs, uint32_t symbol)
 
static void LitEnc_EncodeMatched (CRangeEnc *p, CLzmaProb *probs, uint32_t symbol, uint32_t matchByte)
 
static void LzmaEnc_InitPriceTables (uint32_t *ProbPrices)
 
static uint32_t LitEnc_GetPrice (const CLzmaProb *probs, uint32_t symbol, const uint32_t *ProbPrices)
 
static uint32_t LitEnc_GetPriceMatched (const CLzmaProb *probs, uint32_t symbol, uint32_t matchByte, const uint32_t *ProbPrices)
 
static void RcTree_Encode (CRangeEnc *rc, CLzmaProb *probs, int numBitLevels, uint32_t symbol)
 
static void RcTree_ReverseEncode (CRangeEnc *rc, CLzmaProb *probs, int numBitLevels, uint32_t symbol)
 
static uint32_t RcTree_GetPrice (const CLzmaProb *probs, int numBitLevels, uint32_t symbol, const uint32_t *ProbPrices)
 
static uint32_t RcTree_ReverseGetPrice (const CLzmaProb *probs, int numBitLevels, uint32_t symbol, const uint32_t *ProbPrices)
 
static void LenEnc_Init (CLenEnc *p)
 
static void LenEnc_Encode (CLenEnc *p, CRangeEnc *rc, uint32_t symbol, uint32_t posState)
 
static void LenEnc_SetPrices (CLenEnc *p, uint32_t posState, uint32_t numSymbols, uint32_t *prices, const uint32_t *ProbPrices)
 
static void MY_FAST_CALL LenPriceEnc_UpdateTable (CLenPriceEnc *p, uint32_t posState, const uint32_t *ProbPrices)
 
static void LenPriceEnc_UpdateTables (CLenPriceEnc *p, uint32_t numPosStates, const uint32_t *ProbPrices)
 
static void LenEnc_Encode2 (CLenPriceEnc *p, CRangeEnc *rc, uint32_t symbol, uint32_t posState, bool updatePrice, const uint32_t *ProbPrices)
 
static void MovePos (CLzmaEnc *p, uint32_t num)
 
static uint32_t ReadMatchDistances (CLzmaEnc *p, uint32_t *numDistancePairsRes)
 
static uint32_t GetRepLen1Price (CLzmaEnc *p, uint32_t state, uint32_t posState)
 
static uint32_t GetPureRepPrice (CLzmaEnc *p, uint32_t repIndex, uint32_t state, uint32_t posState)
 
static uint32_t GetRepPrice (CLzmaEnc *p, uint32_t repIndex, uint32_t len, uint32_t state, uint32_t posState)
 
static uint32_t Backward (CLzmaEnc *p, uint32_t *backRes, uint32_t cur)
 
static uint32_t GetOptimum (CLzmaEnc *p, uint32_t position, uint32_t *backRes)
 
static uint32_t GetOptimumFast (CLzmaEnc *p, uint32_t *backRes)
 
static void WriteEndMarker (CLzmaEnc *p, uint32_t posState)
 
static SRes CheckErrors (CLzmaEnc *p)
 
static SRes Flush (CLzmaEnc *p, uint32_t nowPos)
 
static void FillAlignPrices (CLzmaEnc *p)
 
static void FillDistancesPrices (CLzmaEnc *p)
 
void LzmaEnc_Construct (CLzmaEnc *p)
 
CLzmaEncHandle LzmaEnc_Create (ISzAlloc *alloc)
 
void LzmaEnc_FreeLits (CLzmaEnc *p, ISzAlloc *alloc)
 
void LzmaEnc_Destruct (CLzmaEnc *p, ISzAlloc *alloc, ISzAlloc *allocBig)
 
void LzmaEnc_Destroy (CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig)
 
static SRes LzmaEnc_CodeOneBlock (CLzmaEnc *p, bool useLimits, uint32_t maxPackSize, uint32_t maxUnpackSize)
 
static SRes LzmaEnc_Alloc (CLzmaEnc *p, uint32_t keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig)
 
void LzmaEnc_Init (CLzmaEnc *p)
 
void LzmaEnc_InitPrices (CLzmaEnc *p)
 
static SRes LzmaEnc_AllocAndInit (CLzmaEnc *p, uint32_t keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig)
 
static SRes LzmaEnc_Prepare (CLzmaEncHandle pp, ISeqOutStream *outStream, ISeqInStream *inStream, ISzAlloc *alloc, ISzAlloc *allocBig)
 
SRes LzmaEnc_PrepareForLzma2 (CLzmaEncHandle pp, ISeqInStream *inStream, uint32_t keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig)
 
static void LzmaEnc_SetInputBuf (CLzmaEnc *p, const unsigned char *src, size_t srcLen)
 
SRes LzmaEnc_MemPrepare (CLzmaEncHandle pp, const unsigned char *src, size_t srcLen, uint32_t keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig)
 
void LzmaEnc_Finish (CLzmaEncHandle pp)
 
static size_t MyWrite (void *pp, const void *data, size_t size)
 
uint32_t LzmaEnc_GetNumAvailableBytes (CLzmaEncHandle pp)
 
const unsigned char * LzmaEnc_GetCurBuf (CLzmaEncHandle pp)
 
SRes LzmaEnc_CodeOneMemBlock (CLzmaEncHandle pp, bool reInit, unsigned char *dest, size_t *destLen, uint32_t desiredPackSize, uint32_t *unpackSize)
 
static SRes LzmaEnc_Encode2 (CLzmaEnc *p, ICompressProgress *progress)
 
SRes LzmaEnc_Encode (CLzmaEncHandle pp, ISeqOutStream *outStream, ISeqInStream *inStream, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig)
 
SRes LzmaEnc_WriteProperties (CLzmaEncHandle pp, unsigned char *props, size_t *size)
 
SRes LzmaEnc_MemEncode (CLzmaEncHandle pp, unsigned char *dest, size_t *destLen, const unsigned char *src, size_t srcLen, int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig)
 
SRes LzmaEncode (unsigned char *dest, size_t *destLen, const unsigned char *src, size_t srcLen, const CLzmaEncProps *props, unsigned char *propsEncoded, size_t *propsSize, int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig)
 

Variables

static const int kLiteralNextStates [kNumStates] = {0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5}
 
static const int kMatchNextStates [kNumStates] = {7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10}
 
static const int kRepNextStates [kNumStates] = {8, 8, 8, 8, 8, 8, 8, 11, 11, 11, 11, 11}
 
static const int kShortRepNextStates [kNumStates] = {9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11}
 

Macro Definition Documentation

◆ BSR2_RET

#define BSR2_RET (   pos,
  res 
)
Value:
{ uint32_t zz = (pos < (1 << (kNumLogBits + 6))) ? 6 : 6 + kNumLogBits - 1; \
res = p->g_FastPos[pos >> zz] + (zz * 2); }
#define kNumLogBits
Definition: LzmaEnc.c:91
GLfloat GLfloat p
Definition: glext.h:9809
unsigned int uint32_t
Definition: stdint.h:126

◆ ChangePair

#define ChangePair (   smallDist,
  bigDist 
)    (((bigDist) >> 7) > (smallDist))

◆ CLzmaProb

#define CLzmaProb   uint16_t

◆ GET_PRICE

#define GET_PRICE (   prob,
  symbol 
)    p->ProbPrices[((prob) ^ (((-(int)(symbol))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits];

◆ GET_PRICE_0

#define GET_PRICE_0 (   prob)    p->ProbPrices[(prob) >> kNumMoveReducingBits]

◆ GET_PRICE_0a

#define GET_PRICE_0a (   prob)    ProbPrices[(prob) >> kNumMoveReducingBits]

◆ GET_PRICE_1

#define GET_PRICE_1 (   prob)    p->ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits]

◆ GET_PRICE_1a

#define GET_PRICE_1a (   prob)    ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits]

◆ GET_PRICEa

#define GET_PRICEa (   prob,
  symbol 
)    ProbPrices[((prob) ^ ((-((int)(symbol))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits];

◆ GetLenToPosState

#define GetLenToPosState (   len)    (((len) < kNumLenToPosStates + 1) ? (len) - 2 : kNumLenToPosStates - 1)

◆ GetPosSlot

#define GetPosSlot (   pos,
  res 
)    { if (pos < kNumFullDistances) res = p->g_FastPos[pos]; else BSR2_RET(pos, res); }

◆ GetPosSlot1

#define GetPosSlot1 (   pos)    p->g_FastPos[pos]

◆ GetPosSlot2

#define GetPosSlot2 (   pos,
  res 
)    { BSR2_RET(pos, res); }

◆ IsCharState

#define IsCharState (   s)    ((s) < 7)

◆ IsShortRep

#define IsShortRep (   p)    ((p)->backPrev == 0)

◆ kAlignMask

#define kAlignMask   (kAlignTableSize - 1)

◆ kAlignTableSize

#define kAlignTableSize   (1 << kNumAlignBits)

◆ kBigHashDicLimit

#define kBigHashDicLimit   ((uint32_t)1 << 24)

◆ kBitModelTotal

#define kBitModelTotal   (1 << kNumBitModelTotalBits)

◆ kBitPrice

#define kBitPrice   (1 << kNumBitPriceShiftBits)

◆ kBlockSize

#define kBlockSize   (9 << 10)

◆ kBlockSizeMax

#define kBlockSizeMax   ((1 << LZMA_NUM_BLOCK_SIZE_BITS) - 1)

◆ kDicLogSizeMax

#define kDicLogSizeMax   32

◆ kDicLogSizeMaxCompress

#define kDicLogSizeMaxCompress   ((kNumLogBits - 1) * 2 + 7)

◆ kDicLogSizeMin

#define kDicLogSizeMin   0

◆ kDistTableSizeMax

#define kDistTableSizeMax   (kDicLogSizeMax * 2)

◆ kEndPosModelIndex

#define kEndPosModelIndex   14

◆ kInfinityPrice

#define kInfinityPrice   (1 << 30)

◆ kLenNumHighBits

#define kLenNumHighBits   8

◆ kLenNumHighSymbols

#define kLenNumHighSymbols   (1 << kLenNumHighBits)

◆ kLenNumLowBits

#define kLenNumLowBits   3

◆ kLenNumLowSymbols

#define kLenNumLowSymbols   (1 << kLenNumLowBits)

◆ kLenNumMidBits

#define kLenNumMidBits   3

◆ kLenNumMidSymbols

#define kLenNumMidSymbols   (1 << kLenNumMidBits)

◆ kLenNumSymbolsTotal

#define kLenNumSymbolsTotal   (kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols)

◆ kMatchArraySize

#define kMatchArraySize   (1 << 21)

◆ kMatchRecordMaxSize

#define kMatchRecordMaxSize   ((LZMA_MATCH_LEN_MAX * 2 + 3) * LZMA_MATCH_LEN_MAX)

◆ kNumAlignBits

#define kNumAlignBits   4

◆ kNumBitModelTotalBits

#define kNumBitModelTotalBits   11

◆ kNumBitPriceShiftBits

#define kNumBitPriceShiftBits   4

◆ kNumFullDistances

#define kNumFullDistances   (1 << (kEndPosModelIndex >> 1))

◆ kNumLenToPosStates

#define kNumLenToPosStates   4

◆ kNumLogBits

#define kNumLogBits   (9 + sizeof(size_t) / 2)

◆ kNumMaxDirectBits

#define kNumMaxDirectBits   (31)

◆ kNumMoveBits

#define kNumMoveBits   5

◆ kNumMoveReducingBits

#define kNumMoveReducingBits   4

◆ kNumOpts

#define kNumOpts   (1 << 12)

◆ kNumPosModels

#define kNumPosModels   (kEndPosModelIndex - kStartPosModelIndex)

◆ kNumPosSlotBits

#define kNumPosSlotBits   6

◆ kNumStates

#define kNumStates   12

◆ kNumTopBits

#define kNumTopBits   24

◆ kProbInitValue

#define kProbInitValue   (kBitModelTotal >> 1)

◆ kStartPosModelIndex

#define kStartPosModelIndex   4

◆ kTopValue

#define kTopValue   ((uint32_t)1 << kNumTopBits)

◆ kUnpackBlockSize

#define kUnpackBlockSize   (1 << 18)

◆ LIT_PROBS

#define LIT_PROBS (   pos,
  prevByte 
)    (p->litProbs + ((((pos) & p->lpMask) << p->lc) + ((prevByte) >> (8 - p->lc))) * (uint32_t)0x300)

◆ LZMA_LC_MAX

#define LZMA_LC_MAX   8

◆ LZMA_LP_MAX

#define LZMA_LP_MAX   4

◆ LZMA_MATCH_LEN_MAX

#define LZMA_MATCH_LEN_MAX   (LZMA_MATCH_LEN_MIN + kLenNumSymbolsTotal - 1)

◆ LZMA_MATCH_LEN_MIN

#define LZMA_MATCH_LEN_MIN   2

◆ LZMA_NUM_PB_STATES_MAX

#define LZMA_NUM_PB_STATES_MAX   (1 << LZMA_PB_MAX)

◆ LZMA_NUM_REPS

#define LZMA_NUM_REPS   4

◆ LZMA_PB_MAX

#define LZMA_PB_MAX   4

◆ LzmaEnckMaxHistorySize

#define LzmaEnckMaxHistorySize   ((uint32_t)3 << 29)

◆ MakeAsChar

#define MakeAsChar (   p)    (p)->backPrev = (uint32_t)(-1); (p)->prev1IsChar = false;

◆ MakeAsShortRep

#define MakeAsShortRep (   p)    (p)->backPrev = 0; (p)->prev1IsChar = false;

◆ RangeEnc_GetProcessed

#define RangeEnc_GetProcessed (   p)    ((p)->processed + ((p)->buf - (p)->bufBase) + (p)->cacheSize)

◆ RC_BUF_SIZE

#define RC_BUF_SIZE   (1 << 16)

Typedef Documentation

◆ CState

typedef unsigned CState

Function Documentation

◆ Backward()

static uint32_t Backward ( CLzmaEnc p,
uint32_t backRes,
uint32_t  cur 
)
static
Here is the caller graph for this function:

◆ CheckErrors()

static SRes CheckErrors ( CLzmaEnc p)
static
Here is the caller graph for this function:

◆ FillAlignPrices()

static void FillAlignPrices ( CLzmaEnc p)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FillDistancesPrices()

static void FillDistancesPrices ( CLzmaEnc p)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Flush()

static SRes Flush ( CLzmaEnc p,
uint32_t  nowPos 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetOptimum()

static uint32_t GetOptimum ( CLzmaEnc p,
uint32_t  position,
uint32_t backRes 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetOptimumFast()

static uint32_t GetOptimumFast ( CLzmaEnc p,
uint32_t backRes 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetPureRepPrice()

static uint32_t GetPureRepPrice ( CLzmaEnc p,
uint32_t  repIndex,
uint32_t  state,
uint32_t  posState 
)
static
Here is the caller graph for this function:

◆ GetRepLen1Price()

static uint32_t GetRepLen1Price ( CLzmaEnc p,
uint32_t  state,
uint32_t  posState 
)
static
Here is the caller graph for this function:

◆ GetRepPrice()

static uint32_t GetRepPrice ( CLzmaEnc p,
uint32_t  repIndex,
uint32_t  len,
uint32_t  state,
uint32_t  posState 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LenEnc_Encode()

static void LenEnc_Encode ( CLenEnc p,
CRangeEnc rc,
uint32_t  symbol,
uint32_t  posState 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LenEnc_Encode2()

static void LenEnc_Encode2 ( CLenPriceEnc p,
CRangeEnc rc,
uint32_t  symbol,
uint32_t  posState,
bool  updatePrice,
const uint32_t ProbPrices 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LenEnc_Init()

static void LenEnc_Init ( CLenEnc p)
static
Here is the caller graph for this function:

◆ LenEnc_SetPrices()

static void LenEnc_SetPrices ( CLenEnc p,
uint32_t  posState,
uint32_t  numSymbols,
uint32_t prices,
const uint32_t ProbPrices 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LenPriceEnc_UpdateTable()

static void MY_FAST_CALL LenPriceEnc_UpdateTable ( CLenPriceEnc p,
uint32_t  posState,
const uint32_t ProbPrices 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LenPriceEnc_UpdateTables()

static void LenPriceEnc_UpdateTables ( CLenPriceEnc p,
uint32_t  numPosStates,
const uint32_t ProbPrices 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LitEnc_Encode()

static void LitEnc_Encode ( CRangeEnc p,
CLzmaProb probs,
uint32_t  symbol 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LitEnc_EncodeMatched()

static void LitEnc_EncodeMatched ( CRangeEnc p,
CLzmaProb probs,
uint32_t  symbol,
uint32_t  matchByte 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LitEnc_GetPrice()

static uint32_t LitEnc_GetPrice ( const CLzmaProb probs,
uint32_t  symbol,
const uint32_t ProbPrices 
)
static
Here is the caller graph for this function:

◆ LitEnc_GetPriceMatched()

static uint32_t LitEnc_GetPriceMatched ( const CLzmaProb probs,
uint32_t  symbol,
uint32_t  matchByte,
const uint32_t ProbPrices 
)
static
Here is the caller graph for this function:

◆ LzmaEnc_Alloc()

static SRes LzmaEnc_Alloc ( CLzmaEnc p,
uint32_t  keepWindowSize,
ISzAlloc alloc,
ISzAlloc allocBig 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LzmaEnc_AllocAndInit()

static SRes LzmaEnc_AllocAndInit ( CLzmaEnc p,
uint32_t  keepWindowSize,
ISzAlloc alloc,
ISzAlloc allocBig 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LzmaEnc_CodeOneBlock()

static SRes LzmaEnc_CodeOneBlock ( CLzmaEnc p,
bool  useLimits,
uint32_t  maxPackSize,
uint32_t  maxUnpackSize 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LzmaEnc_CodeOneMemBlock()

SRes LzmaEnc_CodeOneMemBlock ( CLzmaEncHandle  pp,
bool  reInit,
unsigned char *  dest,
size_t *  destLen,
uint32_t  desiredPackSize,
uint32_t unpackSize 
)
Here is the call graph for this function:

◆ LzmaEnc_Construct()

void LzmaEnc_Construct ( CLzmaEnc p)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LzmaEnc_Create()

CLzmaEncHandle LzmaEnc_Create ( ISzAlloc alloc)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LzmaEnc_Destroy()

void LzmaEnc_Destroy ( CLzmaEncHandle  p,
ISzAlloc alloc,
ISzAlloc allocBig 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LzmaEnc_Destruct()

void LzmaEnc_Destruct ( CLzmaEnc p,
ISzAlloc alloc,
ISzAlloc allocBig 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LzmaEnc_Encode()

SRes LzmaEnc_Encode ( CLzmaEncHandle  pp,
ISeqOutStream outStream,
ISeqInStream inStream,
ICompressProgress progress,
ISzAlloc alloc,
ISzAlloc allocBig 
)
Here is the call graph for this function:

◆ LzmaEnc_Encode2()

static SRes LzmaEnc_Encode2 ( CLzmaEnc p,
ICompressProgress progress 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LzmaEnc_FastPosInit()

static void LzmaEnc_FastPosInit ( unsigned char *  g_FastPos)
static
Here is the caller graph for this function:

◆ LzmaEnc_Finish()

void LzmaEnc_Finish ( CLzmaEncHandle  pp)
Here is the caller graph for this function:

◆ LzmaEnc_FreeLits()

void LzmaEnc_FreeLits ( CLzmaEnc p,
ISzAlloc alloc 
)
Here is the caller graph for this function:

◆ LzmaEnc_GetCurBuf()

const unsigned char* LzmaEnc_GetCurBuf ( CLzmaEncHandle  pp)

◆ LzmaEnc_GetNumAvailableBytes()

uint32_t LzmaEnc_GetNumAvailableBytes ( CLzmaEncHandle  pp)

◆ LzmaEnc_Init()

void LzmaEnc_Init ( CLzmaEnc p)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LzmaEnc_InitPrices()

void LzmaEnc_InitPrices ( CLzmaEnc p)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LzmaEnc_InitPriceTables()

static void LzmaEnc_InitPriceTables ( uint32_t ProbPrices)
static
Here is the caller graph for this function:

◆ LzmaEnc_MemEncode()

SRes LzmaEnc_MemEncode ( CLzmaEncHandle  pp,
unsigned char *  dest,
size_t *  destLen,
const unsigned char *  src,
size_t  srcLen,
int  writeEndMark,
ICompressProgress progress,
ISzAlloc alloc,
ISzAlloc allocBig 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LzmaEnc_MemPrepare()

SRes LzmaEnc_MemPrepare ( CLzmaEncHandle  pp,
const unsigned char *  src,
size_t  srcLen,
uint32_t  keepWindowSize,
ISzAlloc alloc,
ISzAlloc allocBig 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LzmaEnc_Prepare()

static SRes LzmaEnc_Prepare ( CLzmaEncHandle  pp,
ISeqOutStream outStream,
ISeqInStream inStream,
ISzAlloc alloc,
ISzAlloc allocBig 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LzmaEnc_PrepareForLzma2()

SRes LzmaEnc_PrepareForLzma2 ( CLzmaEncHandle  pp,
ISeqInStream inStream,
uint32_t  keepWindowSize,
ISzAlloc alloc,
ISzAlloc allocBig 
)
Here is the call graph for this function:

◆ LzmaEnc_RestoreState()

void LzmaEnc_RestoreState ( CLzmaEncHandle  pp)
Here is the call graph for this function:

◆ LzmaEnc_SaveState()

void LzmaEnc_SaveState ( CLzmaEncHandle  pp)
Here is the call graph for this function:

◆ LzmaEnc_SetInputBuf()

static void LzmaEnc_SetInputBuf ( CLzmaEnc p,
const unsigned char *  src,
size_t  srcLen 
)
static
Here is the caller graph for this function:

◆ LzmaEnc_SetProps()

SRes LzmaEnc_SetProps ( CLzmaEncHandle  pp,
const CLzmaEncProps props2 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LzmaEnc_WriteProperties()

SRes LzmaEnc_WriteProperties ( CLzmaEncHandle  pp,
unsigned char *  props,
size_t *  size 
)
Here is the caller graph for this function:

◆ LzmaEncode()

SRes LzmaEncode ( unsigned char *  dest,
size_t *  destLen,
const unsigned char *  src,
size_t  srcLen,
const CLzmaEncProps props,
unsigned char *  propsEncoded,
size_t *  propsSize,
int  writeEndMark,
ICompressProgress progress,
ISzAlloc alloc,
ISzAlloc allocBig 
)
Here is the call graph for this function:

◆ LzmaEncProps_GetDictSize()

uint32_t LzmaEncProps_GetDictSize ( const CLzmaEncProps props2)
Here is the call graph for this function:

◆ LzmaEncProps_Init()

void LzmaEncProps_Init ( CLzmaEncProps p)
Here is the caller graph for this function:

◆ LzmaEncProps_Normalize()

void LzmaEncProps_Normalize ( CLzmaEncProps p)
Here is the caller graph for this function:

◆ MovePos()

static void MovePos ( CLzmaEnc p,
uint32_t  num 
)
static
Here is the caller graph for this function:

◆ MyWrite()

static size_t MyWrite ( void pp,
const void data,
size_t  size 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RangeEnc_Alloc()

static int RangeEnc_Alloc ( CRangeEnc p,
ISzAlloc alloc 
)
static
Here is the caller graph for this function:

◆ RangeEnc_Construct()

static void RangeEnc_Construct ( CRangeEnc p)
static
Here is the caller graph for this function:

◆ RangeEnc_EncodeBit()

static void RangeEnc_EncodeBit ( CRangeEnc p,
CLzmaProb prob,
uint32_t  symbol 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RangeEnc_EncodeDirectBits()

static void RangeEnc_EncodeDirectBits ( CRangeEnc p,
uint32_t  value,
unsigned  numBits 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RangeEnc_FlushData()

static void RangeEnc_FlushData ( CRangeEnc p)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RangeEnc_FlushStream()

static void RangeEnc_FlushStream ( CRangeEnc p)
static
Here is the caller graph for this function:

◆ RangeEnc_Free()

static void RangeEnc_Free ( CRangeEnc p,
ISzAlloc alloc 
)
static
Here is the caller graph for this function:

◆ RangeEnc_Init()

static void RangeEnc_Init ( CRangeEnc p)
static
Here is the caller graph for this function:

◆ RangeEnc_ShiftLow()

static void MY_FAST_CALL RangeEnc_ShiftLow ( CRangeEnc p)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RcTree_Encode()

static void RcTree_Encode ( CRangeEnc rc,
CLzmaProb probs,
int  numBitLevels,
uint32_t  symbol 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RcTree_GetPrice()

static uint32_t RcTree_GetPrice ( const CLzmaProb probs,
int  numBitLevels,
uint32_t  symbol,
const uint32_t ProbPrices 
)
static
Here is the caller graph for this function:

◆ RcTree_ReverseEncode()

static void RcTree_ReverseEncode ( CRangeEnc rc,
CLzmaProb probs,
int  numBitLevels,
uint32_t  symbol 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RcTree_ReverseGetPrice()

static uint32_t RcTree_ReverseGetPrice ( const CLzmaProb probs,
int  numBitLevels,
uint32_t  symbol,
const uint32_t ProbPrices 
)
static
Here is the caller graph for this function:

◆ ReadMatchDistances()

static uint32_t ReadMatchDistances ( CLzmaEnc p,
uint32_t numDistancePairsRes 
)
static
Here is the caller graph for this function:

◆ WriteEndMarker()

static void WriteEndMarker ( CLzmaEnc p,
uint32_t  posState 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ kLiteralNextStates

const int kLiteralNextStates[kNumStates] = {0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5}
static

◆ kMatchNextStates

const int kMatchNextStates[kNumStates] = {7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10}
static

◆ kRepNextStates

const int kRepNextStates[kNumStates] = {8, 8, 8, 8, 8, 8, 8, 11, 11, 11, 11, 11}
static

◆ kShortRepNextStates

const int kShortRepNextStates[kNumStates] = {9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11}
static