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


C++ SliceHeader::isBSlice方法代码示例

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


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

示例1: ROF

ErrVal
SliceEncoder::encodeSlice( SliceHeader&  rcSliceHeader,
                           Frame*        pcFrame,
                           MbDataCtrl*   pcMbDataCtrl,
                           RefListStruct& rcRefListStruct,
                           Bool          bMCBlks8x8Disable,
                           UInt          uiMbInRow,
                           Double        dlambda )
{
  ROF( pcFrame );
  ROF( pcMbDataCtrl );
  UInt uiMaxMvPerMb = rcSliceHeader.getSPS().getMaxMVsPer2Mb () >> 1; // hard limit (don't take into account last macroblock)

  //===== get co-located picture =====
  MbDataCtrl*   pcMbDataCtrlL1 = NULL;
  RefFrameList& rcList1        = rcRefListStruct.acRefFrameListME[1];
  if( rcList1.getActive() && rcList1.getEntry( 0 )->getRecPicBufUnit() )
  {
    pcMbDataCtrlL1 = rcList1.getEntry( 0 )->getRecPicBufUnit()->getMbDataCtrl();
  }
  ROT( rcSliceHeader.isBSlice() && ! pcMbDataCtrlL1 );

  //===== initialization =====
  RNOK( pcMbDataCtrl  ->initSlice         ( rcSliceHeader, ENCODE_PROCESS, false, pcMbDataCtrlL1 ) );
  RNOK( m_pcControlMng->initSliceForCoding( rcSliceHeader ) );



  //===== loop over macroblocks =====
  for( UInt uiMbAddress = rcSliceHeader.getFirstMbInSlice(); uiMbAddress <= rcSliceHeader.getLastMbInSlice(); uiMbAddress = rcSliceHeader.getFMO()->getNextMBNr( uiMbAddress ) )
  {
    UInt          uiMbY           = uiMbAddress / uiMbInRow;
    UInt          uiMbX           = uiMbAddress % uiMbInRow;
    MbDataAccess* pcMbDataAccess  = 0;

    RNOK( pcMbDataCtrl  ->initMb          (  pcMbDataAccess, uiMbY, uiMbX ) );
    RNOK( m_pcControlMng->initMbForCoding ( *pcMbDataAccess, uiMbY, uiMbX, false, false  ) );
    pcMbDataAccess->setMbDataAccessBase   ( NULL );

    RNOK( m_pcMbEncoder ->encodeMacroblock( *pcMbDataAccess,
                                             pcFrame,
                                             rcRefListStruct,
                                             uiMaxMvPerMb,
                                             bMCBlks8x8Disable,
                                             m_pcCodingParameter->getBiPred8x8Disable() > 0,
                                             m_pcCodingParameter->getMotionVectorSearchParams().getNumMaxIter(),
                                             m_pcCodingParameter->getMotionVectorSearchParams().getIterSearchRange(),
                                             dlambda ) );
    RNOK( m_pcMbCoder   ->encode          ( *pcMbDataAccess,
                                              NULL,
                                             ( uiMbAddress == rcSliceHeader.getLastMbInSlice() )
                                             ,true ) );
  }

  return Err::m_nOK;
}
开发者ID:hwyhit,项目名称:JSVM,代码行数:56,代码来源:SliceEncoder.cpp

示例2: xSetPredWeights

ErrVal SliceEncoder::xSetPredWeights( SliceHeader& rcSH,
                                      Frame* pOrgFrame,
                                      RefListStruct& rcRefListStruct )
{
  ROTRS( rcSH.isIntraSlice(), Err::m_nOK );

  RefFrameList& rcRefFrameList0 = rcRefListStruct.acRefFrameListRC[0];
  RefFrameList& rcRefFrameList1 = rcRefListStruct.acRefFrameListRC[1];
  const SampleWeightingParams& rcSWP = m_pcCodingParameter->getSampleWeightingParams(rcSH.getDependencyId());

  { // determine denoms
    const UInt uiLumaDenom = rcSWP.getLumaDenom();
    rcSH.setLumaLog2WeightDenom  ( ( uiLumaDenom == MSYS_UINT_MAX ) ? gIntRandom(0,7) : uiLumaDenom );

    const UInt uiChromaDenom = rcSWP.getChromaDenom();
    rcSH.setChromaLog2WeightDenom( ( uiChromaDenom == MSYS_UINT_MAX ) ? gIntRandom(0,7) : uiChromaDenom );
  }

  const Int iChromaScale = 1<<rcSH.getChromaLog2WeightDenom();
  const Int iLumaScale   = 1<<rcSH.getLumaLog2WeightDenom();

  m_pcControlMng->initSliceForWeighting(rcSH);

  if( rcSH.isBSlice() )
  {
      ROTRS( 1 != rcSH.getPPS().getWeightedBiPredIdc(), Err::m_nOK );
  }
  else
  {
    ROTRS( ! rcSH.getPPS().getWeightedPredFlag(), Err::m_nOK );
  }

  if( rcSH.isBSlice() )
  {
      RNOK( rcSH.getPredWeightTable(LIST_1).initDefaults( rcSH.getLumaLog2WeightDenom(), rcSH.getChromaLog2WeightDenom() ) );
  }
  RNOK( rcSH.getPredWeightTable(LIST_0).initDefaults( rcSH.getLumaLog2WeightDenom(), rcSH.getChromaLog2WeightDenom() ) );

  Double afFwWeight[MAX_REF_FRAMES][3];
  Double afBwWeight[MAX_REF_FRAMES][3];

  Double afFwOffsets[MAX_REF_FRAMES][3];
  Double afBwOffsets[MAX_REF_FRAMES][3];

  /* init arrays with default weights */
  for (UInt x = 0; x < MAX_REF_FRAMES; x++)
  {
      xInitDefaultWeights(afFwWeight[x], rcSH.getLumaLog2WeightDenom(), rcSH.getChromaLog2WeightDenom());
      xInitDefaultWeights(afBwWeight[x], rcSH.getLumaLog2WeightDenom(), rcSH.getChromaLog2WeightDenom());

      afFwOffsets[x][0] = afFwOffsets[x][1] = afFwOffsets[x][2] = 0;
      afBwOffsets[x][0] = afBwOffsets[x][1] = afBwOffsets[x][2] = 0;
  }

  if( rcSH.isBSlice() )
  {
      RNOK( m_pcMbEncoder->getPredWeights( rcSH, LIST_1, afBwWeight,
                                           pOrgFrame, rcRefFrameList1 ) );
      RNOK( rcSH.getPredWeightTable( LIST_1).setWeights( afBwWeight, iLumaScale, iChromaScale ) );
  }

  RNOK( m_pcMbEncoder->getPredWeights( rcSH, LIST_0, afFwWeight, pOrgFrame, rcRefFrameList0 ) );
  RNOK( rcSH.getPredWeightTable( LIST_0).setWeights( afFwWeight, iLumaScale, iChromaScale ) );

  return Err::m_nOK;
}
开发者ID:hwyhit,项目名称:JSVM,代码行数:66,代码来源:SliceEncoder.cpp

示例3: switch

ErrVal
SampleWeighting::initSlice( const SliceHeader& rcSliceHeader )
{
  if( rcSliceHeader.isIntraSlice() )
  {
    m_bWeightedPredDisableP = true;
    m_bWeightedPredDisableB = true;
    m_bExplicit             = false;
    return Err::m_nOK;
  }
  if( rcSliceHeader.isPSlice() )
  {
    m_bExplicit             = rcSliceHeader.getPPS().getWeightedPredFlag();
    m_bWeightedPredDisableP = ! m_bExplicit;
    m_bWeightedPredDisableB = true;
    if( m_bExplicit )
    {
      m_uiLumaLogWeightDenom   = rcSliceHeader.getLumaLog2WeightDenom();
      m_uiChromaLogWeightDenom = rcSliceHeader.getChromaLog2WeightDenom();
    }
    return Err::m_nOK;
  }
  if( rcSliceHeader.isBSlice() )
  {
    switch( rcSliceHeader.getPPS().getWeightedBiPredIdc() )
    {
    case 0:
      {
        m_bExplicit               = false;
        m_bWeightedPredDisableP   = true;
        m_bWeightedPredDisableB   = true;
        m_uiLumaLogWeightDenom    = 0;
        m_uiChromaLogWeightDenom  = 0;
      }
      break;
    case 1:
      {
        m_bExplicit               = true;
        m_bWeightedPredDisableP   = false;
        m_bWeightedPredDisableB   = false;
        m_uiLumaLogWeightDenom    = rcSliceHeader.getLumaLog2WeightDenom();
        m_uiChromaLogWeightDenom  = rcSliceHeader.getChromaLog2WeightDenom();
      }
      break;
    case 2:
      {
        m_bExplicit               = false;
        m_bWeightedPredDisableP   = true;
        m_bWeightedPredDisableB   = false;
        m_uiLumaLogWeightDenom    = 5;
        m_uiChromaLogWeightDenom  = 5;
      }
      break;
    default:
      {
        AF();
      }
      break;
    }
  }
  return Err::m_nOK;
}
开发者ID:Aldream,项目名称:jsvm,代码行数:62,代码来源:SampleWeighting.cpp


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