1 | |
---|
2 | |
---|
3 | /** \file TComPic.h |
---|
4 | \brief picture class (header) |
---|
5 | */ |
---|
6 | |
---|
7 | #ifndef __TCOMPIC__ |
---|
8 | #define __TCOMPIC__ |
---|
9 | |
---|
10 | // Include files |
---|
11 | #include "CommonDef.h" |
---|
12 | #include "TComPicSym.h" |
---|
13 | #include "TComPicYuv.h" |
---|
14 | #include "TComBitStream.h" |
---|
15 | #include "TComMVDRefData.h" |
---|
16 | |
---|
17 | class SEImessages; |
---|
18 | |
---|
19 | // ==================================================================================================================== |
---|
20 | // Class definition |
---|
21 | // ==================================================================================================================== |
---|
22 | |
---|
23 | /// picture class (symbol + YUV buffers) |
---|
24 | class TComPic |
---|
25 | { |
---|
26 | private: |
---|
27 | TComPicSym* m_apcPicSym; // Symbol |
---|
28 | |
---|
29 | TComPicYuv* m_apcPicYuv[2]; // Texture, 0:org / 1:rec |
---|
30 | TComPicYuv* m_pcPredDepthMap; // estimated depth map |
---|
31 | TComPicYuv* m_pcOrgDepthMap; // original depth map |
---|
32 | TComPicYuv* m_pcResidual; // residual buffer (coded or inter-view predicted residual) |
---|
33 | |
---|
34 | TComPicYuv* m_pcPicYuvPred; // Prediction |
---|
35 | TComPicYuv* m_pcPicYuvResi; // Residual |
---|
36 | #if PARALLEL_MERGED_DEBLK |
---|
37 | TComPicYuv* m_pcPicYuvDeblkBuf; |
---|
38 | #endif |
---|
39 | Bool m_bReconstructed; |
---|
40 | UInt m_uiCurrSliceIdx; // Index of current slice |
---|
41 | |
---|
42 | SEImessages* m_SEIs; ///< Any SEI messages that have been received. If !NULL we own the object. |
---|
43 | |
---|
44 | // SB //GT; Why? can be accesed by getSlice()->getXXX? |
---|
45 | SliceType m_eSliceType; |
---|
46 | double m_dQP; |
---|
47 | Bool m_bReferenced; |
---|
48 | UInt m_uiColDir; |
---|
49 | Int m_aiRefPOCList[2][MAX_NUM_REF]; |
---|
50 | Int m_aiRefViewIdxList[2][MAX_NUM_REF]; |
---|
51 | Int m_aiNumRefIdx[2]; // for multiple reference of current slice |
---|
52 | |
---|
53 | Int m_iViewIdx; |
---|
54 | Int** m_aaiCodedScale; |
---|
55 | Int** m_aaiCodedOffset; |
---|
56 | |
---|
57 | //GT |
---|
58 | TComMVDRefData m_cReferenceInfo; |
---|
59 | TComPicYuv* m_pcUsedPelsMap; |
---|
60 | |
---|
61 | |
---|
62 | public: |
---|
63 | TComPic(); |
---|
64 | virtual ~TComPic(); |
---|
65 | |
---|
66 | |
---|
67 | Void create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth ); |
---|
68 | Void destroy(); |
---|
69 | |
---|
70 | TComPicSym* getPicSym() { return m_apcPicSym; } |
---|
71 | TComSlice* getSlice(Int i) { return m_apcPicSym->getSlice(i); } |
---|
72 | TComSlice* getCurrSlice() { return m_apcPicSym->getSlice(m_uiCurrSliceIdx); } |
---|
73 | TComSPS* getSPS() { return m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getSPS(); } |
---|
74 | Int getPOC() { return m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getPOC(); } |
---|
75 | #if 0 |
---|
76 | Bool getDRBFlag() { return m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getDRBFlag(); } |
---|
77 | Int getERBIndex() { return m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getERBIndex(); } |
---|
78 | #endif |
---|
79 | TComDataCU*& getCU( UInt uiCUAddr ) { return m_apcPicSym->getCU( uiCUAddr ); } |
---|
80 | |
---|
81 | // SB |
---|
82 | SliceType getSliceType() { return m_eSliceType ;} |
---|
83 | double getQP() { return m_dQP ;} |
---|
84 | Bool getReferenced() { return m_bReferenced ;} |
---|
85 | |
---|
86 | TComPicYuv* getPicYuvOrg() { return m_apcPicYuv[0]; } |
---|
87 | TComPicYuv* getPicYuvRec() { return m_apcPicYuv[1]; } |
---|
88 | |
---|
89 | TComPicYuv* getPredDepthMap() { return m_pcPredDepthMap; } |
---|
90 | TComPicYuv* getOrgDepthMap() { return m_pcOrgDepthMap; } |
---|
91 | TComPicYuv* getResidual() { return m_pcResidual; } |
---|
92 | TComPicYuv* getUsedPelsMap() { return m_pcUsedPelsMap; } |
---|
93 | |
---|
94 | |
---|
95 | TComPicYuv* getPicYuvPred() { return m_pcPicYuvPred; } |
---|
96 | TComPicYuv* getPicYuvResi() { return m_pcPicYuvResi; } |
---|
97 | Void setPicYuvPred( TComPicYuv* pcPicYuv ) { m_pcPicYuvPred = pcPicYuv; } |
---|
98 | Void setPicYuvResi( TComPicYuv* pcPicYuv ) { m_pcPicYuvResi = pcPicYuv; } |
---|
99 | // SB |
---|
100 | Void setQP( double dQP ) { m_dQP = dQP; } |
---|
101 | Void setSliceType( SliceType eSliceType ) { m_eSliceType = eSliceType; } |
---|
102 | Void setReferenced( Bool bReferenced ) { m_bReferenced = bReferenced; } |
---|
103 | Void setColDir( UInt uiColDir ) { m_uiColDir = uiColDir; } |
---|
104 | UInt getColDir() { return m_uiColDir; } |
---|
105 | Void setRefPOC( Int i, RefPicList e, Int iRefIdx ) { m_aiRefPOCList[e][iRefIdx] = i; } |
---|
106 | Int getRefPOC( RefPicList e, Int iRefIdx ) { return m_aiRefPOCList[e][iRefIdx]; } |
---|
107 | Void setRefViewIdx( Int i, RefPicList e, Int iRefIdx ) { m_aiRefViewIdxList[e][iRefIdx] = i; } |
---|
108 | Int getRefViewIdx( RefPicList e, Int iRefIdx ) { return m_aiRefViewIdxList[e][iRefIdx]; } |
---|
109 | Int getNumRefs( RefPicList e ) { return m_aiNumRefIdx[e]; } |
---|
110 | Void setNumRefs( Int i, RefPicList e ) { m_aiNumRefIdx[e] = i; } |
---|
111 | Void setViewIdx( Int i ) { m_iViewIdx = i; } |
---|
112 | Int getViewIdx() { return m_iViewIdx; } |
---|
113 | |
---|
114 | Void setScaleOffset( Int** pS, Int** pO ) { m_aaiCodedScale = pS; m_aaiCodedOffset = pO; } |
---|
115 | Int** getCodedScale () { return m_aaiCodedScale; } |
---|
116 | Int** getCodedOffset() { return m_aaiCodedOffset; } |
---|
117 | |
---|
118 | //GT |
---|
119 | TComMVDRefData* getMVDReferenceInfo() { return &m_cReferenceInfo; } |
---|
120 | |
---|
121 | UInt getNumCUsInFrame() { return m_apcPicSym->getNumberOfCUsInFrame(); } |
---|
122 | UInt getNumPartInWidth() { return m_apcPicSym->getNumPartInWidth(); } |
---|
123 | UInt getNumPartInHeight() { return m_apcPicSym->getNumPartInHeight(); } |
---|
124 | UInt getNumPartInCU() { return m_apcPicSym->getNumPartition(); } |
---|
125 | UInt getFrameWidthInCU() { return m_apcPicSym->getFrameWidthInCU(); } |
---|
126 | UInt getFrameHeightInCU() { return m_apcPicSym->getFrameHeightInCU(); } |
---|
127 | UInt getMinCUWidth() { return m_apcPicSym->getMinCUWidth(); } |
---|
128 | UInt getMinCUHeight() { return m_apcPicSym->getMinCUHeight(); } |
---|
129 | |
---|
130 | UInt getParPelX(UChar uhPartIdx) { return getParPelX(uhPartIdx); } |
---|
131 | UInt getParPelY(UChar uhPartIdx) { return getParPelX(uhPartIdx); } |
---|
132 | |
---|
133 | Int getStride() { return m_apcPicYuv[1]->getStride(); } |
---|
134 | Int getCStride() { return m_apcPicYuv[1]->getCStride(); } |
---|
135 | |
---|
136 | Void setReconMark (Bool b) { m_bReconstructed = b; } |
---|
137 | Bool getReconMark () { return m_bReconstructed; } |
---|
138 | |
---|
139 | #if AMVP_BUFFERCOMPRESS |
---|
140 | Void compressMotion(); |
---|
141 | #endif |
---|
142 | UInt getCurrSliceIdx() { return m_uiCurrSliceIdx; } |
---|
143 | Void setCurrSliceIdx(UInt i) { m_uiCurrSliceIdx = i; } |
---|
144 | UInt getNumAllocatedSlice() {return m_apcPicSym->getNumAllocatedSlice();} |
---|
145 | Void allocateNewSlice() {m_apcPicSym->allocateNewSlice(); } |
---|
146 | Void clearSliceBuffer() {m_apcPicSym->clearSliceBuffer(); } |
---|
147 | |
---|
148 | Void addOriginalBuffer (); |
---|
149 | #if PARALLEL_MERGED_DEBLK |
---|
150 | Void addDeblockBuffer (); |
---|
151 | #endif |
---|
152 | Void addPrdDepthMapBuffer (); |
---|
153 | Void addOrgDepthMapBuffer (); |
---|
154 | Void addResidualBuffer (); |
---|
155 | Void addUsedPelsMapBuffer (); |
---|
156 | |
---|
157 | Void removeOriginalBuffer (); |
---|
158 | #if PARALLEL_MERGED_DEBLK |
---|
159 | Void removeDeblockBuffer (); |
---|
160 | #endif |
---|
161 | Void removePrdDepthMapBuffer (); |
---|
162 | Void removeOrgDepthMapBuffer (); |
---|
163 | Void removeResidualBuffer (); |
---|
164 | Void removeUsedPelsMapBuffer (); |
---|
165 | |
---|
166 | #if PARALLEL_MERGED_DEBLK |
---|
167 | TComPicYuv* getPicYuvDeblkBuf() { return m_pcPicYuvDeblkBuf; } |
---|
168 | #endif |
---|
169 | |
---|
170 | /** transfer ownership of @seis to @this picture */ |
---|
171 | void setSEIs(SEImessages* seis) { m_SEIs = seis; } |
---|
172 | |
---|
173 | /** |
---|
174 | * return the current list of SEI messages associated with this picture. |
---|
175 | * Pointer is valid until @this->destroy() is called */ |
---|
176 | SEImessages* getSEIs() { return m_SEIs; } |
---|
177 | |
---|
178 | /** |
---|
179 | * return the current list of SEI messages associated with this picture. |
---|
180 | * Pointer is valid until @this->destroy() is called */ |
---|
181 | const SEImessages* getSEIs() const { return m_SEIs; } |
---|
182 | |
---|
183 | };// END CLASS DEFINITION TComPic |
---|
184 | |
---|
185 | |
---|
186 | #endif // __TCOMPIC__ |
---|
187 | |
---|