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

📄 extractor.h

📁 JMVM MPEG MVC/3DAV 测试平台 国际通用标准
💻 H
📖 第 1 页 / 共 2 页
字号:
};



class Extractor  
{
protected:
	Extractor();
	virtual ~Extractor();

public:
  static ErrVal create              ( Extractor*&         rpcExtractor );
  ErrVal        init                ( ExtractorParameter* pcExtractorParameter );
  ErrVal        go                  ();
  ErrVal        destroy             ();

  // ROI ICU/ETRI
  Int		ROI_ID[8][8];
  void		setROI_ID(UInt did, UInt sg_id,Int value){ROI_ID[did][sg_id]=value;};
  Int		getROI_ID(UInt did, UInt sg_id){if(sg_id ==-1) return -1;  return ROI_ID[did][sg_id];};
  void		init_ROI_ID()
  { 
    for(int i=0;i<8;i++)
	for(int j=0;j<8;j++)
		ROI_ID[i][j]= -1;
  } 
  Int			getNumSlice			()		const { return 	m_iNumSlice; };   


 //JVT-S080 LMI {
  ErrVal        xWriteScalableSEIToBuffer( h264::SEI::ScalableSei* pcScalableSei, BinData* pcBinData );
  ErrVal        xWriteScalableSEILyrsNotPreToBuffer( h264::SEI::ScalableSeiLayersNotPresent* pcScalableSei, BinData* pcBinData );
  ErrVal        xWriteScalableSEIDepChangeToBuffer( h264::SEI::ScalableSeiDependencyChange* pcScalableSei, BinData* pcBinData );
 //JVT-S080 LMI }
  //{{Quality level estimation and modified truncation- JVTO044 and m12007
  //France Telecom R&D-(nathalie.cammas@francetelecom.com)
  //if there is dead substream in the input bitstream but no R/D information
  ErrVal        go_DS                  ();
  //if there is R/D information (with or without Dead substreams)
  ErrVal        go_QL                  ();
  //}}Quality level estimation and modified truncation- JVTO044 and m12007

  //S051{
  ErrVal		go_SIP();
  //S051}

protected:
  ErrVal        xAnalyse            ();
  ErrVal        xPrimaryAnalyse            ();
  ErrVal        xSetParameters      ();
  ErrVal        xExtractPoints      ();
  ErrVal        xExtractLayerLevel  ();


  // ROI ICU/ETRI
  Int CurNalKeepingNeed(h264::PacketDescription cPacketDescription
								 , const ExtractorParameter::Point& rcExtPoint);

  void			xSetROIParameters	();


  Void          setBaseLayerAVCCompatible( Bool bAVCCompatible ) { m_bAVCCompatible = bAVCCompatible; }
  Bool          getBaseLayerAVCCompatible() const { return m_bAVCCompatible; }
  // JVT-S080 LMI {
  ErrVal        xChangeScalableSEIMesssage( BinData *pcBinData, BinData *pcBinDataSEI, h264::SEI::SEIMessage* pcScalableSEIMessage,
				  UInt uiKeepScalableLayer, UInt& uiWantedScalableLayer, UInt& uiMaxLayer, UInt& uiMaxTempLevel, Double& dMaxFGSLayer, UInt uiMaxBitrate);
  /*
  ErrVal        xChangeScalableSEIMesssage( BinData *pcBinData, h264::SEI::SEIMessage* pcScalableSEIMessage,
				  UInt uiKeepScalableLayer, UInt& uiWantedScalableLayer, UInt& uiMaxLayer, UInt& uiMaxTempLevel, Double& dMaxFGSLayer, UInt uiMaxBitrate);
  */
  // JVT-S080 LMI }
  // HS: packet trace
  ErrVal        xReadLineExtractTrace ( Char*               pcFormatString,
                                        UInt*               puiStart,
                                        UInt*               puiLength );
  ErrVal        xExtractTrace         ();
  //{{Quality level estimation and modified truncation- JVTO044 and m12007
  //France Telecom R&D-(nathalie.cammas@francetelecom.com)
  ErrVal        xSetParameters_DS      ();
  ErrVal        xExtractPoints_DS      ();
  //initialize temporal level of a frame
  Void setLevel(UInt                    uiLayer,
                      UInt                    uiLevel,
					  UInt					  uiNumImage);
  //intialize max rate for a frame from SEI dead substream information
  Void setMaxRateDS(	UInt				  uiMaxRate,
                      UInt                    uiLayer,
          					  UInt					  uiNumImage);
  //count size of packets for each frame
  Void addPacket(UInt                    uiLayer,
                      UInt                    uiLevel,
                      UInt                    uiFGSLayer,
                      UInt                    uiNumBytes);
  //set if dead substream must be kept or thrown away (from command line argument)
  Void setExtractDeadSubstream(Bool b, UInt ui) { m_bExtractDeadSubstream[ui] = b;}
  //calculate the size of the dead substream
  Void CalculateSizeDeadSubstream();
  //determine layer, level and target rate for output stream
  Void GetExtParameters();
  //search optimal quality for target rate
  ErrVal QualityLevelSearch(Bool bOrderedTopLayerTrunc);
  //extract NALs given optimal quality
  ErrVal ExtractPointsFromRate();

  //JVT-S043 : Added the parameters uiMinTruncLayer & uiMaxTruncLayer.
  //get total rate for a given quality 
  Double GetTotalRateForQualityLevel(Double QualityLevel, UInt uiExtLevel, UInt uiExtLayer, 
                                     UInt uiMinTruncLayer, UInt uiMaxTruncLayer);
  //intialize R/D arrays from SEI information
  Void setQualityLevel();
  //get image rate for a given quality
  Double GetImageRateForQualityLevel(UInt uiLayer, UInt uiNumImage, Double QualityLevel, 
                                     UInt uiMinTruncLayer, UInt uiMaxTruncLayer);
  //Calculate max rate for each frame of a layer (in case of dead substreams use of SEI information
  // from dead substreams)
  Void CalculateMaxRate(UInt uiLayer);
  //}}Quality level estimation and modified truncation- JVTO044 and m12007

  UInt getPIDIndex(UInt uiPID);
  UInt addPIDToTable(UInt uiPID);
  Double GetTruncatedRate(Double dQL, UInt uiExtLevel,  UInt uiExtLayer, 
                          UInt uiMinTruncLayer, UInt uiMaxTruncLayer);
  UInt GetNearestPIDForQualityLevel(UInt uiLayer, UInt uiNumImage, Double QualityLevel);
  Double GetImageRateForQualityLevelActual(UInt uiLayer, UInt uiNumImage, Double QualityLevel, Double dRatio, 
                                           UInt uiMinTruncLayer, UInt uiMaxTruncLayer);
  Double CalculateSizeOfIncludedLayers(UInt uiExtLevel, UInt uiExtLayer);
  Double CalculateSizeOfBQLayers(UInt uiExtLevel, UInt uiExtLayer);
  Double CalculateSizeOfMaxQuality(UInt uiExtLevel, UInt uiExtLayer);

  Bool IsFrameToCut(UInt uiFrame);
  Void AllocateAndInitializeDatas();

  //S051{
  ErrVal        xSetParameters_SIP      ();
  ErrVal        xExtractPoints_SIP      ();	
  //S051}

protected:
  ReadBitstreamIf*              m_pcReadBitstream;
  WriteBitstreamIf*             m_pcWriteBitstream;
  ExtractorParameter*           m_pcExtractorParameter;
  h264::H264AVCPacketAnalyzer*  m_pcH264AVCPacketAnalyzer;

  UChar                         m_aucStartCodeBuffer[5];
  BinData                       m_cBinDataStartCode;

  ScalableStreamDescription     m_cScalableStreamDescription;
  Double                        m_aadTargetSNRLayer[MAX_LAYERS][MAX_DSTAGES+1];

  // HS: packet trace
  FILE*                         m_pcTraceFile;
  FILE*                         m_pcExtractionTraceFile;
  LargeFile                     m_cLargeFile;
  UInt                          m_uiMaxSize;

  Void    xOutput          ( ); 
  UInt    getScalableLayer ( UInt uiLayer, UInt uiTL, UInt uiQL ) const { return m_aaauiScalableLayerId[uiLayer][uiTL][uiQL]; }
  Bool                          m_bAVCCompatible;
  UInt                          m_uiScalableNumLayersMinus1;
  UInt                          m_aaauiScalableLayerId[MAX_LAYERS][MAX_TEMP_LEVELS][MAX_QUALITY_LEVELS];
  UInt                          m_auiDependencyId[MAX_SCALABLE_LAYERS];
  UInt                          m_auiTempLevel[MAX_SCALABLE_LAYERS];
  UInt                          m_auiQualityLevel[MAX_SCALABLE_LAYERS];
  UInt                          m_auiFrmWidth[MAX_SCALABLE_LAYERS];
  UInt                          m_auiFrmHeight[MAX_SCALABLE_LAYERS];
  Double                        m_adFramerate[MAX_SCALABLE_LAYERS];
  UInt                          m_auiDirDepLayer[MAX_SCALABLE_LAYERS];
  Double                        m_adFrameRate[MAX_TEMP_LEVELS];
  Double                        m_aadMinBitrate[MAX_LAYERS][MAX_TEMP_LEVELS]; 
  Double                        m_aaadSingleBitrate[MAX_LAYERS][MAX_TEMP_LEVELS][MAX_QUALITY_LEVELS];
  Double                        m_adTotalBitrate[MAX_SCALABLE_LAYERS];


  //{{Quality level estimation and modified truncation- JVTO044 and m12007
  //France Telecom R&D-(nathalie.cammas@francetelecom.com)
  Double*						m_aaadMaxRate[MAX_LAYERS]; //size of each frame for each layer without deadsubstream
  Double*                       m_aaadTargetBytesFGS[MAX_LAYERS][MAX_FGS_LAYERS+1]; //bytes to be extracted for each FGS layer for each frame 																							// at each layer		
  Int*							m_aaiLevelForFrame[MAX_LAYERS];//temporal level of each frame
  Double*                       m_aaadBytesForFrameFGS[MAX_LAYERS][MAX_FGS_LAYERS+1]; //size of each FGS layer for each frame at each layer
  Double						m_aaadMaxRateForLevel[MAX_LAYERS][MAX_DSTAGES+1]; //size of layer for each level without deadsubstream
  Bool							m_bExtractDeadSubstream[MAX_LAYERS]; //indicate if deadsubstream has to be removed (command line)
  UInt							m_aSizeDeadSubstream[MAX_LAYERS]; //size of deadsubstream for each layer
  Bool							m_bInInputStreamDS; //indicate if deadsubstream is in the input bitstream
  Bool							m_bInInputStreamQL;// indicate if RD informations are in the input bitstream
  Double*                       m_aadTargetByteForFrame[MAX_LAYERS];
  UInt*                         m_aaauiBytesForQualityLevel[MAX_LAYERS][MAX_NUM_RD_LEVELS];
  Double*                       m_aaadQualityLevel[MAX_LAYERS][MAX_NUM_RD_LEVELS];
  Int*                          m_aaiNumLevels[MAX_LAYERS];
  UInt                          m_auiNbImages[MAX_LAYERS];
  //}}Quality level estimation and modified truncation- JVTO044 and m12007
  UInt							m_uiExtractNonRequiredPics;
  UInt m_uiQualityLevel;
  UInt m_auiPID[64];
  UInt m_uiNbPID;
  Bool m_bQualityLevelInSEI; //indicates if QualityLayers are in SEI messages

  //S051{
  Bool							m_bUseSIP;
  Double						m_aadTargetSNRLayerNoUse[MAX_LAYERS][MAX_DSTAGES+1];
  UInt							m_uiSuffixUnitEnable;
  //S051}

  //-- ICU/ETRI ROI
  int							m_iNumSlice;
  int							m_aiSilceIDOfSubPicLayer[MAX_SCALABLE_LAYERS];
  int							m_aaiRelatedROIofSubPicLayer[MAX_SCALABLE_LAYERS][MAX_ROIS];
  int							m_aiDepIDOfSubPicLayer[MAX_SCALABLE_LAYERS];
  UInt							m_auiXinFirstMB[MAX_LAYERS][MAX_ROI_NUM];
  UInt							m_auiYinFirstMB[MAX_LAYERS][MAX_ROI_NUM];
  UInt							m_auiXinLastMB[MAX_LAYERS][MAX_ROI_NUM];
  UInt							m_auiYinLastMB[MAX_LAYERS][MAX_ROI_NUM];
  UInt							m_auiAddrFirstMBofROIs[MAX_LAYERS][MAX_ROI_NUM];
  UInt							m_auiAddrLastMBofROIs[MAX_LAYERS][MAX_ROI_NUM];

//JVT-T054{
  Bool            m_bEnableQLTruncation[MAX_LAYERS][MAX_FGS_LAYERS];
//JVT-T054}

};
class ExtractStop{};
#endif //__EXTRACTOR_H_D65BE9B4_A8DA_11D3_AFE7_005004464B79

⌨️ 快捷键说明

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