Exemplo n.º 1
0
        public EltMb(CommonMb mb)
            : base(mb)
        {
            m_Address = mb.getAddress();
            m_X = mb.getX();
            m_Y = mb.getY();
            m_Data = new Int32[LINES_COUNT][][];
            m_Width = new UInt32[LINES_COUNT];
            m_Height = new UInt32[LINES_COUNT];

            for (int iLine = 0; iLine < LINES_COUNT; iLine++) // Y,U,V
            {
                m_Width[iLine] = mb.getWidth((CommonYuvLine_t)iLine);
                m_Height[iLine] = mb.getHeight((CommonYuvLine_t)iLine);

                m_Data[iLine] = new Int32[TYPES_COUNT][];
                for (int iType = 0; iType < TYPES_COUNT; iType++) // Final, Residual, Predicted...
                {
                    m_Data[iLine][iType] = new Int32[m_Width[iLine] * m_Height[iLine]];
            #if COMPUTE_RESIDUAL
                    if ((int)CommonEltMbDataType_t.CommonEltMbDataType_Residual == iType)
                    {
                        // Residual not generated by the native code: do it ourself. Requires Final and Predicted.
                        int s = (int)(m_Width[iLine] * m_Height[iLine]);
                        for (int i = 0; i < s; i++)
                        {
                            m_Data[iLine][iType][i] = m_Data[iLine][(int)CommonEltMbDataType_t.CommonEltMbDataType_Final][i] - m_Data[iLine][(int)CommonEltMbDataType_t.CommonEltMbDataType_Predicted][i];
                        }
                    }
                    else
            #endif
                    {
                        Marshal.Copy(mb.getData((CommonEltMbDataType_t)iType, (CommonYuvLine_t)iLine), m_Data[iLine][iType], 0, (int)(m_Width[iLine] * m_Height[iLine]));
                    }
                }
            }
        }
Exemplo n.º 2
0
 internal static HandleRef getCPtr(CommonMb obj)
 {
     return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr);
 }
Exemplo n.º 3
0
 internal static HandleRef getCPtr(CommonMb obj)
 {
     return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }