12#if defined(MY_CPU_SIZEOF_POINTER) && (MY_CPU_SIZEOF_POINTER == 4)
25#define PPMD_INT_BITS 7
26#define PPMD_PERIOD_BITS 7
27#define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
29#define PPMD_GET_MEAN_SPEC(summ, shift, round) (((summ) + (1 << ((shift) - (round)))) >> (shift))
30#define PPMD_GET_MEAN(summ) PPMD_GET_MEAN_SPEC((summ), PPMD_PERIOD_BITS, 2)
31#define PPMD_UPDATE_PROB_0(prob) ((prob) + (1 << PPMD_INT_BITS) - PPMD_GET_MEAN(prob))
32#define PPMD_UPDATE_PROB_1(prob) ((prob) - PPMD_GET_MEAN(prob))
37#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
38#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
51#define Ppmd_See_UPDATE(p) \
52 { if ((p)->Shift < PPMD_PERIOD_BITS && --(p)->Count == 0) \
53 { (p)->Summ = (UInt16)((p)->Summ << 1); \
54 (p)->Count = (Byte)(3 << (p)->Shift++); }}
105 #define Ppmd_Ref_Type(type) type *
106 #define Ppmd_GetRef(p, ptr) (ptr)
107 #define Ppmd_GetPtr(p, ptr) (ptr)
108 #define Ppmd_GetPtr_Type(p, ptr, note_type) (ptr)
112 #define Ppmd_Ref_Type(type) UInt32
113 #define Ppmd_GetRef(p, ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
114 #define Ppmd_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
115 #define Ppmd_GetPtr_Type(p, offs, type) ((type *)Ppmd_GetPtr(p, offs))
142 #define Ppmd_GET_SUCCESSOR(p) \
143 ( (CPpmd_Void_Ref) (((UInt32)(p)->Successor_0 << 16) | (p)->Successor_1) )
145 #define Ppmd_SET_SUCCESSOR(p, v) { \
146 (p)->Successor_0 = (UInt16)(((UInt32)(v) >> 16) ); \
147 (p)->Successor_1 = (UInt16)((UInt32)(v) ); }
151 #define Ppmd_GET_SUCCESSOR(p) \
152 ( (CPpmd_Void_Ref) ((p)->Successor_0 | ((UInt32)(p)->Successor_1 << 16)) )
154 #define Ppmd_SET_SUCCESSOR(p, v) { \
155 (p)->Successor_0 = (UInt16)((UInt32)(v) ); \
156 (p)->Successor_1 = (UInt16)(((UInt32)(v) >> 16) ); }
163#define PPMD_SetAllBitsIn256Bytes(p) \
164 { size_t z; for (z = 0; z < 256 / sizeof(p[0]); z += 8) { \
165 p[z+7] = p[z+6] = p[z+5] = p[z+4] = p[z+3] = p[z+2] = p[z+1] = p[z+0] = ~(size_t)0; }}
#define EXTERN_C_BEGIN
Definition 7zTypes.h:20
#define EXTERN_C_END
Definition 7zTypes.h:21
#define MY_CPU_pragma_pop
Definition CpuArch.h:321
#define MY_CPU_pragma_pack_push_1
Definition CpuArch.h:320
struct CPpmd_State4_ CPpmd_State4
#define Ppmd_Ref_Type(type)
Definition Ppmd.h:112
struct CPpmd_State2_ CPpmd_State2
UInt32 CPpmd_Void_Ref
Definition Ppmd.h:69
UInt32 CPpmd_State_Ref
Definition Ppmd.h:61
UInt32 CPpmd_Byte_Ref
Definition Ppmd.h:77
Byte Shift
Definition Ppmd.h:47
UInt16 Summ
Definition Ppmd.h:46
Byte Count
Definition Ppmd.h:48
Byte Freq
Definition Ppmd.h:68
Byte Symbol
Definition Ppmd.h:67
UInt16 Successor_0
Definition Ppmd.h:73
UInt16 Successor_1
Definition Ppmd.h:74
UInt16 Successor_0
Definition Ppmd.h:61
Byte Freq
Definition Ppmd.h:60
UInt16 Successor_1
Definition Ppmd.h:62
Byte Symbol
Definition Ppmd.h:59
unsigned short UInt16
Definition bzlib_private.h:47
unsigned char Byte
Definition zconf.h:391