internal bool decodeSymbol2(ModelPPM model) { long count; int hiCnt, i = NumStats - model.NumMasked; SEE2Context psee2c = makeEscFreq2(model, i); RangeCoder coder = model.Coder; // STATE* ps[256], ** pps=ps, * p=U.Stats-1; State p = tempState1.Initialize(model.Heap); State temp = tempState2.Initialize(model.Heap); p.Address = freqData.GetStats() - State.Size; int pps = 0; hiCnt = 0; do { do { p.IncrementAddress(); // p++; } while (model.CharMask[p.Symbol] == model.EscCount); hiCnt += p.Freq; ps[pps++] = p.Address; } while (--i != 0); coder.SubRange.incScale(hiCnt); count = coder.CurrentCount; if (count >= coder.SubRange.Scale) { return(false); } pps = 0; p.Address = ps[pps]; if (count < hiCnt) { hiCnt = 0; while ((hiCnt += p.Freq) <= count) { p.Address = ps[++pps]; // p=*++pps; } coder.SubRange.HighCount = hiCnt; coder.SubRange.LowCount = hiCnt - p.Freq; psee2c.update(); update2(model, p.Address); } else { coder.SubRange.LowCount = hiCnt; coder.SubRange.HighCount = coder.SubRange.Scale; i = NumStats - model.NumMasked; // ->NumMasked; pps--; do { temp.Address = ps[++pps]; // (*++pps) model.CharMask[temp.Symbol] = model.EscCount; } while (--i != 0); psee2c.incSumm((int)coder.SubRange.Scale); model.NumMasked = NumStats; } return(true); }
internal bool decodeSymbol2(ModelPPM model) { int diff = this.NumStats - model.NumMasked; SEE2Context context = this.makeEscFreq2(model, diff); RangeCoder coder = model.Coder; SharpCompress.Compressor.PPMd.H.State state = this.tempState1.Initialize(model.Heap); SharpCompress.Compressor.PPMd.H.State state2 = this.tempState2.Initialize(model.Heap); state.Address = this.freqData.GetStats() - 6; int index = 0; int dScale = 0; do { do { state.IncrementAddress(); }while (model.CharMask[state.Symbol] == model.EscCount); dScale += state.Freq; this.ps[index++] = state.Address; }while (--diff != 0); coder.SubRange.incScale(dScale); long currentCount = coder.CurrentCount; if (currentCount >= coder.SubRange.Scale) { return(false); } index = 0; state.Address = this.ps[index]; if (currentCount < dScale) { dScale = 0; while ((dScale += state.Freq) <= currentCount) { state.Address = this.ps[++index]; } coder.SubRange.HighCount = dScale; coder.SubRange.LowCount = dScale - state.Freq; context.update(); this.update2(model, state.Address); } else { coder.SubRange.LowCount = dScale; coder.SubRange.HighCount = coder.SubRange.Scale; diff = this.NumStats - model.NumMasked; index--; do { state2.Address = this.ps[++index]; model.CharMask[state2.Symbol] = model.EscCount; }while (--diff != 0); context.incSumm((int)coder.SubRange.Scale); model.NumMasked = this.NumStats; } return(true); }