Index: branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenFilter.cpp
===================================================================
--- branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenFilter.cpp	(revision 1389)
+++ branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenFilter.cpp	(revision 1390)
@@ -36,1442 +36,3 @@
 #include "TRenFilter.h"
 #include "TRenInterpFilter.h"
-#if NH_3D_VSO
 
-///// COMMON /////
-template<UInt bitDepth>
-Void TRenFilter<bitDepth>::setSubPelShiftLUT( Int iLutPrec, Int** piSubPelShiftLUT, Int iShift )
-{
-  //ToDo: use same rounding for left and right
-  AOT( iLutPrec < 0 || iLutPrec > 2 );
-  Int iStep = 1 << iLutPrec;
-  for (Int iDelta = 0; iDelta < (iStep << 1)+1; iDelta++ )
-  {
-    for (Int iCurDelta = 0; iCurDelta < (iStep << 1)+1; iCurDelta++ )
-    {
-      if (iCurDelta <= iDelta)
-      {
-        piSubPelShiftLUT[iDelta][iCurDelta] =  (iDelta != 0) ?( ( iStep * iCurDelta + ( iDelta >> 1) )/ iDelta) + iShift * iStep :  iShift * iStep;
-      }
-      else
-      {
-        piSubPelShiftLUT[iDelta][iCurDelta] = 0xdeaddead;
-      }
-    }
-  }
-}
-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 );
-  riBlendDistWeight = bBlendUseDistWeight ? iRelDistToLeft :  1 << (REN_VDWEIGHT_PREC - 1);
-
-  for (UInt uiDepthValue = 0; uiDepthValue <= 256; uiDepthValue++)
-  {
-    //GT: retrieve depth approx from shift
-    piInvZLUTLeft [uiDepthValue] = abs( ppiBaseShiftLUTLeft [0][uiDepthValue] );
-    piInvZLUTRight[uiDepthValue] = abs( ppiBaseShiftLUTRight[0][uiDepthValue] );
-  }
-  // Set Threshold
-  riBlendZThres  = ( std::max( abs(piInvZLUTLeft[0]- piInvZLUTLeft[255]), abs(piInvZLUTRight[0]- piInvZLUTRight[255]) ) * iBlendZThresPerc + 50)  / 100;
-}
-
-template<UInt bitDepth>
-Void TRenFilter<bitDepth>::filledToUsedPelMap( PelImage* pcFilledImage, PelImage* pcUsedPelsImage, Int iUsedPelMapMarExt )
-{
-  // Convert to binary map
-  Int iWidth  = pcFilledImage      ->getPlane(0)->getWidth ();
-  Int iHeight = pcFilledImage      ->getPlane(0)->getHeight();
-
-  AOT( iWidth  != pcUsedPelsImage  ->getPlane(0)->getWidth () );
-  AOT( iHeight != pcUsedPelsImage  ->getPlane(0)->getHeight() );
-  AOF( pcUsedPelsImage->is420() );
-
-  Int iSrcStride  = pcFilledImage  ->getPlane(0)->getStride();
-  Int iDstStrideY = pcUsedPelsImage->getPlane(0)->getStride();
-  Int iDstStrideU = pcUsedPelsImage->getPlane(1)->getStride();
-  Int iDstStrideV = pcUsedPelsImage->getPlane(2)->getStride();
-
-  Pel* pcSrcData  = pcFilledImage  ->getPlane(0)->getPlaneData();
-  Pel* pcDstDataY = pcUsedPelsImage->getPlane(0)->getPlaneData();
-  Pel* pcDstDataU = pcUsedPelsImage->getPlane(1)->getPlaneData();
-  Pel* pcDstDataV = pcUsedPelsImage->getPlane(2)->getPlaneData(); // Only used as buffer
-
-  for (Int iPosY = 0; iPosY < iHeight; iPosY++ )
-  {
-    for (Int iPosX = 0; iPosX < iWidth; iPosX++ )
-    {
-      pcDstDataY[iPosX] = ( pcSrcData[iPosX] != REN_IS_FILLED ) ? REN_USED_PEL : REN_UNUSED_PEL;
-
-      if ((iPosX & 1) && (iPosY & 1))
-      {
-        pcDstDataU[iPosX >> 1] = (   ( pcSrcData[iPosX                 ] != REN_IS_FILLED )
-          || ( pcSrcData[iPosX - 1             ] != REN_IS_FILLED )
-          || ( pcSrcData[iPosX     - iSrcStride] != REN_IS_FILLED )
-          || ( pcSrcData[iPosX - 1 - iSrcStride] != REN_IS_FILLED )
-          ) ? REN_USED_PEL : REN_UNUSED_PEL;
-      }
-    }
-
-    if ( iPosY & 1 )
-    {
-      pcDstDataU += iDstStrideU;
-    }
-
-    pcDstDataY += iDstStrideY;
-    pcSrcData  += iSrcStride;
-  }
-
-  //// Dilatation for Interpolation Filters ////
-  //GT: should better be defined somewhere else ...
-  const Int iLumaIntFiltHalfSize   = 4;
-  const Int iChromaIntFiltHalfSize = 2;
-
-  Int iDilateSizeLuma   = iLumaIntFiltHalfSize   +   iUsedPelMapMarExt      ;
-  Int iDilateSizeChroma = iChromaIntFiltHalfSize + ( iUsedPelMapMarExt >> 1);
-
-  pcDstDataY = pcUsedPelsImage->getPlane(0)->getPlaneData();
-  pcDstDataU = pcUsedPelsImage->getPlane(1)->getPlaneData();
-  pcDstDataV = pcUsedPelsImage->getPlane(2)->getPlaneData();
-
-  // Dilate Luma horizontally
-  xDilate( pcDstDataY, iDstStrideY, iWidth, iHeight, pcDstDataY, iDstStrideY, iDilateSizeLuma, false, true  );
-  xDilate( pcDstDataY, iDstStrideY, iWidth, iHeight, pcDstDataY, iDstStrideY, iDilateSizeLuma, false, false );
-
-  // Dilate Chorma vertically and horizontally (for UV-up)
-  xDilate( pcDstDataU, iDstStrideU, iWidth>>1, iHeight>>1, pcDstDataU, iDstStrideU, iDilateSizeChroma, false, true  );
-  xDilate( pcDstDataU, iDstStrideU, iWidth>>1, iHeight>>1, pcDstDataU, iDstStrideU, iDilateSizeChroma, false, false );
-
-  xDilate( pcDstDataU, iDstStrideU, iWidth>>1, iHeight>>1, pcDstDataU, iDstStrideU, iChromaIntFiltHalfSize, true, true  );
-  xDilate( pcDstDataU, iDstStrideU, iWidth>>1, iHeight>>1, pcDstDataU, iDstStrideU, iChromaIntFiltHalfSize, true, false );
-
-  for (Int iPosY = 0; iPosY < (iHeight >> 1); iPosY++ )
-  {
-    for (Int iPosX = 0; iPosX < (iWidth >> 1); iPosX++ )
-    {
-      pcDstDataV[iPosX] = pcDstDataU[iPosX];
-    }
-
-    pcDstDataU += iDstStrideU;
-    pcDstDataV += iDstStrideV;
-  }
-}
-
-/////////// Copy /////////////
-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 );
-
-}
-
-/////////// Horizontal Mirror ///////////
-template<UInt bitDepth> template <typename T> 
-Void TRenFilter<bitDepth>::mirrorHor( TRenImage<T> *pcImage )
-{
-  for (UInt uCurPlane = 0 ; uCurPlane < pcImage->getNumberOfPlanes(); uCurPlane++ )
-  {
-    mirrorHor( pcImage->getPlane(uCurPlane) );
-  }
-}
-
-template<UInt bitDepth> template <typename T> 
-Void TRenFilter<bitDepth>::mirrorHor( TRenImagePlane<T> *pcImagePlane )
-{
-  T* pcPlaneData = pcImagePlane->getPlaneDataOrg();
-  T cTemp;
-  UInt uiStride = pcImagePlane->getStride();
-  UInt uiHeight = pcImagePlane->getHeightOrg();
-  UInt uiWidth  = pcImagePlane->getWidthOrg();
-
-  for (UInt uiPosY = 0; uiPosY < uiHeight; uiPosY++)
-  {
-    for (UInt uiPosX = 0; uiPosX < ( (uiWidth+1) >> 1); uiPosX++ )
-    {
-      cTemp = pcPlaneData[uiPosX];
-      pcPlaneData[uiPosX] = pcPlaneData[uiWidth - uiPosX-1];
-      pcPlaneData[uiWidth-uiPosX-1] = cTemp;
-    }
-    pcPlaneData += uiStride;
-  }
-}
-
-/////////// Comparison ///////////
-template<UInt bitDepth>
-Int64 TRenFilter<bitDepth>::SSE   (PelImagePlane* pcInputPlane1, PelImagePlane* pcInputPlane2, Bool bLuma )
-{
-  UInt uiWidth     = pcInputPlane1->getWidth();
-  UInt uiHeight    = pcInputPlane1->getHeight();
-
-  UInt uiStride1   = pcInputPlane1->getStride();
-  UInt uiStride2   = pcInputPlane2->getStride();
-
-  Pel* pucImData1  = pcInputPlane1->getPlaneData();
-  Pel* pucImData2  = pcInputPlane2->getPlaneData();
-
-  return SSE( pucImData1, (Int) uiStride1, (Int) uiWidth, (Int) uiHeight, pucImData2, (Int) uiStride2, 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 = ( bitDepth  - 8 ) << 1 ;
-  for(Int iPosY = 0; iPosY < iHeight; iPosY++)
-  {
-    for(Int iPosX = 0; iPosX < iWidth; iPosX++)
-    {
-      Int iDiff = ( piSrc1[iPosX] - piSrc2[iPosX] );
-      iSSE += (( iDiff * iDiff ) >> iShift);
-    }
-    piSrc1 += iSrcStride1;
-    piSrc2 += iSrcStride2;
-  }
-  return iSSE;
-}
-
-template<UInt bitDepth> template <typename T> 
-Bool TRenFilter<bitDepth>::compare( TRenImage<T> *pInputImage1, TRenImage<T> *pInputImage2 )
-{
-  Bool bIsEqual = true;
-  for (UInt uiCurPlane = 0 ; uiCurPlane < pInputImage1->getNumberOfPlanes(); uiCurPlane++ )
-  {
-    bIsEqual = bIsEqual && compare(pInputImage1->getPlane(uiCurPlane), pInputImage2->getPlane(uiCurPlane));
-  }
-  return bIsEqual;
-}
-
-template<UInt bitDepth> template <typename T> 
-Bool TRenFilter<bitDepth>::compare   (TRenImagePlane<T>* pcInputPlane1  , TRenImagePlane<T>* pcInputPlane2   )
-{
-  UInt uiWidth  = pcInputPlane1->getWidth();
-  UInt uiHeight = pcInputPlane1->getHeight();
-
-  UInt uiStride1 = pcInputPlane1->getStride();
-  UInt uiStride2 = pcInputPlane2->getStride();
-
-  T* pucImData1  = pcInputPlane1->getPlaneData();
-  T* pucImData2  = pcInputPlane2->getPlaneData();
-
-  Bool bEqual = true;
-  for(UInt uiPosY = 0; uiPosY < uiHeight; uiPosY++)
-  {
-
-    for(UInt uiPosX = 0; uiPosX < uiWidth; uiPosX++)
-    {
-      bEqual = bEqual && ( pucImData1[uiPosX] == pucImData2[uiPosX]);
-    }
-    pucImData1 += uiStride1;
-    pucImData2 += uiStride2;
-  }
-  return bEqual;
-}
-
-/////////// Sampling ///////////
-template<UInt bitDepth>
-inline Void TRenFilter<bitDepth>::sampleUp2Tap13(PelImage* pcInputImage, PelImage* pcOutputImage)
-{ // UpSampling from JSVM Software (DownConvertStatic) ???
-
-  UInt uiNumPlanes = pcInputImage->getNumberOfPlanes();
-
-  for (UInt uiCurPlane = 0; uiCurPlane < uiNumPlanes; uiCurPlane++)
-  {
-    PelImagePlane* pcInputPlane  = pcInputImage ->getPlane(uiCurPlane);
-    PelImagePlane* pcOutputPlane = pcOutputImage->getPlane(uiCurPlane);
-
-    Int iWidth  = pcInputPlane->getWidth();
-    Int iHeight = pcInputPlane->getHeight();
-
-    Int iInputStride  = pcInputPlane->getStride();
-    Int iOutputStride = pcOutputPlane->getStride();
-
-    assert( iWidth  == 2 * pcOutputPlane->getWidth ());
-    assert( iHeight == 2 * pcOutputPlane->getHeight());
-
-    Int iOffset;
-
-    Pel *pcInputPlaneData   = pcInputPlane->getPlaneData();
-    Int *piDataVerUp        = new Int[iWidth * iHeight * 2];
-    Pel *pcOutputPlaneData  = pcOutputPlane->getPlaneData();
-
-    // Up sampling filter.
-    Int aiFilterCoeff[16] = { 0, 0, 1, 0, -5, 0, 20, 32, 20, 0, -5,  0, 1, 0, 0, 32 };
-
-    // Normalization factors for filtered values.
-    Int iDivH = 1, iDivV = 1, iAddH = 0, iAddV = 0;
-
-    // Factors after horizontal and vertical filtering.
-    iDivH = (aiFilterCoeff[15]*aiFilterCoeff[15]); iAddH = iDivH / 2;
-
-    Int* piDst = new Int[2*iWidth];
-    //1) VERTICAL UPSAMPLING.
-
-    // Process all cols.
-    for(Int i=0; i<iWidth; i++ )
-    {
-      // Set source (col) poInter.
-      Pel* pcSrc = &pcInputPlaneData[i];
-
-      // Process all rows.
-      for( Int j=0; j<iHeight; j++ )
-      {
-        // Adjust indices of border samples.
-        Int i00 = ((j <   3) ? 0   : j-3) * iInputStride;
-        Int i01 = ((j <   2) ? 0   : j-2) * iInputStride;
-        Int i02 = ((j <   1) ? 0   : j-1) * iInputStride;
-        Int i03 = ((j < iHeight  ) ? j   : j-1) * iInputStride;
-        Int i04 = ((j < iHeight-1) ? j+1 : j-1) * iInputStride;
-        Int i05 = ((j < iHeight-2) ? j+2 : j-1) * iInputStride;
-        Int i06 = ((j < iHeight-3) ? j+3 : j-1) * iInputStride;
-        Int i07 = ((j < iHeight-4) ? j+4 : j-1) * iInputStride;
-
-        // Calculate filtered (even) sample.
-        piDst[2*j+0] = aiFilterCoeff[13] * pcSrc[i00]
-        + aiFilterCoeff[11] * pcSrc[i01]
-        + aiFilterCoeff[ 9] * pcSrc[i02]
-        + aiFilterCoeff[ 7] * pcSrc[i03]
-        + aiFilterCoeff[ 5] * pcSrc[i04]
-        + aiFilterCoeff[ 3] * pcSrc[i05]
-        + aiFilterCoeff[ 1] * pcSrc[i06];
-
-        // Calculate filtered (odd) sample.
-        piDst[2*j+1] = aiFilterCoeff[14] * pcSrc[i00]
-        + aiFilterCoeff[12] * pcSrc[i01]
-        + aiFilterCoeff[10] * pcSrc[i02]
-        + aiFilterCoeff[ 8] * pcSrc[i03]
-        + aiFilterCoeff[ 6] * pcSrc[i04]
-        + aiFilterCoeff[ 4] * pcSrc[i05]
-        + aiFilterCoeff[ 2] * pcSrc[i06]
-        + aiFilterCoeff[ 0] * pcSrc[i07];
-      }
-
-      // Process all filtered samples.
-      for(Int j=0; j<(2*iHeight); j++ )
-      {
-        // Scale and copy to image buffer.
-        piDataVerUp[iWidth*j+i] = (piDst[j] + iAddV) / iDivV;
-      }
-    }
-
-    // Update h
-    iHeight *= 2;
-
-    // 2) HORIZONTAL UPSAMPLING.
-
-    // Process all rows.
-    for( Int j=0; j<iHeight; j++ )
-    {
-      // Set source (row) poInter.
-      Int* piSrc = &piDataVerUp[iWidth*j];
-
-      // Process all cols.
-      for( Int i=0; i<iWidth; i++ )
-      {
-        // Adjust indices of border samples.
-        Int i00 = (i <   3) ? 0   : i-3;
-        Int i01 = (i <   2) ? 0   : i-2;
-        Int i02 = (i <   1) ? 0   : i-1;
-        Int i03 = (i < iWidth  ) ? i   : iWidth-1;
-        Int i04 = (i < iWidth-1) ? i+1 : iWidth-1;
-        Int i05 = (i < iWidth-2) ? i+2 : iWidth-1;
-        Int i06 = (i < iWidth-3) ? i+3 : iWidth-1;
-        Int i07 = (i < iWidth-4) ? i+4 : iWidth-1;
-
-        // Calculate filtered (even) sample.
-        piDst[2*i+0] =   aiFilterCoeff[13] * piSrc[i00]
-        + aiFilterCoeff[11] * piSrc[i01]
-        + aiFilterCoeff[ 9] * piSrc[i02]
-        + aiFilterCoeff[ 7] * piSrc[i03]
-        + aiFilterCoeff[ 5] * piSrc[i04]
-        + aiFilterCoeff[ 3] * piSrc[i05]
-        + aiFilterCoeff[ 1] * piSrc[i06];
-
-        // Calculate filtered (odd) sample.
-        piDst[2*i+1] = aiFilterCoeff[14] * piSrc[i00]
-        + aiFilterCoeff[12] * piSrc[i01]
-        + aiFilterCoeff[10] * piSrc[i02]
-        + aiFilterCoeff[ 8] * piSrc[i03]
-        + aiFilterCoeff[ 6] * piSrc[i04]
-        + aiFilterCoeff[ 4] * piSrc[i05]
-        + aiFilterCoeff[ 2] * piSrc[i06]
-        + aiFilterCoeff[ 0] * piSrc[i07];
-      }
-
-      iOffset = 2* iOutputStride * j;
-      // Process all filtered samples.
-      for(Int i=0; i<iWidth*2; i++ )
-      {
-        // Scale and copy to image buffer.
-        pcOutputPlaneData[iOffset+i] = ClipBD((Pel) ((piDst[i] + iAddH) / iDivH), bitDepth);
-      }
-    }
-
-    delete [] piDataVerUp;
-    delete [] piDst;
-
-  }
-}
-
-template<UInt bitDepth>
-Void TRenFilter<bitDepth>::sampleDown2Tap13(PelImage* pcInputImage, PelImage* pcOutputImage)
-{ // DownSampling from JSVM Software (DownConvertStatic) ??
-
-  UInt uiNumPlanes = pcInputImage->getNumberOfPlanes();
-
-  for (UInt uiCurPlane = 0; uiCurPlane < uiNumPlanes; uiCurPlane++)
-  {
-    sampleDown2Tap13( pcInputImage ->getPlane(uiCurPlane),  pcOutputImage->getPlane(uiCurPlane) );
-  }
-};
-
-template<UInt bitDepth>
-Void TRenFilter<bitDepth>::sampleDown2Tap13( Pel* pcInputPlaneData, Int iInputStride, Int iWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
-{ // DownSampling from JSVM Software (DownConvertStatic) ??
-
-  Int iOffset, iPosX, iPosY, k;
-  Int* piDataHorDown = new Int[(Int)(iWidth * iHeight / 2)];
-
-  // Downsampling filter.
-  Int aiFilterCoeff[16] = { 0, 2, 0, -4, -3, 5, 19, 26, 19, 5, -3, -4, 0, 2, 0, 64 };
-
-  // Normalization factors for filtered values.
-  Int iDivH = 1, iDivV = 1, iAddH = 0, iAddV = 0;
-
-  iDivV = (aiFilterCoeff[15]*aiFilterCoeff[15]); iAddV = iDivV / 2;
-
-  // Allocate and init single row of filtered samples.
-  Int* piDst = new Int[iWidth];
-
-  // 1) HORIZONTAL DOWNSAMPLING.
-
-  // Process all rows.
-  for( iPosY=0; iPosY<iHeight; iPosY++ )
-  {
-    // Set source (row) poInter.
-    Pel* pcSrc = &pcInputPlaneData[iInputStride*iPosY];
-
-    // Process all cols.
-    for( iPosX=0, k=0; iPosX<(iWidth/2); iPosX++, k+=2 )
-    {
-      // Adjust indices of border samples.
-      Int i00 = (k <       7) ? 0   : k    -7;
-      Int i01 = (k <       6) ? 0   : k    -6;
-      Int i02 = (k <       5) ? 0   : k    -5;
-      Int i03 = (k <       4) ? 0   : k    -4;
-      Int i04 = (k <       3) ? 0   : k    -3;
-      Int i05 = (k <       2) ? 0   : k    -2;
-      Int i06 = (k <       1) ? 0   : k    -1;
-      Int i07 = (k < iWidth  ) ? k   : iWidth-1;
-      Int i08 = (k < iWidth-1) ? k+1 : iWidth-1;
-      Int i09 = (k < iWidth-2) ? k+2 : iWidth-1;
-      Int i10 = (k < iWidth-3) ? k+3 : iWidth-1;
-      Int i11 = (k < iWidth-4) ? k+4 : iWidth-1;
-      Int i12 = (k < iWidth-5) ? k+5 : iWidth-1;
-      Int i13 = (k < iWidth-6) ? k+6 : iWidth-1;
-      Int i14 = (k < iWidth-7) ? k+7 : iWidth-1;
-
-      // Calculate filtered sample.
-      piDst[iPosX] =     aiFilterCoeff[ 0] * pcSrc[i00]
-      + aiFilterCoeff[ 1] * pcSrc[i01]
-      + aiFilterCoeff[ 2] * pcSrc[i02]
-      + aiFilterCoeff[ 3] * pcSrc[i03]
-      + aiFilterCoeff[ 4] * pcSrc[i04]
-      + aiFilterCoeff[ 5] * pcSrc[i05]
-      + aiFilterCoeff[ 6] * pcSrc[i06]
-      + aiFilterCoeff[ 7] * pcSrc[i07]
-      + aiFilterCoeff[ 8] * pcSrc[i08]
-      + aiFilterCoeff[ 9] * pcSrc[i09]
-      + aiFilterCoeff[10] * pcSrc[i10]
-      + aiFilterCoeff[11] * pcSrc[i11]
-      + aiFilterCoeff[12] * pcSrc[i12]
-      + aiFilterCoeff[13] * pcSrc[i13]
-      + aiFilterCoeff[14] * pcSrc[i14];
-    }
-
-    iOffset = iPosY * iWidth/2;
-    // Process all filtered samples.
-    for( iPosX=0; iPosX<(iWidth/2); iPosX++ )
-    {
-      // Scale and copy back to image buffer.
-      piDataHorDown[iOffset+iPosX] = (piDst[iPosX] + iAddH) / iDivH;
-    }
-  }
-
-  // Update w.
-  iWidth >>= 1;
-
-  // 2) VERTICAL DOWNSAMPLING.
-
-  // Process all cols.
-  for(  iPosX=0; iPosX<iWidth; iPosX++ )
-  {
-    // Set source (col) poInter.
-    Int* piSrc = &piDataHorDown[iPosX];
-
-    // Process all rows.
-    for(  iPosY=0, k=0; iPosY<(iHeight/2); iPosY++, k+=2 )
-    {
-      // Adjust indices of border samples.
-      Int i00 = ((k <       7) ? 0   : k    -7) * iWidth;
-      Int i01 = ((k <       6) ? 0   : k    -6) * iWidth;
-      Int i02 = ((k <       5) ? 0   : k    -5) * iWidth;
-      Int i03 = ((k <       4) ? 0   : k    -4) * iWidth;
-      Int i04 = ((k <       3) ? 0   : k    -3) * iWidth;
-      Int i05 = ((k <       2) ? 0   : k    -2) * iWidth;
-      Int i06 = ((k <       1) ? 0   : k    -1) * iWidth;
-      Int i07 = ((k < iHeight  ) ? k   : iHeight-1) * iWidth;
-      Int i08 = ((k < iHeight-1) ? k+1 : iHeight-1) * iWidth;
-      Int i09 = ((k < iHeight-2) ? k+2 : iHeight-1) * iWidth;
-      Int i10 = ((k < iHeight-3) ? k+3 : iHeight-1) * iWidth;
-      Int i11 = ((k < iHeight-4) ? k+4 : iHeight-1) * iWidth;
-      Int i12 = ((k < iHeight-5) ? k+5 : iHeight-1) * iWidth;
-      Int i13 = ((k < iHeight-6) ? k+6 : iHeight-1) * iWidth;
-      Int i14 = ((k < iHeight-7) ? k+7 : iHeight-1) * iWidth;
-
-      // Calculate filtered sample.
-      piDst[iPosY] =     aiFilterCoeff[ 0] * piSrc[i00]
-      + aiFilterCoeff[ 1] * piSrc[i01]
-      + aiFilterCoeff[ 2] * piSrc[i02]
-      + aiFilterCoeff[ 3] * piSrc[i03]
-      + aiFilterCoeff[ 4] * piSrc[i04]
-      + aiFilterCoeff[ 5] * piSrc[i05]
-      + aiFilterCoeff[ 6] * piSrc[i06]
-      + aiFilterCoeff[ 7] * piSrc[i07]
-      + aiFilterCoeff[ 8] * piSrc[i08]
-      + aiFilterCoeff[ 9] * piSrc[i09]
-      + aiFilterCoeff[10] * piSrc[i10]
-      + aiFilterCoeff[11] * piSrc[i11]
-      + aiFilterCoeff[12] * piSrc[i12]
-      + aiFilterCoeff[13] * piSrc[i13]
-      + aiFilterCoeff[14] * piSrc[i14];
-    }
-
-    // Process all filtered samples.
-    for( iPosY=0; iPosY<(iHeight/2); iPosY++ )
-    {
-      // Scale and copy back to image buffer.
-      pcOutputPlaneData[iOutputStride*iPosY+iPosX] = ClipBD( ( Pel) ( (piDst[iPosY] + iAddV) / iDivV), bitDepth );
-    }
-  }
-
-  delete [] piDataHorDown;
-  delete [] piDst;
-}
-
-template<UInt bitDepth>
-Void TRenFilter<bitDepth>::sampleDown2Tap13(PelImagePlane* pcInputPlane, PelImagePlane* pcOutputPlane)
-{ // DownSampling from JSVM Software (DownConvertStatic) ??
-  Int iWidth       = pcInputPlane->getWidth();
-  Int iHeight      = pcInputPlane->getHeight();
-
-  assert( pcOutputPlane->getWidth () == (iWidth  >> 1 ));
-  assert( pcOutputPlane->getHeight() == (iHeight >> 1 ));
-
-  Int iInputStride  = pcInputPlane->getStride();
-  Int iOutputStride = pcOutputPlane->getStride();
-
-  Pel* pcInputPlaneData = pcInputPlane ->getPlaneData();
-  Pel* pcOutputPlaneData = pcOutputPlane->getPlaneData();
-
-  sampleDown2Tap13( pcInputPlaneData, iInputStride, iWidth, iHeight, pcOutputPlaneData, iOutputStride );
-};
-
-template<UInt bitDepth>
-Void TRenFilter<bitDepth>::sampleVerDown2Tap13( PelImagePlane* pcInputPlane, PelImagePlane* pcOutputPlane, Int uiPad)
-{   
-  // DownSampling from JSVM Software (DownConvertStatic) ??
-  Int iWidth       = pcInputPlane->getWidth();
-  Int iHeight      = pcInputPlane->getHeight();
-
-  assert( pcOutputPlane->getWidth () ==  iWidth       );
-  assert( pcOutputPlane->getHeight() == (iHeight >> 1));
-  assert (pcInputPlane ->getPad()    >=            12 );
-  assert (pcOutputPlane->getPad()    >=         uiPad );
-
-  Int iInputStride  = pcInputPlane->getStride();
-  Int iOutputStride = pcOutputPlane->getStride();
-
-  Pel* pcInputPlaneData  = pcInputPlane ->getPlaneData();
-  Pel* pcOutputPlaneData = pcOutputPlane->getPlaneData();
-
-  Int iStr0  = 0;
-  Int iStr1  = iInputStride;
-  Int iStr2  = iStr1  + iInputStride;
-  Int iStr3  = iStr2  + iInputStride;
-  Int iStr4  = iStr3  + iInputStride;
-  Int iStr5  = iStr4  + iInputStride;
-  Int iStr6  = iStr5  + iInputStride;
-  Int iStr7  = iStr6  + iInputStride;
-  Int iStr8  = iStr7  + iInputStride;
-  Int iStr9  = iStr8  + iInputStride;
-  Int iStr10 = iStr9  + iInputStride;
-  Int iStr11 = iStr10 + iInputStride;
-  Int iStr12 = iStr11 + iInputStride;;
-
-
-  // Downsampling filter { 0, 2, 0, -4, -3, 5, 19, 26, 19, 5, -3, -4, 0, 2, 0, 64 };
-  for ( Int iYPos = 0; iYPos < (iHeight >> 1); iYPos++)
-  {
-    Pel* pcTmpIn = pcInputPlaneData - 12 * iInputStride - uiPad;
-    for ( Int iXPos = -uiPad; iXPos < iWidth + uiPad; iXPos++)
-    {
-      Int iTmp0, iTmp1, iTmp2, iTmp3, iTmp4, iTmp5;
-      iTmp0 = pcTmpIn[iStr0] + pcTmpIn[iStr12];
-      iTmp1 = pcTmpIn[iStr2] + pcTmpIn[iStr10];
-      iTmp2 = pcTmpIn[iStr3] + pcTmpIn[iStr9 ];
-      iTmp3 = pcTmpIn[iStr4] + pcTmpIn[iStr8 ];
-      iTmp4 = pcTmpIn[iStr5] + pcTmpIn[iStr7 ];
-      iTmp5 = pcTmpIn[iStr6];
-
-      Int iSum = iTmp4 + iTmp3 - iTmp2 + ((iTmp0 + iTmp4 + iTmp5 - iTmp2) << 1) + ( ( iTmp3 - iTmp1)  << 2) + (  iTmp5 << 3 ) + (( iTmp4 + iTmp5 ) << 4);
-      pcOutputPlaneData[ iXPos ] = (Pel) ClipBD((iSum + 32) >> 6, bitDepth);
-      pcTmpIn++;
-    }
-    pcOutputPlaneData += iOutputStride;
-    pcInputPlaneData  += (iInputStride << 1);
-  }
-};
-
-template<UInt bitDepth>
-Void TRenFilter<bitDepth>::sampleHorDown2Tap13( PelImagePlane* pcInputPlane, PelImagePlane* pcOutputPlane, Int uiPad )
-{ 
-    // DownSampling from JSVM Software (DownConvertStatic) ??
-  Int iWidth       = pcInputPlane->getWidth();
-  Int iHeight      = pcInputPlane->getHeight();
-
-  assert( pcOutputPlane->getWidth () == (iWidth  >> 1));
-  assert( pcOutputPlane->getHeight() ==  iHeight      );
-  assert (pcInputPlane ->getPad()    >=            12 );
-  assert (pcOutputPlane->getPad()    >=         uiPad );
-
-  Int iInputStride  = pcInputPlane ->getStride();
-  Int iOutputStride = pcOutputPlane->getStride();
-
-  Pel* pcInputPlaneData  = pcInputPlane ->getPlaneData()- uiPad * iInputStride ;
-  Pel* pcOutputPlaneData = pcOutputPlane->getPlaneData()- uiPad * iOutputStride;
-
-  // Downsampling filter { 0, 2, 0, -4, -3, 5, 19, 26, 19, 5, -3, -4, 0, 2, 0, 64 };
-  for ( Int iYPos = 0; iYPos < iHeight + 2*uiPad; iYPos++)
-  {
-    Pel* pcTmpIn = pcInputPlaneData - 12;
-    for ( Int iXPos = 0; iXPos < ( iWidth >> 1); iXPos++)
-    {
-      Int iTmp0, iTmp1, iTmp2, iTmp3, iTmp4, iTmp5;
-      iTmp0 = pcTmpIn[0]+ pcTmpIn[12];
-      iTmp1 = pcTmpIn[2]+ pcTmpIn[10];
-      iTmp2 = pcTmpIn[3]+ pcTmpIn[9 ];
-      iTmp3 = pcTmpIn[4]+ pcTmpIn[8 ];
-      iTmp4 = pcTmpIn[5]+ pcTmpIn[7 ];
-      iTmp5 = pcTmpIn[6];
-
-      Int iSum = iTmp4 + iTmp3 - iTmp2 + ((iTmp0 + iTmp4 + iTmp5 - iTmp2) << 1) + ( ( iTmp3 - iTmp1)  << 2) + (  iTmp5 << 3 ) + (( iTmp4 + iTmp5 ) << 4);
-      pcOutputPlaneData[ iXPos ] = (Pel) ClipBD((iSum + 32) >> 6, bitDepth);
-      pcTmpIn += 2;
-    }
-    pcOutputPlaneData += iOutputStride;
-    pcInputPlaneData  += iInputStride ;
-  }
-};
-
-template<UInt bitDepth>
-inline Pel TRenFilter<bitDepth>::xMedian3(Pel* pcData)
-{
-  Bool bGT01 = pcData[0] >  pcData[1];
-  Bool bGT12 = pcData[1] >  pcData[2];
-  Bool bGT20 = pcData[2] >  pcData[0];
-
-  return ( (bGT01 && bGT20) || (!bGT01 && !bGT20) ) ?  pcData[0] : ( ( (bGT12 && bGT01) || (!bGT12 && !bGT01) ) ?  pcData[1] : pcData[2]) ;
-}
-
-template<UInt bitDepth>
-Void TRenFilter<bitDepth>::lineMedian3( PelImage* pcImage )
-{
-
-  PelImage* pcTemp = pcImage->create();
-
-  for (UInt uiCurPlane = 0; uiCurPlane < pcImage->getNumberOfPlanes(); uiCurPlane++)
-  {
-    PelImagePlane* pcImPlane   = pcImage->getPlane(uiCurPlane);
-    PelImagePlane* pcTempPlane = pcTemp ->getPlane(uiCurPlane);
-
-    UInt uiWidth  = pcImPlane->getWidth();
-    UInt uiHeight = pcImPlane->getHeight();
-
-    Pel* pcImData   = pcImPlane  ->getPlaneData();
-    Pel* pcTempData = pcTempPlane->getPlaneData();
-
-    UInt uiImDataStride   = pcImPlane  ->getStride();
-    UInt uiTempDataStride = pcTempPlane->getStride();
-
-    for(UInt uiPosY = 0; uiPosY < uiHeight; uiPosY++)
-    {
-      for(UInt uiPosX = 0; uiPosX < uiWidth; uiPosX++)
-      {
-        if ( (uiPosX >= 1) && (uiPosX < (uiWidth - 2)) )
-        {
-          pcTempData[uiPosX] = xMedian3(pcImData + uiPosX - 1);
-        }
-        else
-        {
-          pcTempData[uiPosX] = pcImData[uiPosX];
-        }
-      }
-      pcTempData += uiTempDataStride;
-      pcImData   += uiImDataStride;
-    }
-  }
-
-  pcImage->assign(pcTemp);
-  delete pcTemp;
-}
-
-template<UInt bitDepth>
-Void TRenFilter<bitDepth>::convRect( PelImage* pcImage, UInt uiSize )
-{
-  DoubleImage cKernel(uiSize, uiSize,1,0);
-  cKernel.getPlane(0)->assign( 1 / ( Double( uiSize )  * Double( uiSize) ));
-  conv(pcImage, &cKernel);
-}
-
-template<UInt bitDepth>
-Void TRenFilter<bitDepth>::binominal( PelImage* pcInputImage, PelImage* pcOutputImage, UInt uiSize )
-{
-  assert( pcInputImage->getNumberOfFullPlanes()   == pcOutputImage->getNumberOfFullPlanes  () );
-  assert( pcInputImage->getNumberOfQuaterPlanes() == pcOutputImage->getNumberOfQuaterPlanes() );
-
-  UInt uiPlane;
-  for (uiPlane = 0; uiPlane < pcInputImage->getNumberOfPlanes(); uiPlane ++)
-  {
-    binominal( pcInputImage->getPlane(uiPlane), pcOutputImage->getPlane(uiPlane), uiSize );
-  }
-
-  for (  ; uiPlane < pcInputImage->getNumberOfPlanes(); uiPlane ++)
-  {
-    binominal( pcInputImage->getPlane(uiPlane), pcOutputImage->getPlane(uiPlane), uiSize >> 1 );
- }
-}
-
-template<UInt bitDepth>
-Void TRenFilter<bitDepth>::binominal( PelImagePlane* pcInputPlane, PelImagePlane* pcOutputPlane, UInt uiSize )
-{
-  Int iWidth  = pcInputPlane ->getWidth ();
-  Int iHeight = pcInputPlane ->getHeight();
-
-  assert( pcOutputPlane->getWidth () == iWidth  );
-  assert( pcOutputPlane->getHeight() == iHeight );
-  assert( pcInputPlane ->getPad   () >= uiSize );
-  assert( pcOutputPlane->getPad   () >= uiSize );
-
-  if (uiSize == 0)
-  {
-    pcOutputPlane->assign( pcInputPlane );
-    return;
-  };
-
-  Int iInputStride  = pcInputPlane ->getStride();
-  Int iOutputStride = pcOutputPlane->getStride();
-  Int iTempStride   = iWidth + (uiSize << 1);
-
-
-  Pel* pcCurInputData  = pcInputPlane ->getPlaneData() - uiSize;
-  Pel* pcTempData      = new Pel[iTempStride * iHeight];
-  Pel* pcCurTempData   = pcTempData;
-
-  Pel (*fpFilter) ( Pel*, Int ) = NULL;
-
-  switch( uiSize )
-  {
-  case 1:
-    fpFilter = &TRenFilter<bitDepth>::xFiltBinom3;
-    break;
-  case 2:
-    fpFilter = &TRenFilter<bitDepth>::xFiltBinom5;
-    break;
-  case 3:
-    fpFilter = &TRenFilter<bitDepth>::xFiltBinom7;
-    break;
-  case 4:
-    fpFilter = &TRenFilter<bitDepth>::xFiltBinom9;
-    break;
-  default:
-      AOT(true);
-  }
-
-  for (Int iPosY = 0; iPosY < iHeight; iPosY++ )
-  {
-    for (Int iPosX = 0; iPosX < iWidth + (uiSize << 1); iPosX++)
-    {
-      pcCurTempData[iPosX] = (*fpFilter)(pcCurInputData + iPosX, iInputStride );
-    }
-    pcCurTempData   += iTempStride;
-    pcCurInputData  += iInputStride;
-  }
-
-  pcCurTempData   = pcTempData + uiSize;
-  Pel* pcCurOutputData = pcOutputPlane->getPlaneData();
-
-  for (Int iPosY = 0; iPosY < iHeight; iPosY++ )
-  {
-    for (Int iPosX = 0; iPosX < iWidth; iPosX++)
-    {
-      pcCurOutputData[iPosX] = (*fpFilter)(pcCurTempData + iPosX, 1);
-    }
-    pcCurTempData    += iTempStride;
-    pcCurOutputData  += iOutputStride;
-  }
-
-  delete[] pcTempData;
-}
-
-template<UInt bitDepth>
-Pel TRenFilter<bitDepth>::xFiltBinom3( Pel* pcInputData, Int iStride )
-{
-  Int iSum = pcInputData[-1 * iStride ] + pcInputData[ 0 ] +  (pcInputData[iStride ] << 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;
-  Int iStrideM2 = iStrideM1 - iStride;
-  Int iStrideP1 = iStride0  + iStride;
-  Int iStrideP2 = iStrideP1 + iStride;
-
-  Int iTmp0 = pcInputData[iStrideM2] + pcInputData[iStrideP2];
-  Int iTmp1 = pcInputData[iStrideM1] + pcInputData[iStrideP1];
-  Int iTmp2 = pcInputData[iStride0 ];
-
-  Int iSum = iTmp0 +  (iTmp2 << 1) + ((iTmp1 + iTmp2) << 2);
-  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;
-  Int iStrideM2 = iStrideM1 - iStride;
-  Int iStrideM3 = iStrideM1 - iStride;
-  Int iStrideP1 = iStride0  + iStride;
-  Int iStrideP2 = iStrideP1 + iStride;
-  Int iStrideP3 = iStrideP1 + iStride;
-
-  Int iTmp0 = pcInputData[iStrideM3] + pcInputData[iStrideP3];
-  Int iTmp1 = pcInputData[iStrideM2] + pcInputData[iStrideP2];
-  Int iTmp2 = pcInputData[iStrideM1] + pcInputData[iStrideP1];
-  Int iTmp3 = pcInputData[iStride0];
-
-  Int iSum = iTmp0 - iTmp2 + ( iTmp1  << 1) + ( (iTmp1 + iTmp3) << 2) + ((iTmp2 + iTmp3) << 4);
-
-  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;
-  Int iStrideM1 = iStride0  - iStride;
-  Int iStrideM2 = iStrideM1 - iStride;
-  Int iStrideM3 = iStrideM1 - iStride;
-  Int iStrideM4 = iStrideM1 - iStride;
-  Int iStrideP1 = iStride0  + iStride;
-  Int iStrideP2 = iStrideP1 + iStride;
-  Int iStrideP3 = iStrideP1 + iStride;
-  Int iStrideP4 = iStrideP1 + iStride;
-
-  Int iTmp0 = pcInputData[iStrideM4] + pcInputData[iStrideP4];
-  Int iTmp1 = pcInputData[iStrideM3] + pcInputData[iStrideP3];
-  Int iTmp2 = pcInputData[iStrideM2] + pcInputData[iStrideP2];
-  Int iTmp3 = pcInputData[iStrideM1] + pcInputData[iStrideP1];
-  Int iTmp4 = pcInputData[iStride0];
-
-  Int iSum = iTmp0 + ((iTmp4 ) << 1) + ( ( iTmp4 - iTmp2 ) << 2) +  ( (iTmp1 - iTmp3) << 3 ) +  ((iTmp2 ) << 5) + ((iTmp3+ iTmp4 ) << 6);
-
-  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);
-
-  Double adP[4];
-  Double dSqP2 = dSq * dSq;
-  Double dSqP3 = dSqP2 * dSq;
-
-  adP[0] = 1 - 3 * dSqP2 + 2 * dSqP3;
-  adP[1] = dSq - 2 * dSqP2 + dSqP3;
-  adP[2] = 3 * dSqP2 - 2 * dSqP3;
-  adP[3] = -dSqP2 + dSqP3;
-
-  Double dQ  = adP[0] * iQ0 + adP[1] * iQ1 + adP[2] * iQ2 + adP[3] * iQ3 ;
-
-  Pel cQ = (Pel) ( dQ + 0.5);
-
-  cQ = ( cQ < 0   ? 0   : cQ );
-  cQ = ( cQ > 255 ? 255 : cQ );
-
-  return cQ;
-
-}
-
-template<UInt bitDepth>
-Void TRenFilter<bitDepth>::diffHorSym(PelImage* pcInputImage, IntImage* pcOutputImage)
-{
-  for (UInt uiCurPlane = 0; uiCurPlane < pcInputImage->getNumberOfPlanes(); uiCurPlane++)
-  {
-    diffHorSym( pcInputImage->getPlane(uiCurPlane), pcOutputImage->getPlane(uiCurPlane));
-  };
-}
-
-template<UInt bitDepth>
-Void TRenFilter<bitDepth>::diffHorSym(PelImagePlane* pcInputPlane, IntImagePlane* pcOutputPlane)
-{
-  UInt uiInputStride = pcInputPlane ->getStride();
-  UInt uiOutputStride = pcOutputPlane->getStride();
-  UInt uiWidth        = pcInputPlane ->getWidth();
-  UInt uiHeight       = pcInputPlane ->getHeight();
-
-  Pel*   pcInputData   = pcInputPlane ->getPlaneData();
-  Int*   piOutputData  = pcOutputPlane->getPlaneData();
-
-  for (UInt uiPosY = 0; uiPosY < uiHeight; uiPosY++)
-  {
-    for (UInt uiPosX = 1; uiPosX < uiWidth-1; uiPosX++)
-    {
-      piOutputData[uiPosX] = ((Int) pcInputData[uiPosX+1] - (Int) pcInputData[uiPosX-1]);
-      piOutputData[uiPosX] /= 2;
-    };
-
-    piOutputData[0] = piOutputData[1];
-    piOutputData[uiWidth-1] = piOutputData[uiWidth-2];
-    pcInputData += uiInputStride;
-    piOutputData  += uiOutputStride;
-
-  };
-}
-
-template<UInt bitDepth>
-Void TRenFilter<bitDepth>::laplace( DoubleImage* pcInputImage, DoubleImage* pcOutputImage )
-{
-  for (UInt uiCurPlane = 0; uiCurPlane < pcInputImage->getNumberOfPlanes(); uiCurPlane++)
-  {
-    DoubleImagePlane* pcInputPlane  = pcInputImage  ->getPlane(uiCurPlane);
-    DoubleImagePlane* pcOutputPlane = pcOutputImage ->getPlane(uiCurPlane);
-
-    UInt uiWidth  = pcInputPlane->getWidth();
-    UInt uiHeight = pcInputPlane->getHeight();
-
-    Double* pdInputData  = pcInputPlane  ->getPlaneData();
-    Double* pdOutputData = pcOutputPlane ->getPlaneData();
-
-    for (UInt uiPosY = 1; uiPosY < uiHeight-1; uiPosY++)
-    {
-      UInt uOff = uiPosY * uiWidth;
-      for(UInt uiPosX = 1; uiPosX < uiWidth-1; uiPosX++)
-      {
-        UInt uOff2 = uOff + uiPosX;
-        pdOutputData[uOff2] =     4 * pdInputData[uOff2]
-        -   pdInputData[uOff2 - 1]
-        -   pdInputData[uOff2 + 1]
-        -   pdInputData[uOff2 - uiWidth]
-        -   pdInputData[uOff2 + uiWidth];
-      }
-    };
-
-    // left and right margin
-    for (UInt uiPosY = 1; uiPosY < uiHeight-1; uiPosY++)
-    {
-      UInt uOff  = uiPosY * uiWidth;
-      pdOutputData[uOff] = 3 * pdInputData[uOff]
-      -   pdInputData[uOff + 1]
-      -   pdInputData[uOff - uiWidth]
-      -   pdInputData[uOff + uiWidth];
-
-
-      uOff = (uiPosY + 1) * uiWidth - 1;
-      pdOutputData[uOff] = 3 * pdInputData[uOff]
-      -   pdInputData[uOff - 1]
-      -   pdInputData[uOff - uiWidth]
-      -   pdInputData[uOff + uiWidth];
-    }
-
-    for (UInt uiPosX = 1; uiPosX < uiWidth-1; uiPosX++)
-    {
-      UInt uOff  = uiPosX;
-      pdOutputData[uOff] = 3 * pdInputData[uOff]
-      -   pdInputData[uOff + 1]
-      -   pdInputData[uOff - 1]
-      -   pdInputData[uOff + uiWidth];
-
-
-      uOff = (uiHeight - 1) * uiWidth + uiPosX;
-      pdOutputData[uOff] = 3 * pdInputData[uOff]
-      -   pdInputData[uOff + 1]
-      -   pdInputData[uOff - 1]
-      -   pdInputData[uOff - uiWidth];
-    }
-
-    UInt uOff = 0;
-    pdOutputData[uOff] = 2 * pdInputData[uOff] - pdInputData[uOff+1] - pdInputData[ uOff + uiWidth];
-    uOff = uiWidth - 1;
-    pdOutputData[uOff] = 2 * pdInputData[uOff] - pdInputData[uOff-1] - pdInputData[ uOff + uiWidth ];
-    uOff = (uiHeight - 1) * uiWidth;
-    pdOutputData[uOff] = 2 * pdInputData[uOff] - pdInputData[uOff+1] - pdInputData[ uOff - uiWidth];
-    uOff = uiHeight * uiWidth - 1;
-    pdOutputData[uOff] = 2 * pdInputData[uOff] - pdInputData[uOff-1] - pdInputData[ uOff - uiWidth];
-
-  }
-}
-
-template<UInt bitDepth>
-Void TRenFilter<bitDepth>::conv( PelImage* pcImage, DoubleImage* pcKernel )
-{
-  PelImage* pcTemp = pcImage->create();
-
-  DoubleImagePlane* pcKernelPlane = 0;
-  for (UInt uiCurPlane = 0; uiCurPlane < pcImage->getNumberOfPlanes(); uiCurPlane++) {
-
-    PelImagePlane* pcPlane     = pcImage->getPlane(uiCurPlane);
-    PelImagePlane* pcTempPlane = pcTemp ->getPlane(uiCurPlane);
-
-    if ( uiCurPlane <= pcKernel->getNumberOfPlanes() )
-    {
-      pcKernelPlane = pcKernel->getPlane(uiCurPlane);
-    };
-
-    UInt uiWidth  = pcPlane->getWidth();
-    UInt uiHeight = pcPlane->getHeight();
-
-    UInt uiKernelWidth  = pcKernelPlane->getWidth();
-    UInt uiKernelHeight = pcKernelPlane->getHeight();
-
-    Pel*    pcData         = pcPlane      ->getPlaneData();
-    Pel*    pcTempData     = pcTempPlane  ->getPlaneData();
-    Double* pdKernelData   = pcKernelPlane->getPlaneData();
-
-    UInt uiDataStride       = pcPlane      ->getStride();
-    UInt uiTempDataStride   = pcTempPlane  ->getStride();
-    UInt uiKernelDataStride = pcKernelPlane->getStride();
-
-    for(UInt uiPosY = 0; uiPosY < uiHeight; uiPosY++)
-    {
-      UInt uOff = uiPosY * uiTempDataStride;
-      for(UInt uiPosX = 0; uiPosX < uiWidth; uiPosX++)
-      {
-        Double dSum = 0;
-        for(UInt uKY = 0; uKY < uiKernelHeight; uKY++)
-        {
-          UInt uKOff = uKY * uiKernelDataStride;
-
-          Int iYSrc = uiPosY - (uiKernelHeight/2) + uKY;
-
-          if (iYSrc < 0)
-            iYSrc = -iYSrc;
-
-          if (iYSrc >= (Int)uiHeight)
-            iYSrc = 2*uiHeight - iYSrc - 1;
-
-          UInt uSrcOff = iYSrc * uiDataStride;
-
-          for(UInt uKX = 0; uKX < uiKernelWidth; uKX++)
-          {
-            Int iXSrc = uiPosX - (uiKernelWidth/2) + uKX;
-
-            if (iXSrc < 0)
-              iXSrc = -iXSrc;
-
-            if (iXSrc >= (Int)uiWidth)
-              iXSrc = 2*uiWidth - iXSrc - 1;
-
-            dSum += pcData[uSrcOff + iXSrc] * pdKernelData[uKOff + uKX];
-          }
-        }
-        pcTempData[uOff + uiPosX] = (Pel) (dSum + ( ( dSum < 0 ) ? -0.5 : 0.5)  );
-      }
-    }
-  }
-
-  pcImage->assign(pcTemp);
-  delete pcTemp;
-}
-
-
-// Horizontal Up sampling luma
-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 )
-  {
-  case 0:
-    xDistributeArray              ( pcInputPlaneData, iInputStride, 1 , 1, iInputWidth, iHeight, pcOutputPlaneData, iOutputStride, 1, 1 );
-    break;
-  case 1:
-    xDistributeArray              ( pcInputPlaneData, iInputStride, 1 , 1, iInputWidth, iHeight, pcOutputPlaneData, iOutputStride, 2, 1 );
-    cFilter.xCTI_FilterHalfHor    ( pcInputPlaneData, iInputStride,     1, iInputWidth, iHeight, iOutputStride, 2, ++pcOutputPlaneData );
-    break;
-  case 2:
-    xDistributeArray              ( pcInputPlaneData, iInputStride, 1 , 1, iInputWidth, iHeight, pcOutputPlaneData, iOutputStride, 4, 1 );
-    cFilter.xCTI_FilterQuarter0Hor( pcInputPlaneData, iInputStride, 1, iInputWidth, iHeight, iOutputStride, 4, ++pcOutputPlaneData );
-    cFilter.xCTI_FilterHalfHor    ( pcInputPlaneData, iInputStride, 1, iInputWidth, iHeight, iOutputStride, 4, ++pcOutputPlaneData );
-    cFilter.xCTI_FilterQuarter1Hor( pcInputPlaneData, iInputStride, 1, iInputWidth, iHeight, iOutputStride, 4, ++pcOutputPlaneData );
-    break;
-  }
-}
-
-// horizontal up sampling chroma
-template<UInt bitDepth>
-Void TRenFilter<bitDepth>::sampleCHorUp(Int iLog2HorSampFac, Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
-{
-  switch ( iLog2HorSampFac )
-  {
-  case 0:
-    xDistributeArray( pcInputPlaneData,   iInputStride  , 1, 1, iInputWidth,   iHeight   , pcOutputPlaneData                  , iOutputStride, 1 , 1 );
-    break;
-  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<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<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  )
-{
-
-  switch ( iLog2HorSampFac )
-  {
-  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<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<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<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;
-  }
-}
-
-// Down Sampling
-// Down sample luma
-template<UInt bitDepth>
-Void TRenFilter<bitDepth>::sampleHorDown(Int iLog2HorSampFac,  Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
-{
-  switch ( iLog2HorSampFac )
-  {
-  case 0:
-    xDistributeArray( pcInputPlaneData, iInputStride, 1, 1, iInputWidth,iHeight, pcOutputPlaneData, iOutputStride, 1 , 1 );
-    break;
-  case 1:
-    xSampleDownHor2(pcInputPlaneData, iInputStride, iInputWidth, iHeight, pcOutputPlaneData, iOutputStride);
-    break;
-  case 2:
-    xSampleDownHor4(pcInputPlaneData, iInputStride, iInputWidth, iHeight, pcOutputPlaneData, iOutputStride);
-    break;
-  }
-}
-
-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
-  sampleHorDown( iLog2HorSampFac, pcInputPlaneData, iInputStride, iInputWidth, iHeight, pcOutputPlaneData, iOutputStride);
-}
-
-
-
-// Up sampling chroma
-template<UInt bitDepth>
-Void TRenFilter<bitDepth>::sampleCDownHorDown( Int iLog2HorSampFac,  Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iInputHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
-{
-  // create buffer
-  Int iBufferStride   = iInputWidth >> (iLog2HorSampFac + 1);
-  Pel* piBuffer       = new Pel[ iBufferStride * (iInputHeight+2) ];
-
-  switch ( iLog2HorSampFac )
-  {
-  case 0:
-    xSampleDownHor2( pcInputPlaneData - iInputStride,  iInputStride, iInputWidth  , iInputHeight+1, piBuffer,  iBufferStride);
-    break;
-  case 1:
-    xSampleDownHor4( pcInputPlaneData - iInputStride , iInputStride,  iInputWidth , iInputHeight+1, piBuffer, iBufferStride);
-    break;
-  case 2:
-    xSampleDownHor8( pcInputPlaneData - iInputStride , iInputStride,  iInputWidth  , iInputHeight+1, piBuffer, iBufferStride);
-    break;
-  }
-  xSampleDownVer2( piBuffer + iBufferStride       , iBufferStride, iBufferStride, iInputHeight,   pcOutputPlaneData, iOutputStride);
-  delete[] piBuffer;
-}
-
-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;
-  iSrcStride *= iSrcStepY;
-  for (Int iYPos = 0; iYPos < iHeight; iYPos++ )
-  {
-    Pel* pcCurDst = pcDst;
-    const Pel* pcCurSrc  = pcSrc;
-    for (Int iXPos = 0; iXPos < iWidth; iXPos ++)
-    {
-      *pcCurDst = *pcCurSrc;
-
-      pcCurDst += iDstStepX;
-      pcCurSrc += iSrcStepX;
-    }
-    pcDst  += iDstStride;
-    pcSrc  += iSrcStride;
-  }
-}
-
-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<REN_BIT_DEPTH> cFilter;
-  for ( Int y = iHeight; y != 0; y-- )
-  {
-    piSrcTmp = piSrc - iSrcStepX;
-    for ( Int x = 0; x < iWidth; x++ )
-    {
-      iSum      = (cFilter.*fpFilter)( piSrcTmp,  iSrcStepX );
-      piDst[x * iDstStepX ] =  ClipBD ((iSum +  32) >>  6 , bitDepth);
-      piSrcTmp+= iSrcStepX;
-    }
-    piSrc += iSrcStride * iSrcStepY;
-    piDst += iDstStride * iDstStepY;
-  }
-}
-
-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<bitDepth> cFilter;
-  for ( Int y = iHeight; y != 0; y-- )
-  {
-    piSrcTmp = piSrc - iSrcStepY * iSrcStride;
-    for ( Int x = 0; x < iWidth; x++ )
-    {
-      iSum      = (cFilter.*fpFilter)( piSrcTmp,  iSrcStepY * iSrcStride );
-      piDst[x * iDstStepX ]  =  ClipBD ((iSum +  32) >>  6, bitDepth );
-      piSrcTmp += iSrcStepX;
-    }
-    piSrc += iSrcStride * iSrcStepY;
-    piDst += iDstStride * iDstStepY;
-  }
-}
-
-template<UInt bitDepth>
-Void TRenFilter<bitDepth>::xSampleDownHor2( Pel* piSrc, Int iSrcStride, Int iSrcWidth, Int iHeight, Pel* piDst, Int iDstStride  )
-{ 
-
-  Int   iSum;
-  Pel*  piSrcTmp;
-
-
-  for ( Int y = iHeight; y != 0; y-- )
-  {
-    piSrcTmp = piSrc - 1 ;
-    for ( Int x = 0; x < (iSrcWidth >> 1); x++ )
-    {
-      // { 1,2,1 }
-      iSum = piSrcTmp[0] + piSrcTmp[2] +  (piSrcTmp[1] << 1);
-      piDst[x] = ClipBD( (iSum +  2) >>  2 , bitDepth);
-      piSrcTmp += 2;
-    }
-    piSrc += iSrcStride;
-    piDst += iDstStride;
-  }
-};
-
-template<UInt bitDepth>
-Void TRenFilter<bitDepth>::xSampleDownVer2( Pel* piSrc, Int iSrcStride, Int iSrcWidth, Int iSrcHeight, Pel* piDst, Int iDstStride  )
-{
-  Int   iSum;
-  Pel*  piSrcTmp;
-
-  for ( Int y = (iSrcHeight >> 1); y != 0; y-- )
-  {
-    piSrcTmp = piSrc -1 * iSrcStride;
-    for ( Int x = 0; x < iSrcWidth; x++ )
-    {
-      // { 1,2,1 }
-      iSum = piSrcTmp[0] + piSrcTmp[ iSrcStride << 1] +  (piSrcTmp[ iSrcStride ] << 1);
-      piDst[x] = ClipBD( (iSum +  2) >>  2, bitDepth );
-      piSrcTmp += 1;
-    }
-    piSrc += (iSrcStride << 1);
-    piDst += iDstStride;
-  }
-};
-
-template<UInt bitDepth>
-Void TRenFilter<bitDepth>::xSampleDownHor4( Pel* piSrc, Int iSrcStride, Int iSrcWidth, Int iHeight, Pel* piDst, Int iDstStride  )
-{ 
-
-  Int   iSum;
-  Pel*  piSrcTmp;
-
-  Int iTmp0, iTmp1, iTmp2;
-
-  for ( Int y = iHeight; y != 0; y-- )
-  {
-    piSrcTmp = piSrc -2 ;
-    for ( Int x = 0; x < (iSrcWidth >> 2); x++ )
-    {
-      // { 1,4,6,4,1 }
-      iTmp0 = piSrcTmp[0] + piSrcTmp[4];
-      iTmp1 = piSrcTmp[1] + piSrcTmp[3];
-      iTmp2 = piSrcTmp[2];
-
-      iSum = iTmp0 +  (iTmp2 << 1) + ((iTmp1 + iTmp2) << 2);
-      piDst[x] = ClipBD( (iSum +  8) >>  4, bitDepth );
-      piSrcTmp += 4;
-    }
-    piSrc += iSrcStride;
-    piDst += iDstStride;
-  }
-};
-
-template<UInt bitDepth>
-Void TRenFilter<bitDepth>::xSampleDownHor8( Pel* piSrc, Int iSrcStride, Int iSrcWidth, Int iHeight, Pel* piDst, Int iDstStride  )
-{
-  Int   iSum;
-  Pel*  piSrcTmp;
-
-  Int iTmp0, iTmp1, iTmp2, iTmp3;
-
-  for ( Int y = iHeight; y != 0; y-- )
-  {
-    piSrcTmp = piSrc -3;
-    for ( Int x = 0; x < (iSrcWidth >> 3); x++ )
-    {
-      // { 1,6,15,20,15,6,1 }
-      iTmp0 = piSrcTmp[0] + piSrcTmp[6];
-      iTmp1 = piSrcTmp[1] + piSrcTmp[5];
-      iTmp2 = piSrcTmp[2] + piSrcTmp[4];
-      iTmp3 = piSrcTmp[3];
-
-      iSum = iTmp0 - iTmp2 + ( iTmp1  << 1) + ( (iTmp1 + iTmp3) << 2) + ((iTmp2 + iTmp3) << 4);
-      piDst[x] = ClipBD( (iSum +  32) >>  6 , bitDepth);
-      piSrcTmp += 8;
-    }
-    piSrc += iSrcStride;
-    piDst += iDstStride;
-  }
-};
-
-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;
-  Int iInc         = 1;
-  Int iSDimStart   = 0;
-
-  Int iFDimSrcStrd = bVerticalDir ? 1          : iSrcStride;
-  Int iFDimDstStrd = bVerticalDir ? 1          : iDstStride;
-
-  Int iSDimSrcStrd = bVerticalDir ? iSrcStride : 1;
-  Int iSDimDstStrd = bVerticalDir ? iDstStride : 1;
-
-  Int iFDimEnd     = bVerticalDir ? iWidth -1  : iHeight - 1;
-  Int iSDimEnd     = bVerticalDir ? iHeight-1  : iWidth  - 1;
-
-  if ( bToTopOrLeft )
-  {
-    iSDimStart    = iSDimEnd;
-    iSDimEnd      = 0;
-    iInc         *= -1;
-  }
-
-  for (Int iPosFDim = iFDimStart; iPosFDim <= iFDimEnd; iPosFDim++ )
-  {
-    Int  iCount      = 0;
-    Bool bLastWasOne = false;
-    Bool bDilate     = false;
-    Int  iPosSDim    = iSDimStart;
-    Bool bContinue   = true;
-
-    while ( bContinue )
-    {
-      if ( iCount == iSize )
-      {
-        iCount  = 0;
-        bDilate = false;
-      }
-
-      Pel iVal = piSrc[iPosSDim*iSDimSrcStrd];
-      if( iVal == 0 && bLastWasOne )
-      {
-        iCount  = 0;
-        bDilate = true;
-      }
-
-      if( bDilate )
-      {
-        piDst[iPosSDim*iSDimDstStrd] = REN_USED_PEL;
-        iCount++;
-      }
-      else
-      {
-        piDst[iPosSDim*iSDimDstStrd] = iVal;
-      }
-
-
-      bLastWasOne = (iVal == REN_USED_PEL);
-      bContinue   = (iPosSDim != iSDimEnd);
-      iPosSDim    += iInc;
-    }
-
-    piSrc += iFDimSrcStrd;
-    piDst += iFDimDstStrd;
-  }
-};
-
-
-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-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenFilter.h
===================================================================
--- branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenFilter.h	(revision 1389)
+++ branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenFilter.h	(revision 1390)
@@ -39,104 +39,3 @@
 #include "TRenImage.h"
 #include "TRenInterpFilter.h"
-#if NH_3D_VSO
-
-typedef Int (TRenInterpFilter<REN_BIT_DEPTH>::*FpChromaIntFilt) ( Pel*, Int );
-
-template<UInt bitDepthLuma>
-class TRenFilter
-{
-public:
-
-  /////////// Helpers ////////
-  static Void setSubPelShiftLUT ( Int iLutPrec, Int** piSubPelShiftLUT, Int iShift );
-  static Void setupZLUT         ( Bool bBlendUseDistWeight, Int iBlendZThresPerc, Int iRelDistToLeft, Int** ppiBaseShiftLUTLeft, Int** ppiBaseShiftLUTRight, Int& riBlendZThres, Int& riBlendDistWeight, Int* piInvZLUTLeft, Int* piInvZLUTRight );
-  static Void filledToUsedPelMap( PelImage* pcFilledImage, PelImage* pcUsedPelsImage, Int iUsedPelMapMarExt  );
-
-  /////////// Copy ///////////
-  static Void copy( const Pel* pcInputPlaneData, Int iInputStride, Int iWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride);
-
-  /////////// Horizontal Mirroring ///////////
-  template <typename T> static Void mirrorHor(        TRenImage<T> *pcInputImage );
-  //Plane
-  template <typename T> static Void mirrorHor(   TRenImagePlane<T> *pcImagePlane );
-
-  /////////// Comparison ///////////
-
-  static Int64                          SSE  ( PelImagePlane*     pcInputPlane1, PelImagePlane*      pcInputPlane2, Bool bLuma );
-  static Int64                          SSE  ( Pel* piSrc1,       Int iSrcStride1, Int iWidth, Int iHeight,  Pel* piSrc2, Int iSrcStride2, Bool bLuma );
-
-  template <typename T> static Bool compare  (TRenImage<T> *pcInputImage1     , TRenImage<T> *pcInputImage2);
-  //Plane
-  template <typename T> static Bool compare  (TRenImagePlane<T>* pcInputPlane1, TRenImagePlane<T>* pcInputPlane2 );
-
-  /////////// other Filters ///////////
-  static Void binominal  ( PelImage*      pcInputImage,  PelImage*      pcOutputPlane, UInt uiSize);
-  static Void binominal  ( PelImagePlane* pcInputPlane,  PelImagePlane* pcOutputPlane, UInt uiSize );
-
-  static Void lineMedian3( PelImage*      pcImage );
-  static Void convRect   ( PelImage*      pcImage,       UInt uiSize);
-  static Void laplace    ( DoubleImage*   pcInputImage,  DoubleImage* pcOutputImage);
-  static Void diffHorSym ( PelImage*      pcInputImage,  IntImage* pcOutputImage);
-
-  //Plane
-  static Void diffHorSym (PelImagePlane* pcInputPlane, IntImagePlane* pcOutputPlane);
-
-  ///////////  Convolution ///////////
-  static Void conv (PelImage* pcImage, DoubleImage* pcKernel);
-
-  /////////// InterPolation ///////////
-  static Pel interpCHSpline(Double dX, Double dS0, Double dS1, Int iQ0, Int iQ1, Int iQ2, Int iQ3);
-
-
-  /////////// HEVC/ binomial Up and Down sampling ///////////
-  //// Down sampling (binomial)
-  // Horizontally
-  static Void sampleHorDown     (Int iLog2HorSampFac, Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight     , Pel* pcOutputPlaneData, Int iOutputStride );
-  static Void sampleCHorDown    (Int iLog2HorSampFac, Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iInputHeight, Pel* pcOutputPlaneData, Int iOutputStride );
-  // 444->420 and horizontally
-  static Void sampleCDownHorDown(Int iLog2HorSampFac, Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iInputHeight, Pel* pcOutputPlaneData, Int iOutputStride );
-
-  //// Up sampling (HEVC 8/4 tap)
-  // Horizontally
-  static Void sampleHorUp       (Int iLog2HorSampFac, Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight,      Pel* pcOutputPlaneData, Int iOutputStride );
-  static Void sampleCHorUp      (Int iLog2HorSampFac, Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight,      Pel* pcOutputPlaneData, Int iOutputStride );
-  // 420->444 and horizontally
-  static Void sampleCUpHorUp    (Int iLog2HorSampFac, Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight,      Pel* pcOutputPlaneData, Int iOutputStride );
-
-  //// Down sampling (13 tap)
-
-  static Void sampleDown2Tap13   ( Pel* pcInputPlaneData, Int iInputStride, Int iWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride );
-  // Plane
-  static Void sampleHorDown2Tap13(PelImagePlane* pcInputPlane, PelImagePlane* pcOutputPlane, Int uiPad);
-  static Void sampleVerDown2Tap13(PelImagePlane* pcInputPlane, PelImagePlane* pcOutputPlane, Int uiPad);
-  static Void sampleDown2Tap13   (PelImagePlane* pcInputPlane, PelImagePlane* pcOutputPlane);
-  // Image
-  static Void sampleDown2Tap13   (PelImage*      pcInputImage, PelImage*      pcOutputImage);
-  static Void sampleUp2Tap13     (PelImage*      pcInputImage, PelImage*      pcOutImage   );
-private:
-
-  // Helper Functions
-  static inline Pel   xMedian3 (Pel* pcData);
-  static Void         xDilate (Pel* piSrc, Int iSrcStride, Int    iWidth, Int iHeight,    Pel* piDst, Int iDstStride, Int iSize, Bool bVerticalDir, Bool bToTopOrLeft );
-
-  // Down sampling (binomial)
-  static Void xSampleDownHor2 (Pel* piSrc, Int iSrcStride, Int iSrcWidth, Int iHeight,    Pel* piDst, Int iDstStride );
-  static Void xSampleDownHor4 (Pel* piSrc, Int iSrcStride, Int iSrcWidth, Int iHeight,    Pel* piDst, Int iDstStride );
-  static Void xSampleDownHor8 (Pel* piSrc, Int iSrcStride, Int iSrcWidth, Int iHeight,    Pel* piDst, Int iDstStride );
-
-  static Void xSampleDownVer2 (Pel* piSrc, Int iSrcStride, Int iSrcWidth, Int iSrcHeight, Pel* piDst, Int iDstStride );
-
-  // Up sampling (8/4-Tap HEVC)
-  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(const Pel* pcSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* pcDst, Int iDstStride, Int iDstStepX, Int iDstStepY );
-
-  // Binominal Filtering
-  static Pel  xFiltBinom3     (Pel* pcInputData, Int iStride );
-  static Pel  xFiltBinom5     (Pel* pcInputData, Int iStride );
-  static Pel  xFiltBinom7     (Pel* pcInputData, Int iStride );
-  static Pel  xFiltBinom9     (Pel* pcInputData, Int iStride );
-};
-
-#endif
 #endif //__TRENFILTER__
Index: branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenImage.cpp
===================================================================
--- branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenImage.cpp	(revision 1389)
+++ branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenImage.cpp	(revision 1390)
@@ -37,239 +37,2 @@
 #include "TRenFilter.h"
 #include "assert.h"
-#if NH_3D_VSO
-
-
-template<typename T>
-TRenImage<T>::TRenImage( TRenImage& rcIn )
-{  
-  allocatePlanes( rcIn.getPlane(0)->getWidth(), rcIn.getPlane(0)->getHeight(), rcIn.getNumberOfFullPlanes(), rcIn.getNumberOfQuaterPlanes() ) ; assign(&rcIn);
-}
-
-template<typename T>
-TRenImage<T>::TRenImage( UInt uiWidth, UInt uiHeight, UInt uiNumberOfFullPlanes, UInt uiNumberOfQuaterPlanes )
-{  
-  allocatePlanes( uiWidth, uiHeight, uiNumberOfFullPlanes, uiNumberOfQuaterPlanes );
-}
-
-template<typename T>
-TRenImage<T>::TRenImage() : m_uiNumberOfFullPlanes(0), m_uiNumberOfQuaterPlanes(0), m_uiNumberOfPlanes(0), m_apcPlanes(0)
-{
-  
-}
-
-
-template<>
-TRenImage<Pel>::TRenImage( TComPicYuv* pcPicYuv, Bool bFirstPlaneOnly )
-{ 
-  if (bFirstPlaneOnly) //400
-  {
-    m_uiNumberOfPlanes       = 1;
-    m_uiNumberOfFullPlanes   = 1;
-    m_uiNumberOfQuaterPlanes = 0;
-    m_apcPlanes    = new TRenImagePlane<Pel>*[ m_uiNumberOfPlanes ];
-    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
-  {
-    m_uiNumberOfPlanes       = 3;
-    m_uiNumberOfFullPlanes   = 1;
-    m_uiNumberOfQuaterPlanes = 2;
-
-    m_apcPlanes    = new TRenImagePlane<Pel>*[ m_uiNumberOfPlanes ];
-    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 );
-  }
-}
-
-template<typename T>
-TRenImage<T>* TRenImage<T>::create()
-{
-  return new TRenImage( m_apcPlanes[0]->getWidth(), m_apcPlanes[0]->getHeight(), m_uiNumberOfFullPlanes, m_uiNumberOfQuaterPlanes );
-}
-
-
-template<typename T>
-TRenImage<T>::TRenImage( TComPicYuv* pcPicYuv, Bool bFirstPlaneOnly )
-{
-  assert(0);
-}
-
-template<class T>
-TRenImagePlane<T>* TRenImage<T>::getPlane(UInt uiPlaneNumber) const
-{
-  return m_apcPlanes[uiPlaneNumber];
-}
-
-template<class T>
-TRenImagePlane<T>** TRenImage<T>::getPlanes() const
-{
-  return m_apcPlanes;
-}
-
-template<typename T>
-Void TRenImage<T>::getDataAndStrides( T** pptData, Int* piStrides ) const
-{
-  for (UInt uiCurPlane = 0; uiCurPlane < m_uiNumberOfPlanes; uiCurPlane++ )
-  {
-    piStrides[uiCurPlane] = m_apcPlanes[uiCurPlane]->getStride   ();
-    pptData  [uiCurPlane] = m_apcPlanes[uiCurPlane]->getPlaneData();
-  }
-}
-
-
-template<typename T>
-Void TRenImage<T>::getWidthAndHeight( Int* ppiWidths, Int* ppiHeights ) const
-{
-  for (UInt uiCurPlane = 0; uiCurPlane < m_uiNumberOfPlanes; uiCurPlane++ )
-  {
-    ppiWidths [uiCurPlane] = m_apcPlanes[uiCurPlane]->getWidth ();
-    ppiHeights[uiCurPlane] = m_apcPlanes[uiCurPlane]->getHeight();
-  }
-}
-
-template<typename T>
-Void TRenImage<T>::allocatePlanes( UInt uiWidth, UInt uiHeight, UInt uiNumberOfFullPlanes, UInt uiNumberOfQuaterPlanes )
-{
-  assert( uiNumberOfFullPlanes + uiNumberOfQuaterPlanes);
-
-  UInt uiHalfWidth  = uiWidth  / 2;
-  UInt uiHalfHeight = uiHeight / 2;
-
-  uiHalfWidth  = (uiHalfWidth  == 0) ? 1 : uiHalfWidth ;
-  uiHalfHeight = (uiHalfHeight == 0) ? 1 : uiHalfHeight;
-
-  m_uiNumberOfPlanes       = uiNumberOfFullPlanes + uiNumberOfQuaterPlanes; ;
-  m_uiNumberOfFullPlanes   = uiNumberOfFullPlanes;
-  m_uiNumberOfQuaterPlanes = uiNumberOfQuaterPlanes;
-
-  this->m_apcPlanes    = new TRenImagePlane<T>*[m_uiNumberOfPlanes];
-
-  for (UInt uiCurPlane = 0; uiCurPlane < uiNumberOfFullPlanes; uiCurPlane++)
-  {
-    this->m_apcPlanes[uiCurPlane] = new TRenImagePlane<T>(uiWidth, uiHeight, REN_LUMA_MARGIN);
-  };
-
-  for (UInt uiCurPlane = 0; uiCurPlane < uiNumberOfQuaterPlanes; uiCurPlane++)
-  {
-    this->m_apcPlanes[uiCurPlane+uiNumberOfFullPlanes] = new TRenImagePlane<T>(uiHalfWidth, uiHalfHeight, REN_LUMA_MARGIN >> 1);
-  };
-}
-
-
-template<class T>
-Void TRenImage<T>::assign(Int iVal)
-{
-  for (UInt uiCurPlane = 0; uiCurPlane < m_uiNumberOfPlanes; uiCurPlane++)
-  {
-    m_apcPlanes[uiCurPlane]->assign( iVal);
-  }
-}
-
-
-template<class T>
-Void TRenImage<T>::devide( Double dDevisor )
-{
-  for (UInt uiCurPlane = 0; uiCurPlane < m_uiNumberOfPlanes; uiCurPlane++)
-  {
-    m_apcPlanes[uiCurPlane]->devide(dDevisor);
-  }
-}
-
-
-template<class T> template<class S>
-Void TRenImage<T>::assign( TRenImage<S>* pcSrcImage )
-{
-  if (pcSrcImage->getNumberOfPlanes() != m_uiNumberOfPlanes )
-  {
-    assert(0);
-  }
-
-  for (UInt uiCurPlane = 0; uiCurPlane < m_uiNumberOfPlanes; uiCurPlane++)
-  {
-    m_apcPlanes[uiCurPlane]->assign(pcSrcImage->getPlane(uiCurPlane)->getPlaneDataOrg(),pcSrcImage->getPlane(uiCurPlane)->getStride());
-  }
-}
-
-
-template<typename T>
-Void TRenImage<T>::setData( TRenImage* pcInputImage, Bool bClean )
-{
-  for (UInt uiPlane = 0; uiPlane < m_uiNumberOfPlanes; uiPlane++)
-  {
-    m_apcPlanes[uiPlane]->setData( pcInputImage->getPlane( uiPlane ), bClean );
-  }
-}
-
-template<typename T>
-Void TRenImage<T>::extendMargin()
-{
-  for (UInt uiPlane = 0; uiPlane < m_uiNumberOfPlanes; uiPlane++)
-  {
-    m_apcPlanes[uiPlane]->extendMargin();
-  }
-}
-
-template<class T>
-Void TRenImage<T>::xDeletePlanes()
-{
-  for (UInt uiCurPlane = 0; uiCurPlane < m_uiNumberOfPlanes; uiCurPlane++)
-  {
-    if ( m_apcPlanes[uiCurPlane])
-    {
-      delete m_apcPlanes[uiCurPlane];
-    }
-    m_apcPlanes[uiCurPlane] = 0;
-  }
-}
-
-
-template<class T>
-Void TRenImage<T>::init()
-{
-  // YUV-init
-  m_apcPlanes[0]->assign((Pel) 0 );
-
-  for (UInt uiCurPlane = 1; uiCurPlane < m_uiNumberOfPlanes; uiCurPlane++)
-  {
-    m_apcPlanes[uiCurPlane]->assign( (Pel) ( 1 << ( REN_BIT_DEPTH - 1 ) ) );
-  }
-}
-
-
-template<class T>
-TRenImage<T>::~TRenImage()
-{
-  xDeletePlanes();
-  delete[] m_apcPlanes;
-}
-
-
-
-template<class T>
-UInt TRenImage<T>::getNumberOfPlanes() const
-{
-  return m_uiNumberOfPlanes;
-}
-
-template<class T>
-UInt TRenImage<T>::getNumberOfQuaterPlanes() const
-{
-  return m_uiNumberOfQuaterPlanes;
-}
-
-template<class T>
-UInt TRenImage<T>::getNumberOfFullPlanes() const
-{
-  return m_uiNumberOfFullPlanes;
-}
-
-template class TRenImage<Pel>;
-template class TRenImage<Int>;
-template class TRenImage<Double>;
-template class TRenImage<Bool>;
-
-
-template Void TRenImage<Pel>::assign<Pel>    (TRenImage<Pel>*   );
-
-#endif // NH_3D
Index: branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenImage.h
===================================================================
--- branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenImage.h	(revision 1389)
+++ branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenImage.h	(revision 1390)
@@ -39,67 +39,4 @@
 #include "../TLibCommon/TComPicYuv.h"
 #include "TRenImagePlane.h"
-#if NH_3D_VSO
-
-
-#define PelImage    TRenImage<Pel>
-#define DoubleImage TRenImage<Double>
-#define IntImage    TRenImage<Int>
-
-
-template<typename T>
-class TRenImage
-{
-public:
-
-  // Construction
-  TRenImage( TRenImage& rcInputImage );
-  TRenImage();
-//  TRenImage( TRenImagePlane<T>** ppcYPlanes, UInt uiNumberOfFullPlanes, UInt uiNumberOfQuaterPlanes );
-
-  TRenImage( UInt uiWidth, UInt uiHeight, UInt uiNumPlanes, UInt uiNumQPlanes );
-  TRenImage( TComPicYuv* pcPicYuvIn, Bool bFirstPlaneOnly = false );
-
-  Void allocatePlanes(UInt uiWidth, UInt uiHeight, UInt uiNumFullPlanes, UInt uiNumQuaterPlanes);
-  ~TRenImage();
-
-  TRenImage* create();
-  Void       init();
-
-  // Get Planes and data
-  TRenImagePlane<T>*  getPlane(UInt uiPlaneNumber) const;
-  TRenImagePlane<T>** getPlanes() const;
-
-  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() 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
-  Void assign(Int iVal);
-  template<typename S> Void assign(TRenImage<S>* pcSrcImage);
-  Void setData( TRenImage* pcInputImage, Bool bClean );
-
-  Void extendMargin();
-  // Operators
-  Void devide( Double dDevisor );
-
-
-private:
-
-  UInt m_uiNumberOfFullPlanes;
-  UInt m_uiNumberOfQuaterPlanes;
-  UInt m_uiNumberOfPlanes;
-  UInt m_bitDepth;
-  TRenImagePlane<T> ** m_apcPlanes;   // First Full Planes, then Quater Planes
-
-  Void xDeletePlanes();
-};
-
-#endif // NH_3D
 #endif // __TRENIMAGE__
 
Index: branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenImagePlane.cpp
===================================================================
--- branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenImagePlane.cpp	(revision 1389)
+++ branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenImagePlane.cpp	(revision 1390)
@@ -36,496 +36,3 @@
 #include "TRenFilter.h"
 #include <string.h>
-#if NH_3D_VSO
 
-/////// TRenImagePlane ///////
-
-template<class T>
-TRenImagePlane<T>::TRenImagePlane() { m_bClean = true; }
-
-template<class T>
-TRenImagePlane<T>::TRenImagePlane(UInt uiWidth, UInt uiHeight, UInt uiPad)
-: m_uiWidth(uiWidth), m_uiHeight(uiHeight), m_uiStride(uiWidth+2*uiPad), m_uiWidthOrg(uiWidth+2*uiPad), m_uiHeightOrg(uiHeight+2*uiPad), m_uiPad(uiPad)
-{
-  m_pcDataOrg = new T[ m_uiWidthOrg * m_uiHeightOrg ];
-  m_pcData    = m_pcDataOrg + m_uiPad * m_uiStride + m_uiPad;
-  m_bClean    = true;
-}
-
-template<class T>
-TRenImagePlane<T>::TRenImagePlane(TRenImagePlane* pcPlane)
-: m_uiWidth   (pcPlane->getWidth   ())
-, m_uiHeight  (pcPlane->getHeight  ())
-, m_uiStride  (pcPlane->getStride  ())
-, m_uiWidthOrg(pcPlane->getWidthOrg())
-, m_uiHeightOrg(pcPlane->getHeightOrg())
-, m_uiPad     (pcPlane->getPad     ())
-{
-  m_pcData = new T[m_uiWidthOrg*m_uiHeightOrg];
-  m_bClean = true;
-  assign( pcPlane );
-}
-
-template<typename T>
-TRenImagePlane<T>::TRenImagePlane( T* pcDataOrg, UInt uiWidthOrg, UInt uiHeightOrg, UInt uiStride, UInt uiPad )
-: m_pcData     (pcDataOrg + uiStride * uiPad + uiPad )
-, m_uiWidth    (uiWidthOrg  - 2* uiPad )
-, m_uiHeight   (uiHeightOrg - 2* uiPad )
-, m_uiStride   (uiStride   )
-, m_pcDataOrg  (pcDataOrg  )
-, m_uiWidthOrg (uiWidthOrg )
-, m_uiHeightOrg(uiHeightOrg)
-, m_uiPad      (uiPad      )
-, m_bClean     (false      )
-{
-
-}
-
-template<typename T>
-Void TRenImagePlane<T>::setData( T* pDataOrg, UInt uiWidthOrg, UInt uiHeightOrg, UInt uiStride, UInt uiPad, Bool bClean /*= false*/ ) 
-{
-  deleteData();
-  m_uiPad       = uiPad;
-  m_pcDataOrg   = pDataOrg;
-  m_uiWidthOrg  = uiWidthOrg;
-  m_uiHeightOrg = uiHeightOrg;
-  m_uiWidth     = uiWidthOrg  - 2* uiPad;
-  m_uiHeight    = uiHeightOrg - 2* uiPad;
-  m_uiStride    = uiStride;
-  m_pcData      = m_pcDataOrg + uiPad * m_uiStride + uiPad;
-  m_bClean      = bClean;
-}
-
-template<typename T>
-Void TRenImagePlane<T>::setData( TRenImagePlane<T>* pcInPlane, Bool bClean )
-{
-  deleteData();
-  m_uiPad       = pcInPlane->getPad();
-  m_pcDataOrg   = pcInPlane->getPlaneDataOrg();
-  m_uiWidthOrg  = pcInPlane->getWidthOrg();
-  m_uiHeightOrg = pcInPlane->getHeightOrg();
-  m_uiWidth     = pcInPlane->getWidth();
-  m_uiHeight    = pcInPlane->getHeight();
-  m_uiStride    = pcInPlane->getStride();
-  m_pcData      = pcInPlane->getPlaneData();
-  m_bClean      = bClean;
-  pcInPlane->setClean( !m_bClean );
-}
-
-template<typename T>
-Void TRenImagePlane<T>::setClean( Bool bClean )
-{
-  m_bClean = bClean;
-}
-
-template<class T>
-T* TRenImagePlane<T>::getPlaneData()
-{
-  return m_pcData;
-}
-
-
-template<class T>
-T* TRenImagePlane<T>::getPlaneDataOrg()
-{
-  return m_pcDataOrg;
-}
-
-
-template<class T>
-Void TRenImagePlane<T>::assign(Pel* pcSourceData, UInt uiSourceStride )
-{
-  T* pcTargetData = m_pcDataOrg;
-  for (UInt uiYPos = 0; uiYPos < m_uiHeightOrg; uiYPos++)
-  {
-    for (UInt uiXPos = 0; uiXPos < m_uiWidthOrg; uiXPos++)
-    {
-      pcTargetData[uiXPos] = (T) pcSourceData[uiXPos];
-    }
-    pcTargetData += m_uiStride;
-    pcSourceData += uiSourceStride;
-  }
-}
-
-template<class T>
-Void TRenImagePlane<T>::assign(Pel cData)
-{
-  T* pcTargetData = m_pcDataOrg;
-  for (UInt uiYPos = 0; uiYPos < m_uiHeightOrg; uiYPos++)
-  {
-    for (UInt uiXPos = 0; uiXPos < m_uiWidthOrg; uiXPos++)
-    {
-      pcTargetData[uiXPos] = (T) cData;
-    }
-    pcTargetData  += m_uiStride;
-  }
-}
-
-template<class T>
-Void TRenImagePlane<T>::assign(Double* pdData, UInt uiSourceStride )
-{
-  T* pcTargetData = m_pcDataOrg;
-  for (UInt uiYPos = 0; uiYPos < m_uiHeightOrg; uiYPos++)
-  {
-    for (UInt uiXPos = 0; uiXPos < m_uiWidthOrg; uiXPos++)
-    {
-      pcTargetData[uiXPos] = (T) pdData[uiXPos];
-    }
-    pcTargetData += m_uiStride;
-    pdData       +=  uiSourceStride;
-
-  }
-}
-
-template<class T>
-Void TRenImagePlane<T>::assign(Double dData)
-{
-  T* pcTargetData = m_pcDataOrg;
-  for (UInt uiYPos = 0; uiYPos < m_uiHeightOrg; uiYPos++)
-  {
-    for (UInt uiXPos = 0; uiXPos < m_uiWidthOrg; uiXPos++)
-    {
-      pcTargetData[uiXPos] = (T) dData;
-    }
-    pcTargetData  += m_uiStride;
-  }
-}
-
-
-template<class T>
-Void TRenImagePlane<T>::assign(Bool* pbData, UInt uiSourceStride )
-{
-  T* pcTargetData = m_pcDataOrg;
-  for (UInt uiYPos = 0; uiYPos < m_uiHeightOrg; uiYPos++)
-  {
-    for (UInt uiXPos = 0; uiXPos < m_uiWidthOrg; uiXPos++)
-    {
-      pcTargetData[uiXPos] = (T) pbData[uiXPos];
-    }
-    pcTargetData += m_uiStride;
-    pbData       += uiSourceStride;
-  }
-}
-
-template<class T>
-Void TRenImagePlane<T>::assign(Int iData)
-{
-  T* pcTargetData = m_pcDataOrg;
-  for (UInt uiYPos = 0; uiYPos < m_uiHeightOrg; uiYPos++)
-  {
-    for (UInt uiXPos = 0; uiXPos < m_uiWidthOrg; uiXPos++)
-    {
-      pcTargetData[uiXPos] = (T) iData;
-    }
-    pcTargetData += m_uiStride;
-  }
-}
-
-template<class T>
-Void TRenImagePlane<T>::assign(Int* piData, UInt uiSourceStride )
-{
-  T* pcTargetData = m_pcDataOrg;
-  for (UInt uiYPos = 0; uiYPos < m_uiHeightOrg; uiYPos++)
-  {
-    for (UInt uiXPos = 0; uiXPos < m_uiWidthOrg; uiXPos++)
-    {
-      pcTargetData[uiXPos] = (T) piData[uiXPos];
-    }
-    pcTargetData += m_uiStride;
-    piData       += uiSourceStride;
-  }
-}
-
-template<class T>
-Void TRenImagePlane<T>::assign(Bool data)
-{
-  T* pcTargetData = m_pcDataOrg;
-  for (UInt uiYPos = 0; uiYPos < m_uiHeightOrg; uiYPos++)
-  {
-    for (UInt uiXPos = 0; uiXPos < m_uiWidthOrg; uiXPos++)
-    {
-      pcTargetData[uiXPos] = (T) data;
-    }
-    pcTargetData += m_uiStride;
-  }
-}
-
-// Assignments to Bool
-
-template<>
-Void TRenImagePlane<Bool>::assign(Int* piData, UInt uiSourceStride )
-{
-  Bool* pcTargetData = m_pcDataOrg;
-  for (UInt uiYPos = 0; uiYPos < m_uiHeightOrg; uiYPos++)
-  {
-    for (UInt uiXPos = 0; uiXPos < m_uiWidthOrg; uiXPos++)
-    {
-      pcTargetData[uiXPos] = (piData[uiXPos] == 0);
-    }
-    pcTargetData  += m_uiStride;
-    piData        += uiSourceStride;
-
-  }
-}
-
-template<>
-Void TRenImagePlane<Bool>::assign(Int iData)
-{
-  Bool* pcTargetData = m_pcDataOrg;
-  for (UInt uiYPos = 0; uiYPos < m_uiHeightOrg; uiYPos++)
-  {
-    for (UInt uiXPos = 0; uiXPos < m_uiWidthOrg; uiXPos++)
-    {
-      pcTargetData[uiXPos] = (iData == 0);
-    }
-    pcTargetData += m_uiStride;
-  }
-}
-
-template<>
-Void TRenImagePlane<Bool>::assign(Pel* pcData, UInt uiSourceStride )
-{
-  Bool* pcTargetData = m_pcDataOrg;
-  for (UInt uiYPos = 0; uiYPos < m_uiHeightOrg; uiYPos++)
-  {
-    for (UInt uiXPos = 0; uiXPos < m_uiWidthOrg; uiXPos++)
-    {
-      pcTargetData[uiXPos] = (pcData[uiXPos] == 0);
-    }
-    pcTargetData += m_uiStride;
-    pcData       +=  uiSourceStride;
-
-  }
-}
-
-template<>
-Void TRenImagePlane<Bool>::assign(Pel cData)
-{
-  Bool* pcTargetData = m_pcDataOrg;
-  for (UInt uiYPos = 0; uiYPos < m_uiHeightOrg; uiYPos++)
-  {
-    for (UInt uiXPos = 0; uiXPos < m_uiWidthOrg; uiXPos++)
-    {
-      pcTargetData[uiXPos] = (cData == 0);
-    }
-    pcTargetData += m_uiStride;
-  }
-}
-
-template<>
-Void TRenImagePlane<Bool>::assign(Double* pdData, UInt uiSourceStride )
-{
-  Bool* pcTargetData = m_pcDataOrg;
-  for (UInt uiYPos = 0; uiYPos < m_uiHeightOrg; uiYPos++)
-  {
-    for (UInt uiXPos = 0; uiXPos < m_uiWidthOrg; uiXPos++)
-    {
-      pcTargetData[uiXPos] = ( pdData[uiXPos] == 0);
-    }
-    pcTargetData += m_uiStride;
-    pdData       += uiSourceStride;
-
-  }
-}
-
-
-
-template<>
-Void TRenImagePlane<Bool>::assign(Double dData)
-{
-  Bool* pcTargetData = m_pcDataOrg;
-  for (UInt uiYPos = 0; uiYPos < m_uiHeightOrg; uiYPos++)
-  {
-    for (UInt uiXPos = 0; uiXPos < m_uiWidthOrg; uiXPos++)
-    {
-      pcTargetData [uiXPos] = (dData == 0);
-    }
-    pcTargetData  += m_uiStride;
-  }
-}
-
-
-// Assignments to Pel
-template<>
-Void TRenImagePlane<Pel>::assign(Double* pdData, UInt uiSourceStride )
-{
-  Pel* pcTargetData = m_pcDataOrg;
-  for (UInt uiYPos = 0; uiYPos < m_uiHeightOrg; uiYPos++)
-  {
-    for (UInt uiXPos = 0; uiXPos < m_uiWidthOrg; uiXPos++)
-    {
-      pcTargetData[uiXPos] = (Pel) ( pdData[uiXPos] + pdData[uiXPos] < 0 ? -0.5 : 0.5 ) ;
-    }
-    pcTargetData += m_uiStride;
-    pdData       += uiSourceStride;
-  }
-}
-
-template<class T>
-Void TRenImagePlane<T>::assign(TRenImagePlane<T>* pcPlane)
-{
-  assign(pcPlane->getPlaneDataOrg(), pcPlane->getStride());
-}
-
-template<class T>
-Void TRenImagePlane<T>::assign(TRenImagePlane<T>* pcPlane, UInt uiRow, UInt uiStartOffset, UInt uiEndOffset)
-{
-  T* pcTargetData = m_pcData                + uiRow * m_uiStride;
-  T* pcSourceData = pcPlane->getPlaneData() + uiRow * pcPlane->getStride();
-
-  for (UInt uiPosX = uiStartOffset; uiPosX <= uiEndOffset; uiPosX++)
-  {
-    pcTargetData[uiPosX] = pcSourceData[uiPosX];
-  }
-
-}
-
-template<class T>
-Void TRenImagePlane<T>::assign(TRenImagePlane<T>* pcSourcePlane, UInt uiSourceRowStart, UInt uiSourceColStart, UInt uiWidth, UInt uiHeight)
-{
-  T* acSourceData;
-  T* acDestData;
-
-  acSourceData = pcSourcePlane->getPlaneData();
-  acSourceData += uiSourceRowStart * pcSourcePlane->getStride() + uiSourceColStart;
-  acDestData    = m_pcData;
-
-  for (UInt uiPosY = 0; uiPosY < uiHeight ; uiPosY++)
-  {
-    for (UInt uiPosX = 0; uiPosX < uiWidth ; uiPosX++)
-    {
-      acDestData[uiPosX] = acSourceData[uiPosX];
-    }
-    acSourceData += pcSourcePlane->getStride();
-    acDestData   += this        ->getStride();
-  };
-}
-
-
-
-template<class T>
-Void TRenImagePlane<T>::assign( T data , UInt uiRow, UInt uiStartOffset, UInt uiEndOffset)
-{
-  T* pcTargetData = m_pcData + uiRow * m_uiStride;
-  for (UInt uiPosX = uiStartOffset; uiPosX <= uiEndOffset; uiPosX++)
-  {
-    pcTargetData[uiPosX] = data;
-  }
-}
-
-
-template<class T>
-Void TRenImagePlane<T>::devide( Double dDevisor )
-{
-  T* pcTargetData = m_pcDataOrg;
-  for (UInt uiPosY = 0; uiPosY < (m_uiHeightOrg); uiPosY++)
-  {
-    for (UInt uiPosX = 0; uiPosX < m_uiWidthOrg; uiPosX++)
-    {
-      pcTargetData[uiPosX] = (T)  ( ( Double )pcTargetData[uiPosX] / dDevisor );
-    }
-    pcTargetData += m_uiStride;
-  }
-};
-
-template<class T>
-Void TRenImagePlane<T>::multiply( Double dMultiplier ) {
-  T* pcTargetData = m_pcDataOrg;
-  for (UInt uiPosY = 0; uiPosY < (m_uiHeightOrg); uiPosY++)
-  {
-    for (UInt uiPosX = 0; uiPosX < m_uiWidthOrg; uiPosX++)
-    {
-      pcTargetData[uiPosX] = (T)  ( ( Double )pcTargetData[uiPosX] * dMultiplier );
-    }
-    pcTargetData += m_uiStride;
-  }
-};
-
-
-template<>
-Void TRenImagePlane<Bool>::devide( Double dDevisor )
-{
-  assert(0);
-};
-
-template<>
-Void TRenImagePlane<Bool>::multiply( Double dMultiplier )
-{
-  assert(0);
-};
-
-
-template<class T>
-Void TRenImagePlane<T>::deleteData()
-{
-  if (m_bClean)
-  {
-    if (m_pcDataOrg)
-    {
-      delete[] m_pcDataOrg;
-    };
-  }
-}
-
-template<class T>
-TRenImagePlane<T>::~TRenImagePlane()
-{
-  deleteData();
-}
-
-
-template<typename T>
-Void TRenImagePlane<T>::extendMargin()
-{
-  Int iPad = (Int) m_uiPad;
-  T* pcData = m_pcData;
-
-  for ( Int iPosY = 0; iPosY < (Int) m_uiHeight; iPosY++)
-  {
-    for ( Int iPosX = 0; iPosX < (Int) iPad; iPosX++ )
-    {
-      pcData[ -iPad + iPosX ]  = pcData[0];
-      pcData[m_uiWidth + iPosX ]  = pcData[m_uiWidth -1 ];
-    }
-    pcData += m_uiStride;
-  }
-
-
-  pcData -= (m_uiStride + iPad);
-  for ( Int iPosY = 0; iPosY < iPad; iPosY++ )
-  {
-    memcpy( pcData + (iPosY+1)*m_uiStride, pcData, sizeof(T)*(m_uiWidth + (iPad<<1)) );
-  }
-
-  pcData -= ((m_uiHeight-1) * m_uiStride);
-  for ( Int iPosY = 0; iPosY < iPad; iPosY++ )
-  {
-    memcpy( pcData - (iPosY+1)*m_uiStride, pcData, sizeof(T)*(m_uiWidth + (iPad<<1)) );
-  }
-}
-
-template class TRenImagePlane<Pel>;
-template class TRenImagePlane<Double>;
-template class TRenImagePlane<Bool>;
-template class TRenImagePlane<Int>;
-
-/////// TRenImagePlanePart ///////
-
-template<typename T>
-TRenImagePlanePart<T>::TRenImagePlanePart( TRenImagePlane<T>* pPlane, UInt uHorOff, UInt uVerOff, UInt uWidth, UInt uHeight )
-: TRenImagePlane<T>( pPlane->getPlaneData() + uHorOff + uVerOff * pPlane->getStride(), uWidth, uHeight, pPlane->getStride(),0)
-{
-
-}
-
-template<typename T>
-TRenImagePlanePart<T>::~TRenImagePlanePart()
-{
-  this->m_pcData = NULL;
-}
-
-template class TRenImagePlanePart<Pel>;
-template class TRenImagePlanePart<Double>;
-template class TRenImagePlanePart<Bool>;
-template class TRenImagePlanePart<Int>;
-#endif // NH_3D
-
Index: branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenImagePlane.h
===================================================================
--- branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenImagePlane.h	(revision 1389)
+++ branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenImagePlane.h	(revision 1390)
@@ -39,87 +39,3 @@
 #include "../TLibCommon/TComPicYuv.h"
 
-#if NH_3D_VSO
-#define PelImagePlane     TRenImagePlane<Pel>
-#define DoubleImagePlane  TRenImagePlane<Double>
-#define IntImagePlane     TRenImagePlane<Int>
-
-template<typename T>
-class TRenImagePlane
-{
-public:
-  // Construction
-  TRenImagePlane();
-  TRenImagePlane( UInt uiWidth, UInt uiHeight, UInt uiPad);
-  TRenImagePlane( TRenImagePlane* pcInputPlane );
-  TRenImagePlane( T* pcDataOrg, UInt uiWidthOrg, UInt uiHeightOrg, UInt uiStride, UInt uiPad );
-
-  ~TRenImagePlane();
-
-  // Get Data
-  T*   getPlaneData();
-  UInt getWidth    () { return m_uiWidth; };
-  UInt getHeight   () { return m_uiHeight; };
-
-  T*   getPlaneDataOrg();
-  UInt getWidthOrg () { return m_uiWidthOrg;  };
-  UInt getHeightOrg() { return m_uiHeightOrg; };
-  UInt getPad      () { return m_uiPad;       };
-  UInt getStride   () { return m_uiStride; };
-
-  Void setData ( T* pDataOrg, UInt uiWidthOrg, UInt uiHeightOrg, UInt uiStride, UInt uiPad, Bool bClean /*= false*/ ); 
-  
-  Void setData ( TRenImagePlane<T>* pcInPlane, Bool bClean );
-  Void setClean( Bool bClean );
-  Void extendMargin();
-
-  // Assignment
-  Void assign( Pel*    data, UInt uiSourceStride );
-  Void assign( Pel     data );
-
-  Void assign( Double* data, UInt uiSourceStride );
-  Void assign( Double  data );
-
-  Void assign( Bool*  data, UInt uiSourceStride );
-  Void assign( Bool   data );
-
-  Void assign( Int*   data, UInt uiSourceStride );
-  Void assign( Int    data );
-
-  Void assign( TRenImagePlane<T>* pcPlane);
-
-  Void assign( T data , UInt uRow, UInt uStartOffset, UInt uEndOffset);
-  Void assign( TRenImagePlane<T>* pcPlane, UInt uRow, UInt uStartOffset, UInt uEndOffset);
-  Void assign( TRenImagePlane<T>* pcSourcePlane, UInt uSourceRowStart, UInt uSourceColStart, UInt uWidth, UInt uHeight);
-
-  // Operators
-  Void devide(   Double dDevisor );
-  Void multiply( Double dMultiplier );
-
-protected:
-  T     *m_pcData;
-  UInt   m_uiWidth;
-  UInt   m_uiHeight;
-  UInt   m_uiStride;
-
-  T     *m_pcDataOrg;
-  UInt   m_uiWidthOrg;
-  UInt   m_uiHeightOrg;
-  UInt   m_uiPad;
-
-  Double m_dRatio;
-  Bool   m_bClean;
-
-private:
-  Void deleteData();
-};
-
-template<typename T>
-class TRenImagePlanePart : public TRenImagePlane< T >
-{
-public:
-  TRenImagePlanePart( TRenImagePlane<T>* pcPlane, UInt uHorOff, UInt uVerOff, UInt uWidth, UInt uHeight);;
-  ~TRenImagePlanePart();;
-};
-
-#endif // NH_3D
 #endif // __TRENIMAGEPLANE__
Index: branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenInterpFilter.cpp
===================================================================
--- branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenInterpFilter.cpp	(revision 1389)
+++ branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenInterpFilter.cpp	(revision 1390)
@@ -39,17 +39,3 @@
 
 #include "TRenInterpFilter.h"
-#if NH_3D_VSO
 
-// ====================================================================================================================
-// Constructor
-// ====================================================================================================================
-
-template<UInt bitDepthLuma>
-TRenInterpFilter<bitDepthLuma>::TRenInterpFilter()
-{
-  // initial number of taps for Luma
-}
-
-template class TRenInterpFilter<REN_BIT_DEPTH>;
-#endif // NH_3D
-
Index: branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenInterpFilter.h
===================================================================
--- branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenInterpFilter.h	(revision 1389)
+++ branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenInterpFilter.h	(revision 1390)
@@ -44,1313 +44,3 @@
 #include "TLibCommon/CommonDef.h"
 #include "assert.h"
-#if NH_3D_VSO
-
-// ====================================================================================================================
-// Constants
-// ====================================================================================================================
-
-// Local type definitions
-#define HAL_IDX   1
-#define QU0_IDX   0
-#define QU1_IDX   2
-
-// ====================================================================================================================
-// Class definition
-// ====================================================================================================================
-
-/// interpolation filter class
-template<UInt bitDepth>
-class TRenInterpFilter
-{
-public:
-  TRenInterpFilter();
-  
-  // DIF filter interface (for half & quarter)
-  __inline Void xCTI_FilterHalfHor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst);
-  __inline Void xCTI_FilterHalfHor(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst);
-  
-  __inline Void xCTI_FilterQuarter0Hor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst);
-  __inline Void xCTI_FilterQuarter0Hor(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst);
-  
-  __inline Void xCTI_FilterQuarter1Hor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst);
-  __inline Void xCTI_FilterQuarter1Hor(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst);
-  
-  __inline Void xCTI_FilterHalfVer (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst, Int iDstStridePel, Pel*& rpiDstPel );
-  __inline Void xCTI_FilterHalfVer (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst );
-  __inline Void xCTI_FilterHalfVer (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst );
-  
-  __inline Void xCTI_FilterQuarter0Ver (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst );
-  __inline Void xCTI_FilterQuarter0Ver (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst );
-  
-  __inline Void xCTI_FilterQuarter1Ver (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst );
-  __inline Void xCTI_FilterQuarter1Ver (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst );
-  
-  __inline Void xCTI_Filter2DVerC (Pel* piSrc, Int iSrcStride,  Int iWidth, Int iHeight, Int iDstStride,  Int*& rpiDst, Int iMv);
-  __inline Void xCTI_Filter2DHorC (Int* piSrc, Int iSrcStride,  Int iWidth, Int iHeight, Int iDstStride,  Pel*& rpiDst, Int iMV);
-  __inline Void xCTI_Filter1DHorC (Pel* piSrc, Int iSrcStride,  Int iWidth, Int iHeight, Int iDstStride,  Pel*& rpiDst, Int iMV);
-  __inline Void xCTI_Filter1DVerC (Pel* piSrc, Int iSrcStride,  Int iWidth, Int iHeight, Int iDstStride,  Pel*& rpiDst, Int iMV);
-
-   __inline Int xCTI_Filter_VPS04_C_HAL( Pel* pSrc, Int iStride );
-   __inline Int xCTI_Filter_VIS04_C_HAL( Int* pSrc, Int iStride );
-   __inline Int xCTI_Filter_VP04_C_OCT0( Pel* pSrc, Int iStride );
-   __inline Int xCTI_Filter_VI04_C_OCT0( Int* pSrc, Int iStride );
-   __inline Int xCTI_Filter_VP04_C_QUA0( Pel* pSrc, Int iStride );
-   __inline Int xCTI_Filter_VI04_C_QUA0( Int* pSrc, Int iStride );
-   __inline Int xCTI_Filter_VP04_C_OCT1( Pel* pSrc, Int iStride );
-   __inline Int xCTI_Filter_VI04_C_OCT1( Int* pSrc, Int iStride );
-   __inline Int xCTI_Filter_VP04_C_OCT2( Pel* pSrc, Int iStride );
-   __inline Int xCTI_Filter_VI04_C_OCT2( Int* pSrc, Int iStride );
-   __inline Int xCTI_Filter_VP04_C_QUA1( Pel* pSrc, Int iStride );
-   __inline Int xCTI_Filter_VI04_C_QUA1( Int* pSrc, Int iStride );
-   __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)); }
-
-};
-
-
-// ------------------------------------------------------------------------------------------------
-// DCTIF filters
-// ------------------------------------------------------------------------------------------------
-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;
-  Pel*  piSrcTmp;
-  Int iSrcStep2 = iSrcStep*2;
-  Int iSrcStep3 = iSrcStep*3;
-  Int iSrcStep4 = iSrcStep*4;
-  Int iSrcStep5 = iSrcStep*5;
-  Int iSrcStep6 = iSrcStep*6;
-  Int iSrcStep7 = iSrcStep*7;
-
-  Int iTmp0, iTmp1, iTmp2, iTmp3, iTmpA;
-
-  for ( Int y = iHeight; y != 0; y-- )
-  {
-    piSrcTmp = &piSrc[ -3*iSrcStep ];
-    for ( Int x = 0; x < iWidth; x++ )
-    {
-      // { -1,4,-11,40,40,-11,4,-1   } 
-      iTmp0 = piSrcTmp[        0]+piSrcTmp[iSrcStep7];
-      iTmp1 = piSrcTmp[iSrcStep]+piSrcTmp[iSrcStep6];
-      iTmp2 = piSrcTmp[iSrcStep2]+piSrcTmp[iSrcStep5];
-      iTmp3 = piSrcTmp[iSrcStep3]+piSrcTmp[iSrcStep4];
-
-      iTmpA = (iTmp3 << 2) - iTmp2;
-
-      iSum  = (   iTmp1          << 2 )
-            + (   iTmpA          << 3 )
-            + (   iTmpA          << 1 )
-            -    iTmp0 -  iTmp2;
-
-      piDst   [x * iDstStep] = xClipY( (iSum +  32) >>  6 );
-      piSrcTmp += iSrcStep;
-    }
-    piSrc += iSrcStride;
-    piDst += iDstStride;
-  }
-  return;
-}
-
-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;
-  Int*  piSrcTmp;
-  Int iSrcStep2 = iSrcStep*2;
-  Int iSrcStep3 = iSrcStep*3;
-  Int iSrcStep4 = iSrcStep*4;
-  Int iSrcStep5 = iSrcStep*5;
-  Int iSrcStep6 = iSrcStep*6;
-  Int iSrcStep7 = iSrcStep*7;
-
-  Int iTmp0, iTmp1, iTmp2, iTmp3, iTmpA;
-
-  for ( Int y = iHeight; y != 0; y-- )
-  {
-    piSrcTmp = &piSrc[ -3*iSrcStep ];
-    for ( Int x = 0; x < iWidth; x++ )
-    {
-      // { -1,4,-11,40,40,-11,4,-1   } 
-      iTmp0 = piSrcTmp[        0]+piSrcTmp[iSrcStep7];
-      iTmp1 = piSrcTmp[iSrcStep ]+piSrcTmp[iSrcStep6];
-      iTmp2 = piSrcTmp[iSrcStep2]+piSrcTmp[iSrcStep5];
-      iTmp3 = piSrcTmp[iSrcStep3]+piSrcTmp[iSrcStep4];
-      
-      iTmpA = (iTmp3 << 2) - iTmp2;
-      
-      iSum  = (   iTmp1          << 2 )
-            + (   iTmpA          << 3 )
-            + (   iTmpA          << 1 )
-            -    iTmp0 -  iTmp2;
-      
-      piDst   [x * iDstStep] = xClipY( (iSum +  2048) >>  12 );
-      piSrcTmp += iSrcStep;
-    }
-    piSrc += iSrcStride;
-    piDst += iDstStride;
-  }
-  return;
-}
-
-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;
-  Pel*  piSrcTmp;
-  Int iSrcStep2 = iSrcStep*2;
-  Int iSrcStep3 = iSrcStep*3;
-  Int iSrcStep4 = iSrcStep*4;
-  Int iSrcStep5 = iSrcStep*5;
-  Int iSrcStep6 = iSrcStep*6;
-  Int iSrcStep7 = iSrcStep*7;
-
-  Int  iTmp1, iTmp2;
-
-  for ( Int y = iHeight; y != 0; y-- )
-  {
-    piSrcTmp = &piSrc[ -3*iSrcStep ];
-    for ( Int x = 0; x < iWidth; x++ )
-    {
-      // {-1,   4,  -10,  57,   19,  -7,   3,   -1  },
-      
-      iTmp1 = piSrcTmp[iSrcStep3] + piSrcTmp[iSrcStep5];
-      iTmp2 = piSrcTmp[iSrcStep6] + piSrcTmp[iSrcStep4];
-      
-      iSum  =  iTmp1 + iTmp2 - piSrcTmp[0] - piSrcTmp[iSrcStep7]
-             - ( ( piSrcTmp[iSrcStep2] - iTmp2 ) << 1 )
-             + (  piSrcTmp[iSrcStep]             << 2 )
-             - ( ( piSrcTmp[iSrcStep2] + iTmp1 ) << 3 )
-             + (   piSrcTmp[iSrcStep4]           << 4 );
-      
-      piDst   [x * iDstStep] = xClipY(( (iSum +  32) >>  6 )+ piSrcTmp[iSrcStep3]);
-      piSrcTmp += iSrcStep;
-    }
-    piSrc += iSrcStride;
-    piDst += iDstStride;
-  }
-  return;
-}
-
-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;
-  Int*  piSrcTmp;
-  Int iSrcStep2 = iSrcStep*2;
-  Int iSrcStep3 = iSrcStep*3;
-  Int iSrcStep4 = iSrcStep*4;
-  Int iSrcStep5 = iSrcStep*5;
-  Int iSrcStep6 = iSrcStep*6;
-  Int iSrcStep7 = iSrcStep*7;
-
-  Int  iTmp1, iTmp2;
-
-  for ( Int y = iHeight; y != 0; y-- )
-  {
-    piSrcTmp = &piSrc[ -3*iSrcStep ];
-    for ( Int x = 0; x < iWidth; x++ )
-    {
-      // {-1,   4,  -10,  57,   19,  -7,   3,   -1  },
-    
-      iTmp1 = piSrcTmp[iSrcStep3] + piSrcTmp[iSrcStep5];
-      iTmp2 = piSrcTmp[iSrcStep6] + piSrcTmp[iSrcStep4];
-      
-      iSum  =  iTmp1 + iTmp2 - piSrcTmp[0] - piSrcTmp[iSrcStep7]
-            - ( ( piSrcTmp[iSrcStep2] - iTmp2 ) << 1 )
-            + (  piSrcTmp[iSrcStep]             << 2 )
-            - ( ( piSrcTmp[iSrcStep2] + iTmp1 ) << 3 )
-            + (   piSrcTmp[iSrcStep4]           << 4 )
-            + (   piSrcTmp[iSrcStep3]           << 6 );
-      
-      piDst   [x * iDstStep] = xClipY( (iSum +  2048) >>  12 );
-      piSrcTmp += iSrcStep;
-    }
-    piSrc += iSrcStride;
-    piDst += iDstStride;
-  }
-  return;
-}
-
-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;
-  Pel*  piSrcTmp;
-  Int iSrcStep2 = iSrcStep*2;
-  Int iSrcStep3 = iSrcStep*3;
-  Int iSrcStep4 = iSrcStep*4;
-  Int iSrcStep5 = iSrcStep*5;
-  Int iSrcStep6 = iSrcStep*6;
-  Int iSrcStep7 = iSrcStep*7;
-
-  Int  iTmp1, iTmp2;
-  for ( Int y = iHeight; y != 0; y-- )
-  {
-    piSrcTmp = &piSrc[ -3*iSrcStep ];
-    for ( Int x = 0; x < iWidth; x++ )
-    {
-      // {-1,   3,  -7,  19,   57,  -10,   4,   -1  },
-      
-      iTmp1 = piSrcTmp[iSrcStep4] + piSrcTmp[iSrcStep2];
-      iTmp2 = piSrcTmp[iSrcStep ] + piSrcTmp[iSrcStep3];
-      
-      iSum  =  iTmp1 + iTmp2 - piSrcTmp[0] - piSrcTmp[iSrcStep7]
-            - ( ( piSrcTmp[iSrcStep5] - iTmp2 ) << 1 )
-            + (   piSrcTmp[iSrcStep6]           << 2 )
-            - ( ( piSrcTmp[iSrcStep5] + iTmp1 ) << 3 )
-            + (   piSrcTmp[iSrcStep3]           << 4 );
-      
-      piDst   [x * iDstStep] = xClipY( ((iSum +  32) >>  6) + piSrcTmp[iSrcStep4] );
-      piSrcTmp += iSrcStep;
-    }
-    piSrc += iSrcStride;
-    piDst += iDstStride;
-  }
-  return;
-}
-
-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;
-  Int*  piSrcTmp;
-  Int iSrcStep2 = iSrcStep*2;
-  Int iSrcStep3 = iSrcStep*3;
-  Int iSrcStep4 = iSrcStep*4;
-  Int iSrcStep5 = iSrcStep*5;
-  Int iSrcStep6 = iSrcStep*6;
-  Int iSrcStep7 = iSrcStep*7;
-
-  Int  iTmp1, iTmp2;
-  for ( Int y = iHeight; y != 0; y-- )
-  {
-    piSrcTmp = &piSrc[ -3*iSrcStep ];
-    for ( Int x = 0; x < iWidth; x++ )
-    {
-      // {-1,   3,  -7,  19,   57,  -10,   4,   -1  },
-      
-      iTmp1 = piSrcTmp[iSrcStep4] + piSrcTmp[iSrcStep2];
-      iTmp2 = piSrcTmp[iSrcStep ] + piSrcTmp[iSrcStep3];
-      
-      iSum  =  iTmp1 + iTmp2 - piSrcTmp[0] - piSrcTmp[iSrcStep7]
-            - ( ( piSrcTmp[iSrcStep5] - iTmp2 ) << 1 )
-            + (   piSrcTmp[iSrcStep6]           << 2 )
-            - ( ( piSrcTmp[iSrcStep5] + iTmp1 ) << 3 )
-            + (   piSrcTmp[iSrcStep3]           << 4 )
-            + (   piSrcTmp[iSrcStep4]           << 6 );
-      
-      piDst   [x * iDstStep] = xClipY( (iSum +  2048) >>  12 );
-      piSrcTmp += iSrcStep;
-    }
-    piSrc += iSrcStride;
-    piDst += iDstStride;
-  }
-  return;
-}
-
-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;
-  Int   iSum;
-  Pel*  piSrcTmp;
-  Int iSrcStride2 = iSrcStride*2;
-  Int iSrcStride3 = iSrcStride*3;
-  Int iSrcStride4 = iSrcStride*4;
-  Int iSrcStride5 = iSrcStride*5;
-  Int iSrcStride6 = iSrcStride*6;
-  Int iSrcStride7 = iSrcStride*7;
-
-  Int  iTmp0, iTmp1, iTmp2, iTmp3, iTmpA;
-  for ( Int y = iHeight; y != 0; y-- )
-  {
-    piSrcTmp = &piSrc[ -3*iSrcStride ];
-    for ( Int x = 0; x < iWidth; x++ )
-    {
-      // { -1,4,-11,40,40,-11,4,-1   } 
-      iTmp0 = piSrcTmp[          0]+piSrcTmp[iSrcStride7];
-      iTmp1 = piSrcTmp[iSrcStride ]+piSrcTmp[iSrcStride6];
-      iTmp2 = piSrcTmp[iSrcStride2]+piSrcTmp[iSrcStride5];
-      iTmp3 = piSrcTmp[iSrcStride3]+piSrcTmp[iSrcStride4];
-      
-      iTmpA = (iTmp3 << 2) - iTmp2;
-      
-      iSum  = (   iTmp1          << 2 )
-            + (   iTmpA          << 3 )
-            + (   iTmpA          << 1 )
-            -    iTmp0 -  iTmp2;
-      
-      piDst[x * iDstStep]    = iSum;
-      piDstPel[x * iDstStep] = xClipY( (iSum +  32) >>  6 );
-      piSrcTmp += iSrcStep;
-    }
-    piSrc += iSrcStride;
-    piDst += iDstStride;
-    piDstPel += iDstStridePel;
-  }
- return;
-}
-
-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;
-  Int   iSum;
-  Pel*  piSrcTmp;
-  Int iSrcStride2 = iSrcStride*2;
-  Int iSrcStride3 = iSrcStride*3;
-  Int iSrcStride4 = iSrcStride*4;
-  Int iSrcStride5 = iSrcStride*5;
-  Int iSrcStride6 = iSrcStride*6;
-  Int iSrcStride7 = iSrcStride*7;
-
-  Int  iTmp0, iTmp1, iTmp2, iTmp3, iTmpA;
-  for ( Int y = iHeight; y != 0; y-- )
-  {
-    piSrcTmp = &piSrc[ -3*iSrcStride ];
-    for ( Int x = 0; x < iWidth; x++ )
-    {
-      // { -1,4,-11,40,40,-11,4,-1   } 
-      iTmp0 = piSrcTmp[          0]+piSrcTmp[iSrcStride7];
-      iTmp1 = piSrcTmp[iSrcStride ]+piSrcTmp[iSrcStride6];
-      iTmp2 = piSrcTmp[iSrcStride2]+piSrcTmp[iSrcStride5];
-      iTmp3 = piSrcTmp[iSrcStride3]+piSrcTmp[iSrcStride4];
-      
-      iTmpA = (iTmp3 << 2) - iTmp2;
-      
-      iSum  = (   iTmp1          << 2 )
-            + (   iTmpA          << 3 )
-            + (   iTmpA          << 1 )
-            -    iTmp0 -  iTmp2;        
-      
-      piDst[x * iDstStep] = iSum;
-      piSrcTmp += iSrcStep;
-    }
-    piSrc += iSrcStride;
-    piDst += iDstStride;
-  }
-  return;
-}
-
-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;
-  Pel*  piSrcTmp;
-  
-  Int iSrcStride2 = iSrcStride*2;
-  Int iSrcStride3 = iSrcStride*3;
-  Int iSrcStride4 = iSrcStride*4;
-  Int iSrcStride5 = iSrcStride*5;
-  Int iSrcStride6 = iSrcStride*6;
-  Int iSrcStride7 = iSrcStride*7;
-
-  Int  iTmp0, iTmp1, iTmp2, iTmp3, iTmpA;
-  for ( Int y = iHeight; y != 0; y-- )
-  {
-    piSrcTmp = &piSrc[ -3*iSrcStride ];
-    for ( Int x = 0; x < iWidth; x++ )
-    {
-      // { -1,4,-11,40,40,-11,4,-1   } 
-      iTmp0 = piSrcTmp[          0]+piSrcTmp[iSrcStride7];
-      iTmp1 = piSrcTmp[iSrcStride ]+piSrcTmp[iSrcStride6];
-      iTmp2 = piSrcTmp[iSrcStride2]+piSrcTmp[iSrcStride5];
-      iTmp3 = piSrcTmp[iSrcStride3]+piSrcTmp[iSrcStride4];
-      
-      iTmpA = (iTmp3 << 2) - iTmp2;
-      
-      iSum  = (   iTmp1          << 2 )
-            + (   iTmpA          << 3 )
-            + (   iTmpA          << 1 )
-            -    iTmp0 -  iTmp2;        
-      
-      piDst[x * iDstStep] = xClipY( (iSum +  32) >>  6 );
-      piSrcTmp += iSrcStep;
-    }
-    piSrc += iSrcStride;
-    piDst += iDstStride;
-  }
-  return;
-}
-
-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;
-  Int   iSum;
-  Pel*  piSrcTmp;
-  Int iSrcStride2 = iSrcStride*2;
-  Int iSrcStride3 = iSrcStride*3;
-  Int iSrcStride4 = iSrcStride*4;
-  Int iSrcStride5 = iSrcStride*5;
-  Int iSrcStride6 = iSrcStride*6;
-  Int iSrcStride7 = iSrcStride*7;
-
-  Int  iTmp1, iTmp2;
-  for ( Int y = iHeight; y != 0; y-- )
-  {
-    piSrcTmp = &piSrc[ -3*iSrcStride ];
-    for ( Int x = 0; x < iWidth; x++ )
-    {
-      // {-1,   4,  -10,  57,   19,  -7,   3,   -1  },
-      
-      iTmp1 = piSrcTmp[iSrcStride3] + piSrcTmp[iSrcStride5];
-      iTmp2 = piSrcTmp[iSrcStride6] + piSrcTmp[iSrcStride4];
-      
-      iSum  =  iTmp1 + iTmp2 - piSrcTmp[0] - piSrcTmp[iSrcStride7]
-            - ( ( piSrcTmp[iSrcStride2] - iTmp2 ) << 1 )
-            + (  piSrcTmp[iSrcStride]             << 2 )
-            - ( ( piSrcTmp[iSrcStride2] + iTmp1 ) << 3 )
-            + (   piSrcTmp[iSrcStride4]           << 4 )
-            + (   piSrcTmp[iSrcStride3]           << 6 );
-      
-      piDst[x * iDstStep] = iSum;
-      piSrcTmp += iSrcStep;
-    }
-    piSrc += iSrcStride;
-    piDst += iDstStride;
-  }
-  return;
-}
-
-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;
-  Pel*  piSrcTmp;
-  
-  Int iSrcStride2 = iSrcStride*2;
-  Int iSrcStride3 = iSrcStride*3;
-  Int iSrcStride4 = iSrcStride*4;
-  Int iSrcStride5 = iSrcStride*5;
-  Int iSrcStride6 = iSrcStride*6;
-  Int iSrcStride7 = iSrcStride*7;
-
-  Int  iTmp1, iTmp2;
-  for ( Int y = iHeight; y != 0; y-- )
-  {
-    piSrcTmp = &piSrc[ -3*iSrcStride ];
-    for ( Int x = 0; x < iWidth; x++ )
-    {
-      // {-1,   4,  -10,  57,   19,  -7,   3,   -1  },
-      
-      iTmp1 = piSrcTmp[iSrcStride3] + piSrcTmp[iSrcStride5];
-      iTmp2 = piSrcTmp[iSrcStride6] + piSrcTmp[iSrcStride4];
-      
-      iSum  =  iTmp1 + iTmp2 - piSrcTmp[0] - piSrcTmp[iSrcStride7]
-            - ( ( piSrcTmp[iSrcStride2] - iTmp2 ) << 1 )
-            + (  piSrcTmp[iSrcStride]             << 2 )
-            - ( ( piSrcTmp[iSrcStride2] + iTmp1 ) << 3 )
-            + (   piSrcTmp[iSrcStride4]           << 4 );
-      
-      piDst[x * iDstStep] = xClipY( ((iSum +  32) >>  6) + piSrcTmp[iSrcStride3] );
-      piSrcTmp += iSrcStep;
-    }
-    piSrc += iSrcStride;
-    piDst += iDstStride;
-  }
-  return;
-}
-
-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;
-  Int   iSum;
-  Pel*  piSrcTmp;
-  Int iSrcStride2 = iSrcStride*2;
-  Int iSrcStride3 = iSrcStride*3;
-  Int iSrcStride4 = iSrcStride*4;
-  Int iSrcStride5 = iSrcStride*5;
-  Int iSrcStride6 = iSrcStride*6;
-  Int iSrcStride7 = iSrcStride*7;
-
-  Int  iTmp1, iTmp2;
-
-  for ( Int y = iHeight; y != 0; y-- )
-  {
-    piSrcTmp = &piSrc[ -3*iSrcStride ];
-    for ( Int x = 0; x < iWidth; x++ )
-    {
-      /// {-1,   3,  -7,  19,   57,  -10,   4,   -1  },
-      iTmp1 = piSrcTmp[iSrcStride4] + piSrcTmp[iSrcStride2];
-      iTmp2 = piSrcTmp[iSrcStride ] + piSrcTmp[iSrcStride3];
-      
-      iSum  =  iTmp1 + iTmp2 - piSrcTmp[0] - piSrcTmp[iSrcStride7]
-            - ( ( piSrcTmp[iSrcStride5] - iTmp2 ) << 1 )
-            + (   piSrcTmp[iSrcStride6]           << 2 )
-            - ( ( piSrcTmp[iSrcStride5] + iTmp1 ) << 3 )
-            + (   piSrcTmp[iSrcStride3]           << 4 )
-            + (   piSrcTmp[iSrcStride4]           << 6 );
-            
-      piDst[x * iDstStep] = iSum;
-      piSrcTmp += iSrcStep;
-    }
-    piSrc += iSrcStride;
-    piDst += iDstStride;
-  }
-  return;
-}
-
-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;
-  Pel*  piSrcTmp;
-  Int iSrcStride2 = iSrcStride*2;
-  Int iSrcStride3 = iSrcStride*3;
-  Int iSrcStride4 = iSrcStride*4;
-  Int iSrcStride5 = iSrcStride*5;
-  Int iSrcStride6 = iSrcStride*6;
-  Int iSrcStride7 = iSrcStride*7;
-
-  Int  iTmp1, iTmp2;
-
-  for ( Int y = iHeight; y != 0; y-- )
-  {
-    piSrcTmp = &piSrc[ -3*iSrcStride ];
-    for ( Int x = 0; x < iWidth; x++ )
-    {
-      /// {-1,   3,  -7,  19,   57,  -10,   4,   -1  },
-      iTmp1 = piSrcTmp[iSrcStride4] + piSrcTmp[iSrcStride2];
-      iTmp2 = piSrcTmp[iSrcStride ] + piSrcTmp[iSrcStride3];
-      
-      iSum  =  iTmp1 + iTmp2 - piSrcTmp[0] - piSrcTmp[iSrcStride7]
-            - ( ( piSrcTmp[iSrcStride5] - iTmp2 ) << 1 )
-            + (   piSrcTmp[iSrcStride6]           << 2 )
-            - ( ( piSrcTmp[iSrcStride5] + iTmp1 ) << 3 )
-            + (   piSrcTmp[iSrcStride3]           << 4 );
-            
-      piDst[x * iDstStep] = xClipY( ((iSum +  32) >>  6) +  piSrcTmp[iSrcStride4] );
-      piSrcTmp += iSrcStep;
-    }
-    piSrc += iSrcStride;
-    piDst += iDstStride;
-  }
-  return;
-}
-
-// ------------------------------------------------------------------------------------------------
-// DCTIF filters for Chroma
-// ------------------------------------------------------------------------------------------------
-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;
-  Int   iSum;
-  Pel*  piSrcTmp;
-
-  switch (iMV)
-  {
-  case 1:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -iSrcStride ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum      = xCTI_Filter_VP04_C_OCT0( piSrcTmp, iSrcStride );
-          piDst[x ] = iSum;
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 2:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -iSrcStride ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum      = xCTI_Filter_VP04_C_QUA0( piSrcTmp, iSrcStride );
-          piDst[x ] = iSum;
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 6:  
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -iSrcStride ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum      = xCTI_Filter_VP04_C_QUA1( piSrcTmp, iSrcStride );
-          piDst[x ] = iSum;
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 3:  
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -iSrcStride ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum      = xCTI_Filter_VP04_C_OCT1( piSrcTmp, iSrcStride );
-          piDst[x ] = iSum;
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 5:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -iSrcStride ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum      = xCTI_Filter_VP04_C_OCT2( piSrcTmp, iSrcStride );
-          piDst[x ] = iSum;
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 7:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -iSrcStride ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum      = xCTI_Filter_VP04_C_OCT3( piSrcTmp, iSrcStride );
-          piDst[x ] = iSum;
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 4: 
-  {
-
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -iSrcStride ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum      = xCTI_Filter_VPS04_C_HAL( piSrcTmp, iSrcStride );
-          piDst[x ] = iSum;
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  default:
-    assert( 0 );
-  }
-  return;
-}
-
-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;
-  Int*  piSrcTmp;
-
-  switch (iMV)
-  {
-  case 1:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -1 ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum         = xCTI_Filter_VI04_C_OCT0( piSrcTmp, 1 );
-          piDst   [x ] = xClipC ((iSum +  2048) >>  12 );
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 2:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -1 ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum         = xCTI_Filter_VI04_C_QUA0( piSrcTmp, 1 );
-          piDst   [x ] = xClipC ((iSum +  2048) >>  12 );
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 6:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -1 ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum         = xCTI_Filter_VI04_C_QUA1( piSrcTmp, 1 );
-          piDst   [x ] = xClipC ((iSum +  2048) >>  12 );
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 3:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -1 ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum         = xCTI_Filter_VI04_C_OCT1( piSrcTmp, 1 );
-          piDst   [x ] = xClipC ((iSum +  2048) >>  12 );
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 5:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -1 ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum         = xCTI_Filter_VI04_C_OCT2( piSrcTmp, 1 );
-          piDst   [x ] = xClipC ((iSum +  2048) >>  12 );
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 7:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -1 ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum         = xCTI_Filter_VI04_C_OCT3( piSrcTmp, 1 );
-          piDst   [x ] = xClipC ((iSum +  2048) >>  12 );
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 4:
-  {
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -1 ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum      = xCTI_Filter_VIS04_C_HAL( piSrcTmp, 1 );
-          piDst   [x ] = xClipC ((iSum +  2048) >>  12 );
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  default:
-    assert( 0 );
-  }
-
-  return;
-}
-
-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;
-  Pel*  piSrcTmp;
-
-  switch (iMV)
-  {
-  case 1:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -iSrcStride ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum      = xCTI_Filter_VP04_C_OCT0( piSrcTmp,  iSrcStride );
-          piDst[x ] = xClipC ((iSum +  32) >>  6 );
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 2:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -iSrcStride ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum      = xCTI_Filter_VP04_C_QUA0( piSrcTmp,  iSrcStride );
-          piDst[x ] = xClipC ((iSum +  32) >>  6 );
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 6:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -iSrcStride ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum      = xCTI_Filter_VP04_C_QUA1( piSrcTmp,  iSrcStride );
-          piDst[x ] = xClipC ((iSum +  32) >>  6 );
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 3:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -iSrcStride ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum      = xCTI_Filter_VP04_C_OCT1( piSrcTmp,  iSrcStride );
-          piDst[x ] = xClipC ((iSum +  32) >>  6 );
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 5:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -iSrcStride ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum      = xCTI_Filter_VP04_C_OCT2( piSrcTmp,  iSrcStride );
-          piDst[x ] = xClipC ((iSum +  32) >>  6 );
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 7:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -iSrcStride ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum      = xCTI_Filter_VP04_C_OCT3( piSrcTmp,  iSrcStride );
-          piDst[x ] = xClipC ((iSum +  32) >>  6 );
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 4:
-  {
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[-iSrcStride ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum      = xCTI_Filter_VPS04_C_HAL( piSrcTmp, iSrcStride );
-          piDst[x ] = xClipC ((iSum +  32) >>  6 );
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  default:
-    assert( 0 );
-  }
-  return;
-}
-
-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;
-  Int   iSum;
-  Pel*  piSrcTmp;
-
-  switch (iMV)
-  {
-  case 1:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -1 ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum         = xCTI_Filter_VP04_C_OCT0( piSrcTmp,  1 );
-          piDst[x ] = xClipC ((iSum +  32) >>  6 );
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 2:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -1 ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum         = xCTI_Filter_VP04_C_QUA0( piSrcTmp,  1 );
-          piDst[x ] = xClipC ((iSum +  32) >>  6 );
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 6:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -1 ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum         = xCTI_Filter_VP04_C_QUA1( piSrcTmp,  1 );
-          piDst[x ] = xClipC ((iSum +  32) >>  6 );
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 3:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -1 ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum         = xCTI_Filter_VP04_C_OCT1( piSrcTmp,  1 );
-          piDst[x ] = xClipC ((iSum +  32) >>  6 );
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 5:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -1 ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum         = xCTI_Filter_VP04_C_OCT2( piSrcTmp,  1 );
-          piDst[x ] = xClipC ((iSum +  32) >>  6 );
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 7:
-  {  
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -1 ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum         = xCTI_Filter_VP04_C_OCT3( piSrcTmp,  1 );
-          piDst[x ] = xClipC ((iSum +  32) >>  6 );
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  case 4:
-  {
-      for ( Int y = iHeight; y != 0; y-- )
-      {
-        piSrcTmp = &piSrc[ -1 ];
-        for ( Int x = 0; x < iWidth; x++ )
-        {
-          iSum         = xCTI_Filter_VPS04_C_HAL( piSrcTmp,  1 );
-          piDst[x ] = xClipC ((iSum +  32) >>  6 );
-          piSrcTmp++;
-        }
-        piSrc += iSrcStride;
-        piDst += iDstStride;
-      }
-  }
-  break;
-  default:
-    assert( 0 );
- }
-  return;
-}
-
-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;
-
-  Int p0 = pSrc[0];     iIdx+= iStride;
-  Int p1 = pSrc[iIdx];  iIdx+= iStride;
-  Int p2 = pSrc[iIdx];  iIdx+= iStride;
-  Int p3 = pSrc[iIdx];  
-  iSum = (p1<<6) -((p1+p0)<<2) +p0 +(p2<<3) -p3;
-
-  return iSum;
-}
-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;
-
-  Int p0 = pSrc[0];     iIdx+= iStride;
-  Int p1 = pSrc[iIdx];  iIdx+= iStride;
-  Int p2 = pSrc[iIdx];  iIdx+= iStride;
-  Int p3 = pSrc[iIdx];  
-  iSum = (p1<<6) -((p1+p0)<<2) +p0 +(p2<<3) -p3;
-
-  return iSum;
-}
-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;
-
-  Int p0 = pSrc[0];     iIdx+= iStride;
-  Int p1 = pSrc[iIdx];  iIdx+= iStride;
-  Int p2 = pSrc[iIdx];  iIdx+= iStride;
-  Int p3 = pSrc[iIdx];  
-  iSum = (p1 << 6) + (p2 << 4) - (p1 << 3) - ( p0 << 2) - ((p1 + p3) << 1);
-
-  return iSum;
-}
-
-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;
-
-  Int p0 = pSrc[0];     iIdx+= iStride;
-  Int p1 = pSrc[iIdx];  iIdx+= iStride;
-  Int p2 = pSrc[iIdx];  iIdx+= iStride;
-  Int p3 = pSrc[iIdx];  
-  iSum = (p1 << 6) + (p2 << 4) - (p1 << 3) - ( p0 << 2) - ((p1 + p3) << 1);
-
-  return iSum;
-}
-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;
-
-  Int p0 = pSrc[0];     iIdx+= iStride;
-  Int p1 = pSrc[iIdx];  iIdx+= iStride;
-  Int p2 = pSrc[iIdx];  iIdx+= iStride;
-  Int p3 = pSrc[iIdx];  
-  iSum = (p2 << 6) + (p1 << 4) - (p2 << 3) - ( p3 << 2) - ((p2 + p0) << 1);
-
-  return iSum;
-}
-
-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;
-
-  Int p0 = pSrc[0];     iIdx+= iStride;
-  Int p1 = pSrc[iIdx];  iIdx+= iStride;
-  Int p2 = pSrc[iIdx];  iIdx+= iStride;
-  Int p3 = pSrc[iIdx];  
-  iSum = (p2 << 6) + (p1 << 4) - (p2 << 3) - ( p3 << 2) - ((p2 + p0) << 1);
-
-  return iSum;
-}
-
-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;
-
-  Int p0 = pSrc[0];     iIdx+= iStride;
-  Int p1 = pSrc[iIdx];  iIdx+= iStride;
-  Int p2 = pSrc[iIdx];  iIdx+= iStride;
-  Int p3 = pSrc[iIdx];  
-  Int t = p0 + p2;
-  iSum = ((p1 + p2) << 5) + (p1 << 4) - ( (t + p3) << 2) - ( p1 << 1) - t;
-
-  return iSum;
-}
-
-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;
-
-  Int p0 = pSrc[0];     iIdx+= iStride;
-  Int p1 = pSrc[iIdx];  iIdx+= iStride;
-  Int p2 = pSrc[iIdx];  iIdx+= iStride;
-  Int p3 = pSrc[iIdx];  
-  Int t = p0 + p2;
-  iSum = ((p1 + p2) << 5) + (p1 << 4) - ( (t + p3) << 2) - ( p1 << 1) - t;
-
-  return iSum;
-}
-
-template<UInt bitDepth>
-__inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VPS04_C_HAL( Pel* pSrc, Int iStride )
-{
-  // {  -4,  36,  36,   -4,}, // 1/2
-  Int iSum;
-  Int iTemp0 = pSrc[iStride*1]+pSrc[iStride*2];
-  Int iTemp1 = pSrc[        0]+pSrc[iStride*3];
-
-  iSum  = ((iTemp0<<3) + iTemp0 -iTemp1)<<2;
-
-  return iSum;
-}
-
-template<UInt bitDepth>
-__inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VIS04_C_HAL( Int* pSrc, Int iStride )
-{
-  // {  -4,  36,  36,   -4,}, //1/2
-  Int iSum;
-  Int iTemp0 = pSrc[iStride*1]+pSrc[iStride*2];
-  Int iTemp1 = pSrc[        0]+pSrc[iStride*3];
-
-  iSum  = ((iTemp0<<3) + iTemp0 -iTemp1)<<2;
-
-  return iSum;
-}
-
-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;
-
-  Int p0 = pSrc[0];     iIdx+= iStride;
-  Int p1 = pSrc[iIdx];  iIdx+= iStride;
-  Int p2 = pSrc[iIdx];  iIdx+= iStride;
-  Int p3 = pSrc[iIdx];  
-  Int t = p1 + p3;
-  iSum = ((p1 + p2) << 5) + (p2 << 4) - ( (t + p0) << 2) - ( p2 << 1) - t;
-
-  return iSum;
-}
-
-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;
-
-  Int p0 = pSrc[0];     iIdx+= iStride;
-  Int p1 = pSrc[iIdx];  iIdx+= iStride;
-  Int p2 = pSrc[iIdx];  iIdx+= iStride;
-  Int p3 = pSrc[iIdx];  
-  Int t = p1 + p3;
-  iSum = ((p1 + p2) << 5) + (p2 << 4) - ( (t + p0) << 2) - ( p2 << 1) - t;
-
-  return iSum;
-}
-
-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;
-
-  Int p0 = pSrc[0];     iIdx+= iStride;
-  Int p1 = pSrc[iIdx];  iIdx+= iStride;
-  Int p2 = pSrc[iIdx];  iIdx+= iStride;
-  Int p3 = pSrc[iIdx];  
-  iSum = (p2<<6) -((p2+p3)<<2) +p3 +(p1<<3) -p0;
-
-  return iSum;
-}
-
-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;
-
-  Int p0 = pSrc[0];     iIdx+= iStride;
-  Int p1 = pSrc[iIdx];  iIdx+= iStride;
-  Int p2 = pSrc[iIdx];  iIdx+= iStride;
-  Int p3 = pSrc[iIdx];  
-  iSum = (p2<<6) -((p2+p3)<<2) +p3 +(p1<<3) -p0;
-
-  return iSum;
-}
-
-#endif // NH_3D
 #endif // __TRENINTERP__
Index: branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenModSetupStrParser.cpp
===================================================================
--- branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenModSetupStrParser.cpp	(revision 1389)
+++ branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenModSetupStrParser.cpp	(revision 1390)
@@ -37,416 +37,3 @@
 #include "TRenModSetupStrParser.h"
 
-#if NH_3D_VSO
-Int
-TRenModSetupStrParser::getNumOfModels()
-{
-  return m_iNumberOfModels;
-}
 
-Int
-TRenModSetupStrParser::getNumOfBaseViews()
-{
-  return (Int) m_aiAllBaseViewIdx  .size();
-}
-
-Int
-TRenModSetupStrParser::getNumOfModelsForView( Int iViewIdx, Int iContent )
-{
-  return (Int) m_aaaiModelNums[iContent][iViewIdx].size();
-}
-
-Int
-TRenModSetupStrParser::getNumOfBaseViewsForView( Int iViewIdx, Int iContent )
-{
-  return (Int) m_aaaiBaseViewsIdx[iContent][iViewIdx].size();
-}
-
-Void
-TRenModSetupStrParser::getSingleModelData( Int iSrcViewIdx,
-                                           Int iSrcCnt,
-                                           Int iCurModel,
-                                           Int& riModelNum,
-                                           Int& riBlendMode,
-                                           Int& riLeftBaseViewIdx,
-                                           Int& riRightBaseViewIdx,
-                                           Int& riOrgRefBaseViewIdx,
-                                           Int& riSynthViewRelNum )
-{
-  Bool bExtrapolate    = m_aaabExtrapolate[iSrcCnt][iSrcViewIdx][iCurModel];
-  Bool bOrgRef         = m_aaabOrgRef     [iSrcCnt][iSrcViewIdx][iCurModel];
-
-  riOrgRefBaseViewIdx = bOrgRef ? m_aaaiSynthViewNums[iSrcCnt][iSrcViewIdx][iCurModel] / ( (Int) VIEW_NUM_PREC ) : -1;
-  riSynthViewRelNum    = m_aaaiSynthViewNums[iSrcCnt][iSrcViewIdx][iCurModel];
-  riModelNum           = m_aaaiModelNums    [iSrcCnt][iSrcViewIdx][iCurModel];
-  riBlendMode          = m_aaaiBlendMode    [iSrcCnt][iSrcViewIdx][iCurModel];
-
-
-  Int iSrcViewNum = iSrcViewIdx * ((Int) VIEW_NUM_PREC );
-  if ( iSrcViewNum < riSynthViewRelNum )
-  {
-    riLeftBaseViewIdx  = iSrcViewIdx;
-    riRightBaseViewIdx = -1;
-  }
-  else
-  {
-    riLeftBaseViewIdx = -1;
-    riRightBaseViewIdx  = iSrcViewIdx;
-  }
-
-  if ( !bExtrapolate )
-  {
-    std::vector<Int> cCurBaseViews = m_aaaiBaseViewsIdx[iSrcCnt][iSrcViewIdx];
-
-    Int iMinDist = MAX_INT;
-    Int iNearestNum = -1;
-
-    for (Int iCurBaseView = 0; iCurBaseView < cCurBaseViews.size(); iCurBaseView++ )
-    {
-      Int iCurBaseNum = m_aaaiBaseViewsIdx [iSrcCnt][iSrcViewIdx][iCurBaseView];
-
-      if ( iCurBaseNum == iSrcViewNum )
-        continue;
-
-      Int iDist = iCurBaseNum - riSynthViewRelNum;
-
-      if ( ( iDist <= 0  && riLeftBaseViewIdx == -1) || ( iDist >= 0  && riRightBaseViewIdx == -1 ) )
-      {
-        if ( abs(iDist) < iMinDist )
-        {
-          iMinDist = abs(iDist);
-          iNearestNum = iCurBaseNum;
-        }
-      }
-    }
-    xError(iNearestNum == -1);
-
-    if (riLeftBaseViewIdx == -1 )
-    {
-      riLeftBaseViewIdx = iNearestNum / (Int) (VIEW_NUM_PREC);
-    }
-    else
-    {
-      riRightBaseViewIdx = iNearestNum / (Int) (VIEW_NUM_PREC);
-    }
-
-    xError(riLeftBaseViewIdx  == -1 );
-    xError(riRightBaseViewIdx == -1 );
-    xError(riLeftBaseViewIdx  >= riRightBaseViewIdx );
-  }
-}
-
-Void
-TRenModSetupStrParser::getBaseViewData( Int iSourceViewIdx, Int iSourceContent, Int iCurView, Int& riBaseViewSIdx, Int& riVideoDistMode, Int& riDepthDistMode )
-{
-  riBaseViewSIdx = m_aaaiBaseViewsIdx  [iSourceContent][iSourceViewIdx][iCurView] / (Int) VIEW_NUM_PREC;
-  riVideoDistMode            = m_aaaiVideoDistMode [iSourceContent][iSourceViewIdx][iCurView];
-  riDepthDistMode            = m_aaaiDepthDistMode [iSourceContent][iSourceViewIdx][iCurView];
-}
-
-TRenModSetupStrParser::TRenModSetupStrParser()
-{
-  m_pchSetStr       = NULL;
-  m_iPosInStr       = 0;
-  m_iNumberOfModels = 0;
-  m_bCurrentViewSet = false;
-}
-
-Void
-TRenModSetupStrParser::setString( Int iNumOfBaseViews, TChar* pchSetStr )
-{
-  for (Int iContent = 0; iContent < 2; iContent++)
-  {
-    m_aaaiBaseViewsIdx  [iContent].resize( iNumOfBaseViews );
-    m_aaaiDepthDistMode [iContent].resize( iNumOfBaseViews );
-    m_aaaiVideoDistMode [iContent].resize( iNumOfBaseViews );
-    m_aaaiSynthViewNums [iContent].resize( iNumOfBaseViews );
-    m_aaaiModelNums     [iContent].resize( iNumOfBaseViews );
-    m_aaabOrgRef        [iContent].resize( iNumOfBaseViews );
-    m_aaabExtrapolate   [iContent].resize( iNumOfBaseViews );
-    m_aaaiBlendMode     [iContent].resize( iNumOfBaseViews );
-  }
-
-  AOT( m_pchSetStr );
-  m_pchSetStr = pchSetStr;
-  m_iPosInStr       = 0;
-  m_bCurrentViewSet = false;
-
-  xParseString();
-}
-
-Void
-TRenModSetupStrParser::xParseString()
-{
-  TChar cChar;
-  xGetNextChar(cChar);
-  while(  cChar != '\0' )
-  {
-    xParseSourceView();
-    xGetNextChar(cChar);
-  }
-  // CHECK
-  size_t iNumOfSrcViews = m_aaaiBaseViewsIdx[0].size();
-
-  for (Int iSrcView = 0; iSrcView < iNumOfSrcViews; iSrcView++)
-  {
-    for (Int iContent = 0; iContent < 2; iContent++ )
-    {
-      size_t iNumOfBase  = m_aaaiBaseViewsIdx  [iContent][iSrcView].size();
-      AOF( iNumOfBase   == m_aaaiDepthDistMode [iContent][iSrcView].size());
-      AOF( iNumOfBase   == m_aaaiVideoDistMode [iContent][iSrcView].size());
-
-      size_t iNumOfModels = m_aaaiSynthViewNums[iContent][iSrcView].size();
-      AOF( iNumOfModels == m_aaaiModelNums     [iContent][iSrcView].size());
-      AOF( iNumOfModels == m_aaabOrgRef        [iContent][iSrcView].size());
-      AOF( iNumOfModels == m_aaabExtrapolate   [iContent][iSrcView].size());
-    }
-  }
-
-  // SORT
-  std::vector<Int>::iterator cIterNewEnd;
-
-  std::sort( m_aiAllBaseViewIdx.begin(), m_aiAllBaseViewIdx.end() );
-  cIterNewEnd = std::unique( m_aiAllBaseViewIdx.begin(), m_aiAllBaseViewIdx.end() );
-  m_aiAllBaseViewIdx.erase( cIterNewEnd, m_aiAllBaseViewIdx.end() );
-
-  std::sort( m_aiAllSynthViewNums.begin(), m_aiAllSynthViewNums.end() );
-  cIterNewEnd = std::unique( m_aiAllSynthViewNums.begin(), m_aiAllSynthViewNums.end() );
-  m_aiAllSynthViewNums.erase( cIterNewEnd, m_aiAllSynthViewNums.end() );
-}
-
-Void
-TRenModSetupStrParser::xParseSourceView()
-{
-  m_bCurrentViewSet = false;
-
-  TChar cChar;
-  xGetNextCharGoOn( cChar );
-  xError( cChar != '[' );
-  xReadViewInfo('B');
-
-  Bool bContinueReading = true;
-  while( bContinueReading )
-  {
-    xGetNextCharGoOn( cChar );
-    switch ( cChar )
-    {
-    case 'B':
-    case 'I':
-    case 'E':
-    case 'L':
-    case 'R':
-      xReadViews( cChar );
-      break;
-    case ']':
-      bContinueReading = false;
-      break;
-    default:
-      xError(true);
-      break;
-    }
-  }
-}
-
-Void
-TRenModSetupStrParser::xReadViews( TChar cType )
-{
-  TChar cChar;
-  xGetNextCharGoOn( cChar );
-  xError( cChar != '(' );
-
-  Bool bContinue = true;
-  while ( bContinue )
-  {
-    xGetNextChar( cChar );
-    if (cChar == ')')
-    {
-      xGetNextCharGoOn( cChar );
-      bContinue = false;
-    }
-    else
-    {
-      xReadViewInfo( cType );
-    }
-  }
-}
-
-Void
-TRenModSetupStrParser::xReadViewInfo( TChar cType )
-{
-  std::vector<Int> aiViewNums;
-  aiViewNums.clear();
-
-  switch ( cType )
-  {
-  case 'B':
-    TChar cVideoType;
-    TChar cDepthType;
-
-    xGetNextCharGoOn   ( cVideoType );
-    xGetNextCharGoOn   ( cDepthType );
-    xGetViewNumberRange( aiViewNums );
-
-    if ( !m_bCurrentViewSet )
-    {
-      xError( aiViewNums.size() != 1 );
-      m_iCurrentView = aiViewNums[0] / (Int) VIEW_NUM_PREC;
-      if      ( cVideoType == 'x' )
-      {
-        m_iCurrentContent = 0;
-        m_bCurrentViewSet = true;
-      }
-      else if ( cDepthType == 'x' )
-      {
-        m_iCurrentContent = 1;
-        m_bCurrentViewSet = true;
-      }
-      else
-      {
-        xError( true );
-      }
-    }
-
-    for ( Int iIdx = 0; iIdx < aiViewNums.size(); iIdx++ )
-    {
-      xAddBaseView( aiViewNums[iIdx], cVideoType, cDepthType );
-    }
-    break;
-
-  case 'E':
-  case 'I':
-  case 'L':
-  case 'R':
-    TChar cRefType;
-    xGetNextCharGoOn   ( cRefType   );
-    xGetViewNumberRange( aiViewNums );
-    for ( Int iIdx = 0; iIdx < aiViewNums.size(); iIdx++ )
-    {
-      xAddSynthView( aiViewNums[iIdx], cType, cRefType );
-    }
-  }
-}
-
-Void
-TRenModSetupStrParser::xAddBaseView( Int iViewIdx, TChar cVideoType, TChar cDepthType )
-{
-  AOF( m_bCurrentViewSet );
-
-  if ( cDepthType == 'x' ) cDepthType = 'o';
-  if ( cVideoType == 'x' ) cVideoType = 'o';
-  
-  xError( cDepthType != 'o' && cDepthType != 'c' && cVideoType != 'r' );
-  xError( cVideoType != 'o' && cVideoType != 'c' && cVideoType != 'r' );
-  m_aiAllBaseViewIdx.push_back( iViewIdx );
-  m_aaaiBaseViewsIdx  [m_iCurrentContent][m_iCurrentView].push_back( iViewIdx          );
-  m_aaaiVideoDistMode [m_iCurrentContent][m_iCurrentView].push_back( ( cVideoType == 'c' ) ? 2 : ( (cVideoType == 'r') ? 1 :  0 ) );
-  m_aaaiDepthDistMode [m_iCurrentContent][m_iCurrentView].push_back( ( cDepthType == 'c' ) ? 2 : ( (cDepthType == 'r') ? 1 :  0 ) );
-}
-
-Void
-TRenModSetupStrParser::xAddSynthView( Int iViewNum, TChar cType, TChar cRefType )
-{
-  AOF( m_bCurrentViewSet );
-
-  xError( cRefType != 's' && cRefType != 'o' );
-
-  m_aiAllSynthViewNums.push_back( iViewNum );
-
-  Int iBlendMode;
-  switch ( cType )
-  {
-  case 'E':
-    iBlendMode = BLEND_NONE;
-    break;
-  case 'I':
-    iBlendMode = BLEND_AVRG;
-    break;
-  case 'L':
-    iBlendMode = BLEND_LEFT;
-    break;
-  case 'R':
-    iBlendMode = BLEND_RIGHT;
-    break;
-  default:
-    xError(false);
-    break;
-  }
-
-  m_aaaiBlendMode    [m_iCurrentContent][m_iCurrentView].push_back( iBlendMode        );
-  m_aaaiSynthViewNums[m_iCurrentContent][m_iCurrentView].push_back( iViewNum          );
-  m_aaabExtrapolate  [m_iCurrentContent][m_iCurrentView].push_back( cType    == 'E'   );
-  m_aaabOrgRef       [m_iCurrentContent][m_iCurrentView].push_back( cRefType == 'o'   );
-  m_aaaiModelNums    [m_iCurrentContent][m_iCurrentView].push_back( m_iNumberOfModels );
-
-  m_iNumberOfModels++;
-}
-
-Void
-TRenModSetupStrParser::xError( Bool bIsError )
-{
-  if ( bIsError )
-  {
-    std::cout << "RenModel setup string invalid. Last character read: " << m_iPosInStr << std::endl;
-    AOF( false );
-    exit(0);
-  }
-}
-
-Void
-TRenModSetupStrParser::xGetViewNumberRange( std::vector<Int>& raiViewNumbers )
-{
-  size_t iStartPos;
-  size_t iEndPos;
-  TChar cChar;
-  xGetNextCharGoOn(cChar );
-  if (cChar == '{')
-  {
-    iStartPos = m_iPosInStr;
-    while( m_pchSetStr[m_iPosInStr] != '}' )
-    {
-      xError( m_iPosInStr == '\0' );
-      m_iPosInStr++;
-    }
-    iEndPos = m_iPosInStr - 1;
-    m_iPosInStr++;
-  }
-  else
-  {
-    iStartPos = m_iPosInStr - 1;
-    while( m_pchSetStr[m_iPosInStr] != ' ' && m_pchSetStr[m_iPosInStr] != ',' && m_pchSetStr[m_iPosInStr] != ')' )
-    {
-      xError( m_iPosInStr == '\0' );
-      m_iPosInStr++;
-    }
-    iEndPos = m_iPosInStr - 1;
-  }
-
-  size_t iNumElem = iEndPos - iStartPos + 1;
-  TChar* pcTempBuffer = new TChar[  iNumElem + 1];
-  strncpy( pcTempBuffer, m_pchSetStr + iStartPos, iNumElem );
-  pcTempBuffer[iNumElem] = '\0';
-
-  TAppComCamPara::convertNumberString( pcTempBuffer, raiViewNumbers, VIEW_NUM_PREC );
-  delete[] pcTempBuffer;
-}
-
-Void
-TRenModSetupStrParser::xGetNextCharGoOn( TChar& rcNextChar )
-{
-  while ( m_pchSetStr[m_iPosInStr] == ' ' || m_pchSetStr[m_iPosInStr] == ',' )
-  {
-    xError( m_pchSetStr[m_iPosInStr] == '\0' );
-    m_iPosInStr++;
-  }
-  rcNextChar = m_pchSetStr[m_iPosInStr];
-  m_iPosInStr++;
-}
-
-Void
-TRenModSetupStrParser::xGetNextChar( TChar& rcNextChar )
-{
-  size_t iPos = m_iPosInStr;
-  while ( ( m_pchSetStr[iPos] == ' ' || m_pchSetStr[iPos] == ',' ) && m_pchSetStr[iPos] != '\0' ) iPos++;
-  rcNextChar = m_pchSetStr[iPos];
-}
-#endif // NH_3D
-
Index: branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenModSetupStrParser.h
===================================================================
--- branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenModSetupStrParser.h	(revision 1389)
+++ branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenModSetupStrParser.h	(revision 1390)
@@ -39,94 +39,4 @@
 #include "../TLibCommon/TypeDef.h"
 #include "../TAppCommon/TAppComCamPara.h"
-#if NH_3D_VSO
-
-
-
-#include <list>
-#include <vector>
-#include <math.h>
-#include <errno.h>
-#include <vector>
-#include <iostream>
-#include <algorithm>
-#include <functional>
-#include <string>
-#include <cstdio>
-#include <cstring>
-
-
-using namespace std;
-
-class TRenModSetupStrParser
-{
-public:
-
-  Int  getNumOfModels          ();
-  Int  getNumOfBaseViews       ();
-
-  Int  getNumOfModelsForView   ( Int iViewIdx, Int iContent );
-  Int  getNumOfBaseViewsForView( Int iViewIdx, Int iContent );
-
-  Void getSingleModelData      ( Int  iSrcViewIdx,
-                                 Int  iSrcCnt,
-                                 Int  iCurModel,
-                                 Int& riModelNum,
-                                 Int& riInterpolationType,
-                                 Int& riLeftBaseViewIdx,
-                                 Int& riRightBaseViewIdx,
-                                 Int& riOrgRefBaseViewIdx,
-                                 Int& riSynthViewRelNum
-                               );
-
-  Void getBaseViewData         ( Int   iSourceViewIdx,
-                                 Int   iSourceContent,
-                                 Int   iCurView,
-                                 Int&  riBaseViewSIdx,
-                                 Int&  riVideoDistMode,
-                                 Int&  riDepthDistMode
-                                );
-
-  IntAry1d*  getSynthViews() { return &m_aiAllSynthViewNums;  }
-  IntAry1d*  getBaseViews()  { return &m_aiAllBaseViewIdx;    }
-
-  TRenModSetupStrParser();
-
-  Void setString( Int iNumOfBaseViews, TChar* pchSetStr );
-
-private:
-  IntAry2d                         m_aaaiBaseViewsIdx  [2];
-  IntAry2d                         m_aaaiVideoDistMode [2];
-  IntAry2d                         m_aaaiDepthDistMode [2];
-  IntAry2d                         m_aaaiModelNums     [2];
-  IntAry2d                         m_aaaiSynthViewNums [2];
-  BoolAry2d                        m_aaabOrgRef        [2];
-  BoolAry2d                        m_aaabExtrapolate   [2];
-  IntAry2d                         m_aaaiBlendMode     [2];
-
-  IntAry1d                         m_aiAllBaseViewIdx;
-  IntAry1d                         m_aiAllSynthViewNums;
-
-  Bool                             m_bCurrentViewSet;
-  Int                              m_iCurrentView;
-  Int                              m_iCurrentContent;
-  Int                              m_iNumberOfModels;
-
-  TChar*                            m_pchSetStr;
-  size_t                           m_iPosInStr;
-
-private:
-  Void xParseString();
-  Void xParseSourceView();
-  Void xReadViews         ( TChar cType );
-  Void xReadViewInfo      ( TChar cType );
-  Void xAddBaseView       ( Int iViewIdx, TChar cVideoType, TChar cDepthType );
-  Void xAddSynthView      ( Int iViewNum, TChar cType, TChar cRefType );
-  Void xError             ( Bool bIsError );
-  Void xGetViewNumberRange( std::vector<Int>& raiViewNumbers );
-  Void xGetNextCharGoOn   ( TChar& rcNextChar );
-  Void xGetNextChar       ( TChar& rcNextChar );
-};
-
-#endif // NH_3D
 #endif //__TRENMODEL__
 
Index: branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenModel.cpp
===================================================================
--- branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenModel.cpp	(revision 1389)
+++ branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenModel.cpp	(revision 1390)
@@ -36,668 +36,2 @@
 #include "TRenModel.h"
 
-#if NH_3D_VSO
-///////////  TRENMODEL //////////////////////
-TRenModel::TRenModel()
-{
-  m_iPad               = PICYUV_PAD;
-  m_iWidth             = -1;
-  m_iHeight            = -1;
-  m_iUsedHeight        = -1; 
-  m_iNumOfBaseViews    = -1;
-  m_iSampledWidth      = -1;
-  m_iShiftPrec         =  0;
-  m_iHoleMargin        =  1;
-  m_uiHorOff           = -1;
-#if H_3D_VSO_EARLY_SKIP
-  m_bEarlySkip         = false; 
-#endif
-
-  // Current Error Type ///
-  m_iCurrentView       = -1;
-  m_iCurrentContent    = -1;
-  m_iCurrentPlane      = -1;
-
-  // Array of Models used to determine the Current Error ///
-  m_iNumOfCurRenModels = -1;
-  m_apcCurRenModels    = NULL;
-  m_aiCurPosInModels   = NULL;
-
-  // Array of Models ///
-  m_iNumOfRenModels    = -1;
-  m_apcRenModels       = NULL;
-
-  // Mapping from View number to models ///
-  m_aiNumOfModelsForDepthView = NULL;
-  m_aapcRenModelForDepthView  = NULL;
-  m_aaePosInModelForDepthView = NULL;
-
-  m_aiNumOfModelsForVideoView = NULL;
-  m_aapcRenModelForVideoView  = NULL;
-  m_aaePosInModelForVideoView = NULL;
-  m_aaeBaseViewPosInModel     = NULL;
-
-  // Data
-  m_aapiCurVideoPel      = NULL;
-  m_aaiCurVideoStrides   = NULL;
-  m_apiCurDepthPel       = NULL;
-  m_aiCurDepthStrides    = NULL;
-
-  m_aapiOrgVideoPel      = NULL;
-  m_aaiOrgVideoStrides   = NULL;
-  m_apiOrgDepthPel       = NULL;
-  m_aiOrgDepthStrides    = NULL;
-
-  m_aaaiSubPelShiftLut[0]= NULL;
-  m_aaaiSubPelShiftLut[1]= NULL;
-
-  /// Current Setup data ///
-  m_abSetupVideoFromOrgForView = NULL;
-  m_abSetupDepthFromOrgForView = NULL;
-}
-
-TRenModel::~TRenModel()
-{
-  if ( m_apcRenModels )
-  {
-    for (Int iNumModel = 0; iNumModel < m_iNumOfRenModels; iNumModel++)
-    {
-      if ( m_apcRenModels[iNumModel] ) delete m_apcRenModels[iNumModel];
-    }
-
-    delete[] m_apcRenModels;
-  }
-
-  for (Int iViewNum = 0; iViewNum < m_iNumOfBaseViews; iViewNum++)
-  {
-    if ( m_aapcRenModelForDepthView && m_aapcRenModelForDepthView [iViewNum] )
-    {
-      delete[]   m_aapcRenModelForDepthView [iViewNum];
-    }
-
-    if ( m_aaePosInModelForDepthView && m_aaePosInModelForDepthView[iViewNum] )
-    {
-      delete[]   m_aaePosInModelForDepthView[iViewNum];
-    }
-
-    if ( m_aapcRenModelForVideoView && m_aapcRenModelForVideoView[iViewNum] )
-    {
-      delete[]   m_aapcRenModelForVideoView[iViewNum];
-    }
-
-    if ( m_aaePosInModelForVideoView && m_aaePosInModelForVideoView[iViewNum] )
-    {
-      delete[]   m_aaePosInModelForVideoView[iViewNum];
-    }
-
-    if ( m_aaeBaseViewPosInModel && m_aaeBaseViewPosInModel[iViewNum] )
-    {
-      delete[]   m_aaeBaseViewPosInModel[iViewNum];
-    }
-
-    if ( m_aapiCurVideoPel && m_aapiCurVideoPel    [iViewNum] )
-    {
-      delete[] ( m_aapiCurVideoPel    [iViewNum][0] - m_iPad * m_aaiCurVideoStrides[iViewNum][0] - m_iPad );
-      delete[] ( m_aapiCurVideoPel    [iViewNum][1] - m_iPad * m_aaiCurVideoStrides[iViewNum][1] - m_iPad );
-      delete[] ( m_aapiCurVideoPel    [iViewNum][2] - m_iPad * m_aaiCurVideoStrides[iViewNum][2] - m_iPad );
-      delete[]   m_aapiCurVideoPel    [iViewNum];
-    }
-
-    if ( m_aaiCurVideoStrides && m_aaiCurVideoStrides [iViewNum] )
-    {
-      delete[]   m_aaiCurVideoStrides [iViewNum];
-    }
-
-    if ( m_apiCurDepthPel )
-    {
-      delete[] ( m_apiCurDepthPel     [iViewNum]    - m_iPad * m_aiCurDepthStrides [iViewNum]    - m_iPad );
-    }
-
-    if ( m_aapiOrgVideoPel && m_aapiOrgVideoPel    [iViewNum] )
-    {
-      delete[] ( m_aapiOrgVideoPel    [iViewNum][0] - m_iPad * m_aaiOrgVideoStrides[iViewNum][0] - m_iPad );
-      delete[] ( m_aapiOrgVideoPel    [iViewNum][1] - m_iPad * m_aaiOrgVideoStrides[iViewNum][1] - m_iPad );
-      delete[] ( m_aapiOrgVideoPel    [iViewNum][2] - m_iPad * m_aaiOrgVideoStrides[iViewNum][2] - m_iPad );
-      delete[]   m_aapiOrgVideoPel    [iViewNum];
-    }
-
-    if ( m_aaiOrgVideoStrides && m_aaiOrgVideoStrides [iViewNum] )
-    {
-      delete[]   m_aaiOrgVideoStrides [iViewNum];
-    }
-
-    if ( m_apiOrgDepthPel && m_apiOrgDepthPel     [iViewNum ] )
-    {
-      delete[] ( m_apiOrgDepthPel     [iViewNum]    - m_iPad * m_aiOrgDepthStrides [iViewNum]    - m_iPad );
-    }
-  }
-
-  if(m_aiNumOfModelsForDepthView) delete[] m_aiNumOfModelsForDepthView;
-  if(m_aapcRenModelForDepthView ) delete[] m_aapcRenModelForDepthView ;
-  if(m_aaePosInModelForDepthView) delete[] m_aaePosInModelForDepthView;
-
-  if(m_aiNumOfModelsForVideoView) delete[] m_aiNumOfModelsForVideoView;
-  if(m_aapcRenModelForVideoView ) delete[] m_aapcRenModelForVideoView ;
-  if(m_aaePosInModelForVideoView) delete[] m_aaePosInModelForVideoView;
-
-
-  if(m_aaeBaseViewPosInModel    ) delete[] m_aaeBaseViewPosInModel    ;
-  if(m_aapiCurVideoPel          ) delete[] m_aapiCurVideoPel          ;
-  if(m_aaiCurVideoStrides       ) delete[] m_aaiCurVideoStrides       ;
-
-  if(m_abSetupVideoFromOrgForView) delete[] m_abSetupVideoFromOrgForView;
-  if(m_abSetupDepthFromOrgForView) delete[] m_abSetupDepthFromOrgForView;
-
-  if(m_aapiOrgVideoPel          ) delete[] m_aapiOrgVideoPel          ;
-  if(m_aaiOrgVideoStrides       ) delete[] m_aaiOrgVideoStrides       ;
-
-  if(m_apiOrgDepthPel           ) delete[] m_apiOrgDepthPel           ;
-  if(m_aiOrgDepthStrides        ) delete[] m_aiOrgDepthStrides        ;
-
-  if(m_apiCurDepthPel           ) delete[] m_apiCurDepthPel           ;
-  if(m_aiCurDepthStrides        ) delete[] m_aiCurDepthStrides        ;
-
-  Int iNumEntries = (1 << ( m_iShiftPrec + 1) ) + 1 ;
-
-  for (UInt uiEntry = 0; uiEntry < iNumEntries; uiEntry++)
-  {
-    if ( m_aaaiSubPelShiftLut[0] && m_aaaiSubPelShiftLut[0][uiEntry] )
-      delete[] m_aaaiSubPelShiftLut[0][uiEntry];
-
-    if ( m_aaaiSubPelShiftLut[1] && m_aaaiSubPelShiftLut[1][uiEntry] )
-      delete[] m_aaaiSubPelShiftLut[1][uiEntry];
-  }
-
-  if( m_aaaiSubPelShiftLut[0] ) delete[] m_aaaiSubPelShiftLut[0];
-  if( m_aaaiSubPelShiftLut[1] ) delete[] m_aaaiSubPelShiftLut[1];
-}
-
-
-
-Void
-#if H_3D_VSO_EARLY_SKIP
-TRenModel::create( Int iNumOfBaseViews, Int iNumOfModels, Int iWidth, Int iHeight, Int iShiftPrec, Int iHoleMargin, Bool bEarlySkip )
-#else
-TRenModel::create( Int iNumOfBaseViews, Int iNumOfModels, Int iWidth, Int iHeight, Int iShiftPrec, Int iHoleMargin )
-#endif
-{
-  m_iNumOfBaseViews     = iNumOfBaseViews;
-  m_iNumOfRenModels     = iNumOfModels;
-  m_iWidth              = iWidth;
-  m_iHeight             = iHeight;
-  m_iShiftPrec          = iShiftPrec;
-  m_iHoleMargin         = iHoleMargin;
-#if H_3D_VSO_EARLY_SKIP
-  m_bEarlySkip          = bEarlySkip; 
-#endif
-
-
-// LUTs for sub pel shifting
-  Int iNumEntries = (1 << ( m_iShiftPrec + 1) ) + 1 ;
-  m_aaaiSubPelShiftLut[0] = new Int*[ iNumEntries ];
-  m_aaaiSubPelShiftLut[1] = new Int*[ iNumEntries ];
-  for (UInt uiEntry = 0; uiEntry < iNumEntries; uiEntry++)
-  {
-    m_aaaiSubPelShiftLut[0][uiEntry] = new Int[ iNumEntries ];
-    m_aaaiSubPelShiftLut[1][uiEntry] = new Int[ iNumEntries ];
-  }
-
-  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;
-
-
-  m_aapiCurVideoPel     = new Pel**     [m_iNumOfBaseViews];
-  m_aaiCurVideoStrides  = new Int*      [m_iNumOfBaseViews];
-  m_apiCurDepthPel      = new Pel*      [m_iNumOfBaseViews];
-  m_aiCurDepthStrides   = new Int       [m_iNumOfBaseViews];
-
-  m_aapiOrgVideoPel     = new Pel**     [m_iNumOfBaseViews];
-  m_aaiOrgVideoStrides  = new Int*      [m_iNumOfBaseViews];
-
-  m_apiOrgDepthPel      = new Pel*      [m_iNumOfBaseViews];
-  m_aiOrgDepthStrides   = new Int       [m_iNumOfBaseViews];
-
-  m_abSetupVideoFromOrgForView = new Bool[m_iNumOfBaseViews];
-  m_abSetupDepthFromOrgForView = new Bool[m_iNumOfBaseViews];
-
-  m_iNumOfCurRenModels   = 0;
-  m_apcCurRenModels      = NULL;
-  m_aiCurPosInModels     = NULL;
-
-  m_apcRenModels         = new TRenSingleModel*       [m_iNumOfRenModels];
-
-  m_aiNumOfModelsForDepthView = new Int               [m_iNumOfBaseViews];
-  m_aapcRenModelForDepthView  = new TRenSingleModel** [m_iNumOfBaseViews];
-  m_aaePosInModelForDepthView = new Int*              [m_iNumOfBaseViews];
-
-  m_aiNumOfModelsForVideoView = new Int               [m_iNumOfBaseViews];
-  m_aapcRenModelForVideoView  = new TRenSingleModel** [m_iNumOfBaseViews];
-  m_aaePosInModelForVideoView = new Int*              [m_iNumOfBaseViews];
-  m_aaeBaseViewPosInModel     = new Int*              [m_iNumOfBaseViews];
-
-
-  for (Int iModelNum = 0; iModelNum < m_iNumOfRenModels; iModelNum++)
-  {
-    m_apcRenModels         [iModelNum] = NULL;
-  }
-
-  for (Int iViewNum = 0; iViewNum < m_iNumOfBaseViews; iViewNum++ )
-  {
-    m_aiNumOfModelsForDepthView[ iViewNum ] = 0;
-    m_aiNumOfModelsForVideoView[ iViewNum ] = 0;
-
-    m_aapcRenModelForDepthView [iViewNum] = new TRenSingleModel*[m_iNumOfRenModels];
-    m_aapcRenModelForVideoView [iViewNum] = new TRenSingleModel*[m_iNumOfRenModels];
-
-    m_aaePosInModelForDepthView[iViewNum] = new Int             [m_iNumOfRenModels];
-    m_aaePosInModelForVideoView[iViewNum] = new Int             [m_iNumOfRenModels];
-    m_aaeBaseViewPosInModel    [iViewNum] = new Int             [m_iNumOfRenModels];
-
-    for (Int iModelNum = 0; iModelNum< m_iNumOfRenModels; iModelNum++)
-    {
-      m_aapcRenModelForDepthView [iViewNum] [iModelNum] = NULL;
-      m_aapcRenModelForVideoView [iViewNum] [iModelNum] = NULL;
-      m_aaePosInModelForDepthView[iViewNum] [iModelNum] = VIEWPOS_INVALID;
-      m_aaePosInModelForVideoView[iViewNum] [iModelNum] = VIEWPOS_INVALID;
-      m_aaeBaseViewPosInModel    [iViewNum] [iModelNum] = VIEWPOS_INVALID;
-    };
-
-    m_aaiCurVideoStrides  [iViewNum]     =  new Int[3];
-    m_aaiCurVideoStrides  [iViewNum][0]  =  m_iSampledWidth + (m_iPad << 1);
-    m_aaiCurVideoStrides  [iViewNum][1]  =  m_iSampledWidth + (m_iPad << 1);
-    m_aaiCurVideoStrides  [iViewNum][2]  =  m_iSampledWidth + (m_iPad << 1);
-
-    m_aapiCurVideoPel     [iViewNum]     = new Pel*[3];
-    m_aapiCurVideoPel     [iViewNum][0]  = new Pel [ m_aaiCurVideoStrides[iViewNum][0] * ( m_iHeight  + (m_iPad << 1) )];
-    m_aapiCurVideoPel     [iViewNum][1]  = new Pel [ m_aaiCurVideoStrides[iViewNum][1] * ( m_iHeight  + (m_iPad << 1) )];
-    m_aapiCurVideoPel     [iViewNum][2]  = new Pel [ m_aaiCurVideoStrides[iViewNum][2] * ( m_iHeight  + (m_iPad << 1) )];
-
-    m_aapiCurVideoPel     [iViewNum][0] += m_aaiCurVideoStrides[iViewNum][0] * m_iPad + m_iPad;
-    m_aapiCurVideoPel     [iViewNum][1] += m_aaiCurVideoStrides[iViewNum][1] * m_iPad + m_iPad;
-    m_aapiCurVideoPel     [iViewNum][2] += m_aaiCurVideoStrides[iViewNum][2] * m_iPad + m_iPad;
-
-    m_aiCurDepthStrides   [iViewNum]     = m_iWidth + (m_iPad << 1);
-    m_apiCurDepthPel      [iViewNum]     = new Pel[ m_aiCurDepthStrides[iViewNum] * ( m_iHeight  + (m_iPad << 1) ) ];
-    m_apiCurDepthPel      [iViewNum]    += m_aiCurDepthStrides[iViewNum] * m_iPad + m_iPad;
-
-    m_aaiOrgVideoStrides  [iViewNum]    =  new Int[3];
-    m_aaiOrgVideoStrides  [iViewNum][0] = m_iSampledWidth + (m_iPad << 1);
-    m_aaiOrgVideoStrides  [iViewNum][1] = m_iSampledWidth + (m_iPad << 1);
-    m_aaiOrgVideoStrides  [iViewNum][2] = m_iSampledWidth + (m_iPad << 1);
-
-    m_aapiOrgVideoPel     [iViewNum]     = new Pel*[3];
-    m_aapiOrgVideoPel     [iViewNum][0]  = new Pel [ m_aaiOrgVideoStrides[iViewNum][0] * ( m_iHeight  + (m_iPad << 1) )];
-    m_aapiOrgVideoPel     [iViewNum][1]  = new Pel [ m_aaiOrgVideoStrides[iViewNum][1] * ( m_iHeight  + (m_iPad << 1) )];
-    m_aapiOrgVideoPel     [iViewNum][2]  = new Pel [ m_aaiOrgVideoStrides[iViewNum][2] * ( m_iHeight  + (m_iPad << 1) )];
-
-    m_aapiOrgVideoPel     [iViewNum][0] += m_aaiOrgVideoStrides[iViewNum][0] * m_iPad + m_iPad;
-    m_aapiOrgVideoPel     [iViewNum][1] += m_aaiOrgVideoStrides[iViewNum][1] * m_iPad + m_iPad;
-    m_aapiOrgVideoPel     [iViewNum][2] += m_aaiOrgVideoStrides[iViewNum][2] * m_iPad + m_iPad;
-
-    m_aiOrgDepthStrides   [iViewNum]     = m_iWidth + (m_iPad << 1);
-    m_apiOrgDepthPel      [iViewNum]     = new Pel[ m_aiOrgDepthStrides[iViewNum] * ( m_iHeight  + (m_iPad << 1) ) ];
-    m_apiOrgDepthPel      [iViewNum]    += m_aiOrgDepthStrides[iViewNum] * m_iPad + m_iPad;
-
-    m_abSetupVideoFromOrgForView[iViewNum] = false;
-    m_abSetupDepthFromOrgForView[iViewNum] = false;
-  }
-}
-
-Void
-TRenModel::createSingleModel( Int iBaseViewNum, Int iContent, Int iModelNum, Int iLeftViewNum, Int iRightViewNum, Bool bUseOrgRef, Int iBlendMode )
-{
-  Int iMode = ( (iLeftViewNum != -1) && ( iRightViewNum != -1 ) ) ? 2 : ( iLeftViewNum != -1 ? 0 : ( iRightViewNum != -1  ? 1 : -1 ) );
-
-  AOT( iMode == -1);
-  AOT( iModelNum < 0 || iModelNum > m_iNumOfRenModels );  
-  AOT( iLeftViewNum  < -1 || iLeftViewNum  > m_iNumOfBaseViews );
-  AOT( iRightViewNum < -1 || iRightViewNum > m_iNumOfBaseViews );
-  AOT( iBaseViewNum  < -1 || iBaseViewNum  > m_iNumOfBaseViews );
-  AOT( iBaseViewNum != -1 && iBaseViewNum != iLeftViewNum && iBaseViewNum != iRightViewNum );
-  AOT( iContent      < -1 || iContent > 1 );
-  AOT( iBlendMode < -1 || iBlendMode > 2 );  
-
-  Bool bBitInc = ( REN_BIT_DEPTH != ENC_INTERNAL_BIT_DEPTH );
-
-  AOT( m_apcRenModels[iModelNum] );
-
-  if ( bBitInc )
-  { 
-    if ( iMode != 2 ) 
-    { // No Blending
-      m_apcRenModels[iModelNum]   = new TRenSingleModelC<BLEND_NONE, true>; 
-    }
-    else
-    {
-      switch ( iBlendMode )
-      {
-      case BLEND_AVRG: // average
-        m_apcRenModels[iModelNum] = new TRenSingleModelC<BLEND_AVRG, true>;       
-        break;
-      case BLEND_LEFT: // left  view is main view
-        m_apcRenModels[iModelNum] = new TRenSingleModelC<BLEND_LEFT, true>;       
-        break;
-      case BLEND_RIGHT: // right view is main view
-        m_apcRenModels[iModelNum] = new TRenSingleModelC<BLEND_RIGHT, true>;       
-        break;
-      default: 
-        AOT(true);
-        break;
-      }    
-    }
-  }
-  else
-  {
-    if ( iMode != 2 ) 
-    { // No Blending
-      m_apcRenModels[iModelNum] = new TRenSingleModelC<BLEND_NONE, false>; 
-    }
-    else
-    {
-      switch ( iBlendMode )
-      {
-      case BLEND_AVRG: // average
-        m_apcRenModels[iModelNum] = new TRenSingleModelC<BLEND_AVRG, false>;       
-        break;
-      case BLEND_LEFT: // left  view is main view
-        m_apcRenModels[iModelNum] = new TRenSingleModelC<BLEND_LEFT, false>;       
-        break;
-      case BLEND_RIGHT: // right view is main view
-        m_apcRenModels[iModelNum] = new TRenSingleModelC<BLEND_RIGHT, false>;       
-        break;
-      default: 
-        AOT(true);
-        break;
-      }    
-    }
-  }
-
-
-#if H_3D_VSO_EARLY_SKIP
-  m_apcRenModels[iModelNum]->create( iMode ,m_iWidth, m_iHeight, m_iShiftPrec, m_aaaiSubPelShiftLut, m_iHoleMargin,  bUseOrgRef, iBlendMode, m_bEarlySkip );
-#else
-  m_apcRenModels[iModelNum]->create( iMode ,m_iWidth, m_iHeight, m_iShiftPrec, m_aaaiSubPelShiftLut, m_iHoleMargin,  bUseOrgRef, iBlendMode );
-#endif
-
-  if ( iLeftViewNum != -1 )
-  {
-    xSetLRViewAndAddModel( iModelNum, iLeftViewNum, iContent,  VIEWPOS_LEFT,  (iBaseViewNum == -1  || iBaseViewNum == iLeftViewNum   ) );
-  }
-
-  if ( iRightViewNum != -1)
-  {
-    xSetLRViewAndAddModel( iModelNum, iRightViewNum, iContent, VIEWPOS_RIGHT, (iBaseViewNum == -1  || iBaseViewNum == iRightViewNum  ) );
-  }
-}
-
-Void
-TRenModel::setBaseView( Int iViewNum, TComPicYuv* pcPicYuvVideoData, TComPicYuv* pcPicYuvDepthData, TComPicYuv* pcPicYuvOrgVideoData, TComPicYuv* pcPicYuvOrgDepthData )
-{
-  AOT( iViewNum < 0 || iViewNum > m_iNumOfBaseViews );
-  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<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
-  m_abSetupVideoFromOrgForView[iViewNum] = (pcPicYuvOrgVideoData != NULL);
-  m_abSetupDepthFromOrgForView[iViewNum] = (pcPicYuvOrgDepthData != NULL);
-
-  if ( m_abSetupVideoFromOrgForView[iViewNum] )
-  {
-    AOF( pcPicYuvOrgVideoData->getChromaFormat() == CHROMA_420 );
-    AOF( pcPicYuvOrgVideoData->getHeight( COMPONENT_Y ) >= m_iUsedHeight + m_uiHorOff && pcPicYuvOrgVideoData->getWidth( COMPONENT_Y) == m_iWidth );    
-    pcPicYuvOrgVideoData->extendPicBorder();
-    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( 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]    );
-  }
-}
-
-Void
-TRenModel::setSingleModel( Int iModelNum, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, TComPicYuv* pcPicYuvRefView )
-{
-  AOT( iModelNum < 0 || iModelNum > m_iNumOfRenModels );
-
-  m_apcRenModels[iModelNum]->setupPart( m_uiHorOff, m_iUsedHeight );
-
-  // Switch model  to original data for setup if given to render reference
-  Bool bAnyRefFromOrg = false;
-  for (Int iBaseViewIdx = 0; iBaseViewIdx < m_iNumOfBaseViews; iBaseViewIdx++ )
-  {
-    Bool bSetupFromOrgVideo = m_abSetupVideoFromOrgForView[iBaseViewIdx];
-    Bool bSetupFromOrgDepth = m_abSetupDepthFromOrgForView[iBaseViewIdx];
-    bAnyRefFromOrg          = bAnyRefFromOrg || bSetupFromOrgVideo || bSetupFromOrgDepth;
-
-    if ( m_aaeBaseViewPosInModel[iBaseViewIdx][iModelNum] != VIEWPOS_INVALID )
-    {
-      bAnyRefFromOrg = true;
-      m_apcRenModels[iModelNum]->setLRView( m_aaeBaseViewPosInModel[iBaseViewIdx][iModelNum],
-        ( bSetupFromOrgVideo ? m_aapiOrgVideoPel   : m_aapiCurVideoPel   ) [iBaseViewIdx],
-        ( bSetupFromOrgVideo ? m_aaiOrgVideoStrides: m_aaiCurVideoStrides) [iBaseViewIdx],
-        ( bSetupFromOrgDepth ? m_apiOrgDepthPel    : m_apiCurDepthPel    ) [iBaseViewIdx],
-        ( bSetupFromOrgDepth ? m_aiOrgDepthStrides : m_aiCurDepthStrides ) [iBaseViewIdx] );
-    }
-  }
-
-  m_apcRenModels[iModelNum]->setup     ( pcPicYuvRefView, ppiShiftLutLeft, ppiBaseShiftLutLeft, ppiShiftLutRight, ppiBaseShiftLutRight, iDistToLeft, false );
-
-  // Setup to Org
-  if ( bAnyRefFromOrg )
-  {
-    // Restore old values
-    for (Int iBaseViewIdx = 0; iBaseViewIdx < m_iNumOfBaseViews; iBaseViewIdx++ )
-    {
-      if ( m_aaeBaseViewPosInModel[iBaseViewIdx][iModelNum] != VIEWPOS_INVALID )
-      {
-        m_apcRenModels[iModelNum]->setLRView(
-          m_aaeBaseViewPosInModel[iBaseViewIdx][iModelNum],
-          m_aapiCurVideoPel      [iBaseViewIdx],
-          m_aaiCurVideoStrides   [iBaseViewIdx],
-          m_apiCurDepthPel       [iBaseViewIdx],
-          m_aiCurDepthStrides    [iBaseViewIdx]
-        );
-      }
-    }
-
-    // setup keeping reference rendered from original data
-    m_apcRenModels[iModelNum]->setup     ( pcPicYuvRefView, ppiShiftLutLeft, ppiBaseShiftLutLeft, ppiShiftLutRight, ppiBaseShiftLutRight, iDistToLeft, true );
-  }
-}
-
-Void
-TRenModel::setErrorMode( Int iView, Int iContent, int iPlane )
-{
-  AOT(iView > m_iNumOfBaseViews || iView < 0);
-  AOT(iContent != 0  &&  iContent != 1);
-  AOT(iPlane < 0     || iPlane > 3);
-
-  m_iCurrentView    = iView;
-  m_iCurrentContent = iContent;
-  m_iCurrentPlane   = iPlane;
-
-  if ( iContent == 1 )
-  {
-    m_iNumOfCurRenModels  = m_aiNumOfModelsForDepthView[iView];
-    m_apcCurRenModels     = m_aapcRenModelForDepthView [iView];
-    m_aiCurPosInModels    = m_aaePosInModelForDepthView[iView];
-  }
-  else
-  {
-    m_iNumOfCurRenModels  = m_aiNumOfModelsForVideoView[iView];
-    m_apcCurRenModels     = m_aapcRenModelForVideoView [iView];
-    m_aiCurPosInModels    = m_aaePosInModelForVideoView[iView];
-  }
-}
-
-
-Void
-TRenModel::setupPart ( UInt uiHorOff, Int iUsedHeight )
-{
-  AOT( iUsedHeight > m_iHeight );     
-  m_uiHorOff    = uiHorOff; 
-  m_iUsedHeight = iUsedHeight; 
-}
-
-#if H_3D_VSO_EARLY_SKIP
-RMDist
-TRenModel::getDist( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel * piOrgData, Int iOrgStride)
-#else
-RMDist
-TRenModel::getDist( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData )
-#endif
-{
-  iStartPosY -= m_uiHorOff; 
-
-  AOT( iWidth  + iStartPosX > m_iWidth  );
-  AOT( iHeight + iStartPosY > m_iUsedHeight );
-
-  AOT( iStartPosX < 0);
-  AOT( iStartPosY < 0);
-  AOT( iWidth     < 0);
-  AOT( iHeight    < 0);
-
-  RMDist iDist = 0;
-
-  for (Int iModelNum = 0; iModelNum < m_iNumOfCurRenModels; iModelNum++ )
-  {
-    if (m_iCurrentContent == 1)
-    {
-#if H_3D_VSO_EARLY_SKIP
-      iDist +=  m_apcCurRenModels[iModelNum]->getDistDepth  ( m_aiCurPosInModels[iModelNum], iStartPosX, iStartPosY,  iWidth,  iHeight,  iStride,  piNewData , piOrgData, iOrgStride);
-#else
-      iDist +=  m_apcCurRenModels[iModelNum]->getDistDepth  ( m_aiCurPosInModels[iModelNum], iStartPosX, iStartPosY,  iWidth,  iHeight,  iStride,  piNewData );
-#endif
-    }
-    else
-    {
-      iDist +=  m_apcCurRenModels[iModelNum]->getDistVideo  ( m_aiCurPosInModels[iModelNum], m_iCurrentPlane ,iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData );
-    }
-  }
-
-  return ( iDist + (m_iNumOfCurRenModels >> 1) ) / m_iNumOfCurRenModels;
-}
-
-Void
-TRenModel::setData( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData )
-{
-  iStartPosY -= m_uiHorOff; 
-
-  iWidth  = min(iWidth , m_iWidth  - iStartPosX );
-  iHeight = min(iHeight, m_iUsedHeight - iStartPosY );
-
-  AOT( iStartPosX < 0);
-  AOT( iStartPosY < 0);
-  AOT( iWidth     < 0);
-  AOT( iHeight    < 0);
-
-  for (Int iModelNum = 0; iModelNum < m_iNumOfCurRenModels; iModelNum++ )
-  {
-    if (m_iCurrentContent == 1)
-    {
-#if H_3D_VSO_EARLY_SKIP
-      Int iTargetStride = m_aiCurDepthStrides[ m_iCurrentView ];
-      m_apcCurRenModels[iModelNum]->setDepth  ( m_aiCurPosInModels[iModelNum], iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData,m_apiCurDepthPel[ m_iCurrentView ] + iStartPosY * iTargetStride + iStartPosX ,iTargetStride );
-#else
-      m_apcCurRenModels[iModelNum]->setDepth  ( m_aiCurPosInModels[iModelNum], iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData );
-#endif
-    }
-    else
-    {
-      m_apcCurRenModels[iModelNum]->setVideo  ( m_aiCurPosInModels[iModelNum], m_iCurrentPlane ,iStartPosX, iStartPosY,  iWidth,  iHeight,  iStride, piNewData );
-    }
-  }
-
-#if H_3D_VSO_EARLY_SKIP
-  if (m_iCurrentContent == 1)
-  {
-    Int iTargetStride = m_aiCurDepthStrides[ m_iCurrentView ];
-    TRenFilter<REN_BIT_DEPTH>::copy( piNewData, iStride, iWidth, iHeight,  m_apiCurDepthPel[ m_iCurrentView ] + iStartPosY * iTargetStride + iStartPosX, iTargetStride );
-  }
-#endif
-}
-
-Void
-TRenModel::getSynthVideo( Int iModelNum, Int iViewNum, TComPicYuv* pcPicYuv )
-{
-  m_apcRenModels[iModelNum]->getSynthVideo(iViewNum, pcPicYuv );
-}
-
-Void
-TRenModel::getSynthDepth( Int iModelNum, Int iViewNum, TComPicYuv* pcPicYuv )
-{
-  m_apcRenModels[iModelNum]->getSynthDepth(iViewNum, pcPicYuv );
-}
-
-Void
-TRenModel::getTotalSSE( Int64& riSSEY, Int64& riSSEU, Int64& riSSEV )
-{
-  TComPicYuv cPicYuvSynth;
-  cPicYuvSynth.create( m_iWidth, m_iUsedHeight, CHROMA_420, 1, 1, 1, true);
-
-  TComPicYuv cPicYuvTempRef;
-  cPicYuvTempRef.create( m_iWidth, m_iUsedHeight, CHROMA_420, 1, 1, 1, true);
-
-  Int64 iSSEY = 0;
-  Int64 iSSEU = 0;
-  Int64 iSSEV = 0;
-
-  for (Int iCurModel = 0; iCurModel < m_iNumOfCurRenModels; iCurModel++)
-  {
-    m_apcCurRenModels[iCurModel]->getSynthVideo( m_aiCurPosInModels[iCurModel], &cPicYuvSynth );    
-    m_apcCurRenModels[iCurModel]->getRefVideo  ( m_aiCurPosInModels[iCurModel], &cPicYuvTempRef   );
-
-    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 );
-  }
-
-  riSSEY = ( iSSEY + (m_iNumOfCurRenModels >> 1) ) / m_iNumOfCurRenModels;
-  riSSEU = ( iSSEU + (m_iNumOfCurRenModels >> 1) ) / m_iNumOfCurRenModels;
-  riSSEV = ( iSSEV + (m_iNumOfCurRenModels >> 1) ) / m_iNumOfCurRenModels;
-
-  cPicYuvTempRef.destroy();
-  cPicYuvSynth  .destroy();
-}
-
-Void
-TRenModel::xSetLRViewAndAddModel( Int iModelNum, Int iBaseViewNum, Int iContent, Int iViewPos, Bool bAdd )
-{
-  AOF(iViewPos == VIEWPOS_LEFT  || iViewPos == VIEWPOS_RIGHT);
-  AOF(iContent == -1 || iContent == 0 || iContent == 1);
-  AOT( iBaseViewNum  < 0 || iBaseViewNum  > m_iNumOfBaseViews );
-  AOT( m_aaeBaseViewPosInModel[iBaseViewNum][iModelNum] != VIEWPOS_INVALID );
-  m_aaeBaseViewPosInModel[iBaseViewNum][iModelNum] = iViewPos;
-
-  if (bAdd)
-  {
-    if (iContent == 0 || iContent == -1 )
-    {
-      Int iNewModelIdxForView = m_aiNumOfModelsForVideoView[iBaseViewNum]++;
-      m_aapcRenModelForVideoView [ iBaseViewNum ][ iNewModelIdxForView ] = m_apcRenModels[iModelNum];
-      m_aaePosInModelForVideoView[ iBaseViewNum ][ iNewModelIdxForView ] = iViewPos;
-    }
-
-    if (iContent == 1 || iContent == -1 )
-    {
-      Int iNewModelIdxForView = m_aiNumOfModelsForDepthView[iBaseViewNum]++;
-      m_aapcRenModelForDepthView [ iBaseViewNum ][ iNewModelIdxForView ] = m_apcRenModels[iModelNum];
-      m_aaePosInModelForDepthView[ iBaseViewNum ][ iNewModelIdxForView ] = iViewPos;
-    }
-  }
-}
-#endif // NH_3D
Index: branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenModel.h
===================================================================
--- branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenModel.h	(revision 1389)
+++ branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenModel.h	(revision 1390)
@@ -42,120 +42,4 @@
 #include "../TLibCommon/TypeDef.h"
 
-#if NH_3D_VSO
-
-class TRenModel
-{
-public:
-
-  TRenModel();
-  ~TRenModel();
-
-  // Creation
-#if H_3D_VSO_EARLY_SKIP
-  Void  create           ( Int iNumOfBaseViews, Int iNumOfModels, Int iWidth, Int iHeight, Int iShiftPrec, Int iHoleMargin, Bool bEarlySkip );
-#else
-  Void  create           ( Int iNumOfBaseViews, Int iNumOfModels, Int iWidth, Int iHeight, Int iShiftPrec, Int iHoleMargin );
-#endif
-  Void  createSingleModel( Int iBaseViewNum, Int iContent, Int iModelNum, Int iLeftViewNum, Int iRightViewNum, Bool bUseOrgRef, Int iBlendMode );
-
-  // Set new Frame
-  Void  setBaseView      ( Int iViewNum, TComPicYuv* pcPicYuvVideoData, TComPicYuv* pcPicYuvDepthData, TComPicYuv* pcPicYuvOrgVideoData, TComPicYuv* pcPicYuvOrgDepthData  );
-  Void  setSingleModel   ( Int iModelNum, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, TComPicYuv* pcPicYuvRefView );
-
-  // Set horizontal offset
-  Void  setupPart        ( UInt uiHorOff, Int iUsedHeight );
-
-  // Set Mode
-  Void  setErrorMode     ( Int iView, Int iContent, Int iPlane );
-
-  // Get Distortion, set Data
-#if H_3D_VSO_EARLY_SKIP
-  Int64 getDist          ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel * piOrgData, Int iOrgStride);
-#else
-  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, const Pel* piNewData  );
-
-  // Get Rendered View
-
-  Void  getSynthVideo    ( Int iModelNum, Int iViewNum, TComPicYuv* pcPicYuvSynthVideo );
-  Void  getSynthDepth    ( Int iModelNum, Int iViewNum, TComPicYuv* pcPicYuvSynthDepth );
-
-  // Get Total Distortion
-  Void  getTotalSSE      (Int64& riSSEY, Int64& riSSEU, Int64& riSSEV );
-
-private:
-  // helpers
-  Void xSetLRViewAndAddModel( Int iModelNum, Int iBaseViewNum, Int iContent, Int iViewPos, Bool bAdd );
-
-  // Settings
-  Int    m_iShiftPrec;
-  Int**  m_aaaiSubPelShiftLut[2];
-  Int    m_iHoleMargin;
-#if H_3D_VSO_EARLY_SKIP
-  Bool   m_bEarlySkip; 
-#endif
-
-  /// Size of Video and Depth
-  Int m_iWidth;
-  Int m_iHeight;
-  Int m_iSampledWidth;
-  Int m_iPad;
-  Int m_iUsedHeight;   // height currently used in buffer, whereas m_iHeight is the total height of the buffer
-
-
-  Int m_iNumOfBaseViews;
-
-  // Horizontal Offset in input data
-  UInt m_uiHorOff;          
-
-  /// Current Error Type ///
-  Int m_iCurrentView;
-  Int m_iCurrentContent;
-  Int m_iCurrentPlane;
-
-  /// Array of Models used to determine the Current Error ///
-  Int                m_iNumOfCurRenModels;
-  TRenSingleModel**  m_apcCurRenModels;   // Array of pointers used for determination of current error
-  Int*               m_aiCurPosInModels;  // Position of Current View in Model
-
-  /// Array of Models ///
-  Int                m_iNumOfRenModels;
-  TRenSingleModel**  m_apcRenModels;   // Array of pointers to all created models
-
-  /// Mapping from View number and Content type to models ///
-  Int*               m_aiNumOfModelsForDepthView;
-  TRenSingleModel*** m_aapcRenModelForDepthView;   // Dim1: ViewNumber
-  Int**              m_aaePosInModelForDepthView; // Position in Model ( Left or Right)
-
-  Int*               m_aiNumOfModelsForVideoView;
-  TRenSingleModel*** m_aapcRenModelForVideoView;   // Dim1: ViewNumber
-  Int**              m_aaePosInModelForVideoView; // Position in Model ( Left or Right) (local model numbering)
-
-  /// Position of Base Views in Models ( global model numbering )
-  Int**              m_aaeBaseViewPosInModel;
-
-  /// Current Setup data ///
-  Bool*              m_abSetupVideoFromOrgForView;  //: Dim1: ViewNumber, 0 ... use org; 1 ... use coded; 2; use org ref and coded in RDO
-  Bool*              m_abSetupDepthFromOrgForView;
-
-  /// DATA //
-  // Cur
-
-  /// Number of Base Views
-  Pel*** m_aapiCurVideoPel   ; // Dim1: ViewNumber: Plane  0-> Y, 1->U, 2->V
-  Int**  m_aaiCurVideoStrides; // Dim1: ViewPosition 0->Left, 1->Right; Dim2: Plane  0-> Y, 1->U, 2->V
-
-  Pel**  m_apiCurDepthPel    ; // Dim1: ViewPosition
-  Int*   m_aiCurDepthStrides ; // Dim1: ViewPosition
-
-  Pel*** m_aapiOrgVideoPel   ; // Dim1: ViewPosition  Dim2: Plane  0-> Y, 1->U, 2->V
-  Int**  m_aaiOrgVideoStrides; // Dim1: ViewPosition  Dim2: Plane  0-> Y, 1->U, 2->V
-
-  Pel**  m_apiOrgDepthPel    ;    // Dim1: ViewPosition
-  Int*   m_aiOrgDepthStrides ;    // Dim1: ViewPosition
-};
-
-#endif // NH_3D
 #endif //__TRENMODEL__
 
Index: branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenSingleModel.cpp
===================================================================
--- branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenSingleModel.cpp	(revision 1389)
+++ branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenSingleModel.cpp	(revision 1390)
@@ -36,1932 +36,3 @@
 #include "TRenSingleModel.h"
 
-#if NH_3D_VSO
 
-////////////// TRENSINGLE MODEL ///////////////
-template <BlenMod iBM, Bool bBitInc>
-TRenSingleModelC<iBM,bBitInc>::TRenSingleModelC()
-:  m_iDistShift ( ( ENC_INTERNAL_BIT_DEPTH  - REN_BIT_DEPTH) << 1 )
-{
-  m_iWidth  = -1;
-  m_iHeight = -1;
-  m_iStride = -1;
-  m_iUsedHeight = -1; 
-  m_iHorOffset  = -1; 
-  m_iMode   = -1;
-  m_iPad    = PICYUV_PAD;
-  m_iGapTolerance = -1;
-  m_bUseOrgRef = false;
-
-  m_pcPicYuvRef          = NULL;
-
-  m_pcOutputSamples      = NULL; 
-  m_pcOutputSamplesRow   = NULL;   
-  m_iOutputSamplesStride = -1; 
-
-  m_ppiCurLUT            = NULL;
-  m_piInvZLUTLeft        = NULL;
-  m_piInvZLUTRight       = NULL;
-
-  m_aapiRefVideoPel[0]   = NULL;
-  m_aapiRefVideoPel[1]   = NULL;
-  m_aapiRefVideoPel[2]   = NULL;
-
-  m_aiRefVideoStrides[0] = -1;
-  m_aiRefVideoStrides[1] = -1;
-  m_aiRefVideoStrides[2] = -1;
-
-
-  for (UInt uiViewNum = 0 ; uiViewNum < 2; uiViewNum++)
-  {
-    // LUT
-    m_appiShiftLut[uiViewNum] = NULL;
-
-    m_pcInputSamples[uiViewNum] = NULL; 
-    m_iInputSamplesStride       = -1; 
-
-    m_ppiCurLUT               = NULL;
-    m_piInvZLUTLeft           = NULL;
-    m_piInvZLUTRight          = NULL;
-  }
-
-#if H_3D_VSO_EARLY_SKIP
-  m_pbHorSkip = NULL;
-#endif
-}
-
-template <BlenMod iBM, Bool bBitInc>
-TRenSingleModelC<iBM,bBitInc>::~TRenSingleModelC()
-{
-#if H_3D_VSO_EARLY_SKIP
-  if ( m_pbHorSkip ) 
-  {
-    delete[] m_pbHorSkip;
-    m_pbHorSkip = NULL;
-  }
-#endif
-
-  if ( m_pcInputSamples [0] ) delete[] m_pcInputSamples [0];
-  if ( m_pcInputSamples [1] ) delete[] m_pcInputSamples [1];
-
-  if ( m_pcOutputSamples    ) delete[] m_pcOutputSamples   ;
-
-  if ( m_piInvZLUTLeft  ) delete[] m_piInvZLUTLeft ;
-  if ( m_piInvZLUTRight ) delete[] m_piInvZLUTRight;
-
-  if ( m_aapiRefVideoPel[0] ) delete[] ( m_aapiRefVideoPel[0] - ( m_aiRefVideoStrides[0] * m_iPad + m_iPad ) );
-  if ( m_aapiRefVideoPel[1] ) delete[] ( m_aapiRefVideoPel[1] - ( m_aiRefVideoStrides[1] * m_iPad + m_iPad ) );
-  if ( m_aapiRefVideoPel[2] ) delete[] ( m_aapiRefVideoPel[2] - ( m_aiRefVideoStrides[2] * m_iPad + m_iPad ) );
-}
-
-template <BlenMod iBM, Bool bBitInc> Void
-#if H_3D_VSO_EARLY_SKIP
-TRenSingleModelC<iBM,bBitInc>::create( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bEarlySkip )
-#else
-TRenSingleModelC<iBM,bBitInc>::create( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode )
-#endif
-
-{
-#if H_3D_VSO_EARLY_SKIP
-  m_pbHorSkip     = new Bool [MAX_CU_SIZE];
-  m_bEarlySkip    = bEarlySkip; 
-#endif
-
-  AOF( iBlendMode == iBM ); 
-
-  m_iMode = iMode;
-
-  m_iWidth  = iWidth;
-  m_iHeight = iHeight;
-  m_iStride = iWidth;
-
-  m_iSampledWidth  = m_iWidth  << iShiftPrec;
-  m_iSampledStride = m_iStride << iShiftPrec;
-
-  m_iShiftPrec     = iShiftPrec;
-  m_aaiSubPelShiftL = aaaiSubPelShiftTable[0];
-  m_aaiSubPelShiftR = aaaiSubPelShiftTable[1];
-
-  if (m_iMode == 2)
-  {
-    m_piInvZLUTLeft  = new Int[257];
-    m_piInvZLUTRight = new Int[257];
-  }
-
-  m_iGapTolerance  = ( 2 << iShiftPrec );
-  m_iHoleMargin    =  iHoleMargin;
-
-  m_bUseOrgRef = bUseOrgRef;
-
-  m_aiRefVideoStrides[0] = m_iStride + (m_iPad << 1);
-  m_aiRefVideoStrides[1] = m_iStride + (m_iPad << 1);
-  m_aiRefVideoStrides[2] = m_iStride + (m_iPad << 1);
-
-  m_aapiRefVideoPel  [0] = new Pel[ m_aiRefVideoStrides[0] * (m_iHeight + (m_iPad << 1))];
-  m_aapiRefVideoPel  [1] = new Pel[ m_aiRefVideoStrides[1] * (m_iHeight + (m_iPad << 1))];
-  m_aapiRefVideoPel  [2] = new Pel[ m_aiRefVideoStrides[2] * (m_iHeight + (m_iPad << 1))];
-
-  m_aapiRefVideoPel  [0] += m_aiRefVideoStrides[0] * m_iPad + m_iPad;
-  m_aapiRefVideoPel  [1] += m_aiRefVideoStrides[1] * m_iPad + m_iPad;
-  m_aapiRefVideoPel  [2] += m_aiRefVideoStrides[2] * m_iPad + m_iPad;
-
-  m_iInputSamplesStride  = m_iWidth+1;
-  m_iOutputSamplesStride = m_iWidth;
-
-  m_pcInputSamples[0]     = new RenModelInPels[m_iInputSamplesStride*m_iHeight];
-  m_pcInputSamples[1]     = new RenModelInPels[m_iInputSamplesStride*m_iHeight];
-
-  m_pcOutputSamples       = new RenModelOutPels[m_iOutputSamplesStride*m_iHeight];  
-}
-
-template <BlenMod iBM, Bool bBitInc> Void
-TRenSingleModelC<iBM,bBitInc>::setLRView( Int iViewPos, Pel** apiCurVideoPel, Int* aiCurVideoStride, Pel* piCurDepthPel, Int iCurDepthStride )
-{
-  AOF(( iViewPos == 0) || (iViewPos == 1) );
-
-  RenModelInPels* pcCurInputSampleRow = m_pcInputSamples[iViewPos];
-  
-  Pel* piDRow = piCurDepthPel;
-  Pel* piYRow = apiCurVideoPel[0];
-#if H_3D_VSO_COLOR_PLANES
-  Pel* piURow = apiCurVideoPel[1];
-  Pel* piVRow = apiCurVideoPel[2];
-#endif  
-
-
-  Int iOffsetX = ( iViewPos == VIEWPOS_RIGHT ) ? 1 : 0;
-
-  for ( Int iPosY = 0; iPosY < m_iUsedHeight; iPosY++ )
-  {
-    if ( iViewPos == VIEWPOS_RIGHT )
-    {
-      Int iSubPosX = (1 << m_iShiftPrec); 
-      pcCurInputSampleRow[0].aiY[iSubPosX] = piYRow[0];
-#if H_3D_VSO_COLOR_PLANES 
-      pcCurInputSampleRow[0].aiU[iSubPosX] = piURow[0];
-      pcCurInputSampleRow[0].aiV[iSubPosX] = piVRow[0];
-#endif
-    }
-
-    for ( Int iPosX = 0; iPosX < m_iWidth; iPosX++ )
-    {
-      pcCurInputSampleRow[iPosX].iD = piDRow[iPosX];
-
-      for (Int iSubPosX = 0; iSubPosX < (1 << m_iShiftPrec)+1; iSubPosX++ )
-      { 
-        Int iShift = (iPosX << m_iShiftPrec) + iSubPosX;
-        pcCurInputSampleRow[iPosX+iOffsetX].aiY[iSubPosX] = piYRow[iShift];
-#if H_3D_VSO_COLOR_PLANES 
-        pcCurInputSampleRow[iPosX+iOffsetX].aiU[iSubPosX] = piURow[iShift];
-        pcCurInputSampleRow[iPosX+iOffsetX].aiV[iSubPosX] = piVRow[iShift];
-#endif
-      }
-    } 
-
-    pcCurInputSampleRow += m_iInputSamplesStride; 
-
-    piDRow += iCurDepthStride;
-    piYRow += aiCurVideoStride[0];
-#if H_3D_VSO_COLOR_PLANES
-    piURow += aiCurVideoStride[1];
-    piVRow += aiCurVideoStride[2];
-#endif
-  }
-
-  
-  m_aapiBaseVideoPel      [iViewPos] = apiCurVideoPel;
-  m_aaiBaseVideoStrides   [iViewPos] = aiCurVideoStride;
-  m_apiBaseDepthPel       [iViewPos] = piCurDepthPel;
-  m_aiBaseDepthStrides    [iViewPos] = iCurDepthStride;
-
-}
-template <BlenMod iBM, Bool bBitInc> Void
-TRenSingleModelC<iBM,bBitInc>::setupPart ( UInt uiHorOffset,       Int iUsedHeight )
-{
-  AOT( iUsedHeight > m_iHeight );   
-
-  m_iUsedHeight =       iUsedHeight; 
-  m_iHorOffset  = (Int) uiHorOffset;
-}
-
-template <BlenMod iBM, Bool bBitInc> Void
-TRenSingleModelC<iBM,bBitInc>::setup( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight,  Int** ppiBaseShiftLutRight,  Int iDistToLeft, Bool bKeepReference )
-{
-  AOT( !m_bUseOrgRef && pcOrgVideo );
-  AOT( (ppiShiftLutLeft  == NULL) && (m_iMode == 0 || m_iMode == 2) );
-  AOT( (ppiShiftLutRight == NULL) && (m_iMode == 1 || m_iMode == 2) );
-
-  m_appiShiftLut[0] = ppiShiftLutLeft;
-  m_appiShiftLut[1] = ppiShiftLutRight;
-
-  // Copy Reference
-  m_pcPicYuvRef = pcOrgVideo;
-
-  if ( pcOrgVideo && !bKeepReference )
-  {
-    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();
-  }
-
-  // Initial Rendering
-  xResetStructError();
-  xInitSampleStructs();
-  switch ( m_iMode )
-  {  
-  case 0:   
-#if H_3D_VSO_EARLY_SKIP
-    xRenderL<true>( 0, 0, m_iWidth, m_iUsedHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0],false );
-#else
-    xRenderL<true>( 0, 0, m_iWidth, m_iUsedHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0] );
-#endif   
-    break;
-  case 1:    
-#if H_3D_VSO_EARLY_SKIP
-    xRenderR<true>( 0, 0, m_iWidth, m_iUsedHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1],false);
-#else
-    xRenderR<true>( 0, 0, m_iWidth, m_iUsedHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1] );
-#endif
-    break;
-  case 2:
-    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);
-    xRenderR<true>( 0, 0, m_iWidth, m_iUsedHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1],false);
-#else      
-    xRenderL<true>( 0, 0, m_iWidth, m_iUsedHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0] );
-    xRenderR<true>( 0, 0, m_iWidth, m_iUsedHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1] );
-#endif
-    break;
-  default:
-    AOT(true);
-  }
-
-  // Get Rendered View as Reference
-  if ( !pcOrgVideo && !bKeepReference )
-  {
-    xResetStructError();
-    xSetStructSynthViewAsRefView();
-  }
-}
-
-template <BlenMod iBM, Bool bBitInc> Void
-#if H_3D_VSO_COLOR_PLANES
-TRenSingleModelC<iBM,bBitInc>::xGetSampleStrTextPtrs( Int iViewNum, Pel RenModelOutPels::*& rpiSrcY, Pel RenModelOutPels::*& rpiSrcU, Pel RenModelOutPels::*& rpiSrcV )
-#else
-TRenSingleModelC<iBM,bBitInc>::xGetSampleStrTextPtrs( Int iViewNum, Pel RenModelOutPels::*& rpiSrcY )
-#endif
-{
-  switch ( iViewNum )
-  {
-  case 0:
-    rpiSrcY = &RenModelOutPels::iYLeft;
-#if H_3D_VSO_COLOR_PLANES  
-    rpiSrcU = &RenModelOutPels::iULeft;
-    rpiSrcV = &RenModelOutPels::iVLeft;
-#endif
-    break;
-  case 1:
-    rpiSrcY = &RenModelOutPels::iYRight;
-#if H_3D_VSO_COLOR_PLANES  
-    rpiSrcU = &RenModelOutPels::iURight;
-    rpiSrcV = &RenModelOutPels::iVRight;
-#endif
-    break;
-  case 2:
-    rpiSrcY = &RenModelOutPels::iYBlended;
-#if H_3D_VSO_COLOR_PLANES  
-    rpiSrcU = &RenModelOutPels::iUBlended;
-    rpiSrcV = &RenModelOutPels::iVBlended;
-#endif
-    break;
-  }
-}
-
-
-template <BlenMod iBM, Bool bBitInc> Void
-TRenSingleModelC<iBM,bBitInc>::xGetSampleStrDepthPtrs( Int iViewNum, Pel RenModelOutPels::*& rpiSrcD )
-{
-  AOT(iViewNum != 0 && iViewNum != 1);  
-  rpiSrcD = (iViewNum == 1) ? &RenModelOutPels::iDRight : &RenModelOutPels::iDLeft; 
-}
-
-
-template <BlenMod iBM, Bool bBitInc> Void
-TRenSingleModelC<iBM,bBitInc>::xSetStructRefView( )
-{
-  RenModelOutPels* pcCurOutSampleRow = m_pcOutputSamples;
-  
-  Pel* piYRow = m_aapiRefVideoPel[0];
-#if H_3D_VSO_COLOR_PLANES
-  Pel* piURow = m_aapiRefVideoPel[1];
-  Pel* piVRow = m_aapiRefVideoPel[2];
-#endif  
-
-  for ( Int iPosY = 0; iPosY < m_iUsedHeight; iPosY++ )
-  {
-    for ( Int iPosX = 0; iPosX < m_iWidth; iPosX++ )
-    {      
-      pcCurOutSampleRow[iPosX].iYRef = piYRow[iPosX];
-#if H_3D_VSO_COLOR_PLANES
-      pcCurOutSampleRow[iPosX].iURef = piURow[iPosX];
-      pcCurOutSampleRow[iPosX].iVRef = piVRow[iPosX];
-#endif
-    } 
-
-    pcCurOutSampleRow += m_iOutputSamplesStride; 
-    
-    piYRow += m_aiRefVideoStrides[0];
-#if H_3D_VSO_COLOR_PLANES
-    piURow += m_aiRefVideoStrides[1];
-    piVRow += m_aiRefVideoStrides[2];
-#endif
-  }
-}
-
-template <BlenMod iBM, Bool bBitInc> Void
-TRenSingleModelC<iBM,bBitInc>::xResetStructError( )
-{
-  RenModelOutPels* pcCurOutSampleRow = m_pcOutputSamples;
-
-  for ( Int iPosY = 0; iPosY < m_iHeight; iPosY++ )
-  {
-    for ( Int iPosX = 0; iPosX < m_iWidth; iPosX++ )
-    {      
-      pcCurOutSampleRow[iPosX].iError = 0;
-    } 
-    pcCurOutSampleRow += m_iOutputSamplesStride; 
-  }
-}
-
-template <BlenMod iBM, Bool bBitInc> Void
-TRenSingleModelC<iBM,bBitInc>::xSetStructSynthViewAsRefView( )
-{
-  AOT( m_iMode < 0 || m_iMode > 2);
-
-  RenModelOutPels* pcCurOutSampleRow = m_pcOutputSamples;
-
-  Pel RenModelOutPels::* piSrcY = NULL;
-
-#if H_3D_VSO_COLOR_PLANES  
-  Pel RenModelOutPels::* piSrcU = NULL;
-  Pel RenModelOutPels::* piSrcV = NULL;
-  xGetSampleStrTextPtrs( m_iMode, piSrcY, piSrcU, piSrcV );
-#else
-  xGetSampleStrTextPtrs( m_iMode, piSrcY );
-#endif
-
-  for ( Int iPosY = 0; iPosY < m_iUsedHeight; iPosY++ )
-  {
-    for ( Int iPosX = 0; iPosX < m_iWidth; iPosX++ )
-    {      
-      pcCurOutSampleRow[iPosX].iYRef = pcCurOutSampleRow[iPosX].*piSrcY;
-#if H_3D_VSO_COLOR_PLANES
-      pcCurOutSampleRow[iPosX].iURef = pcCurOutSampleRow[iPosX].*piSrcU;
-      pcCurOutSampleRow[iPosX].iVRef = pcCurOutSampleRow[iPosX].*piSrcV;
-#endif
-    } 
-    pcCurOutSampleRow += m_iOutputSamplesStride; 
-  }
-}
-
-template <BlenMod iBM, Bool bBitInc> Void
-TRenSingleModelC<iBM,bBitInc>::xInitSampleStructs()
-{
-  RenModelOutPels* pcOutSampleRow      = m_pcOutputSamples;
-  RenModelInPels * pcLeftInSampleRow   = m_pcInputSamples[0];
-  RenModelInPels * pcRightInSampleRow  = m_pcInputSamples[1];
-
-
-  for (Int iPosY = 0; iPosY < m_iHeight; iPosY++)
-  {
-    for (Int iPosX = 0; iPosX < m_iWidth; iPosX++)
-    {
-      //// Output Samples
-      pcOutSampleRow[iPosX].iFilledLeft   = REN_IS_HOLE;
-      pcOutSampleRow[iPosX].iFilledRight  = REN_IS_HOLE;
-
-      pcOutSampleRow[iPosX].iDLeft        = 0;
-      pcOutSampleRow[iPosX].iDRight       = 0;
-      pcOutSampleRow[iPosX].iDBlended     = 0;      
-                                     
-      // Y Planes                    
-      pcOutSampleRow[iPosX].iYLeft        = 0;
-      pcOutSampleRow[iPosX].iYRight       = 0;
-      pcOutSampleRow[iPosX].iYBlended     = 0;
-#if H_3D_VSO_COLOR_PLANES             
-      // U Planes                    
-      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
-      pcLeftInSampleRow [iPosX].bOccluded = false;
-      pcRightInSampleRow[iPosX].bOccluded = false;
-    }
-
-    pcOutSampleRow     += m_iOutputSamplesStride;
-    pcLeftInSampleRow  += m_iInputSamplesStride;
-    pcRightInSampleRow += m_iInputSamplesStride;
-  }  
-}
-
-
-#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, 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, const Pel* piNewData )
-#endif
-{
-  RMDist iSSE = 0;
-#if H_3D_VSO_EARLY_SKIP
-  Bool   bEarlySkip;
-#endif
-  switch ( iViewPos )
-  {
-  case 0:
-#if H_3D_VSO_EARLY_SKIP
-    bEarlySkip = m_bEarlySkip ? xDetectEarlySkipL(iStartPosX,   iStartPosY,   iWidth,   iHeight,   iStride, piNewData, piOrgData, iOrgStride) : false;
-    if( !bEarlySkip )
-    {
-      iSSE = xRenderL<false>( iStartPosX,   iStartPosY,   iWidth,   iHeight,   iStride, piNewData,true );
-    }    
-#else
-    iSSE = xRenderL<false>( iStartPosX,   iStartPosY,   iWidth,   iHeight,   iStride, piNewData );
-#endif
-    break;
-  case 1:
-#if H_3D_VSO_EARLY_SKIP
-    bEarlySkip = m_bEarlySkip ? xDetectEarlySkipR(iStartPosX,   iStartPosY,   iWidth,   iHeight,   iStride, piNewData, piOrgData, iOrgStride) : false;
-    if( !bEarlySkip )
-    {
-      iSSE = xRenderR<false>( iStartPosX,   iStartPosY,   iWidth,   iHeight,   iStride, piNewData,true );
-    }    
-#else
-    iSSE = xRenderR<false>( iStartPosX,   iStartPosY,   iWidth,   iHeight,   iStride, piNewData );
-#endif
-    break;
-  default:
-    assert(0);
-  }
-
-  return iSSE;
-}
-#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, 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, const Pel* piNewData )
-#endif
-{
-#ifdef  H_3D_VSO_EARLY_SKIP
-  Bool bEarlySkip;
-#endif
-  switch ( iViewPos )
-  {
-  case 0:
-#if H_3D_VSO_EARLY_SKIP
-    bEarlySkip = m_bEarlySkip ? xDetectEarlySkipL(iStartPosX,   iStartPosY,   iWidth,   iHeight,   iStride, piNewData, piOrgData,iOrgStride) : false;
-    if( !bEarlySkip )
-    {
-      xRenderL<true>( iStartPosX,   iStartPosY,   iWidth,   iHeight,   iStride, piNewData,true );
-    }    
-#else
-    xRenderL<true>( iStartPosX,   iStartPosY,   iWidth,   iHeight,   iStride, piNewData );
-#endif     
-    break;
-  case 1:
-#if H_3D_VSO_EARLY_SKIP
-    bEarlySkip = m_bEarlySkip ? xDetectEarlySkipR(iStartPosX,   iStartPosY,   iWidth,   iHeight,   iStride, piNewData, piOrgData,iOrgStride) : false;
-    if( !bEarlySkip )
-    {
-      xRenderR<true>( iStartPosX,   iStartPosY,   iWidth,   iHeight,   iStride, piNewData,true ); 
-    }    
-#else
-    xRenderR<true>( iStartPosX,   iStartPosY,   iWidth,   iHeight,   iStride, piNewData );
-#endif     
-    break;
-  default:
-    assert(0);
-  }
-}
-
-template <BlenMod iBM, Bool bBitInc> Void
-TRenSingleModelC<iBM,bBitInc>::getSynthVideo( Int iViewPos, TComPicYuv* pcPicYuv )
-{  
-  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
-  Pel RenModelOutPels::* piText[3] = { NULL, NULL, NULL };
-  xGetSampleStrTextPtrs(iViewPos, piText[0], piText[1], piText[2]); 
-
-  // Temp image for chroma down sampling
-  PelImage cTempImage( m_iWidth, m_iUsedHeight, 3, 0);
-
-  Int  aiStrides[3]; 
-  Pel* apiData  [3]; 
-
-  cTempImage.getDataAndStrides( apiData, aiStrides ); 
-
-  for (UInt uiCurPlane = 0; uiCurPlane < 3; uiCurPlane++ )
-  {
-    xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, piText[uiCurPlane], apiData[uiCurPlane], aiStrides[uiCurPlane] , m_iWidth, m_iUsedHeight);
-  }  
-  xCopy2PicYuv( apiData, aiStrides, pcPicYuv );
-#else
-  Pel RenModelOutPels::* piY;
-  xGetSampleStrTextPtrs(iViewPos, piY); 
-  xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, piY, pcPicYuv->getLumaAddr() + m_iHorOffset * pcPicYuv->getStride(), pcPicYuv->getStride(), m_iWidth, m_iUsedHeight );
-  pcPicYuv->setChromaTo( 1 << (g_bitDepthC - 1) );   
-#endif  
-}
-
-template <BlenMod iBM, Bool bBitInc> Void
-TRenSingleModelC<iBM,bBitInc>::getSynthDepth( Int iViewPos, TComPicYuv* pcPicYuv )
-{  
-  AOT( iViewPos != 0 && iViewPos != 1); 
-  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->getAddr( COMPONENT_Y ) + pcPicYuv->getStride( COMPONENT_Y ) * m_iHorOffset, pcPicYuv->getStride( COMPONENT_Y ), m_iWidth, m_iUsedHeight );
-  pcPicYuv->setChromaTo( 1 << (REN_BIT_DEPTH - 1) );   
-}
-
-
-template <BlenMod iBM, Bool bBitInc> Void
-TRenSingleModelC<iBM,bBitInc>::getRefVideo ( Int iViewPos, TComPicYuv* pcPicYuv )
-{  
-  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
-  Pel RenModelOutPels::* piText[3];
-  piText[0] = &RenModelOutPels::iYRef;
-  piText[1] = &RenModelOutPels::iURef;
-  piText[2] = &RenModelOutPels::iVRef;
-
-  // Temp image for chroma down sampling
-
-  PelImage cTempImage( m_iWidth, m_iUsedHeight, 3, 0);
-  Int  aiStrides[3]; 
-  Pel* apiData  [3]; 
-
-  cTempImage.getDataAndStrides( apiData, aiStrides ); 
-
-  for (UInt uiCurPlane = 0; uiCurPlane < 3; uiCurPlane++ )
-  {
-    xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, piText[uiCurPlane], apiData[uiCurPlane], aiStrides[uiCurPlane] , m_iWidth, m_iUsedHeight);
-  }  
-
-  xCopy2PicYuv( apiData, aiStrides, pcPicYuv );
-#else
-  xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, &RenModelOutPels::iYRef, pcPicYuv->getLumaAddr() *  pcPicYuv->getStride() + m_iHorOffset, pcPicYuv->getStride(), m_iWidth, m_iUsedHeight );
-  pcPicYuv->setChromaTo( 1 << ( g_bitDepthC - 1 ) );   
-#endif  
-}
-
-template <BlenMod iBM, Bool bBitInc> RMDist
-TRenSingleModelC<iBM,bBitInc>::getDistVideo( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData )
-{
-  AOF(false);
-  return 0;
-}
-
-template <BlenMod iBM, Bool bBitInc> Void
-TRenSingleModelC<iBM,bBitInc>::setVideo( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData )
-{
-  AOF(false);
-}
-
-
-
-template <BlenMod iBM, Bool bBitInc> __inline Void
-TRenSingleModelC<iBM,bBitInc>::xSetViewRow( Int iPosY )
-{
-  m_pcInputSamplesRow[0] = m_pcInputSamples[0] + m_iInputSamplesStride  * iPosY;
-  m_pcInputSamplesRow[1] = m_pcInputSamples[1] + m_iInputSamplesStride  * iPosY;
-  m_pcOutputSamplesRow   = m_pcOutputSamples   + m_iOutputSamplesStride * iPosY;  
-
-}
-
-template <BlenMod iBM, Bool bBitInc> __inline Void
-TRenSingleModelC<iBM,bBitInc>::xIncViewRow( )
-{
-  m_pcInputSamplesRow[0] += m_iInputSamplesStride ;
-  m_pcInputSamplesRow[1] += m_iInputSamplesStride ;
-  m_pcOutputSamplesRow   += m_iOutputSamplesStride;  
-}
-#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, 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, const Pel* piNewData)
-#endif
-{
-  const Int iCurViewPos   = 0;
-  const Int iOtherViewPos = 1;
-
-  m_iCurViewPos   = iCurViewPos  ; 
-  m_iOtherViewPos = iOtherViewPos;
-
-  m_piNewDepthData   = piNewData;
-  m_iNewDataWidth    = iWidth;
-  m_iStartChangePosX = iStartPosX;
-
-  if ((iWidth == 0) || (iHeight == 0))
-    return 0;
-
-  // Get Data
-  m_ppiCurLUT      = m_appiShiftLut   [iCurViewPos];
-  xSetViewRow      ( iStartPosY);
-
-  // Init Start
-  RMDist iError = 0;
-  Int   iStartChangePos;
-
-  iStartChangePos = m_iStartChangePosX;
-
-  for (Int iPosY = iStartPosY; iPosY < iStartPosY + iHeight; iPosY++ )
-  {
-#if H_3D_VSO_EARLY_SKIP
-    if( m_bEarlySkip && bFast )
-    {
-      if ( m_pbHorSkip[iPosY-iStartPosY] )
-      {
-        xIncViewRow();
-        m_piNewDepthData += iStride;
-        continue;
-      }
-    }
-#endif
-    m_bInOcclusion = false;
-
-    Int iLastSPos;
-    Int iEndChangePos         = m_iStartChangePosX + iWidth - 1;
-    Int iPosXinNewData        = iWidth - 1;
-    Int iMinChangedSPos       = m_iSampledWidth;
-
-    if ( iEndChangePos == ( m_iWidth -1 )) // Special processing for rightmost depth sample
-    {
-      m_iCurDepth           = m_piNewDepthData[iPosXinNewData];
-      Int iCurSPos          = xShiftNewData(iEndChangePos, iPosXinNewData);
-      m_iLastOccludedSPos   = iCurSPos + 1;
-      m_iLastOccludedSPosFP = xRangeLeftL( m_iLastOccludedSPos );
-      xExtrapolateMarginL<bSet>  ( iCurSPos, iEndChangePos, iError );
-
-      iMinChangedSPos       = std::min( iMinChangedSPos, (iEndChangePos << m_iShiftPrec) - m_ppiCurLUT[0][ RenModRemoveBitInc( std::max(m_pcInputSamplesRow[iCurViewPos][iEndChangePos].iD, m_piNewDepthData[iPosXinNewData] )) ]);
-      iLastSPos             = iCurSPos;
-      m_iLastDepth          = m_iCurDepth;
-
-      if ( bSet )
-      {
-        m_pcInputSamplesRow[iCurViewPos][iEndChangePos].iD = m_piNewDepthData[iPosXinNewData];
-      }
-
-      iPosXinNewData--;
-      iEndChangePos--;
-    }
-    else
-    {
-      iLastSPos    = xShift(iEndChangePos+1);
-      m_iLastDepth = m_pcInputSamplesRow [iCurViewPos][iEndChangePos+1].iD;
-      xInitRenderPartL( iEndChangePos, iLastSPos );
-    }
-
-    //// RENDER NEW DATA
-    Int iCurPosX;
-    for ( iCurPosX = iEndChangePos; iCurPosX >= iStartChangePos; iCurPosX-- )
-    {
-      // Get minimal changed sample position
-
-      iMinChangedSPos = std::min( iMinChangedSPos, (iCurPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RenModRemoveBitInc( std::max(m_pcInputSamplesRow[iCurViewPos][iCurPosX].iD, m_piNewDepthData[iPosXinNewData] )) ]);
-      Int iCurSPos    = xShiftNewData(iCurPosX,iPosXinNewData);
-      m_iCurDepth     = m_piNewDepthData[iPosXinNewData];
-      xRenderRangeL<bSet>(iCurSPos, iLastSPos, iCurPosX, iError );
-      iLastSPos       = iCurSPos;
-      m_iLastDepth    = m_iCurDepth;
-
-      if ( bSet )
-      {
-        m_pcInputSamplesRow[iCurViewPos][iCurPosX].iD = m_piNewDepthData[iPosXinNewData];
-      }
-
-      iPosXinNewData--;
-    }
-
-    //// RE-RENDER DATA LEFT TO NEW DATA
-    while ( iCurPosX >= 0 )
-    {
-      Int iCurSPos = xShift(iCurPosX);
-
-      m_iCurDepth  = m_pcInputSamplesRow[iCurViewPos][iCurPosX].iD;
-      xRenderRangeL<bSet>( iCurSPos, iLastSPos, iCurPosX, iError );
-
-      if ( iCurSPos < iMinChangedSPos )
-      {
-          break;
-      }
-
-      iCurPosX--;
-      iLastSPos    = iCurSPos;
-      m_iLastDepth = m_iCurDepth;
-    }
-
-
-    xIncViewRow();
-    m_piNewDepthData += iStride;
-  }
-  return iError;
-}
-
-#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, 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, const Pel* piNewData )
-#endif
-{
-
-  const Int iCurViewPos   = 1;
-  const Int iOtherViewPos = 0;
-
-  m_iCurViewPos      = iCurViewPos;
-  m_iOtherViewPos    = iOtherViewPos;
-
-  m_piNewDepthData   = piNewData;
-  m_iNewDataWidth    = iWidth;
-  m_iStartChangePosX = iStartPosX;
-
-  if ((iWidth == 0) || (iHeight == 0))
-    return 0;
-
-  // Get Data
-  m_ppiCurLUT      = m_appiShiftLut   [iCurViewPos];
-  xSetViewRow      ( iStartPosY);
-
-  // Init Start
-  RMDist iError = 0;
-  Int   iEndChangePos;
-
-  iEndChangePos = m_iStartChangePosX + iWidth - 1;
-
-  for (Int iPosY = iStartPosY; iPosY < iStartPosY + iHeight; iPosY++ )
-  {
-#if H_3D_VSO_EARLY_SKIP
-    if( m_bEarlySkip && bFast )
-    {
-      if ( m_pbHorSkip[iPosY-iStartPosY] )
-      {
-        xIncViewRow();
-        m_piNewDepthData += iStride;
-        continue;
-      }
-    }
-#endif
-    m_bInOcclusion = false;
-
-    Int iLastSPos;
-    Int iStartChangePos       = m_iStartChangePosX;
-    Int iPosXinNewData        = 0;
-    Int iMaxChangedSPos = -1;
-
-    if ( iStartChangePos == 0 ) // Special processing for leftmost depth sample
-    {
-      m_iCurDepth           = m_piNewDepthData[iPosXinNewData];
-      Int iCurSPos          = xShiftNewData(iStartChangePos, iPosXinNewData);
-      m_iLastOccludedSPos   = iCurSPos - 1;
-      m_iLastOccludedSPosFP = xRangeRightR( m_iLastOccludedSPos );
-      xExtrapolateMarginR<bSet>     ( iCurSPos, iStartChangePos, iError );
-
-      iMaxChangedSPos       = std::max( iMaxChangedSPos, (iStartChangePos << m_iShiftPrec) - m_ppiCurLUT[0][ RenModRemoveBitInc( std::max(m_pcInputSamplesRow[iCurViewPos][iStartChangePos].iD, m_piNewDepthData[iPosXinNewData] )) ]);
-      iLastSPos             = iCurSPos;
-      m_iLastDepth          = m_iCurDepth;
-      if ( bSet )
-      {
-        m_pcInputSamplesRow[iCurViewPos][iStartChangePos].iD = m_piNewDepthData[iPosXinNewData];
-      }
-
-
-      iPosXinNewData++;
-      iStartChangePos++;
-    }
-    else
-    {
-      iLastSPos   = xShift(iStartChangePos-1);
-
-      m_iLastDepth = m_pcInputSamplesRow[iCurViewPos][iStartChangePos-1].iD;
-      xInitRenderPartR( iStartChangePos, iLastSPos );
-    }
-
-    //// RENDER NEW DATA
-    Int iCurPosX;
-    for ( iCurPosX = iStartChangePos; iCurPosX <= iEndChangePos; iCurPosX++ )
-    {
-      // Get minimal changed sample position
-
-      iMaxChangedSPos = std::max( iMaxChangedSPos, (iCurPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RenModRemoveBitInc( std::max(m_pcInputSamplesRow[iCurViewPos][iCurPosX].iD, m_piNewDepthData[iPosXinNewData] )) ]);
-      Int iCurSPos    = xShiftNewData(iCurPosX,iPosXinNewData);
-      m_iCurDepth     = m_piNewDepthData[iPosXinNewData];
-      xRenderRangeR<bSet>(iCurSPos, iLastSPos, iCurPosX, iError );
-      iLastSPos      = iCurSPos;
-      m_iLastDepth    = m_iCurDepth;
-
-      if ( bSet )
-      {
-        m_pcInputSamplesRow[iCurViewPos][iCurPosX].iD = m_piNewDepthData[iPosXinNewData];
-      }
-
-      iPosXinNewData++;
-    }
-
-    //// RE-RENDER DATA LEFT TO NEW DATA
-    while ( iCurPosX < m_iWidth )
-    {
-      Int iCurSPos = xShift(iCurPosX);
-
-      m_iCurDepth  = m_pcInputSamplesRow[iCurViewPos][iCurPosX].iD;
-      xRenderRangeR<bSet>( iCurSPos, iLastSPos, iCurPosX, iError );
-
-      if ( iCurSPos > iMaxChangedSPos )
-      {
-          break;
-        }
-      iCurPosX++;
-      iLastSPos    = iCurSPos;
-      m_iLastDepth = m_iCurDepth;
-    }
-
-    xIncViewRow();
-    m_piNewDepthData += iStride;
-  }
-  return iError;
-}
-
-
-template <BlenMod iBM, Bool bBitInc> __inline Void
-TRenSingleModelC<iBM,bBitInc>::xInitRenderPartL(  Int iEndChangePos, Int iLastSPos )
-{
-  const Int iCurViewPos = 0; 
-  // GET MINIMAL OCCLUDED SAMPLE POSITION
-  Int iCurPosX           = iEndChangePos;
-
-
-  if ( ( iCurPosX + 1 < m_iWidth ) && (m_pcInputSamplesRow[iCurViewPos][ iCurPosX + 1].bOccluded ) )
-  {
-    iCurPosX++;
-
-    while ( (iCurPosX + 1 < m_iWidth) &&  (m_pcInputSamplesRow[iCurViewPos][ iCurPosX + 1].bOccluded  )  )
-
-      iCurPosX++;
-
-    if ( iCurPosX + 1 < m_iWidth )
-    {
-      iCurPosX++;
-      m_iLastOccludedSPos = xShift(iCurPosX);
-    }
-    else
-    {
-      m_iLastOccludedSPos = xShift(iCurPosX) + 1;
-    }
-
-    m_iLastOccludedSPosFP = xRoundL( m_iLastOccludedSPos );
-  }
-  else
-  {
-    m_iLastOccludedSPos   = iLastSPos+1;
-    m_iLastOccludedSPosFP = xRangeLeftL( m_iLastOccludedSPos );
-  }
-
-  m_bInOcclusion = iLastSPos >= m_iLastOccludedSPos;
-};
-
-template <BlenMod iBM, Bool bBitInc> __inline Void
-TRenSingleModelC<iBM,bBitInc>::xInitRenderPartR(  Int iStartChangePos, Int iLastSPos )
-{
-    const Int iCurViewPos = 1; 
-  // GET MINIMAL OCCLUDED SAMPLE POSITION
-  Int iCurPosX           = iStartChangePos;
-
-  if ( ( iCurPosX - 1 > -1 ) && (m_pcInputSamplesRow[iCurViewPos][ iCurPosX - 1].bOccluded  ) )
-  {
-    iCurPosX--;
-
-    while ( (iCurPosX - 1 > -1 ) &&  (m_pcInputSamplesRow[iCurViewPos][ iCurPosX - 1].bOccluded  )  )
-      iCurPosX--;
-
-    if ( iCurPosX - 1 > -1 )
-    {
-      iCurPosX--;
-      m_iLastOccludedSPos = xShift(iCurPosX);
-    }
-    else
-    {
-      m_iLastOccludedSPos = xShift(iCurPosX) - 1;
-    }
-    m_iLastOccludedSPosFP = xRoundR( m_iLastOccludedSPos );
-  }
-  else
-  {
-    m_iLastOccludedSPos   = iLastSPos-1;
-    m_iLastOccludedSPosFP = xRangeRightR( m_iLastOccludedSPos );
-  }
-
-  m_bInOcclusion = iLastSPos <= m_iLastOccludedSPos;
-};
-
-
-template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void
-TRenSingleModelC<iBM,bBitInc>::xRenderShiftedRangeL(Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError )
-{
-  assert( iCurSPos <= iLastSPos );
-  //assert( iRightSPos < m_iWidth );
-
-  Int iDeltaSPos = iLastSPos - iCurSPos;
-  if ( iDeltaSPos > m_iGapTolerance )
-  {
-    xFillHoleL<bSet>( iCurSPos, iLastSPos, iCurPos, riError );
-  }
-  else
-  {
-    if (iLastSPos < 0 )
-      return;
-
-    RM_AOT( iDeltaSPos    > m_iGapTolerance );
-
-    m_iThisDepth = m_iCurDepth;
-    for (Int iFillSPos = std::max(0, xRangeLeftL(iCurSPos) ); iFillSPos <= min(xRangeRightL( iLastSPos ) ,m_iLastOccludedSPosFP-1); iFillSPos++ )
-    {
-      Int iDeltaCurSPos  = (iFillSPos << m_iShiftPrec) - iCurSPos;
-
-      RM_AOT( iDeltaCurSPos > iDeltaSPos );
-      RM_AOT( iDeltaCurSPos < 0 );
-      RM_AOT( m_aaiSubPelShiftL[iDeltaSPos][iDeltaCurSPos] == 0xdeaddead);
-
-      xSetShiftedPelL<bSet>( iCurPos, m_aaiSubPelShiftL[iDeltaSPos][iDeltaCurSPos], iFillSPos, REN_IS_FILLED, riError );
-    }
-  };
-}
-
-template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void
-TRenSingleModelC<iBM,bBitInc>::xRenderShiftedRangeR(Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError )
-{
-  assert( iCurSPos >= iLastSPos );
-
-  Int iDeltaSPos = iCurSPos - iLastSPos;
-  if ( iDeltaSPos > m_iGapTolerance )
-  {
-    xFillHoleR<bSet>( iCurSPos, iLastSPos, iCurPos, riError );
-  }
-  else
-  {
-    if (iLastSPos > m_iSampledWidth - 1 )
-      return;
-
-    m_iThisDepth = m_iCurDepth;
-    RM_AOT( iDeltaSPos    > m_iGapTolerance );
-    for (Int iFillSPos = max(m_iLastOccludedSPosFP+1, xRangeLeftR(iLastSPos) ); iFillSPos <= min(xRangeRightR( iCurSPos ) ,m_iWidth -1); iFillSPos++ )
-    {
-      Int iDeltaCurSPos  = (iFillSPos << m_iShiftPrec) - iLastSPos;
-
-      RM_AOT( iDeltaCurSPos > iDeltaSPos );
-      RM_AOT( iDeltaCurSPos < 0 );
-      RM_AOT( m_aaiSubPelShiftR[iDeltaSPos][iDeltaCurSPos] == 0xdeaddead);
-
-      xSetShiftedPelR<bSet>( iCurPos, m_aaiSubPelShiftR[iDeltaSPos][iDeltaCurSPos], iFillSPos, REN_IS_FILLED, riError );
-    }
-  };
-}
-
-
-
-template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void
-TRenSingleModelC<iBM,bBitInc>::xRenderRangeL(Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError )
-{
-  const Int iCurViewPos = 0; 
-  if (  !m_bInOcclusion )
-  {
-    if ( iCurSPos >= iLastSPos )
-    {
-      m_iLastOccludedSPos = iLastSPos;
-
-      Int iRightSPosFP = xRoundL( iLastSPos );
-      if ( ( iRightSPosFP == xRangeRightL(iLastSPos)) && (iRightSPosFP >= 0) )
-      {
-        m_iThisDepth = m_iLastDepth;
-
-        xSetShiftedPelL<bSet>( iCurPos+1, 0, iRightSPosFP, REN_IS_FILLED, riError );
-      }
-      m_iLastOccludedSPosFP = iRightSPosFP;
-
-      m_bInOcclusion = true;
-
-      if ( bSet )
-      {
-        m_pcInputSamplesRow[iCurViewPos][ iCurPos ].bOccluded  = true;
-      }
-    }
-    else
-    {
-      if ( bSet )
-      {
-        m_pcInputSamplesRow[iCurViewPos][ iCurPos ].bOccluded  = false;
-      }
-
-      xRenderShiftedRangeL<bSet>(iCurSPos, iLastSPos, iCurPos, riError );
-    }
-  }
-  else
-  {
-    if ( iCurSPos < m_iLastOccludedSPos )
-    {
-      m_bInOcclusion = false;
-      if ( bSet )
-      {
-        m_pcInputSamplesRow[iCurViewPos][ iCurPos ].bOccluded  = false;
-      }
-
-      xRenderShiftedRangeL<bSet>(iCurSPos, iLastSPos, iCurPos, riError );
-    }
-    else
-    {
-      if ( bSet )
-      {
-        m_pcInputSamplesRow[iCurViewPos][ iCurPos ].bOccluded  = true;
-      }
-    }
-  }
-}
-
-template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void
-TRenSingleModelC<iBM,bBitInc>::xRenderRangeR(Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError )
-{
-  const Int iCurViewPos = 1; 
-  // Find out if current sample is occluded
-  if (  !m_bInOcclusion )
-  {
-    if ( iCurSPos <= iLastSPos )
-    {
-      m_iLastOccludedSPos = iLastSPos;
-
-      Int iLeftSPosFP = xRoundR( iLastSPos );
-      if ( ( iLeftSPosFP == xRangeLeftR(iLastSPos)) && (iLeftSPosFP <= m_iWidth - 1) )
-      {
-        m_iThisDepth = m_iLastDepth;
-        xSetShiftedPelR<bSet>( iCurPos-1,1 << m_iShiftPrec , iLeftSPosFP, REN_IS_FILLED, riError );
-      }
-      m_iLastOccludedSPosFP = iLeftSPosFP;
-
-      m_bInOcclusion = true;
-
-      if ( bSet )
-      {
-        m_pcInputSamplesRow[iCurViewPos][ iCurPos ].bOccluded  = true;
-      }
-    }
-    else
-    {
-      if ( bSet )
-      {
-        m_pcInputSamplesRow[iCurViewPos][ iCurPos ].bOccluded  = false;
-      }
-
-      xRenderShiftedRangeR<bSet>(iCurSPos, iLastSPos, iCurPos, riError );
-    }
-  }
-  else
-  {
-    if ( iCurSPos > m_iLastOccludedSPos )
-    {
-      m_bInOcclusion = false;
-      if ( bSet )
-      {
-        m_pcInputSamplesRow[iCurViewPos][ iCurPos ].bOccluded  = false;
-      }
-
-      xRenderShiftedRangeR<bSet>(iCurSPos, iLastSPos, iCurPos, riError );
-    }
-    else
-    {
-      if ( bSet )
-      {
-        m_pcInputSamplesRow[iCurViewPos][ iCurPos ].bOccluded  = true;
-      }
-    }
-  }
-}
-
-template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void
-TRenSingleModelC<iBM,bBitInc>::xFillHoleL( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError )
-{
-  if (iLastSPos < 0)
-    return;
-
-  Int iStartFillSPos = iCurSPos;
-  Int iStartFillPos  = iCurPos;
-  Int iLastPos      = iCurPos + 1;
-
-  Int iStartFillSPosFP = xRangeLeftL(iStartFillSPos);
-
-  if (iStartFillSPosFP == xRoundL(iStartFillSPos))
-  {
-    if ((iStartFillSPosFP >= 0) && (iStartFillSPosFP < m_iLastOccludedSPosFP) )
-    {
-      m_iThisDepth = m_iCurDepth;
-      xSetShiftedPelL<bSet>    ( iStartFillPos, 0, iStartFillSPosFP, REN_IS_FILLED, riError );
-    }
-  }
-  else
-  {
-    iStartFillSPosFP--;
-  }
-
-  m_iThisDepth = m_iLastDepth;
-  for (Int iFillSPos = std::max(iStartFillSPosFP+1,0); iFillSPos <= min(xRangeRightL( iLastSPos ), m_iLastOccludedSPosFP-1 ); iFillSPos++ )
-  {
-    xSetShiftedPelL<bSet>( iLastPos, 0,  iFillSPos, REN_IS_HOLE, riError );
-  }
-}
-
-template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void
-TRenSingleModelC<iBM,bBitInc>::xFillHoleR( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError )
-{
-  if (iLastSPos < 0)
-    return;
-
-  Int iStartFillSPos = iCurSPos;
-  Int iEndFillPos    = iCurPos;
-  Int iLastPos       = iCurPos - 1;
-
-  Int iStartFillSPosFP = xRangeRightR(iStartFillSPos);
-
-  if (iStartFillSPosFP == xRoundR(iStartFillSPos))
-  {
-    if ((iStartFillSPosFP < m_iWidth) && (iStartFillSPosFP > m_iLastOccludedSPosFP) )
-    {
-      m_iThisDepth = m_iCurDepth;
-      xSetShiftedPelR<bSet>( iEndFillPos, 1 << m_iShiftPrec , iStartFillSPosFP, REN_IS_FILLED, riError );
-    }
-  }
-  else
-  {
-    iStartFillSPosFP++;
-  }
-
-  m_iThisDepth = m_iLastDepth;
-  for (Int iFillSPos = max(xRangeLeftR( iLastSPos ), m_iLastOccludedSPosFP+1); iFillSPos <= min(iStartFillSPosFP,m_iWidth)-1 ; iFillSPos++ )
-  {
-    xSetShiftedPelR<bSet>( iLastPos, 1 << m_iShiftPrec, iFillSPos, REN_IS_HOLE, riError );
-  }
-}
-
-template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void
-TRenSingleModelC<iBM,bBitInc>::xExtrapolateMarginL(Int iCurSPos, Int iCurPos, RMDist& riError )
-{
-//  if (iLeftSPos < 0 )
-//    return;
-
-  Int iSPosFullPel = std::max(0,xRangeLeftL(iCurSPos));
-
-  m_iThisDepth = m_iCurDepth;
-  if (iSPosFullPel < m_iWidth)
-  {
-    xSetShiftedPelL<bSet>( iCurPos, 0, iSPosFullPel, REN_IS_FILLED, riError );
-  }
-
-  for (Int iFillSPos = iSPosFullPel +1; iFillSPos < m_iWidth; iFillSPos++ )
-  {
-    xSetShiftedPelL<bSet>( iCurPos, 0, iFillSPos, REN_IS_HOLE, riError );
-  }
-}
-
-template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void
-TRenSingleModelC<iBM,bBitInc>::xExtrapolateMarginR(Int iCurSPos, Int iCurPos, RMDist& riError )
-{
-  //  if (iLeftSPos < 0 )
-  //    return;
-
-  Int iSPosFullPel = std::min(m_iWidth-1,xRangeRightR(iCurSPos));
-
-  m_iThisDepth = m_iCurDepth;
-  if (iSPosFullPel > -1)
-  {
-    xSetShiftedPelR<bSet>( iCurPos, 1 << m_iShiftPrec, iSPosFullPel, REN_IS_FILLED, riError );
-  }
-
-  for (Int iFillSPos = iSPosFullPel -1; iFillSPos > -1; iFillSPos-- )
-  {
-    xSetShiftedPelR<bSet>( iCurPos , 1 << m_iShiftPrec, iFillSPos, REN_IS_HOLE, riError );
-  }
-}
-
-template <BlenMod iBM, Bool bBitInc> __inline Int
-TRenSingleModelC<iBM,bBitInc>::xShiftNewData( Int iPosX, Int iPosInNewData )
-{
-  RM_AOT( iPosInNewData <               0 );
-  RM_AOF( iPosInNewData < m_iNewDataWidth );
-
-  return (iPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RenModRemoveBitInc( m_piNewDepthData[iPosInNewData] )];
-}
-
-template <BlenMod iBM, Bool bBitInc> __inline Int
-TRenSingleModelC<iBM,bBitInc>::xShift( Int iPosX )
-{
- RM_AOT( iPosX <        0);
- RM_AOF( iPosX < m_iWidth);
-
- return (iPosX  << m_iShiftPrec) - m_ppiCurLUT[0][ RenModRemoveBitInc( m_pcInputSamplesRow[m_iCurViewPos][iPosX].iD )];
-}
-
-
-template <BlenMod iBM, Bool bBitInc> __inline Int
-TRenSingleModelC<iBM,bBitInc>::xShift( Int iPos, Int iPosInNewData )
-{
-  if ( (iPosInNewData >= 0) && (iPosInNewData < m_iNewDataWidth) )
-  {
-    return xShiftNewData(iPos ,iPosInNewData );
-  }
-  else
-  {
-    return xShift(iPos);
-  }
-}
-
-template <BlenMod iBM, Bool bBitInc> __inline Int
-TRenSingleModelC<iBM,bBitInc>::xRangeLeftL( Int iPos )
-{
-  return  ( iPos +  (1 << m_iShiftPrec) - 1) >> m_iShiftPrec;
-}
-
-
-template <BlenMod iBM, Bool bBitInc> __inline Int
-TRenSingleModelC<iBM,bBitInc>::xRangeLeftR( Int iPos )
-{
-
-  return  xRangeRightR( iPos ) + 1;
-}
-
-
-template <BlenMod iBM, Bool bBitInc> __inline Int
-TRenSingleModelC<iBM,bBitInc>::xRangeRightL( Int iPos )
-{
-  return xRangeLeftL(iPos) - 1;
-}
-
-template <BlenMod iBM, Bool bBitInc> __inline Int
-TRenSingleModelC<iBM,bBitInc>::xRangeRightR( Int iPos )
-{
-  return iPos >> m_iShiftPrec;
-}
-
-
-template <BlenMod iBM, Bool bBitInc> __inline Int
-TRenSingleModelC<iBM,bBitInc>::xRoundL( Int iPos )
-{
-  return  (iPos + (( 1 << m_iShiftPrec ) >> 1 )) >> m_iShiftPrec;
-}
-
-template <BlenMod iBM, Bool bBitInc> __inline Int
-TRenSingleModelC<iBM,bBitInc>::xRoundR( Int iPos )
-{
-  return  (m_iShiftPrec == 0) ? iPos : xRoundL(iPos - 1);
-}
-
-
-template <BlenMod iBM, Bool bBitInc> Void
-TRenSingleModelC<iBM,bBitInc>::xSetPels( Pel* piPelSource , Int iSourceStride, Int iWidth, Int iHeight, Pel iVal )
-{
-  for (Int iYPos = 0; iYPos < iHeight; iYPos++)
-  {
-    for (Int iXPos = 0; iXPos < iWidth; iXPos++)
-    {
-      piPelSource[iXPos] = iVal;
-    }
-    piPelSource += iSourceStride;
-  }
-}
-
-template <BlenMod iBM, Bool bBitInc> Void
-TRenSingleModelC<iBM,bBitInc>::xSetInts( Int* piPelSource , Int iSourceStride, Int iWidth, Int iHeight, Int iVal )
-{
-  for (Int iYPos = 0; iYPos < iHeight; iYPos++)
-  {
-    for (Int iXPos = 0; iXPos < iWidth; iXPos++)
-    {
-      piPelSource[iXPos] = iVal;
-    }
-    piPelSource += iSourceStride;
-  }
-}
-
-
-template <BlenMod iBM, Bool bBitInc> Void
-TRenSingleModelC<iBM,bBitInc>::xSetBools( Bool* pbPelSource , Int iSourceStride, Int iWidth, Int iHeight, Bool bVal )
-{
-  for (Int iYPos = 0; iYPos < iHeight; iYPos++)
-  {
-    for (Int iXPos = 0; iXPos < iWidth; iXPos++)
-    {
-      pbPelSource[iXPos] = bVal;
-    }
-    pbPelSource += iSourceStride;
-  }
-}
-
-template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void
-TRenSingleModelC<iBM,bBitInc>::xSetShiftedPelL(Int iSourcePos, Int iSubSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError )
-{
-  RM_AOT( iSourcePos    <  0                   );
-  RM_AOT( iSourcePos    >= m_iWidth            );
-  RM_AOT( iSubSourcePos < 0                    );
-  RM_AOT( iSubSourcePos >  (1 << m_iShiftPrec) );
-  RM_AOT( iTargetSPos   < 0                    );
-  RM_AOT( iTargetSPos   >= m_iWidth            );  
-
-  RenModelOutPels* pcOutSample = m_pcOutputSamplesRow              + iTargetSPos;
-  RenModelInPels * pcInSample  = m_pcInputSamplesRow[VIEWPOS_LEFT] + iSourcePos ;
-
-  if ( iBM != BLEND_NONE )
-  {
-    xSetShiftedPelBlendL<bSet>  (pcInSample, iSubSourcePos, pcOutSample, iFilled, riError);
-  }
-  else
-  {
-    xSetShiftedPelNoBlendL<bSet>(pcInSample, iSubSourcePos, pcOutSample, iFilled, riError);
-  }
-}
-
-template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void
-TRenSingleModelC<iBM,bBitInc>::xSetShiftedPelNoBlendL(RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError )
-{
-  if ( bSet )
-  { 
-    // Filled
-    pcOutSample->iFilledLeft = iFilled;
-
-    // Yuv
-    pcOutSample->iYLeft  = pcInSample->aiY[iSubSourcePos];
-#if H_3D_VSO_COLOR_PLANES
-    pcOutSample->iULeft  = pcInSample->aiU[iSubSourcePos];
-    pcOutSample->iVLeft  = pcInSample->aiV[iSubSourcePos];
-
-    pcOutSample->iError = xGetDist( pcOutSample->iYLeft - pcOutSample->iYRef,
-                                    pcOutSample->iULeft - pcOutSample->iURef,    
-                                    pcOutSample->iVLeft - pcOutSample->iVRef
-                                  );    
-#else
-    pcOutSample->iError = xGetDist( pcOutSample->iYLeft - pcOutSample->iYRef );    
-#endif    
-    
-  }
-  else
-  { 
-#if H_3D_VSO_COLOR_PLANES
-    riError += xGetDist( pcInSample->aiY[iSubSourcePos] - pcOutSample->iYRef,
-                         pcInSample->aiU[iSubSourcePos] - pcOutSample->iURef,
-                         pcInSample->aiV[iSubSourcePos] - pcOutSample->iVRef
-                       );
-#else               
-    riError += xGetDist( pcInSample->aiY[iSubSourcePos] - pcOutSample->iYRef );
-#endif
-
-    riError -= pcOutSample->iError;
-  }
-}
-
-template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void
-TRenSingleModelC<iBM,bBitInc>::xSetShiftedPelBlendL(RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError )
-{
-  Pel piBlendedValueY;
-#if H_3D_VSO_COLOR_PLANES
-  Pel piBlendedValueU;
-  Pel piBlendedValueV;
-#endif
-
-  xGetBlendedValue (
-    pcInSample ->aiY[iSubSourcePos],
-    pcOutSample->iYRight,    
-#if H_3D_VSO_COLOR_PLANES
-    pcInSample ->aiU[iSubSourcePos],
-    pcOutSample->iURight,    
-    pcInSample ->aiV[iSubSourcePos],
-    pcOutSample->iVRight,    
-#endif
-    m_piInvZLUTLeft [RenModRemoveBitInc(m_iThisDepth)        ],
-    m_piInvZLUTRight[RenModRemoveBitInc(pcOutSample->iDRight)],
-    iFilled,
-    pcOutSample->iFilledRight  ,
-    piBlendedValueY
-#if H_3D_VSO_COLOR_PLANES
-    , piBlendedValueU,
-    piBlendedValueV
-#endif
-    );
-
-  if ( bSet )
-  {    
-    // Set values
-    pcOutSample->iDLeft      = m_iThisDepth;
-    pcOutSample->iYLeft      = pcInSample ->aiY[iSubSourcePos];
-    pcOutSample->iYBlended   = piBlendedValueY;    
-#if H_3D_VSO_COLOR_PLANES  
-    pcOutSample->iULeft      = pcInSample ->aiU[iSubSourcePos];
-    pcOutSample->iUBlended   = piBlendedValueU;    
-    pcOutSample->iVLeft      = pcInSample ->aiV[iSubSourcePos];
-    pcOutSample->iVBlended   = piBlendedValueV;    
-#endif
-    pcOutSample->iFilledLeft = iFilled;
-
-    // Get Error
-    Int iDiffY = pcOutSample->iYRef - piBlendedValueY;
-#if H_3D_VSO_COLOR_PLANES
-    Int iDiffU = pcOutSample->iURef - piBlendedValueU;
-    Int iDiffV = pcOutSample->iVRef - piBlendedValueV;
-    pcOutSample->iError  = xGetDist(iDiffY, iDiffU, iDiffV );
-#else
-    pcOutSample->iError  = xGetDist(iDiffY );
-#endif
-  }
-  else
-  {
-    Int iDiffY = pcOutSample->iYRef - piBlendedValueY;
-#if H_3D_VSO_COLOR_PLANES
-    Int iDiffU = pcOutSample->iURef - piBlendedValueU;
-    Int iDiffV = pcOutSample->iVRef - piBlendedValueV;
-    riError   += ( xGetDist( iDiffY, iDiffU, iDiffV ) - pcOutSample->iError );
-
-#else
-    riError   += ( xGetDist( iDiffY ) - pcOutSample->iError  );
-#endif
-
-  }
-}
-
-
-template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void
-TRenSingleModelC<iBM,bBitInc>::xSetShiftedPelR(Int iSourcePos, Int iSubSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError )
-{
-  RM_AOT( iSourcePos    <  0                     );
-  RM_AOT( iSourcePos    >= m_iWidth              );
-  RM_AOT( iSubSourcePos <  0                     );
-  RM_AOT( iSubSourcePos >= (1 << m_iShiftPrec)+1 );
-  RM_AOT( iTargetSPos   < 0                      );
-  RM_AOT( iTargetSPos   >= m_iWidth              );  
-
-  RenModelOutPels* pcOutSample = m_pcOutputSamplesRow               + iTargetSPos;
-  RenModelInPels * pcInSample  = m_pcInputSamplesRow[VIEWPOS_RIGHT] + iSourcePos ;
-
-  if ( iBM != BLEND_NONE )
-  {
-    xSetShiftedPelBlendR<bSet>   (pcInSample, iSubSourcePos, pcOutSample, iFilled, riError);
-  }
-  else
-  {
-    xSetShiftedPelNoBlendR<bSet> (pcInSample, iSubSourcePos, pcOutSample, iFilled, riError);
-  }
-}
-
-template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void
-TRenSingleModelC<iBM,bBitInc>::xSetShiftedPelNoBlendR(RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError )
-{
-  if ( bSet )
-  { 
-    // Filled
-    pcOutSample->iFilledRight = iFilled;
-
-    // Yuv
-    pcOutSample->iYRight  = pcInSample->aiY[iSubSourcePos];
-#if H_3D_VSO_COLOR_PLANES
-    pcOutSample->iURight  = pcInSample->aiU[iSubSourcePos];
-    pcOutSample->iVRight  = pcInSample->aiV[iSubSourcePos];
-
-    pcOutSample->iError = xGetDist( 
-      pcOutSample->iYRight - pcOutSample->iYRef,
-      pcOutSample->iURight - pcOutSample->iURef,    
-      pcOutSample->iVRight - pcOutSample->iVRef
-      );    
-#else
-    pcOutSample->iError = xGetDist( pcOutSample->iYRight - pcOutSample->iYRef );    
-#endif    
-
-  }
-  else
-  { 
-#if H_3D_VSO_COLOR_PLANES
-    riError += xGetDist( pcInSample->aiY[iSubSourcePos] - pcOutSample->iYRef,
-      pcInSample->aiU[iSubSourcePos] - pcOutSample->iURef,
-      pcInSample->aiV[iSubSourcePos] - pcOutSample->iVRef
-      );
-#else               
-    riError += xGetDist( pcInSample->aiY[iSubSourcePos] - pcOutSample->iYRef );
-#endif
-
-    riError -= pcOutSample->iError;
-  }
-}
-
-template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void
-TRenSingleModelC<iBM,bBitInc>::xSetShiftedPelBlendR(RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError )
-{
-  Pel piBlendedValueY;
-#if H_3D_VSO_COLOR_PLANES
-  Pel piBlendedValueU;
-  Pel piBlendedValueV;
-#endif
-
-  xGetBlendedValue (
-    pcOutSample->iYLeft, 
-    pcInSample ->aiY[iSubSourcePos],        
-#if H_3D_VSO_COLOR_PLANES
-    pcOutSample->iULeft,    
-    pcInSample ->aiU[iSubSourcePos],
-    pcOutSample->iVLeft,    
-    pcInSample ->aiV[iSubSourcePos],
-#endif
-    m_piInvZLUTLeft  [RenModRemoveBitInc(pcOutSample->iDLeft)],
-    m_piInvZLUTRight [RenModRemoveBitInc(m_iThisDepth)       ],
-    pcOutSample->iFilledLeft,
-    iFilled,
-    piBlendedValueY
-#if H_3D_VSO_COLOR_PLANES
-    , piBlendedValueU,
-    piBlendedValueV
-#endif
-    );
-
-  if ( bSet )
-  {    
-    // Set values
-    pcOutSample->iDRight     = m_iThisDepth;
-    pcOutSample->iYRight     = pcInSample ->aiY[iSubSourcePos];
-    pcOutSample->iYBlended   = piBlendedValueY;    
-#if H_3D_VSO_COLOR_PLANES  
-    pcOutSample->iURight     = pcInSample ->aiU[iSubSourcePos];
-    pcOutSample->iUBlended   = piBlendedValueU;    
-    pcOutSample->iVRight     = pcInSample ->aiV[iSubSourcePos];
-    pcOutSample->iVBlended   = piBlendedValueV;    
-#endif
-    pcOutSample->iFilledRight = iFilled;
-
-    // Get Error
-    Int iDiffY = pcOutSample->iYRef - piBlendedValueY;
-#if H_3D_VSO_COLOR_PLANES
-    Int iDiffU = pcOutSample->iURef - piBlendedValueU;
-    Int iDiffV = pcOutSample->iVRef - piBlendedValueV;
-    pcOutSample->iError  = xGetDist(iDiffY, iDiffU, iDiffV );
-#else
-    pcOutSample->iError  = xGetDist(iDiffY );
-#endif
-  }
-  else
-  {
-    Int iDiffY = pcOutSample->iYRef - piBlendedValueY;
-#if H_3D_VSO_COLOR_PLANES
-    Int iDiffU = pcOutSample->iURef - piBlendedValueU;
-    Int iDiffV = pcOutSample->iVRef - piBlendedValueV;
-    riError   += ( xGetDist( iDiffY, iDiffU, iDiffV ) - pcOutSample->iError );
-#else
-    riError   += ( xGetDist( iDiffY ) -  pcOutSample->iError  );
-#endif
-  }
-}
-
-template <BlenMod iBM, Bool bBitInc> __inline Int
-TRenSingleModelC<iBM,bBitInc>::xGetDist( Int iDiffY, Int iDiffU, Int iDiffV )
-{
-
-  if ( !bBitInc )
-  {
-    return (          (iDiffY * iDiffY )
-               +  ((( (iDiffU * iDiffU )
-                     +(iDiffV * iDiffV )
-                    )
-                   ) >> 2
-                  )
-           );
-  }
-  else
-  {
-    return (          ((iDiffY * iDiffY) >> m_iDistShift)
-               +  ((( ((iDiffU * iDiffU) >> m_iDistShift)
-                     +((iDiffV * iDiffV) >> m_iDistShift)
-                    )
-                   ) >> 2
-                  )
-           );
-  
-  }
-}
-
-template <BlenMod iBM, Bool bBitInc> __inline Int
-TRenSingleModelC<iBM,bBitInc>::xGetDist( Int iDiffY )
-{
-  if ( !bBitInc )
-  {
-    return (iDiffY * iDiffY);
-  }
-  else
-  {
-    return ((iDiffY * iDiffY) >> m_iDistShift);
-  }
-
-}
-
-
-#if H_3D_VSO_COLOR_PLANES
-template <BlenMod iBM, Bool bBitInc>  __inline Void
-TRenSingleModelC<iBM,bBitInc>::xGetBlendedValue( Pel iYL, Pel iYR, Pel iUL, Pel iUR, Pel iVL, Pel iVR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY, Pel& riU, Pel&riV )
-#else
-template <BlenMod iBM, Bool bBitInc>  __inline Void
-TRenSingleModelC<iBM,bBitInc>::xGetBlendedValue( Pel iYL, Pel iYR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY )
-#endif
-{
-
-  RM_AOT( iBM != BLEND_AVRG && iBM != BLEND_LEFT && iBM != BLEND_RIGHT );
-
-  if (iBM != BLEND_AVRG )
-  {
-    if (iBM == BLEND_LEFT )
-    {
-#if H_3D_VSO_COLOR_PLANES
-      xGetBlendedValueBM1(  iYL,  iYR,  iUL,  iUR,  iVL,  iVR,  iDepthL,  iDepthR,  iFilledL,  iFilledR,  riY,  riU, riV );
-#else
-      xGetBlendedValueBM1(  iYL,  iYR,  iDepthL,  iDepthR,  iFilledL,  iFilledR,  riY );
-#endif
-    }
-    else
-    {
-#if H_3D_VSO_COLOR_PLANES
-      xGetBlendedValueBM2(  iYL,  iYR,  iUL,  iUR,  iVL,  iVR,  iDepthL,  iDepthR,  iFilledL,  iFilledR,  riY,  riU, riV );
-#else
-      xGetBlendedValueBM2(  iYL,  iYR, iDepthL,  iDepthR,  iFilledL,  iFilledR,  riY );
-#endif
-    }
-    return;
-  }
-
-  if (  (iFilledL != REN_IS_HOLE ) && ( iFilledR != REN_IS_HOLE) )
-  {
-    Int iDepthDifference = iDepthR - iDepthL;
-
-    if ( abs ( iDepthDifference ) <= m_iBlendZThres )
-    {
-      if      ((iFilledL == REN_IS_FILLED) && ( iFilledR != REN_IS_FILLED))
-      {
-        riY = xBlend( iYL, iYR, iFilledR >> 1 );
-#if H_3D_VSO_COLOR_PLANES
-        riU = xBlend( iUL, iUR, iFilledR >> 1 );
-        riV = xBlend( iVL, iVR, iFilledR >> 1 );
-#endif
-
-      }
-      else if ((iFilledL != REN_IS_FILLED) && ( iFilledR == REN_IS_FILLED))
-      {
-        riY = xBlend( iYR, iYL, (iFilledL >> 1) );
-#if H_3D_VSO_COLOR_PLANES
-        riU = xBlend( iUR, iUL, (iFilledL >> 1) );
-        riV = xBlend( iVR, iVL, (iFilledL >> 1) );
-#endif
-      }
-      else
-      {
-        riY = xBlend( iYL, iYR, m_iBlendDistWeight );
-#if H_3D_VSO_COLOR_PLANES    
-        riU = xBlend( iUL, iUR, m_iBlendDistWeight );
-        riV = xBlend( iVL, iVR, m_iBlendDistWeight );
-#endif
-      }
-    }
-    else if ( iDepthDifference < 0 )
-    {
-      riY = iYL;
-#if H_3D_VSO_COLOR_PLANES
-      riU = iUL;
-      riV = iVL;
-#endif
-    }
-    else
-    {
-      riY = iYR;
-#if H_3D_VSO_COLOR_PLANES
-      riU = iUR;
-      riV = iVR;
-#endif
-    }
-  }
-  else if ( (iFilledL == REN_IS_HOLE) && (iFilledR == REN_IS_HOLE))
-  {
-    if ( iDepthR < iDepthL )
-    {
-        riY =  iYR;
-#if H_3D_VSO_COLOR_PLANES
-        riU =  iUR;
-        riV =  iVR;
-#endif
-    }
-    else
-    {
-        riY =  iYL;
-#if H_3D_VSO_COLOR_PLANES
-        riU =  iUL;
-        riV =  iVL;
-#endif
-    }
-  }
-  else
-  {
-    if (iFilledR == REN_IS_HOLE)
-    {
-        riY = iYL;
-#if H_3D_VSO_COLOR_PLANES
-        riU = iUL;
-        riV = iVL;
-#endif
-    }
-    else
-    {
-      riY = iYR;
-#if H_3D_VSO_COLOR_PLANES
-      riU = iUR;
-      riV = iVR;
-#endif
-    }
-  }
-}
-
-template <BlenMod iBM, Bool bBitInc> __inline Void
-#if H_3D_VSO_COLOR_PLANES
-TRenSingleModelC<iBM,bBitInc>::xGetBlendedValueBM1( Pel iYL, Pel iYR, Pel iUL, Pel iUR, Pel iVL, Pel iVR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY, Pel& riU, Pel&riV )
-#else
-TRenSingleModelC<iBM,bBitInc>::xGetBlendedValueBM1( Pel iYL, Pel iYR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY )
-#endif
-{
-  if ( iFilledL == REN_IS_FILLED ||  iFilledR == REN_IS_HOLE )
-  {
-    riY = iYL;
-#if H_3D_VSO_COLOR_PLANES
-    riU = iUL;
-    riV = iVL;
-#endif
-  }
-  else if ( iFilledL == REN_IS_HOLE  )
-  {
-    riY = iYR;
-#if H_3D_VSO_COLOR_PLANES
-    riU = iUR;
-    riV = iVR;
-#endif
-  }
-  else
-  {
-    riY = xBlend( iYR, iYL, iFilledL );
-#if H_3D_VSO_COLOR_PLANES
-    riU = xBlend( iUR, iUL, iFilledL );
-    riV = xBlend( iVR, iUL, iFilledL );
-#endif
-  }
-}
-
-template <BlenMod iBM, Bool bBitInc> __inline Void
-#if H_3D_VSO_COLOR_PLANES
-TRenSingleModelC<iBM,bBitInc>::xGetBlendedValueBM2( Pel iYL, Pel iYR, Pel iUL, Pel iUR, Pel iVL, Pel iVR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY, Pel& riU, Pel&riV )
-#else
-TRenSingleModelC<iBM,bBitInc>::xGetBlendedValueBM2( Pel iYL, Pel iYR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY )
-#endif
-{
-  if      ( iFilledR == REN_IS_FILLED ||  iFilledL == REN_IS_HOLE )
-  {
-    riY = iYR;
-#if H_3D_VSO_COLOR_PLANES
-    riU = iUR;
-    riV = iVR;
-#endif
-  }
-  else if ( iFilledR == REN_IS_HOLE  )
-  {
-    riY = iYL;
-#if H_3D_VSO_COLOR_PLANES
-    riU = iUL;
-    riV = iVL;
-#endif
-  }
-  else
-  {
-    riY = xBlend( iYL, iYR, iFilledR );
-#if H_3D_VSO_COLOR_PLANES
-    riU = xBlend( iUL, iUR, iFilledR );
-    riV = xBlend( iVL, iUR, iFilledR );
-#endif
-  }
-}
-
-template <BlenMod iBM, Bool bBitInc> __inline Pel
-TRenSingleModelC<iBM,bBitInc>::xBlend( Pel pVal1, Pel pVal2, Int iWeightVal2 )
-{
-  return pVal1  +  (Pel) (  ( (Int) ( pVal2 - pVal1) * iWeightVal2 + (1 << (REN_VDWEIGHT_PREC - 1)) ) >> REN_VDWEIGHT_PREC );
-}
-
-template <BlenMod iBM, Bool bBitInc> Void
-TRenSingleModelC<iBM,bBitInc>::xCopy2PicYuv( Pel** ppiSrcVideoPel, Int* piStrides, TComPicYuv* rpcPicYuvTarget )
-{
-  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) );
-}
-
-template class TRenSingleModelC<BLEND_NONE ,true>;
-template class TRenSingleModelC<BLEND_AVRG ,true>;
-template class TRenSingleModelC<BLEND_LEFT ,true>;
-template class TRenSingleModelC<BLEND_RIGHT,true>;
-
-template class TRenSingleModelC<BLEND_NONE ,false>;
-template class TRenSingleModelC<BLEND_AVRG ,false>;
-template class TRenSingleModelC<BLEND_LEFT ,false>;
-template class TRenSingleModelC<BLEND_RIGHT,false>;
-
-#if H_3D_VSO_EARLY_SKIP
-template <BlenMod iBM, Bool bBitInc> 
-__inline Bool
-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 ); 
-  const Int iCurViewPos = 0;
-  Int** ppiCurLUT       = m_appiShiftLut   [ iCurViewPos ];
-  
-  Bool bNoDiff          = true;   
-  
-  for (Int iPosY=0; iPosY < iHeight; iPosY++)
-  {
-    m_pbHorSkip[iPosY] = true;
-
-    for (Int iPosX = 0; iPosX < iWidth; iPosX++)
-    {
-      Int iDisparityRec = abs(ppiCurLUT[0][ RenModRemoveBitInc(piNewData[iPosX])]);
-      Int iDispartyOrg  = abs(ppiCurLUT[0][ RenModRemoveBitInc(piOrgData[iPosX])]);
-
-      if( iDispartyOrg != iDisparityRec)
-      {
-        m_pbHorSkip[iPosY] = false;
-        bNoDiff            = false;
-        break;
-      }
-    }
-    piNewData += iStride;
-    piOrgData += iOrgStride;
-  }
-  return bNoDiff;
-}
-
-template <BlenMod iBM, Bool bBitInc> 
-__inline Bool
-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 ); 
-  Bool bNoDiff  = true;
-
-  const Int iCurViewPos = 1;
-  Int** ppiCurLUT       = m_appiShiftLut   [ iCurViewPos ];
-
-  for ( Int iPosY = 0; iPosY < iHeight; iPosY++ )
-  {
-    m_pbHorSkip[iPosY] = true;
-
-    for (Int iPosX = 0; iPosX < iWidth; iPosX++)
-    {
-      Int iDisparityRec = abs( ppiCurLUT[0][ RenModRemoveBitInc(piNewData[iPosX])] );
-      Int iDisparityOrg = abs( ppiCurLUT[0][ RenModRemoveBitInc(piOrgData[iPosX])] );
-
-      if( iDisparityRec != iDisparityOrg )
-      {
-        m_pbHorSkip[iPosY] = false;
-        bNoDiff            = false;
-        break;
-      }
-    }
-
-    piNewData += iStride;
-    piOrgData += iOrgStride;
-  }
-  return bNoDiff;
-}
-#endif
-#endif // NH_3D
-
Index: branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenSingleModel.h
===================================================================
--- branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenSingleModel.h	(revision 1389)
+++ branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenSingleModel.h	(revision 1390)
@@ -51,343 +51,4 @@
 #include <cstring>
 
-#if NH_3D_VSO
-using namespace std;
-
-#if H_3D_VSO_RM_ASSERTIONS
-#define RM_AOT( exp ) AOT ( exp )
-#define RM_AOF( exp ) AOF ( exp )
-#else
-#define RM_AOT( exp ) ((void)0)
-#define RM_AOF( exp ) ((void)0)
-#endif
-
-#define RenModRemoveBitInc( exp ) bBitInc ? ( RemoveBitIncrement( exp ) ) : ( exp ) 
-
-class TRenSingleModel
-{
-public: 
-
-  virtual ~TRenSingleModel() { }  
-#if H_3D_VSO_EARLY_SKIP
-  virtual Void   create    ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bEarlySkip ) = 0;
-#else
-  virtual Void   create    ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode ) = 0;
-#endif
-
-  // Set Frame dependent data
-  virtual Void   setLRView ( Int iViewPos, Pel** apiCurVideoPel, Int* aiCurVideoStride, Pel* piCurDepthPel, Int iCurDepthStride ) = 0;
-  virtual Void   setupPart ( UInt uiHorOffset,       Int iUsedHeight ) = 0;
-  virtual Void   setup     ( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight,  Int** ppiBaseShiftLutRight,  Int iDistToLeft, Bool bKeepReference ) = 0;
-
-  // Set Data
-#if H_3D_VSO_EARLY_SKIP
-  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, 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;  
-  virtual Void   getSynthDepth  ( Int iViewPos, TComPicYuv* pcPicYuv ) = 0;
-  virtual Void   getRefVideo    ( Int iViewPos, TComPicYuv* pcPicYuv ) = 0;
-};
-
-template < BlenMod iBM, Bool bBitInc >
-class TRenSingleModelC : public TRenSingleModel
-{
-  struct RenModelInPels
-  {
-    // video
-    Pel aiY[5]    ; // y-value
-#if H_3D_VSO_COLOR_PLANES
-    Pel aiU[5]    ; // u-value
-    Pel aiV[5]    ; // v-value
-#endif
-    // depth
-    Pel iD        ; // depth
-
-    // state
-    Bool bOccluded; // Occluded
-  };
-
-  struct RenModelOutPels
-  {
-    // video
-    Pel iYLeft    ; 
-    Pel iYRight   ; 
-    Pel iYBlended ; 
-#if H_3D_VSO_COLOR_PLANES
-    Pel iULeft    ; 
-    Pel iURight   ; 
-    Pel iUBlended ; 
-    Pel iVLeft    ; 
-    Pel iVRight   ; 
-    Pel iVBlended ; 
-#endif
-    // depth
-    Pel iDLeft    ;
-    Pel iDRight   ; 
-    Pel iDBlended ; 
-
-    // state
-    Int iFilledLeft ; 
-    Int iFilledRight; 
-
-    // error
-    Int  iError   ;
-
-    // reference
-    Pel iYRef    ; 
-#if H_3D_VSO_COLOR_PLANES
-    Pel iURef    ; 
-    Pel iVRef    ; 
-#endif        
-  };
-
-
-
-public:
-  TRenSingleModelC();
-  ~TRenSingleModelC();
-
-  // Create Model
-#if H_3D_VSO_EARLY_SKIP
-  Void   create    ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bEarlySkip  );
-#else
-  Void   create    ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode );
-#endif
-
-  // Set Frame dependent data
-  Void   setLRView ( Int iViewPos, Pel** apiCurVideoPel, Int* aiCurVideoStride, Pel* piCurDepthPel, Int iCurDepthStride );
-  Void   setupPart ( UInt uiHorOffset,       Int uiUsedHeight );
-  Void   setup     ( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight,  Int** ppiBaseShiftLutRight,  Int iDistToLeft, Bool bKeepReference );
-
-#if H_3D_VSO_EARLY_SKIP
-  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 );  
-  Void   getSynthDepth  ( Int iViewPos, TComPicYuv* pcPicYuv );
-  Void   getRefVideo    ( Int iViewPos, TComPicYuv* pcPicYuv );
-
-private:
-  // Set and inc Current Row
-  __inline Void   xSetViewRow(  Int iPosY );
-  __inline Void   xIncViewRow();
-
-  /////  Rendering /////
-  // Left to Right
-#if H_3D_VSO_EARLY_SKIP
-                      __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  );
-  template<Bool bSet> __inline Void   xRenderRangeL       ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError );
-  template<Bool bSet> __inline Void   xRenderShiftedRangeL( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError );
-  template<Bool bSet> __inline Void   xFillHoleL          ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError );
-  template<Bool bSet> __inline Void   xExtrapolateMarginL ( Int iCurSPos,                Int iCurPos, RMDist& riError );
-                      __inline Int    xRangeLeftL         ( Int iPos );
-                      __inline Int    xRangeRightL        ( Int iPos );
-                      __inline Int    xRoundL             ( Int iPos );
-
-  // Right to Left
-                      __inline Void   xInitRenderPartR    ( Int iStartChangePos, Int iLastSPos );
-  template<Bool bSet> __inline Void   xRenderShiftedRangeR( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError );
-  template<Bool bSet> __inline Void   xRenderRangeR       ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError );
-  template<Bool bSet> __inline Void   xFillHoleR          ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError );
-  template<Bool bSet> __inline Void   xExtrapolateMarginR ( Int iCurSPos,                Int iCurPos, RMDist& riError );
-                      __inline Int    xRangeLeftR         ( Int iPos );
-                      __inline Int    xRangeRightR        ( Int iPos );
-                      __inline Int    xRoundR             ( Int iPos );
-
-  // Blending
-  template<Bool bSet> __inline Void   xSetShiftedPelBlend ( Int iSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError );
-
-#if H_3D_VSO_COLOR_PLANES
-  __inline Void   xGetBlendedValue    ( Pel iYL, Pel iYR, Pel iUL, Pel iUR, Pel iVL, Pel iVR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY, Pel& riU, Pel&riV );
-  __inline Void   xGetBlendedValueBM1 ( Pel iYL, Pel iYR, Pel iUL, Pel iUR, Pel iVL, Pel iVR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY, Pel& riU, Pel&riV );
-  __inline Void   xGetBlendedValueBM2 ( Pel iYL, Pel iYR, Pel iUL, Pel iUR, Pel iVL, Pel iVR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY, Pel& riU, Pel&riV );
-#else
-  __inline Void   xGetBlendedValue    ( Pel iYL, Pel iYR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY );
-  __inline Void   xGetBlendedValueBM1 ( Pel iYL, Pel iYR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY );
-  __inline Void   xGetBlendedValueBM2 ( Pel iYL, Pel iYR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY );
-#endif
-  __inline Pel    xBlend              ( Pel pVal1, Pel pVal2, Int iWeightVal2 );
-
-  // General
-  template<Bool bSet> __inline Void xSetShiftedPelL       (Int iSourcePos,             Int iSubSourcePos, Int iTargetSPos,              Pel iFilled, RMDist& riError );
-  template<Bool bSet> __inline Void xSetShiftedPelBlendL  (RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError );
-  template<Bool bSet> __inline Void xSetShiftedPelNoBlendL(RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError );
-
-  template<Bool bSet> __inline Void xSetShiftedPelR       (Int iSourcePos,             Int iSubSourcePos, Int iTargetSPos,              Pel iFilled, RMDist& riError );
-  template<Bool bSet> __inline Void xSetShiftedPelBlendR  (RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError );
-  template<Bool bSet> __inline Void xSetShiftedPelNoBlendR(RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError );
-
-  __inline Int    xShiftNewData      ( Int iPos, Int iPosInNewData );
-  __inline Int    xShift             ( Int iPos );
-  __inline Int    xShift             ( Int iPos, Int iPosInNewData );
-  __inline Int    xGetDist           ( Int iDiffY, Int iDiffU, Int iDiffV );
-  __inline Int    xGetDist           ( Int iDiffY );
-
-  // Utilities
-  __inline Void   xSetPels   ( Pel*  piPelSource , Int iSourceStride, Int iWidth, Int iHeight, Pel iVal );
-  __inline Void   xSetBools  ( Bool* pbSource    , Int iSourceStride, Int iWidth, Int iHeight, Bool bVal );
-  __inline Void   xSetInts   ( Int*  piPelSource , Int iSourceStride, Int iWidth, Int iHeight, Int iVal );
-
-#if H_3D_VSO_COLOR_PLANES
-  Void            xGetSampleStrTextPtrs ( Int iViewNum, Pel RenModelOutPels::*& rpiSrcY, Pel RenModelOutPels::*& rpiSrcU, Pel RenModelOutPels::*& rpiSrcV );
-#else  
-  Void            xGetSampleStrTextPtrs ( Int iViewNum, Pel RenModelOutPels::*& rpiSrcY );
-#endif 
-  Void            xGetSampleStrDepthPtrs( Int iViewNum, Pel RenModelOutPels::*& rpiSrcD );
-       
-  Void            xSetStructRefView            ();
-  Void            xResetStructError            ();
-  Void            xInitSampleStructs           ();
-  Void            xSetStructSynthViewAsRefView ();
-  Void            xCopy2PicYuv                ( Pel** ppiSrcVideoPel, Int* piStrides, TComPicYuv* rpcPicYuvTarget );
-
-  template< typename S, typename T> 
-  Void   xCopyFromSampleStruct ( S* ptSource , Int iSourceStride, T S::* ptSourceElement, T* ptTarget, Int iTargetStride, Int iWidth, Int iHeight )
-  {
-    AOT( iWidth != m_iWidth ); 
-    for (Int iPosY = 0; iPosY < iHeight; iPosY++)
-    {
-      for (Int iPosX = 0; iPosX < m_iWidth; iPosX++)
-      {
-        ptTarget[iPosX] = ptSource[iPosX].*ptSourceElement;
-      }
-      ptSource += iSourceStride;
-      ptTarget += iTargetStride;
-    }    
-  }  
-
-  template< typename S, typename T> 
-  Void   xCopyToSampleStruct ( T* ptSource , Int iSourceStride, S* ptTarget, Int iTargetStride, T S::* ptSourceElement, Int iWidth, Int iHeight )
-  {
-    AOT( iWidth != m_iWidth ); 
-    for (Int iPosY = 0; iPosY < iHeight; iPosY++)
-    {
-      for (Int iPosX = 0; iPosX < m_iWidth; iPosX++)
-      {
-        ptTarget[iPosX] = ptSource[iPosX].*ptSourceElement;
-      }
-      ptSource += iSourceStride;
-      ptTarget += iTargetStride;
-    }    
-  }   
-
-private:
-
-  // Image sizes
-  Int   m_iWidth;
-  Int   m_iHeight;
-  Int   m_iStride;
-  Int   m_iPad;
-  Int   m_iUsedHeight;
-  Int   m_iHorOffset; 
-
-  Int   m_iSampledWidth;
-  Int   m_iSampledStride;
-
-  RenModelInPels* m_pcInputSamples[2];
-  Int             m_iInputSamplesStride;
-
-  // Base
-  Pel** m_aapiBaseVideoPel     [2]; // Dim1: ViewPosition 0->Left, 1->Right; Dim2: Plane  0-> Y, 1->U, 2->V
-  Int*  m_aaiBaseVideoStrides  [2]; // Dim1: ViewPosition 0->Left, 1->Right; Dim2: Plane  0-> Y, 1->U, 2->V
-
-  Pel*  m_apiBaseDepthPel      [2]; // Dim1: ViewPosition
-  Int   m_aiBaseDepthStrides   [2]; // Dim1: ViewPosition
-
-
-  // LUT
-  Int** m_appiShiftLut         [2];
-  Int** m_ppiCurLUT;
-  Int** m_aaiSubPelShiftL;
-  Int** m_aaiSubPelShiftR;
-
-  Int*  m_piInvZLUTLeft;
-  Int*  m_piInvZLUTRight;
-
-
-  //// Reference Data  ////
-  TComPicYuv* m_pcPicYuvRef       ;    // Reference PIcYuv
-
-  //// Output Samples
-  RenModelOutPels* m_pcOutputSamples;
-  Int                   m_iOutputSamplesStride;
-
-  Pel*  m_aapiRefVideoPel      [3];    // Dim1: Plane  0-> Y, 1->U, 2->V
-  Int   m_aiRefVideoStrides    [3];    // Dim1: Plane  0-> Y, 1->U, 2->V
-
-  // Rendering State
-  Bool  m_bInOcclusion;                // Currently rendering in occluded area
-  Int   m_iLastOccludedSPos;           // Position of last topmost shifted position
-  Int   m_iLastOccludedSPosFP;         // Position of last topmost shifted position in FullPels
-
-  Int   m_iCurViewPos;                 // Current View Position 0: Left, 1: Right
-  Int   m_iOtherViewPos;               // Other View Position 0: Left, 1: Right
-  const Pel*  m_piNewDepthData;              // Pointer to new depth data
-  Int   m_iStartChangePosX;            // Start Position of new data
-  Int   m_iNewDataWidth;               // Width of new data
-  Pel   m_iCurDepth;                   // Current Depth Value
-  Pel   m_iLastDepth;                  // Last Depth Value
-  Pel   m_iThisDepth;                  // Depth value to use for setting
-
-  //// Settings ////
-  // Input
-  Int   m_iMode;                       // 0: Left to Right, 1: Right to Left, 2: Merge
-  Bool  m_bUseOrgRef;
-  Int   m_iShiftPrec;
-  Int   m_iHoleMargin;
-#if H_3D_VSO_EARLY_SKIP
-  Bool  m_bEarlySkip; 
-#endif
-
-  // Derived settings
-  Int   m_iGapTolerance;
-  Int   m_iBlendZThres;
-  Int   m_iBlendDistWeight;
-
-  //// Current Pointers ////
-
-  RenModelInPels*  m_pcInputSamplesRow [2];
-  RenModelOutPels* m_pcOutputSamplesRow;
-
-  //// MISC ////
-  const Int m_iDistShift;                  // Shift in Distortion computation
-
-  //// Early Skip 
-#if H_3D_VSO_EARLY_SKIP
-  Bool* m_pbHorSkip;
-#endif
-};
-
-#endif // NH_3D
 #endif //__TRENSINGLEMODEL__
 
Index: branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenTop.cpp
===================================================================
--- branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenTop.cpp	(revision 1389)
+++ branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenTop.cpp	(revision 1390)
@@ -40,2197 +40,3 @@
 #include <math.h>
 #include "../TLibCommon/CommonDef.h"
-#if NH_3D_VSO
 
-
-Void TRenTop::xGetDataPointers( PelImage*& rpcInputImage, PelImage*& rpcOutputImage, PelImage*& rpcInputDepth, PelImage*& rpcOutputDepth, PelImage*& rpcFilled, Bool bRenderDepth )
-{
-  UInt uiWidth = m_auiInputResolution[0] << m_iLog2SamplingFactor;
-
-  UInt uiSubPelWidth  = uiWidth;
-
-  if ( m_iInterpolationMode == eRenInt8Tap )
-  {
-    uiSubPelWidth <<= m_iRelShiftLUTPrec;
-  }
-
-  UInt uiHeight = m_auiInputResolution[1];
-
-  if ( m_bUVUp )
-  {
-    rpcInputDepth  = new PelImage(uiSubPelWidth, uiHeight,1,0);
-    rpcInputImage  = new PelImage(uiSubPelWidth, uiHeight,3,0);
-    rpcOutputImage = new PelImage(uiWidth,        uiHeight,3,0);
-    rpcOutputDepth = bRenderDepth  ? new PelImage(uiWidth, uiHeight,1,0) : 0;
-    rpcFilled      = new PelImage(uiWidth, uiHeight,1,0);
-  }
-  else
-  {
-    rpcInputDepth  = new PelImage(uiSubPelWidth, uiHeight,1,1);
-    rpcInputImage  = new PelImage(uiSubPelWidth, uiHeight,1,2);
-    rpcOutputImage = new PelImage(uiWidth,        uiHeight,1,2);
-    rpcOutputDepth = bRenderDepth ? new PelImage(uiWidth, uiHeight,1,1) : 0;
-    rpcFilled      = new PelImage(uiWidth,        uiHeight,1,1);
-  }
-
-}
-
-Void TRenTop::xGetDataPointerOutputImage( PelImage*& rpcOutputImage, PelImage*& rpcOutputDepth )
-{
-
-  UInt uiWidth  = m_auiInputResolution[0] << m_iLog2SamplingFactor;
-  UInt uiHeight = m_auiInputResolution[1];
-
-  if ( m_bUVUp )
-  {
-    rpcOutputImage = new PelImage(uiWidth, uiHeight,3,0);
-    rpcOutputDepth = (m_iBlendMode == eRenBlendDepthFirst ) ? new PelImage(uiWidth, uiHeight,1,0) : NULL;
-  }
-  else
-  {
-    rpcOutputImage = new PelImage(uiWidth, uiHeight,1,2);
-    rpcOutputDepth = (m_iBlendMode == eRenBlendDepthFirst ) ? new PelImage(uiWidth, uiHeight,1,1) : NULL;
-  }
-}
-
-Void TRenTop::xConvertInputVideo( PelImage* pcOrgInputImage, PelImage* pcConvInputImage)
-{
-  TRenImagePlane<Pel>*  pcOrgPlane ;
-  TRenImagePlane<Pel>*  pcConvPlane;
-
-  Int iLog2SamplingFactor = m_iLog2SamplingFactor;
-
-  if ( m_iInterpolationMode == eRenInt8Tap)
-  {
-    iLog2SamplingFactor += m_iRelShiftLUTPrec;
-  }
-
-  AOT( iLog2SamplingFactor > 2);
-
-  for (UInt uiPlane = 0; uiPlane < 3; uiPlane++)
-  {
-    pcOrgPlane  = pcOrgInputImage ->getPlane(uiPlane);
-    pcConvPlane = pcConvInputImage->getPlane(uiPlane);
-
-    if (uiPlane == 0)
-    {
-      TRenFilter<REN_BIT_DEPTH>::sampleHorUp    ( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
-    }
-    else
-    {
-      if ( m_bUVUp )
-      {
-        TRenFilter<REN_BIT_DEPTH>::sampleCUpHorUp( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
-      }
-      else
-      {
-        TRenFilter<REN_BIT_DEPTH>::sampleCHorUp   ( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
-      }
-    }
-  }
-}
-
-Void TRenTop::xConvertInputDepth( PelImage* pcOrgInputImage, PelImage* pcConvInputImage)
-{
-  PelImagePlane*  pcOrgPlane ;
-  PelImagePlane*  pcConvPlane;
-
-  // Full Plane
-  pcOrgPlane  = pcOrgInputImage ->getPlane(0);
-  pcConvPlane = pcConvInputImage->getPlane(0);
-
-  Int iLog2SamplingFactor = m_iLog2SamplingFactor;
-
-  if ( m_iInterpolationMode == eRenInt8Tap)
-  {
-    iLog2SamplingFactor += m_iRelShiftLUTPrec;
-  }
-  AOT( iLog2SamplingFactor > 2);
-
-  TRenFilter<REN_BIT_DEPTH>::sampleHorUp(iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
-
-  if ( !m_bUVUp ) //GT: depth down
-  {
-    // Quarter Plane
-    PelImagePlane* pcTempPlane = new PelImagePlane(pcOrgInputImage->getPlane(0)->getWidth(), ( pcOrgInputImage->getPlane(0)->getHeight() >> 1), REN_LUMA_MARGIN );
-
-    TRenFilter<REN_BIT_DEPTH>::sampleVerDown2Tap13(pcOrgInputImage->getPlane(0), pcTempPlane, PICYUV_PAD);
-    pcConvPlane = pcConvInputImage->getPlane(1);
-
-    if ( iLog2SamplingFactor == 0 )
-    {
-      TRenFilter<REN_BIT_DEPTH>::sampleHorDown2Tap13(pcTempPlane, pcConvPlane, 0 );
-    }
-    else
-    {
-      TRenFilter<REN_BIT_DEPTH>::sampleHorUp    ( iLog2SamplingFactor - 1, pcTempPlane->getPlaneData(), pcTempPlane->getStride(), pcTempPlane->getWidth(), pcTempPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
-    }
-    delete pcTempPlane;
-  }
-}
-
-Void TRenTop::xConvertInputData( PelImage* pcOrgInputImage, PelImage* pcOrgInputDepth, PelImage* pcConvInputImage, PelImage* pcConvInputDepth, Bool bMirror )
-{
-  //ToDo: remove unnecessary copying
-  if ( bMirror )
-  {
-    m_pcTempImage->assign( pcOrgInputImage );
-    TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcTempImage );
-    m_pcTempImage->extendMargin();
-    xConvertInputVideo(    m_pcTempImage, pcConvInputImage );
-
-    m_pcTempImage->getPlane(0)->assign( pcOrgInputDepth->getPlane(0) );
-    TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcTempImage->getPlane(0) );
-    m_pcTempImage->getPlane(0)->extendMargin();
-    xConvertInputDepth( m_pcTempImage, pcConvInputDepth );
-  }
-  else
-  {
-    m_pcTempImage->assign( pcOrgInputImage );
-    m_pcTempImage->extendMargin();
-    xConvertInputVideo( m_pcTempImage, pcConvInputImage );
-
-    m_pcTempImage->getPlane(0)->assign( pcOrgInputDepth->getPlane(0) );
-    m_pcTempImage->getPlane(0)->extendMargin();
-    xConvertInputDepth( m_pcTempImage, pcConvInputDepth );
-  }
-}
-
-Void TRenTop::xConvertOutputData( PelImage* pcOrgOutputImage, PelImage* pcConvOutputImage, Bool bMirror )
-{
-  Int iLog2SamplingFactor = m_iLog2SamplingFactor;
-
-  for ( UInt uiPlane = 0; uiPlane < 3; uiPlane++)
-  {
-    PelImagePlane* pcOrgPlane  = pcOrgOutputImage ->getPlane(uiPlane);
-    PelImagePlane* pcConvPlane = pcConvOutputImage->getPlane(uiPlane);
-
-    pcOrgPlane->extendMargin();
-
-    if ( uiPlane == 0 )
-    {
-      TRenFilter<REN_BIT_DEPTH>::sampleHorDown( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
-    }
-    else
-    {
-      if ( m_bUVUp )
-      {
-        TRenFilter<REN_BIT_DEPTH>::sampleCDownHorDown( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
-      }
-      else
-      {
-        TRenFilter<REN_BIT_DEPTH>::sampleCHorDown    ( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
-      }
-    }
-  }
-
-  if ( bMirror )
-  {
-    TRenFilter<REN_BIT_DEPTH>::mirrorHor( pcConvOutputImage );
-  }
-
-}
-
-Void TRenTop::setShiftLUTs( Double** ppdShiftLUTLeft, Int** ppiShiftLUTLeft, Int** ppiBaseShiftLUTLeft, Double** ppdShiftLUTRight, Int** ppiShiftLUTRight, Int** ppiBaseShiftLUTRight,  Int iRelDistToLeft )
-{
-  m_ppdShiftLUTLeft  = ppdShiftLUTLeft;
-  m_ppdShiftLUTRight = ppdShiftLUTRight;
-
-  m_ppiShiftLUTLeft  = ppiShiftLUTLeft;
-  m_ppiShiftLUTRight = ppiShiftLUTRight;
-
-  if (  m_ppdShiftLUTRight != NULL && m_ppiShiftLUTRight != NULL )
-  {
-    for( UInt uiPlane = 0; uiPlane < 2; uiPlane++)
-    {
-      for (UInt uiDepthValue = 0; uiDepthValue <= 256; uiDepthValue++)
-      {
-        m_ppdShiftLUTRightMirror[uiPlane][uiDepthValue] = - m_ppdShiftLUTRight[uiPlane][uiDepthValue];
-        m_ppiShiftLUTRightMirror[uiPlane][uiDepthValue] = - m_ppiShiftLUTRight[uiPlane][uiDepthValue];
-      }
-    }
-  }
-
-  if ( !m_bExtrapolate )
-  {
-    TRenFilter<REN_BIT_DEPTH>::setupZLUT( m_bBlendUseDistWeight, m_iBlendZThresPerc, iRelDistToLeft, ppiBaseShiftLUTLeft, ppiBaseShiftLUTRight, m_iBlendZThres, m_iBlendDistWeight, m_piInvZLUTLeft, m_piInvZLUTRight);
-  }
-}
-
-Void TRenTop::extrapolateView( TComPicYuv* pcPicYuvVideo, TComPicYuv* pcPicYuvDepth, TComPicYuv* pcPicYuvSynthOut, Bool bRenderFromLeft )
-{
-  AOF( m_bExtrapolate );
-  AOF( bRenderFromLeft ? m_ppiShiftLUTLeft || m_ppdShiftLUTLeft : m_ppiShiftLUTRight || m_ppdShiftLUTRight );
-  AOF( m_auiInputResolution[0] == pcPicYuvVideo->getWidth ( COMPONENT_Y ));
-  AOF( m_auiInputResolution[1] == pcPicYuvVideo->getHeight( COMPONENT_Y ));
-
-  PelImage cInputImage ( pcPicYuvVideo    );
-  PelImage cInputDepth ( pcPicYuvDepth    , true);
-  PelImage cOutputImage( pcPicYuvSynthOut );
-
-  m_pcOutputImage->init();
-  m_pcFilled     ->assign(REN_IS_HOLE);
-
-  xPreProcessDepth ( &cInputDepth,  &cInputDepth);
-  xConvertInputData( &cInputImage, &cInputDepth, m_pcInputImage, m_pcInputDepth, !bRenderFromLeft );
-  xShiftPixels(m_pcInputImage, m_pcInputDepth, m_pcOutputImage, m_pcFilled, bRenderFromLeft);
-  xRemBoundaryNoise ( m_pcOutputImage, m_pcFilled, m_pcOutputImage, bRenderFromLeft); // Erode
-  xFillHoles        ( m_pcOutputImage, m_pcFilled, m_pcOutputImage, bRenderFromLeft);
-  xConvertOutputData( m_pcOutputImage, &cOutputImage, !bRenderFromLeft );
-  xPostProcessImage (&cOutputImage, &cOutputImage);
-  xCutMargin        ( &cOutputImage );
-};
-
-Void TRenTop::getUsedSamplesMap( TComPicYuv* pcPicYuvDepth, TComPicYuv* pcUsedSampleMap, Bool bRenderFromLeft )
-{
-  AOF( bRenderFromLeft ? m_ppiShiftLUTLeft && m_ppdShiftLUTLeft : m_ppiShiftLUTRight && m_ppdShiftLUTRight );
-  AOF(m_auiInputResolution[0] == pcPicYuvDepth->getWidth (COMPONENT_Y));
-  AOF(m_auiInputResolution[1] == pcPicYuvDepth->getHeight(COMPONENT_Y));
-
-  PelImage cInputDepth ( pcPicYuvDepth    , true);
-  PelImage cOutputImage( pcUsedSampleMap );
-  PelImage cInputImage ( m_auiInputResolution[0], m_auiInputResolution[1], 1, 2 );
-  cInputImage.assign(0);
-
-  m_pcFilled     ->assign(REN_IS_HOLE);
-  xConvertInputData(  &cInputImage,  &cInputDepth,   m_pcInputImage,  m_pcInputDepth, !bRenderFromLeft );
-  xShiftPixels     (m_pcInputImage, m_pcInputDepth, m_pcOutputImage, m_pcFilled, bRenderFromLeft);
-
-  xCreateAlphaMap  ( m_pcFilled, m_pcFilled, bRenderFromLeft );
-
-  if ( !bRenderFromLeft )
-  {
-    TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcFilled );
-  }
-
-  TRenFilter<REN_BIT_DEPTH>::filledToUsedPelMap( m_pcFilled, &cOutputImage, m_iUsedPelMapMarExt );
-};
-
-
-Void TRenTop::interpolateView( TComPicYuv* pcPicYuvVideoLeft, TComPicYuv* pcPicYuvDepthLeft, TComPicYuv* pcPicYuvVideoRight, TComPicYuv* pcPicYuvDepthRight, TComPicYuv* pcPicYuvSynthOut, Int iBlendMode, Int iSimEnhBaseView )
-{
-  assert( !m_bExtrapolate );
-  assert( m_auiInputResolution[0] == pcPicYuvVideoLeft ->getWidth ( COMPONENT_Y ) );
-  assert( m_auiInputResolution[1] == pcPicYuvVideoRight->getHeight( COMPONENT_Y ) );
-
-  AOT( iBlendMode == 3);
-  m_iBlendMode = iBlendMode;
-  m_iSimEnhBaseView = iSimEnhBaseView;
-
-  PelImage cLeftInputImage   ( pcPicYuvVideoLeft  );
-  PelImage cLeftInputDepth   ( pcPicYuvDepthLeft,  true );
-  PelImage cRightInputImage  ( pcPicYuvVideoRight );
-  PelImage cRightInputDepth  ( pcPicYuvDepthRight, true );
-  PelImage cOutputImage      ( pcPicYuvSynthOut   );
-
-  m_pcLeftOutputImage ->init();
-  m_pcRightOutputImage->init();
-  m_pcOutputImage     ->init();
-
-  if ( m_iBlendMode == eRenBlendDepthFirst )
-  {
-    m_pcOutputDepth->init();
-  }
-
-  m_pcLeftFilled ->assign(REN_IS_HOLE);
-  m_pcRightFilled->assign(REN_IS_HOLE);
-
-  xPreProcessDepth(&cLeftInputDepth , &cLeftInputDepth );
-  xPreProcessDepth(&cRightInputDepth, &cRightInputDepth);
-
-  xConvertInputData( &cLeftInputImage,  &cLeftInputDepth,  m_pcLeftInputImage,  m_pcLeftInputDepth  ,false );
-  xConvertInputData( &cRightInputImage, &cRightInputDepth, m_pcRightInputImage, m_pcRightInputDepth ,true  );
-
-  // Render from Left View to Right view
-  if ( m_iBlendMode != eRenBlendDepthFirst )
-  {
-    xShiftPixels(m_pcLeftInputImage,  m_pcLeftInputDepth, m_pcLeftOutputImage, m_pcLeftFilled, true );
-    xFillHoles  (m_pcLeftOutputImage, m_pcLeftFilled,     m_pcLeftOutputImage, true );
-  }
-
-  xShiftPixels(m_pcLeftInputDepth,  m_pcLeftInputDepth, m_pcLeftOutputDepth, m_pcLeftFilled, true );
-  xFillHoles     ( m_pcLeftOutputDepth, m_pcLeftFilled,     m_pcLeftOutputDepth, true);
-  xCreateAlphaMap( m_pcLeftFilled,      m_pcLeftFilled,     true );
-
-  // Render from Right View to Left view
-  if ( m_iBlendMode != eRenBlendDepthFirst )
-  {
-    xShiftPixels(m_pcRightInputImage , m_pcRightInputDepth, m_pcRightOutputImage, m_pcRightFilled, false );
-    xFillHoles  (m_pcRightOutputImage, m_pcRightFilled,     m_pcRightOutputImage, false);
-  }
-
-  xShiftPixels(m_pcRightInputDepth,  m_pcRightInputDepth, m_pcRightOutputDepth, m_pcRightFilled, false);
-  xFillHoles     ( m_pcRightOutputDepth, m_pcRightFilled,     m_pcRightOutputDepth, false);
-  xCreateAlphaMap( m_pcRightFilled,      m_pcRightFilled, false );
-
-  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 );
-
-  if ( m_iBlendMode == eRenBlendDepthFirst )
-  {
-    xBlend               ( m_pcLeftOutputDepth,  m_pcRightOutputDepth, m_pcLeftFilled,       m_pcRightFilled, m_pcLeftOutputDepth, m_pcRightOutputDepth, m_pcOutputDepth);
-
-    xBackShiftPixels     ( m_pcLeftInputImage,   m_pcOutputDepth,      m_pcLeftOutputImage,  m_pcLeftFilled  , false);
-    xFillHoles           ( m_pcLeftOutputImage,  m_pcLeftFilled,       m_pcLeftOutputImage, false);
-    xCreateAlphaMap      ( m_pcLeftFilled,       m_pcLeftFilled,       true );
-
-    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<REN_BIT_DEPTH>::mirrorHor( m_pcRightFilled );
-    xCreateAlphaMap      ( m_pcRightFilled,      m_pcRightFilled,      true );
-    TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcRightFilled );
-  }
-
-  xBlend(m_pcLeftOutputImage, m_pcRightOutputImage, m_pcLeftFilled, m_pcRightFilled, m_pcLeftOutputDepth, m_pcRightOutputDepth, m_pcOutputImage);
-  xConvertOutputData( m_pcOutputImage, &cOutputImage , false );
-
-  xPostProcessImage  ( &cOutputImage, &cOutputImage);
-  xCutMargin( &cOutputImage );
-};
-
-
-Void TRenTop::xPreProcessDepth( PelImage* pcInImage, PelImage* pcOutImage )
-{
-  if ( m_iPreProcMode == eRenPreProNone )
-    return;
-
-  PelImage* pcTemp;
-
-  if (pcInImage == pcOutImage)
-  {
-    pcTemp = pcOutImage->create();
-  }
-  else
-  {
-    pcTemp = pcOutImage;
-  }
-
-  pcTemp->assign(pcInImage);
-
-  switch ( m_iPreProcMode )
-  {
-    case eRenPreProBinom:
-      TRenFilter<REN_BIT_DEPTH>::binominal(pcOutImage, pcTemp, m_iPreFilterSize);
-      break;
-    case eRenPreProNone:
-      break;
-    default:
-      assert(0);
-      break;
-  }
-
-  if (pcInImage == pcOutImage)
-  {
-    pcOutImage->setData(pcTemp, true);
-    delete pcTemp;
-  };
-
-}
-
-Void TRenTop::xShiftPlanePixelsLinInt( PelImagePlane** apcInputPlanes, PelImagePlane* pcDepthPlane, PelImagePlane** apcOutputPlanes, PelImagePlane* pcFilledPlane, UInt uiNumberOfPlanes )
-{
-  Int iWidth        = apcInputPlanes[0]->getWidth();
-  Int iHeight       = apcInputPlanes[0]->getHeight();
-
-  Int iInputStride  = apcInputPlanes [0]->getStride();
-  Int iOutputStride = apcOutputPlanes[0]->getStride();
-
-  Int iFilledStride = pcFilledPlane->getStride();
-  Int iDepthStride  = pcDepthPlane ->getStride();
-
-  pcFilledPlane->assign(REN_IS_HOLE);
-
-  Pel** apcInputData  = new Pel*[ uiNumberOfPlanes ];
-  Pel** apcOutputData = new Pel*[ uiNumberOfPlanes ];
-
-  for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-  {
-    apcInputData   [uiCurPlane] = apcInputPlanes [uiCurPlane]->getPlaneData();
-    apcOutputData  [uiCurPlane] = apcOutputPlanes[uiCurPlane]->getPlaneData();
-    assert( iWidth        == apcInputPlanes [uiCurPlane]->getWidth()  && iWidth        == apcOutputPlanes[uiCurPlane]->getWidth() );
-    assert( iHeight       == apcInputPlanes [uiCurPlane]->getHeight() && iHeight       == apcOutputPlanes[uiCurPlane]->getHeight());
-    assert( iInputStride  == apcInputPlanes [uiCurPlane]->getStride() && iOutputStride == apcOutputPlanes[uiCurPlane]->getStride());
-  }
-
-  Pel* pcDepthData  = pcDepthPlane ->getPlaneData();
-  Pel* pcFilledData = pcFilledPlane->getPlaneData();
-
-  for(Int iPosY = 0; iPosY < iHeight; iPosY++)
-  {
-    Int iPrevShiftedPos = -1;
-    Int iShiftedPos = -1;
-
-    for(Int iPosX = 0; iPosX < iWidth; iPosX ++ )
-    {
-      Bool bExtrapolate = false;
-
-      // compute disparity and shift
-      iShiftedPos  = ( iPosX << m_iRelShiftLUTPrec ) - m_aiShiftLUTCur[RemoveBitIncrement( pcDepthData[iPosX])];
-
-      if (iPosX == 0)
-      {
-        // in first iteration only get dLeftPos
-        iPrevShiftedPos = iShiftedPos;
-        continue;
-      };
-
-      Int iDeltaPos = iShiftedPos - iPrevShiftedPos;
-
-      if ( iDeltaPos <= 0 || (iDeltaPos > (2 << m_iRelShiftLUTPrec)))
-      {
-        // skip Interpolation if pixel is shifted forwards (gap) or if  pixel is shifted backwards (foreground object)
-        bExtrapolate = true;
-      };
-
-      Int iInterPolPos;
-      if (!bExtrapolate)
-      {  // Interpolate between j1 and j2
-        for (iInterPolPos = ( iPrevShiftedPos + (1 << m_iRelShiftLUTPrec) - 1 ) >> m_iRelShiftLUTPrec  ; iInterPolPos <= (iShiftedPos >> m_iRelShiftLUTPrec); iInterPolPos++)
-        {
-          if ( (iInterPolPos >= iWidth) || (iInterPolPos < (Int) 0))
-          {
-            // skip Interpolation if Interpolation position is outside frame
-            continue;
-          };
-
-          // Interpolate
-          Int iDeltaCurPos  = (iInterPolPos << m_iRelShiftLUTPrec) - iPrevShiftedPos;
-          for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-          {
-            Pel cVal  = (( apcInputData[uiCurPlane][iPosX - 1] * iDeltaPos +  ( apcInputData[uiCurPlane][iPosX] - apcInputData[uiCurPlane][iPosX - 1] ) * iDeltaCurPos ) / iDeltaPos );
-            apcOutputData[uiCurPlane][iInterPolPos]  = cVal;
-          }
-
-          pcFilledData[iInterPolPos]  = REN_IS_FILLED;
-        }
-      }
-      else
-      { // Extrapolate right from dLeftPos and left from dRightPos
-        Int iShiftedPosCeiled = (( iPrevShiftedPos + (1 << m_iRelShiftLUTPrec) - 1) >> m_iRelShiftLUTPrec ) << m_iRelShiftLUTPrec;
-        if ( (iPrevShiftedPos + (m_iRelShiftLUTPrec >> 1) ) > iShiftedPosCeiled )
-        {
-          iInterPolPos = iShiftedPosCeiled >> m_iRelShiftLUTPrec;
-
-          if ( (iInterPolPos >= iWidth) || (iInterPolPos < (Int) 0))
-          {
-            // skip Interpolation if Interpolation position is outside frame
-            iPrevShiftedPos = iShiftedPos;
-            continue;
-          };
-
-          for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-          {
-            apcOutputData[uiCurPlane][iInterPolPos]  = apcInputData[uiCurPlane][iPosX - 1];
-          }
-
-          pcFilledData[iInterPolPos]  = REN_IS_FILLED;
-        }
-
-        Int iPrevShiftedPosFloor = (iShiftedPos >> m_iRelShiftLUTPrec) << m_iRelShiftLUTPrec;
-        if (iShiftedPos - (m_iRelShiftLUTPrec > 1) < iPrevShiftedPosFloor )
-        {
-          iInterPolPos = iPrevShiftedPosFloor >> m_iRelShiftLUTPrec;
-
-          if ( (iInterPolPos >= iWidth) || (iInterPolPos < (Int) 0))
-          {
-            // skip Interpolation if Interpolation position is outside frame
-            iPrevShiftedPos = iShiftedPos;
-            continue;
-          };
-
-          for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-          {
-            apcOutputData[uiCurPlane][iInterPolPos]  = apcInputData[uiCurPlane][iPosX ];
-          }
-
-          pcFilledData[iInterPolPos]  = REN_IS_FILLED;
-        }
-      }
-      iPrevShiftedPos = iShiftedPos;
-    }
-
-    for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-    {
-      apcOutputData[uiCurPlane] += iOutputStride;
-      apcInputData [uiCurPlane] += iInputStride;
-    }
-    pcFilledData += iFilledStride;
-    pcDepthData  += iDepthStride;
-  }
-  delete[] apcInputData;
-  delete[] apcOutputData;
-};
-
-
-Void TRenTop::xShiftPlanePixelsLinReal( PelImagePlane** apcInputPlanes, PelImagePlane* pcDepthPlane, PelImagePlane** apcOutputPlanes, PelImagePlane* pcFilledPlane, UInt uiNumberOfPlanes )
-{
-  Int iWidth        = apcInputPlanes[0]->getWidth();
-  Int iHeight       = apcInputPlanes[0]->getHeight();
-
-  Int iInputStride  = apcInputPlanes [0]->getStride();
-  Int iOutputStride = apcOutputPlanes[0]->getStride();
-
-  Int iFilledStride = pcFilledPlane->getStride();
-  Int iDepthStride  = pcDepthPlane ->getStride();
-
-  pcFilledPlane->assign( REN_IS_HOLE );
-
-  Pel** apcInputData  = new Pel*[ uiNumberOfPlanes ];
-  Pel** apcOutputData = new Pel*[ uiNumberOfPlanes ];
-
-  for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-  {
-    apcInputData   [uiCurPlane] = apcInputPlanes [uiCurPlane]->getPlaneData();
-    apcOutputData  [uiCurPlane] = apcOutputPlanes[uiCurPlane]->getPlaneData();
-    assert( iWidth        == apcInputPlanes [uiCurPlane]->getWidth()  && iWidth        == apcOutputPlanes[uiCurPlane]->getWidth() );
-    assert( iHeight       == apcInputPlanes [uiCurPlane]->getHeight() && iHeight       == apcOutputPlanes[uiCurPlane]->getHeight());
-    assert( iInputStride  == apcInputPlanes [uiCurPlane]->getStride() && iOutputStride == apcOutputPlanes[uiCurPlane]->getStride());
-  }
-
-  Pel* pcDepthData  = pcDepthPlane ->getPlaneData();
-  Pel* pcFilledData = pcFilledPlane->getPlaneData();
-
-  ///// FEM Stuff /////
-  const UInt  cuiMaxPlaneNum = 6;  AOT( uiNumberOfPlanes > cuiMaxPlaneNum );
-  IntImagePlane* apcDiffPlane[ cuiMaxPlaneNum ];
-  Int*          ppiDiffPlanes[ cuiMaxPlaneNum ];
-  Int             iDiffStride = 0;
-
-  if ( m_iInterpolationMode == eRenIntFEM )
-  {
-    AOT( uiNumberOfPlanes > cuiMaxPlaneNum );
-    for ( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++ )
-    {
-      apcDiffPlane[uiCurPlane] = new IntImagePlane( iWidth, iHeight, apcInputPlanes[uiCurPlane]->getPad());
-      TRenFilter<REN_BIT_DEPTH>::diffHorSym(apcInputPlanes[uiCurPlane] , apcDiffPlane[uiCurPlane]);
-      ppiDiffPlanes[uiCurPlane] = apcDiffPlane[uiCurPlane]->getPlaneData();
-    }
-    iDiffStride = apcDiffPlane[0]->getStride();
-  }
-  ///// FEM Stuff End /////
-
-  for(Int iPosY = 0; iPosY < iHeight; iPosY++)
-  {
-    Double dShiftedPos = 0;
-    Double dPrevShiftedPos = 0;
-
-    for(Int iPosX = 0; iPosX < iWidth; iPosX ++ )
-    {
-        Bool bExtrapolate = false;
-
-        // compute disparity and shift
-        assert( RemoveBitIncrement(pcDepthData[iPosX]) >= 0 && RemoveBitIncrement(pcDepthData[iPosX]) <= 256 );
-        dPrevShiftedPos  = (Double) iPosX - m_adShiftLUTCur[ RemoveBitIncrement(pcDepthData[iPosX])];
-
-        if (iPosX == 0)
-        {
-          // in first iteration only get dLeftPos
-          dShiftedPos = dPrevShiftedPos;
-          continue;
-        };
-
-        Double dDeltaPos = dPrevShiftedPos - dShiftedPos;
-
-        if ((dDeltaPos <= 0) || ( dDeltaPos > 2 ))
-        {
-          // skip Interpolation if pixel is shifted backwards (foreground object)  or if pixel is shifted forwards (gap)
-          bExtrapolate = true;
-        };
-
-        Int iInterPolPos;
-        if (!bExtrapolate)
-        {  // Interpolate between j1 and j2
-          for (iInterPolPos = (Int) ceil(dShiftedPos); iInterPolPos <= floor(dPrevShiftedPos); iInterPolPos++)
-          {
-            if ( (iInterPolPos >= (Int) iWidth) || (iInterPolPos < (Int) 0 ))
-            {
-              // skip Interpolation if Interpolation position is outside frame
-              continue;
-            };
-
-            // Interpolate
-            Pel cVal;
-            if ( m_iInterpolationMode == eRenIntFEM ) //FEM Interpolation
-            {
-              for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-              {
-                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;
-              }
-            }
-            else
-            {
-              Double dDeltaJ  = (Double) iInterPolPos - dShiftedPos;
-
-              for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-              {
-                cVal  = (UChar) ( (Double) apcInputData[uiCurPlane][iPosX - 1] +  ( (Double) apcInputData[uiCurPlane][iPosX] - (Double) apcInputData[uiCurPlane][iPosX - 1] ) / dDeltaPos * dDeltaJ + 0.5);
-                apcOutputData[uiCurPlane][iInterPolPos]  = cVal;
-              }
-            };
-
-            pcFilledData[iInterPolPos]  = REN_IS_FILLED;
-          }
-        }
-        else
-        { // Extrapolate right from dLeftPos and left from dRightPos
-          if (dShiftedPos + 0.5 > ceil(dShiftedPos))
-          {
-            iInterPolPos = (Int) ceil(dShiftedPos);
-
-            if ( (iInterPolPos >= (Int) iWidth) || (iInterPolPos < (Int) 0))
-            {
-              // skip Interpolation if Interpolation position is outside frame
-              dShiftedPos = dPrevShiftedPos;
-              continue;
-            };
-
-            for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-            {
-              apcOutputData[uiCurPlane][iInterPolPos]  = apcInputData[uiCurPlane][iPosX - 1];
-            }
-
-            pcFilledData[iInterPolPos]  = REN_IS_FILLED;
-          }
-
-          if (dPrevShiftedPos - 0.5 < floor(dPrevShiftedPos))
-          {
-            iInterPolPos = (Int) floor(dPrevShiftedPos);
-
-            if ( (iInterPolPos >= (Int) iWidth) || (iInterPolPos < (Int) 0))
-            {
-              // skip Interpolation if Interpolation position is outside frame
-              dShiftedPos = dPrevShiftedPos;
-              continue;
-            };
-
-            for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-            {
-              apcOutputData[uiCurPlane][iInterPolPos]  = apcInputData[uiCurPlane][iPosX ];
-            }
-
-            pcFilledData[iInterPolPos]  = REN_IS_FILLED;
-          }
-        }
-        dShiftedPos = dPrevShiftedPos;
-      }
-
-    for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-    {
-      apcOutputData[uiCurPlane] += iOutputStride;
-      apcInputData [uiCurPlane] += iInputStride;
-
-      if (m_iInterpolationMode ==  eRenIntFEM)
-      {
-        ppiDiffPlanes[ uiCurPlane ] += iDiffStride;
-      }
-    }
-
-    pcFilledData += iFilledStride;
-    pcDepthData  += iDepthStride;
-  }
-
-  if (m_iInterpolationMode ==  eRenIntFEM)
-  {
-    for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-    {
-      delete apcDiffPlane[uiCurPlane];
-    }
-  }
-
-  delete[] apcInputData;
-  delete[] apcOutputData;
-}
-
-
-Void TRenTop::xShiftPlanePixels( PelImagePlane** apcInPlane, PelImagePlane* pcDepthPlane, PelImagePlane** apcOutPlane, PelImagePlane* pcPlaneFilled, UInt uiNumberOfPlanes )
-{
-  switch ( m_iInterpolationMode)
-  {
-  case eRenIntFullPel:
-    xShiftPlanePixelsFullPel( apcInPlane, pcDepthPlane, apcOutPlane, pcPlaneFilled, uiNumberOfPlanes);
-    break;
-  case eRenIntFEM:
-  case eRenIntLinReal:
-    xShiftPlanePixelsLinReal( apcInPlane, pcDepthPlane, apcOutPlane, pcPlaneFilled, uiNumberOfPlanes);
-    break;
-  case eRenIntLinInt:
-    xShiftPlanePixelsLinInt ( apcInPlane, pcDepthPlane, apcOutPlane, pcPlaneFilled, uiNumberOfPlanes);
-    break;
-  case eRenInt8Tap:
-    xShiftPlanePixels8Tap   ( apcInPlane, pcDepthPlane, apcOutPlane, pcPlaneFilled, uiNumberOfPlanes );
-    break;
-  default:
-    AOF( false );
-  }
-}
-
-
-Void TRenTop::xShiftPlanePixelsFullPel( PelImagePlane** apcInputPlanes, PelImagePlane* pcDepthPlane, PelImagePlane** apcOutputPlanes, PelImagePlane* pcFilledPlane, UInt uiNumberOfPlanes )
-{
-  Int iWidth        = apcInputPlanes[0]->getWidth();
-  Int iHeight       = apcInputPlanes[0]->getHeight();
-
-  Int iInputStride  = apcInputPlanes [0]->getStride();
-  Int iOutputStride = apcOutputPlanes[0]->getStride();
-
-  Int iFilledStride = pcFilledPlane->getStride();
-  Int iDepthStride  = pcDepthPlane ->getStride();
-
-  pcFilledPlane->assign(REN_IS_HOLE);
-
-  Pel** apcInputData  = new Pel*[ uiNumberOfPlanes ];
-  Pel** apcOutputData = new Pel*[ uiNumberOfPlanes ];
-
-  for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-  {
-    apcInputData   [uiCurPlane] = apcInputPlanes [uiCurPlane]->getPlaneData();
-    apcOutputData  [uiCurPlane] = apcOutputPlanes[uiCurPlane]->getPlaneData();
-    assert( iWidth        == apcInputPlanes [uiCurPlane]->getWidth()  && iWidth        == apcOutputPlanes[uiCurPlane]->getWidth() );
-    assert( iHeight       == apcInputPlanes [uiCurPlane]->getHeight() && iHeight       == apcOutputPlanes[uiCurPlane]->getHeight());
-    assert( iInputStride  == apcInputPlanes [uiCurPlane]->getStride() && iOutputStride == apcOutputPlanes[uiCurPlane]->getStride());
-  }
-
-  Pel* pcDepthData  = pcDepthPlane ->getPlaneData();
-  Pel* pcFilledData = pcFilledPlane->getPlaneData();
-
-  for(Int iPosY = 0; iPosY < iHeight; iPosY++)
-  {
-    Int iPrevShiftedPos = -1;
-
-    for(Int iPosX = 0; iPosX < iWidth; iPosX++)
-    {
-      assert( RemoveBitIncrement(pcDepthData[iPosX]) >= 0 && RemoveBitIncrement(pcDepthData[iPosX]) <= 256 );
-      Int iShiftedPos = iPosX - m_aiShiftLUTCur[ RemoveBitIncrement(pcDepthData[iPosX])] ;
-      if (iShiftedPos < iWidth && iShiftedPos >= 0)
-      {
-        Int iDiff = iShiftedPos - iPrevShiftedPos;
-        if (( iDiff <= 2) && (iDiff > 0) )
-        {
-          for (Int iCurPos = iPrevShiftedPos+1; iCurPos <= iShiftedPos; iCurPos++)
-          {
-            for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-            {
-              apcOutputData[uiCurPlane][iCurPos] = apcInputData[uiCurPlane][iPosX];    // Only small gaps, therefor not necessary NN
-            }
-            pcFilledData[iCurPos] = REN_IS_FILLED;
-          }
-        }
-        else
-        {
-          for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-          {
-            apcOutputData[uiCurPlane][iShiftedPos] = apcInputData[uiCurPlane][iPosX];
-          }
-          pcFilledData[iShiftedPos] = REN_IS_FILLED;
-        }
-        iPrevShiftedPos = iShiftedPos;
-      }
-    }
-    for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-    {
-      apcOutputData[uiCurPlane] += iOutputStride;
-      apcInputData [uiCurPlane] += iInputStride;
-    }
-    pcFilledData += iFilledStride;
-    pcDepthData  += iDepthStride;
-  }
-
-  delete[] apcInputData;
-  delete[] apcOutputData;
-}
-
-Void TRenTop::xBackShiftPlanePixels( PelImagePlane** apcInputPlanes, PelImagePlane* pcDepthPlane, PelImagePlane** apcOutputPlanes, PelImagePlane* pcFilledPlane, UInt uiNumberOfPlanes )
-{
-  Int iOutputWidth  = apcOutputPlanes[0]->getWidth();
-  Int iInputWidth   = apcInputPlanes [0]->getWidth();
-  Int iHeight       = apcInputPlanes [0]->getHeight();
-
-  Int iInputStride  = apcInputPlanes [0]->getStride();
-  Int iOutputStride = apcOutputPlanes[0]->getStride();
-
-  Int iFilledStride = pcFilledPlane->getStride();
-  Int iDepthStride  = pcDepthPlane ->getStride();
-
-  Pel** apcInputData  = new Pel*[ uiNumberOfPlanes ];
-  Pel** apcOutputData = new Pel*[ uiNumberOfPlanes ];
-
-  Int iStep         = (1 << m_iRelShiftLUTPrec);
-
-  for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-  {
-    apcInputData   [uiCurPlane] = apcInputPlanes [uiCurPlane]->getPlaneData();
-    apcOutputData  [uiCurPlane] = apcOutputPlanes[uiCurPlane]->getPlaneData();
-    AOF( iInputWidth   == apcInputPlanes [uiCurPlane]->getWidth()  && iOutputWidth  == apcOutputPlanes[uiCurPlane]->getWidth() );
-    AOF( iHeight       == apcInputPlanes [uiCurPlane]->getHeight() && iHeight       == apcOutputPlanes[uiCurPlane]->getHeight());
-    AOF( iInputStride  == apcInputPlanes [uiCurPlane]->getStride() && iOutputStride == apcOutputPlanes[uiCurPlane]->getStride());
-    AOF( iInputWidth   == iOutputWidth * iStep );
-  }
-
-  Pel* pcDepthData  = pcDepthPlane ->getPlaneData();
-  Pel* pcFilledData = pcFilledPlane->getPlaneData();
-
-
-  for(Int iPosY = 0; iPosY < iHeight; iPosY++)
-  {
-    for(Int iPosX = 0; iPosX < iOutputWidth; iPosX ++)
-    {
-      Int iBackShiftedPos = (iPosX << m_iRelShiftLUTPrec) - m_aiShiftLUTCur[ RemoveBitIncrement( pcDepthData[iPosX] )];
-      if( ( pcFilledData[iPosX] == REN_IS_FILLED )  && (iBackShiftedPos >= 0 ) && ( iBackShiftedPos < iInputWidth ) )
-      {
-        for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-        {
-          apcOutputData[uiCurPlane][iPosX] = apcInputData[uiCurPlane][iBackShiftedPos];
-        }
-      }
-      else
-      {
-        for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-        {
-          apcOutputData[uiCurPlane][iPosX] = 0;
-        }
-        pcFilledData[iPosX] = REN_IS_HOLE;
-      }
-    }
-
-    for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-    {
-      apcOutputData[uiCurPlane] += iOutputStride;
-      apcInputData [uiCurPlane] += iInputStride;
-    }
-    pcFilledData += iFilledStride;
-    pcDepthData  += iDepthStride;
-  }
-
-  delete[] apcInputData;
-  delete[] apcOutputData;
-}
-
-Void TRenTop::xShiftPlanePixels8Tap( PelImagePlane** apcInputPlanes, PelImagePlane* pcDepthPlane, PelImagePlane** apcOutputPlanes, PelImagePlane* pcFilledPlane, UInt uiNumberOfPlanes  )
-{
-  Bool bRenderDepth = (apcInputPlanes[0] == pcDepthPlane);
-
-  Int iOutputWidth  = apcOutputPlanes[0]->getWidth();
-  Int iInputWidth   = apcInputPlanes [0]->getWidth();
-  Int iHeight       = apcInputPlanes [0]->getHeight();
-
-  Int iInputStride  = apcInputPlanes [0]->getStride();
-  Int iOutputStride = apcOutputPlanes[0]->getStride();
-
-  Int iFilledStride = pcFilledPlane->getStride();
-  Int iDepthStride  = pcDepthPlane ->getStride();
-
-  Int iStep         = (1 << m_iRelShiftLUTPrec);
-
-  pcFilledPlane->assign(REN_IS_HOLE);
-
-  Pel** apcInputData  = new Pel*[ uiNumberOfPlanes ];
-  Pel** apcOutputData = new Pel*[ uiNumberOfPlanes ];
-
-  for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-  {
-    apcInputData   [uiCurPlane] = apcInputPlanes [uiCurPlane]->getPlaneData();
-    apcOutputData  [uiCurPlane] = apcOutputPlanes[uiCurPlane]->getPlaneData();
-    AOF( iInputWidth   == apcInputPlanes [uiCurPlane]->getWidth()  && iOutputWidth  == apcOutputPlanes[uiCurPlane]->getWidth() );
-    AOF( iHeight       == apcInputPlanes [uiCurPlane]->getHeight() && iHeight       == apcOutputPlanes[uiCurPlane]->getHeight());
-    AOF( iInputStride  == apcInputPlanes [uiCurPlane]->getStride() && iOutputStride == apcOutputPlanes[uiCurPlane]->getStride());
-    AOF( iInputWidth   == iOutputWidth * iStep );
-  }
-
-  Pel* pcDepthData  = pcDepthPlane ->getPlaneData();
-  Pel* pcFilledData = pcFilledPlane->getPlaneData();
-
-  for(Int iPosY = 0; iPosY < iHeight; iPosY++)
-  {
-    Int iPrevShiftedPos = -1;
-    Int iShiftedPos     = -1;
-
-    for(Int iPosX = 0; iPosX < iInputWidth; iPosX += iStep )
-    {
-      // compute disparity and shift
-      iShiftedPos  =  iPosX - m_aiShiftLUTCur[RemoveBitIncrement(pcDepthData[iPosX])];
-
-      if ( iPosX == 0 )
-      {
-        // in first iteration only get dLeftPos
-        iPrevShiftedPos = iShiftedPos;
-        continue;
-      };
-
-      Int iDeltaPos = iShiftedPos - iPrevShiftedPos;
-
-      Bool bDisocclusion = ( iDeltaPos > (2 << m_iRelShiftLUTPrec) );
-      Bool bOcclusion    = ( iDeltaPos <= 0 );
-
-      Int iInterPolPos;
-      if ( !bDisocclusion && !bOcclusion )
-      {  // Interpolate between previous shifted pos and shifted pos
-        for (iInterPolPos = xCeil( iPrevShiftedPos ); iInterPolPos <= xCeil (iShiftedPos ) -1 ; iInterPolPos++)
-        {
-          if ( (iInterPolPos < (Int) 0) || (iInterPolPos >= iOutputWidth))
-          {
-            // skip Interpolation if Interpolation position is outside frame
-            continue;
-          };
-
-          // Interpolate
-          Int iDeltaCurPos  = (iInterPolPos << m_iRelShiftLUTPrec) - iPrevShiftedPos;
-
-          AOF( (iDeltaCurPos <= iDeltaPos) && ( iDeltaCurPos >= 0));
-          AOF( iDeltaPos    <= (2 <<  m_iRelShiftLUTPrec)  );
-          AOF( m_aaiSubPelShift[iDeltaPos][iDeltaCurPos] != 0xdeaddead);
-
-          Int iSourcePos;
-
-          if ( bRenderDepth )
-          {
-            iSourcePos = iPosX - iStep; // Render depth with Full Pel accuracy to avoid ringing at sharp depth edges;
-          }
-          else
-          {
-            iSourcePos = iPosX +  m_aaiSubPelShift[iDeltaPos][iDeltaCurPos];   // GT:  = iPosX - iStep + ( iStep * iDeltaCurPos + ( iDeltaPos >> 1) ) / iDeltaPos;
-          }
-
-          for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-          {
-            apcOutputData[uiCurPlane][iInterPolPos] = apcInputData[uiCurPlane][iSourcePos];
-          }
-
-          pcFilledData[ iInterPolPos]  = REN_IS_FILLED;
-        }
-      }
-      else
-        {
-        // Fill Disocclusion Edge
-
-        if ( bDisocclusion )
-        {
-          Int iPrevShiftedPosCeiled =  xCeil(iPrevShiftedPos) << m_iRelShiftLUTPrec;
-          iInterPolPos = iPrevShiftedPosCeiled >> m_iRelShiftLUTPrec;
-
-          if ((iPrevShiftedPos + (iStep >> 1) ) > iPrevShiftedPosCeiled )
-          {
-            if ( !((iInterPolPos < (Int) 0) || (iInterPolPos >= iOutputWidth)))
-            {
-
-              for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-              {
-                apcOutputData[uiCurPlane][iInterPolPos]  = apcInputData[uiCurPlane][iPosX - iStep];
-              }
-              pcFilledData[iInterPolPos]  = REN_IS_FILLED;
-
-            }           
-            iInterPolPos++;
-          }          
-
-          // Fill Disocclusion
-          if ( m_bInstantHoleFilling )
-          {
-            for ( ; iInterPolPos <= xCeil (iShiftedPos ) -1 ; iInterPolPos++)
-            {
-              if ( ( iInterPolPos >= 0 ) && ( iInterPolPos < iOutputWidth ) )
-              {
-                if( pcFilledData[iInterPolPos] == REN_IS_HOLE )
-                {               
-                  Int iNextPos = std::min(iInputWidth-1,iPosX + iStep); 
-                  Int iPosXBG  = ( std::abs( pcDepthData[iNextPos] - pcDepthData[iPosX] ) > 5  ) ? iPosX : iNextPos; 
-                  for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-                  {
-                    apcOutputData[uiCurPlane][iInterPolPos]  = apcInputData[uiCurPlane][iPosXBG];
-                  }
-                }
-                else
-                {
-                  pcFilledData[iInterPolPos] = REN_IS_HOLE + 1; 
-                }
-              }
-            }
-          }
-        }
-
-        //// Last sample next to occlusion
-        Int iShiftedPosFloor = ( iShiftedPos >> m_iRelShiftLUTPrec ) << m_iRelShiftLUTPrec;
-        if ( bOcclusion && (iShiftedPos - (iStep >> 1) < iShiftedPosFloor) )
-        {
-          iInterPolPos = iShiftedPosFloor >> m_iRelShiftLUTPrec;
-          if ( !((iInterPolPos < (Int) 0) || (iInterPolPos >= iOutputWidth)))
-          {        
-            for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-            {
-              apcOutputData[uiCurPlane][iInterPolPos]  = apcInputData[uiCurPlane][iPosX ];
-            }
-
-            pcFilledData[iInterPolPos]  = REN_IS_FILLED;
-          }
-        }
-      }
-      iPrevShiftedPos = iShiftedPos;
-    }
-
-    for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-    {
-      apcOutputData[uiCurPlane] += iOutputStride;
-      apcInputData [uiCurPlane] += iInputStride;
-    }
-    pcFilledData += iFilledStride;
-    pcDepthData  += iDepthStride;
-  }
-  delete[] apcInputData;
-  delete[] apcOutputData;
-};
-
-Void TRenTop::xShiftPixels(PelImage* pcInImage, PelImage* pcDepth, PelImage* pcOutImage, PelImage* pcFilledImage, Bool bShiftFromLeft )
-{
-  PelImage*  pcTemp = 0;
-
-  if (pcInImage == pcOutImage)
-  {
-    pcTemp = pcOutImage->create();
-  }
-  else
-  {
-    pcTemp = pcOutImage;
-  }
-
-  Double ** ppdShiftLUT = bShiftFromLeft ? m_ppdShiftLUTLeft : m_ppdShiftLUTRightMirror;
-  Int    ** ppiShiftLUT = bShiftFromLeft ? m_ppiShiftLUTLeft : m_ppiShiftLUTRightMirror;
-
-  UInt uiNumFullPlanes = pcInImage->getNumberOfFullPlanes();
-  UInt uiNumQuatPlanes = pcInImage->getNumberOfQuaterPlanes();
-
-  assert( uiNumFullPlanes == pcOutImage->getNumberOfFullPlanes  () );
-  assert( uiNumQuatPlanes == pcOutImage->getNumberOfQuaterPlanes() );
-
-  m_aiShiftLUTCur = ppiShiftLUT[ 0 ];
-  m_adShiftLUTCur = ppdShiftLUT[ 0 ];
-
-  xShiftPlanePixels( pcInImage->getPlanes(), pcDepth->getPlane(0),  pcOutImage->getPlanes(), pcFilledImage->getPlane(0),  uiNumFullPlanes  );
-
-  if (uiNumQuatPlanes > 0)
-  {
-    assert( pcDepth->getNumberOfPlanes() > 1 && pcFilledImage->getNumberOfPlanes() > 1);
-    m_aiShiftLUTCur = ppiShiftLUT[ 1 ];
-    m_adShiftLUTCur = ppdShiftLUT[ 1 ];
-    xShiftPlanePixels( pcInImage->getPlanes()+uiNumFullPlanes,pcDepth->getPlane(1),  pcOutImage->getPlanes() + uiNumFullPlanes, pcFilledImage->getPlane(1),  uiNumQuatPlanes );
-  }
-
-  if (pcInImage == pcOutImage)
-  {
-    pcOutImage->assign(pcTemp);
-    delete pcTemp;
-  };
-};
-
-Void TRenTop::xBackShiftPixels(PelImage* pcInImage, PelImage* pcDepth, PelImage* pcOutImage, PelImage* pcFilledImage, Bool bShiftFromLeft )
-{
-  PelImage*  pcTemp = 0;
-
-  if (pcInImage == pcOutImage)
-  {
-    pcTemp = pcOutImage->create();
-  }
-  else
-  {
-    pcTemp = pcOutImage;
-  }
-
-  Double ** ppdShiftLUT = bShiftFromLeft ? m_ppdShiftLUTLeft : m_ppdShiftLUTRight;
-  Int    ** ppiShiftLUT = bShiftFromLeft ? m_ppiShiftLUTLeft : m_ppiShiftLUTRight;
-
-  UInt uiNumFullPlanes = pcInImage->getNumberOfFullPlanes();
-  UInt uiNumQuatPlanes = pcInImage->getNumberOfQuaterPlanes();
-
-  assert( uiNumFullPlanes == pcOutImage->getNumberOfFullPlanes  () );
-  assert( uiNumQuatPlanes == pcOutImage->getNumberOfQuaterPlanes() );
-
-  m_aiShiftLUTCur = ppiShiftLUT[ 0 ];
-  m_adShiftLUTCur = ppdShiftLUT[ 0 ];
-
-  xBackShiftPlanePixels( pcInImage->getPlanes(), pcDepth->getPlane(0),  pcOutImage->getPlanes(), pcFilledImage->getPlane(0),  uiNumFullPlanes  );
-
-  if (uiNumQuatPlanes > 0)
-  {
-    assert( pcDepth->getNumberOfPlanes() > 1 && pcFilledImage->getNumberOfPlanes() > 1);
-    m_aiShiftLUTCur = ppiShiftLUT[ 1 ];
-    m_adShiftLUTCur = ppdShiftLUT[ 1 ];
-    xBackShiftPlanePixels( pcInImage->getPlanes()+uiNumFullPlanes,pcDepth->getPlane(1),  pcOutImage->getPlanes() + uiNumFullPlanes, pcFilledImage->getPlane(1),  uiNumQuatPlanes );
-  }
-
-  if (pcInImage == pcOutImage)
-  {
-    pcOutImage->assign(pcTemp);
-    delete pcTemp;
-  };
-};
-
-Void TRenTop::xFillHoles(PelImage* pcInImage, PelImage* pcFilled, PelImage* pcOutImage, Bool bRenderFromLeft )
-{
-  if (pcInImage != pcOutImage)
-  {
-    pcOutImage->assign(pcInImage);
-  }
-
-  switch (m_iHoleFillingMode)
-  {
-    case eRenHFNone:
-      break;
-    case eRenHFLWBackExt:
-      xFillLWBackExt( pcInImage, pcFilled, pcOutImage, bRenderFromLeft);
-      break;
-    default:
-      break;
-  }
-};
-
-Void TRenTop::xFillLWBackExt( PelImage* pcInImage, PelImage* pcFilledImage, PelImage* pcOutImage, Bool bRenderFromLeft )
-{
-  UInt uiNumFullPlanes = pcInImage->getNumberOfFullPlanes();
-  UInt uiNumQuatPlanes = pcInImage->getNumberOfQuaterPlanes();
-
-  assert( uiNumFullPlanes == pcOutImage->getNumberOfFullPlanes  () );
-  assert( uiNumQuatPlanes == pcOutImage->getNumberOfQuaterPlanes() );
-
-  xFillPlaneHoles( pcInImage->getPlanes(), pcFilledImage->getPlane(0), pcOutImage->getPlanes(),  uiNumFullPlanes, bRenderFromLeft  );
-
-  if (uiNumQuatPlanes > 0)
-  {
-    assert(  pcFilledImage->getNumberOfPlanes() > 1);
-    xFillPlaneHoles( pcInImage->getPlanes()+uiNumFullPlanes, pcFilledImage->getPlane(1), pcOutImage->getPlanes() + uiNumFullPlanes,  uiNumQuatPlanes, bRenderFromLeft );
-  }
-};
-
-Void TRenTop::xCreateAlphaMap(PelImage* pcFilledImage, PelImage* pcAlphaMapImage, Bool bRenderFromLeft )
-{
-  UInt uiNumFullPlanes = pcFilledImage  ->getNumberOfFullPlanes();
-  UInt uiNumQuatPlanes = pcFilledImage->getNumberOfQuaterPlanes();
-
-  AOF( uiNumFullPlanes == pcAlphaMapImage->getNumberOfFullPlanes  () );
-  AOF( uiNumQuatPlanes == pcAlphaMapImage->getNumberOfQuaterPlanes() );
-
-  xCreateAlphaMapPlane( pcFilledImage->getPlanes(),  pcAlphaMapImage->getPlanes(),  uiNumFullPlanes, bRenderFromLeft  );
-
-  if (uiNumQuatPlanes > 0)
-  {
-    AOF(  pcFilledImage->getNumberOfPlanes() > 1);
-    xCreateAlphaMapPlane( pcFilledImage->getPlanes()+ uiNumFullPlanes, pcAlphaMapImage->getPlanes()+uiNumFullPlanes,  uiNumQuatPlanes, bRenderFromLeft );
-  }
-};
-
-Void TRenTop::xCreateAlphaMapPlane(PelImagePlane** apcFilledPlanes,  PelImagePlane** apcAlphaPlanes,  UInt uiNumberOfPlanes, Bool bRenderFromLeft)
-{
-  Int iWidth            = apcFilledPlanes [0]->getWidth();
-  Int iHeight           = apcFilledPlanes [0]->getHeight();
-
-  for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-  {
-    AOF( iWidth         == apcFilledPlanes [uiCurPlane]->getWidth()  && iWidth        == apcAlphaPlanes[uiCurPlane]->getWidth() );
-    AOF( iHeight        == apcFilledPlanes [uiCurPlane]->getHeight() && iHeight       == apcAlphaPlanes[uiCurPlane]->getHeight());
-  }
-
-  Int iBlendWidth  = m_iBlendHoleMargin;
-  Int iMaxBlendLevel;
-
-  if (!m_bBlendUseDistWeight )
-  {
-    iMaxBlendLevel = ( 1 <<  REN_VDWEIGHT_PREC ) ;
-
-    if ( m_iBlendMode == 0)
-    {
-      iMaxBlendLevel >>= 1;
-    }
-  }
-  else
-  {
-    if ( m_iBlendMode == 0)
-    {
-      iMaxBlendLevel = bRenderFromLeft ? (1 << REN_VDWEIGHT_PREC) - m_iBlendDistWeight :  m_iBlendDistWeight;
-    }
-    else
-    {
-      iMaxBlendLevel  = ( 1 <<  REN_VDWEIGHT_PREC );
-    }
-  }
-
-  Int iWeightStep = (iBlendWidth > 0) ? ( iMaxBlendLevel + (iBlendWidth >> 1) ) / iBlendWidth : 0;
-
-  for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-  {
-    Int iFilledStride   = apcFilledPlanes [uiCurPlane]->getStride();
-    Int iAlphaStride    = apcAlphaPlanes  [uiCurPlane]->getStride();
-
-    Pel* pcFilledData = apcFilledPlanes   [uiCurPlane]->getPlaneData();
-    Pel* pcAlphaData  = apcAlphaPlanes    [uiCurPlane]->getPlaneData();
-
-    for(Int iYPos = 0; iYPos < iHeight; iYPos++)
-    {
-      for(Int iXPos = 0 ; iXPos < iWidth; iXPos++ )
-      {
-        if (pcFilledData[iXPos] == REN_IS_HOLE)
-        {
-          while( (pcFilledData[iXPos] == REN_IS_HOLE) && (iXPos < iWidth) )
-          {
-            pcAlphaData[iXPos] = REN_IS_HOLE;
-            iXPos++;
-          }
-
-          if ( iXPos >= iWidth )
-            continue;
-
-          Int iWeight = 0;
-          Int iLastFillPos = iXPos + iBlendWidth;
-
-          while( (pcFilledData[iXPos] != REN_IS_HOLE) && (iXPos < iWidth) && (iXPos < iLastFillPos) )
-          {
-            AOF(  iWeight <= (1 << REN_VDWEIGHT_PREC) );
-            pcAlphaData[iXPos]  = (iWeight == 0) ? 1 : iWeight;
-            iWeight += iWeightStep;
-            iXPos++;
-          }
-        }
-        else
-        {
-          pcAlphaData[iXPos] = pcFilledData[iXPos];
-        }
-      }
-      pcAlphaData    += iAlphaStride;
-      pcFilledData   += iFilledStride;
-    }
-  }
-}
-
-Void TRenTop::xRemBoundaryNoise(PelImage* pcInImage, PelImage* pcFilledImage, PelImage* pcOutImage, Bool bRenderFromLeft )
-{
-  if (pcInImage != pcOutImage)
-  {
-    pcOutImage->assign(pcInImage);
-  }
-
-  UInt uiNumFullPlanes = pcInImage->getNumberOfFullPlanes();
-  UInt uiNumQuatPlanes = pcInImage->getNumberOfQuaterPlanes();
-
-  AOF( uiNumFullPlanes == pcOutImage->getNumberOfFullPlanes  () );
-  AOF( uiNumQuatPlanes == pcOutImage->getNumberOfQuaterPlanes() );
-
-  xRemBoundaryNoisePlane( pcInImage->getPlanes(), pcFilledImage->getPlane(0), pcOutImage->getPlanes(),  uiNumFullPlanes, bRenderFromLeft  );
-
-  if (uiNumQuatPlanes > 0)
-  {
-    AOF(  pcFilledImage->getNumberOfPlanes() > 1);
-    xRemBoundaryNoisePlane( pcInImage->getPlanes()+uiNumFullPlanes, pcFilledImage->getPlane(1), pcOutImage->getPlanes() + uiNumFullPlanes,  uiNumQuatPlanes, bRenderFromLeft );
-  }
-};
-
-Void TRenTop::xRemBoundaryNoisePlane(PelImagePlane** apcInputPlanes,  PelImagePlane* pcFilledPlane, PelImagePlane** apcOutputPlanes, UInt uiNumberOfPlanes, Bool bRenderFromLeft)
-{
-  Int iWidth        = apcOutputPlanes[0]->getWidth();
-  Int iHeight       = apcInputPlanes [0]->getHeight();
-
-  Int iInputStride  = apcInputPlanes [0]->getStride();
-  Int iOutputStride = apcOutputPlanes[0]->getStride();
-
-  Int iFilledStride = pcFilledPlane->getStride();
-
-  Pel** apcInputData  = new Pel*[ uiNumberOfPlanes ];
-  Pel** apcOutputData = new Pel*[ uiNumberOfPlanes ];
-  Pel*   pcFilledData = pcFilledPlane->getPlaneData();
-
-  for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-  {
-    apcInputData   [uiCurPlane] = apcInputPlanes [uiCurPlane]->getPlaneData();
-    apcOutputData  [uiCurPlane] = apcOutputPlanes[uiCurPlane]->getPlaneData();
-    AOF( iWidth        == apcInputPlanes [uiCurPlane]->getWidth()  && iWidth        == apcOutputPlanes[uiCurPlane]->getWidth() );
-    AOF( iHeight       == apcInputPlanes [uiCurPlane]->getHeight() && iHeight       == apcOutputPlanes[uiCurPlane]->getHeight());
-    AOF( iInputStride  == apcInputPlanes [uiCurPlane]->getStride() && iOutputStride == apcOutputPlanes[uiCurPlane]->getStride());
-  }
-
-  Int iRemovalWidth  = m_iBlendHoleMargin;
-  AOT(iRemovalWidth > 6);  // GT: insufficent padding
-
-  for(Int iYPos = 0; iYPos < iHeight; iYPos++)
-  {
-    for(Int iXPos = iWidth-1; iXPos >= 0; iXPos-- )
-    {
-      if (pcFilledData[iXPos] == REN_IS_HOLE)
-      {
-        Int iSourcePos = iXPos + 1;
-
-        // Get New Value
-        while( (pcFilledData[iSourcePos] != REN_IS_HOLE) && ( iSourcePos < iWidth) && ( iSourcePos < iXPos + iRemovalWidth  ) ) iSourcePos++;
-
-        if (iSourcePos == iWidth || pcFilledData[iSourcePos] != REN_IS_HOLE )
-          iSourcePos--;
-
-        Int iXPosRem = iSourcePos - 1;
-
-        // Remove
-        while( iXPosRem > iXPos)
-        {
-          for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-          {
-            apcOutputData[uiCurPlane][iXPosRem] = apcInputData[uiCurPlane][iSourcePos];
-          }
-
-          iXPosRem--;
-        }
-
-        // Skip Hole
-        while( (pcFilledData[iXPos] == REN_IS_HOLE) && ( iXPos > 0) ) iXPos--;
-      }
-    }
-
-    for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-    {
-      apcOutputData[uiCurPlane] += iOutputStride;
-      apcInputData [uiCurPlane] += iInputStride;
-    }
-    pcFilledData += iFilledStride;
-  }
-  delete[] apcInputData;
-  delete[] apcOutputData;
-}
-
-Void TRenTop::xFillPlaneHoles(PelImagePlane** apcInputPlanes,  PelImagePlane* pcFilledPlane, PelImagePlane** apcOutputPlanes, UInt uiNumberOfPlanes, Bool bRenderFromLeft)
-{
-  Int iWidth        = apcOutputPlanes[0]->getWidth();
-  Int iHeight       = apcInputPlanes [0]->getHeight();
-
-  Int iInputStride  = apcInputPlanes [0]->getStride();
-  Int iOutputStride = apcOutputPlanes[0]->getStride();
-
-  Int iFilledStride = pcFilledPlane->getStride();
-
-  Pel** apcInputData  = new Pel*[ uiNumberOfPlanes ];
-  Pel** apcOutputData = new Pel*[ uiNumberOfPlanes ];
-  Pel*   pcFilledData = pcFilledPlane->getPlaneData();
-
-  for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-  {
-    apcInputData   [uiCurPlane] = apcInputPlanes [uiCurPlane]->getPlaneData();
-    apcOutputData  [uiCurPlane] = apcOutputPlanes[uiCurPlane]->getPlaneData();
-    AOF( iWidth        == apcInputPlanes [uiCurPlane]->getWidth()  && iWidth        == apcOutputPlanes[uiCurPlane]->getWidth() );
-    AOF( iHeight       == apcInputPlanes [uiCurPlane]->getHeight() && iHeight       == apcOutputPlanes[uiCurPlane]->getHeight());
-    AOF( iInputStride  == apcInputPlanes [uiCurPlane]->getStride() && iOutputStride == apcOutputPlanes[uiCurPlane]->getStride());
-  }
-
-  for(Int iYPos = 0; iYPos < iHeight; iYPos++)
-  {
-    if ( !m_bInstantHoleFilling )
-    {
-    for(Int iXPos = 0 ; iXPos < iWidth; iXPos++ )
-    {
-      if (pcFilledData[iXPos] == REN_IS_HOLE)
-      {
-          Int iSourcePos;
-          Int iLastFillPos;
-
-        Int iXPosSearch = iXPos;
-        while( (pcFilledData[iXPosSearch] == REN_IS_HOLE) && (iXPosSearch < iWidth) ) iXPosSearch++;
-
-          if ( iXPosSearch >= iWidth )
-        {
-            continue;
-          }
-          else
-          {
-            iSourcePos   = iXPosSearch;
-            iLastFillPos = iXPosSearch-1;
-          }
-
-        while( iXPos <= iLastFillPos)
-        {
-          for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-          {
-            apcOutputData[uiCurPlane][iXPos] = apcInputData[uiCurPlane][iSourcePos];
-          }
-          iXPos++;
-        }
-        }
-      }
-    }
-
-    // Fill Right Gap
-    Int iXPosSearch = iWidth -1;
-    while( (pcFilledData[iXPosSearch] == REN_IS_HOLE) && (iXPosSearch >= 0) ) iXPosSearch--;
-    if ( iXPosSearch < 0) iXPosSearch++;
-
-    Int iSourcePos = iXPosSearch;
-
-    for( Int iXPos = iSourcePos + 1; iXPos <  iWidth; iXPos++)
-    {
-      for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-      {
-        apcOutputData[uiCurPlane][iXPos] = apcInputData[uiCurPlane][iSourcePos];
-      }
-    }
-
-    // Fill Left Gap
-    iXPosSearch = 0;
-    while( (pcFilledData[iXPosSearch] == REN_IS_HOLE) && (iXPosSearch < iWidth) ) iXPosSearch++;
-    if ( iXPosSearch >= iWidth) iXPosSearch--;
-
-    iSourcePos = iXPosSearch;
-
-    for( Int iXPos = iSourcePos - 1; iXPos >= 0; iXPos--)
-    {
-      for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-      {
-        apcOutputData[uiCurPlane][iXPos] = apcInputData[uiCurPlane][iSourcePos];
-      }
-    }
-
-    // Go to next line
-    for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
-    {
-      apcOutputData[uiCurPlane] += iOutputStride;
-      apcInputData [uiCurPlane] += iInputStride;
-    }
-    pcFilledData += iFilledStride;
-  }
-  delete[] apcInputData;
-  delete[] apcOutputData;
-}
-
-Void TRenTop::xPostProcessImage(PelImage* pcInImage, PelImage* pcOutImage)
-{
-  if ( m_iPostProcMode == eRenPostProNone )
-    return;
-
-  PelImage* pcTemp;
-
-  if (pcInImage == pcOutImage)
-  {
-    pcTemp = pcOutImage->create();
-  }
-  else
-  {
-    pcTemp = pcOutImage;
-  }
-
-  pcTemp->assign(pcInImage);
-
-  switch ( m_iPostProcMode )
-  {
-  case eRenPostProMed:
-    TRenFilter<REN_BIT_DEPTH>::lineMedian3(pcTemp);
-    break;
-  case eRenPostProNone:
-    break;
-  default:
-    assert(0);
-  }
-
-  if (pcInImage == pcOutImage)
-  {
-    pcOutImage->assign(pcTemp);
-    delete pcTemp;
-  };
-}
-
-
-Void TRenTop::xCutPlaneMargin( PelImagePlane* pcImagePlane, Pel cFill, UInt uiScale )
-{
-  UInt uiWidth  = pcImagePlane->getWidth();
-  UInt uiHeight = pcImagePlane->getHeight();
-
-  UInt uiStride    = pcImagePlane->getStride();
-  Pel* pcPlaneData = pcImagePlane->getPlaneData();
-
-  UInt uiCutLeft  =           m_auiCut[0] / uiScale;
-  UInt uiCutRight = uiWidth - m_auiCut[1] / uiScale;
-
-  for(UInt uiYPos = 0; uiYPos < uiHeight; uiYPos++)
-  {
-    for(UInt uiXPos = 0; uiXPos < (UInt) uiWidth ; uiXPos++)
-    {
-      if ( ( uiXPos < uiCutLeft  )  || (  uiXPos >=  uiCutRight )  )
-      {
-        pcPlaneData[uiXPos ] = cFill;
-      }
-    }
-    pcPlaneData += uiStride;
-  }
-};
-
-Void TRenTop::xCutMargin( PelImage* pcInputImage )
-{
-  if  ( ( m_auiCut[0] == 0 ) && ( m_auiCut[1] == 0 ) )
-  {
-    return;
-  };
-
-  UInt uiCurPlane = 0;
-  for (; uiCurPlane < pcInputImage->getNumberOfFullPlanes(); uiCurPlane++ )
-  {
-    xCutPlaneMargin( pcInputImage->getPlane(uiCurPlane), (Pel) 0  , 1 );
-  }
-
-  for (; uiCurPlane < pcInputImage->getNumberOfPlanes(); uiCurPlane++ )
-  {
-    xCutPlaneMargin( pcInputImage->getPlane(uiCurPlane), (Pel) 128  , 2 );
-  }
-
-};
-
-
-Void TRenTop::xEnhSimilarity( PelImage* pcLeftImage, PelImage* pcRightImage, PelImage* pcFilledLeft, PelImage* pcFilledRight )
-{
-  if (m_iSimEnhBaseView == 0)
-    return;
-
-  UInt uiNumFullPlanes = pcLeftImage->getNumberOfFullPlanes();
-  UInt uiNumQuatPlanes = pcLeftImage->getNumberOfQuaterPlanes();
-
-  if (uiNumQuatPlanes > 0)
-  {
-    assert( pcFilledLeft ->getNumberOfPlanes() > 1);
-    assert( pcFilledRight->getNumberOfPlanes() > 1);
-  };
-
-  xEnhSimilarityPlane ( pcLeftImage->getPlanes()                , pcRightImage->getPlanes()                , pcFilledLeft->getPlane(0), pcFilledRight->getPlane(0), uiNumFullPlanes);
-  if (uiNumQuatPlanes > 0)
-  {
-    xEnhSimilarityPlane ( pcLeftImage->getPlanes()+uiNumFullPlanes, pcRightImage->getPlanes()+uiNumFullPlanes, pcFilledLeft->getPlane(1), pcFilledRight->getPlane(1), uiNumQuatPlanes);
-  }
-}
-
-Void TRenTop::xEnhSimilarityPlane       ( PelImagePlane** apcLeftPlane, PelImagePlane** apcRightPlane, PelImagePlane* pcFilledLeftPlane, PelImagePlane* pcFilledRightPlane, UInt uiNumberOfPlanes )
-{  
-  AOT( m_iSimEnhBaseView != 1 && m_iSimEnhBaseView != 2 );
-  Int iWidth  = (*apcRightPlane)->getWidth ();
-  Int iHeight = (*apcRightPlane)->getHeight();
-
-  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 << REN_BIT_DEPTH ); iCurVal++)
-    {
-      aiHistLeft [iCurVal] = 0;
-      aiHistRight[iCurVal] = 0;
-    }
-
-    Pel* pcFilledRightData = pcFilledRightPlane    ->getPlaneData();
-    Pel* pcRightImageData  = (*apcRightPlane )     ->getPlaneData();
-
-    Pel* pcFilledLeftData  = pcFilledLeftPlane     ->getPlaneData();
-    Pel* pcLeftImageData   = (*apcLeftPlane)       ->getPlaneData();
-
- 
-
-    for (UInt uiYPos = 0; uiYPos < iHeight; uiYPos++ )
-    {
-      for (UInt uiXPos = 0; uiXPos < iWidth; uiXPos++ )
-      {
-          if      ( pcFilledLeftData[uiXPos] == REN_IS_FILLED &&  pcFilledRightData[uiXPos] == REN_IS_FILLED )
-          {
-            aiHistLeft [pcLeftImageData   [uiXPos] ]++;
-            aiHistRight[pcRightImageData  [uiXPos] ]++;
-          }
-      }
-
-
-      pcFilledRightData +=    pcFilledRightPlane  ->getStride();
-      pcRightImageData  += (*apcRightPlane)       ->getStride();
-
-      pcFilledLeftData  +=    pcFilledLeftPlane   ->getStride();
-      pcLeftImageData   +=  (*apcLeftPlane)       ->getStride();
-    }
-
-    Int iCumSumChange  = 0;
-    Int iCumSumBase    = 0;
-    Int iCurBaseVal    = 0;
-    Int iCurChangeVal  = 0;
-
-    Int* aiHistChange  = (m_iSimEnhBaseView == 2 ) ? aiHistLeft  : aiHistRight;
-    Int* aiHistBase    = (m_iSimEnhBaseView == 2 ) ? aiHistRight : aiHistLeft ;
-
-    iCumSumChange += aiHistChange[iCurChangeVal];
-    iCumSumBase   += aiHistBase  [iCurBaseVal]  ;
-
-    Int iCheckSumLeft  = 0;
-    Int iCheckSumRight = 0;
-
-    for (Int iCurVal = 0 ; iCurVal < ( 1 << REN_BIT_DEPTH ); iCurVal++)
-    {
-      iCheckSumLeft  += aiHistLeft [iCurVal];
-      iCheckSumRight += aiHistRight[iCurVal];
-    }
-
-
-    while( iCurChangeVal < ( 1 << REN_BIT_DEPTH ) )
-    {
-      if ( iCumSumBase == iCumSumChange )
-      {
-        aiConvLUT[iCurChangeVal] = std::min( iCurBaseVal,  ( 1 << REN_BIT_DEPTH ) - 1 );
-        iCurBaseVal  ++;
-        iCurChangeVal++;
-        iCumSumChange += aiHistChange[iCurChangeVal];
-        if (iCurBaseVal <  ( 1 << REN_BIT_DEPTH ) )
-        {
-          iCumSumBase   += aiHistBase  [iCurBaseVal]  ;
-        }
-      }
-      else if ( iCumSumBase < iCumSumChange )
-      {
-        iCurBaseVal++;
-        if (iCurBaseVal < ( 1 << REN_BIT_DEPTH ) )
-        {
-          iCumSumBase   += aiHistBase  [iCurBaseVal]  ;
-        }
-      }
-      else if ( iCumSumBase > iCumSumChange)
-      {
-        aiConvLUT[iCurChangeVal] = std::min(iCurBaseVal, ( 1 << REN_BIT_DEPTH )-1);
-        iCurChangeVal++;
-        iCumSumChange += aiHistChange  [iCurChangeVal]  ;
-      }
-    }
-
-    Pel* pcChangeImageData   = ( ( m_iSimEnhBaseView == 2 ) ? (*apcLeftPlane) : (*apcRightPlane) )->getPlaneData();
-    Int  iChangeImageStride  = ( ( m_iSimEnhBaseView == 2 ) ? (*apcLeftPlane) : (*apcRightPlane) )->getStride   ();
-
-    for (UInt uiYPos = 0; uiYPos < iHeight; uiYPos++ )
-    {
-      for (UInt uiXPos = 0; uiXPos < iWidth; uiXPos++ )
-      {
-          pcChangeImageData  [uiXPos] = aiConvLUT[ pcChangeImageData[uiXPos]];
-      }
-      pcChangeImageData   +=  iChangeImageStride;
-    }
-
-    apcRightPlane ++;
-    apcLeftPlane  ++;
-
-  }
-
-delete[] aiHistLeft ;
-delete[] aiHistRight;
-delete[] aiConvLUT  ;
-}
-
-
-Void TRenTop::xBlend( PelImage* pcLeftImage, PelImage* pcRightImage, PelImage* pcFilledLeft, PelImage* pcFilledRight, PelImage* pcLeftDepth, PelImage* pcRightDepth, PelImage* pcOutputImage )
-{
-  UInt uiNumFullPlanes = pcLeftImage->getNumberOfFullPlanes();
-  UInt uiNumQuatPlanes = pcLeftImage->getNumberOfQuaterPlanes();
-
-  assert( uiNumFullPlanes == pcRightImage->getNumberOfFullPlanes  () && uiNumFullPlanes == pcOutputImage->getNumberOfFullPlanes    ());
-  assert( uiNumQuatPlanes == pcRightImage->getNumberOfQuaterPlanes() && uiNumQuatPlanes == pcOutputImage->getNumberOfQuaterPlanes  ());
-
-  if (uiNumQuatPlanes > 0)
-  {
-    assert( pcLeftDepth ->getNumberOfPlanes() > 1 || pcFilledLeft ->getNumberOfPlanes() > 1);
-    assert( pcRightDepth->getNumberOfPlanes() > 1 || pcFilledRight->getNumberOfPlanes() > 1);
-  };
-
-  switch (m_iBlendMode)
-  {
-  case eRenBlendAverg:
-  case eRenBlendDepthFirst:
-    xBlendPlanesAvg( pcLeftImage->getPlanes()                , pcRightImage->getPlanes()                , pcFilledLeft->getPlane(0), pcFilledRight->getPlane(0), pcLeftDepth->getPlane(0), pcRightDepth->getPlane(0), pcOutputImage->getPlanes(), uiNumFullPlanes);
-    if (uiNumQuatPlanes > 0)
-    {
-      xBlendPlanesAvg( pcLeftImage->getPlanes()+uiNumFullPlanes, pcRightImage->getPlanes()+uiNumFullPlanes, pcFilledLeft->getPlane(1), pcFilledRight->getPlane(1), pcLeftDepth->getPlane(1), pcRightDepth->getPlane(1), pcOutputImage->getPlanes()+uiNumFullPlanes, uiNumQuatPlanes);
-    }
-    break;
-  case eRenBlendLeft:
-  case eRenBlendRight:
-    xBlendPlanesOneView( pcLeftImage->getPlanes()                , pcRightImage->getPlanes()                , pcFilledLeft->getPlane(0), pcFilledRight->getPlane(0), pcLeftDepth->getPlane(0), pcRightDepth->getPlane(0), pcOutputImage->getPlanes(), uiNumFullPlanes);
-    if (uiNumQuatPlanes > 0)
-    {
-      xBlendPlanesOneView( pcLeftImage->getPlanes()+uiNumFullPlanes, pcRightImage->getPlanes()+uiNumFullPlanes, pcFilledLeft->getPlane(1), pcFilledRight->getPlane(1), pcLeftDepth->getPlane(1), pcRightDepth->getPlane(1), pcOutputImage->getPlanes()+uiNumFullPlanes, uiNumQuatPlanes);
-    }
-    break;
-  }
-}
-
-Void TRenTop::xBlendPlanesOneView( PelImagePlane** apcLeftPlane, PelImagePlane** apcRightPlane, PelImagePlane* pcFilledLeftPlane, PelImagePlane* pcFilledRightPlane, PelImagePlane* pcLeftDepthPlane, PelImagePlane* pcRightDepthPlane, PelImagePlane** apcOutputImagePlane, UInt uiNumberOfPlanes )
-{
-  for (UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++ )
-  {
-    Pel* pcFilledRightData = pcFilledRightPlane    ->getPlaneData();
-    Pel* pcRightImageData  = (*apcRightPlane )     ->getPlaneData();
-    Pel* pcRightDepthData  = pcRightDepthPlane     ->getPlaneData();
-
-    Pel* pcFilledLeftData  = pcFilledLeftPlane     ->getPlaneData();
-    Pel* pcLeftImageData   = (*apcLeftPlane)       ->getPlaneData();
-    Pel* pcLeftDepthData   = pcLeftDepthPlane      ->getPlaneData();
-    Pel* pcOutputData      = (*apcOutputImagePlane)->getPlaneData();
-
-    for (UInt uiYPos = 0; uiYPos < (*apcOutputImagePlane)->getHeight(); uiYPos++ )
-    {
-      for (UInt uiXPos = 0; uiXPos < (*apcOutputImagePlane)->getWidth(); uiXPos++ )
-      {
-        if      (m_iBlendMode == eRenBlendLeft  )
-        {
-          if      ( pcFilledLeftData[uiXPos] == REN_IS_FILLED ||  pcFilledRightData[uiXPos] == REN_IS_HOLE )
-          {
-            pcOutputData[uiXPos] = pcLeftImageData[uiXPos];
-          }
-          else if ( pcFilledLeftData[uiXPos] == REN_IS_HOLE )
-          {
-            pcOutputData[uiXPos] = pcRightImageData[uiXPos];
-          }
-          else
-          {
-            pcOutputData[uiXPos] = pcRightImageData[uiXPos] +  (Pel) (  ( (Int) ( pcLeftImageData[uiXPos] - pcRightImageData[uiXPos] ) * pcFilledLeftData[uiXPos] + (1 << (REN_VDWEIGHT_PREC - 1)) ) >> REN_VDWEIGHT_PREC );
-          }
-        }
-        else if ( m_iBlendMode == eRenBlendRight )
-        {
-          if      ( pcFilledRightData[uiXPos] == REN_IS_FILLED || pcFilledLeftData[uiXPos] == REN_IS_HOLE )
-          {
-            pcOutputData[uiXPos] = pcRightImageData[uiXPos];
-          }
-          else if ( pcFilledRightData[uiXPos] == REN_IS_HOLE )
-          {
-            pcOutputData[uiXPos] = pcLeftImageData[uiXPos];
-          }
-          else
-          {
-            pcOutputData[uiXPos] = pcLeftImageData[uiXPos] +  (Pel) (  ( (Int) ( pcRightImageData[uiXPos] - pcLeftImageData[uiXPos] ) * pcFilledRightData[uiXPos] + (1 << (REN_VDWEIGHT_PREC - 1)) ) >> REN_VDWEIGHT_PREC );
-          }
-        }
-        else
-        {
-          AOT(true);
-        }
-      }
-
-      pcFilledRightData +=    pcFilledRightPlane  ->getStride();
-      pcRightImageData  += (*apcRightPlane)       ->getStride();
-      pcRightDepthData  +=    pcRightDepthPlane   ->getStride();
-
-      pcFilledLeftData  +=    pcFilledLeftPlane   ->getStride();
-      pcLeftImageData   +=  (*apcLeftPlane)       ->getStride();
-      pcLeftDepthData   +=    pcLeftDepthPlane    ->getStride();
-      pcOutputData      +=  (*apcOutputImagePlane)->getStride();
-    }
-
-    apcRightPlane ++;
-    apcLeftPlane  ++;
-    apcOutputImagePlane++;
-  }
-}
-
-Void TRenTop::xBlendPlanesAvg( PelImagePlane** apcLeftPlane, PelImagePlane** apcRightPlane, PelImagePlane* pcFilledLeftPlane, PelImagePlane* pcFilledRightPlane, PelImagePlane* pcLeftDepthPlane, PelImagePlane* pcRightDepthPlane, PelImagePlane** apcOutputImagePlane, UInt uiNumberOfPlanes )
-{
-  for (UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++ )
-  {
-    Pel* pcFilledRightData = pcFilledRightPlane   ->getPlaneData();
-    Pel* pcRightVideoData  = (*apcRightPlane )    ->getPlaneData();
-    Pel* pcRightDepthData  = pcRightDepthPlane    ->getPlaneData();
-
-    Pel* pcFilledLeftData  = pcFilledLeftPlane    ->getPlaneData();
-    Pel* pcLeftVideoData   = (*apcLeftPlane)      ->getPlaneData();
-    Pel* pcLeftDepthData   = pcLeftDepthPlane     ->getPlaneData();
-
-    Pel* pcOutputData      = (*apcOutputImagePlane)->getPlaneData();
-
-    for (UInt uiYPos = 0; uiYPos < (*apcOutputImagePlane)->getHeight(); uiYPos++ )
-    {
-      for (UInt uiXPos = 0; uiXPos < (*apcOutputImagePlane)->getWidth(); uiXPos++ )
-      {
-        if      (  (pcFilledRightData[uiXPos] != REN_IS_HOLE ) && ( pcFilledLeftData[uiXPos] != REN_IS_HOLE) )
-        {
-          Int iDepthDifference  = m_piInvZLUTLeft[RemoveBitIncrement(pcLeftDepthData[uiXPos])] - m_piInvZLUTRight[RemoveBitIncrement(pcRightDepthData[uiXPos])];
-
-          if ( abs ( iDepthDifference ) <= m_iBlendZThres )
-          {
-            if      ((pcFilledRightData[uiXPos] == REN_IS_FILLED) && ( pcFilledLeftData[uiXPos] != REN_IS_FILLED))
-            {
-              pcOutputData[uiXPos] = pcRightVideoData[uiXPos] +  (Pel) (  ( (Int) ( pcLeftVideoData[uiXPos] - pcRightVideoData[uiXPos] ) * (pcFilledLeftData[uiXPos]) + (1 << (REN_VDWEIGHT_PREC - 1)) ) >> REN_VDWEIGHT_PREC );
-            }
-            else if ((pcFilledRightData[uiXPos] != REN_IS_FILLED) && ( pcFilledLeftData[uiXPos] == REN_IS_FILLED))
-            {
-              pcOutputData[uiXPos] = pcLeftVideoData[uiXPos]  +  (Pel) (  ( (Int) ( pcRightVideoData[uiXPos] - pcLeftVideoData[uiXPos] ) * (pcFilledRightData[uiXPos]) + (1 << (REN_VDWEIGHT_PREC - 1)) ) >> REN_VDWEIGHT_PREC );
-            }
-            else
-            {
-              pcOutputData[uiXPos] = pcLeftVideoData[uiXPos]  +  (Pel) (  ( (Int) ( pcRightVideoData[uiXPos] - pcLeftVideoData[uiXPos] ) * m_iBlendDistWeight               + (1 << (REN_VDWEIGHT_PREC - 1)) ) >> REN_VDWEIGHT_PREC );
-            }
-
-          }
-          else if ( iDepthDifference < 0 )
-          {
-            pcOutputData[uiXPos] = pcRightVideoData[uiXPos];
-          }
-          else
-          {
-            pcOutputData[uiXPos] = pcLeftVideoData[uiXPos];
-          }
-        }
-        else if ( (pcFilledRightData[uiXPos] == REN_IS_HOLE) && (pcFilledLeftData[uiXPos] == REN_IS_HOLE))
-        {
-          pcOutputData[uiXPos] = m_piInvZLUTLeft[RemoveBitIncrement( pcLeftDepthData[uiXPos])]  < m_piInvZLUTRight[RemoveBitIncrement(pcRightDepthData[uiXPos])] ? pcLeftVideoData[uiXPos] : pcRightVideoData[uiXPos];
-        }
-        else
-        {
-          pcOutputData[uiXPos] =  (pcFilledLeftData[uiXPos] == REN_IS_HOLE) ? pcRightVideoData[uiXPos] : pcLeftVideoData[uiXPos];
-        }
-      }
-
-      pcFilledRightData +=    pcFilledRightPlane  ->getStride();
-      pcRightVideoData  += (*apcRightPlane)      ->getStride();
-      pcRightDepthData  +=    pcRightDepthPlane   ->getStride();
-
-      pcFilledLeftData  +=    pcFilledLeftPlane   ->getStride();
-      pcLeftVideoData   +=  (*apcLeftPlane)       ->getStride();
-      pcLeftDepthData   +=    pcLeftDepthPlane    ->getStride();
-      pcOutputData      +=  (*apcOutputImagePlane)->getStride();
-    };
-
-    apcRightPlane ++;
-    apcLeftPlane  ++;
-    apcOutputImagePlane++;
-  }
-}
-
-// Temporal Filter from Zhejiang University: (a little different from m16041: Temporal Improvement Method in View Synthesis)
-Void TRenTop::temporalFilterVSRS( TComPicYuv* pcPicYuvVideoCur, TComPicYuv* pcPicYuvDepthCur, TComPicYuv* pcPicYuvVideoLast, TComPicYuv* pcPicYuvDepthLast, Bool bFirstFrame )
-{
-  Int iSADThres  = 100 ;  //threshold of sad in 4*4 block motion detection
-
-  Int iWidth  = m_auiInputResolution[0];
-  Int iHeight = m_auiInputResolution[1];
-
-  //internal variables
-  Int* piFlagMoving =  m_aiBlkMoving + 2;
-
-  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 ;
-  Pel* pcVideoLastDataFrm = pcVideoLastData;
-  Pel* pcDepthCurDataFrm  = pcDepthCurData ;
-  Pel* pcDepthLastDataFrm = pcDepthLastData;
-
-
-  if( !bFirstFrame ) // first frame need not the weighting, but need to prepare the data
-  {
-    for ( Int iPosY = 0; iPosY < (iHeight >> 2); iPosY++)
-    {
-      //motion detection by SAD
-      for ( Int iPosX = 0; iPosX < (iWidth >> 2);  iPosX++)
-      {
-        Int iSAD = 0;
-
-        Pel* pcVideoCurDataBlk  = pcVideoCurDataFrm  + (iPosX << 2);
-        Pel* pcVideoLastDataBlk = pcVideoLastDataFrm + (iPosX << 2);
-
-        //GT: Check difference of block compared to last frame
-        for( Int iCurPosY = 0; iCurPosY < 4; iCurPosY++)
-        {
-          for( Int iCurPosX = 0; iCurPosX < 4; iCurPosX++)
-          {
-            iSAD += abs( pcVideoLastDataBlk[iCurPosX] - pcVideoCurDataBlk[iCurPosX] );   //SAD
-          }
-          pcVideoLastDataBlk += iVideoLastStride;
-          pcVideoCurDataBlk  += iVideoCurStride;
-        }
-
-        piFlagMoving[iPosX] = ( iSAD < iSADThres ) ? 0 : 1;
-      }
-
-      //temporal weighting according to motion detection result -- do a line
-      for ( Int iPosX = 0; iPosX < (iWidth >> 2);  iPosX++)
-      {
-        //5 block
-       Int iSumMoving = piFlagMoving[iPosX-2] + piFlagMoving[iPosX-1] + piFlagMoving[iPosX]   + piFlagMoving[iPosX+1] + piFlagMoving[iPosX+2];
-
-        if( iSumMoving == 0 ) // if not moving
-        {
-          Pel* pcDepthCurDataBlk  = pcDepthCurDataFrm  + (iPosX << 2);
-          Pel* pcDepthLastDataBlk = pcDepthLastDataFrm + (iPosX << 2);
-
-          for( Int iCurPosY = 0; iCurPosY < 4; iCurPosY++)
-          {
-            for( Int iCurPosX = 0; iCurPosX < 4; iCurPosX++)
-            { //Weight: 0.75
-              Int iFilt = (( (pcDepthLastDataBlk[iCurPosX] << 1 ) + pcDepthLastDataBlk[iCurPosX] + pcDepthCurDataBlk[iCurPosX] + 2 ) >> 2 );
-              assert( (iFilt >= 0) && (iFilt <  ( 1 << REN_BIT_DEPTH ) ) );
-              pcDepthCurDataBlk[iCurPosX] = pcDepthLastDataBlk[iCurPosX];
-              pcDepthCurDataBlk[iCurPosX] = iFilt;
-            }
-
-            pcDepthCurDataBlk  += iDepthCurStride;
-            pcDepthLastDataBlk += iDepthLastStride;
-          }
-        }
-      }
-
-      pcDepthCurDataFrm  += ( iDepthCurStride  << 2);
-      pcDepthLastDataFrm += ( iDepthLastStride << 2);
-      pcVideoCurDataFrm  += ( iVideoCurStride  << 2);
-      pcVideoLastDataFrm += ( iVideoLastStride << 2);
-    }
-  }
-  pcPicYuvVideoCur->copyToPic( pcPicYuvVideoLast );
-  pcPicYuvDepthCur->copyToPic( pcPicYuvDepthLast );
-}
-
-TRenTop::TRenTop()
-{
-  m_auiInputResolution[0] = 0;
-  m_auiInputResolution[1] = 0;
-
-  // Sub Pel Rendering
-  m_iLog2SamplingFactor = 0;
-
-  // ColorPlaneHandling
-  m_bUVUp = true;
-
-
-  //PreProcessing
-  m_iPreProcMode         = eRenPreProNone;
-  m_iPreFilterSize = 2;
-
-  // Interpolation
-  m_iInterpolationMode   = eRenIntFullPel;
-
-  // Sim Enhancement
-  m_iSimEnhBaseView      = 0;
-
-  // Blending
-  m_iBlendMode           = eRenBlendAverg;
-  m_iBlendZThresPerc     = -1;
-  m_bBlendUseDistWeight  = false;
-  m_iBlendHoleMargin     = -1;
-
-  m_iBlendZThres         = -1;
-  m_iBlendDistWeight     = -1;
-
-  // Hole Filling
-  m_iHoleFillingMode     = eRenHFLWBackExt;
-  m_bInstantHoleFilling  = false;
-
-  // PostProcessing
-  m_iPostProcMode        = eRenPostProNone;
-
-  // Cut
-  m_auiCut[0] = 0;
-  m_auiCut[1] = 0;
-
-  // Data
-  m_uiSampledWidth = -1;
-
-  // LUTs
-  m_ppdShiftLUTLeft  = 0;
-  m_ppdShiftLUTRight = 0;
-
-  m_ppdShiftLUTRightMirror    = new Double*[2];
-  m_ppdShiftLUTRightMirror[0] = new Double [257];
-  m_ppdShiftLUTRightMirror[1] = new Double [257];
-
-  m_adShiftLUTCur    = 0;
-
-  m_ppiShiftLUTLeft  = 0;
-  m_ppiShiftLUTRight = 0;
-  m_ppiShiftLUTRightMirror    = new Int*[2];
-  m_ppiShiftLUTRightMirror[0] = new Int[257];
-  m_ppiShiftLUTRightMirror[1] = new Int[257];
-
-  m_aiShiftLUTCur    = 0;
-  m_piInvZLUTLeft  = new Int[257];
-  m_piInvZLUTRight = new Int[257];
-
-  // Buffers
-  m_pcLeftInputImage   = 0;
-  m_pcLeftInputDepth   = 0;
-  m_pcLeftOutputImage  = 0;
-  m_pcLeftOutputDepth  = 0;
-  m_pcLeftFilled       = 0;
-
-  m_pcRightInputImage  = 0;
-  m_pcRightInputDepth  = 0;
-  m_pcRightOutputImage = 0;
-  m_pcRightOutputDepth = 0;
-  m_pcRightFilled      = 0;
-
-  m_pcOutputImage      = 0;
-  m_pcOutputDepth      = 0;
-
-  //Extrapolation
-  m_pcInputImage       = 0;
-  m_pcInputDepth       = 0;
-  m_pcFilled           = 0;
-
-  // SubPel
-  m_aaiSubPelShift     = 0;
-
-  // Temp
-  m_pcTempImage        = 0;
-
-  //Temporal Filter
-  m_aiBlkMoving        = 0;
-}
-
-
-Void TRenTop::init(UInt uiImageWidth,
-                   UInt uiImageHeight,
-                   Bool  bExtrapolate,
-                   UInt uiLog2SamplingFactor,
-                   Int   iShiftLUTPrec,
-                   Bool  bUVUp,
-                   Int   iPreProcMode,
-                   Int   iPreFilterKernelSize,
-                   Int   iBlendMode,
-                   Int   iBlendZThresPerc,
-                   Bool  bBlendUseDistWeight,
-                   Int   iBlendHoleMargin,
-                   Int   iInterpolationMode,
-                   Int   iHoleFillingMode,
-                   Int   iPostProcMode,
-                   Int   iUsedPelMapMarExt
-                   )
-
-{
-  // Shift LUT Prec
-  m_iRelShiftLUTPrec = iShiftLUTPrec - (Int) uiLog2SamplingFactor;
-
-  // Sub Pel Rendering
-  m_iLog2SamplingFactor = uiLog2SamplingFactor;
-
-  // Extrapolation ?
-  m_bExtrapolate = bExtrapolate;
-
-  // ColorPlaneHandling
-  m_bUVUp = bUVUp;
-
-  //PreProcessing
-  m_iPreProcMode = iPreProcMode;
-  m_iPreFilterSize = iPreFilterKernelSize;
-
-  // Interpolation
-  m_iInterpolationMode = iInterpolationMode;
-
-  //Blending
-  m_iBlendMode          = iBlendMode;
-  m_iBlendZThresPerc    = iBlendZThresPerc;
-  m_bBlendUseDistWeight = bBlendUseDistWeight;
-  m_iBlendHoleMargin    = iBlendHoleMargin;
-
-  // Hole Filling
-  m_iHoleFillingMode = iHoleFillingMode;
-
-  m_bInstantHoleFilling   = (m_iInterpolationMode == eRenInt8Tap ) && (m_iHoleFillingMode != 0 );
-
-  // PostProcessing
-  m_iPostProcMode    = iPostProcMode;
-
-  // Used pel map
-  m_iUsedPelMapMarExt     = iUsedPelMapMarExt;
-
-  // Cut
-  m_auiCut[0] = 0;
-  m_auiCut[1] = 0;
-
-  m_auiInputResolution[0] = uiImageWidth;
-  m_auiInputResolution[1] = uiImageHeight;
-
-  if ( m_bExtrapolate )
-  {
-    PelImage*    pcDump        = 0;
-    xGetDataPointers( m_pcInputImage, m_pcOutputImage, m_pcInputDepth, pcDump, m_pcFilled, false );
-  }
-  else
-  {
-    xGetDataPointers(m_pcLeftInputImage,  m_pcLeftOutputImage,  m_pcLeftInputDepth,  m_pcLeftOutputDepth,  m_pcLeftFilled,  true);
-    xGetDataPointers(m_pcRightInputImage, m_pcRightOutputImage, m_pcRightInputDepth, m_pcRightOutputDepth, m_pcRightFilled, true);
-    xGetDataPointerOutputImage(m_pcOutputImage, m_pcOutputDepth );
-  }
-
-  m_pcTempImage = new PelImage( m_auiInputResolution[0],m_auiInputResolution[1],1,2);
-
-  // SubPelShiftLUT
-  if (iInterpolationMode == eRenInt8Tap)
-  {
-    // SubPel Shift LUT
-    Int iNumEntries = (1 << ( m_iRelShiftLUTPrec + 1) ) + 1 ;
-    m_aaiSubPelShift = new Int*[ iNumEntries ];
-    for (UInt uiEntry = 0; uiEntry < iNumEntries; uiEntry++)
-    {
-      m_aaiSubPelShift[uiEntry] = new Int[ iNumEntries ];
-    }
-
-    TRenFilter<REN_BIT_DEPTH>::setSubPelShiftLUT(m_iRelShiftLUTPrec, m_aaiSubPelShift, -1);
-  }
-
-  // Zheijang temporal filter
-  m_aiBlkMoving    = new Int[ ( m_auiInputResolution[0] >> 2 ) + 4 ];
-  m_aiBlkMoving[0] = 0;
-  m_aiBlkMoving[1] = 0;
-  m_aiBlkMoving[ ( m_auiInputResolution[0] >> 2 ) + 2 ] = 0;
-  m_aiBlkMoving[ ( m_auiInputResolution[0] >> 2 ) + 3 ] = 0;
-}
-
-
-TRenTop::~TRenTop()
-{
-  if ( m_ppdShiftLUTRightMirror != NULL )
-  {
-    delete[] m_ppdShiftLUTRightMirror[0];
-    delete[] m_ppdShiftLUTRightMirror[1];
-    delete[] m_ppdShiftLUTRightMirror;
-  };
-
-  if ( m_ppiShiftLUTRightMirror != NULL )
-  {
-    delete[] m_ppiShiftLUTRightMirror[0];
-    delete[] m_ppiShiftLUTRightMirror[1];
-    delete[] m_ppiShiftLUTRightMirror;
-  };
-
-  if (m_piInvZLUTLeft      != NULL ) delete[] m_piInvZLUTLeft   ;
-  if (m_piInvZLUTLeft      != NULL ) delete[] m_piInvZLUTRight  ;
-
-  if (m_pcLeftInputImage   != NULL ) delete m_pcLeftInputImage  ;
-  if (m_pcLeftInputDepth   != NULL ) delete m_pcLeftInputDepth  ;
-  if (m_pcLeftOutputImage  != NULL ) delete m_pcLeftOutputImage ;
-  if (m_pcLeftOutputDepth  != NULL ) delete m_pcLeftOutputDepth ;
-  if (m_pcLeftFilled       != NULL ) delete m_pcLeftFilled      ;
-
-  if (m_pcRightInputImage  != NULL ) delete m_pcRightInputImage ;
-  if (m_pcRightInputDepth  != NULL ) delete m_pcRightInputDepth ;
-  if (m_pcRightOutputImage != NULL ) delete m_pcRightOutputImage;
-  if (m_pcRightOutputDepth != NULL ) delete m_pcRightOutputDepth;
-  if (m_pcRightFilled      != NULL ) delete m_pcRightFilled     ;
-
-  if (m_pcOutputImage      != NULL ) delete m_pcOutputImage     ;
-  if (m_pcOutputDepth      != NULL ) delete m_pcOutputDepth     ;
-
-  if (m_pcInputImage       != NULL ) delete m_pcInputImage      ;
-  if (m_pcInputDepth       != NULL ) delete m_pcInputDepth      ;
-  if (m_pcFilled           != NULL ) delete m_pcFilled          ;
-
-  if (m_pcTempImage        != NULL ) delete m_pcTempImage       ;
-
-  // SubPel LUT
-  if ( m_aaiSubPelShift != NULL)
-  {
-    Int iNumEntries = (1 << ( m_iRelShiftLUTPrec + 1) ) + 1;
-    for (UInt uiEntry = 0; uiEntry < iNumEntries; uiEntry++)
-    {
-      delete[] m_aaiSubPelShift[uiEntry];
-    }
-    delete[] m_aaiSubPelShift;
-  }
-
-  // Zheijang temporal filter
-  if(m_aiBlkMoving         != NULL ) delete[] m_aiBlkMoving;
-}
-#endif // NH_3D
-
Index: branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenTop.h
===================================================================
--- branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenTop.h	(revision 1389)
+++ branches/HTM-16.0-MV-draft-5/source/Lib/TLibRenderer/TRenTop.h	(revision 1390)
@@ -39,235 +39,3 @@
 #include "../TLibCommon/TComPicYuv.h"
 
-#if NH_3D_VSO
-#include <list>
-#include <vector>
-
-using namespace std;
-
-class TRenTop
-{
-// ENUM Modes
-
-
-  // Interpolation Modes
-
-  enum { eRenIntFullPel = 0, eRenIntLinInt = 1, eRenIntLinReal = 2, eRenIntFEM = 3, eRenInt8Tap = 4 };
-
-  // HoleFilling
-  enum { eRenHFNone = 0, eRenHFLWBackExt = 1};
-
-  // Pre-Processing
-  enum { eRenPreProNone = 0, eRenPreProBinom = 1};
-
-  // Post-Processing
-  enum { eRenPostProNone = 0, eRenPostProMed = 1};
-
-  // Merging
-  enum { eRenBlendAverg = 0, eRenBlendLeft = 1, eRenBlendRight = 2, eRenBlendDepthFirst = 5 };
-
-public:
-  TRenTop();
-  ~TRenTop();
-
-  // Init
-  Void init              ( UInt uiImageWitdh,
-                           UInt uiImageHeight,
-                           Bool bExtrapolate,
-                           UInt uiLog2SamplingFactor,
-                           Int  iLUTPrec,
-                           Bool bUVUp,
-                           Int  iPreProcMode,
-                           Int  iPreFilterKernelSize,
-                           Int  iBlendMode,
-                           Int  iBlendZThresPerc,
-                           Bool bBlendUseDistWeight,
-                           Int  iBlendHoleMargin,
-                           Int  iInterpolationMode,
-                           Int  iHoleFillingMode,
-                           Int  iPostProcMode,
-                           Int  iUsedPelMapMarExt );
-
-  Void setShiftLUTs      ( Double** ppdShiftLUTLeft,
-                           Int**    ppiShiftLUTLeft,
-                           Int**    ppiBaseShiftLUTLeft,
-                           Double** ppdShiftLUTRight,
-                           Int**    ppiShiftLUTRight,
-                           Int**    ppiBaseShiftLUTRight,
-                           Int      iRelDistLeft );
-
-  // View Synthesis
-  Void extrapolateView   ( TComPicYuv* pcPicYuvVideo,
-                           TComPicYuv* pcPicYuvDepth,
-                           TComPicYuv* pcPicYuvSynthOut,
-                           Bool bRenderFromLeft );
-
-  Void interpolateView   ( TComPicYuv* pcPicYuvVideoLeft,
-                           TComPicYuv* pcPicYuvDepthLeft,
-                           TComPicYuv* pcPicYuvVideoRight,
-                           TComPicYuv* pcPicYuvDepthRight,
-                           TComPicYuv* pcPicYuvSynthOut,
-                           Int         iBlendMode,
-                           Int         iSimEnhBaseView );
-  // Tools
-  Void getUsedSamplesMap ( TComPicYuv* pcPicYuvDepth,
-                           TComPicYuv* pcUsedSampleMap,
-                           Bool bRenderFromLeft );
-
-  // Zhejiang Temporal Improvement
-  Void temporalFilterVSRS( TComPicYuv* pcPicYuvVideoCur,
-                           TComPicYuv* pcPicYuvDepthCur,
-                           TComPicYuv* pcPicYuvVideoLast,
-                           TComPicYuv* pcPicYuvDepthLast,
-                           Bool bFirstFrame );
-
-private:
-  // Depth PreProcessing
-  Void xPreProcessDepth(PelImage* pcInImage, PelImage* pcOutImage);
-
-  // Pixel Shifting
-  Void xShiftPixels              ( PelImage*        pcInImage,     PelImage*      pcDepth     , PelImage*        pcOutImage    , PelImage*      pcFilledImage, Bool bShiftFromLeft  );
-  Void xShiftPlanePixels         ( PelImagePlane** apcInputPlanes, PelImagePlane* pcDepthPlane, PelImagePlane** apcOutputPlanes, PelImagePlane* pcPlaneFilled, UInt uiNumberOfPlanes);
-  Void xShiftPlanePixelsLinReal  ( PelImagePlane** apcInputPlanes, PelImagePlane* pcDepthPlane, PelImagePlane** apcOutputPlanes, PelImagePlane* pcPlaneFilled, UInt uiNumberOfPlanes);
-  Void xShiftPlanePixelsFullPel  ( PelImagePlane** apcInputPlanes, PelImagePlane* pcDepthPlane, PelImagePlane** apcOutputPlanes, PelImagePlane* pcPlaneFilled, UInt uiNumberOfPlanes);
-  Void xShiftPlanePixelsLinInt   ( PelImagePlane** apcInputPlanes, PelImagePlane* pcDepthPlane, PelImagePlane** apcOutputPlanes, PelImagePlane* pcFilledPlane, UInt uiNumberOfPlanes);
-  Void xShiftPlanePixels8Tap     ( PelImagePlane** apcInputPlanes, PelImagePlane* pcDepthPlane, PelImagePlane** apcOutputPlanes, PelImagePlane* pcFilledPlane, UInt uiNumberOfPlanes);
-
-  Void xBackShiftPixels          ( PelImage*            pcInImage, PelImage*      pcDepth     , PelImage*            pcOutImage, PelImage*      pcFilledImage, Bool bShiftFromLeft   );
-  Void xBackShiftPlanePixels     ( PelImagePlane** apcInputPlanes, PelImagePlane* pcDepthPlane, PelImagePlane** apcOutputPlanes, PelImagePlane* pcFilledPlane, UInt uiNumberOfPlanes );
-
-  Int  xCeil                     ( Int iVal ) { return (( iVal + ( (1 << m_iRelShiftLUTPrec) - 1 ) ) >> m_iRelShiftLUTPrec);  }
-
-  // Hole Filling
-  Void xFillHoles                ( PelImage*       pcInImage,      PelImage*      pcFilled,      PelImage*       pcOutImage                            , Bool bRenderFromLeft );
-  Void xFillLWBackExt            ( PelImage*       pcInImage,      PelImage*      pcFilled,      PelImage*       pcOutImage                            , Bool bRenderFromLeft );
-  Void xFillPlaneHoles           ( PelImagePlane** apcInputPlanes, PelImagePlane* pcPlaneFilled, PelImagePlane** apcOutputPlanes, UInt uiNumberOfPlanes, Bool bRenderFromLeft );
-
-  // Alpha Map Creation
-  Void xCreateAlphaMap           (PelImage* pcFilledImage,         PelImage*       pcAlphaMapImage, Bool bRenderFromLeft );
-  Void xCreateAlphaMapPlane      (PelImagePlane** apcFilledPlanes, PelImagePlane** apcAlphaPlanes,  UInt uiNumberOfPlanes, Bool bRenderFromLeft);
-
-  // BoundaryNoiseErosion
-  Void xRemBoundaryNoise            ( PelImage*       pcInImage,      PelImage*      pcFilled,      PelImage*       pcOutImage                            , Bool bRenderFromLeft );
-  Void xRemBoundaryNoisePlane       ( PelImagePlane** apcInputPlanes, PelImagePlane* pcPlaneFilled, PelImagePlane** apcOutputPlanes, UInt uiNumberOfPlanes, Bool bRenderFromLeft );
-
-  // Similarity Enhancement
-  Void xEnhSimilarity            ( PelImage*      pcLeftImage,   PelImage*        pcRightImage, PelImage*      pcFilledLeft,      PelImage*      pcFilledRight      );
-  Void xEnhSimilarityPlane       ( PelImagePlane** apcLeftPlane, PelImagePlane** apcRightPlane, PelImagePlane* pcFilledLeftPlane, PelImagePlane* pcFilledRightPlane, UInt uNumPlanes );
-
-  // View Blending
-  Void xBlend                    ( PelImage*       pcLeftImage,  PelImage*        pcRightImage, PelImage*      pcFilledLeft,      PelImage*      pcFilledRight,      PelImage* pcLeftDepth,           PelImage* pcRightDepth,           PelImage* pcOutputImage);
-  Void xBlendPlanesAvg           ( PelImagePlane** apcLeftPlane, PelImagePlane** apcRightPlane, PelImagePlane* pcFilledLeftPlane, PelImagePlane* pcFilledRightPlane, PelImagePlane* pcLeftDepthPlane, PelImagePlane* pcRightDepthPlane, PelImagePlane** apcOutputImagePlane, UInt uNumPlanes );
-  Void xBlendPlanesOneView       ( PelImagePlane** apcLeftPlane, PelImagePlane** apcRightPlane, PelImagePlane* pcFilledLeftPlane, PelImagePlane* pcFilledRightPlane, PelImagePlane* pcLeftDepthPlane, PelImagePlane* pcRightDepthPlane, PelImagePlane** apcOutputImagePlane, UInt uNumPlanes );
-
-  // PostProcessing
-  Void xCutMargin                ( PelImage* pcInputImage );
-  Void xCutPlaneMargin           ( PelImagePlane* pcImagePlane, Pel cFill, UInt uiScale);
-  Void xPostProcessImage         ( PelImage* pcInImage,       PelImage* pCOutImage);
-
-  // Input Output Data Conversion
-  Void xConvertInputData         ( PelImage* pcOrgInputImage, PelImage* pcOrgInputDepth, PelImage* pcConvInputImage, PelImage* pcConvInputDepth, Bool bMirror);
-  Void xConvertOutputData        ( PelImage* pOrgOutputImage, PelImage* pConvOutputImage, Bool bMirror);
-
-  Void xGetDataPointers          ( PelImage*& rpcInputImage,  PelImage*& rpcOutputImage, PelImage*& rpcInputDepth, PelImage*& rpcOutputDepth, PelImage*& rpcFilled, Bool bRenderDepth );
-  Void xGetDataPointerOutputImage( PelImage*& rpcOutputImage, PelImage*& rpcOutputDepth );
-
-  Void xConvertInputVideo        ( PelImage* pcOrgInputImage, PelImage* pcConvInputImage);
-  Void xConvertInputDepth        ( PelImage* pcOrgInputImage, PelImage* pcConvInputImage);
-
-
-  // Data
-  UInt m_uiSampledWidth;    // Width after UPsampling
-
-  // Resolution of input view
-  UInt  m_auiInputResolution[2];
-
-  // Extrapolation
-  Bool m_bExtrapolate;
-
-  // Input Conversion
-  Int  m_iLog2SamplingFactor;
-  Bool m_bUVUp;
-
-  // PreProcessing
-  Int  m_iPreProcMode;         //0: none, 1: binominal
-  Int  m_iPreFilterSize;       // Half size
-
-  // Similarity Enhancement
-  Int  m_iSimEnhBaseView;      // 0: none, 1: left, 2: right
-
-  // Blending
-  Int  m_iBlendMode;           // 0: average;
-  Int  m_iBlendZThresPerc;     // in percent of total depth
-  Bool m_bBlendUseDistWeight;  // use weighting depending on viewing distance
-  Int  m_iBlendHoleMargin;     // blending margin next to holes
-
-  Int  m_iBlendZThres;         // absoluteInt  m_iBlendWeight;
-  Int  m_iBlendDistWeight;     // Weight for view distance depending blending
-
-  // Interpolation
-  Int  m_iInterpolationMode;   //0: none; 1: Linear (Double), 2: FEM (Double)
-
-  // Hole Filling
-  Int  m_iHoleFillingMode;     //0: none; 1: LW Background extension
-  Int  m_bInstantHoleFilling;  // perform hole filling while pixel shifting ( only supported for interpolation mode 4 )
-
-  // Post Processing
-  Int  m_iPostProcMode;        //0: none; 1: Median
-
-  // Precision in LUT
-  Int  m_iRelShiftLUTPrec;
-
-  // Cut
-  UInt m_auiCut[2];
-
-  // Look up tables Shift
-  Double** m_ppdShiftLUTLeft;
-  Double** m_ppdShiftLUTRight;
-  Double** m_ppdShiftLUTRightMirror; // For rendering the mirrored view
-  Double*  m_adShiftLUTCur;
-
-  Int**    m_ppiShiftLUTLeft;
-  Int**    m_ppiShiftLUTRight;
-  Int**    m_ppiShiftLUTRightMirror; // For rendering the mirrored view
-  Int*     m_aiShiftLUTCur;
-
-  // Look up tables Z
-  Int*     m_piInvZLUTLeft;          // Look up table entry is proportional to Z
-  Int*     m_piInvZLUTRight;
-
-  // Look up tables sub pel shift
-  Int**    m_aaiSubPelShift;
-
-   // Zhejiang Temporal Improvement
-  Int*    m_aiBlkMoving;
-
-  // Used pel map generation
-  Int      m_iUsedPelMapMarExt;
-
-  // Buffers
-
-  // Interpolation
-  PelImage* m_pcLeftInputImage  ;
-  PelImage* m_pcLeftInputDepth  ;
-  PelImage* m_pcLeftOutputImage ;
-  PelImage* m_pcLeftOutputDepth ;
-  PelImage* m_pcLeftFilled      ;
-  PelImage* m_pcRightInputImage ;
-  PelImage* m_pcRightInputDepth ;
-  PelImage* m_pcRightOutputImage;
-  PelImage* m_pcRightOutputDepth;
-  PelImage* m_pcRightFilled     ;
-  PelImage* m_pcOutputImage     ;
-  PelImage* m_pcOutputDepth     ;
-
-  // Extrapolation
-  PelImage* m_pcInputImage      ;
-  PelImage* m_pcInputDepth      ;
-  PelImage* m_pcFilled          ;
-
-  //Temp
-  PelImage* m_pcTempImage       ;
-};
-
-#endif // NH_3D
 #endif //__TRENTOP__
