⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sliceheaderbase.h

📁 JMVM MPEG MVC/3DAV 测试平台 国际通用标准
💻 H
📖 第 1 页 / 共 4 页
字号:
    {
      return !(*this != rcPredWeight);
    }

    Void  copy( const PredWeight& rcPredWeight )
    {
      m_bLumaWeightFlag   = rcPredWeight.m_bLumaWeightFlag;
      m_bChromaWeightFlag = rcPredWeight.m_bChromaWeightFlag;
      m_iLumaWeight       = rcPredWeight.m_iLumaWeight;
      m_iLumaOffset       = rcPredWeight.m_iLumaOffset;
      m_aiChromaWeight[0] = rcPredWeight.m_aiChromaWeight[0];
      m_aiChromaWeight[1] = rcPredWeight.m_aiChromaWeight[1];
      m_aiChromaOffset[0] = rcPredWeight.m_aiChromaOffset[0];
      m_aiChromaOffset[1] = rcPredWeight.m_aiChromaOffset[1];
    }

  private:
    Bool  m_bLumaWeightFlag;
    Bool  m_bChromaWeightFlag;
    Int   m_iLumaWeight;
    Int   m_iLumaOffset;
    Int   m_aiChromaWeight[2];
    Int   m_aiChromaOffset[2];
  };

  class H264AVCCOMMONLIB_API PredWeightTable : public DynBuf<PredWeight>
  {
  public:
    ErrVal initDefaults( UInt uiLumaWeightDenom, UInt uiChromaWeightDenom );
    ErrVal createRandomParameters();

    ErrVal write( HeaderSymbolWriteIf*  pcWriteIf,  UInt uiNumber ) const;
    ErrVal read ( HeaderSymbolReadIf*   pcReadIf,   UInt uiNumber );

//TMM_WP
    ErrVal setPredWeightsAndFlags( const Int iLumaScale, 
                                   const Int iChromaScale, 
                                   const Double(*pafWeight)[3], 
                                   Double fDiscardThr );

    ErrVal setOffsets(  const Double(*pafOffsets)[3] );
//TMM_WP
    ErrVal copy ( const PredWeightTable& rcPredWeightTable );
  };

  class H264AVCCOMMONLIB_API DeblockingFilterParameter
  {
  public:
    DeblockingFilterParameter( UInt uiDisableDeblockingFilterIdc  = 0,
                               Int  iSliceAlphaC0Offset           = 0,
                               Int  iSliceBetaOffset              = 0 )
    : m_uiDisableDeblockingFilterIdc( uiDisableDeblockingFilterIdc )
    , m_iSliceAlphaC0Offset         ( iSliceAlphaC0Offset )
    , m_iSliceBetaOffset            ( iSliceBetaOffset )
    {
    }

    ErrVal write( HeaderSymbolWriteIf*  pcWriteIf ) const;
    ErrVal read ( HeaderSymbolReadIf*   pcReadIf );

    DeblockingFilterParameter* getCopy()  const
    {
      return new DeblockingFilterParameter( m_uiDisableDeblockingFilterIdc, m_iSliceAlphaC0Offset, m_iSliceBetaOffset );
    }
    
    Void setDisableDeblockingFilterIdc( UInt uiDisableDeblockingFilterIdc ) { m_uiDisableDeblockingFilterIdc = uiDisableDeblockingFilterIdc; }
    Void setSliceAlphaC0Offset        ( Int  iSliceAlphaC0Offset )          { AOT_DBG( 1 & iSliceAlphaC0Offset);  m_iSliceAlphaC0Offset = iSliceAlphaC0Offset; }
    Void setSliceBetaOffset           ( Int  iSliceBetaOffset )             { AOT_DBG( 1 & iSliceBetaOffset);     m_iSliceBetaOffset = iSliceBetaOffset; }

    UInt getDisableDeblockingFilterIdc()  const { return m_uiDisableDeblockingFilterIdc;}
    Int  getSliceAlphaC0Offset()          const { return m_iSliceAlphaC0Offset;}
    Int  getSliceBetaOffset()             const { return m_iSliceBetaOffset;}

  private:
    UInt m_uiDisableDeblockingFilterIdc;
    Int  m_iSliceAlphaC0Offset;
    Int  m_iSliceBetaOffset;
  };



protected:
	SliceHeaderBase         ( const SequenceParameterSet& rcSPS,
                            const PictureParameterSet&  rcPPS );
	virtual ~SliceHeaderBase();


public:
  ErrVal    read    ( HeaderSymbolReadIf*   pcReadIf  );
  ErrVal    write   ( HeaderSymbolWriteIf*  pcWriteIf ) const;


  //===== get properties =====
   Bool                              isIdrNalUnit                  ()  const { return ( m_eNalUnitType == NAL_UNIT_CODED_SLICE_IDR || 
                                                                                       (m_eNalUnitType == NAL_UNIT_CODED_SLICE_SCALABLE && m_bIDRFlag) ); }

  Bool                              isH264AVCCompatible           ()  const { return ( m_eNalUnitType == NAL_UNIT_CODED_SLICE  ||
                                                                                       m_eNalUnitType == NAL_UNIT_CODED_SLICE_IDR ); }
 

  Int                               getPicQp                      ()  const { return m_rcPPS.getPicInitQp() + getSliceQpDelta(); }
  UInt                              getMbInPic                    ()  const { return m_rcSPS.getMbInFrame(); }

  
  //===== get parameter sets =====
  const PictureParameterSet&        getPPS                        ()  const { return m_rcPPS; }
  const SequenceParameterSet&       getSPS                        ()  const { return m_rcSPS; }


  //===== get parameters =====
  NalRefIdc                         getNalRefIdc                  ()  const { return m_eNalRefIdc; }
  NalUnitType                       getNalUnitType                ()  const { return m_eNalUnitType; }
  UInt                              getLayerId                    ()  const { return m_uiLayerId; }
  UInt                              getTemporalLevel              ()  const { return m_uiTemporalLevel; }
  UInt                              getQualityLevel               ()  const { return m_uiQualityLevel; }
  UInt                              getFirstMbInSlice             ()  const { return m_uiFirstMbInSlice; }
  SliceType                         getSliceType                  ()  const { return m_eSliceType; }
  UInt                              getPicParameterSetId          ()  const { return m_uiPicParameterSetId; }
  UInt                              getFrameNum                   ()  const { return m_uiFrameNum; }

  Bool		getSvcMvcFlag ()          const { return m_svc_mvc_flag;    }       // u(1)
  UInt 		getAVCFlag()              const { return m_bAVCFlag;        }       // not bit 
  // return m_uiSimplePriorityId                                              // u(6)
  // tmeporal_level                                                           // u(3)
  Bool 		getAnchorPicFlag()        const { return m_anchor_pic_flag; }       // u(1)
  UInt		getViewId()               const { return m_view_id;         }       // u(10) 
  Bool 		getIDRFlag()              const { return m_bIDRFlag;        }       // u(1) // JVT-W035
	Bool		getInterViewFlag()					const	{	return m_inter_view_flag;}       // u(1) // JVT-W056  Samsung
  UInt		getReservedZeroBits()     const { return m_reserved_zero_bits;}     // u(1) // JVT-W035
  void                              setFrameNum      (const int num) { m_uiFrameNum=num; }

  UInt                              getNumMbsInSlice              ()  const { return m_uiNumMbsInSlice; }
  Bool                              getFgsComponentSep            ()  const { return m_bFgsComponentSep; }
  UInt                              getIdrPicId                   ()  const { return m_uiIdrPicId; }
  UInt                              getPicOrderCntLsb             ()  const { return m_uiPicOrderCntLsb; }
  Int                               getDeltaPicOrderCntBottom     ()  const { return m_iDeltaPicOrderCntBottom; }
  Int                               getDeltaPicOrderCnt    (UInt ui)  const { return m_aiDeltaPicOrderCnt[ui]; }
  Bool                              getBasePredWeightTableFlag    ()  const { return m_bBasePredWeightTableFlag; }
  UInt                              getLumaLog2WeightDenom        ()  const { return m_uiLumaLog2WeightDenom; }
  UInt                              getChromaLog2WeightDenom      ()  const { return m_uiChromaLog2WeightDenom; }
  const PredWeightTable&            getPredWeightTable   (ListIdx e)  const { return m_acPredWeightTable[e]; }
  PredWeightTable&                  getPredWeightTable   (ListIdx e)        { return m_acPredWeightTable[e]; }
  const PredWeight&                 getPredWeight        (ListIdx e,
                                                          UInt   ui)  const { return m_acPredWeightTable[e].get(ui-1); }
  PredWeight&                       getPredWeight        (ListIdx e,
                                                          UInt   ui)        { return m_acPredWeightTable[e].get(ui-1); }

//TMM_WP
  ErrVal copyWeightedPred(PredWeightTable& pcPredWeightTable, UInt uiLumaLogWeightDenom,
                          UInt uiChromaWeightDenom, ListIdx eListIdx, Bool bDecoder);
//TMM_WP

  Bool                              getDirectSpatialMvPredFlag    ()  const { return m_bDirectSpatialMvPredFlag; }
  Int							    getSnapShotId                 ()  const { return m_uiSnapShotId; } //SEI LSJ
  Bool                              getKeyPictureFlag             ()  const { return m_bKeyPictureFlag; }
  Bool                              getKeyPicFlagScalable         ()  const { return m_bKeyPicFlagScalable; } //JVT-S036 lsj
  UInt                              getBaseLayerId                ()  const { return m_uiBaseLayerId; }
  UInt                              getBaseQualityLevel           ()  const { return m_uiBaseQualityLevel; }
  Bool                              getAdaptivePredictionFlag     ()  const { return m_bAdaptivePredictionFlag; }
  Bool                              getNumRefIdxActiveOverrideFlag()  const { return m_bNumRefIdxActiveOverrideFlag; }
  UInt                              getNumRefIdxActive ( ListIdx e )  const { return m_auiNumRefIdxActive[e]; }
  const RplrBuffer&                 getRplrBuffer      ( ListIdx e )  const { return m_acRplrBuffer      [e]; }
  RplrBuffer&                       getRplrBuffer      ( ListIdx e )        { return m_acRplrBuffer      [e]; }
  UInt                              getNumRefIdxUpdate ( UInt    ui,
                                                         ListIdx e )  const { return m_aauiNumRefIdxActiveUpdate[ui][e]; }
  Bool                              getNoOutputOfPriorPicsFlag    ()  const { return m_bNoOutputOfPriorPicsFlag; }
  Bool                              getAdaptiveRefPicBufferingFlag()  const { return m_bAdaptiveRefPicBufferingModeFlag; }
  Bool								getAdaptiveRefPicMarkingFlag  ()  const { return m_bAdaptiveRefPicMarkingModeFlag; } //JVT-S036 
  const MmcoBuffer&                 getMmcoBuffer                 ()  const { return m_cMmmcoBuffer; }
  MmcoBuffer&                       getMmcoBuffer                 ()        { return m_cMmmcoBuffer; }
//JVT-S036  start
  const MmcoBuffer&                 getMmcoBaseBuffer             ()  const { return m_cMmmcoBaseBuffer; }
  MmcoBuffer&                       getMmcoBaseBuffer             ()        { return m_cMmmcoBaseBuffer; }
//JVT-S036  end
#if JMVM_ONLY  // JVT-W081
  Int getGlobalDisparityL0         ( UInt ui, UInt uiCompIdx ) const { return m_iGlobalDisparityL0[ui][uiCompIdx]; }
  Int getGlobalDisparityL1         ( UInt ui, UInt uiCompIdx ) const { return m_iGlobalDisparityL1[ui][uiCompIdx]; }
  Int getGlobalDisparityVIdL0      ( UInt ui ) const { return m_iGlobalDisparityRefVIdL0[ui]; }
  Int getGlobalDisparityVIdL1      ( UInt ui ) const { return m_iGlobalDisparityRefVIdL1[ui]; }
  // JVT-W081
  //JVT-Z021
  UInt                              getMbMotionModeIdx           ( UInt uiList  )  const { return m_cMbMotionRd[uiList].m_uiModeIdx; }

  Int                               getMbMotionModeNum           ( UInt uiList  )  const { return m_cMbMotionRd[uiList].m_iModeNumber; }

  class MBMotion                    getMbMotionInfo              ( UInt uiList, UInt uiIdx ) const { return m_cMbMotionRd[uiList].m_cMbMotionInfo[uiIdx]; }
#endif //JVT-Z021
  //TMM_EC {{
  Void								setDefualtMmcoBuffer(UInt uiDecompositionStages, Bool Number2)
  {
	m_cMmmcoBuffer.clear();

	UInt uiCount=0;
	UInt	uiGopSize	=	1 << uiDecompositionStages;
	for( Int iIndex=uiGopSize/2-2;iIndex>=0;iIndex-- )
	{
		m_cMmmcoBuffer.set( uiCount++, Mmco(MMCO_SHORT_TERM_UNUSED,iIndex));
	}
	if(!Number2)m_cMmmcoBuffer.set(uiCount++,Mmco(MMCO_SHORT_TERM_UNUSED,uiGopSize/2));
	else       m_cMmmcoBuffer.set(uiCount++,Mmco(MMCO_SHORT_TERM_UNUSED,uiGopSize-1));

	m_cMmmcoBuffer.set(uiCount++,Mmco(MMCO_END));

    return ;	  
  }

  UInt                              getCabacInitIdc               ()  const { return m_uiCabacInitIdc; }
  Int                               getSliceQpDelta               ()  const { return m_iSliceQpDelta; }
  const DeblockingFilterParameter&  getDeblockingFilterParameter  ()  const { return m_cDeblockingFilterParameter; }
  DeblockingFilterParameter&        getDeblockingFilterParameter  ()        { return m_cDeblockingFilterParameter; }

  UInt  getLog2MaxSliceGroupChangeCycle(UInt uiPicSizeInMapUnits) const {return UInt(ceil( (log ( uiPicSizeInMapUnits*(getPPS().getSliceGroupChangeRateMinus1()+1.)+ 1. ))/log(2.) ));};
  UInt  getSliceGroupChangeCycle() const {return m_uiSliceGroupChangeCycle;}
  FMO*  getFMO() const { return  m_pcFMO;}
  Int getNumMbInSlice();

  UInt                              getBaseWeightZeroBaseBlock()            { return m_uiBaseWeightZeroBaseBlock;     }
  UInt                              getBaseWeightZeroBaseCoeff()            { return m_uiBaseWeightZeroBaseCoeff;     }

  Void  setBaseWeightZeroBaseBlock(UInt ui)
  { 
    AOT( ui > AR_FGS_MAX_BASE_WEIGHT );
    m_uiBaseWeightZeroBaseBlock = (ui <= 1) ? 0 : ui; 
  }
  Void  setBaseWeightZeroBaseCoeff(UInt ui)
  {
    AOT( ui > AR_FGS_MAX_BASE_WEIGHT );
    m_uiBaseWeightZeroBaseCoeff = (ui <= 1) ? 0 : ui; 
  }

  Void  setArFgsUsageFlag               ( Bool b  )         { m_bArFgsUsageFlag       = b;  }
  Bool  getArFgsUsageFlag               ()                  { return m_bArFgsUsageFlag;     }

  Void  setFgsEntropyOrderFlag               ( Bool b  )         { m_bFgsEntropyOrderFlag       = b;  }
  Bool  getFgsEntropyOrderFlag               ()                  { return m_bFgsEntropyOrderFlag;     }
  
  Void  setLowPassFgsMcFilter           ( UInt ui )         { m_uiLowPassFgsMcFilter  = ui;  }
  UInt  getLowPassFgsMcFilter           ()                  { return m_uiLowPassFgsMcFilter;  }
  

  //{{Variable Lengh NAL unit header data with priority and dead substream flag
  //France Telecom R&D- (nathalie.cammas@francetelecom.com)
  UInt                              getSimplePriorityId			  ()	    { return m_uiSimplePriorityId;}
  Bool                              getDiscardableFlag			  ()		{ return m_bDiscardableFlag;}
  Bool                              getReservedZeroBit            ()    	{ return m_bReservedZeroBit;} //JVT-S036 
  //}}Variable Lengh NAL unit header data with priority and dead substream flag

  //JVT-P031
  Bool                              getFragmentedFlag              ()       {return m_bFragmentedFlag;}
  UInt                              getFragmentOrder               ()       {return m_uiFragmentOrder;}
  Bool                              getLastFragmentFlag            ()       {return m_bLastFragmentFlag;}
  Void                              setFragmentedFlag              (Bool b)    {m_bFragmentedFlag = b;}
  Void                              setFragmentOrder               (UInt ui)   {m_uiFragmentOrder = ui;}
  Void                              setLastFragmentFlag            (Bool b)    {m_bLastFragmentFlag = b;}
  //~JVT-P031
//JVT-T054{
  Void                              setBaseFragmentOrder          ( UInt        ui )  { m_uiBaseFragmentOrder               = ui; }           
//JVT-T054}
  Bool                              getBaseLayerUsesConstrainedIntraPred() const { return m_bBaseLayerUsesConstrainedIntraPred; }
  UInt                              getRedundantPicCnt             ()       { return m_uiRedundantPicCnt; } // JVT-Q054 Red. Picture

#if JMVM_ONLY  // JVT-U052
  UInt                              getIcEnable                    ()       {return m_uiIcEnable;}
  UInt                              getMotionSkip                  () const {return m_bMotionSkip; }
#endif

  //===== set parameters =====
  Void  setAVCCompatible              ( Bool     Flag  )  { m_eAVCCompatible                    = Flag;}  //JVT-S036 
  Void  setNalRefIdc                  ( NalRefIdc   e  )  { m_eNalRefIdc                        = e;  }
  Void  setNalUnitType                ( NalUnitType e  )  { m_eNalUnitType                      = e;  }
  Void  setLayerId                    ( UInt        ui )  { m_uiLayerId                         = ui; }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -