public H264OutputStream(Nalu nalu, SequenceParameterSet sps,PictureParameterSet pps)
        {
            this.Nalu = nalu;
            this.sps = sps;
            this.pps = pps;

            if (pps.EntropyCodingModeFlag)
            {
                //TODO : CABAC
                // entropyOutputStream = new CABAC();
            }
            else
            {
                entropyOutputStream = new Cavlc(this);
            }
        }
Esempio n. 2
0
        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);
        }
        private readonly bool weightedPredFlag; // u(1)

        #endregion Fields

        #region Constructors

        public PictureParameterSet(SequenceParameterSet sps)
        {
            seqParameterSetId = sps.SeqParameterSetId;
            picParameterSetId = 0;          // TODO hard coded to zero
            entropyCodingModeFlag = false;  // TODO hard coded to Cavlc
            picOrderPresentFlag = false;    // TODO hard coded to false
            numSliceGroupsMinus1 = 0;       // TODO hard coded to zero

            // Following set the parameter for different slice group types
            if (numSliceGroupsMinus1 > 0)
            {
            }
            // End FMO stuff

            if (sps.FrameMbsOnlyFlag)
            {
                numRefIdxL0ActiveMinus1 = sps.NumRefFrames - 1;
                numRefIdxL1ActiveMinus1 = sps.NumRefFrames - 1;
            }
            else
            {
                numRefIdxL0ActiveMinus1 = 2 * sps.NumRefFrames - 1;
                numRefIdxL1ActiveMinus1 = 2 * sps.NumRefFrames - 1;
            }

            weightedPredFlag = false;       // TODO hard coded to false
            weightedBipredIdc = 0;          // TODO hard coded to zero

            // hard coded to zero, QP lives in the slice header
            picInitQpMinus26 = 0;
            picInitQsMinus26 = 0;
            chromaQpIndexOffset = 0;                    // TODO hard coded to zero
            deblockingFilterControlPresentFlag = false; // TODO hrd cd to false
            constrainedIntraPredFlag = false;           // TODO hard coded to false
            redundantPicCntPresentFlag = false;         // TODO hard coded to false
        }