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


C++ MvData::SBSplit方法代码示例

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


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

示例1: DoWorkCode

// Main code function
void PredModeCodec::DoWorkCode( MvData& in_data )
{
    int step,max; 
    int split_depth;  

    for (m_sb_yp = 0, m_sb_tlb_y = 0;  m_sb_yp < in_data.SBSplit().LengthY();  ++m_sb_yp, m_sb_tlb_y += 4)
    {
        for (m_sb_xp = 0,m_sb_tlb_x = 0; m_sb_xp < in_data.SBSplit().LengthX(); ++m_sb_xp,m_sb_tlb_x += 4)
        {
            split_depth = in_data.SBSplit()[m_sb_yp][m_sb_xp]; 

            step = 4  >>  (split_depth); 
            max = (1 << split_depth); 
                        
            //now do all the block modes and mvs in the mb            
            for (m_b_yp = m_sb_tlb_y; m_b_yp < m_sb_tlb_y+4; m_b_yp += step)
            {
                for (m_b_xp = m_sb_tlb_x; m_b_xp < m_sb_tlb_x+4; m_b_xp += step)
                {
                    CodeVal(in_data);
                }//m_b_xp
            }//m_b_yp    
            
        }//m_sb_xp
    }//m_sb_yp    
} 
开发者ID:MOXfiles,项目名称:dirac-research,代码行数:27,代码来源:mv_codec.cpp

示例2: CodeVal

void SplitModeCodec::CodeVal(const MvData& in_data)
{
    int val = in_data.SBSplit()[m_sb_yp][m_sb_xp] - Prediction( in_data.SBSplit() ); 
    
    if (val < 0) val+=3; //produce prediction mod 3

    EncodeUInt(val, SB_SPLIT_BIN1_CTX, SB_SPLIT_BIN2_CTX);
}
开发者ID:MOXfiles,项目名称:dirac-research,代码行数:8,代码来源:mv_codec.cpp

示例3: DoWorkDecode

// Main decode function
void SplitModeCodec::DoWorkDecode( MvData& out_data)
{

    for (m_sb_yp = 0; m_sb_yp < out_data.SBSplit().LengthY(); ++m_sb_yp)
    {
        for (m_sb_xp = 0; m_sb_xp < out_data.SBSplit().LengthX(); ++m_sb_xp)
        {
            DecodeVal( out_data );
        }//m_sb_xp
    }//m_sb_yp
}  
开发者ID:MOXfiles,项目名称:dirac-research,代码行数:12,代码来源:mv_codec.cpp

示例4: CompensateComponent

void MotionCompensator::CompensateComponent( Picture* pic ,
                                             Picture* refsptr[2] ,
                                             const MvData& mv_data ,
                                             const CompSort cs )
{
    // Set up references to pictures and references
    PicArray& pic_data_out = pic->Data( cs );

    // Size of picture component being motion compensated

    const PicArray& ref1up = refsptr[0]->UpData( cs );
    const PicArray& ref2up = refsptr[1]->UpData( cs );

    // Set up a row of blocks which will contain the MC data, which
    // we'll add or subtract to pic_data_out
    TwoDArray<ValueType> pic_data(m_bparams.Yblen(), pic_data_out.LengthX(), 0 );

    // Factors to compensate for subsampling of chroma
    int xscale_shift = 0;
    int yscale_shift = 0;
    if ( cs != Y_COMP )
    {
        if (m_cformat == format420)
        {
            xscale_shift = 1;
            yscale_shift = 1;
        }
        else if (m_cformat == format422)
        {
            xscale_shift = 1;
            yscale_shift = 0;
        }
    }

    ImageCoords pic_size(pic->GetPparams().Xl(), pic->GetPparams().Yl());
    if ( cs != Y_COMP )
    {
        pic_size.x = pic->GetPparams().ChromaXl();
        pic_size.y = pic->GetPparams().ChromaYl();
    }


    // Reference to the relevant DC array
    const TwoDArray<ValueType>& dcarray = mv_data.DC( cs );

    // Set up references to the vectors
    const int num_refs = pic->GetPparams().Refs().size();
    const MvArray* mv_array1;
    const MvArray* mv_array2;
    mv_array1 = &mv_data.Vectors(1);
    if (num_refs ==2 )
        mv_array2 = &mv_data.Vectors(2);
    else
        mv_array2 = &mv_data.Vectors(1);

    ReConfig();//set all the weighting blocks up

    //Blocks are listed left to right, line by line.
    MVector mv1,mv2;
    PredMode block_mode;

    //Coords of the top-left corner of a block
    ImageCoords pos;

    //Loop for each block in the output image.
    //The CompensateBlock function will use the image pointed to by ref1up
    //and add the compensated pixels to the image pointed to by pic_data.
    size_t wgt_idx;

    int save_from_row = m_bparams.Ybsep()-m_bparams.Yoffset();

    // unpadded picture dimensions
    const int x_end_data = pic_data_out.FirstX() + std::min(pic_data_out.LengthX(), pic_size.x );
    const int y_end_data = pic_data_out.FirstY() + std::min(pic_data_out.LengthY(), pic_size.y );

    const int blocks_per_mb_row = m_predparams.XNumBlocks()/m_predparams.XNumSB();
    const int blocks_per_sb_row = blocks_per_mb_row>>1;

    // The picture does not contain integral number of blocks. So not all
    // blocks need to be processed. Compute the relevant blocks to be
    // processed 
    int y_num_blocks = std::min((NUM_USED_BLKS(pic_size.y,m_bparams.Ybsep(),m_bparams.Yblen())), 
                       m_predparams.YNumBlocks());
    int x_num_blocks = std::min((NUM_USED_BLKS(pic_size.x,m_bparams.Xbsep(),m_bparams.Xblen())),  
                       m_predparams.XNumBlocks());

    //Loop over all the block rows
    pos.y = -m_bparams.Yoffset();
    for(int yblock = 0; yblock < y_num_blocks; ++yblock)
    {
        pos.x = -m_bparams.Xoffset();
        int xincr, xb_incr = 0;
        //loop over all the blocks in a row
        for(int xblock = 0 ; xblock < x_num_blocks; xblock+=xb_incr)
        {
            int split_mode =  mv_data.SBSplit()[yblock/blocks_per_mb_row][xblock/blocks_per_mb_row];

            int blk_x, blk_y = 1;

            switch (split_mode)
//.........这里部分代码省略.........
开发者ID:cheeyeo,项目名称:dirac,代码行数:101,代码来源:mot_comp.cpp

示例5: DecodeVal

void SplitModeCodec::DecodeVal(MvData& out_data)
{
    out_data.SBSplit()[m_sb_yp][m_sb_xp] =
                             (DecodeUInt(SB_SPLIT_BIN1_CTX, SB_SPLIT_BIN2_CTX) +
                             Prediction(out_data.SBSplit())) % 3;
}
开发者ID:MOXfiles,项目名称:dirac-research,代码行数:6,代码来源:mv_codec.cpp


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