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


C++ BitstreamReader::Init方法代码示例

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


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

示例1:

static Status parseAPP0(DataReader *pReader, JPEGAPP0Header *pHeader)
{
    BitstreamReader bs;

    Ipp8u  iMarker[5];
    size_t iSize = 5;

    pReader->Get16uSwap(&pHeader->iLength);

    pReader->CacheData(&iMarker[0], iSize);
    if(iMarker[0] == 'J' && iMarker[1] == 'F' && iMarker[2] == 'I' && iMarker[3] == 'F' && iMarker[4] == 0)
    {
        pReader->MovePosition(5);
        bs.Init(pReader);

        pHeader->bJfifDetected    = true;
        pHeader->iJfifVerMajor    = bs.GetBits(8);
        pHeader->iJfifVerMinor    = bs.GetBits(8);
        pHeader->iJfifUnits       = bs.GetBits(8);
        pHeader->iJfifXDensity    = bs.GetBits(16);
        pHeader->iJfifYDensity    = bs.GetBits(16);
        pHeader->iJfifThumbWidth  = bs.GetBits(8);
        pHeader->iJfifThumbHeight = bs.GetBits(8);

        bs.AlignReader();
    }

    pReader->CacheData(&iMarker[0], iSize);
    if(iMarker[0] == 'J' && iMarker[1] == 'F' && iMarker[2] == 'X' && iMarker[3] == 'X' && iMarker[4] == 0)
    {
        pReader->MovePosition(5);
        bs.Init(pReader);

        pHeader->bJfxxDetected       = true;
        pHeader->iJfxxThumbnailsType = bs.GetBits(8);

        bs.AlignReader();
    }

    pReader->CacheData(&iMarker[0], iSize);
    if(iMarker[0] == 'A' && iMarker[1] == 'V' && iMarker[2] == 'I' && iMarker[3] == '1')
    {
        pReader->MovePosition(4);
        bs.Init(pReader);

        pHeader->bAvi1Detected   = true;
        pHeader->iAvi1Polarity   = bs.GetBits(8);
        pHeader->iAvi1Reserved   = bs.GetBits(8);
        pHeader->iAvi1FiledSize1 = bs.GetBits(32);
        pHeader->iAvi1FiledSize2 = bs.GetBits(32);

        bs.AlignReader();
    }

    return UMC_OK;
}
开发者ID:vinnie38170,项目名称:klImageCore,代码行数:56,代码来源:umc_mjpeg_pure_splitter.cpp

示例2: parseSOF

static Status parseSOF(DataReader *pReader, JPEGSOFHeader *pHeader)
{
    BitstreamReader bs;
    bs.Init(pReader);

    pHeader->iLength    = bs.GetBits(16);
    pHeader->iPrecision = bs.GetBits(8);
    pHeader->iHeight    = bs.GetBits(16);
    pHeader->iWidth     = bs.GetBits(16);
    pHeader->iComonents = bs.GetBits(8);

    for(Ipp32u i = 0; i < pHeader->iComonents; i++)
    {
        pHeader->comonent[i].iID        = bs.GetBits(8);
        pHeader->comonent[i].iHSampling = bs.GetBits(4);
        pHeader->comonent[i].iVSampling = bs.GetBits(4);
        pHeader->comonent[i].iQSelector = bs.GetBits(8);
    }
    bs.AlignReader();

    return UMC_OK;
}
开发者ID:vinnie38170,项目名称:klImageCore,代码行数:22,代码来源:umc_mjpeg_pure_splitter.cpp


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