示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProbabilityEstimationModule"/> class.
        /// </summary>
        /// <param name="associatedCM">associated context model.</param>
        /// <param name="associatedGCE">associated golomb code encoder.</param>
        public ProbabilityEstimationModule(ref ContextModel associatedCM, ref GolombCodeEncoder associatedGCE)
        {
            this.cm          = associatedCM;
            this.cm.PEM      = this;
            this.gce         = associatedGCE;
            this.contextInfo = new SDD1ContextInfo[32];

            this.stateEvolutionTable = new State[]
            {
                new State(0, 25, 25),
                new State(0, 2, 1),
                new State(0, 3, 1),
                new State(0, 4, 2),
                new State(0, 5, 3),
                new State(1, 6, 4),
                new State(1, 7, 5),
                new State(1, 8, 6),
                new State(1, 9, 7),
                new State(2, 10, 8),
                new State(2, 11, 9),
                new State(2, 12, 10),
                new State(2, 13, 11),
                new State(3, 14, 12),
                new State(3, 15, 13),
                new State(3, 16, 14),
                new State(3, 17, 15),
                new State(4, 18, 16),
                new State(4, 19, 17),
                new State(5, 20, 18),
                new State(5, 21, 19),
                new State(6, 22, 20),
                new State(6, 23, 21),
                new State(7, 24, 22),
                new State(7, 24, 23),
                new State(0, 26, 1),
                new State(1, 27, 2),
                new State(2, 28, 4),
                new State(3, 29, 8),
                new State(4, 30, 12),
                new State(5, 31, 16),
                new State(6, 32, 18),
                new State(7, 24, 22),
            };
        }
示例#2
0
        private void InitCompression()
        {
            this.bitplaneBuffer    = new List <byte> [8];
            this.codewordBuffer    = new List <byte> [8];
            this.codewordsSequence = new List <byte>();

            for (int i = 0; i < 8; i++)
            {
                this.bitplaneBuffer[i] = new List <byte>();
            }

            for (int i = 0; i < 8; i++)
            {
                this.codewordBuffer[i] = new List <byte>();
            }

            this.bitplanesExtractor      = new BitplanesExtractor(this.bitplaneBuffer[0], this.bitplaneBuffer[1], this.bitplaneBuffer[2], this.bitplaneBuffer[3], this.bitplaneBuffer[4], this.bitplaneBuffer[5], this.bitplaneBuffer[6], this.bitplaneBuffer[7]);
            this.contextModelCompression = new ContextModelCompression(this.bitplaneBuffer[0], this.bitplaneBuffer[1], this.bitplaneBuffer[2], this.bitplaneBuffer[3], this.bitplaneBuffer[4], this.bitplaneBuffer[5], this.bitplaneBuffer[6], this.bitplaneBuffer[7]);
            this.golombCodeEncoder       = new GolombCodeEncoder(this.codewordsSequence, this.codewordBuffer[0], this.codewordBuffer[1], this.codewordBuffer[2], this.codewordBuffer[3], this.codewordBuffer[4], this.codewordBuffer[5], this.codewordBuffer[6], this.codewordBuffer[7]);
            this.probabilityEstimationModuleCompression = new ProbabilityEstimationModuleCompression(this.contextModelCompression, this.golombCodeEncoder);
            this.interleaver = new Interleaver(this.codewordsSequence, this.codewordBuffer[0], this.codewordBuffer[1], this.codewordBuffer[2], this.codewordBuffer[3], this.codewordBuffer[4], this.codewordBuffer[5], this.codewordBuffer[6], this.codewordBuffer[7]);
        }