Index: trunk/source/Lib/TLibEncoder/AnnexBwrite.h
===================================================================
--- trunk/source/Lib/TLibEncoder/AnnexBwrite.h	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/AnnexBwrite.h	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
Index: trunk/source/Lib/TLibEncoder/NALwrite.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/NALwrite.cpp	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/NALwrite.cpp	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
Index: trunk/source/Lib/TLibEncoder/NALwrite.h
===================================================================
--- trunk/source/Lib/TLibEncoder/NALwrite.h	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/NALwrite.h	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
Index: trunk/source/Lib/TLibEncoder/SEIwrite.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/SEIwrite.cpp	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/SEIwrite.cpp	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
Index: trunk/source/Lib/TLibEncoder/SEIwrite.h
===================================================================
--- trunk/source/Lib/TLibEncoder/SEIwrite.h	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/SEIwrite.h	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
Index: trunk/source/Lib/TLibEncoder/SyntaxElementWriter.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/SyntaxElementWriter.cpp	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/SyntaxElementWriter.cpp	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
@@ -49,5 +49,13 @@
   if( g_HLSTraceEnable )
   {
+#if H_MV_ENC_DEC_TRAC
+    if ( !g_disableNumbering )
+    {
+#endif
     fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
+#if H_MV_ENC_DEC_TRAC
+    }
+#endif
+
     if( length<10 )
     {
@@ -66,5 +74,13 @@
   if( g_HLSTraceEnable )
   {
+#if H_MV_ENC_DEC_TRAC
+    if ( !g_disableNumbering )
+    {
+#endif
     fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
+#if H_MV_ENC_DEC_TRAC
+    }
+#endif
+
     fprintf( g_hTrace, "%-50s ue(v) : %d\n", pSymbolName, value ); 
   }
@@ -76,5 +92,13 @@
   if( g_HLSTraceEnable )
   {
+#if H_MV_ENC_DEC_TRAC
+    if ( !g_disableNumbering )
+    {
+#endif
     fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
+#if H_MV_ENC_DEC_TRAC
+    }
+#endif
+
     fprintf( g_hTrace, "%-50s se(v) : %d\n", pSymbolName, value ); 
   }
@@ -86,5 +110,12 @@
   if( g_HLSTraceEnable )
   {
+#if H_MV_ENC_DEC_TRAC
+    if ( !g_disableNumbering )
+    {
+#endif
     fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
+#if H_MV_ENC_DEC_TRAC
+    }
+#endif
     fprintf( g_hTrace, "%-50s u(1)  : %d\n", pSymbolName, value ); 
   }
Index: trunk/source/Lib/TLibEncoder/SyntaxElementWriter.h
===================================================================
--- trunk/source/Lib/TLibEncoder/SyntaxElementWriter.h	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/SyntaxElementWriter.h	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
Index: trunk/source/Lib/TLibEncoder/TEncAnalyze.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncAnalyze.cpp	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/TEncAnalyze.cpp	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
Index: trunk/source/Lib/TLibEncoder/TEncAnalyze.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncAnalyze.h	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/TEncAnalyze.h	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
Index: trunk/source/Lib/TLibEncoder/TEncBinCoder.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncBinCoder.h	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/TEncBinCoder.h	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
Index: trunk/source/Lib/TLibEncoder/TEncBinCoderCABAC.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncBinCoderCABAC.cpp	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/TEncBinCoderCABAC.cpp	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
Index: trunk/source/Lib/TLibEncoder/TEncBinCoderCABAC.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncBinCoderCABAC.h	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/TEncBinCoderCABAC.h	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
Index: trunk/source/Lib/TLibEncoder/TEncBinCoderCABACCounter.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncBinCoderCABACCounter.cpp	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/TEncBinCoderCABACCounter.cpp	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
Index: trunk/source/Lib/TLibEncoder/TEncBinCoderCABACCounter.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncBinCoderCABACCounter.h	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/TEncBinCoderCABACCounter.h	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
Index: trunk/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
@@ -40,7 +40,10 @@
 #include "SEIwrite.h"
 #include "../TLibCommon/TypeDef.h"
-
+#if H_3D_ANNEX_SELECTION_FIX
+#include "TEncTop.h"
+#endif
 //! \ingroup TLibEncoder
 //! \{
+
 
 #if ENC_DEC_TRACE
@@ -678,5 +681,7 @@
 #endif
   WRITE_UVLC( pcSPS->getChromaFormatIdc (),         "chroma_format_idc" );
+#if !H_3D_DISABLE_CHROMA
   assert(pcSPS->getChromaFormatIdc () == 1);
+#endif
   // in the first version chroma_format_idc can only be equal to 1 (4:2:0)
   if( pcSPS->getChromaFormatIdc () == 3 )
@@ -857,5 +862,12 @@
   WRITE_FLAG( pcPPS->getPocResetInfoPresentFlag( ) ? 1 : 0 , "poc_reset_info_present_flag" );
   WRITE_FLAG( pcPPS->getPpsInferScalingListFlag( ) ? 1 : 0 , "pps_infer_scaling_list_flag" );
+#if FIX_TICKET_95
+  if (pcPPS->getPpsInferScalingListFlag())
+  {
+    WRITE_CODE( pcPPS->getPpsScalingListRefLayerId( ), 6, "pps_scaling_list_ref_layer_id" );
+  }
+#else    
   WRITE_CODE( pcPPS->getPpsScalingListRefLayerId( ), 6, "pps_scaling_list_ref_layer_id" );
+#endif
   WRITE_UVLC( 0, "num_ref_loc_offsets" );
   WRITE_FLAG( 0 , "colour_mapping_enabled_flag" );
@@ -889,5 +901,9 @@
       WRITE_FLAG( sps3dExt->getQtPredFlag( d ) ? 1 : 0 , "qt_pred_flag" );
       WRITE_FLAG( sps3dExt->getInterSdcFlag( d ) ? 1 : 0 , "inter_sdc_flag" );
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+      WRITE_FLAG( sps3dExt->getDepthIntraSkipFlag( d ) ? 1 : 0 , "intra_skip_flag" );
+#else
       WRITE_FLAG( sps3dExt->getIntraSingleFlag( d ) ? 1 : 0 , "intra_single_flag" );
+#endif
     }
   }
@@ -1365,12 +1381,12 @@
   if ( pcRepFormat->getChromaAndBitDepthVpsPresentFlag() )
   {  
-  WRITE_CODE( pcRepFormat->getChromaFormatVpsIdc( ), 2, "chroma_format_vps_idc" );
-
-  if ( pcRepFormat->getChromaFormatVpsIdc() == 3 )
-  {
-    WRITE_FLAG( pcRepFormat->getSeparateColourPlaneVpsFlag( ) ? 1 : 0 , "separate_colour_plane_vps_flag" );
-  }
-  WRITE_CODE( pcRepFormat->getBitDepthVpsLumaMinus8( ),      4, "bit_depth_vps_luma_minus8" );
-  WRITE_CODE( pcRepFormat->getBitDepthVpsChromaMinus8( ),    4, "bit_depth_vps_chroma_minus8" );
+    WRITE_CODE( pcRepFormat->getChromaFormatVpsIdc( ), 2, "chroma_format_vps_idc" );  
+
+    if ( pcRepFormat->getChromaFormatVpsIdc() == 3 )
+    {
+      WRITE_FLAG( pcRepFormat->getSeparateColourPlaneVpsFlag( ) ? 1 : 0 , "separate_colour_plane_vps_flag" );
+    }
+    WRITE_CODE( pcRepFormat->getBitDepthVpsLumaMinus8( ),      4, "bit_depth_vps_luma_minus8" );
+    WRITE_CODE( pcRepFormat->getBitDepthVpsChromaMinus8( ),    4, "bit_depth_vps_chroma_minus8" );
   }
   else
@@ -1598,4 +1614,31 @@
 Void TEncCavlc::codeVPS3dExtension( TComVPS* pcVPS )
 { 
+#if HHI_CAM_PARA_K0052
+  WRITE_UVLC( pcVPS->getCpPrecision( ), "cp_precision" );
+  for (Int n = 1; n < pcVPS->getNumViews(); n++)
+  {
+    Int i      = pcVPS->getViewOIdxList( n );
+    Int iInVps = pcVPS->getVoiInVps( i ); 
+    WRITE_CODE( pcVPS->getNumCp( iInVps ), 6, "num_cp" );
+
+    if( pcVPS->getNumCp( iInVps ) > 0 )
+    {
+      WRITE_FLAG( pcVPS->getCpInSliceSegmentHeaderFlag( iInVps ) ? 1 : 0 , "cp_in_slice_segment_header_flag" );
+      for( Int m = 0; m < pcVPS->getNumCp( iInVps ); m++ )
+      {
+        WRITE_UVLC( pcVPS->getCpRefVoi( iInVps, m ), "cp_ref_voi" );
+        if( !pcVPS->getCpInSliceSegmentHeaderFlag( iInVps ) )
+        {
+          Int j      = pcVPS->getCpRefVoi( iInVps, m );
+          Int jInVps = pcVPS->getVoiInVps( j ); 
+          WRITE_SVLC( pcVPS->getVpsCpScale   ( iInVps, jInVps ), "vps_cp_scale" );
+          WRITE_SVLC( pcVPS->getVpsCpOff     ( iInVps, jInVps ), "vps_cp_off" );
+          WRITE_SVLC( pcVPS->getVpsCpInvScale( iInVps, jInVps ) + pcVPS->getVpsCpScale( iInVps, jInVps ), "vps_cp_inv_scale_plus_scale" );
+          WRITE_SVLC( pcVPS->getVpsCpInvOff  ( iInVps, jInVps ) + pcVPS->getVpsCpOff  ( iInVps, jInVps ), "vps_cp_inv_off_plus_off" );
+        }
+      }
+    }
+  }  
+#else
   WRITE_UVLC( pcVPS->getCamParPrecision(), "cp_precision" );
   for (UInt viewIndex=1; viewIndex<pcVPS->getNumViews(); viewIndex++)
@@ -1617,4 +1660,5 @@
     }
   }
+#endif
 }
 #endif
@@ -1721,5 +1765,10 @@
 
     // in the first version chroma_format_idc is equal to one, thus colour_plane_id will not be present
+#if H_3D_DISABLE_CHROMA
+    assert (pcSlice->getSPS()->getChromaFormatIdc() == 1 || pcSlice->getIsDepth() );
+    assert (pcSlice->getSPS()->getChromaFormatIdc() == 0 || !pcSlice->getIsDepth() );
+#else
     assert (pcSlice->getSPS()->getChromaFormatIdc() == 1 );
+#endif
     // if( separate_colour_plane_flag  ==  1 )
     //   colour_plane_id                                      u(2)
@@ -1895,4 +1944,16 @@
     }
 #endif
+
+#if HHI_INTER_COMP_PRED_K0052
+#if H_3D      
+  if( getEncTop()->decProcAnnexI() )
+  {
+      if ( pcSlice->getInCmpPredAvailFlag() )
+      {
+        WRITE_FLAG( pcSlice->getInCompPredFlag(), "in_comp_pred_flag" );
+      }
+  }
+#endif
+#endif
     if(pcSlice->getSPS()->getUseSAO())
     {
@@ -1900,5 +1961,12 @@
       {
          WRITE_FLAG( pcSlice->getSaoEnabledFlag(), "slice_sao_luma_flag" );
+#if H_3D_DISABLE_CHROMA
+         if ( !pcSlice->getIsDepth() )
+         {
          WRITE_FLAG( pcSlice->getSaoEnabledFlagChroma(), "slice_sao_chroma_flag" );
+      }
+#else
+         WRITE_FLAG( pcSlice->getSaoEnabledFlagChroma(), "slice_sao_chroma_flag" );
+#endif
       }
     }
@@ -2018,5 +2086,12 @@
     }
 #if H_3D_IC
+#if H_3D_ANNEX_SELECTION_FIX
+    else if( pcSlice->getViewIndex() && ( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE )
+      && !pcSlice->getIsDepth() && vps->getNumRefListLayers( layerId ) > 0 
+      && getEncTop()->decProcAnnexI()       
+      )
+#else
     else if( pcSlice->getViewIndex() && ( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE ) && !pcSlice->getIsDepth() && vps->getNumRefListLayers( layerId ) > 0 )
+#endif
     {
       WRITE_FLAG( pcSlice->getApplyIC() ? 1 : 0, "slice_ic_enable_flag" );
@@ -2073,5 +2148,26 @@
       WRITE_FLAG(pcSlice->getLFCrossSliceBoundaryFlag()?1:0, "slice_loop_filter_across_slices_enabled_flag");
     }
-  }
+#if HHI_CAM_PARA_K0052
+#if H_3D
+    if (getEncTop()->decProcAnnexI() )
+    {
+      Int voiInVps = vps->getVoiInVps( pcSlice->getViewIndex() ); 
+      if( vps->getCpInSliceSegmentHeaderFlag( voiInVps ) && !pcSlice->getIsDepth() )
+      {
+        for( Int m = 0; m < vps->getNumCp( voiInVps ); m++ )
+        {
+          Int jInVps = vps->getVoiInVps( vps->getCpRefVoi( voiInVps, m ));
+          WRITE_SVLC( pcSlice->getCpScale   ( jInVps )   , "cp_scale" );
+          WRITE_SVLC( pcSlice->getCpOff     ( jInVps )   , "cp_off" );
+          WRITE_SVLC( pcSlice->getCpInvScale( jInVps ) + pcSlice->getCpScale( jInVps ) , "cp_inv_scale_plus_scale" );
+          WRITE_SVLC( pcSlice->getCpInvOff  ( jInVps ) + pcSlice->getCpOff  ( jInVps ) , "cp_inv_off_plus_off" );
+        }
+      }
+    }
+#endif
+#endif
+  }
+
+#if !HHI_CAM_PARA_K0052  
 #if H_3D
 #if H_3D_FCO
@@ -2089,4 +2185,5 @@
     }
   }
+#endif
 #endif
 
@@ -2435,4 +2532,11 @@
   assert(0);
 }
+
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+Void TEncCavlc::codeDIS( TComDataCU* pcCU, UInt uiAbsPartIdx )
+{
+  assert(0);
+}
+#else
 #if H_3D_SINGLE_DEPTH
 Void TEncCavlc::codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx )
@@ -2441,4 +2545,6 @@
 }
 #endif
+#endif
+
 Void TEncCavlc::codeSplitFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
 {
@@ -2544,5 +2650,9 @@
 {
   wpScalingParam  *wp;
+#if  H_3D_DISABLE_CHROMA
+  Bool            bChroma     = !pcSlice->getIsDepth(); // color always present in HEVC ?
+#else
   Bool            bChroma     = true; // color always present in HEVC ?
+#endif
   Int             iNbRef       = (pcSlice->getSliceType() == B_SLICE ) ? (2) : (1);
   Bool            bDenomCoded  = false;
Index: trunk/source/Lib/TLibEncoder/TEncCavlc.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncCavlc.h	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/TEncCavlc.h	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
@@ -68,5 +68,7 @@
   TComSlice*    m_pcSlice;
   UInt          m_uiCoeffCost;
-
+#if H_3D_ANNEX_SELECTION_FIX
+  TEncTop*      m_encTop; 
+#endif
   Void codeShortTermRefPicSet              ( TComSPS* pcSPS, TComReferencePictureSet* pcRPS, Bool calledFromSliceHeader, Int idx );
   Bool findMatchingLTRP ( TComSlice* pcSlice, UInt *ltrpsIndex, Int ltrpPOC, Bool usedFlag );
@@ -127,6 +129,10 @@
   Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx );
   Void codeSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx );
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+  Void codeDIS           ( TComDataCU* pcCU, UInt uiAbsPartIdx );
+#else
 #if H_3D_SINGLE_DEPTH
   Void codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx );
+#endif
 #endif
   Void codeMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx );
@@ -181,5 +187,8 @@
   Void codeDFFlag       ( UInt uiCode, const Char *pSymbolName );
   Void codeDFSvlc       ( Int   iCode, const Char *pSymbolName );
-
+#if H_3D_ANNEX_SELECTION_FIX
+  TEncTop* getEncTop()               { return m_encTop; };
+  Void     setEncTop( TEncTop* et )  {  m_encTop = et; };
+#endif
 };
 
Index: trunk/source/Lib/TLibEncoder/TEncCfg.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncCfg.h	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/TEncCfg.h	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
@@ -78,4 +78,7 @@
   Int m_interViewRefPosL[2][MAX_NUM_REF_PICS];  
 #endif
+#if HHI_INTER_COMP_PRED_K0052
+  Bool m_interCompPredFlag;
+#endif
   GOPEntry()
   : m_POC(-1)
@@ -95,4 +98,9 @@
   , m_numActiveRefLayerPics(0)
 #endif
+#if HHI_INTER_COMP_PRED_K0052
+#if H_3D
+  , m_interCompPredFlag(false)
+#endif
+#endif
   {
     ::memset( m_referencePics, 0, sizeof(m_referencePics) );
@@ -180,5 +188,8 @@
   Int       m_iSearchRange;                     //  0:Full frame
   Int       m_bipredSearchRange;
-
+#if SONY_MV_V_CONST_C0078
+  Bool      m_bUseDisparitySearchRangeRestriction;
+  Int       m_iVerticalDisparitySearchRange;
+#endif
   //====== Quality control ========
   Int       m_iMaxDeltaQP;                      //  Max. absolute delta QP (1:default)
@@ -369,8 +380,10 @@
 
   //====== Camera Parameters ======
+#if !HHI_CAM_PARA_K0052
   UInt      m_uiCamParPrecision;
   Bool      m_bCamParInSliceHeader;
   Int**     m_aaiCodedScale;
   Int**     m_aaiCodedOffset;
+#endif
   TAppComCamPara* m_cameraParameters; 
   
@@ -405,4 +418,8 @@
   Bool      m_bUseQTL;
 #endif
+#if H_3D_ANNEX_SELECTION_FIX
+  Int m_profileIdc;
+#endif
+
 #endif
 public:
@@ -418,4 +435,7 @@
   , m_isDepth(false)
   , m_bUseVSO(false)
+#if H_3D_ANNEX_SELECTION_FIX
+  , m_profileIdc( -1 )
+#endif
 #endif
 #endif
@@ -502,4 +522,8 @@
   Void      setSearchRange                  ( Int   i )      { m_iSearchRange = i; }
   Void      setBipredSearchRange            ( Int   i )      { m_bipredSearchRange = i; }
+#if SONY_MV_V_CONST_C0078
+  Void      setUseDisparitySearchRangeRestriction ( Bool   b )      { m_bUseDisparitySearchRangeRestriction = b; }
+  Void      setVerticalDisparitySearchRange ( Int   i )      { m_iVerticalDisparitySearchRange = i; }
+#endif
 
   //====== Quality control ========
@@ -554,4 +578,8 @@
   Int       getFastSearch                   ()      { return  m_iFastSearch; }
   Int       getSearchRange                  ()      { return  m_iSearchRange; }
+#if SONY_MV_V_CONST_C0078
+  Bool      getUseDisparitySearchRangeRestriction ()      { return  m_bUseDisparitySearchRangeRestriction; }
+  Int       getVerticalDisparitySearchRange ()            { return  m_iVerticalDisparitySearchRange; }
+#endif
 
   //==== Quality control ========
@@ -895,8 +923,10 @@
 
  //==== CAMERA PARAMETERS  ==========
+#if !HHI_CAM_PARA_K0052
   Void      setCamParPrecision              ( UInt  u )      { m_uiCamParPrecision      = u; }
   Void      setCamParInSliceHeader          ( Bool  b )      { m_bCamParInSliceHeader   = b; }
   Void      setCodedScale                   ( Int** p )      { m_aaiCodedScale          = p; }
   Void      setCodedOffset                  ( Int** p )      { m_aaiCodedOffset         = p; }
+#endif
   Void      setCameraParameters             ( TAppComCamPara* c) { m_cameraParameters   = c; }
 
@@ -946,4 +976,9 @@
   Bool      getUseQTL                       ()         { return m_bUseQTL; }
 #endif
+#if H_3D_ANNEX_SELECTION_FIX
+  Void                    setProfileIdc( Int a )    { assert( a == 1 || a == 6 || a == 8 ); m_profileIdc = a;  }
+  Bool                    decProcAnnexI()           { assert( m_profileIdc != -1 ); return ( m_profileIdc == 8); }    
+#endif
+
 #endif // H_3D
 };
Index: trunk/source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncCu.cpp	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/TEncCu.cpp	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
@@ -275,4 +275,8 @@
   m_ppcTempCU[0]->initCU( rpcCU->getPic(), rpcCU->getAddr() );
 
+#if H_3D_DISABLE_CHROMA
+  m_ppcWeightedTempCU[0]->initCU( rpcCU->getPic(), rpcCU->getAddr() );
+#endif
+
 #if KWU_RC_MADPRED_E0227
   m_LCUPredictionSAD = 0;
@@ -437,5 +441,7 @@
 #if H_3D_VSP
   DisInfo DvInfo; 
+#if !SEC_ARP_REM_ENC_RESTRICT_K0035
   DvInfo.bDV = false;
+#endif
   DvInfo.m_acNBDV.setZero();
   DvInfo.m_aVIdxCan = 0;
@@ -583,5 +589,9 @@
           if (rpcTempCU->getSlice()->getIsDepth() )
           {
+#if SEC_ARP_REM_ENC_RESTRICT_K0035
+            rpcTempCU->getDispforDepth(0, 0, &DvInfo);
+#else
             DvInfo.bDV = rpcTempCU->getDispforDepth(0, 0, &DvInfo);
+#endif
           }
           else
@@ -590,8 +600,16 @@
 #if H_3D_NBDV_REF
           if( rpcTempCU->getSlice()->getDepthRefinementFlag() )
+#if SEC_ARP_REM_ENC_RESTRICT_K0035
+            rpcTempCU->getDisMvpCandNBDV(&DvInfo, true);
+#else
             DvInfo.bDV = rpcTempCU->getDisMvpCandNBDV(&DvInfo, true);
+#endif
           else
 #endif 
+#if SEC_ARP_REM_ENC_RESTRICT_K0035
+            rpcTempCU->getDisMvpCandNBDV(&DvInfo);
+#else
             DvInfo.bDV = rpcTempCU->getDisMvpCandNBDV(&DvInfo);
+#endif
 
 #if H_3D_IV_MERGE
@@ -712,4 +730,12 @@
     }
 #endif
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+    rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP  );
+    if( rpcBestCU->getSlice()->getDepthIntraSkipFlag() )
+    {
+      xCheckRDCostDIS( rpcBestCU, rpcTempCU, SIZE_2Nx2N );
+      rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP  );
+    }
+#else
 #if H_3D_SINGLE_DEPTH
     rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP  );
@@ -719,4 +745,5 @@
       rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP  );
     }
+#endif
 #endif
     if(!earlyDetectionSkipMode)
@@ -1226,4 +1253,7 @@
       TComDataCU* pcSubTempPartCU     = m_ppcTempCU[uhNextDepth];
 
+#if H_3D_DISABLE_CHROMA
+      m_ppcWeightedTempCU[uhNextDepth]->setSlice( m_ppcWeightedTempCU[ uiDepth]->getSlice()); 
+#endif
       for ( UInt uiPartUnitIdx = 0; uiPartUnitIdx < 4; uiPartUnitIdx++ )
       {
@@ -1577,4 +1607,9 @@
     return;
   }
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+  m_pcEntropyCoder->encodeDIS( pcCU, uiAbsPartIdx );
+  if(!pcCU->getDISFlag(uiAbsPartIdx))
+  {
+#else
 #if H_3D_SINGLE_DEPTH
   m_pcEntropyCoder->encodeSingleDepthMode( pcCU, uiAbsPartIdx );
@@ -1582,17 +1617,24 @@
   {
 #endif
+#endif
   m_pcEntropyCoder->encodePredMode( pcCU, uiAbsPartIdx );
   
   m_pcEntropyCoder->encodePartSize( pcCU, uiAbsPartIdx, uiDepth );
   
+#if !HHI_MOVE_SYN_K0052
 #if H_3D_DIM_SDC
   m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx, false );
 #endif
+#endif
   if (pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N )
   {
     m_pcEntropyCoder->encodeIPCMInfo( pcCU, uiAbsPartIdx );
-
     if(pcCU->getIPCMFlag(uiAbsPartIdx))
     {
+#if HHI_MOVE_SYN_K0052
+#if H_3D_DIM_SDC
+      m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx, false );
+#endif  
+#endif
       // Encode slice finish
       finishCU(pcCU,uiAbsPartIdx,uiDepth);
@@ -1603,5 +1645,10 @@
   // prediction Info ( Intra : direction mode, Inter : Mv, reference idx )
   m_pcEntropyCoder->encodePredInfo( pcCU, uiAbsPartIdx );
-
+#if HHI_MOVE_SYN_K0052
+  m_pcEntropyCoder->encodeDBBPFlag( pcCU, uiAbsPartIdx );
+#if H_3D_DIM_SDC
+  m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx, false );
+#endif  
+#endif
 #if H_3D_ARP
   m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx );
@@ -1612,8 +1659,16 @@
   // Encode Coefficients
   Bool bCodeDQP = getdQPFlag();
+#if H_3D_DISABLE_CHROMA
+  m_pcEntropyCoder->encodeCoeff( pcCU, uiAbsPartIdx, uiDepth, pcCU->getWidth (uiAbsPartIdx), pcCU->getHeight(uiAbsPartIdx), bCodeDQP, false );
+#else
   m_pcEntropyCoder->encodeCoeff( pcCU, uiAbsPartIdx, uiDepth, pcCU->getWidth (uiAbsPartIdx), pcCU->getHeight(uiAbsPartIdx), bCodeDQP );
+#endif
   setdQPFlag( bCodeDQP );
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+  }
+#else
 #if H_3D_SINGLE_DEPTH
   }
+#endif
 #endif
   // --- write terminating bit ---
@@ -1834,5 +1889,9 @@
 #if H_3D_ARP
   Int nARPWMax = rpcTempCU->getSlice()->getARPStepNum() - 1;
+#if SEC_ARP_REM_ENC_RESTRICT_K0035
+  if( nARPWMax < 0 || bICFlag )
+#else
   if( nARPWMax < 0 || !rpcTempCU->getDvInfo(0).bDV || bICFlag )
+#endif
   {
     nARPWMax = 0;
@@ -2000,6 +2059,10 @@
 
           rpcTempCU->setSkipFlagSubParts( rpcTempCU->getQtRootCbf(0) == 0, 0, uhDepth );
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+          rpcTempCU->setDISFlagSubParts( false, 0, uhDepth );
+#else
 #if H_3D_SINGLE_DEPTH
           rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth );
+#endif
 #endif
 #if H_3D_VSP // possible bug fix
@@ -2042,6 +2105,10 @@
               }
               rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth );
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+              rpcTempCU->setDISFlagSubParts( false, 0, uhDepth );
+#else
 #if H_3D_SINGLE_DEPTH
               rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth );
+#endif
 #endif
               rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth );
@@ -2166,6 +2233,9 @@
   Bool bFirstTime = true;
   Int nARPWMax    = rpcTempCU->getSlice()->getARPStepNum() - 1;
-
+#if SEC_ARP_REM_ENC_RESTRICT_K0035
+  if( nARPWMax < 0 || ePartSize != SIZE_2Nx2N || rpcTempCU->getICFlag(0) )
+#else
   if( nARPWMax < 0 || ePartSize != SIZE_2Nx2N || !rpcTempCU->getDvInfo(0).bDV || rpcTempCU->getICFlag(0) )
+#endif
   {
     nARPWMax = 0;
@@ -2193,6 +2263,10 @@
   
   rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth );
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+  rpcTempCU->setDISFlagSubParts( false, 0, uhDepth );
+#else
 #if H_3D_SINGLE_DEPTH
   rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth );
+#endif
 #endif
   rpcTempCU->setPartSizeSubParts  ( ePartSize,  0, uhDepth );
@@ -2303,6 +2377,10 @@
       }
       rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth );
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+      rpcTempCU->setDISFlagSubParts( false, 0, uhDepth );
+#else
 #if H_3D_SINGLE_DEPTH
       rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth );
+#endif
 #endif
       rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth );
@@ -2413,4 +2491,78 @@
   }
 }
+
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+Void TEncCu::xCheckRDCostDIS( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize eSize )
+{
+  UInt uiDepth = rpcTempCU->getDepth( 0 );
+  if( !rpcBestCU->getSlice()->getIsDepth() || (eSize != SIZE_2Nx2N))
+  {
+    return;
+  }
+
+#if H_3D_VSO // M5
+  if( m_pcRdCost->getUseRenModel() )
+  {
+    UInt  uiWidth     = m_ppcOrigYuv[uiDepth]->getWidth   ();
+    UInt  uiHeight    = m_ppcOrigYuv[uiDepth]->getHeight  ();
+    Pel*  piSrc       = m_ppcOrigYuv[uiDepth]->getLumaAddr();
+    UInt  uiSrcStride = m_ppcOrigYuv[uiDepth]->getStride  ();
+    m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );
+  }
+#endif
+
+  rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth );
+  rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth );
+  rpcTempCU->setPredModeSubParts( MODE_INTRA, 0, uiDepth );
+  rpcTempCU->setCUTransquantBypassSubParts( rpcTempCU->getCUTransquantBypass(0), 0, uiDepth );
+
+  rpcTempCU->setTrIdxSubParts(0, 0, uiDepth);
+  rpcTempCU->setCbfSubParts(0, 1, 1, 0, uiDepth);
+  rpcTempCU->setDISFlagSubParts(true, 0, uiDepth);
+  rpcTempCU->setLumaIntraDirSubParts (DC_IDX, 0, uiDepth);
+#if H_3D_DIM_SDC
+  rpcTempCU->setSDCFlagSubParts( false, 0, uiDepth);
+#endif
+
+  UInt uiPreCalcDistC;
+  m_pcPredSearch  ->estIntraPredDIS      ( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], uiPreCalcDistC, false );
+
+#if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC
+  Int oldTraceCopyBack = g_traceCopyBack; 
+  g_traceCopyBack = false;  
+#endif
+  m_ppcRecoYuvTemp[uiDepth]->copyToPicLuma(rpcTempCU->getPic()->getPicYuvRec(), rpcTempCU->getAddr(), rpcTempCU->getZorderIdxInCU() );
+  #if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC  
+    g_traceCopyBack = oldTraceCopyBack; 
+  #endif
+
+
+  m_pcEntropyCoder->resetBits();
+  if ( rpcTempCU->getSlice()->getPPS()->getTransquantBypassEnableFlag())
+  {
+    m_pcEntropyCoder->encodeCUTransquantBypassFlag( rpcTempCU, 0,          true );
+  }
+  m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0,          true );
+  m_pcEntropyCoder->encodeDIS( rpcTempCU, 0,          true );
+
+
+  m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]);
+
+  rpcTempCU->getTotalBits() = m_pcEntropyCoder->getNumberOfWrittenBits();
+  rpcTempCU->getTotalBins() = ((TEncBinCABAC *)((TEncSbac*)m_pcEntropyCoder->m_pcEntropyCoderIf)->getEncBinIf())->getBinsCoded();
+
+
+#if H_3D_VSO // M6
+  if( m_pcRdCost->getUseLambdaScaleVSO())  
+    rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCostVSO( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() );  
+  else
+#endif
+    rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() );
+
+
+  xCheckDQP( rpcTempCU );
+  xCheckBestMode(rpcBestCU, rpcTempCU, uiDepth);
+}
+#else
 #if H_3D_SINGLE_DEPTH
 Void TEncCu::xCheckRDCostSingleDepth( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize eSize )
@@ -2480,4 +2632,5 @@
 }
 #endif
+#endif
 
 Void TEncCu::xCheckRDCostInterDBBP( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, Bool bUseMRG )
@@ -2522,5 +2675,11 @@
   AOF( uiDepthStride != 0 );
   
+#if HS_DBBP_CLEAN_K0048
+  PartSize eVirtualPartSize = m_pcPredSearch->getPartitionSizeFromDepth(pDepthPels, uiDepthStride, uiWidth, rpcTempCU);
+
   // derive partitioning from depth
+  Bool pMask[MAX_CU_SIZE*MAX_CU_SIZE];
+  Bool bValidMask = m_pcPredSearch->getSegmentMaskFromDepth(pDepthPels, uiDepthStride, uiWidth, uiHeight, pMask, rpcTempCU);
+#else
   PartSize eVirtualPartSize = m_pcPredSearch->getPartitionSizeFromDepth(pDepthPels, uiDepthStride, uiWidth);
   
@@ -2528,4 +2687,5 @@
   Bool pMask[MAX_CU_SIZE*MAX_CU_SIZE];
   Bool bValidMask = m_pcPredSearch->getSegmentMaskFromDepth(pDepthPels, uiDepthStride, uiWidth, uiHeight, pMask);
+#endif
   
   if( !bValidMask )
@@ -2636,6 +2796,10 @@
 
   rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth );
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+  rpcTempCU->setDISFlagSubParts( false, 0, uiDepth );
+#else
 #if H_3D_SINGLE_DEPTH
   rpcTempCU->setSingleDepthFlagSubParts( false, 0, uiDepth );
+#endif
 #endif
   rpcTempCU->setPartSizeSubParts( eSize, 0, uiDepth );
@@ -2656,5 +2820,9 @@
   
 #if H_3D_DIM_SDC
+#if 0 // H_3D_DISABLE_CHROMA
+  if( !rpcTempCU->getSDCFlag( 0 ) && !rpcTempCU->getSlice()->getIsDepth() )
+#else
   if( !rpcTempCU->getSDCFlag( 0 ) )
+#endif
 #endif
   m_pcPredSearch  ->estIntraPredChromaQT( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], uiPreCalcDistC );
@@ -2666,4 +2834,9 @@
   }
   m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0,          true );
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+  m_pcEntropyCoder->encodeDIS( rpcTempCU, 0,          true );
+  if(!rpcTempCU->getDISFlag(0))
+  {
+#else
 #if H_3D_SINGLE_DEPTH
   m_pcEntropyCoder->encodeSingleDepthMode( rpcTempCU, 0,          true );
@@ -2671,19 +2844,37 @@
   {
 #endif
+#endif
   m_pcEntropyCoder->encodePredMode( rpcTempCU, 0,          true );
   m_pcEntropyCoder->encodePartSize( rpcTempCU, 0, uiDepth, true );
+#if !HHI_MOVE_SYN_K0052
 #if H_3D_DIM_SDC
   m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true );
 #endif
+#endif
   m_pcEntropyCoder->encodePredInfo( rpcTempCU, 0,          true );
   m_pcEntropyCoder->encodeIPCMInfo(rpcTempCU, 0, true );
+#if HHI_MOVE_SYN_K0052
+#if H_3D_DIM_SDC
+  m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true );
+#endif
+#endif
 
   // Encode Coefficients
   Bool bCodeDQP = getdQPFlag();
+#if H_3D_DISABLE_CHROMA
+  m_pcEntropyCoder->encodeCoeff( rpcTempCU, 0, uiDepth, rpcTempCU->getWidth (0), rpcTempCU->getHeight(0), bCodeDQP, true );
+#else
   m_pcEntropyCoder->encodeCoeff( rpcTempCU, 0, uiDepth, rpcTempCU->getWidth (0), rpcTempCU->getHeight(0), bCodeDQP );
+#endif
+
+
   setdQPFlag( bCodeDQP );
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+  }
+#else
 #if H_3D_SINGLE_DEPTH
   }
-#endif        
+#endif
+#endif
   m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]);
   
@@ -2713,6 +2904,10 @@
 
   rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth );
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+  rpcTempCU->setDISFlagSubParts( false, 0, uiDepth );
+#else
 #if H_3D_SINGLE_DEPTH
   rpcTempCU->setSingleDepthFlagSubParts( false, 0, uiDepth );
+#endif
 #endif
   rpcTempCU->setIPCMFlag(0, true);
@@ -2732,14 +2927,24 @@
   }
   m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0,          true );
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+  m_pcEntropyCoder->encodeDIS( rpcTempCU, 0,          true );
+#else
 #if H_3D_SINGLE_DEPTH
   m_pcEntropyCoder->encodeSingleDepthMode( rpcTempCU, 0,          true );
 #endif
+#endif
   m_pcEntropyCoder->encodePredMode ( rpcTempCU, 0,          true );
   m_pcEntropyCoder->encodePartSize ( rpcTempCU, 0, uiDepth, true );
+#if !HHI_MOVE_SYN_K0052
 #if H_3D_DIM_SDC
   m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true );
 #endif
+#endif
   m_pcEntropyCoder->encodeIPCMInfo ( rpcTempCU, 0, true );
-
+#if HHI_MOVE_SYN_K0052
+#if H_3D_DIM_SDC
+  m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true );
+#endif
+#endif
   m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]);
 
Index: trunk/source/Lib/TLibEncoder/TEncCu.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncCu.h	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/TEncCu.h	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
@@ -159,6 +159,10 @@
   Void  xCheckRDCostInterDBBP( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, Bool bUseMRG = false );
 #endif
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+  Void  xCheckRDCostDIS   ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize  );
+#else
 #if H_3D_SINGLE_DEPTH
   Void  xCheckRDCostSingleDepth   ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize  );
+#endif
 #endif
 #if H_3D_DIM
Index: trunk/source/Lib/TLibEncoder/TEncEntropy.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
@@ -111,4 +111,19 @@
   m_pcEntropyCoderIf->codeSkipFlag( pcCU, uiAbsPartIdx );
 }
+
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+Void TEncEntropy::encodeDIS( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
+{
+  if ( !pcCU->getSlice()->getIsDepth() )
+  {
+    return;
+  }
+  if( bRD )
+  {
+    uiAbsPartIdx = 0;
+  }
+  m_pcEntropyCoderIf->codeDIS( pcCU, uiAbsPartIdx );
+}
+#else
 #if H_3D_SINGLE_DEPTH
 Void TEncEntropy::encodeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
@@ -125,4 +140,6 @@
 }
 #endif
+#endif
+
 /** encode merge flag
  * \param pcCU
@@ -254,4 +271,5 @@
   m_pcEntropyCoderIf->codePartSize( pcCU, uiAbsPartIdx, uiDepth );
   
+#if !HHI_MOVE_SYN_K0052
 #if H_3D_DBBP
   if( pcCU->getSlice()->getDepthBasedBlkPartFlag() && (pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2NxN || pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_Nx2N) && pcCU->getWidth(uiAbsPartIdx) > 8 && pcCU->getSlice()->getDefaultRefViewIdxAvailableFlag() )
@@ -259,4 +277,5 @@
     encodeDBBPFlag(pcCU, uiAbsPartIdx, bRD);
   }
+#endif
 #endif
 }
@@ -285,6 +304,24 @@
 }
 
+#if H_3D_DISABLE_CHROMA
+Void TEncEntropy::xEncodeTransform( TComDataCU* pcCU,UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP, Bool rd )
+#else
 Void TEncEntropy::xEncodeTransform( TComDataCU* pcCU,UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP )
-{
+#endif
+{
+
+#if H_MV_ENC_DEC_TRAC
+#if ENC_DEC_TRACE
+  UInt uiLPelX   = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ];
+  UInt uiTPelY   = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ];
+
+  DTRACE_TU_S("=========== transform_tree ===========\n")
+  DTRACE_TU("x0", uiLPelX)
+  DTRACE_TU("x1", uiTPelY)
+  DTRACE_TU("log2TrafoSize", g_uiMaxCUWidth>>uiDepth)
+  DTRACE_TU("trafoDepth"  , uiDepth)
+#endif
+#endif
+
   const UInt uiSubdiv = pcCU->getTransformIdx( uiAbsPartIdx ) + pcCU->getDepth( uiAbsPartIdx ) > uiDepth;
   const UInt uiLog2TrafoSize = g_aucConvertToBit[pcCU->getSlice()->getSPS()->getMaxCUWidth()]+2 - uiDepth;
@@ -292,5 +329,11 @@
   UInt cbfU = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrIdx );
   UInt cbfV = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrIdx );
-
+#if H_3D_DISABLE_CHROMA
+  if( !rd && pcCU->getSlice()->getSPS()->getChromaFormatIdc() == 0 )
+  {
+    cbfU = 0;
+    cbfV = 0;
+  }
+#endif
   if(uiTrIdx==0)
   {
@@ -309,4 +352,11 @@
       cbfU = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_U, uiTrIdx );
       cbfV = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_V, uiTrIdx );
+#if H_3D_DISABLE_CHROMA
+      if( !rd && pcCU->getSlice()->getSPS()->getChromaFormatIdc() == 0 )
+      {
+        cbfU = 0;
+        cbfV = 0;
+      }
+#endif
     }
   }
@@ -349,4 +399,17 @@
   if( bFirstCbfOfCU || uiLog2TrafoSize > 2 )
   {
+#if H_3D_DISABLE_CHROMA
+    if (pcCU->getSlice()->getSPS()->getChromaFormatIdc() != 0 || rd)
+    {
+      if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr - 1 ) )
+      {
+        m_pcEntropyCoderIf->codeQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr );
+      }
+      if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr - 1 ) )
+      {
+        m_pcEntropyCoderIf->codeQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr );
+      }
+    }
+#else
     if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr - 1 ) )
     {
@@ -357,9 +420,18 @@
       m_pcEntropyCoderIf->codeQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr );
     }
+#endif
   }
   else if( uiLog2TrafoSize == 2 )
   {
+#if H_3D_DISABLE_CHROMA
+    if ( rd && pcCU->getSlice()->getSPS()->getChromaFormatIdc() != 0 )
+    {
     assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr ) == pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr - 1 ) );
     assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr ) == pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr - 1 ) );
+  }
+#else
+    assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr ) == pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr - 1 ) );
+    assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr ) == pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr - 1 ) );
+#endif
   }
   
@@ -374,4 +446,16 @@
     const UInt partNum = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1);
     
+#if H_3D_DISABLE_CHROMA
+    xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP, rd );
+
+    uiAbsPartIdx += partNum;  offsetLuma += size;  offsetChroma += (size>>2);
+    xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP ,rd );
+
+    uiAbsPartIdx += partNum;  offsetLuma += size;  offsetChroma += (size>>2);
+    xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP, rd );
+
+    uiAbsPartIdx += partNum;  offsetLuma += size;  offsetChroma += (size>>2);
+    xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP, rd );
+#else
     xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP );
 
@@ -384,4 +468,5 @@
     uiAbsPartIdx += partNum;  offsetLuma += size;  offsetChroma += (size>>2);
     xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP );
+#endif
   }
   else
@@ -400,5 +485,11 @@
 #endif
     
+#if H_3D_DISABLE_CHROMA
+    Bool notcbfUV = !rd && pcCU->getSlice()->getSPS()->getChromaFormatIdc() == 0 ? 1 : ( !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) ) ;
+    if( pcCU->getPredictionMode(uiAbsPartIdx) != MODE_INTRA && 
+      uiDepth == pcCU->getDepth( uiAbsPartIdx ) && notcbfUV ) 
+#else
     if( pcCU->getPredictionMode(uiAbsPartIdx) != MODE_INTRA && uiDepth == pcCU->getDepth( uiAbsPartIdx ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) )
+#endif
     {
       assert( pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, 0 ) );
@@ -489,5 +580,9 @@
     encodeIntraDirModeLuma  ( pcCU, uiAbsPartIdx,true );
 #if H_3D_DIM_SDC
+#if H_3D_DISABLE_CHROMA
+    if(!pcCU->getSDCFlag(uiAbsPartIdx) && ( pcCU->getSlice()->getSPS()->getChromaFormatIdc() != 0  || bRD ) ) 
+#else
     if(!pcCU->getSDCFlag(uiAbsPartIdx))
+#endif
 #endif
     encodeIntraDirModeChroma( pcCU, uiAbsPartIdx, bRD );
@@ -657,5 +752,9 @@
  * \param uiHeight
  */
+#if H_3D_DISABLE_CHROMA
+Void TEncEntropy::encodeCoeff( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, Bool& bCodeDQP, Bool rd )
+#else
 Void TEncEntropy::encodeCoeff( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, Bool& bCodeDQP )
+#endif
 {
   UInt uiMinCoeffSize = pcCU->getPic()->getMinCUWidth()*pcCU->getPic()->getMinCUHeight();
@@ -668,7 +767,16 @@
     assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 );
     assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 );
+#if H_3D_DISABLE_CHROMA
+    if (!pcCU->getSlice()->getIsDepth() )
+    {
+      assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
+      assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
+    }
+#else
     assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
     assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
-  }
+#endif
+  }
+
 
   if( pcCU->getSDCFlag( uiAbsPartIdx ) && !pcCU->isIntra( uiAbsPartIdx ) )
@@ -723,5 +831,9 @@
   }
   
+#if H_3D_DISABLE_CHROMA
+  xEncodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, bCodeDQP, rd);
+#else
   xEncodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, bCodeDQP);
+#endif
 }
 
@@ -792,9 +904,20 @@
 Void TEncEntropy::encodeDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
 {
-  if( bRD )
-  {
-    uiAbsPartIdx = 0;
-  }
-  m_pcEntropyCoderIf->codeDBBPFlag( pcCU, uiAbsPartIdx );
+#if HHI_MOVE_SYN_K0052
+  if( pcCU->getSlice()->getDepthBasedBlkPartFlag() && 
+    ( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2NxN || 
+      pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_Nx2N) && 
+      pcCU->getWidth(uiAbsPartIdx) > 8 && 
+      pcCU->getSlice()->getDefaultRefViewIdxAvailableFlag() )
+  {
+#endif
+    if( bRD )
+    {
+      uiAbsPartIdx = 0;
+    }
+    m_pcEntropyCoderIf->codeDBBPFlag( pcCU, uiAbsPartIdx );
+#if HHI_MOVE_SYN_K0052
+  }
+#endif
 }
 #endif
Index: trunk/source/Lib/TLibEncoder/TEncEntropy.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncEntropy.h	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/TEncEntropy.h	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
@@ -82,6 +82,10 @@
   virtual Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
   virtual Void codeSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+  virtual Void codeDIS          ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
+#else
 #if H_3D_SINGLE_DEPTH
   virtual Void codeSingleDepthMode      ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
+#endif
 #endif
   virtual Void codeMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
@@ -147,5 +151,14 @@
   Void    resetBits                 ()                        { m_pcEntropyCoderIf->resetBits();      }
   Void    resetCoeffCost            ()                        { m_pcEntropyCoderIf->resetCoeffCost(); }
-  UInt    getNumberOfWrittenBits    ()                        { return m_pcEntropyCoderIf->getNumberOfWrittenBits(); }
+  UInt    getNumberOfWrittenBits    ()
+  {
+#if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC
+    Bool oldJustDoIt = g_bJustDoIt;
+    g_bJustDoIt = true; 
+    writeToTraceFile( "NumberOfWrittenBits", m_pcEntropyCoderIf->getNumberOfWrittenBits(), g_encNumberOfWrittenBits );
+    g_bJustDoIt = oldJustDoIt; 
+#endif
+    return m_pcEntropyCoderIf->getNumberOfWrittenBits(); 
+  }
   UInt    getCoeffCost              ()                        { return  m_pcEntropyCoderIf->getCoeffCost(); }
   Void    resetEntropy              ()                        { m_pcEntropyCoderIf->resetEntropy();  }
@@ -166,6 +179,10 @@
   Void encodeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
   Void encodeSkipFlag          ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+  Void encodeDIS               ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD=false );
+#else
 #if H_3D_SINGLE_DEPTH
   Void encodeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD=false );
+#endif
 #endif
   Void encodePUWise       ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
@@ -209,7 +226,13 @@
 
 private:
+#if H_3D_DISABLE_CHROMA
+  Void xEncodeTransform        ( TComDataCU* pcCU,UInt offsetLumaOffset, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP, Bool rd );
+public:
+  Void encodeCoeff             ( TComDataCU* pcCU,                 UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, Bool& bCodeDQP, Bool rd );
+#else
   Void xEncodeTransform        ( TComDataCU* pcCU,UInt offsetLumaOffset, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP );
 public:
   Void encodeCoeff             ( TComDataCU* pcCU,                 UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, Bool& bCodeDQP );
+#endif
   
   Void encodeCoeffNxN         ( TComDataCU* pcCU, TCoeff* pcCoeff, UInt uiAbsPartIdx, UInt uiTrWidth, UInt uiTrHeight, UInt uiDepth, TextType eType );
Index: trunk/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
@@ -885,5 +885,12 @@
     Int numDirectRefLayers = vps    ->getNumDirectRefLayers( getLayerId() ); 
 #endif
+#if HHI_INTER_COMP_PRED_K0052
+    pcSlice->setIvPicLists( m_ivPicLists );         
+
+    Int gopNum = (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid;
+    GOPEntry gopEntry      = m_pcCfg->getGOPEntry( gopNum );     
+#else
     GOPEntry gopEntry      = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid );     
+#endif
     
     Bool interLayerPredLayerIdcPresentFlag = false; 
@@ -922,4 +929,39 @@
     assert( pcSlice->getNumActiveRefLayerPics() == gopEntry.m_numActiveRefLayerPics ); 
     
+#if HHI_INTER_COMP_PRED_K0052
+#if H_3D
+    if ( m_pcEncTop->decProcAnnexI() )
+    {    
+      pcSlice->deriveInCmpPredAndCpAvailFlag(); 
+      if ( pcSlice->getInCmpPredAvailFlag() )
+      {      
+        pcSlice->setInCompPredFlag( gopEntry.m_interCompPredFlag ); 
+      }
+      else
+      {
+        if (gopEntry.m_interCompPredFlag )
+        {
+          if ( gopNum == MAX_GOP)
+          {
+            printf( "\nError: FrameI_l%d cannot enable inter-component prediction.\n", pcSlice->getVPS()->getLayerIdInVps( getLayerId() ) );
+          }
+          else
+          {
+            printf( "\nError: Frame%d_l%d cannot enable inter-component prediction.\n", gopNum, pcSlice->getVPS()->getLayerIdInVps( getLayerId() ) );
+          }
+          
+          exit(EXIT_FAILURE);
+        }
+      }
+      pcSlice->init3dToolParameters(); 
+      pcSlice->checkInCompPredRefLayers(); 
+    }
+    
+
+    // This needs to be done after initilizaiton of 3D tool parameters.
+    pcSlice->setMaxNumMergeCand      ( m_pcCfg->getMaxNumMergeCand()   + ( ( pcSlice->getMpiFlag( ) || pcSlice->getIvMvPredFlag( ) || pcSlice->getViewSynthesisPredFlag( )   ) ? 1 : 0 ));
+#endif
+#endif
+
     pcSlice->createInterLayerReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 
     pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer0.size() + (Int) m_refPicSetInterLayer1.size()) ) );
@@ -968,4 +1010,5 @@
     }
 #endif
+#if !HHI_INTER_COMP_PRED_K0052
 #if H_3D
     pcSlice->setIvPicLists( m_ivPicLists );         
@@ -973,4 +1016,5 @@
     assert( !m_pcEncTop->getIsDepth() || ( pcSlice->getTexturePic() != 0 ) );
 #endif    
+#endif
 #endif
 #if H_3D_IC
@@ -1950,4 +1994,11 @@
               m_pcSAO->PCMLFDisableProcess(pcPic);
 
+#if H_3D_DISABLE_CHROMA
+            if (pcSlice->getIsDepth())
+            {
+              sliceEnabled[SAO_Cb] = false; 
+              sliceEnabled[SAO_Cr] = false; 
+            }
+#endif
             //assign SAO slice header
             for(Int s=0; s< uiNumSlices; s++)
Index: trunk/source/Lib/TLibEncoder/TEncGOP.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncGOP.h	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/TEncGOP.h	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
Index: trunk/source/Lib/TLibEncoder/TEncPic.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncPic.cpp	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/TEncPic.cpp	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
Index: trunk/source/Lib/TLibEncoder/TEncPic.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncPic.h	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/TEncPic.h	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
Index: trunk/source/Lib/TLibEncoder/TEncPreanalyzer.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncPreanalyzer.cpp	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/TEncPreanalyzer.cpp	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
Index: trunk/source/Lib/TLibEncoder/TEncPreanalyzer.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncPreanalyzer.h	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/TEncPreanalyzer.h	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
Index: trunk/source/Lib/TLibEncoder/TEncRateCtrl.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncRateCtrl.cpp	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/TEncRateCtrl.cpp	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
Index: trunk/source/Lib/TLibEncoder/TEncRateCtrl.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncRateCtrl.h	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/TEncRateCtrl.h	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
Index: trunk/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
- * Copyright (c) 2010-2014, ITU/ISO/IEC
+ * Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
Index: trunk/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.h	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.h	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
- * Copyright (c) 2010-2014, ITU/ISO/IEC
+ * Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
Index: trunk/source/Lib/TLibEncoder/TEncSbac.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
@@ -58,7 +58,12 @@
 , m_cCUSplitFlagSCModel       ( 1,             1,               NUM_SPLIT_FLAG_CTX            , m_contextModels + m_numContextModels, m_numContextModels )
 , m_cCUSkipFlagSCModel        ( 1,             1,               NUM_SKIP_FLAG_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+, m_cCUDISFlagSCModel         ( 1,             1,               NUM_DIS_FLAG_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
+, m_cCUDISTypeSCModel         ( 1,             1,               NUM_DIS_TYPE_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
+#else
 #if H_3D_SINGLE_DEPTH
 , m_cCUSingleDepthFlagSCModel        ( 1,             1,               NUM_SINGLEDEPTH_FLAG_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
 , m_cSingleDepthValueSCModel         ( 1,             1,               NUM_SINGLE_DEPTH_VALUE_DATA_CTX      , m_contextModels + m_numContextModels, m_numContextModels)
+#endif
 #endif
 , m_cCUMergeFlagExtSCModel    ( 1,             1,               NUM_MERGE_FLAG_EXT_CTX        , m_contextModels + m_numContextModels, m_numContextModels)
@@ -134,7 +139,12 @@
   
   m_cCUSkipFlagSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SKIP_FLAG );
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+  m_cCUDISFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_DIS_FLAG );
+  m_cCUDISTypeSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_DIS_TYPE );
+#else
 #if H_3D_SINGLE_DEPTH
   m_cCUSingleDepthFlagSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SINGLEDEPTH_FLAG );
   m_cSingleDepthValueSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA );
+#endif
 #endif
   m_cCUMergeFlagExtSCModel.initBuffer    ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT);
@@ -214,7 +224,12 @@
       curCost  = m_cCUSplitFlagSCModel.calcCost       ( curSliceType, qp, (UChar*)INIT_SPLIT_FLAG );
       curCost += m_cCUSkipFlagSCModel.calcCost        ( curSliceType, qp, (UChar*)INIT_SKIP_FLAG );
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+      curCost += m_cCUDISFlagSCModel.calcCost         ( curSliceType, qp, (UChar*)INIT_DIS_FLAG );
+      curCost += m_cCUDISTypeSCModel.calcCost         ( curSliceType, qp, (UChar*)INIT_DIS_TYPE );
+#else
 #if H_3D_SINGLE_DEPTH
       curCost += m_cCUSingleDepthFlagSCModel.calcCost        ( curSliceType, qp, (UChar*)INIT_SINGLEDEPTH_FLAG );
       curCost += m_cSingleDepthValueSCModel.calcCost         ( curSliceType, qp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA );
+#endif
 #endif
       curCost += m_cCUMergeFlagExtSCModel.calcCost    ( curSliceType, qp, (UChar*)INIT_MERGE_FLAG_EXT);
@@ -287,8 +302,13 @@
   
   m_cCUSkipFlagSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SKIP_FLAG );
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+  m_cCUDISFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_DIS_FLAG );
+  m_cCUDISTypeSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_DIS_TYPE );
+#else
 #if H_3D_SINGLE_DEPTH
   m_cCUSingleDepthFlagSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SINGLEDEPTH_FLAG );
   m_cSingleDepthValueSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA );
-#endif  
+#endif
+#endif
   m_cCUMergeFlagExtSCModel.initBuffer    ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT);
   m_cCUMergeIdxExtSCModel.initBuffer     ( eSliceType, iQp, (UChar*)INIT_MERGE_IDX_EXT);
@@ -446,4 +466,37 @@
   m_pcBinIf->encodeBinsEP( bins, numBins );
 }
+
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+Void TEncSbac::codeDIS( TComDataCU* pcCU, UInt uiAbsPartIdx )
+{
+  UInt uiSymbol = pcCU->getDISFlag(uiAbsPartIdx ) ? 1 : 0;
+  m_pcBinIf->encodeBin( uiSymbol, m_cCUDISFlagSCModel.get( 0, 0, 0 ) );
+  if(uiSymbol)
+  {
+    UInt uiUnaryIdx = (UInt) pcCU->getDISType(uiAbsPartIdx);
+    UInt uiNumCand  = 4;
+
+    if ( uiNumCand > 1 )
+    {
+      for( UInt ui = 0; ui < uiNumCand - 1; ++ui )
+      {
+        const UInt uiSymbol2 = ui == uiUnaryIdx ? 0 : 1;
+        if ( ui == 0 )
+        {
+          m_pcBinIf->encodeBin( uiSymbol2, m_cCUDISTypeSCModel.get( 0, 0, 0 ) );
+        }
+        else
+        {
+          m_pcBinIf->encodeBinEP( uiSymbol2 );
+        }
+        if( uiSymbol2 == 0 )
+        {
+          break;
+        }
+      }
+    }
+  }
+}
+#else
 #if H_3D_SINGLE_DEPTH
 Void TEncSbac::codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx )
@@ -477,4 +530,6 @@
 }
 #endif
+#endif
+
 /** Coding of coeff_abs_level_minus3
  * \param uiSymbol value of coeff_abs_level_minus3
@@ -1040,5 +1095,8 @@
   DTRACE_CABAC_V( uiCtx )
   DTRACE_CABAC_T( "\n" )
-#endif
+#else
+  DTRACE_TU("split_transform_flag", uiSymbol )
+#endif
+
 }
 
@@ -1371,4 +1429,17 @@
   DTRACE_CABAC_V( uiAbsPartIdx )
   DTRACE_CABAC_T( "\n" )
+#else
+  if ( eType == TEXT_CHROMA_U )
+  {
+    DTRACE_TU("cbf_cb", uiCbf )
+  }
+  else if ( eType == TEXT_CHROMA_V )
+  {
+    DTRACE_TU("cbf_cr", uiCbf )
+  }
+  else
+  {
+    DTRACE_TU("cbf_luma", uiCbf )
+  }
 #endif
 }
@@ -1446,4 +1517,8 @@
     }
 
+#if H_3D_DISABLE_CHROMA
+    if( pcCU->getSlice()->getSPS()->getChromaFormatIdc() != 0 )
+    {    
+#endif
     piPCMSample = pcCU->getPCMSampleCb() + uiChromaOffset;
     uiWidth = pcCU->getWidth(uiAbsPartIdx)/2;
@@ -1477,4 +1552,7 @@
       piPCMSample += uiWidth;
     }
+#if H_3D_DISABLE_CHROMA
+    }
+#endif
     m_pcBinIf->resetBac();
   }
@@ -2289,5 +2367,5 @@
   UInt uiSymbol = pcCU->getSDCFlag( uiAbsPartIdx ) ? 1 : 0;
   UInt uiCtxSDCFlag = pcCU->getCtxSDCFlag( uiAbsPartIdx );
-
+  DTRACE_CU("dc_only_flag", uiSymbol)
   m_pcBinIf->encodeBin( uiSymbol, m_cSDCFlagSCModel.get( 0, 0, uiCtxSDCFlag ) );
 }
@@ -2305,4 +2383,5 @@
   UInt uiSymbol = pcCU->getDBBPFlag( uiAbsPartIdx ) ? 1 : 0;
   m_pcBinIf->encodeBin( uiSymbol, m_cDBBPFlagSCModel.get( 0, 0, 0 ) );
+  DTRACE_CU("dbbp_flag", uiSymbol)
 }
 #endif
Index: trunk/source/Lib/TLibEncoder/TEncSbac.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncSbac.h	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/TEncSbac.h	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
@@ -146,6 +146,10 @@
   Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx );
   Void codeSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx );
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+  Void codeDIS           ( TComDataCU* pcCU, UInt uiAbsPartIdx );
+#else
 #if H_3D_SINGLE_DEPTH
   Void codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx );
+#endif
 #endif
   Void codeMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx );
@@ -215,7 +219,12 @@
   ContextModel3DBuffer m_cCUSplitFlagSCModel;
   ContextModel3DBuffer m_cCUSkipFlagSCModel;
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+  ContextModel3DBuffer m_cCUDISFlagSCModel;
+  ContextModel3DBuffer m_cCUDISTypeSCModel;
+#else
 #if H_3D_SINGLE_DEPTH
   ContextModel3DBuffer m_cCUSingleDepthFlagSCModel;
   ContextModel3DBuffer m_cSingleDepthValueSCModel;
+#endif
 #endif
   ContextModel3DBuffer m_cCUMergeFlagExtSCModel;
Index: trunk/source/Lib/TLibEncoder/TEncSearch.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
@@ -915,10 +915,21 @@
         }
         m_pcEntropyCoder->encodeSkipFlag( pcCU, 0, true );
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+        m_pcEntropyCoder->encodeDIS(pcCU, 0, true );
+        if(!pcCU->getDISFlag(uiAbsPartIdx))
+#else
 #if H_3D_SINGLE_DEPTH
         m_pcEntropyCoder->encodeSingleDepthMode(pcCU, 0, true );
         if(!pcCU->getSingleDepthFlag(uiAbsPartIdx))
 #endif
-        m_pcEntropyCoder->encodePredMode( pcCU, 0, true );
-      }
+#endif
+          m_pcEntropyCoder->encodePredMode( pcCU, 0, true );
+      }
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+      else
+      {
+        m_pcEntropyCoder->encodeDIS(pcCU, 0, true );
+      }
+#else
 #if H_3D_SINGLE_DEPTH
       else
@@ -926,75 +937,118 @@
         m_pcEntropyCoder->encodeSingleDepthMode(pcCU, 0, true );
       }
-#endif      
+#endif
+#endif
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+      if(!pcCU->getDISFlag(uiAbsPartIdx))
+      {
+#else
 #if H_3D_SINGLE_DEPTH
       if(!pcCU->getSingleDepthFlag(uiAbsPartIdx))
       {
 #endif
-      m_pcEntropyCoder  ->encodePartSize( pcCU, 0, pcCU->getDepth(0), true );
-
+#endif
+        m_pcEntropyCoder  ->encodePartSize( pcCU, 0, pcCU->getDepth(0), true );
+
+#if !HHI_MOVE_SYN_K0052
 #if H_3D_DIM_SDC
-      m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
-#endif
-      if (pcCU->isIntra(0) && pcCU->getPartitionSize(0) == SIZE_2Nx2N )
-      {
-        m_pcEntropyCoder->encodeIPCMInfo( pcCU, 0, true );
-
-        if ( pcCU->getIPCMFlag (0))
-        {
-          return;
-        }
-      }
+        m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
+#endif
+#endif
+        if (pcCU->isIntra(0) && pcCU->getPartitionSize(0) == SIZE_2Nx2N )
+        {
+          m_pcEntropyCoder->encodeIPCMInfo( pcCU, 0, true );
+          if ( pcCU->getIPCMFlag (0))
+          {
+#if HHI_MOVE_SYN_K0052
+#if H_3D_DIM_SDC
+            m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
+#endif
+#endif
+            return;
+          }
+        }
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+      }
+#else
 #if H_3D_SINGLE_DEPTH
-    }
-#endif
-    }
+      }
+#endif
+#endif
+    }
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+    if(!pcCU->getDISFlag(uiAbsPartIdx))
+    {
+#else
 #if H_3D_SINGLE_DEPTH
-      if(!pcCU->getSingleDepthFlag(uiAbsPartIdx))
-      {
-#endif
-    // luma prediction mode
-    if( pcCU->getPartitionSize(0) == SIZE_2Nx2N )
-    {
-      if( uiAbsPartIdx == 0 )
-      {
-        m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, 0 );
+    if(!pcCU->getSingleDepthFlag(uiAbsPartIdx))
+    {
+#endif
+#endif
+      // luma prediction mode
+      if( pcCU->getPartitionSize(0) == SIZE_2Nx2N )
+      {
+        if( uiAbsPartIdx == 0 )
+        {
+          m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, 0 );
 #if H_3D_DIM_SDC
-        if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( 0 ) ) && getDimType( pcCU->getLumaIntraDir( 0 ) ) < DIM_NUM_TYPE ) 
-        {
-          m_pcEntropyCoder->encodeDeltaDC( pcCU, 0 );
-        }
-#endif
-      }
-    }
-    else
-    {
-      UInt uiQNumParts = pcCU->getTotalNumPart() >> 2;
-      if( uiTrDepth == 0 )
-      {
-        assert( uiAbsPartIdx == 0 );
-        for( UInt uiPart = 0; uiPart < 4; uiPart++ )
-        {
-          m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiPart * uiQNumParts );
+#if HHI_MOVE_SYN_K0052
 #if H_3D_DIM_SDC
-          if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( uiPart * uiQNumParts ) ) && getDimType( pcCU->getLumaIntraDir( uiPart * uiQNumParts ) ) < DIM_NUM_TYPE ) 
+          m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
+#endif
+#endif
+          if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( 0 ) ) && getDimType( pcCU->getLumaIntraDir( 0 ) ) < DIM_NUM_TYPE ) 
           {
-            m_pcEntropyCoder->encodeDeltaDC( pcCU, uiPart * uiQNumParts );
+            m_pcEntropyCoder->encodeDeltaDC( pcCU, 0 );
           }
 #endif
         }
       }
-      else if( ( uiAbsPartIdx % uiQNumParts ) == 0 )
-      {
-        m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiAbsPartIdx );
+      else
+      {
+        UInt uiQNumParts = pcCU->getTotalNumPart() >> 2;
+        if( uiTrDepth == 0 )
+        {
+          assert( uiAbsPartIdx == 0 );
+          for( UInt uiPart = 0; uiPart < 4; uiPart++ )
+          {
+            m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiPart * uiQNumParts );
+
+#if HHI_MOVE_SYN_K0052
+          }
+          m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
+          for( UInt uiPart = 0; uiPart < 4; uiPart++ )
+          {
+#endif
 #if H_3D_DIM_SDC
-        if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( uiAbsPartIdx ) ) && getDimType( pcCU->getLumaIntraDir( uiAbsPartIdx ) ) < DIM_NUM_TYPE ) 
-        {
-          m_pcEntropyCoder->encodeDeltaDC( pcCU, uiAbsPartIdx );
-      }
-#endif
-    }
-  }
+            if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( uiPart * uiQNumParts ) ) && getDimType( pcCU->getLumaIntraDir( uiPart * uiQNumParts ) ) < DIM_NUM_TYPE ) 
+            {
+              m_pcEntropyCoder->encodeDeltaDC( pcCU, uiPart * uiQNumParts );
+            }
+#endif
+          }
+        }
+        else if( ( uiAbsPartIdx % uiQNumParts ) == 0 )
+        {
+          m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiAbsPartIdx );
+#if H_3D_DIM_SDC
+#if HHI_MOVE_SYN_K0052
+          if( uiAbsPartIdx == 0 )  
+          {
+            m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
+          }
+#endif
+          if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( uiAbsPartIdx ) ) && getDimType( pcCU->getLumaIntraDir( uiAbsPartIdx ) ) < DIM_NUM_TYPE ) 
+          {
+            m_pcEntropyCoder->encodeDeltaDC( pcCU, uiAbsPartIdx );
+          }
+#endif
+        }
+      }
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+    }
+#else
 #if H_3D_SINGLE_DEPTH
     }
+#endif
 #endif
   }
@@ -1859,4 +1913,98 @@
   dRDCost  += dSingleCost;
 }
+
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+Void TEncSearch::xIntraCodingDIS( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, UInt uiPredMode )
+{
+  UInt    uiWidth           = pcCU     ->getWidth   ( 0 );
+  UInt    uiHeight          = pcCU     ->getHeight  ( 0 );
+  UInt    uiStride          = pcOrgYuv ->getStride  ();
+  Pel*    piOrg             = pcOrgYuv ->getLumaAddr( uiAbsPartIdx );
+  Pel*    piPred            = pcPredYuv->getLumaAddr( uiAbsPartIdx );
+
+  AOF( uiWidth == uiHeight );
+  AOF( uiAbsPartIdx == 0 );
+  pcCU->setDISTypeSubParts(uiPredMode, uiAbsPartIdx, 0, pcCU->getDepth(0));  
+  //===== reconstruction =====
+
+  Bool bAboveAvail = false;
+  Bool bLeftAvail  = false;
+  pcCU->getPattern()->initPattern   ( pcCU, 0, 0 );
+  pcCU->getPattern()->initAdiPattern( pcCU, 0, 0, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail );
+
+  if ( uiPredMode == 0 )
+  {
+    predIntraLumaAng( pcCU->getPattern(), VER_IDX, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail );
+  }
+  else if ( uiPredMode == 1 )
+  {
+    predIntraLumaAng( pcCU->getPattern(), HOR_IDX, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail );
+  }
+  else if ( uiPredMode == 2 )
+  {
+    Pel pSingleDepth = 1 << ( g_bitDepthY - 1 );
+    pcCU->getNeighDepth ( 0, 0, &pSingleDepth, 0 );
+    for( UInt uiY = 0; uiY < uiHeight; uiY++ )
+    {
+      for( UInt uiX = 0; uiX < uiWidth; uiX++ )
+      {
+        piPred[ uiX ] = pSingleDepth;
+      }
+      piPred+= uiStride;
+    }
+  }
+  else if ( uiPredMode == 3 )
+  {
+    Pel pSingleDepth = 1 << ( g_bitDepthY - 1 );
+    pcCU->getNeighDepth ( 0, 0, &pSingleDepth, 1 );
+    for( UInt uiY = 0; uiY < uiHeight; uiY++ )
+    {
+      for( UInt uiX = 0; uiX < uiWidth; uiX++ )
+      {
+        piPred[ uiX ] = pSingleDepth;
+      }
+      piPred+= uiStride;
+    }
+  }
+
+  // clear UV
+  UInt  uiStrideC     = pcPredYuv->getCStride();
+  Pel   *pRecCb       = pcPredYuv->getCbAddr();
+  Pel   *pRecCr       = pcPredYuv->getCrAddr();
+
+  for (Int y=0; y<uiHeight/2; y++)
+  {
+    for (Int x=0; x<uiWidth/2; x++)
+    {
+      pRecCb[x] = 1<<(g_bitDepthC-1);
+      pRecCr[x] = 1<<(g_bitDepthC-1);
+    }
+
+    pRecCb += uiStrideC;
+    pRecCr += uiStrideC;
+  }
+
+  piPred            = pcPredYuv->getLumaAddr( uiAbsPartIdx );
+  //===== determine distortion =====
+#if H_3D_VSO
+  if ( m_pcRdCost->getUseVSO() )
+    ruiDist = m_pcRdCost->getDistPartVSO  ( pcCU, uiAbsPartIdx, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, false );
+  else
+#endif
+    ruiDist = m_pcRdCost->getDistPart(g_bitDepthY, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight );
+
+  //===== determine rate and r-d cost =====
+  m_pcEntropyCoder->resetBits();
+  m_pcEntropyCoder->encodeDIS( pcCU, 0, true );
+  UInt uiBits = m_pcEntropyCoder->getNumberOfWrittenBits();
+
+#if H_3D_VSO
+  if ( m_pcRdCost->getUseLambdaScaleVSO())
+    dRDCost = m_pcRdCost->calcRdCostVSO( uiBits, ruiDist );
+  else
+#endif
+    dRDCost = m_pcRdCost->calcRdCost( uiBits, ruiDist );
+}
+#else
 #if H_3D_SINGLE_DEPTH
 Void TEncSearch::xIntraCodingSingleDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Int iTestDepthIdx, Pel *DepthNeighbor )
@@ -1921,4 +2069,6 @@
 }
 #endif
+#endif
+
 #if H_3D_DIM_SDC
 Void TEncSearch::xIntraCodingSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bZeroResidual, Int iSDCDeltaResi  )
@@ -2168,10 +2318,20 @@
 
   m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth( 0 ), true );
+#if !HHI_MOVE_SYN_K0052
   m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
+#endif
 
   // encode pred direction + DC residual data
   m_pcEntropyCoder->encodePredInfo( pcCU, 0, true );
+#if HHI_MOVE_SYN_K0052
+  m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
+#endif
+
   Bool bDummy = false;
+#if H_3D_DISABLE_CHROMA
+  m_pcEntropyCoder->encodeCoeff( pcCU, 0, pcCU->getDepth( 0 ), uiWidth, uiHeight, bDummy, true );
+#else
   m_pcEntropyCoder->encodeCoeff( pcCU, 0, pcCU->getDepth( 0 ), uiWidth, uiHeight, bDummy );
+#endif
   UInt uiBits = m_pcEntropyCoder->getNumberOfWrittenBits();
 
@@ -2861,4 +3021,65 @@
   pcCU->setChromIntraDirSubParts( uiBestMode, 0, pcCU->getDepth( 0 ) );
 }
+
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+Void TEncSearch::estIntraPredDIS( TComDataCU* pcCU, 
+                                  TComYuv*    pcOrgYuv, 
+                                  TComYuv*    pcPredYuv, 
+                                  TComYuv*    pcResiYuv, 
+                                  TComYuv*    pcRecoYuv,
+                                  UInt&       ruiDistC,
+                                  Bool        bLumaOnly )
+{
+  UInt    uiDepth        = pcCU->getDepth(0);
+  UInt    uiWidth        = pcCU->getWidth (0);
+  UInt    uiHeight       = pcCU->getHeight(0);
+
+
+  Pel* piOrg         = pcOrgYuv ->getLumaAddr( 0, uiWidth );
+  UInt uiStride      = pcPredYuv->getStride();
+
+  Dist   uiDist = 0;
+  Double dCost   = 0.0;
+  Dist    uiBestDist = 0;
+  Double  dBestCost   = MAX_DOUBLE;
+  UInt     uiBestDISType = 0;
+
+  for( UInt uiPredMode = 0; uiPredMode < 4 ; uiPredMode++ )
+  {
+    // set context models
+    m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST] );
+
+    // determine residual for partition
+    uiDist = 0;
+    dCost   = 0.0;
+#if H_3D_VSO // M36
+    if( m_pcRdCost->getUseRenModel() )
+    {
+      m_pcRdCost->setRenModelData( pcCU, 0, piOrg, uiStride, uiWidth, uiHeight );
+    }
+#endif
+    xIntraCodingDIS(pcCU, 0, pcOrgYuv, pcPredYuv, uiDist, dCost, uiPredMode);
+    // check r-d cost
+    if( dCost < dBestCost )
+    {
+      uiBestDist = uiDist;
+      dBestCost   = dCost;
+      uiBestDISType = pcCU->getDISType(0);
+      // copy reconstruction
+      pcPredYuv->copyPartToPartYuv(pcRecoYuv, 0, uiWidth, uiHeight);
+    }
+  } 
+
+
+  pcCU->setDISTypeSubParts(uiBestDISType, 0, 0, uiDepth);  
+  assert(uiBestDISType >= 0);
+
+  //===== reset context models =====
+  m_pcRDGoOnSbacCoder->load(m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST]);
+
+  //===== set distortion (rate and r-d costs are determined later) =====
+  pcCU->getTotalDistortion() = uiBestDist;
+}
+#else
 #if H_3D_SINGLE_DEPTH
 Void 
@@ -2950,4 +3171,6 @@
 
 #endif 
+#endif
+
 Void 
 TEncSearch::estIntraPredQT( TComDataCU* pcCU, 
@@ -5311,6 +5534,19 @@
   TComMv      cMvPred = *pcMvPred;
   
+#if SONY_MV_V_CONST_C0078
+  Bool bMv_VRng_Restricted = false;
+  if( m_pcEncCfg->getUseDisparitySearchRangeRestriction()
+       &&
+      pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxPred )->getPOC() == pcCU->getSlice()->getPOC()
+    )
+  {
+      bMv_VRng_Restricted = true;
+  }
+  if ( bBi )  xSetSearchRange   ( pcCU, rcMv   , iSrchRng, cMvSrchRngLT, cMvSrchRngRB, bMv_VRng_Restricted, m_pcEncCfg->getVerticalDisparitySearchRange() );
+  else        xSetSearchRange   ( pcCU, cMvPred, iSrchRng, cMvSrchRngLT, cMvSrchRngRB, bMv_VRng_Restricted, m_pcEncCfg->getVerticalDisparitySearchRange() );
+#else
   if ( bBi )  xSetSearchRange   ( pcCU, rcMv   , iSrchRng, cMvSrchRngLT, cMvSrchRngRB );
   else        xSetSearchRange   ( pcCU, cMvPred, iSrchRng, cMvSrchRngLT, cMvSrchRngRB );
+#endif
   
   m_pcRdCost->getMotionCost ( 1, 0 );
@@ -5365,5 +5601,9 @@
 
 
+#if SONY_MV_V_CONST_C0078
+Void TEncSearch::xSetSearchRange ( TComDataCU* pcCU, TComMv& cMvPred, Int iSrchRng, TComMv& rcMvSrchRngLT, TComMv& rcMvSrchRngRB, Bool bMv_VRng_Restricted, Int iVerDispSrchRng )
+#else
 Void TEncSearch::xSetSearchRange ( TComDataCU* pcCU, TComMv& cMvPred, Int iSrchRng, TComMv& rcMvSrchRngLT, TComMv& rcMvSrchRngRB )
+#endif
 {
   Int  iMvShift = 2;
@@ -5380,4 +5620,14 @@
   rcMvSrchRngRB.setHor( cTmpMvPred.getHor() + (iSrchRng << iMvShift) );
   rcMvSrchRngRB.setVer( cTmpMvPred.getVer() + (iSrchRng << iMvShift) );
+  
+#if SONY_MV_V_CONST_C0078
+  if ( bMv_VRng_Restricted ) {
+    Int iRestrictMvVrange = ( iVerDispSrchRng - 1 ) << iMvShift ; // -1 to consider subpel search
+    if ( rcMvSrchRngRB.getVer() >= iRestrictMvVrange  ){
+      rcMvSrchRngRB.setVer( iRestrictMvVrange ); //only positive side is restricted
+    }
+  }
+#endif
+
   pcCU->clipMv        ( rcMvSrchRngLT );
   pcCU->clipMv        ( rcMvSrchRngRB );
@@ -7119,5 +7369,9 @@
     const UInt uiQTTempAccessLayer = pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() - uiLog2TrSize;
 
+#if 0 //H_3D_DISABLE_CHROMA
+    Bool  bCodeChroma   = !pcCU->getSlice()->getIsDepth();
+#else
     Bool  bCodeChroma   = true;
+#endif
     UInt  uiTrModeC     = uiTrMode;
     UInt  uiLog2TrSizeC = uiLog2TrSize-1;
@@ -7261,21 +7515,39 @@
     }
     m_pcEntropyCoder->encodeSkipFlag ( pcCU, 0, true );
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+    m_pcEntropyCoder->encodeDIS ( pcCU, 0, true );
+#else
 #if H_3D_SINGLE_DEPTH
     m_pcEntropyCoder->encodeSingleDepthMode ( pcCU, 0, true );
 #endif
+#endif
     m_pcEntropyCoder->encodePredMode( pcCU, 0, true );
     m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth(0), true );
+#if !HHI_MOVE_SYN_K0052
 #if H_3D_DIM_SDC
     m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
 #endif
+#endif 
     m_pcEntropyCoder->encodePredInfo( pcCU, 0, true );
+#if HHI_MOVE_SYN_K0052
+#if H_3D_DIM_SDC
+    m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
+#endif
+#endif
 #if H_3D_ARP
-    m_pcEntropyCoder->encodeARPW( pcCU , 0 );
+    m_pcEntropyCoder->encodeARPW( pcCU , 0  );
 #endif
 #if H_3D_IC
     m_pcEntropyCoder->encodeICFlag( pcCU, 0, true );
 #endif
+#if HHI_MOVE_SYN_K0052
+    m_pcEntropyCoder->encodeDBBPFlag( pcCU, 0, true );
+#endif
     Bool bDummy = false;
+#if H_3D_DISABLE_CHROMA
+    m_pcEntropyCoder->encodeCoeff   ( pcCU, 0, pcCU->getDepth(0), pcCU->getWidth(0), pcCU->getHeight(0), bDummy, true );
+#else
     m_pcEntropyCoder->encodeCoeff   ( pcCU, 0, pcCU->getDepth(0), pcCU->getWidth(0), pcCU->getHeight(0), bDummy );
+#endif
     
     ruiBits += m_pcEntropyCoder->getNumberOfWrittenBits();
Index: trunk/source/Lib/TLibEncoder/TEncSearch.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncSearch.h	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/TEncSearch.h	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
@@ -191,4 +191,13 @@
                                   TComYuv*    pcRecoYuv,
                                   UInt        uiPreCalcDistC );
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+  Void  estIntraPredDIS        ( TComDataCU* pcCU, 
+                                 TComYuv*    pcOrgYuv, 
+                                 TComYuv*    pcPredYuv, 
+                                 TComYuv*    pcResiYuv, 
+                                 TComYuv*    pcRecoYuv,
+                                 UInt&       ruiDistC,
+                                 Bool        bLumaOnly );
+#else
 #if H_3D_SINGLE_DEPTH
   Void  estIntraPredSingleDepth  ( TComDataCU* pcCU, 
@@ -199,5 +208,6 @@
                                   UInt&       ruiDistC,
                                   Bool        bLumaOnly );
-#endif    
+#endif
+#endif
   
   /// encoder estimation - inter prediction (non-skip)
@@ -354,6 +364,10 @@
                                     UInt         uiAbsPartIdx,
                                     UInt         stateU0V1Both2 );
+#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
+  Void xIntraCodingDIS           ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, UInt uiPredMode );
+#else
 #if H_3D_SINGLE_DEPTH
   Void xIntraCodingSingleDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Int iTestDepthIdx, Pel * DepthNeighbor );
+#endif
 #endif
 #if H_3D_DIM
@@ -466,4 +480,13 @@
                                     UInt&         ruiSAD );
   
+#if SONY_MV_V_CONST_C0078
+  Void xSetSearchRange           (  TComDataCU* pcCU, 
+                                    TComMv& cMvPred, 
+                                    Int iSrchRng, 
+                                    TComMv& rcMvSrchRngLT, 
+                                    TComMv& rcMvSrchRngRB, 
+                                    Bool bMv_VRng_Restricted, 
+                                    Int iVerDispSrchRng );
+#else
   Void xSetSearchRange            ( TComDataCU*   pcCU,
                                     TComMv&       cMvPred,
@@ -471,4 +494,5 @@
                                     TComMv&       rcMvSrchRngLT,
                                     TComMv&       rcMvSrchRngRB );
+#endif
   
   Void xPatternSearchFast         ( TComDataCU*   pcCU,
Index: trunk/source/Lib/TLibEncoder/TEncSlice.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
@@ -215,6 +215,8 @@
   rpcSlice->setPicOutputFlag( true );
   rpcSlice->setPOC( pocCurr );
+#if !HHI_INTER_COMP_PRED_K0052
 #if H_3D
-  rpcSlice->init3dToolParameters(); 
+    rpcSlice->init3dToolParameters(); 
+#endif
 #endif
 #if H_3D_IC
@@ -610,8 +612,14 @@
   rpcSlice->setSliceSegmentMode     ( m_pcCfg->getSliceSegmentMode()     );
   rpcSlice->setSliceSegmentArgument ( m_pcCfg->getSliceSegmentArgument() );
+#if !HHI_INTER_COMP_PRED_K0052
 #if H_3D_IV_MERGE
   rpcSlice->setMaxNumMergeCand      ( m_pcCfg->getMaxNumMergeCand()   + ( ( rpcSlice->getMpiFlag( ) || rpcSlice->getIvMvPredFlag( ) || rpcSlice->getViewSynthesisPredFlag( )   ) ? 1 : 0 ));
 #else
   rpcSlice->setMaxNumMergeCand        ( m_pcCfg->getMaxNumMergeCand()        );
+#endif
+#else
+#if !H_3D
+  rpcSlice->setMaxNumMergeCand        ( m_pcCfg->getMaxNumMergeCand()        );
+#endif
 #endif
   xStoreWPparam( pPPS->getUseWP(), pPPS->getWPBiPred() );
Index: trunk/source/Lib/TLibEncoder/TEncSlice.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncSlice.h	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/TEncSlice.h	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
Index: trunk/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncTop.cpp	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/TEncTop.cpp	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
@@ -91,4 +91,7 @@
   m_aICEnableNum = NULL;
 #endif
+#if H_3D_ANNEX_SELECTION_FIX
+  m_cCavlcCoder.setEncTop(this); 
+#endif
 }
 
@@ -364,4 +367,5 @@
   }
 #endif
+
   // initialize processing unit classes
   m_cGOPEncoder.  init( this );
@@ -413,5 +417,9 @@
 #endif
 #if H_3D
+#if HHI_CAM_PARA_K0052
+  pcPicCurr->setScaleOffset( m_cameraParameters->getCodedScale(), m_cameraParameters->getCodedOffset() );
+#else
   pcPicCurr->setScaleOffset( m_aaiCodedScale, m_aaiCodedOffset );
+#endif
 #endif
 }
@@ -760,5 +768,11 @@
     m_cSPS.setSpsInferScalingListFlag   ( true ); 
     m_cSPS.setSpsScalingListRefLayerId( m_cVPS->getIdRefLayer( getLayerId(), 0 ) ); 
-  }
+#if SONY_MV_V_CONST_C0078
+    if ( m_bUseDisparitySearchRangeRestriction )
+    {
+      m_cSPS.setInterViewMvVertConstraintFlag ( true ) ;
+    }
+#endif
+  }  
   m_cSPS.setSpsExtensionPresentFlag       ( true ); 
   m_cSPS.setSpsMultilayerExtensionFlag    ( true ); 
@@ -773,4 +787,7 @@
   m_cSPS.setMaxCUHeight   ( g_uiMaxCUHeight     );
   m_cSPS.setMaxCUDepth    ( g_uiMaxCUDepth      );
+#if H_3D_DISABLE_CHROMA
+  m_cSPS.setChromaFormatIdc( getIsDepth() ? CHROMA_400 : CHROMA_420 ); 
+#endif
 
   Int minCUSize = m_cSPS.getMaxCUWidth() >> ( m_cSPS.getMaxCUDepth()-g_uiAddCUDepth );
Index: trunk/source/Lib/TLibEncoder/TEncTop.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncTop.h	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/TEncTop.h	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
Index: trunk/source/Lib/TLibEncoder/WeightPredAnalysis.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/WeightPredAnalysis.cpp	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/WeightPredAnalysis.cpp	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
Index: trunk/source/Lib/TLibEncoder/WeightPredAnalysis.h
===================================================================
--- trunk/source/Lib/TLibEncoder/WeightPredAnalysis.h	(revision 1133)
+++ trunk/source/Lib/TLibEncoder/WeightPredAnalysis.h	(revision 1179)
@@ -4,5 +4,5 @@
  * granted under this license.  
  *
-* Copyright (c) 2010-2014, ITU/ISO/IEC
+* Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
