Changeset 5 in 3DVCSoftware for trunk/source/Lib/TLibCommon/TComSlice.h


Ignore:
Timestamp:
12 Dec 2011, 18:35:44 (14 years ago)
Author:
hhi
Message:

Clean version with cfg-files

File:
1 edited

Legend:

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

    r2 r5  
     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-2011, 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 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
    134
    235
     
    1750
    1851class TComPic;
     52#if DEPTH_MAP_GENERATION
    1953class TComDepthMapGenerator;
     54#endif
     55#if HHI_INTER_VIEW_RESIDUAL_PRED
    2056class TComResidualGenerator;
     57#endif
    2158
    2259// ====================================================================================================================
     
    3875  UInt        m_uiMinTrDepth;
    3976  UInt        m_uiMaxTrDepth;
    40  
     77
    4178  UInt        m_uiViewId;
    4279  Int         m_iViewOrderIdx;
     
    5491  Bool        m_bUseALF;
    5592  Bool        m_bUseDQP;
    56 #if !SB_NO_LowDelayCoding
     93#if !HHI_NO_LowDelayCoding
    5794  Bool        m_bUseLDC;
    5895#endif
     
    6097  Bool        m_bUseMRG; // SOPH:
    6198
    62 #if LM_CHROMA 
     99#if LM_CHROMA
    63100  Bool        m_bUseLMChroma; // JL:
    64101#endif
     
    68105  Bool        m_bLCMod;
    69106#endif
    70  
     107
    71108#if HHI_RMP_SWITCH
    72109  Bool        m_bUseRMP;
     
    76113  UInt        m_uiBitDepth;
    77114  UInt        m_uiBitIncrement;
    78  
     115
    79116  // Max physical transform size
    80117  UInt        m_uiMaxTrSize;
    81  
     118
    82119  Int m_iAMPAcc[MAX_CU_DEPTH];
    83120
     
    86123#endif
    87124#if MTK_SAO
    88   Bool        m_bUseSAO;
    89 #endif
     125  Bool        m_bUseSAO;
     126#endif
     127#if HHI_MPI
    90128  Bool        m_bUseMVI;
     129#endif
    91130
    92131  UInt m_uiCodedPictureBufferSize ;
    93132
    94 #if HHI_DMM_INTRA
    95   Bool  m_bUseDepthModelModes;
    96 #endif
    97 
     133#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     134  Bool  m_bUseDMM;
     135#endif
     136
     137#if DEPTH_MAP_GENERATION
    98138  UInt  m_uiPredDepthMapGeneration;
    99   UInt  m_uiMultiviewMvPredMode;
    100139  UInt  m_uiPdmPrecision;
    101140  Int   m_aiPdmScaleNomDelta[MAX_NUMBER_VIEWS];
    102141  Int   m_aiPdmOffset       [MAX_NUMBER_VIEWS];
     142#endif
     143#if HHI_INTER_VIEW_MOTION_PRED
     144  UInt  m_uiMultiviewMvPredMode;
     145#endif
     146#if HHI_INTER_VIEW_RESIDUAL_PRED
    103147  UInt  m_uiMultiviewResPredMode;
    104 
     148#endif
     149
     150#if DEPTH_MAP_GENERATION
    105151  TComDepthMapGenerator* m_pcDepthMapGenerator;
     152#endif
     153#if HHI_INTER_VIEW_RESIDUAL_PRED
    106154  TComResidualGenerator* m_pcResidualGenerator;
     155#endif
    107156
    108157public:
    109158  TComSPS();
    110159  virtual ~TComSPS();
    111  
     160
    112161  // structure
    113162  Void setSPSId       ( UInt u ) { m_uiSPSId = u;           }
     
    140189  Int  getPad         ( Int  u ) { assert(u < 2); return m_aiPad[u];}
    141190  Int* getPad         ( )        { return m_aiPad; }
    142  
     191
    143192  Void        initMultiviewSPS      ( UInt uiViewId, Int iViewOrderIdx = 0, UInt uiCamParPrecision = 0, Bool bCamParSlice = false, Int** aaiScale = 0, Int** aaiOffset = 0 );
    144193  Void        initMultiviewSPSDepth ( UInt uiViewId, Int iViewOrderIdx );
     
    157206  Void setMaxTrSize   ( UInt u ) { m_uiMaxTrSize = u;       }
    158207  UInt getMaxTrSize   ()         { return  m_uiMaxTrSize;   }
    159  
     208
    160209  // Tool list
    161210  Bool getUseALF      ()         { return m_bUseALF;        }
    162211  Bool getUseDQP      ()         { return m_bUseDQP;        }
    163  
    164 #if !SB_NO_LowDelayCoding
     212
     213#if !HHI_NO_LowDelayCoding
    165214  Bool getUseLDC      ()         { return m_bUseLDC;        }
    166215#endif
    167216  Bool getUsePAD      ()         { return m_bUsePAD;        }
    168217  Bool getUseMRG      ()         { return m_bUseMRG;        } // SOPH:
    169  
     218
    170219  Void setUseALF      ( Bool b ) { m_bUseALF  = b;          }
    171220  Void setUseDQP      ( Bool b ) { m_bUseDQP   = b;         }
    172  
    173 #if !SB_NO_LowDelayCoding
     221
     222#if !HHI_NO_LowDelayCoding
    174223  Void setUseLDC      ( Bool b ) { m_bUseLDC   = b;         }
    175224#endif
     
    177226  Void setUseMRG      ( Bool b ) { m_bUseMRG  = b;          } // SOPH:
    178227 
    179 #if HHI_DMM_INTRA
    180   Bool getUseDepthModelModes()         { return m_bUseDepthModelModes; }
    181   Void setUseDepthModelModes( Bool b ) { m_bUseDepthModelModes = b;    }
     228#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     229  Bool getUseDMM()         { return m_bUseDMM; }
     230  Void setUseDMM( Bool b ) { m_bUseDMM = b;    }
    182231#endif
    183232
     
    194243  Void setUseRMP     ( Bool b ) { m_bUseRMP = b;    }
    195244#endif
    196  
    197 #if LM_CHROMA 
     245
     246#if LM_CHROMA
    198247  Bool getUseLMChroma ()         { return m_bUseLMChroma;        }
    199248  Void setUseLMChroma ( Bool b ) { m_bUseLMChroma  = b;          }
     
    203252  AMVP_MODE getAMVPMode ( UInt uiDepth ) { assert(uiDepth < g_uiMaxCUDepth);  return m_aeAMVPMode[uiDepth]; }
    204253  Void      setAMVPMode ( UInt uiDepth, AMVP_MODE eMode) { assert(uiDepth < g_uiMaxCUDepth);  m_aeAMVPMode[uiDepth] = eMode; }
    205  
     254
    206255  // Bit-depth
    207256  UInt      getBitDepth     ()         { return m_uiBitDepth;     }
     
    212261#if MTK_NONCROSS_INLOOP_FILTER
    213262  Void      setLFCrossSliceBoundaryFlag     ( Bool   bValue  )    { m_bLFCrossSliceBoundaryFlag = bValue; }
    214   Bool      getLFCrossSliceBoundaryFlag     ()                    { return m_bLFCrossSliceBoundaryFlag;   } 
     263  Bool      getLFCrossSliceBoundaryFlag     ()                    { return m_bLFCrossSliceBoundaryFlag;   }
    215264#endif
    216265
     
    220269#endif
    221270
     271#if HHI_MPI
    222272  Void setUseMVI                  (Bool bVal)  {m_bUseMVI = bVal;}
    223273  Bool getUseMVI                  ()           {return m_bUseMVI;}
     274#endif
    224275
    225276  Void      setCodedPictureBufferSize( UInt u ) { m_uiCodedPictureBufferSize = u ;}
    226277  UInt      getCodedPictureBufferSize( )        { return m_uiCodedPictureBufferSize ;}
    227278
     279#if DEPTH_MAP_GENERATION
    228280  Void  setPredDepthMapGeneration( UInt uiViewId, Bool bIsDepth, UInt uiPdmGenMode = 0, UInt uiPdmMvPredMode = 0, UInt uiPdmPrec = 0, Int** aaiPdmScaleNomDelta = 0, Int** aaiPdmOffset = 0 );
     281#endif
     282#if HHI_INTER_VIEW_RESIDUAL_PRED
    229283  Void  setMultiviewResPredMode  ( UInt uiResPrdMode ) { m_uiMultiviewResPredMode = uiResPrdMode; }
    230  
     284#endif
     285
     286#if DEPTH_MAP_GENERATION
    231287  UInt  getPredDepthMapGeneration()          { return m_uiPredDepthMapGeneration; }
    232   UInt  getMultiviewMvPredMode   ()          { return m_uiMultiviewMvPredMode;    }
    233288  UInt  getPdmPrecision          ()          { return m_uiPdmPrecision;           }
    234289  Int*  getPdmScaleNomDelta      ()          { return m_aiPdmScaleNomDelta;       }
    235290  Int*  getPdmOffset             ()          { return m_aiPdmOffset;              }
     291#endif
     292#if HHI_INTER_VIEW_MOTION_PRED
     293  UInt  getMultiviewMvPredMode   ()          { return m_uiMultiviewMvPredMode;    }
     294#endif
     295#if HHI_INTER_VIEW_RESIDUAL_PRED
    236296  UInt  getMultiviewResPredMode  ()          { return m_uiMultiviewResPredMode;   }
    237 
     297#endif
     298
     299#if DEPTH_MAP_GENERATION
    238300  Void                    setDepthMapGenerator( TComDepthMapGenerator* pcDepthMapGenerator )  { m_pcDepthMapGenerator = pcDepthMapGenerator; }
    239301  TComDepthMapGenerator*  getDepthMapGenerator()                                              { return m_pcDepthMapGenerator; }
    240 
     302#endif
     303#if HHI_INTER_VIEW_RESIDUAL_PRED
    241304  Void                    setResidualGenerator( TComResidualGenerator* pcResidualGenerator )  { m_pcResidualGenerator = pcResidualGenerator; }
    242305  TComResidualGenerator*  getResidualGenerator()                                              { return m_pcResidualGenerator; }
     306#endif
    243307};
    244308
     
    256320  UInt        m_uiPPSId;
    257321  UInt        m_uiSPSId;
    258  
     322
    259323public:
    260324  TComPPS();
    261325  virtual ~TComPPS();
    262  
     326
    263327  Void      setPPSId                ( UInt u ) { m_uiPPSId = u; }
    264328  UInt      getPPSId                ()         { return m_uiPPSId; }
     
    301365class TComSlice
    302366{
    303  
     367
    304368private:
    305369  //  Bitstream writing
     
    313377  Int         m_iSymbolMode;
    314378  Bool        m_bLoopFilterDisable;
    315  
     379
    316380#if DCM_COMB_LIST
    317381  Int         m_aiNumRefIdx   [3];    //  for multiple reference of current slice
     
    326390#else
    327391  Int         m_aiNumRefIdx   [2];    //  for multiple reference of current slice
    328 #endif 
     392#endif
    329393
    330394  //  Data
     
    334398  Int         m_iDepth;
    335399  TComPic*    m_pcTexturePic;
    336  
     400
    337401  // referenced slice?
    338402  Bool        m_bRefenced;
     
    340404  Bool        m_bRounding;
    341405#endif
    342  
     406
    343407  // access channel
    344408  TComSPS*    m_pcSPS;
    345409  TComPPS*    m_pcPPS;
    346410  TComPic*    m_pcPic;
    347  
     411
    348412  UInt        m_uiColDir;  // direction to get colocated CUs
    349  
     413
    350414  Double      m_dLambda;
    351  
     415
    352416  Bool        m_abEqualRef  [2][MAX_NUM_REF][MAX_NUM_REF];
    353417
    354   // SB
    355418  Int         m_iViewIdx;
    356419  Int         m_aiRefViewList[2][MAX_INPUT_VIEW_NUM];
    357  
     420
    358421  Bool        m_bNoBackPredFlag;
    359422#if MS_LCEC_LOOKUP_TABLE_EXCEPTION
     
    381444  wpACDCParam   m_weightACDCParam[3]; // [0:Y, 1:U, 2:V]
    382445#endif
    383  
     446
    384447public:
    385448  TComSlice();
    386449  virtual ~TComSlice();
    387  
     450
    388451  Void      initSlice       ();
    389  
     452
    390453  Void      setSPS          ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; }
    391454  TComSPS*  getSPS          () { return m_pcSPS; }
    392  
     455
    393456  Void      setPPS          ( TComPPS* pcPPS ) { m_pcPPS = pcPPS; }
    394457  TComPPS*  getPPS          () { return m_pcPPS; }
    395  
     458
    396459  UInt      getPPSId        ()                          { return  m_uiPPSId;            }
    397460  SliceType getSliceType    ()                          { return  m_eSliceType;         }
     
    407470  Int       getDepth            ()                              { return  m_iDepth;                     }
    408471  UInt      getColDir           ()                              { return  m_uiColDir;                   }
    409  
    410 #if DCM_COMB_LIST 
     472
     473#if DCM_COMB_LIST
    411474  Int       getRefIdxOfLC       (RefPicList e, Int iRefIdx)     { return m_iRefIdxOfLC[e][iRefIdx];           }
    412475  Int       getListIdFromIdxOfLC(Int iRefIdx)                   { return m_eListIdFromIdxOfLC[iRefIdx];       }
     
    415478  Int       getRefIdxOfL1FromRefIdxOfL0(Int iRefIdx)            { return m_iRefIdxOfL1FromRefIdxOfL0[iRefIdx];}
    416479  Bool      getRefPicListModificationFlagLC()                   {return m_bRefPicListModificationFlagLC;}
    417   Void      setRefPicListModificationFlagLC(Bool bflag)         {m_bRefPicListModificationFlagLC=bflag;}     
     480  Void      setRefPicListModificationFlagLC(Bool bflag)         {m_bRefPicListModificationFlagLC=bflag;}
    418481  Bool      getRefPicListCombinationFlag()                      {return m_bRefPicListCombinationFlag;}
    419   Void      setRefPicListCombinationFlag(Bool bflag)            {m_bRefPicListCombinationFlag=bflag;}     
     482  Void      setRefPicListCombinationFlag(Bool bflag)            {m_bRefPicListCombinationFlag=bflag;}
    420483  Void      setListIdFromIdxOfLC(Int  iRefIdx, UInt uiVal)      { m_eListIdFromIdxOfLC[iRefIdx]=uiVal; }
    421484  Void      setRefIdxFromIdxOfLC(Int  iRefIdx, UInt uiVal)      { m_iRefIdxFromIdxOfLC[iRefIdx]=uiVal; }
     
    429492  Bool      isRounding()                                        { return m_bRounding; }
    430493#endif
    431  
     494
    432495  Void      setPPSId            ( UInt u )                      { m_uiPPSId           = u;      }
    433496  Void      setPOC              ( Int i )                       { m_iPOC              = i;      }
     
    442505  Void      setSymbolMode       ( Int b  )                      { m_iSymbolMode       = b;      }
    443506  Void      setLoopFilterDisable( Bool b )                      { m_bLoopFilterDisable= b;      }
    444  
     507
    445508  Void      setRefPic           ( TComPic* p, RefPicList e, Int iRefIdx ) { m_apcRefPicList[e][iRefIdx] = p; }
    446509  Void      setRefPOC           ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefPOCList[e][iRefIdx] = i; }
     
    448511  Void      setPic              ( TComPic* p )                  { m_pcPic             = p;      }
    449512  Void      setDepth            ( Int iDepth )                  { m_iDepth            = iDepth; }
    450  
     513
    451514  Void      setRefPicList       ( TComList<TComPic*>& rcListPic );
    452515  Void      setRefPOCList       ();
    453516  Void      setColDir           ( UInt uiDir ) { m_uiColDir = uiDir; }
    454  
     517
    455518  Void      setRefPicListFromGOPSTring( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& rapcSpatRefPics );
    456519  Void      setRefPicListExplicitlyDecoderSided( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& rapcSpatRefPics );
     
    459522  Bool      isInterB        ()                          { return  m_eSliceType == B_SLICE;  }
    460523  Bool      isInterP        ()                          { return  m_eSliceType == P_SLICE;  }
    461  
     524
    462525  Void      setLambda( Double d ) { m_dLambda = d; }
    463526  Double    getLambda() { return m_dLambda;        }
    464  
    465   //SB
     527
    466528  Void      setViewIdx(Int i)                           { m_iViewIdx = i; }
    467529  Int       getViewIdx()                                { return m_iViewIdx; }
     
    476538    return m_abEqualRef[e][iRefIdx1][iRefIdx2];
    477539  }
    478  
     540
    479541  Void setEqualRef( RefPicList e, Int iRefIdx1, Int iRefIdx2, Bool b)
    480542  {
    481543    m_abEqualRef[e][iRefIdx1][iRefIdx2] = m_abEqualRef[e][iRefIdx2][iRefIdx1] = b;
    482544  }
    483  
     545
    484546  static Void      sortPicList         ( TComList<TComPic*>& rcListPic );
    485  
     547
    486548  Bool getNoBackPredFlag() { return m_bNoBackPredFlag; }
    487549  Void setNoBackPredFlag( Bool b ) { m_bNoBackPredFlag = b; }
     
    517579  Bool isNextEntropySlice               ()                  { return m_bNextEntropySlice;                 }
    518580  Void setSliceBits                     ( UInt uiVal )      { m_uiSliceBits = uiVal;                      }
    519   UInt getSliceBits                     ()                  { return m_uiSliceBits;                       } 
    520  
     581  UInt getSliceBits                     ()                  { return m_uiSliceBits;                       }
     582
    521583  Void      initMultiviewSlice    ( Int** aaiScale = 0, Int** aaiOffset = 0 );
    522584
     
    537599  Void  initWpScaling();
    538600  inline Bool applyWP() { return( (m_eSliceType==P_SLICE && m_pcPPS->getUseWP()) || (m_eSliceType==B_SLICE && m_pcPPS->getWPBiPredIdc()) ); }
    539  
     601
    540602  Void  setWpAcDcParam ( wpACDCParam wp[3] ) { memcpy(m_weightACDCParam, wp, sizeof(wpACDCParam)*3); }
    541603  Void  getWpAcDcParam ( wpACDCParam *&wp );
     
    552614                         UInt                uiNthRefPic );
    553615#endif
    554  
     616
    555617};// END CLASS DEFINITION TComSlice
    556618
Note: See TracChangeset for help on using the changeset viewer.