Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Model.cpp File Reference

#include <string.h>
#include "PPMd.h"
#include "Coder.h"
#include "SubAlloc.h"
#include "CSource.h"

Include dependency graph for Model.cpp:

Go to the source code of this file.

Defines

#define P_CALL(F)
#define GET_MEAN(SUMM, SHIFT, ROUND)   ((SUMM+(1 << (SHIFT-ROUND))) >> (SHIFT))

Enumerations

enum  {
  UP_FREQ = 5, INT_BITS = 7, PERIOD_BITS = 7, TOT_BITS = INT_BITS+PERIOD_BITS,
  INTERVAL = 1 << INT_BITS, BIN_SCALE = 1 << TOT_BITS, MAX_FREQ = 124, O_BOUND = 9
}

Functions

void SWAP (PPM_CONTEXT::STATE &s1, PPM_CONTEXT::STATE &s2)
void StateCpy (PPM_CONTEXT::STATE &s1, const PPM_CONTEXT::STATE &s2)
static void _STDCALL StartModelRare (int MaxOrder, MR_METHOD MRMethod)
static void RestoreModelRare (PPM_CONTEXT *pc1, PPM_CONTEXT *MinContext, PPM_CONTEXT *FSuccessor)
static PPM_CONTEXT *_FASTCALL CreateSuccessors (BOOL Skip, PPM_CONTEXT::STATE *p, PPM_CONTEXT *pc)
static PPM_CONTEXT *_FASTCALL ReduceOrder (PPM_CONTEXT::STATE *p, PPM_CONTEXT *pc)
static void UpdateModel (PPM_CONTEXT *MinContext)
void ClearMask (CInfo *EncodedFile, CInfo *DecodedFile)
void _STDCALL EncodeFile (CSink *EncodedFile, CSource *DecodedFile, int MaxOrder, MR_METHOD MRMethod)
void _STDCALL DecodeFile (CSink *DecodedFile, CSource *EncodedFile, int MaxOrder, MR_METHOD MRMethod)
size_t UnPPM (bool extra, unsigned char *readbuffer, size_t reclen, unsigned char *buffer, size_t buffersize)
size_t PluckerDecompress3 (unsigned char *a, size_t b, unsigned char *c, size_t d)
size_t PluckerDecompress4 (unsigned char *a, size_t b, unsigned char *c, size_t d)
size_t RebDecompress (unsigned char *a, size_t b, unsigned char *c, size_t d)

Variables

static struct SEE2_CONTEXT SEE2Cont [24][32]
static struct SEE2_CONTEXT DummySEE2Cont [24][32]
static struct PPM_CONTEXTMaxContext
static BYTE NS2BSIndx [256]
static BYTE QTable [260]
static PPM_CONTEXT::STATEFoundState
static int InitEsc
static int OrderFall
static int RunLength
static int InitRL
static int MaxOrder
static BYTE CharMask [256]
static BYTE NumMasked
static BYTE PrevSuccess
static BYTE EscCount
static BYTE PrintCount
static WORD BinSumm [25][64]
static MR_METHOD MRMethod
PPMD_STARTUP PPMd_StartUp
static const BYTE ExpEscape [16] = { 25,14, 9, 7, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 2 }


Define Documentation

#define GET_MEAN SUMM,
SHIFT,
ROUND   )     ((SUMM+(1 << (SHIFT-ROUND))) >> (SHIFT))
 

Definition at line 440 of file Model.cpp.

Referenced by PPM_CONTEXT::decodeBinSymbol(), and PPM_CONTEXT::encodeBinSymbol().

#define P_CALL  ) 
 

Value:

( PrefetchData(p->Successor), \
                    p->Successor=p->Successor->F(Order+1))

Definition at line 148 of file Model.cpp.

Referenced by PPM_CONTEXT::cutOff(), and PPM_CONTEXT::removeBinConts().


Enumeration Type Documentation

anonymous enum
 

Enumeration values:
UP_FREQ 
INT_BITS 
PERIOD_BITS 
TOT_BITS 
INTERVAL 
BIN_SCALE 
MAX_FREQ 
O_BOUND 

Definition at line 13 of file Model.cpp.


Function Documentation

void ClearMask CInfo EncodedFile,
CInfo DecodedFile
[inline]
 

Definition at line 602 of file Model.cpp.

References CharMask, and EscCount.

Referenced by DecodeFile(), and EncodeFile().

static PPM_CONTEXT *_FASTCALL CreateSuccessors BOOL  Skip,
PPM_CONTEXT::STATE p,
PPM_CONTEXT pc
[static]
 

Definition at line 316 of file Model.cpp.

References AllocContext(), PPM_CONTEXT::Flags, PPM_CONTEXT::STATE::Freq, MAX_FREQ, MAX_O, NULL, PPM_CONTEXT::NumStats, PPM_CONTEXT::oneState(), PPM_CONTEXT::Stats, PPM_CONTEXT::STATE::Successor, PPM_CONTEXT::Suffix, PPM_CONTEXT::SummFreq, and PPM_CONTEXT::STATE::Symbol.

Referenced by ReduceOrder(), and UpdateModel().

void _STDCALL DecodeFile CSink DecodedFile,
CSource EncodedFile,
int  MaxOrder,
MR_METHOD  MRMethod
 

Definition at line 638 of file Model.cpp.

References _PPMD_D_PUTC, ARI_DEC_NORMALIZE, ARI_INIT_DECODER, ariRemoveSubrange(), ClearMask(), PPM_CONTEXT::decodeBinSymbol(), PPM_CONTEXT::decodeSymbol1(), PPM_CONTEXT::decodeSymbol2(), EscCount, MaxContext, ns, NumMasked, PPM_CONTEXT::NumStats, OrderFall, PrefetchData(), StartModelRare(), PPM_CONTEXT::STATE::Successor, PPM_CONTEXT::Suffix, PPM_CONTEXT::STATE::Symbol, UnitsStart, and UpdateModel().

Referenced by UnPPM().

void _STDCALL EncodeFile CSink EncodedFile,
CSource DecodedFile,
int  MaxOrder,
MR_METHOD  MRMethod
 

Definition at line 607 of file Model.cpp.

References _PPMD_E_GETC, ARI_ENC_NORMALIZE, ARI_FLUSH_ENCODER, ariEncodeSymbol(), ariInitEncoder(), ariShiftEncodeSymbol(), ClearMask(), PPM_CONTEXT::encodeBinSymbol(), PPM_CONTEXT::encodeSymbol1(), PPM_CONTEXT::encodeSymbol2(), EscCount, MaxContext, ns, NumMasked, PPM_CONTEXT::NumStats, OrderFall, PrefetchData(), StartModelRare(), PPM_CONTEXT::STATE::Successor, PPM_CONTEXT::Suffix, TOT_BITS, UnitsStart, and UpdateModel().

size_t PluckerDecompress3 unsigned char *  a,
size_t  b,
unsigned char *  c,
size_t  d
 

Definition at line 706 of file Model.cpp.

References UnPPM().

size_t PluckerDecompress4 unsigned char *  a,
size_t  b,
unsigned char *  c,
size_t  d
 

Definition at line 711 of file Model.cpp.

References UnPPM().

size_t RebDecompress unsigned char *  a,
size_t  b,
unsigned char *  c,
size_t  d
 

Definition at line 716 of file Model.cpp.

References UnPPM().

static PPM_CONTEXT* _FASTCALL ReduceOrder PPM_CONTEXT::STATE p,
PPM_CONTEXT pc
[static]
 

Definition at line 239 of file Model.cpp.

References CreateSuccessors(), FALSE, PPM_CONTEXT::STATE::Freq, HeapStart, MAX_FREQ, MAX_O, MaxContext, MRM_FREEZE, MRMethod, NULL, PPM_CONTEXT::NumStats, PPM_CONTEXT::oneState(), OrderFall, pText, PPM_CONTEXT::Stats, PPM_CONTEXT::STATE::Successor, PPM_CONTEXT::Suffix, PPM_CONTEXT::SummFreq, and PPM_CONTEXT::STATE::Symbol.

Referenced by UpdateModel().

static void RestoreModelRare PPM_CONTEXT pc1,
PPM_CONTEXT MinContext,
PPM_CONTEXT FSuccessor
[static]
 

Definition at line 202 of file Model.cpp.

References BList, PPM_CONTEXT::cutOff(), EscCount, ExpandTextArea(), FALSE, PPM_CONTEXT::Flags, GetUsedMemory(), GlueCount, HeapStart, MaxContext, MaxOrder, MRM_FREEZE, MRM_RESTART, MRMethod, PPM_CONTEXT::NumStats, PPM_CONTEXT::oneState(), OrderFall, p, PrintCount, pText, PPM_CONTEXT::refresh(), PPM_CONTEXT::removeBinConts(), SpecialFreeUnit(), BLK_NODE::Stamp, StartModelRare(), StateCpy(), PPM_CONTEXT::Stats, SubAllocatorSize, PPM_CONTEXT::Suffix, PPM_CONTEXT::SummFreq, PPM_CONTEXT::STATE::Symbol, and TRUE.

Referenced by UpdateModel().

static void _STDCALL StartModelRare int  MaxOrder,
MR_METHOD  MRMethod
[static]
 

Definition at line 99 of file Model.cpp.

References AllocContext(), AllocUnits(), BIN_SCALE, BinSumm, CharMask, EscCount, PPM_CONTEXT::STATE::Freq, i, SEE2_CONTEXT::init(), InitRL, InitSubAllocator(), MaxContext, MaxOrder, MRMethod, NULL, PPM_CONTEXT::NumStats, OrderFall, PrevSuccess, PrintCount, QTable, RunLength, SEE2Cont, PPM_CONTEXT::Stats, PPM_CONTEXT::STATE::Successor, PPM_CONTEXT::Suffix, PPM_CONTEXT::SummFreq, PPM_CONTEXT::STATE::Symbol, and WORD.

Referenced by DecodeFile(), EncodeFile(), and RestoreModelRare().

void StateCpy PPM_CONTEXT::STATE s1,
const PPM_CONTEXT::STATE s2
[inline]
 

Definition at line 74 of file Model.cpp.

Referenced by PPM_CONTEXT::cutOff(), PPM_CONTEXT::rescale(), RestoreModelRare(), and UpdateModel().

void SWAP PPM_CONTEXT::STATE s1,
PPM_CONTEXT::STATE s2
[inline]
 

Definition at line 63 of file Model.cpp.

References t.

Referenced by PPM_CONTEXT::cutOff(), PPM_CONTEXT::rescale(), PPM_CONTEXT::update1(), and UpdateModel().

size_t UnPPM bool  extra,
unsigned char *  readbuffer,
size_t  reclen,
unsigned char *  buffer,
size_t  buffersize
 

Definition at line 674 of file Model.cpp.

References DecodeFile(), CMemSink::size(), StartSubAllocator(), StopSubAllocator(), and type.

Referenced by PluckerDecompress3(), PluckerDecompress4(), and RebDecompress().

static void UpdateModel PPM_CONTEXT MinContext  )  [inline, static]
 

Definition at line 367 of file Model.cpp.

References AllocUnits(), CreateSuccessors(), ExpandUnits(), FALSE, PPM_CONTEXT::Flags, PPM_CONTEXT::STATE::Freq, HeapStart, InitEsc, MAX_FREQ, MaxContext, MRM_FREEZE, MRMethod, ns, NULL, PPM_CONTEXT::NumStats, PPM_CONTEXT::oneState(), OrderFall, p, pText, ReduceOrder(), RestoreModelRare(), StateCpy(), PPM_CONTEXT::Stats, PPM_CONTEXT::STATE::Successor, PPM_CONTEXT::Suffix, PPM_CONTEXT::SummFreq, SWAP(), PPM_CONTEXT::STATE::Symbol, TRUE, and UnitsStart.

Referenced by DecodeFile(), and EncodeFile().


Variable Documentation

WORD BinSumm[25][64] [static]
 

Definition at line 60 of file Model.cpp.

Referenced by PPM_CONTEXT::decodeBinSymbol(), PPM_CONTEXT::encodeBinSymbol(), and StartModelRare().

BYTE CharMask[256] [static]
 

Definition at line 59 of file Model.cpp.

Referenced by ClearMask(), PPM_CONTEXT::decodeBinSymbol(), PPM_CONTEXT::decodeSymbol1(), PPM_CONTEXT::decodeSymbol2(), PPM_CONTEXT::encodeBinSymbol(), PPM_CONTEXT::encodeSymbol1(), PPM_CONTEXT::encodeSymbol2(), and StartModelRare().

struct SEE2_CONTEXT DummySEE2Cont[24][32] [static]
 

Referenced by PPM_CONTEXT::makeEscFreq2(), and PPMD_STARTUP::PPMD_STARTUP().

BYTE EscCount [static]
 

Definition at line 59 of file Model.cpp.

Referenced by ClearMask(), PPM_CONTEXT::decodeBinSymbol(), DecodeFile(), PPM_CONTEXT::decodeSymbol1(), PPM_CONTEXT::decodeSymbol2(), PPM_CONTEXT::encodeBinSymbol(), EncodeFile(), PPM_CONTEXT::encodeSymbol1(), PPM_CONTEXT::encodeSymbol2(), RestoreModelRare(), StartModelRare(), and PPM_CONTEXT::update2().

const BYTE ExpEscape[16] = { 25,14, 9, 7, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 2 } [static]
 

Definition at line 439 of file Model.cpp.

Referenced by PPM_CONTEXT::decodeBinSymbol(), and PPM_CONTEXT::encodeBinSymbol().

PPM_CONTEXT::STATE* FoundState [static]
 

Definition at line 57 of file Model.cpp.

int InitEsc [static]
 

Definition at line 58 of file Model.cpp.

Referenced by PPM_CONTEXT::decodeBinSymbol(), PPM_CONTEXT::encodeBinSymbol(), and UpdateModel().

int InitRL [static]
 

Definition at line 58 of file Model.cpp.

Referenced by StartModelRare(), and PPM_CONTEXT::update2().

struct PPM_CONTEXT* MaxContext [static]
 

Referenced by DecodeFile(), EncodeFile(), ReduceOrder(), RestoreModelRare(), StartModelRare(), and UpdateModel().

int MaxOrder [static]
 

Definition at line 58 of file Model.cpp.

Referenced by PPM_CONTEXT::cutOff(), PPM_CONTEXT::removeBinConts(), RestoreModelRare(), and StartModelRare().

MR_METHOD MRMethod [static]
 

Definition at line 61 of file Model.cpp.

Referenced by ReduceOrder(), PPM_CONTEXT::rescale(), RestoreModelRare(), StartModelRare(), and UpdateModel().

BYTE NS2BSIndx[256] [static]
 

Definition at line 56 of file Model.cpp.

Referenced by PPM_CONTEXT::decodeBinSymbol(), PPM_CONTEXT::encodeBinSymbol(), and PPMD_STARTUP::PPMD_STARTUP().

BYTE NumMasked [static]
 

Definition at line 59 of file Model.cpp.

Referenced by PPM_CONTEXT::decodeBinSymbol(), DecodeFile(), PPM_CONTEXT::decodeSymbol1(), PPM_CONTEXT::decodeSymbol2(), PPM_CONTEXT::encodeBinSymbol(), EncodeFile(), PPM_CONTEXT::encodeSymbol1(), PPM_CONTEXT::encodeSymbol2(), and PPM_CONTEXT::makeEscFreq2().

int OrderFall [static]
 

Definition at line 58 of file Model.cpp.

Referenced by DecodeFile(), EncodeFile(), ReduceOrder(), PPM_CONTEXT::rescale(), RestoreModelRare(), StartModelRare(), and UpdateModel().

struct PPMD_STARTUP PPMd_StartUp
 

BYTE PrevSuccess [static]
 

Definition at line 59 of file Model.cpp.

Referenced by PPM_CONTEXT::decodeBinSymbol(), PPM_CONTEXT::decodeSymbol1(), PPM_CONTEXT::encodeBinSymbol(), PPM_CONTEXT::encodeSymbol1(), and StartModelRare().

BYTE PrintCount [static]
 

Definition at line 59 of file Model.cpp.

Referenced by RestoreModelRare(), and StartModelRare().

BYTE QTable[260] [static]
 

Definition at line 56 of file Model.cpp.

Referenced by PPM_CONTEXT::decodeBinSymbol(), PPM_CONTEXT::encodeBinSymbol(), PPM_CONTEXT::makeEscFreq2(), PPMD_STARTUP::PPMD_STARTUP(), PredictTabWidget::PredictTabWidget(), StartModelRare(), and Todo::TableView::TableView().

int RunLength [static]
 

Definition at line 58 of file Model.cpp.

Referenced by PPM_CONTEXT::decodeBinSymbol(), PPM_CONTEXT::decodeSymbol1(), PPM_CONTEXT::encodeBinSymbol(), PPM_CONTEXT::encodeSymbol1(), StartModelRare(), and PPM_CONTEXT::update2().

struct SEE2_CONTEXT SEE2Cont[24][32] [static]
 

Referenced by PPM_CONTEXT::makeEscFreq2(), and StartModelRare().


Generated on Sat Nov 5 16:49:44 2005 for OPIE by  doxygen 1.4.2