Changeset 1413 in 3DVCSoftware for trunk/source/Lib


Ignore:
Timestamp:
11 Jul 2018, 15:19:49 (6 years ago)
Author:
tech
Message:

Merged HTM-16.2-dev@1412

Location:
trunk/source/Lib
Files:
2 added
140 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TAppCommon/program_options_lite.cpp

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TAppCommon/program_options_lite.h

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/AccessUnit.h

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/CommonDef.h

    r1406 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    7272#if NH_MV
    7373#define NV_VERSION        "16.2"                ///< Current software version
    74 #define HM_VERSION        "16.9"                ///<
    75 #else
    76 #define NV_VERSION        "16.9"                 ///< Current software version
     74#define HM_VERSION        "16.18"                ///<
     75#else
     76#define NV_VERSION        "16.18"                 ///< Current software version
    7777#endif
    7878// ====================================================================================================================
     
    267267static const Int LAST_SIGNIFICANT_GROUPS =                        10 ;
    268268
    269 #if W0038_DB_OPT
    270269static const Int MAX_ENCODER_DEBLOCKING_QUALITY_LAYERS =           8 ;
    271 #endif
    272 
    273270
    274271#if NH_MV
     
    290287#endif
    291288
     289static const UInt LUMA_LEVEL_TO_DQP_LUT_MAXSIZE =                1024; ///< max LUT size for QP offset based on luma
     290
     291
    292292// ====================================================================================================================
    293293// Macro functions
     
    373373#endif
    374374
    375 #if NH_3D_MLC  || NH_3D_ARP
     375#if NH_3D
    376376#define MRG_MAX_NUM_CANDS_MEM       (MRG_MAX_NUM_CANDS+1) // one extra for inter-view motion prediction
    377377#endif
  • trunk/source/Lib/TLibCommon/ContextModel.cpp

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/ContextModel.h

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/ContextModel3DBuffer.cpp

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/ContextModel3DBuffer.h

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/ContextTables.h

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    5151#define NUM_SPLIT_FLAG_CTX            3       ///< number of context models for split flag
    5252#define NUM_SKIP_FLAG_CTX             3       ///< number of context models for skip flag
    53 #if NH_3D_DIS
     53#if NH_3D
    5454#define NUM_DIS_FLAG_CTX              1
    5555#define NUM_DIS_TYPE_CTX              1       
     
    162162#define NUM_CU_TRANSQUANT_BYPASS_FLAG_CTX  1
    163163
    164 #if NH_3D_ARP
     164#if NH_3D
    165165#define NUM_ARPW_CTX                  3       ///< number of context models for weighting factor index used by advanced residual prediction
    166 #endif
    167 
    168 #if NH_3D_IC
    169166#define NUM_IC_FLAG_CTX               1       ///< number of context models for illumination compensation flag
    170167#endif
     168
    171169#define NUM_CROSS_COMPONENT_PREDICTION_CTX 10
    172170
    173171#define CNU                          154      ///< dummy initialization value for unused context models 'Context model Not Used'
    174172
    175 #if NH_3D_DMM
     173#if NH_3D
    176174#define NUM_NOTDMM_FLAG_CTX           1       ///< number of context models for not-DMM flag
    177175#define NUM_DMM_MODE_CTX              1       ///< number of context models for DMM modes
    178 #endif
    179 #if NH_3D_DMM || NH_3D_SDC_INTRA
    180176#define NUM_DDC_DATA_CTX              1       ///< number of context models for deltaDC data (DMM or SDC)
    181 #endif
    182 #if NH_3D_SDC_INTRA
    183177#define SDC_NUM_RESIDUAL_FLAG_CTX     1
    184178#define SDC_NUM_RESIDUAL_CTX          1
    185179#define NUM_SDC_FLAG_CTX              1      ///< number of context
    186180#define NUM_DDC_FLAG_CTX              2       ///< number of context models for deltaDC flag (SDC only)
    187 #endif
    188 #if NH_3D_DBBP
    189 #define DBBP_NUM_FLAG_CTX                 1
     181#define DBBP_NUM_FLAG_CTX             1
    190182#endif
    191183// ====================================================================================================================
     
    218210  { CNU,  CNU,  CNU, },
    219211};
    220 #if NH_3D_DIS
     212#if NH_3D
    221213static const UChar
    222214INIT_DIS_FLAG[3][NUM_DIS_FLAG_CTX] = 
     
    540532//! \}
    541533
    542 #if NH_3D_ARP
     534#if NH_3D
    543535static const UChar
    544536INIT_ARPW[3][NUM_ARPW_CTX] =
     
    549541};
    550542
    551 #endif
    552 #if NH_3D_IC
    553543static const UChar
    554544INIT_IC_FLAG[3][NUM_IC_FLAG_CTX] = 
     
    559549};
    560550
    561 #endif
    562 
    563 #if NH_3D_DMM
    564551static const UChar
    565552INIT_NOTDMM_FLAG[3][NUM_NOTDMM_FLAG_CTX] =
     
    576563  { CNU }
    577564};
    578 #endif
    579 #if NH_3D_DMM || NH_3D_SDC_INTRA
     565
    580566static const UChar
    581567INIT_DDC_DATA[3][NUM_DDC_DATA_CTX] =
     
    585571  { CNU },
    586572};
    587 #endif
    588 #if NH_3D_SDC_INTRA
     573
    589574static const UChar
    590575INIT_SDC_RESIDUAL_FLAG[3][SDC_NUM_RESIDUAL_FLAG_CTX] =
     
    615600  {64, CNU}
    616601};
     602static const UChar INIT_DBBP_FLAG[3][DBBP_NUM_FLAG_CTX] =
     603{
     604  { CNU },
     605  { CNU },
     606  { CNU },
     607};
    617608#endif
    618 #if NH_3D_DBBP
    619 static const UChar INIT_DBBP_FLAG[3][DBBP_NUM_FLAG_CTX] =
    620 {
    621   { CNU },
    622   { CNU },
    623   { CNU },
    624 };
     609
    625610#endif
    626 
    627 #endif
  • trunk/source/Lib/TLibCommon/Debug.cpp

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    180180
    181181  PRINT_CONSTANT(ME_ENABLE_ROUNDING_OF_MVS,                                         settingNameWidth, settingValueWidth);
    182   PRINT_CONSTANT(U0040_MODIFIED_WEIGHTEDPREDICTION_WITH_BIPRED_AND_CLIPPING,        settingNameWidth, settingValueWidth);
     182#if NH_MV
     183  PRINT_CONSTANT(NH_MV_ALLOW_NON_CONFORMING,                                        settingNameWidth, settingValueWidth);
     184#endif
    183185
    184186  //------------------------------------------------
  • trunk/source/Lib/TLibCommon/Debug.h

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/NAL.h

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/SEI.cpp

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    124124    case SEI::BUFFERING_PERIOD:                     return "Buffering period";
    125125    case SEI::PICTURE_TIMING:                       return "Picture timing";
    126     case SEI::PAN_SCAN_RECT:                        return "Pan-scan rectangle";                   // not currently decoded
    127     case SEI::FILLER_PAYLOAD:                       return "Filler payload";                       // not currently decoded
    128     case SEI::USER_DATA_REGISTERED_ITU_T_T35:       return "User data registered";                 // not currently decoded
     126    case SEI::PAN_SCAN_RECT:                        return "Pan-scan rectangle";
     127    case SEI::FILLER_PAYLOAD:                       return "Filler payload";
     128    case SEI::USER_DATA_REGISTERED_ITU_T_T35:       return "User data registered";
    129129    case SEI::USER_DATA_UNREGISTERED:               return "User data unregistered";
    130130    case SEI::RECOVERY_POINT:                       return "Recovery point";
    131     case SEI::SCENE_INFO:                           return "Scene information";                    // not currently decoded
    132     case SEI::FULL_FRAME_SNAPSHOT:                  return "Picture snapshot";                     // not currently decoded
    133     case SEI::PROGRESSIVE_REFINEMENT_SEGMENT_START: return "Progressive refinement segment start"; // not currently decoded
    134     case SEI::PROGRESSIVE_REFINEMENT_SEGMENT_END:   return "Progressive refinement segment end";   // not currently decoded
    135     case SEI::FILM_GRAIN_CHARACTERISTICS:           return "Film grain characteristics";           // not currently decoded
    136     case SEI::POST_FILTER_HINT:                     return "Post filter hint";                     // not currently decoded
     131    case SEI::SCENE_INFO:                           return "Scene information";
     132    case SEI::PICTURE_SNAPSHOT:                     return "Picture snapshot";
     133    case SEI::PROGRESSIVE_REFINEMENT_SEGMENT_START: return "Progressive refinement segment start";
     134    case SEI::PROGRESSIVE_REFINEMENT_SEGMENT_END:   return "Progressive refinement segment end";
     135    case SEI::FILM_GRAIN_CHARACTERISTICS:           return "Film grain characteristics";
     136    case SEI::POST_FILTER_HINT:                     return "Post filter hint";
    137137    case SEI::TONE_MAPPING_INFO:                    return "Tone mapping information";
    138138    case SEI::KNEE_FUNCTION_INFO:                   return "Knee function information";
    139139    case SEI::FRAME_PACKING:                        return "Frame packing arrangement";
    140140    case SEI::DISPLAY_ORIENTATION:                  return "Display orientation";
     141    case SEI::GREEN_METADATA:                       return "Green metadata information";
    141142    case SEI::SOP_DESCRIPTION:                      return "Structure of pictures information";
    142143    case SEI::ACTIVE_PARAMETER_SETS:                return "Active parameter sets";
     
    153154    case SEI::CHROMA_RESAMPLING_FILTER_HINT:        return "Chroma sampling filter hint";
    154155    case SEI::COLOUR_REMAPPING_INFO:                return "Colour remapping info";
    155 #if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
     156    case SEI::DEINTERLACE_FIELD_IDENTIFICATION:     return "Deinterlace field identification";
     157    case SEI::CONTENT_LIGHT_LEVEL_INFO:             return "Content light level info";
     158    case SEI::DEPENDENT_RAP_INDICATION:             return "Dependent RAP indication";
     159    case SEI::CODED_REGION_COMPLETION:              return "Coded region completion";
    156160    case SEI::ALTERNATIVE_TRANSFER_CHARACTERISTICS: return "Alternative transfer characteristics";
    157 #endif
     161    case SEI::AMBIENT_VIEWING_ENVIRONMENT:          return "Ambient viewing environment";
    158162
    159163#if NH_MV
    160     case SEI::DEINTERLACED_FIELD_IDENTIFICATION:         return "Deinterlaced field identification";
    161164    case SEI::LAYERS_NOT_PRESENT:                        return "Layers not present";
    162165    case SEI::INTER_LAYER_CONSTRAINED_TILE_SETS:         return "Inter-layer constrained tile sets";
  • trunk/source/Lib/TLibCommon/SEI.h

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    6868    BUFFERING_PERIOD                     = 0,
    6969    PICTURE_TIMING                       = 1,
    70     PAN_SCAN_RECT                        = 2,
    71     FILLER_PAYLOAD                       = 3,
    72     USER_DATA_REGISTERED_ITU_T_T35       = 4,
    73     USER_DATA_UNREGISTERED               = 5,
     70    PAN_SCAN_RECT                        = 2,   // TODO: add encoder command line control to create these messages
     71    FILLER_PAYLOAD                       = 3,   // TODO: add encoder command line control to create these messages
     72    USER_DATA_REGISTERED_ITU_T_T35       = 4,   // TODO: add encoder command line control to create these messages
     73    USER_DATA_UNREGISTERED               = 5,   // TODO: add encoder command line control to create these messages
    7474    RECOVERY_POINT                       = 6,
    75     SCENE_INFO                           = 9,
    76     FULL_FRAME_SNAPSHOT                  = 15,
    77     PROGRESSIVE_REFINEMENT_SEGMENT_START = 16,
    78     PROGRESSIVE_REFINEMENT_SEGMENT_END   = 17,
    79     FILM_GRAIN_CHARACTERISTICS           = 19,
    80     POST_FILTER_HINT                     = 22,
     75    SCENE_INFO                           = 9,   // TODO: add encoder command line control to create these messages
     76    PICTURE_SNAPSHOT                     = 15,  // TODO: add encoder command line control to create these messages
     77    PROGRESSIVE_REFINEMENT_SEGMENT_START = 16,  // TODO: add encoder command line control to create these messages
     78    PROGRESSIVE_REFINEMENT_SEGMENT_END   = 17,  // TODO: add encoder command line control to create these messages
     79    FILM_GRAIN_CHARACTERISTICS           = 19,  // TODO: add encoder command line control to create these messages
     80    POST_FILTER_HINT                     = 22,  // TODO: add encoder command line control to create these messages
    8181    TONE_MAPPING_INFO                    = 23,
    8282    FRAME_PACKING                        = 45,
    8383    DISPLAY_ORIENTATION                  = 47,
     84    GREEN_METADATA                       = 56,
    8485    SOP_DESCRIPTION                      = 128,
    8586    ACTIVE_PARAMETER_SETS                = 129,
     
    9798    KNEE_FUNCTION_INFO                   = 141,
    9899    COLOUR_REMAPPING_INFO                = 142,
    99 #if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
    100     ALTERNATIVE_TRANSFER_CHARACTERISTICS = 182,
    101 #endif
    102     DEINTERLACED_FIELD_IDENTIFICATION         = 143,
     100    DEINTERLACE_FIELD_IDENTIFICATION     = 143, // TODO: add encoder command line control to create these messages
     101    CONTENT_LIGHT_LEVEL_INFO             = 144, // TODO: add encoder command line control to create these messages
     102    DEPENDENT_RAP_INDICATION             = 145, // TODO: add encoder command line control to create these messages
     103    CODED_REGION_COMPLETION              = 146, // TODO: add encoder command line control to create these messages
     104    ALTERNATIVE_TRANSFER_CHARACTERISTICS = 147,
     105    AMBIENT_VIEWING_ENVIRONMENT          = 148, // TODO: add encoder command line control to create these messages
     106#if NH_MV
    103107    LAYERS_NOT_PRESENT                        = 160,
    104108    INTER_LAYER_CONSTRAINED_TILE_SETS         = 161,
     
    118122    ,ALTERNATIVE_DEPTH_INFO                    = 181
    119123#endif
     124#endif
    120125
    121126  };
     
    165170};
    166171
    167 static const UInt ISO_IEC_11578_LEN=16;
    168 
    169 class SEIuserDataUnregistered : public SEI
    170 {
    171 public:
    172   PayloadType payloadType() const { return USER_DATA_UNREGISTERED; }
    173 
    174   SEIuserDataUnregistered()
    175     : userData(0)
    176     {}
    177 
    178   virtual ~SEIuserDataUnregistered()
    179   {
    180     delete userData;
    181   }
    182 
    183   UChar uuid_iso_iec_11578[ISO_IEC_11578_LEN];
    184   UInt  userDataLength;
    185   UChar *userData;
    186 };
    187 
    188 class SEIDecodedPictureHash : public SEI
    189 {
    190 public:
    191   PayloadType payloadType() const { return DECODED_PICTURE_HASH; }
    192 
    193   SEIDecodedPictureHash() {}
    194   virtual ~SEIDecodedPictureHash() {}
    195 
    196   HashType method;
    197 
    198   TComPictureHash m_pictureHash;
    199 };
    200 
    201 class SEIActiveParameterSets : public SEI
    202 {
    203 public:
    204   PayloadType payloadType() const { return ACTIVE_PARAMETER_SETS; }
    205 
    206   SEIActiveParameterSets()
    207     : activeVPSId            (0)
    208     , m_selfContainedCvsFlag (false)
    209     , m_noParameterSetUpdateFlag (false)
    210     , numSpsIdsMinus1        (0)
    211   {}
    212   virtual ~SEIActiveParameterSets() {}
    213 
    214   Int activeVPSId;
    215   Bool m_selfContainedCvsFlag;
    216   Bool m_noParameterSetUpdateFlag;
    217   Int numSpsIdsMinus1;
    218   std::vector<Int> activeSeqParameterSetId;
    219 };
     172
     173typedef std::list<SEI*> SEIMessages;
     174
     175/// output a selection of SEI messages by payload type. Ownership stays in original message list.
     176SEIMessages getSeisByType(SEIMessages &seiList, SEI::PayloadType seiType);
     177
     178/// remove a selection of SEI messages by payload type from the original list and return them in a new list.
     179SEIMessages extractSeisByType(SEIMessages &seiList, SEI::PayloadType seiType);
     180
     181/// delete list of SEI messages (freeing the referenced objects)
     182Void deleteSEIs (SEIMessages &seiList);
     183
    220184
    221185class SEIBufferingPeriod : public SEI
     
    279243};
    280244
    281 class SEIDecodingUnitInfo : public SEI
    282 {
    283 public:
    284   PayloadType payloadType() const { return DECODING_UNIT_INFO; }
    285 
    286   SEIDecodingUnitInfo()
    287     : m_decodingUnitIdx(0)
    288     , m_duSptCpbRemovalDelay(0)
    289     , m_dpbOutputDuDelayPresentFlag(false)
    290     , m_picSptDpbOutputDuDelay(0)
    291   {}
    292   virtual ~SEIDecodingUnitInfo() {}
    293   Int m_decodingUnitIdx;
    294   Int m_duSptCpbRemovalDelay;
    295   Bool m_dpbOutputDuDelayPresentFlag;
    296   Int m_picSptDpbOutputDuDelay;
    297 };
     245class SEIPanScanRect : public SEI
     246{
     247public:
     248  PayloadType payloadType() const { return PAN_SCAN_RECT; }
     249
     250  SEIPanScanRect() {}
     251  virtual ~SEIPanScanRect() {}
     252
     253  struct PanScanRect
     254  {
     255    Int leftOffset;
     256    Int rightOffset;
     257    Int topOffset;
     258    Int bottomOffset;
     259  };
     260
     261  UInt m_panScanRectId;
     262  Bool m_panScanRectCancelFlag;
     263  std::vector<PanScanRect> m_panScanRectRegions;
     264  Bool m_panScanRectPersistenceFlag;
     265};
     266
     267
     268class SEIFillerPayload : public SEI
     269{
     270public:
     271  PayloadType payloadType() const { return FILLER_PAYLOAD; }
     272
     273  SEIFillerPayload() {}
     274  virtual ~SEIFillerPayload() {}
     275
     276  UInt m_numFillerFFBytes;
     277};
     278
     279
     280class SEIUserDataRegistered : public SEI
     281{
     282public:
     283  PayloadType payloadType() const { return USER_DATA_REGISTERED_ITU_T_T35; }
     284
     285  SEIUserDataRegistered() {}
     286  virtual ~SEIUserDataRegistered() {}
     287
     288  UShort m_ituCountryCode;
     289  std::vector<UChar> m_userData;
     290};
     291
     292
     293static const UInt ISO_IEC_11578_LEN=16;
     294
     295class SEIUserDataUnregistered : public SEI
     296{
     297public:
     298  PayloadType payloadType() const { return USER_DATA_UNREGISTERED; }
     299
     300  SEIUserDataUnregistered() {}
     301  virtual ~SEIUserDataUnregistered() { }
     302
     303  UChar m_uuid_iso_iec_11578[ISO_IEC_11578_LEN];
     304  std::vector<UChar> m_userData;
     305};
     306
    298307
    299308class SEIRecoveryPoint : public SEI
     
    310319};
    311320
    312 class SEIFramePacking : public SEI
    313 {
    314 public:
    315   PayloadType payloadType() const { return FRAME_PACKING; }
    316 
    317   SEIFramePacking() {}
    318   virtual ~SEIFramePacking() {}
    319 
    320   Int  m_arrangementId;
    321   Bool m_arrangementCancelFlag;
    322   Int  m_arrangementType;
    323   Bool m_quincunxSamplingFlag;
    324   Int  m_contentInterpretationType;
    325   Bool m_spatialFlippingFlag;
    326   Bool m_frame0FlippedFlag;
    327   Bool m_fieldViewsFlag;
    328   Bool m_currentFrameIsFrame0Flag;
    329   Bool m_frame0SelfContainedFlag;
    330   Bool m_frame1SelfContainedFlag;
    331   Int  m_frame0GridPositionX;
    332   Int  m_frame0GridPositionY;
    333   Int  m_frame1GridPositionX;
    334   Int  m_frame1GridPositionY;
    335   Int  m_arrangementReservedByte;
    336   Bool m_arrangementPersistenceFlag;
    337   Bool m_upsampledAspectRatio;
    338 };
    339 
    340 class SEISegmentedRectFramePacking : public SEI
    341 {
    342 public:
    343   PayloadType payloadType() const { return SEGM_RECT_FRAME_PACKING; }
    344 
    345   SEISegmentedRectFramePacking() {}
    346   virtual ~SEISegmentedRectFramePacking() {}
    347 
    348   Bool m_arrangementCancelFlag;
    349   Int  m_contentInterpretationType;
    350   Bool m_arrangementPersistenceFlag;
    351 };
    352 
    353 class SEIDisplayOrientation : public SEI
    354 {
    355 public:
    356   PayloadType payloadType() const { return DISPLAY_ORIENTATION; }
    357 
    358   SEIDisplayOrientation()
    359     : cancelFlag(true)
    360     , persistenceFlag(0)
    361     , extensionFlag(false)
    362     {}
    363   virtual ~SEIDisplayOrientation() {}
    364 
    365   Bool cancelFlag;
    366   Bool horFlip;
    367   Bool verFlip;
    368 
    369   UInt anticlockwiseRotation;
    370   Bool persistenceFlag;
    371   Bool extensionFlag;
    372 };
    373 
    374 class SEITemporalLevel0Index : public SEI
    375 {
    376 public:
    377   PayloadType payloadType() const { return TEMPORAL_LEVEL0_INDEX; }
    378 
    379   SEITemporalLevel0Index()
    380     : tl0Idx(0)
    381     , rapIdx(0)
    382     {}
    383   virtual ~SEITemporalLevel0Index() {}
    384 
    385   UInt tl0Idx;
    386   UInt rapIdx;
    387 };
    388 
    389 class SEIGradualDecodingRefreshInfo : public SEI
    390 {
    391 public:
    392   PayloadType payloadType() const { return REGION_REFRESH_INFO; }
    393 
    394   SEIGradualDecodingRefreshInfo()
    395     : m_gdrForegroundFlag(0)
    396   {}
    397   virtual ~SEIGradualDecodingRefreshInfo() {}
    398 
    399   Bool m_gdrForegroundFlag;
    400 };
    401 
    402 class SEINoDisplay : public SEI
    403 {
    404 public:
    405   PayloadType payloadType() const { return NO_DISPLAY; }
    406 
    407   SEINoDisplay()
    408     : m_noDisplay(false)
    409   {}
    410   virtual ~SEINoDisplay() {}
    411 
    412   Bool m_noDisplay;
    413 };
    414 
    415 class SEISOPDescription : public SEI
    416 {
    417 public:
    418   PayloadType payloadType() const { return SOP_DESCRIPTION; }
    419 
    420   SEISOPDescription() {}
    421   virtual ~SEISOPDescription() {}
    422 
    423   UInt m_sopSeqParameterSetId;
    424   UInt m_numPicsInSopMinus1;
    425 
    426   UInt m_sopDescVclNaluType[MAX_NUM_PICS_IN_SOP];
    427   UInt m_sopDescTemporalId[MAX_NUM_PICS_IN_SOP];
    428   UInt m_sopDescStRpsIdx[MAX_NUM_PICS_IN_SOP];
    429   Int m_sopDescPocDelta[MAX_NUM_PICS_IN_SOP];
     321class SEISceneInfo : public SEI
     322{
     323public:
     324  PayloadType payloadType() const { return SCENE_INFO; }
     325
     326  SEISceneInfo() {}
     327  virtual ~SEISceneInfo() {}
     328
     329  Bool m_bSceneInfoPresentFlag;
     330  Bool m_bPrevSceneIdValidFlag;
     331  UInt m_sceneId;
     332  UInt m_sceneTransitionType;
     333  UInt m_secondSceneId;
     334};
     335
     336class SEIPictureSnapshot : public SEI
     337{
     338public:
     339  PayloadType payloadType() const { return PICTURE_SNAPSHOT; }
     340
     341  SEIPictureSnapshot() {}
     342  virtual ~SEIPictureSnapshot() {}
     343
     344  UInt m_snapshotId;
     345};
     346
     347
     348class SEIProgressiveRefinementSegmentStart : public SEI
     349{
     350public:
     351  PayloadType payloadType() const { return PROGRESSIVE_REFINEMENT_SEGMENT_START; }
     352
     353  SEIProgressiveRefinementSegmentStart() {}
     354  virtual ~SEIProgressiveRefinementSegmentStart() {}
     355
     356  UInt m_progressiveRefinementId;
     357  UInt m_picOrderCntDelta;
     358};
     359
     360
     361class SEIProgressiveRefinementSegmentEnd: public SEI
     362{
     363public:
     364  PayloadType payloadType() const { return PROGRESSIVE_REFINEMENT_SEGMENT_END; }
     365
     366  SEIProgressiveRefinementSegmentEnd() {}
     367  virtual ~SEIProgressiveRefinementSegmentEnd() {}
     368
     369  UInt m_progressiveRefinementId;
     370};
     371
     372
     373class SEIFilmGrainCharacteristics: public SEI
     374{
     375public:
     376  PayloadType payloadType() const { return FILM_GRAIN_CHARACTERISTICS; }
     377
     378  SEIFilmGrainCharacteristics() {}
     379  virtual ~SEIFilmGrainCharacteristics() {}
     380
     381  Bool      m_filmGrainCharacteristicsCancelFlag;
     382  UChar     m_filmGrainModelId;
     383  Bool      m_separateColourDescriptionPresentFlag;
     384  UChar     m_filmGrainBitDepthLumaMinus8;
     385  UChar     m_filmGrainBitDepthChromaMinus8;
     386  Bool      m_filmGrainFullRangeFlag;
     387  UChar     m_filmGrainColourPrimaries;
     388  UChar     m_filmGrainTransferCharacteristics;
     389  UChar     m_filmGrainMatrixCoeffs;
     390  UChar     m_blendingModeId;
     391  UChar     m_log2ScaleFactor;
     392
     393  struct CompModelIntensityValues
     394{
     395    UChar intensityIntervalLowerBound;
     396    UChar intensityIntervalUpperBound;
     397    std::vector<Int> compModelValue;
     398  };
     399
     400  struct CompModel
     401  {
     402    Bool  bPresentFlag;
     403    UChar numModelValues; // this must be the same as intensityValues[*].compModelValue.size()
     404    std::vector<CompModelIntensityValues> intensityValues;
     405  };
     406
     407  CompModel m_compModel[MAX_NUM_COMPONENT];
     408  Bool      m_filmGrainCharacteristicsPersistenceFlag;
     409
     410};
     411
     412
     413class SEIPostFilterHint: public SEI
     414{
     415public:
     416  PayloadType payloadType() const { return POST_FILTER_HINT; }
     417
     418  SEIPostFilterHint() {}
     419  virtual ~SEIPostFilterHint() {}
     420
     421  UInt             m_filterHintSizeY;
     422  UInt             m_filterHintSizeX;
     423  UInt             m_filterHintType;
     424  Bool             m_bIsMonochrome;
     425  std::vector<Int> m_filterHintValues; // values stored in linear array, [ ( ( component * sizeY + y ) * SizeX ) + x ]
    430426};
    431427
     
    465461};
    466462
     463class SEIFramePacking : public SEI
     464{
     465public:
     466  PayloadType payloadType() const { return FRAME_PACKING; }
     467
     468  SEIFramePacking() {}
     469  virtual ~SEIFramePacking() {}
     470
     471  Int  m_arrangementId;
     472  Bool m_arrangementCancelFlag;
     473  Int  m_arrangementType;
     474  Bool m_quincunxSamplingFlag;
     475  Int  m_contentInterpretationType;
     476  Bool m_spatialFlippingFlag;
     477  Bool m_frame0FlippedFlag;
     478  Bool m_fieldViewsFlag;
     479  Bool m_currentFrameIsFrame0Flag;
     480  Bool m_frame0SelfContainedFlag;
     481  Bool m_frame1SelfContainedFlag;
     482  Int  m_frame0GridPositionX;
     483  Int  m_frame0GridPositionY;
     484  Int  m_frame1GridPositionX;
     485  Int  m_frame1GridPositionY;
     486  Int  m_arrangementReservedByte;
     487  Bool m_arrangementPersistenceFlag;
     488  Bool m_upsampledAspectRatio;
     489};
     490
     491class SEIDisplayOrientation : public SEI
     492{
     493public:
     494  PayloadType payloadType() const { return DISPLAY_ORIENTATION; }
     495
     496  SEIDisplayOrientation()
     497    : cancelFlag(true)
     498    , persistenceFlag(0)
     499    , extensionFlag(false)
     500    {}
     501  virtual ~SEIDisplayOrientation() {}
     502
     503  Bool cancelFlag;
     504  Bool horFlip;
     505  Bool verFlip;
     506
     507  UInt anticlockwiseRotation;
     508  Bool persistenceFlag;
     509  Bool extensionFlag;
     510};
     511
     512
     513class SEIGreenMetadataInfo : public SEI
     514  {
     515public:
     516    PayloadType payloadType() const { return GREEN_METADATA; }
     517    SEIGreenMetadataInfo() {}
     518
     519    virtual ~SEIGreenMetadataInfo() {}
     520
     521    UInt m_greenMetadataType;
     522    UInt m_xsdMetricType;
     523    UInt m_xsdMetricValue;
     524};
     525
     526
     527class SEISOPDescription : public SEI
     528    {
     529public:
     530  PayloadType payloadType() const { return SOP_DESCRIPTION; }
     531
     532  SEISOPDescription() {}
     533  virtual ~SEISOPDescription() {}
     534
     535  UInt m_sopSeqParameterSetId;
     536  UInt m_numPicsInSopMinus1;
     537
     538  UInt m_sopDescVclNaluType[MAX_NUM_PICS_IN_SOP];
     539  UInt m_sopDescTemporalId[MAX_NUM_PICS_IN_SOP];
     540  UInt m_sopDescStRpsIdx[MAX_NUM_PICS_IN_SOP];
     541  Int m_sopDescPocDelta[MAX_NUM_PICS_IN_SOP];
     542  };
     543
     544
     545class SEIActiveParameterSets : public SEI
     546      {
     547public:
     548  PayloadType payloadType() const { return ACTIVE_PARAMETER_SETS; }
     549
     550  SEIActiveParameterSets()
     551    : activeVPSId            (0)
     552    , m_selfContainedCvsFlag (false)
     553    , m_noParameterSetUpdateFlag (false)
     554    , numSpsIdsMinus1        (0)
     555  {}
     556  virtual ~SEIActiveParameterSets() {}
     557
     558  Int activeVPSId;
     559  Bool m_selfContainedCvsFlag;
     560  Bool m_noParameterSetUpdateFlag;
     561  Int numSpsIdsMinus1;
     562  std::vector<Int> activeSeqParameterSetId;
     563};
     564
     565class SEIDecodingUnitInfo : public SEI
     566{
     567public:
     568  PayloadType payloadType() const { return DECODING_UNIT_INFO; }
     569
     570  SEIDecodingUnitInfo()
     571    : m_decodingUnitIdx(0)
     572    , m_duSptCpbRemovalDelay(0)
     573    , m_dpbOutputDuDelayPresentFlag(false)
     574    , m_picSptDpbOutputDuDelay(0)
     575  {}
     576  virtual ~SEIDecodingUnitInfo() {}
     577  Int m_decodingUnitIdx;
     578  Int m_duSptCpbRemovalDelay;
     579  Bool m_dpbOutputDuDelayPresentFlag;
     580  Int m_picSptDpbOutputDuDelay;
     581};
     582
     583class SEITemporalLevel0Index : public SEI
     584{
     585public:
     586  PayloadType payloadType() const { return TEMPORAL_LEVEL0_INDEX; }
     587
     588  SEITemporalLevel0Index()
     589    : tl0Idx(0)
     590    , rapIdx(0)
     591    {}
     592  virtual ~SEITemporalLevel0Index() {}
     593
     594  UInt tl0Idx;
     595  UInt rapIdx;
     596};
     597
     598
     599class SEIDecodedPictureHash : public SEI
     600{
     601public:
     602  PayloadType payloadType() const { return DECODED_PICTURE_HASH; }
     603
     604  SEIDecodedPictureHash() {}
     605  virtual ~SEIDecodedPictureHash() {}
     606
     607  HashType method;
     608
     609  TComPictureHash m_pictureHash;
     610};
     611
     612
     613class SEIScalableNesting : public SEI
     614{
     615public:
     616  PayloadType payloadType() const { return SCALABLE_NESTING; }
     617
     618  SEIScalableNesting() {}
     619
     620  virtual ~SEIScalableNesting()
     621  {
     622    deleteSEIs(m_nestedSEIs);
     623  }
     624
     625  Bool  m_bitStreamSubsetFlag;
     626  Bool  m_nestingOpFlag;
     627  Bool  m_defaultOpFlag;                             //value valid if m_nestingOpFlag != 0
     628  UInt  m_nestingNumOpsMinus1;                       // -"-
     629  UInt  m_nestingMaxTemporalIdPlus1[MAX_TLAYER];     // -"-
     630  UInt  m_nestingOpIdx[MAX_NESTING_NUM_OPS];         // -"-
     631
     632  Bool  m_allLayersFlag;                             //value valid if m_nestingOpFlag == 0
     633  UInt  m_nestingNoOpMaxTemporalIdPlus1;             //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0
     634  UInt  m_nestingNumLayersMinus1;                    //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0
     635  UChar m_nestingLayerId[MAX_NESTING_NUM_LAYER];     //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0. This can e.g. be a static array of 64 UChar values
     636
     637  SEIMessages m_nestedSEIs;
     638};
     639
     640
     641class SEIRegionRefreshInfo : public SEI
     642{
     643public:
     644  PayloadType payloadType() const { return REGION_REFRESH_INFO; }
     645
     646  SEIRegionRefreshInfo()
     647    : m_gdrForegroundFlag(0)
     648  {}
     649  virtual ~SEIRegionRefreshInfo() {}
     650
     651  Bool m_gdrForegroundFlag;
     652};
     653
     654
     655class SEINoDisplay : public SEI
     656{
     657public:
     658  PayloadType payloadType() const { return NO_DISPLAY; }
     659
     660  SEINoDisplay()
     661    : m_noDisplay(false)
     662  {}
     663  virtual ~SEINoDisplay() {}
     664
     665  Bool m_noDisplay;
     666};
     667
     668
     669class SEITimeCode : public SEI
     670{
     671public:
     672  PayloadType payloadType() const { return TIME_CODE; }
     673  SEITimeCode() {}
     674  virtual ~SEITimeCode(){}
     675
     676  UInt numClockTs;
     677  TComSEITimeSet timeSetArray[MAX_TIMECODE_SEI_SETS];
     678};
     679
     680
     681class SEIMasteringDisplayColourVolume : public SEI
     682{
     683public:
     684    PayloadType payloadType() const { return MASTERING_DISPLAY_COLOUR_VOLUME; }
     685    SEIMasteringDisplayColourVolume() {}
     686    virtual ~SEIMasteringDisplayColourVolume(){}
     687
     688    TComSEIMasteringDisplay values;
     689};
     690
     691
     692class SEISegmentedRectFramePacking : public SEI
     693{
     694public:
     695  PayloadType payloadType() const { return SEGM_RECT_FRAME_PACKING; }
     696
     697  SEISegmentedRectFramePacking() {}
     698  virtual ~SEISegmentedRectFramePacking() {}
     699
     700  Bool m_arrangementCancelFlag;
     701  Int  m_contentInterpretationType;
     702  Bool m_arrangementPersistenceFlag;
     703};
     704
     705
     706//definition according to P1005_v1;
     707class SEITempMotionConstrainedTileSets: public SEI
     708{
     709  class TileSetData
     710  {
     711    protected:
     712      std::vector<Int> m_top_left_tile_index;  //[tileSetIdx][tileIdx];
     713      std::vector<Int> m_bottom_right_tile_index;
     714
     715    public:
     716      Int     m_mcts_id;
     717      Bool    m_display_tile_set_flag;
     718      Int     m_num_tile_rects_in_set; //_minus1;
     719      Bool    m_exact_sample_value_match_flag;
     720      Bool    m_mcts_tier_level_idc_present_flag;
     721      Bool    m_mcts_tier_flag;
     722      Int     m_mcts_level_idc;
     723
     724      Void setNumberOfTileRects(const Int number)
     725      {
     726        m_top_left_tile_index    .resize(number);
     727        m_bottom_right_tile_index.resize(number);
     728      }
     729
     730      Int  getNumberOfTileRects() const
     731      {
     732        assert(m_top_left_tile_index.size() == m_bottom_right_tile_index.size());
     733        return Int(m_top_left_tile_index.size());
     734      }
     735
     736            Int &topLeftTileIndex    (const Int tileRectIndex)       { return m_top_left_tile_index    [tileRectIndex]; }
     737            Int &bottomRightTileIndex(const Int tileRectIndex)       { return m_bottom_right_tile_index[tileRectIndex]; }
     738      const Int &topLeftTileIndex    (const Int tileRectIndex) const { return m_top_left_tile_index    [tileRectIndex]; }
     739      const Int &bottomRightTileIndex(const Int tileRectIndex) const { return m_bottom_right_tile_index[tileRectIndex]; }
     740  };
     741
     742protected:
     743  std::vector<TileSetData> m_tile_set_data;
     744
     745public:
     746
     747  Bool    m_mc_all_tiles_exact_sample_value_match_flag;
     748  Bool    m_each_tile_one_tile_set_flag;
     749  Bool    m_limited_tile_set_display_flag;
     750  Bool    m_max_mcs_tier_level_idc_present_flag;
     751  Bool    m_max_mcts_tier_flag;
     752  Int     m_max_mcts_level_idc;
     753
     754  PayloadType payloadType() const { return TEMP_MOTION_CONSTRAINED_TILE_SETS; }
     755  SEITempMotionConstrainedTileSets() { }
     756  virtual ~SEITempMotionConstrainedTileSets() { }
     757
     758  Void setNumberOfTileSets(const Int number)       { m_tile_set_data.resize(number);     }
     759  Int  getNumberOfTileSets()                 const { return Int(m_tile_set_data.size()); }
     760
     761        TileSetData &tileSetData (const Int index)       { return m_tile_set_data[index]; }
     762  const TileSetData &tileSetData (const Int index) const { return m_tile_set_data[index]; }
     763
     764};
     765
     766
     767class SEIChromaResamplingFilterHint : public SEI
     768{
     769public:
     770  PayloadType payloadType() const {return CHROMA_RESAMPLING_FILTER_HINT;}
     771  SEIChromaResamplingFilterHint() {}
     772  virtual ~SEIChromaResamplingFilterHint() {}
     773
     774  Int                            m_verChromaFilterIdc;
     775  Int                            m_horChromaFilterIdc;
     776  Bool                           m_verFilteringFieldProcessingFlag;
     777  Int                            m_targetFormatIdc;
     778  Bool                           m_perfectReconstructionFlag;
     779  std::vector<std::vector<Int> > m_verFilterCoeff;
     780  std::vector<std::vector<Int> > m_horFilterCoeff;
     781};
     782
     783
    467784class SEIKneeFunctionInfo : public SEI
    468785{
     
    484801};
    485802
     803
    486804class SEIColourRemappingInfo : public SEI
    487805{
     
    503821
    504822  Void copyFrom( const SEIColourRemappingInfo &seiCriInput)
    505       {
     823  {
    506824    (*this) = seiCriInput;
    507825  }
     
    526844};
    527845
    528 class SEIChromaResamplingFilterHint : public SEI
    529 {
    530 public:
    531   PayloadType payloadType() const {return CHROMA_RESAMPLING_FILTER_HINT;}
    532   SEIChromaResamplingFilterHint() {}
    533   virtual ~SEIChromaResamplingFilterHint() {}
    534 
    535   Int   m_verChromaFilterIdc;
    536   Int   m_horChromaFilterIdc;
    537   Bool                           m_verFilteringFieldProcessingFlag;
    538   Int   m_targetFormatIdc;
    539   Bool  m_perfectReconstructionFlag;
    540   std::vector<std::vector<Int> > m_verFilterCoeff;
    541   std::vector<std::vector<Int> > m_horFilterCoeff;
    542 };
    543 
    544 class SEIMasteringDisplayColourVolume : public SEI
    545 {
    546 public:
    547     PayloadType payloadType() const { return MASTERING_DISPLAY_COLOUR_VOLUME; }
    548     SEIMasteringDisplayColourVolume() {}
    549     virtual ~SEIMasteringDisplayColourVolume(){}
    550 
    551     TComSEIMasteringDisplay values;
    552 };
    553 
    554 typedef std::list<SEI*> SEIMessages;
    555 
    556 /// output a selection of SEI messages by payload type. Ownership stays in original message list.
    557 SEIMessages getSeisByType(SEIMessages &seiList, SEI::PayloadType seiType);
    558 
    559 /// remove a selection of SEI messages by payload type from the original list and return them in a new list.
    560 SEIMessages extractSeisByType(SEIMessages &seiList, SEI::PayloadType seiType);
    561 
    562 /// delete list of SEI messages (freeing the referenced objects)
    563 Void deleteSEIs (SEIMessages &seiList);
    564 
    565 class SEIScalableNesting : public SEI
    566 {
    567 public:
    568   PayloadType payloadType() const { return SCALABLE_NESTING; }
    569 
    570   SEIScalableNesting() {}
    571 
    572   virtual ~SEIScalableNesting()
    573   {
    574     deleteSEIs(m_nestedSEIs);
    575   }
    576 
    577   Bool  m_bitStreamSubsetFlag;
    578   Bool  m_nestingOpFlag;
    579   Bool  m_defaultOpFlag;                             //value valid if m_nestingOpFlag != 0
    580   UInt  m_nestingNumOpsMinus1;                       // -"-
    581   UInt  m_nestingMaxTemporalIdPlus1[MAX_TLAYER];     // -"-
    582   UInt  m_nestingOpIdx[MAX_NESTING_NUM_OPS];         // -"-
    583 
    584   Bool  m_allLayersFlag;                             //value valid if m_nestingOpFlag == 0
    585   UInt  m_nestingNoOpMaxTemporalIdPlus1;             //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0
    586   UInt  m_nestingNumLayersMinus1;                    //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0
    587   UChar m_nestingLayerId[MAX_NESTING_NUM_LAYER];     //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0. This can e.g. be a static array of 64 UChar values
    588 
    589   SEIMessages m_nestedSEIs;
    590 };
    591 
    592 class SEITimeCode : public SEI
    593 {
    594 public:
    595   PayloadType payloadType() const { return TIME_CODE; }
    596   SEITimeCode() {}
    597   virtual ~SEITimeCode(){}
    598 
    599   UInt numClockTs;
    600   TComSEITimeSet timeSetArray[MAX_TIMECODE_SEI_SETS];
    601 };
    602 
    603 //definition according to P1005_v1;
    604 class SEITempMotionConstrainedTileSets: public SEI
    605 {
    606   struct TileSetData
    607   {
    608     protected:
    609       std::vector<Int> m_top_left_tile_index;  //[tileSetIdx][tileIdx];
    610       std::vector<Int> m_bottom_right_tile_index;
    611 
    612     public:
    613       Int     m_mcts_id;
    614       Bool    m_display_tile_set_flag;
    615       Int     m_num_tile_rects_in_set; //_minus1;
    616       Bool    m_exact_sample_value_match_flag;
    617       Bool    m_mcts_tier_level_idc_present_flag;
    618       Bool    m_mcts_tier_flag;
    619       Int     m_mcts_level_idc;
    620 
    621       Void setNumberOfTileRects(const Int number)
    622       {
    623         m_top_left_tile_index    .resize(number);
    624         m_bottom_right_tile_index.resize(number);
    625       }
    626 
    627       Int  getNumberOfTileRects() const
    628       {
    629         assert(m_top_left_tile_index.size() == m_bottom_right_tile_index.size());
    630         return Int(m_top_left_tile_index.size());
    631       }
    632 
    633             Int &topLeftTileIndex    (const Int tileRectIndex)       { return m_top_left_tile_index    [tileRectIndex]; }
    634             Int &bottomRightTileIndex(const Int tileRectIndex)       { return m_bottom_right_tile_index[tileRectIndex]; }
    635       const Int &topLeftTileIndex    (const Int tileRectIndex) const { return m_top_left_tile_index    [tileRectIndex]; }
    636       const Int &bottomRightTileIndex(const Int tileRectIndex) const { return m_bottom_right_tile_index[tileRectIndex]; }
    637   };
    638 
    639 protected:
    640   std::vector<TileSetData> m_tile_set_data;
    641 
    642 public:
    643 
    644   Bool    m_mc_all_tiles_exact_sample_value_match_flag;
    645   Bool    m_each_tile_one_tile_set_flag;
    646   Bool    m_limited_tile_set_display_flag;
    647   Bool    m_max_mcs_tier_level_idc_present_flag;
    648   Bool    m_max_mcts_tier_flag;
    649   Int     m_max_mcts_level_idc;
    650 
    651   PayloadType payloadType() const { return TEMP_MOTION_CONSTRAINED_TILE_SETS; }
    652 
    653   Void setNumberOfTileSets(const Int number)       { m_tile_set_data.resize(number);     }
    654   Int  getNumberOfTileSets()                 const { return Int(m_tile_set_data.size()); }
    655 
    656         TileSetData &tileSetData (const Int index)       { return m_tile_set_data[index]; }
    657   const TileSetData &tileSetData (const Int index) const { return m_tile_set_data[index]; }
    658 
    659 };
    660 
    661 #if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
     846
     847class SEIDeinterlaceFieldIdentification : public SEI
     848{
     849public:
     850    PayloadType payloadType() const { return  DEINTERLACE_FIELD_IDENTIFICATION; }
     851    SEIDeinterlaceFieldIdentification() { }
     852
     853    virtual ~SEIDeinterlaceFieldIdentification() {}
     854
     855    Bool m_deinterlacedPictureSourceParityFlag;
     856};
     857
     858
     859class SEIContentLightLevelInfo : public SEI
     860{
     861public:
     862    PayloadType payloadType() const { return CONTENT_LIGHT_LEVEL_INFO; }
     863    SEIContentLightLevelInfo() { }
     864
     865    virtual ~SEIContentLightLevelInfo() { }
     866
     867    UInt m_maxContentLightLevel;
     868    UInt m_maxPicAverageLightLevel;
     869};
     870
     871
     872class SEIDependentRAPIndication : public SEI
     873{
     874public:
     875  PayloadType payloadType() const { return DEPENDENT_RAP_INDICATION; }
     876  SEIDependentRAPIndication() { }
     877
     878  virtual ~SEIDependentRAPIndication() { }
     879};
     880
     881
     882class SEICodedRegionCompletion : public SEI
     883{
     884public:
     885  PayloadType payloadType() const { return CODED_REGION_COMPLETION; }
     886  SEICodedRegionCompletion() { }
     887
     888  virtual ~SEICodedRegionCompletion() { }
     889
     890  UInt m_nextSegmentAddress;
     891  Bool m_independentSliceSegmentFlag;
     892};
     893
     894
    662895class SEIAlternativeTransferCharacteristics : public SEI
    663896{
     
    672905  UInt m_preferredTransferCharacteristics;
    673906};
    674 #endif
     907
     908
     909class SEIAmbientViewingEnvironment : public SEI
     910{
     911public:
     912  PayloadType payloadType() const { return AMBIENT_VIEWING_ENVIRONMENT; }
     913  SEIAmbientViewingEnvironment() { }
     914
     915  virtual ~SEIAmbientViewingEnvironment() { }
     916
     917  UInt m_ambientIlluminance;
     918  UShort m_ambientLightX;
     919  UShort m_ambientLightY;
     920};
    675921
    676922
  • trunk/source/Lib/TLibCommon/TComBitCounter.h

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComBitStream.cpp

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComBitStream.h

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComCABACTables.cpp

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComCABACTables.h

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComChromaFormat.cpp

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComChromaFormat.h

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComCodingStatistics.h

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    8181  STATS__CABAC_BITS__ESCAPE_BITS,
    8282
    83 #if NH_3D_DBBP
     83#if NH_3D
    8484  STATS__CABAC_BITS__DBBP_FLAG,
    85 #endif
    86 #if NH_3D_ARP
    8785  STATS__CABAC_BITS__ARP_FLAG,
    8886#endif
     
    9997  STATS__CABAC_BITS__ALIGNED_ESCAPE_BITS,
    10098
    101 #if NH_3D_IC
     99#if NH_3D
    102100  STATS__CABAC_BITS__3D_IC,
    103 #endif
    104 #if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER
    105101  STATS__CABAC_BITS__DELTADC_SIGN_EP,
    106102  STATS__CABAC_BITS__DELTADC_PREFIX,
    107103  STATS__CABAC_BITS__DELTADC_SUFFIX_EP,
    108 #endif
    109 #if NH_3D_DMM
    110104  STATS__CABAC_BITS__NOTDMM_FLAG,
    111105  STATS__CABAC_BITS__DMMMODE,
    112106  STATS__CABAC_BITS__DMM1_BITS_EP,
    113 #endif
    114 #if NH_3D_SDC_INTRA
    115107  STATS__CABAC_BITS__SDC_INTRA_FLAG,
    116108  STATS__CABAC_BITS__SDC_DELTADC_FLAG,
     
    156148    "CABAC_BITS__SIGN_BIT",
    157149    "CABAC_BITS__ESCAPE_BITS",
    158 #if NH_3D_DBBP
     150#if NH_3D
    159151    "CABAC_BITS__DBBP_FLAG",
    160152#endif
     
    171163    "CABAC_BITS__ALIGNED_ESCAPE_BITS"
    172164
    173 #if NH_3D_IC
     165#if NH_3D
    174166    "CABAC_BITS__3D_IC"
    175 #endif
    176 #if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER
    177167   ,"STATS__CABAC_BITS__DELTADC_SIGN_EP"
    178168   ,"STATS__CABAC_BITS__DELTADC_PREFIX"
    179169   ,"STATS__CABAC_BITS__DELTADC_SUFFIX_EP"
    180 #endif
    181 #if NH_3D_DMM
    182170   ,"STATS__CABAC_BITS__NOTDMM_FLAG"
    183171   ,"STATS__CABAC_BITS__DMMMODE"
    184172   ,"STATS__CABAC_BITS__DMM1_BITS_EP"
    185 #endif
    186 #if NH_3D_SDC_INTRA
    187173    ,"STATS__CABAC_BITS__SDC_INTRA_FLAG"
    188174    ,"STATS__CABAC_BITS__SDC_DELTADC_FLAG"
  • trunk/source/Lib/TLibCommon/TComDataCU.cpp

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    5555
    5656  m_skipFlag           = NULL;
    57 #if NH_3D_DIS
     57#if NH_3D
    5858  m_bDISFlag           = NULL;
    5959  m_ucDISType          = NULL;
     
    9999  for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++)
    100100  {
    101     m_apcCUColocated[i]  = NULL;
    102101    m_apiMVPIdx[i]       = NULL;
    103102    m_apiMVPNum[i]       = NULL;
    104103  }
    105104
    106 #if NH_3D_DMM
     105#if NH_3D
    107106  for( Int i = 0; i < NUM_DMM; i++ )
    108107  {
     
    111110  }
    112111  m_dmm1WedgeTabIdx = NULL;
    113 #endif
    114 #if NH_3D_SDC_INTRA
     112
    115113  m_pbSDCFlag             = NULL;
    116114  m_apSegmentDCOffset[0]  = NULL;
     
    120118  m_bDecSubCu          = false;
    121119
    122 #if NH_3D_NBDV
     120#if NH_3D
    123121  m_pDvInfo              = NULL;
    124 #endif
    125 #if NH_3D_VSP
    126122  m_piVSPFlag            = NULL;
    127 #endif
    128 #if NH_3D_SPIVMP
    129123  m_pbSPIVMPFlag         = NULL;
    130 #endif
    131 #if NH_3D_ARP
    132124  m_puhARPW              = NULL;
    133 #endif
    134 #if NH_3D_IC
    135125  m_pbICFlag             = NULL;
    136 #endif
    137 #if NH_3D_DBBP
    138126  m_pbDBBPFlag         = NULL;
    139127#endif
     
    167155    m_ChromaQpAdj        = new UChar[ uiNumPartition ];
    168156    m_skipFlag           = new Bool[ uiNumPartition ];
    169 #if NH_3D_DIS
     157#if NH_3D
    170158    m_bDISFlag           = new Bool[ uiNumPartition ];
    171159    m_ucDISType          = (UChar*)xMalloc(UChar, uiNumPartition);
     
    178166    m_pbMergeFlag        = (Bool*  )xMalloc(Bool,   uiNumPartition);
    179167    m_puhMergeIndex      = (UChar* )xMalloc(UChar,  uiNumPartition);
    180 #if NH_3D_VSP
     168#if NH_3D
    181169    m_piVSPFlag          = (SChar* )xMalloc(SChar, uiNumPartition);
    182 #endif
    183 #if NH_3D_SPIVMP
    184170    m_pbSPIVMPFlag       = (Bool*  )xMalloc(Bool,   uiNumPartition);
    185171#endif
     
    201187    }
    202188
    203 #if NH_3D_NBDV
     189#if NH_3D
    204190    m_pDvInfo            = (DisInfo* )xMalloc(DisInfo,  uiNumPartition);
    205191#endif
     
    242228    }
    243229
    244 #if NH_3D_ARP
     230#if NH_3D
    245231    m_puhARPW            = (UChar*  )xMalloc(UChar,   uiNumPartition);
    246 #endif
    247 #if NH_3D_IC
    248232    m_pbICFlag           = (Bool* )xMalloc(Bool,   uiNumPartition);
    249 #endif
    250 #if NH_3D_DMM
    251233    for( Int i = 0; i < NUM_DMM; i++ )
    252234    {
     
    255237    }
    256238    m_dmm1WedgeTabIdx    = (UInt*)xMalloc(UInt, uiNumPartition);
    257 #endif
    258 #if NH_3D_SDC_INTRA
    259239    m_pbSDCFlag             = (Bool*)xMalloc(Bool, uiNumPartition);
    260240    m_apSegmentDCOffset[0]  = (Pel*)xMalloc(Pel, uiNumPartition);
    261241    m_apSegmentDCOffset[1]  = (Pel*)xMalloc(Pel, uiNumPartition);
    262 #endif
    263 #if NH_3D_DBBP
    264242    m_pbDBBPFlag         = (Bool*  )xMalloc(Bool,   uiNumPartition);
    265243#endif
     
    280258  m_pCtuAbove          = NULL;
    281259  m_pCtuLeft           = NULL;
    282 
    283   for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++)
    284   {
    285     m_apcCUColocated[i]  = NULL;
    286   }
    287260}
    288261
     
    319292    }
    320293
    321 #if NH_3D_DIS
     294#if NH_3D
    322295    if ( m_bDISFlag           ) { delete[] m_bDISFlag;   m_bDISFlag     = NULL; }
    323296    if ( m_ucDISType         ) { xFree(m_ucDISType);  m_ucDISType    = NULL; }
     
    360333    }
    361334
    362 #if NH_3D_VSP
     335#if NH_3D
    363336    if ( m_piVSPFlag )
    364337    {
     
    366339      m_piVSPFlag = NULL;
    367340    }
    368 #endif
    369 #if NH_3D_SPIVMP
    370341    if ( m_pbSPIVMPFlag       ) { xFree(m_pbSPIVMPFlag);           m_pbSPIVMPFlag         = NULL; }
    371342#endif
     
    455426      m_acCUMvField[rpl].destroy();
    456427    }
    457 #if NH_3D_NBDV
     428#if NH_3D
    458429    if ( m_pDvInfo            ) { xFree(m_pDvInfo);             m_pDvInfo           = NULL; }
    459 #endif
    460 
    461 
    462 #if NH_3D_ARP
    463430    if ( m_puhARPW            ) { xFree(m_puhARPW);             m_puhARPW           = NULL; }
    464 #endif
    465 #if NH_3D_IC
    466431    if ( m_pbICFlag           ) { xFree(m_pbICFlag);            m_pbICFlag          = NULL; }
    467 #endif
    468 
    469 #if NH_3D_DMM
    470432    for( Int i = 0; i < NUM_DMM; i++ )
    471433    {
     
    474436    }
    475437    if ( m_dmm1WedgeTabIdx    ) { xFree( m_dmm1WedgeTabIdx );  m_dmm1WedgeTabIdx = NULL;  }
    476 #endif
    477 #if NH_3D_SDC_INTRA
    478438    if ( m_pbSDCFlag            ) { xFree(m_pbSDCFlag);             m_pbSDCFlag             = NULL; }
    479439    if ( m_apSegmentDCOffset[0] ) { xFree(m_apSegmentDCOffset[0]);  m_apSegmentDCOffset[0]  = NULL; }
    480440    if ( m_apSegmentDCOffset[1] ) { xFree(m_apSegmentDCOffset[1]);  m_apSegmentDCOffset[1]  = NULL; }
    481 #endif   
    482 #if NH_3D_DBBP
    483     if ( m_pbDBBPFlag         ) { xFree(m_pbDBBPFlag);          m_pbDBBPFlag        = NULL; }
     441    if ( m_pbDBBPFlag           ) { xFree(m_pbDBBPFlag);          m_pbDBBPFlag        = NULL; }
    484442#endif
    485443
     
    493451  m_pCtuAbove          = NULL;
    494452  m_pCtuLeft           = NULL;
    495 
    496 
    497   for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++)
    498   {
    499     m_apcCUColocated[i]  = NULL;
    500   }
    501453
    502454}
     
    572524  memset( m_skipFlag          , false,                      m_uiNumPartition * sizeof( *m_skipFlag ) );
    573525
    574 #if NH_3D_DIS
     526#if NH_3D
    575527    memset( m_bDISFlag        , false,                      m_uiNumPartition * sizeof( *m_bDISFlag ) );
    576528    memset( m_ucDISType       , false,                      m_uiNumPartition * sizeof( *m_ucDISType ) );
     
    585537  memset( m_puhHeight         , maxCUHeight,                m_uiNumPartition * sizeof( *m_puhHeight ) );
    586538
    587 #if NH_3D_IC
     539#if NH_3D
    588540  memset( m_pbICFlag          , false,                      m_uiNumPartition * sizeof( *m_pbICFlag ) );
    589541#endif
     
    606558  memset( m_puhMergeIndex     , 0,                        m_uiNumPartition * sizeof( *m_puhMergeIndex ) );
    607559
    608 #if NH_3D_VSP
     560#if NH_3D
    609561  memset( m_piVSPFlag         , 0,                        m_uiNumPartition * sizeof( *m_piVSPFlag ) );
    610 #endif
    611 #if NH_3D_SPIVMP
    612562  memset( m_pbSPIVMPFlag      , 0,                     m_uiNumPartition * sizeof( *m_pbSPIVMPFlag ) );   
    613 #endif
    614 #if NH_3D_SDC_INTRA
    615563  memset( m_pbSDCFlag, false, m_uiNumPartition * sizeof( *m_pbSDCFlag ) );
    616 #endif
    617 #if NH_3D_DBBP
    618564  memset( m_pbDBBPFlag , false, m_uiNumPartition * sizeof( *m_pbDBBPFlag ));
    619565#endif
     
    624570  }
    625571
    626 #if NH_3D_ARP
     572#if NH_3D
    627573  memset( m_puhARPW      ,      0,        m_uiNumPartition * sizeof( *m_puhARPW )         );
    628 #endif
    629 
    630 
    631 #if NH_3D_DMM
    632574  for( Int i = 0; i < NUM_DMM; i++ )
    633575  {
     
    635577    memset( m_dmmDeltaDC[i][1], 0,                        m_uiNumPartition * sizeof( *m_dmmDeltaDC[i][1] ) );
    636578  }
    637   memset( m_dmm1WedgeTabIdx,    0,                        m_uiNumPartition * sizeof( *m_dmm1WedgeTabIdx   ) );
    638 #endif
    639 #if NH_3D_SDC_INTRA
    640     memset( m_pbSDCFlag,     false,                m_uiNumPartition * sizeof( *m_pbSDCFlag ) );
     579    memset( m_dmm1WedgeTabIdx,    0,                        m_uiNumPartition * sizeof( *m_dmm1WedgeTabIdx   ) );
     580    memset( m_pbSDCFlag      ,     false,                m_uiNumPartition * sizeof( *m_pbSDCFlag ) );
    641581    memset( m_apSegmentDCOffset[0],     0,                m_uiNumPartition * sizeof( *m_apSegmentDCOffset[0] ) );
    642582    memset( m_apSegmentDCOffset[1],     0,                m_uiNumPartition * sizeof( *m_apSegmentDCOffset[1] ) );
     
    667607  m_pCtuAboveRight  = NULL;
    668608
    669 
    670   for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++)
    671   {
    672     m_apcCUColocated[i]  = NULL;
    673   }
    674 
    675609  UInt frameWidthInCtus = pcPic->getFrameWidthInCtus();
    676610  if ( m_ctuRsAddr % frameWidthInCtus )
     
    692626  {
    693627    m_pCtuAboveRight = pcPic->getCtu( m_ctuRsAddr - frameWidthInCtus + 1 );
    694   }
    695 
    696   for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++)
    697   {
    698     const RefPicList rpl=RefPicList(i);
    699     if ( getSlice()->getNumRefIdx( rpl ) > 0 )
    700     {
    701       m_apcCUColocated[rpl] = getSlice()->getRefPic( rpl, 0)->getCtu( m_ctuRsAddr );
    702     }
    703628  }
    704629}
     
    743668    }
    744669    m_skipFlag[ui]      = false;
    745 #if NH_3D_DIS
     670#if NH_3D
    746671    m_bDISFlag[ui]      = false;
    747672    m_ucDISType[ui]     = 0;
     
    755680    m_pbMergeFlag[ui]   = 0;
    756681    m_puhMergeIndex[ui] = 0;
    757 #if NH_3D_VSP
     682#if NH_3D
    758683    m_piVSPFlag[ui]     = 0;
    759 #endif
    760 #if NH_3D_SPIVMP
    761684    m_pbSPIVMPFlag[ui] = 0;
    762685#endif
     
    772695      m_puhCbf[comp][ui] = 0;
    773696    }
    774 #if NH_3D_ARP
    775       m_puhARPW[ui] = 0;
    776 #endif
    777 #if NH_3D_IC
    778       m_pbICFlag[ui]  = false;
    779 #endif
    780 
    781 
    782 #if NH_3D_DMM
     697#if NH_3D
     698    m_puhARPW[ui] = 0;
     699    m_pbICFlag[ui]  = false;
    783700    for( Int i = 0; i < NUM_DMM; i++ )
    784701    {
    785       m_dmmDeltaDC[i][0] [ui] = 0;
    786       m_dmmDeltaDC[i][1] [ui] = 0;
    787     }
    788     m_dmm1WedgeTabIdx    [ui] = 0;
    789 #endif
    790 #if NH_3D_SDC_INTRA
    791       m_pbSDCFlag           [ui] = false;
    792       m_apSegmentDCOffset[0][ui] = 0;
    793       m_apSegmentDCOffset[1][ui] = 0;
    794 #endif
    795 #if NH_3D_DBBP
    796       m_pbDBBPFlag[ui] = false;
     702      m_dmmDeltaDC[i][0]  [ui] = 0;
     703      m_dmmDeltaDC[i][1]  [ui] = 0;
     704    }
     705    m_dmm1WedgeTabIdx     [ui] = 0;
     706    m_pbSDCFlag           [ui] = false;
     707    m_apSegmentDCOffset[0][ui] = 0;
     708    m_apSegmentDCOffset[1][ui] = 0;
     709    m_pbDBBPFlag          [ui] = false;
    797710#endif
    798711  }
     
    849762  memset( m_pbMergeFlag,        0, iSizeInBool  );
    850763  memset( m_puhMergeIndex,      0, iSizeInUchar );
    851 #if NH_3D_VSP
     764#if NH_3D
    852765  memset( m_piVSPFlag,          0, sizeof( SChar ) * m_uiNumPartition );
    853 #endif
    854 #if NH_3D_SPIVMP
    855766  memset( m_pbSPIVMPFlag,       0, sizeof( Bool  ) * m_uiNumPartition );
    856767#endif
     
    876787  memset( m_puhHeight,         uhHeight, iSizeInUchar );
    877788  memset( m_pbIPCMFlag,        0, iSizeInBool  );
    878 #if NH_3D_ARP
     789#if NH_3D
    879790  memset( m_puhARPW,           0, iSizeInUchar  );
    880 #endif
    881 #if NH_3D_IC
    882791  memset( m_pbICFlag,          0, iSizeInBool  );
    883 #endif
    884 #if NH_3D_DMM
    885792  for( Int i = 0; i < NUM_DMM; i++ )
    886793  {
     
    889796  }
    890797  memset( m_dmm1WedgeTabIdx,    0, sizeof(UInt) * m_uiNumPartition );
    891 #endif
    892 #if NH_3D_SDC_INTRA
    893798  memset( m_pbSDCFlag,            0, sizeof(Bool) * m_uiNumPartition  );
    894799  memset( m_apSegmentDCOffset[0], 0, sizeof(Pel) * m_uiNumPartition   );
    895800  memset( m_apSegmentDCOffset[1], 0, sizeof(Pel) * m_uiNumPartition   );
    896 #endif
    897 #if NH_3D_DBBP
    898801  memset( m_pbDBBPFlag,         0, sizeof(Bool) * m_uiNumPartition  );
    899802#endif
     
    902805  {
    903806    m_skipFlag[ui]   = false;
    904 #if NH_3D_DIS
     807#if NH_3D
    905808    m_bDISFlag[ui]   = false;
    906809    m_ucDISType[ui]  = 0;
     
    918821      m_apiMVPNum[rpl][ui] = -1;
    919822    }
    920 #if NH_3D_DIS
    921       m_bDISFlag[ui]    = pcCU->getDISFlag(uiPartOffset+ui);
    922       m_ucDISType[ui]   = pcCU->getDISType(uiPartOffset+ui);
    923 #endif
    924 #if NH_3D_VSP
    925     m_piVSPFlag[ui] = pcCU->m_piVSPFlag[uiPartOffset+ui];
    926     m_pDvInfo[ ui ] = pcCU->m_pDvInfo[uiPartOffset+ui];
    927 #endif
    928 #if NH_3D_SPIVMP
    929     m_pbSPIVMPFlag[ui]=pcCU->m_pbSPIVMPFlag[uiPartOffset+ui];
    930 #endif
    931 #if NH_3D_ARP
    932       m_puhARPW           [ui] = pcCU->getARPW( uiPartOffset+ui );
    933 #endif
    934 #if NH_3D_IC
    935       m_pbICFlag          [ui] = pcCU->m_pbICFlag[uiPartOffset+ui];
    936 #endif
    937 #if NH_3D_DMM
    938   for( Int i = 0; i < NUM_DMM; i++ )
    939   {
    940     m_dmmDeltaDC[i][0] [ui] = pcCU->m_dmmDeltaDC[i][0] [uiPartOffset+ui];
    941     m_dmmDeltaDC[i][1] [ui] = pcCU->m_dmmDeltaDC[i][1] [uiPartOffset+ui];
    942   }
    943   m_dmm1WedgeTabIdx    [ui] = pcCU->m_dmm1WedgeTabIdx  [uiPartOffset+ui];
    944 #endif
    945 #if NH_3D_SDC_INTRA
     823#if NH_3D
     824    m_bDISFlag    [ui] = pcCU->getDISFlag(uiPartOffset+ui);
     825    m_ucDISType   [ui] = pcCU->getDISType(uiPartOffset+ui);
     826    m_piVSPFlag   [ui] = pcCU->m_piVSPFlag[uiPartOffset+ui];
     827    m_pDvInfo     [ui] = pcCU->m_pDvInfo[uiPartOffset+ui];
     828    m_pbSPIVMPFlag[ui] = pcCU->m_pbSPIVMPFlag[uiPartOffset+ui];
     829    m_puhARPW     [ui] = pcCU->getARPW( uiPartOffset+ui );
     830    m_pbICFlag    [ui] = pcCU->m_pbICFlag[uiPartOffset+ui];
     831    for( Int i = 0; i < NUM_DMM; i++ )
     832    {
     833      m_dmmDeltaDC[i][0] [ui] = pcCU->m_dmmDeltaDC[i][0] [uiPartOffset+ui];
     834      m_dmmDeltaDC[i][1] [ui] = pcCU->m_dmmDeltaDC[i][1] [uiPartOffset+ui];
     835    }
     836    m_dmm1WedgeTabIdx    [ui] = pcCU->m_dmm1WedgeTabIdx  [uiPartOffset+ui];
    946837    m_pbSDCFlag           [ui] = pcCU->m_pbSDCFlag            [ uiPartOffset + ui ];
    947838    m_apSegmentDCOffset[0][ui] = pcCU->m_apSegmentDCOffset[0] [ uiPartOffset + ui ];
    948839    m_apSegmentDCOffset[1][ui] = pcCU->m_apSegmentDCOffset[1] [ uiPartOffset + ui ];
    949 #endif
    950 #if NH_3D_DBBP
    951       m_pbDBBPFlag[ui]=pcCU->m_pbDBBPFlag[uiPartOffset+ui];
     840    m_pbDBBPFlag[ui]=pcCU->m_pbDBBPFlag[uiPartOffset+ui];
    952841#endif
    953842  }
     
    973862  m_pCtuAboveLeft   = pcCU->getCtuAboveLeft();
    974863  m_pCtuAboveRight  = pcCU->getCtuAboveRight();
    975 
    976   for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++)
    977   {
    978     m_apcCUColocated[i] = pcCU->getCUColocated(RefPicList(i));
    979   }
    980864}
    981865
     
    1009893
    1010894  m_skipFlag=pcCU->getSkipFlag()          + uiPart;
    1011 #if NH_3D_DIS
     895#if NH_3D
    1012896  m_bDISFlag     = pcCU->getDISFlag()     + uiPart;
    1013897  m_ucDISType    = pcCU->getDISType()     + uiPart;
     
    1019903  m_pePredMode=pcCU->getPredictionMode()  + uiPart;
    1020904  m_CUTransquantBypass  = pcCU->getCUTransquantBypass()+uiPart;
    1021 #if NH_3D_NBDV
     905#if NH_3D
    1022906  m_pDvInfo             = pcCU->getDvInfo()           + uiPart;
    1023907#endif
    1024 
    1025908  m_pbMergeFlag         = pcCU->getMergeFlag()        + uiPart;
    1026909  m_puhMergeIndex       = pcCU->getMergeIndex()       + uiPart;
    1027 #if NH_3D_VSP
     910#if NH_3D
    1028911  m_piVSPFlag           = pcCU->getVSPFlag()          + uiPart;
    1029 #endif
    1030 #if NH_3D_SPIVMP
    1031   m_pbSPIVMPFlag        = pcCU->getSPIVMPFlag()          + uiPart;
    1032 #endif
    1033 #if NH_3D_ARP
     912  m_pbSPIVMPFlag        = pcCU->getSPIVMPFlag()       + uiPart;
    1034913  m_puhARPW             = pcCU->getARPW()             + uiPart;
    1035 #endif
    1036 #if NH_3D_IC
    1037914  m_pbICFlag            = pcCU->getICFlag()           + uiPart;
    1038915#endif
     
    1053930    m_explicitRdpcmMode[comp]             = pcCU->getExplicitRdpcmMode(ComponentID(comp))             + uiPart;
    1054931  }
    1055 #if NH_3D_DMM
     932#if NH_3D
    1056933  for( Int i = 0; i < NUM_DMM; i++ )
    1057934  {
     
    1060937  }
    1061938  m_dmm1WedgeTabIdx    = pcCU->getDmm1WedgeTabIdx()  + uiPart;
    1062 #endif
    1063 #if NH_3D_SDC_INTRA
    1064939  m_pbSDCFlag               = pcCU->getSDCFlag()              + uiPart;
    1065940  m_apSegmentDCOffset[0]    = pcCU->getSDCSegmentDCOffset(0)  + uiPart;
    1066941  m_apSegmentDCOffset[1]    = pcCU->getSDCSegmentDCOffset(1)  + uiPart;
    1067 #endif 
    1068 #if NH_3D_DBBP
    1069942  m_pbDBBPFlag              = pcCU->getDBBPFlag()         + uiPart;
    1070943#endif
     
    1084957  {
    1085958    const RefPicList rpl=RefPicList(i);
    1086     m_apcCUColocated[rpl] = pcCU->getCUColocated(rpl);
    1087959    m_apiMVPIdx[rpl]=pcCU->getMVPIdx(rpl)  + uiPart;
    1088960    m_apiMVPNum[rpl]=pcCU->getMVPNum(rpl)  + uiPart;
     
    1113985}
    1114986
    1115 #if NH_3D_NBDV
     987#if NH_3D
    1116988Void TComDataCU::copyDVInfoFrom (TComDataCU* pcCU, UInt uiAbsPartIdx)
    1117989{
     
    1121993
    1122994// Copy inter prediction info from the biggest CU
    1123 #if NH_3D_NBDV
     995#if NH_3D
    1124996Void TComDataCU::copyInterPredInfoFrom    ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList   , Bool bNBDV )
    1125997#else
     
    11411013  m_pCtuLeft           = pcCU->getCtuLeft();
    11421014
    1143   for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++)
    1144   {
    1145     m_apcCUColocated[i]  = pcCU->getCUColocated(RefPicList(i));
    1146   }
    11471015
    11481016  m_skipFlag           = pcCU->getSkipFlag ()             + uiAbsPartIdx;
    1149 #if NH_3D_DIS
     1017#if NH_3D
    11501018  m_bDISFlag           = pcCU->getDISFlag ()              + uiAbsPartIdx;
    11511019  m_ucDISType          = pcCU->getDISType()               + uiAbsPartIdx;
     
    11531021
    11541022  m_pePartSize         = pcCU->getPartitionSize ()        + uiAbsPartIdx;
    1155 #if NH_3D_NBDV
     1023#if NH_3D
    11561024  if(bNBDV == true)
    11571025  {
     
    11631031  {
    11641032#endif
    1165   m_pePredMode         = pcCU->getPredictionMode()        + uiAbsPartIdx;
    1166   m_ChromaQpAdj        = pcCU->getChromaQpAdj()           + uiAbsPartIdx;
    1167   m_CUTransquantBypass = pcCU->getCUTransquantBypass()    + uiAbsPartIdx;
    1168   m_puhInterDir        = pcCU->getInterDir      ()        + uiAbsPartIdx;
    1169 
    1170   m_puhDepth           = pcCU->getDepth ()                + uiAbsPartIdx;
    1171   m_puhWidth           = pcCU->getWidth ()                + uiAbsPartIdx;
    1172   m_puhHeight          = pcCU->getHeight()                + uiAbsPartIdx;
    1173 
    1174   m_pbMergeFlag        = pcCU->getMergeFlag()             + uiAbsPartIdx;
    1175   m_puhMergeIndex      = pcCU->getMergeIndex()            + uiAbsPartIdx;
    1176 #if NH_3D_VSP
    1177   m_piVSPFlag          = pcCU->getVSPFlag()               + uiAbsPartIdx;
    1178   m_pDvInfo            = pcCU->getDvInfo()                + uiAbsPartIdx;
    1179 #endif
    1180 #if NH_3D_SPIVMP
    1181   m_pbSPIVMPFlag       = pcCU->getSPIVMPFlag()            + uiAbsPartIdx;
    1182 #endif
    1183 
    1184   m_apiMVPIdx[eRefPicList] = pcCU->getMVPIdx(eRefPicList) + uiAbsPartIdx;
    1185   m_apiMVPNum[eRefPicList] = pcCU->getMVPNum(eRefPicList) + uiAbsPartIdx;
    1186 #if NH_3D_ARP
    1187   m_puhARPW            = pcCU->getARPW()                  + uiAbsPartIdx;
    1188 #endif   
    1189 #if NH_3D_DBBP
    1190   m_pbDBBPFlag       = pcCU->getDBBPFlag()              + uiAbsPartIdx;
    1191 #endif
    1192 
    1193   m_acCUMvField[ eRefPicList ].linkToWithOffset( pcCU->getCUMvField(eRefPicList), uiAbsPartIdx );
    1194 #if NH_3D_NBDV
    1195   }
    1196 #endif
    1197 #if NH_3D_IC
     1033    m_pePredMode         = pcCU->getPredictionMode()        + uiAbsPartIdx;
     1034    m_ChromaQpAdj        = pcCU->getChromaQpAdj()           + uiAbsPartIdx;
     1035    m_CUTransquantBypass = pcCU->getCUTransquantBypass()    + uiAbsPartIdx;
     1036    m_puhInterDir        = pcCU->getInterDir      ()        + uiAbsPartIdx;
     1037
     1038    m_puhDepth           = pcCU->getDepth ()                + uiAbsPartIdx;
     1039    m_puhWidth           = pcCU->getWidth ()                + uiAbsPartIdx;
     1040    m_puhHeight          = pcCU->getHeight()                + uiAbsPartIdx;
     1041
     1042    m_pbMergeFlag        = pcCU->getMergeFlag()             + uiAbsPartIdx;
     1043    m_puhMergeIndex      = pcCU->getMergeIndex()            + uiAbsPartIdx;
     1044#if NH_3D
     1045    m_piVSPFlag          = pcCU->getVSPFlag()               + uiAbsPartIdx;
     1046    m_pDvInfo            = pcCU->getDvInfo()                + uiAbsPartIdx;
     1047    m_pbSPIVMPFlag       = pcCU->getSPIVMPFlag()            + uiAbsPartIdx;
     1048#endif
     1049    m_apiMVPIdx[eRefPicList] = pcCU->getMVPIdx(eRefPicList) + uiAbsPartIdx;
     1050    m_apiMVPNum[eRefPicList] = pcCU->getMVPNum(eRefPicList) + uiAbsPartIdx;
     1051#if NH_3D
     1052    m_puhARPW            = pcCU->getARPW()                  + uiAbsPartIdx;
     1053    m_pbDBBPFlag       = pcCU->getDBBPFlag()              + uiAbsPartIdx;
     1054#endif
     1055
     1056    m_acCUMvField[ eRefPicList ].linkToWithOffset( pcCU->getCUMvField(eRefPicList), uiAbsPartIdx );
     1057#if NH_3D
     1058  }
    11981059  m_pbICFlag           = pcCU->getICFlag()                + uiAbsPartIdx;
    11991060#endif
     
    12211082  Int sizeInChar  = sizeof( SChar ) * uiNumPartition;
    12221083  memcpy( m_skipFlag   + uiOffset, pcCU->getSkipFlag(),       sizeof( *m_skipFlag )   * uiNumPartition );
    1223 #if NH_3D_DIS
     1084#if NH_3D
    12241085  memcpy( m_bDISFlag   + uiOffset, pcCU->getDISFlag(),        sizeof( *m_bDISFlag )   * uiNumPartition );
    12251086  memcpy( m_ucDISType  + uiOffset, pcCU->getDISType(),        sizeof( *m_ucDISType )  * uiNumPartition);
     
    12321093  memcpy( m_pbMergeFlag         + uiOffset, pcCU->getMergeFlag(),         iSizeInBool  );
    12331094  memcpy( m_puhMergeIndex       + uiOffset, pcCU->getMergeIndex(),        iSizeInUchar );
    1234 #if NH_3D_VSP
     1095#if NH_3D
    12351096  memcpy( m_piVSPFlag           + uiOffset, pcCU->getVSPFlag(),           sizeof( SChar ) * uiNumPartition );
    12361097  memcpy( m_pDvInfo             + uiOffset, pcCU->getDvInfo(),            sizeof( *m_pDvInfo ) * uiNumPartition );
    1237 #endif
    1238 #if NH_3D_SPIVMP  || NH_3D_DBBP
    12391098  memcpy( m_pbSPIVMPFlag        + uiOffset, pcCU->getSPIVMPFlag(),        sizeof( Bool ) * uiNumPartition );
    12401099#endif
     
    12551114    memcpy( m_explicitRdpcmMode[comp]             + uiOffset, pcCU->getExplicitRdpcmMode(ComponentID(comp))            , iSizeInUchar );
    12561115  }
    1257 #if NH_3D_DMM
     1116#if NH_3D
    12581117  for( Int i = 0; i < NUM_DMM; i++ )
    12591118  {
     
    12621121  }
    12631122  memcpy( m_dmm1WedgeTabIdx    + uiOffset, pcCU->getDmm1WedgeTabIdx(),         sizeof(UInt) * uiNumPartition );
    1264 #endif
    1265 #if NH_3D_SDC_INTRA
    12661123  memcpy( m_pbSDCFlag             + uiOffset, pcCU->getSDCFlag(), sizeof( *m_pbSDCFlag ) * uiNumPartition  );
    12671124  memcpy( m_apSegmentDCOffset[0]  + uiOffset, pcCU->getSDCSegmentDCOffset(0), sizeof( Pel ) * uiNumPartition);
    12681125  memcpy( m_apSegmentDCOffset[1]  + uiOffset, pcCU->getSDCSegmentDCOffset(1), sizeof( Pel ) * uiNumPartition);
    1269 #endif
    1270 #if NH_3D_DBBP
    12711126  memcpy( m_pbDBBPFlag          + uiOffset, pcCU->getDBBPFlag(),          iSizeInBool  );
    1272 #endif
    1273 #if NH_3D_ARP
    12741127  memcpy( m_puhARPW             + uiOffset, pcCU->getARPW(),              iSizeInUchar );
    12751128#endif
     
    12911144    memcpy( m_apiMVPIdx[rpl] + uiOffset, pcCU->getMVPIdx(rpl), iSizeInUchar );
    12921145    memcpy( m_apiMVPNum[rpl] + uiOffset, pcCU->getMVPNum(rpl), iSizeInUchar );
    1293     m_apcCUColocated[rpl] = pcCU->getCUColocated(rpl);
    12941146  }
    12951147
     
    13141166  }
    13151167
    1316 #if NH_3D_IC
     1168#if NH_3D
    13171169  memcpy( m_pbICFlag            + uiOffset, pcCU->getICFlag(),            iSizeInBool );
    13181170#endif
     
    13381190
    13391191  memcpy( pCtu->getSkipFlag() + m_absZIdxInCtu, m_skipFlag, sizeof( *m_skipFlag ) * m_uiNumPartition );
    1340 #if NH_3D_DIS
     1192#if NH_3D
    13411193  memcpy( pCtu->getDISFlag()  + m_absZIdxInCtu, m_bDISFlag, sizeof( *m_bDISFlag )  * m_uiNumPartition );
    13421194  memcpy( pCtu->getDISType()  + m_absZIdxInCtu, m_ucDISType, sizeof( *m_ucDISType ) * m_uiNumPartition );
     
    13441196
    13451197  memcpy( pCtu->getQP() + m_absZIdxInCtu, m_phQP, sizeInChar  );
    1346 #if NH_3D_NBDV
     1198#if NH_3D
    13471199  memcpy( pCtu->getDvInfo() + m_absZIdxInCtu, m_pDvInfo, sizeof(* m_pDvInfo) * m_uiNumPartition );
    13481200#endif
     
    13541206  memcpy( pCtu->getMergeFlag()         + m_absZIdxInCtu, m_pbMergeFlag,         iSizeInBool  );
    13551207  memcpy( pCtu->getMergeIndex()        + m_absZIdxInCtu, m_puhMergeIndex,       iSizeInUchar );
    1356 #if NH_3D_VSP
     1208#if NH_3D
    13571209  memcpy( pCtu->getVSPFlag()           + m_absZIdxInCtu, m_piVSPFlag,           sizeof( SChar ) * m_uiNumPartition );
    1358 #endif
    1359 #if NH_3D_DBBP
    13601210  memcpy( pCtu->getDvInfo()            + m_absZIdxInCtu, m_pDvInfo,             sizeof( *m_pDvInfo ) * m_uiNumPartition );
    1361 #endif
    1362 #if NH_3D_SPIVMP
    13631211  memcpy( pCtu->getSPIVMPFlag()        + m_absZIdxInCtu, m_pbSPIVMPFlag,        sizeof( Bool ) * m_uiNumPartition );
    13641212#endif
    13651213
    1366 for (UInt ch=0; ch<numValidChan; ch++)
     1214  for (UInt ch=0; ch<numValidChan; ch++)
    13671215  {
    13681216    memcpy( pCtu->getIntraDir(ChannelType(ch)) + m_absZIdxInCtu, m_puhIntraDir[ch], iSizeInUchar);
     
    13801228  }
    13811229
    1382 #if NH_3D_DMM
     1230#if NH_3D
    13831231  for( Int i = 0; i < NUM_DMM; i++ )
    13841232  {
     
    13861234    memcpy( pCtu->getDmmDeltaDC( (DmmID)i, 1 ) + m_absZIdxInCtu, m_dmmDeltaDC[i][1], sizeof(Pel ) * m_uiNumPartition );
    13871235  }
     1236
    13881237  memcpy( pCtu->getDmm1WedgeTabIdx()           + m_absZIdxInCtu, m_dmm1WedgeTabIdx,  sizeof(UInt) * m_uiNumPartition );
    1389 #endif
    1390 #if NH_3D_SDC_INTRA
    13911238  memcpy( pCtu->getSDCFlag()             + m_absZIdxInCtu, m_pbSDCFlag, sizeof(Bool) * m_uiNumPartition );
    13921239  memcpy( pCtu->getSDCSegmentDCOffset(0) + m_absZIdxInCtu, m_apSegmentDCOffset[0], sizeof( Pel ) * m_uiNumPartition);
    13931240  memcpy( pCtu->getSDCSegmentDCOffset(1) + m_absZIdxInCtu, m_apSegmentDCOffset[1], sizeof( Pel ) * m_uiNumPartition);
    1394 #endif
    1395 #if NH_3D_DBBP
    13961241  memcpy( pCtu->getDBBPFlag()          + m_absZIdxInCtu, m_pbDBBPFlag,          iSizeInBool  );
    1397 #endif
    1398 #if NH_3D_ARP
    13991242  memcpy( pCtu->getARPW()              + m_absZIdxInCtu, m_puhARPW,             iSizeInUchar );
    14001243#endif
     
    14321275  }
    14331276
    1434 #if NH_3D_IC
     1277#if NH_3D
    14351278  memcpy( pCtu->getICFlag() + m_absZIdxInCtu, m_pbICFlag, sizeof( *m_pbICFlag ) * m_uiNumPartition );
    14361279#endif
    14371280  pCtu->getTotalBins() = m_uiTotalBins;
    14381281}
    1439 #if H_3D_SPIVMP
    1440   memcpy( rpcCU->getSPIVMPFlag()        + uiPartOffset, m_pbSPIVMPFlag,        sizeof(Bool) * uiQNumPart );
    1441 #endif
    1442 
    1443 
    14441282
    14451283// --------------------------------------------------------------------------------------------------------------------
     
    17861624Bool TComDataCU::isLosslessCoded(UInt absPartIdx) const
    17871625{
    1788   return (getSlice()->getPPS()->getTransquantBypassEnableFlag() && getCUTransquantBypass (absPartIdx));
     1626  return (getSlice()->getPPS()->getTransquantBypassEnabledFlag() && getCUTransquantBypass (absPartIdx));
    17891627}
    17901628
     
    18421680  }
    18431681  iLeftIntraDir  = pcCULeft ? ( pcCULeft->isIntra( LeftPartIdx ) ? pcCULeft->getIntraDir( chType, LeftPartIdx ) : DC_IDX ) : DC_IDX;
    1844 #if NH_3D_DMM
     1682#if NH_3D
    18451683  mapDmmToIntraDir( iLeftIntraDir );
    18461684#endif
     
    18541692  }
    18551693  iAboveIntraDir = pcCUAbove ? ( pcCUAbove->isIntra( AbovePartIdx ) ? pcCUAbove->getIntraDir( chType, AbovePartIdx ) : DC_IDX ) : DC_IDX;
    1856 #if NH_3D_DMM
     1694#if NH_3D
    18571695  mapDmmToIntraDir( iAboveIntraDir );
    18581696#endif
     
    19901828  return uiCtx;
    19911829}
    1992 #if NH_3D_ARP
     1830#if NH_3D
    19931831UInt TComDataCU::getCTXARPWFlag( UInt uiAbsPartIdx )
    19941832{
     
    20011839  return uiCtx;
    20021840}
    2003 #endif
    2004 #if NH_3D_DBBP
     1841
    20051842Pel* TComDataCU::getVirtualDepthBlock(UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt& uiDepthStride)
    20061843{
     
    20161853  assert( !getSlice()->getIsDepth() );
    20171854 
    2018 #if H_3D_FCO
    2019   TComPic* depthPic = getSlice()->getIvPic(true, getSlice()->getViewIndex() );
    2020  
    2021   if( depthPic && depthPic->getPicYuvRec() != NULL && depthPic->getIsDepth() )  // depth first
    2022   {
    2023     depthPicYuv = depthPic->getPicYuvRec();
    2024     depthPicYuv->extendPicBorder();
    2025    
    2026     // get collocated depth block for current CU
    2027     uiDepthStride = depthPicYuv->getStride();
    2028     pDepthPels    = depthPicYuv->getLumaAddr( getAddr(), uiAbsPartIdx );
    2029   }
    2030   else  // texture first
    2031 #else
    20321855  {
    20331856    DisInfo DvInfo = getDvInfo(uiAbsPartIdx);
     
    20521875   
    20531876    Bool depthRefineFlag = false;
    2054 #if NH_3D_NBDV_REF
    20551877    depthRefineFlag = m_pcSlice->getDepthRefinementFlag();
    2056 #endif // NH_3D_NBDV_REF
    20571878   
    20581879    TComMv cDv = depthRefineFlag ? DvInfo.m_acDoNBDV : DvInfo.m_acNBDV;
     
    20671888    pDepthPels = depthPicYuv->getAddr(COMPONENT_Y) + depthPosX + depthPosY * uiDepthStride;
    20681889  }
    2069 #endif
    20701890 
    20711891  AOF( depthPicYuv != NULL );
     
    20751895  return pDepthPels;
    20761896}
    2077 #endif
    2078 
    2079 #if NH_3D_DBBP
     1897
    20801898Void TComDataCU::setDBBPFlagSubParts ( Bool bDBBPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
    20811899{
     
    21701988}
    21711989
    2172 #if NH_3D_DIS
     1990#if NH_3D
    21731991Void TComDataCU::setDISFlagSubParts( Bool bDIS, UInt uiAbsPartIdx, UInt uiDepth )
    21741992{
     
    23362154}
    23372155
    2338 #if NH_3D_SDC_INTRA
     2156#if NH_3D
    23392157Void TComDataCU::setSDCFlagSubParts ( Bool bSDCFlag, UInt absPartIdx, UInt depth )
    23402158{
     
    23492167    UInt lumaPredMode = getIntraDir( CHANNEL_TYPE_LUMA, uiAbsPartIdx );
    23502168    if( lumaPredMode < NUM_INTRA_MODE ) { return true; }
    2351 #if NH_3D_DMM
    23522169    if( isDmmMode( lumaPredMode )     ) { return true; }
    2353 #endif
    23542170  }
    23552171  return false;
     
    23672183}
    23682184
    2369 #if NH_3D_SPIVMP
     2185#if NH_3D
    23702186Void TComDataCU::setSPIVMPFlagSubParts( Bool bSPIVMPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
    23712187{
    23722188  setSubPart<Bool>( bSPIVMPFlag, m_pbSPIVMPFlag, uiAbsPartIdx, uiDepth, uiPartIdx );
    23732189}
    2374 #endif
    2375 
    2376 #if NH_3D_VSP
     2190
    23772191Void TComDataCU::setVSPFlagSubParts( SChar iVSPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
    23782192{
     
    25992413
    26002414// This is for use by a leaf/sub CU object only, with no additional AbsPartIdx
    2601 #if NH_3D_IC || NH_3D_VSP
     2415#if NH_3D
    26022416Void TComDataCU::getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx, Bool bLCU) const
    26032417{
     
    29412755    );
    29422756}
    2943 #endif
    2944 
    2945 #if NH_3D_VSP
     2757
    29462758/** Add a VSP merging candidate
    29472759 * \Inputs
     
    29972809        predFlag[iRefListIdX] = 1;
    29982810        mvVSP[0+iRefListIdX].setMvField( pDInfo->m_acNBDV, i );
    2999 #if NH_3D_NBDV
    30002811        mvVSP[0+iRefListIdX].getMv().setIDVFlag (false);
    3001 #endif
    30022812      }
    30032813    }
     
    30052815
    30062816  dirVSP = (predFlag[0] | (predFlag[1] << 1));
    3007   m_mergCands[MRG_VSP].setCand( mvVSP, dirVSP, true
    3008 #if NH_3D_SPIVMP
    3009     , false
    3010 #endif
    3011     );
     2817  m_mergCands[MRG_VSP].setCand( mvVSP, dirVSP, true    , false);
    30122818  if ( mrgCandIdx == iCount )
    30132819  {
     
    30192825  return false;
    30202826}
    3021 #endif
    3022 
    3023 #if NH_3D_IV_MERGE
     2827
    30242828inline Bool TComDataCU::xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Int* ivCandDir, TComMv* ivCandMv, Int* ivCandRefIdx )
    30252829{
     
    30522856      if(!bRemove)
    30532857      {
    3054 #if NH_3D_NBDV
    30552858        if(iLoop) // For IvMcShift candidate
    30562859        {
     
    30582861          tmpMV[1].getMv().setIDVFlag (false);
    30592862        }
    3060 #endif
    30612863        m_mergCands[MRG_IVSHIFT].setCand(tmpMV, tmpDir, false, false);
    30622864        if( mrgCandIdx == iCount )
     
    30722874}
    30732875
    3074 #endif
    3075 #if NH_3D_MLC
    30762876/** Construct a extended list of merging candidates
    30772877 * \param pcMvFieldNeighbours
     
    30812881 * \param numValidMergeCand
    30822882 */
    3083 Void TComDataCU::buildMCL(TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours
    3084 #if NH_3D_VSP
    3085   , Int* vspFlag
    3086 #endif
    3087 #if NH_3D_SPIVMP
    3088   , Bool* pbSPIVMPFlag
    3089 #endif
    3090   , Int& numValidMergeCand
    3091   )
     2883Void TComDataCU::buildMCL(TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag  , Bool* pbSPIVMPFlag  , Int& numValidMergeCand  )
    30922884{
    30932885  if (!( getSlice()->getIsDepth() || getSlice()->getViewIndex()>0))
     
    30952887    return;
    30962888  }
    3097 
    30982889
    30992890#if ENC_DEC_TRACE && NH_MV_ENC_DEC_TRAC
     
    31192910    extMergeCandList[ui<<1].setMvField(cZeroMv, NOT_VALID);
    31202911    extMergeCandList[(ui<<1)+1].setMvField(cZeroMv, NOT_VALID);
    3121 #if NH_3D_VSP
    31222912    vspFlag[ui] = 0;
    3123 #endif
    31242913  }
    31252914
     
    31292918    if (m_mergCands[i].m_bAvailable)
    31302919    {
    3131       m_mergCands[i].getCand(iCount, extMergeCandList, uhInterDirNeighboursExt
    3132 #if NH_3D_VSP
    3133         , vspFlag
    3134 #endif
    3135 #if NH_3D_SPIVMP
    3136         , pbSPIVMPFlag
    3137 #endif
    3138         );
     2920      m_mergCands[i].getCand(iCount, extMergeCandList, uhInterDirNeighboursExt, vspFlag, pbSPIVMPFlag );
    31392921      iCount++;
    31402922      if (iCount >= getSlice()->getMaxNumMergeCand())
     
    32293011 * \param numValidMergeCand
    32303012 */
    3231 Void TComDataCU::xGetInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours
    3232 #if NH_3D_SPIVMP
    3233       , TComMvField* pcMvFieldSP, UChar* puhInterDirSP
    3234 #endif
    3235       , Int& numValidMergeCand, Int mrgCandIdx
    3236 )
    3237 {
    3238 #if NH_3D_IV_MERGE
     3013
     3014Void TComDataCU::xGetInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, TComMvField* pcMvFieldSP, UChar* puhInterDirSP, Int& numValidMergeCand, Int mrgCandIdx )
     3015{
    32393016  TComMv cZeroMv;
    32403017  TComMvField tmpMV[2]; 
    3241 #endif
    32423018
    32433019  //////////////////////////////////
    32443020  //////// GET DISPARITIES  ////////
    32453021  //////////////////////////////////
    3246 #if NH_3D_IV_MERGE
    32473022  DisInfo cDisInfo = getDvInfo(uiAbsPartIdx);
    32483023  m_cDefaultDisInfo = cDisInfo;
    3249 #elif NH_3D_VSP
    3250   // for xAddVspCand()
    3251   DisInfo cDisInfo = getDvInfo(uiAbsPartIdx);
    3252 #endif
    32533024
    32543025  if (!( getSlice()->getIsDepth() || getSlice()->getViewIndex()>0))
     
    32683039  deriveLeftRightTopIdxGeneral( uiAbsPartIdx, uiPUIdx, uiPartIdxLT, uiPartIdxRT );
    32693040  deriveLeftBottomIdxGeneral  ( uiAbsPartIdx, uiPUIdx, uiPartIdxLB );
    3270 #if NH_3D_TEXT_MERGE
    32713041  Bool bMPIFlag   = getSlice()->getMpiFlag();
    32723042  Int  tmpDir;
    3273 #endif
    3274 #if NH_3D_IV_MERGE || NH_3D_TEXT_MERGE
    32753043  Bool bIsDepth = getSlice()->getIsDepth();
    3276 #endif
    3277 
    3278 #if NH_3D_IC
     3044
    32793045  Bool bICFlag = getICFlag(uiAbsPartIdx);
    3280 #endif
    3281 #if NH_3D_ARP
    32823046  Bool bARPFlag = getARPW(uiAbsPartIdx) > 0;
    3283 #endif
    3284 #if NH_3D_DBBP
    32853047  Bool bDBBPFlag = getDBBPFlag(uiAbsPartIdx);
    32863048  assert(bDBBPFlag == getDBBPFlag(0)); 
    3287 #endif
    3288 
    3289 #if NH_3D_NBDV
     3049
    32903050  for(Int i = 0; i < MRG_MAX_NUM_CANDS_MEM; i++) 
    32913051  {
     
    32933053    pcMFieldNeighbours[(i<<1)+1].getMv().setIDVFlag (false);
    32943054  }
    3295 #endif
    32963055  // init containers
    32973056  for (Int i = 0; i<MRG_IVSHIFT+1; i++)
     
    33103069  if (getAvailableFlagA1())
    33113070  {
    3312     m_mergCands[MRG_A1].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands]
    3313 #if NH_3D_VSP
    3314     , (pcCULeft->getVSPFlag(uiLeftPartIdx) != 0
    3315 #if NH_3D_IC
    3316       && !bICFlag
    3317 #endif
    3318 #if NH_3D_ARP
    3319       && !bARPFlag
    3320 #endif
    3321 #if NH_3D_DBBP
    3322       && !bDBBPFlag
    3323 #endif
    3324       )
    3325 #endif
    3326 #if NH_3D_SPIVMP
    3327       , false
    3328 #endif
    3329       );
     3071    m_mergCands[MRG_A1].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands], (pcCULeft->getVSPFlag(uiLeftPartIdx) != 0 && !bICFlag && !bARPFlag&& !bDBBPFlag), false );
    33303072    m_numSpatialCands++;
    33313073  }
     
    33343076  if (getAvailableFlagB1())
    33353077  {
    3336     m_mergCands[MRG_B1].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands]
    3337 #if NH_3D_VSP
    3338     , false
    3339 #endif
    3340 #if NH_3D_SPIVMP
    3341       , false
    3342 #endif
    3343       );
     3078    m_mergCands[MRG_B1].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands], false, false );
    33443079    m_numSpatialCands++;
    33453080  }
     
    33483083  if (getAvailableFlagB0())
    33493084  {
    3350     m_mergCands[MRG_B0].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands]
    3351 #if NH_3D_VSP
    3352     , false
    3353 #endif
    3354 #if NH_3D_SPIVMP
    3355       , false
    3356 #endif
    3357       );
     3085    m_mergCands[MRG_B0].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands], false, false );
    33583086    m_numSpatialCands++;
    33593087  }
     
    33623090  if (getAvailableFlagA0())
    33633091  {
    3364     m_mergCands[MRG_A0].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands]
    3365 #if NH_3D_VSP
    3366     , false
    3367 #endif
    3368 #if NH_3D_SPIVMP
    3369       , false
    3370 #endif
    3371       );
     3092    m_mergCands[MRG_A0].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands], false, false );
    33723093    m_numSpatialCands++;
    33733094  }
     
    33763097  if (getAvailableFlagB2())
    33773098  {
    3378     m_mergCands[MRG_B2].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands]
    3379 #if NH_3D_VSP
    3380     , false
    3381 #endif
    3382 #if NH_3D_SPIVMP
    3383       , false
    3384 #endif
    3385       );
     3099    m_mergCands[MRG_B2].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands], false, false );
    33863100    m_numSpatialCands++;
    33873101  }
    33883102
    3389 
    3390 #if NH_3D_TEXT_MERGE
    33913103
    33923104  /////////////////////////////////////////////
     
    34043116
    34053117    TComPic * pcTexPic = m_pcSlice->getTexturePic();
    3406 #if H_3D_FCO
    3407     if (pcTexPic && pcTexPic->getReconMark())
    3408     {
    3409 #endif   
    34103118      TComPicYuv*   pcTexRec = pcTexPic->getPicYuvRec  ();
    34113119      UInt          uiPartAddr;
     
    34393147
    34403148      Int         iTexPosX, iTexPosY;
    3441 #if NH_3D_INTEGER_MV_DEPTH
    34423149      const TComMv cMvRounding( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) );
    3443 #endif
     3150
    34443151      Int         iCenterPosX = iCurrPosX + ( ( iWidth /  iPUWidth ) >> 1 )  * iPUWidth + ( iPUWidth >> 1 );
    34453152      Int         iCenterPosY = iCurrPosY + ( ( iHeight /  iPUHeight ) >> 1 )  * iPUHeight + (iPUHeight >> 1);
     
    34743181              {
    34753182                bSPIVMPFlag = true;
    3476 #if NH_3D_INTEGER_MV_DEPTH
    34773183                TComMv cMv = cDefaultMvField.getMv() + cMvRounding;
    34783184                cMv >>= 2;
    3479 #else
    3480                 TComMv cMv = cDefaultMvField.getMv();
    3481 #endif
    34823185                cMvFieldSaved[eCurrRefPicList].setMvField(cMv, iRefPicList) ;
    34833186                break;
     
    35163219                if( (cTexMvField.getRefIdx()>=0) && ( iValidDepRef >= 0 ) )
    35173220                {
    3518 #if NH_3D_INTEGER_MV_DEPTH
    35193221                  TComMv cMv = cTexMvField.getMv() + cMvRounding;
    35203222                  cMv >>=2;         
    3521 #else
    3522                   TComMv cMv = cTexMvField.getMv();
    3523 #endif         
    35243223                  pcMvFieldSP[2*iPartition + uiCurrRefListId].setMvField(cMv, iValidDepRef);
    35253224                }
     
    35413240        }
    35423241      }
    3543 #if H_3D_FCO
    3544     }
    3545 #endif
     3242
    35463243    if( tmpDir != 0 )
    35473244    {
     
    35683265    }
    35693266  }
    3570 #endif
    3571 
    3572 #if NH_3D_IV_MERGE
     3267
    35733268  /////////////////////////////////////////////////////////////////
    35743269  //////// DERIVE IvMC, IvMCShift,IvDCShift, IvDC  Candidates /////
     
    35883283  if ( ivMvPredFlag && cDisInfo.m_aVIdxCan!=-1)
    35893284  {
    3590 #if NH_3D_IC
    35913285    getInterViewMergeCands(uiPUIdx, ivCandRefIdx, ivCandMv, &cDisInfo, ivCandDir , bIsDepth, pcMvFieldSP, puhInterDirSP, bICFlag );
    3592 #else
    3593     getInterViewMergeCands(uiPUIdx, ivCandRefIdx, ivCandMv, &cDisInfo, ivCandDir , bIsDepth, pcMvFieldSP, puhInterDirSP, false );
    3594 #endif
    35953286  } 
    35963287
     
    36483339        spiMvpFlag = true;
    36493340      }
    3650 #if NH_3D_DBBP
    36513341      spiMvpFlag &= !bDBBPFlag;
    3652 #endif
    36533342
    36543343      m_mergCands[MRG_IVMC].setCand( tmpMV, ivCandDir[0], false, spiMvpFlag);
     
    36673356    return;
    36683357  }
    3669 #endif
     3358
    36703359
    36713360  iCount += m_mergCands[MRG_A1].m_bAvailable + m_mergCands[MRG_B1].m_bAvailable;
    36723361
    3673 #if NH_3D_VSP
    36743362  /////////////////////////////////////////////////
    36753363  //////// VIEW SYNTHESIS PREDICTION (VSP) ////////
     
    36773365  if (iCount<getSlice()->getMaxNumMergeCand())
    36783366  {
    3679     if (
    3680       (!getAvailableFlagA1() || !(pcCULeft->getVSPFlag(uiLeftPartIdx) != 0)) &&
    3681 #if NH_3D_IC
    3682       !bICFlag &&
    3683 #endif
    3684 #if NH_3D_ARP
    3685       !bARPFlag &&
    3686 #endif
    3687 #if NH_3D
     3367    if ( ( !getAvailableFlagA1() || !(pcCULeft->getVSPFlag(uiLeftPartIdx) != 0) ) &&
     3368      !bICFlag           &&
     3369      !bARPFlag          &&
    36883370      (nPSW + nPSH > 12) &&
    3689 #endif
    3690 #if NH_3D_DBBP
    3691       !bDBBPFlag &&
    3692 #endif
     3371      !bDBBPFlag         &&
    36933372      xAddVspCand( mrgCandIdx, &cDisInfo, iCount ) )
    36943373    {
     
    37023381    }
    37033382  }
    3704 #endif
    37053383
    37063384  iCount += m_mergCands[MRG_B0].m_bAvailable;
    37073385
    3708 #if NH_3D_IV_MERGE
    37093386  /////////////////////////////////////////////
    37103387  //////// INTER VIEW DISP COMP (IvDC) ////////
     
    37403417    if(!bRemoveSpa)
    37413418    {
    3742 #if NH_3D_NBDV
    37433419      tmpMV[0].getMv().setIDVFlag (false);
    37443420      tmpMV[1].getMv().setIDVFlag (false);
    3745 #endif
    37463421      m_mergCands[MRG_IVDC].setCand( tmpMV, ivCandDir[1], false, false);
    37473422
     
    37573432    }
    37583433  }
    3759 #endif // H_3D_IV_MERGE
     3434
    37603435
    37613436  iCount += m_mergCands[MRG_A0].m_bAvailable + m_mergCands[MRG_B2].m_bAvailable;
    37623437
    3763 #if NH_3D_IV_MERGE
    37643438  ////////////////////////////////////////////////////
    37653439  //////// SHIFTED IV (IvMCShift + IvDCShift) ////////
     
    37773451    }
    37783452  }
    3779 #endif
    37803453}
    37813454#endif
    37823455
    37833456//! Construct a list of merging candidates
    3784 #if NH_3D
     3457
     3458
     3459#if MCTS_ENC_CHECK
     3460Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, UInt &numSpatialMergeCandidates, Int mrgCandIdx )
     3461#else
    37853462Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx )
    3786 #else
    3787 Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx ) const
     3463#endif
     3464#if !NH_3D 
     3465  const
    37883466#endif
    37893467{
    37903468  UInt uiAbsPartAddr = m_absZIdxInCtu + uiAbsPartIdx;
    3791 #if NH_3D_MLC
     3469#if NH_3D
    37923470  Bool abCandIsInter[ MRG_MAX_NUM_CANDS_MEM ];
    37933471#else
     
    38233501  if ( isAvailableA1 )
    38243502  {
    3825 #if NH_3D_MLC
     3503#if NH_3D
    38263504    m_bAvailableFlagA1 = 1;
    38273505#endif
     
    38373515    if ( mrgCandIdx == iCount )
    38383516    {
     3517#if MCTS_ENC_CHECK
     3518      numSpatialMergeCandidates = iCount + 1;
     3519#endif
    38393520      return;
    38403521    }
     
    38453526  if (iCount == getSlice()->getMaxNumMergeCand())
    38463527  {
     3528#if MCTS_ENC_CHECK
     3529    numSpatialMergeCandidates = iCount;
     3530#endif
    38473531    return;
    38483532  }
     
    38583542  if ( isAvailableB1 && (!isAvailableA1 || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCUAbove, uiAbovePartIdx ) ) )
    38593543  {
    3860 #if NH_3D_MLC
     3544#if NH_3D
    38613545    m_bAvailableFlagB1 = 1;
    38623546#endif
     
    38723556    if ( mrgCandIdx == iCount )
    38733557    {
     3558#if MCTS_ENC_CHECK
     3559      numSpatialMergeCandidates = iCount + 1;
     3560#endif
    38743561      return;
    38753562    }
     
    38793566  if (iCount == getSlice()->getMaxNumMergeCand())
    38803567  {
     3568#if MCTS_ENC_CHECK
     3569    numSpatialMergeCandidates = iCount;
     3570#endif
    38813571    return;
    38823572  }
     
    38923582  if ( isAvailableB0 && ( !isAvailableB1 || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveRight, uiAboveRightPartIdx ) ) )
    38933583  {
    3894 #if NH_3D_MLC
     3584#if NH_3D
    38953585    m_bAvailableFlagB0 = 1;
    38963586#endif
     
    39063596    if ( mrgCandIdx == iCount )
    39073597    {
     3598#if MCTS_ENC_CHECK
     3599      numSpatialMergeCandidates = iCount + 1;
     3600#endif
    39083601      return;
    39093602    }
     
    39133606  if (iCount == getSlice()->getMaxNumMergeCand())
    39143607  {
     3608#if MCTS_ENC_CHECK
     3609    numSpatialMergeCandidates = iCount;
     3610#endif
    39153611    return;
    39163612  }
     
    39263622  if ( isAvailableA0 && ( !isAvailableA1 || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCULeftBottom, uiLeftBottomPartIdx ) ) )
    39273623  {
    3928 #if NH_3D_MLC
     3624#if NH_3D
    39293625    m_bAvailableFlagA0 = 1;
    39303626#endif
     
    39403636    if ( mrgCandIdx == iCount )
    39413637    {
     3638#if MCTS_ENC_CHECK
     3639      numSpatialMergeCandidates = iCount + 1;
     3640#endif
    39423641      return;
    39433642    }
     
    39473646  if (iCount == getSlice()->getMaxNumMergeCand())
    39483647  {
     3648#if MCTS_ENC_CHECK
     3649    numSpatialMergeCandidates = iCount;
     3650#endif
    39493651    return;
    39503652  }
     
    39633665        && ( !isAvailableB1 || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveLeft, uiAboveLeftPartIdx ) ) )
    39643666    {
    3965 #if NH_3D_MLC
     3667#if NH_3D
    39663668      m_bAvailableFlagB2 = 1;
    39673669#endif
     
    39773679      if ( mrgCandIdx == iCount )
    39783680      {
     3681#if MCTS_ENC_CHECK
     3682        numSpatialMergeCandidates = iCount + 1;
     3683#endif
    39793684        return;
    39803685      }
     
    39853690  if (iCount == getSlice()->getMaxNumMergeCand())
    39863691  {
     3692#if MCTS_ENC_CHECK
     3693    numSpatialMergeCandidates = iCount;
     3694#endif
    39873695    return;
    39883696  }
    39893697
     3698#if MCTS_ENC_CHECK
     3699  numSpatialMergeCandidates = iCount;
     3700#endif
    39903701  if ( getSlice()->getEnableTMVPFlag() )
    39913702  {
     
    40473758    if ( getSlice()->isInterB() )
    40483759    {
    4049 #if NH_3D_TMVP
     3760#if NH_3D
    40503761      iRefIdx = 0;
    40513762#endif
     
    40663777      puhInterDirNeighbours[uiArrayAddr] = dir;
    40673778      abCandIsInter[uiArrayAddr] = true;
    4068 #if NH_3D_NBDV
     3779#if NH_3D
    40693780      pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
    40703781      pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);
     
    40873798  UInt uiCutoff = uiArrayAddr;
    40883799
    4089 #if NH_3D_MLC
     3800#if NH_3D
    40903801  if ( getSlice()->isInterB() && iCount<5)
    40913802#else
     
    42573968  if (refIdx < 0)
    42583969  {
     3970#if MCTS_ENC_CHECK
     3971    pInfo->numSpatialMVPCandidates = 0;
     3972#endif
    42593973    return;
    42603974  }
     
    43294043  }
    43304044
     4045#if MCTS_ENC_CHECK
     4046  pInfo->numSpatialMVPCandidates = pInfo->iN;
     4047#endif
    43314048  if (pInfo->iN < AMVP_MAX_NUM_CANDS && getSlice()->getEnableTMVPFlag() )
    43324049  {
     
    43344051    const UInt numPartInCtuWidth  = m_pcPic->getNumPartInCtuWidth();
    43354052    const UInt numPartInCtuHeight = m_pcPic->getNumPartInCtuHeight();
    4336 #if NH_3D_TMVP
     4053#if NH_3D
    43374054    Int refIdx_Col = refIdx;
    43384055#else
     
    43724089      }
    43734090    }
    4374 #if NH_3D_TMVP
     4091#if NH_3D
    43754092        if ( ctuRsAddr >= 0 && xGetColMVP( eRefPicList, ctuRsAddr, absPartAddr, cColMv, refIdx_Col  , 0 ) )
    43764093#else
     
    43844101      UInt uiPartIdxCenter;
    43854102      xDeriveCenterIdx( partIdx, uiPartIdxCenter );
    4386 #if NH_3D_TMVP
     4103#if NH_3D
    43874104      if (xGetColMVP( eRefPicList, getCtuRsAddr(), uiPartIdxCenter,  cColMv, refIdx_Col , 0 ))
    43884105#else
     
    44114128  UInt partAddr;
    44124129
    4413 #if NH_3D_DBBP
     4130#if NH_3D
    44144131  if( getDBBPFlag(0) )
    44154132  {
     
    44314148  const TComSPS &sps=*(m_pcSlice->getSPS());
    44324149  Int  iMvShift = 2;
    4433 #if NH_3D_INTEGER_MV_DEPTH
     4150#if NH_3D
    44344151  if( getSlice()->getIsDepth() )
    44354152    iMvShift = 0;
     
    46634380}
    46644381
    4665 #if NH_3D_TMVP
     4382#if NH_3D
    46664383Bool TComDataCU::xGetColMVP( const RefPicList eRefPicList, const Int ctuRsAddr, const Int partUnitIdx, TComMv& rcMv, Int& refIdx, Bool bMRG  ) const
    46674384#else
     
    46734390  // use coldir.
    46744391  const TComPic    * const pColPic = getSlice()->getRefPic( RefPicList(getSlice()->isInterB() ? 1-getSlice()->getColFromL0Flag() : 0), getSlice()->getColRefIdx());
     4392#if REDUCED_ENCODER_MEMORY
     4393  if (!pColPic->getPicSym()->hasDPBPerCtuData())
     4394  {
     4395    return false;
     4396  }
     4397  const TComPicSym::DPBPerCtuData * const pColDpbCtu = &(pColPic->getPicSym()->getDPBPerCtuData(ctuRsAddr));
     4398  const TComSlice * const pColSlice = pColDpbCtu->getSlice();
     4399  if(pColDpbCtu->getPartitionSize(partUnitIdx)==NUMBER_OF_PART_SIZES)
     4400#else
    46754401  const TComDataCU * const pColCtu = pColPic->getCtu( ctuRsAddr );
    46764402  if(pColCtu->getPic()==0 || pColCtu->getPartitionSize(partUnitIdx)==NUMBER_OF_PART_SIZES)
     4403#endif
    46774404  {
    46784405    return false;
    46794406  }
    46804407
     4408#if REDUCED_ENCODER_MEMORY
     4409  if (!pColDpbCtu->isInter(absPartAddr))
     4410#else
    46814411  if (!pColCtu->isInter(absPartAddr))
     4412#endif
    46824413  {
    46834414    return false;
     
    46854416
    46864417  RefPicList eColRefPicList = getSlice()->getCheckLDC() ? eRefPicList : RefPicList(getSlice()->getColFromL0Flag());
     4418#if REDUCED_ENCODER_MEMORY
     4419  Int iColRefIdx            = pColDpbCtu->getCUMvField(RefPicList(eColRefPicList))->getRefIdx(absPartAddr);
     4420#else
    46874421  Int iColRefIdx            = pColCtu->getCUMvField(RefPicList(eColRefPicList))->getRefIdx(absPartAddr);
     4422#endif
    46884423
    46894424  if (iColRefIdx < 0 )
    46904425  {
    46914426    eColRefPicList = RefPicList(1 - eColRefPicList);
     4427#if REDUCED_ENCODER_MEMORY
     4428    iColRefIdx = pColDpbCtu->getCUMvField(RefPicList(eColRefPicList))->getRefIdx(absPartAddr);
     4429#else
    46924430    iColRefIdx = pColCtu->getCUMvField(RefPicList(eColRefPicList))->getRefIdx(absPartAddr);
     4431#endif
    46934432
    46944433    if (iColRefIdx < 0 )
     
    46984437  }
    46994438
    4700 #if NH_3D_TMVP
     4439#if NH_3D
    47014440  Bool bIsCurrRefLongTerm = m_pcSlice->getRefPic(eRefPicList, refIdx)->getIsLongTerm();
    47024441#else
    47034442  const Bool bIsCurrRefLongTerm = m_pcSlice->getRefPic(eRefPicList, refIdx)->getIsLongTerm();
    47044443#endif
     4444#if REDUCED_ENCODER_MEMORY
     4445  const Bool bIsColRefLongTerm  = pColSlice->getIsUsedAsLongTerm(eColRefPicList, iColRefIdx);
     4446#else
    47054447  const Bool bIsColRefLongTerm  = pColCtu->getSlice()->getIsUsedAsLongTerm(eColRefPicList, iColRefIdx);
    4706 
     4448#endif
    47074449  if ( bIsCurrRefLongTerm != bIsColRefLongTerm )
    47084450  {
    4709 #if NH_3D_TMVP
     4451#if NH_3D
    47104452    Int iAlterRefIdx  = m_pcSlice->getAlterRefIdx(eRefPicList);
    47114453    if(bMRG && iAlterRefIdx > 0)
     
    47194461#endif
    47204462      return false;
    4721 #if NH_3D_TMVP
     4463#if NH_3D
    47224464    }
    47234465#endif
    47244466  }
    47254467  // Scale the vector.
     4468#if REDUCED_ENCODER_MEMORY
     4469  const TComMv &cColMv = pColDpbCtu->getCUMvField(eColRefPicList)->getMv(absPartAddr);
     4470#else
    47264471  const TComMv &cColMv = pColCtu->getCUMvField(eColRefPicList)->getMv(absPartAddr);
    4727 
    4728 #if NH_3D_TMVP
     4472#endif
     4473
     4474#if NH_3D
    47294475  if ( bIsCurrRefLongTerm || bIsColRefLongTerm )
    47304476#else
     
    47324478#endif
    47334479  {
    4734 #if NH_3D_TMVP
     4480#if NH_3D
    47354481    const Int iCurrViewId    = m_pcSlice->getViewId ();
    47364482    const Int iCurrRefViewId = m_pcSlice->getRefPic(eRefPicList, refIdx)->getViewId ();
     
    47504496#endif
    47514497      rcMv = cColMv;
    4752 #if NH_3D_TMVP
     4498#if NH_3D
    47534499    }
    47544500#endif
     
    47574503  {
    47584504    const Int currPOC    = m_pcSlice->getPOC();
     4505#if REDUCED_ENCODER_MEMORY
     4506    const Int colPOC     = pColSlice->getPOC();
     4507    const Int colRefPOC  = pColSlice->getRefPOC(eColRefPicList, iColRefIdx);
     4508#else
    47594509    const Int colPOC     = pColCtu->getSlice()->getPOC();
    47604510    const Int colRefPOC  = pColCtu->getSlice()->getRefPOC(eColRefPicList, iColRefIdx);
     4511#endif
    47614512    const Int currRefPOC = m_pcSlice->getRefPic(eRefPicList, refIdx)->getPOC();
    47624513    const Int scale      = xGetDistScaleFactor(currPOC, currRefPOC, colPOC, colRefPOC);
     
    48114562{
    48124563   Int scaleFactor = (4 / scale ) * AMVP_DECIMATION_FACTOR / m_unitSize;
     4564  if (scaleFactor > 0)
     4565  {
     4566    for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++)
     4567    {
     4568      m_acCUMvField[i].compress(m_pePredMode, scaleFactor);
     4569    }
     4570  }
    48134571#else
    48144572Void TComDataCU::compressMV()
    48154573{
     4574#if REDUCED_ENCODER_MEMORY
     4575  const Int scaleFactor = std::max<Int>(1,4 * AMVP_DECIMATION_FACTOR / m_unitSize);
     4576  TComPicSym &picSym=*(getPic()->getPicSym());
     4577  TComPicSym::DPBPerCtuData &dpbForCtu=picSym.getDPBPerCtuData(getCtuRsAddr());
     4578
     4579  for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++)
     4580  {
     4581    dpbForCtu.m_CUMvField[i].compress(dpbForCtu.m_pePredMode, m_pePredMode, scaleFactor,m_acCUMvField[i]);
     4582    memcpy(dpbForCtu.m_pePartSize, m_pePartSize, sizeof(*m_pePartSize)*m_uiNumPartition);
     4583    dpbForCtu.m_pSlice = getSlice();
     4584  }
     4585#else
    48164586  Int scaleFactor = 4 * AMVP_DECIMATION_FACTOR / m_unitSize;
    4817 #endif
    48184587  if (scaleFactor > 0)
    48194588  {
     
    48234592    }
    48244593  }
     4594#endif
     4595#endif
    48254596}
    48264597#if NH_3D
     
    48674638
    48684639  UInt uiDirMode  = getIntraDir(toChannelType(compID), uiAbsPartIdx);
    4869 #if NH_3D_DMM
     4640#if NH_3D
    48704641  mapDmmToIntraDir( uiDirMode );
    48714642#endif
     
    48764647    const UInt partsPerMinCU = 1<<(2*(sps->getMaxTotalCUDepth() - sps->getLog2DiffMaxMinCodingBlockSize()));
    48774648    uiDirMode = getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, getPic()->getChromaFormat(), partsPerMinCU));
    4878 #if NH_3D_DMM
     4649#if NH_3D
    48794650    mapDmmToIntraDir( uiDirMode );
    48804651#endif
     
    49014672  }
    49024673}
     4674
     4675#if MCTS_ENC_CHECK
     4676Bool TComDataCU::isLastColumnCTUInTile() const
     4677{
     4678  UInt      currentTileIdx               = this->getPic()->getPicSym()->getTileIdxMap(this->getCtuRsAddr());
     4679  TComTile *pCurrentTile                 = m_pcPic->getPicSym()->getTComTile(currentTileIdx);
     4680  UInt      frameWidthInCtus             = m_pcPic->getPicSym()->getFrameWidthInCtus();
     4681  UInt      rightEdgeCTUPosInCurrentTile = pCurrentTile->getRightEdgePosInCtus();
     4682  UInt      ctuXPosInCtus                = this->getCtuRsAddr() % frameWidthInCtus;
     4683 
     4684  return (rightEdgeCTUPosInCurrentTile == ctuXPosInCtus);
     4685}
     4686#endif
    49034687
    49044688#if NH_3D_VSO
     
    49104694#endif
    49114695
    4912 #if NH_3D_IV_MERGE
     4696#if NH_3D
    49134697Void TComDataCU::getDispforDepth (UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDisp)
    49144698{
     
    49284712  }
    49294713}
    4930 #endif
    4931 
    4932 #if NH_3D_DIS
     4714
    49334715Bool TComDataCU::getNeighDepth ( UInt uiPartIdx, UInt uiPartAddr, Pel* pNeighDepth, Int index )
    49344716{
     
    49884770  return bDepAvail;
    49894771}
    4990 #endif
    4991 #if NH_3D_NBDV
    4992 //Notes from QC:
    4993 //TBD#1: DoNBDV related contributions are just partially integrated under the marco of NH_3D_NBDV_REF, remove this comment once DoNBDV and BVSP are done
    4994 //TBD#2: set of DvMCP values need to be done as part of inter-view motion prediction process. Remove this comment once merge related integration is done
    4995 //To be checked: Parallel Merge features for NBDV, related to DV_DERIVATION_PARALLEL_B0096 and LGE_IVMP_PARALLEL_MERGE_B0136 are not integrated. The need of these features due to the adoption of CU-based NBDV is not clear. We need confirmation on this, especially by proponents
    4996 Void TComDataCU::getDisMvpCandNBDV( DisInfo* pDInfo
    4997 #if NH_3D_NBDV_REF
    4998 , Bool bDepthRefine
    4999 #endif
    5000 )
     4772
     4773Void TComDataCU::getDisMvpCandNBDV( DisInfo* pDInfo, Bool bDepthRefine )
    50014774{
    50024775  //// ******* Init variables ******* /////
     
    50184791    }
    50194792  }
    5020 #if NH_3D_NBDV_REF
     4793
    50214794  if( !m_pcSlice->getDepthRefinementFlag( ) )
    50224795  {
    50234796    bDepthRefine = false;
    50244797  }
    5025 #endif
     4798
    50264799  // Get Positions 
    50274800  PartSize eCUMode    = getPartitionSize( uiPartAddr );   
     
    50684841        pDInfo->m_aVIdxCan  = iTargetViewIdx;
    50694842
    5070 #if NH_3D_NBDV_REF
    50714843        TComPic* picDepth = NULL;   
    5072 #if H_3D_FCO
    5073         picDepth  = getSlice()->getIvPic(true, getSlice()->getViewIndex() );
    5074         if ( picDepth->getPicYuvRec() != NULL  ) 
    5075         {
    5076           cColMv.setZero();
    5077         }
    5078         else // Go back with virtual depth
    5079         {
    5080           picDepth = getSlice()->getIvPic( true, iTargetViewIdx );
    5081         }
    5082 
    5083         assert(picDepth != NULL);
    5084 #else
    50854844        picDepth = getSlice()->getIvPic( true, iTargetViewIdx );
    5086 #endif
    50874845        if (picDepth && bDepthRefine)
    50884846        {
     
    50904848        }
    50914849        pDInfo->m_acDoNBDV  = cColMv;
    5092 #endif //NH_3D_NBDV_REF
    50934850        return;
    50944851      }
     
    51034860    pcTmpCU = getPULeft(uiIdx, uiPartIdxLB);
    51044861  bCheckMcpDv = true;
    5105   if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, pDInfo, bCheckMcpDv, &cIDVInfo, DVFROM_LEFT
    5106 #if NH_3D_NBDV_REF
    5107     , bDepthRefine
    5108 #endif
    5109     ) )
     4862  if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, pDInfo, bCheckMcpDv, &cIDVInfo, DVFROM_LEFT, bDepthRefine ) )
    51104863    return;
    51114864
     
    51154868  {
    51164869    bCheckMcpDv = ( ( getCtuRsAddr() - pcTmpCU->getCtuRsAddr() ) == 0);
    5117     if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, pDInfo, bCheckMcpDv, &cIDVInfo, DVFROM_ABOVE
    5118 #if NH_3D_NBDV_REF
    5119       , bDepthRefine
    5120 #endif
    5121       ) )
     4870    if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, pDInfo, bCheckMcpDv, &cIDVInfo, DVFROM_ABOVE , bDepthRefine ) )
    51224871      return;
    51234872  }
     
    51354884          pDInfo->m_acNBDV = cDispVec;
    51364885          pDInfo->m_aVIdxCan = cIDVInfo.m_aVIdxCan[iList][ curPos ];
    5137 #if NH_3D_NBDV_REF
    5138 #if H_3D_FCO
    5139           TComPic* picDepth  = NULL;
    5140 
    5141           picDepth  = getSlice()->getIvPic(true, getSlice()->getViewIndex() );
    5142           if ( picDepth->getPicYuvRec() != NULL ) 
    5143           {
    5144             cDispVec.setZero();
    5145           }
    5146           else // Go back with virtual depth
    5147           {
    5148             picDepth = getSlice()->getIvPic( true, pDInfo->m_aVIdxCan );
    5149           }
    5150 
    5151           assert(picDepth != NULL);
    5152 #else
    51534886          TComPic* picDepth = getSlice()->getIvPic( true, pDInfo->m_aVIdxCan );
    5154 #endif
    51554887
    51564888          if (picDepth && bDepthRefine)
     
    51594891          }
    51604892          pDInfo->m_acDoNBDV = cDispVec;
    5161 #endif
    51624893          return;
    51634894        }
     
    51734904    pDInfo->m_aVIdxCan = getSlice()->getDefaultRefViewIdx();
    51744905
    5175 #if NH_3D_NBDV_REF
    51764906    TComPic* picDepth = NULL;
    5177 #if H_3D_FCO
    5178     picDepth  = getSlice()->getIvPic(true, getSlice()->getViewIndex() );
    5179     if ( picDepth->getPicYuvRec() != NULL ) 
    5180     {
    5181       defaultDV.setZero();
    5182     }
    5183     else // Go back with virtual depth
    5184     {
    5185       picDepth = getSlice()->getIvPic( true, getSlice()->getDefaultRefViewIdx());
    5186     }
    5187 
    5188     assert(picDepth != NULL);
    5189 #else
    51904907    picDepth = getSlice()->getIvPic( true, getSlice()->getDefaultRefViewIdx());
    5191 #endif
    51924908    if (picDepth && bDepthRefine)
    51934909    {
     
    51954911    }
    51964912    pDInfo->m_acDoNBDV = defaultDV;
    5197 #endif
    5198   }
    5199 }
    5200 
    5201 #if NH_3D_NBDV_REF
     4913  }
     4914}
     4915
    52024916Pel TComDataCU::getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iBlkWidth, Int iBlkHeight, Int* aiShiftLUT )
    52034917{
     
    52414955  }
    52424956}
    5243 #endif //NH_3D_NBDV_REF
    5244 
    5245 
    5246 Bool TComDataCU::xCheckSpatialNBDV( const TComDataCU* pcTmpCU, UInt uiIdx, DisInfo* pNbDvInfo, Bool bSearchForMvpDv, IDVInfo* paIDVInfo, UInt uiMvpDvPos
    5247 #if NH_3D_NBDV_REF
    5248 , Bool bDepthRefine
    5249 #endif
    5250 )
     4957
     4958
     4959
     4960Bool TComDataCU::xCheckSpatialNBDV( const TComDataCU* pcTmpCU, UInt uiIdx, DisInfo* pNbDvInfo, Bool bSearchForMvpDv, IDVInfo* paIDVInfo, UInt uiMvpDvPos, Bool bDepthRefine )
    52514961{
    52524962  if( pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) )
     
    52664976          pNbDvInfo->m_acNBDV = cMvPred;
    52674977          pNbDvInfo->m_aVIdxCan = refViewIdx;
    5268 #if NH_3D_NBDV_REF
     4978
    52694979          TComPic* picDepth = NULL;
    52704980          assert(getSlice()->getRefPic(eRefPicList, refId)->getPOC() == getSlice()->getPOC());           
    5271 #if H_3D_FCO
    5272           picDepth  = getSlice()->getIvPic(true, getSlice()->getViewIndex() );
    5273           if ( picDepth->getPicYuvRec() != NULL ) 
    5274           {
    5275             cMvPred.setZero();
    5276           }
    5277           else// Go back with virtual depth
    5278           {
    5279             picDepth = getSlice()->getIvPic (true, refViewIdx );
    5280           }
    5281           assert(picDepth != NULL);
    5282 #else
    52834981          picDepth   = getSlice()->getIvPic (true, refViewIdx );
    5284 #endif
    52854982          UInt uiPartIdx = 0;   //Notes from MTK: Please confirm that using 0 as partition index and partition address is correct for CU-level DoNBDV
    52864983          UInt uiPartAddr = 0;  //QC: confirmed
     
    52914988          }
    52924989          pNbDvInfo->m_acDoNBDV = cMvPred;
    5293 #endif
    52944990          return true;
    52954991        }
     
    53555051}
    53565052
    5357 
    53585053Void TComDataCU::setDvInfoSubParts( DisInfo cDvInfo, UInt uiAbsPartIdx, UInt uiDepth )
    53595054{
    5360 #if NH_3D_VSP // bug fix
    53615055  UInt uiCurrPartNumb = m_pcPic->getNumPartitionsInCtu() >> (uiDepth << 1);
    53625056  assert(m_pcPic->getNumPartitionsInCtu() ==m_pcPic->getNumPartInCtuWidth()*m_pcPic->getNumPartInCtuHeight());
    53635057
    5364 #else
    5365   UInt uiCurrPartNumb = m_pcPic->getNumPartInCtuWidth() >> (uiDepth << 1);
    5366 #endif
    53675058  for (UInt ui = 0; ui < uiCurrPartNumb; ui++ )
    53685059  {
     
    53705061  }
    53715062}
    5372 #if NH_3D_VSP  || NH_3D_DBBP
     5063
    53735064Void TComDataCU::setDvInfoSubParts( DisInfo cDvInfo, UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth )
    53745065{
    53755066  setSubPartT<DisInfo>( cDvInfo, m_pDvInfo, uiAbsPartIdx, uiDepth, uiPUIdx );
    53765067}
    5377 #endif
    53785068
    53795069Bool TComDataCU::xGetColDisMV( Int currCandPic, RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv , Int & iTargetViewIdx, Int & iStartViewIdx )
     
    54495139  iCurrPosY  += ( ( iHeight - 1 ) >> 1 );
    54505140
    5451   Bool depthRefineFlag = false;
    5452 #if NH_3D_NBDV_REF
    5453   depthRefineFlag = m_pcSlice->getDepthRefinementFlag( );
    5454 #endif // NH_3D_NBDV_REF
     5141  Bool depthRefineFlag = m_pcSlice->getDepthRefinementFlag( );
    54555142
    54565143  TComMv      cDv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV;
     
    55065193#endif
    55075194
    5508 #if NH_3D_SPIVMP
     5195#if NH_3D
    55095196Void TComDataCU::getSPPara(Int iPUWidth, Int iPUHeight, Int& iNumSP, Int& iNumSPInOneLine, Int& iSPWidth, Int& iSPHeight)
    55105197{
     
    55555242  }
    55565243}
    5557 #endif
    5558 
    5559 #if NH_3D_IV_MERGE
    5560 Bool
    5561 TComDataCU::getInterViewMergeCands(UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* availableMcDc , Bool bIsDepth           
    5562 #if NH_3D_SPIVMP
    5563 , TComMvField* pcMvFieldSP, UChar* puhInterDirSP
    5564 #endif
    5565 , Bool bICFlag
    5566 )
     5244
     5245Bool TComDataCU::getInterViewMergeCands(UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* availableMcDc , Bool bIsDepth , TComMvField* pcMvFieldSP, UChar* puhInterDirSP, Bool bICFlag )
    55675246{
    55685247  TComSlice*    pcSlice = getSlice (); 
     
    55815260  pcBaseRec->getTopLeftSamplePos( getCtuRsAddr(), getZorderIdxInCtu() + uiPartAddr, iCurrPosX, iCurrPosY );
    55825261
    5583 #if !NH_3D_SPIVMP
    5584   iCurrPosX  += ( iWidth  >> 1 );
    5585   iCurrPosY  += ( iHeight >> 1 );
    5586 #endif
    5587 
    5588   Bool depthRefineFlag = false;
    5589 #if NH_3D_NBDV_REF
    5590   depthRefineFlag = m_pcSlice->getDepthRefinementFlag( );
    5591 #endif // NH_3D_NBDV_REF
     5262  Bool depthRefineFlag =  m_pcSlice->getDepthRefinementFlag( );
    55925263
    55935264  TComMv      cDv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV;
     
    55985269
    55995270  Bool abPdmAvailable[8] =  {false, false, false, false, false, false, false, false};
    5600 #if NH_3D_NBDV
     5271
    56015272  for( Int i = 0; i < 8; i++)
    56025273  {
    56035274    pacPdmMv[i].setIDVFlag   (false);
    56045275  }
    5605 #endif
    56065276
    56075277  if(!bICFlag)
    56085278  {
    5609 
    5610 #if NH_3D_SPIVMP
    56115279    ////////////////////////////////
    56125280    //////////sub-PU IvMC///////////
     
    56145282    if(!m_pcSlice->getIsDepth())
    56155283    {
    5616 #if NH_3D_DBBP
    56175284      if (!getDBBPFlag(0))
    5618 #else
    5619       if (1)
    5620 #endif
    56215285      {
    56225286        Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight;
     
    56785342                      abPdmAvailable[ uiCurrRefListId ] = true;
    56795343                      TComMv cMv(cDefaultMvField.getHor(), cDefaultMvField.getVer());
    5680 #if NH_3D_NBDV
    5681 #if NH_3D_IV_MERGE
    56825344                      if( !bIsDepth )
    56835345                      {
    5684 #endif
    56855346                        cMv.setIDVFlag   (true);
    56865347                        cMv.setIDVHor    (cDv.getHor());                 
    56875348                        cMv.setIDVVer    (cDv.getVer()); 
    56885349                        cMv.setIDVVId    (iViewIndex);
    5689 #if NH_3D_IV_MERGE
    56905350                      }
    5691 #endif
    5692 #endif
    56935351                      paiPdmRefIdx  [ uiCurrRefListId ] = iPdmRefIdx;
    56945352                      pacPdmMv      [ uiCurrRefListId ] = cMv;
     
    57785436      iCurrPosY  += ( iHeight >> 1 );
    57795437    }
    5780 #endif
     5438
    57815439
    57825440    ////////////////////////////////
     
    57845442    ////////////////////////////////
    57855443
    5786 #if NH_3D_SPIVMP
    57875444    if(m_pcSlice->getIsDepth())
    57885445    {
     
    57905447      iCurrPosY  += ( iHeight >> 1 );
    57915448    }
    5792 #if NH_3D_DBBP
     5449
    57935450    for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getDBBPFlag(0)) ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++)
    5794 #else
    5795     for(Int iLoopCan = ( m_pcSlice->getIsDepth() ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++)
    5796 #endif
    5797 #else
    5798     for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++)
    5799 #endif
    58005451    {
    58015452      // iLoopCan == 0 --> IvMC
     
    58395490                    abPdmAvailable[ (uiCurrRefListId + (iLoopCan<<2)) ] = true;
    58405491                    TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer());
    5841 #if NH_3D_NBDV
    5842 #if NH_3D_IV_MERGE
    58435492                    if( !bIsDepth )
    58445493                    {
    5845 #endif
    58465494                      cMv.setIDVFlag   (true);
    58475495                      cMv.setIDVHor    (cDv.getHor());                 
    58485496                      cMv.setIDVVer    (cDv.getVer()); 
    58495497                      cMv.setIDVVId    (iViewIndex);
    5850 #if NH_3D_IV_MERGE
    58515498                    }
    5852 #endif
    5853 #endif
    58545499                    paiPdmRefIdx  [ (uiCurrRefListId + (iLoopCan<<2)) ] = iPdmRefIdx;
    58555500                    pacPdmMv      [ (uiCurrRefListId + (iLoopCan<<2)) ] = cMv;
     
    58645509      }
    58655510    }
    5866 #if NH_3D_SPIVMP
    5867 #if NH_3D_DBBP
    58685511    for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getDBBPFlag(0)) ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++)
    5869 #else
    5870     for(Int iLoopCan = ( m_pcSlice->getIsDepth()  ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++)
    5871 #endif
    5872 #else
    5873     for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++)
    5874 #endif
    58755512    {
    58765513      availableMcDc[(iLoopCan << 1)] = ( abPdmAvailable[(iLoopCan<<2)] ? 1 : 0 ) + ( abPdmAvailable[1 + (iLoopCan<<2)] ? 2 : 0);
     
    58985535            abPdmAvailable[ iRefListId + 2 + (iLoopCan<<2) ] = true;
    58995536            paiPdmRefIdx  [ iRefListId + 2 + (iLoopCan<<2) ] = iPdmRefIdx;
    5900 #if NH_3D_NBDV_REF
    59015537            TComMv cMv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV;
    5902 #endif
    59035538            cMv.setHor( cMv.getHor() + ioffsetDV );
    5904 #if NH_3D_IV_MERGE
    59055539            if( bIsDepth )
    59065540            {
    59075541              cMv.setHor((cMv.getHor()+2)>>2);
    59085542            }
    5909 #endif
    59105543            cMv.setVer( 0 );
    59115544            pacPdmMv      [iRefListId + 2 + (iLoopCan<<2)] = cMv;
     
    59225555  return false;
    59235556}
    5924 #endif
    5925 #if NH_3D_ARP
     5557
    59265558Void TComDataCU::setARPWSubParts ( UChar w, UInt uiAbsPartIdx, UInt uiDepth )
    59275559{
    59285560  setSubPart<UChar>( w, m_puhARPW, uiAbsPartIdx, uiDepth, 0 );
    59295561}
    5930 #endif
    5931 
    5932 #if NH_3D_IC
     5562
    59335563Void TComDataCU::setICFlagSubParts( Bool bICFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
    59345564{
     
    59835613  return false;
    59845614}
    5985 #endif
    5986 #if NH_3D_DMM
     5615
    59875616Void TComDataCU::setDmm1WedgeTabIdxSubParts( UInt tabIdx, UInt uiAbsPartIdx, UInt uiDepth )
    59885617{
     
    59905619  for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) { m_dmm1WedgeTabIdx[uiAbsPartIdx+ui] = tabIdx; }
    59915620}
    5992 #endif
    5993 
    5994 #if NH_3D_VSP
     5621
    59955622Void TComDataCU::setMvFieldPUForVSP( TComDataCU* pcCU, UInt partAddr, Int width, Int height, RefPicList eRefPicList, Int iRefIdx, Int &vspSize )
    59965623{
     
    59985625  Int depthRefViewIdx = pcCU->getDvInfo(partAddr).m_aVIdxCan;
    59995626 
    6000 #if H_3D_FCO
    6001   TComPic* pRefPicBaseDepth = 0;
    6002   Bool     bIsCurrDepthCoded = false;
    6003   pRefPicBaseDepth  = pcCU->getSlice()->getIvPic( true, pcCU->getSlice()->getViewIndex() );
    6004   if ( pRefPicBaseDepth->getPicYuvRec() != NULL  )
    6005   {
    6006     bIsCurrDepthCoded = true;
    6007   }
    6008   else
    6009   {
    6010     pRefPicBaseDepth = pcCU->getSlice()->getIvPic (true, depthRefViewIdx );
    6011   }
    6012 #else
    60135627  TComPic* pRefPicBaseDepth = pcCU->getSlice()->getIvPic (true, depthRefViewIdx );
    6014 #endif
    60155628  assert(pRefPicBaseDepth != NULL);
    60165629  TComPicYuv* pcBaseViewDepthPicYuv = pRefPicBaseDepth->getPicYuvRec();
     
    60325645  TComMv cDv  = pcCU->getDvInfo(partAddr).m_acNBDV;
    60335646  pcCU->clipMv(cDv);
    6034 
    6035 #if H_3D_FCO
    6036   if ( bIsCurrDepthCoded )
    6037   {
    6038       cDv.setZero();
    6039   }
    6040 #endif
    60415647
    60425648  // fetch virtual depth map & convert depth to motion vector, which are stored in the motion memory
  • trunk/source/Lib/TLibCommon/TComDataCU.h

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    6060static const UInt NUM_MOST_PROBABLE_MODES=3;
    6161
    62 #if NH_3D_DBBP
     62#if NH_3D
    6363typedef struct _DBBPTmpData
    6464{
     
    111111
    112112  Bool*          m_skipFlag;           ///< array of skip flags
    113 #if NH_3D_DIS
     113#if NH_3D
    114114  Bool*          m_bDISFlag;         
    115115  UChar*         m_ucDISType;
     
    142142  TComDataCU*   m_pCtuAbove;          ///< pointer of above CTU.
    143143  TComDataCU*   m_pCtuLeft;           ///< pointer of left CTU
    144   TComDataCU*   m_apcCUColocated[NUM_REF_PIC_LIST_01];  ///< pointer of temporally colocated CU's for both directions
    145144  TComMvField   m_cMvFieldA;          ///< motion vector of position A
    146145  TComMvField   m_cMvFieldB;          ///< motion vector of position B
     
    162161  SChar*        m_apiMVPNum[NUM_REF_PIC_LIST_01];       ///< array of number of possible motion vectors predictors
    163162  Bool*         m_pbIPCMFlag;         ///< array of intra_pcm flags
    164 #if NH_3D_NBDV
     163#if MCTS_ENC_CHECK
     164  Bool          m_tMctsMvpIsValid;
     165#endif
     166#if NH_3D
    165167  DisInfo*      m_pDvInfo;
    166 #endif
    167 #if NH_3D_VSP
    168168  SChar*        m_piVSPFlag;          ///< array of VSP flags to indicate whehter a block uses VSP or not  ///< 0: non-VSP; 1: VSP
    169 #endif
    170 #if NH_3D_SPIVMP
    171169  Bool*         m_pbSPIVMPFlag;       ///< array of sub-PU IVMP flags to indicate whehter a block uses sub-PU IVMP ///< 0: non-SPIVMP; 1: SPIVMP
    172 #endif
    173 #if NH_3D_ARP
    174170  UChar*        m_puhARPW;
    175 #endif
    176 #if NH_3D_IC
    177171  Bool*         m_pbICFlag;           ///< array of IC flags
    178 #endif
    179 #if NH_3D_DMM
    180172  Pel*          m_dmmDeltaDC[NUM_DMM][2];
    181173  UInt*         m_dmm1WedgeTabIdx;
    182 #endif
    183 #if NH_3D_SDC_INTRA
    184174  Bool*         m_pbSDCFlag;
    185175  Pel*          m_apSegmentDCOffset[2];
    186 #endif
    187 #if NH_3D_DBBP
    188176  Bool*         m_pbDBBPFlag;        ///< array of DBBP flags
    189177  DbbpTmpData   m_sDBBPTmpData;
    190 #endif
    191 #if NH_3D_MLC
     178
    192179  Bool          m_bAvailableFlagA1;    ///< A1 available flag
    193180  Bool          m_bAvailableFlagB1;    ///< B1 available flag
     
    212199  UInt          m_uiTotalBins;        ///< sum of partition bins
    213200  SChar         m_codedQP;
    214 #if NH_3D_MLC
     201#if NH_3D
    215202  DisInfo         m_cDefaultDisInfo;    ///< Default disparity information for initializing
    216203  TComMotionCand  m_mergCands[MRG_IVSHIFT+1];   ///< Motion candidates for merge mode
     
    226213  Bool          xAddMVPCandWithScaling        ( AMVPInfo &info, const RefPicList eRefPicList, const Int iRefIdx, const UInt uiPartUnitIdx, const MVP_DIR eDir ) const;
    227214
    228 #if NH_3D_VSP
     215#if NH_3D
    229216  Bool          xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount);
    230 #endif
    231 #if NH_3D_IV_MERGE
    232217  Bool          xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Int*   ivCandDir, TComMv* ivCandMv, Int* ivCandRefIdx );
    233218#endif
     
    235220  Void          deriveRightBottomIdx          ( UInt uiPartIdx, UInt& ruiPartIdxRB ) const;
    236221
    237 #if NH_3D_TMVP
     222#if NH_3D
    238223  Bool          xGetColMVP                    ( const RefPicList eRefPicList, const Int ctuRsAddr, const Int partUnitIdx, TComMv& rcMv, Int& refIdx, Bool bMRG = true  ) const;
    239224#else
     
    242227
    243228  /// compute scaling factor from POC difference
    244 #if !NH_3D_ARP
     229#if !NH_3D
    245230  static Int    xGetDistScaleFactor           ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC );
    246231#endif
    247232  Void          xDeriveCenterIdx              ( UInt uiPartIdx, UInt& ruiPartIdxCenter ) const;
    248233
    249 #if NH_3D_VSP
    250   Void xSetMvFieldForVSP  ( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, Int *shiftLUT, RefPicList refPicList, Int refIdx, Bool isDepth, Int &vspSize );
     234#if NH_3D
     235  Void          xSetMvFieldForVSP  ( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, Int *shiftLUT, RefPicList refPicList, Int refIdx, Bool isDepth, Int &vspSize );
    251236#endif
    252237
    253238public:
    254239
    255 #if NH_3D_ARP
     240#if NH_3D
    256241  static Int    xGetDistScaleFactor           ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC );
    257242#endif
     
    274259  Void          initSubCU             ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth, Int qp );
    275260  Void          setOutsideCUPart      ( UInt uiAbsPartIdx, UInt uiDepth );
    276 #if NH_3D_NBDV
     261
     262  Void          copySubCU             ( TComDataCU* pcCU, UInt uiPartUnitIdx );
     263#if NH_3D
    277264  Void          copyDVInfoFrom        (TComDataCU* pcCU, UInt uiAbsPartIdx);
    278 #endif
    279 
    280   Void          copySubCU             ( TComDataCU* pcCU, UInt uiPartUnitIdx );
    281 #if NH_3D_NBDV
    282     Void          copyInterPredInfoFrom ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList, Bool bNBDV = false );
     265  Void          copyInterPredInfoFrom ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList, Bool bNBDV = false );
    283266#else
    284267  Void          copyInterPredInfoFrom ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList );
     
    307290
    308291  Void          setDepthSubParts      ( UInt uiDepth, UInt uiAbsPartIdx );
    309 #if NH_3D_VSO
     292
     293#if MCTS_ENC_CHECK
     294  Void          setTMctsMvpIsValid(Bool b)    { m_tMctsMvpIsValid = b; }
     295  Bool          getTMctsMvpIsValid()          { return m_tMctsMvpIsValid; }
     296  Bool          isLastColumnCTUInTile() const;
     297#endif
     298
     299#if NH_3D
    310300  Void          getPosInPic           ( UInt uiAbsPartIndex, Int& riPosX, Int& riPosY ) const;
    311 #endif
    312 
    313 #if NH_3D_ARP
    314301  Void          setSlice              ( TComSlice* pcSlice)     { m_pcSlice = pcSlice;       }
    315302  Void          setPic                ( TComDataCU* pcCU  )     { m_pcPic              = pcCU->getPic(); }
     
    325312  Void          setCUTransquantBypassSubParts( Bool flag, UInt uiAbsPartIdx, UInt uiDepth );
    326313
    327 #if NH_3D_DBBP
     314#if NH_3D
    328315  Pel*          getVirtualDepthBlock(UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt& uiDepthStride);
    329316#endif
    330317 
    331   Bool*         getSkipFlag            ()                        { return m_skipFlag;          }
     318  Bool*         getSkipFlag           ()                        { return m_skipFlag;          }
    332319  Bool          getSkipFlag                   ( UInt idx ) const                                           { return m_skipFlag[idx];                    }
    333320  Void          setSkipFlag           ( UInt idx, Bool skip)     { m_skipFlag[idx] = skip;   }
    334321  Void          setSkipFlagSubParts   ( Bool skip, UInt absPartIdx, UInt depth );
    335 #if NH_3D_DIS
    336   Bool*        getDISFlag            ()                         { return m_bDISFlag;          }
    337   Bool         getDISFlag            ( UInt idx)                { return m_bDISFlag[idx];     }
    338   Void         setDISFlag            ( UInt idx, Bool bDIS)     { m_bDISFlag[idx] = bDIS;   }
    339   Void         setDISFlagSubParts    ( Bool bDIS, UInt uiAbsPartIdx, UInt uiDepth );
    340 
    341   UChar*       getDISType            ()                         { return m_ucDISType; }
    342   UChar        getDISType            ( UInt idx)                { return m_ucDISType[idx];     }
    343   Void         getDISType            ( UInt idx, UChar ucDISType)     { m_ucDISType[idx] = ucDISType;   }
    344   Void         setDISTypeSubParts    ( UChar ucDISType, UInt uiAbsPartIdx, UInt uiDepth );
    345 #endif
    346   SChar*        getPredictionMode             ( )                                                          { return m_pePredMode;                       }
    347   PredMode      getPredictionMode             ( UInt uiIdx ) const                                         { return static_cast<PredMode>( m_pePredMode[uiIdx] ); }
    348   Void          setPredictionMode     ( UInt uiIdx, PredMode uh){ m_pePredMode[uiIdx] = uh;   }
    349   Void          setPredModeSubParts   ( PredMode eMode, UInt uiAbsPartIdx, UInt uiDepth );
    350 
    351 #if NH_3D_DBBP
     322
     323#if NH_3D
     324  Bool*         getDISFlag            ()                         { return m_bDISFlag;          }
     325  Bool          getDISFlag            ( UInt idx)                { return m_bDISFlag[idx];     }
     326  Void          setDISFlag            ( UInt idx, Bool bDIS)     { m_bDISFlag[idx] = bDIS;   }
     327  Void          setDISFlagSubParts    ( Bool bDIS, UInt uiAbsPartIdx, UInt uiDepth );
     328
     329  UChar*        getDISType            ()                         { return m_ucDISType; }
     330  UChar         getDISType            ( UInt idx)                { return m_ucDISType[idx];     }
     331  Void          getDISType            ( UInt idx, UChar ucDISType)     { m_ucDISType[idx] = ucDISType;   }
     332  Void          setDISTypeSubParts    ( UChar ucDISType, UInt uiAbsPartIdx, UInt uiDepth );
     333
    352334  Bool*         getDBBPFlag           ()                        const { return m_pbDBBPFlag;               }
    353335  Bool          getDBBPFlag           ( UInt uiIdx )            const { return m_pbDBBPFlag[uiIdx];        }
     
    355337  Void          setDBBPFlagSubParts   ( Bool bDBBPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
    356338  DbbpTmpData*  getDBBPTmpData        () { return &m_sDBBPTmpData; }
    357 #endif
     339
     340
     341#endif
     342  SChar*        getPredictionMode             ( )                                                          { return m_pePredMode;                       }
     343  PredMode      getPredictionMode             ( UInt uiIdx ) const                                         { return static_cast<PredMode>( m_pePredMode[uiIdx] ); }
     344  Void          setPredictionMode     ( UInt uiIdx, PredMode uh){ m_pePredMode[uiIdx] = uh;   }
     345  Void          setPredModeSubParts   ( PredMode eMode, UInt uiAbsPartIdx, UInt uiDepth );
     346
    358347
    359348  SChar*        getCrossComponentPredictionAlpha( ComponentID compID )                                     { return m_crossComponentPredictionAlpha[compID];        }
     
    451440  template <typename T>
    452441  Void          setSubPart            ( T bParameter, T* pbBaseCtu, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx );
    453 #if H_3D_VSP || NH_3D_DBBP
     442#if NH_3D
    454443  template<typename T>
    455444  Void          setSubPartT           ( T uiParameter, T* puhBaseLCU, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx );
     
    477466  Void          setIPCMFlag           (UInt uiIdx, Bool b )     { m_pbIPCMFlag[uiIdx] = b;           }
    478467  Void          setIPCMFlagSubParts   (Bool bIpcmFlag, UInt uiAbsPartIdx, UInt uiDepth);
    479 #if NH_3D_NBDV
     468  // -------------------------------------------------------------------------------------------------------------------
     469  // member functions for accessing partition information
     470  // -------------------------------------------------------------------------------------------------------------------
     471
     472#if  NH_3D_FAST_TEXTURE_ENCODING
     473  Void          getIVNStatus       ( UInt uiPartIdx,  DisInfo* pDInfo, Bool& bIVFMerge,  Int& iIVFMaxD);
     474#endif
     475
     476#if NH_3D
    480477  Void          setDvInfoSubParts     ( DisInfo cDvInfo, UInt uiAbsPartIdx, UInt uiDepth );
    481 #if H_3D_VSP || NH_3D_DBBP
    482478  Void          setDvInfoSubParts     ( DisInfo cDvInfo, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth);
    483 #endif
    484479  DisInfo*      getDvInfo             ()                        { return m_pDvInfo;                 }
    485480  DisInfo       getDvInfo             (UInt uiIdx)              { return m_pDvInfo[uiIdx];          }
    486 #endif
    487 #if NH_3D_NBDV
    488   Void          xDeriveRightBottomNbIdx(Int &uiLCUIdxRBNb, Int &uiPartIdxRBNb );
    489   Bool          xCheckSpatialNBDV (const TComDataCU* pcTmpCU, UInt uiIdx, DisInfo* pNbDvInfo, Bool bSearchForMvpDv, IDVInfo* paMvpDvInfo,
    490                                    UInt uiMvpDvPos
    491 #if NH_3D_NBDV_REF
    492   , Bool bDepthRefine = false
    493 #endif
    494   );
    495   Bool          xGetColDisMV      ( Int currCandPic, RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int & iTargetViewIdx, Int & iStartViewIdx );
    496   Void          getDisMvpCandNBDV ( DisInfo* pDInfo
    497 #if NH_3D_NBDV_REF
    498    , Bool bDepthRefine = false
    499 #endif
    500    );
    501    
    502 #if NH_3D_IV_MERGE
    503   Void          getDispforDepth  ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* cDisp);
    504 #endif
    505 
    506 #if NH_3D_NBDV_REF
    507   Pel           getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iWidth, Int iHeight, Int* aiShiftLUT );
    508   Void          estimateDVFromDM(Int refViewIdx, UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred );
    509 #endif //NH_3D_NBDV_REF
    510 #endif
    511 #if NH_3D_DIS
    512    Bool          getNeighDepth (UInt uiPartIdx, UInt uiPartAddr, Pel* pNeighDepth, Int index);
    513 #endif
    514 #if  NH_3D_FAST_TEXTURE_ENCODING
    515   Void          getIVNStatus       ( UInt uiPartIdx,  DisInfo* pDInfo, Bool& bIVFMerge,  Int& iIVFMaxD);
    516 #endif
    517 #if NH_3D_SPIVMP
    518   Void          getSPPara(Int iPUWidth, Int iPUHeight, Int& iNumSP, Int& iNumSPInOneLine, Int& iSPWidth, Int& iSPHeight);
    519   Void          getSPAbsPartIdx(UInt uiBaseAbsPartIdx, Int iWidth, Int iHeight, Int iPartIdx, Int iNumPartLine, UInt& ruiPartAddr );
    520   Void          setInterDirSP( UInt uiDir, UInt uiAbsPartIdx, Int iWidth, Int iHeight );
    521 #endif
    522 #if NH_3D_IV_MERGE
    523   Bool          getInterViewMergeCands          ( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* availableMcDc, Bool bIsDepth           
    524 
    525 #if NH_3D_SPIVMP
    526     , TComMvField* pcMFieldSP, UChar* puhInterDirSP
    527 #endif   
    528     , Bool bICFlag
    529     );   
    530 #endif
    531 #if NH_3D_ARP
     481 
     482  Void          getDisMvpCandNBDV     ( DisInfo* pDInfo, Bool bDepthRefine = false   );   
     483  Void          getDispforDepth       ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* cDisp);
     484
     485  Pel           getMcpFromDM          ( TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iWidth, Int iHeight, Int* aiShiftLUT );
     486  Void          estimateDVFromDM      ( Int refViewIdx, UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred );
     487  Bool          getNeighDepth         ( UInt uiPartIdx, UInt uiPartAddr, Pel* pNeighDepth, Int index);
     488  Void          getSPPara             ( Int iPUWidth   , Int iPUHeight, Int& iNumSP, Int& iNumSPInOneLine, Int& iSPWidth, Int& iSPHeight);
     489  Void          getSPAbsPartIdx       ( UInt uiBaseAbsPartIdx, Int iWidth, Int iHeight, Int iPartIdx, Int iNumPartLine, UInt& ruiPartAddr );
     490  Void          setInterDirSP         ( UInt uiDir    , UInt uiAbsPartIdx, Int iWidth, Int iHeight );
     491  Bool          getInterViewMergeCands( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* availableMcDc, Bool bIsDepth , TComMvField* pcMFieldSP, UChar* puhInterDirSP, Bool bICFlag );   
     492
    532493  UChar*        getARPW            ()              const          { return m_puhARPW;               }
    533494  UChar         getARPW            ( UInt uiIdx )  const          { return m_puhARPW[uiIdx];        }
    534495  Void          setARPW            ( UInt uiIdx, UChar w )   { m_puhARPW[uiIdx] = w;           }
    535496  Void          setARPWSubParts    ( UChar w, UInt uiAbsPartIdx, UInt uiDepth );
    536 #endif
    537 #if NH_3D_IC
     497
    538498  Bool*         getICFlag          ()                        { return m_pbICFlag;               }
    539499  Bool          getICFlag          ( UInt uiIdx )            { return m_pbICFlag[uiIdx];        }
     
    541501  Void          setICFlagSubParts  ( Bool bICFlag,  UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
    542502  Bool          isICFlagRequired   ( UInt uiAbsPartIdx );
    543   Void          getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx = 0, Bool bLCU = false) const;
    544 #elif NH_3D_VSP
    545   Void          getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx = 0, Bool bLCU = false) const;
    546 #else
    547   // -------------------------------------------------------------------------------------------------------------------
    548   // member functions for accessing partition information
    549   // -------------------------------------------------------------------------------------------------------------------
    550 
    551   Void          getPartIndexAndSize           ( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight ) const; // This is for use by a leaf/sub CU object only, with no additional AbsPartIdx
    552 #endif
    553   UChar         getNumPartitions              ( const UInt uiAbsPartIdx = 0 ) const;
    554   Bool          isFirstAbsZorderIdxInDepth    ( UInt uiAbsPartIdx, UInt uiDepth ) const;
    555 
    556 #if NH_3D_DMM
    557   Pel*  getDmmDeltaDC                 ( DmmID dmmType, UInt segId )                      { return m_dmmDeltaDC[dmmType][segId];        }
    558   Pel   getDmmDeltaDC                 ( DmmID dmmType, UInt segId, UInt uiIdx )          { return m_dmmDeltaDC[dmmType][segId][uiIdx]; }
    559   Void  setDmmDeltaDC                 ( DmmID dmmType, UInt segId, UInt uiIdx, Pel val ) { m_dmmDeltaDC[dmmType][segId][uiIdx] = val;  }
    560 
    561   UInt* getDmm1WedgeTabIdx            ()                                                { return m_dmm1WedgeTabIdx;          }       
    562   UInt  getDmm1WedgeTabIdx            ( UInt uiIdx )                                    { return m_dmm1WedgeTabIdx[uiIdx];   }
    563   Void  setDmm1WedgeTabIdx            ( UInt uiIdx, UInt tabIdx )                       { m_dmm1WedgeTabIdx[uiIdx] = tabIdx; }
    564   Void  setDmm1WedgeTabIdxSubParts    ( UInt tabIdx, UInt uiAbsPartIdx, UInt uiDepth );
    565 #endif
    566 #if NH_3D_SDC_INTRA
     503
     504  Pel*          getDmmDeltaDC                 ( DmmID dmmType, UInt segId )                      { return m_dmmDeltaDC[dmmType][segId];        }
     505  Pel           getDmmDeltaDC                 ( DmmID dmmType, UInt segId, UInt uiIdx )          { return m_dmmDeltaDC[dmmType][segId][uiIdx]; }
     506  Void          setDmmDeltaDC                 ( DmmID dmmType, UInt segId, UInt uiIdx, Pel val ) { m_dmmDeltaDC[dmmType][segId][uiIdx] = val;  }
     507
     508  UInt*         getDmm1WedgeTabIdx            ()                                                { return m_dmm1WedgeTabIdx;          }       
     509  UInt          getDmm1WedgeTabIdx            ( UInt uiIdx )                                    { return m_dmm1WedgeTabIdx[uiIdx];   }
     510  Void          setDmm1WedgeTabIdx            ( UInt uiIdx, UInt tabIdx )                       { m_dmm1WedgeTabIdx[uiIdx] = tabIdx; }
     511  Void          setDmm1WedgeTabIdxSubParts    ( UInt tabIdx, UInt uiAbsPartIdx, UInt uiDepth );
     512
    567513  Bool*         getSDCFlag          ()                        { return m_pbSDCFlag;               }
    568514  Bool          getSDCFlag          ( UInt uiIdx )            { return m_pbSDCFlag[uiIdx];        }
    569515  Void          setSDCFlagSubParts  ( Bool bSDCFlag, UInt uiAbsPartIdx, UInt uiDepth );
    570  
     516
    571517  Bool          getSDCAvailable             ( UInt uiAbsPartIdx );
    572  
     518
    573519  Pel*          getSDCSegmentDCOffset( UInt uiSeg ) { return m_apSegmentDCOffset[uiSeg]; }
    574520  Pel           getSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentDCOffset[uiSeg][uiPartIdx]; }
    575521  Void          setSDCSegmentDCOffset( Pel pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentDCOffset[uiSeg][uiPartIdx] = pOffset; }
    576 #endif
     522
     523  Void          xDeriveRightBottomNbIdx(Int &uiLCUIdxRBNb, Int &uiPartIdxRBNb );
     524  Bool          xCheckSpatialNBDV (const TComDataCU* pcTmpCU, UInt uiIdx, DisInfo* pNbDvInfo, Bool bSearchForMvpDv, IDVInfo* paMvpDvInfo, UInt uiMvpDvPos  , Bool bDepthRefine = false  );
     525  Bool          xGetColDisMV      ( Int currCandPic, RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int & iTargetViewIdx, Int & iStartViewIdx );
     526
     527
     528  Void          getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx = 0, Bool bLCU = false) const;
     529#else
     530  Void          getPartIndexAndSize           ( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight ) const; // This is for use by a leaf/sub CU object only, with no additional AbsPartIdx
     531#endif
     532  UChar         getNumPartitions              ( const UInt uiAbsPartIdx = 0 ) const;
     533  Bool          isFirstAbsZorderIdxInDepth    ( UInt uiAbsPartIdx, UInt uiDepth ) const;
    577534 
    578535  // -------------------------------------------------------------------------------------------------------------------
     
    586543  Void          getPartPosition               ( UInt partIdx, Int& xP, Int& yP, Int& nPSW, Int& nPSH ) const;
    587544
    588   Void          setMVPIdx             ( RefPicList eRefPicList, UInt uiIdx, Int iMVPIdx)  { m_apiMVPIdx[eRefPicList][uiIdx] = iMVPIdx;  }
     545  Void          setMVPIdx                     ( RefPicList eRefPicList, UInt uiIdx, Int iMVPIdx)  { m_apiMVPIdx[eRefPicList][uiIdx] = iMVPIdx;  }
    589546  Int           getMVPIdx                     ( RefPicList eRefPicList, UInt uiIdx) const                  { return m_apiMVPIdx[eRefPicList][uiIdx];    }
    590547  SChar*        getMVPIdx                     ( RefPicList eRefPicList )                                   { return m_apiMVPIdx[eRefPicList];           }
    591548
    592   Void          setMVPNum             ( RefPicList eRefPicList, UInt uiIdx, Int iMVPNum ) { m_apiMVPNum[eRefPicList][uiIdx] = iMVPNum;  }
     549  Void          setMVPNum                     ( RefPicList eRefPicList, UInt uiIdx, Int iMVPNum ) { m_apiMVPNum[eRefPicList][uiIdx] = iMVPNum;  }
    593550  Int           getMVPNum                     ( RefPicList eRefPicList, UInt uiIdx ) const                 { return m_apiMVPNum[eRefPicList][uiIdx];    }
    594551  SChar*        getMVPNum                     ( RefPicList eRefPicList )                                   { return m_apiMVPNum[eRefPicList];           }
    595552
    596   Void          setMVPIdxSubParts     ( Int iMVPIdx, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
    597   Void          setMVPNumSubParts     ( Int iMVPNum, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
     553  Void          setMVPIdxSubParts             ( Int iMVPIdx, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
     554  Void          setMVPNumSubParts             ( Int iMVPNum, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
    598555
    599556  Void          clipMv                        ( TComMv&     rcMv     ) const;
    600557
    601 #if NH_MV
    602   Void          checkMvVertRest (TComMv&  rcMv,  RefPicList eRefPicList, int iRefIdx );
    603 #endif
    604558  Void          getMvPredLeft                 ( TComMv&     rcMvPred ) const                               { rcMvPred = m_cMvFieldA.getMv();            }
    605559  Void          getMvPredAbove                ( TComMv&     rcMvPred ) const                               { rcMvPred = m_cMvFieldB.getMv();            }
    606560  Void          getMvPredAboveRight           ( TComMv&     rcMvPred ) const                               { rcMvPred = m_cMvFieldC.getMv();            }
     561
     562#if NH_MV
     563  Void          checkMvVertRest (TComMv&  rcMv,  RefPicList eRefPicList, int iRefIdx );
     564#endif
     565
     566
    607567#if NH_3D
    608568  Void          compressMV            ( Int scale );
     
    619579  TComDataCU*   getCtuAboveLeft             () { return m_pCtuAboveLeft;  }
    620580  TComDataCU*   getCtuAboveRight            () { return m_pCtuAboveRight; }
    621   TComDataCU*   getCUColocated              ( RefPicList eRefPicList ) { return m_apcCUColocated[eRefPicList]; }
    622581  Bool          CUIsFromSameSlice           ( const TComDataCU *pCU /* Can be NULL */) const { return ( pCU!=NULL && pCU->getSlice()->getSliceCurStartCtuTsAddr() == getSlice()->getSliceCurStartCtuTsAddr() ); }
    623582  Bool          CUIsFromSameTile            ( const TComDataCU *pCU /* Can be NULL */) const;
     
    653612  Void          deriveLeftBottomIdx           ( UInt uiPartIdx, UInt& ruiPartIdxLB ) const;
    654613
     614  Bool          hasEqualMotion                ( UInt uiAbsPartIdx, const TComDataCU* pcCandCU, UInt uiCandAbsPartIdx ) const;
     615
    655616#if NH_3D
    656617  Bool          hasEqualMotion              ( Int dirA, const TComMvField* mvFieldA,  Int dirB, const TComMvField* mvFieldB  );
    657 #endif
    658   Bool          hasEqualMotion                ( UInt uiAbsPartIdx, const TComDataCU* pcCandCU, UInt uiCandAbsPartIdx ) const;
    659 
    660 #if NH_3D_MLC
    661618  Bool          getAvailableFlagA1() { return m_bAvailableFlagA1;   }
    662619  Bool          getAvailableFlagB1() { return m_bAvailableFlagB1;   }
     
    664621  Bool          getAvailableFlagA0() { return m_bAvailableFlagA0;   }
    665622  Bool          getAvailableFlagB2() { return m_bAvailableFlagB2;   }
    666   Void          initAvailableFlags() { m_bAvailableFlagA1 = m_bAvailableFlagB1 = m_bAvailableFlagB0 = m_bAvailableFlagA0 = m_bAvailableFlagB2 = 0;  }
    667   Void          buildMCL(TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours
    668 #if NH_3D_VSP
    669     , Int* vspFlag
    670 #endif
    671 #if NH_3D_SPIVMP
    672     , Bool* pbSPIVMPFlag
    673 #endif
    674     , Int& numValidMergeCand
    675     );
    676   Void          xGetInterMergeCandidates      ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours
    677 #if NH_3D_SPIVMP
    678   , TComMvField* pcMvFieldSP, UChar* puhInterDirSP
    679 #endif
    680   , Int& numValidMergeCand, Int mrgCandIdx = -1 );
    681 #endif
    682 #if NH_3D
    683   Void          getInterMergeCandidates       ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx = -1 );
     623 
     624  Void          initAvailableFlags() { m_bAvailableFlagA1 = m_bAvailableFlagB1 = m_bAvailableFlagB0 = m_bAvailableFlagA0 = m_bAvailableFlagB2 = 0;  } 
     625 
     626  Void          buildMCL(TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag, Bool* pbSPIVMPFlag , Int& numValidMergeCand    ); 
     627  Void          xGetInterMergeCandidates      ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, TComMvField* pcMvFieldSP, UChar* puhInterDirSP, Int& numValidMergeCand, Int mrgCandIdx = -1 );
     628#endif
     629
     630#if MCTS_ENC_CHECK
     631  Void          getInterMergeCandidates       ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, UInt& numSpatialMergeCandidates , Int mrgCandIdx = -1)
    684632#else
    685   Void          getInterMergeCandidates       ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx = -1 ) const;
    686 #endif
    687 
    688 #if NH_3D_VSP
    689 #if NH_3D_SPIVMP
     633  Void          getInterMergeCandidates       ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx = -1 )
     634#endif
     635#if !NH_3D
     636  const
     637#endif
     638;
     639#if NH_3D
    690640  Bool*         getSPIVMPFlag        ()                        const { return m_pbSPIVMPFlag;          }
    691641  Bool          getSPIVMPFlag        ( UInt uiIdx )            const { return m_pbSPIVMPFlag[uiIdx];   }
    692642  Void          setSPIVMPFlag        ( UInt uiIdx, Bool n )     { m_pbSPIVMPFlag[uiIdx] = n;      }
    693643  Void          setSPIVMPFlagSubParts( Bool bSPIVMPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
    694 #endif
    695644
    696645  SChar*        getVSPFlag        ()                        const { return m_piVSPFlag;          }
     
    729678  UInt          getCtxSkipFlag                ( UInt   uiAbsPartIdx ) const;
    730679  UInt          getCtxInterDir                ( UInt   uiAbsPartIdx ) const;
    731 #if NH_3D_ARP
     680#if NH_3D
    732681  UInt          getCTXARPWFlag                  ( UInt   uiAbsPartIdx                                 );
    733682#endif 
  • trunk/source/Lib/TLibCommon/TComInterpolationFilter.cpp

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    4747#include "TComChromaFormat.h"
    4848
     49#if VECTOR_CODING__INTERPOLATION_FILTER && (RExt__HIGH_BIT_DEPTH_SUPPORT==0)
     50#include <emmintrin.h>
     51#endif
    4952
    5053//! \ingroup TLibCommon
     
    7578};
    7679
    77 #if NH_3D_ARP
     80#if VECTOR_CODING__INTERPOLATION_FILTER && (RExt__HIGH_BIT_DEPTH_SUPPORT==0)
     81inline __m128i simdInterpolateLuma4( Short const *src , Int srcStride , __m128i *mmCoeff , const __m128i & mmOffset , Int shift )
     82{
     83  __m128i sumHi = _mm_setzero_si128();
     84  __m128i sumLo = _mm_setzero_si128();
     85  for( Int n = 0 ; n < 8 ; n++ )
     86  {
     87    __m128i mmPix = _mm_loadl_epi64( ( __m128i* )src );
     88    __m128i hi = _mm_mulhi_epi16( mmPix , mmCoeff[n] );
     89    __m128i lo = _mm_mullo_epi16( mmPix , mmCoeff[n] );
     90    sumHi = _mm_add_epi32( sumHi , _mm_unpackhi_epi16( lo , hi ) );
     91    sumLo = _mm_add_epi32( sumLo , _mm_unpacklo_epi16( lo , hi ) );
     92    src += srcStride;
     93  }
     94  sumHi = _mm_srai_epi32( _mm_add_epi32( sumHi , mmOffset ) , shift );
     95  sumLo = _mm_srai_epi32( _mm_add_epi32( sumLo , mmOffset ) , shift );
     96  return( _mm_packs_epi32( sumLo , sumHi ) );
     97}
     98
     99inline __m128i simdInterpolateChroma4( Short const *src , Int srcStride , __m128i *mmCoeff , const __m128i & mmOffset , Int shift )
     100{
     101  __m128i sumHi = _mm_setzero_si128();
     102  __m128i sumLo = _mm_setzero_si128();
     103  for( Int n = 0 ; n < 4 ; n++ )
     104  {
     105    __m128i mmPix = _mm_loadl_epi64( ( __m128i* )src );
     106    __m128i hi = _mm_mulhi_epi16( mmPix , mmCoeff[n] );
     107    __m128i lo = _mm_mullo_epi16( mmPix , mmCoeff[n] );
     108    sumHi = _mm_add_epi32( sumHi , _mm_unpackhi_epi16( lo , hi ) );
     109    sumLo = _mm_add_epi32( sumLo , _mm_unpacklo_epi16( lo , hi ) );
     110    src += srcStride;
     111  }
     112  sumHi = _mm_srai_epi32( _mm_add_epi32( sumHi , mmOffset ) , shift );
     113  sumLo = _mm_srai_epi32( _mm_add_epi32( sumLo , mmOffset ) , shift );
     114  return( _mm_packs_epi32( sumLo , sumHi ) );
     115}
     116
     117inline __m128i simdInterpolateLuma8( Short const *src , Int srcStride , __m128i *mmCoeff , const __m128i & mmOffset , Int shift )
     118{
     119  __m128i sumHi = _mm_setzero_si128();
     120  __m128i sumLo = _mm_setzero_si128();
     121  for( Int n = 0 ; n < 8 ; n++ )
     122  {
     123    __m128i mmPix = _mm_loadu_si128( ( __m128i* )src );
     124    __m128i hi = _mm_mulhi_epi16( mmPix , mmCoeff[n] );
     125    __m128i lo = _mm_mullo_epi16( mmPix , mmCoeff[n] );
     126    sumHi = _mm_add_epi32( sumHi , _mm_unpackhi_epi16( lo , hi ) );
     127    sumLo = _mm_add_epi32( sumLo , _mm_unpacklo_epi16( lo , hi ) );
     128    src += srcStride;
     129  }
     130  sumHi = _mm_srai_epi32( _mm_add_epi32( sumHi , mmOffset ) , shift );
     131  sumLo = _mm_srai_epi32( _mm_add_epi32( sumLo , mmOffset ) , shift );
     132  return( _mm_packs_epi32( sumLo , sumHi ) );
     133}
     134
     135inline __m128i simdInterpolateLuma2P8( Short const *src , Int srcStride , __m128i *mmCoeff , const __m128i & mmOffset , Int shift )
     136{
     137  __m128i sumHi = _mm_setzero_si128();
     138  __m128i sumLo = _mm_setzero_si128();
     139  for( Int n = 0 ; n < 2 ; n++ )
     140  {
     141    __m128i mmPix = _mm_loadu_si128( ( __m128i* )src );
     142    __m128i hi = _mm_mulhi_epi16( mmPix , mmCoeff[n] );
     143    __m128i lo = _mm_mullo_epi16( mmPix , mmCoeff[n] );
     144    sumHi = _mm_add_epi32( sumHi , _mm_unpackhi_epi16( lo , hi ) );
     145    sumLo = _mm_add_epi32( sumLo , _mm_unpacklo_epi16( lo , hi ) );
     146    src += srcStride;
     147  }
     148  sumHi = _mm_srai_epi32( _mm_add_epi32( sumHi , mmOffset ) , shift );
     149  sumLo = _mm_srai_epi32( _mm_add_epi32( sumLo , mmOffset ) , shift );
     150  return( _mm_packs_epi32( sumLo , sumHi ) );
     151}
     152
     153inline __m128i simdInterpolateLuma2P4( Short const *src , Int srcStride , __m128i *mmCoeff , const __m128i & mmOffset , Int shift )
     154{
     155  __m128i sumHi = _mm_setzero_si128();
     156  __m128i sumLo = _mm_setzero_si128();
     157  for( Int n = 0 ; n < 2 ; n++ )
     158  {
     159    __m128i mmPix = _mm_loadl_epi64( ( __m128i* )src );
     160    __m128i hi = _mm_mulhi_epi16( mmPix , mmCoeff[n] );
     161    __m128i lo = _mm_mullo_epi16( mmPix , mmCoeff[n] );
     162    sumHi = _mm_add_epi32( sumHi , _mm_unpackhi_epi16( lo , hi ) );
     163    sumLo = _mm_add_epi32( sumLo , _mm_unpacklo_epi16( lo , hi ) );
     164    src += srcStride;
     165  }
     166  sumHi = _mm_srai_epi32( _mm_add_epi32( sumHi , mmOffset ) , shift );
     167  sumLo = _mm_srai_epi32( _mm_add_epi32( sumLo , mmOffset ) , shift );
     168  return( _mm_packs_epi32( sumLo , sumHi ) );
     169}
     170
     171inline __m128i simdClip3( __m128i mmMin , __m128i mmMax , __m128i mmPix )
     172{
     173  __m128i mmMask = _mm_cmpgt_epi16( mmPix , mmMin );
     174  mmPix = _mm_or_si128( _mm_and_si128( mmMask , mmPix ) , _mm_andnot_si128( mmMask , mmMin ) );
     175  mmMask = _mm_cmplt_epi16( mmPix , mmMax );
     176  mmPix = _mm_or_si128( _mm_and_si128( mmMask , mmPix ) , _mm_andnot_si128( mmMask , mmMax ) );
     177  return( mmPix );
     178}
     179#endif
     180
     181#if NH_3D
    78182const Short TComInterpolationFilter::m_lumaFilterARP[4][NTAPS_LUMA_ARP] =
    79183{
     
    240344  }
    241345
     346#if VECTOR_CODING__INTERPOLATION_FILTER && (RExt__HIGH_BIT_DEPTH_SUPPORT==0)
     347  if( bitDepth <= 10 )
     348  {
     349    if( N == 8 && !( width & 0x07 ) )
     350    {
     351      Short minVal = 0;
     352      __m128i mmOffset = _mm_set1_epi32( offset );
     353      __m128i mmCoeff[8];
     354      __m128i mmMin = _mm_set1_epi16( minVal );
     355      __m128i mmMax = _mm_set1_epi16( maxVal );
     356      for( Int n = 0 ; n < 8 ; n++ )
     357        mmCoeff[n] = _mm_set1_epi16( c[n] );
     358      for( row = 0 ; row < height ; row++ )
     359      {
     360        for( col = 0 ; col < width ; col += 8 )
     361        {
     362          __m128i mmFiltered = simdInterpolateLuma8( src + col , cStride , mmCoeff , mmOffset , shift );
     363          if( isLast )
     364          {
     365            mmFiltered = simdClip3( mmMin , mmMax , mmFiltered );
     366          }
     367          _mm_storeu_si128( ( __m128i * )( dst + col ) , mmFiltered );
     368        }
     369        src += srcStride;
     370        dst += dstStride;
     371      }
     372      return;
     373    }
     374    else if( N == 8 && !( width & 0x03 ) )
     375    {
     376      Short minVal = 0;
     377      __m128i mmOffset = _mm_set1_epi32( offset );
     378      __m128i mmCoeff[8];
     379      __m128i mmMin = _mm_set1_epi16( minVal );
     380      __m128i mmMax = _mm_set1_epi16( maxVal );
     381      for( Int n = 0 ; n < 8 ; n++ )
     382        mmCoeff[n] = _mm_set1_epi16( c[n] );
     383      for( row = 0 ; row < height ; row++ )
     384      {
     385        for( col = 0 ; col < width ; col += 4 )
     386        {
     387          __m128i mmFiltered = simdInterpolateLuma4( src + col , cStride , mmCoeff , mmOffset , shift );
     388          if( isLast )
     389          {
     390            mmFiltered = simdClip3( mmMin , mmMax , mmFiltered );
     391          }
     392          _mm_storel_epi64( ( __m128i * )( dst + col ) , mmFiltered );
     393        }
     394        src += srcStride;
     395        dst += dstStride;
     396      }
     397      return;
     398    }
     399    else if( N == 4 && !( width & 0x03 ) )
     400    {
     401      Short minVal = 0;
     402      __m128i mmOffset = _mm_set1_epi32( offset );
     403      __m128i mmCoeff[8];
     404      __m128i mmMin = _mm_set1_epi16( minVal );
     405      __m128i mmMax = _mm_set1_epi16( maxVal );
     406      for( Int n = 0 ; n < 4 ; n++ )
     407        mmCoeff[n] = _mm_set1_epi16( c[n] );
     408      for( row = 0 ; row < height ; row++ )
     409      {
     410        for( col = 0 ; col < width ; col += 4 )
     411        {
     412          __m128i mmFiltered = simdInterpolateChroma4( src + col , cStride , mmCoeff , mmOffset , shift );
     413          if( isLast )
     414          {
     415            mmFiltered = simdClip3( mmMin , mmMax , mmFiltered );
     416          }
     417          _mm_storel_epi64( ( __m128i * )( dst + col ) , mmFiltered );
     418        }
     419        src += srcStride;
     420        dst += dstStride;
     421      }
     422      return;
     423    }
     424    else if( N == 2 && !( width & 0x07 ) )
     425    {
     426      Short minVal = 0;
     427      __m128i mmOffset = _mm_set1_epi32( offset );
     428      __m128i mmCoeff[2];
     429      __m128i mmMin = _mm_set1_epi16( minVal );
     430      __m128i mmMax = _mm_set1_epi16( maxVal );
     431      for( Int n = 0 ; n < 2 ; n++ )
     432        mmCoeff[n] = _mm_set1_epi16( c[n] );
     433      for( row = 0 ; row < height ; row++ )
     434      {
     435        for( col = 0 ; col < width ; col += 8 )
     436        {
     437          __m128i mmFiltered = simdInterpolateLuma2P8( src + col , cStride , mmCoeff , mmOffset , shift );
     438          if( isLast )
     439          {
     440            mmFiltered = simdClip3( mmMin , mmMax , mmFiltered );
     441          }
     442          _mm_storeu_si128( ( __m128i * )( dst + col ) , mmFiltered );
     443        }
     444        src += srcStride;
     445        dst += dstStride;
     446      }
     447      return;
     448    }
     449    else if( N == 2 && !( width & 0x03 ) )
     450    {
     451      Short minVal = 0;
     452      __m128i mmOffset = _mm_set1_epi32( offset );
     453      __m128i mmCoeff[8];
     454      __m128i mmMin = _mm_set1_epi16( minVal );
     455      __m128i mmMax = _mm_set1_epi16( maxVal );
     456      for( Int n = 0 ; n < 2 ; n++ )
     457        mmCoeff[n] = _mm_set1_epi16( c[n] );
     458      for( row = 0 ; row < height ; row++ )
     459      {
     460        for( col = 0 ; col < width ; col += 4 )
     461        {
     462          __m128i mmFiltered = simdInterpolateLuma2P4( src + col , cStride , mmCoeff , mmOffset , shift );
     463          if( isLast )
     464          {
     465            mmFiltered = simdClip3( mmMin , mmMax , mmFiltered );
     466          }
     467          _mm_storel_epi64( ( __m128i * )( dst + col ) , mmFiltered );
     468        }
     469        src += srcStride;
     470        dst += dstStride;
     471      }
     472      return;
     473    }
     474  }
     475#endif
     476
    242477  for (row = 0; row < height; row++)
    243478  {
     
    360595 * \param  bitDepth   Bit depth
    361596 */
    362 #if NH_3D_ARP
     597#if NH_3D
    363598Void TComInterpolationFilter::filterHor(const ComponentID compID, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast, const ChromaFormat fmt, const Int bitDepth, Bool filterType )
    364599#else
     
    374609  {
    375610    assert(frac >= 0 && frac < LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS);
    376 #if NH_3D_ARP
     611#if NH_3D
    377612    if(filterType)
    378613    {
     
    383618#endif
    384619    filterHor<NTAPS_LUMA>(bitDepth, src, srcStride, dst, dstStride, width, height, isLast, m_lumaFilter[frac]);
    385 #if NH_3D_ARP
     620#if NH_3D
    386621    }
    387622#endif
     
    392627    const UInt csx = getComponentScaleX(compID, fmt);
    393628    assert(frac >=0 && csx<2 && (frac<<(1-csx)) < CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS);
    394 #if NH_3D_ARP
     629#if NH_3D
    395630    if(filterType)
    396631    {
     
    401636#endif
    402637    filterHor<NTAPS_CHROMA>(bitDepth, src, srcStride, dst, dstStride, width, height, isLast, m_chromaFilter[frac<<(1-csx)]);
    403 #if NH_3D_ARP
     638#if NH_3D
    404639    }
    405640#endif
     
    424659 * \param  bitDepth   Bit depth
    425660 */
    426 #if NH_3D_ARP
     661#if NH_3D
    427662Void TComInterpolationFilter::filterVer(const ComponentID compID, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast, const ChromaFormat fmt, const Int bitDepth, Bool filterType )
    428663#else
     
    437672  {
    438673    assert(frac >= 0 && frac < LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS);
    439 #if NH_3D_ARP
     674#if NH_3D
    440675    if(filterType)
    441676    {
     
    445680    {
    446681#endif
    447     filterVer<NTAPS_LUMA>(bitDepth, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_lumaFilter[frac]);
    448 #if NH_3D_ARP
     682      filterVer<NTAPS_LUMA>(bitDepth, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_lumaFilter[frac]);
     683#if NH_3D
    449684    }
    450685#endif
     
    455690    const UInt csy = getComponentScaleY(compID, fmt);
    456691    assert(frac >=0 && csy<2 && (frac<<(1-csy)) < CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS);
    457 #if NH_3D_ARP
     692#if NH_3D
    458693    if(filterType)
    459694    {
     
    463698    {
    464699#endif
    465     filterVer<NTAPS_CHROMA>(bitDepth, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_chromaFilter[frac<<(1-csy)]);
    466 #if NH_3D_ARP
    467     }
    468 #endif
    469     }
    470     }
     700      filterVer<NTAPS_CHROMA>(bitDepth, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_chromaFilter[frac<<(1-csy)]);
     701#if NH_3D
     702    }
     703#endif
     704  }
     705}
    471706//! \}
  • trunk/source/Lib/TLibCommon/TComInterpolationFilter.h

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    4545//! \{
    4646
    47 #if NH_3D_ARP
     47#if NH_3D
    4848#define NTAPS_LUMA_ARP    2 ///< Number of taps for luma
    4949#define NTAPS_CHROMA_ARP  2 ///< Number of taps for chroma
     
    6363  static const TFilterCoeff m_lumaFilter[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_LUMA];     ///< Luma filter taps
    6464  static const TFilterCoeff m_chromaFilter[CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_CHROMA]; ///< Chroma filter taps
    65 #if NH_3D_ARP
     65#if NH_3D
    6666  static const Short m_lumaFilterARP  [4][NTAPS_LUMA_ARP];     ///< Luma filter taps for ARP
    6767  static const Short m_chromaFilterARP[8][NTAPS_CHROMA_ARP];   ///< Chroma filter taps for ARP
     
    8282  ~TComInterpolationFilter() {}
    8383
    84 #if NH_3D_ARP
     84#if NH_3D
    8585  Void filterHor(const ComponentID compID, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Int frac,               Bool isLast, const ChromaFormat fmt, const Int bitDepth , Bool filterType = false );
    8686#else
     
    8888#endif
    8989
    90 #if NH_3D_ARP
     90#if NH_3D
    9191  Void filterVer(const ComponentID compID, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Int frac,               Bool isFirst, Bool isLast, const ChromaFormat fmt, const Int bitDepth , Bool filterType = false );
    9292#else
  • trunk/source/Lib/TLibCommon/TComList.h

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComLoopFilter.cpp

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    561561        Pel        *piTmpSrc                      = piSrc;
    562562  const TComSPS    &sps                           = *(pcCU->getSlice()->getSPS());
    563   const Bool        ppsTransquantBypassEnableFlag = pcCU->getSlice()->getPPS()->getTransquantBypassEnableFlag();
     563  const Bool        ppsTransquantBypassEnabledFlag = pcCU->getSlice()->getPPS()->getTransquantBypassEnabledFlag();
    564564  const Int         bitDepthLuma                  = sps.getBitDepth(CHANNEL_TYPE_LUMA);
    565565  const Bool        lfCrossSliceBoundaryFlag      = pcCU->getSlice()->getLFCrossSliceBoundaryFlag();
     
    644644        Int d =  d0 + d3;
    645645
    646         if (bPCMFilter || ppsTransquantBypassEnableFlag)
     646        if (bPCMFilter || ppsTransquantBypassEnabledFlag)
    647647        {
    648648          // Check if each of PUs is I_PCM with LF disabling
     
    769769      iQP_P = pcCUP->getQP(uiPartPIdx);
    770770
    771       if (bPCMFilter || pcCU->getSlice()->getPPS()->getTransquantBypassEnableFlag())
     771      if (bPCMFilter || pcCU->getSlice()->getPPS()->getTransquantBypassEnabledFlag())
    772772      {
    773773        // Check if each of PUs is I_PCM with LF disabling
  • trunk/source/Lib/TLibCommon/TComLoopFilter.h

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComMotionInfo.cpp

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    4040#include "assert.h"
    4141#include <stdlib.h>
    42 #if NH_3D_SPIVMP
     42#if NH_3D
    4343#include "TComDataCU.h"
    4444#include "TComPic.h"
     
    330330}
    331331
    332 #if NH_3D_SPIVMP
     332#if NH_3D
    333333Void TComCUMvField::setMvFieldSP( TComDataCU* pcCU, UInt uiAbsPartIdx, TComMvField cMvField, Int iWidth, Int iHeight  )
    334334{
     
    358358 * \param scale      Factor by which to subsample motion information
    359359 */
     360#if REDUCED_ENCODER_MEMORY
     361Void TComCUMvField::compress(SChar *pePredMode, const SChar* pePredModeSource, const Int scale, const TComCUMvField &source)
     362{
     363  const Int numSubpartsWithIdenticalMotion = scale * scale;
     364  assert( numSubpartsWithIdenticalMotion > 0 && numSubpartsWithIdenticalMotion <= m_uiNumPartition);
     365  assert(source.m_uiNumPartition == m_uiNumPartition);
     366
     367  for ( Int partIdx = 0; partIdx < m_uiNumPartition; partIdx += numSubpartsWithIdenticalMotion )
     368  {
     369    TComMv cMv(0,0);
     370    Int iRefIdx = 0;
     371
     372    cMv = source.m_pcMv[ partIdx ];
     373    PredMode predMode = static_cast<PredMode>( pePredModeSource[ partIdx ] );
     374    iRefIdx = source.m_piRefIdx[ partIdx ];
     375    for ( Int i = 0; i < numSubpartsWithIdenticalMotion; i++ )
     376    {
     377      m_pcMv[ partIdx + i ] = cMv;
     378      pePredMode[ partIdx + i ] = predMode;
     379      m_piRefIdx[ partIdx + i ] = iRefIdx;
     380    }
     381  }
     382}
     383#else
     384
    360385Void TComCUMvField::compress(SChar* pePredMode, Int scale)
    361386{
     
    379404  }
    380405}
     406#endif
    381407
    382408#if NH_MV
     
    405431}
    406432
    407 #if NH_3D_MLC
     433#if NH_3D
    408434Void TComMotionCand::print( Int i )
    409435{
  • trunk/source/Lib/TLibCommon/TComMotionInfo.h

    r1405 r1413  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    5151// ====================================================================================================================
    5252
    53 #if NH_3D_SPIVMP
     53#if NH_3D
    5454class TComDataCU;
    5555#endif
     
    5959  TComMv m_acMvCand[ AMVP_MAX_NUM_CANDS ];  ///< array of motion vector predictor candidates
    6060  Int    iN;                                ///< number of motion vector predictor candidates
     61#if MCTS_ENC_CHECK
     62  UInt   numSpatialMVPCandidates;
     63#endif
    6164} AMVPInfo;
    6265
    63 #if NH_3D_NBDV
     66#if NH_3D
    6467typedef struct _DisCand
    6568{
    6669  TComMv m_acNBDV;              // DV from NBDV
    67 #if NH_3D_NBDV_REF
    6870  TComMv m_acDoNBDV;            // DV from DoNBDV
    69 #endif 
    7071  Int    m_aVIdxCan;            // View order index (the same with the NBDV and the DoNBDV)
    7172} DisInfo;
     
    108109  Int getHor   () const { return  m_acMv.getHor(); }
    109110  Int getVer   () const { return  m_acMv.getVer(); }
    110 #if NH_3D_IV_MERGE
     111#if NH_3D
    111112  Bool operator== ( const TComMvField& rcMv ) const
    112113  {
     
    168169  Void    setAllRefIdx ( Int iRefIdx,                 PartSize eMbMode, Int iPartAddr, UInt uiDepth, Int iPartIdx=0 );
    169170  Void    setAllMvField( TComMvField const & mvField, PartSize eMbMode, Int iPartAddr, UInt uiDepth, Int iPartIdx=0 );
    170 #if NH_3D_SPIVMP
     171#if NH_3D
    171172  Void    setMvFieldSP ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComMvField cMvField, Int iWidth, Int iHeight  );
    172 #endif
    173 #if NH_3D_VSP
    174173  Void    setMv         ( Int iIdx, TComMv const & rcMv ) { m_pcMv[iIdx] = rcMv; }
    175174  Void    setRefIdx     ( Int iIdx, Int iRefIdx )         { m_piRefIdx[iIdx] = iRefIdx; }
     
    188187  }
    189188 
     189#if REDUCED_ENCODER_MEMORY
     190  Void compress(SChar *pePredMode, const SChar* pePredModeSource, const Int scale, const TComCUMvField &source);
     191#else
    190192  Void compress(SChar* pePredMode, Int scale);
     193#endif
    191194#if NH_MV
    192195  Void print   (SChar* pePredMode);
     
    196199//! \}
    197200
    198 #if NH_3D_MLC
     201#if NH_3D
    199202/// class for container of merge candidate
    200203class TComMotionCand
     
    204207  TComMvField           m_cMvField[2];
    205208  UChar                 m_uDir;
    206 #if NH_3D_VSP
    207209  Int                   m_iVspFlag;
    208 #endif
    209 #if NH_3D_SPIVMP
    210210  Bool                  m_bSPIVMPFlag;
    211 #endif
    212211
    213212public:
     
    216215    m_bAvailable = false;
    217216    m_uDir = 0;
    218 #if NH_3D_VSP
    219217    m_iVspFlag = 0;
    220 #endif
    221 #if NH_3D_SPIVMP
    222218    m_bSPIVMPFlag = false;
    223 #endif
    224219  }
    225220
     
    235230    m_bAvailable = false;
    236231    m_uDir = 0;
    237 #if NH_3D_VSP
    238232    m_iVspFlag = 0;
    239 #endif
    240 #if NH_3D_SPIVMP
    241233    m_bSPIVMPFlag = false;
    242 #endif
    243234    m_cMvField[0].setMvField(cZeroMv, NOT_VALID);
    244235    m_cMvField[1].setMvField(cZeroMv, NOT_VALID);
    245236  }
    246237
    247   Void setCand(TComMvField* pcMvFieldNeighbours, UChar uhInterDirNeighbours
    248 #if NH_3D_VSP
    249     , Int vspFlag
    250 #endif
    251 #if NH_3D_SPIVMP
    252     , Bool bSPIVMPFlag
    253 #endif
    254     )
     238  Void setCand(TComMvField* pcMvFieldNeighbours, UChar uhInterDirNeighbours, Int vspFlag, Bool bSPIVMPFlag )
    255239  {
    256240    m_bAvailable = true;
     
    258242    m_cMvField[1] = pcMvFieldNeighbours[1];
    259243    m_uDir = uhInterDirNeighbours;
    260 #if NH_3D_VSP
    261244    m_iVspFlag = vspFlag;
    262 #endif
    263 #if NH_3D_SPIVMP
    264245    m_bSPIVMPFlag = bSPIVMPFlag;
    265 #endif
    266   }
    267  
    268   Void getCand(Int iCount, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours
    269 #if NH_3D_VSP
    270     , Int* vspFlag
    271 #endif
    272 #if NH_3D_SPIVMP
    273     , Bool* pbSPIVMPFlag
    274 #endif
    275     )
     246  }
     247 
     248  Void getCand(Int iCount, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag , Bool* pbSPIVMPFlag )
    276249  {
    277250    pcMvFieldNeighbours[iCount<<1] = m_cMvField[0];
    278251    pcMvFieldNeighbours[(iCount<<1) + 1] = m_cMvField[1];
    279252    puhInterDirNeighbours[iCount] = m_uDir;
    280 #if NH_3D_VSP
    281253    vspFlag[iCount] = m_iVspFlag;
    282 #endif
    283 #if NH_3D_SPIVMP
    284254    pbSPIVMPFlag[iCount] = m_bSPIVMPFlag;
    285 #endif
    286   }
    287 
    288 
     255  }
    289256  Void print( Int i );
    290 
    291257};
    292258
  • trunk/source/Lib/TLibCommon/TComMv.h

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    5757  Short m_iHor;     ///< horizontal component of motion vector
    5858  Short m_iVer;     ///< vertical component of motion vector
    59 #if NH_3D_NBDV
     59#if NH_3D
    6060  Bool  m_bIDV;       
    6161  Short m_iIDVHor;   
     
    7272  m_iHor(0),
    7373  m_iVer(0)
    74 #if NH_3D_NBDV
     74#if NH_3D
    7575  , m_bIDV(false)
    7676  , m_iIDVHor(0)
     
    8484  m_iHor(iHor),
    8585  m_iVer(iVer)
    86  #if NH_3D_NBDV
     86 #if NH_3D
    8787  , m_bIDV(false)
    8888  , m_iIDVHor(0)
     
    100100  Void  setHor    ( Short i )                   { m_iHor = i;                               }
    101101  Void  setVer    ( Short i )                   { m_iVer = i;                               }
    102 #if NH_3D_NBDV
     102#if NH_3D
    103103  Void  setZero   ()                            { m_iHor = m_iVer = 0; m_bIDV = false; m_iIDVHor = m_iIDVVer = 0; m_iIDVVId = 0;  }
    104104  Void   setIDVHor  (Short i)                    {m_iIDVHor = i;}
     
    117117  Int   getAbsHor () const { return abs( m_iHor );   }
    118118  Int   getAbsVer () const { return abs( m_iVer );   }
    119 #if NH_3D_NBDV
     119#if NH_3D
    120120  Short getIDVHor () const { return m_iIDVHor;       }
    121121  Short getIDVVer () const { return m_iIDVVer;       }
  • trunk/source/Lib/TLibCommon/TComPattern.cpp

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    7474
    7575// ====================================================================================================================
    76 // Public member functions (TComPatternParam)
    77 // ====================================================================================================================
    78 
    79 /**
    80  \param  piTexture     pixel data
    81  \param  iRoiWidth     pattern width
    82  \param  iRoiHeight    pattern height
    83  \param  iStride       buffer stride
    84  \param  bitDepth      bit depth
    85  */
    86 Void TComPatternParam::setPatternParamPel ( Pel* piTexture,
    87                                            Int iRoiWidth,
    88                                            Int iRoiHeight,
    89                                            Int iStride,
    90                                            Int bitDepth
    91                                            )
    92 {
    93   m_piROIOrigin    = piTexture;
    94   m_iROIWidth      = iRoiWidth;
    95   m_iROIHeight     = iRoiHeight;
    96   m_iPatternStride = iStride;
    97   m_bitDepth       = bitDepth;
    98 }
    99 
    100 // ====================================================================================================================
    10176// Public member functions (TComPattern)
    10277// ====================================================================================================================
    10378
     79#if MCTS_ENC_CHECK
     80Void TComPattern::initPattern(Pel* piY,
     81                              Int roiWidth,
     82                              Int roiHeight,
     83                              Int stride,
     84                              Int bitDepthLuma,
     85                              Int roiPosX,
     86                              Int roiPosY)
     87#else
    10488Void TComPattern::initPattern (Pel* piY,
    105                                Int iRoiWidth,
    106                                Int iRoiHeight,
    107                                Int iStride,
     89                               Int roiWidth,
     90                               Int roiHeight,
     91                               Int stride,
    10892                               Int bitDepthLuma)
    109 {
    110   m_cPatternY. setPatternParamPel( piY,  iRoiWidth, iRoiHeight, iStride, bitDepthLuma);
    111 }
     93#endif
     94{
     95  m_piROIOrigin = piY;
     96  m_roiWidth = roiWidth;
     97  m_roiHeight = roiHeight;
     98  m_patternStride = stride;
     99  m_bitDepth = bitDepthLuma;
     100#if MCTS_ENC_CHECK
     101  m_roiPosX       = roiPosX;
     102  m_roiPosY       = roiPosY;
     103#endif
     104}
     105
     106#if MCTS_ENC_CHECK
     107Void TComPattern::setTileBorders(Int tileLeftTopPelPosX, Int tileLeftTopPelPosY, Int tileRightBottomPelPosX, Int tileRightBottomPelPosY)
     108{
     109  m_tileLeftTopPelPosX = tileLeftTopPelPosX;
     110  m_tileLeftTopPelPosY = tileLeftTopPelPosY;
     111  m_tileRightBottomPelPosX = tileRightBottomPelPosX;
     112  m_tileRightBottomPelPosY = tileRightBottomPelPosY;
     113}
     114#endif
    112115
    113116
  • trunk/source/Lib/TLibCommon/TComPattern.h

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    5252class TComTU;
    5353
    54 /// neighbouring pixel access class for one component
    55 class TComPatternParam
     54/// neighbouring pixel access class for all components
     55class TComPattern
    5656{
    5757private:
    5858  Pel*  m_piROIOrigin;
     59  Int   m_roiWidth;
     60  Int   m_roiHeight;
     61  Int   m_patternStride;
     62  Int   m_bitDepth;
     63
     64#if MCTS_ENC_CHECK 
     65  Int   m_roiPosX;
     66  Int   m_roiPosY;
     67  Int   m_tileLeftTopPelPosX;
     68  Int   m_tileLeftTopPelPosY;
     69  Int   m_tileRightBottomPelPosX;
     70  Int   m_tileRightBottomPelPosY;
     71#endif
    5972
    6073public:
    61   Int   m_iROIWidth;
    62   Int   m_iROIHeight;
    63   Int   m_iPatternStride;
    64   Int   m_bitDepth;
     74  // ROI & pattern information, (ROI = &pattern[AboveOffset][LeftOffset])
     75  Int   getROIYWidth() const      { return m_roiWidth;       }
     76  Int   getROIYHeight() const     { return m_roiHeight;      }
     77  Int   getPatternLStride() const { return m_patternStride;  }
     78  Int   getBitDepthY() const      { return m_bitDepth;       }
     79#if MCTS_ENC_CHECK
     80  Int   getROIYPosX() const       { return m_roiPosX; }
     81  Int   getROIYPosY() const       { return m_roiPosY; }
    6582
    66   /// return starting position of ROI (ROI = &pattern[AboveOffset][LeftOffset])
    67   __inline Pel*  getROIOrigin()
     83  Int   getTileLeftTopPelPosX() const { return m_tileLeftTopPelPosX; }
     84  Int   getTileLeftTopPelPosY() const { return m_tileLeftTopPelPosY; }
     85  Int   getTileRightBottomPelPosX() const { return m_tileRightBottomPelPosX; }
     86  Int   getTileRightBottomPelPosY() const { return m_tileRightBottomPelPosY; }
     87#endif
     88
     89  __inline Pel*  getROIY()
    6890  {
    6991    return  m_piROIOrigin;
    7092  }
    71   __inline const Pel*  getROIOrigin() const
     93  __inline const Pel*  getROIY() const
    7294  {
    7395    return  m_piROIOrigin;
    7496  }
    7597
    76   /// set parameters from Pel buffer for accessing neighbouring pixels
    77   Void setPatternParamPel( Pel* piTexture, Int iRoiWidth, Int iRoiHeight, Int iStride, Int bitDepth );
    78 };
     98#if NH_3D
     99  Bool              m_bICFlag;
     100  Bool              m_bSDCMRSADFlag;
    79101
    80 /// neighbouring pixel access class for all components
    81 class TComPattern
    82 {
    83 private:
    84   TComPatternParam  m_cPatternY;
    85 //  TComPatternParam  m_cPatternCb;
    86   //TComPatternParam  m_cPatternCr;
    87 #if NH_3D_IC
    88   Bool              m_bICFlag;
    89 #endif
    90 #if NH_3D_SDC_INTER
    91   Bool              m_bSDCMRSADFlag;
     102  Bool  getICFlag()               const { return m_bICFlag; }
     103  Void  setICFlag( Bool bICFlag ) { m_bICFlag = bICFlag; }
     104  Bool  getSDCMRSADFlag()         const { return m_bSDCMRSADFlag; }
     105  Void  setSDCMRSADFlag( Bool bSDCMRSADFlag )    { m_bSDCMRSADFlag = bSDCMRSADFlag; }
    92106#endif
    93107
    94108
    95 public:
     109  TComPattern()
     110  : m_piROIOrigin(NULL)
     111  , m_roiWidth(0)
     112  , m_roiHeight(0)
     113  , m_patternStride(0)
     114  , m_bitDepth(0)
     115#if MCTS_ENC_CHECK
     116  , m_roiPosX(0)
     117  , m_roiPosY(0)
     118  , m_tileLeftTopPelPosX(0)
     119  , m_tileLeftTopPelPosY(0)
     120  , m_tileRightBottomPelPosX(0)
     121  , m_tileRightBottomPelPosY(0)
     122#endif
     123  {};
    96124
    97   // ROI & pattern information, (ROI = &pattern[AboveOffset][LeftOffset])
    98   Pel*  getROIY()                 { return m_cPatternY.getROIOrigin();    }
    99   const Pel*  getROIY() const     { return m_cPatternY.getROIOrigin();    }
    100   Int   getROIYWidth() const      { return m_cPatternY.m_iROIWidth;       }
    101   Int   getROIYHeight() const     { return m_cPatternY.m_iROIHeight;      }
    102   Int   getPatternLStride() const { return m_cPatternY.m_iPatternStride;  }
    103   Int   getBitDepthY() const      { return m_cPatternY.m_bitDepth;        }
    104 
    105 #if NH_3D_IC
    106   Bool  getICFlag()               const { return m_bICFlag; }
    107   Void  setICFlag( Bool bICFlag ) { m_bICFlag = bICFlag; }
    108 #endif
    109 #if NH_3D_SDC_INTER
    110   Bool  getSDCMRSADFlag()         const { return m_bSDCMRSADFlag; }
    111   Void  setSDCMRSADFlag( Bool bSDCMRSADFlag )    { m_bSDCMRSADFlag = bSDCMRSADFlag; }
    112 #endif
    113125
    114126  // -------------------------------------------------------------------------------------------------------------------
     
    117129
    118130  /// set parameters from Pel buffers for accessing neighbouring pixels
    119   Void initPattern( Pel* piY, Int iRoiWidth, Int iRoiHeight, Int iStride, Int bitDepthLuma );
     131#if MCTS_ENC_CHECK
     132  Void initPattern(Pel* piY, Int roiWidth, Int roiHeight, Int stride, Int bitDepthLuma, Int roiPosX, Int roiPosY);
     133  Void setTileBorders(Int tileLeftTopPelPosX, Int tileLeftTopPelPosY, Int tileRightBottomPelPosX, Int tileRightBottomPelPosY);
     134#else
     135  Void initPattern(Pel* piY, Int roiWidth, Int roiHeight, Int stride, Int bitDepthLuma);
     136#endif
    120137};
    121138
  • trunk/source/Lib/TLibCommon/TComPic.cpp

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    7373    m_apcPicYuv[i]      = NULL;
    7474  }
    75 #if NH_3D_QTLPC
     75#if NH_3D
    7676  m_bReduceBitsQTL    = 0;
    77 #endif
    78 #if NH_3D_NBDV
    7977  m_iNumDdvCandPics   = 0;
    8078  m_eRapRefList       = REF_PIC_LIST_0;
     
    10098}
    10199
     100#if REDUCED_ENCODER_MEMORY
     101Void TComPic::create( const TComSPS &sps, const TComPPS &pps, const Bool bCreateEncoderSourcePicYuv, const Bool bCreateForImmediateReconstruction )
     102#else
    102103Void TComPic::create( const TComSPS &sps, const TComPPS &pps, const Bool bIsVirtual)
     104#endif
    103105{
    104106  destroy();
     
    111113  const UInt         uiMaxDepth      = sps.getMaxTotalCUDepth();
    112114
     115#if REDUCED_ENCODER_MEMORY
     116  m_picSym.create( sps, pps, uiMaxDepth, bCreateForImmediateReconstruction );
     117  if (bCreateEncoderSourcePicYuv)
     118#else
    113119  m_picSym.create( sps, pps, uiMaxDepth );
    114120  if (!bIsVirtual)
     121#endif
    115122  {
    116123    m_apcPicYuv[PIC_YUV_ORG    ]   = new TComPicYuv;  m_apcPicYuv[PIC_YUV_ORG     ]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true );
    117124    m_apcPicYuv[PIC_YUV_TRUE_ORG]  = new TComPicYuv;  m_apcPicYuv[PIC_YUV_TRUE_ORG]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true );
    118125  }
     126#if REDUCED_ENCODER_MEMORY
     127  if (bCreateForImmediateReconstruction)
     128  {
     129#endif
    119130  m_apcPicYuv[PIC_YUV_REC]  = new TComPicYuv;  m_apcPicYuv[PIC_YUV_REC]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true );
     131#if REDUCED_ENCODER_MEMORY
     132  }
     133#endif
    120134
    121135  // there are no SEI messages associated with this picture initially
     
    125139  }
    126140  m_bUsedByCurr = false;
    127 
    128 #if H_3D_FCO
    129 /* initialize the texture to depth reference status */
    130   for (int j=0; j<2; j++)
    131   {
    132       for (int i=0; i<MAX_NUM_REF; i++)
    133       {
    134           m_aiTexToDepRef[j][i] = -1;
    135       }
    136   }
    137 #endif
    138 
    139 }
     141}
     142
     143#if REDUCED_ENCODER_MEMORY
     144Void TComPic::prepareForEncoderSourcePicYuv()
     145{
     146  const TComSPS &sps=m_picSym.getSPS();
     147
     148  const ChromaFormat chromaFormatIDC = sps.getChromaFormatIdc();
     149  const Int          iWidth          = sps.getPicWidthInLumaSamples();
     150  const Int          iHeight         = sps.getPicHeightInLumaSamples();
     151  const UInt         uiMaxCuWidth    = sps.getMaxCUWidth();
     152  const UInt         uiMaxCuHeight   = sps.getMaxCUHeight();
     153  const UInt         uiMaxDepth      = sps.getMaxTotalCUDepth();
     154
     155  if (m_apcPicYuv[PIC_YUV_ORG    ]==NULL)
     156  {
     157    m_apcPicYuv[PIC_YUV_ORG    ]   = new TComPicYuv;  m_apcPicYuv[PIC_YUV_ORG     ]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true );
     158  }
     159  if (m_apcPicYuv[PIC_YUV_TRUE_ORG    ]==NULL)
     160  {
     161    m_apcPicYuv[PIC_YUV_TRUE_ORG]  = new TComPicYuv;  m_apcPicYuv[PIC_YUV_TRUE_ORG]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true );
     162  }
     163}
     164
     165Void TComPic::prepareForReconstruction()
     166{
     167  if (m_apcPicYuv[PIC_YUV_REC] == NULL)
     168  {
     169    const TComSPS &sps=m_picSym.getSPS();
     170    const ChromaFormat chromaFormatIDC = sps.getChromaFormatIdc();
     171    const Int          iWidth          = sps.getPicWidthInLumaSamples();
     172    const Int          iHeight         = sps.getPicHeightInLumaSamples();
     173    const UInt         uiMaxCuWidth    = sps.getMaxCUWidth();
     174    const UInt         uiMaxCuHeight   = sps.getMaxCUHeight();
     175    const UInt         uiMaxDepth      = sps.getMaxTotalCUDepth();
     176
     177    m_apcPicYuv[PIC_YUV_REC]  = new TComPicYuv;  m_apcPicYuv[PIC_YUV_REC]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true );
     178  }
     179
     180  // mark it should be extended
     181  m_apcPicYuv[PIC_YUV_REC]->setBorderExtension(false);
     182
     183  m_picSym.prepareForReconstruction();
     184}
     185
     186Void TComPic::releaseReconstructionIntermediateData()
     187{
     188  m_picSym.releaseReconstructionIntermediateData();
     189}