📄 extractor.h
字号:
// 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::SEIMessage* 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 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 ();
ErrVal xExtractMaxRate ( Double dMaxRate,
Bool bDontTruncQLayer,
Bool bPercentageMode );
ErrVal xAnalyse ( UInt uiTargetLayer,
Double& rdFrameRate,
Bool& rbQualityLayerPresent,
UInt auiQLRate[],
Bool bNoSpecialFirstFrame );
ErrVal xExtract ( UInt uiTargetLayer,
Bool bQualityLayerPresent,
Int iQualityLayer,
UInt& ruiInLayerRate,
Bool bNoSpecialFirstFrame );
// ROI ICU/ETRI
Int CurNalKeepingNeed(h264::PacketDescription cPacketDescription
, const ExtractorParameter::Point& rcExtPoint);
void xSetROIParameters ();
ErrVal GetPictureDataKeep ( h264::PacketDescription* pcPacketDescription,
Double dRemainingBytes,
Double dCurrPacketBytes,
Bool& bKeep );
ErrVal xResetSLFGSBitrate ( UInt uiDependencyId, UInt uiTempLevel, UInt uiFGSLayer, Double dDecBitrate ); //cleaning
ErrVal xReCalculateBr ();
Void xMakeDepLayerList ( UInt uiScalableLayerId, std::list<UInt>& DepLayerList );
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 );
// JVT-S080 LMI }
// HS: packet trace
ErrVal xReadLineExtractTrace ( Char* pcFormatString,
UInt* puiStart,
UInt* puiLength );
ErrVal xExtractTrace ();
//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 );
//determine layer, level and target rate for output stream
ErrVal xGetExtParameters();
ErrVal GetAndCheckBaseLayerPackets( Double& dRemainingBytes );
UInt GetWantedScalableLayer();
//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}
ErrVal xCalcSIPBitrate (); //cleaning, add function
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_auiDirDepLayerDelta[MAX_SCALABLE_LAYERS][2];
std::list<UInt> m_acDepLayerList[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];
//JVT-W046 {
//SEI changes update {
// Bool m_bAvc_Layer_Conversion_Flag[MAX_SCALABLE_LAYERS];
//UInt m_uiAvc_Conversion_Type_Idc[MAX_SCALABLE_LAYERS];
//Bool m_bAvc_Info_Flag[MAX_SCALABLE_LAYERS][2];
//Int32 m_uiAvc_Profile_Level_Idc[MAX_SCALABLE_LAYERS][2];
//UInt m_dAvc_Avg_Bitrate[MAX_SCALABLE_LAYERS][2];
//UInt m_dAvc_Max_Bitrate[MAX_SCALABLE_LAYERS][2];
Bool m_bLayer_Conversion_Flag[MAX_SCALABLE_LAYERS];
UInt m_uiConversion_Type_Idc[MAX_SCALABLE_LAYERS];
Bool m_bRewriting_Info_Flag[MAX_SCALABLE_LAYERS][2];
Int32 m_uiRewriting_Profile_Level_Idc[MAX_SCALABLE_LAYERS][2];
UInt m_dRewriting_Avg_Bitrate[MAX_SCALABLE_LAYERS][2];
UInt m_dRewriting_Max_Bitrate[MAX_SCALABLE_LAYERS][2];
//JVT-W046 }
//JVT-W051 {
//UInt m_uiQl_num_dId_minus1;
//UInt m_uiQl_Dependency_Id[MAX_LAYERS];
//UInt m_uiQl_num_minus1[MAX_LAYERS];
//UInt m_uiQl_Id[MAX_LAYERS][MAX_QUALITY_LEVELS];
//Int32 m_uiQl_Profile_Level_Idc[MAX_LAYERS][MAX_QUALITY_LEVELS];
//UInt m_dQl_Avg_Bitrate[MAX_LAYERS][MAX_QUALITY_LEVELS];
//UInt m_dQl_Max_Bitrate[MAX_LAYERS][MAX_QUALITY_LEVELS];
UInt m_uiPr_num_dId_minus1;
UInt m_uiPr_Dependency_Id[MAX_LAYERS];
UInt m_uiPr_num_minus1[MAX_LAYERS];
UInt m_uiPr_Id[MAX_LAYERS][MAX_QUALITY_LEVELS];
Int32 m_uiPr_Profile_Level_Idc[MAX_LAYERS][MAX_QUALITY_LEVELS];
UInt m_dPr_Avg_Bitrate[MAX_LAYERS][MAX_QUALITY_LEVELS];
UInt m_dPr_Max_Bitrate[MAX_LAYERS][MAX_QUALITY_LEVELS];
//JVT-W051 }
//SEI changes update }
//{{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_QUALITY_LEVELS]; //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_QUALITY_LEVELS]; //size of each FGS layer for each frame at each layer
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];//SEI changes update
Double* m_aaadPriorityLevel[MAX_LAYERS][MAX_NUM_RD_LEVELS];//SEI changes update
Int* m_aaiNumLevels[MAX_LAYERS];
UInt m_auiNbImages[MAX_LAYERS];
//}}Quality level estimation and modified truncation- JVTO044 and m12007
UInt m_uiExtractNonRequiredPics;
UInt m_uiQualityId;
UInt m_auiPID[64];
UInt m_uiNbPID;
Bool m_bQualityLevelInSEI; //indicates if QualityLayers are in SEI messages
UInt m_uiTruncateLayer;
UInt m_uiTruncateLevel;
UInt m_uiTruncateFGSLayer;
//S051{
Bool m_bUseSIP;
Double m_aadTargetSNRLayerNoUse[MAX_LAYERS][MAX_DSTAGES+1];
UInt m_uiPreAndSuffixUnitEnable;
//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];
};
class ExtractStop{};
#endif //__EXTRACTOR_H_D65BE9B4_A8DA_11D3_AFE7_005004464B79
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -