protected Intra16X16LumaAbstractPredictor(int x, int y, Macroblock macroblock, IAlgorithmFactory algorithms)
        {
            this.x = x;
            this.y = y;
            access = macroblock.MacroblockAccess;
            info = new MacroblockInfo(macroblock);
            transform = algorithms.CreateTransform();
            quantizer = algorithms.CreateQuantizer();
            distortion = algorithms.CreateDistortionMetric();
            scanner = algorithms.CreateScanner();
            mOrig = new int[mbHeight][];
            for (var i = 0; i < mOrig.Length; i++)
                mOrig[i] = new int[mbWidth];

            mResd = new int[mbHeight][];
            for (var i = 0; i < mResd.Length; i++)
                mResd[i] = new int[mbWidth];

            mPred = new int[mbHeight][];
            for (var i = 0; i < mPred.Length; i++)
                mPred[i] = new int[mbWidth];

            mDc = new int[dcHeight][];
            for (var i = 0; i < mDc.Length; i++)
                mDc[i] = new int[dcWidth];
        }
 public Macroblock(Slice slice, int mbNr)
 {
     this.mbNr = mbNr;
     this.slice = slice;
     position = new MacroblockPosition(this);
     access = new MacroblockAccessNonMbaff(this);
     encodingModes = new List<IEncodingMode> {new Intra16X16EncodingMode(this)};
     StartMacroblock();
 }