Changeset 1313 in 3DVCSoftware for trunk/source/Lib/TLibCommon/TComPic.h


Ignore:
Timestamp:
13 Aug 2015, 17:38:13 (9 years ago)
Author:
tech
Message:

Merged 14.1-update-dev1@1312.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibCommon/TComPic.h

    r1179 r1313  
    22 * License, included below. This software may be subject to other third party
    33 * and contributor rights, including patent rights, and no such rights are
    4  * granted under this license. 
    5  *
    6 * Copyright (c) 2010-2015, ITU/ISO/IEC
     4 * granted under this license.
     5 *
     6 * Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    3636*/
    3737
    38 
    3938#ifndef __TCOMPIC__
    4039#define __TCOMPIC__
     
    4544#include "TComPicYuv.h"
    4645#include "TComBitStream.h"
    47 #include "SEI.h"
    4846
    4947//! \ingroup TLibCommon
     
    5553
    5654/// picture class (symbol + YUV buffers)
     55
    5756class TComPic
    5857{
     58public:
     59  typedef enum { PIC_YUV_ORG=0, PIC_YUV_REC=1, PIC_YUV_TRUE_ORG=2, NUM_PIC_YUV=3 } PIC_YUV_T;
     60     // TRUE_ORG is the input file without any pre-encoder colour space conversion (but with possible bit depth increment)
     61  TComPicYuv*   getPicYuvTrueOrg()        { return  m_apcPicYuv[PIC_YUV_TRUE_ORG]; }
     62
    5963private:
    6064  UInt                  m_uiTLayer;               //  Temporal layer
    6165  Bool                  m_bUsedByCurr;            //  Used by current picture
    6266  Bool                  m_bIsLongTerm;            //  IS long term picture
    63   TComPicSym*           m_apcPicSym;              //  Symbol
    64  
    65   TComPicYuv*           m_apcPicYuv[2];           //  Texture,  0:org / 1:rec
    66  
     67  TComPicSym            m_picSym;                 //  Symbol
     68  TComPicYuv*           m_apcPicYuv[NUM_PIC_YUV];
     69
    6770  TComPicYuv*           m_pcPicYuvPred;           //  Prediction
    6871  TComPicYuv*           m_pcPicYuvResi;           //  Residual
    6972  Bool                  m_bReconstructed;
    7073  Bool                  m_bNeededForOutput;
    71 #if H_MV
     74#if NH_MV
    7275  Bool                  m_bPicOutputFlag;         // Semantics variable
    7376#endif
    7477  UInt                  m_uiCurrSliceIdx;         // Index of current slice
    7578  Bool                  m_bCheckLTMSB;
    76  
    77   Int                   m_numReorderPics[MAX_TLAYER];
    78   Window                m_conformanceWindow;
    79   Window                m_defaultDisplayWindow;
    80 
    81   bool                  m_isTop;
    82   bool                  m_isField;
    83  
     79
     80  Bool                  m_isTop;
     81  Bool                  m_isField;
     82
    8483  std::vector<std::vector<TComDataCU*> > m_vSliceCUDataLink;
    8584
    8685  SEIMessages  m_SEIs; ///< Any SEI messages that have been received.  If !NULL we own the object.
    87 
    88 #if H_MV
     86#if NH_MV
    8987  Int                   m_layerId;
    9088  Int                   m_viewId;
    91 #if H_3D
     89#if NH_3D
    9290  Int                   m_viewIndex;
    9391  Bool                  m_isDepth;
     
    9694#endif
    9795#endif
    98 #if H_3D_QTLPC
     96#if NH_3D_QTLPC
    9997  Bool                  m_bReduceBitsQTL;
    10098#endif
    101 #if H_3D_NBDV
     99#if NH_3D_NBDV
    102100  UInt        m_uiRapRefIdx;
    103101  RefPicList  m_eRapRefList;
    104102  Int         m_iNumDdvCandPics;
    105   Bool        m_abTIVRINCurrRL  [2][2][MAX_NUM_REF]; //whether an inter-view reference picture with the same view index of the inter-view reference picture of temporal reference picture of current picture exists in current reference picture lists
     103  Bool        m_abTIVRINCurrRL [2][2][MAX_NUM_REF]; //whether an inter-view reference picture with the same view index of the inter-view reference picture of temporal reference picture of current picture exists in current reference picture lists
    106104  Int         m_aiTexToDepRef  [2][MAX_NUM_REF];
    107105#endif
     106
    108107public:
    109108  TComPic();
    110109  virtual ~TComPic();
    111  
    112   Void          create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow,
    113                         Int *numReorderPics, Bool bIsVirtual = false );
    114                        
     110
     111  Void          create( const TComSPS &sps, const TComPPS &pps, const Bool bIsVirtual /*= false*/ );
     112
    115113  virtual Void  destroy();
    116  
    117   UInt          getTLayer()                { return m_uiTLayer;   }
     114
     115  UInt          getTLayer() const               { return m_uiTLayer;   }
    118116  Void          setTLayer( UInt uiTLayer ) { m_uiTLayer = uiTLayer; }
    119 
    120 #if H_MV
     117#if NH_MV
    121118  Void          setLayerId            ( Int layerId )    { m_layerId      = layerId; }
    122119  Int           getLayerId            ()                 { return m_layerId;    }
    123120  Void          setViewId             ( Int viewId )     { m_viewId = viewId;   }
    124121  Int           getViewId             ()                 { return m_viewId;     }
    125 #if H_3D
     122#if NH_3D
    126123  Void          setViewIndex          ( Int viewIndex )  { m_viewIndex = viewIndex;   }
    127124  Int           getViewIndex          ()                 { return m_viewIndex;     }
     
    135132#endif
    136133#endif
    137 #if H_3D_QTLPC
     134#if NH_3D_QTLPC
    138135  Bool          getReduceBitsFlag ()             { return m_bReduceBitsQTL;     }
    139136  Void          setReduceBitsFlag ( Bool bFlag ) { m_bReduceBitsQTL = bFlag;    }
    140137#endif
    141   Bool          getUsedByCurr()             { return m_bUsedByCurr; }
     138
     139  Bool          getUsedByCurr() const            { return m_bUsedByCurr; }
    142140  Void          setUsedByCurr( Bool bUsed ) { m_bUsedByCurr = bUsed; }
    143   Bool          getIsLongTerm()             { return m_bIsLongTerm; }
     141  Bool          getIsLongTerm() const            { return m_bIsLongTerm; }
    144142  Void          setIsLongTerm( Bool lt ) { m_bIsLongTerm = lt; }
    145143  Void          setCheckLTMSBPresent     (Bool b ) {m_bCheckLTMSB=b;}
    146144  Bool          getCheckLTMSBPresent     () { return m_bCheckLTMSB;}
    147145
    148   TComPicSym*   getPicSym()           { return  m_apcPicSym;    }
    149   TComSlice*    getSlice(Int i)       { return  m_apcPicSym->getSlice(i);  }
    150   Int           getPOC()              { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getPOC();  }
    151   TComDataCU*&  getCU( UInt uiCUAddr )  { return  m_apcPicSym->getCU( uiCUAddr ); }
    152  
    153   TComPicYuv*   getPicYuvOrg()        { return  m_apcPicYuv[0]; }
    154   TComPicYuv*   getPicYuvRec()        { return  m_apcPicYuv[1]; }
    155  
     146  TComPicSym*   getPicSym()           { return  &m_picSym;    }
     147  TComSlice*    getSlice(Int i)       { return  m_picSym.getSlice(i);  }
     148  Int           getPOC() const        { return  m_picSym.getSlice(m_uiCurrSliceIdx)->getPOC();  }
     149  TComDataCU*   getCtu( UInt ctuRsAddr )           { return  m_picSym.getCtu( ctuRsAddr ); }
     150  const TComDataCU* getCtu( UInt ctuRsAddr ) const { return  m_picSym.getCtu( ctuRsAddr ); }
     151
     152  TComPicYuv*   getPicYuvOrg()        { return  m_apcPicYuv[PIC_YUV_ORG]; }
     153  TComPicYuv*   getPicYuvRec()        { return  m_apcPicYuv[PIC_YUV_REC]; }
     154
    156155  TComPicYuv*   getPicYuvPred()       { return  m_pcPicYuvPred; }
    157156  TComPicYuv*   getPicYuvResi()       { return  m_pcPicYuvResi; }
    158157  Void          setPicYuvPred( TComPicYuv* pcPicYuv )       { m_pcPicYuvPred = pcPicYuv; }
    159158  Void          setPicYuvResi( TComPicYuv* pcPicYuv )       { m_pcPicYuvResi = pcPicYuv; }
    160  
    161   UInt          getNumCUsInFrame()      { return m_apcPicSym->getNumberOfCUsInFrame(); }
    162   UInt          getNumPartInWidth()     { return m_apcPicSym->getNumPartInWidth();     }
    163   UInt          getNumPartInHeight()    { return m_apcPicSym->getNumPartInHeight();    }
    164   UInt          getNumPartInCU()        { return m_apcPicSym->getNumPartition();       }
    165   UInt          getFrameWidthInCU()     { return m_apcPicSym->getFrameWidthInCU();     }
    166   UInt          getFrameHeightInCU()    { return m_apcPicSym->getFrameHeightInCU();    }
    167   UInt          getMinCUWidth()         { return m_apcPicSym->getMinCUWidth();         }
    168   UInt          getMinCUHeight()        { return m_apcPicSym->getMinCUHeight();        }
    169  
    170   UInt          getParPelX(UChar uhPartIdx) { return getParPelX(uhPartIdx); }
    171   UInt          getParPelY(UChar uhPartIdx) { return getParPelX(uhPartIdx); }
    172  
    173   Int           getStride()           { return m_apcPicYuv[1]->getStride(); }
    174   Int           getCStride()          { return m_apcPicYuv[1]->getCStride(); }
    175  
     159
     160  UInt          getNumberOfCtusInFrame() const     { return m_picSym.getNumberOfCtusInFrame(); }
     161  UInt          getNumPartInCtuWidth() const       { return m_picSym.getNumPartInCtuWidth();   }
     162  UInt          getNumPartInCtuHeight() const      { return m_picSym.getNumPartInCtuHeight();  }
     163  UInt          getNumPartitionsInCtu() const      { return m_picSym.getNumPartitionsInCtu();  }
     164  UInt          getFrameWidthInCtus() const        { return m_picSym.getFrameWidthInCtus();    }
     165  UInt          getFrameHeightInCtus() const       { return m_picSym.getFrameHeightInCtus();   }
     166  UInt          getMinCUWidth() const              { return m_picSym.getMinCUWidth();          }
     167  UInt          getMinCUHeight() const             { return m_picSym.getMinCUHeight();         }
     168
     169  Int           getStride(const ComponentID id) const          { return m_apcPicYuv[PIC_YUV_REC]->getStride(id); }
     170  Int           getComponentScaleX(const ComponentID id) const    { return m_apcPicYuv[PIC_YUV_REC]->getComponentScaleX(id); }
     171  Int           getComponentScaleY(const ComponentID id) const    { return m_apcPicYuv[PIC_YUV_REC]->getComponentScaleY(id); }
     172  ChromaFormat  getChromaFormat() const                           { return m_apcPicYuv[PIC_YUV_REC]->getChromaFormat(); }
     173  Int           getNumberValidComponents() const                  { return m_apcPicYuv[PIC_YUV_REC]->getNumberValidComponents(); }
     174
    176175  Void          setReconMark (Bool b) { m_bReconstructed = b;     }
    177   Bool          getReconMark ()       { return m_bReconstructed;  }
     176  Bool          getReconMark () const      { return m_bReconstructed;  }
    178177  Void          setOutputMark (Bool b) { m_bNeededForOutput = b;     }
    179   Bool          getOutputMark ()       { return m_bNeededForOutput;  }
    180  #if H_MV
     178  Bool          getOutputMark () const      { return m_bNeededForOutput;  }
     179 #if NH_MV
    181180  Void          setPicOutputFlag(Bool b) { m_bPicOutputFlag = b;      }
    182181  Bool          getPicOutputFlag()       { return m_bPicOutputFlag ;  }
    183182#endif
    184 
    185   Void          setNumReorderPics(Int i, UInt tlayer) { m_numReorderPics[tlayer] = i;    }
    186   Int           getNumReorderPics(UInt tlayer)        { return m_numReorderPics[tlayer]; }
    187 #if H_3D
     183#if NH_3D
     184#if NH_3D_ARP
     185  Void          getCUAddrAndPartIdx( Int iX, Int iY, Int& riCuAddr, Int& riAbsZorderIdx );
     186#endif
    188187  Void          compressMotion(Int scale);
    189188#else   
    190   Void          compressMotion(); 
    191 #endif
    192   UInt          getCurrSliceIdx()            { return m_uiCurrSliceIdx;                }
     189  Void          compressMotion();
     190#endif
     191  UInt          getCurrSliceIdx() const           { return m_uiCurrSliceIdx;                }
    193192  Void          setCurrSliceIdx(UInt i)      { m_uiCurrSliceIdx = i;                   }
    194   UInt          getNumAllocatedSlice()       {return m_apcPicSym->getNumAllocatedSlice();}
    195   Void          allocateNewSlice()           {m_apcPicSym->allocateNewSlice();         }
    196   Void          clearSliceBuffer()           {m_apcPicSym->clearSliceBuffer();         }
    197 
    198   Window&       getConformanceWindow()  { return m_conformanceWindow; }
    199   Window&       getDefDisplayWindow()   { return m_defaultDisplayWindow; }
     193  UInt          getNumAllocatedSlice() const      {return m_picSym.getNumAllocatedSlice();}
     194  Void          allocateNewSlice()           {m_picSym.allocateNewSlice();         }
     195  Void          clearSliceBuffer()           {m_picSym.clearSliceBuffer();         }
     196
     197  const Window& getConformanceWindow() const { return m_picSym.getSPS().getConformanceWindow(); }
     198  Window        getDefDisplayWindow() const  { return m_picSym.getSPS().getVuiParametersPresentFlag() ? m_picSym.getSPS().getVuiParameters()->getDefaultDisplayWindow() : Window(); }
    200199
    201200  Bool          getSAOMergeAvailability(Int currAddr, Int mergeAddr);
    202201
     202  UInt          getSubstreamForCtuAddr(const UInt ctuAddr, const Bool bAddressInRaster, TComSlice *pcSlice);
     203
    203204  /* field coding parameters*/
    204205
    205    Void              setTopField(bool b)                  {m_isTop = b;}
    206    bool              isTopField()                         {return m_isTop;}
    207    Void              setField(bool b)                     {m_isField = b;}
    208    bool              isField()                            {return m_isField;}
    209 
    210 #if H_MV
     206   Void              setTopField(Bool b)                  {m_isTop = b;}
     207   Bool              isTopField()                         {return m_isTop;}
     208   Void              setField(Bool b)                     {m_isField = b;}
     209   Bool              isField()                            {return m_isField;}
     210
     211#if NH_MV
    211212  Void          print( Bool legend );
    212213#endif
    213 #if H_3D_NBDV
     214#if NH_3D_NBDV
    214215  Int           getNumDdvCandPics()                    {return m_iNumDdvCandPics;   }
    215216  Int           getDisCandRefPictures(Int iColPOC);
     
    224225  Int           isTextRefValid(Int iTextRefDir, Int iTextRefIdx);
    225226#endif
     227
    226228  /** transfer ownership of seis to this picture */
    227   void setSEIs(SEIMessages& seis) { m_SEIs = seis; }
     229  Void setSEIs(SEIMessages& seis) { m_SEIs = seis; }
    228230
    229231  /**
     
    236238   * Pointer is valid until this->destroy() is called */
    237239  const SEIMessages& getSEIs() const { return m_SEIs; }
    238 
    239240};// END CLASS DEFINITION TComPic
    240241
    241 #if H_MV
     242#if NH_MV
    242243class TComPicLists
    243244{
    244245private:
    245246  TComList<TComList<TComPic*>*> m_lists;
    246 #if H_3D
    247   TComVPS*                     m_vps;
     247#if NH_3D
     248  const TComVPS*                     m_vps;
    248249#endif
    249250public:
    250251  Void        push_back( TComList<TComPic*>* list ) { m_lists.push_back( list );   }
    251252  Int         size     ()                           { return (Int) m_lists.size(); }
    252 #if H_3D_ARP
     253#if NH_3D_ARP
    253254  TComList<TComPic*>*  getPicList   ( Int layerIdInNuh );
    254255#endif
    255256  TComPic*    getPic   ( Int layerIdInNuh,              Int poc );   
    256257  TComPicYuv* getPicYuv( Int layerIdInNuh,              Int poc, Bool recon );
    257 #if H_3D
    258   Void        setVPS   ( TComVPS* vps ) { m_vps = vps;  };
     258#if NH_3D
     259  Void        setVPS   ( const TComVPS* vps ) { m_vps = vps;  };
    259260  TComPic*    getPic   ( Int viewIndex, Bool depthFlag, Int poc );
    260261  TComPicYuv* getPicYuv( Int viewIndex, Bool depthFlag, Int poc, Bool recon );
     
    266267
    267268#endif
     269
    268270//! \}
    269271
Note: See TracChangeset for help on using the changeset viewer.