Index: branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenFilter.cpp
===================================================================
--- branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenFilter.cpp	(revision 1199)
+++ branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenFilter.cpp	(revision 1200)
@@ -36,8 +36,9 @@
 #include "TRenFilter.h"
 #include "TRenInterpFilter.h"
-#if H_3D
+#if NH_3D
 
 ///// COMMON /////
-Void TRenFilter::setSubPelShiftLUT( Int iLutPrec, Int** piSubPelShiftLUT, Int iShift )
+template<UInt bitDepth>
+Void TRenFilter<bitDepth>::setSubPelShiftLUT( Int iLutPrec, Int** piSubPelShiftLUT, Int iShift )
 {
   //ToDo: use same rounding for left and right
@@ -59,6 +60,6 @@
   }
 }
-
-Void TRenFilter::setupZLUT( Bool bBlendUseDistWeight, Int iBlendZThresPerc, Int iRelDistToLeft, Int** ppiBaseShiftLUTLeft, Int** ppiBaseShiftLUTRight, Int& riBlendZThres, Int& riBlendDistWeight, Int* piInvZLUTLeft, Int* piInvZLUTRight )
+template<UInt bitDepth>
+Void TRenFilter<bitDepth>::setupZLUT( Bool bBlendUseDistWeight, Int iBlendZThresPerc, Int iRelDistToLeft, Int** ppiBaseShiftLUTLeft, Int** ppiBaseShiftLUTRight, Int& riBlendZThres, Int& riBlendDistWeight, Int* piInvZLUTLeft, Int* piInvZLUTRight )
 {
   AOT( iRelDistToLeft == -1 );
@@ -75,5 +76,6 @@
 }
 
-Void TRenFilter::filledToUsedPelMap( PelImage* pcFilledImage, PelImage* pcUsedPelsImage, Int iUsedPelMapMarExt )
+template<UInt bitDepth>
+Void TRenFilter<bitDepth>::filledToUsedPelMap( PelImage* pcFilledImage, PelImage* pcUsedPelsImage, Int iUsedPelMapMarExt )
 {
   // Convert to binary map
@@ -156,5 +158,6 @@
 
 /////////// Copy /////////////
-Void TRenFilter::copy(Pel* pcInputPlaneData, Int iInputStride, Int iWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
+template<UInt bitDepth>
+Void TRenFilter<bitDepth>::copy(const Pel* pcInputPlaneData, Int iInputStride, Int iWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
 {
   xDistributeArray(pcInputPlaneData, iInputStride, 1, 1, iWidth, iHeight ,pcOutputPlaneData, iOutputStride, 1 , 1 );
@@ -163,6 +166,6 @@
 
 /////////// Horizontal Mirror ///////////
-template <typename T>
-Void TRenFilter::mirrorHor( TRenImage<T> *pcImage )
+template<UInt bitDepth> template <typename T> 
+Void TRenFilter<bitDepth>::mirrorHor( TRenImage<T> *pcImage )
 {
   for (UInt uCurPlane = 0 ; uCurPlane < pcImage->getNumberOfPlanes(); uCurPlane++ )
@@ -172,6 +175,6 @@
 }
 
-template <typename T>
-Void TRenFilter::mirrorHor( TRenImagePlane<T> *pcImagePlane )
+template<UInt bitDepth> template <typename T> 
+Void TRenFilter<bitDepth>::mirrorHor( TRenImagePlane<T> *pcImagePlane )
 {
   T* pcPlaneData = pcImagePlane->getPlaneDataOrg();
@@ -194,5 +197,6 @@
 
 /////////// Comparison ///////////
-Int64 TRenFilter::SSE   (PelImagePlane* pcInputPlane1, PelImagePlane* pcInputPlane2, Bool bLuma )
+template<UInt bitDepth>
+Int64 TRenFilter<bitDepth>::SSE   (PelImagePlane* pcInputPlane1, PelImagePlane* pcInputPlane2, Bool bLuma )
 {
   UInt uiWidth     = pcInputPlane1->getWidth();
@@ -208,10 +212,11 @@
 }
 
-Int64 TRenFilter::SSE( Pel* piSrc1, Int iSrcStride1, Int iWidth, Int iHeight,  Pel* piSrc2, Int iSrcStride2, Bool bLuma )
+template<UInt bitDepth>
+Int64 TRenFilter<bitDepth>::SSE( Pel* piSrc1, Int iSrcStride1, Int iWidth, Int iHeight,  Pel* piSrc2, Int iSrcStride2, Bool bLuma )
 {
   Int64 iSSE = 0;
 
 
-  Int iShift = DISTORTION_PRECISION_ADJUSTMENT( ( bLuma ? g_bitDepthY : g_bitDepthC ) - 8 ) << 1 ;
+  Int iShift = ( bitDepth  - 8 ) << 1 ;
   for(Int iPosY = 0; iPosY < iHeight; iPosY++)
   {
@@ -227,6 +232,6 @@
 }
 
-template <typename T>
-Bool TRenFilter::compare( TRenImage<T> *pInputImage1, TRenImage<T> *pInputImage2 )
+template<UInt bitDepth> template <typename T> 
+Bool TRenFilter<bitDepth>::compare( TRenImage<T> *pInputImage1, TRenImage<T> *pInputImage2 )
 {
   Bool bIsEqual = true;
@@ -238,6 +243,6 @@
 }
 
-template <typename T>
-Bool TRenFilter::compare   (TRenImagePlane<T>* pcInputPlane1  , TRenImagePlane<T>* pcInputPlane2   )
+template<UInt bitDepth> template <typename T> 
+Bool TRenFilter<bitDepth>::compare   (TRenImagePlane<T>* pcInputPlane1  , TRenImagePlane<T>* pcInputPlane2   )
 {
   UInt uiWidth  = pcInputPlane1->getWidth();
@@ -265,9 +270,8 @@
 
 /////////// Sampling ///////////
-
-inline Void TRenFilter::sampleUp2Tap13(PelImage* pcInputImage, PelImage* pcOutputImage)
+template<UInt bitDepth>
+inline Void TRenFilter<bitDepth>::sampleUp2Tap13(PelImage* pcInputImage, PelImage* pcOutputImage)
 { // UpSampling from JSVM Software (DownConvertStatic) ???
 
-  AOF( g_bitDepthC == g_bitDepthY ); 
   UInt uiNumPlanes = pcInputImage->getNumberOfPlanes();
 
@@ -400,5 +404,5 @@
       {
         // Scale and copy to image buffer.
-        pcOutputPlaneData[iOffset+i] = ClipY((Pel) ((piDst[i] + iAddH) / iDivH));
+        pcOutputPlaneData[iOffset+i] = ClipBD((Pel) ((piDst[i] + iAddH) / iDivH), bitDepth);
       }
     }
@@ -410,6 +414,6 @@
 }
 
-
-Void TRenFilter::sampleDown2Tap13(PelImage* pcInputImage, PelImage* pcOutputImage)
+template<UInt bitDepth>
+Void TRenFilter<bitDepth>::sampleDown2Tap13(PelImage* pcInputImage, PelImage* pcOutputImage)
 { // DownSampling from JSVM Software (DownConvertStatic) ??
 
@@ -422,8 +426,7 @@
 };
 
-Void TRenFilter::sampleDown2Tap13( Pel* pcInputPlaneData, Int iInputStride, Int iWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
+template<UInt bitDepth>
+Void TRenFilter<bitDepth>::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;
@@ -549,5 +552,5 @@
     {
       // Scale and copy back to image buffer.
-      pcOutputPlaneData[iOutputStride*iPosY+iPosX] = ClipY( ( Pel) ( (piDst[iPosY] + iAddV) / iDivV));
+      pcOutputPlaneData[iOutputStride*iPosY+iPosX] = ClipBD( ( Pel) ( (piDst[iPosY] + iAddV) / iDivV), bitDepth );
     }
   }
@@ -557,5 +560,6 @@
 }
 
-Void TRenFilter::sampleDown2Tap13(PelImagePlane* pcInputPlane, PelImagePlane* pcOutputPlane)
+template<UInt bitDepth>
+Void TRenFilter<bitDepth>::sampleDown2Tap13(PelImagePlane* pcInputPlane, PelImagePlane* pcOutputPlane)
 { // DownSampling from JSVM Software (DownConvertStatic) ??
   Int iWidth       = pcInputPlane->getWidth();
@@ -574,7 +578,7 @@
 };
 
-Void TRenFilter::sampleVerDown2Tap13( PelImagePlane* pcInputPlane, PelImagePlane* pcOutputPlane, Int uiPad)
-{ 
-  assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth 
+template<UInt bitDepth>
+Void TRenFilter<bitDepth>::sampleVerDown2Tap13( PelImagePlane* pcInputPlane, PelImagePlane* pcOutputPlane, Int uiPad)
+{   
   // DownSampling from JSVM Software (DownConvertStatic) ??
   Int iWidth       = pcInputPlane->getWidth();
@@ -622,5 +626,5 @@
 
       Int iSum = iTmp4 + iTmp3 - iTmp2 + ((iTmp0 + iTmp4 + iTmp5 - iTmp2) << 1) + ( ( iTmp3 - iTmp1)  << 2) + (  iTmp5 << 3 ) + (( iTmp4 + iTmp5 ) << 4);
-      pcOutputPlaneData[ iXPos ] = (Pel) ClipY((iSum + 32) >> 6);
+      pcOutputPlaneData[ iXPos ] = (Pel) ClipBD((iSum + 32) >> 6, bitDepth);
       pcTmpIn++;
     }
@@ -630,8 +634,8 @@
 };
 
-Void TRenFilter::sampleHorDown2Tap13( PelImagePlane* pcInputPlane, PelImagePlane* pcOutputPlane, Int uiPad )
+template<UInt bitDepth>
+Void TRenFilter<bitDepth>::sampleHorDown2Tap13( PelImagePlane* pcInputPlane, PelImagePlane* pcOutputPlane, Int uiPad )
 { 
-  assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth 
-  // DownSampling from JSVM Software (DownConvertStatic) ??
+    // DownSampling from JSVM Software (DownConvertStatic) ??
   Int iWidth       = pcInputPlane->getWidth();
   Int iHeight      = pcInputPlane->getHeight();
@@ -663,5 +667,5 @@
 
       Int iSum = iTmp4 + iTmp3 - iTmp2 + ((iTmp0 + iTmp4 + iTmp5 - iTmp2) << 1) + ( ( iTmp3 - iTmp1)  << 2) + (  iTmp5 << 3 ) + (( iTmp4 + iTmp5 ) << 4);
-      pcOutputPlaneData[ iXPos ] = (Pel) ClipY((iSum + 32) >> 6);
+      pcOutputPlaneData[ iXPos ] = (Pel) ClipBD((iSum + 32) >> 6, bitDepth);
       pcTmpIn += 2;
     }
@@ -671,5 +675,6 @@
 };
 
-inline Pel TRenFilter::xMedian3(Pel* pcData)
+template<UInt bitDepth>
+inline Pel TRenFilter<bitDepth>::xMedian3(Pel* pcData)
 {
   Bool bGT01 = pcData[0] >  pcData[1];
@@ -680,6 +685,6 @@
 }
 
-
-Void TRenFilter::lineMedian3( PelImage* pcImage )
+template<UInt bitDepth>
+Void TRenFilter<bitDepth>::lineMedian3( PelImage* pcImage )
 {
 
@@ -722,6 +727,6 @@
 }
 
-
-Void TRenFilter::convRect( PelImage* pcImage, UInt uiSize )
+template<UInt bitDepth>
+Void TRenFilter<bitDepth>::convRect( PelImage* pcImage, UInt uiSize )
 {
   DoubleImage cKernel(uiSize, uiSize,1,0);
@@ -730,5 +735,6 @@
 }
 
-Void TRenFilter::binominal( PelImage* pcInputImage, PelImage* pcOutputImage, UInt uiSize )
+template<UInt bitDepth>
+Void TRenFilter<bitDepth>::binominal( PelImage* pcInputImage, PelImage* pcOutputImage, UInt uiSize )
 {
   assert( pcInputImage->getNumberOfFullPlanes()   == pcOutputImage->getNumberOfFullPlanes  () );
@@ -747,5 +753,6 @@
 }
 
-Void TRenFilter::binominal( PelImagePlane* pcInputPlane, PelImagePlane* pcOutputPlane, UInt uiSize )
+template<UInt bitDepth>
+Void TRenFilter<bitDepth>::binominal( PelImagePlane* pcInputPlane, PelImagePlane* pcOutputPlane, UInt uiSize )
 {
   Int iWidth  = pcInputPlane ->getWidth ();
@@ -777,14 +784,14 @@
   {
   case 1:
-    fpFilter = &TRenFilter::xFiltBinom3;
+    fpFilter = &TRenFilter<bitDepth>::xFiltBinom3;
     break;
   case 2:
-    fpFilter = &TRenFilter::xFiltBinom5;
+    fpFilter = &TRenFilter<bitDepth>::xFiltBinom5;
     break;
   case 3:
-    fpFilter = &TRenFilter::xFiltBinom7;
+    fpFilter = &TRenFilter<bitDepth>::xFiltBinom7;
     break;
   case 4:
-    fpFilter = &TRenFilter::xFiltBinom9;
+    fpFilter = &TRenFilter<bitDepth>::xFiltBinom9;
     break;
   default:
@@ -818,16 +825,15 @@
 }
 
-Pel TRenFilter::xFiltBinom3( Pel* pcInputData, Int iStride )
-{
-  assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth 
-
+template<UInt bitDepth>
+Pel TRenFilter<bitDepth>::xFiltBinom3( Pel* pcInputData, Int iStride )
+{
   Int iSum = pcInputData[-1 * iStride ] + pcInputData[ 0 ] +  (pcInputData[iStride ] << 1 );
-  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 }
+  return ClipBD( (iSum +  2) >>  2 , bitDepth);
+}
+
+template<UInt bitDepth>
+Pel TRenFilter<bitDepth>::xFiltBinom5( Pel* pcInputData, Int iStride )
+{
+    // { 1,4,6,4,1 }
   Int iStride0  = 0;
   Int iStrideM1 = iStride0  - iStride;
@@ -841,11 +847,11 @@
 
   Int iSum = iTmp0 +  (iTmp2 << 1) + ((iTmp1 + iTmp2) << 2);
-  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 }
+  return ClipBD( (iSum +  8) >>  4 , bitDepth);
+}
+
+template<UInt bitDepth>
+Pel TRenFilter<bitDepth>::xFiltBinom7( Pel* pcInputData, Int iStride )
+{
+    // { 1,6,15,20,15,6,1 }
   Int iStride0  = 0;
   Int iStrideM1 = iStride0  - iStride;
@@ -863,10 +869,10 @@
   Int iSum = iTmp0 - iTmp2 + ( iTmp1  << 1) + ( (iTmp1 + iTmp3) << 2) + ((iTmp2 + iTmp3) << 4);
 
-  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 
+  return ClipBD( (iSum +  32) >>  6 , bitDepth);
+}
+
+template<UInt bitDepth>
+Pel TRenFilter<bitDepth>::xFiltBinom9( Pel* pcInputData, Int iStride )
+{  
   // {  1     8    28    56    70    56    28     8     1 }
   Int iStride0  = 0;
@@ -888,9 +894,9 @@
   Int iSum = iTmp0 + ((iTmp4 ) << 1) + ( ( iTmp4 - iTmp2 ) << 2) +  ( (iTmp1 - iTmp3) << 3 ) +  ((iTmp2 ) << 5) + ((iTmp3+ iTmp4 ) << 6);
 
-  return ClipY( (iSum +  128) >>  8 );
-}
-
-
-Pel TRenFilter::interpCHSpline(Double dX, Double dS0, Double dS1, Int iQ0, Int iQ1, Int iQ2, Int iQ3)
+  return ClipBD( (iSum +  128) >>  8 , bitDepth);
+}
+
+template<UInt bitDepth>
+Pel TRenFilter<bitDepth>::interpCHSpline(Double dX, Double dS0, Double dS1, Int iQ0, Int iQ1, Int iQ2, Int iQ3)
 {
   Double dSq = (dX - dS0) / (dS1 - dS0);
@@ -916,5 +922,6 @@
 }
 
-Void TRenFilter::diffHorSym(PelImage* pcInputImage, IntImage* pcOutputImage)
+template<UInt bitDepth>
+Void TRenFilter<bitDepth>::diffHorSym(PelImage* pcInputImage, IntImage* pcOutputImage)
 {
   for (UInt uiCurPlane = 0; uiCurPlane < pcInputImage->getNumberOfPlanes(); uiCurPlane++)
@@ -924,5 +931,6 @@
 }
 
-Void TRenFilter::diffHorSym(PelImagePlane* pcInputPlane, IntImagePlane* pcOutputPlane)
+template<UInt bitDepth>
+Void TRenFilter<bitDepth>::diffHorSym(PelImagePlane* pcInputPlane, IntImagePlane* pcOutputPlane)
 {
   UInt uiInputStride = pcInputPlane ->getStride();
@@ -950,5 +958,6 @@
 }
 
-Void TRenFilter::laplace( DoubleImage* pcInputImage, DoubleImage* pcOutputImage )
+template<UInt bitDepth>
+Void TRenFilter<bitDepth>::laplace( DoubleImage* pcInputImage, DoubleImage* pcOutputImage )
 {
   for (UInt uiCurPlane = 0; uiCurPlane < pcInputImage->getNumberOfPlanes(); uiCurPlane++)
@@ -1022,6 +1031,6 @@
 }
 
-
-Void TRenFilter::conv( PelImage* pcImage, DoubleImage* pcKernel )
+template<UInt bitDepth>
+Void TRenFilter<bitDepth>::conv( PelImage* pcImage, DoubleImage* pcKernel )
 {
   PelImage* pcTemp = pcImage->create();
@@ -1096,7 +1105,8 @@
 
 // Horizontal Up sampling luma
-Void TRenFilter::sampleHorUp( Int iLog2HorSampFac, Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
-{
-  TRenInterpFilter cFilter;
+template<UInt bitDepth>
+Void TRenFilter<bitDepth>::sampleHorUp( Int iLog2HorSampFac, Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
+{
+  TRenInterpFilter<bitDepth> cFilter;
   switch ( iLog2HorSampFac )
   {
@@ -1118,5 +1128,6 @@
 
 // horizontal up sampling chroma
-Void TRenFilter::sampleCHorUp(Int iLog2HorSampFac, Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
+template<UInt bitDepth>
+Void TRenFilter<bitDepth>::sampleCHorUp(Int iLog2HorSampFac, Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
 {
   switch ( iLog2HorSampFac )
@@ -1127,16 +1138,17 @@
   case 1:
     xDistributeArray( pcInputPlaneData,   iInputStride  , 1, 1, iInputWidth,   iHeight   , pcOutputPlaneData                  , iOutputStride, 2 , 1 );
-    xInterpHorChroma( pcInputPlaneData  , iInputStride  , 1, 1, iInputWidth,   iHeight   , pcOutputPlaneData                +1, iOutputStride, 2 , 1, &TRenInterpFilter::xCTI_Filter_VPS04_C_HAL );
+    xInterpHorChroma( pcInputPlaneData  , iInputStride  , 1, 1, iInputWidth,   iHeight   , pcOutputPlaneData                +1, iOutputStride, 2 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VPS04_C_HAL );
     break;
   case 2:
     xDistributeArray( pcInputPlaneData,   iInputStride  , 1, 1, iInputWidth,   iHeight   , pcOutputPlaneData                  , iOutputStride, 4 , 1 );
-    xInterpHorChroma( pcInputPlaneData  , iInputStride  , 1, 1, iInputWidth,   iHeight   , pcOutputPlaneData                +1, iOutputStride, 4 , 1, &TRenInterpFilter::xCTI_Filter_VP04_C_QUA0 );
-    xInterpHorChroma( pcInputPlaneData  , iInputStride  , 1, 1, iInputWidth,   iHeight   , pcOutputPlaneData                +2, iOutputStride, 4 , 1, &TRenInterpFilter::xCTI_Filter_VPS04_C_HAL );
-    xInterpHorChroma( pcInputPlaneData  , iInputStride  , 1, 1, iInputWidth,   iHeight   , pcOutputPlaneData                +3, iOutputStride, 4 , 1, &TRenInterpFilter::xCTI_Filter_VP04_C_QUA1 );
-    break;
-  }
-}
-
-Void TRenFilter::sampleCUpHorUp( Int iLog2HorSampFac, Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
+    xInterpHorChroma( pcInputPlaneData  , iInputStride  , 1, 1, iInputWidth,   iHeight   , pcOutputPlaneData                +1, iOutputStride, 4 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VP04_C_QUA0 );
+    xInterpHorChroma( pcInputPlaneData  , iInputStride  , 1, 1, iInputWidth,   iHeight   , pcOutputPlaneData                +2, iOutputStride, 4 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VPS04_C_HAL );
+    xInterpHorChroma( pcInputPlaneData  , iInputStride  , 1, 1, iInputWidth,   iHeight   , pcOutputPlaneData                +3, iOutputStride, 4 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VP04_C_QUA1 );
+    break;
+  }
+}
+
+template<UInt bitDepth>
+Void TRenFilter<bitDepth>::sampleCUpHorUp( Int iLog2HorSampFac, Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
 {
 
@@ -1145,24 +1157,24 @@
   case 0:
     xDistributeArray( pcInputPlaneData-1, iInputStride  , 1, 1, iInputWidth+3, iHeight   , pcOutputPlaneData                -2, iOutputStride, 2,  2 );
-    xInterpVerChroma( pcInputPlaneData-1, iInputStride  , 1, 1, iInputWidth+3, iHeight   , pcOutputPlaneData+1*iOutputStride-2, iOutputStride, 2 , 2, &TRenInterpFilter::xCTI_Filter_VPS04_C_HAL );
-    xInterpHorChroma( pcOutputPlaneData , iOutputStride , 2, 1, iInputWidth,   iHeight*2 , pcOutputPlaneData+1                , iOutputStride, 2 , 1, &TRenInterpFilter::xCTI_Filter_VPS04_C_HAL );
+    xInterpVerChroma( pcInputPlaneData-1, iInputStride  , 1, 1, iInputWidth+3, iHeight   , pcOutputPlaneData+1*iOutputStride-2, iOutputStride, 2 , 2, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VPS04_C_HAL );
+    xInterpHorChroma( pcOutputPlaneData , iOutputStride , 2, 1, iInputWidth,   iHeight*2 , pcOutputPlaneData+1                , iOutputStride, 2 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VPS04_C_HAL );
     break;
   case 1:
     xDistributeArray( pcInputPlaneData-1, iInputStride  , 1, 1, iInputWidth+3, iHeight   , pcOutputPlaneData                -4, iOutputStride, 4 , 2 );
-    xInterpVerChroma( pcInputPlaneData-1, iInputStride  , 1, 1, iInputWidth+3, iHeight   , pcOutputPlaneData+1*iOutputStride-4, iOutputStride, 4 , 2, &TRenInterpFilter::xCTI_Filter_VPS04_C_HAL );
-    xInterpHorChroma( pcOutputPlaneData , iOutputStride , 4, 1, iInputWidth, iHeight*2 , pcOutputPlaneData                +1, iOutputStride, 4 , 1, &TRenInterpFilter::xCTI_Filter_VP04_C_QUA0 );
-    xInterpHorChroma( pcOutputPlaneData , iOutputStride , 4, 1, iInputWidth, iHeight*2 , pcOutputPlaneData                +2, iOutputStride, 4 , 1, &TRenInterpFilter::xCTI_Filter_VPS04_C_HAL );
-    xInterpHorChroma( pcOutputPlaneData , iOutputStride , 4, 1, iInputWidth, iHeight*2 , pcOutputPlaneData                +3, iOutputStride, 4 , 1, &TRenInterpFilter::xCTI_Filter_VP04_C_QUA1 );
+    xInterpVerChroma( pcInputPlaneData-1, iInputStride  , 1, 1, iInputWidth+3, iHeight   , pcOutputPlaneData+1*iOutputStride-4, iOutputStride, 4 , 2, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VPS04_C_HAL );
+    xInterpHorChroma( pcOutputPlaneData , iOutputStride , 4, 1, iInputWidth, iHeight*2 , pcOutputPlaneData                +1, iOutputStride, 4 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VP04_C_QUA0 );
+    xInterpHorChroma( pcOutputPlaneData , iOutputStride , 4, 1, iInputWidth, iHeight*2 , pcOutputPlaneData                +2, iOutputStride, 4 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VPS04_C_HAL );
+    xInterpHorChroma( pcOutputPlaneData , iOutputStride , 4, 1, iInputWidth, iHeight*2 , pcOutputPlaneData                +3, iOutputStride, 4 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VP04_C_QUA1 );
     break;
   case 2:
     xDistributeArray( pcInputPlaneData-1, iInputStride  , 1, 1, iInputWidth+3, iHeight   , pcOutputPlaneData                -8, iOutputStride, 8 , 2 );
-    xInterpVerChroma( pcInputPlaneData-1, iInputStride  , 1, 1, iInputWidth+3, iHeight   , pcOutputPlaneData+1*iOutputStride-8, iOutputStride, 8 , 2, &TRenInterpFilter::xCTI_Filter_VPS04_C_HAL );
-    xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth,   iHeight*2 , pcOutputPlaneData                +1, iOutputStride, 8 , 1, &TRenInterpFilter::xCTI_Filter_VP04_C_OCT0 );
-    xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth,   iHeight*2 , pcOutputPlaneData                +2, iOutputStride, 8 , 1, &TRenInterpFilter::xCTI_Filter_VP04_C_QUA0 );
-    xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth,   iHeight*2 , pcOutputPlaneData                +3, iOutputStride, 8 , 1, &TRenInterpFilter::xCTI_Filter_VP04_C_OCT1 );
-    xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth,   iHeight*2 , pcOutputPlaneData                +4, iOutputStride, 8 , 1, &TRenInterpFilter::xCTI_Filter_VPS04_C_HAL );
-    xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth,   iHeight*2 , pcOutputPlaneData                +5, iOutputStride, 8 , 1, &TRenInterpFilter::xCTI_Filter_VP04_C_OCT2 );
-    xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth,   iHeight*2 , pcOutputPlaneData                +6, iOutputStride, 8 , 1, &TRenInterpFilter::xCTI_Filter_VP04_C_QUA1 );
-    xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth,   iHeight*2 , pcOutputPlaneData                +7, iOutputStride, 8 , 1, &TRenInterpFilter::xCTI_Filter_VP04_C_OCT3 );
+    xInterpVerChroma( pcInputPlaneData-1, iInputStride  , 1, 1, iInputWidth+3, iHeight   , pcOutputPlaneData+1*iOutputStride-8, iOutputStride, 8 , 2, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VPS04_C_HAL );
+    xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth,   iHeight*2 , pcOutputPlaneData                +1, iOutputStride, 8 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VP04_C_OCT0 );
+    xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth,   iHeight*2 , pcOutputPlaneData                +2, iOutputStride, 8 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VP04_C_QUA0 );
+    xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth,   iHeight*2 , pcOutputPlaneData                +3, iOutputStride, 8 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VP04_C_OCT1 );
+    xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth,   iHeight*2 , pcOutputPlaneData                +4, iOutputStride, 8 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VPS04_C_HAL );
+    xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth,   iHeight*2 , pcOutputPlaneData                +5, iOutputStride, 8 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VP04_C_OCT2 );
+    xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth,   iHeight*2 , pcOutputPlaneData                +6, iOutputStride, 8 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VP04_C_QUA1 );
+    xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth,   iHeight*2 , pcOutputPlaneData                +7, iOutputStride, 8 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VP04_C_OCT3 );
     break;
   }
@@ -1171,5 +1183,6 @@
 // Down Sampling
 // Down sample luma
-Void TRenFilter::sampleHorDown(Int iLog2HorSampFac,  Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
+template<UInt bitDepth>
+Void TRenFilter<bitDepth>::sampleHorDown(Int iLog2HorSampFac,  Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
 {
   switch ( iLog2HorSampFac )
@@ -1187,6 +1200,6 @@
 }
 
-
-Void TRenFilter::sampleCHorDown(Int iLog2HorSampFac,  Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
+template<UInt bitDepth>
+Void TRenFilter<bitDepth>::sampleCHorDown(Int iLog2HorSampFac,  Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
 {
   //GT: currently the same as for luma
@@ -1197,5 +1210,6 @@
 
 // Up sampling chroma
-Void TRenFilter::sampleCDownHorDown( Int iLog2HorSampFac,  Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iInputHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
+template<UInt bitDepth>
+Void TRenFilter<bitDepth>::sampleCDownHorDown( Int iLog2HorSampFac,  Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iInputHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
 {
   // create buffer
@@ -1219,5 +1233,6 @@
 }
 
-Void TRenFilter::xDistributeArray(Pel* pcSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* pcDst, Int iDstStride, Int iDstStepX, Int iDstStepY)
+template<UInt bitDepth>
+Void TRenFilter<bitDepth>::xDistributeArray(const Pel* pcSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* pcDst, Int iDstStride, Int iDstStepX, Int iDstStepY)
 {
   iDstStride *= iDstStepY;
@@ -1226,5 +1241,5 @@
   {
     Pel* pcCurDst = pcDst;
-    Pel* pcCurSrc  = pcSrc;
+    const Pel* pcCurSrc  = pcSrc;
     for (Int iXPos = 0; iXPos < iWidth; iXPos ++)
     {
@@ -1239,11 +1254,11 @@
 }
 
-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 
+template<UInt bitDepth>
+Void TRenFilter<bitDepth>::xInterpHorChroma( Pel* piSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* piDst, Int iDstStride, Int iDstStepX, Int iDstStepY, FpChromaIntFilt fpFilter )
+{
   Int   iSum;
   Pel*  piSrcTmp;
 
-  TRenInterpFilter cFilter;
+  TRenInterpFilter<REN_BIT_DEPTH> cFilter;
   for ( Int y = iHeight; y != 0; y-- )
   {
@@ -1252,5 +1267,5 @@
     {
       iSum      = (cFilter.*fpFilter)( piSrcTmp,  iSrcStepX );
-      piDst[x * iDstStepX ] =  ClipC ((iSum +  32) >>  6 );
+      piDst[x * iDstStepX ] =  ClipBD ((iSum +  32) >>  6 , bitDepth);
       piSrcTmp+= iSrcStepX;
     }
@@ -1260,11 +1275,11 @@
 }
 
-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 
+template<UInt bitDepth>
+Void TRenFilter<bitDepth>::xInterpVerChroma( Pel* piSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* piDst, Int iDstStride, Int iDstStepX, Int iDstStepY, FpChromaIntFilt fpFilter )
+{  
   Int   iSum;
   Pel*  piSrcTmp;
 
-  TRenInterpFilter cFilter;
+  TRenInterpFilter<bitDepth> cFilter;
   for ( Int y = iHeight; y != 0; y-- )
   {
@@ -1273,5 +1288,5 @@
     {
       iSum      = (cFilter.*fpFilter)( piSrcTmp,  iSrcStepY * iSrcStride );
-      piDst[x * iDstStepX ]  =  ClipC ((iSum +  32) >>  6 );
+      piDst[x * iDstStepX ]  =  ClipBD ((iSum +  32) >>  6, bitDepth );
       piSrcTmp += iSrcStepX;
     }
@@ -1281,9 +1296,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 
+template<UInt bitDepth>
+Void TRenFilter<bitDepth>::xSampleDownHor2( Pel* piSrc, Int iSrcStride, Int iSrcWidth, Int iHeight, Pel* piDst, Int iDstStride  )
+{ 
 
   Int   iSum;
@@ -1298,5 +1311,5 @@
       // { 1,2,1 }
       iSum = piSrcTmp[0] + piSrcTmp[2] +  (piSrcTmp[1] << 1);
-      piDst[x] = ClipY( (iSum +  2) >>  2 );
+      piDst[x] = ClipBD( (iSum +  2) >>  2 , bitDepth);
       piSrcTmp += 2;
     }
@@ -1306,8 +1319,7 @@
 };
 
-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 
-
+template<UInt bitDepth>
+Void TRenFilter<bitDepth>::xSampleDownVer2( Pel* piSrc, Int iSrcStride, Int iSrcWidth, Int iSrcHeight, Pel* piDst, Int iDstStride  )
+{
   Int   iSum;
   Pel*  piSrcTmp;
@@ -1320,5 +1332,5 @@
       // { 1,2,1 }
       iSum = piSrcTmp[0] + piSrcTmp[ iSrcStride << 1] +  (piSrcTmp[ iSrcStride ] << 1);
-      piDst[x] = ClipY( (iSum +  2) >>  2 );
+      piDst[x] = ClipBD( (iSum +  2) >>  2, bitDepth );
       piSrcTmp += 1;
     }
@@ -1328,7 +1340,7 @@
 };
 
-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 
+template<UInt bitDepth>
+Void TRenFilter<bitDepth>::xSampleDownHor4( Pel* piSrc, Int iSrcStride, Int iSrcWidth, Int iHeight, Pel* piDst, Int iDstStride  )
+{ 
 
   Int   iSum;
@@ -1348,5 +1360,5 @@
 
       iSum = iTmp0 +  (iTmp2 << 1) + ((iTmp1 + iTmp2) << 2);
-      piDst[x] = ClipY( (iSum +  8) >>  4 );
+      piDst[x] = ClipBD( (iSum +  8) >>  4, bitDepth );
       piSrcTmp += 4;
     }
@@ -1356,8 +1368,7 @@
 };
 
-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 
-
+template<UInt bitDepth>
+Void TRenFilter<bitDepth>::xSampleDownHor8( Pel* piSrc, Int iSrcStride, Int iSrcWidth, Int iHeight, Pel* piDst, Int iDstStride  )
+{
   Int   iSum;
   Pel*  piSrcTmp;
@@ -1377,5 +1388,5 @@
 
       iSum = iTmp0 - iTmp2 + ( iTmp1  << 1) + ( (iTmp1 + iTmp3) << 2) + ((iTmp2 + iTmp3) << 4);
-      piDst[x] = ClipY( (iSum +  32) >>  6 );
+      piDst[x] = ClipBD( (iSum +  32) >>  6 , bitDepth);
       piSrcTmp += 8;
     }
@@ -1385,5 +1396,6 @@
 };
 
-Void TRenFilter::xDilate( Pel* piSrc, Int iSrcStride, Int iWidth, Int iHeight, Pel* piDst, Int iDstStride, Int iSize, Bool bVerticalDir, Bool bToTopOrLeft )
+template<UInt bitDepth>
+Void TRenFilter<bitDepth>::xDilate( Pel* piSrc, Int iSrcStride, Int iWidth, Int iHeight, Pel* piDst, Int iDstStride, Int iSize, Bool bVerticalDir, Bool bToTopOrLeft )
 {
   Int iFDimStart   = 0;
@@ -1452,11 +1464,13 @@
 
 
-template Bool TRenFilter::compare   (TRenImage<Pel     >*, TRenImage<Pel>*      );
-template Bool TRenFilter::compare   (TRenImagePlane<Pel>*, TRenImagePlane<Pel>* );
-
-template Void TRenFilter::mirrorHor(        TRenImage<Double>        *pcImage );
-template Void TRenFilter::mirrorHor(        TRenImage<Pel>           *pcImage );
-template Void TRenFilter::mirrorHor(        TRenImage<Int>           *pcImage );
-template Void TRenFilter::mirrorHor(        TRenImagePlane<Pel>      *pcImagePlane );
+template class TRenFilter<REN_BIT_DEPTH>;
+
+template Bool TRenFilter<REN_BIT_DEPTH>::compare   (TRenImage<Pel     >*, TRenImage<Pel>*      );
+template Bool TRenFilter<REN_BIT_DEPTH>::compare   (TRenImagePlane<Pel>*, TRenImagePlane<Pel>* );
+                         
+template Void TRenFilter<REN_BIT_DEPTH>::mirrorHor( TRenImage<Double>        *pcImage );
+template Void TRenFilter<REN_BIT_DEPTH>::mirrorHor( TRenImage<Pel>           *pcImage );
+template Void TRenFilter<REN_BIT_DEPTH>::mirrorHor( TRenImage<Int>           *pcImage );
+template Void TRenFilter<REN_BIT_DEPTH>::mirrorHor( TRenImagePlane<Pel>      *pcImagePlane );
 
 #endif 
Index: branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenFilter.h
===================================================================
--- branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenFilter.h	(revision 1199)
+++ branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenFilter.h	(revision 1200)
@@ -39,8 +39,9 @@
 #include "TRenImage.h"
 #include "TRenInterpFilter.h"
-#if H_3D
+#if NH_3D
 
-typedef Int (TRenInterpFilter::*FpChromaIntFilt) ( Pel*, Int );
+typedef Int (TRenInterpFilter<REN_BIT_DEPTH>::*FpChromaIntFilt) ( Pel*, Int );
 
+template<UInt bitDepthLuma>
 class TRenFilter
 {
@@ -53,5 +54,5 @@
 
   /////////// Copy ///////////
-  static Void copy( Pel* pcInputPlaneData, Int iInputStride, Int iWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride);
+  static Void copy( const Pel* pcInputPlaneData, Int iInputStride, Int iWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride);
 
   /////////// Horizontal Mirroring ///////////
@@ -129,5 +130,5 @@
   static Void xInterpVerChroma(Pel* piSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* piDst, Int iDstStride, Int iDstStepX, Int iDstStepY, FpChromaIntFilt fpFilter);
   static Void xInterpHorChroma(Pel* piSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* piDst, Int iDstStride, Int iDstStepX, Int iDstStepY, FpChromaIntFilt fpFilter);
-  static Void xDistributeArray(Pel* pcSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* pcDst, Int iDstStride, Int iDstStepX, Int iDstStepY );
+  static Void xDistributeArray(const Pel* pcSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* pcDst, Int iDstStride, Int iDstStepX, Int iDstStepY );
 
   // Binominal Filtering
Index: branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenImage.cpp
===================================================================
--- branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenImage.cpp	(revision 1199)
+++ branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenImage.cpp	(revision 1200)
@@ -37,10 +37,10 @@
 #include "TRenFilter.h"
 #include "assert.h"
-#if H_3D
+#if NH_3D
 
 
 template<typename T>
 TRenImage<T>::TRenImage( TRenImage& rcIn )
-{
+{  
   allocatePlanes( rcIn.getPlane(0)->getWidth(), rcIn.getPlane(0)->getHeight(), rcIn.getNumberOfFullPlanes(), rcIn.getNumberOfQuaterPlanes() ) ; assign(&rcIn);
 }
@@ -48,5 +48,5 @@
 template<typename T>
 TRenImage<T>::TRenImage( UInt uiWidth, UInt uiHeight, UInt uiNumberOfFullPlanes, UInt uiNumberOfQuaterPlanes )
-{
+{  
   allocatePlanes( uiWidth, uiHeight, uiNumberOfFullPlanes, uiNumberOfQuaterPlanes );
 }
@@ -55,5 +55,5 @@
 TRenImage<T>::TRenImage() : m_uiNumberOfFullPlanes(0), m_uiNumberOfQuaterPlanes(0), m_uiNumberOfPlanes(0), m_apcPlanes(0)
 {
-
+  
 }
 
@@ -61,5 +61,5 @@
 template<>
 TRenImage<Pel>::TRenImage( TComPicYuv* pcPicYuv, Bool bFirstPlaneOnly )
-{
+{ 
   if (bFirstPlaneOnly) //400
   {
@@ -68,5 +68,5 @@
     m_uiNumberOfQuaterPlanes = 0;
     m_apcPlanes    = new TRenImagePlane<Pel>*[ m_uiNumberOfPlanes ];
-    m_apcPlanes[0] = new TRenImagePlane<Pel>( pcPicYuv->getBufY(), pcPicYuv->getWidth() + (REN_LUMA_MARGIN << 1),   pcPicYuv->getHeight()+ (REN_LUMA_MARGIN << 1), pcPicYuv->getStride (), REN_LUMA_MARGIN );
+    m_apcPlanes[0] = new TRenImagePlane<Pel>( pcPicYuv->getBuf( COMPONENT_Y ), pcPicYuv->getWidth( COMPONENT_Y  ) + (REN_LUMA_MARGIN << 1),   pcPicYuv->getHeight( COMPONENT_Y  ) + (REN_LUMA_MARGIN << 1), pcPicYuv->getStride( COMPONENT_Y ), REN_LUMA_MARGIN );
   }
   else //420
@@ -77,7 +77,7 @@
 
     m_apcPlanes    = new TRenImagePlane<Pel>*[ m_uiNumberOfPlanes ];
-    m_apcPlanes[0] = new TRenImagePlane<Pel>( pcPicYuv->getBufY(),   pcPicYuv->getWidth()     + (REN_LUMA_MARGIN << 1),  pcPicYuv->getHeight()      + (REN_LUMA_MARGIN << 1), pcPicYuv->getStride (), REN_LUMA_MARGIN );
-    m_apcPlanes[1] = new TRenImagePlane<Pel>( pcPicYuv->getBufU(),   (pcPicYuv->getWidth()>>1)+  REN_LUMA_MARGIN      ,  (pcPicYuv->getHeight()>>1) +  REN_LUMA_MARGIN      , pcPicYuv->getCStride(), REN_LUMA_MARGIN >> 1 );
-    m_apcPlanes[2] = new TRenImagePlane<Pel>( pcPicYuv->getBufV(),   (pcPicYuv->getWidth()>>1)+  REN_LUMA_MARGIN      ,  (pcPicYuv->getHeight()>>1) +  REN_LUMA_MARGIN      , pcPicYuv->getCStride(), REN_LUMA_MARGIN >> 1 );
+    m_apcPlanes[0] = new TRenImagePlane<Pel>( pcPicYuv->getBuf( COMPONENT_Y  ), pcPicYuv->getWidth( COMPONENT_Y  ) + (REN_LUMA_MARGIN << 1),  pcPicYuv->getHeight( COMPONENT_Y  ) + (REN_LUMA_MARGIN << 1), pcPicYuv->getStride( COMPONENT_Y ), REN_LUMA_MARGIN );
+    m_apcPlanes[1] = new TRenImagePlane<Pel>( pcPicYuv->getBuf( COMPONENT_Cb ), pcPicYuv->getWidth( COMPONENT_Cb ) +  REN_LUMA_MARGIN      ,  pcPicYuv->getHeight( COMPONENT_Cb ) +  REN_LUMA_MARGIN      , pcPicYuv->getStride( COMPONENT_Cb), REN_LUMA_MARGIN >> 1 );
+    m_apcPlanes[2] = new TRenImagePlane<Pel>( pcPicYuv->getBuf( COMPONENT_Cr ), pcPicYuv->getWidth( COMPONENT_Cr ) +  REN_LUMA_MARGIN      ,  pcPicYuv->getHeight( COMPONENT_Cr ) +  REN_LUMA_MARGIN      , pcPicYuv->getStride( COMPONENT_Cr), REN_LUMA_MARGIN >> 1 );
   }
 }
@@ -109,5 +109,5 @@
 
 template<typename T>
-Void TRenImage<T>::getDataAndStrides( T** pptData, Int* piStrides )
+Void TRenImage<T>::getDataAndStrides( T** pptData, Int* piStrides ) const
 {
   for (UInt uiCurPlane = 0; uiCurPlane < m_uiNumberOfPlanes; uiCurPlane++ )
@@ -120,5 +120,5 @@
 
 template<typename T>
-Void TRenImage<T>::getWidthAndHeight( Int* ppiWidths, Int* ppiHeights )
+Void TRenImage<T>::getWidthAndHeight( Int* ppiWidths, Int* ppiHeights ) const
 {
   for (UInt uiCurPlane = 0; uiCurPlane < m_uiNumberOfPlanes; uiCurPlane++ )
@@ -233,11 +233,12 @@
   for (UInt uiCurPlane = 1; uiCurPlane < m_uiNumberOfPlanes; uiCurPlane++)
   {
-    m_apcPlanes[uiCurPlane]->assign( (Pel) ( 1 << ( g_bitDepthC - 1 ) ) );
-  }
-}
-
-
-template<class T>
-TRenImage<T>::~TRenImage() {
+    m_apcPlanes[uiCurPlane]->assign( (Pel) ( 1 << ( REN_BIT_DEPTH - 1 ) ) );
+  }
+}
+
+
+template<class T>
+TRenImage<T>::~TRenImage()
+{
   xDeletePlanes();
   delete[] m_apcPlanes;
@@ -272,3 +273,3 @@
 template Void TRenImage<Pel>::assign<Pel>    (TRenImage<Pel>*   );
 
-#endif // H_3D
+#endif // NH_3D
Index: branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenImage.h
===================================================================
--- branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenImage.h	(revision 1199)
+++ branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenImage.h	(revision 1200)
@@ -39,5 +39,5 @@
 #include "../TLibCommon/TComPicYuv.h"
 #include "TRenImagePlane.h"
-#if H_3D
+#if NH_3D
 
 
@@ -70,13 +70,13 @@
   TRenImagePlane<T>** getPlanes() const;
 
-  Void getDataAndStrides( T**    pptData, Int*  piStrides );
-  Void getWidthAndHeight( Int*  piWidths, Int*  piHeights );
+  Void getDataAndStrides ( T**    pptData, Int*  piStrides ) const ;
+  Void getWidthAndHeight ( Int*  piWidths, Int*  piHeights ) const ;
 
   UInt getNumberOfPlanes()  const;
   UInt getNumberOfQuaterPlanes() const;
   UInt getNumberOfFullPlanes() const;
-  Bool is420() {return m_uiNumberOfFullPlanes == 1 && m_uiNumberOfQuaterPlanes == 2; };
-  Bool is444() {return m_uiNumberOfFullPlanes == 3 && m_uiNumberOfQuaterPlanes == 0; };
-  Bool is400() {return m_uiNumberOfFullPlanes == 1 && m_uiNumberOfQuaterPlanes == 0; };
+  Bool is420() const {return m_uiNumberOfFullPlanes == 1 && m_uiNumberOfQuaterPlanes == 2; };
+  Bool is444() const {return m_uiNumberOfFullPlanes == 3 && m_uiNumberOfQuaterPlanes == 0; };
+  Bool is400() const {return m_uiNumberOfFullPlanes == 1 && m_uiNumberOfQuaterPlanes == 0; };
 
   // Assign
@@ -95,4 +95,5 @@
   UInt m_uiNumberOfQuaterPlanes;
   UInt m_uiNumberOfPlanes;
+  UInt m_bitDepth;
   TRenImagePlane<T> ** m_apcPlanes;   // First Full Planes, then Quater Planes
 
@@ -100,5 +101,5 @@
 };
 
-#endif // H_3D
+#endif // NH_3D
 #endif // __TRENIMAGE__
 
Index: branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenImagePlane.cpp
===================================================================
--- branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenImagePlane.cpp	(revision 1199)
+++ branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenImagePlane.cpp	(revision 1200)
@@ -36,5 +36,5 @@
 #include "TRenFilter.h"
 #include <string.h>
-#if H_3D
+#if NH_3D
 
 /////// TRenImagePlane ///////
@@ -528,4 +528,4 @@
 template class TRenImagePlanePart<Bool>;
 template class TRenImagePlanePart<Int>;
-#endif // H_3D
-
+#endif // NH_3D
+
Index: branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenImagePlane.h
===================================================================
--- branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenImagePlane.h	(revision 1199)
+++ branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenImagePlane.h	(revision 1200)
@@ -39,5 +39,5 @@
 #include "../TLibCommon/TComPicYuv.h"
 
-#if H_3D
+#if NH_3D
 #define PelImagePlane     TRenImagePlane<Pel>
 #define DoubleImagePlane  TRenImagePlane<Double>
@@ -122,4 +122,4 @@
 };
 
-#endif // H_3D
+#endif // NH_3D
 #endif // __TRENIMAGEPLANE__
Index: branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenInterpFilter.cpp
===================================================================
--- branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenInterpFilter.cpp	(revision 1199)
+++ branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenInterpFilter.cpp	(revision 1200)
@@ -39,5 +39,5 @@
 
 #include "TRenInterpFilter.h"
-#if H_3D
+#if NH_3D
 
 // ====================================================================================================================
@@ -45,9 +45,11 @@
 // ====================================================================================================================
 
-TRenInterpFilter::TRenInterpFilter()
+template<UInt bitDepthLuma>
+TRenInterpFilter<bitDepthLuma>::TRenInterpFilter()
 {
   // initial number of taps for Luma
 }
 
-#endif // H_3D
+template class TRenInterpFilter<REN_BIT_DEPTH>;
+#endif // NH_3D
 
Index: branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenInterpFilter.h
===================================================================
--- branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenInterpFilter.h	(revision 1199)
+++ branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenInterpFilter.h	(revision 1200)
@@ -44,5 +44,5 @@
 #include "TLibCommon/CommonDef.h"
 #include "assert.h"
-#if H_3D
+#if NH_3D
 
 // ====================================================================================================================
@@ -60,4 +60,5 @@
 
 /// interpolation filter class
+template<UInt bitDepth>
 class TRenInterpFilter
 {
@@ -104,4 +105,7 @@
    __inline Int xCTI_Filter_VP04_C_OCT3( Pel* pSrc, Int iStride );
    __inline Int xCTI_Filter_VI04_C_OCT3( Int* pSrc, Int iStride );
+private:
+  __inline Int xClipY( Pel x ) { return std::min<Pel>(Pel((1 << bitDepth)-1), std::max<Pel>( Pel(0), x)); } 
+  __inline Int xClipC( Pel x ) { return std::min<Pel>(Pel((1 << bitDepth)-1), std::max<Pel>( Pel(0), x)); }
 
 };
@@ -111,9 +115,7 @@
 // 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 
-
+template<UInt bitDepth>
+__inline Void TRenInterpFilter<bitDepth>::xCTI_FilterHalfHor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
+{
   Pel*  piDst    = rpiDst;
   Int   iSum;
@@ -146,5 +148,5 @@
             -    iTmp0 -  iTmp2;
 
-      piDst   [x * iDstStep] = ClipY( (iSum +  32) >>  6 );
+      piDst   [x * iDstStep] = xClipY( (iSum +  32) >>  6 );
       piSrcTmp += iSrcStep;
     }
@@ -155,8 +157,7 @@
 }
 
-__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 
-
+template<UInt bitDepth>
+__inline Void TRenInterpFilter<bitDepth>::xCTI_FilterHalfHor(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
+{
   Pel*  piDst    = rpiDst;
   Int   iSum;
@@ -189,5 +190,5 @@
             -    iTmp0 -  iTmp2;
       
-      piDst   [x * iDstStep] = ClipY( (iSum +  2048) >>  12 );
+      piDst   [x * iDstStep] = xClipY( (iSum +  2048) >>  12 );
       piSrcTmp += iSrcStep;
     }
@@ -198,7 +199,7 @@
 }
 
-__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 
+template<UInt bitDepth>
+__inline Void TRenInterpFilter<bitDepth>::xCTI_FilterQuarter0Hor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
+{  
   Pel*  piDst    = rpiDst;
   Int   iSum;
@@ -229,5 +230,5 @@
              + (   piSrcTmp[iSrcStep4]           << 4 );
       
-      piDst   [x * iDstStep] = ClipY(( (iSum +  32) >>  6 )+ piSrcTmp[iSrcStep3]);
+      piDst   [x * iDstStep] = xClipY(( (iSum +  32) >>  6 )+ piSrcTmp[iSrcStep3]);
       piSrcTmp += iSrcStep;
     }
@@ -238,8 +239,7 @@
 }
 
-__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 
-
+template<UInt bitDepth>
+__inline Void TRenInterpFilter<bitDepth>::xCTI_FilterQuarter0Hor(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
+{
   Pel*  piDst    = rpiDst;
   Int   iSum;
@@ -271,5 +271,5 @@
             + (   piSrcTmp[iSrcStep3]           << 6 );
       
-      piDst   [x * iDstStep] = ClipY( (iSum +  2048) >>  12 );
+      piDst   [x * iDstStep] = xClipY( (iSum +  2048) >>  12 );
       piSrcTmp += iSrcStep;
     }
@@ -280,7 +280,7 @@
 }
 
-__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 
+template<UInt bitDepth>
+__inline Void TRenInterpFilter<bitDepth>::xCTI_FilterQuarter1Hor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
+{
   Pel*  piDst    = rpiDst;
   Int   iSum;
@@ -310,5 +310,5 @@
             + (   piSrcTmp[iSrcStep3]           << 4 );
       
-      piDst   [x * iDstStep] = ClipY( ((iSum +  32) >>  6) + piSrcTmp[iSrcStep4] );
+      piDst   [x * iDstStep] = xClipY( ((iSum +  32) >>  6) + piSrcTmp[iSrcStep4] );
       piSrcTmp += iSrcStep;
     }
@@ -319,8 +319,7 @@
 }
 
-__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 
-
+template<UInt bitDepth>
+__inline Void TRenInterpFilter<bitDepth>::xCTI_FilterQuarter1Hor(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
+{
   Pel*  piDst    = rpiDst;
   Int   iSum;
@@ -351,5 +350,5 @@
             + (   piSrcTmp[iSrcStep4]           << 6 );
       
-      piDst   [x * iDstStep] = ClipY( (iSum +  2048) >>  12 );
+      piDst   [x * iDstStep] = xClipY( (iSum +  2048) >>  12 );
       piSrcTmp += iSrcStep;
     }
@@ -360,7 +359,7 @@
 }
 
-__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 
+template<UInt bitDepth>
+__inline Void TRenInterpFilter<bitDepth>::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;
@@ -394,5 +393,5 @@
       
       piDst[x * iDstStep]    = iSum;
-      piDstPel[x * iDstStep] = ClipY( (iSum +  32) >>  6 );
+      piDstPel[x * iDstStep] = xClipY( (iSum +  32) >>  6 );
       piSrcTmp += iSrcStep;
     }
@@ -404,5 +403,6 @@
 }
 
-__inline Void TRenInterpFilter::xCTI_FilterHalfVer (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst)
+template<UInt bitDepth>
+__inline Void TRenInterpFilter<bitDepth>::xCTI_FilterHalfVer (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst)
 {
   Int*  piDst = rpiDst;
@@ -444,7 +444,7 @@
 }
 
-__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 
+template<UInt bitDepth>
+__inline Void TRenInterpFilter<bitDepth>::xCTI_FilterHalfVer (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
+{
   Pel*  piDst = rpiDst;
   Int   iSum;
@@ -477,5 +477,5 @@
             -    iTmp0 -  iTmp2;        
       
-      piDst[x * iDstStep] = ClipY( (iSum +  32) >>  6 );
+      piDst[x * iDstStep] = xClipY( (iSum +  32) >>  6 );
       piSrcTmp += iSrcStep;
     }
@@ -486,5 +486,6 @@
 }
 
-__inline Void TRenInterpFilter::xCTI_FilterQuarter0Ver (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst)
+template<UInt bitDepth>
+__inline Void TRenInterpFilter<bitDepth>::xCTI_FilterQuarter0Ver (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst)
 {
   Int*  piDst = rpiDst;
@@ -525,7 +526,7 @@
 }
 
-__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 
+template<UInt bitDepth>
+__inline Void TRenInterpFilter<bitDepth>::xCTI_FilterQuarter0Ver (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
+{
   Pel*  piDst = rpiDst;
   Int   iSum;
@@ -556,5 +557,5 @@
             + (   piSrcTmp[iSrcStride4]           << 4 );
       
-      piDst[x * iDstStep] = ClipY( ((iSum +  32) >>  6) + piSrcTmp[iSrcStride3] );
+      piDst[x * iDstStep] = xClipY( ((iSum +  32) >>  6) + piSrcTmp[iSrcStride3] );
       piSrcTmp += iSrcStep;
     }
@@ -565,5 +566,6 @@
 }
 
-__inline Void TRenInterpFilter::xCTI_FilterQuarter1Ver (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst)
+template<UInt bitDepth>
+__inline Void TRenInterpFilter<bitDepth>::xCTI_FilterQuarter1Ver (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst)
 {
   Int*  piDst = rpiDst;
@@ -604,8 +606,7 @@
 }
 
-__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 
-
+template<UInt bitDepth>
+__inline Void TRenInterpFilter<bitDepth>::xCTI_FilterQuarter1Ver (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
+{
   Pel*  piDst = rpiDst;
   Int   iSum;
@@ -635,5 +636,5 @@
             + (   piSrcTmp[iSrcStride3]           << 4 );
             
-      piDst[x * iDstStep] = ClipY( ((iSum +  32) >>  6) +  piSrcTmp[iSrcStride4] );
+      piDst[x * iDstStep] = xClipY( ((iSum +  32) >>  6) +  piSrcTmp[iSrcStride4] );
       piSrcTmp += iSrcStep;
     }
@@ -647,5 +648,6 @@
 // DCTIF filters for Chroma
 // ------------------------------------------------------------------------------------------------
-__inline Void TRenInterpFilter::xCTI_Filter2DVerC (Pel* piSrc, Int iSrcStride,  Int iWidth, Int iHeight, Int iDstStride,  Int*& rpiDst, Int iMV)
+template<UInt bitDepth>
+__inline Void TRenInterpFilter<bitDepth>::xCTI_Filter2DVerC (Pel* piSrc, Int iSrcStride,  Int iWidth, Int iHeight, Int iDstStride,  Int*& rpiDst, Int iMV)
 {
   Int*  piDst = rpiDst;
@@ -774,7 +776,7 @@
 }
 
-__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 
+template<UInt bitDepth>
+__inline Void TRenInterpFilter<bitDepth>::xCTI_Filter2DHorC(Int* piSrc, Int iSrcStride,  Int iWidth, Int iHeight, Int iDstStride,  Pel*& rpiDst, Int iMV)
+{
   Pel*  piDst    = rpiDst;
   Int   iSum;
@@ -791,5 +793,5 @@
         {
           iSum         = xCTI_Filter_VI04_C_OCT0( piSrcTmp, 1 );
-          piDst   [x ] = ClipC ((iSum +  2048) >>  12 );
+          piDst   [x ] = xClipC ((iSum +  2048) >>  12 );
           piSrcTmp++;
         }
@@ -807,5 +809,5 @@
         {
           iSum         = xCTI_Filter_VI04_C_QUA0( piSrcTmp, 1 );
-          piDst   [x ] = ClipC ((iSum +  2048) >>  12 );
+          piDst   [x ] = xClipC ((iSum +  2048) >>  12 );
           piSrcTmp++;
         }
@@ -823,5 +825,5 @@
         {
           iSum         = xCTI_Filter_VI04_C_QUA1( piSrcTmp, 1 );
-          piDst   [x ] = ClipC ((iSum +  2048) >>  12 );
+          piDst   [x ] = xClipC ((iSum +  2048) >>  12 );
           piSrcTmp++;
         }
@@ -839,5 +841,5 @@
         {
           iSum         = xCTI_Filter_VI04_C_OCT1( piSrcTmp, 1 );
-          piDst   [x ] = ClipC ((iSum +  2048) >>  12 );
+          piDst   [x ] = xClipC ((iSum +  2048) >>  12 );
           piSrcTmp++;
         }
@@ -855,5 +857,5 @@
         {
           iSum         = xCTI_Filter_VI04_C_OCT2( piSrcTmp, 1 );
-          piDst   [x ] = ClipC ((iSum +  2048) >>  12 );
+          piDst   [x ] = xClipC ((iSum +  2048) >>  12 );
           piSrcTmp++;
         }
@@ -871,5 +873,5 @@
         {
           iSum         = xCTI_Filter_VI04_C_OCT3( piSrcTmp, 1 );
-          piDst   [x ] = ClipC ((iSum +  2048) >>  12 );
+          piDst   [x ] = xClipC ((iSum +  2048) >>  12 );
           piSrcTmp++;
         }
@@ -887,5 +889,5 @@
         {
           iSum      = xCTI_Filter_VIS04_C_HAL( piSrcTmp, 1 );
-          piDst   [x ] = ClipC ((iSum +  2048) >>  12 );
+          piDst   [x ] = xClipC ((iSum +  2048) >>  12 );
           piSrcTmp++;
         }
@@ -902,8 +904,7 @@
 }
 
-__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 
-
+template<UInt bitDepth>
+__inline Void TRenInterpFilter<bitDepth>::xCTI_Filter1DVerC (Pel* piSrc, Int iSrcStride, Int iWidth, Int iHeight, Int iDstStride,  Pel*& rpiDst, Int iMV)
+{
   Pel*  piDst = rpiDst;
   Int   iSum;
@@ -920,5 +921,5 @@
         {
           iSum      = xCTI_Filter_VP04_C_OCT0( piSrcTmp,  iSrcStride );
-          piDst[x ] = ClipC ((iSum +  32) >>  6 );
+          piDst[x ] = xClipC ((iSum +  32) >>  6 );
           piSrcTmp++;
         }
@@ -936,5 +937,5 @@
         {
           iSum      = xCTI_Filter_VP04_C_QUA0( piSrcTmp,  iSrcStride );
-          piDst[x ] = ClipC ((iSum +  32) >>  6 );
+          piDst[x ] = xClipC ((iSum +  32) >>  6 );
           piSrcTmp++;
         }
@@ -952,5 +953,5 @@
         {
           iSum      = xCTI_Filter_VP04_C_QUA1( piSrcTmp,  iSrcStride );
-          piDst[x ] = ClipC ((iSum +  32) >>  6 );
+          piDst[x ] = xClipC ((iSum +  32) >>  6 );
           piSrcTmp++;
         }
@@ -968,5 +969,5 @@
         {
           iSum      = xCTI_Filter_VP04_C_OCT1( piSrcTmp,  iSrcStride );
-          piDst[x ] = ClipC ((iSum +  32) >>  6 );
+          piDst[x ] = xClipC ((iSum +  32) >>  6 );
           piSrcTmp++;
         }
@@ -984,5 +985,5 @@
         {
           iSum      = xCTI_Filter_VP04_C_OCT2( piSrcTmp,  iSrcStride );
-          piDst[x ] = ClipC ((iSum +  32) >>  6 );
+          piDst[x ] = xClipC ((iSum +  32) >>  6 );
           piSrcTmp++;
         }
@@ -1000,5 +1001,5 @@
         {
           iSum      = xCTI_Filter_VP04_C_OCT3( piSrcTmp,  iSrcStride );
-          piDst[x ] = ClipC ((iSum +  32) >>  6 );
+          piDst[x ] = xClipC ((iSum +  32) >>  6 );
           piSrcTmp++;
         }
@@ -1016,5 +1017,5 @@
         {
           iSum      = xCTI_Filter_VPS04_C_HAL( piSrcTmp, iSrcStride );
-          piDst[x ] = ClipC ((iSum +  32) >>  6 );
+          piDst[x ] = xClipC ((iSum +  32) >>  6 );
           piSrcTmp++;
         }
@@ -1030,5 +1031,6 @@
 }
 
-__inline Void TRenInterpFilter::xCTI_Filter1DHorC(Pel* piSrc, Int iSrcStride, Int iWidth, Int iHeight, Int iDstStride, Pel*& rpiDst, Int iMV)
+template<UInt bitDepth>
+__inline Void TRenInterpFilter<bitDepth>::xCTI_Filter1DHorC(Pel* piSrc, Int iSrcStride, Int iWidth, Int iHeight, Int iDstStride, Pel*& rpiDst, Int iMV)
 {
   Pel*  piDst    = rpiDst;
@@ -1046,5 +1048,5 @@
         {
           iSum         = xCTI_Filter_VP04_C_OCT0( piSrcTmp,  1 );
-          piDst[x ] = ClipC ((iSum +  32) >>  6 );
+          piDst[x ] = xClipC ((iSum +  32) >>  6 );
           piSrcTmp++;
         }
@@ -1062,5 +1064,5 @@
         {
           iSum         = xCTI_Filter_VP04_C_QUA0( piSrcTmp,  1 );
-          piDst[x ] = ClipC ((iSum +  32) >>  6 );
+          piDst[x ] = xClipC ((iSum +  32) >>  6 );
           piSrcTmp++;
         }
@@ -1078,5 +1080,5 @@
         {
           iSum         = xCTI_Filter_VP04_C_QUA1( piSrcTmp,  1 );
-          piDst[x ] = ClipC ((iSum +  32) >>  6 );
+          piDst[x ] = xClipC ((iSum +  32) >>  6 );
           piSrcTmp++;
         }
@@ -1094,5 +1096,5 @@
         {
           iSum         = xCTI_Filter_VP04_C_OCT1( piSrcTmp,  1 );
-          piDst[x ] = ClipC ((iSum +  32) >>  6 );
+          piDst[x ] = xClipC ((iSum +  32) >>  6 );
           piSrcTmp++;
         }
@@ -1110,5 +1112,5 @@
         {
           iSum         = xCTI_Filter_VP04_C_OCT2( piSrcTmp,  1 );
-          piDst[x ] = ClipC ((iSum +  32) >>  6 );
+          piDst[x ] = xClipC ((iSum +  32) >>  6 );
           piSrcTmp++;
         }
@@ -1126,5 +1128,5 @@
         {
           iSum         = xCTI_Filter_VP04_C_OCT3( piSrcTmp,  1 );
-          piDst[x ] = ClipC ((iSum +  32) >>  6 );
+          piDst[x ] = xClipC ((iSum +  32) >>  6 );
           piSrcTmp++;
         }
@@ -1142,5 +1144,5 @@
         {
           iSum         = xCTI_Filter_VPS04_C_HAL( piSrcTmp,  1 );
-          piDst[x ] = ClipC ((iSum +  32) >>  6 );
+          piDst[x ] = xClipC ((iSum +  32) >>  6 );
           piSrcTmp++;
         }
@@ -1156,5 +1158,6 @@
 }
 
-__inline Int TRenInterpFilter::xCTI_Filter_VP04_C_OCT0( Pel* pSrc,  Int iStride )
+template<UInt bitDepth>
+__inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VP04_C_OCT0( Pel* pSrc,  Int iStride )
 {// {  -3,  60,   8,   -1,} // 1/8
   Int iSum, iIdx = 0;
@@ -1168,5 +1171,6 @@
   return iSum;
 }
-__inline Int TRenInterpFilter::xCTI_Filter_VI04_C_OCT0( Int* pSrc, Int iStride )
+template<UInt bitDepth>
+__inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VI04_C_OCT0( Int* pSrc, Int iStride )
 { // {  -3,  60,   8,   -1,} //1/8
   Int iSum, iIdx = 0;
@@ -1180,5 +1184,6 @@
   return iSum;
 }
-__inline Int TRenInterpFilter::xCTI_Filter_VP04_C_QUA0( Pel* pSrc,  Int iStride )
+template<UInt bitDepth>
+__inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VP04_C_QUA0( Pel* pSrc,  Int iStride )
 {// {  -4,  54,  16,   -2,} // 1/4
   Int iSum, iIdx = 0;
@@ -1192,5 +1197,7 @@
   return iSum;
 }
-__inline Int TRenInterpFilter::xCTI_Filter_VI04_C_QUA0( Int* pSrc, Int iStride )
+
+template<UInt bitDepth>
+__inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VI04_C_QUA0( Int* pSrc, Int iStride )
 { // {  -4,  54,  16,   -2,} //1/4
   Int iSum, iIdx = 0;
@@ -1204,5 +1211,6 @@
   return iSum;
 }
-__inline Int TRenInterpFilter::xCTI_Filter_VP04_C_QUA1( Pel* pSrc,  Int iStride )
+template<UInt bitDepth>
+__inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VP04_C_QUA1( Pel* pSrc,  Int iStride )
 {// {  -2,  16,  54,   -4,}// 3/4
   Int iSum, iIdx = 0;
@@ -1216,5 +1224,7 @@
   return iSum;
 }
-__inline Int TRenInterpFilter::xCTI_Filter_VI04_C_QUA1( Int* pSrc, Int iStride )
+
+template<UInt bitDepth>
+__inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VI04_C_QUA1( Int* pSrc, Int iStride )
 {// {  -2,  16,  54,   -4,}// 3/4
   Int iSum, iIdx = 0;
@@ -1228,5 +1238,7 @@
   return iSum;
 }
-__inline Int TRenInterpFilter::xCTI_Filter_VP04_C_OCT1( Pel* pSrc,  Int iStride )
+
+template<UInt bitDepth>
+__inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VP04_C_OCT1( Pel* pSrc,  Int iStride )
 {// {  -5,  46,  27,   -4,} // 3/8
   Int iSum, iIdx = 0;
@@ -1241,5 +1253,7 @@
   return iSum;
 }
-__inline Int TRenInterpFilter::xCTI_Filter_VI04_C_OCT1( Int* pSrc, Int iStride )
+
+template<UInt bitDepth>
+__inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VI04_C_OCT1( Int* pSrc, Int iStride )
 { // {  -5,  46,  27,   -4,} //3/8
   Int iSum, iIdx = 0;
@@ -1254,5 +1268,7 @@
   return iSum;
 }
-__inline Int TRenInterpFilter::xCTI_Filter_VPS04_C_HAL( Pel* pSrc, Int iStride )
+
+template<UInt bitDepth>
+__inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VPS04_C_HAL( Pel* pSrc, Int iStride )
 {
   // {  -4,  36,  36,   -4,}, // 1/2
@@ -1265,5 +1281,7 @@
   return iSum;
 }
-__inline Int TRenInterpFilter::xCTI_Filter_VIS04_C_HAL( Int* pSrc, Int iStride )
+
+template<UInt bitDepth>
+__inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VIS04_C_HAL( Int* pSrc, Int iStride )
 {
   // {  -4,  36,  36,   -4,}, //1/2
@@ -1276,5 +1294,7 @@
   return iSum;
 }
-__inline Int TRenInterpFilter::xCTI_Filter_VP04_C_OCT2( Pel* pSrc,  Int iStride )
+
+template<UInt bitDepth>
+__inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VP04_C_OCT2( Pel* pSrc,  Int iStride )
 {// {  -4,  27,  46,   -5,}, // 5/8
   Int iSum, iIdx = 0;
@@ -1289,5 +1309,7 @@
   return iSum;
 }
-__inline Int TRenInterpFilter::xCTI_Filter_VI04_C_OCT2( Int* pSrc, Int iStride )
+
+template<UInt bitDepth>
+__inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VI04_C_OCT2( Int* pSrc, Int iStride )
 { // {  -4,  27,  46,   -5,}, // 5/8
   Int iSum, iIdx = 0;
@@ -1302,5 +1324,7 @@
   return iSum;
 }
-__inline Int TRenInterpFilter::xCTI_Filter_VP04_C_OCT3( Pel* pSrc,  Int iStride )
+
+template<UInt bitDepth>
+__inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VP04_C_OCT3( Pel* pSrc,  Int iStride )
 {// {  -1,   8,  60,   -3,} // 7/8
   Int iSum, iIdx = 0;
@@ -1314,5 +1338,7 @@
   return iSum;
 }
-__inline Int TRenInterpFilter::xCTI_Filter_VI04_C_OCT3( Int* pSrc, Int iStride )
+
+template<UInt bitDepth>
+__inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VI04_C_OCT3( Int* pSrc, Int iStride )
 { // {  -1,   8,  60,   -3,} // 7/8
   Int iSum, iIdx = 0;
@@ -1326,4 +1352,5 @@
   return iSum;
 }
-#endif // H_3D
+
+#endif // NH_3D
 #endif // __TRENINTERP__
Index: branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenModSetupStrParser.cpp
===================================================================
--- branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenModSetupStrParser.cpp	(revision 1199)
+++ branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenModSetupStrParser.cpp	(revision 1200)
@@ -37,5 +37,5 @@
 #include "TRenModSetupStrParser.h"
 
-#if H_3D
+#if NH_3D
 Int
 TRenModSetupStrParser::getNumOfModels()
@@ -451,4 +451,4 @@
   rcNextChar = m_pchSetStr[iPos];
 }
-#endif // H_3D
-
+#endif // NH_3D
+
Index: branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenModSetupStrParser.h
===================================================================
--- branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenModSetupStrParser.h	(revision 1199)
+++ branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenModSetupStrParser.h	(revision 1200)
@@ -39,5 +39,5 @@
 #include "../TLibCommon/TypeDef.h"
 #include "../TAppCommon/TAppComCamPara.h"
-#if H_3D
+#if NH_3D
 
 
@@ -128,5 +128,5 @@
 };
 
-#endif // H_3D
+#endif // NH_3D
 #endif //__TRENMODEL__
 
Index: branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenModel.cpp
===================================================================
--- branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenModel.cpp	(revision 1199)
+++ branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenModel.cpp	(revision 1200)
@@ -36,5 +36,5 @@
 #include "TRenModel.h"
 
-#if H_3D_VSO
+#if NH_3D_VSO
 ///////////  TRENMODEL //////////////////////
 TRenModel::TRenModel()
@@ -242,6 +242,6 @@
   }
 
-  TRenFilter::setSubPelShiftLUT( m_iShiftPrec, m_aaaiSubPelShiftLut[0], 0 );
-  TRenFilter::setSubPelShiftLUT( m_iShiftPrec, m_aaaiSubPelShiftLut[1], 0 );
+  TRenFilter<REN_BIT_DEPTH>::setSubPelShiftLUT( m_iShiftPrec, m_aaaiSubPelShiftLut[0], 0 );
+  TRenFilter<REN_BIT_DEPTH>::setSubPelShiftLUT( m_iShiftPrec, m_aaaiSubPelShiftLut[1], 0 );
 
   m_iSampledWidth       = iWidth << m_iShiftPrec;
@@ -357,8 +357,7 @@
   AOT( iBaseViewNum != -1 && iBaseViewNum != iLeftViewNum && iBaseViewNum != iRightViewNum );
   AOT( iContent      < -1 || iContent > 1 );
-  AOT( iBlendMode < -1 || iBlendMode > 2 );
-  AOT( g_bitDepthY  != g_bitDepthC ); 
-
-  Bool bBitInc = ( DISTORTION_PRECISION_ADJUSTMENT( g_bitDepthY - 8 ) != 0);
+  AOT( iBlendMode < -1 || iBlendMode > 2 );  
+
+  Bool bBitInc = ( REN_BIT_DEPTH != ENC_INTERNAL_BIT_DEPTH );
 
   AOT( m_apcRenModels[iModelNum] );
@@ -437,13 +436,15 @@
 {
   AOT( iViewNum < 0 || iViewNum > m_iNumOfBaseViews );
-  AOF( pcPicYuvVideoData->getHeight() >= m_iUsedHeight + m_uiHorOff && pcPicYuvVideoData->getWidth() == m_iWidth );
-  AOF( pcPicYuvDepthData->getHeight() >= m_iUsedHeight + m_uiHorOff && pcPicYuvDepthData->getWidth() == m_iWidth );
-
+  AOF( pcPicYuvVideoData->getHeight( COMPONENT_Y ) >= m_iUsedHeight + m_uiHorOff && pcPicYuvVideoData->getWidth( COMPONENT_Y ) == m_iWidth );
+  AOF( pcPicYuvDepthData->getHeight( COMPONENT_Y ) >= m_iUsedHeight + m_uiHorOff && pcPicYuvDepthData->getWidth( COMPONENT_Y ) == m_iWidth );
+  
+  AOF( pcPicYuvVideoData   ->getChromaFormat() == CHROMA_420 );
+  
   pcPicYuvVideoData->extendPicBorder();
 
-  TRenFilter::sampleHorUp   ( m_iShiftPrec, pcPicYuvVideoData->getLumaAddr() +  m_uiHorOff        * pcPicYuvVideoData->getStride () , pcPicYuvVideoData->getStride() , m_iWidth,      m_iUsedHeight,      m_aapiCurVideoPel[ iViewNum ][0], m_aaiCurVideoStrides[iViewNum][0] );
-  TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvVideoData->getCbAddr()   + (m_uiHorOff >> 1 ) * pcPicYuvVideoData->getCStride() , pcPicYuvVideoData->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiCurVideoPel[ iViewNum ][1], m_aaiCurVideoStrides[iViewNum][1] );
-  TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvVideoData->getCrAddr()   + (m_uiHorOff >> 1 ) * pcPicYuvVideoData->getCStride() , pcPicYuvVideoData->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiCurVideoPel[ iViewNum ][2], m_aaiCurVideoStrides[iViewNum][2] );
-  TRenFilter::copy          (               pcPicYuvDepthData->getLumaAddr() +  m_uiHorOff        * pcPicYuvDepthData->getStride () , pcPicYuvDepthData->getStride(),  m_iWidth,      m_iUsedHeight,      m_apiCurDepthPel [ iViewNum],     m_aiCurDepthStrides [iViewNum]    );
+  TRenFilter<REN_BIT_DEPTH>::sampleHorUp   ( m_iShiftPrec, pcPicYuvVideoData->getAddr( COMPONENT_Y  ) +  m_uiHorOff        * pcPicYuvVideoData->getStride( COMPONENT_Y ) , pcPicYuvVideoData->getStride( COMPONENT_Y  ) , m_iWidth,      m_iUsedHeight,      m_aapiCurVideoPel[ iViewNum ][0], m_aaiCurVideoStrides[iViewNum][0] );
+  TRenFilter<REN_BIT_DEPTH>::sampleCUpHorUp( m_iShiftPrec, pcPicYuvVideoData->getAddr( COMPONENT_Cb ) + (m_uiHorOff >> 1 ) * pcPicYuvVideoData->getStride( COMPONENT_Cb) , pcPicYuvVideoData->getStride( COMPONENT_Cb ), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiCurVideoPel[ iViewNum ][1], m_aaiCurVideoStrides[iViewNum][1] );
+  TRenFilter<REN_BIT_DEPTH>::sampleCUpHorUp( m_iShiftPrec, pcPicYuvVideoData->getAddr( COMPONENT_Cr ) + (m_uiHorOff >> 1 ) * pcPicYuvVideoData->getStride( COMPONENT_Cr) , pcPicYuvVideoData->getStride( COMPONENT_Cr ), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiCurVideoPel[ iViewNum ][2], m_aaiCurVideoStrides[iViewNum][2] );
+  TRenFilter<REN_BIT_DEPTH>::copy          (               pcPicYuvDepthData->getAddr( COMPONENT_Y  ) +  m_uiHorOff        * pcPicYuvDepthData->getStride( COMPONENT_Y ) , pcPicYuvDepthData->getStride( COMPONENT_Y  ),  m_iWidth,      m_iUsedHeight,      m_apiCurDepthPel [ iViewNum],     m_aiCurDepthStrides [iViewNum]    );
 
   // Used for rendering reference pic from original video data
@@ -453,15 +454,16 @@
   if ( m_abSetupVideoFromOrgForView[iViewNum] )
   {
-    AOF( pcPicYuvOrgVideoData->getHeight() >= m_iUsedHeight + m_uiHorOff && pcPicYuvOrgVideoData->getWidth() == m_iWidth );
+    AOF( pcPicYuvOrgVideoData->getChromaFormat() == CHROMA_420 );
+    AOF( pcPicYuvOrgVideoData->getHeight( COMPONENT_Y ) >= m_iUsedHeight + m_uiHorOff && pcPicYuvOrgVideoData->getWidth( COMPONENT_Y) == m_iWidth );    
     pcPicYuvOrgVideoData->extendPicBorder();
-    TRenFilter::sampleHorUp   ( m_iShiftPrec, pcPicYuvOrgVideoData->getLumaAddr() +  m_uiHorOff        * pcPicYuvOrgVideoData->getStride() , pcPicYuvOrgVideoData->getStride() , m_iWidth,      m_iUsedHeight,      m_aapiOrgVideoPel[ iViewNum ][0], m_aaiOrgVideoStrides[iViewNum][0] );
-    TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvOrgVideoData->getCbAddr()   + (m_uiHorOff >> 1 ) * pcPicYuvOrgVideoData->getCStride(), pcPicYuvOrgVideoData->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiOrgVideoPel[ iViewNum ][1], m_aaiOrgVideoStrides[iViewNum][1] );
-    TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvOrgVideoData->getCrAddr()   + (m_uiHorOff >> 1 ) * pcPicYuvOrgVideoData->getCStride(), pcPicYuvOrgVideoData->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiOrgVideoPel[ iViewNum ][2], m_aaiOrgVideoStrides[iViewNum][2] );
+    TRenFilter<REN_BIT_DEPTH>::sampleHorUp   ( m_iShiftPrec, pcPicYuvOrgVideoData->getAddr( COMPONENT_Y  ) +  m_uiHorOff          * pcPicYuvOrgVideoData->getStride( COMPONENT_Y  ), pcPicYuvOrgVideoData->getStride( COMPONENT_Y  ) , m_iWidth,      m_iUsedHeight,      m_aapiOrgVideoPel[ iViewNum ][0], m_aaiOrgVideoStrides[iViewNum][0] );
+    TRenFilter<REN_BIT_DEPTH>::sampleCUpHorUp( m_iShiftPrec, pcPicYuvOrgVideoData->getAddr( COMPONENT_Cb )   + (m_uiHorOff >> 1 ) * pcPicYuvOrgVideoData->getStride( COMPONENT_Cb ), pcPicYuvOrgVideoData->getStride( COMPONENT_Cb ), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiOrgVideoPel[ iViewNum ][1], m_aaiOrgVideoStrides[iViewNum][1] );
+    TRenFilter<REN_BIT_DEPTH>::sampleCUpHorUp( m_iShiftPrec, pcPicYuvOrgVideoData->getAddr( COMPONENT_Cr )   + (m_uiHorOff >> 1 ) * pcPicYuvOrgVideoData->getStride( COMPONENT_Cr ), pcPicYuvOrgVideoData->getStride( COMPONENT_Cr ), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiOrgVideoPel[ iViewNum ][2], m_aaiOrgVideoStrides[iViewNum][2] );
   }
 
   if ( m_abSetupDepthFromOrgForView[iViewNum] )
-  {
-    AOF( pcPicYuvOrgDepthData->getHeight() >= m_iUsedHeight + m_uiHorOff && pcPicYuvOrgDepthData->getWidth() == m_iWidth );
-    TRenFilter::copy          (               pcPicYuvOrgDepthData->getLumaAddr() +  m_uiHorOff        * pcPicYuvOrgDepthData->getStride() , pcPicYuvOrgDepthData->getStride(),  m_iWidth,     m_iUsedHeight,      m_apiOrgDepthPel [ iViewNum],     m_aiOrgDepthStrides [iViewNum]    );
+  {    
+    AOF( pcPicYuvOrgDepthData->getHeight( COMPONENT_Y ) >= m_iUsedHeight + m_uiHorOff && pcPicYuvOrgDepthData->getWidth( COMPONENT_Y ) == m_iWidth );
+    TRenFilter<REN_BIT_DEPTH>::copy          (               pcPicYuvOrgDepthData->getAddr( COMPONENT_Y ) +  m_uiHorOff        * pcPicYuvOrgDepthData->getStride( COMPONENT_Y) , pcPicYuvOrgDepthData->getStride( COMPONENT_Y),  m_iWidth,     m_iUsedHeight,      m_apiOrgDepthPel [ iViewNum],     m_aiOrgDepthStrides [iViewNum]    );
   }
 }
@@ -592,5 +594,5 @@
 
 Void
-TRenModel::setData( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData )
+TRenModel::setData( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData )
 {
   iStartPosY -= m_uiHorOff; 
@@ -625,5 +627,5 @@
   {
     Int iTargetStride = m_aiCurDepthStrides[ m_iCurrentView ];
-    TRenFilter::copy( piNewData, iStride, iWidth, iHeight,  m_apiCurDepthPel[ m_iCurrentView ] + iStartPosY * iTargetStride + iStartPosX, iTargetStride );
+    TRenFilter<REN_BIT_DEPTH>::copy( piNewData, iStride, iWidth, iHeight,  m_apiCurDepthPel[ m_iCurrentView ] + iStartPosY * iTargetStride + iStartPosX, iTargetStride );
   }
 #endif
@@ -646,8 +648,8 @@
 {
   TComPicYuv cPicYuvSynth;
-  cPicYuvSynth.create( m_iWidth, m_iUsedHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth );
+  cPicYuvSynth.create( m_iWidth, m_iUsedHeight, CHROMA_420, 1, 1, 1, true);
 
   TComPicYuv cPicYuvTempRef;
-  cPicYuvTempRef.create( m_iWidth, m_iUsedHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth);
+  cPicYuvTempRef.create( m_iWidth, m_iUsedHeight, CHROMA_420, 1, 1, 1, true);
 
   Int64 iSSEY = 0;
@@ -660,7 +662,7 @@
     m_apcCurRenModels[iCurModel]->getRefVideo  ( m_aiCurPosInModels[iCurModel], &cPicYuvTempRef   );
 
-    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 );
+    iSSEY += TRenFilter<REN_BIT_DEPTH>::SSE( cPicYuvSynth.getAddr(  COMPONENT_Y ), cPicYuvSynth.getStride( COMPONENT_Y  ),  m_iWidth,      m_iUsedHeight    , cPicYuvTempRef.getAddr( COMPONENT_Y  ), cPicYuvTempRef.getStride( COMPONENT_Y  ), true  );
+    iSSEU += TRenFilter<REN_BIT_DEPTH>::SSE( cPicYuvSynth.getAddr( COMPONENT_Cb ), cPicYuvSynth.getStride( COMPONENT_Cb ), m_iWidth >> 1, m_iUsedHeight >> 1, cPicYuvTempRef.getAddr( COMPONENT_Cb ), cPicYuvTempRef.getStride( COMPONENT_Cb ), false );
+    iSSEV += TRenFilter<REN_BIT_DEPTH>::SSE( cPicYuvSynth.getAddr( COMPONENT_Cr ), cPicYuvSynth.getStride( COMPONENT_Cr ), m_iWidth >> 1, m_iUsedHeight >> 1, cPicYuvTempRef.getAddr( COMPONENT_Cr ), cPicYuvTempRef.getStride( COMPONENT_Cr ), false );
   }
 
@@ -699,3 +701,3 @@
   }
 }
-#endif // H_3D
+#endif // NH_3D
Index: branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenModel.h
===================================================================
--- branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenModel.h	(revision 1199)
+++ branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenModel.h	(revision 1200)
@@ -42,5 +42,5 @@
 #include "../TLibCommon/TypeDef.h"
 
-#if H_3D_VSO
+#if NH_3D_VSO
 
 class TRenModel
@@ -75,5 +75,5 @@
   Int64 getDist          ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData  );
 #endif
-  Void  setData          ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData  );
+  Void  setData          ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData  );
 
   // Get Rendered View
@@ -157,5 +157,5 @@
 };
 
-#endif // H_3D
+#endif // NH_3D
 #endif //__TRENMODEL__
 
Index: branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenSingleModel.cpp
===================================================================
--- branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenSingleModel.cpp	(revision 1199)
+++ branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenSingleModel.cpp	(revision 1200)
@@ -36,10 +36,10 @@
 #include "TRenSingleModel.h"
 
-#if H_3D_VSO
+#if NH_3D_VSO
 
 ////////////// TRENSINGLE MODEL ///////////////
 template <BlenMod iBM, Bool bBitInc>
 TRenSingleModelC<iBM,bBitInc>::TRenSingleModelC()
-:  m_iDistShift ( ( g_bitDepthY - 8) << 1 )
+:  m_iDistShift ( ( ENC_INTERNAL_BIT_DEPTH  - REN_BIT_DEPTH) << 1 )
 {
   m_iWidth  = -1;
@@ -259,7 +259,9 @@
   if ( pcOrgVideo && !bKeepReference )
   {
-    TRenFilter::copy(             pcOrgVideo->getLumaAddr() +  m_iHorOffset       * pcOrgVideo->getStride() , pcOrgVideo->getStride() , m_iWidth,      m_iUsedHeight,      m_aapiRefVideoPel[0], m_aiRefVideoStrides[0]);
-    TRenFilter::sampleCUpHorUp(0, pcOrgVideo->getCbAddr()   + (m_iHorOffset >> 1) * pcOrgVideo->getCStride(), pcOrgVideo->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiRefVideoPel[1], m_aiRefVideoStrides[1]);
-    TRenFilter::sampleCUpHorUp(0, pcOrgVideo->getCrAddr()   + (m_iHorOffset >> 1) * pcOrgVideo->getCStride(), pcOrgVideo->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiRefVideoPel[2], m_aiRefVideoStrides[2]);    
+    assert( pcOrgVideo->getChromaFormat() != CHROMA_420 );     
+
+    TRenFilter<REN_BIT_DEPTH>::copy(             pcOrgVideo->getAddr( COMPONENT_Y  ) +  m_iHorOffset       * pcOrgVideo->getStride( COMPONENT_Y  ), pcOrgVideo->getStride( COMPONENT_Y  ), m_iWidth,      m_iUsedHeight,      m_aapiRefVideoPel[0], m_aiRefVideoStrides[0]);
+    TRenFilter<REN_BIT_DEPTH>::sampleCUpHorUp(0, pcOrgVideo->getAddr( COMPONENT_Cb ) + (m_iHorOffset >> 1) * pcOrgVideo->getStride( COMPONENT_Cb ), pcOrgVideo->getStride( COMPONENT_Cb ), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiRefVideoPel[1], m_aiRefVideoStrides[1]);
+    TRenFilter<REN_BIT_DEPTH>::sampleCUpHorUp(0, pcOrgVideo->getAddr( COMPONENT_Cr ) + (m_iHorOffset >> 1) * pcOrgVideo->getStride( COMPONENT_Cr ), pcOrgVideo->getStride( COMPONENT_Cr ), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiRefVideoPel[2], m_aiRefVideoStrides[2]);    
     xSetStructRefView();
   }
@@ -285,5 +287,5 @@
     break;
   case 2:
-    TRenFilter::setupZLUT( true, 30, iDistToLeft, ppiBaseShiftLutLeft, ppiBaseShiftLutRight, m_iBlendZThres, m_iBlendDistWeight, m_piInvZLUTLeft, m_piInvZLUTRight );
+    TRenFilter<REN_BIT_DEPTH>::setupZLUT( true, 30, iDistToLeft, ppiBaseShiftLutLeft, ppiBaseShiftLutRight, m_iBlendZThres, m_iBlendDistWeight, m_piInvZLUTLeft, m_piInvZLUTRight );
 #if H_3D_VSO_EARLY_SKIP
     xRenderL<true>( 0, 0, m_iWidth, m_iUsedHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0],false);
@@ -452,12 +454,12 @@
 #if H_3D_VSO_COLOR_PLANES             
       // U Planes                    
-      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        = 1 << (g_bitDepthC - 1);
-      pcOutSampleRow[iPosX].iVRight       = 1 << (g_bitDepthC - 1);
-      pcOutSampleRow[iPosX].iVBlended     = 1 << (g_bitDepthC - 1);
+      pcOutSampleRow[iPosX].iULeft        = 1 << (REN_BIT_DEPTH  - 1);
+      pcOutSampleRow[iPosX].iURight       = 1 << (REN_BIT_DEPTH  - 1);
+      pcOutSampleRow[iPosX].iUBlended     = 1 << (REN_BIT_DEPTH  - 1);
+                                                  
+      // V Planes                                  
+      pcOutSampleRow[iPosX].iVLeft        = 1 << (REN_BIT_DEPTH  - 1);
+      pcOutSampleRow[iPosX].iVRight       = 1 << (REN_BIT_DEPTH  - 1);
+      pcOutSampleRow[iPosX].iVBlended     = 1 << (REN_BIT_DEPTH  - 1);
 #endif
       //// Input Samples
@@ -475,8 +477,8 @@
 #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 )
+TRenSingleModelC<iBM,bBitInc>::getDistDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData , const Pel * piOrgData, Int iOrgStride )
 #else
 template <BlenMod iBM, Bool bBitInc> RMDist
-TRenSingleModelC<iBM,bBitInc>::getDistDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData )
+TRenSingleModelC<iBM,bBitInc>::getDistDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData )
 #endif
 {
@@ -517,8 +519,8 @@
 #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 )
+TRenSingleModelC<iBM,bBitInc>::setDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel* piOrgData, Int iOrgStride )
 #else
 template <BlenMod iBM, Bool bBitInc> Void
-TRenSingleModelC<iBM,bBitInc>::setDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData )
+TRenSingleModelC<iBM,bBitInc>::setDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData )
 #endif
 {
@@ -558,6 +560,8 @@
 TRenSingleModelC<iBM,bBitInc>::getSynthVideo( Int iViewPos, TComPicYuv* pcPicYuv )
 {  
-  AOT( pcPicYuv->getWidth() != m_iWidth );
-  AOT( pcPicYuv->getHeight() < m_iUsedHeight + m_iHorOffset );
+  AOT( pcPicYuv->getWidth( COMPONENT_Y  )  != m_iWidth );
+  AOT( pcPicYuv->getChromaFormat()         != CHROMA_420 ); 
+
+  AOT( pcPicYuv->getHeight( COMPONENT_Y ) < m_iUsedHeight + m_iHorOffset );
 
 #if H_3D_VSO_COLOR_PLANES
@@ -590,11 +594,12 @@
 {  
   AOT( iViewPos != 0 && iViewPos != 1); 
-  AOT( pcPicYuv->getWidth()  != m_iWidth  );
-  AOT( pcPicYuv->getHeight() < m_iUsedHeight + m_iHorOffset );
+  AOT( pcPicYuv->getWidth( COMPONENT_Y)  != m_iWidth  );
+  AOT( pcPicYuv->getChromaFormat( )  != CHROMA_420 );
+  AOT( pcPicYuv->getHeight( COMPONENT_Y ) < m_iUsedHeight + m_iHorOffset );
 
   Pel RenModelOutPels::* piD = 0;
   xGetSampleStrDepthPtrs(iViewPos, piD); 
-  xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, piD, pcPicYuv->getLumaAddr() + pcPicYuv->getStride() * m_iHorOffset, pcPicYuv->getStride(), m_iWidth, m_iUsedHeight );
-  pcPicYuv->setChromaTo( 1 << (g_bitDepthC - 1) );   
+  xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, piD, pcPicYuv->getAddr( COMPONENT_Y ) + pcPicYuv->getStride( COMPONENT_Y ) * m_iHorOffset, pcPicYuv->getStride( COMPONENT_Y ), m_iWidth, m_iUsedHeight );
+  pcPicYuv->setChromaTo( 1 << (REN_BIT_DEPTH - 1) );   
 }
 
@@ -603,6 +608,7 @@
 TRenSingleModelC<iBM,bBitInc>::getRefVideo ( Int iViewPos, TComPicYuv* pcPicYuv )
 {  
-  AOT( pcPicYuv->getWidth()  != m_iWidth  );
-  AOT( pcPicYuv->getHeight() <  m_iUsedHeight + m_iHorOffset);
+  AOT( pcPicYuv->getChromaFormat( ) != CHROMA_420 );
+  AOT( pcPicYuv->getWidth( COMPONENT_Y )  != m_iWidth  );
+  AOT( pcPicYuv->getHeight( COMPONENT_Y ) <  m_iUsedHeight + m_iHorOffset);
 
 #if H_3D_VSO_COLOR_PLANES
@@ -633,5 +639,5 @@
 
 template <BlenMod iBM, Bool bBitInc> RMDist
-TRenSingleModelC<iBM,bBitInc>::getDistVideo( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData )
+TRenSingleModelC<iBM,bBitInc>::getDistVideo( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData )
 {
   AOF(false);
@@ -640,5 +646,5 @@
 
 template <BlenMod iBM, Bool bBitInc> Void
-TRenSingleModelC<iBM,bBitInc>::setVideo( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData )
+TRenSingleModelC<iBM,bBitInc>::setVideo( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData )
 {
   AOF(false);
@@ -665,8 +671,8 @@
 #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)
+TRenSingleModelC<iBM,bBitInc>::xRenderL( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, Bool bFast)
 #else
 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)
+TRenSingleModelC<iBM,bBitInc>::xRenderL( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData)
 #endif
 {
@@ -789,8 +795,8 @@
 #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)
+TRenSingleModelC<iBM,bBitInc>::xRenderR( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData , Bool bFast)
 #else
 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 )
+TRenSingleModelC<iBM,bBitInc>::xRenderR( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData )
 #endif
 {
@@ -1877,7 +1883,7 @@
 TRenSingleModelC<iBM,bBitInc>::xCopy2PicYuv( Pel** ppiSrcVideoPel, Int* piStrides, TComPicYuv* rpcPicYuvTarget )
 {
-  TRenFilter::copy            ( ppiSrcVideoPel[0], piStrides[0], m_iWidth, m_iUsedHeight, rpcPicYuvTarget->getLumaAddr() +  m_iHorOffset       * rpcPicYuvTarget->getStride() , rpcPicYuvTarget->getStride () );
-  TRenFilter::sampleDown2Tap13( ppiSrcVideoPel[1], piStrides[1], m_iWidth, m_iUsedHeight, rpcPicYuvTarget->getCbAddr  () + (m_iHorOffset >> 1) * rpcPicYuvTarget->getCStride(), rpcPicYuvTarget->getCStride() );
-  TRenFilter::sampleDown2Tap13( ppiSrcVideoPel[2], piStrides[2], m_iWidth, m_iUsedHeight, rpcPicYuvTarget->getCrAddr  () + (m_iHorOffset >> 1) * rpcPicYuvTarget->getCStride(), rpcPicYuvTarget->getCStride() );
+  TRenFilter<REN_BIT_DEPTH>::copy            ( ppiSrcVideoPel[0], piStrides[0], m_iWidth, m_iUsedHeight, rpcPicYuvTarget->getAddr( COMPONENT_Y  ) +  m_iHorOffset       * rpcPicYuvTarget->getStride( COMPONENT_Y  ), rpcPicYuvTarget->getStride( COMPONENT_Y ) );
+  TRenFilter<REN_BIT_DEPTH>::sampleDown2Tap13( ppiSrcVideoPel[1], piStrides[1], m_iWidth, m_iUsedHeight, rpcPicYuvTarget->getAddr( COMPONENT_Cb ) + (m_iHorOffset >> 1) * rpcPicYuvTarget->getStride( COMPONENT_Cb ), rpcPicYuvTarget->getStride( COMPONENT_Cb) );
+  TRenFilter<REN_BIT_DEPTH>::sampleDown2Tap13( ppiSrcVideoPel[2], piStrides[2], m_iWidth, m_iUsedHeight, rpcPicYuvTarget->getAddr( COMPONENT_Cr ) + (m_iHorOffset >> 1) * rpcPicYuvTarget->getStride( COMPONENT_Cr ), rpcPicYuvTarget->getStride( COMPONENT_Cr) );
 }
 
@@ -1895,5 +1901,5 @@
 template <BlenMod iBM, Bool bBitInc> 
 __inline Bool
-TRenSingleModelC<iBM,bBitInc>::xDetectEarlySkipL( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData,Pel* piOrgData, Int iOrgStride)
+TRenSingleModelC<iBM,bBitInc>::xDetectEarlySkipL( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel* piOrgData, Int iOrgStride)
 {
   RM_AOF( m_bEarlySkip ); 
@@ -1927,5 +1933,5 @@
 template <BlenMod iBM, Bool bBitInc> 
 __inline Bool
-TRenSingleModelC<iBM,bBitInc>::xDetectEarlySkipR( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData,Pel* piOrgData, Int iOrgStride)
+TRenSingleModelC<iBM,bBitInc>::xDetectEarlySkipR( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel* piOrgData, Int iOrgStride)
 {
   RM_AOF( m_bEarlySkip ); 
@@ -1958,4 +1964,4 @@
 }
 #endif
-#endif // H_3D
-
+#endif // NH_3D
+
Index: branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenSingleModel.h
===================================================================
--- branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenSingleModel.h	(revision 1199)
+++ branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenSingleModel.h	(revision 1200)
@@ -51,5 +51,5 @@
 #include <cstring>
 
-#if H_3D_VSO
+#if NH_3D_VSO
 using namespace std;
 
@@ -82,17 +82,17 @@
   // Set Data
 #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
-  virtual Void   setDepth  ( Int iViewPos,                 Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData )  = 0;
-#endif
-  virtual Void   setVideo  ( Int iViewPos,     Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) = 0;
+  virtual Void   setDepth  ( Int iViewPos,                 Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel* piOrgData, Int iOrgStride )  = 0;
+#else
+  virtual Void   setDepth  ( Int iViewPos,                 Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData )  = 0;
+#endif
+  virtual Void   setVideo  ( Int iViewPos,     Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ) = 0;
 
   // Get Distortion
 #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
-  virtual RMDist getDistDepth  ( Int iViewPos,             Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) = 0;
-#endif
-  virtual RMDist getDistVideo  ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) = 0;
+  virtual RMDist getDistDepth  ( Int iViewPos,             Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel * piOrgData , Int iOrgStride)=0;
+#else
+  virtual RMDist getDistDepth  ( Int iViewPos,             Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ) = 0;
+#endif
+  virtual RMDist getDistVideo  ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ) = 0;
 
   virtual Void   getSynthVideo  ( Int iViewPos, TComPicYuv* pcPicYuv ) = 0;  
@@ -172,17 +172,17 @@
 
 #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
-  Void   setDepth  ( Int iViewPos,                 Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData );
-#endif
-  Void   setVideo  ( Int iViewPos,     Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData );
-
-  // Get Distortion
-#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
-  RMDist getDistDepth  ( Int iViewPos,             Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData );
-#endif
-  RMDist getDistVideo  ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData );
+  Void   setDepth  ( Int iViewPos,                 Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel* piOrgData, Int iOrgStride );
+#else                                                                                                                    
+  Void   setDepth  ( Int iViewPos,                 Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData );
+#endif                                                                                                                   
+  Void   setVideo  ( Int iViewPos,     Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData );
+                                                                                                                         
+  // Get Distortion                                                                                                      
+#if H_3D_VSO_EARLY_SKIP                                                                                                  
+  RMDist getDistDepth  ( Int iViewPos,             Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel * piOrgData , Int iOrgStride);
+#else                                                                                                                    
+  RMDist getDistDepth  ( Int iViewPos,             Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData );
+#endif                                                                                                                   
+  RMDist getDistVideo  ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData );
 
   Void   getSynthVideo  ( Int iViewPos, TComPicYuv* pcPicYuv );  
@@ -198,11 +198,11 @@
   // Left to Right
 #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 );
-  template<Bool bSet> __inline RMDist xRenderL            ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Bool bFast );
-  template<Bool bSet> __inline RMDist xRenderR            ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Bool bFast );
-#else
-  template<Bool bSet> __inline RMDist xRenderR            ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData );
-  template<Bool bSet> __inline RMDist xRenderL            ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData );
+                      __inline Bool   xDetectEarlySkipL   ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel* piOrgData, Int iOrgStride );
+                      __inline Bool   xDetectEarlySkipR   ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel* piOrgData, Int iOrgStride );
+  template<Bool bSet> __inline RMDist xRenderL            ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, Bool bFast );
+  template<Bool bSet> __inline RMDist xRenderR            ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, Bool bFast );
+#else
+  template<Bool bSet> __inline RMDist xRenderR            ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData );
+  template<Bool bSet> __inline RMDist xRenderL            ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData );
 #endif
                       __inline Void   xInitRenderPartL    ( Int iEndChangePos, Int iLastSPos  );
@@ -353,5 +353,5 @@
   Int   m_iCurViewPos;                 // Current View Position 0: Left, 1: Right
   Int   m_iOtherViewPos;               // Other View Position 0: Left, 1: Right
-  Pel*  m_piNewDepthData;              // Pointer to new depth data
+  const Pel*  m_piNewDepthData;              // Pointer to new depth data
   Int   m_iStartChangePosX;            // Start Position of new data
   Int   m_iNewDataWidth;               // Width of new data
@@ -389,5 +389,5 @@
 };
 
-#endif // H_3D
+#endif // NH_3D
 #endif //__TRENSINGLEMODEL__
 
Index: branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenTop.cpp
===================================================================
--- branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenTop.cpp	(revision 1199)
+++ branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenTop.cpp	(revision 1200)
@@ -40,5 +40,5 @@
 #include <math.h>
 #include "../TLibCommon/CommonDef.h"
-#if H_3D
+#if NH_3D
 
 
@@ -114,5 +114,5 @@
     if (uiPlane == 0)
     {
-      TRenFilter::sampleHorUp    ( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
+      TRenFilter<REN_BIT_DEPTH>::sampleHorUp    ( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
     }
     else
@@ -120,9 +120,9 @@
       if ( m_bUVUp )
       {
-        TRenFilter::sampleCUpHorUp( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
+        TRenFilter<REN_BIT_DEPTH>::sampleCUpHorUp( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
       }
       else
       {
-        TRenFilter::sampleCHorUp   ( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
+        TRenFilter<REN_BIT_DEPTH>::sampleCHorUp   ( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
       }
     }
@@ -147,5 +147,5 @@
   AOT( iLog2SamplingFactor > 2);
 
-  TRenFilter::sampleHorUp(iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
+  TRenFilter<REN_BIT_DEPTH>::sampleHorUp(iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
 
   if ( !m_bUVUp ) //GT: depth down
@@ -154,14 +154,14 @@
     PelImagePlane* pcTempPlane = new PelImagePlane(pcOrgInputImage->getPlane(0)->getWidth(), ( pcOrgInputImage->getPlane(0)->getHeight() >> 1), REN_LUMA_MARGIN );
 
-    TRenFilter::sampleVerDown2Tap13(pcOrgInputImage->getPlane(0), pcTempPlane, PICYUV_PAD);
+    TRenFilter<REN_BIT_DEPTH>::sampleVerDown2Tap13(pcOrgInputImage->getPlane(0), pcTempPlane, PICYUV_PAD);
     pcConvPlane = pcConvInputImage->getPlane(1);
 
     if ( iLog2SamplingFactor == 0 )
     {
-      TRenFilter::sampleHorDown2Tap13(pcTempPlane, pcConvPlane, 0 );
+      TRenFilter<REN_BIT_DEPTH>::sampleHorDown2Tap13(pcTempPlane, pcConvPlane, 0 );
     }
     else
     {
-      TRenFilter::sampleHorUp    ( iLog2SamplingFactor - 1, pcTempPlane->getPlaneData(), pcTempPlane->getStride(), pcTempPlane->getWidth(), pcTempPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
+      TRenFilter<REN_BIT_DEPTH>::sampleHorUp    ( iLog2SamplingFactor - 1, pcTempPlane->getPlaneData(), pcTempPlane->getStride(), pcTempPlane->getWidth(), pcTempPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
     }
     delete pcTempPlane;
@@ -175,10 +175,10 @@
   {
     m_pcTempImage->assign( pcOrgInputImage );
-    TRenFilter::mirrorHor( m_pcTempImage );
+    TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcTempImage );
     m_pcTempImage->extendMargin();
     xConvertInputVideo(    m_pcTempImage, pcConvInputImage );
 
     m_pcTempImage->getPlane(0)->assign( pcOrgInputDepth->getPlane(0) );
-    TRenFilter::mirrorHor( m_pcTempImage->getPlane(0) );
+    TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcTempImage->getPlane(0) );
     m_pcTempImage->getPlane(0)->extendMargin();
     xConvertInputDepth( m_pcTempImage, pcConvInputDepth );
@@ -209,5 +209,5 @@
     if ( uiPlane == 0 )
     {
-      TRenFilter::sampleHorDown( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
+      TRenFilter<REN_BIT_DEPTH>::sampleHorDown( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
     }
     else
@@ -215,9 +215,9 @@
       if ( m_bUVUp )
       {
-        TRenFilter::sampleCDownHorDown( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
+        TRenFilter<REN_BIT_DEPTH>::sampleCDownHorDown( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
       }
       else
       {
-        TRenFilter::sampleCHorDown    ( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
+        TRenFilter<REN_BIT_DEPTH>::sampleCHorDown    ( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
       }
     }
@@ -226,5 +226,5 @@
   if ( bMirror )
   {
-    TRenFilter::mirrorHor( pcConvOutputImage );
+    TRenFilter<REN_BIT_DEPTH>::mirrorHor( pcConvOutputImage );
   }
 
@@ -253,5 +253,5 @@
   if ( !m_bExtrapolate )
   {
-    TRenFilter::setupZLUT( m_bBlendUseDistWeight, m_iBlendZThresPerc, iRelDistToLeft, ppiBaseShiftLUTLeft, ppiBaseShiftLUTRight, m_iBlendZThres, m_iBlendDistWeight, m_piInvZLUTLeft, m_piInvZLUTRight);
+    TRenFilter<REN_BIT_DEPTH>::setupZLUT( m_bBlendUseDistWeight, m_iBlendZThresPerc, iRelDistToLeft, ppiBaseShiftLUTLeft, ppiBaseShiftLUTRight, m_iBlendZThres, m_iBlendDistWeight, m_piInvZLUTLeft, m_piInvZLUTRight);
   }
 }
@@ -261,6 +261,6 @@
   AOF( m_bExtrapolate );
   AOF( bRenderFromLeft ? m_ppiShiftLUTLeft || m_ppdShiftLUTLeft : m_ppiShiftLUTRight || m_ppdShiftLUTRight );
-  AOF( m_auiInputResolution[0] == pcPicYuvVideo->getWidth ());
-  AOF( m_auiInputResolution[1] == pcPicYuvVideo->getHeight());
+  AOF( m_auiInputResolution[0] == pcPicYuvVideo->getWidth ( COMPONENT_Y ));
+  AOF( m_auiInputResolution[1] == pcPicYuvVideo->getHeight( COMPONENT_Y ));
 
   PelImage cInputImage ( pcPicYuvVideo    );
@@ -284,6 +284,6 @@
 {
   AOF( bRenderFromLeft ? m_ppiShiftLUTLeft && m_ppdShiftLUTLeft : m_ppiShiftLUTRight && m_ppdShiftLUTRight );
-  AOF(m_auiInputResolution[0] == pcPicYuvDepth->getWidth ());
-  AOF(m_auiInputResolution[1] == pcPicYuvDepth->getHeight());
+  AOF(m_auiInputResolution[0] == pcPicYuvDepth->getWidth (COMPONENT_Y));
+  AOF(m_auiInputResolution[1] == pcPicYuvDepth->getHeight(COMPONENT_Y));
 
   PelImage cInputDepth ( pcPicYuvDepth    , true);
@@ -300,8 +300,8 @@
   if ( !bRenderFromLeft )
   {
-    TRenFilter::mirrorHor( m_pcFilled );
-  }
-
-  TRenFilter::filledToUsedPelMap( m_pcFilled, &cOutputImage, m_iUsedPelMapMarExt );
+    TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcFilled );
+  }
+
+  TRenFilter<REN_BIT_DEPTH>::filledToUsedPelMap( m_pcFilled, &cOutputImage, m_iUsedPelMapMarExt );
 };
 
@@ -310,6 +310,6 @@
 {
   assert( !m_bExtrapolate );
-  assert( m_auiInputResolution[0] == pcPicYuvVideoLeft ->getWidth () );
-  assert( m_auiInputResolution[1] == pcPicYuvVideoRight->getHeight() );
+  assert( m_auiInputResolution[0] == pcPicYuvVideoLeft ->getWidth ( COMPONENT_Y ) );
+  assert( m_auiInputResolution[1] == pcPicYuvVideoRight->getHeight( COMPONENT_Y ) );
 
   AOT( iBlendMode == 3);
@@ -363,7 +363,7 @@
   xCreateAlphaMap( m_pcRightFilled,      m_pcRightFilled, false );
 
-  TRenFilter::mirrorHor( m_pcRightOutputImage );
-  TRenFilter::mirrorHor( m_pcRightOutputDepth );
-  TRenFilter::mirrorHor( m_pcRightFilled      );
+  TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcRightOutputImage );
+  TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcRightOutputDepth );
+  TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcRightFilled      );
 
   xEnhSimilarity( m_pcLeftOutputImage, m_pcRightOutputImage, m_pcLeftFilled, m_pcRightFilled );
@@ -377,11 +377,11 @@
     xCreateAlphaMap      ( m_pcLeftFilled,       m_pcLeftFilled,       true );
 
-    TRenFilter::mirrorHor( m_pcRightInputImage );
+    TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcRightInputImage );
     xBackShiftPixels     ( m_pcRightInputImage,  m_pcOutputDepth,      m_pcRightOutputImage, m_pcRightFilled , true );
     xFillHoles           ( m_pcRightOutputImage, m_pcRightFilled,      m_pcRightOutputImage, true);
 
-    TRenFilter::mirrorHor( m_pcRightFilled );
+    TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcRightFilled );
     xCreateAlphaMap      ( m_pcRightFilled,      m_pcRightFilled,      true );
-    TRenFilter::mirrorHor( m_pcRightFilled );
+    TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcRightFilled );
   }
 
@@ -415,5 +415,5 @@
   {
     case eRenPreProBinom:
-      TRenFilter::binominal(pcOutImage, pcTemp, m_iPreFilterSize);
+      TRenFilter<REN_BIT_DEPTH>::binominal(pcOutImage, pcTemp, m_iPreFilterSize);
       break;
     case eRenPreProNone:
@@ -607,5 +607,5 @@
     {
       apcDiffPlane[uiCurPlane] = new IntImagePlane( iWidth, iHeight, apcInputPlanes[uiCurPlane]->getPad());
-      TRenFilter::diffHorSym(apcInputPlanes[uiCurPlane] , apcDiffPlane[uiCurPlane]);
+      TRenFilter<REN_BIT_DEPTH>::diffHorSym(apcInputPlanes[uiCurPlane] , apcDiffPlane[uiCurPlane]);
       ppiDiffPlanes[uiCurPlane] = apcDiffPlane[uiCurPlane]->getPlaneData();
     }
@@ -659,5 +659,5 @@
               for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
               {
-                cVal  = TRenFilter::interpCHSpline(iInterPolPos, dShiftedPos, dPrevShiftedPos, apcInputData[uiCurPlane][iPosX - 1], ppiDiffPlanes[uiCurPlane][iPosX - 1], apcInputData[uiCurPlane][iPosX], ppiDiffPlanes[uiCurPlane][iPosX] );
+                cVal  = TRenFilter<REN_BIT_DEPTH>::interpCHSpline(iInterPolPos, dShiftedPos, dPrevShiftedPos, apcInputData[uiCurPlane][iPosX - 1], ppiDiffPlanes[uiCurPlane][iPosX - 1], apcInputData[uiCurPlane][iPosX], ppiDiffPlanes[uiCurPlane][iPosX] );
                 apcOutputData[uiCurPlane][iInterPolPos]  = cVal;
               }
@@ -1516,5 +1516,5 @@
   {
   case eRenPostProMed:
-    TRenFilter::lineMedian3(pcTemp);
+    TRenFilter<REN_BIT_DEPTH>::lineMedian3(pcTemp);
     break;
   case eRenPostProNone:
@@ -1599,17 +1599,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[ ((Int64)1 ) << g_bitDepthY ];
-  Int* aiHistRight = new Int[ ((Int64)1 ) << g_bitDepthY ];
-  Pel* aiConvLUT   = new Pel[ ((Int64)1 ) << g_bitDepthY ];
+  Int* aiHistLeft  = new Int[ ((Int64)1 ) << REN_BIT_DEPTH ];
+  Int* aiHistRight = new Int[ ((Int64)1 ) << REN_BIT_DEPTH ];
+  Pel* aiConvLUT   = new Pel[ ((Int64)1 ) << REN_BIT_DEPTH ];
 
   for (UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++ )
   {
-    for (Int iCurVal = 0 ; iCurVal < ( 1 << g_bitDepthY ); iCurVal++)
+    for (Int iCurVal = 0 ; iCurVal < ( 1 << REN_BIT_DEPTH ); iCurVal++)
     {
       aiHistLeft [iCurVal] = 0;
@@ -1658,5 +1657,5 @@
     Int iCheckSumRight = 0;
 
-    for (Int iCurVal = 0 ; iCurVal < ( 1 << g_bitDepthY ); iCurVal++)
+    for (Int iCurVal = 0 ; iCurVal < ( 1 << REN_BIT_DEPTH ); iCurVal++)
     {
       iCheckSumLeft  += aiHistLeft [iCurVal];
@@ -1665,13 +1664,13 @@
 
 
-    while( iCurChangeVal < ( 1 << g_bitDepthY ) )
+    while( iCurChangeVal < ( 1 << REN_BIT_DEPTH ) )
     {
       if ( iCumSumBase == iCumSumChange )
       {
-        aiConvLUT[iCurChangeVal] = std::min( iCurBaseVal,  ( 1 << g_bitDepthY ) - 1 );
+        aiConvLUT[iCurChangeVal] = std::min( iCurBaseVal,  ( 1 << REN_BIT_DEPTH ) - 1 );
         iCurBaseVal  ++;
         iCurChangeVal++;
         iCumSumChange += aiHistChange[iCurChangeVal];
-        if (iCurBaseVal <  ( 1 << g_bitDepthY ) )
+        if (iCurBaseVal <  ( 1 << REN_BIT_DEPTH ) )
         {
           iCumSumBase   += aiHistBase  [iCurBaseVal]  ;
@@ -1681,5 +1680,5 @@
       {
         iCurBaseVal++;
-        if (iCurBaseVal < ( 1 << g_bitDepthY ) )
+        if (iCurBaseVal < ( 1 << REN_BIT_DEPTH ) )
         {
           iCumSumBase   += aiHistBase  [iCurBaseVal]  ;
@@ -1688,5 +1687,5 @@
       else if ( iCumSumBase > iCumSumChange)
       {
-        aiConvLUT[iCurChangeVal] = std::min(iCurBaseVal, ( 1 << g_bitDepthY )-1);
+        aiConvLUT[iCurChangeVal] = std::min(iCurBaseVal, ( 1 << REN_BIT_DEPTH )-1);
         iCurChangeVal++;
         iCumSumChange += aiHistChange  [iCurChangeVal]  ;
@@ -1897,5 +1896,4 @@
 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
 
@@ -1906,13 +1904,13 @@
   Int* piFlagMoving =  m_aiBlkMoving + 2;
 
-  Int iVideoCurStride     = pcPicYuvVideoCur ->getStride();
-  Int iVideoLastStride    = pcPicYuvVideoLast->getStride();
-  Int iDepthCurStride     = pcPicYuvDepthCur ->getStride();
-  Int iDepthLastStride    = pcPicYuvDepthLast->getStride();
-
-  Pel* pcVideoCurData     = pcPicYuvVideoCur ->getLumaAddr();
-  Pel* pcVideoLastData    = pcPicYuvVideoLast->getLumaAddr();
-  Pel* pcDepthCurData     = pcPicYuvDepthCur ->getLumaAddr();
-  Pel* pcDepthLastData    = pcPicYuvDepthLast->getLumaAddr();
+  Int iVideoCurStride     = pcPicYuvVideoCur ->getStride( COMPONENT_Y );
+  Int iVideoLastStride    = pcPicYuvVideoLast->getStride( COMPONENT_Y );
+  Int iDepthCurStride     = pcPicYuvDepthCur ->getStride( COMPONENT_Y );
+  Int iDepthLastStride    = pcPicYuvDepthLast->getStride( COMPONENT_Y );
+
+  Pel* pcVideoCurData     = pcPicYuvVideoCur ->getAddr( COMPONENT_Y );
+  Pel* pcVideoLastData    = pcPicYuvVideoLast->getAddr( COMPONENT_Y );
+  Pel* pcDepthCurData     = pcPicYuvDepthCur ->getAddr( COMPONENT_Y );
+  Pel* pcDepthLastData    = pcPicYuvDepthLast->getAddr( COMPONENT_Y );
 
   Pel* pcVideoCurDataFrm  = pcVideoCurData ;
@@ -1964,5 +1962,5 @@
             { //Weight: 0.75
               Int iFilt = (( (pcDepthLastDataBlk[iCurPosX] << 1 ) + pcDepthLastDataBlk[iCurPosX] + pcDepthCurDataBlk[iCurPosX] + 2 ) >> 2 );
-              assert( (iFilt >= 0) && (iFilt <  ( 1 << g_bitDepthY ) ) );
+              assert( (iFilt >= 0) && (iFilt <  ( 1 << REN_BIT_DEPTH ) ) );
               pcDepthCurDataBlk[iCurPosX] = pcDepthLastDataBlk[iCurPosX];
               pcDepthCurDataBlk[iCurPosX] = iFilt;
@@ -2169,5 +2167,5 @@
     }
 
-    TRenFilter::setSubPelShiftLUT(m_iRelShiftLUTPrec, m_aaiSubPelShift, -1);
+    TRenFilter<REN_BIT_DEPTH>::setSubPelShiftLUT(m_iRelShiftLUTPrec, m_aaiSubPelShift, -1);
   }
 
@@ -2235,4 +2233,4 @@
   if(m_aiBlkMoving         != NULL ) delete[] m_aiBlkMoving;
 }
-#endif // H_3D
-
+#endif // NH_3D
+
Index: branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenTop.h
===================================================================
--- branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenTop.h	(revision 1199)
+++ branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenTop.h	(revision 1200)
@@ -39,5 +39,5 @@
 #include "../TLibCommon/TComPicYuv.h"
 
-#if H_3D
+#if NH_3D
 #include <list>
 #include <vector>
@@ -270,4 +270,4 @@
 };
 
-#endif // H_3D
+#endif // NH_3D
 #endif //__TRENTOP__
