Esempio n. 1
0
 public CommonMvVector getMvdL1()
 {
     CommonMvVector ret = new CommonMvVector(commonWRAPPINVOKE.CommonMbH264_getMvdL1(swigCPtr), true);
     return ret;
 }
Esempio n. 2
0
        public H264Mb(CommonMbH264 eltMb)
            : base(eltMb)
        {
            m_Mode = eltMb.getMode();
            m_SliceType = eltMb.getSliceType();
            m_MbType = eltMb.getMbType();
            m_QP = eltMb.getQP();
            m_QPC = eltMb.getQPC();
            m_CBP = eltMb.getCBP();
            m_IsIntra16x16 = eltMb.isIntra16x16();
            m_IsInter8x8 = eltMb.isInter8x8();
            m_IsIntra = eltMb.isIntra();
            m_NumMbPart = 1;
            m_MbPartSize = new Size(16, 16);

            if (m_Mode == MbMode.INTRA_4X4)
            {
                m_Intra4x4PredModes = new Intra4x4PredMode[16];
                eltMb.getIntra4x4PredMode(m_Intra4x4PredModes);
            }
            else if (m_IsIntra16x16)
            {
                m_I16x16Type = (m_SliceType == SliceType.P_SLICE) ? (I16x16Type)(m_MbType - 5) : (I16x16Type)m_MbType;
            }
            else if (m_SliceType == SliceType.P_SLICE)
            {
                if (m_MbType < 5 || m_Mode == MbMode.MODE_SKIP)
                {
                    if (m_Mode == MbMode.MODE_SKIP)
                    {
                        m_NumMbPart = 1;
                        m_MbPartSize = new Size(16, 16);
                    }
                    else
                    {
                        m_PType = (PType)m_MbType;
                        if (m_MbType < PartNumP.Length)
                        {
                            m_NumMbPart = PartNumP[m_MbType];
                        }
                        if (m_MbType < PartSizeP.Length)
                        {
                            m_MbPartSize = new Size((int)PartSizeP[m_MbType][0], (int)PartSizeP[m_MbType][1]);
                        }
                    }
                }
                else if (m_MbType == 5)
                {
                    // I_4x4
                    Debug.Assert(false);
                    m_IsIntra = true;
                }
                else
                {
                    // I_16x16
                    m_I16x16Type = (I16x16Type)(m_MbType - 5);
                    m_IsIntra = true;
                    m_IsIntra16x16 = true;
                }
            }
            else if (m_SliceType == SliceType.B_SLICE)
            {
                m_BType = (BType)m_MbType;
                if (m_MbType < PartNumB.Length)
                {
                    m_NumMbPart = PartNumB[m_MbType];
                }
                if (m_MbType < PartSizeP.Length)
                {
                    m_MbPartSize = new Size((int)PartSizeB[m_MbType][0], (int)PartSizeB[m_MbType][1]);
                }
            }

            if (m_IsInter8x8)
            {
                m_BlkModes = new BlkMode[4];
                eltMb.getBlkModes(m_BlkModes);
            }

            if (m_IsIntra)
            {
                m_IntraChromaPredMode = eltMb.getIntraChromaPredMode();
            }
            else
            {
                m_ref_idx_L0 = new Int32[4];
                m_POC0 = new Int32[4];
                m_mvd_l0 = eltMb.getMvdL0();
                m_mvL0 = eltMb.getMvL0();
                eltMb.getRefIdxL0(m_ref_idx_L0);
                eltMb.getPOC0(m_POC0);
                if (SliceType == SliceType.B_SLICE)
                {
                    m_ref_idx_L1 = new Int32[4];
                    m_POC1 = new Int32[4];
                    m_mvd_l1 = eltMb.getMvdL1();
                    m_mvL1 = eltMb.getMvL1();
                    eltMb.getRefIdxL1(m_ref_idx_L1);
                    eltMb.getPOC1(m_POC1);
                }
            }

            /*** SVC ***/
            m_IsInCropWindow = eltMb.isInCropWindow();
            m_IsResidualPredictionFlag = eltMb.isResidualPredictionFlag();
            m_IsBLSkippedFlag = eltMb.isBLSkippedFlag();
        }
Esempio n. 3
0
        public H264Mb(CommonMbH264 eltMb)
            : base(eltMb)
        {
            m_Mode         = eltMb.getMode();
            m_SliceType    = eltMb.getSliceType();
            m_MbType       = eltMb.getMbType();
            m_QP           = eltMb.getQP();
            m_QPC          = eltMb.getQPC();
            m_CBP          = eltMb.getCBP();
            m_IsIntra16x16 = eltMb.isIntra16x16();
            m_IsInter8x8   = eltMb.isInter8x8();
            m_IsIntra      = eltMb.isIntra();
            m_NumMbPart    = 1;
            m_MbPartSize   = new Size(16, 16);

            if (m_Mode == MbMode.INTRA_4X4)
            {
                m_Intra4x4PredModes = new Intra4x4PredMode[16];
                eltMb.getIntra4x4PredMode(m_Intra4x4PredModes);
            }
            else if (m_IsIntra16x16)
            {
                m_I16x16Type = (m_SliceType == SliceType.P_SLICE) ? (I16x16Type)(m_MbType - 5) : (I16x16Type)m_MbType;
            }
            else if (m_SliceType == SliceType.P_SLICE)
            {
                if (m_MbType < 5 || m_Mode == MbMode.MODE_SKIP)
                {
                    if (m_Mode == MbMode.MODE_SKIP)
                    {
                        m_NumMbPart  = 1;
                        m_MbPartSize = new Size(16, 16);
                    }
                    else
                    {
                        m_PType = (PType)m_MbType;
                        if (m_MbType < PartNumP.Length)
                        {
                            m_NumMbPart = PartNumP[m_MbType];
                        }
                        if (m_MbType < PartSizeP.Length)
                        {
                            m_MbPartSize = new Size((int)PartSizeP[m_MbType][0], (int)PartSizeP[m_MbType][1]);
                        }
                    }
                }
                else if (m_MbType == 5)
                {
                    // I_4x4
                    Debug.Assert(false);
                    m_IsIntra = true;
                }
                else
                {
                    // I_16x16
                    m_I16x16Type   = (I16x16Type)(m_MbType - 5);
                    m_IsIntra      = true;
                    m_IsIntra16x16 = true;
                }
            }
            else if (m_SliceType == SliceType.B_SLICE)
            {
                m_BType = (BType)m_MbType;
                if (m_MbType < PartNumB.Length)
                {
                    m_NumMbPart = PartNumB[m_MbType];
                }
                if (m_MbType < PartSizeP.Length)
                {
                    m_MbPartSize = new Size((int)PartSizeB[m_MbType][0], (int)PartSizeB[m_MbType][1]);
                }
            }

            if (m_IsInter8x8)
            {
                m_BlkModes = new BlkMode[4];
                eltMb.getBlkModes(m_BlkModes);
            }

            if (m_IsIntra)
            {
                m_IntraChromaPredMode = eltMb.getIntraChromaPredMode();
            }
            else
            {
                m_ref_idx_L0 = new Int32[4];
                m_POC0       = new Int32[4];
                m_mvd_l0     = eltMb.getMvdL0();
                m_mvL0       = eltMb.getMvL0();
                eltMb.getRefIdxL0(m_ref_idx_L0);
                eltMb.getPOC0(m_POC0);
                if (SliceType == SliceType.B_SLICE)
                {
                    m_ref_idx_L1 = new Int32[4];
                    m_POC1       = new Int32[4];
                    m_mvd_l1     = eltMb.getMvdL1();
                    m_mvL1       = eltMb.getMvL1();
                    eltMb.getRefIdxL1(m_ref_idx_L1);
                    eltMb.getPOC1(m_POC1);
                }
            }

            /*** SVC ***/
            m_IsInCropWindow           = eltMb.isInCropWindow();
            m_IsResidualPredictionFlag = eltMb.isResidualPredictionFlag();
            m_IsBLSkippedFlag          = eltMb.isBLSkippedFlag();
        }