Index: trunk/source/Lib/TLibCommon/TComPic.h
===================================================================
--- trunk/source/Lib/TLibCommon/TComPic.h	(revision 21)
+++ trunk/source/Lib/TLibCommon/TComPic.h	(revision 56)
@@ -2,7 +2,7 @@
  * License, included below. This software may be subject to other third party
  * and contributor rights, including patent rights, and no such rights are
- * granted under this license.
- *
- * Copyright (c) 2010-2011, ISO/IEC
+ * granted under this license.  
+ *
+ * Copyright (c) 2010-2012, ITU/ISO/IEC
  * All rights reserved.
  *
@@ -15,5 +15,5 @@
  *    this list of conditions and the following disclaimer in the documentation
  *    and/or other materials provided with the distribution.
- *  * Neither the name of the ISO/IEC nor the names of its contributors may
+ *  * Neither the name of the ITU/ISO/IEC nor the names of its contributors may
  *    be used to endorse or promote products derived from this software without
  *    specific prior written permission.
@@ -32,6 +32,4 @@
  */
 
-
-
 /** \file     TComPic.h
     \brief    picture class (header)
@@ -46,5 +44,7 @@
 #include "TComPicYuv.h"
 #include "TComBitStream.h"
-#include "TComMVDRefData.h"
+
+//! \ingroup TLibCommon
+//! \{
 
 class SEImessages;
@@ -58,10 +58,15 @@
 {
 private:
+  UInt                  m_uiTLayer;               //  Temporal layer
+  Bool                  m_bUsedByCurr;            //  Used by current picture
+  Bool                  m_bIsLongTerm;            //  IS long term picture
   TComPicSym*           m_apcPicSym;              //  Symbol
-
+  
   TComPicYuv*           m_apcPicYuv[2];           //  Texture,  0:org / 1:rec
+  
 #if DEPTH_MAP_GENERATION
   TComPicYuv*           m_pcPredDepthMap;         //  estimated depth map
 #endif
+
 #if HHI_INTER_VIEW_MOTION_PRED
   TComPicYuv*           m_pcOrgDepthMap;          //  original depth map
@@ -73,21 +78,22 @@
   TComPicYuv*           m_pcPicYuvPred;           //  Prediction
   TComPicYuv*           m_pcPicYuvResi;           //  Residual
-#if PARALLEL_MERGED_DEBLK
-  TComPicYuv*           m_pcPicYuvDeblkBuf;
-#endif
   Bool                  m_bReconstructed;
+  Bool                  m_bNeededForOutput;
   UInt                  m_uiCurrSliceIdx;         // Index of current slice
 
+  Bool                  m_usedForTMVP;
+  
+  Int*                  m_pSliceSUMap;
+  Bool*                 m_pbValidSlice;
+  Int                   m_sliceGranularityForNDBFilter;
+  Bool                  m_bIndependentSliceBoundaryForNDBFilter;
+  Bool                  m_bIndependentTileBoundaryForNDBFilter;
+  TComPicYuv*           m_pNDBFilterYuvTmp;    //!< temporary picture buffer when non-cross slice/tile boundary in-loop filtering is enabled
+  std::vector<std::vector<TComDataCU*> > m_vSliceCUDataLink;
+
   SEImessages* m_SEIs; ///< Any SEI messages that have been received.  If !NULL we own the object.
-
-  SliceType             m_eSliceType;
-  double                m_dQP;
-  Bool                  m_bReferenced;
-  UInt                  m_uiColDir;
-  Int                   m_aiRefPOCList[2][MAX_NUM_REF];
-  Int                   m_aiRefViewIdxList[2][MAX_NUM_REF];
-  Int                   m_aiNumRefIdx[2];    //  for multiple reference of current slice
-
-  Int                   m_iViewIdx;
+#if HHI_INTERVIEW_SKIP
+  TComPicYuv*           m_pcUsedPelsMap;
+#endif
 #if SONY_COLPIC_AVAILABILITY
   Int                   m_iViewOrderIdx;
@@ -95,20 +101,19 @@
   Int**                 m_aaiCodedScale;
   Int**                 m_aaiCodedOffset;
-
-#if HHI_VSO  
-  TComMVDRefData        m_cReferenceInfo;
-#endif
-#if HHI_INTERVIEW_SKIP
-  TComPicYuv*           m_pcUsedPelsMap;
-#endif
-
 
 public:
   TComPic();
   virtual ~TComPic();
-
-
-  Void          create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth );
-  Void          destroy();
+  
+  Void          create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Bool bIsVirtual = false );
+  virtual Void  destroy();
+  
+  UInt          getTLayer()                { return m_uiTLayer;   }
+  Void          setTLayer( UInt uiTLayer ) { m_uiTLayer = uiTLayer; }
+
+  Bool          getUsedByCurr()             { return m_bUsedByCurr; }
+  Void          setUsedByCurr( Bool bUsed ) { m_bUsedByCurr = bUsed; }
+  Bool          getIsLongTerm()             { return m_bIsLongTerm; }
+  Void          setIsLongTerm( Bool lt ) { m_bIsLongTerm = lt; }
 
   TComPicSym*   getPicSym()           { return  m_apcPicSym;    }
@@ -117,31 +122,32 @@
   TComSPS*      getSPS()              { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getSPS();  }
   Int           getPOC()              { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getPOC();  }
-#if 0
-  Bool          getDRBFlag()          { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getDRBFlag();  }
-  Int           getERBIndex()         { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getERBIndex();  }
-#endif
+  Int           getViewId()           { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getViewId(); }
   TComDataCU*&  getCU( UInt uiCUAddr )  { return  m_apcPicSym->getCU( uiCUAddr ); }
-
-  SliceType     getSliceType()        { return m_eSliceType ;}
-  double        getQP()               { return m_dQP ;}
-  Bool          getReferenced()       { return m_bReferenced ;}
-
+  
   TComPicYuv*   getPicYuvOrg()        { return  m_apcPicYuv[0]; }
   TComPicYuv*   getPicYuvRec()        { return  m_apcPicYuv[1]; }
-
-#if DEPTH_MAP_GENERATION
-  TComPicYuv*   getPredDepthMap()     { return  m_pcPredDepthMap; }
-#endif
-#if HHI_INTER_VIEW_MOTION_PRED
-  TComPicYuv*   getOrgDepthMap()      { return  m_pcOrgDepthMap; }
-#endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
-  TComPicYuv*   getResidual()         { return  m_pcResidual; }
-#endif
-
 #if HHI_INTERVIEW_SKIP
   TComPicYuv*   getUsedPelsMap()      { return  m_pcUsedPelsMap; }
 #endif
-
+  
+#if DEPTH_MAP_GENERATION
+  TComPicYuv*   getPredDepthMap()     { return  m_pcPredDepthMap; }
+#endif
+
+#if HHI_INTER_VIEW_MOTION_PRED
+  TComPicYuv*   getOrgDepthMap()      { return  m_pcOrgDepthMap; }
+#endif
+
+#if HHI_INTER_VIEW_RESIDUAL_PRED
+  TComPicYuv*   getResidual()         { return  m_pcResidual; }
+#endif
+
+#if SONY_COLPIC_AVAILABILITY
+  Void          setViewOrderIdx(Int i)                        { m_iViewOrderIdx = i; }
+  Int           getViewOrderIdx()                             { return m_iViewOrderIdx; }
+#endif
+  Void          setScaleOffset( Int** pS, Int** pO )  { m_aaiCodedScale = pS; m_aaiCodedOffset = pO; }
+  Int**         getCodedScale ()                      { return m_aaiCodedScale;  }
+  Int**         getCodedOffset()                      { return m_aaiCodedOffset; }
 
   TComPicYuv*   getPicYuvPred()       { return  m_pcPicYuvPred; }
@@ -149,30 +155,5 @@
   Void          setPicYuvPred( TComPicYuv* pcPicYuv )       { m_pcPicYuvPred = pcPicYuv; }
   Void          setPicYuvResi( TComPicYuv* pcPicYuv )       { m_pcPicYuvResi = pcPicYuv; }
-  Void          setQP( double dQP )   { m_dQP = dQP; }
-  Void          setSliceType( SliceType eSliceType ) { m_eSliceType = eSliceType; }
-  Void          setReferenced( Bool bReferenced )    { m_bReferenced = bReferenced; }
-  Void          setColDir( UInt uiColDir )           { m_uiColDir = uiColDir; }
-  UInt          getColDir()                          { return m_uiColDir; }
-  Void          setRefPOC( Int i, RefPicList e, Int iRefIdx ) { m_aiRefPOCList[e][iRefIdx] = i; }
-  Int           getRefPOC( RefPicList e, Int iRefIdx )        { return m_aiRefPOCList[e][iRefIdx]; }
-  Void          setRefViewIdx( Int i, RefPicList e, Int iRefIdx ) { m_aiRefViewIdxList[e][iRefIdx] = i; }
-  Int           getRefViewIdx( RefPicList e, Int iRefIdx )        { return m_aiRefViewIdxList[e][iRefIdx]; }
-  Int           getNumRefs( RefPicList e )                    { return m_aiNumRefIdx[e]; }
-  Void          setNumRefs( Int i, RefPicList e )             { m_aiNumRefIdx[e] = i; }
-  Void          setViewIdx( Int i )                           { m_iViewIdx = i; }
-  Int           getViewIdx()                                  { return m_iViewIdx; }
-#if SONY_COLPIC_AVAILABILITY
-  Void          setViewOrderIdx(Int i)                        { m_iViewOrderIdx = i; }
-  Int           getViewOrderIdx()                             { return m_iViewOrderIdx; }
-#endif
-
-  Void          setScaleOffset( Int** pS, Int** pO )  { m_aaiCodedScale = pS; m_aaiCodedOffset = pO; }
-  Int**         getCodedScale ()                      { return m_aaiCodedScale;  }
-  Int**         getCodedOffset()                      { return m_aaiCodedOffset; }
-
-#if HHI_VSO
-  TComMVDRefData* getMVDReferenceInfo() { return &m_cReferenceInfo; }
-#endif
-
+  
   UInt          getNumCUsInFrame()      { return m_apcPicSym->getNumberOfCUsInFrame(); }
   UInt          getNumPartInWidth()     { return m_apcPicSym->getNumPartInWidth();     }
@@ -183,17 +164,21 @@
   UInt          getMinCUWidth()         { return m_apcPicSym->getMinCUWidth();         }
   UInt          getMinCUHeight()        { return m_apcPicSym->getMinCUHeight();        }
-
+  
   UInt          getParPelX(UChar uhPartIdx) { return getParPelX(uhPartIdx); }
   UInt          getParPelY(UChar uhPartIdx) { return getParPelX(uhPartIdx); }
-
+  
   Int           getStride()           { return m_apcPicYuv[1]->getStride(); }
   Int           getCStride()          { return m_apcPicYuv[1]->getCStride(); }
-
+  
   Void          setReconMark (Bool b) { m_bReconstructed = b;     }
   Bool          getReconMark ()       { return m_bReconstructed;  }
 
-#if AMVP_BUFFERCOMPRESS
-  Void          compressMotion();
-#endif
+  Void          setUsedForTMVP( Bool b ) { m_usedForTMVP = b;    }
+  Bool          getUsedForTMVP()         { return m_usedForTMVP; }
+
+  Void          setOutputMark (Bool b) { m_bNeededForOutput = b;     }
+  Bool          getOutputMark ()       { return m_bNeededForOutput;  }
+ 
+  Void          compressMotion(); 
   UInt          getCurrSliceIdx()            { return m_uiCurrSliceIdx;                }
   Void          setCurrSliceIdx(UInt i)      { m_uiCurrSliceIdx = i;                   }
@@ -201,26 +186,24 @@
   Void          allocateNewSlice()           {m_apcPicSym->allocateNewSlice();         }
   Void          clearSliceBuffer()           {m_apcPicSym->clearSliceBuffer();         }
-
-  Void          addOriginalBuffer       ();
-#if PARALLEL_MERGED_DEBLK
-  Void          addDeblockBuffer        ();
-#endif
-#if DEPTH_MAP_GENERATION
-  Void          addPrdDepthMapBuffer    ( UInt uiSubSampExpX, UInt uiSubSampExpY );
-#endif
-#if HHI_INTER_VIEW_MOTION_PRED
-  Void          addOrgDepthMapBuffer    ();
-#endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
-  Void          addResidualBuffer       ();
-#endif
-
 #if HHI_INTERVIEW_SKIP
   Void          addUsedPelsMapBuffer    ();
-#endif
-
-  Void          removeOriginalBuffer    ();
-#if PARALLEL_MERGED_DEBLK
-  Void          removeDeblockBuffer     ();
+  Void          removeUsedPelsMapBuffer ();
+#endif
+  
+  Void          createNonDBFilterInfo   (UInt* pSliceStartAddress = NULL, Int numSlices = 1, Int sliceGranularityDepth= 0
+                                        ,Bool bNDBFilterCrossSliceBoundary = true
+                                        ,Int  numTiles = 1
+                                        ,Bool bNDBFilterCrossTileBoundary = true);
+  Void          createNonDBFilterInfoLCU(Int tileID, Int sliceID, TComDataCU* pcCU, UInt startSU, UInt endSU, Int sliceGranularyDepth, UInt picWidth, UInt picHeight);
+  Void          destroyNonDBFilterInfo();
+
+#if DEPTH_MAP_GENERATION
+  Void          addPrdDepthMapBuffer    ( UInt uiSubSampExpX, UInt uiSubSampExpY );
+#endif
+#if HHI_INTER_VIEW_MOTION_PRED
+  Void          addOrgDepthMapBuffer    ();
+#endif
+#if HHI_INTER_VIEW_RESIDUAL_PRED
+  Void          addResidualBuffer       ();
 #endif
 #if DEPTH_MAP_GENERATION
@@ -233,28 +216,27 @@
   Void          removeResidualBuffer    ();
 #endif
-#if HHI_INTERVIEW_SKIP
-  Void          removeUsedPelsMapBuffer ();
-#endif
-
-#if PARALLEL_MERGED_DEBLK
-  TComPicYuv*   getPicYuvDeblkBuf()      { return  m_pcPicYuvDeblkBuf; }
-#endif
-
-  /** transfer ownership of @seis to @this picture */
+  Bool          getValidSlice                                  (Int sliceID)  {return m_pbValidSlice[sliceID];}
+  Int           getSliceGranularityForNDBFilter                ()             {return m_sliceGranularityForNDBFilter;}
+  Bool          getIndependentSliceBoundaryForNDBFilter        ()             {return m_bIndependentSliceBoundaryForNDBFilter;}
+  Bool          getIndependentTileBoundaryForNDBFilter         ()             {return m_bIndependentTileBoundaryForNDBFilter; }
+  TComPicYuv*   getYuvPicBufferForIndependentBoundaryProcessing()             {return m_pNDBFilterYuvTmp;}
+  std::vector<TComDataCU*>& getOneSliceCUDataForNDBFilter      (Int sliceID) { return m_vSliceCUDataLink[sliceID];}
+
+  /** transfer ownership of seis to this picture */
   void setSEIs(SEImessages* seis) { m_SEIs = seis; }
 
   /**
    * return the current list of SEI messages associated with this picture.
-   * Pointer is valid until @this->destroy() is called */
+   * Pointer is valid until this->destroy() is called */
   SEImessages* getSEIs() { return m_SEIs; }
 
   /**
    * return the current list of SEI messages associated with this picture.
-   * Pointer is valid until @this->destroy() is called */
+   * Pointer is valid until this->destroy() is called */
   const SEImessages* getSEIs() const { return m_SEIs; }
 
 };// END CLASS DEFINITION TComPic
 
+//! \}
 
 #endif // __TCOMPIC__
-
