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


C++ SliceHeader类代码示例

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


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

示例1: RNOK

ErrVal
RecPicBuffer::ProcessRef(SliceHeader&   rcSliceHeader, RefFrameList&  rcList ,RefFrameList&  rcListTemp, QuarterPelFilter* pcQuarterPelFilter)
{
  UInt uiPos; 
  PicType ePicType=rcSliceHeader.getPicType();
  bool bFieldPic=(ePicType!=FRAME);

  for( uiPos = 0; uiPos < rcListTemp.getSize() ; uiPos++ )
  {
    IntFrame* pcRefFrame = rcListTemp.getEntry( uiPos );
	if( 1)//! ( pcRefFrame->isHalfPel() && pcRefFrame->isPicReady(FRAME) ) )
    {
      RNOK( pcRefFrame->initHalfPel() );
    }
    if( ! pcRefFrame->isExtended() )
    {
		RNOK( pcRefFrame->extendFrame( pcQuarterPelFilter, FRAME, rcSliceHeader.getSPS().getFrameMbsOnlyFlag() ));
    }
  }

  if(bFieldPic)//lufeng
	xFieldList(rcSliceHeader,rcList,rcListTemp);
  else
  {
	   for( uiPos = 0; uiPos < rcListTemp.getSize() ; uiPos++ )
	   {
		   rcListTemp[uiPos+1]->getFullPelYuvBuffer()->fillMargin();//lufeng: for frame ref
		 rcList.add(rcListTemp[uiPos+1]);
	   }
  }

  return Err::m_nOK;
}
开发者ID:edwardtoday,项目名称:BE-thesis-code,代码行数:33,代码来源:RecPicBuffer.cpp

示例2: GetPOC

bool POCState::GetPOC(NALUnit* nal, int* pPOC)
{
    int maxlsb = 1 << (m_sps.POCLSBBits());
    SliceHeader slice;
    if (slice.Parse(nal, &m_sps, m_deltaPresent))
    {
        int prevMSB = m_prevMSB;
        int prevLSB = m_prevLSB;
        if (nal->Type() == NALUnit::NAL_IDR_Slice)
        {
            prevLSB = prevMSB= 0;
        }
        // !! mmoc == 5
        
        int lsb = slice.POCLSB();
        int MSB = prevMSB;
        if ((lsb < prevLSB) && ((prevLSB - lsb) >= (maxlsb / 2)))
        {
            MSB = prevMSB + maxlsb;
        }
        else if ((lsb > prevLSB) && ((lsb - prevLSB) > (maxlsb/2)))
        {
            MSB = prevMSB - maxlsb;
        }
        if (nal->IsRefPic())
        {
            m_prevLSB = lsb;
            m_prevMSB = MSB;
        }
        
        *pPOC = MSB + lsb;
        return true;
    }
    return false;
}
开发者ID:9aa5,项目名称:encoderdemo,代码行数:35,代码来源:NALUnit.cpp

示例3:

// ----------------------------------------------------------------------
//
// FUNCTION:	AddMultiviewRefsToList
//
// INPUTS:	recPicBufUnitList:  A list of refernce pictures potentially
//				    containing multiview references.
//		rcList:  A RefFrameList object to add multiview references to.
//		refDirection:  Direction of references to add to rcList. 
//
// PURPOSE:	This function goes through each reference in recPicBufUnitList,
//		finds all multiview references with the given refDirection,
//		and adds them to rcList.  
//
// MODIFIED:	Tue Mar 14, 2006
//
// ----------------------------------------------------------------------
// modified to be a member of RecPicBuffer 26 Dec, 2006
// and the format has also been adjusted (AddMultiviewRef)
// Simplified again for JVT-V043 7 Feb. 2007
// and some cleanup
ErrVal 
RecPicBuffer::AddMultiviewRef( RecPicBufUnitList& recPicBufUnitList,
			                          RefFrameList& rcList, const int maxListSize,
			                          const MultiviewReferenceDirection refDirection, SliceHeader&   rcSliceheader,
									  QuarterPelFilter* pcQuarterPelFilter) {


  RefFrameList tempList;
  RecPicBufUnitList::iterator iter;

  for (iter  = recPicBufUnitList.begin();iter != recPicBufUnitList.end(); iter++) {
    if ( refDirection == (*iter)->GetMultiviewReferenceDirection() ) {
			if(m_pcPicEncoder->derivation_Inter_View_Flag((*iter)->getViewId(), rcSliceheader)){                        //JVT-W056  Samsung
				RecPicBufUnit* bufUnitToAdd = (*iter);   
				if( 1)
				{
					RNOK( bufUnitToAdd->getRecFrame()->initHalfPel() );
				}
				if( ! bufUnitToAdd->getRecFrame()->isExtended() )
				{
					RNOK( bufUnitToAdd->getRecFrame()->extendFrame( pcQuarterPelFilter, FRAME, rcSliceheader.getSPS().getFrameMbsOnlyFlag() ));
				}
				rcList.add( bufUnitToAdd->getRecFrame()->getPic(rcSliceheader.getPicType()) );
			}
    }
  }
  return Err::m_nOK;
}
开发者ID:edwardtoday,项目名称:BE-thesis-code,代码行数:48,代码来源:RecPicBuffer.cpp

示例4: RNOK

ErrVal ControlMngH264AVCEncoder::initSlice( SliceHeader& rcSH, ProcessingState eProcessingState )
{
  m_uiCurrLayer   = rcSH.getSPS().getLayerId();
  m_pcMbDataCtrl = rcSH.getFrameUnit()->getMbDataCtrl();

  RNOK( m_pcMbDataCtrl          ->initSlice( rcSH, eProcessingState, false, NULL ) );
  RNOK( m_pcMotionEstimation    ->initSlice( rcSH ) );
  RNOK( m_pcSampleWeighting     ->initSlice( rcSH ) );
  RNOK( m_pcMbEncoder           ->initSlice( rcSH ) );

  if( ENCODE_PROCESS == eProcessingState )
  {
    Bool bCabac = rcSH.getPPS().getEntropyCodingModeFlag();
    if( bCabac )
    {
      m_pcMbSymbolWriteIf = m_pcCabacWriter;
    }
    else
    {
      m_pcMbSymbolWriteIf = m_pcUvlcWriter;
    }

    RNOK( m_pcMbSymbolWriteIf->startSlice( rcSH ) );
    RNOK( m_pcMbCoder->initSlice( rcSH, m_pcMbSymbolWriteIf, m_pcRateDistortion ) );
  }

  return Err::m_nOK;
}
开发者ID:Moutarde,项目名称:3DWebcam,代码行数:28,代码来源:ControlMngH264AVCEncoder.cpp

示例5: 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

示例6: RNOK

ErrVal ControlMngH264AVCDecoder::initSliceForDecoding( const SliceHeader& rcSH )
{
  m_uiCurrLayer   = rcSH.getLayerId();

  RNOK( m_pcMotionCompensation->initSlice( rcSH ) );
  RNOK( m_pcSampleWeighting->initSlice( rcSH ) );

  return Err::m_nOK;
}
开发者ID:edwardtoday,项目名称:BE-thesis-code,代码行数:9,代码来源:ControlMngH264AVCDecoder.cpp

示例7: min

ErrVal
RecPicBuffer::xAdaptListSize( RefFrameList& rcList,
                              ListIdx       eListIdx,
                              SliceHeader&  rcSliceHeader )
{
  UInt  uiDefaultListSize = rcSliceHeader.getNumRefIdxActive( eListIdx );
  UInt  uiMaximumListSize = rcList.getActive();
  UInt  uiCurrentListSize = min( uiDefaultListSize, uiMaximumListSize );
  //===== update slice header =====
  rcList.       setActive         (           uiCurrentListSize );
  rcSliceHeader.setNumRefIdxActive( eListIdx, uiCurrentListSize );
  if( uiCurrentListSize != rcSliceHeader.getPPS().getNumRefIdxActive( eListIdx ) )
  {
    rcSliceHeader.setNumRefIdxActiveOverrideFlag( true );
  }

  return Err::m_nOK;
}
开发者ID:edwardtoday,项目名称:BE-thesis-code,代码行数:18,代码来源:RecPicBuffer.cpp

示例8: ROTRS

// JVT-V043 and some cleanup
ErrVal
RecPicBuffer::getRefLists( RefFrameList&  rcList0,
                           RefFrameList&  rcList1,
                           SliceHeader&   rcSliceHeader,
						   QuarterPelFilter* pcQuarterPelFilter)
{
  //===== clear lists =====
	RefFrameList rcListTemp0, rcListTemp1;
  rcList0.reset();
  rcList1.reset();
  ROTRS( rcSliceHeader.isIntra(), Err::m_nOK );

  PicType ePicType = rcSliceHeader.getPicType();
  if( rcSliceHeader.isInterP() )
  {
    RNOK( xInitRefListPSlice  ( rcListTemp0 , ePicType, rcSliceHeader.getNalRefIdc()>0) );
	ProcessRef(rcSliceHeader,rcList0,rcListTemp0,pcQuarterPelFilter);//lufeng


	AddMultiviewRef (m_cUsedRecPicBufUnitList, rcList0, rcSliceHeader.getNumRefIdxActive(LIST_0), FORWARD, rcSliceHeader, pcQuarterPelFilter);//JVT-W056  Samsung
	RNOK( xRefListRemapping   ( rcList0, LIST_0, &rcSliceHeader ) );

    RNOK( xAdaptListSize      ( rcList0, LIST_0,  rcSliceHeader ) );
    RNOK( xDumpRefList        ( rcList0, LIST_0 ) );
  }
  else // rcSliceHeader.isInterB()
  {
    
	RNOK( xInitRefListsBSlice ( rcListTemp0, rcListTemp1 , ePicType , rcSliceHeader.getNalRefIdc()>0) );
    
	ProcessRef(rcSliceHeader,rcList0,rcListTemp0,pcQuarterPelFilter);//lufeng
	ProcessRef(rcSliceHeader,rcList1,rcListTemp1,pcQuarterPelFilter);//lufeng

	AddMultiviewRef(m_cUsedRecPicBufUnitList, rcList0, rcSliceHeader.getNumRefIdxActive(LIST_0), FORWARD, rcSliceHeader, pcQuarterPelFilter);//JVT-W056  Samsung
    AddMultiviewRef(m_cUsedRecPicBufUnitList, rcList1, rcSliceHeader.getNumRefIdxActive(LIST_1), BACKWARD, rcSliceHeader, pcQuarterPelFilter);//JVT-W056  Samsung

	RNOK( xRefListRemapping   ( rcList0, LIST_0, &rcSliceHeader ) );
    RNOK( xRefListRemapping   ( rcList1, LIST_1, &rcSliceHeader ) );
    
    RNOK( xAdaptListSize      ( rcList0, LIST_0,  rcSliceHeader ) );
    RNOK( xAdaptListSize      ( rcList1, LIST_1,  rcSliceHeader ) );
    RNOK( xDumpRefList        ( rcList0, LIST_0 ) );
    RNOK( xDumpRefList        ( rcList1, LIST_1 ) );
  }

  return Err::m_nOK;
}
开发者ID:edwardtoday,项目名称:BE-thesis-code,代码行数:48,代码来源:RecPicBuffer.cpp

示例9: RNOK

ErrVal ControlMngH264AVCDecoder::initSlice( SliceHeader& rcSH, ProcessingState eProcessingState )
{
  m_uiCurrLayer   = rcSH.getLayerId();
  m_pcMbDataCtrl  = rcSH.getFrameUnit()->getMbDataCtrl();

  RNOK( m_pcMbDataCtrl->initSlice( rcSH, eProcessingState, true, NULL ) );
  RNOK( m_pcSampleWeighting->initSlice( rcSH ) );

  if( PARSE_PROCESS == eProcessingState && rcSH.getTrueSlice())//TMM_EC
  {
    MbSymbolReadIf* pcMbSymbolReadIf;
    
    if( rcSH.getPPS().getEntropyCodingModeFlag() )
    {
      pcMbSymbolReadIf = m_pcCabacReader;
    }
    else
    {
      pcMbSymbolReadIf = m_pcUvlcReader;
    }

    RNOK( pcMbSymbolReadIf->startSlice( rcSH ) );
    RNOK( m_pcMbParser->initSlice( pcMbSymbolReadIf ) );

  }

  if( DECODE_PROCESS == eProcessingState)
  {
    RNOK( m_pcMotionCompensation->initSlice( rcSH ) );
  }
#ifdef   LF_INTERLACE
  m_bMbAff = rcSH.isMbAff(); // for future use
  m_pcSliceHeader = &rcSH;
#endif
  return Err::m_nOK;
}
开发者ID:edwardtoday,项目名称:BE-thesis-code,代码行数:36,代码来源:ControlMngH264AVCDecoder.cpp

示例10: initSlice

ErrVal MbCoder::initSlice(  const SliceHeader& rcSH,
                            MbSymbolWriteIf*   pcMbSymbolWriteIf,
                            RateDistortionIf*  pcRateDistortionIf )
{
  ROT( NULL == pcMbSymbolWriteIf );
  ROT( NULL == pcRateDistortionIf );

  m_pcMbSymbolWriteIf = pcMbSymbolWriteIf;
  m_pcRateDistortionIf = pcRateDistortionIf;

  m_bCabac          = rcSH.getPPS().getEntropyCodingModeFlag();
  m_bPrevIsSkipped  = false;

  m_bInitDone = true;

  return Err::m_nOK;
}
开发者ID:edwardtoday,项目名称:BE-thesis-code,代码行数:17,代码来源:MbCoder.cpp

示例11: while

ErrVal
RecPicBuffer::xFieldList(    SliceHeader&   rcSliceHeader,
                           RefFrameList&  rcList,
                           RefFrameList&  rcListTemp )
{
	PicType               eCurrPicType      = rcSliceHeader.getPicType();
    PicType               eOppositePicture  = ( eCurrPicType == TOP_FIELD ? BOT_FIELD : TOP_FIELD );

    //----- initialize field list for short term pictures -----
    UInt  uiCurrentParityIndex  = 0;
    UInt  uiOppositeParityIndex = 0;

    while( uiCurrentParityIndex < rcListTemp.getActive() || uiOppositeParityIndex < rcListTemp.getActive() )
    {
        //--- current parity ---
        while( uiCurrentParityIndex < rcListTemp.getActive() )
        {
			if( rcListTemp[++uiCurrentParityIndex]->isPicReady( eCurrPicType ) )
            {
				rcList.add(rcListTemp[uiCurrentParityIndex]->getPic(eCurrPicType));
                break;
            }
        }
        //--- opposite parity ---
		while( uiOppositeParityIndex < rcListTemp.getActive() )
        {
			if( rcListTemp[++uiOppositeParityIndex]->isPicReady( eOppositePicture ) )
            {
				rcList.add(rcListTemp[uiOppositeParityIndex]->getPic(eOppositePicture));
                break;
            }
        }
    }

    return Err::m_nOK;
}
开发者ID:edwardtoday,项目名称:BE-thesis-code,代码行数:36,代码来源:RecPicBuffer.cpp

示例12:

ErrVal ControlMngH264AVCDecoder::initSliceForFiltering( const SliceHeader& rcSH )
{
  m_uiCurrLayer   = rcSH.getLayerId();

  return Err::m_nOK;
}
开发者ID:edwardtoday,项目名称:BE-thesis-code,代码行数:6,代码来源:ControlMngH264AVCDecoder.cpp

示例13: 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

示例14: 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

示例15: AOF_DBG

ErrVal MbDataCtrl::initSlice( SliceHeader& rcSH, ProcessingState eProcessingState, Bool bDecoder, MbDataCtrl* pcMbDataCtrl )
{
  AOF_DBG( m_bInitDone );

  m_eProcessingState  = eProcessingState;
  m_pcMbDataCtrl0L1   = NULL;

  m_iColocatedOffset  = 0;
  m_bUseTopField      = false;
  m_bPicCodedField    = rcSH.getFieldPicFlag();

  if( rcSH.isInterB() )
  {
    if( ((rcSH.getNalUnitType() != NAL_UNIT_CODED_SLICE_IDR_SCALABLE &&
          rcSH.getNalUnitType() != NAL_UNIT_CODED_SLICE_SCALABLE) || (!rcSH.getSvcMvcFlag()) ) && bDecoder
          && rcSH.getRefListSize( LIST_1 )
		  )
    {
      const RefPic& rcRefPic0L1 = rcSH.getRefPic( 1, rcSH.getPicType(), LIST_1 );
      AOF_DBG( rcRefPic0L1.isAvailable() );
      const FrameUnit* pcFU = rcRefPic0L1.getPic().getFrameUnit();
      Int iCurrPoc    = rcSH.getPoc();
      Int iTopDiffPOC = iCurrPoc - pcFU->getTopField().getPOC();
      Int iBotDiffPOC = iCurrPoc - pcFU->getBotField().getPOC();

      m_bUseTopField    = (abs( iTopDiffPOC ) < abs( iBotDiffPOC ) );

      m_pcMbDataCtrl0L1 = pcFU->getMbDataCtrl();

      if( FRAME != rcSH.getPicType() )
      {
          if( rcRefPic0L1.getFrame()->getPicType() != rcSH.getPicType() && m_pcMbDataCtrl0L1->isPicCodedField() )
          {
              m_iColocatedOffset = m_iMbPerLine;
          }
      }
	 

    }

    if( pcMbDataCtrl )
    {
      m_pcMbDataCtrl0L1 = pcMbDataCtrl;
    }

    if(!bDecoder)
    { // Fix by [email protected] & Dong
      if (eProcessingState == ENCODE_PROCESS)
      {
        if( (rcSH.getNalUnitType() != NAL_UNIT_CODED_SLICE_IDR_SCALABLE &&
          rcSH.getNalUnitType() != NAL_UNIT_CODED_SLICE_SCALABLE) || (!rcSH.getSvcMvcFlag()) )
        {
          PicType picType = rcSH.getPicType();
          RefFrameList* pRefFrameList1 = rcSH.getRefFrameList(picType, LIST_1);

          Int iCurrPoc    = rcSH.getPoc();
          Int iTopDiffPOC = iCurrPoc - pRefFrameList1->getEntry( 0 )->getTopFieldPoc();
          Int iBotDiffPOC = iCurrPoc - pRefFrameList1->getEntry( 0 )->getBotFieldPoc();

          m_bUseTopField    = (abs( iTopDiffPOC ) < abs( iBotDiffPOC ) );

          if( FRAME != rcSH.getPicType() )
          {
            if( pRefFrameList1->getEntry( 0 )->getPicType() != rcSH.getPicType() && m_pcMbDataCtrl0L1->isPicCodedField() )
            {
              m_iColocatedOffset = m_iMbPerLine;
            }
          }
        }
      }
      else
      {
        m_bUseTopField = true;//lufeng: default
      }
    }
  }

  if( PARSE_PROCESS == m_eProcessingState || ENCODE_PROCESS == m_eProcessingState )
  {
    m_uiSliceId++;

    //[email protected] : memory leak fix
    if( m_cpDFPBuffer.get( m_uiSliceId ) )
    {
      delete m_cpDFPBuffer.get( m_uiSliceId );
      m_cpDFPBuffer.set( m_uiSliceId, NULL );
    }
    //--

    m_cpDFPBuffer.set( m_uiSliceId, rcSH.getDeblockingFilterParameter().getCopy() );
    m_bDirect8x8InferenceFlag = rcSH.getSPS().getDirect8x8InferenceFlag();
  }
  m_pcSliceHeader = &rcSH;


  Int iMbPerColumn  = rcSH.getSPS().getFrameHeightInMbs ();
  m_iMbPerLine      = rcSH.getSPS().getFrameWidthInMbs  ();

  m_uiMbOffset      = rcSH.getBottomFieldFlag() ? 1 * m_iMbPerLine : 0;
  m_uiMbStride      = rcSH.getFieldPicFlag()    ? 2 * m_iMbPerLine : m_iMbPerLine;
//.........这里部分代码省略.........
开发者ID:Moutarde,项目名称:3DWebcam,代码行数:101,代码来源:MbDataCtrl.cpp


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