当前位置: 首页>>代码示例>>C++>>正文


C++ CGolombBuffer::BitByteAlign方法代码示例

本文整理汇总了C++中CGolombBuffer::BitByteAlign方法的典型用法代码示例。如果您正苦于以下问题:C++ CGolombBuffer::BitByteAlign方法的具体用法?C++ CGolombBuffer::BitByteAlign怎么用?C++ CGolombBuffer::BitByteAlign使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CGolombBuffer的用法示例。


在下文中一共展示了CGolombBuffer::BitByteAlign方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: while

void CompositionObject::Dvb4PixelsCodeString(SubPicDesc& spd, CGolombBuffer& gb, short& nX, short& nY)
{
    bool bQuit = false;

    while (!bQuit && !gb.IsEOF()) {
        short nCount = 0;
        BYTE nPaletteIndex = 0;
        BYTE bTemp = (BYTE)gb.BitRead(4);
        if (bTemp != 0) {
            nPaletteIndex = bTemp;
            nCount = 1;
        } else {
            if (gb.BitRead(1) == 0) {                               // switch_1
                nCount = (short)gb.BitRead(3);                      // run_length_3-9
                if (nCount != 0) {
                    nCount += 2;
                } else {
                    bQuit = true;
                }
            } else {
                if (gb.BitRead(1) == 0) {                           // switch_2
                    nCount = 4 + (short)gb.BitRead(2);              // run_length_4-7
                    nPaletteIndex = (BYTE)gb.BitRead(4);            // 4-bit_pixel-code
                } else {
                    switch (gb.BitRead(2)) {                        // switch_3
                        case 0:
                            nCount = 1;
                            break;
                        case 1:
                            nCount = 2;
                            break;
                        case 2:                                     // if (switch_3 == '10')
                            nCount = 9 + (short)gb.BitRead(4);      // run_length_9-24
                            nPaletteIndex = (BYTE)gb.BitRead(4);    // 4-bit_pixel-code
                            break;
                        case 3:
                            nCount = 25 + gb.ReadByte();            // run_length_25-280
                            nPaletteIndex = (BYTE)gb.BitRead(4);    // 4-bit_pixel-code
                            break;
                    }
                }
            }
        }

#if 0
        if (nX + nCount > m_width) {
            ASSERT(FALSE);
            break;
        }
#endif

        if (nCount > 0) {
            FillSolidRect(spd, nX, nY, nCount, 1, m_Colors[nPaletteIndex]);
            nX += nCount;
        }
    }

    gb.BitByteAlign();
}
开发者ID:EchoLiao,项目名称:mpc-hc,代码行数:59,代码来源:CompositionObject.cpp

示例2: while

void CompositionObject::Dvb2PixelsCodeString(SubPicDesc& spd, CGolombBuffer& gb, short& nX, short& nY)
{
    BYTE  bTemp;
    BYTE  nPaletteIndex = 0;
    short nCount;
    bool  bQuit = false;

    while (!bQuit && !gb.IsEOF()) {
        nCount = 0;
        nPaletteIndex = 0;
        bTemp = (BYTE)gb.BitRead(2);
        if (bTemp != 0) {
            nPaletteIndex = bTemp;
            nCount = 1;
        } else {
            if (gb.BitRead(1) == 1) {                               // switch_1
                nCount = 3 + (short)gb.BitRead(3);                  // run_length_3-9
                nPaletteIndex = (BYTE)gb.BitRead(2);
            } else {
                if (gb.BitRead(1) == 0) {                           // switch_2
                    switch (gb.BitRead(2)) {                        // switch_3
                        case 0:
                            bQuit = true;
                            break;
                        case 1:
                            nCount = 2;
                            break;
                        case 2:                                     // if (switch_3 == '10')
                            nCount = 12 + (short)gb.BitRead(4);     // run_length_12-27
                            nPaletteIndex = (BYTE)gb.BitRead(2);    // 4-bit_pixel-code
                            break;
                        case 3:
                            nCount = 29 + gb.ReadByte();            // run_length_29-284
                            nPaletteIndex = (BYTE)gb.BitRead(2);    // 4-bit_pixel-code
                            break;
                    }
                } else {
                    nCount = 1;
                }
            }
        }

        if (nX + nCount > m_width) {
            ASSERT(FALSE);
            break;
        }

        if (nCount > 0) {
            FillSolidRect(spd, nX, nY, nCount, 1, m_Colors[nPaletteIndex]);
            nX += nCount;
        }
    }

    gb.BitByteAlign();
}
开发者ID:Cyberbeing,项目名称:xy-VSFilter,代码行数:55,代码来源:CompositionObject.cpp

示例3: while

void CompositionObject::Dvb8PixelsCodeString(SubPicDesc& spd, CGolombBuffer& gb, SHORT& nX, SHORT& nY)
{
    BYTE			bTemp;
    BYTE			nPaletteIndex = 0;
    SHORT			nCount;
    bool			bQuit	= false;

    while(!bQuit && !gb.IsEOF())
    {
        nCount			= 0;
        nPaletteIndex	= 0;
        bTemp			= gb.ReadByte();
        if(bTemp != 0)
        {
            nPaletteIndex = bTemp;
            nCount		  = 1;
        }
        else
        {
            if(gb.BitRead(1) == 0)								// switch_1
            {
                nCount = (SHORT)gb.BitRead(7);					// run_length_1-127
                if(nCount == 0)
                    bQuit = true;
            }
            else
            {
                nCount			= (SHORT)gb.BitRead(7);			// run_length_3-127
                nPaletteIndex	= gb.ReadByte();
            }
        }

        if(nX + nCount > m_width)
        {
            ASSERT(FALSE);
            break;
        }

        if(nCount > 0)
        {
            FillSolidRect(spd, nX, nY, nCount, 1, m_Colors[nPaletteIndex]);
            nX += nCount;
        }
    }

    gb.BitByteAlign();
}
开发者ID:AlexsandroAG,项目名称:vsfiltermod,代码行数:47,代码来源:CompositionObject.cpp


注:本文中的CGolombBuffer::BitByteAlign方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。