1 | |
---|
2 | |
---|
3 | /** \file TEncPic.h |
---|
4 | \brief GOP encoder class (header) |
---|
5 | */ |
---|
6 | |
---|
7 | #ifndef __TEncPic__ |
---|
8 | #define __TEncPic__ |
---|
9 | |
---|
10 | #include <stdlib.h> |
---|
11 | |
---|
12 | #include "../TLibCommon/TComList.h" |
---|
13 | #include "../TLibCommon/TComPic.h" |
---|
14 | #include "../TLibCommon/TComBitStream.h" |
---|
15 | #include "../TLibCommon/TComBitCounter.h" |
---|
16 | #include "../TLibCommon/TComLoopFilter.h" |
---|
17 | #include "../TLibCommon/TComDepthMapGenerator.h" |
---|
18 | #include "../TLibCommon/TComResidualGenerator.h" |
---|
19 | #include "TEncAdaptiveLoopFilter.h" |
---|
20 | #include "TEncSlice.h" |
---|
21 | #include "TEncEntropy.h" |
---|
22 | #include "TEncCavlc.h" |
---|
23 | #include "TEncSbac.h" |
---|
24 | |
---|
25 | #include "TEncAnalyze.h" |
---|
26 | |
---|
27 | #ifdef WEIGHT_PRED |
---|
28 | #include "WeightPredAnalysis.h" |
---|
29 | #endif |
---|
30 | |
---|
31 | #if RVM_VCEGAM10 |
---|
32 | #include <vector> |
---|
33 | #endif |
---|
34 | |
---|
35 | class TEncTop; |
---|
36 | |
---|
37 | // ==================================================================================================================== |
---|
38 | // Class definition |
---|
39 | // ==================================================================================================================== |
---|
40 | |
---|
41 | /// GOP encoder class |
---|
42 | class TEncPic |
---|
43 | { |
---|
44 | private: |
---|
45 | // Data |
---|
46 | Int m_iHrchDepth; |
---|
47 | |
---|
48 | // Access channel |
---|
49 | TEncTop* m_pcEncTop; |
---|
50 | TEncCfg* m_pcCfg; |
---|
51 | TEncSlice* m_pcSliceEncoder; |
---|
52 | TComList<TComPic*>* m_pcListPic; |
---|
53 | |
---|
54 | TEncEntropy* m_pcEntropyCoder; |
---|
55 | TEncCavlc* m_pcCavlcCoder; |
---|
56 | TEncSbac* m_pcSbacCoder; |
---|
57 | TEncBinCABAC* m_pcBinCABAC; |
---|
58 | TComLoopFilter* m_pcLoopFilter; |
---|
59 | TComDepthMapGenerator* m_pcDepthMapGenerator; |
---|
60 | TComResidualGenerator* m_pcResidualGenerator; |
---|
61 | |
---|
62 | // Adaptive Loop filter |
---|
63 | TEncAdaptiveLoopFilter* m_pcAdaptiveLoopFilter; |
---|
64 | //--Adaptive Loop filter |
---|
65 | #if MTK_SAO |
---|
66 | TEncSampleAdaptiveOffset* m_pcSAO; |
---|
67 | #endif |
---|
68 | TComBitCounter* m_pcBitCounter; |
---|
69 | |
---|
70 | TComRdCost* m_pcRdCost; ///< RD cost computation |
---|
71 | |
---|
72 | #if DCM_DECODING_REFRESH |
---|
73 | // clean decoding refresh |
---|
74 | Bool m_bRefreshPending; |
---|
75 | UInt m_uiPOCCDR; |
---|
76 | #endif |
---|
77 | UInt* m_uiStoredStartCUAddrForEncodingSlice; |
---|
78 | UInt* m_uiStoredStartCUAddrForEncodingEntropySlice; |
---|
79 | |
---|
80 | // #if MTK_NONCROSS_INLOOP_FILTER |
---|
81 | // UInt m_uiILSliceCount; |
---|
82 | // UInt* m_puiILSliceStartLCU; |
---|
83 | // UInt* m_puiILSliceEndLCU; |
---|
84 | // #endif |
---|
85 | |
---|
86 | #if RVM_VCEGAM10 |
---|
87 | std::vector<Int> m_vRVM_RP; |
---|
88 | #endif |
---|
89 | |
---|
90 | public: |
---|
91 | TEncPic(); |
---|
92 | virtual ~TEncPic(); |
---|
93 | |
---|
94 | Void create ( Int iWidth, Int iHeight, UInt iMaxCUWidth, UInt iMaxCUHeight ); |
---|
95 | Void destroy (); |
---|
96 | |
---|
97 | Void init ( TEncTop* pcTEncTop ); |
---|
98 | Void compressPic( TComBitstream* pcBitstreamOut, TComPicYuv cPicOrg, TComPic* pcPic, TComPicYuv* pcPicYuvRecOut, |
---|
99 | TComPic* pcOrgRefList[2][MAX_REF_PIC_NUM], Bool& rbSeqFirst, TComList<TComPic*>& rcListPic ); |
---|
100 | TComList<TComPic*>* getListPic() { return m_pcListPic; } |
---|
101 | |
---|
102 | Void preLoopFilterPicAll ( TComPic* pcPic, UInt64& ruiDist, UInt64& ruiBits ); |
---|
103 | |
---|
104 | |
---|
105 | protected: |
---|
106 | #if DCM_DECODING_REFRESH |
---|
107 | NalUnitType getNalUnitType( UInt uiPOCCurr ); |
---|
108 | #endif |
---|
109 | |
---|
110 | Void xCalculateAddPSNR ( TComPic* pcPic, TComPicYuv* pcPicD, UInt uiBits, Double dEncTime ); |
---|
111 | |
---|
112 | UInt64 xFindDistortionFrame (TComPicYuv* pcPic0, TComPicYuv* pcPic1); |
---|
113 | |
---|
114 | #if RVM_VCEGAM10 |
---|
115 | Double xCalculateRVM(); |
---|
116 | #endif |
---|
117 | };// END CLASS DEFINITION TEncPic |
---|
118 | |
---|
119 | |
---|
120 | #endif // __TEncPic__ |
---|
121 | |
---|