示例#1
0
 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();
 }
        public SliceHeader(Slice slice, Nalu nalu, SequenceParameterSet sps, PictureParameterSet pps)
        {
            this.slice = slice;

            // BEGIN: parameters from Nalu, Picture Par Set and Sequence Par Set
            picParameterSetId = pps.PicParameterSetId;
            log2MaxFrameNumMinus4 = sps.Log2MaxFrameNumMinus4;
            frameMbsOnlyFlag = sps.FrameMbsOnlyFlag;
            picOrderCntType = sps.PicOrderCntType;
            log2MaxPicOrderCntLsbMinus4 = sps.Log2MaxPicOrderCntLsbMinus4;
            picInitQpMinus26 = pps.PicInitQpMinus26;
            nalRefIdc = nalu.NalRefIdc;
            nalUnitType = nalu.NalUnitType;
            // END: parameters from Nalu, Picture Par Set and Sequence Par Set

            sliceType = slice.Picture.TypeOfSlice;
            firstMbInSlice = slice.Picture.CurrentMbNr;
            noOutputOfPriorPicsFlag = false;
            longTermReferenceFlag = false;
            sliceQpDelta = (slice.Qp - 26 - picInitQpMinus26);
        }
示例#3
0
        protected void CodePicture(YuvFrameBuffer inFrameBuffer, YuvFrameBuffer outFrameBuffer)
        {
            var numberOfCodedMBs = 0;

            // TODO FmoInit()
            // TODO FmoStartPicture() -> picture level initialization of FMO

            CalculateQuantParam();

            // loop over slices
            while (numberOfCodedMBs < picSizeInMbs)
            {
                slice = new Slice(this, type);
                numberOfCodedMBs += slice.Encode(inFrameBuffer, outFrameBuffer);
            }
        }