source: 3DVCSoftware/branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComPic.h @ 476

Last change on this file since 476 was 476, checked in by mediatek-htm, 11 years ago

Integration of 3D-HEVC merge related coding tools:
Inter-view motion merge candidate
HHI_INTER_VIEW_MOTION_PRED
SAIT_IMPROV_MOTION_PRED_M24829, improved inter-view motion vector prediction
QC_MRG_CANS_B0048 , JCT3V-B0048, B0086, B0069
OL_DISMV_POS_B0069 , different pos for disparity MV candidate, B0069
MTK_INTERVIEW_MERGE_A0049 , second part
QC_AMVP_MRG_UNIFY_IVCAN_C0051
TEXTURE MERGING CANDIDATE , JCT3V-C0137

Notes: Two configurations are added:
PredDepthMapGen : 1
MultiviewMvPred : 7

From: yiwen.chen@… (MediaTek)

  • Property svn:eol-style set to native
File size: 12.2 KB
Line 
1/* The copyright in this software is being made available under the BSD
2 * License, included below. This software may be subject to other third party
3 * and contributor rights, including patent rights, and no such rights are
4 * granted under this license. 
5 *
6 * Copyright (c) 2010-2013, ITU/ISO/IEC
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 *  * Redistributions of source code must retain the above copyright notice,
13 *    this list of conditions and the following disclaimer.
14 *  * Redistributions in binary form must reproduce the above copyright notice,
15 *    this list of conditions and the following disclaimer in the documentation
16 *    and/or other materials provided with the distribution.
17 *  * Neither the name of the ITU/ISO/IEC nor the names of its contributors may
18 *    be used to endorse or promote products derived from this software without
19 *    specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31 * THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
34/** \file     TComPic.h
35    \brief    picture class (header)
36*/
37
38#ifndef __TCOMPIC__
39#define __TCOMPIC__
40
41// Include files
42#include "CommonDef.h"
43#include "TComPicSym.h"
44#include "TComPicYuv.h"
45#include "TComBitStream.h"
46#include "SEI.h"
47
48//! \ingroup TLibCommon
49//! \{
50
51// ====================================================================================================================
52// Class definition
53// ====================================================================================================================
54
55/// picture class (symbol + YUV buffers)
56class TComPic
57{
58private:
59  UInt                  m_uiTLayer;               //  Temporal layer
60  Bool                  m_bUsedByCurr;            //  Used by current picture
61  Bool                  m_bIsLongTerm;            //  IS long term picture
62  Bool                  m_bIsUsedAsLongTerm;      //  long term picture is used as reference before
63  TComPicSym*           m_apcPicSym;              //  Symbol
64 
65  TComPicYuv*           m_apcPicYuv[2];           //  Texture,  0:org / 1:rec
66 
67  TComPicYuv*           m_pcPicYuvPred;           //  Prediction
68  TComPicYuv*           m_pcPicYuvResi;           //  Residual
69  Bool                  m_bReconstructed;
70  Bool                  m_bNeededForOutput;
71  UInt                  m_uiCurrSliceIdx;         // Index of current slice
72  Int*                  m_pSliceSUMap;
73  Bool*                 m_pbValidSlice;
74  Int                   m_sliceGranularityForNDBFilter;
75  Bool                  m_bIndependentSliceBoundaryForNDBFilter;
76  Bool                  m_bIndependentTileBoundaryForNDBFilter;
77  TComPicYuv*           m_pNDBFilterYuvTmp;    //!< temporary picture buffer when non-cross slice/tile boundary in-loop filtering is enabled
78  Bool                  m_bCheckLTMSB;
79 
80  Int                   m_numReorderPics[MAX_TLAYER];
81  Window                m_conformanceWindow;
82  Window                m_defaultDisplayWindow;
83
84  std::vector<std::vector<TComDataCU*> > m_vSliceCUDataLink;
85
86  SEIMessages  m_SEIs; ///< Any SEI messages that have been received.  If !NULL we own the object.
87
88#if H_MV
89  Int                   m_layerId;
90  Int                   m_viewId;
91#if H_3D
92  Int                   m_viewIndex;
93  Bool                  m_isDepth;
94  Int**                 m_aaiCodedScale;
95  Int**                 m_aaiCodedOffset;
96#endif
97#endif
98#if H_3D_NBDV
99  UInt        m_uiRapRefIdx;
100  RefPicList  m_eRapRefList;
101  Int         m_iNumDdvCandPics;
102#endif
103public:
104  TComPic();
105  virtual ~TComPic();
106 
107  Void          create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, 
108                        Int *numReorderPics, Bool bIsVirtual = false );
109                       
110  virtual Void  destroy();
111 
112  UInt          getTLayer()                { return m_uiTLayer;   }
113  Void          setTLayer( UInt uiTLayer ) { m_uiTLayer = uiTLayer; }
114
115#if H_MV
116  Void          setLayerId            ( Int layerId )    { m_layerId      = layerId; }
117  Int           getLayerId            ()                 { return m_layerId;    }
118  Void          setViewId             ( Int viewId )     { m_viewId = viewId;   }
119  Int           getViewId             ()                 { return m_viewId;     }
120#if H_3D
121  Void          setViewIndex          ( Int viewIndex )  { m_viewIndex = viewIndex;   }
122  Int           getViewIndex          ()                 { return m_viewIndex;     }
123
124  Void          setIsDepth            ( Bool isDepth )   { m_isDepth = isDepth; }
125  Bool          getIsDepth            ()                 { return m_isDepth; }
126
127  Void          setScaleOffset( Int** pS, Int** pO )  { m_aaiCodedScale = pS; m_aaiCodedOffset = pO; }
128  Int**         getCodedScale ()                      { return m_aaiCodedScale;  }
129  Int**         getCodedOffset()                      { return m_aaiCodedOffset; }
130#endif
131#endif
132  Bool          getUsedByCurr()             { return m_bUsedByCurr; }
133  Void          setUsedByCurr( Bool bUsed ) { m_bUsedByCurr = bUsed; }
134  Bool          getIsLongTerm()             { return m_bIsLongTerm; }
135  Void          setIsLongTerm( Bool lt ) { m_bIsLongTerm = lt; }
136  Void          setCheckLTMSBPresent     (Bool b ) {m_bCheckLTMSB=b;}
137  Bool          getCheckLTMSBPresent     () { return m_bCheckLTMSB;}
138
139  TComPicSym*   getPicSym()           { return  m_apcPicSym;    }
140  TComSlice*    getSlice(Int i)       { return  m_apcPicSym->getSlice(i);  }
141  Int           getPOC()              { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getPOC();  }
142  TComDataCU*&  getCU( UInt uiCUAddr )  { return  m_apcPicSym->getCU( uiCUAddr ); }
143#if H_3D_IV_MERGE
144  TComSlice*    getCurrSlice()        { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx);  }
145  TComSPS*      getSPS()              { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getSPS();  }
146  TComVPS*      getVPS()              { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getVPS();  }
147#endif
148 
149  TComPicYuv*   getPicYuvOrg()        { return  m_apcPicYuv[0]; }
150  TComPicYuv*   getPicYuvRec()        { return  m_apcPicYuv[1]; }
151 
152  TComPicYuv*   getPicYuvPred()       { return  m_pcPicYuvPred; }
153  TComPicYuv*   getPicYuvResi()       { return  m_pcPicYuvResi; }
154  Void          setPicYuvPred( TComPicYuv* pcPicYuv )       { m_pcPicYuvPred = pcPicYuv; }
155  Void          setPicYuvResi( TComPicYuv* pcPicYuv )       { m_pcPicYuvResi = pcPicYuv; }
156 
157  UInt          getNumCUsInFrame()      { return m_apcPicSym->getNumberOfCUsInFrame(); }
158  UInt          getNumPartInWidth()     { return m_apcPicSym->getNumPartInWidth();     }
159  UInt          getNumPartInHeight()    { return m_apcPicSym->getNumPartInHeight();    }
160  UInt          getNumPartInCU()        { return m_apcPicSym->getNumPartition();       }
161  UInt          getFrameWidthInCU()     { return m_apcPicSym->getFrameWidthInCU();     }
162  UInt          getFrameHeightInCU()    { return m_apcPicSym->getFrameHeightInCU();    }
163  UInt          getMinCUWidth()         { return m_apcPicSym->getMinCUWidth();         }
164  UInt          getMinCUHeight()        { return m_apcPicSym->getMinCUHeight();        }
165 
166  UInt          getParPelX(UChar uhPartIdx) { return getParPelX(uhPartIdx); }
167  UInt          getParPelY(UChar uhPartIdx) { return getParPelX(uhPartIdx); }
168 
169  Int           getStride()           { return m_apcPicYuv[1]->getStride(); }
170  Int           getCStride()          { return m_apcPicYuv[1]->getCStride(); }
171 
172  Void          setReconMark (Bool b) { m_bReconstructed = b;     }
173  Bool          getReconMark ()       { return m_bReconstructed;  }
174  Void          setOutputMark (Bool b) { m_bNeededForOutput = b;     }
175  Bool          getOutputMark ()       { return m_bNeededForOutput;  }
176 
177  Void          setNumReorderPics(Int i, UInt tlayer) { m_numReorderPics[tlayer] = i;    }
178  Int           getNumReorderPics(UInt tlayer)        { return m_numReorderPics[tlayer]; }
179
180  Void          compressMotion(); 
181  UInt          getCurrSliceIdx()            { return m_uiCurrSliceIdx;                }
182  Void          setCurrSliceIdx(UInt i)      { m_uiCurrSliceIdx = i;                   }
183  UInt          getNumAllocatedSlice()       {return m_apcPicSym->getNumAllocatedSlice();}
184  Void          allocateNewSlice()           {m_apcPicSym->allocateNewSlice();         }
185  Void          clearSliceBuffer()           {m_apcPicSym->clearSliceBuffer();         }
186
187  Window&       getConformanceWindow()  { return m_conformanceWindow; }
188  Window&       getDefDisplayWindow()   { return m_defaultDisplayWindow; }
189
190  Void          createNonDBFilterInfo   (std::vector<Int> sliceStartAddress, Int sliceGranularityDepth
191                                        ,std::vector<Bool>* LFCrossSliceBoundary
192                                        ,Int  numTiles = 1
193                                        ,Bool bNDBFilterCrossTileBoundary = true);
194  Void          createNonDBFilterInfoLCU(Int tileID, Int sliceID, TComDataCU* pcCU, UInt startSU, UInt endSU, Int sliceGranularyDepth, UInt picWidth, UInt picHeight);
195  Void          destroyNonDBFilterInfo();
196
197  Bool          getValidSlice                                  (Int sliceID)  {return m_pbValidSlice[sliceID];}
198  Bool          getIndependentSliceBoundaryForNDBFilter        ()             {return m_bIndependentSliceBoundaryForNDBFilter;}
199  Bool          getIndependentTileBoundaryForNDBFilter         ()             {return m_bIndependentTileBoundaryForNDBFilter; }
200  TComPicYuv*   getYuvPicBufferForIndependentBoundaryProcessing()             {return m_pNDBFilterYuvTmp;}
201  std::vector<TComDataCU*>& getOneSliceCUDataForNDBFilter      (Int sliceID) { return m_vSliceCUDataLink[sliceID];}
202
203#if H_MV
204  Void          print( Bool legend );
205#endif
206#if H_3D_NBDV
207  Int           getNumDdvCandPics()                    {return m_iNumDdvCandPics;   }
208  Int           getDisCandRefPictures(Int iColPOC);
209  Void          setRapRefIdx(UInt uiRapRefIdx)         {m_uiRapRefIdx = uiRapRefIdx;}
210  Void          setRapRefList(RefPicList eRefPicList)  {m_eRapRefList = eRefPicList;}
211  Void          setNumDdvCandPics (Int i)              {m_iNumDdvCandPics = i;       }
212  UInt          getRapRefIdx()                         {return m_uiRapRefIdx;       }
213  RefPicList    getRapRefList()                        {return m_eRapRefList;       }
214#endif
215  /** transfer ownership of seis to this picture */
216  void setSEIs(SEIMessages& seis) { m_SEIs = seis; }
217
218  /**
219   * return the current list of SEI messages associated with this picture.
220   * Pointer is valid until this->destroy() is called */
221  SEIMessages& getSEIs() { return m_SEIs; }
222
223  /**
224   * return the current list of SEI messages associated with this picture.
225   * Pointer is valid until this->destroy() is called */
226  const SEIMessages& getSEIs() const { return m_SEIs; }
227
228};// END CLASS DEFINITION TComPic
229
230#if H_MV
231class TComPicLists
232{
233private: 
234  TComList<TComList<TComPic*>*> m_lists; 
235#if H_3D
236  TComVPS*                     m_vps; 
237#endif
238public: 
239  Void        push_back( TComList<TComPic*>* list ) { m_lists.push_back( list );   }
240  Int         size     ()                           { return (Int) m_lists.size(); } 
241  TComPic*    getPic   ( Int layerIdInNuh,              Int poc );   
242  TComPicYuv* getPicYuv( Int layerIdInNuh,              Int poc, Bool recon ); 
243#if H_3D
244  Void        setVPS   ( TComVPS* vps ) { m_vps = vps;  }; 
245  TComPic*    getPic   ( Int viewIndex, Bool depthFlag, Int poc );
246  TComPicYuv* getPicYuv( Int viewIndex, Bool depthFlag, Int poc, Bool recon );
247#endif 
248
249  Void print( ); 
250
251}; // END CLASS DEFINITION TComPicLists
252
253#endif
254//! \}
255
256#endif // __TCOMPIC__
Note: See TracBrowser for help on using the repository browser.