Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }