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

Macros

#define kEmptyHashValue   0
 
#define kMaxValForNormalize   ((uint32_t)0xFFFFFFFF)
 
#define kNormalizeStepMin   (1 << 10) /* it must be power of 2 */
 
#define kNormalizeMask   (~(uint32_t)(kNormalizeStepMin - 1))
 
#define LzFindkMaxHistorySize   ((uint32_t)7 << 29)
 
#define kStartMaxLen   3
 
#define kCrcPoly   0xEDB88320
 
#define MOVE_POS
 
#define MOVE_POS_RET   MOVE_POS return offset;
 
#define GET_MATCHES_HEADER2(minLen, ret_op)
 
#define GET_MATCHES_HEADER(minLen)   GET_MATCHES_HEADER2(minLen, return 0)
 
#define SKIP_HEADER(minLen)   GET_MATCHES_HEADER2(minLen, continue)
 
#define MF_PARAMS(p)   p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue
 
#define GET_MATCHES_FOOTER(offset, maxLen)
 
#define SKIP_FOOTER   SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); MOVE_POS;
 
#define UPDATE_maxLen
 

Functions

static void LzInWindow_Free (CMatchFinder *p, ISzAlloc *alloc)
 
static int LzInWindow_Create (CMatchFinder *p, uint32_t keepSizeReserv, ISzAlloc *alloc)
 
unsigned char * MatchFinder_GetPointerToCurrentPos (CMatchFinder *p)
 
uint32_t MatchFinder_GetNumAvailableBytes (CMatchFinder *p)
 
void MatchFinder_ReduceOffsets (CMatchFinder *p, uint32_t subValue)
 
static void MatchFinder_ReadBlock (CMatchFinder *p)
 
void MatchFinder_MoveBlock (CMatchFinder *p)
 
int MatchFinder_NeedMove (CMatchFinder *p)
 
void MatchFinder_ReadIfRequired (CMatchFinder *p)
 
static void MatchFinder_CheckAndMoveAndRead (CMatchFinder *p)
 
static void MatchFinder_SetDefaultSettings (CMatchFinder *p)
 
void MatchFinder_Construct (CMatchFinder *p)
 
static void MatchFinder_FreeThisClassMemory (CMatchFinder *p, ISzAlloc *alloc)
 
void MatchFinder_Free (CMatchFinder *p, ISzAlloc *alloc)
 
static CLzRefAllocRefs (size_t num, ISzAlloc *alloc)
 
int MatchFinder_Create (CMatchFinder *p, uint32_t historySize, uint32_t keepAddBufferBefore, uint32_t matchMaxLen, uint32_t keepAddBufferAfter, ISzAlloc *alloc)
 
static void MatchFinder_SetLimits (CMatchFinder *p)
 
void MatchFinder_Init_2 (CMatchFinder *p, int readData)
 
void MatchFinder_Init (CMatchFinder *p)
 
static uint32_t MatchFinder_GetSubValue (CMatchFinder *p)
 
void MatchFinder_Normalize3 (uint32_t subValue, CLzRef *items, size_t numItems)
 
static void MatchFinder_Normalize (CMatchFinder *p)
 
static void MatchFinder_CheckLimits (CMatchFinder *p)
 
static uint32_tHc_GetMatchesSpec (uint32_t lenLimit, uint32_t curMatch, uint32_t pos, const unsigned char *cur, CLzRef *son, uint32_t _cyclicBufferPos, uint32_t _cyclicBufferSize, uint32_t cutValue, uint32_t *distances, uint32_t maxLen)
 
uint32_tGetMatchesSpec1 (uint32_t lenLimit, uint32_t curMatch, uint32_t pos, const unsigned char *cur, CLzRef *son, uint32_t _cyclicBufferPos, uint32_t _cyclicBufferSize, uint32_t cutValue, uint32_t *distances, uint32_t maxLen)
 
static void SkipMatchesSpec (uint32_t lenLimit, uint32_t curMatch, uint32_t pos, const unsigned char *cur, CLzRef *son, uint32_t _cyclicBufferPos, uint32_t _cyclicBufferSize, uint32_t cutValue)
 
static void MatchFinder_MovePos (CMatchFinder *p)
 
static uint32_t Bt2_MatchFinder_GetMatches (CMatchFinder *p, uint32_t *distances)
 
uint32_t Bt3Zip_MatchFinder_GetMatches (CMatchFinder *p, uint32_t *distances)
 
static uint32_t Bt3_MatchFinder_GetMatches (CMatchFinder *p, uint32_t *distances)
 
static uint32_t Bt4_MatchFinder_GetMatches (CMatchFinder *p, uint32_t *distances)
 
static uint32_t Hc4_MatchFinder_GetMatches (CMatchFinder *p, uint32_t *distances)
 
uint32_t Hc3Zip_MatchFinder_GetMatches (CMatchFinder *p, uint32_t *distances)
 
static void Bt2_MatchFinder_Skip (CMatchFinder *p, uint32_t num)
 
void Bt3Zip_MatchFinder_Skip (CMatchFinder *p, uint32_t num)
 
static void Bt3_MatchFinder_Skip (CMatchFinder *p, uint32_t num)
 
static void Bt4_MatchFinder_Skip (CMatchFinder *p, uint32_t num)
 
static void Hc4_MatchFinder_Skip (CMatchFinder *p, uint32_t num)
 
void Hc3Zip_MatchFinder_Skip (CMatchFinder *p, uint32_t num)
 
void MatchFinder_CreateVTable (CMatchFinder *p, IMatchFinder *vTable)
 

Macro Definition Documentation

◆ GET_MATCHES_FOOTER

#define GET_MATCHES_FOOTER (   offset,
  maxLen 
)
Value:
offset = (uint32_t)(GetMatchesSpec1(lenLimit, curMatch, MF_PARAMS(p), \
distances + offset, maxLen) - distances); MOVE_POS_RET;
uint32_t * GetMatchesSpec1(uint32_t lenLimit, uint32_t curMatch, uint32_t pos, const unsigned char *cur, CLzRef *son, uint32_t _cyclicBufferPos, uint32_t _cyclicBufferSize, uint32_t cutValue, uint32_t *distances, uint32_t maxLen)
Definition: LzFind.c:388
GLfloat GLfloat p
Definition: glext.h:9809
#define MOVE_POS_RET
Definition: LzFind.c:498
#define MF_PARAMS(p)
Definition: LzFind.c:510
GLintptr offset
Definition: glext.h:6560
unsigned int uint32_t
Definition: stdint.h:126

◆ GET_MATCHES_HEADER

#define GET_MATCHES_HEADER (   minLen)    GET_MATCHES_HEADER2(minLen, return 0)

◆ GET_MATCHES_HEADER2

#define GET_MATCHES_HEADER2 (   minLen,
  ret_op 
)
Value:
uint32_t lenLimit; uint32_t hv; const unsigned char *cur; uint32_t curMatch; \
lenLimit = p->lenLimit; { if (lenLimit < minLen) { MatchFinder_MovePos(p); ret_op; }} \
cur = p->buffer;
static overlayled_t * cur
Definition: led_overlay.c:18
GLfloat GLfloat p
Definition: glext.h:9809
static void MatchFinder_MovePos(CMatchFinder *p)
Definition: LzFind.c:500
unsigned int uint32_t
Definition: stdint.h:126

◆ kCrcPoly

#define kCrcPoly   0xEDB88320

◆ kEmptyHashValue

#define kEmptyHashValue   0

◆ kMaxValForNormalize

#define kMaxValForNormalize   ((uint32_t)0xFFFFFFFF)

◆ kNormalizeMask

#define kNormalizeMask   (~(uint32_t)(kNormalizeStepMin - 1))

◆ kNormalizeStepMin

#define kNormalizeStepMin   (1 << 10) /* it must be power of 2 */

◆ kStartMaxLen

#define kStartMaxLen   3

◆ LzFindkMaxHistorySize

#define LzFindkMaxHistorySize   ((uint32_t)7 << 29)

◆ MF_PARAMS

#define MF_PARAMS (   p)    p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue

◆ MOVE_POS

#define MOVE_POS
Value:
++p->cyclicBufferPos; \
p->buffer++; \
if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p);
GLfloat GLfloat p
Definition: glext.h:9809
static void MatchFinder_CheckLimits(CMatchFinder *p)
Definition: LzFind.c:346

◆ MOVE_POS_RET

#define MOVE_POS_RET   MOVE_POS return offset;

◆ SKIP_FOOTER

#define SKIP_FOOTER   SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); MOVE_POS;

◆ SKIP_HEADER

#define SKIP_HEADER (   minLen)    GET_MATCHES_HEADER2(minLen, continue)

◆ UPDATE_maxLen

#define UPDATE_maxLen
Value:
{ \
ptrdiff_t diff = (ptrdiff_t)0 - d2; \
const unsigned char *c = cur + maxLen; \
const unsigned char *lim = cur + lenLimit; \
for (; c != lim; c++) if (*(c + diff) != *c) break; \
maxLen = (uint32_t)(c - cur); }
static overlayled_t * cur
Definition: led_overlay.c:18
const GLubyte * c
Definition: glext.h:9812
unsigned int uint32_t
Definition: stdint.h:126

Function Documentation

◆ AllocRefs()

static CLzRef* AllocRefs ( size_t  num,
ISzAlloc alloc 
)
static
Here is the caller graph for this function:

◆ Bt2_MatchFinder_GetMatches()

static uint32_t Bt2_MatchFinder_GetMatches ( CMatchFinder p,
uint32_t distances 
)
static
Here is the caller graph for this function:

◆ Bt2_MatchFinder_Skip()

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

◆ Bt3_MatchFinder_GetMatches()

static uint32_t Bt3_MatchFinder_GetMatches ( CMatchFinder p,
uint32_t distances 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Bt3_MatchFinder_Skip()

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

◆ Bt3Zip_MatchFinder_GetMatches()

uint32_t Bt3Zip_MatchFinder_GetMatches ( CMatchFinder p,
uint32_t distances 
)

◆ Bt3Zip_MatchFinder_Skip()

void Bt3Zip_MatchFinder_Skip ( CMatchFinder p,
uint32_t  num 
)

◆ Bt4_MatchFinder_GetMatches()

static uint32_t Bt4_MatchFinder_GetMatches ( CMatchFinder p,
uint32_t distances 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Bt4_MatchFinder_Skip()

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

◆ GetMatchesSpec1()

uint32_t* GetMatchesSpec1 ( uint32_t  lenLimit,
uint32_t  curMatch,
uint32_t  pos,
const unsigned char *  cur,
CLzRef son,
uint32_t  _cyclicBufferPos,
uint32_t  _cyclicBufferSize,
uint32_t  cutValue,
uint32_t distances,
uint32_t  maxLen 
)

◆ Hc3Zip_MatchFinder_GetMatches()

uint32_t Hc3Zip_MatchFinder_GetMatches ( CMatchFinder p,
uint32_t distances 
)
Here is the call graph for this function:

◆ Hc3Zip_MatchFinder_Skip()

void Hc3Zip_MatchFinder_Skip ( CMatchFinder p,
uint32_t  num 
)

◆ Hc4_MatchFinder_GetMatches()

static uint32_t Hc4_MatchFinder_GetMatches ( CMatchFinder p,
uint32_t distances 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Hc4_MatchFinder_Skip()

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

◆ Hc_GetMatchesSpec()

static uint32_t* Hc_GetMatchesSpec ( uint32_t  lenLimit,
uint32_t  curMatch,
uint32_t  pos,
const unsigned char *  cur,
CLzRef son,
uint32_t  _cyclicBufferPos,
uint32_t  _cyclicBufferSize,
uint32_t  cutValue,
uint32_t distances,
uint32_t  maxLen 
)
static
Here is the caller graph for this function:

◆ LzInWindow_Create()

static int LzInWindow_Create ( CMatchFinder p,
uint32_t  keepSizeReserv,
ISzAlloc alloc 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LzInWindow_Free()

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

◆ MatchFinder_CheckAndMoveAndRead()

static void MatchFinder_CheckAndMoveAndRead ( CMatchFinder p)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MatchFinder_CheckLimits()

static void MatchFinder_CheckLimits ( CMatchFinder p)
static
Here is the call graph for this function:

◆ MatchFinder_Construct()

void MatchFinder_Construct ( CMatchFinder p)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MatchFinder_Create()

int MatchFinder_Create ( CMatchFinder p,
uint32_t  historySize,
uint32_t  keepAddBufferBefore,
uint32_t  matchMaxLen,
uint32_t  keepAddBufferAfter,
ISzAlloc alloc 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MatchFinder_CreateVTable()

void MatchFinder_CreateVTable ( CMatchFinder p,
IMatchFinder vTable 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MatchFinder_Free()

void MatchFinder_Free ( CMatchFinder p,
ISzAlloc alloc 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MatchFinder_FreeThisClassMemory()

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

◆ MatchFinder_GetNumAvailableBytes()

uint32_t MatchFinder_GetNumAvailableBytes ( CMatchFinder p)
Here is the caller graph for this function:

◆ MatchFinder_GetPointerToCurrentPos()

unsigned char* MatchFinder_GetPointerToCurrentPos ( CMatchFinder p)
Here is the caller graph for this function:

◆ MatchFinder_GetSubValue()

static uint32_t MatchFinder_GetSubValue ( CMatchFinder p)
static
Here is the caller graph for this function:

◆ MatchFinder_Init()

void MatchFinder_Init ( CMatchFinder p)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MatchFinder_Init_2()

void MatchFinder_Init_2 ( CMatchFinder p,
int  readData 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MatchFinder_MoveBlock()

void MatchFinder_MoveBlock ( CMatchFinder p)
Here is the caller graph for this function:

◆ MatchFinder_MovePos()

static void MatchFinder_MovePos ( CMatchFinder p)
static

◆ MatchFinder_NeedMove()

int MatchFinder_NeedMove ( CMatchFinder p)
Here is the caller graph for this function:

◆ MatchFinder_Normalize()

static void MatchFinder_Normalize ( CMatchFinder p)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MatchFinder_Normalize3()

void MatchFinder_Normalize3 ( uint32_t  subValue,
CLzRef items,
size_t  numItems 
)
Here is the caller graph for this function:

◆ MatchFinder_ReadBlock()

static void MatchFinder_ReadBlock ( CMatchFinder p)
static
Here is the caller graph for this function:

◆ MatchFinder_ReadIfRequired()

void MatchFinder_ReadIfRequired ( CMatchFinder p)
Here is the call graph for this function:

◆ MatchFinder_ReduceOffsets()

void MatchFinder_ReduceOffsets ( CMatchFinder p,
uint32_t  subValue 
)
Here is the caller graph for this function:

◆ MatchFinder_SetDefaultSettings()

static void MatchFinder_SetDefaultSettings ( CMatchFinder p)
static
Here is the caller graph for this function:

◆ MatchFinder_SetLimits()

static void MatchFinder_SetLimits ( CMatchFinder p)
static
Here is the caller graph for this function:

◆ SkipMatchesSpec()

static void SkipMatchesSpec ( uint32_t  lenLimit,
uint32_t  curMatch,
uint32_t  pos,
const unsigned char *  cur,
CLzRef son,
uint32_t  _cyclicBufferPos,
uint32_t  _cyclicBufferSize,
uint32_t  cutValue 
)
static
Here is the caller graph for this function: