Changeset 56 in 3DVCSoftware for trunk/source/Lib/TLibCommon/TComDataCU.h


Ignore:
Timestamp:
11 May 2012, 21:20:17 (13 years ago)
Author:
hschwarz
Message:

updated trunk (move to HM6.1)

File:
1 edited

Legend:

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

    r5 r56  
    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.
     4 * granted under this license. 
    55 *
    6  * Copyright (c) 2010-2011, ISO/IEC
     6 * Copyright (c) 2010-2012, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    1515 *    this list of conditions and the following disclaimer in the documentation
    1616 *    and/or other materials provided with the distribution.
    17  *  * Neither the name of the ISO/IEC nor the names of its contributors may
     17 *  * Neither the name of the ITU/ISO/IEC nor the names of its contributors may
    1818 *    be used to endorse or promote products derived from this software without
    1919 *    specific prior written permission.
     
    3232 */
    3333
    34 
    35 
    3634/** \file     TComDataCU.h
    3735    \brief    CU data structure (header)
     
    5048#include "TComRdCost.h"
    5149#include "TComPattern.h"
     50
     51#if HHI_INTER_VIEW_RESIDUAL_PRED
    5252#include "TComYuv.h"
     53#endif
    5354
    5455#include <algorithm>
    5556#include <vector>
     57
     58//! \ingroup TLibCommon
     59//! \{
     60
     61// ====================================================================================================================
     62// Non-deblocking in-loop filter processing block data structure
     63// ====================================================================================================================
     64
     65/// Non-deblocking filter processing block border tag
     66enum NDBFBlockBorderTag
     67{
     68  SGU_L = 0,
     69  SGU_R,
     70  SGU_T,
     71  SGU_B,
     72  SGU_TL,
     73  SGU_TR,
     74  SGU_BL,
     75  SGU_BR,
     76  NUM_SGU_BORDER
     77};
     78
     79/// Non-deblocking filter processing block information
     80struct NDBFBlockInfo
     81{
     82  Int   tileID;   //!< tile ID
     83  Int   sliceID;  //!< slice ID
     84  UInt  startSU;  //!< starting SU z-scan address in LCU
     85  UInt  endSU;    //!< ending SU z-scan address in LCU
     86  UInt  widthSU;  //!< number of SUs in width
     87  UInt  heightSU; //!< number of SUs in height
     88  UInt  posX;     //!< top-left X coordinate in picture
     89  UInt  posY;     //!< top-left Y coordinate in picture
     90  UInt  width;    //!< number of pixels in width
     91  UInt  height;   //!< number of pixels in height
     92  Bool  isBorderAvailable[NUM_SGU_BORDER];  //!< the border availabilities
     93#if LCU_SYNTAX_ALF
     94  Bool  allBordersAvailable;
     95#endif
     96
     97  NDBFBlockInfo():tileID(0), sliceID(0), startSU(0), endSU(0) {} //!< constructor
     98  const NDBFBlockInfo& operator= (const NDBFBlockInfo& src);  //!< "=" operator
     99};
     100
    56101
    57102// ====================================================================================================================
     
    84129  UChar*        m_puhHeight;          ///< array of heights
    85130  UChar*        m_puhDepth;           ///< array of depths
     131  Int           m_unitSize;           ///< size of a "minimum partition"
    86132#if HHI_MPI
    87   Int*          m_piTextureModeDepth; ///< at which depth is prediction data inherited from texture picture ( -1 : none )
     133  Int*          m_piTextureModeDepth; ///< at which depth are prediction data inherited from texture picture ( -1 : none )
    88134#endif
    89135 
     
    92138  // -------------------------------------------------------------------------------------------------------------------
    93139 
    94   PartSize*     m_pePartSize;         ///< array of partition sizes
    95   PredMode*     m_pePredMode;         ///< array of prediction modes
     140  Char*         m_pePartSize;         ///< array of partition sizes
     141#if HHI_INTERVIEW_SKIP
     142  Bool*         m_pbRenderable;        ///< array of merge flags
     143#endif
     144  Char*         m_pePredMode;         ///< array of prediction modes
     145#if H0736_AVC_STYLE_QP_RANGE
     146  Char*         m_phQP;               ///< array of QP values
     147#else
    96148  UChar*        m_phQP;               ///< array of QP values
     149#endif
    97150  UChar*        m_puhTrIdx;           ///< array of transform indices
     151  UChar*        m_nsqtPartIdx;        ///< array of absPartIdx mapping table, map zigzag to NSQT
    98152  UChar*        m_puhCbf[3];          ///< array of coded block flags (CBF)
    99153  TComCUMvField m_acCUMvField[2];     ///< array of motion vectors
     
    101155  TCoeff*       m_pcTrCoeffCb;        ///< transformed coefficient buffer (Cb)
    102156  TCoeff*       m_pcTrCoeffCr;        ///< transformed coefficient buffer (Cr)
    103 #if SNY_DQP
    104   Bool          m_bdQP;               ///< signal if LCU dQP encoded
    105 #endif//SNY_DQP
    106  
     157#if ADAPTIVE_QP_SELECTION
     158  Int*          m_pcArlCoeffY;        ///< ARL coefficient buffer (Y)
     159  Int*          m_pcArlCoeffCb;       ///< ARL coefficient buffer (Cb)
     160  Int*          m_pcArlCoeffCr;       ///< ARL coefficient buffer (Cr)
     161
     162  static Int*   m_pcGlbArlCoeffY;     ///< ARL coefficient buffer (Y)
     163  static Int*   m_pcGlbArlCoeffCb;    ///< ARL coefficient buffer (Cb)
     164  static Int*   m_pcGlbArlCoeffCr;    ///< ARL coefficient buffer (Cr)
     165#endif
     166 
     167  Pel*          m_pcIPCMSampleY;      ///< PCM sample buffer (Y)
     168  Pel*          m_pcIPCMSampleCb;     ///< PCM sample buffer (Cb)
     169  Pel*          m_pcIPCMSampleCr;     ///< PCM sample buffer (Cr)
     170
     171  Int*          m_piSliceSUMap;       ///< pointer of slice ID map
     172  std::vector<NDBFBlockInfo> m_vNDFBlock;
     173
    107174  // -------------------------------------------------------------------------------------------------------------------
    108175  // neighbour access variables
     
    125192  Bool*         m_pbMergeFlag;        ///< array of merge flags
    126193  UChar*        m_puhMergeIndex;      ///< array of merge candidate indices
     194#if AMP_MRG
     195  Bool          m_bIsMergeAMP;
     196#endif
     197  UChar*        m_puhLumaIntraDir;    ///< array of intra directions (luma)
     198  UChar*        m_puhChromaIntraDir;  ///< array of intra directions (chroma)
     199  UChar*        m_puhInterDir;        ///< array of inter directions
     200  Char*         m_apiMVPIdx[2];       ///< array of motion vector predictor candidates
     201  Char*         m_apiMVPNum[2];       ///< array of number of possible motion vectors predictors
     202  Bool*         m_puiAlfCtrlFlag;     ///< array of ALF flags
     203  Bool*         m_puiTmpAlfCtrlFlag;  ///< temporal array of ALF flags
     204 
     205  Bool*         m_pbIPCMFlag;         ///< array of intra_pcm flags
     206
     207#if BURST_IPCM
     208  Int           m_numSucIPCM;         ///< the number of succesive IPCM blocks associated with the current log2CUSize
     209  Bool          m_lastCUSucIPCMFlag;  ///< True indicates that the last CU is IPCM and shares the same root as the current CU. 
     210#endif
    127211#if HHI_INTER_VIEW_RESIDUAL_PRED
    128212  Bool*         m_pbResPredAvailable; ///< array of residual prediction available flags
    129213  Bool*         m_pbResPredFlag;      ///< array of residual prediction flags
    130214#endif
    131   UChar*        m_apuhNeighbourCandIdx[ MRG_MAX_NUM_CANDS ];///< array of motion vector predictor candidates indices
    132   UChar*        m_puhLumaIntraDir;    ///< array of intra directions (luma)
    133   UChar*        m_puhChromaIntraDir;  ///< array of intra directions (chroma)
    134   UChar*        m_puhInterDir;        ///< array of inter directions
    135   Int*          m_apiMVPIdx[2];       ///< array of motion vector predictor candidates
    136   Int*          m_apiMVPNum[2];       ///< array of number of possible motion vectors predictors
    137   UInt*         m_puiAlfCtrlFlag;     ///< array of ALF flags
    138   UInt*         m_puiTmpAlfCtrlFlag;  ///< temporal array of ALF flags
     215
     216  // -------------------------------------------------------------------------------------------------------------------
     217  // misc. variables
     218  // -------------------------------------------------------------------------------------------------------------------
     219 
     220  Bool          m_bDecSubCu;          ///< indicates decoder-mode
     221  Double        m_dTotalCost;         ///< sum of partition RD costs
     222  UInt          m_uiTotalDistortion;  ///< sum of partition distortion
     223  UInt          m_uiTotalBits;        ///< sum of partition bits
     224  UInt          m_uiTotalBins;       ///< sum of partition bins
     225  UInt*         m_uiSliceStartCU;    ///< Start CU address of current slice
     226  UInt*         m_uiEntropySliceStartCU; ///< Start CU address of current slice
     227 
     228  // -------------------------------------------------------------------------------------------------------------------
     229  // depth model mode data
     230  // -------------------------------------------------------------------------------------------------------------------
    139231#if HHI_DMM_WEDGE_INTRA
    140232  UInt*         m_puiWedgeFullTabIdx;
     
    155247  Int*          m_piContourPredTexDeltaDC2;
    156248#endif
    157  
    158   // -------------------------------------------------------------------------------------------------------------------
    159   // misc. variables
    160   // -------------------------------------------------------------------------------------------------------------------
    161  
    162   Bool          m_bDecSubCu;          ///< indicates decoder-mode
    163   Double        m_dTotalCost;         ///< sum of partition RD costs
    164   Dist          m_uiTotalDistortion;  ///< sum of partition distortion
    165   UInt          m_uiTotalBits;        ///< sum of partition bits
    166   UInt          m_uiSliceStartCU;    ///< Start CU address of current slice
    167   UInt          m_uiEntropySliceStartCU; ///< Start CU address of current slice
    168  
     249
    169250protected:
    170251 
    171252  /// add possible motion vector predictor candidates
    172253  Bool          xAddMVPCand           ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir );
    173 #if MTK_AMVP_SMVP_DERIVATION
    174254  Bool          xAddMVPCandOrder      ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir );
    175 #endif 
    176 
    177 #if MTK_TMVP_H_MRG || MTK_TMVP_H_AMVP
     255
    178256  Void          deriveRightBottomIdx        ( PartSize eCUMode, UInt uiPartIdx, UInt& ruiPartIdxRB );
    179257  Bool          xGetColMVP( RefPicList eRefPicList, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx );
    180 #endif
    181  
     258 
     259#if !AMVP_PRUNING_SIMPLIFICATION
    182260  /// remove redundant candidates
    183261  Void          xUniqueMVPCand        ( AMVPInfo* pInfo );
     262#endif
    184263
    185264  Void xCheckCornerCand( TComDataCU* pcCorner, UInt uiCornerIdx, UInt uiIter, Bool& rbValidCand );
     
    191270  Int           xGetDistScaleFactor   ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC );
    192271 
    193   /// calculate all CBF's from coefficients
    194   Void          xCalcCuCbf            ( UChar* puhCbf, UInt uiTrDepth, UInt uiCbfDepth, UInt uiCuDepth );
    195  
    196 #if FT_TCTR_AMVP || FT_TCTR_MRG
    197272  Void xDeriveCenterIdx( PartSize eCUMode, UInt uiPartIdx, UInt& ruiPartIdxCenter );
    198273  Bool xGetCenterCol( UInt uiPartIdx, RefPicList eRefPicList, int iRefIdx, TComMv *pcMv );
    199 #endif
    200  
     274 
     275  Void xCheckDuplicateCand(TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, bool* pbCandIsInter, UInt& ruiArrayAddr);
     276
     277#if !BURST_IPCM
     278  Int           getLastValidPartIdx   ( Int iAbsPartIdx );
     279#endif
     280
    201281public:
    202282  TComDataCU();
     
    207287  // -------------------------------------------------------------------------------------------------------------------
    208288 
    209   Void          create                ( UInt uiNumPartition, UInt uiWidth, UInt uiHeight, Bool bDecSubCu );
     289  Void          create                ( UInt uiNumPartition, UInt uiWidth, UInt uiHeight, Bool bDecSubCu, Int unitSize
     290#if ADAPTIVE_QP_SELECTION
     291    , Bool bGlobalRMARLBuffer = false
     292#endif 
     293    );
    210294  Void          destroy               ();
    211295 
    212296  Void          initCU                ( TComPic* pcPic, UInt uiCUAddr );
    213   Void          initEstData           ();
    214   Void          initSubCU             ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth );
    215  
     297#if H0736_AVC_STYLE_QP_RANGE
     298  Void          initEstData           ( UInt uiDepth, Int qp );
     299  Void          initSubCU             ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth, Int qp );
     300#else
     301  Void          initEstData           ( UInt uiDepth, UInt uiQP );
     302  Void          initSubCU             ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth, UInt uiQP );
     303#endif
     304  Void          setOutsideCUPart      ( UInt uiAbsPartIdx, UInt uiDepth );
     305
    216306  Void          copySubCU             ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth );
    217307  Void          copyInterPredInfoFrom ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList );
     
    229319  UInt&         getAddr               ()                        { return m_uiCUAddr;        }
    230320  UInt&         getZorderIdxInCU      ()                        { return m_uiAbsIdxInLCU; }
     321  UInt          getSCUAddr            ();
    231322  UInt          getCUPelX             ()                        { return m_uiCUPelX;        }
    232323  UInt          getCUPelY             ()                        { return m_uiCUPelY;        }
     
    237328  Void          setDepth              ( UInt uiIdx, UChar  uh ) { m_puhDepth[uiIdx] = uh;   }
    238329 
     330  Void          setDepthSubParts      ( UInt uiDepth, UInt uiAbsPartIdx );
     331  Void          getPosInPic           ( UInt uiAbsPartIndex, Int& riPosX, Int& riPosY );
    239332#if HHI_MPI
    240333  Int*          getTextureModeDepth   ()                        { return m_piTextureModeDepth; }
     
    244337  Void          copyTextureMotionDataFrom( TComDataCU* pcCU, UInt uiDepth, UInt uiAbsPartIdxSrc, UInt uiAbsPartIdxDst = 0 );
    245338#endif
    246 
    247   Void          setDepthSubParts      ( UInt uiDepth, UInt uiAbsPartIdx );
    248   Void          getPosInPic           ( UInt uiAbsPartIndex, Int& riPosX, Int& riPosY );
    249339 
    250340  // -------------------------------------------------------------------------------------------------------------------
     
    252342  // -------------------------------------------------------------------------------------------------------------------
    253343 
    254   PartSize*     getPartitionSize      ()                        { return m_pePartSize;        }
    255   PartSize      getPartitionSize      ( UInt uiIdx )            { return m_pePartSize[uiIdx]; }
     344  Char*         getPartitionSize      ()                        { return m_pePartSize;        }
     345  PartSize      getPartitionSize      ( UInt uiIdx )            { return static_cast<PartSize>( m_pePartSize[uiIdx] ); }
    256346  Void          setPartitionSize      ( UInt uiIdx, PartSize uh){ m_pePartSize[uiIdx] = uh;   }
    257347  Void          setPartSizeSubParts   ( PartSize eMode, UInt uiAbsPartIdx, UInt uiDepth );
    258348 
    259   PredMode*     getPredictionMode     ()                        { return m_pePredMode;        }
    260   PredMode      getPredictionMode     ( UInt uiIdx )            { return m_pePredMode[uiIdx]; }
     349#if HHI_INTERVIEW_SKIP
     350  Bool*         getRenderable          ()                        { return m_pbRenderable;               }
     351    Bool          getRenderable          ( UInt uiIdx )            { return m_pbRenderable[uiIdx];        }
     352    Void          setRenderable          ( UInt uiIdx, Bool b )    { m_pbRenderable[uiIdx] = b;           }
     353    Void          setRenderableSubParts  ( Bool bRenderable, UInt uiAbsPartIdx, UInt uiDepth );
     354#endif
     355 
     356  Char*         getPredictionMode     ()                        { return m_pePredMode;        }
     357  PredMode      getPredictionMode     ( UInt uiIdx )            { return static_cast<PredMode>( m_pePredMode[uiIdx] ); }
    261358  Void          setPredictionMode     ( UInt uiIdx, PredMode uh){ m_pePredMode[uiIdx] = uh;   }
    262359  Void          setPredModeSubParts   ( PredMode eMode, UInt uiAbsPartIdx, UInt uiDepth );
     
    272369  Void          setSizeSubParts       ( UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, UInt uiDepth );
    273370 
     371#if H0736_AVC_STYLE_QP_RANGE
     372  Char*         getQP                 ()                        { return m_phQP;              }
     373  Char          getQP                 ( UInt uiIdx )            { return m_phQP[uiIdx];       }
     374  Void          setQP                 ( UInt uiIdx, Char value ){ m_phQP[uiIdx] =  value;     }
     375  Void          setQPSubParts         ( Int qp,   UInt uiAbsPartIdx, UInt uiDepth );
     376#if BURST_IPCM
     377  Int           getLastValidPartIdx   ( Int iAbsPartIdx );
     378#endif
     379  Char          getLastCodedQP        ( UInt uiAbsPartIdx );
     380#else
    274381  UChar*        getQP                 ()                        { return m_phQP;              }
    275382  UChar         getQP                 ( UInt uiIdx )            { return m_phQP[uiIdx];       }
    276383  Void          setQP                 ( UInt uiIdx, UChar  uh ) { m_phQP[uiIdx] = uh;         }
    277384  Void          setQPSubParts         ( UInt uiQP,   UInt uiAbsPartIdx, UInt uiDepth );
    278 #if SNY_DQP
    279   Bool          getdQPFlag            ()                        { return m_bdQP;              }
    280   Void          setdQPFlag            ( Bool b )                { m_bdQP = b;                 }
    281 #endif//SNY_DQP
     385#if BURST_IPCM
     386  Int           getLastValidPartIdx   ( Int iAbsPartIdx );
     387#endif
     388  UChar         getLastCodedQP        ( UInt uiAbsPartIdx );
     389#endif
     390
     391#if LOSSLESS_CODING
     392  Bool          isLosslessCoded(UInt absPartIdx);
     393#endif
     394  UChar*        getNSQTPartIdx        ()                        { return m_nsqtPartIdx;        }
     395  UChar         getNSQTPartIdx        ( UInt idx )              { return m_nsqtPartIdx[idx];   }
     396  Void          setNSQTIdxSubParts    ( UInt absPartIdx, UInt depth );
     397  Void          setNSQTIdxSubParts    ( UInt log2TrafoSize, UInt absPartIdx, UInt absTUPartIdx, UInt trMode );
    282398 
    283399  UChar*        getTransformIdx       ()                        { return m_puhTrIdx;          }
     
    285401  Void          setTrIdxSubParts      ( UInt uiTrIdx, UInt uiAbsPartIdx, UInt uiDepth );
    286402 
    287   UInt          getQuadtreeTULog2MinSizeInCU( UInt uiIdx );
    288  
    289 #if HHI_RQT_FORCE_SPLIT_ACC2_PU || HHI_RQT_DISABLE_SUB
    290   UInt          getQuadtreeTULog2RootSizeInCU( UInt uiIdx );
    291 #endif
     403  UInt          getQuadtreeTULog2MinSizeInCU( UInt absPartIdx );
    292404 
    293405  TComCUMvField* getCUMvField         ( RefPicList e )          { return  &m_acCUMvField[e];  }
     
    296408  TCoeff*&      getCoeffCb            ()                        { return m_pcTrCoeffCb;       }
    297409  TCoeff*&      getCoeffCr            ()                        { return m_pcTrCoeffCr;       }
    298  
     410#if ADAPTIVE_QP_SELECTION
     411  Int*&         getArlCoeffY          ()                        { return m_pcArlCoeffY;       }
     412  Int*&         getArlCoeffCb         ()                        { return m_pcArlCoeffCb;      }
     413  Int*&         getArlCoeffCr         ()                        { return m_pcArlCoeffCr;      }
     414#endif
     415 
     416  Pel*&         getPCMSampleY         ()                        { return m_pcIPCMSampleY;     }
     417  Pel*&         getPCMSampleCb        ()                        { return m_pcIPCMSampleCb;    }
     418  Pel*&         getPCMSampleCr        ()                        { return m_pcIPCMSampleCr;    }
     419
    299420  UChar         getCbf    ( UInt uiIdx, TextType eType )                  { return m_puhCbf[g_aucConvertTxtTypeToIdx[eType]][uiIdx];  }
    300421  UChar*        getCbf    ( TextType eType )                              { return m_puhCbf[g_aucConvertTxtTypeToIdx[eType]];         }
     
    306427  Void          setCbfSubParts        ( UInt uiCbfY, UInt uiCbfU, UInt uiCbfV, UInt uiAbsPartIdx, UInt uiDepth          );
    307428  Void          setCbfSubParts        ( UInt uiCbf, TextType eTType, UInt uiAbsPartIdx, UInt uiDepth                    );
    308 #if HHI_MRG_SKIP
    309429  Void          setCbfSubParts        ( UInt uiCbf, TextType eTType, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth    );
    310 #endif
    311430 
    312431  // -------------------------------------------------------------------------------------------------------------------
     
    323442  Void          setMergeIndex         ( UInt uiIdx, UInt uiMergeIndex ) { m_puhMergeIndex[uiIdx] = uiMergeIndex;  }
    324443  Void          setMergeIndexSubParts ( UInt uiMergeIndex, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
    325 
    326   UChar*        getNeighbourCandIdx         ( UInt uiCandIdx )            { return m_apuhNeighbourCandIdx[uiCandIdx];           }
    327   UChar         getNeighbourCandIdx         ( UInt uiCandIdx, UInt uiIdx ){ return m_apuhNeighbourCandIdx[uiCandIdx][uiIdx];           }
    328   Void          setNeighbourCandIdx         ( UInt uiCandIdx, UInt uiIdx, UChar uhNeighCands ) { m_apuhNeighbourCandIdx[uiCandIdx][uiIdx] = uhNeighCands;}
    329   Void          setNeighbourCandIdxSubParts ( UInt uiCandIdx, UChar uhNumCands, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
    330 
     444  template <typename T>
     445  Void          setSubPart            ( T bParameter, T* pbBaseLCU, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx );
     446
     447#if AMP_MRG
     448  Void          setMergeAMP( Bool b )      { m_bIsMergeAMP = b; }
     449  Bool          getMergeAMP( )             { return m_bIsMergeAMP; }
     450#endif
     451
     452  UChar*        getLumaIntraDir       ()                        { return m_puhLumaIntraDir;           }
     453  UChar         getLumaIntraDir       ( UInt uiIdx )            { return m_puhLumaIntraDir[uiIdx];    }
     454  Void          setLumaIntraDir       ( UInt uiIdx, UChar  uh ) { m_puhLumaIntraDir[uiIdx] = uh;      }
     455  Void          setLumaIntraDirSubParts( UInt uiDir,  UInt uiAbsPartIdx, UInt uiDepth );
     456 
     457  UChar*        getChromaIntraDir     ()                        { return m_puhChromaIntraDir;         }
     458  UChar         getChromaIntraDir     ( UInt uiIdx )            { return m_puhChromaIntraDir[uiIdx];  }
     459  Void          setChromaIntraDir     ( UInt uiIdx, UChar  uh ) { m_puhChromaIntraDir[uiIdx] = uh;    }
     460  Void          setChromIntraDirSubParts( UInt uiDir,  UInt uiAbsPartIdx, UInt uiDepth );
     461 
     462  UChar*        getInterDir           ()                        { return m_puhInterDir;               }
     463  UChar         getInterDir           ( UInt uiIdx )            { return m_puhInterDir[uiIdx];        }
     464  Void          setInterDir           ( UInt uiIdx, UChar  uh ) { m_puhInterDir[uiIdx] = uh;          }
     465  Void          setInterDirSubParts   ( UInt uiDir,  UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
     466 
     467  Bool*         getAlfCtrlFlag        ()                        { return m_puiAlfCtrlFlag;            }
     468  Bool          getAlfCtrlFlag        ( UInt uiIdx )            { return m_puiAlfCtrlFlag[uiIdx];     }
     469  Void          setAlfCtrlFlag        ( UInt uiIdx, Bool uiFlag){ m_puiAlfCtrlFlag[uiIdx] = uiFlag;   }
     470  Void          setAlfCtrlFlagSubParts( Bool uiFlag, UInt uiAbsPartIdx, UInt uiDepth );
     471 
     472  Void          createTmpAlfCtrlFlag  ();
     473  Void          destroyTmpAlfCtrlFlag ();
     474  Void          copyAlfCtrlFlagToTmp  ();
     475  Void          copyAlfCtrlFlagFromTmp();
     476 
     477  Bool*         getIPCMFlag           ()                        { return m_pbIPCMFlag;               }
     478  Bool          getIPCMFlag           (UInt uiIdx )             { return m_pbIPCMFlag[uiIdx];        }
     479  Void          setIPCMFlag           (UInt uiIdx, Bool b )     { m_pbIPCMFlag[uiIdx] = b;           }
     480  Void          setIPCMFlagSubParts   (Bool bIpcmFlag, UInt uiAbsPartIdx, UInt uiDepth);
     481
     482#if BURST_IPCM
     483  Int           getNumSucIPCM         ()                        { return m_numSucIPCM;             }
     484  Void          setNumSucIPCM         ( Int num )               { m_numSucIPCM = num;              }
     485  Bool          getLastCUSucIPCMFlag  ()                        { return m_lastCUSucIPCMFlag;        }
     486  Void          setLastCUSucIPCMFlag  ( Bool flg )              { m_lastCUSucIPCMFlag = flg;         }
     487#endif
     488
     489  /// get slice ID for SU
     490  Int           getSUSliceID          (UInt uiIdx)              {return m_piSliceSUMap[uiIdx];      }
     491
     492  /// get the pointer of slice ID map
     493  Int*          getSliceSUMap         ()                        {return m_piSliceSUMap;             }
     494
     495  /// set the pointer of slice ID map
     496  Void          setSliceSUMap         (Int *pi)                 {m_piSliceSUMap = pi;               }
     497
     498  std::vector<NDBFBlockInfo>* getNDBFilterBlocks()      {return &m_vNDFBlock;}
     499  Void setNDBFilterBlockBorderAvailability(UInt numLCUInPicWidth, UInt numLCUInPicHeight, UInt numSUInLCUWidth, UInt numSUInLCUHeight, UInt picWidth, UInt picHeight
     500                                          ,Bool bIndependentSliceBoundaryEnabled
     501                                          ,Bool bTopTileBoundary, Bool bDownTileBoundary, Bool bLeftTileBoundary, Bool bRightTileBoundary
     502                                          ,Bool bIndependentTileBoundaryEnabled );
     503
     504#if HHI_INTER_VIEW_MOTION_PRED
     505  Int           getPdmMergeCandidate( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv );
     506  Bool          getPdmMvPred( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, Bool bMerge = false );
     507  Bool          getIViewOrgDepthMvPred( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv );
     508#endif
    331509#if HHI_INTER_VIEW_RESIDUAL_PRED
    332510  Bool*         getResPredAvail         ()                        { return m_pbResPredAvailable;        }
     
    334512  Void          setResPredAvail         ( UInt uiIdx, Bool b )    { m_pbResPredAvailable[uiIdx] = b;    }
    335513  Void          setResPredAvailSubParts ( Bool b, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
    336  
     514
    337515  Bool*         getResPredFlag          ()                        { return m_pbResPredFlag;        }
    338516  Bool          getResPredFlag          ( UInt uiIdx )            { return m_pbResPredFlag[uiIdx]; }
     
    342520  Void          setResPredIndicator     ( Bool bAv, Bool bRP )    { m_pbResPredAvailable[0] = bAv; m_pbResPredFlag[0] = bRP; }
    343521#endif
    344 
    345   Void          setSubPartBool        ( Bool bParameter, Bool* pbBaseLCU, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx );
    346   Void          setSubPartUChar       ( UInt bParameter, UChar* pbBaseLCU, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx );
    347 
    348   UChar*        getLumaIntraDir       ()                        { return m_puhLumaIntraDir;           }
    349   UChar         getLumaIntraDir       ( UInt uiIdx )            { return m_puhLumaIntraDir[uiIdx];    }
    350   Void          setLumaIntraDir       ( UInt uiIdx, UChar  uh ) { m_puhLumaIntraDir[uiIdx] = uh;      }
    351   Void          setLumaIntraDirSubParts( UInt uiDir,  UInt uiAbsPartIdx, UInt uiDepth );
    352  
    353   UChar*        getChromaIntraDir     ()                        { return m_puhChromaIntraDir;         }
    354   UChar         getChromaIntraDir     ( UInt uiIdx )            { return m_puhChromaIntraDir[uiIdx];  }
    355   Void          setChromaIntraDir     ( UInt uiIdx, UChar  uh ) { m_puhChromaIntraDir[uiIdx] = uh;    }
    356   Void          setChromIntraDirSubParts( UInt uiDir,  UInt uiAbsPartIdx, UInt uiDepth );
    357  
    358   UChar*        getInterDir           ()                        { return m_puhInterDir;               }
    359   UChar         getInterDir           ( UInt uiIdx )            { return m_puhInterDir[uiIdx];        }
    360   Void          setInterDir           ( UInt uiIdx, UChar  uh ) { m_puhInterDir[uiIdx] = uh;          }
    361   Void          setInterDirSubParts   ( UInt uiDir,  UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
    362  
    363   UInt*         getAlfCtrlFlag        ()                        { return m_puiAlfCtrlFlag;            }
    364   UInt          getAlfCtrlFlag        ( UInt uiIdx )            { return m_puiAlfCtrlFlag[uiIdx];     }
    365   Void          setAlfCtrlFlag        ( UInt uiIdx, UInt uiFlag){ m_puiAlfCtrlFlag[uiIdx] = uiFlag;   }
    366   Void          setAlfCtrlFlagSubParts( UInt uiFlag, UInt uiAbsPartIdx, UInt uiDepth );
    367  
    368   Void          createTmpAlfCtrlFlag  ();
    369   Void          destroyTmpAlfCtrlFlag ();
    370   Void          copyAlfCtrlFlagToTmp  ();
    371   Void          copyAlfCtrlFlagFromTmp();
    372  
    373 #if HHI_DMM_WEDGE_INTRA
    374   UInt*         getWedgeFullTabIdx         ()                        { return m_puiWedgeFullTabIdx;        }
    375   UInt          getWedgeFullTabIdx         ( UInt uiIdx )            { return m_puiWedgeFullTabIdx[uiIdx]; }
    376   Void          setWedgeFullTabIdx         ( UInt uiIdx, UInt uh )   { m_puiWedgeFullTabIdx[uiIdx] = uh;   }
    377   Void          setWedgeFullTabIdxSubParts ( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth );
    378 
    379   Int*          getWedgeFullDeltaDC1       ()                        { return m_piWedgeFullDeltaDC1;             }
    380   Int           getWedgeFullDeltaDC1       ( UInt uiIdx )            { return m_piWedgeFullDeltaDC1[uiIdx];      }
    381   Void          setWedgeFullDeltaDC1       ( UInt uiIdx, Int i )     { m_piWedgeFullDeltaDC1[uiIdx] = i;         }
    382   Void          setWedgeFullDeltaDC1SubParts( Int iDC1, UInt uiAbsPartIdx, UInt uiDepth );
    383 
    384   Int*          getWedgeFullDeltaDC2       ()                        { return m_piWedgeFullDeltaDC2;             }
    385   Int           getWedgeFullDeltaDC2       ( UInt uiIdx )            { return m_piWedgeFullDeltaDC2[uiIdx];      }
    386   Void          setWedgeFullDeltaDC2       ( UInt uiIdx, Int i )     { m_piWedgeFullDeltaDC2[uiIdx] = i;         }
    387   Void          setWedgeFullDeltaDC2SubParts( Int iDC2, UInt uiAbsPartIdx, UInt uiDepth );
    388 
    389   UInt*         getWedgePredDirTabIdx        ()                      { return m_puiWedgePredDirTabIdx;        }
    390   UInt          getWedgePredDirTabIdx        ( UInt uiIdx )          { return m_puiWedgePredDirTabIdx[uiIdx]; }
    391   Void          setWedgePredDirTabIdx        ( UInt uiIdx, UInt uh ) { m_puiWedgePredDirTabIdx[uiIdx] = uh;   }
    392   Void          setWedgePredDirTabIdxSubParts( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth );
    393 
    394   Int*          getWedgePredDirDeltaDC1       ()                        { return m_piWedgePredDirDeltaDC1;             }
    395   Int           getWedgePredDirDeltaDC1       ( UInt uiIdx )            { return m_piWedgePredDirDeltaDC1[uiIdx];      }
    396   Void          setWedgePredDirDeltaDC1       ( UInt uiIdx, Int i )     { m_piWedgePredDirDeltaDC1[uiIdx] = i;         }
    397   Void          setWedgePredDirDeltaDC1SubParts( Int iDC1, UInt uiAbsPartIdx, UInt uiDepth );
    398 
    399   Int*          getWedgePredDirDeltaDC2       ()                        { return m_piWedgePredDirDeltaDC2;             }
    400   Int           getWedgePredDirDeltaDC2       ( UInt uiIdx )            { return m_piWedgePredDirDeltaDC2[uiIdx];      }
    401   Void          setWedgePredDirDeltaDC2       ( UInt uiIdx, Int i )     { m_piWedgePredDirDeltaDC2[uiIdx] = i;         }
    402   Void          setWedgePredDirDeltaDC2SubParts( Int iDC2, UInt uiAbsPartIdx, UInt uiDepth );
    403 
    404   Int*          getWedgePredDirDeltaEnd        ()                     { return m_piWedgePredDirDeltaEnd;        }
    405   Int           getWedgePredDirDeltaEnd        ( UInt uiIdx )         { return m_piWedgePredDirDeltaEnd[uiIdx]; }
    406   Void          setWedgePredDirDeltaEnd        ( UInt uiIdx, Int iD ) { m_piWedgePredDirDeltaEnd[uiIdx] = iD;   }
    407   Void          setWedgePredDirDeltaEndSubParts( Int iDelta, UInt uiAbsPartIdx, UInt uiDepth );
    408 #endif
    409 #if HHI_DMM_PRED_TEX
    410   UInt*         getWedgePredTexTabIdx       ()                       { return m_puiWedgePredTexTabIdx;           }
    411   UInt          getWedgePredTexTabIdx       ( UInt uiIdx )           { return m_puiWedgePredTexTabIdx[uiIdx];    }
    412   Void          setWedgePredTexTabIdx       ( UInt uiIdx, UInt uh )  { m_puiWedgePredTexTabIdx[uiIdx] = uh;      }
    413   Void          setWedgePredTexTabIdxSubParts( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth );
    414 
    415   Int*          getWedgePredTexDeltaDC1       ()                     { return m_piWedgePredTexDeltaDC1;          }
    416   Int           getWedgePredTexDeltaDC1       ( UInt uiIdx )         { return m_piWedgePredTexDeltaDC1[uiIdx];   }
    417   Void          setWedgePredTexDeltaDC1       ( UInt uiIdx, Int i )  { m_piWedgePredTexDeltaDC1[uiIdx] = i;      }
    418   Void          setWedgePredTexDeltaDC1SubParts( Int iDC1, UInt uiAbsPartIdx, UInt uiDepth );
    419 
    420   Int*          getWedgePredTexDeltaDC2       ()                     { return m_piWedgePredTexDeltaDC2;          }
    421   Int           getWedgePredTexDeltaDC2       ( UInt uiIdx )         { return m_piWedgePredTexDeltaDC2[uiIdx];   }
    422   Void          setWedgePredTexDeltaDC2       ( UInt uiIdx, Int i )  { m_piWedgePredTexDeltaDC2[uiIdx] = i;      }
    423   Void          setWedgePredTexDeltaDC2SubParts( Int iDC2, UInt uiAbsPartIdx, UInt uiDepth );
    424 
    425   Int*          getContourPredTexDeltaDC1       ()                     { return m_piContourPredTexDeltaDC1;          }
    426   Int           getContourPredTexDeltaDC1       ( UInt uiIdx )         { return m_piContourPredTexDeltaDC1[uiIdx];   }
    427   Void          setContourPredTexDeltaDC1       ( UInt uiIdx, Int i )  { m_piContourPredTexDeltaDC1[uiIdx] = i;      }
    428   Void          setContourPredTexDeltaDC1SubParts( Int iDC1, UInt uiAbsPartIdx, UInt uiDepth );
    429 
    430   Int*          getContourPredTexDeltaDC2       ()                     { return m_piContourPredTexDeltaDC2;          }
    431   Int           getContourPredTexDeltaDC2       ( UInt uiIdx )         { return m_piContourPredTexDeltaDC2[uiIdx];   }
    432   Void          setContourPredTexDeltaDC2       ( UInt uiIdx, Int i )  { m_piContourPredTexDeltaDC2[uiIdx] = i;      }
    433   Void          setContourPredTexDeltaDC2SubParts( Int iDC2, UInt uiAbsPartIdx, UInt uiDepth );
    434 #endif
    435 
    436 #if HHI_INTER_VIEW_MOTION_PRED
    437   Int           getPdmMergeCandidate( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv );
    438   Bool          getPdmMvPred( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, Bool bMerge = false );
    439   Bool          getIViewOrgDepthMvPred( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv );
    440 #endif
    441522#if HHI_INTER_VIEW_RESIDUAL_PRED
    442523  Bool          getResidualSamples( UInt uiPartIdx, TComYuv* pcYuv = 0 );
    443524#endif
    444  
    445525  // -------------------------------------------------------------------------------------------------------------------
    446526  // member functions for accessing partition information
     
    459539  AMVP_MODE     getAMVPMode           ( UInt uiIdx );
    460540  Void          fillMvpCand           ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo );
    461 #if DCM_SIMPLIFIED_MVP==0
    462   Bool          clearMVPCand          ( TComMv cMvd, AMVPInfo* pInfo );
    463 #endif
    464   Int           searchMVPIdx          ( TComMv cMv,  AMVPInfo* pInfo );
    465 
     541#if PARALLEL_MERGE
     542  Bool          isDiffMER             ( Int xN, Int yN, Int xP, Int yP);
     543  Void          getPartPosition       ( UInt partIdx, Int& xP, Int& yP, Int& nPSW, Int& nPSH);
     544#endif
    466545  Void          setMVPIdx             ( RefPicList eRefPicList, UInt uiIdx, Int iMVPIdx)  { m_apiMVPIdx[eRefPicList][uiIdx] = iMVPIdx;  }
    467546  Int           getMVPIdx             ( RefPicList eRefPicList, UInt uiIdx)               { return m_apiMVPIdx[eRefPicList][uiIdx];     }
    468   Int*          getMVPIdx             ( RefPicList eRefPicList )                          { return m_apiMVPIdx[eRefPicList];            }
    469  
     547  Char*         getMVPIdx             ( RefPicList eRefPicList )                          { return m_apiMVPIdx[eRefPicList];            }
     548
    470549  Void          setMVPNum             ( RefPicList eRefPicList, UInt uiIdx, Int iMVPNum ) { m_apiMVPNum[eRefPicList][uiIdx] = iMVPNum;  }
    471550  Int           getMVPNum             ( RefPicList eRefPicList, UInt uiIdx )              { return m_apiMVPNum[eRefPicList][uiIdx];     }
    472   Int*          getMVPNum             ( RefPicList eRefPicList )                          { return m_apiMVPNum[eRefPicList];            }
     551  Char*         getMVPNum             ( RefPicList eRefPicList )                          { return m_apiMVPNum[eRefPicList];            }
    473552 
    474553  Void          setMVPIdxSubParts     ( Int iMVPIdx, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
     
    480559  Void          getMvPredAboveRight   ( TComMv&     rcMvPred )   { rcMvPred = m_cMvFieldC.getMv(); }
    481560 
    482 #if AMVP_BUFFERCOMPRESS
    483561  Void          compressMV            ();
    484 #endif
    485562 
    486563  // -------------------------------------------------------------------------------------------------------------------
     
    493570  TComDataCU*   getCUAboveRight             () { return m_pcCUAboveRight; }
    494571  TComDataCU*   getCUColocated              ( RefPicList eRefPicList ) { return m_apcCUColocated[eRefPicList]; }
    495  
    496   TComDataCU*   getPULeft                   ( UInt&  uiLPartUnitIdx , UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true );
    497   TComDataCU*   getPUAbove                  ( UInt&  uiAPartUnitIdx , UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true );
    498   TComDataCU*   getPUAboveLeft              ( UInt&  uiALPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true );
    499   TComDataCU*   getPUAboveRight             ( UInt&  uiARPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true );
     572
     573
     574  TComDataCU*   getPULeft                   ( UInt&  uiLPartUnitIdx , UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true
     575                                            , Bool bEnforceTileRestriction=true
     576                                            );
     577
     578  TComDataCU*   getPUAbove                  ( UInt&  uiAPartUnitIdx , UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true, Bool MotionDataCompresssion = false
     579                                            , Bool planarAtLCUBoundary = false
     580                                            , Bool bEnforceTileRestriction=true
     581                                            );
     582
     583  TComDataCU*   getPUAboveLeft              ( UInt&  uiALPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true, Bool MotionDataCompresssion = false );
     584  TComDataCU*   getPUAboveRight             ( UInt&  uiARPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true, Bool MotionDataCompresssion = false );
    500585  TComDataCU*   getPUBelowLeft              ( UInt& uiBLPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true );
    501586
    502 #if CONSTRAINED_INTRA_PRED
     587  TComDataCU*   getQpMinCuLeft              ( UInt&  uiLPartUnitIdx , UInt uiCurrAbsIdxInLCU, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true );
     588#if H0204_QP_PREDICTION
     589  TComDataCU*   getQpMinCuAbove             ( UInt&  aPartUnitIdx , UInt currAbsIdxInLCU, Bool enforceSliceRestriction=true, Bool enforceEntropySliceRestriction=true );
     590#endif
     591#if H0736_AVC_STYLE_QP_RANGE
     592  Char          getRefQP                    ( UInt   uiCurrAbsIdxInLCU                       );
     593#else
     594  UChar         getRefQP                    ( UInt   uiCurrAbsIdxInLCU                       );
     595#endif
     596
    503597  TComDataCU*   getPUAboveRightAdi          ( UInt&  uiARPartUnitIdx, UInt uiPuWidth, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset = 1, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true );
    504598  TComDataCU*   getPUBelowLeftAdi           ( UInt& uiBLPartUnitIdx, UInt uiPuHeight, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset = 1, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true );
    505 #else
    506   TComDataCU*   getPUAboveRightAdi          ( UInt&  uiARPartUnitIdx, UInt uiPuWidth, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true );
    507   TComDataCU*   getPUBelowLeftAdi           ( UInt& uiBLPartUnitIdx, UInt uiPuHeight, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true );
    508 #endif
    509599 
    510600  Void          deriveLeftRightTopIdx       ( PartSize eCUMode, UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT );
     
    515605 
    516606  Bool          hasEqualMotion              ( UInt uiAbsPartIdx, TComDataCU* pcCandCU, UInt uiCandAbsPartIdx );
    517   Bool          avoidMergeCandidate         ( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComDataCU* pcCandCU, UInt uiCandAbsPartIdx );
    518   Bool          hasEqualMotion              ( UInt uiAbsPartIdx, UInt uiCandInterDir, Int* paiCandRefIdx, TComMv* pacCandMv );
    519   Bool          avoidMergeCandidate         ( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, UInt uiCandInterDir, Int* paiCandRefIdx, TComMv* pacCandMv );
    520   Void          getInterMergeCandidates       ( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, UInt* puiNeighbourCandIdx );
     607#if SIMP_MRG_PRUN
     608  Void          getInterMergeCandidates       ( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx = -1 );
     609#else
     610  Void          getInterMergeCandidates       ( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand );
     611#endif
    521612  Void          deriveLeftRightTopIdxGeneral  ( PartSize eCUMode, UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT );
    522613  Void          deriveLeftBottomIdxGeneral    ( PartSize eCUMode, UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLB );
     
    534625  // -------------------------------------------------------------------------------------------------------------------
    535626 
    536   Int           getMostProbableIntraDirLuma     ( UInt uiAbsPartIdx                                       );
    537  
    538627  UInt          getIntraSizeIdx                 ( UInt uiAbsPartIdx                                       );
    539628  Void          convertTransIdx                 ( UInt uiAbsPartIdx, UInt uiTrIdx, UInt& ruiLumaTrMode, UInt& ruiChromaTrMode );
    540629 
    541 #if LCEC_INTRA_MODE
    542   Int           getLeftIntraDirLuma             ( UInt uiAbsPartIdx );
    543   Int           getAboveIntraDirLuma            ( UInt uiAbsPartIdx );
    544 #endif
    545 
    546 #if MTK_DCM_MPM
    547   Int           getIntraDirLumaPredictor        ( UInt uiAbsPartIdx, Int uiIntraDirPred[]                 );
    548 #endif
    549 
    550 #if MS_LCEC_LOOKUP_TABLE_EXCEPTION
    551   Bool          isSuroundingRefIdxException     ( UInt   uiAbsPartIdx );
    552 #endif
     630  Void          getAllowedChromaDir             ( UInt uiAbsPartIdx, UInt* uiModeList );
     631  Int           getIntraDirLumaPredictor        ( UInt uiAbsPartIdx, Int* uiIntraDirPred, Int* piMode = NULL );
    553632 
    554633  // -------------------------------------------------------------------------------------------------------------------
     
    557636 
    558637  UInt          getCtxSplitFlag                 ( UInt   uiAbsPartIdx, UInt uiDepth                   );
    559   UInt          getCtxCbf                       ( UInt   uiAbsPartIdx, TextType eType, UInt uiTrDepth );
    560638  UInt          getCtxQtCbf                     ( UInt   uiAbsPartIdx, TextType eType, UInt uiTrDepth );
    561   UInt          getCtxQtRootCbf                 ( UInt   uiAbsPartIdx                                 );
    562   UInt          getCtxRefIdx                    ( UInt   uiAbsPartIdx, RefPicList eRefPicList         );
     639
    563640  UInt          getCtxSkipFlag                  ( UInt   uiAbsPartIdx                                 );
    564   UInt          getCtxAlfCtrlFlag               ( UInt   uiAbsPartIdx                                 );
    565641  UInt          getCtxInterDir                  ( UInt   uiAbsPartIdx                                 );
    566   UInt          getCtxIntraDirChroma            ( UInt   uiAbsPartIdx                                 );
    567   UInt          getCtxMergeFlag                 ( UInt uiAbsPartIdx                                   );
    568  
    569   Void          setSliceStartCU  ( UInt uiStartCU )    { m_uiSliceStartCU = uiStartCU;    } 
    570   UInt          getSliceStartCU  ()                    { return m_uiSliceStartCU;         }
    571   Void          setEntropySliceStartCU ( UInt uiStartCU ) { m_uiEntropySliceStartCU = uiStartCU;     } 
    572   UInt          getEntropySliceStartCU ()                 { return m_uiEntropySliceStartCU;          }
    573 
     642
     643#if HHI_INTER_VIEW_RESIDUAL_PRED
     644  UInt          getCtxResPredFlag               ( UInt   uiAbsPartIdx                                 );
     645#endif
     646 
     647  UInt          getSliceStartCU         ( UInt pos )                  { return m_uiSliceStartCU[pos-m_uiAbsIdxInLCU];                                                                                          }
     648  UInt          getEntropySliceStartCU  ( UInt pos )                  { return m_uiEntropySliceStartCU[pos-m_uiAbsIdxInLCU];                                                                                   }
     649  UInt&         getTotalBins            ()                            { return m_uiTotalBins;                                                                                                  }
    574650  // -------------------------------------------------------------------------------------------------------------------
    575651  // member functions for RD cost storage
     
    577653 
    578654  Double&       getTotalCost()                  { return m_dTotalCost;        }
    579   Dist&         getTotalDistortion()            { return m_uiTotalDistortion; }
     655  UInt&         getTotalDistortion()            { return m_uiTotalDistortion; }
    580656  UInt&         getTotalBits()                  { return m_uiTotalBits;       }
    581657  UInt&         getTotalNumPart()               { return m_uiNumPartition;    }
    582658
    583 #if QC_MDCS
    584659  UInt          getCoefScanIdx(UInt uiAbsPartIdx, UInt uiWidth, Bool bIsLuma, Bool bIsIntra);
    585 #endif //QC_MDCS
    586 
     660
     661  Bool          useNonSquareTrans( UInt uiTrMode, Int absPartIdx );
     662  Void          getNSQTSize(Int trMode, Int absPartIdx, Int &trWidth, Int &trHeight);
     663  Bool          useNonSquarePU   ( UInt absPartIdx);
     664  UInt          getInterTUSplitDirection ( Int width, Int height, Int trLastWidth, Int trLastHeight );
     665  UInt          getNSAbsPartIdx  ( UInt log2TrafoSize, UInt absPartIdx, UInt absTUPartIdx, UInt innerQuadIdx, UInt trMode );
     666  UInt          getNSAddrChroma   ( UInt uiLog2TrSizeC, UInt uiTrModeC, UInt uiQuadrant, UInt absTUPartIdx );
     667 
     668// -------------------------------------------------------------------------------------------------------------------
     669  // member functions for depth model modes
     670  // -------------------------------------------------------------------------------------------------------------------
     671#if HHI_DMM_WEDGE_INTRA
     672  UInt* getWedgeFullTabIdx                ()                      { return m_puiWedgeFullTabIdx;              }
     673  UInt  getWedgeFullTabIdx                ( UInt uiIdx )          { return m_puiWedgeFullTabIdx[uiIdx];       }
     674  Void  setWedgeFullTabIdx                ( UInt uiIdx, UInt uh ) { m_puiWedgeFullTabIdx[uiIdx] = uh;         }
     675  Void  setWedgeFullTabIdxSubParts        ( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth );
     676  Int*  getWedgeFullDeltaDC1              ()                      { return m_piWedgeFullDeltaDC1;             }
     677  Int   getWedgeFullDeltaDC1              ( UInt uiIdx )          { return m_piWedgeFullDeltaDC1[uiIdx];      }
     678  Void  setWedgeFullDeltaDC1              ( UInt uiIdx, Int i )   { m_piWedgeFullDeltaDC1[uiIdx] = i;         }
     679  Void  setWedgeFullDeltaDC1SubParts      ( Int iDC1, UInt uiAbsPartIdx, UInt uiDepth );
     680  Int*  getWedgeFullDeltaDC2              ()                      { return m_piWedgeFullDeltaDC2;             }
     681  Int   getWedgeFullDeltaDC2              ( UInt uiIdx )          { return m_piWedgeFullDeltaDC2[uiIdx];      }
     682  Void  setWedgeFullDeltaDC2              ( UInt uiIdx, Int i )   { m_piWedgeFullDeltaDC2[uiIdx] = i;         }
     683  Void  setWedgeFullDeltaDC2SubParts      ( Int iDC2, UInt uiAbsPartIdx, UInt uiDepth );
     684
     685  UInt* getWedgePredDirTabIdx             ()                      { return m_puiWedgePredDirTabIdx;           }
     686  UInt  getWedgePredDirTabIdx             ( UInt uiIdx )          { return m_puiWedgePredDirTabIdx[uiIdx];    }
     687  Void  setWedgePredDirTabIdx             ( UInt uiIdx, UInt uh ) { m_puiWedgePredDirTabIdx[uiIdx] = uh;      }
     688  Void  setWedgePredDirTabIdxSubParts     ( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth );
     689  Int*  getWedgePredDirDeltaDC1           ()                      { return m_piWedgePredDirDeltaDC1;          }
     690  Int   getWedgePredDirDeltaDC1           ( UInt uiIdx )          { return m_piWedgePredDirDeltaDC1[uiIdx];   }
     691  Void  setWedgePredDirDeltaDC1           ( UInt uiIdx, Int i )   { m_piWedgePredDirDeltaDC1[uiIdx] = i;      }
     692  Void  setWedgePredDirDeltaDC1SubParts   ( Int iDC1, UInt uiAbsPartIdx, UInt uiDepth );
     693  Int*  getWedgePredDirDeltaDC2           ()                      { return m_piWedgePredDirDeltaDC2;          }
     694  Int   getWedgePredDirDeltaDC2           ( UInt uiIdx )          { return m_piWedgePredDirDeltaDC2[uiIdx];   }
     695  Void  setWedgePredDirDeltaDC2           ( UInt uiIdx, Int i )   { m_piWedgePredDirDeltaDC2[uiIdx] = i;      }
     696  Void  setWedgePredDirDeltaDC2SubParts   ( Int iDC2, UInt uiAbsPartIdx, UInt uiDepth );
     697  Int*  getWedgePredDirDeltaEnd           ()                      { return m_piWedgePredDirDeltaEnd;          }
     698  Int   getWedgePredDirDeltaEnd           ( UInt uiIdx )          { return m_piWedgePredDirDeltaEnd[uiIdx];   }
     699  Void  setWedgePredDirDeltaEnd           ( UInt uiIdx, Int iD )  { m_piWedgePredDirDeltaEnd[uiIdx] = iD;     }
     700  Void  setWedgePredDirDeltaEndSubParts   ( Int iDelta, UInt uiAbsPartIdx, UInt uiDepth );
     701#endif
     702#if HHI_DMM_PRED_TEX
     703  UInt* getWedgePredTexTabIdx             ()                      { return m_puiWedgePredTexTabIdx;           }
     704  UInt  getWedgePredTexTabIdx             ( UInt uiIdx )          { return m_puiWedgePredTexTabIdx[uiIdx];    }
     705  Void  setWedgePredTexTabIdx             ( UInt uiIdx, UInt uh ) { m_puiWedgePredTexTabIdx[uiIdx] = uh;      }
     706  Void  setWedgePredTexTabIdxSubParts     ( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth );
     707  Int*  getWedgePredTexDeltaDC1           ()                      { return m_piWedgePredTexDeltaDC1;          }
     708  Int   getWedgePredTexDeltaDC1           ( UInt uiIdx )          { return m_piWedgePredTexDeltaDC1[uiIdx];   }
     709  Void  setWedgePredTexDeltaDC1           ( UInt uiIdx, Int i )   { m_piWedgePredTexDeltaDC1[uiIdx] = i;      }
     710  Void  setWedgePredTexDeltaDC1SubParts   ( Int iDC1, UInt uiAbsPartIdx, UInt uiDepth );
     711  Int*  getWedgePredTexDeltaDC2           ()                      { return m_piWedgePredTexDeltaDC2;          }
     712  Int   getWedgePredTexDeltaDC2           ( UInt uiIdx )          { return m_piWedgePredTexDeltaDC2[uiIdx];   }
     713  Void  setWedgePredTexDeltaDC2           ( UInt uiIdx, Int i )   { m_piWedgePredTexDeltaDC2[uiIdx] = i;      }
     714  Void  setWedgePredTexDeltaDC2SubParts   ( Int iDC2, UInt uiAbsPartIdx, UInt uiDepth );
     715
     716  Int*  getContourPredTexDeltaDC1         ()                      { return m_piContourPredTexDeltaDC1;        }
     717  Int   getContourPredTexDeltaDC1         ( UInt uiIdx )          { return m_piContourPredTexDeltaDC1[uiIdx]; }
     718  Void  setContourPredTexDeltaDC1         ( UInt uiIdx, Int i )   { m_piContourPredTexDeltaDC1[uiIdx] = i;    }
     719  Void  setContourPredTexDeltaDC1SubParts ( Int iDC1, UInt uiAbsPartIdx, UInt uiDepth );
     720  Int*  getContourPredTexDeltaDC2         ()                      { return m_piContourPredTexDeltaDC2;        }
     721  Int   getContourPredTexDeltaDC2         ( UInt uiIdx )          { return m_piContourPredTexDeltaDC2[uiIdx]; }
     722  Void  setContourPredTexDeltaDC2         ( UInt uiIdx, Int i )   { m_piContourPredTexDeltaDC2[uiIdx] = i;    }
     723  Void  setContourPredTexDeltaDC2SubParts ( Int iDC2, UInt uiAbsPartIdx, UInt uiDepth );
     724#endif
    587725};
    588726
    589 #endif
    590 
     727namespace RasterAddress
     728{
     729  /** Check whether 2 addresses point to the same column
     730   * \param addrA          First address in raster scan order
     731   * \param addrB          Second address in raters scan order
     732   * \param numUnitsPerRow Number of units in a row
     733   * \return Result of test
     734   */
     735  static inline Bool isEqualCol( Int addrA, Int addrB, Int numUnitsPerRow )
     736  {
     737    // addrA % numUnitsPerRow == addrB % numUnitsPerRow
     738    return (( addrA ^ addrB ) &  ( numUnitsPerRow - 1 ) ) == 0;
     739  }
     740 
     741  /** Check whether 2 addresses point to the same row
     742   * \param addrA          First address in raster scan order
     743   * \param addrB          Second address in raters scan order
     744   * \param numUnitsPerRow Number of units in a row
     745   * \return Result of test
     746   */
     747  static inline Bool isEqualRow( Int addrA, Int addrB, Int numUnitsPerRow )
     748  {
     749    // addrA / numUnitsPerRow == addrB / numUnitsPerRow
     750    return (( addrA ^ addrB ) &~ ( numUnitsPerRow - 1 ) ) == 0;
     751  }
     752 
     753  /** Check whether 2 addresses point to the same row or column
     754   * \param addrA          First address in raster scan order
     755   * \param addrB          Second address in raters scan order
     756   * \param numUnitsPerRow Number of units in a row
     757   * \return Result of test
     758   */
     759  static inline Bool isEqualRowOrCol( Int addrA, Int addrB, Int numUnitsPerRow )
     760  {
     761    return isEqualCol( addrA, addrB, numUnitsPerRow ) | isEqualRow( addrA, addrB, numUnitsPerRow );
     762  }
     763 
     764  /** Check whether one address points to the first column
     765   * \param addr           Address in raster scan order
     766   * \param numUnitsPerRow Number of units in a row
     767   * \return Result of test
     768   */
     769  static inline Bool isZeroCol( Int addr, Int numUnitsPerRow )
     770  {
     771    // addr % numUnitsPerRow == 0
     772    return ( addr & ( numUnitsPerRow - 1 ) ) == 0;
     773  }
     774 
     775  /** Check whether one address points to the first row
     776   * \param addr           Address in raster scan order
     777   * \param numUnitsPerRow Number of units in a row
     778   * \return Result of test
     779   */
     780  static inline Bool isZeroRow( Int addr, Int numUnitsPerRow )
     781  {
     782    // addr / numUnitsPerRow == 0
     783    return ( addr &~ ( numUnitsPerRow - 1 ) ) == 0;
     784  }
     785 
     786  /** Check whether one address points to a column whose index is smaller than a given value
     787   * \param addr           Address in raster scan order
     788   * \param val            Given column index value
     789   * \param numUnitsPerRow Number of units in a row
     790   * \return Result of test
     791   */
     792  static inline Bool lessThanCol( Int addr, Int val, Int numUnitsPerRow )
     793  {
     794    // addr % numUnitsPerRow < val
     795    return ( addr & ( numUnitsPerRow - 1 ) ) < val;
     796  }
     797 
     798  /** Check whether one address points to a row whose index is smaller than a given value
     799   * \param addr           Address in raster scan order
     800   * \param val            Given row index value
     801   * \param numUnitsPerRow Number of units in a row
     802   * \return Result of test
     803   */
     804  static inline Bool lessThanRow( Int addr, Int val, Int numUnitsPerRow )
     805  {
     806    // addr / numUnitsPerRow < val
     807    return addr < val * numUnitsPerRow;
     808  }
     809};
     810
     811//! \}
     812
     813#endif
Note: See TracChangeset for help on using the changeset viewer.