Index: /branches/SHM-dev/source/Lib/TLibCommon/ContextTables.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/ContextTables.h	(revision 1314)
+++ /branches/SHM-dev/source/Lib/TLibCommon/ContextTables.h	(revision 1315)
@@ -58,5 +58,5 @@
 #define NUM_PRED_MODE_CTX             1       ///< number of context models for prediction mode
 
-#define NUM_ADI_CTX                   1       ///< number of context models for intra prediction
+#define NUM_INTRA_PREDICT_CTX         1       ///< number of context models for intra prediction
 
 #define NUM_CHROMA_PRED_CTX           2       ///< number of context models for intra prediction (chroma)
@@ -227,5 +227,5 @@
 
 static const UChar
-INIT_INTRA_PRED_MODE[NUMBER_OF_SLICE_TYPES][NUM_ADI_CTX] =
+INIT_INTRA_PRED_MODE[NUMBER_OF_SLICE_TYPES][NUM_INTRA_PREDICT_CTX] =
 {
   { 183, },
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1314)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1315)
@@ -1149,113 +1149,5 @@
 }
 
-TComDataCU* TComDataCU::getPUAboveRight( UInt& uiARPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction )
-{
-  UInt uiAbsPartIdxRT     = g_auiZscanToRaster[uiCurrPartUnitIdx];
-  UInt uiAbsZorderCUIdx   = g_auiZscanToRaster[ m_absZIdxInCtu ] + m_puhWidth[0] / m_pcPic->getMinCUWidth() - 1;
-  const UInt numPartInCtuWidth = m_pcPic->getNumPartInCtuWidth();
-  
-#if SVC_EXTENSION
-  if( ( m_pcPic->getCtu(m_ctuRsAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxRT] + m_pcPic->getMinCUWidth() ) >= m_pcSlice->getPicWidthInLumaSamples() )
-#else
-  if( ( m_pcPic->getCtu(m_ctuRsAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxRT] + m_pcPic->getMinCUWidth() ) >= m_pcSlice->getSPS()->getPicWidthInLumaSamples() )
-#endif
-  {
-    uiARPartUnitIdx = MAX_UINT;
-    return NULL;
-  }
-
-  if ( RasterAddress::lessThanCol( uiAbsPartIdxRT, numPartInCtuWidth - 1, numPartInCtuWidth ) )
-  {
-    if ( !RasterAddress::isZeroRow( uiAbsPartIdxRT, numPartInCtuWidth ) )
-    {
-      if ( uiCurrPartUnitIdx > g_auiRasterToZscan[ uiAbsPartIdxRT - numPartInCtuWidth + 1 ] )
-      {
-        uiARPartUnitIdx = g_auiRasterToZscan[ uiAbsPartIdxRT - numPartInCtuWidth + 1 ];
-        if ( RasterAddress::isEqualRowOrCol( uiAbsPartIdxRT, uiAbsZorderCUIdx, numPartInCtuWidth ) )
-        {
-          return m_pcPic->getCtu( getCtuRsAddr() );
-        }
-        else
-        {
-          uiARPartUnitIdx -= m_absZIdxInCtu;
-          return this;
-        }
-      }
-      uiARPartUnitIdx = MAX_UINT;
-      return NULL;
-    }
-    uiARPartUnitIdx = g_auiRasterToZscan[ uiAbsPartIdxRT + m_pcPic->getNumPartitionsInCtu() - numPartInCtuWidth + 1 ];
-
-    if ( bEnforceSliceRestriction && !CUIsFromSameSliceAndTile(m_pCtuAbove) )
-    {
-      return NULL;
-    }
-    return m_pCtuAbove;
-  }
-
-  if ( !RasterAddress::isZeroRow( uiAbsPartIdxRT, numPartInCtuWidth ) )
-  {
-    uiARPartUnitIdx = MAX_UINT;
-    return NULL;
-  }
-
-  uiARPartUnitIdx = g_auiRasterToZscan[ m_pcPic->getNumPartitionsInCtu() - numPartInCtuWidth ];
-
-  if ( bEnforceSliceRestriction && !CUIsFromSameSliceAndTile(m_pCtuAboveRight) )
-  {
-    return NULL;
-  }
-  return m_pCtuAboveRight;
-}
-
-TComDataCU* TComDataCU::getPUBelowLeft( UInt& uiBLPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction )
-{
-  UInt uiAbsPartIdxLB     = g_auiZscanToRaster[uiCurrPartUnitIdx];
-  const UInt numPartInCtuWidth = m_pcPic->getNumPartInCtuWidth();
-  UInt uiAbsZorderCUIdxLB = g_auiZscanToRaster[ m_absZIdxInCtu ] + (m_puhHeight[0] / m_pcPic->getMinCUHeight() - 1)*numPartInCtuWidth;
-
-#if SVC_EXTENSION
-  if( ( m_pcPic->getCtu(m_ctuRsAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxLB] + m_pcPic->getMinCUHeight() ) >= m_pcSlice->getPicHeightInLumaSamples() )
-#else
-  if( ( m_pcPic->getCtu(m_ctuRsAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxLB] + m_pcPic->getMinCUHeight() ) >= m_pcSlice->getSPS()->getPicHeightInLumaSamples() )
-#endif
-  {
-    uiBLPartUnitIdx = MAX_UINT;
-    return NULL;
-  }
-
-  if ( RasterAddress::lessThanRow( uiAbsPartIdxLB, m_pcPic->getNumPartInCtuHeight() - 1, numPartInCtuWidth ) )
-  {
-    if ( !RasterAddress::isZeroCol( uiAbsPartIdxLB, numPartInCtuWidth ) )
-    {
-      if ( uiCurrPartUnitIdx > g_auiRasterToZscan[ uiAbsPartIdxLB + numPartInCtuWidth - 1 ] )
-      {
-        uiBLPartUnitIdx = g_auiRasterToZscan[ uiAbsPartIdxLB + numPartInCtuWidth - 1 ];
-        if ( RasterAddress::isEqualRowOrCol( uiAbsPartIdxLB, uiAbsZorderCUIdxLB, numPartInCtuWidth ) )
-        {
-          return m_pcPic->getCtu( getCtuRsAddr() );
-        }
-        else
-        {
-          uiBLPartUnitIdx -= m_absZIdxInCtu;
-          return this;
-        }
-      }
-      uiBLPartUnitIdx = MAX_UINT;
-      return NULL;
-    }
-    uiBLPartUnitIdx = g_auiRasterToZscan[ uiAbsPartIdxLB + numPartInCtuWidth*2 - 1 ];
-    if ( bEnforceSliceRestriction && !CUIsFromSameSliceAndTile(m_pCtuLeft) )
-    {
-      return NULL;
-    }
-    return m_pCtuLeft;
-  }
-
-  uiBLPartUnitIdx = MAX_UINT;
-  return NULL;
-}
-
-TComDataCU* TComDataCU::getPUBelowLeftAdi(UInt& uiBLPartUnitIdx,  UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset, Bool bEnforceSliceRestriction)
+TComDataCU* TComDataCU::getPUBelowLeft(UInt& uiBLPartUnitIdx,  UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset, Bool bEnforceSliceRestriction)
 {
   UInt uiAbsPartIdxLB     = g_auiZscanToRaster[uiCurrPartUnitIdx];
@@ -1305,5 +1197,5 @@
 }
 
-TComDataCU* TComDataCU::getPUAboveRightAdi(UInt&  uiARPartUnitIdx, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset, Bool bEnforceSliceRestriction)
+TComDataCU* TComDataCU::getPUAboveRight(UInt&  uiARPartUnitIdx, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset, Bool bEnforceSliceRestriction)
 {
   UInt uiAbsPartIdxRT     = g_auiZscanToRaster[uiCurrPartUnitIdx];
@@ -2281,23 +2173,4 @@
       break;
   }
-}
-
-Void TComDataCU::deriveLeftRightTopIdxAdi ( UInt& ruiPartIdxLT, UInt& ruiPartIdxRT, UInt uiPartOffset, UInt uiPartDepth )
-{
-  UInt uiNumPartInWidth = (m_puhWidth[0]/m_pcPic->getMinCUWidth())>>uiPartDepth;
-  ruiPartIdxLT = m_absZIdxInCtu + uiPartOffset;
-  ruiPartIdxRT = g_auiRasterToZscan[ g_auiZscanToRaster[ ruiPartIdxLT ] + uiNumPartInWidth - 1 ];
-}
-
-Void TComDataCU::deriveLeftBottomIdxAdi( UInt& ruiPartIdxLB, UInt uiPartOffset, UInt uiPartDepth )
-{
-  UInt uiAbsIdx;
-  UInt uiMinCuWidth, uiWidthInMinCus;
-
-  uiMinCuWidth    = getPic()->getMinCUWidth();
-  uiWidthInMinCus = (getWidth(0)/uiMinCuWidth)>>uiPartDepth;
-  uiAbsIdx        = getZorderIdxInCtu()+uiPartOffset+(m_uiNumPartition>>(uiPartDepth<<1))-1;
-  uiAbsIdx        = g_auiZscanToRaster[uiAbsIdx]-(uiWidthInMinCus-1);
-  ruiPartIdxLB    = g_auiRasterToZscan[uiAbsIdx];
 }
 
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.h	(revision 1314)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.h	(revision 1315)
@@ -414,6 +414,4 @@
                                               Bool bEnforceTileRestriction=true );
   TComDataCU*   getPUAboveLeft              ( UInt&  uiALPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true );
-  TComDataCU*   getPUAboveRight             ( UInt&  uiARPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true );
-  TComDataCU*   getPUBelowLeft              ( UInt&  uiBLPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true );
 
   TComDataCU*   getQpMinCuLeft              ( UInt&  uiLPartUnitIdx , UInt uiCurrAbsIdxInCtu );
@@ -421,12 +419,11 @@
   Char          getRefQP                    ( UInt   uiCurrAbsIdxInCtu                       );
 
-  TComDataCU*   getPUAboveRightAdi          ( UInt&  uiARPartUnitIdx, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset = 1, Bool bEnforceSliceRestriction=true );
-  TComDataCU*   getPUBelowLeftAdi           ( UInt&  uiBLPartUnitIdx, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset = 1, Bool bEnforceSliceRestriction=true );
+  /// returns CU and part index of the PU above the top row of the current uiCurrPartUnitIdx of the CU, at a horizontal offset (to the right) of uiPartUnitOffset (in parts)
+  TComDataCU*   getPUAboveRight             ( UInt&  uiARPartUnitIdx, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset = 1, Bool bEnforceSliceRestriction=true );
+  /// returns CU and part index of the PU left of the lefthand column of the current uiCurrPartUnitIdx of the CU, at a vertical offset (below) of uiPartUnitOffset (in parts)
+  TComDataCU*   getPUBelowLeft              ( UInt&  uiBLPartUnitIdx, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset = 1, Bool bEnforceSliceRestriction=true );
 
   Void          deriveLeftRightTopIdx       ( UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT );
   Void          deriveLeftBottomIdx         ( UInt uiPartIdx, UInt& ruiPartIdxLB );
-
-  Void          deriveLeftRightTopIdxAdi    ( UInt& ruiPartIdxLT, UInt& ruiPartIdxRT, UInt uiPartOffset, UInt uiPartDepth );
-  Void          deriveLeftBottomIdxAdi      ( UInt& ruiPartIdxLB, UInt  uiPartOffset, UInt uiPartDepth ); // NOTE: Unused function.
 
   Bool          hasEqualMotion              ( UInt uiAbsPartIdx, TComDataCU* pcCandCU, UInt uiCandAbsPartIdx );
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComPattern.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComPattern.cpp	(revision 1314)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComPattern.cpp	(revision 1315)
@@ -54,5 +54,5 @@
 #endif
                            const Pel* piRoiOrigin, 
-                                 Pel* piAdiTemp, 
+                                 Pel* piIntraTemp,
                            const Bool* bNeighborFlags,
                            const Int iNumIntraNeighbor, 
@@ -113,5 +113,5 @@
 
 // TODO: move this function to TComPrediction.cpp.
-Void TComPrediction::initAdiPatternChType( TComTU &rTu, Bool& bAbove, Bool& bLeft, const ComponentID compID, const Bool bFilterRefSamples DEBUG_STRING_FN_DECLARE(sDebug))
+Void TComPrediction::initIntraPatternChType( TComTU &rTu, Bool& bAbove, Bool& bLeft, const ComponentID compID, const Bool bFilterRefSamples DEBUG_STRING_FN_DECLARE(sDebug))
 {
   const ChannelType chType    = toChannelType(compID);
@@ -169,5 +169,5 @@
 
   {
-    Pel *piAdiTemp   = m_piYuvExt[compID][PRED_BUF_UNFILTERED];
+    Pel *piIntraTemp   = m_piYuvExt[compID][PRED_BUF_UNFILTERED];
     Pel *piRoiOrigin = pcCU->getPic()->getPicYuvRec()->getAddr(compID, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu()+uiZorderIdxInPart);
 #if O0043_BEST_EFFORT_DECODING
@@ -177,5 +177,5 @@
     fillReferenceSamples (bitDepthForChannel,
 #endif
-                          piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor,  iUnitWidth, iUnitHeight, iAboveUnits, iLeftUnits,
+                          piRoiOrigin, piIntraTemp, bNeighborFlags, iNumIntraNeighbor,  iUnitWidth, iUnitHeight, iAboveUnits, iLeftUnits,
                           uiROIWidth, uiROIHeight, iPicStride);
 
@@ -192,5 +192,5 @@
           if (x==0 || y==0)
           {
-            ss << piAdiTemp[y*uiROIWidth + x] << ", ";
+            ss << piIntraTemp[y*uiROIWidth + x] << ", ";
 //          if (x%16==15) ss << "\nPart size: ~ ";
           }
@@ -206,5 +206,5 @@
 
             Int          stride    = uiROIWidth;
-      const Pel         *piSrcPtr  = piAdiTemp                             + (stride * uiTuHeight2); // bottom left
+      const Pel         *piSrcPtr  = piIntraTemp                           + (stride * uiTuHeight2); // bottom left
             Pel         *piDestPtr = m_piYuvExt[compID][PRED_BUF_FILTERED] + (stride * uiTuHeight2); // bottom left
 
@@ -213,7 +213,7 @@
       Bool useStrongIntraSmoothing = isLuma(chType) && sps.getUseStrongIntraSmoothing();
 
-      const Pel bottomLeft = piAdiTemp[stride * uiTuHeight2];
-      const Pel topLeft    = piAdiTemp[0];
-      const Pel topRight   = piAdiTemp[uiTuWidth2];
+      const Pel bottomLeft = piIntraTemp[stride * uiTuHeight2];
+      const Pel topLeft    = piIntraTemp[0];
+      const Pel topRight   = piIntraTemp[uiTuWidth2];
 
       if (useStrongIntraSmoothing)
@@ -224,6 +224,6 @@
         const Int  threshold     = 1 << (bitDepthForChannel - 5);
 #endif
-        const Bool bilinearLeft  = abs((bottomLeft + topLeft ) - (2 * piAdiTemp[stride * uiTuHeight])) < threshold; //difference between the
-        const Bool bilinearAbove = abs((topLeft    + topRight) - (2 * piAdiTemp[         uiTuWidth ])) < threshold; //ends and the middle
+        const Bool bilinearLeft  = abs((bottomLeft + topLeft ) - (2 * piIntraTemp[stride * uiTuHeight])) < threshold; //difference between the
+        const Bool bilinearAbove = abs((topLeft    + topRight) - (2 * piIntraTemp[         uiTuWidth ])) < threshold; //ends and the middle
         if ((uiTuWidth < 32) || (!bilinearLeft) || (!bilinearAbove))
         {
@@ -332,5 +332,5 @@
 #endif
                            const Pel* piRoiOrigin, 
-                                 Pel* piAdiTemp, 
+                                 Pel* piIntraTemp,
                            const Bool* bNeighborFlags,
                            const Int iNumIntraNeighbor, 
@@ -353,9 +353,9 @@
     for (i=0; i<uiWidth; i++)
     {
-      piAdiTemp[i] = iDCValue;
+      piIntraTemp[i] = iDCValue;
     }
     for (i=1; i<uiHeight; i++)
     {
-      piAdiTemp[i*uiWidth] = iDCValue;
+      piIntraTemp[i*uiWidth] = iDCValue;
     }
   }
@@ -368,7 +368,7 @@
     {
 #if O0043_BEST_EFFORT_DECODING
-      piAdiTemp[i] = piRoiTemp[i] << bitDepthDelta;
+      piIntraTemp[i] = piRoiTemp[i] << bitDepthDelta;
 #else
-      piAdiTemp[i] = piRoiTemp[i];
+      piIntraTemp[i] = piRoiTemp[i];
 #endif
     }
@@ -380,7 +380,7 @@
     {
 #if O0043_BEST_EFFORT_DECODING
-      piAdiTemp[i*uiWidth] = (*(piRoiTemp)) << bitDepthDelta;
+      piIntraTemp[i*uiWidth] = (*(piRoiTemp)) << bitDepthDelta;
 #else
-      piAdiTemp[i*uiWidth] = *(piRoiTemp);
+      piIntraTemp[i*uiWidth] = *(piRoiTemp);
 #endif
       piRoiTemp += iPicStride;
@@ -391,6 +391,6 @@
     // all above units have "unitWidth" samples each, all left/below-left units have "unitHeight" samples each
     const Int  iTotalSamples = (iLeftUnits * unitHeight) + ((iAboveUnits + 1) * unitWidth);
-    Pel  piAdiLine[5 * MAX_CU_SIZE];
-    Pel  *piAdiLineTemp;
+    Pel  piIntraLine[5 * MAX_CU_SIZE];
+    Pel  *piIntraLineTemp;
     const Bool *pbNeighborFlags;
 
@@ -399,10 +399,10 @@
     for (i=0; i<iTotalSamples; i++)
     {
-      piAdiLine[i] = iDCValue;
+      piIntraLine[i] = iDCValue;
     }
 
     // Fill top-left sample
     piRoiTemp = piRoiOrigin - iPicStride - 1;
-    piAdiLineTemp = piAdiLine + (iLeftUnits * unitHeight);
+    piIntraLineTemp = piIntraLine + (iLeftUnits * unitHeight);
     pbNeighborFlags = bNeighborFlags + iLeftUnits;
     if (*pbNeighborFlags)
@@ -415,5 +415,5 @@
       for (i=0; i<unitWidth; i++)
       {
-        piAdiLineTemp[i] = topLeftVal;
+        piIntraLineTemp[i] = topLeftVal;
       }
     }
@@ -421,5 +421,5 @@
     // Fill left & below-left samples (downwards)
     piRoiTemp += iPicStride;
-    piAdiLineTemp--;
+    piIntraLineTemp--;
     pbNeighborFlags--;
 
@@ -431,12 +431,12 @@
         {
 #if O0043_BEST_EFFORT_DECODING
-          piAdiLineTemp[-i] = piRoiTemp[i*iPicStride] << bitDepthDelta;
+          piIntraLineTemp[-i] = piRoiTemp[i*iPicStride] << bitDepthDelta;
 #else
-          piAdiLineTemp[-i] = piRoiTemp[i*iPicStride];
+          piIntraLineTemp[-i] = piRoiTemp[i*iPicStride];
 #endif
         }
       }
       piRoiTemp += unitHeight*iPicStride;
-      piAdiLineTemp -= unitHeight;
+      piIntraLineTemp -= unitHeight;
       pbNeighborFlags--;
     }
@@ -445,5 +445,5 @@
     piRoiTemp = piRoiOrigin - iPicStride;
     // offset line buffer by iNumUints2*unitHeight (for left/below-left) + unitWidth (for above-left)
-    piAdiLineTemp = piAdiLine + (iLeftUnits * unitHeight) + unitWidth;
+    piIntraLineTemp = piIntraLine + (iLeftUnits * unitHeight) + unitWidth;
     pbNeighborFlags = bNeighborFlags + iLeftUnits + 1;
     for (j=0; j<iAboveUnits; j++)
@@ -454,12 +454,12 @@
         {
 #if O0043_BEST_EFFORT_DECODING
-          piAdiLineTemp[i] = piRoiTemp[i] << bitDepthDelta;
+          piIntraLineTemp[i] = piRoiTemp[i] << bitDepthDelta;
 #else
-          piAdiLineTemp[i] = piRoiTemp[i];
+          piIntraLineTemp[i] = piRoiTemp[i];
 #endif
         }
       }
       piRoiTemp += unitWidth;
-      piAdiLineTemp += unitWidth;
+      piIntraLineTemp += unitWidth;
       pbNeighborFlags++;
     }
@@ -467,6 +467,6 @@
     // Pad reference samples when necessary
     Int iCurrJnit = 0;
-    Pel  *piAdiLineCur   = piAdiLine;
-    const UInt piAdiLineTopRowOffset = iLeftUnits * (unitHeight - unitWidth);
+    Pel  *piIntraLineCur   = piIntraLine;
+    const UInt piIntraLineTopRowOffset = iLeftUnits * (unitHeight - unitWidth);
 
     if (!bNeighborFlags[0])
@@ -479,6 +479,6 @@
           iNext++;
         }
-        Pel *piAdiLineNext = piAdiLine + ((iNext < iLeftUnits) ? (iNext * unitHeight) : (piAdiLineTopRowOffset + (iNext * unitWidth)));
-        const Pel refSample = *piAdiLineNext;
+        Pel *piIntraLineNext = piIntraLine + ((iNext < iLeftUnits) ? (iNext * unitHeight) : (piIntraLineTopRowOffset + (iNext * unitWidth)));
+        const Pel refSample = *piIntraLineNext;
         // Pad unavailable samples with new value
         Int iNextOrTop = std::min<Int>(iNext, iLeftUnits);
@@ -488,7 +488,7 @@
           for (i=0; i<unitHeight; i++)
           {
-            piAdiLineCur[i] = refSample;
+            piIntraLineCur[i] = refSample;
           }
-          piAdiLineCur += unitHeight;
+          piIntraLineCur += unitHeight;
           iCurrJnit++;
         }
@@ -498,7 +498,7 @@
           for (i=0; i<unitWidth; i++)
           {
-            piAdiLineCur[i] = refSample;
+            piIntraLineCur[i] = refSample;
           }
-          piAdiLineCur += unitWidth;
+          piIntraLineCur += unitWidth;
           iCurrJnit++;
         }
@@ -513,10 +513,10 @@
         {
           const Int numSamplesInCurrUnit = (iCurrJnit >= iLeftUnits) ? unitWidth : unitHeight;
-          const Pel refSample = *(piAdiLineCur-1);
+          const Pel refSample = *(piIntraLineCur-1);
           for (i=0; i<numSamplesInCurrUnit; i++)
           {
-            piAdiLineCur[i] = refSample;
+            piIntraLineCur[i] = refSample;
           }
-          piAdiLineCur += numSamplesInCurrUnit;
+          piIntraLineCur += numSamplesInCurrUnit;
           iCurrJnit++;
         }
@@ -524,5 +524,5 @@
       else
       {
-        piAdiLineCur += (iCurrJnit >= iLeftUnits) ? unitWidth : unitHeight;
+        piIntraLineCur += (iCurrJnit >= iLeftUnits) ? unitWidth : unitHeight;
         iCurrJnit++;
       }
@@ -531,15 +531,15 @@
     // Copy processed samples
 
-    piAdiLineTemp = piAdiLine + uiHeight + unitWidth - 2;
+    piIntraLineTemp = piIntraLine + uiHeight + unitWidth - 2;
     // top left, top and top right samples
     for (i=0; i<uiWidth; i++)
     {
-      piAdiTemp[i] = piAdiLineTemp[i];
-    }
-
-    piAdiLineTemp = piAdiLine + uiHeight - 1;
+      piIntraTemp[i] = piIntraLineTemp[i];
+    }
+
+    piIntraLineTemp = piIntraLine + uiHeight - 1;
     for (i=1; i<uiHeight; i++)
     {
-      piAdiTemp[i*uiWidth] = piAdiLineTemp[-i];
+      piIntraTemp[i*uiWidth] = piIntraLineTemp[-i];
     }
   }
@@ -681,5 +681,5 @@
   {
     UInt uiPartAboveRight;
-    TComDataCU* pcCUAboveRight = pcCU->getPUAboveRightAdi( uiPartAboveRight, uiPartIdxRT, uiOffset );
+    TComDataCU* pcCUAboveRight = pcCU->getPUAboveRight( uiPartAboveRight, uiPartIdxRT, uiOffset );
     if(pcCU->getSlice()->getPPS()->getConstrainedIntraPred())
     {
@@ -721,5 +721,5 @@
   {
     UInt uiPartBelowLeft;
-    TComDataCU* pcCUBelowLeft = pcCU->getPUBelowLeftAdi( uiPartBelowLeft, uiPartIdxLB, uiOffset );
+    TComDataCU* pcCUBelowLeft = pcCU->getPUBelowLeft( uiPartBelowLeft, uiPartIdxLB, uiOffset );
     if(pcCU->getSlice()->getPPS()->getConstrainedIntraPred())
     {
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComPrediction.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComPrediction.h	(revision 1314)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComPrediction.h	(revision 1315)
@@ -132,6 +132,6 @@
 
   // This function is actually still in TComPattern.cpp
-  /// set parameters from CU data for accessing ADI data
-  Void initAdiPatternChType ( TComTU &rTu,
+  /// set parameters from CU data for accessing intra data
+  Void initIntraPatternChType ( TComTU &rTu,
                               Bool&       bAbove,
                               Bool&       bLeft,
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComRom.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComRom.cpp	(revision 1314)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComRom.cpp	(revision 1315)
@@ -507,5 +507,5 @@
 
 // ====================================================================================================================
-// ADI
+// Intra prediction
 // ====================================================================================================================
 
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComRom.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComRom.h	(revision 1314)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComRom.h	(revision 1315)
@@ -139,5 +139,5 @@
 
 // ====================================================================================================================
-// ADI table
+// Intra prediction table
 // ====================================================================================================================
 
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComYuv.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComYuv.cpp	(revision 1314)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComYuv.cpp	(revision 1315)
@@ -230,5 +230,5 @@
 Void TComYuv::copyPartToPartComponent  ( const ComponentID compID, TComYuv* pcYuvDst, const UInt uiPartIdx, const UInt iWidthComponent, const UInt iHeightComponent ) const
 {
-  const Pel* pSrc =           getAddr(compID);
+  const Pel* pSrc =           getAddr(compID, uiPartIdx);
         Pel* pDst = pcYuvDst->getAddr(compID, uiPartIdx);
   if( pSrc == pDst )
Index: /branches/SHM-dev/source/Lib/TLibDecoder/TDecCu.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/TDecCu.cpp	(revision 1314)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/TDecCu.cpp	(revision 1315)
@@ -583,5 +583,5 @@
 
   DEBUG_STRING_NEW(sTemp)
-  m_pcPrediction->initAdiPatternChType( rTu, bAboveAvail, bLeftAvail, compID, bUseFilteredPredictions  DEBUG_STRING_PASS_INTO(sTemp) );
+  m_pcPrediction->initIntraPatternChType( rTu, bAboveAvail, bLeftAvail, compID, bUseFilteredPredictions  DEBUG_STRING_PASS_INTO(sTemp) );
 
 
Index: /branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 1314)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 1315)
@@ -71,5 +71,5 @@
 , m_cCUPartSizeSCModel                       ( 1,             1,                      NUM_PART_SIZE_CTX                    , m_contextModels + m_numContextModels, m_numContextModels)
 , m_cCUPredModeSCModel                       ( 1,             1,                      NUM_PRED_MODE_CTX                    , m_contextModels + m_numContextModels, m_numContextModels)
-, m_cCUIntraPredSCModel                      ( 1,             1,                      NUM_ADI_CTX                          , m_contextModels + m_numContextModels, m_numContextModels)
+, m_cCUIntraPredSCModel                      ( 1,             1,                      NUM_INTRA_PREDICT_CTX                , m_contextModels + m_numContextModels, m_numContextModels)
 , m_cCUChromaPredSCModel                     ( 1,             1,                      NUM_CHROMA_PRED_CTX                  , m_contextModels + m_numContextModels, m_numContextModels)
 , m_cCUDeltaQpSCModel                        ( 1,             1,                      NUM_DELTA_QP_CTX                     , m_contextModels + m_numContextModels, m_numContextModels)
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncSbac.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 1314)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 1315)
@@ -66,5 +66,5 @@
 , m_cCUPartSizeSCModel                 ( 1,             1,                      NUM_PART_SIZE_CTX                    , m_contextModels + m_numContextModels, m_numContextModels)
 , m_cCUPredModeSCModel                 ( 1,             1,                      NUM_PRED_MODE_CTX                    , m_contextModels + m_numContextModels, m_numContextModels)
-, m_cCUIntraPredSCModel                ( 1,             1,                      NUM_ADI_CTX                          , m_contextModels + m_numContextModels, m_numContextModels)
+, m_cCUIntraPredSCModel                ( 1,             1,                      NUM_INTRA_PREDICT_CTX                , m_contextModels + m_numContextModels, m_numContextModels)
 , m_cCUChromaPredSCModel               ( 1,             1,                      NUM_CHROMA_PRED_CTX                  , m_contextModels + m_numContextModels, m_numContextModels)
 , m_cCUDeltaQpSCModel                  ( 1,             1,                      NUM_DELTA_QP_CTX                     , m_contextModels + m_numContextModels, m_numContextModels)
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 1314)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 1315)
@@ -1175,5 +1175,5 @@
     const Bool bUseFilteredPredictions=TComPrediction::filteringIntraReferenceSamples(compID, uiChFinalMode, uiWidth, uiHeight, chFmt, sps.getDisableIntraReferenceSmoothing());
 
-    initAdiPatternChType( rTu, bAboveAvail, bLeftAvail, compID, bUseFilteredPredictions DEBUG_STRING_PASS_INTO(sDebug) );
+    initIntraPatternChType( rTu, bAboveAvail, bLeftAvail, compID, bUseFilteredPredictions DEBUG_STRING_PASS_INTO(sDebug) );
 
     //===== get prediction signal =====
@@ -2260,5 +2260,5 @@
     if (tuRecurseWithPU.ProcessComponentSection(COMPONENT_Y))
     {
-      initAdiPatternChType( tuRecurseWithPU, bAboveAvail, bLeftAvail, COMPONENT_Y, true DEBUG_STRING_PASS_INTO(sTemp2) );
+      initIntraPatternChType( tuRecurseWithPU, bAboveAvail, bLeftAvail, COMPONENT_Y, true DEBUG_STRING_PASS_INTO(sTemp2) );
     }
 
@@ -3976,5 +3976,5 @@
   else    //non ILR reference pic
 #endif
-  xPatternSearchFracDIF( bIsLosslessCoded, pcPatternKey, piRefY, iRefStride, &rcMv, cMvHalf, cMvQter, ruiCost );  
+  xPatternSearchFracDIF( bIsLosslessCoded, pcPatternKey, piRefY, iRefStride, &rcMv, cMvHalf, cMvQter, ruiCost );
 
   m_pcRdCost->setCostScale( 0 );
