internal See2Context MakeEscFreq(ModelPpm model, int numMasked, out int escFreq) { See2Context psee2C; int numStats = NumStats; int nonMasked = numStats - numMasked; if (numStats != 256) { PpmContext suff = GetTempPpmContext(model.Heap); suff.Address = GetSuffix(); int idx1 = model.GetNs2Indx()[nonMasked - 1]; int idx2 = 0; idx2 += ((nonMasked < suff.NumStats - numStats) ? 1 : 0); idx2 += 2 * ((_freqData.SummFreq < 11 * numStats) ? 1 : 0); idx2 += 4 * ((numMasked > nonMasked) ? 1 : 0); idx2 += model.HiBitsFlag; psee2C = model.GetSee2Cont()[idx1][idx2]; escFreq = psee2C.Mean; } else { psee2C = model.DummySee2Cont; escFreq = 1; } return(psee2C); }
private See2Context MakeEscFreq2(ModelPpm model, int diff) { See2Context psee2C; int numStats = NumStats; if (numStats != 256) { PpmContext suff = GetTempPpmContext(model.Heap); suff.Address = GetSuffix(); int idx1 = model.GetNs2Indx()[diff - 1]; int idx2 = 0; idx2 += ((diff < suff.NumStats - numStats) ? 1 : 0); idx2 += 2 * ((_freqData.SummFreq < 11 * numStats) ? 1 : 0); idx2 += 4 * ((model.NumMasked > diff) ? 1 : 0); idx2 += model.HiBitsFlag; psee2C = model.GetSee2Cont()[idx1][idx2]; model.Coder.SubRange.Scale = psee2C.Mean; } else { psee2C = model.DummySee2Cont; model.Coder.SubRange.Scale = 1; } return(psee2C); }