Index: trunk/source/Lib/TLibCommon/TComPattern.cpp
===================================================================
--- trunk/source/Lib/TLibCommon/TComPattern.cpp	(revision 2)
+++ trunk/source/Lib/TLibCommon/TComPattern.cpp	(revision 5)
@@ -1,2 +1,35 @@
+/* The copyright in this software is being made available under the BSD
+ * License, included below. This software may be subject to other third party
+ * and contributor rights, including patent rights, and no such rights are
+ * granted under this license.
+ *
+ * Copyright (c) 2010-2011, ISO/IEC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *  * Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *  * Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *  * Neither the name of the ISO/IEC nor the names of its contributors may
+ *    be used to endorse or promote products derived from this software without
+ *    specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 
 
@@ -91,6 +124,9 @@
                                          Int         iOffsetBottom,
                                          UInt        uiPartDepth,
-                                         UInt        uiAbsPartIdx,
-                                         Bool        bPrdDepthMap )
+                                         UInt        uiAbsPartIdx
+#if DEPTH_MAP_GENERATION
+                                        ,Bool        bPrdDepthMap
+#endif
+                                         )
 {
   m_iOffsetLeft   = iOffsetLeft;
@@ -104,5 +140,9 @@
   UInt uiAbsZorderIdx = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
   
+#if DEPTH_MAP_GENERATION
   TComPicYuv* pcPic = ( bPrdDepthMap ? pcCU->getPic()->getPredDepthMap() : pcCU->getPic()->getPicYuvRec() );
+#else
+  TComPicYuv* pcPic = pcCU->getPic()->getPicYuvRec();
+#endif
   if ( iComp == 0 )
   {
@@ -142,5 +182,9 @@
 }
 
-Void TComPattern::initPattern( TComDataCU* pcCU, UInt uiPartDepth, UInt uiAbsPartIdx, Bool bPrdDepthMap )
+Void TComPattern::initPattern( TComDataCU* pcCU, UInt uiPartDepth, UInt uiAbsPartIdx
+#if DEPTH_MAP_GENERATION
+                             , Bool bPrdDepthMap 
+#endif
+                             )
 {
   Int   uiOffsetLeft  = 0;
@@ -185,10 +229,20 @@
 #endif
 
+#if DEPTH_MAP_GENERATION
   m_cPatternY .setPatternParamCU( pcCU, 0, uiWidth,      uiHeight,      uiOffsetLeft, uiOffsetRight, uiOffsetAbove, 0, uiPartDepth, uiAbsPartIdx, bPrdDepthMap );
   m_cPatternCb.setPatternParamCU( pcCU, 1, uiWidth >> 1, uiHeight >> 1, uiOffsetLeft, uiOffsetRight, uiOffsetAbove, 0, uiPartDepth, uiAbsPartIdx, bPrdDepthMap );
   m_cPatternCr.setPatternParamCU( pcCU, 2, uiWidth >> 1, uiHeight >> 1, uiOffsetLeft, uiOffsetRight, uiOffsetAbove, 0, uiPartDepth, uiAbsPartIdx, bPrdDepthMap );
-}
-
-Void TComPattern::initAdiPattern( TComDataCU* pcCU, UInt uiZorderIdxInPart, UInt uiPartDepth, Int* piAdiBuf, Int iOrgBufStride, Int iOrgBufHeight, Bool& bAbove, Bool& bLeft, Bool bPrdDepthMap )
+#else
+  m_cPatternY .setPatternParamCU( pcCU, 0, uiWidth,      uiHeight,      uiOffsetLeft, uiOffsetRight, uiOffsetAbove, 0, uiPartDepth, uiAbsPartIdx );
+  m_cPatternCb.setPatternParamCU( pcCU, 1, uiWidth >> 1, uiHeight >> 1, uiOffsetLeft, uiOffsetRight, uiOffsetAbove, 0, uiPartDepth, uiAbsPartIdx );
+  m_cPatternCr.setPatternParamCU( pcCU, 2, uiWidth >> 1, uiHeight >> 1, uiOffsetLeft, uiOffsetRight, uiOffsetAbove, 0, uiPartDepth, uiAbsPartIdx );
+#endif
+}
+
+Void TComPattern::initAdiPattern( TComDataCU* pcCU, UInt uiZorderIdxInPart, UInt uiPartDepth, Int* piAdiBuf, Int iOrgBufStride, Int iOrgBufHeight, Bool& bAbove, Bool& bLeft
+#if DEPTH_MAP_GENERATION
+                                , Bool bPrdDepthMap 
+#endif
+                                )
 {
   Pel*  piRoiOrigin;
@@ -330,4 +384,5 @@
   piAdiTemp   = piAdiBuf;
 
+#if DEPTH_MAP_GENERATION
   if( bPrdDepthMap )
   {
@@ -338,8 +393,13 @@
 #endif
   }
-
-
-#if REFERENCE_SAMPLE_PADDING
+#endif
+
+
+#if REFERENCE_SAMPLE_PADDING
+#if DEPTH_MAP_GENERATION
   fillReferenceSamples ( pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitSize, iNumUnitsInCu, iTotalUnits, uiCuWidth, uiCuHeight, uiWidth, uiHeight, iPicStride, bPrdDepthMap );
+#else
+  fillReferenceSamples ( pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitSize, iNumUnitsInCu, iTotalUnits, uiCuWidth, uiCuHeight, uiWidth, uiHeight, iPicStride );
+#endif
   delete [] bNeighborFlags;
   bNeighborFlags = NULL;
@@ -586,5 +646,9 @@
 
 #if REFERENCE_SAMPLE_PADDING
+#if DEPTH_MAP_GENERATION
   fillReferenceSamples ( pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitSize, iNumUnitsInCu, iTotalUnits, uiCuWidth, uiCuHeight, uiWidth, uiHeight, iPicStride, false );
+#else
+  fillReferenceSamples ( pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitSize, iNumUnitsInCu, iTotalUnits, uiCuWidth, uiCuHeight, uiWidth, uiHeight, iPicStride );
+#endif
 #else // REFERENCE_SAMPLE_PADDING
   for (i=0;i<uiWidth;i++)
@@ -648,5 +712,9 @@
   
 #if REFERENCE_SAMPLE_PADDING
+#if DEPTH_MAP_GENERATION
   fillReferenceSamples ( pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitSize, iNumUnitsInCu, iTotalUnits, uiCuWidth, uiCuHeight, uiWidth, uiHeight, iPicStride, false );
+#else
+  fillReferenceSamples ( pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitSize, iNumUnitsInCu, iTotalUnits, uiCuWidth, uiCuHeight, uiWidth, uiHeight, iPicStride );
+#endif
   delete [] bNeighborFlags;
   bNeighborFlags = NULL;
@@ -709,9 +777,17 @@
 
 #if REFERENCE_SAMPLE_PADDING
-Void TComPattern::fillReferenceSamples( TComDataCU* pcCU, Pel* piRoiOrigin, Int* piAdiTemp, Bool* bNeighborFlags, Int iNumIntraNeighbor, Int iUnitSize, Int iNumUnitsInCu, Int iTotalUnits, UInt uiCuWidth, UInt uiCuHeight, UInt uiWidth, UInt uiHeight, Int iPicStride, Bool bPrdDepthMap )
+Void TComPattern::fillReferenceSamples( TComDataCU* pcCU, Pel* piRoiOrigin, Int* piAdiTemp, Bool* bNeighborFlags, Int iNumIntraNeighbor, Int iUnitSize, Int iNumUnitsInCu, Int iTotalUnits, UInt uiCuWidth, UInt uiCuHeight, UInt uiWidth, UInt uiHeight, Int iPicStride
+#if DEPTH_MAP_GENERATION
+                                        , Bool bPrdDepthMap 
+#endif
+                                        )
 {
   Pel* piRoiTemp;
   Int  i, j;
+#if DEPTH_MAP_GENERATION
   Int  iDCValue = ( bPrdDepthMap ? PDM_UNDEFINED_DEPTH : ( 1<<( g_uiBitDepth + g_uiBitIncrement - 1) ) );
+#else
+  Int  iDCValue = ( 1<<( g_uiBitDepth + g_uiBitIncrement - 1) );
+#endif
   
   if (iNumIntraNeighbor == 0)
@@ -885,9 +961,5 @@
 
 #if QC_MDIS
-#if HHI_DISABLE_INTRA_SMOOTHING_DEPTH
-Int* TComPattern::getPredictorPtr ( UInt uiDirMode, UInt uiWidthBits, Int iCuWidth, Int iCuHeight, Int* piAdiBuf, Bool bDepth )
-#else
 Int* TComPattern::getPredictorPtr ( UInt uiDirMode, UInt uiWidthBits, Int iCuWidth, Int iCuHeight, Int* piAdiBuf )
-#endif
 {
 #if MN_MDIS_SIMPLIFICATION
@@ -919,12 +991,5 @@
   mapPlanartoDC( uiDirMode );
 #endif
-#if HHI_DISABLE_INTRA_SMOOTHING_DEPTH
-  UChar ucFiltIdx = 0;
-  if ( !bDepth )
-  {
-    ucFiltIdx = g_aucIntraFilter[uiWidthBits][uiDirMode];
-  }
-#else
-#if HHI_DMM_INTRA
+#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
   UChar ucFiltIdx = 0;
   if ( uiDirMode < 34 )
@@ -934,5 +999,4 @@
 #else
   UChar ucFiltIdx = g_aucIntraFilter[uiWidthBits][uiDirMode];
-#endif
 #endif
 
