CSJ2K.j2k.entropy.encoder.MQCoder.MQCoder C# (CSharp) Method

MQCoder() public method

Instantiates a new MQ-coder, with the specified number of contexts and initial states. The compressed bytestream is written to the 'oStream' object.
public MQCoder ( CSJ2K.j2k.entropy.encoder.ByteOutputBuffer oStream, int nrOfContexts, int init ) : System
oStream CSJ2K.j2k.entropy.encoder.ByteOutputBuffer where to output the compressed data. /// ///
nrOfContexts int The number of contexts used by the MQ coder. /// ///
init int The initial state for each context. A reference is kept to /// this array to reinitialize the contexts whenever 'reset()' or /// 'resetCtxts()' is called. /// ///
return System
        public MQCoder(ByteOutputBuffer oStream, int nrOfContexts, int[] init)
        {
            out_Renamed = oStream;

            // --- INITENC

            // Default initialization of the statistics bins is MPS=0 and
            // I=0
            I = new int[nrOfContexts];
            mPS = new int[nrOfContexts];
            initStates = init;

            a = 0x8000;
            c = 0;
            if (b == 0xFF)
            {
                cT = 13;
            }
            else
            {
                cT = 12;
            }

            resetCtxts();

            // End of INITENC ---
            b = 0;
        }