Index: trunk/source/Lib/TLibRenderer/TRenFilter.cpp
===================================================================
--- trunk/source/Lib/TLibRenderer/TRenFilter.cpp	(revision 296)
+++ trunk/source/Lib/TLibRenderer/TRenFilter.cpp	(revision 608)
@@ -36,5 +36,5 @@
 #include "TRenFilter.h"
 #include "TRenInterpFilter.h"
-
+#if H_3D
 
 ///// COMMON /////
@@ -72,5 +72,5 @@
   }
   // Set Threshold
-  riBlendZThres  = ( Max( abs(piInvZLUTLeft[0]- piInvZLUTLeft[255]), abs(piInvZLUTRight[0]- piInvZLUTRight[255]) ) * iBlendZThresPerc + 50)  / 100;
+  riBlendZThres  = ( std::max( abs(piInvZLUTLeft[0]- piInvZLUTLeft[255]), abs(piInvZLUTRight[0]- piInvZLUTRight[255]) ) * iBlendZThresPerc + 50)  / 100;
 }
 
@@ -194,5 +194,5 @@
 
 /////////// Comparison ///////////
-Int64 TRenFilter::SSE   (PelImagePlane* pcInputPlane1, PelImagePlane* pcInputPlane2   )
+Int64 TRenFilter::SSE   (PelImagePlane* pcInputPlane1, PelImagePlane* pcInputPlane2, Bool bLuma )
 {
   UInt uiWidth     = pcInputPlane1->getWidth();
@@ -205,12 +205,13 @@
   Pel* pucImData2  = pcInputPlane2->getPlaneData();
 
-  return SSE( pucImData1, (Int) uiStride1, (Int) uiWidth, (Int) uiHeight, pucImData2, (Int) uiStride2 );
-}
-
-Int64 TRenFilter::SSE( Pel* piSrc1, Int iSrcStride1, Int iWidth, Int iHeight,  Pel* piSrc2, Int iSrcStride2 )
+  return SSE( pucImData1, (Int) uiStride1, (Int) uiWidth, (Int) uiHeight, pucImData2, (Int) uiStride2, bLuma );
+}
+
+Int64 TRenFilter::SSE( Pel* piSrc1, Int iSrcStride1, Int iWidth, Int iHeight,  Pel* piSrc2, Int iSrcStride2, Bool bLuma )
 {
   Int64 iSSE = 0;
 
-  Int iShift = g_uiBitIncrement << 1;
+
+  Int iShift = DISTORTION_PRECISION_ADJUSTMENT( ( bLuma ? g_bitDepthY : g_bitDepthC ) - 8 ) << 1 ;
   for(Int iPosY = 0; iPosY < iHeight; iPosY++)
   {
@@ -266,5 +267,7 @@
 
 inline Void TRenFilter::sampleUp2Tap13(PelImage* pcInputImage, PelImage* pcOutputImage)
-{// UpSampling from JSVM Software (DownConvertStatic) ???
+{ // UpSampling from JSVM Software (DownConvertStatic) ???
+
+  AOF( g_bitDepthC == g_bitDepthY ); 
   UInt uiNumPlanes = pcInputImage->getNumberOfPlanes();
 
@@ -397,5 +400,5 @@
       {
         // Scale and copy to image buffer.
-        pcOutputPlaneData[iOffset+i] = Max(Min((Pel) ((piDst[i] + iAddH) / iDivH), g_uiBASE_MAX ),0);
+        pcOutputPlaneData[iOffset+i] = ClipY((Pel) ((piDst[i] + iAddH) / iDivH));
       }
     }
@@ -421,4 +424,7 @@
 Void TRenFilter::sampleDown2Tap13( Pel* pcInputPlaneData, Int iInputStride, Int iWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
 { // DownSampling from JSVM Software (DownConvertStatic) ??
+  
+  AOF( g_bitDepthC == g_bitDepthY ); 
+
   Int iOffset, iPosX, iPosY, k;
   Int* piDataHorDown = new Int[(Int)(iWidth * iHeight / 2)];
@@ -543,5 +549,5 @@
     {
       // Scale and copy back to image buffer.
-      pcOutputPlaneData[iOutputStride*iPosY+iPosX] = Max(Min( ( Pel) ( (piDst[iPosY] + iAddV) / iDivV), g_uiBASE_MAX ),0);
+      pcOutputPlaneData[iOutputStride*iPosY+iPosX] = ClipY( ( Pel) ( (piDst[iPosY] + iAddV) / iDivV));
     }
   }
@@ -569,5 +575,7 @@
 
 Void TRenFilter::sampleVerDown2Tap13( PelImagePlane* pcInputPlane, PelImagePlane* pcOutputPlane, Int uiPad)
-{ // DownSampling from JSVM Software (DownConvertStatic) ??
+{ 
+  assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth 
+  // DownSampling from JSVM Software (DownConvertStatic) ??
   Int iWidth       = pcInputPlane->getWidth();
   Int iHeight      = pcInputPlane->getHeight();
@@ -614,5 +622,5 @@
 
       Int iSum = iTmp4 + iTmp3 - iTmp2 + ((iTmp0 + iTmp4 + iTmp5 - iTmp2) << 1) + ( ( iTmp3 - iTmp1)  << 2) + (  iTmp5 << 3 ) + (( iTmp4 + iTmp5 ) << 4);
-      pcOutputPlaneData[ iXPos ] = (Pel) Clip((iSum + 32) >> 6);
+      pcOutputPlaneData[ iXPos ] = (Pel) ClipY((iSum + 32) >> 6);
       pcTmpIn++;
     }
@@ -623,5 +631,7 @@
 
 Void TRenFilter::sampleHorDown2Tap13( PelImagePlane* pcInputPlane, PelImagePlane* pcOutputPlane, Int uiPad )
-{ // DownSampling from JSVM Software (DownConvertStatic) ??
+{ 
+  assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth 
+  // DownSampling from JSVM Software (DownConvertStatic) ??
   Int iWidth       = pcInputPlane->getWidth();
   Int iHeight      = pcInputPlane->getHeight();
@@ -653,5 +663,5 @@
 
       Int iSum = iTmp4 + iTmp3 - iTmp2 + ((iTmp0 + iTmp4 + iTmp5 - iTmp2) << 1) + ( ( iTmp3 - iTmp1)  << 2) + (  iTmp5 << 3 ) + (( iTmp4 + iTmp5 ) << 4);
-      pcOutputPlaneData[ iXPos ] = (Pel) Clip((iSum + 32) >> 6);
+      pcOutputPlaneData[ iXPos ] = (Pel) ClipY((iSum + 32) >> 6);
       pcTmpIn += 2;
     }
@@ -810,10 +820,13 @@
 Pel TRenFilter::xFiltBinom3( Pel* pcInputData, Int iStride )
 {
+  assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth 
+
   Int iSum = pcInputData[-1 * iStride ] + pcInputData[ 0 ] +  (pcInputData[iStride ] << 1 );
-  return Clip( (iSum +  2) >>  2 );
+  return ClipY( (iSum +  2) >>  2 );
 }
 
 Pel TRenFilter::xFiltBinom5( Pel* pcInputData, Int iStride )
 {
+  assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth 
   // { 1,4,6,4,1 }
   Int iStride0  = 0;
@@ -828,9 +841,10 @@
 
   Int iSum = iTmp0 +  (iTmp2 << 1) + ((iTmp1 + iTmp2) << 2);
-  return Clip( (iSum +  8) >>  4 );
+  return ClipY( (iSum +  8) >>  4 );
 }
 
 Pel TRenFilter::xFiltBinom7( Pel* pcInputData, Int iStride )
 {
+  assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth 
   // { 1,6,15,20,15,6,1 }
   Int iStride0  = 0;
@@ -849,9 +863,10 @@
   Int iSum = iTmp0 - iTmp2 + ( iTmp1  << 1) + ( (iTmp1 + iTmp3) << 2) + ((iTmp2 + iTmp3) << 4);
 
-  return Clip( (iSum +  32) >>  6 );
+  return ClipY( (iSum +  32) >>  6 );
 }
 
 Pel TRenFilter::xFiltBinom9( Pel* pcInputData, Int iStride )
 {
+  assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth 
   // {  1     8    28    56    70    56    28     8     1 }
   Int iStride0  = 0;
@@ -873,5 +888,5 @@
   Int iSum = iTmp0 + ((iTmp4 ) << 1) + ( ( iTmp4 - iTmp2 ) << 2) +  ( (iTmp1 - iTmp3) << 3 ) +  ((iTmp2 ) << 5) + ((iTmp3+ iTmp4 ) << 6);
 
-  return Clip( (iSum +  128) >>  8 );
+  return ClipY( (iSum +  128) >>  8 );
 }
 
@@ -1226,4 +1241,5 @@
 Void TRenFilter::xInterpHorChroma( Pel* piSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* piDst, Int iDstStride, Int iDstStepX, Int iDstStepY, FpChromaIntFilt fpFilter )
 {
+  assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth 
   Int   iSum;
   Pel*  piSrcTmp;
@@ -1236,5 +1252,5 @@
     {
       iSum      = (cFilter.*fpFilter)( piSrcTmp,  iSrcStepX );
-      piDst[x * iDstStepX ] =  Clip ((iSum +  32) >>  6 );
+      piDst[x * iDstStepX ] =  ClipC ((iSum +  32) >>  6 );
       piSrcTmp+= iSrcStepX;
     }
@@ -1246,4 +1262,5 @@
 Void TRenFilter::xInterpVerChroma( Pel* piSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* piDst, Int iDstStride, Int iDstStepX, Int iDstStepY, FpChromaIntFilt fpFilter )
 {
+  assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth 
   Int   iSum;
   Pel*  piSrcTmp;
@@ -1256,5 +1273,5 @@
     {
       iSum      = (cFilter.*fpFilter)( piSrcTmp,  iSrcStepY * iSrcStride );
-      piDst[x * iDstStepX ]  =  Clip ((iSum +  32) >>  6 );
+      piDst[x * iDstStepX ]  =  ClipC ((iSum +  32) >>  6 );
       piSrcTmp += iSrcStepX;
     }
@@ -1267,4 +1284,7 @@
 Void TRenFilter::xSampleDownHor2( Pel* piSrc, Int iSrcStride, Int iSrcWidth, Int iHeight, Pel* piDst, Int iDstStride  )
 {
+  
+  assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth 
+
   Int   iSum;
   Pel*  piSrcTmp;
@@ -1278,5 +1298,5 @@
       // { 1,2,1 }
       iSum = piSrcTmp[0] + piSrcTmp[2] +  (piSrcTmp[1] << 1);
-      piDst[x] = Clip( (iSum +  2) >>  2 );
+      piDst[x] = ClipY( (iSum +  2) >>  2 );
       piSrcTmp += 2;
     }
@@ -1288,4 +1308,6 @@
 Void TRenFilter::xSampleDownVer2( Pel* piSrc, Int iSrcStride, Int iSrcWidth, Int iSrcHeight, Pel* piDst, Int iDstStride  )
 {
+  assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth 
+
   Int   iSum;
   Pel*  piSrcTmp;
@@ -1298,5 +1320,5 @@
       // { 1,2,1 }
       iSum = piSrcTmp[0] + piSrcTmp[ iSrcStride << 1] +  (piSrcTmp[ iSrcStride ] << 1);
-      piDst[x] = Clip( (iSum +  2) >>  2 );
+      piDst[x] = ClipY( (iSum +  2) >>  2 );
       piSrcTmp += 1;
     }
@@ -1308,4 +1330,6 @@
 Void TRenFilter::xSampleDownHor4( Pel* piSrc, Int iSrcStride, Int iSrcWidth, Int iHeight, Pel* piDst, Int iDstStride  )
 {
+  assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth 
+
   Int   iSum;
   Pel*  piSrcTmp;
@@ -1324,5 +1348,5 @@
 
       iSum = iTmp0 +  (iTmp2 << 1) + ((iTmp1 + iTmp2) << 2);
-      piDst[x] = Clip( (iSum +  8) >>  4 );
+      piDst[x] = ClipY( (iSum +  8) >>  4 );
       piSrcTmp += 4;
     }
@@ -1334,4 +1358,6 @@
 Void TRenFilter::xSampleDownHor8( Pel* piSrc, Int iSrcStride, Int iSrcWidth, Int iHeight, Pel* piDst, Int iDstStride  )
 {
+  assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth 
+
   Int   iSum;
   Pel*  piSrcTmp;
@@ -1351,5 +1377,5 @@
 
       iSum = iTmp0 - iTmp2 + ( iTmp1  << 1) + ( (iTmp1 + iTmp3) << 2) + ((iTmp2 + iTmp3) << 4);
-      piDst[x] = Clip( (iSum +  32) >>  6 );
+      piDst[x] = ClipY( (iSum +  32) >>  6 );
       piSrcTmp += 8;
     }
@@ -1433,2 +1459,5 @@
 template Void TRenFilter::mirrorHor(        TRenImage<Int>           *pcImage );
 template Void TRenFilter::mirrorHor(        TRenImagePlane<Pel>      *pcImagePlane );
+
+#endif 
+
Index: trunk/source/Lib/TLibRenderer/TRenFilter.h
===================================================================
--- trunk/source/Lib/TLibRenderer/TRenFilter.h	(revision 296)
+++ trunk/source/Lib/TLibRenderer/TRenFilter.h	(revision 608)
@@ -33,5 +33,4 @@
 
 
-
 #ifndef __TRENFILTER__
 #define __TRENFILTER__
@@ -40,4 +39,5 @@
 #include "TRenImage.h"
 #include "TRenInterpFilter.h"
+#if H_3D
 
 typedef Int (TRenInterpFilter::*FpChromaIntFilt) ( Pel*, Int );
@@ -62,6 +62,6 @@
   /////////// Comparison ///////////
 
-  static Int64                          SSE  ( PelImagePlane*     pcInputPlane1, PelImagePlane*      pcInputPlane2 );
-  static Int64                          SSE  ( Pel* piSrc1,       Int iSrcStride1, Int iWidth, Int iHeight,  Pel* piSrc2, Int iSrcStride2 );
+  static Int64                          SSE  ( PelImagePlane*     pcInputPlane1, PelImagePlane*      pcInputPlane2, Bool bLuma );
+  static Int64                          SSE  ( Pel* piSrc1,       Int iSrcStride1, Int iWidth, Int iHeight,  Pel* piSrc2, Int iSrcStride2, Bool bLuma );
 
   template <typename T> static Bool compare  (TRenImage<T> *pcInputImage1     , TRenImage<T> *pcInputImage2);
@@ -138,4 +138,4 @@
 };
 
-
+#endif
 #endif //__TRENFILTER__
Index: trunk/source/Lib/TLibRenderer/TRenImage.cpp
===================================================================
--- trunk/source/Lib/TLibRenderer/TRenImage.cpp	(revision 296)
+++ trunk/source/Lib/TLibRenderer/TRenImage.cpp	(revision 608)
@@ -37,4 +37,6 @@
 #include "TRenFilter.h"
 #include "assert.h"
+#if H_3D
+
 
 template<typename T>
@@ -231,5 +233,5 @@
   for (UInt uiCurPlane = 1; uiCurPlane < m_uiNumberOfPlanes; uiCurPlane++)
   {
-    m_apcPlanes[uiCurPlane]->assign( (Pel) ((g_uiIBDI_MAX+1) >> 1) );
+    m_apcPlanes[uiCurPlane]->assign( (Pel) ( 1 << ( g_bitDepthC - 1 ) ) );
   }
 }
@@ -270,2 +272,3 @@
 template Void TRenImage<Pel>::assign<Pel>    (TRenImage<Pel>*   );
 
+#endif // H_3D
Index: trunk/source/Lib/TLibRenderer/TRenImage.h
===================================================================
--- trunk/source/Lib/TLibRenderer/TRenImage.h	(revision 296)
+++ trunk/source/Lib/TLibRenderer/TRenImage.h	(revision 608)
@@ -39,4 +39,5 @@
 #include "../TLibCommon/TComPicYuv.h"
 #include "TRenImagePlane.h"
+#if H_3D
 
 
@@ -99,4 +100,5 @@
 };
 
+#endif // H_3D
 #endif // __TRENIMAGE__
 
Index: trunk/source/Lib/TLibRenderer/TRenImagePlane.cpp
===================================================================
--- trunk/source/Lib/TLibRenderer/TRenImagePlane.cpp	(revision 296)
+++ trunk/source/Lib/TLibRenderer/TRenImagePlane.cpp	(revision 608)
@@ -36,4 +36,6 @@
 #include "TRenFilter.h"
 #include <string.h>
+#if H_3D
+
 /////// TRenImagePlane ///////
 
@@ -526,2 +528,4 @@
 template class TRenImagePlanePart<Bool>;
 template class TRenImagePlanePart<Int>;
+#endif // H_3D
+
Index: trunk/source/Lib/TLibRenderer/TRenImagePlane.h
===================================================================
--- trunk/source/Lib/TLibRenderer/TRenImagePlane.h	(revision 296)
+++ trunk/source/Lib/TLibRenderer/TRenImagePlane.h	(revision 608)
@@ -39,4 +39,5 @@
 #include "../TLibCommon/TComPicYuv.h"
 
+#if H_3D
 #define PelImagePlane     TRenImagePlane<Pel>
 #define DoubleImagePlane  TRenImagePlane<Double>
@@ -121,3 +122,4 @@
 };
 
+#endif // H_3D
 #endif // __TRENIMAGEPLANE__
Index: trunk/source/Lib/TLibRenderer/TRenInterpFilter.cpp
===================================================================
--- trunk/source/Lib/TLibRenderer/TRenInterpFilter.cpp	(revision 296)
+++ trunk/source/Lib/TLibRenderer/TRenInterpFilter.cpp	(revision 608)
@@ -39,4 +39,5 @@
 
 #include "TRenInterpFilter.h"
+#if H_3D
 
 // ====================================================================================================================
@@ -49,2 +50,4 @@
 }
 
+#endif // H_3D
+
Index: trunk/source/Lib/TLibRenderer/TRenInterpFilter.h
===================================================================
--- trunk/source/Lib/TLibRenderer/TRenInterpFilter.h	(revision 296)
+++ trunk/source/Lib/TLibRenderer/TRenInterpFilter.h	(revision 608)
@@ -44,4 +44,6 @@
 #include "TLibCommon/CommonDef.h"
 #include "assert.h"
+#if H_3D
+
 // ====================================================================================================================
 // Constants
@@ -103,34 +105,18 @@
    __inline Int xCTI_Filter_VI04_C_OCT3( Int* pSrc, Int iStride );
 
-#if HIGH_ACCURACY_BI
-  __inline Void xCTI_FilterHalfHor_ha(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst); //
-  __inline Void xCTI_FilterHalfHor_ha(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst);//
-  
-    
-  __inline Void xCTI_FilterQuarter0Hor_ha(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst); //
-  __inline Void xCTI_FilterQuarter0Hor_ha(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst); //
-  
-  __inline Void xCTI_FilterQuarter1Hor_ha(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst); //
-  __inline Void xCTI_FilterQuarter1Hor_ha(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst); //
-  
-  __inline Void xCTI_FilterHalfVer_ha (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst ); //
-  
-  __inline Void xCTI_FilterQuarter0Ver_ha (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst );
-  __inline Void xCTI_FilterQuarter1Ver_ha (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst );
-  
-  __inline Void xCTI_Filter1DHorC_ha (Pel* piSrc, Int iSrcStride,  Int iWidth, Int iHeight, Int iDstStride,  Pel*& rpiDst, Int iMV);
-  __inline Void xCTI_Filter1DVerC_ha (Pel* piSrc, Int iSrcStride,  Int iWidth, Int iHeight, Int iDstStride,  Pel*& rpiDst, Int iMV);
-  __inline Void xCTI_Filter2DHorC_ha (Int* piSrc, Int iSrcStride,  Int iWidth, Int iHeight, Int iDstStride,  Pel*& rpiDst, Int iMV);
-
-#endif
 };
 
-#if HIGH_ACCURACY_BI
-__inline Void TRenInterpFilter::xCTI_FilterHalfHor_ha(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
-{
+
+// ------------------------------------------------------------------------------------------------
+// DCTIF filters
+// ------------------------------------------------------------------------------------------------
+
+__inline Void TRenInterpFilter::xCTI_FilterHalfHor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
+{
+  assert( g_bitDepthC == g_bitDepthY);  // ToDo: Update renderer to work with different luma/chroma bit depth 
+
   Pel*  piDst    = rpiDst;
   Int   iSum;
   Pel*  piSrcTmp;
-
   Int iSrcStep2 = iSrcStep*2;
   Int iSrcStep3 = iSrcStep*3;
@@ -141,6 +127,5 @@
 
   Int iTmp0, iTmp1, iTmp2, iTmp3, iTmpA;
-  Int shiftNum = g_uiBitIncrement + g_uiBitDepth - 8;
-  Int shiftOffset = (shiftNum > 0) ? ( 1 << (shiftNum - 1)) : 0 ;
+
   for ( Int y = iHeight; y != 0; y-- )
   {
@@ -160,10 +145,6 @@
             + (   iTmpA          << 1 )
             -    iTmp0 -  iTmp2;
-#if REMOVE_INTERMEDIATE_CLIPPING
-      piDst   [x * iDstStep] = (iSum +  shiftOffset) >>  shiftNum;
-#else
-      piDst   [x * iDstStep] = Clip3(0,16383, (iSum +  shiftOffset) >>  shiftNum );
-#endif
-      
+
+      piDst   [x * iDstStep] = ClipY( (iSum +  32) >>  6 );
       piSrcTmp += iSrcStep;
     }
@@ -172,13 +153,13 @@
   }
   return;
-
-}
-
-__inline Void TRenInterpFilter::xCTI_FilterHalfHor_ha(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
-{
+}
+
+__inline Void TRenInterpFilter::xCTI_FilterHalfHor(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
+{
+  assert( g_bitDepthC == g_bitDepthY);  // ToDo: Update renderer to work with different luma/chroma bit depth 
+
   Pel*  piDst    = rpiDst;
   Int   iSum;
   Int*  piSrcTmp;
- 
   Int iSrcStep2 = iSrcStep*2;
   Int iSrcStep3 = iSrcStep*3;
@@ -189,6 +170,5 @@
 
   Int iTmp0, iTmp1, iTmp2, iTmp3, iTmpA;
-  Int shiftNum = 6 + g_uiBitIncrement + g_uiBitDepth - 8;
-  Int shiftOffset = (shiftNum > 0) ? ( 1 << (shiftNum - 1)) : 0 ;
+
   for ( Int y = iHeight; y != 0; y-- )
   {
@@ -209,10 +189,5 @@
             -    iTmp0 -  iTmp2;
       
-#if REMOVE_INTERMEDIATE_CLIPPING
-      piDst   [x * iDstStep] = (iSum +  shiftOffset) >>  shiftNum;
-#else
-      piDst   [x * iDstStep] = Clip3(0,16383, (iSum +  shiftOffset) >>  shiftNum );
-#endif
-
+      piDst   [x * iDstStep] = ClipY( (iSum +  2048) >>  12 );
       piSrcTmp += iSrcStep;
     }
@@ -221,14 +196,12 @@
   }
   return;
-
-}
-
-
-__inline Void TRenInterpFilter::xCTI_FilterQuarter0Hor_ha(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
-{
+}
+
+__inline Void TRenInterpFilter::xCTI_FilterQuarter0Hor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
+{
+  assert( g_bitDepthC == g_bitDepthY);  // ToDo: Update renderer to work with different luma/chroma bit depth 
   Pel*  piDst    = rpiDst;
   Int   iSum;
   Pel*  piSrcTmp;
-
   Int iSrcStep2 = iSrcStep*2;
   Int iSrcStep3 = iSrcStep*3;
@@ -239,6 +212,5 @@
 
   Int  iTmp1, iTmp2;
-  Int shiftNum = g_uiBitIncrement + g_uiBitDepth - 8;
-  Int shiftOffset = (shiftNum > 0) ? ( 1 << (shiftNum - 1)) : 0 ;
+
   for ( Int y = iHeight; y != 0; y-- )
   {
@@ -252,15 +224,10 @@
       
       iSum  =  iTmp1 + iTmp2 - piSrcTmp[0] - piSrcTmp[iSrcStep7]
-            - ( ( piSrcTmp[iSrcStep2] - iTmp2 ) << 1 )
-            + (  piSrcTmp[iSrcStep]             << 2 )
-            - ( ( piSrcTmp[iSrcStep2] + iTmp1 ) << 3 )
-            + (   piSrcTmp[iSrcStep4]           << 4 )
-            + ( piSrcTmp[iSrcStep3]             << 6);
-      
-#if REMOVE_INTERMEDIATE_CLIPPING
-      piDst   [x * iDstStep] = (iSum + shiftOffset) >> shiftNum;
-#else
-      piDst   [x * iDstStep] = Clip3(0,16383, (iSum + shiftOffset) >> shiftNum );
-#endif
+             - ( ( piSrcTmp[iSrcStep2] - iTmp2 ) << 1 )
+             + (  piSrcTmp[iSrcStep]             << 2 )
+             - ( ( piSrcTmp[iSrcStep2] + iTmp1 ) << 3 )
+             + (   piSrcTmp[iSrcStep4]           << 4 );
+      
+      piDst   [x * iDstStep] = ClipY(( (iSum +  32) >>  6 )+ piSrcTmp[iSrcStep3]);
       piSrcTmp += iSrcStep;
     }
@@ -271,10 +238,11 @@
 }
 
-__inline Void TRenInterpFilter::xCTI_FilterQuarter0Hor_ha(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
-{
+__inline Void TRenInterpFilter::xCTI_FilterQuarter0Hor(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
+{
+  assert( g_bitDepthC == g_bitDepthY);  // ToDo: Update renderer to work with different luma/chroma bit depth 
+
   Pel*  piDst    = rpiDst;
   Int   iSum;
   Int*  piSrcTmp;
-  
   Int iSrcStep2 = iSrcStep*2;
   Int iSrcStep3 = iSrcStep*3;
@@ -283,6 +251,5 @@
   Int iSrcStep6 = iSrcStep*6;
   Int iSrcStep7 = iSrcStep*7;
-  Int shiftNum = 6 + g_uiBitIncrement + g_uiBitDepth - 8;
-  Int shiftOffset = (shiftNum > 0) ? ( 1 << (shiftNum - 1)) : 0 ;
+
   Int  iTmp1, iTmp2;
 
@@ -304,9 +271,5 @@
             + (   piSrcTmp[iSrcStep3]           << 6 );
       
-#if REMOVE_INTERMEDIATE_CLIPPING
-      piDst   [x * iDstStep] = (iSum +  shiftOffset) >>  shiftNum;
-#else
-      piDst   [x * iDstStep] = Clip3(0, 16383, (iSum +  shiftOffset) >>  shiftNum );
-#endif
+      piDst   [x * iDstStep] = ClipY( (iSum +  2048) >>  12 );
       piSrcTmp += iSrcStep;
     }
@@ -315,14 +278,12 @@
   }
   return;
-
-}
-
-
-__inline Void TRenInterpFilter::xCTI_FilterQuarter1Hor_ha(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
-{
+}
+
+__inline Void TRenInterpFilter::xCTI_FilterQuarter1Hor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
+{
+  assert( g_bitDepthC == g_bitDepthY);  // ToDo: Update renderer to work with different luma/chroma bit depth 
   Pel*  piDst    = rpiDst;
   Int   iSum;
   Pel*  piSrcTmp;
-
   Int iSrcStep2 = iSrcStep*2;
   Int iSrcStep3 = iSrcStep*3;
@@ -331,6 +292,44 @@
   Int iSrcStep6 = iSrcStep*6;
   Int iSrcStep7 = iSrcStep*7;
-  Int shiftNum = g_uiBitIncrement + g_uiBitDepth - 8;
-  Int shiftOffset = (shiftNum > 0) ? ( 1 << (shiftNum - 1)) : 0 ;
+
+  Int  iTmp1, iTmp2;
+  for ( Int y = iHeight; y != 0; y-- )
+  {
+    piSrcTmp = &piSrc[ -3*iSrcStep ];
+    for ( Int x = 0; x < iWidth; x++ )
+    {
+      // {-1,   3,  -7,  19,   57,  -10,   4,   -1  },
+      
+      iTmp1 = piSrcTmp[iSrcStep4] + piSrcTmp[iSrcStep2];
+      iTmp2 = piSrcTmp[iSrcStep ] + piSrcTmp[iSrcStep3];
+      
+      iSum  =  iTmp1 + iTmp2 - piSrcTmp[0] - piSrcTmp[iSrcStep7]
+            - ( ( piSrcTmp[iSrcStep5] - iTmp2 ) << 1 )
+            + (   piSrcTmp[iSrcStep6]           << 2 )
+            - ( ( piSrcTmp[iSrcStep5] + iTmp1 ) << 3 )
+            + (   piSrcTmp[iSrcStep3]           << 4 );
+      
+      piDst   [x * iDstStep] = ClipY( ((iSum +  32) >>  6) + piSrcTmp[iSrcStep4] );
+      piSrcTmp += iSrcStep;
+    }
+    piSrc += iSrcStride;
+    piDst += iDstStride;
+  }
+  return;
+}
+
+__inline Void TRenInterpFilter::xCTI_FilterQuarter1Hor(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
+{
+  assert( g_bitDepthC == g_bitDepthY);  // ToDo: Update renderer to work with different luma/chroma bit depth 
+
+  Pel*  piDst    = rpiDst;
+  Int   iSum;
+  Int*  piSrcTmp;
+  Int iSrcStep2 = iSrcStep*2;
+  Int iSrcStep3 = iSrcStep*3;
+  Int iSrcStep4 = iSrcStep*4;
+  Int iSrcStep5 = iSrcStep*5;
+  Int iSrcStep6 = iSrcStep*6;
+  Int iSrcStep7 = iSrcStep*7;
 
   Int  iTmp1, iTmp2;
@@ -351,10 +350,6 @@
             + (   piSrcTmp[iSrcStep3]           << 4 )
             + (   piSrcTmp[iSrcStep4]           << 6 );
-
-#if REMOVE_INTERMEDIATE_CLIPPING
-      piDst   [x * iDstStep] = (iSum +  shiftOffset) >>  shiftNum;
-#else
-      piDst   [x * iDstStep] = Clip3(0, 16383, (iSum +  shiftOffset) >>  shiftNum );
-#endif
+      
+      piDst   [x * iDstStep] = ClipY( (iSum +  2048) >>  12 );
       piSrcTmp += iSrcStep;
     }
@@ -363,58 +358,93 @@
   }
   return;
-
-
-}
-
-__inline Void TRenInterpFilter::xCTI_FilterQuarter1Hor_ha(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
-{
-  Pel*  piDst    = rpiDst;
-  Int   iSum;
-  Int*  piSrcTmp;
-
-  Int iSrcStep2 = iSrcStep*2;
-  Int iSrcStep3 = iSrcStep*3;
-  Int iSrcStep4 = iSrcStep*4;
-  Int iSrcStep5 = iSrcStep*5;
-  Int iSrcStep6 = iSrcStep*6;
-  Int iSrcStep7 = iSrcStep*7;
-  Int shiftNum = 6+g_uiBitIncrement + g_uiBitDepth - 8;
-  Int shiftOffset = (shiftNum > 0) ? ( 1 << (shiftNum - 1)) : 0 ;
-  Int  iTmp1, iTmp2;
+}
+
+__inline Void TRenInterpFilter::xCTI_FilterHalfVer (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst, Int iDstStridePel, Pel*& rpiDstPel )
+{
+  assert( g_bitDepthC == g_bitDepthY);  // ToDo: Update renderer to work with different luma/chroma bit depth 
+  Int*  piDst = rpiDst;
+  Pel*  piDstPel = rpiDstPel;
+  Int   iSum;
+  Pel*  piSrcTmp;
+  Int iSrcStride2 = iSrcStride*2;
+  Int iSrcStride3 = iSrcStride*3;
+  Int iSrcStride4 = iSrcStride*4;
+  Int iSrcStride5 = iSrcStride*5;
+  Int iSrcStride6 = iSrcStride*6;
+  Int iSrcStride7 = iSrcStride*7;
+
+  Int  iTmp0, iTmp1, iTmp2, iTmp3, iTmpA;
   for ( Int y = iHeight; y != 0; y-- )
   {
-    piSrcTmp = &piSrc[ -3*iSrcStep ];
+    piSrcTmp = &piSrc[ -3*iSrcStride ];
     for ( Int x = 0; x < iWidth; x++ )
     {
-      // {-1,   3,  -7,  19,   57,  -10,   4,   -1  },
-      
-      iTmp1 = piSrcTmp[iSrcStep4] + piSrcTmp[iSrcStep2];
-      iTmp2 = piSrcTmp[iSrcStep ] + piSrcTmp[iSrcStep3];
-      
-      iSum  =  iTmp1 + iTmp2 - piSrcTmp[0] - piSrcTmp[iSrcStep7]
-            - ( ( piSrcTmp[iSrcStep5] - iTmp2 ) << 1 )
-            + (   piSrcTmp[iSrcStep6]           << 2 )
-            - ( ( piSrcTmp[iSrcStep5] + iTmp1 ) << 3 )
-            + (   piSrcTmp[iSrcStep3]           << 4 )
-            + (   piSrcTmp[iSrcStep4]           << 6 );
-      
-#if REMOVE_INTERMEDIATE_CLIPPING
-      piDst   [x * iDstStep] = (iSum +  shiftOffset) >>  shiftNum;
-#else
-      piDst   [x * iDstStep] = Clip3(0, 16383, (iSum +  shiftOffset) >>  shiftNum );
-#endif
+      // { -1,4,-11,40,40,-11,4,-1   } 
+      iTmp0 = piSrcTmp[          0]+piSrcTmp[iSrcStride7];
+      iTmp1 = piSrcTmp[iSrcStride ]+piSrcTmp[iSrcStride6];
+      iTmp2 = piSrcTmp[iSrcStride2]+piSrcTmp[iSrcStride5];
+      iTmp3 = piSrcTmp[iSrcStride3]+piSrcTmp[iSrcStride4];
+      
+      iTmpA = (iTmp3 << 2) - iTmp2;
+      
+      iSum  = (   iTmp1          << 2 )
+            + (   iTmpA          << 3 )
+            + (   iTmpA          << 1 )
+            -    iTmp0 -  iTmp2;
+      
+      piDst[x * iDstStep]    = iSum;
+      piDstPel[x * iDstStep] = ClipY( (iSum +  32) >>  6 );
       piSrcTmp += iSrcStep;
     }
     piSrc += iSrcStride;
     piDst += iDstStride;
-  }
-  return;
-
-}
-
-
-
-__inline Void TRenInterpFilter::xCTI_FilterQuarter0Ver_ha (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
-{
+    piDstPel += iDstStridePel;
+  }
+ return;
+}
+
+__inline Void TRenInterpFilter::xCTI_FilterHalfVer (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst)
+{
+  Int*  piDst = rpiDst;
+  Int   iSum;
+  Pel*  piSrcTmp;
+  Int iSrcStride2 = iSrcStride*2;
+  Int iSrcStride3 = iSrcStride*3;
+  Int iSrcStride4 = iSrcStride*4;
+  Int iSrcStride5 = iSrcStride*5;
+  Int iSrcStride6 = iSrcStride*6;
+  Int iSrcStride7 = iSrcStride*7;
+
+  Int  iTmp0, iTmp1, iTmp2, iTmp3, iTmpA;
+  for ( Int y = iHeight; y != 0; y-- )
+  {
+    piSrcTmp = &piSrc[ -3*iSrcStride ];
+    for ( Int x = 0; x < iWidth; x++ )
+    {
+      // { -1,4,-11,40,40,-11,4,-1   } 
+      iTmp0 = piSrcTmp[          0]+piSrcTmp[iSrcStride7];
+      iTmp1 = piSrcTmp[iSrcStride ]+piSrcTmp[iSrcStride6];
+      iTmp2 = piSrcTmp[iSrcStride2]+piSrcTmp[iSrcStride5];
+      iTmp3 = piSrcTmp[iSrcStride3]+piSrcTmp[iSrcStride4];
+      
+      iTmpA = (iTmp3 << 2) - iTmp2;
+      
+      iSum  = (   iTmp1          << 2 )
+            + (   iTmpA          << 3 )
+            + (   iTmpA          << 1 )
+            -    iTmp0 -  iTmp2;        
+      
+      piDst[x * iDstStep] = iSum;
+      piSrcTmp += iSrcStep;
+    }
+    piSrc += iSrcStride;
+    piDst += iDstStride;
+  }
+  return;
+}
+
+__inline Void TRenInterpFilter::xCTI_FilterHalfVer (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
+{
+  assert( g_bitDepthC == g_bitDepthY);  // ToDo: Update renderer to work with different luma/chroma bit depth 
   Pel*  piDst = rpiDst;
   Int   iSum;
@@ -427,7 +457,6 @@
   Int iSrcStride6 = iSrcStride*6;
   Int iSrcStride7 = iSrcStride*7;
-  Int shiftNum = g_uiBitIncrement + g_uiBitDepth - 8;
-  Int shiftOffset = (shiftNum > 0) ? ( 1 << (shiftNum - 1)) : 0 ;
-  Int  iTmp1, iTmp2;
+
+  Int  iTmp0, iTmp1, iTmp2, iTmp3, iTmpA;
   for ( Int y = iHeight; y != 0; y-- )
   {
@@ -435,21 +464,18 @@
     for ( Int x = 0; x < iWidth; x++ )
     {
-      // {-1,   4,  -10,  57,   19,  -7,   3,   -1  },
-      
-      iTmp1 = piSrcTmp[iSrcStride3] + piSrcTmp[iSrcStride5];
-      iTmp2 = piSrcTmp[iSrcStride6] + piSrcTmp[iSrcStride4];
-      
-      iSum  =  iTmp1 + iTmp2 - piSrcTmp[0] - piSrcTmp[iSrcStride7]
-            - ( ( piSrcTmp[iSrcStride2] - iTmp2 ) << 1 )
-            + (  piSrcTmp[iSrcStride]             << 2 )
-            - ( ( piSrcTmp[iSrcStride2] + iTmp1 ) << 3 )
-            + (   piSrcTmp[iSrcStride4]           << 4 )
-            + (   piSrcTmp[iSrcStride3]           << 6);
-      
-#if REMOVE_INTERMEDIATE_CLIPPING
-      piDst   [x * iDstStep] = (iSum +  shiftOffset) >>  shiftNum;
-#else
-      piDst   [x * iDstStep] = Clip3(0, 16383, (iSum +  shiftOffset) >>  shiftNum );
-#endif
+      // { -1,4,-11,40,40,-11,4,-1   } 
+      iTmp0 = piSrcTmp[          0]+piSrcTmp[iSrcStride7];
+      iTmp1 = piSrcTmp[iSrcStride ]+piSrcTmp[iSrcStride6];
+      iTmp2 = piSrcTmp[iSrcStride2]+piSrcTmp[iSrcStride5];
+      iTmp3 = piSrcTmp[iSrcStride3]+piSrcTmp[iSrcStride4];
+      
+      iTmpA = (iTmp3 << 2) - iTmp2;
+      
+      iSum  = (   iTmp1          << 2 )
+            + (   iTmpA          << 3 )
+            + (   iTmpA          << 1 )
+            -    iTmp0 -  iTmp2;        
+      
+      piDst[x * iDstStep] = ClipY( (iSum +  32) >>  6 );
       piSrcTmp += iSrcStep;
     }
@@ -458,14 +484,11 @@
   }
   return;
-
-}
-
-
-__inline Void TRenInterpFilter::xCTI_FilterQuarter1Ver_ha (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
-{
-  Pel*  piDst = rpiDst;
+}
+
+__inline Void TRenInterpFilter::xCTI_FilterQuarter0Ver (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst)
+{
+  Int*  piDst = rpiDst;
   Int   iSum;
   Pel*  piSrcTmp;
-
   Int iSrcStride2 = iSrcStride*2;
   Int iSrcStride3 = iSrcStride*3;
@@ -474,8 +497,6 @@
   Int iSrcStride6 = iSrcStride*6;
   Int iSrcStride7 = iSrcStride*7;
-  Int shiftNum = g_uiBitIncrement + g_uiBitDepth - 8;
-  Int shiftOffset = (shiftNum > 0) ? ( 1 << (shiftNum - 1)) : 0 ;
+
   Int  iTmp1, iTmp2;
-
   for ( Int y = iHeight; y != 0; y-- )
   {
@@ -483,20 +504,17 @@
     for ( Int x = 0; x < iWidth; x++ )
     {
-      /// {-1,   3,  -7,  19,   57,  -10,   4,   -1  },
-      iTmp1 = piSrcTmp[iSrcStride4] + piSrcTmp[iSrcStride2];
-      iTmp2 = piSrcTmp[iSrcStride ] + piSrcTmp[iSrcStride3];
+      // {-1,   4,  -10,  57,   19,  -7,   3,   -1  },
+      
+      iTmp1 = piSrcTmp[iSrcStride3] + piSrcTmp[iSrcStride5];
+      iTmp2 = piSrcTmp[iSrcStride6] + piSrcTmp[iSrcStride4];
       
       iSum  =  iTmp1 + iTmp2 - piSrcTmp[0] - piSrcTmp[iSrcStride7]
-            - ( ( piSrcTmp[iSrcStride5] - iTmp2 ) << 1 )
-            + (   piSrcTmp[iSrcStride6]           << 2 )
-            - ( ( piSrcTmp[iSrcStride5] + iTmp1 ) << 3 )
-            + (   piSrcTmp[iSrcStride3]           << 4 )
-            + (   piSrcTmp[iSrcStride4]           << 6 );
-            
-#if REMOVE_INTERMEDIATE_CLIPPING
-      piDst   [x * iDstStep] = (iSum +  shiftOffset) >>  shiftNum;
-#else
-      piDst   [x * iDstStep] = Clip3(0, 16383, (iSum +  shiftOffset) >>  shiftNum );
-#endif
+            - ( ( piSrcTmp[iSrcStride2] - iTmp2 ) << 1 )
+            + (  piSrcTmp[iSrcStride]             << 2 )
+            - ( ( piSrcTmp[iSrcStride2] + iTmp1 ) << 3 )
+            + (   piSrcTmp[iSrcStride4]           << 4 )
+            + (   piSrcTmp[iSrcStride3]           << 6 );
+      
+      piDst[x * iDstStep] = iSum;
       piSrcTmp += iSrcStep;
     }
@@ -505,9 +523,9 @@
   }
   return;
-
-}
-
-__inline Void TRenInterpFilter::xCTI_FilterHalfVer_ha  (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
-{
+}
+
+__inline Void TRenInterpFilter::xCTI_FilterQuarter0Ver (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
+{
+  assert( g_bitDepthC == g_bitDepthY );  // ToDo: Update renderer to work with different luma/chroma bit depth 
   Pel*  piDst = rpiDst;
   Int   iSum;
@@ -520,459 +538,4 @@
   Int iSrcStride6 = iSrcStride*6;
   Int iSrcStride7 = iSrcStride*7;
-  Int shiftNum = g_uiBitIncrement + g_uiBitDepth - 8;
-  Int shiftOffset = (shiftNum > 0) ? ( 1 << (shiftNum - 1)) : 0 ;
-  Int  iTmp0, iTmp1, iTmp2, iTmp3, iTmpA;
-  for ( Int y = iHeight; y != 0; y-- )
-  {
-    piSrcTmp = &piSrc[ -3*iSrcStride ];
-    for ( Int x = 0; x < iWidth; x++ )
-    {
-      // { -1,4,-11,40,40,-11,4,-1   } 
-      iTmp0 = piSrcTmp[          0]+piSrcTmp[iSrcStride7];
-      iTmp1 = piSrcTmp[iSrcStride ]+piSrcTmp[iSrcStride6];
-      iTmp2 = piSrcTmp[iSrcStride2]+piSrcTmp[iSrcStride5];
-      iTmp3 = piSrcTmp[iSrcStride3]+piSrcTmp[iSrcStride4];
-      
-      iTmpA = (iTmp3 << 2) - iTmp2;
-      
-      iSum  = (   iTmp1          << 2 )
-            + (   iTmpA          << 3 )
-            + (   iTmpA          << 1 )
-            -    iTmp0 -  iTmp2;        
-      
-#if REMOVE_INTERMEDIATE_CLIPPING
-      piDst   [x * iDstStep] = (iSum +  shiftOffset) >>  shiftNum;
-#else
-      piDst   [x * iDstStep] = Clip3(0, 16383, (iSum +  shiftOffset) >>  shiftNum );
-#endif
-      piSrcTmp += iSrcStep;
-    }
-    piSrc += iSrcStride;
-    piDst += iDstStride;
-  }
-  return;
-
-}
-
-
-#endif
-
-// ------------------------------------------------------------------------------------------------
-// DCTIF filters
-// ------------------------------------------------------------------------------------------------
-
-__inline Void TRenInterpFilter::xCTI_FilterHalfHor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
-{
-  Pel*  piDst    = rpiDst;
-  Int   iSum;
-  Pel*  piSrcTmp;
-  Int iSrcStep2 = iSrcStep*2;
-  Int iSrcStep3 = iSrcStep*3;
-  Int iSrcStep4 = iSrcStep*4;
-  Int iSrcStep5 = iSrcStep*5;
-  Int iSrcStep6 = iSrcStep*6;
-  Int iSrcStep7 = iSrcStep*7;
-
-  Int iTmp0, iTmp1, iTmp2, iTmp3, iTmpA;
-
-  for ( Int y = iHeight; y != 0; y-- )
-  {
-    piSrcTmp = &piSrc[ -3*iSrcStep ];
-    for ( Int x = 0; x < iWidth; x++ )
-    {
-      // { -1,4,-11,40,40,-11,4,-1   } 
-      iTmp0 = piSrcTmp[        0]+piSrcTmp[iSrcStep7];
-      iTmp1 = piSrcTmp[iSrcStep]+piSrcTmp[iSrcStep6];
-      iTmp2 = piSrcTmp[iSrcStep2]+piSrcTmp[iSrcStep5];
-      iTmp3 = piSrcTmp[iSrcStep3]+piSrcTmp[iSrcStep4];
-
-      iTmpA = (iTmp3 << 2) - iTmp2;
-
-      iSum  = (   iTmp1          << 2 )
-            + (   iTmpA          << 3 )
-            + (   iTmpA          << 1 )
-            -    iTmp0 -  iTmp2;
-
-      piDst   [x * iDstStep] = Clip( (iSum +  32) >>  6 );
-      piSrcTmp += iSrcStep;
-    }
-    piSrc += iSrcStride;
-    piDst += iDstStride;
-  }
-  return;
-}
-
-__inline Void TRenInterpFilter::xCTI_FilterHalfHor(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
-{
-  Pel*  piDst    = rpiDst;
-  Int   iSum;
-  Int*  piSrcTmp;
-  Int iSrcStep2 = iSrcStep*2;
-  Int iSrcStep3 = iSrcStep*3;
-  Int iSrcStep4 = iSrcStep*4;
-  Int iSrcStep5 = iSrcStep*5;
-  Int iSrcStep6 = iSrcStep*6;
-  Int iSrcStep7 = iSrcStep*7;
-
-  Int iTmp0, iTmp1, iTmp2, iTmp3, iTmpA;
-
-  for ( Int y = iHeight; y != 0; y-- )
-  {
-    piSrcTmp = &piSrc[ -3*iSrcStep ];
-    for ( Int x = 0; x < iWidth; x++ )
-    {
-      // { -1,4,-11,40,40,-11,4,-1   } 
-      iTmp0 = piSrcTmp[        0]+piSrcTmp[iSrcStep7];
-      iTmp1 = piSrcTmp[iSrcStep ]+piSrcTmp[iSrcStep6];
-      iTmp2 = piSrcTmp[iSrcStep2]+piSrcTmp[iSrcStep5];
-      iTmp3 = piSrcTmp[iSrcStep3]+piSrcTmp[iSrcStep4];
-      
-      iTmpA = (iTmp3 << 2) - iTmp2;
-      
-      iSum  = (   iTmp1          << 2 )
-            + (   iTmpA          << 3 )
-            + (   iTmpA          << 1 )
-            -    iTmp0 -  iTmp2;
-      
-      piDst   [x * iDstStep] = Clip( (iSum +  2048) >>  12 );
-      piSrcTmp += iSrcStep;
-    }
-    piSrc += iSrcStride;
-    piDst += iDstStride;
-  }
-  return;
-}
-
-__inline Void TRenInterpFilter::xCTI_FilterQuarter0Hor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
-{
-  Pel*  piDst    = rpiDst;
-  Int   iSum;
-  Pel*  piSrcTmp;
-  Int iSrcStep2 = iSrcStep*2;
-  Int iSrcStep3 = iSrcStep*3;
-  Int iSrcStep4 = iSrcStep*4;
-  Int iSrcStep5 = iSrcStep*5;
-  Int iSrcStep6 = iSrcStep*6;
-  Int iSrcStep7 = iSrcStep*7;
-
-  Int  iTmp1, iTmp2;
-
-  for ( Int y = iHeight; y != 0; y-- )
-  {
-    piSrcTmp = &piSrc[ -3*iSrcStep ];
-    for ( Int x = 0; x < iWidth; x++ )
-    {
-      // {-1,   4,  -10,  57,   19,  -7,   3,   -1  },
-      
-      iTmp1 = piSrcTmp[iSrcStep3] + piSrcTmp[iSrcStep5];
-      iTmp2 = piSrcTmp[iSrcStep6] + piSrcTmp[iSrcStep4];
-      
-      iSum  =  iTmp1 + iTmp2 - piSrcTmp[0] - piSrcTmp[iSrcStep7]
-             - ( ( piSrcTmp[iSrcStep2] - iTmp2 ) << 1 )
-             + (  piSrcTmp[iSrcStep]             << 2 )
-             - ( ( piSrcTmp[iSrcStep2] + iTmp1 ) << 3 )
-             + (   piSrcTmp[iSrcStep4]           << 4 );
-      
-      piDst   [x * iDstStep] = Clip(( (iSum +  32) >>  6 )+ piSrcTmp[iSrcStep3]);
-      piSrcTmp += iSrcStep;
-    }
-    piSrc += iSrcStride;
-    piDst += iDstStride;
-  }
-  return;
-}
-
-__inline Void TRenInterpFilter::xCTI_FilterQuarter0Hor(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
-{
-  Pel*  piDst    = rpiDst;
-  Int   iSum;
-  Int*  piSrcTmp;
-  Int iSrcStep2 = iSrcStep*2;
-  Int iSrcStep3 = iSrcStep*3;
-  Int iSrcStep4 = iSrcStep*4;
-  Int iSrcStep5 = iSrcStep*5;
-  Int iSrcStep6 = iSrcStep*6;
-  Int iSrcStep7 = iSrcStep*7;
-
-  Int  iTmp1, iTmp2;
-
-  for ( Int y = iHeight; y != 0; y-- )
-  {
-    piSrcTmp = &piSrc[ -3*iSrcStep ];
-    for ( Int x = 0; x < iWidth; x++ )
-    {
-      // {-1,   4,  -10,  57,   19,  -7,   3,   -1  },
-    
-      iTmp1 = piSrcTmp[iSrcStep3] + piSrcTmp[iSrcStep5];
-      iTmp2 = piSrcTmp[iSrcStep6] + piSrcTmp[iSrcStep4];
-      
-      iSum  =  iTmp1 + iTmp2 - piSrcTmp[0] - piSrcTmp[iSrcStep7]
-            - ( ( piSrcTmp[iSrcStep2] - iTmp2 ) << 1 )
-            + (  piSrcTmp[iSrcStep]             << 2 )
-            - ( ( piSrcTmp[iSrcStep2] + iTmp1 ) << 3 )
-            + (   piSrcTmp[iSrcStep4]           << 4 )
-            + (   piSrcTmp[iSrcStep3]           << 6 );
-      
-      piDst   [x * iDstStep] = Clip( (iSum +  2048) >>  12 );
-      piSrcTmp += iSrcStep;
-    }
-    piSrc += iSrcStride;
-    piDst += iDstStride;
-  }
-  return;
-}
-
-__inline Void TRenInterpFilter::xCTI_FilterQuarter1Hor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
-{
-  Pel*  piDst    = rpiDst;
-  Int   iSum;
-  Pel*  piSrcTmp;
-  Int iSrcStep2 = iSrcStep*2;
-  Int iSrcStep3 = iSrcStep*3;
-  Int iSrcStep4 = iSrcStep*4;
-  Int iSrcStep5 = iSrcStep*5;
-  Int iSrcStep6 = iSrcStep*6;
-  Int iSrcStep7 = iSrcStep*7;
-
-  Int  iTmp1, iTmp2;
-  for ( Int y = iHeight; y != 0; y-- )
-  {
-    piSrcTmp = &piSrc[ -3*iSrcStep ];
-    for ( Int x = 0; x < iWidth; x++ )
-    {
-      // {-1,   3,  -7,  19,   57,  -10,   4,   -1  },
-      
-      iTmp1 = piSrcTmp[iSrcStep4] + piSrcTmp[iSrcStep2];
-      iTmp2 = piSrcTmp[iSrcStep ] + piSrcTmp[iSrcStep3];
-      
-      iSum  =  iTmp1 + iTmp2 - piSrcTmp[0] - piSrcTmp[iSrcStep7]
-            - ( ( piSrcTmp[iSrcStep5] - iTmp2 ) << 1 )
-            + (   piSrcTmp[iSrcStep6]           << 2 )
-            - ( ( piSrcTmp[iSrcStep5] + iTmp1 ) << 3 )
-            + (   piSrcTmp[iSrcStep3]           << 4 );
-      
-      piDst   [x * iDstStep] = Clip( ((iSum +  32) >>  6) + piSrcTmp[iSrcStep4] );
-      piSrcTmp += iSrcStep;
-    }
-    piSrc += iSrcStride;
-    piDst += iDstStride;
-  }
-  return;
-}
-
-__inline Void TRenInterpFilter::xCTI_FilterQuarter1Hor(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
-{
-  Pel*  piDst    = rpiDst;
-  Int   iSum;
-  Int*  piSrcTmp;
-  Int iSrcStep2 = iSrcStep*2;
-  Int iSrcStep3 = iSrcStep*3;
-  Int iSrcStep4 = iSrcStep*4;
-  Int iSrcStep5 = iSrcStep*5;
-  Int iSrcStep6 = iSrcStep*6;
-  Int iSrcStep7 = iSrcStep*7;
-
-  Int  iTmp1, iTmp2;
-  for ( Int y = iHeight; y != 0; y-- )
-  {
-    piSrcTmp = &piSrc[ -3*iSrcStep ];
-    for ( Int x = 0; x < iWidth; x++ )
-    {
-      // {-1,   3,  -7,  19,   57,  -10,   4,   -1  },
-      
-      iTmp1 = piSrcTmp[iSrcStep4] + piSrcTmp[iSrcStep2];
-      iTmp2 = piSrcTmp[iSrcStep ] + piSrcTmp[iSrcStep3];
-      
-      iSum  =  iTmp1 + iTmp2 - piSrcTmp[0] - piSrcTmp[iSrcStep7]
-            - ( ( piSrcTmp[iSrcStep5] - iTmp2 ) << 1 )
-            + (   piSrcTmp[iSrcStep6]           << 2 )
-            - ( ( piSrcTmp[iSrcStep5] + iTmp1 ) << 3 )
-            + (   piSrcTmp[iSrcStep3]           << 4 )
-            + (   piSrcTmp[iSrcStep4]           << 6 );
-      
-      piDst   [x * iDstStep] = Clip( (iSum +  2048) >>  12 );
-      piSrcTmp += iSrcStep;
-    }
-    piSrc += iSrcStride;
-    piDst += iDstStride;
-  }
-  return;
-}
-
-__inline Void TRenInterpFilter::xCTI_FilterHalfVer (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst, Int iDstStridePel, Pel*& rpiDstPel )
-{
-  Int*  piDst = rpiDst;
-  Pel*  piDstPel = rpiDstPel;
-  Int   iSum;
-  Pel*  piSrcTmp;
-  Int iSrcStride2 = iSrcStride*2;
-  Int iSrcStride3 = iSrcStride*3;
-  Int iSrcStride4 = iSrcStride*4;
-  Int iSrcStride5 = iSrcStride*5;
-  Int iSrcStride6 = iSrcStride*6;
-  Int iSrcStride7 = iSrcStride*7;
-
-  Int  iTmp0, iTmp1, iTmp2, iTmp3, iTmpA;
-  for ( Int y = iHeight; y != 0; y-- )
-  {
-    piSrcTmp = &piSrc[ -3*iSrcStride ];
-    for ( Int x = 0; x < iWidth; x++ )
-    {
-      // { -1,4,-11,40,40,-11,4,-1   } 
-      iTmp0 = piSrcTmp[          0]+piSrcTmp[iSrcStride7];
-      iTmp1 = piSrcTmp[iSrcStride ]+piSrcTmp[iSrcStride6];
-      iTmp2 = piSrcTmp[iSrcStride2]+piSrcTmp[iSrcStride5];
-      iTmp3 = piSrcTmp[iSrcStride3]+piSrcTmp[iSrcStride4];
-      
-      iTmpA = (iTmp3 << 2) - iTmp2;
-      
-      iSum  = (   iTmp1          << 2 )
-            + (   iTmpA          << 3 )
-            + (   iTmpA          << 1 )
-            -    iTmp0 -  iTmp2;
-      
-      piDst[x * iDstStep]    = iSum;
-      piDstPel[x * iDstStep] = Clip( (iSum +  32) >>  6 );
-      piSrcTmp += iSrcStep;
-    }
-    piSrc += iSrcStride;
-    piDst += iDstStride;
-    piDstPel += iDstStridePel;
-  }
- return;
-}
-
-__inline Void TRenInterpFilter::xCTI_FilterHalfVer (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst)
-{
-  Int*  piDst = rpiDst;
-  Int   iSum;
-  Pel*  piSrcTmp;
-  Int iSrcStride2 = iSrcStride*2;
-  Int iSrcStride3 = iSrcStride*3;
-  Int iSrcStride4 = iSrcStride*4;
-  Int iSrcStride5 = iSrcStride*5;
-  Int iSrcStride6 = iSrcStride*6;
-  Int iSrcStride7 = iSrcStride*7;
-
-  Int  iTmp0, iTmp1, iTmp2, iTmp3, iTmpA;
-  for ( Int y = iHeight; y != 0; y-- )
-  {
-    piSrcTmp = &piSrc[ -3*iSrcStride ];
-    for ( Int x = 0; x < iWidth; x++ )
-    {
-      // { -1,4,-11,40,40,-11,4,-1   } 
-      iTmp0 = piSrcTmp[          0]+piSrcTmp[iSrcStride7];
-      iTmp1 = piSrcTmp[iSrcStride ]+piSrcTmp[iSrcStride6];
-      iTmp2 = piSrcTmp[iSrcStride2]+piSrcTmp[iSrcStride5];
-      iTmp3 = piSrcTmp[iSrcStride3]+piSrcTmp[iSrcStride4];
-      
-      iTmpA = (iTmp3 << 2) - iTmp2;
-      
-      iSum  = (   iTmp1          << 2 )
-            + (   iTmpA          << 3 )
-            + (   iTmpA          << 1 )
-            -    iTmp0 -  iTmp2;        
-      
-      piDst[x * iDstStep] = iSum;
-      piSrcTmp += iSrcStep;
-    }
-    piSrc += iSrcStride;
-    piDst += iDstStride;
-  }
-  return;
-}
-
-__inline Void TRenInterpFilter::xCTI_FilterHalfVer (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
-{
-  Pel*  piDst = rpiDst;
-  Int   iSum;
-  Pel*  piSrcTmp;
-  
-  Int iSrcStride2 = iSrcStride*2;
-  Int iSrcStride3 = iSrcStride*3;
-  Int iSrcStride4 = iSrcStride*4;
-  Int iSrcStride5 = iSrcStride*5;
-  Int iSrcStride6 = iSrcStride*6;
-  Int iSrcStride7 = iSrcStride*7;
-
-  Int  iTmp0, iTmp1, iTmp2, iTmp3, iTmpA;
-  for ( Int y = iHeight; y != 0; y-- )
-  {
-    piSrcTmp = &piSrc[ -3*iSrcStride ];
-    for ( Int x = 0; x < iWidth; x++ )
-    {
-      // { -1,4,-11,40,40,-11,4,-1   } 
-      iTmp0 = piSrcTmp[          0]+piSrcTmp[iSrcStride7];
-      iTmp1 = piSrcTmp[iSrcStride ]+piSrcTmp[iSrcStride6];
-      iTmp2 = piSrcTmp[iSrcStride2]+piSrcTmp[iSrcStride5];
-      iTmp3 = piSrcTmp[iSrcStride3]+piSrcTmp[iSrcStride4];
-      
-      iTmpA = (iTmp3 << 2) - iTmp2;
-      
-      iSum  = (   iTmp1          << 2 )
-            + (   iTmpA          << 3 )
-            + (   iTmpA          << 1 )
-            -    iTmp0 -  iTmp2;        
-      
-      piDst[x * iDstStep] = Clip( (iSum +  32) >>  6 );
-      piSrcTmp += iSrcStep;
-    }
-    piSrc += iSrcStride;
-    piDst += iDstStride;
-  }
-  return;
-}
-
-__inline Void TRenInterpFilter::xCTI_FilterQuarter0Ver (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst)
-{
-  Int*  piDst = rpiDst;
-  Int   iSum;
-  Pel*  piSrcTmp;
-  Int iSrcStride2 = iSrcStride*2;
-  Int iSrcStride3 = iSrcStride*3;
-  Int iSrcStride4 = iSrcStride*4;
-  Int iSrcStride5 = iSrcStride*5;
-  Int iSrcStride6 = iSrcStride*6;
-  Int iSrcStride7 = iSrcStride*7;
-
-  Int  iTmp1, iTmp2;
-  for ( Int y = iHeight; y != 0; y-- )
-  {
-    piSrcTmp = &piSrc[ -3*iSrcStride ];
-    for ( Int x = 0; x < iWidth; x++ )
-    {
-      // {-1,   4,  -10,  57,   19,  -7,   3,   -1  },
-      
-      iTmp1 = piSrcTmp[iSrcStride3] + piSrcTmp[iSrcStride5];
-      iTmp2 = piSrcTmp[iSrcStride6] + piSrcTmp[iSrcStride4];
-      
-      iSum  =  iTmp1 + iTmp2 - piSrcTmp[0] - piSrcTmp[iSrcStride7]
-            - ( ( piSrcTmp[iSrcStride2] - iTmp2 ) << 1 )
-            + (  piSrcTmp[iSrcStride]             << 2 )
-            - ( ( piSrcTmp[iSrcStride2] + iTmp1 ) << 3 )
-            + (   piSrcTmp[iSrcStride4]           << 4 )
-            + (   piSrcTmp[iSrcStride3]           << 6 );
-      
-      piDst[x * iDstStep] = iSum;
-      piSrcTmp += iSrcStep;
-    }
-    piSrc += iSrcStride;
-    piDst += iDstStride;
-  }
-  return;
-}
-
-__inline Void TRenInterpFilter::xCTI_FilterQuarter0Ver (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
-{
-  Pel*  piDst = rpiDst;
-  Int   iSum;
-  Pel*  piSrcTmp;
-  
-  Int iSrcStride2 = iSrcStride*2;
-  Int iSrcStride3 = iSrcStride*3;
-  Int iSrcStride4 = iSrcStride*4;
-  Int iSrcStride5 = iSrcStride*5;
-  Int iSrcStride6 = iSrcStride*6;
-  Int iSrcStride7 = iSrcStride*7;
 
   Int  iTmp1, iTmp2;
@@ -993,5 +556,5 @@
             + (   piSrcTmp[iSrcStride4]           << 4 );
       
-      piDst[x * iDstStep] = Clip( ((iSum +  32) >>  6) + piSrcTmp[iSrcStride3] );
+      piDst[x * iDstStep] = ClipY( ((iSum +  32) >>  6) + piSrcTmp[iSrcStride3] );
       piSrcTmp += iSrcStep;
     }
@@ -1043,4 +606,6 @@
 __inline Void TRenInterpFilter::xCTI_FilterQuarter1Ver (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
 {
+  assert( g_bitDepthC == g_bitDepthY);  // ToDo: Update renderer to work with different luma/chroma bit depth 
+
   Pel*  piDst = rpiDst;
   Int   iSum;
@@ -1070,5 +635,5 @@
             + (   piSrcTmp[iSrcStride3]           << 4 );
             
-      piDst[x * iDstStep] = Clip( ((iSum +  32) >>  6) +  piSrcTmp[iSrcStride4] );
+      piDst[x * iDstStep] = ClipY( ((iSum +  32) >>  6) +  piSrcTmp[iSrcStride4] );
       piSrcTmp += iSrcStep;
     }
@@ -1211,4 +776,5 @@
 __inline Void TRenInterpFilter::xCTI_Filter2DHorC(Int* piSrc, Int iSrcStride,  Int iWidth, Int iHeight, Int iDstStride,  Pel*& rpiDst, Int iMV)
 {
+  assert( g_bitDepthC == g_bitDepthY);  // ToDo: Update renderer to work with different luma/chroma bit depth 
   Pel*  piDst    = rpiDst;
   Int   iSum;
@@ -1225,5 +791,5 @@
         {
           iSum         = xCTI_Filter_VI04_C_OCT0( piSrcTmp, 1 );
-          piDst   [x ] = Clip ((iSum +  2048) >>  12 );
+          piDst   [x ] = ClipC ((iSum +  2048) >>  12 );
           piSrcTmp++;
         }
@@ -1241,5 +807,5 @@
         {
           iSum         = xCTI_Filter_VI04_C_QUA0( piSrcTmp, 1 );
-          piDst   [x ] = Clip ((iSum +  2048) >>  12 );
+          piDst   [x ] = ClipC ((iSum +  2048) >>  12 );
           piSrcTmp++;
         }
@@ -1257,5 +823,5 @@
         {
           iSum         = xCTI_Filter_VI04_C_QUA1( piSrcTmp, 1 );
-          piDst   [x ] = Clip ((iSum +  2048) >>  12 );
+          piDst   [x ] = ClipC ((iSum +  2048) >>  12 );
           piSrcTmp++;
         }
@@ -1273,5 +839,5 @@
         {
           iSum         = xCTI_Filter_VI04_C_OCT1( piSrcTmp, 1 );
-          piDst   [x ] = Clip ((iSum +  2048) >>  12 );
+          piDst   [x ] = ClipC ((iSum +  2048) >>  12 );
           piSrcTmp++;
         }
@@ -1289,5 +855,5 @@
         {
           iSum         = xCTI_Filter_VI04_C_OCT2( piSrcTmp, 1 );
-          piDst   [x ] = Clip ((iSum +  2048) >>  12 );
+          piDst   [x ] = ClipC ((iSum +  2048) >>  12 );
           piSrcTmp++;
         }
@@ -1305,5 +871,5 @@
         {
           iSum         = xCTI_Filter_VI04_C_OCT3( piSrcTmp, 1 );
-          piDst   [x ] = Clip ((iSum +  2048) >>  12 );
+          piDst   [x ] = ClipC ((iSum +  2048) >>  12 );
           piSrcTmp++;
         }
@@ -1321,5 +887,5 @@
         {
           iSum      = xCTI_Filter_VIS04_C_HAL( piSrcTmp, 1 );
-          piDst   [x ] = Clip ((iSum +  2048) >>  12 );
+          piDst   [x ] = ClipC ((iSum +  2048) >>  12 );
           piSrcTmp++;
         }
@@ -1338,4 +904,6 @@
 __inline Void TRenInterpFilter::xCTI_Filter1DVerC (Pel* piSrc, Int iSrcStride, Int iWidth, Int iHeight, Int iDstStride,  Pel*& rpiDst, Int iMV)
 {
+  assert( g_bitDepthC == g_bitDepthY);  // ToDo: Update renderer to work with different luma/chroma bit depth 
+
   Pel*  piDst = rpiDst;
   Int   iSum;
@@ -1352,5 +920,5 @@
         {
           iSum      = xCTI_Filter_VP04_C_OCT0( piSrcTmp,  iSrcStride );
-          piDst[x ] = Clip ((iSum +  32) >>  6 );
+          piDst[x ] = ClipC ((iSum +  32) >>  6 );
           piSrcTmp++;
         }
@@ -1368,5 +936,5 @@
         {
           iSum      = xCTI_Filter_VP04_C_QUA0( piSrcTmp,  iSrcStride );
-          piDst[x ] = Clip ((iSum +  32) >>  6 );
+          piDst[x ] = ClipC ((iSum +  32) >>  6 );
           piSrcTmp++;
         }
@@ -1384,5 +952,5 @@
         {
           iSum      = xCTI_Filter_VP04_C_QUA1( piSrcTmp,  iSrcStride );
-          piDst[x ] = Clip ((iSum +  32) >>  6 );
+          piDst[x ] = ClipC ((iSum +  32) >>  6 );
           piSrcTmp++;
         }
@@ -1400,5 +968,5 @@
         {
           iSum      = xCTI_Filter_VP04_C_OCT1( piSrcTmp,  iSrcStride );
-          piDst[x ] = Clip ((iSum +  32) >>  6 );
+          piDst[x ] = ClipC ((iSum +  32) >>  6 );
           piSrcTmp++;
         }
@@ -1416,5 +984,5 @@
         {
           iSum      = xCTI_Filter_VP04_C_OCT2( piSrcTmp,  iSrcStride );
-          piDst[x ] = Clip ((iSum +  32) >>  6 );
+          piDst[x ] = ClipC ((iSum +  32) >>  6 );
           piSrcTmp++;
         }
@@ -1432,5 +1000,5 @@
         {
           iSum      = xCTI_Filter_VP04_C_OCT3( piSrcTmp,  iSrcStride );
-          piDst[x ] = Clip ((iSum +  32) >>  6 );
+          piDst[x ] = ClipC ((iSum +  32) >>  6 );
           piSrcTmp++;
         }
@@ -1448,5 +1016,5 @@
         {
           iSum      = xCTI_Filter_VPS04_C_HAL( piSrcTmp, iSrcStride );
-          piDst[x ] = Clip ((iSum +  32) >>  6 );
+          piDst[x ] = ClipC ((iSum +  32) >>  6 );
           piSrcTmp++;
         }
@@ -1478,5 +1046,5 @@
         {
           iSum         = xCTI_Filter_VP04_C_OCT0( piSrcTmp,  1 );
-          piDst[x ] = Clip ((iSum +  32) >>  6 );
+          piDst[x ] = ClipC ((iSum +  32) >>  6 );
           piSrcTmp++;
         }
@@ -1494,5 +1062,5 @@
         {
           iSum         = xCTI_Filter_VP04_C_QUA0( piSrcTmp,  1 );
-          piDst[x ] = Clip ((iSum +  32) >>  6 );
+          piDst[x ] = ClipC ((iSum +  32) >>  6 );
           piSrcTmp++;
         }
@@ -1510,5 +1078,5 @@
         {
           iSum         = xCTI_Filter_VP04_C_QUA1( piSrcTmp,  1 );
-          piDst[x ] = Clip ((iSum +  32) >>  6 );
+          piDst[x ] = ClipC ((iSum +  32) >>  6 );
           piSrcTmp++;
         }
@@ -1526,5 +1094,5 @@
         {
           iSum         = xCTI_Filter_VP04_C_OCT1( piSrcTmp,  1 );
-          piDst[x ] = Clip ((iSum +  32) >>  6 );
+          piDst[x ] = ClipC ((iSum +  32) >>  6 );
           piSrcTmp++;
         }
@@ -1542,5 +1110,5 @@
         {
           iSum         = xCTI_Filter_VP04_C_OCT2( piSrcTmp,  1 );
-          piDst[x ] = Clip ((iSum +  32) >>  6 );
+          piDst[x ] = ClipC ((iSum +  32) >>  6 );
           piSrcTmp++;
         }
@@ -1558,5 +1126,5 @@
         {
           iSum         = xCTI_Filter_VP04_C_OCT3( piSrcTmp,  1 );
-          piDst[x ] = Clip ((iSum +  32) >>  6 );
+          piDst[x ] = ClipC ((iSum +  32) >>  6 );
           piSrcTmp++;
         }
@@ -1574,5 +1142,5 @@
         {
           iSum         = xCTI_Filter_VPS04_C_HAL( piSrcTmp,  1 );
-          piDst[x ] = Clip ((iSum +  32) >>  6 );
+          piDst[x ] = ClipC ((iSum +  32) >>  6 );
           piSrcTmp++;
         }
@@ -1587,477 +1155,4 @@
   return;
 }
-
-#if HIGH_ACCURACY_BI
-__inline Void TRenInterpFilter::xCTI_Filter2DHorC_ha(Int* piSrc, Int iSrcStride,  Int iWidth, Int iHeight, Int iDstStride,  Pel*& rpiDst, Int iMV)
-{
-  Pel*  piDst    = rpiDst;
-  Int   iSum;
-  Int*  piSrcTmp;
-  Int shiftNum  = 6 + g_uiBitIncrement + g_uiBitDepth - 8;
-  Int shiftOffset = (shiftNum > 0) ? ( 1 << (shiftNum - 1)) : 0 ;
-
-  switch (iMV)
-  {
-  case 1:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -1 ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum         = xCTI_Filter_VI04_C_OCT0( piSrcTmp, 1 );
-#if REMOVE_INTERMEDIATE_CLIPPING
-          piDst[x ] = (iSum +  shiftOffset) >>  shiftNum;
-#else
-          piDst[x ] = Clip3(0,16383, (iSum +  shiftOffset) >>  shiftNum );
-#endif
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 2:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -1 ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum         = xCTI_Filter_VI04_C_QUA0( piSrcTmp, 1 );
-#if REMOVE_INTERMEDIATE_CLIPPING
-          piDst[x ] = (iSum +  shiftOffset) >>  shiftNum;
-#else
-          piDst[x ] = Clip3(0,16383, (iSum +  shiftOffset) >>  shiftNum );
-#endif
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 6:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -1 ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum         = xCTI_Filter_VI04_C_QUA1( piSrcTmp, 1 );
-#if REMOVE_INTERMEDIATE_CLIPPING
-          piDst[x ] = (iSum +  shiftOffset) >>  shiftNum;
-#else
-          piDst[x ] = Clip3(0,16383, (iSum +  shiftOffset) >>  shiftNum );
-#endif
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 3:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -1 ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum         = xCTI_Filter_VI04_C_OCT1( piSrcTmp, 1 );
-#if REMOVE_INTERMEDIATE_CLIPPING
-          piDst[x ] = (iSum +  shiftOffset) >>  shiftNum;
-#else
-          piDst[x ] = Clip3(0,16383, (iSum +  shiftOffset) >>  shiftNum );
-#endif
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 5:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -1 ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum         = xCTI_Filter_VI04_C_OCT2( piSrcTmp, 1 );
-#if REMOVE_INTERMEDIATE_CLIPPING
-          piDst[x ] = (iSum +  shiftOffset) >>  shiftNum;
-#else
-          piDst[x ] = Clip3(0,16383, (iSum +  shiftOffset) >>  shiftNum );
-#endif
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 7:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -1 ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum         = xCTI_Filter_VI04_C_OCT3( piSrcTmp, 1 );
-#if REMOVE_INTERMEDIATE_CLIPPING
-          piDst[x ] = (iSum +  shiftOffset) >>  shiftNum;
-#else
-          piDst[x ] = Clip3(0,16383, (iSum +  shiftOffset) >>  shiftNum );
-#endif
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 4:
-  {
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -1 ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum      = xCTI_Filter_VIS04_C_HAL( piSrcTmp, 1 );
-#if REMOVE_INTERMEDIATE_CLIPPING
-          piDst[x ] = (iSum +  shiftOffset) >>  shiftNum;
-#else
-          piDst[x ] = Clip3(0,16383, (iSum +  shiftOffset) >>  shiftNum );
-#endif
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  default:
-    assert( 0 );
-  }
-
-  return;
-}
-
-__inline Void TRenInterpFilter::xCTI_Filter1DVerC_ha (Pel* piSrc, Int iSrcStride, Int iWidth, Int iHeight, Int iDstStride,  Pel*& rpiDst, Int iMV)
-{
-  Pel*  piDst = rpiDst;
-  Int   iSum;
-  Pel*  piSrcTmp;
-  Int shiftNum  = g_uiBitIncrement + g_uiBitDepth - 8;
-  Int shiftOffset = (shiftNum > 0) ? ( 1 << (shiftNum - 1)) : 0 ;
-    
-  switch (iMV)
-  {
-  case 1:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -iSrcStride ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum      = xCTI_Filter_VP04_C_OCT0( piSrcTmp,  iSrcStride );
-#if REMOVE_INTERMEDIATE_CLIPPING
-          piDst[x ] = (iSum +  shiftOffset) >>  shiftNum;
-#else
-          piDst[x ] = Clip3(0,16383, (iSum +  shiftOffset) >>  shiftNum );
-#endif
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 2:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -iSrcStride ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum      = xCTI_Filter_VP04_C_QUA0( piSrcTmp,  iSrcStride );
-#if REMOVE_INTERMEDIATE_CLIPPING
-          piDst[x ] = (iSum +  shiftOffset) >>  shiftNum;
-#else
-          piDst[x ] = Clip3(0,16383, (iSum +  shiftOffset) >>  shiftNum );
-#endif
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 6:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -iSrcStride ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum      = xCTI_Filter_VP04_C_QUA1( piSrcTmp,  iSrcStride );
-#if REMOVE_INTERMEDIATE_CLIPPING
-          piDst[x ] = (iSum +  shiftOffset) >>  shiftNum;
-#else
-          piDst[x ] = Clip3(0,16383, (iSum +  shiftOffset) >>  shiftNum );
-#endif
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 3:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -iSrcStride ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum      = xCTI_Filter_VP04_C_OCT1( piSrcTmp,  iSrcStride );
-#if REMOVE_INTERMEDIATE_CLIPPING
-          piDst[x ] = (iSum +  shiftOffset) >>  shiftNum;
-#else
-          piDst[x ] = Clip3(0,16383, (iSum +  shiftOffset) >>  shiftNum );
-#endif
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 5:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -iSrcStride ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum      = xCTI_Filter_VP04_C_OCT2( piSrcTmp,  iSrcStride );
-#if REMOVE_INTERMEDIATE_CLIPPING
-          piDst[x ] = (iSum +  shiftOffset) >>  shiftNum;
-#else
-          piDst[x ] = Clip3(0,16383, (iSum +  shiftOffset) >>  shiftNum );
-#endif
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 7:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -iSrcStride ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum      = xCTI_Filter_VP04_C_OCT3( piSrcTmp,  iSrcStride );
-#if REMOVE_INTERMEDIATE_CLIPPING
-          piDst[x ] = (iSum +  shiftOffset) >>  shiftNum;
-#else
-          piDst[x ] = Clip3(0,16383, (iSum +  shiftOffset) >>  shiftNum );
-#endif
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 4:
-  {
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[-iSrcStride ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum      = xCTI_Filter_VPS04_C_HAL( piSrcTmp, iSrcStride );
-#if REMOVE_INTERMEDIATE_CLIPPING
-          piDst[x ] = (iSum +  shiftOffset) >>  shiftNum;
-#else
-          piDst[x ] = Clip3(0,16383, (iSum +  shiftOffset) >>  shiftNum );
-#endif
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  default:
-    assert( 0 );
-  }    
-  return;
-}
-
-__inline Void TRenInterpFilter::xCTI_Filter1DHorC_ha(Pel* piSrc, Int iSrcStride, Int iWidth, Int iHeight, Int iDstStride, Pel*& rpiDst, Int iMV)
-{
-  Pel*  piDst    = rpiDst;
-  Int   iSum;
-  Pel*  piSrcTmp;
-  Int shiftNum  = g_uiBitIncrement + g_uiBitDepth - 8;
-  Int shiftOffset = (shiftNum > 0) ? ( 1 << (shiftNum - 1)) : 0 ;
-
-  switch (iMV)
-  {
-  case 1:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -1 ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum      = xCTI_Filter_VP04_C_OCT0( piSrcTmp,  1 );
-#if REMOVE_INTERMEDIATE_CLIPPING
-          piDst[x ] = (iSum +  shiftOffset) >>  shiftNum;
-#else
-          piDst[x ] = Clip3(0,16383, (iSum +  shiftOffset) >>  shiftNum );
-#endif
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 2:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -1 ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum      = xCTI_Filter_VP04_C_QUA0( piSrcTmp,  1 );
-#if REMOVE_INTERMEDIATE_CLIPPING
-          piDst[x ] = (iSum +  shiftOffset) >>  shiftNum;
-#else
-          piDst[x ] = Clip3(0,16383, (iSum +  shiftOffset) >>  shiftNum );
-#endif
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 6:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -1 ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum         = xCTI_Filter_VP04_C_QUA1( piSrcTmp,  1 );
-#if REMOVE_INTERMEDIATE_CLIPPING
-          piDst[x ] = (iSum +  shiftOffset) >>  shiftNum;
-#else
-          piDst[x ] = Clip3(0,16383, (iSum +  shiftOffset) >>  shiftNum );
-#endif
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 3:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -1 ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum      = xCTI_Filter_VP04_C_OCT1( piSrcTmp,  1 );
-#if REMOVE_INTERMEDIATE_CLIPPING
-          piDst[x ] = (iSum +  shiftOffset) >>  shiftNum;
-#else
-          piDst[x ] = Clip3(0,16383, (iSum +  shiftOffset) >>  shiftNum );
-#endif
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 5:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -1 ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum         = xCTI_Filter_VP04_C_OCT2( piSrcTmp,  1 );
-#if REMOVE_INTERMEDIATE_CLIPPING
-          piDst[x ] = (iSum +  shiftOffset) >>  shiftNum;
-#else
-          piDst[x ] = Clip3(0,16383, (iSum +  shiftOffset) >>  shiftNum );
-#endif
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 7:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -1 ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum         = xCTI_Filter_VP04_C_OCT3( piSrcTmp,  1 );
-#if REMOVE_INTERMEDIATE_CLIPPING
-          piDst[x ] = (iSum +  shiftOffset) >>  shiftNum;
-#else
-          piDst[x ] = Clip3(0,16383, (iSum +  shiftOffset) >>  shiftNum );
-#endif
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 4:
-  {
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -1 ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum    = xCTI_Filter_VPS04_C_HAL( piSrcTmp,  1 );
-#if REMOVE_INTERMEDIATE_CLIPPING
-          piDst[x ] = (iSum +  shiftOffset) >>  shiftNum;
-#else
-          piDst[x ] = Clip3(0,16383, (iSum +  shiftOffset) >>  shiftNum );
-#endif
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  default:
-    assert( 0 );
-
- }
-  return;
-}
-#endif
-
 
 __inline Int TRenInterpFilter::xCTI_Filter_VP04_C_OCT0( Pel* pSrc,  Int iStride )
@@ -2231,4 +1326,4 @@
   return iSum;
 }
-
+#endif // H_3D
 #endif // __TRENINTERP__
Index: trunk/source/Lib/TLibRenderer/TRenModSetupStrParser.cpp
===================================================================
--- trunk/source/Lib/TLibRenderer/TRenModSetupStrParser.cpp	(revision 296)
+++ trunk/source/Lib/TLibRenderer/TRenModSetupStrParser.cpp	(revision 608)
@@ -36,5 +36,6 @@
 #include "TRenFilter.h"
 #include "TRenModSetupStrParser.h"
-#if !QC_MVHEVC_B0046
+
+#if H_3D
 Int
 TRenModSetupStrParser::getNumOfModels()
@@ -450,4 +451,4 @@
   rcNextChar = m_pchSetStr[iPos];
 }
-#endif
-
+#endif // H_3D
+
Index: trunk/source/Lib/TLibRenderer/TRenModSetupStrParser.h
===================================================================
--- trunk/source/Lib/TLibRenderer/TRenModSetupStrParser.h	(revision 296)
+++ trunk/source/Lib/TLibRenderer/TRenModSetupStrParser.h	(revision 608)
@@ -31,5 +31,5 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
-#if !QC_MVHEVC_B0046
+
 #ifndef __TRENMODSETUPSTRPARSER__
 #define __TRENMODSETUPSTRPARSER__
@@ -39,4 +39,6 @@
 #include "../TLibCommon/TypeDef.h"
 #include "../TAppCommon/TAppComCamPara.h"
+#if H_3D
+
 
 
@@ -126,5 +128,6 @@
 };
 
+#endif // H_3D
 #endif //__TRENMODEL__
-#endif
 
+
Index: trunk/source/Lib/TLibRenderer/TRenModel.cpp
===================================================================
--- trunk/source/Lib/TLibRenderer/TRenModel.cpp	(revision 296)
+++ trunk/source/Lib/TLibRenderer/TRenModel.cpp	(revision 608)
@@ -35,5 +35,6 @@
 #include "TRenFilter.h"
 #include "TRenModel.h"
-#if !QC_MVHEVC_B0046
+
+#if H_3D_VSO
 ///////////  TRENMODEL //////////////////////
 TRenModel::TRenModel()
@@ -48,5 +49,5 @@
   m_iHoleMargin        =  1;
   m_uiHorOff           = -1;
-#if LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
   m_bEarlySkip         = false; 
 #endif
@@ -214,5 +215,5 @@
 
 Void
-#if LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
 TRenModel::create( Int iNumOfBaseViews, Int iNumOfModels, Int iWidth, Int iHeight, Int iShiftPrec, Int iHoleMargin, Bool bEarlySkip )
 #else
@@ -226,5 +227,5 @@
   m_iShiftPrec          = iShiftPrec;
   m_iHoleMargin         = iHoleMargin;
-#if LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
   m_bEarlySkip          = bEarlySkip; 
 #endif
@@ -357,6 +358,7 @@
   AOT( iContent      < -1 || iContent > 1 );
   AOT( iBlendMode < -1 || iBlendMode > 2 );
-
-  Bool bBitInc = (g_uiBitIncrement != 0);
+  AOT( g_bitDepthY  != g_bitDepthC ); 
+
+  Bool bBitInc = ( DISTORTION_PRECISION_ADJUSTMENT( g_bitDepthY - 8 ) != 0);
 
   AOT( m_apcRenModels[iModelNum] );
@@ -414,5 +416,5 @@
 
 
-#if LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
   m_apcRenModels[iModelNum]->create( iMode ,m_iWidth, m_iHeight, m_iShiftPrec, m_aaaiSubPelShiftLut, m_iHoleMargin,  bUseOrgRef, iBlendMode, m_bEarlySkip );
 #else
@@ -550,5 +552,5 @@
 }
 
-#if LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
 RMDist
 TRenModel::getDist( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel * piOrgData, Int iOrgStride)
@@ -574,5 +576,5 @@
     if (m_iCurrentContent == 1)
     {
-#if LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
       iDist +=  m_apcCurRenModels[iModelNum]->getDistDepth  ( m_aiCurPosInModels[iModelNum], iStartPosX, iStartPosY,  iWidth,  iHeight,  iStride,  piNewData , piOrgData, iOrgStride);
 #else
@@ -606,5 +608,5 @@
     if (m_iCurrentContent == 1)
     {
-#ifdef LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
       Int iTargetStride = m_aiCurDepthStrides[ m_iCurrentView ];
       m_apcCurRenModels[iModelNum]->setDepth  ( m_aiCurPosInModels[iModelNum], iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData,m_apiCurDepthPel[ m_iCurrentView ] + iStartPosY * iTargetStride + iStartPosX ,iTargetStride );
@@ -619,5 +621,5 @@
   }
 
-#ifdef LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
   if (m_iCurrentContent == 1)
   {
@@ -658,7 +660,7 @@
     m_apcCurRenModels[iCurModel]->getRefVideo  ( m_aiCurPosInModels[iCurModel], &cPicYuvTempRef   );
 
-    iSSEY += TRenFilter::SSE( cPicYuvSynth.getLumaAddr(), cPicYuvSynth.getStride(),  m_iWidth,      m_iUsedHeight     , cPicYuvTempRef.getLumaAddr(), cPicYuvTempRef.getStride() );
-    iSSEU += TRenFilter::SSE( cPicYuvSynth.getCbAddr()  , cPicYuvSynth.getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, cPicYuvTempRef.getCbAddr()  , cPicYuvTempRef.getCStride());
-    iSSEV += TRenFilter::SSE( cPicYuvSynth.getCrAddr()  , cPicYuvSynth.getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, cPicYuvTempRef.getCrAddr()  , cPicYuvTempRef.getCStride());
+    iSSEY += TRenFilter::SSE( cPicYuvSynth.getLumaAddr(), cPicYuvSynth.getStride(),  m_iWidth,      m_iUsedHeight     , cPicYuvTempRef.getLumaAddr(), cPicYuvTempRef.getStride() , true  );
+    iSSEU += TRenFilter::SSE( cPicYuvSynth.getCbAddr()  , cPicYuvSynth.getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, cPicYuvTempRef.getCbAddr()  , cPicYuvTempRef.getCStride(), false );
+    iSSEV += TRenFilter::SSE( cPicYuvSynth.getCrAddr()  , cPicYuvSynth.getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, cPicYuvTempRef.getCrAddr()  , cPicYuvTempRef.getCStride(), false );
   }
 
@@ -697,4 +699,3 @@
   }
 }
-#endif
-
+#endif // H_3D
Index: trunk/source/Lib/TLibRenderer/TRenModel.h
===================================================================
--- trunk/source/Lib/TLibRenderer/TRenModel.h	(revision 296)
+++ trunk/source/Lib/TLibRenderer/TRenModel.h	(revision 608)
@@ -32,5 +32,5 @@
  */
 
-#if !QC_MVHEVC_B0046
+
 #ifndef __TRENMODEL__
 #define __TRENMODEL__
@@ -42,4 +42,6 @@
 #include "../TLibCommon/TypeDef.h"
 
+#if H_3D_VSO
+
 class TRenModel
 {
@@ -50,5 +52,5 @@
 
   // Creation
-#if LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
   Void  create           ( Int iNumOfBaseViews, Int iNumOfModels, Int iWidth, Int iHeight, Int iShiftPrec, Int iHoleMargin, Bool bEarlySkip );
 #else
@@ -68,5 +70,5 @@
 
   // Get Distortion, set Data
-#ifdef LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
   Int64 getDist          ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel * piOrgData, Int iOrgStride);
 #else
@@ -91,5 +93,5 @@
   Int**  m_aaaiSubPelShiftLut[2];
   Int    m_iHoleMargin;
-#if LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
   Bool   m_bEarlySkip; 
 #endif
@@ -155,5 +157,5 @@
 };
 
+#endif // H_3D
 #endif //__TRENMODEL__
-#endif
 
Index: trunk/source/Lib/TLibRenderer/TRenSingleModel.cpp
===================================================================
--- trunk/source/Lib/TLibRenderer/TRenSingleModel.cpp	(revision 296)
+++ trunk/source/Lib/TLibRenderer/TRenSingleModel.cpp	(revision 608)
@@ -36,9 +36,10 @@
 #include "TRenSingleModel.h"
 
-#if !QC_MVHEVC_B0046
+#if H_3D_VSO
+
 ////////////// TRENSINGLE MODEL ///////////////
 template <BlenMod iBM, Bool bBitInc>
 TRenSingleModelC<iBM,bBitInc>::TRenSingleModelC()
-:  m_iDistShift ( g_uiBitIncrement << 1 )
+:  m_iDistShift ( ( g_bitDepthY - 8) << 1 )
 {
   m_iWidth  = -1;
@@ -84,5 +85,5 @@
   }
 
-#ifdef LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
   m_pbHorSkip = NULL;
 #endif
@@ -92,5 +93,5 @@
 TRenSingleModelC<iBM,bBitInc>::~TRenSingleModelC()
 {
-#ifdef LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
   if ( m_pbHorSkip ) 
   {
@@ -114,5 +115,5 @@
 
 template <BlenMod iBM, Bool bBitInc> Void
-#if LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
 TRenSingleModelC<iBM,bBitInc>::create( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bEarlySkip )
 #else
@@ -121,5 +122,5 @@
 
 {
-#if LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
   m_pbHorSkip     = new Bool [MAX_CU_SIZE];
   m_bEarlySkip    = bEarlySkip; 
@@ -182,5 +183,5 @@
   Pel* piDRow = piCurDepthPel;
   Pel* piYRow = apiCurVideoPel[0];
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
   Pel* piURow = apiCurVideoPel[1];
   Pel* piVRow = apiCurVideoPel[2];
@@ -196,5 +197,5 @@
       Int iSubPosX = (1 << m_iShiftPrec); 
       pcCurInputSampleRow[0].aiY[iSubPosX] = piYRow[0];
-#if HHI_VSO_COLOR_PLANES 
+#if H_3D_VSO_COLOR_PLANES 
       pcCurInputSampleRow[0].aiU[iSubPosX] = piURow[0];
       pcCurInputSampleRow[0].aiV[iSubPosX] = piVRow[0];
@@ -210,5 +211,5 @@
         Int iShift = (iPosX << m_iShiftPrec) + iSubPosX;
         pcCurInputSampleRow[iPosX+iOffsetX].aiY[iSubPosX] = piYRow[iShift];
-#if HHI_VSO_COLOR_PLANES 
+#if H_3D_VSO_COLOR_PLANES 
         pcCurInputSampleRow[iPosX+iOffsetX].aiU[iSubPosX] = piURow[iShift];
         pcCurInputSampleRow[iPosX+iOffsetX].aiV[iSubPosX] = piVRow[iShift];
@@ -221,5 +222,5 @@
     piDRow += iCurDepthStride;
     piYRow += aiCurVideoStride[0];
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
     piURow += aiCurVideoStride[1];
     piVRow += aiCurVideoStride[2];
@@ -270,5 +271,5 @@
   {  
   case 0:   
-#if LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
     xRenderL<true>( 0, 0, m_iWidth, m_iUsedHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0],false );
 #else
@@ -277,5 +278,5 @@
     break;
   case 1:    
-#ifdef LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
     xRenderR<true>( 0, 0, m_iWidth, m_iUsedHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1],false);
 #else
@@ -285,5 +286,5 @@
   case 2:
     TRenFilter::setupZLUT( true, 30, iDistToLeft, ppiBaseShiftLutLeft, ppiBaseShiftLutRight, m_iBlendZThres, m_iBlendDistWeight, m_piInvZLUTLeft, m_piInvZLUTRight );
-#ifdef LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
     xRenderL<true>( 0, 0, m_iWidth, m_iUsedHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0],false);
     xRenderR<true>( 0, 0, m_iWidth, m_iUsedHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1],false);
@@ -306,5 +307,5 @@
 
 template <BlenMod iBM, Bool bBitInc> Void
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
 TRenSingleModelC<iBM,bBitInc>::xGetSampleStrTextPtrs( Int iViewNum, Pel RenModelOutPels::*& rpiSrcY, Pel RenModelOutPels::*& rpiSrcU, Pel RenModelOutPels::*& rpiSrcV )
 #else
@@ -316,5 +317,5 @@
   case 0:
     rpiSrcY = &RenModelOutPels::iYLeft;
-#if HHI_VSO_COLOR_PLANES  
+#if H_3D_VSO_COLOR_PLANES  
     rpiSrcU = &RenModelOutPels::iULeft;
     rpiSrcV = &RenModelOutPels::iVLeft;
@@ -323,5 +324,5 @@
   case 1:
     rpiSrcY = &RenModelOutPels::iYRight;
-#if HHI_VSO_COLOR_PLANES  
+#if H_3D_VSO_COLOR_PLANES  
     rpiSrcU = &RenModelOutPels::iURight;
     rpiSrcV = &RenModelOutPels::iVRight;
@@ -330,5 +331,5 @@
   case 2:
     rpiSrcY = &RenModelOutPels::iYBlended;
-#if HHI_VSO_COLOR_PLANES  
+#if H_3D_VSO_COLOR_PLANES  
     rpiSrcU = &RenModelOutPels::iUBlended;
     rpiSrcV = &RenModelOutPels::iVBlended;
@@ -353,5 +354,5 @@
   
   Pel* piYRow = m_aapiRefVideoPel[0];
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
   Pel* piURow = m_aapiRefVideoPel[1];
   Pel* piVRow = m_aapiRefVideoPel[2];
@@ -363,5 +364,5 @@
     {      
       pcCurOutSampleRow[iPosX].iYRef = piYRow[iPosX];
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
       pcCurOutSampleRow[iPosX].iURef = piURow[iPosX];
       pcCurOutSampleRow[iPosX].iVRef = piVRow[iPosX];
@@ -372,5 +373,5 @@
     
     piYRow += m_aiRefVideoStrides[0];
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
     piURow += m_aiRefVideoStrides[1];
     piVRow += m_aiRefVideoStrides[2];
@@ -403,5 +404,5 @@
   Pel RenModelOutPels::* piSrcY = NULL;
 
-#if HHI_VSO_COLOR_PLANES  
+#if H_3D_VSO_COLOR_PLANES  
   Pel RenModelOutPels::* piSrcU = NULL;
   Pel RenModelOutPels::* piSrcV = NULL;
@@ -416,5 +417,5 @@
     {      
       pcCurOutSampleRow[iPosX].iYRef = pcCurOutSampleRow[iPosX].*piSrcY;
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
       pcCurOutSampleRow[iPosX].iURef = pcCurOutSampleRow[iPosX].*piSrcU;
       pcCurOutSampleRow[iPosX].iVRef = pcCurOutSampleRow[iPosX].*piSrcV;
@@ -449,14 +450,14 @@
       pcOutSampleRow[iPosX].iYRight       = 0;
       pcOutSampleRow[iPosX].iYBlended     = 0;
-#if HHI_VSO_COLOR_PLANES             
+#if H_3D_VSO_COLOR_PLANES             
       // U Planes                    
-      pcOutSampleRow[iPosX].iULeft        = 128 << g_uiBitIncrement;
-      pcOutSampleRow[iPosX].iURight       = 128 << g_uiBitIncrement;
-      pcOutSampleRow[iPosX].iUBlended     = 128 << g_uiBitIncrement;
+      pcOutSampleRow[iPosX].iULeft        = 1 << (g_bitDepthC - 1);
+      pcOutSampleRow[iPosX].iURight       = 1 << (g_bitDepthC - 1);
+      pcOutSampleRow[iPosX].iUBlended     = 1 << (g_bitDepthC - 1);
                                      
       // V Planes                    
-      pcOutSampleRow[iPosX].iVLeft        = 128 << g_uiBitIncrement;
-      pcOutSampleRow[iPosX].iVRight       = 128 << g_uiBitIncrement;
-      pcOutSampleRow[iPosX].iVBlended     = 128 << g_uiBitIncrement;
+      pcOutSampleRow[iPosX].iVLeft        = 1 << (g_bitDepthC - 1);
+      pcOutSampleRow[iPosX].iVRight       = 1 << (g_bitDepthC - 1);
+      pcOutSampleRow[iPosX].iVBlended     = 1 << (g_bitDepthC - 1);
 #endif
       //// Input Samples
@@ -472,5 +473,5 @@
 
 
-#ifdef LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
 template <BlenMod iBM, Bool bBitInc> RMDist
 TRenSingleModelC<iBM,bBitInc>::getDistDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData , Pel * piOrgData, Int iOrgStride )
@@ -481,5 +482,5 @@
 {
   RMDist iSSE = 0;
-#ifdef LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
   Bool   bEarlySkip;
 #endif
@@ -487,5 +488,5 @@
   {
   case 0:
-#ifdef LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
     bEarlySkip = m_bEarlySkip ? xDetectEarlySkipL(iStartPosX,   iStartPosY,   iWidth,   iHeight,   iStride, piNewData, piOrgData, iOrgStride) : false;
     if( !bEarlySkip )
@@ -498,5 +499,5 @@
     break;
   case 1:
-#ifdef LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
     bEarlySkip = m_bEarlySkip ? xDetectEarlySkipR(iStartPosX,   iStartPosY,   iWidth,   iHeight,   iStride, piNewData, piOrgData, iOrgStride) : false;
     if( !bEarlySkip )
@@ -514,5 +515,5 @@
   return iSSE;
 }
-#ifdef LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
 template <BlenMod iBM, Bool bBitInc> Void
 TRenSingleModelC<iBM,bBitInc>::setDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel* piOrgData, Int iOrgStride )
@@ -522,5 +523,5 @@
 #endif
 {
-#ifdef  LGE_VSO_EARLY_SKIP_A0093
+#ifdef  H_3D_VSO_EARLY_SKIP
   Bool bEarlySkip;
 #endif
@@ -528,5 +529,5 @@
   {
   case 0:
-#ifdef LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
     bEarlySkip = m_bEarlySkip ? xDetectEarlySkipL(iStartPosX,   iStartPosY,   iWidth,   iHeight,   iStride, piNewData, piOrgData,iOrgStride) : false;
     if( !bEarlySkip )
@@ -539,5 +540,5 @@
     break;
   case 1:
-#ifdef LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
     bEarlySkip = m_bEarlySkip ? xDetectEarlySkipR(iStartPosX,   iStartPosY,   iWidth,   iHeight,   iStride, piNewData, piOrgData,iOrgStride) : false;
     if( !bEarlySkip )
@@ -560,5 +561,5 @@
   AOT( pcPicYuv->getHeight() < m_iUsedHeight + m_iHorOffset );
 
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
   Pel RenModelOutPels::* piText[3] = { NULL, NULL, NULL };
   xGetSampleStrTextPtrs(iViewPos, piText[0], piText[1], piText[2]); 
@@ -581,5 +582,5 @@
   xGetSampleStrTextPtrs(iViewPos, piY); 
   xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, piY, pcPicYuv->getLumaAddr() + m_iHorOffset * pcPicYuv->getStride(), pcPicYuv->getStride(), m_iWidth, m_iUsedHeight );
-  pcPicYuv->setChromaTo( 128 << g_uiBitIncrement );   
+  pcPicYuv->setChromaTo( 1 << (g_bitDepthC - 1) );   
 #endif  
 }
@@ -595,5 +596,5 @@
   xGetSampleStrDepthPtrs(iViewPos, piD); 
   xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, piD, pcPicYuv->getLumaAddr() + pcPicYuv->getStride() * m_iHorOffset, pcPicYuv->getStride(), m_iWidth, m_iUsedHeight );
-  pcPicYuv->setChromaTo( 128 << g_uiBitIncrement );   
+  pcPicYuv->setChromaTo( 1 << (g_bitDepthC - 1) );   
 }
 
@@ -605,5 +606,5 @@
   AOT( pcPicYuv->getHeight() <  m_iUsedHeight + m_iHorOffset);
 
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
   Pel RenModelOutPels::* piText[3];
   piText[0] = &RenModelOutPels::iYRef;
@@ -627,5 +628,5 @@
 #else
   xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, &RenModelOutPels::iYRef, pcPicYuv->getLumaAddr() *  pcPicYuv->getStride() + m_iHorOffset, pcPicYuv->getStride(), m_iWidth, m_iUsedHeight );
-  pcPicYuv->setChromaTo( 128 << g_uiBitIncrement );   
+  pcPicYuv->setChromaTo( 1 << ( g_bitDepthC - 1 ) );   
 #endif  
 }
@@ -662,5 +663,5 @@
   m_pcOutputSamplesRow   += m_iOutputSamplesStride;  
 }
-#if LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline RMDist 
 TRenSingleModelC<iBM,bBitInc>::xRenderL( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Bool bFast)
@@ -695,5 +696,5 @@
   for (Int iPosY = iStartPosY; iPosY < iStartPosY + iHeight; iPosY++ )
   {
-#ifdef LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
     if( m_bEarlySkip && bFast )
     {
@@ -721,5 +722,5 @@
       xExtrapolateMarginL<bSet>  ( iCurSPos, iEndChangePos, iError );
 
-      iMinChangedSPos       = Min( iMinChangedSPos, (iEndChangePos << m_iShiftPrec) - m_ppiCurLUT[0][ RenModRemoveBitInc( Max(m_pcInputSamplesRow[iCurViewPos][iEndChangePos].iD, m_piNewDepthData[iPosXinNewData] )) ]);
+      iMinChangedSPos       = std::min( iMinChangedSPos, (iEndChangePos << m_iShiftPrec) - m_ppiCurLUT[0][ RenModRemoveBitInc( std::max(m_pcInputSamplesRow[iCurViewPos][iEndChangePos].iD, m_piNewDepthData[iPosXinNewData] )) ]);
       iLastSPos             = iCurSPos;
       m_iLastDepth          = m_iCurDepth;
@@ -746,5 +747,5 @@
       // Get minimal changed sample position
 
-      iMinChangedSPos = Min( iMinChangedSPos, (iCurPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RenModRemoveBitInc( Max(m_pcInputSamplesRow[iCurViewPos][iCurPosX].iD, m_piNewDepthData[iPosXinNewData] )) ]);
+      iMinChangedSPos = std::min( iMinChangedSPos, (iCurPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RenModRemoveBitInc( std::max(m_pcInputSamplesRow[iCurViewPos][iCurPosX].iD, m_piNewDepthData[iPosXinNewData] )) ]);
       Int iCurSPos    = xShiftNewData(iCurPosX,iPosXinNewData);
       m_iCurDepth     = m_piNewDepthData[iPosXinNewData];
@@ -786,5 +787,5 @@
 }
 
-#ifdef  LGE_VSO_EARLY_SKIP_A0093
+#ifdef  H_3D_VSO_EARLY_SKIP
 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline RMDist
 TRenSingleModelC<iBM,bBitInc>::xRenderR( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData , Bool bFast)
@@ -820,5 +821,5 @@
   for (Int iPosY = iStartPosY; iPosY < iStartPosY + iHeight; iPosY++ )
   {
-#ifdef LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
     if( m_bEarlySkip && bFast )
     {
@@ -846,5 +847,5 @@
       xExtrapolateMarginR<bSet>     ( iCurSPos, iStartChangePos, iError );
 
-      iMaxChangedSPos       = Max( iMaxChangedSPos, (iStartChangePos << m_iShiftPrec) - m_ppiCurLUT[0][ RenModRemoveBitInc( Max(m_pcInputSamplesRow[iCurViewPos][iStartChangePos].iD, m_piNewDepthData[iPosXinNewData] )) ]);
+      iMaxChangedSPos       = std::max( iMaxChangedSPos, (iStartChangePos << m_iShiftPrec) - m_ppiCurLUT[0][ RenModRemoveBitInc( std::max(m_pcInputSamplesRow[iCurViewPos][iStartChangePos].iD, m_piNewDepthData[iPosXinNewData] )) ]);
       iLastSPos             = iCurSPos;
       m_iLastDepth          = m_iCurDepth;
@@ -872,5 +873,5 @@
       // Get minimal changed sample position
 
-      iMaxChangedSPos = Max( iMaxChangedSPos, (iCurPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RenModRemoveBitInc( Max(m_pcInputSamplesRow[iCurViewPos][iCurPosX].iD, m_piNewDepthData[iPosXinNewData] )) ]);
+      iMaxChangedSPos = std::max( iMaxChangedSPos, (iCurPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RenModRemoveBitInc( std::max(m_pcInputSamplesRow[iCurViewPos][iCurPosX].iD, m_piNewDepthData[iPosXinNewData] )) ]);
       Int iCurSPos    = xShiftNewData(iCurPosX,iPosXinNewData);
       m_iCurDepth     = m_piNewDepthData[iPosXinNewData];
@@ -1002,5 +1003,5 @@
 
     m_iThisDepth = m_iCurDepth;
-    for (Int iFillSPos = Max(0, xRangeLeftL(iCurSPos) ); iFillSPos <= min(xRangeRightL( iLastSPos ) ,m_iLastOccludedSPosFP-1); iFillSPos++ )
+    for (Int iFillSPos = std::max(0, xRangeLeftL(iCurSPos) ); iFillSPos <= min(xRangeRightL( iLastSPos ) ,m_iLastOccludedSPosFP-1); iFillSPos++ )
     {
       Int iDeltaCurSPos  = (iFillSPos << m_iShiftPrec) - iCurSPos;
@@ -1189,5 +1190,5 @@
 
   m_iThisDepth = m_iLastDepth;
-  for (Int iFillSPos = Max(iStartFillSPosFP+1,0); iFillSPos <= min(xRangeRightL( iLastSPos ), m_iLastOccludedSPosFP-1 ); iFillSPos++ )
+  for (Int iFillSPos = std::max(iStartFillSPosFP+1,0); iFillSPos <= min(xRangeRightL( iLastSPos ), m_iLastOccludedSPosFP-1 ); iFillSPos++ )
   {
     xSetShiftedPelL<bSet>( iLastPos, 0,  iFillSPos, REN_IS_HOLE, riError );
@@ -1233,5 +1234,5 @@
 //    return;
 
-  Int iSPosFullPel = Max(0,xRangeLeftL(iCurSPos));
+  Int iSPosFullPel = std::max(0,xRangeLeftL(iCurSPos));
 
   m_iThisDepth = m_iCurDepth;
@@ -1253,5 +1254,5 @@
   //    return;
 
-  Int iSPosFullPel = Min(m_iWidth-1,xRangeRightR(iCurSPos));
+  Int iSPosFullPel = std::min(m_iWidth-1,xRangeRightR(iCurSPos));
 
   m_iThisDepth = m_iCurDepth;
@@ -1413,5 +1414,5 @@
     // Yuv
     pcOutSample->iYLeft  = pcInSample->aiY[iSubSourcePos];
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
     pcOutSample->iULeft  = pcInSample->aiU[iSubSourcePos];
     pcOutSample->iVLeft  = pcInSample->aiV[iSubSourcePos];
@@ -1428,5 +1429,5 @@
   else
   { 
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
     riError += xGetDist( pcInSample->aiY[iSubSourcePos] - pcOutSample->iYRef,
                          pcInSample->aiU[iSubSourcePos] - pcOutSample->iURef,
@@ -1445,5 +1446,5 @@
 {
   Pel piBlendedValueY;
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
   Pel piBlendedValueU;
   Pel piBlendedValueV;
@@ -1453,5 +1454,5 @@
     pcInSample ->aiY[iSubSourcePos],
     pcOutSample->iYRight,    
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
     pcInSample ->aiU[iSubSourcePos],
     pcOutSample->iURight,    
@@ -1464,5 +1465,5 @@
     pcOutSample->iFilledRight  ,
     piBlendedValueY
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
     , piBlendedValueU,
     piBlendedValueV
@@ -1476,5 +1477,5 @@
     pcOutSample->iYLeft      = pcInSample ->aiY[iSubSourcePos];
     pcOutSample->iYBlended   = piBlendedValueY;    
-#if HHI_VSO_COLOR_PLANES  
+#if H_3D_VSO_COLOR_PLANES  
     pcOutSample->iULeft      = pcInSample ->aiU[iSubSourcePos];
     pcOutSample->iUBlended   = piBlendedValueU;    
@@ -1486,5 +1487,5 @@
     // Get Error
     Int iDiffY = pcOutSample->iYRef - piBlendedValueY;
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
     Int iDiffU = pcOutSample->iURef - piBlendedValueU;
     Int iDiffV = pcOutSample->iVRef - piBlendedValueV;
@@ -1497,5 +1498,5 @@
   {
     Int iDiffY = pcOutSample->iYRef - piBlendedValueY;
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
     Int iDiffU = pcOutSample->iURef - piBlendedValueU;
     Int iDiffV = pcOutSample->iVRef - piBlendedValueV;
@@ -1543,5 +1544,5 @@
     // Yuv
     pcOutSample->iYRight  = pcInSample->aiY[iSubSourcePos];
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
     pcOutSample->iURight  = pcInSample->aiU[iSubSourcePos];
     pcOutSample->iVRight  = pcInSample->aiV[iSubSourcePos];
@@ -1559,5 +1560,5 @@
   else
   { 
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
     riError += xGetDist( pcInSample->aiY[iSubSourcePos] - pcOutSample->iYRef,
       pcInSample->aiU[iSubSourcePos] - pcOutSample->iURef,
@@ -1576,5 +1577,5 @@
 {
   Pel piBlendedValueY;
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
   Pel piBlendedValueU;
   Pel piBlendedValueV;
@@ -1584,5 +1585,5 @@
     pcOutSample->iYLeft, 
     pcInSample ->aiY[iSubSourcePos],        
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
     pcOutSample->iULeft,    
     pcInSample ->aiU[iSubSourcePos],
@@ -1595,5 +1596,5 @@
     iFilled,
     piBlendedValueY
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
     , piBlendedValueU,
     piBlendedValueV
@@ -1607,5 +1608,5 @@
     pcOutSample->iYRight     = pcInSample ->aiY[iSubSourcePos];
     pcOutSample->iYBlended   = piBlendedValueY;    
-#if HHI_VSO_COLOR_PLANES  
+#if H_3D_VSO_COLOR_PLANES  
     pcOutSample->iURight     = pcInSample ->aiU[iSubSourcePos];
     pcOutSample->iUBlended   = piBlendedValueU;    
@@ -1617,5 +1618,5 @@
     // Get Error
     Int iDiffY = pcOutSample->iYRef - piBlendedValueY;
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
     Int iDiffU = pcOutSample->iURef - piBlendedValueU;
     Int iDiffV = pcOutSample->iVRef - piBlendedValueV;
@@ -1628,5 +1629,5 @@
   {
     Int iDiffY = pcOutSample->iYRef - piBlendedValueY;
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
     Int iDiffU = pcOutSample->iURef - piBlendedValueU;
     Int iDiffV = pcOutSample->iVRef - piBlendedValueV;
@@ -1680,5 +1681,5 @@
 
 
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
 template <BlenMod iBM, Bool bBitInc>  __inline Void
 TRenSingleModelC<iBM,bBitInc>::xGetBlendedValue( Pel iYL, Pel iYR, Pel iUL, Pel iUR, Pel iVL, Pel iVR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY, Pel& riU, Pel&riV )
@@ -1695,5 +1696,5 @@
     if (iBM == BLEND_LEFT )
     {
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
       xGetBlendedValueBM1(  iYL,  iYR,  iUL,  iUR,  iVL,  iVR,  iDepthL,  iDepthR,  iFilledL,  iFilledR,  riY,  riU, riV );
 #else
@@ -1703,5 +1704,5 @@
     else
     {
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
       xGetBlendedValueBM2(  iYL,  iYR,  iUL,  iUR,  iVL,  iVR,  iDepthL,  iDepthR,  iFilledL,  iFilledR,  riY,  riU, riV );
 #else
@@ -1721,5 +1722,5 @@
       {
         riY = xBlend( iYL, iYR, iFilledR >> 1 );
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
         riU = xBlend( iUL, iUR, iFilledR >> 1 );
         riV = xBlend( iVL, iVR, iFilledR >> 1 );
@@ -1730,5 +1731,5 @@
       {
         riY = xBlend( iYR, iYL, (iFilledL >> 1) );
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
         riU = xBlend( iUR, iUL, (iFilledL >> 1) );
         riV = xBlend( iVR, iVL, (iFilledL >> 1) );
@@ -1738,5 +1739,5 @@
       {
         riY = xBlend( iYL, iYR, m_iBlendDistWeight );
-#if HHI_VSO_COLOR_PLANES    
+#if H_3D_VSO_COLOR_PLANES    
         riU = xBlend( iUL, iUR, m_iBlendDistWeight );
         riV = xBlend( iVL, iVR, m_iBlendDistWeight );
@@ -1747,5 +1748,5 @@
     {
       riY = iYL;
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
       riU = iUL;
       riV = iVL;
@@ -1755,5 +1756,5 @@
     {
       riY = iYR;
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
       riU = iUR;
       riV = iVR;
@@ -1766,5 +1767,5 @@
     {
         riY =  iYR;
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
         riU =  iUR;
         riV =  iVR;
@@ -1774,5 +1775,5 @@
     {
         riY =  iYL;
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
         riU =  iUL;
         riV =  iVL;
@@ -1785,5 +1786,5 @@
     {
         riY = iYL;
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
         riU = iUL;
         riV = iVL;
@@ -1793,5 +1794,5 @@
     {
       riY = iYR;
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
       riU = iUR;
       riV = iVR;
@@ -1802,5 +1803,5 @@
 
 template <BlenMod iBM, Bool bBitInc> __inline Void
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
 TRenSingleModelC<iBM,bBitInc>::xGetBlendedValueBM1( Pel iYL, Pel iYR, Pel iUL, Pel iUR, Pel iVL, Pel iVR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY, Pel& riU, Pel&riV )
 #else
@@ -1811,5 +1812,5 @@
   {
     riY = iYL;
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
     riU = iUL;
     riV = iVL;
@@ -1819,5 +1820,5 @@
   {
     riY = iYR;
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
     riU = iUR;
     riV = iVR;
@@ -1827,5 +1828,5 @@
   {
     riY = xBlend( iYR, iYL, iFilledL );
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
     riU = xBlend( iUR, iUL, iFilledL );
     riV = xBlend( iVR, iUL, iFilledL );
@@ -1835,5 +1836,5 @@
 
 template <BlenMod iBM, Bool bBitInc> __inline Void
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
 TRenSingleModelC<iBM,bBitInc>::xGetBlendedValueBM2( Pel iYL, Pel iYR, Pel iUL, Pel iUR, Pel iVL, Pel iVR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY, Pel& riU, Pel&riV )
 #else
@@ -1844,5 +1845,5 @@
   {
     riY = iYR;
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
     riU = iUR;
     riV = iVR;
@@ -1852,5 +1853,5 @@
   {
     riY = iYL;
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
     riU = iUL;
     riV = iVL;
@@ -1860,5 +1861,5 @@
   {
     riY = xBlend( iYL, iYR, iFilledR );
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
     riU = xBlend( iUL, iUR, iFilledR );
     riV = xBlend( iVL, iUR, iFilledR );
@@ -1891,5 +1892,5 @@
 template class TRenSingleModelC<BLEND_RIGHT,false>;
 
-#ifdef LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
 template <BlenMod iBM, Bool bBitInc> 
 __inline Bool
@@ -1957,4 +1958,4 @@
 }
 #endif
-#endif
-
+#endif // H_3D
+
Index: trunk/source/Lib/TLibRenderer/TRenSingleModel.h
===================================================================
--- trunk/source/Lib/TLibRenderer/TRenSingleModel.h	(revision 296)
+++ trunk/source/Lib/TLibRenderer/TRenSingleModel.h	(revision 608)
@@ -32,5 +32,5 @@
  */
 
-#if !QC_MVHEVC_B0046
+
 #ifndef __TRENSINGLEMODEL__ 
 #define __TRENSINGLEMODEL__
@@ -51,9 +51,8 @@
 #include <cstring>
 
-
+#if H_3D_VSO
 using namespace std;
 
-
-#if HHI_VSO_RM_ASSERTIONS
+#if H_3D_VSO_RM_ASSERTIONS
 #define RM_AOT( exp ) AOT ( exp )
 #define RM_AOF( exp ) AOF ( exp )
@@ -70,5 +69,5 @@
 
   virtual ~TRenSingleModel() { }  
-#if LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
   virtual Void   create    ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bEarlySkip ) = 0;
 #else
@@ -82,5 +81,5 @@
 
   // Set Data
-#ifdef LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
   virtual Void   setDepth  ( Int iViewPos,                 Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel* piOrgData, Int iOrgStride )  = 0;
 #else
@@ -90,5 +89,5 @@
 
   // Get Distortion
-#ifdef LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
   virtual RMDist getDistDepth  ( Int iViewPos,             Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel * piOrgData , Int iOrgStride)=0;
 #else
@@ -109,5 +108,5 @@
     // video
     Pel aiY[5]    ; // y-value
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
     Pel aiU[5]    ; // u-value
     Pel aiV[5]    ; // v-value
@@ -126,5 +125,5 @@
     Pel iYRight   ; 
     Pel iYBlended ; 
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
     Pel iULeft    ; 
     Pel iURight   ; 
@@ -148,5 +147,5 @@
     // reference
     Pel iYRef    ; 
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
     Pel iURef    ; 
     Pel iVRef    ; 
@@ -161,5 +160,5 @@
 
   // Create Model
-#if LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
   Void   create    ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bEarlySkip  );
 #else
@@ -172,5 +171,5 @@
   Void   setup     ( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight,  Int** ppiBaseShiftLutRight,  Int iDistToLeft, Bool bKeepReference );
 
-#if LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
   Void   setDepth  ( Int iViewPos,                 Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel* piOrgData, Int iOrgStride );
 #else
@@ -180,5 +179,5 @@
 
   // Get Distortion
-#ifdef LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
   RMDist getDistDepth  ( Int iViewPos,             Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel * piOrgData , Int iOrgStride);
 #else
@@ -198,5 +197,5 @@
   /////  Rendering /////
   // Left to Right
-#if LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
                       __inline Bool   xDetectEarlySkipL   ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData,Pel* piOrgData, Int iOrgStride );
                       __inline Bool   xDetectEarlySkipR   ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData,Pel* piOrgData, Int iOrgStride );
@@ -229,5 +228,5 @@
   template<Bool bSet> __inline Void   xSetShiftedPelBlend ( Int iSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError );
 
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
   __inline Void   xGetBlendedValue    ( Pel iYL, Pel iYR, Pel iUL, Pel iUR, Pel iVL, Pel iVR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY, Pel& riU, Pel&riV );
   __inline Void   xGetBlendedValueBM1 ( Pel iYL, Pel iYR, Pel iUL, Pel iUR, Pel iVL, Pel iVR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY, Pel& riU, Pel&riV );
@@ -260,5 +259,5 @@
   __inline Void   xSetInts   ( Int*  piPelSource , Int iSourceStride, Int iWidth, Int iHeight, Int iVal );
 
-#if HHI_VSO_COLOR_PLANES
+#if H_3D_VSO_COLOR_PLANES
   Void            xGetSampleStrTextPtrs ( Int iViewNum, Pel RenModelOutPels::*& rpiSrcY, Pel RenModelOutPels::*& rpiSrcU, Pel RenModelOutPels::*& rpiSrcV );
 #else  
@@ -367,5 +366,5 @@
   Int   m_iShiftPrec;
   Int   m_iHoleMargin;
-#ifdef LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
   Bool  m_bEarlySkip; 
 #endif
@@ -385,10 +384,11 @@
 
   //// Early Skip 
-#ifdef LGE_VSO_EARLY_SKIP_A0093
+#if H_3D_VSO_EARLY_SKIP
   Bool* m_pbHorSkip;
 #endif
 };
 
+#endif // H_3D
 #endif //__TRENSINGLEMODEL__
-#endif
-
+
+
Index: trunk/source/Lib/TLibRenderer/TRenTop.cpp
===================================================================
--- trunk/source/Lib/TLibRenderer/TRenTop.cpp	(revision 296)
+++ trunk/source/Lib/TLibRenderer/TRenTop.cpp	(revision 608)
@@ -32,4 +32,5 @@
  */
 
+
 #include "TRenImage.h"
 #include "TRenTop.h"
@@ -39,4 +40,6 @@
 #include <math.h>
 #include "../TLibCommon/CommonDef.h"
+#if H_3D
+
 
 Void TRenTop::xGetDataPointers( PelImage*& rpcInputImage, PelImage*& rpcOutputImage, PelImage*& rpcInputDepth, PelImage*& rpcOutputDepth, PelImage*& rpcFilled, Bool bRenderDepth )
@@ -1030,4 +1033,22 @@
             for ( ; iInterPolPos <= xCeil (iShiftedPos ) -1 ; iInterPolPos++)
             {
+#if H_3D_FIX_REN
+              if ( ( iInterPolPos >= 0 ) && ( iInterPolPos < iOutputWidth ) )
+              {
+                if( pcFilledData[iInterPolPos] == REN_IS_HOLE )
+                {               
+                  Int iNextPos = std::min(iInputWidth-1,iPosX + iStep); 
+                  Int iPosXBG  = ( std::abs( pcDepthData[iNextPos] - pcDepthData[iPosX] ) > 5  ) ? iPosX : iNextPos; 
+                  for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
+                  {
+                    apcOutputData[uiCurPlane][iInterPolPos]  = apcInputData[uiCurPlane][iPosXBG];
+                  }
+                }
+                else
+                {
+                  pcFilledData[iInterPolPos] = REN_IS_HOLE + 1; 
+                }
+              }
+#else
               for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
               {
@@ -1037,4 +1058,5 @@
                 }
               }
+#endif
             }
           }
@@ -1282,5 +1304,9 @@
         else
         {
+#if H_3D_FIX_REN
+          pcAlphaData[iXPos] = pcFilledData[iXPos];
+#else
           pcAlphaData[iXPos] = REN_IS_FILLED;
+#endif
         }
       }
@@ -1588,15 +1614,16 @@
 Void TRenTop::xEnhSimilarityPlane       ( PelImagePlane** apcLeftPlane, PelImagePlane** apcRightPlane, PelImagePlane* pcFilledLeftPlane, PelImagePlane* pcFilledRightPlane, UInt uiNumberOfPlanes )
 {
+  AOF( g_bitDepthC == g_bitDepthY ); 
   AOT( m_iSimEnhBaseView != 1 && m_iSimEnhBaseView != 2 );
   Int iWidth  = (*apcRightPlane)->getWidth ();
   Int iHeight = (*apcRightPlane)->getHeight();
 
-  Int* aiHistLeft  = new Int[ g_uiIBDI_MAX + 1 ];
-  Int* aiHistRight = new Int[ g_uiIBDI_MAX + 1 ];
-  Pel* aiConvLUT   = new Pel[ g_uiIBDI_MAX + 1 ];
+  Int* aiHistLeft  = new Int[ ((Int64)1 ) << g_bitDepthY ];
+  Int* aiHistRight = new Int[ ((Int64)1 ) << g_bitDepthY ];
+  Pel* aiConvLUT   = new Pel[ ((Int64)1 ) << g_bitDepthY ];
 
   for (UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++ )
   {
-    for (Int iCurVal = 0 ; iCurVal <= g_uiIBDI_MAX; iCurVal++)
+    for (Int iCurVal = 0 ; iCurVal < ( 1 << g_bitDepthY ); iCurVal++)
     {
       aiHistLeft [iCurVal] = 0;
@@ -1645,5 +1672,5 @@
     Int iCheckSumRight = 0;
 
-    for (Int iCurVal = 0 ; iCurVal <= g_uiIBDI_MAX; iCurVal++)
+    for (Int iCurVal = 0 ; iCurVal < ( 1 << g_bitDepthY ); iCurVal++)
     {
       iCheckSumLeft  += aiHistLeft [iCurVal];
@@ -1652,13 +1679,13 @@
 
 
-    while( iCurChangeVal <= g_uiIBDI_MAX )
+    while( iCurChangeVal < ( 1 << g_bitDepthY ) )
     {
       if ( iCumSumBase == iCumSumChange )
       {
-        aiConvLUT[iCurChangeVal] = Min(iCurBaseVal, g_uiIBDI_MAX);
+        aiConvLUT[iCurChangeVal] = std::min( iCurBaseVal,  ( 1 << g_bitDepthY ) - 1 );
         iCurBaseVal  ++;
         iCurChangeVal++;
         iCumSumChange += aiHistChange[iCurChangeVal];
-        if (iCurBaseVal <= g_uiIBDI_MAX )
+        if (iCurBaseVal <  ( 1 << g_bitDepthY ) )
         {
           iCumSumBase   += aiHistBase  [iCurBaseVal]  ;
@@ -1668,5 +1695,5 @@
       {
         iCurBaseVal++;
-        if (iCurBaseVal <= g_uiIBDI_MAX )
+        if (iCurBaseVal < ( 1 << g_bitDepthY ) )
         {
           iCumSumBase   += aiHistBase  [iCurBaseVal]  ;
@@ -1675,5 +1702,5 @@
       else if ( iCumSumBase > iCumSumChange)
       {
-        aiConvLUT[iCurChangeVal] = Min(iCurBaseVal, g_uiIBDI_MAX);
+        aiConvLUT[iCurChangeVal] = std::min(iCurBaseVal, ( 1 << g_bitDepthY )-1);
         iCurChangeVal++;
         iCumSumChange += aiHistChange  [iCurChangeVal]  ;
@@ -1884,4 +1911,5 @@
 Void TRenTop::temporalFilterVSRS( TComPicYuv* pcPicYuvVideoCur, TComPicYuv* pcPicYuvDepthCur, TComPicYuv* pcPicYuvVideoLast, TComPicYuv* pcPicYuvDepthLast, Bool bFirstFrame )
 {
+  AOF( g_bitDepthY == g_bitDepthC ); 
   Int iSADThres  = 100 ;  //threshold of sad in 4*4 block motion detection
 
@@ -1950,5 +1978,5 @@
             { //Weight: 0.75
               Int iFilt = (( (pcDepthLastDataBlk[iCurPosX] << 1 ) + pcDepthLastDataBlk[iCurPosX] + pcDepthCurDataBlk[iCurPosX] + 2 ) >> 2 );
-              assert( (iFilt >= 0) && (iFilt <=  g_uiIBDI_MAX) );
+              assert( (iFilt >= 0) && (iFilt <  ( 1 << g_bitDepthY ) ) );
               pcDepthCurDataBlk[iCurPosX] = pcDepthLastDataBlk[iCurPosX];
               pcDepthCurDataBlk[iCurPosX] = iFilt;
@@ -2221,2 +2249,4 @@
   if(m_aiBlkMoving         != NULL ) delete[] m_aiBlkMoving;
 }
+#endif // H_3D
+
Index: trunk/source/Lib/TLibRenderer/TRenTop.h
===================================================================
--- trunk/source/Lib/TLibRenderer/TRenTop.h	(revision 296)
+++ trunk/source/Lib/TLibRenderer/TRenTop.h	(revision 608)
@@ -38,4 +38,6 @@
 #include "../TLibCommon/CommonDef.h"
 #include "../TLibCommon/TComPicYuv.h"
+
+#if H_3D
 #include <list>
 #include <vector>
@@ -268,3 +270,4 @@
 };
 
+#endif // H_3D
 #endif //__TRENTOP__
