Ignore:
Timestamp:
4 May 2015, 18:38:08 (10 years ago)
Author:
tech
Message:

Update to HM-16.5.
Starting point for further re-activation of 3D-tools.

Includes:

active:

  • MV-HEVC
  • 3D-HLS (apart from DLT)
  • VSO

inactive:

  • remaining 3D-HEVC tools.
Location:
branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenFilter.cpp

    r1179 r1200  
    3636#include "TRenFilter.h"
    3737#include "TRenInterpFilter.h"
    38 #if H_3D
     38#if NH_3D
    3939
    4040///// COMMON /////
    41 Void TRenFilter::setSubPelShiftLUT( Int iLutPrec, Int** piSubPelShiftLUT, Int iShift )
     41template<UInt bitDepth>
     42Void TRenFilter<bitDepth>::setSubPelShiftLUT( Int iLutPrec, Int** piSubPelShiftLUT, Int iShift )
    4243{
    4344  //ToDo: use same rounding for left and right
     
    5960  }
    6061}
    61 
    62 Void TRenFilter::setupZLUT( Bool bBlendUseDistWeight, Int iBlendZThresPerc, Int iRelDistToLeft, Int** ppiBaseShiftLUTLeft, Int** ppiBaseShiftLUTRight, Int& riBlendZThres, Int& riBlendDistWeight, Int* piInvZLUTLeft, Int* piInvZLUTRight )
     62template<UInt bitDepth>
     63Void TRenFilter<bitDepth>::setupZLUT( Bool bBlendUseDistWeight, Int iBlendZThresPerc, Int iRelDistToLeft, Int** ppiBaseShiftLUTLeft, Int** ppiBaseShiftLUTRight, Int& riBlendZThres, Int& riBlendDistWeight, Int* piInvZLUTLeft, Int* piInvZLUTRight )
    6364{
    6465  AOT( iRelDistToLeft == -1 );
     
    7576}
    7677
    77 Void TRenFilter::filledToUsedPelMap( PelImage* pcFilledImage, PelImage* pcUsedPelsImage, Int iUsedPelMapMarExt )
     78template<UInt bitDepth>
     79Void TRenFilter<bitDepth>::filledToUsedPelMap( PelImage* pcFilledImage, PelImage* pcUsedPelsImage, Int iUsedPelMapMarExt )
    7880{
    7981  // Convert to binary map
     
    156158
    157159/////////// Copy /////////////
    158 Void TRenFilter::copy(Pel* pcInputPlaneData, Int iInputStride, Int iWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
     160template<UInt bitDepth>
     161Void TRenFilter<bitDepth>::copy(const Pel* pcInputPlaneData, Int iInputStride, Int iWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
    159162{
    160163  xDistributeArray(pcInputPlaneData, iInputStride, 1, 1, iWidth, iHeight ,pcOutputPlaneData, iOutputStride, 1 , 1 );
     
    163166
    164167/////////// Horizontal Mirror ///////////
    165 template <typename T>
    166 Void TRenFilter::mirrorHor( TRenImage<T> *pcImage )
     168template<UInt bitDepth> template <typename T>
     169Void TRenFilter<bitDepth>::mirrorHor( TRenImage<T> *pcImage )
    167170{
    168171  for (UInt uCurPlane = 0 ; uCurPlane < pcImage->getNumberOfPlanes(); uCurPlane++ )
     
    172175}
    173176
    174 template <typename T>
    175 Void TRenFilter::mirrorHor( TRenImagePlane<T> *pcImagePlane )
     177template<UInt bitDepth> template <typename T>
     178Void TRenFilter<bitDepth>::mirrorHor( TRenImagePlane<T> *pcImagePlane )
    176179{
    177180  T* pcPlaneData = pcImagePlane->getPlaneDataOrg();
     
    194197
    195198/////////// Comparison ///////////
    196 Int64 TRenFilter::SSE   (PelImagePlane* pcInputPlane1, PelImagePlane* pcInputPlane2, Bool bLuma )
     199template<UInt bitDepth>
     200Int64 TRenFilter<bitDepth>::SSE   (PelImagePlane* pcInputPlane1, PelImagePlane* pcInputPlane2, Bool bLuma )
    197201{
    198202  UInt uiWidth     = pcInputPlane1->getWidth();
     
    208212}
    209213
    210 Int64 TRenFilter::SSE( Pel* piSrc1, Int iSrcStride1, Int iWidth, Int iHeight,  Pel* piSrc2, Int iSrcStride2, Bool bLuma )
     214template<UInt bitDepth>
     215Int64 TRenFilter<bitDepth>::SSE( Pel* piSrc1, Int iSrcStride1, Int iWidth, Int iHeight,  Pel* piSrc2, Int iSrcStride2, Bool bLuma )
    211216{
    212217  Int64 iSSE = 0;
    213218
    214219
    215   Int iShift = DISTORTION_PRECISION_ADJUSTMENT( ( bLuma ? g_bitDepthY : g_bitDepthC ) - 8 ) << 1 ;
     220  Int iShift = ( bitDepth - 8 ) << 1 ;
    216221  for(Int iPosY = 0; iPosY < iHeight; iPosY++)
    217222  {
     
    227232}
    228233
    229 template <typename T>
    230 Bool TRenFilter::compare( TRenImage<T> *pInputImage1, TRenImage<T> *pInputImage2 )
     234template<UInt bitDepth> template <typename T>
     235Bool TRenFilter<bitDepth>::compare( TRenImage<T> *pInputImage1, TRenImage<T> *pInputImage2 )
    231236{
    232237  Bool bIsEqual = true;
     
    238243}
    239244
    240 template <typename T>
    241 Bool TRenFilter::compare   (TRenImagePlane<T>* pcInputPlane1  , TRenImagePlane<T>* pcInputPlane2   )
     245template<UInt bitDepth> template <typename T>
     246Bool TRenFilter<bitDepth>::compare   (TRenImagePlane<T>* pcInputPlane1  , TRenImagePlane<T>* pcInputPlane2   )
    242247{
    243248  UInt uiWidth  = pcInputPlane1->getWidth();
     
    265270
    266271/////////// Sampling ///////////
    267 
    268 inline Void TRenFilter::sampleUp2Tap13(PelImage* pcInputImage, PelImage* pcOutputImage)
     272template<UInt bitDepth>
     273inline Void TRenFilter<bitDepth>::sampleUp2Tap13(PelImage* pcInputImage, PelImage* pcOutputImage)
    269274{ // UpSampling from JSVM Software (DownConvertStatic) ???
    270275
    271   AOF( g_bitDepthC == g_bitDepthY );
    272276  UInt uiNumPlanes = pcInputImage->getNumberOfPlanes();
    273277
     
    400404      {
    401405        // Scale and copy to image buffer.
    402         pcOutputPlaneData[iOffset+i] = ClipY((Pel) ((piDst[i] + iAddH) / iDivH));
     406        pcOutputPlaneData[iOffset+i] = ClipBD((Pel) ((piDst[i] + iAddH) / iDivH), bitDepth);
    403407      }
    404408    }
     
    410414}
    411415
    412 
    413 Void TRenFilter::sampleDown2Tap13(PelImage* pcInputImage, PelImage* pcOutputImage)
     416template<UInt bitDepth>
     417Void TRenFilter<bitDepth>::sampleDown2Tap13(PelImage* pcInputImage, PelImage* pcOutputImage)
    414418{ // DownSampling from JSVM Software (DownConvertStatic) ??
    415419
     
    422426};
    423427
    424 Void TRenFilter::sampleDown2Tap13( Pel* pcInputPlaneData, Int iInputStride, Int iWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
     428template<UInt bitDepth>
     429Void TRenFilter<bitDepth>::sampleDown2Tap13( Pel* pcInputPlaneData, Int iInputStride, Int iWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
    425430{ // DownSampling from JSVM Software (DownConvertStatic) ??
    426  
    427   AOF( g_bitDepthC == g_bitDepthY );
    428431
    429432  Int iOffset, iPosX, iPosY, k;
     
    549552    {
    550553      // Scale and copy back to image buffer.
    551       pcOutputPlaneData[iOutputStride*iPosY+iPosX] = ClipY( ( Pel) ( (piDst[iPosY] + iAddV) / iDivV));
     554      pcOutputPlaneData[iOutputStride*iPosY+iPosX] = ClipBD( ( Pel) ( (piDst[iPosY] + iAddV) / iDivV), bitDepth );
    552555    }
    553556  }
     
    557560}
    558561
    559 Void TRenFilter::sampleDown2Tap13(PelImagePlane* pcInputPlane, PelImagePlane* pcOutputPlane)
     562template<UInt bitDepth>
     563Void TRenFilter<bitDepth>::sampleDown2Tap13(PelImagePlane* pcInputPlane, PelImagePlane* pcOutputPlane)
    560564{ // DownSampling from JSVM Software (DownConvertStatic) ??
    561565  Int iWidth       = pcInputPlane->getWidth();
     
    574578};
    575579
    576 Void TRenFilter::sampleVerDown2Tap13( PelImagePlane* pcInputPlane, PelImagePlane* pcOutputPlane, Int uiPad)
    577 {
    578   assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth
     580template<UInt bitDepth>
     581Void TRenFilter<bitDepth>::sampleVerDown2Tap13( PelImagePlane* pcInputPlane, PelImagePlane* pcOutputPlane, Int uiPad)
     582
    579583  // DownSampling from JSVM Software (DownConvertStatic) ??
    580584  Int iWidth       = pcInputPlane->getWidth();
     
    622626
    623627      Int iSum = iTmp4 + iTmp3 - iTmp2 + ((iTmp0 + iTmp4 + iTmp5 - iTmp2) << 1) + ( ( iTmp3 - iTmp1)  << 2) + (  iTmp5 << 3 ) + (( iTmp4 + iTmp5 ) << 4);
    624       pcOutputPlaneData[ iXPos ] = (Pel) ClipY((iSum + 32) >> 6);
     628      pcOutputPlaneData[ iXPos ] = (Pel) ClipBD((iSum + 32) >> 6, bitDepth);
    625629      pcTmpIn++;
    626630    }
     
    630634};
    631635
    632 Void TRenFilter::sampleHorDown2Tap13( PelImagePlane* pcInputPlane, PelImagePlane* pcOutputPlane, Int uiPad )
     636template<UInt bitDepth>
     637Void TRenFilter<bitDepth>::sampleHorDown2Tap13( PelImagePlane* pcInputPlane, PelImagePlane* pcOutputPlane, Int uiPad )
    633638{
    634   assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth
    635   // DownSampling from JSVM Software (DownConvertStatic) ??
     639    // DownSampling from JSVM Software (DownConvertStatic) ??
    636640  Int iWidth       = pcInputPlane->getWidth();
    637641  Int iHeight      = pcInputPlane->getHeight();
     
    663667
    664668      Int iSum = iTmp4 + iTmp3 - iTmp2 + ((iTmp0 + iTmp4 + iTmp5 - iTmp2) << 1) + ( ( iTmp3 - iTmp1)  << 2) + (  iTmp5 << 3 ) + (( iTmp4 + iTmp5 ) << 4);
    665       pcOutputPlaneData[ iXPos ] = (Pel) ClipY((iSum + 32) >> 6);
     669      pcOutputPlaneData[ iXPos ] = (Pel) ClipBD((iSum + 32) >> 6, bitDepth);
    666670      pcTmpIn += 2;
    667671    }
     
    671675};
    672676
    673 inline Pel TRenFilter::xMedian3(Pel* pcData)
     677template<UInt bitDepth>
     678inline Pel TRenFilter<bitDepth>::xMedian3(Pel* pcData)
    674679{
    675680  Bool bGT01 = pcData[0] >  pcData[1];
     
    680685}
    681686
    682 
    683 Void TRenFilter::lineMedian3( PelImage* pcImage )
     687template<UInt bitDepth>
     688Void TRenFilter<bitDepth>::lineMedian3( PelImage* pcImage )
    684689{
    685690
     
    722727}
    723728
    724 
    725 Void TRenFilter::convRect( PelImage* pcImage, UInt uiSize )
     729template<UInt bitDepth>
     730Void TRenFilter<bitDepth>::convRect( PelImage* pcImage, UInt uiSize )
    726731{
    727732  DoubleImage cKernel(uiSize, uiSize,1,0);
     
    730735}
    731736
    732 Void TRenFilter::binominal( PelImage* pcInputImage, PelImage* pcOutputImage, UInt uiSize )
     737template<UInt bitDepth>
     738Void TRenFilter<bitDepth>::binominal( PelImage* pcInputImage, PelImage* pcOutputImage, UInt uiSize )
    733739{
    734740  assert( pcInputImage->getNumberOfFullPlanes()   == pcOutputImage->getNumberOfFullPlanes  () );
     
    747753}
    748754
    749 Void TRenFilter::binominal( PelImagePlane* pcInputPlane, PelImagePlane* pcOutputPlane, UInt uiSize )
     755template<UInt bitDepth>
     756Void TRenFilter<bitDepth>::binominal( PelImagePlane* pcInputPlane, PelImagePlane* pcOutputPlane, UInt uiSize )
    750757{
    751758  Int iWidth  = pcInputPlane ->getWidth ();
     
    777784  {
    778785  case 1:
    779     fpFilter = &TRenFilter::xFiltBinom3;
     786    fpFilter = &TRenFilter<bitDepth>::xFiltBinom3;
    780787    break;
    781788  case 2:
    782     fpFilter = &TRenFilter::xFiltBinom5;
     789    fpFilter = &TRenFilter<bitDepth>::xFiltBinom5;
    783790    break;
    784791  case 3:
    785     fpFilter = &TRenFilter::xFiltBinom7;
     792    fpFilter = &TRenFilter<bitDepth>::xFiltBinom7;
    786793    break;
    787794  case 4:
    788     fpFilter = &TRenFilter::xFiltBinom9;
     795    fpFilter = &TRenFilter<bitDepth>::xFiltBinom9;
    789796    break;
    790797  default:
     
    818825}
    819826
    820 Pel TRenFilter::xFiltBinom3( Pel* pcInputData, Int iStride )
    821 {
    822   assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth
    823 
     827template<UInt bitDepth>
     828Pel TRenFilter<bitDepth>::xFiltBinom3( Pel* pcInputData, Int iStride )
     829{
    824830  Int iSum = pcInputData[-1 * iStride ] + pcInputData[ 0 ] +  (pcInputData[iStride ] << 1 );
    825   return ClipY( (iSum +  2) >>  2 );
    826 }
    827 
    828 Pel TRenFilter::xFiltBinom5( Pel* pcInputData, Int iStride )
    829 {
    830   assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth
    831   // { 1,4,6,4,1 }
     831  return ClipBD( (iSum +  2) >>  2 , bitDepth);
     832}
     833
     834template<UInt bitDepth>
     835Pel TRenFilter<bitDepth>::xFiltBinom5( Pel* pcInputData, Int iStride )
     836{
     837    // { 1,4,6,4,1 }
    832838  Int iStride0  = 0;
    833839  Int iStrideM1 = iStride0  - iStride;
     
    841847
    842848  Int iSum = iTmp0 +  (iTmp2 << 1) + ((iTmp1 + iTmp2) << 2);
    843   return ClipY( (iSum +  8) >>  4 );
    844 }
    845 
    846 Pel TRenFilter::xFiltBinom7( Pel* pcInputData, Int iStride )
    847 {
    848   assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth
    849   // { 1,6,15,20,15,6,1 }
     849  return ClipBD( (iSum +  8) >>  4 , bitDepth);
     850}
     851
     852template<UInt bitDepth>
     853Pel TRenFilter<bitDepth>::xFiltBinom7( Pel* pcInputData, Int iStride )
     854{
     855    // { 1,6,15,20,15,6,1 }
    850856  Int iStride0  = 0;
    851857  Int iStrideM1 = iStride0  - iStride;
     
    863869  Int iSum = iTmp0 - iTmp2 + ( iTmp1  << 1) + ( (iTmp1 + iTmp3) << 2) + ((iTmp2 + iTmp3) << 4);
    864870
    865   return ClipY( (iSum +  32) >>  6 );
    866 }
    867 
    868 Pel TRenFilter::xFiltBinom9( Pel* pcInputData, Int iStride )
    869 {
    870   assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth
     871  return ClipBD( (iSum +  32) >>  6 , bitDepth);
     872}
     873
     874template<UInt bitDepth>
     875Pel TRenFilter<bitDepth>::xFiltBinom9( Pel* pcInputData, Int iStride )
     876{
    871877  // {  1     8    28    56    70    56    28     8     1 }
    872878  Int iStride0  = 0;
     
    888894  Int iSum = iTmp0 + ((iTmp4 ) << 1) + ( ( iTmp4 - iTmp2 ) << 2) +  ( (iTmp1 - iTmp3) << 3 ) +  ((iTmp2 ) << 5) + ((iTmp3+ iTmp4 ) << 6);
    889895
    890   return ClipY( (iSum +  128) >>  8 );
    891 }
    892 
    893 
    894 Pel TRenFilter::interpCHSpline(Double dX, Double dS0, Double dS1, Int iQ0, Int iQ1, Int iQ2, Int iQ3)
     896  return ClipBD( (iSum +  128) >>  8 , bitDepth);
     897}
     898
     899template<UInt bitDepth>
     900Pel TRenFilter<bitDepth>::interpCHSpline(Double dX, Double dS0, Double dS1, Int iQ0, Int iQ1, Int iQ2, Int iQ3)
    895901{
    896902  Double dSq = (dX - dS0) / (dS1 - dS0);
     
    916922}
    917923
    918 Void TRenFilter::diffHorSym(PelImage* pcInputImage, IntImage* pcOutputImage)
     924template<UInt bitDepth>
     925Void TRenFilter<bitDepth>::diffHorSym(PelImage* pcInputImage, IntImage* pcOutputImage)
    919926{
    920927  for (UInt uiCurPlane = 0; uiCurPlane < pcInputImage->getNumberOfPlanes(); uiCurPlane++)
     
    924931}
    925932
    926 Void TRenFilter::diffHorSym(PelImagePlane* pcInputPlane, IntImagePlane* pcOutputPlane)
     933template<UInt bitDepth>
     934Void TRenFilter<bitDepth>::diffHorSym(PelImagePlane* pcInputPlane, IntImagePlane* pcOutputPlane)
    927935{
    928936  UInt uiInputStride = pcInputPlane ->getStride();
     
    950958}
    951959
    952 Void TRenFilter::laplace( DoubleImage* pcInputImage, DoubleImage* pcOutputImage )
     960template<UInt bitDepth>
     961Void TRenFilter<bitDepth>::laplace( DoubleImage* pcInputImage, DoubleImage* pcOutputImage )
    953962{
    954963  for (UInt uiCurPlane = 0; uiCurPlane < pcInputImage->getNumberOfPlanes(); uiCurPlane++)
     
    10221031}
    10231032
    1024 
    1025 Void TRenFilter::conv( PelImage* pcImage, DoubleImage* pcKernel )
     1033template<UInt bitDepth>
     1034Void TRenFilter<bitDepth>::conv( PelImage* pcImage, DoubleImage* pcKernel )
    10261035{
    10271036  PelImage* pcTemp = pcImage->create();
     
    10961105
    10971106// Horizontal Up sampling luma
    1098 Void TRenFilter::sampleHorUp( Int iLog2HorSampFac, Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
    1099 {
    1100   TRenInterpFilter cFilter;
     1107template<UInt bitDepth>
     1108Void TRenFilter<bitDepth>::sampleHorUp( Int iLog2HorSampFac, Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
     1109{
     1110  TRenInterpFilter<bitDepth> cFilter;
    11011111  switch ( iLog2HorSampFac )
    11021112  {
     
    11181128
    11191129// horizontal up sampling chroma
    1120 Void TRenFilter::sampleCHorUp(Int iLog2HorSampFac, Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
     1130template<UInt bitDepth>
     1131Void TRenFilter<bitDepth>::sampleCHorUp(Int iLog2HorSampFac, Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
    11211132{
    11221133  switch ( iLog2HorSampFac )
     
    11271138  case 1:
    11281139    xDistributeArray( pcInputPlaneData,   iInputStride  , 1, 1, iInputWidth,   iHeight   , pcOutputPlaneData                  , iOutputStride, 2 , 1 );
    1129     xInterpHorChroma( pcInputPlaneData  , iInputStride  , 1, 1, iInputWidth,   iHeight   , pcOutputPlaneData                +1, iOutputStride, 2 , 1, &TRenInterpFilter::xCTI_Filter_VPS04_C_HAL );
     1140    xInterpHorChroma( pcInputPlaneData  , iInputStride  , 1, 1, iInputWidth,   iHeight   , pcOutputPlaneData                +1, iOutputStride, 2 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VPS04_C_HAL );
    11301141    break;
    11311142  case 2:
    11321143    xDistributeArray( pcInputPlaneData,   iInputStride  , 1, 1, iInputWidth,   iHeight   , pcOutputPlaneData                  , iOutputStride, 4 , 1 );
    1133     xInterpHorChroma( pcInputPlaneData  , iInputStride  , 1, 1, iInputWidth,   iHeight   , pcOutputPlaneData                +1, iOutputStride, 4 , 1, &TRenInterpFilter::xCTI_Filter_VP04_C_QUA0 );
    1134     xInterpHorChroma( pcInputPlaneData  , iInputStride  , 1, 1, iInputWidth,   iHeight   , pcOutputPlaneData                +2, iOutputStride, 4 , 1, &TRenInterpFilter::xCTI_Filter_VPS04_C_HAL );
    1135     xInterpHorChroma( pcInputPlaneData  , iInputStride  , 1, 1, iInputWidth,   iHeight   , pcOutputPlaneData                +3, iOutputStride, 4 , 1, &TRenInterpFilter::xCTI_Filter_VP04_C_QUA1 );
    1136     break;
    1137   }
    1138 }
    1139 
    1140 Void TRenFilter::sampleCUpHorUp( Int iLog2HorSampFac, Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
     1144    xInterpHorChroma( pcInputPlaneData  , iInputStride  , 1, 1, iInputWidth,   iHeight   , pcOutputPlaneData                +1, iOutputStride, 4 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VP04_C_QUA0 );
     1145    xInterpHorChroma( pcInputPlaneData  , iInputStride  , 1, 1, iInputWidth,   iHeight   , pcOutputPlaneData                +2, iOutputStride, 4 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VPS04_C_HAL );
     1146    xInterpHorChroma( pcInputPlaneData  , iInputStride  , 1, 1, iInputWidth,   iHeight   , pcOutputPlaneData                +3, iOutputStride, 4 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VP04_C_QUA1 );
     1147    break;
     1148  }
     1149}
     1150
     1151template<UInt bitDepth>
     1152Void TRenFilter<bitDepth>::sampleCUpHorUp( Int iLog2HorSampFac, Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
    11411153{
    11421154
     
    11451157  case 0:
    11461158    xDistributeArray( pcInputPlaneData-1, iInputStride  , 1, 1, iInputWidth+3, iHeight   , pcOutputPlaneData                -2, iOutputStride, 2,  2 );
    1147     xInterpVerChroma( pcInputPlaneData-1, iInputStride  , 1, 1, iInputWidth+3, iHeight   , pcOutputPlaneData+1*iOutputStride-2, iOutputStride, 2 , 2, &TRenInterpFilter::xCTI_Filter_VPS04_C_HAL );
    1148     xInterpHorChroma( pcOutputPlaneData , iOutputStride , 2, 1, iInputWidth,   iHeight*2 , pcOutputPlaneData+1                , iOutputStride, 2 , 1, &TRenInterpFilter::xCTI_Filter_VPS04_C_HAL );
     1159    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 );
     1160    xInterpHorChroma( pcOutputPlaneData , iOutputStride , 2, 1, iInputWidth,   iHeight*2 , pcOutputPlaneData+1                , iOutputStride, 2 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VPS04_C_HAL );
    11491161    break;
    11501162  case 1:
    11511163    xDistributeArray( pcInputPlaneData-1, iInputStride  , 1, 1, iInputWidth+3, iHeight   , pcOutputPlaneData                -4, iOutputStride, 4 , 2 );
    1152     xInterpVerChroma( pcInputPlaneData-1, iInputStride  , 1, 1, iInputWidth+3, iHeight   , pcOutputPlaneData+1*iOutputStride-4, iOutputStride, 4 , 2, &TRenInterpFilter::xCTI_Filter_VPS04_C_HAL );
    1153     xInterpHorChroma( pcOutputPlaneData , iOutputStride , 4, 1, iInputWidth, iHeight*2 , pcOutputPlaneData                +1, iOutputStride, 4 , 1, &TRenInterpFilter::xCTI_Filter_VP04_C_QUA0 );
    1154     xInterpHorChroma( pcOutputPlaneData , iOutputStride , 4, 1, iInputWidth, iHeight*2 , pcOutputPlaneData                +2, iOutputStride, 4 , 1, &TRenInterpFilter::xCTI_Filter_VPS04_C_HAL );
    1155     xInterpHorChroma( pcOutputPlaneData , iOutputStride , 4, 1, iInputWidth, iHeight*2 , pcOutputPlaneData                +3, iOutputStride, 4 , 1, &TRenInterpFilter::xCTI_Filter_VP04_C_QUA1 );
     1164    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 );
     1165    xInterpHorChroma( pcOutputPlaneData , iOutputStride , 4, 1, iInputWidth, iHeight*2 , pcOutputPlaneData                +1, iOutputStride, 4 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VP04_C_QUA0 );
     1166    xInterpHorChroma( pcOutputPlaneData , iOutputStride , 4, 1, iInputWidth, iHeight*2 , pcOutputPlaneData                +2, iOutputStride, 4 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VPS04_C_HAL );
     1167    xInterpHorChroma( pcOutputPlaneData , iOutputStride , 4, 1, iInputWidth, iHeight*2 , pcOutputPlaneData                +3, iOutputStride, 4 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VP04_C_QUA1 );
    11561168    break;
    11571169  case 2:
    11581170    xDistributeArray( pcInputPlaneData-1, iInputStride  , 1, 1, iInputWidth+3, iHeight   , pcOutputPlaneData                -8, iOutputStride, 8 , 2 );
    1159     xInterpVerChroma( pcInputPlaneData-1, iInputStride  , 1, 1, iInputWidth+3, iHeight   , pcOutputPlaneData+1*iOutputStride-8, iOutputStride, 8 , 2, &TRenInterpFilter::xCTI_Filter_VPS04_C_HAL );
    1160     xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth,   iHeight*2 , pcOutputPlaneData                +1, iOutputStride, 8 , 1, &TRenInterpFilter::xCTI_Filter_VP04_C_OCT0 );
    1161     xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth,   iHeight*2 , pcOutputPlaneData                +2, iOutputStride, 8 , 1, &TRenInterpFilter::xCTI_Filter_VP04_C_QUA0 );
    1162     xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth,   iHeight*2 , pcOutputPlaneData                +3, iOutputStride, 8 , 1, &TRenInterpFilter::xCTI_Filter_VP04_C_OCT1 );
    1163     xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth,   iHeight*2 , pcOutputPlaneData                +4, iOutputStride, 8 , 1, &TRenInterpFilter::xCTI_Filter_VPS04_C_HAL );
    1164     xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth,   iHeight*2 , pcOutputPlaneData                +5, iOutputStride, 8 , 1, &TRenInterpFilter::xCTI_Filter_VP04_C_OCT2 );
    1165     xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth,   iHeight*2 , pcOutputPlaneData                +6, iOutputStride, 8 , 1, &TRenInterpFilter::xCTI_Filter_VP04_C_QUA1 );
    1166     xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth,   iHeight*2 , pcOutputPlaneData                +7, iOutputStride, 8 , 1, &TRenInterpFilter::xCTI_Filter_VP04_C_OCT3 );
     1171    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 );
     1172    xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth,   iHeight*2 , pcOutputPlaneData                +1, iOutputStride, 8 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VP04_C_OCT0 );
     1173    xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth,   iHeight*2 , pcOutputPlaneData                +2, iOutputStride, 8 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VP04_C_QUA0 );
     1174    xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth,   iHeight*2 , pcOutputPlaneData                +3, iOutputStride, 8 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VP04_C_OCT1 );
     1175    xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth,   iHeight*2 , pcOutputPlaneData                +4, iOutputStride, 8 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VPS04_C_HAL );
     1176    xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth,   iHeight*2 , pcOutputPlaneData                +5, iOutputStride, 8 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VP04_C_OCT2 );
     1177    xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth,   iHeight*2 , pcOutputPlaneData                +6, iOutputStride, 8 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VP04_C_QUA1 );
     1178    xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth,   iHeight*2 , pcOutputPlaneData                +7, iOutputStride, 8 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VP04_C_OCT3 );
    11671179    break;
    11681180  }
     
    11711183// Down Sampling
    11721184// Down sample luma
    1173 Void TRenFilter::sampleHorDown(Int iLog2HorSampFac,  Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
     1185template<UInt bitDepth>
     1186Void TRenFilter<bitDepth>::sampleHorDown(Int iLog2HorSampFac,  Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
    11741187{
    11751188  switch ( iLog2HorSampFac )
     
    11871200}
    11881201
    1189 
    1190 Void TRenFilter::sampleCHorDown(Int iLog2HorSampFac,  Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
     1202template<UInt bitDepth>
     1203Void TRenFilter<bitDepth>::sampleCHorDown(Int iLog2HorSampFac,  Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
    11911204{
    11921205  //GT: currently the same as for luma
     
    11971210
    11981211// Up sampling chroma
    1199 Void TRenFilter::sampleCDownHorDown( Int iLog2HorSampFac,  Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iInputHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
     1212template<UInt bitDepth>
     1213Void TRenFilter<bitDepth>::sampleCDownHorDown( Int iLog2HorSampFac,  Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iInputHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
    12001214{
    12011215  // create buffer
     
    12191233}
    12201234
    1221 Void TRenFilter::xDistributeArray(Pel* pcSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* pcDst, Int iDstStride, Int iDstStepX, Int iDstStepY)
     1235template<UInt bitDepth>
     1236Void TRenFilter<bitDepth>::xDistributeArray(const Pel* pcSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* pcDst, Int iDstStride, Int iDstStepX, Int iDstStepY)
    12221237{
    12231238  iDstStride *= iDstStepY;
     
    12261241  {
    12271242    Pel* pcCurDst = pcDst;
    1228     Pel* pcCurSrc  = pcSrc;
     1243    const Pel* pcCurSrc  = pcSrc;
    12291244    for (Int iXPos = 0; iXPos < iWidth; iXPos ++)
    12301245    {
     
    12391254}
    12401255
    1241 Void TRenFilter::xInterpHorChroma( Pel* piSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* piDst, Int iDstStride, Int iDstStepX, Int iDstStepY, FpChromaIntFilt fpFilter )
    1242 {
    1243   assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth
     1256template<UInt bitDepth>
     1257Void 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 )
     1258{
    12441259  Int   iSum;
    12451260  Pel*  piSrcTmp;
    12461261
    1247   TRenInterpFilter cFilter;
     1262  TRenInterpFilter<REN_BIT_DEPTH> cFilter;
    12481263  for ( Int y = iHeight; y != 0; y-- )
    12491264  {
     
    12521267    {
    12531268      iSum      = (cFilter.*fpFilter)( piSrcTmp,  iSrcStepX );
    1254       piDst[x * iDstStepX ] =  ClipC ((iSum +  32) >>  6 );
     1269      piDst[x * iDstStepX ] =  ClipBD ((iSum +  32) >>  6 , bitDepth);
    12551270      piSrcTmp+= iSrcStepX;
    12561271    }
     
    12601275}
    12611276
    1262 Void TRenFilter::xInterpVerChroma( Pel* piSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* piDst, Int iDstStride, Int iDstStepX, Int iDstStepY, FpChromaIntFilt fpFilter )
    1263 {
    1264   assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth
     1277template<UInt bitDepth>
     1278Void 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 )
     1279{
    12651280  Int   iSum;
    12661281  Pel*  piSrcTmp;
    12671282
    1268   TRenInterpFilter cFilter;
     1283  TRenInterpFilter<bitDepth> cFilter;
    12691284  for ( Int y = iHeight; y != 0; y-- )
    12701285  {
     
    12731288    {
    12741289      iSum      = (cFilter.*fpFilter)( piSrcTmp,  iSrcStepY * iSrcStride );
    1275       piDst[x * iDstStepX ]  =  ClipC ((iSum +  32) >>  6 );
     1290      piDst[x * iDstStepX ]  =  ClipBD ((iSum +  32) >>  6, bitDepth );
    12761291      piSrcTmp += iSrcStepX;
    12771292    }
     
    12811296}
    12821297
    1283 
    1284 Void TRenFilter::xSampleDownHor2( Pel* piSrc, Int iSrcStride, Int iSrcWidth, Int iHeight, Pel* piDst, Int iDstStride  )
    1285 {
    1286  
    1287   assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth
     1298template<UInt bitDepth>
     1299Void TRenFilter<bitDepth>::xSampleDownHor2( Pel* piSrc, Int iSrcStride, Int iSrcWidth, Int iHeight, Pel* piDst, Int iDstStride  )
     1300{
    12881301
    12891302  Int   iSum;
     
    12981311      // { 1,2,1 }
    12991312      iSum = piSrcTmp[0] + piSrcTmp[2] +  (piSrcTmp[1] << 1);
    1300       piDst[x] = ClipY( (iSum +  2) >>  2 );
     1313      piDst[x] = ClipBD( (iSum +  2) >>  2 , bitDepth);
    13011314      piSrcTmp += 2;
    13021315    }
     
    13061319};
    13071320
    1308 Void TRenFilter::xSampleDownVer2( Pel* piSrc, Int iSrcStride, Int iSrcWidth, Int iSrcHeight, Pel* piDst, Int iDstStride  )
    1309 {
    1310   assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth
    1311 
     1321template<UInt bitDepth>
     1322Void TRenFilter<bitDepth>::xSampleDownVer2( Pel* piSrc, Int iSrcStride, Int iSrcWidth, Int iSrcHeight, Pel* piDst, Int iDstStride  )
     1323{
    13121324  Int   iSum;
    13131325  Pel*  piSrcTmp;
     
    13201332      // { 1,2,1 }
    13211333      iSum = piSrcTmp[0] + piSrcTmp[ iSrcStride << 1] +  (piSrcTmp[ iSrcStride ] << 1);
    1322       piDst[x] = ClipY( (iSum +  2) >>  2 );
     1334      piDst[x] = ClipBD( (iSum +  2) >>  2, bitDepth );
    13231335      piSrcTmp += 1;
    13241336    }
     
    13281340};
    13291341
    1330 Void TRenFilter::xSampleDownHor4( Pel* piSrc, Int iSrcStride, Int iSrcWidth, Int iHeight, Pel* piDst, Int iDstStride  )
    1331 {
    1332   assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth
     1342template<UInt bitDepth>
     1343Void TRenFilter<bitDepth>::xSampleDownHor4( Pel* piSrc, Int iSrcStride, Int iSrcWidth, Int iHeight, Pel* piDst, Int iDstStride  )
     1344{
    13331345
    13341346  Int   iSum;
     
    13481360
    13491361      iSum = iTmp0 +  (iTmp2 << 1) + ((iTmp1 + iTmp2) << 2);
    1350       piDst[x] = ClipY( (iSum +  8) >>  4 );
     1362      piDst[x] = ClipBD( (iSum +  8) >>  4, bitDepth );
    13511363      piSrcTmp += 4;
    13521364    }
     
    13561368};
    13571369
    1358 Void TRenFilter::xSampleDownHor8( Pel* piSrc, Int iSrcStride, Int iSrcWidth, Int iHeight, Pel* piDst, Int iDstStride  )
    1359 {
    1360   assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth
    1361 
     1370template<UInt bitDepth>
     1371Void TRenFilter<bitDepth>::xSampleDownHor8( Pel* piSrc, Int iSrcStride, Int iSrcWidth, Int iHeight, Pel* piDst, Int iDstStride  )
     1372{
    13621373  Int   iSum;
    13631374  Pel*  piSrcTmp;
     
    13771388
    13781389      iSum = iTmp0 - iTmp2 + ( iTmp1  << 1) + ( (iTmp1 + iTmp3) << 2) + ((iTmp2 + iTmp3) << 4);
    1379       piDst[x] = ClipY( (iSum +  32) >>  6 );
     1390      piDst[x] = ClipBD( (iSum +  32) >>  6 , bitDepth);
    13801391      piSrcTmp += 8;
    13811392    }
     
    13851396};
    13861397
    1387 Void TRenFilter::xDilate( Pel* piSrc, Int iSrcStride, Int iWidth, Int iHeight, Pel* piDst, Int iDstStride, Int iSize, Bool bVerticalDir, Bool bToTopOrLeft )
     1398template<UInt bitDepth>
     1399Void TRenFilter<bitDepth>::xDilate( Pel* piSrc, Int iSrcStride, Int iWidth, Int iHeight, Pel* piDst, Int iDstStride, Int iSize, Bool bVerticalDir, Bool bToTopOrLeft )
    13881400{
    13891401  Int iFDimStart   = 0;
     
    14521464
    14531465
    1454 template Bool TRenFilter::compare   (TRenImage<Pel     >*, TRenImage<Pel>*      );
    1455 template Bool TRenFilter::compare   (TRenImagePlane<Pel>*, TRenImagePlane<Pel>* );
    1456 
    1457 template Void TRenFilter::mirrorHor(        TRenImage<Double>        *pcImage );
    1458 template Void TRenFilter::mirrorHor(        TRenImage<Pel>           *pcImage );
    1459 template Void TRenFilter::mirrorHor(        TRenImage<Int>           *pcImage );
    1460 template Void TRenFilter::mirrorHor(        TRenImagePlane<Pel>      *pcImagePlane );
     1466template class TRenFilter<REN_BIT_DEPTH>;
     1467
     1468template Bool TRenFilter<REN_BIT_DEPTH>::compare   (TRenImage<Pel     >*, TRenImage<Pel>*      );
     1469template Bool TRenFilter<REN_BIT_DEPTH>::compare   (TRenImagePlane<Pel>*, TRenImagePlane<Pel>* );
     1470                         
     1471template Void TRenFilter<REN_BIT_DEPTH>::mirrorHor( TRenImage<Double>        *pcImage );
     1472template Void TRenFilter<REN_BIT_DEPTH>::mirrorHor( TRenImage<Pel>           *pcImage );
     1473template Void TRenFilter<REN_BIT_DEPTH>::mirrorHor( TRenImage<Int>           *pcImage );
     1474template Void TRenFilter<REN_BIT_DEPTH>::mirrorHor( TRenImagePlane<Pel>      *pcImagePlane );
    14611475
    14621476#endif
  • branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenFilter.h

    r1179 r1200  
    3939#include "TRenImage.h"
    4040#include "TRenInterpFilter.h"
    41 #if H_3D
     41#if NH_3D
    4242
    43 typedef Int (TRenInterpFilter::*FpChromaIntFilt) ( Pel*, Int );
     43typedef Int (TRenInterpFilter<REN_BIT_DEPTH>::*FpChromaIntFilt) ( Pel*, Int );
    4444
     45template<UInt bitDepthLuma>
    4546class TRenFilter
    4647{
     
    5354
    5455  /////////// Copy ///////////
    55   static Void copy( Pel* pcInputPlaneData, Int iInputStride, Int iWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride);
     56  static Void copy( const Pel* pcInputPlaneData, Int iInputStride, Int iWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride);
    5657
    5758  /////////// Horizontal Mirroring ///////////
     
    129130  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);
    130131  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);
    131   static Void xDistributeArray(Pel* pcSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* pcDst, Int iDstStride, Int iDstStepX, Int iDstStepY );
     132  static Void xDistributeArray(const Pel* pcSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* pcDst, Int iDstStride, Int iDstStepX, Int iDstStepY );
    132133
    133134  // Binominal Filtering
  • branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenImage.cpp

    r1179 r1200  
    3737#include "TRenFilter.h"
    3838#include "assert.h"
    39 #if H_3D
     39#if NH_3D
    4040
    4141
    4242template<typename T>
    4343TRenImage<T>::TRenImage( TRenImage& rcIn )
    44 {
     44{ 
    4545  allocatePlanes( rcIn.getPlane(0)->getWidth(), rcIn.getPlane(0)->getHeight(), rcIn.getNumberOfFullPlanes(), rcIn.getNumberOfQuaterPlanes() ) ; assign(&rcIn);
    4646}
     
    4848template<typename T>
    4949TRenImage<T>::TRenImage( UInt uiWidth, UInt uiHeight, UInt uiNumberOfFullPlanes, UInt uiNumberOfQuaterPlanes )
    50 {
     50{ 
    5151  allocatePlanes( uiWidth, uiHeight, uiNumberOfFullPlanes, uiNumberOfQuaterPlanes );
    5252}
     
    5555TRenImage<T>::TRenImage() : m_uiNumberOfFullPlanes(0), m_uiNumberOfQuaterPlanes(0), m_uiNumberOfPlanes(0), m_apcPlanes(0)
    5656{
    57 
     57 
    5858}
    5959
     
    6161template<>
    6262TRenImage<Pel>::TRenImage( TComPicYuv* pcPicYuv, Bool bFirstPlaneOnly )
    63 {
     63{ 
    6464  if (bFirstPlaneOnly) //400
    6565  {
     
    6868    m_uiNumberOfQuaterPlanes = 0;
    6969    m_apcPlanes    = new TRenImagePlane<Pel>*[ m_uiNumberOfPlanes ];
    70     m_apcPlanes[0] = new TRenImagePlane<Pel>( pcPicYuv->getBufY(), pcPicYuv->getWidth() + (REN_LUMA_MARGIN << 1),   pcPicYuv->getHeight()+ (REN_LUMA_MARGIN << 1), pcPicYuv->getStride (), REN_LUMA_MARGIN );
     70    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 );
    7171  }
    7272  else //420
     
    7777
    7878    m_apcPlanes    = new TRenImagePlane<Pel>*[ m_uiNumberOfPlanes ];
    79     m_apcPlanes[0] = new TRenImagePlane<Pel>( pcPicYuv->getBufY(),   pcPicYuv->getWidth()     + (REN_LUMA_MARGIN << 1),  pcPicYuv->getHeight()      + (REN_LUMA_MARGIN << 1), pcPicYuv->getStride (), REN_LUMA_MARGIN );
    80     m_apcPlanes[1] = new TRenImagePlane<Pel>( pcPicYuv->getBufU(),   (pcPicYuv->getWidth()>>1)+  REN_LUMA_MARGIN      ,  (pcPicYuv->getHeight()>>1) +  REN_LUMA_MARGIN      , pcPicYuv->getCStride(), REN_LUMA_MARGIN >> 1 );
    81     m_apcPlanes[2] = new TRenImagePlane<Pel>( pcPicYuv->getBufV(),   (pcPicYuv->getWidth()>>1)+  REN_LUMA_MARGIN      ,  (pcPicYuv->getHeight()>>1) +  REN_LUMA_MARGIN      , pcPicYuv->getCStride(), REN_LUMA_MARGIN >> 1 );
     79    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 );
     80    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 );
     81    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 );
    8282  }
    8383}
     
    109109
    110110template<typename T>
    111 Void TRenImage<T>::getDataAndStrides( T** pptData, Int* piStrides )
     111Void TRenImage<T>::getDataAndStrides( T** pptData, Int* piStrides ) const
    112112{
    113113  for (UInt uiCurPlane = 0; uiCurPlane < m_uiNumberOfPlanes; uiCurPlane++ )
     
    120120
    121121template<typename T>
    122 Void TRenImage<T>::getWidthAndHeight( Int* ppiWidths, Int* ppiHeights )
     122Void TRenImage<T>::getWidthAndHeight( Int* ppiWidths, Int* ppiHeights ) const
    123123{
    124124  for (UInt uiCurPlane = 0; uiCurPlane < m_uiNumberOfPlanes; uiCurPlane++ )
     
    233233  for (UInt uiCurPlane = 1; uiCurPlane < m_uiNumberOfPlanes; uiCurPlane++)
    234234  {
    235     m_apcPlanes[uiCurPlane]->assign( (Pel) ( 1 << ( g_bitDepthC - 1 ) ) );
    236   }
    237 }
    238 
    239 
    240 template<class T>
    241 TRenImage<T>::~TRenImage() {
     235    m_apcPlanes[uiCurPlane]->assign( (Pel) ( 1 << ( REN_BIT_DEPTH - 1 ) ) );
     236  }
     237}
     238
     239
     240template<class T>
     241TRenImage<T>::~TRenImage()
     242{
    242243  xDeletePlanes();
    243244  delete[] m_apcPlanes;
     
    272273template Void TRenImage<Pel>::assign<Pel>    (TRenImage<Pel>*   );
    273274
    274 #endif // H_3D
     275#endif // NH_3D
  • branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenImage.h

    r1179 r1200  
    3939#include "../TLibCommon/TComPicYuv.h"
    4040#include "TRenImagePlane.h"
    41 #if H_3D
     41#if NH_3D
    4242
    4343
     
    7070  TRenImagePlane<T>** getPlanes() const;
    7171
    72   Void getDataAndStrides( T**    pptData, Int*  piStrides );
    73   Void getWidthAndHeight( Int*  piWidths, Int*  piHeights );
     72  Void getDataAndStrides ( T**    pptData, Int*  piStrides ) const ;
     73  Void getWidthAndHeight ( Int*  piWidths, Int*  piHeights ) const ;
    7474
    7575  UInt getNumberOfPlanes()  const;
    7676  UInt getNumberOfQuaterPlanes() const;
    7777  UInt getNumberOfFullPlanes() const;
    78   Bool is420() {return m_uiNumberOfFullPlanes == 1 && m_uiNumberOfQuaterPlanes == 2; };
    79   Bool is444() {return m_uiNumberOfFullPlanes == 3 && m_uiNumberOfQuaterPlanes == 0; };
    80   Bool is400() {return m_uiNumberOfFullPlanes == 1 && m_uiNumberOfQuaterPlanes == 0; };
     78  Bool is420() const {return m_uiNumberOfFullPlanes == 1 && m_uiNumberOfQuaterPlanes == 2; };
     79  Bool is444() const {return m_uiNumberOfFullPlanes == 3 && m_uiNumberOfQuaterPlanes == 0; };
     80  Bool is400() const {return m_uiNumberOfFullPlanes == 1 && m_uiNumberOfQuaterPlanes == 0; };
    8181
    8282  // Assign
     
    9595  UInt m_uiNumberOfQuaterPlanes;
    9696  UInt m_uiNumberOfPlanes;
     97  UInt m_bitDepth;
    9798  TRenImagePlane<T> ** m_apcPlanes;   // First Full Planes, then Quater Planes
    9899
     
    100101};
    101102
    102 #endif // H_3D
     103#endif // NH_3D
    103104#endif // __TRENIMAGE__
    104105
  • branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenImagePlane.cpp

    r1179 r1200  
    3636#include "TRenFilter.h"
    3737#include <string.h>
    38 #if H_3D
     38#if NH_3D
    3939
    4040/////// TRenImagePlane ///////
     
    528528template class TRenImagePlanePart<Bool>;
    529529template class TRenImagePlanePart<Int>;
    530 #endif // H_3D
    531 
     530#endif // NH_3D
     531
  • branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenImagePlane.h

    r1179 r1200  
    3939#include "../TLibCommon/TComPicYuv.h"
    4040
    41 #if H_3D
     41#if NH_3D
    4242#define PelImagePlane     TRenImagePlane<Pel>
    4343#define DoubleImagePlane  TRenImagePlane<Double>
     
    122122};
    123123
    124 #endif // H_3D
     124#endif // NH_3D
    125125#endif // __TRENIMAGEPLANE__
  • branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenInterpFilter.cpp

    r1179 r1200  
    3939
    4040#include "TRenInterpFilter.h"
    41 #if H_3D
     41#if NH_3D
    4242
    4343// ====================================================================================================================
     
    4545// ====================================================================================================================
    4646
    47 TRenInterpFilter::TRenInterpFilter()
     47template<UInt bitDepthLuma>
     48TRenInterpFilter<bitDepthLuma>::TRenInterpFilter()
    4849{
    4950  // initial number of taps for Luma
    5051}
    5152
    52 #endif // H_3D
     53template class TRenInterpFilter<REN_BIT_DEPTH>;
     54#endif // NH_3D
    5355
  • branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenInterpFilter.h

    r1179 r1200  
    4444#include "TLibCommon/CommonDef.h"
    4545#include "assert.h"
    46 #if H_3D
     46#if NH_3D
    4747
    4848// ====================================================================================================================
     
    6060
    6161/// interpolation filter class
     62template<UInt bitDepth>
    6263class TRenInterpFilter
    6364{
     
    104105   __inline Int xCTI_Filter_VP04_C_OCT3( Pel* pSrc, Int iStride );
    105106   __inline Int xCTI_Filter_VI04_C_OCT3( Int* pSrc, Int iStride );
     107private:
     108  __inline Int xClipY( Pel x ) { return std::min<Pel>(Pel((1 << bitDepth)-1), std::max<Pel>( Pel(0), x)); }
     109  __inline Int xClipC( Pel x ) { return std::min<Pel>(Pel((1 << bitDepth)-1), std::max<Pel>( Pel(0), x)); }
    106110
    107111};
     
    111115// DCTIF filters
    112116// ------------------------------------------------------------------------------------------------
    113 
    114 __inline Void TRenInterpFilter::xCTI_FilterHalfHor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
    115 {
    116   assert( g_bitDepthC == g_bitDepthY);  // ToDo: Update renderer to work with different luma/chroma bit depth
    117 
     117template<UInt bitDepth>
     118__inline Void TRenInterpFilter<bitDepth>::xCTI_FilterHalfHor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
     119{
    118120  Pel*  piDst    = rpiDst;
    119121  Int   iSum;
     
    146148            -    iTmp0 -  iTmp2;
    147149
    148       piDst   [x * iDstStep] = ClipY( (iSum +  32) >>  6 );
     150      piDst   [x * iDstStep] = xClipY( (iSum +  32) >>  6 );
    149151      piSrcTmp += iSrcStep;
    150152    }
     
    155157}
    156158
    157 __inline Void TRenInterpFilter::xCTI_FilterHalfHor(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
    158 {
    159   assert( g_bitDepthC == g_bitDepthY);  // ToDo: Update renderer to work with different luma/chroma bit depth
    160 
     159template<UInt bitDepth>
     160__inline Void TRenInterpFilter<bitDepth>::xCTI_FilterHalfHor(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
     161{
    161162  Pel*  piDst    = rpiDst;
    162163  Int   iSum;
     
    189190            -    iTmp0 -  iTmp2;
    190191     
    191       piDst   [x * iDstStep] = ClipY( (iSum +  2048) >>  12 );
     192      piDst   [x * iDstStep] = xClipY( (iSum +  2048) >>  12 );
    192193      piSrcTmp += iSrcStep;
    193194    }
     
    198199}
    199200
    200 __inline Void TRenInterpFilter::xCTI_FilterQuarter0Hor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
    201 {
    202   assert( g_bitDepthC == g_bitDepthY);  // ToDo: Update renderer to work with different luma/chroma bit depth
     201template<UInt bitDepth>
     202__inline Void TRenInterpFilter<bitDepth>::xCTI_FilterQuarter0Hor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
     203{
    203204  Pel*  piDst    = rpiDst;
    204205  Int   iSum;
     
    229230             + (   piSrcTmp[iSrcStep4]           << 4 );
    230231     
    231       piDst   [x * iDstStep] = ClipY(( (iSum +  32) >>  6 )+ piSrcTmp[iSrcStep3]);
     232      piDst   [x * iDstStep] = xClipY(( (iSum +  32) >>  6 )+ piSrcTmp[iSrcStep3]);
    232233      piSrcTmp += iSrcStep;
    233234    }
     
    238239}
    239240
    240 __inline Void TRenInterpFilter::xCTI_FilterQuarter0Hor(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
    241 {
    242   assert( g_bitDepthC == g_bitDepthY);  // ToDo: Update renderer to work with different luma/chroma bit depth
    243 
     241template<UInt bitDepth>
     242__inline Void TRenInterpFilter<bitDepth>::xCTI_FilterQuarter0Hor(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
     243{
    244244  Pel*  piDst    = rpiDst;
    245245  Int   iSum;
     
    271271            + (   piSrcTmp[iSrcStep3]           << 6 );
    272272     
    273       piDst   [x * iDstStep] = ClipY( (iSum +  2048) >>  12 );
     273      piDst   [x * iDstStep] = xClipY( (iSum +  2048) >>  12 );
    274274      piSrcTmp += iSrcStep;
    275275    }
     
    280280}
    281281
    282 __inline Void TRenInterpFilter::xCTI_FilterQuarter1Hor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
    283 {
    284   assert( g_bitDepthC == g_bitDepthY);  // ToDo: Update renderer to work with different luma/chroma bit depth
     282template<UInt bitDepth>
     283__inline Void TRenInterpFilter<bitDepth>::xCTI_FilterQuarter1Hor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
     284{
    285285  Pel*  piDst    = rpiDst;
    286286  Int   iSum;
     
    310310            + (   piSrcTmp[iSrcStep3]           << 4 );
    311311     
    312       piDst   [x * iDstStep] = ClipY( ((iSum +  32) >>  6) + piSrcTmp[iSrcStep4] );
     312      piDst   [x * iDstStep] = xClipY( ((iSum +  32) >>  6) + piSrcTmp[iSrcStep4] );
    313313      piSrcTmp += iSrcStep;
    314314    }
     
    319319}
    320320
    321 __inline Void TRenInterpFilter::xCTI_FilterQuarter1Hor(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
    322 {
    323   assert( g_bitDepthC == g_bitDepthY);  // ToDo: Update renderer to work with different luma/chroma bit depth
    324 
     321template<UInt bitDepth>
     322__inline Void TRenInterpFilter<bitDepth>::xCTI_FilterQuarter1Hor(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
     323{
    325324  Pel*  piDst    = rpiDst;
    326325  Int   iSum;
     
    351350            + (   piSrcTmp[iSrcStep4]           << 6 );
    352351     
    353       piDst   [x * iDstStep] = ClipY( (iSum +  2048) >>  12 );
     352      piDst   [x * iDstStep] = xClipY( (iSum +  2048) >>  12 );
    354353      piSrcTmp += iSrcStep;
    355354    }
     
    360359}
    361360
    362 __inline Void TRenInterpFilter::xCTI_FilterHalfVer (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst, Int iDstStridePel, Pel*& rpiDstPel )
    363 {
    364   assert( g_bitDepthC == g_bitDepthY);  // ToDo: Update renderer to work with different luma/chroma bit depth
     361template<UInt bitDepth>
     362__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 )
     363{
    365364  Int*  piDst = rpiDst;
    366365  Pel*  piDstPel = rpiDstPel;
     
    394393     
    395394      piDst[x * iDstStep]    = iSum;
    396       piDstPel[x * iDstStep] = ClipY( (iSum +  32) >>  6 );
     395      piDstPel[x * iDstStep] = xClipY( (iSum +  32) >>  6 );
    397396      piSrcTmp += iSrcStep;
    398397    }
     
    404403}
    405404
    406 __inline Void TRenInterpFilter::xCTI_FilterHalfVer (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst)
     405template<UInt bitDepth>
     406__inline Void TRenInterpFilter<bitDepth>::xCTI_FilterHalfVer (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst)
    407407{
    408408  Int*  piDst = rpiDst;
     
    444444}
    445445
    446 __inline Void TRenInterpFilter::xCTI_FilterHalfVer (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
    447 {
    448   assert( g_bitDepthC == g_bitDepthY);  // ToDo: Update renderer to work with different luma/chroma bit depth
     446template<UInt bitDepth>
     447__inline Void TRenInterpFilter<bitDepth>::xCTI_FilterHalfVer (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
     448{
    449449  Pel*  piDst = rpiDst;
    450450  Int   iSum;
     
    477477            -    iTmp0 -  iTmp2;       
    478478     
    479       piDst[x * iDstStep] = ClipY( (iSum +  32) >>  6 );
     479      piDst[x * iDstStep] = xClipY( (iSum +  32) >>  6 );
    480480      piSrcTmp += iSrcStep;
    481481    }
     
    486486}
    487487
    488 __inline Void TRenInterpFilter::xCTI_FilterQuarter0Ver (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst)
     488template<UInt bitDepth>
     489__inline Void TRenInterpFilter<bitDepth>::xCTI_FilterQuarter0Ver (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst)
    489490{
    490491  Int*  piDst = rpiDst;
     
    525526}
    526527
    527 __inline Void TRenInterpFilter::xCTI_FilterQuarter0Ver (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
    528 {
    529   assert( g_bitDepthC == g_bitDepthY );  // ToDo: Update renderer to work with different luma/chroma bit depth
     528template<UInt bitDepth>
     529__inline Void TRenInterpFilter<bitDepth>::xCTI_FilterQuarter0Ver (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
     530{
    530531  Pel*  piDst = rpiDst;
    531532  Int   iSum;
     
    556557            + (   piSrcTmp[iSrcStride4]           << 4 );
    557558     
    558       piDst[x * iDstStep] = ClipY( ((iSum +  32) >>  6) + piSrcTmp[iSrcStride3] );
     559      piDst[x * iDstStep] = xClipY( ((iSum +  32) >>  6) + piSrcTmp[iSrcStride3] );
    559560      piSrcTmp += iSrcStep;
    560561    }
     
    565566}
    566567
    567 __inline Void TRenInterpFilter::xCTI_FilterQuarter1Ver (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst)
     568template<UInt bitDepth>
     569__inline Void TRenInterpFilter<bitDepth>::xCTI_FilterQuarter1Ver (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst)
    568570{
    569571  Int*  piDst = rpiDst;
     
    604606}
    605607
    606 __inline Void TRenInterpFilter::xCTI_FilterQuarter1Ver (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
    607 {
    608   assert( g_bitDepthC == g_bitDepthY);  // ToDo: Update renderer to work with different luma/chroma bit depth
    609 
     608template<UInt bitDepth>
     609__inline Void TRenInterpFilter<bitDepth>::xCTI_FilterQuarter1Ver (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
     610{
    610611  Pel*  piDst = rpiDst;
    611612  Int   iSum;
     
    635636            + (   piSrcTmp[iSrcStride3]           << 4 );
    636637           
    637       piDst[x * iDstStep] = ClipY( ((iSum +  32) >>  6) +  piSrcTmp[iSrcStride4] );
     638      piDst[x * iDstStep] = xClipY( ((iSum +  32) >>  6) +  piSrcTmp[iSrcStride4] );
    638639      piSrcTmp += iSrcStep;
    639640    }
     
    647648// DCTIF filters for Chroma
    648649// ------------------------------------------------------------------------------------------------
    649 __inline Void TRenInterpFilter::xCTI_Filter2DVerC (Pel* piSrc, Int iSrcStride,  Int iWidth, Int iHeight, Int iDstStride,  Int*& rpiDst, Int iMV)
     650template<UInt bitDepth>
     651__inline Void TRenInterpFilter<bitDepth>::xCTI_Filter2DVerC (Pel* piSrc, Int iSrcStride,  Int iWidth, Int iHeight, Int iDstStride,  Int*& rpiDst, Int iMV)
    650652{
    651653  Int*  piDst = rpiDst;
     
    774776}
    775777
    776 __inline Void TRenInterpFilter::xCTI_Filter2DHorC(Int* piSrc, Int iSrcStride,  Int iWidth, Int iHeight, Int iDstStride,  Pel*& rpiDst, Int iMV)
    777 {
    778   assert( g_bitDepthC == g_bitDepthY);  // ToDo: Update renderer to work with different luma/chroma bit depth
     778template<UInt bitDepth>
     779__inline Void TRenInterpFilter<bitDepth>::xCTI_Filter2DHorC(Int* piSrc, Int iSrcStride,  Int iWidth, Int iHeight, Int iDstStride,  Pel*& rpiDst, Int iMV)
     780{
    779781  Pel*  piDst    = rpiDst;
    780782  Int   iSum;
     
    791793        {
    792794          iSum         = xCTI_Filter_VI04_C_OCT0( piSrcTmp, 1 );
    793           piDst   [x ] = ClipC ((iSum +  2048) >>  12 );
     795          piDst   [x ] = xClipC ((iSum +  2048) >>  12 );
    794796          piSrcTmp++;
    795797        }
     
    807809        {
    808810          iSum         = xCTI_Filter_VI04_C_QUA0( piSrcTmp, 1 );
    809           piDst   [x ] = ClipC ((iSum +  2048) >>  12 );
     811          piDst   [x ] = xClipC ((iSum +  2048) >>  12 );
    810812          piSrcTmp++;
    811813        }
     
    823825        {
    824826          iSum         = xCTI_Filter_VI04_C_QUA1( piSrcTmp, 1 );
    825           piDst   [x ] = ClipC ((iSum +  2048) >>  12 );
     827          piDst   [x ] = xClipC ((iSum +  2048) >>  12 );
    826828          piSrcTmp++;
    827829        }
     
    839841        {
    840842          iSum         = xCTI_Filter_VI04_C_OCT1( piSrcTmp, 1 );
    841           piDst   [x ] = ClipC ((iSum +  2048) >>  12 );
     843          piDst   [x ] = xClipC ((iSum +  2048) >>  12 );
    842844          piSrcTmp++;
    843845        }
     
    855857        {
    856858          iSum         = xCTI_Filter_VI04_C_OCT2( piSrcTmp, 1 );
    857           piDst   [x ] = ClipC ((iSum +  2048) >>  12 );
     859          piDst   [x ] = xClipC ((iSum +  2048) >>  12 );
    858860          piSrcTmp++;
    859861        }
     
    871873        {
    872874          iSum         = xCTI_Filter_VI04_C_OCT3( piSrcTmp, 1 );
    873           piDst   [x ] = ClipC ((iSum +  2048) >>  12 );
     875          piDst   [x ] = xClipC ((iSum +  2048) >>  12 );
    874876          piSrcTmp++;
    875877        }
     
    887889        {
    888890          iSum      = xCTI_Filter_VIS04_C_HAL( piSrcTmp, 1 );
    889           piDst   [x ] = ClipC ((iSum +  2048) >>  12 );
     891          piDst   [x ] = xClipC ((iSum +  2048) >>  12 );
    890892          piSrcTmp++;
    891893        }
     
    902904}
    903905
    904 __inline Void TRenInterpFilter::xCTI_Filter1DVerC (Pel* piSrc, Int iSrcStride, Int iWidth, Int iHeight, Int iDstStride,  Pel*& rpiDst, Int iMV)
    905 {
    906   assert( g_bitDepthC == g_bitDepthY);  // ToDo: Update renderer to work with different luma/chroma bit depth
    907 
     906template<UInt bitDepth>
     907__inline Void TRenInterpFilter<bitDepth>::xCTI_Filter1DVerC (Pel* piSrc, Int iSrcStride, Int iWidth, Int iHeight, Int iDstStride,  Pel*& rpiDst, Int iMV)
     908{
    908909  Pel*  piDst = rpiDst;
    909910  Int   iSum;
     
    920921        {
    921922          iSum      = xCTI_Filter_VP04_C_OCT0( piSrcTmp,  iSrcStride );
    922           piDst[x ] = ClipC ((iSum +  32) >>  6 );
     923          piDst[x ] = xClipC ((iSum +  32) >>  6 );
    923924          piSrcTmp++;
    924925        }
     
    936937        {
    937938          iSum      = xCTI_Filter_VP04_C_QUA0( piSrcTmp,  iSrcStride );
    938           piDst[x ] = ClipC ((iSum +  32) >>  6 );
     939          piDst[x ] = xClipC ((iSum +  32) >>  6 );
    939940          piSrcTmp++;
    940941        }
     
    952953        {
    953954          iSum      = xCTI_Filter_VP04_C_QUA1( piSrcTmp,  iSrcStride );
    954           piDst[x ] = ClipC ((iSum +  32) >>  6 );
     955          piDst[x ] = xClipC ((iSum +  32) >>  6 );
    955956          piSrcTmp++;
    956957        }
     
    968969        {
    969970          iSum      = xCTI_Filter_VP04_C_OCT1( piSrcTmp,  iSrcStride );
    970           piDst[x ] = ClipC ((iSum +  32) >>  6 );
     971          piDst[x ] = xClipC ((iSum +  32) >>  6 );
    971972          piSrcTmp++;
    972973        }
     
    984985        {
    985986          iSum      = xCTI_Filter_VP04_C_OCT2( piSrcTmp,  iSrcStride );
    986           piDst[x ] = ClipC ((iSum +  32) >>  6 );
     987          piDst[x ] = xClipC ((iSum +  32) >>  6 );
    987988          piSrcTmp++;
    988989        }
     
    10001001        {
    10011002          iSum      = xCTI_Filter_VP04_C_OCT3( piSrcTmp,  iSrcStride );
    1002           piDst[x ] = ClipC ((iSum +  32) >>  6 );
     1003          piDst[x ] = xClipC ((iSum +  32) >>  6 );
    10031004          piSrcTmp++;
    10041005        }
     
    10161017        {
    10171018          iSum      = xCTI_Filter_VPS04_C_HAL( piSrcTmp, iSrcStride );
    1018           piDst[x ] = ClipC ((iSum +  32) >>  6 );
     1019          piDst[x ] = xClipC ((iSum +  32) >>  6 );
    10191020          piSrcTmp++;
    10201021        }
     
    10301031}
    10311032
    1032 __inline Void TRenInterpFilter::xCTI_Filter1DHorC(Pel* piSrc, Int iSrcStride, Int iWidth, Int iHeight, Int iDstStride, Pel*& rpiDst, Int iMV)
     1033template<UInt bitDepth>
     1034__inline Void TRenInterpFilter<bitDepth>::xCTI_Filter1DHorC(Pel* piSrc, Int iSrcStride, Int iWidth, Int iHeight, Int iDstStride, Pel*& rpiDst, Int iMV)
    10331035{
    10341036  Pel*  piDst    = rpiDst;
     
    10461048        {
    10471049          iSum         = xCTI_Filter_VP04_C_OCT0( piSrcTmp,  1 );
    1048           piDst[x ] = ClipC ((iSum +  32) >>  6 );
     1050          piDst[x ] = xClipC ((iSum +  32) >>  6 );
    10491051          piSrcTmp++;
    10501052        }
     
    10621064        {
    10631065          iSum         = xCTI_Filter_VP04_C_QUA0( piSrcTmp,  1 );
    1064           piDst[x ] = ClipC ((iSum +  32) >>  6 );
     1066          piDst[x ] = xClipC ((iSum +  32) >>  6 );
    10651067          piSrcTmp++;
    10661068        }
     
    10781080        {
    10791081          iSum         = xCTI_Filter_VP04_C_QUA1( piSrcTmp,  1 );
    1080           piDst[x ] = ClipC ((iSum +  32) >>  6 );
     1082          piDst[x ] = xClipC ((iSum +  32) >>  6 );
    10811083          piSrcTmp++;
    10821084        }
     
    10941096        {
    10951097          iSum         = xCTI_Filter_VP04_C_OCT1( piSrcTmp,  1 );
    1096           piDst[x ] = ClipC ((iSum +  32) >>  6 );
     1098          piDst[x ] = xClipC ((iSum +  32) >>  6 );
    10971099          piSrcTmp++;
    10981100        }
     
    11101112        {
    11111113          iSum         = xCTI_Filter_VP04_C_OCT2( piSrcTmp,  1 );
    1112           piDst[x ] = ClipC ((iSum +  32) >>  6 );
     1114          piDst[x ] = xClipC ((iSum +  32) >>  6 );
    11131115          piSrcTmp++;
    11141116        }
     
    11261128        {
    11271129          iSum         = xCTI_Filter_VP04_C_OCT3( piSrcTmp,  1 );
    1128           piDst[x ] = ClipC ((iSum +  32) >>  6 );
     1130          piDst[x ] = xClipC ((iSum +  32) >>  6 );
    11291131          piSrcTmp++;
    11301132        }
     
    11421144        {
    11431145          iSum         = xCTI_Filter_VPS04_C_HAL( piSrcTmp,  1 );
    1144           piDst[x ] = ClipC ((iSum +  32) >>  6 );
     1146          piDst[x ] = xClipC ((iSum +  32) >>  6 );
    11451147          piSrcTmp++;
    11461148        }
     
    11561158}
    11571159
    1158 __inline Int TRenInterpFilter::xCTI_Filter_VP04_C_OCT0( Pel* pSrc,  Int iStride )
     1160template<UInt bitDepth>
     1161__inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VP04_C_OCT0( Pel* pSrc,  Int iStride )
    11591162{// {  -3,  60,   8,   -1,} // 1/8
    11601163  Int iSum, iIdx = 0;
     
    11681171  return iSum;
    11691172}
    1170 __inline Int TRenInterpFilter::xCTI_Filter_VI04_C_OCT0( Int* pSrc, Int iStride )
     1173template<UInt bitDepth>
     1174__inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VI04_C_OCT0( Int* pSrc, Int iStride )
    11711175{ // {  -3,  60,   8,   -1,} //1/8
    11721176  Int iSum, iIdx = 0;
     
    11801184  return iSum;
    11811185}
    1182 __inline Int TRenInterpFilter::xCTI_Filter_VP04_C_QUA0( Pel* pSrc,  Int iStride )
     1186template<UInt bitDepth>
     1187__inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VP04_C_QUA0( Pel* pSrc,  Int iStride )
    11831188{// {  -4,  54,  16,   -2,} // 1/4
    11841189  Int iSum, iIdx = 0;
     
    11921197  return iSum;
    11931198}
    1194 __inline Int TRenInterpFilter::xCTI_Filter_VI04_C_QUA0( Int* pSrc, Int iStride )
     1199
     1200template<UInt bitDepth>
     1201__inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VI04_C_QUA0( Int* pSrc, Int iStride )
    11951202{ // {  -4,  54,  16,   -2,} //1/4
    11961203  Int iSum, iIdx = 0;
     
    12041211  return iSum;
    12051212}
    1206 __inline Int TRenInterpFilter::xCTI_Filter_VP04_C_QUA1( Pel* pSrc,  Int iStride )
     1213template<UInt bitDepth>
     1214__inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VP04_C_QUA1( Pel* pSrc,  Int iStride )
    12071215{// {  -2,  16,  54,   -4,}// 3/4
    12081216  Int iSum, iIdx = 0;
     
    12161224  return iSum;
    12171225}
    1218 __inline Int TRenInterpFilter::xCTI_Filter_VI04_C_QUA1( Int* pSrc, Int iStride )
     1226
     1227template<UInt bitDepth>
     1228__inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VI04_C_QUA1( Int* pSrc, Int iStride )
    12191229{// {  -2,  16,  54,   -4,}// 3/4
    12201230  Int iSum, iIdx = 0;
     
    12281238  return iSum;
    12291239}
    1230 __inline Int TRenInterpFilter::xCTI_Filter_VP04_C_OCT1( Pel* pSrc,  Int iStride )
     1240
     1241template<UInt bitDepth>
     1242__inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VP04_C_OCT1( Pel* pSrc,  Int iStride )
    12311243{// {  -5,  46,  27,   -4,} // 3/8
    12321244  Int iSum, iIdx = 0;
     
    12411253  return iSum;
    12421254}
    1243 __inline Int TRenInterpFilter::xCTI_Filter_VI04_C_OCT1( Int* pSrc, Int iStride )
     1255
     1256template<UInt bitDepth>
     1257__inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VI04_C_OCT1( Int* pSrc, Int iStride )
    12441258{ // {  -5,  46,  27,   -4,} //3/8
    12451259  Int iSum, iIdx = 0;
     
    12541268  return iSum;
    12551269}
    1256 __inline Int TRenInterpFilter::xCTI_Filter_VPS04_C_HAL( Pel* pSrc, Int iStride )
     1270
     1271template<UInt bitDepth>
     1272__inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VPS04_C_HAL( Pel* pSrc, Int iStride )
    12571273{
    12581274  // {  -4,  36,  36,   -4,}, // 1/2
     
    12651281  return iSum;
    12661282}
    1267 __inline Int TRenInterpFilter::xCTI_Filter_VIS04_C_HAL( Int* pSrc, Int iStride )
     1283
     1284template<UInt bitDepth>
     1285__inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VIS04_C_HAL( Int* pSrc, Int iStride )
    12681286{
    12691287  // {  -4,  36,  36,   -4,}, //1/2
     
    12761294  return iSum;
    12771295}
    1278 __inline Int TRenInterpFilter::xCTI_Filter_VP04_C_OCT2( Pel* pSrc,  Int iStride )
     1296
     1297template<UInt bitDepth>
     1298__inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VP04_C_OCT2( Pel* pSrc,  Int iStride )
    12791299{// {  -4,  27,  46,   -5,}, // 5/8
    12801300  Int iSum, iIdx = 0;
     
    12891309  return iSum;
    12901310}
    1291 __inline Int TRenInterpFilter::xCTI_Filter_VI04_C_OCT2( Int* pSrc, Int iStride )
     1311
     1312template<UInt bitDepth>
     1313__inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VI04_C_OCT2( Int* pSrc, Int iStride )
    12921314{ // {  -4,  27,  46,   -5,}, // 5/8
    12931315  Int iSum, iIdx = 0;
     
    13021324  return iSum;
    13031325}
    1304 __inline Int TRenInterpFilter::xCTI_Filter_VP04_C_OCT3( Pel* pSrc,  Int iStride )
     1326
     1327template<UInt bitDepth>
     1328__inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VP04_C_OCT3( Pel* pSrc,  Int iStride )
    13051329{// {  -1,   8,  60,   -3,} // 7/8
    13061330  Int iSum, iIdx = 0;
     
    13141338  return iSum;
    13151339}
    1316 __inline Int TRenInterpFilter::xCTI_Filter_VI04_C_OCT3( Int* pSrc, Int iStride )
     1340
     1341template<UInt bitDepth>
     1342__inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VI04_C_OCT3( Int* pSrc, Int iStride )
    13171343{ // {  -1,   8,  60,   -3,} // 7/8
    13181344  Int iSum, iIdx = 0;
     
    13261352  return iSum;
    13271353}
    1328 #endif // H_3D
     1354
     1355#endif // NH_3D
    13291356#endif // __TRENINTERP__
  • branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenModSetupStrParser.cpp

    r1179 r1200  
    3737#include "TRenModSetupStrParser.h"
    3838
    39 #if H_3D
     39#if NH_3D
    4040Int
    4141TRenModSetupStrParser::getNumOfModels()
     
    451451  rcNextChar = m_pchSetStr[iPos];
    452452}
    453 #endif // H_3D
    454 
     453#endif // NH_3D
     454
  • branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenModSetupStrParser.h

    r1179 r1200  
    3939#include "../TLibCommon/TypeDef.h"
    4040#include "../TAppCommon/TAppComCamPara.h"
    41 #if H_3D
     41#if NH_3D
    4242
    4343
     
    128128};
    129129
    130 #endif // H_3D
     130#endif // NH_3D
    131131#endif //__TRENMODEL__
    132132
  • branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenModel.cpp

    r1179 r1200  
    3636#include "TRenModel.h"
    3737
    38 #if H_3D_VSO
     38#if NH_3D_VSO
    3939///////////  TRENMODEL //////////////////////
    4040TRenModel::TRenModel()
     
    242242  }
    243243
    244   TRenFilter::setSubPelShiftLUT( m_iShiftPrec, m_aaaiSubPelShiftLut[0], 0 );
    245   TRenFilter::setSubPelShiftLUT( m_iShiftPrec, m_aaaiSubPelShiftLut[1], 0 );
     244  TRenFilter<REN_BIT_DEPTH>::setSubPelShiftLUT( m_iShiftPrec, m_aaaiSubPelShiftLut[0], 0 );
     245  TRenFilter<REN_BIT_DEPTH>::setSubPelShiftLUT( m_iShiftPrec, m_aaaiSubPelShiftLut[1], 0 );
    246246
    247247  m_iSampledWidth       = iWidth << m_iShiftPrec;
     
    357357  AOT( iBaseViewNum != -1 && iBaseViewNum != iLeftViewNum && iBaseViewNum != iRightViewNum );
    358358  AOT( iContent      < -1 || iContent > 1 );
    359   AOT( iBlendMode < -1 || iBlendMode > 2 );
    360   AOT( g_bitDepthY  != g_bitDepthC );
    361 
    362   Bool bBitInc = ( DISTORTION_PRECISION_ADJUSTMENT( g_bitDepthY - 8 ) != 0);
     359  AOT( iBlendMode < -1 || iBlendMode > 2 ); 
     360
     361  Bool bBitInc = ( REN_BIT_DEPTH != ENC_INTERNAL_BIT_DEPTH );
    363362
    364363  AOT( m_apcRenModels[iModelNum] );
     
    437436{
    438437  AOT( iViewNum < 0 || iViewNum > m_iNumOfBaseViews );
    439   AOF( pcPicYuvVideoData->getHeight() >= m_iUsedHeight + m_uiHorOff && pcPicYuvVideoData->getWidth() == m_iWidth );
    440   AOF( pcPicYuvDepthData->getHeight() >= m_iUsedHeight + m_uiHorOff && pcPicYuvDepthData->getWidth() == m_iWidth );
    441 
     438  AOF( pcPicYuvVideoData->getHeight( COMPONENT_Y ) >= m_iUsedHeight + m_uiHorOff && pcPicYuvVideoData->getWidth( COMPONENT_Y ) == m_iWidth );
     439  AOF( pcPicYuvDepthData->getHeight( COMPONENT_Y ) >= m_iUsedHeight + m_uiHorOff && pcPicYuvDepthData->getWidth( COMPONENT_Y ) == m_iWidth );
     440 
     441  AOF( pcPicYuvVideoData   ->getChromaFormat() == CHROMA_420 );
     442 
    442443  pcPicYuvVideoData->extendPicBorder();
    443444
    444   TRenFilter::sampleHorUp   ( m_iShiftPrec, pcPicYuvVideoData->getLumaAddr() +  m_uiHorOff        * pcPicYuvVideoData->getStride () , pcPicYuvVideoData->getStride() , m_iWidth,      m_iUsedHeight,      m_aapiCurVideoPel[ iViewNum ][0], m_aaiCurVideoStrides[iViewNum][0] );
    445   TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvVideoData->getCbAddr()   + (m_uiHorOff >> 1 ) * pcPicYuvVideoData->getCStride() , pcPicYuvVideoData->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiCurVideoPel[ iViewNum ][1], m_aaiCurVideoStrides[iViewNum][1] );
    446   TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvVideoData->getCrAddr()   + (m_uiHorOff >> 1 ) * pcPicYuvVideoData->getCStride() , pcPicYuvVideoData->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiCurVideoPel[ iViewNum ][2], m_aaiCurVideoStrides[iViewNum][2] );
    447   TRenFilter::copy          (               pcPicYuvDepthData->getLumaAddr() +  m_uiHorOff        * pcPicYuvDepthData->getStride () , pcPicYuvDepthData->getStride(),  m_iWidth,      m_iUsedHeight,      m_apiCurDepthPel [ iViewNum],     m_aiCurDepthStrides [iViewNum]    );
     445  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] );
     446  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] );
     447  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] );
     448  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]    );
    448449
    449450  // Used for rendering reference pic from original video data
     
    453454  if ( m_abSetupVideoFromOrgForView[iViewNum] )
    454455  {
    455     AOF( pcPicYuvOrgVideoData->getHeight() >= m_iUsedHeight + m_uiHorOff && pcPicYuvOrgVideoData->getWidth() == m_iWidth );
     456    AOF( pcPicYuvOrgVideoData->getChromaFormat() == CHROMA_420 );
     457    AOF( pcPicYuvOrgVideoData->getHeight( COMPONENT_Y ) >= m_iUsedHeight + m_uiHorOff && pcPicYuvOrgVideoData->getWidth( COMPONENT_Y) == m_iWidth );   
    456458    pcPicYuvOrgVideoData->extendPicBorder();
    457     TRenFilter::sampleHorUp   ( m_iShiftPrec, pcPicYuvOrgVideoData->getLumaAddr() +  m_uiHorOff        * pcPicYuvOrgVideoData->getStride() , pcPicYuvOrgVideoData->getStride() , m_iWidth,      m_iUsedHeight,      m_aapiOrgVideoPel[ iViewNum ][0], m_aaiOrgVideoStrides[iViewNum][0] );
    458     TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvOrgVideoData->getCbAddr()   + (m_uiHorOff >> 1 ) * pcPicYuvOrgVideoData->getCStride(), pcPicYuvOrgVideoData->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiOrgVideoPel[ iViewNum ][1], m_aaiOrgVideoStrides[iViewNum][1] );
    459     TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvOrgVideoData->getCrAddr()   + (m_uiHorOff >> 1 ) * pcPicYuvOrgVideoData->getCStride(), pcPicYuvOrgVideoData->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiOrgVideoPel[ iViewNum ][2], m_aaiOrgVideoStrides[iViewNum][2] );
     459    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] );
     460    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] );
     461    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] );
    460462  }
    461463
    462464  if ( m_abSetupDepthFromOrgForView[iViewNum] )
    463   {
    464     AOF( pcPicYuvOrgDepthData->getHeight() >= m_iUsedHeight + m_uiHorOff && pcPicYuvOrgDepthData->getWidth() == m_iWidth );
    465     TRenFilter::copy          (               pcPicYuvOrgDepthData->getLumaAddr() +  m_uiHorOff        * pcPicYuvOrgDepthData->getStride() , pcPicYuvOrgDepthData->getStride(),  m_iWidth,     m_iUsedHeight,      m_apiOrgDepthPel [ iViewNum],     m_aiOrgDepthStrides [iViewNum]    );
     465  {   
     466    AOF( pcPicYuvOrgDepthData->getHeight( COMPONENT_Y ) >= m_iUsedHeight + m_uiHorOff && pcPicYuvOrgDepthData->getWidth( COMPONENT_Y ) == m_iWidth );
     467    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]    );
    466468  }
    467469}
     
    592594
    593595Void
    594 TRenModel::setData( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData )
     596TRenModel::setData( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData )
    595597{
    596598  iStartPosY -= m_uiHorOff;
     
    625627  {
    626628    Int iTargetStride = m_aiCurDepthStrides[ m_iCurrentView ];
    627     TRenFilter::copy( piNewData, iStride, iWidth, iHeight,  m_apiCurDepthPel[ m_iCurrentView ] + iStartPosY * iTargetStride + iStartPosX, iTargetStride );
     629    TRenFilter<REN_BIT_DEPTH>::copy( piNewData, iStride, iWidth, iHeight,  m_apiCurDepthPel[ m_iCurrentView ] + iStartPosY * iTargetStride + iStartPosX, iTargetStride );
    628630  }
    629631#endif
     
    646648{
    647649  TComPicYuv cPicYuvSynth;
    648   cPicYuvSynth.create( m_iWidth, m_iUsedHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth );
     650  cPicYuvSynth.create( m_iWidth, m_iUsedHeight, CHROMA_420, 1, 1, 1, true);
    649651
    650652  TComPicYuv cPicYuvTempRef;
    651   cPicYuvTempRef.create( m_iWidth, m_iUsedHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth);
     653  cPicYuvTempRef.create( m_iWidth, m_iUsedHeight, CHROMA_420, 1, 1, 1, true);
    652654
    653655  Int64 iSSEY = 0;
     
    660662    m_apcCurRenModels[iCurModel]->getRefVideo  ( m_aiCurPosInModels[iCurModel], &cPicYuvTempRef   );
    661663
    662     iSSEY += TRenFilter::SSE( cPicYuvSynth.getLumaAddr(), cPicYuvSynth.getStride(),  m_iWidth,      m_iUsedHeight     , cPicYuvTempRef.getLumaAddr(), cPicYuvTempRef.getStride() , true  );
    663     iSSEU += TRenFilter::SSE( cPicYuvSynth.getCbAddr()  , cPicYuvSynth.getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, cPicYuvTempRef.getCbAddr()  , cPicYuvTempRef.getCStride(), false );
    664     iSSEV += TRenFilter::SSE( cPicYuvSynth.getCrAddr()  , cPicYuvSynth.getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, cPicYuvTempRef.getCrAddr()  , cPicYuvTempRef.getCStride(), false );
     664    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  );
     665    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 );
     666    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 );
    665667  }
    666668
     
    699701  }
    700702}
    701 #endif // H_3D
     703#endif // NH_3D
  • branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenModel.h

    r1179 r1200  
    4242#include "../TLibCommon/TypeDef.h"
    4343
    44 #if H_3D_VSO
     44#if NH_3D_VSO
    4545
    4646class TRenModel
     
    7575  Int64 getDist          ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData  );
    7676#endif
    77   Void  setData          ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData  );
     77  Void  setData          ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData  );
    7878
    7979  // Get Rendered View
     
    157157};
    158158
    159 #endif // H_3D
     159#endif // NH_3D
    160160#endif //__TRENMODEL__
    161161
  • branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenSingleModel.cpp

    r1179 r1200  
    3636#include "TRenSingleModel.h"
    3737
    38 #if H_3D_VSO
     38#if NH_3D_VSO
    3939
    4040////////////// TRENSINGLE MODEL ///////////////
    4141template <BlenMod iBM, Bool bBitInc>
    4242TRenSingleModelC<iBM,bBitInc>::TRenSingleModelC()
    43 :  m_iDistShift ( ( g_bitDepthY - 8) << 1 )
     43:  m_iDistShift ( ( ENC_INTERNAL_BIT_DEPTH  - REN_BIT_DEPTH) << 1 )
    4444{
    4545  m_iWidth  = -1;
     
    259259  if ( pcOrgVideo && !bKeepReference )
    260260  {
    261     TRenFilter::copy(             pcOrgVideo->getLumaAddr() +  m_iHorOffset       * pcOrgVideo->getStride() , pcOrgVideo->getStride() , m_iWidth,      m_iUsedHeight,      m_aapiRefVideoPel[0], m_aiRefVideoStrides[0]);
    262     TRenFilter::sampleCUpHorUp(0, pcOrgVideo->getCbAddr()   + (m_iHorOffset >> 1) * pcOrgVideo->getCStride(), pcOrgVideo->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiRefVideoPel[1], m_aiRefVideoStrides[1]);
    263     TRenFilter::sampleCUpHorUp(0, pcOrgVideo->getCrAddr()   + (m_iHorOffset >> 1) * pcOrgVideo->getCStride(), pcOrgVideo->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiRefVideoPel[2], m_aiRefVideoStrides[2]);   
     261    assert( pcOrgVideo->getChromaFormat() != CHROMA_420 );     
     262
     263    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]);
     264    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]);
     265    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]);   
    264266    xSetStructRefView();
    265267  }
     
    285287    break;
    286288  case 2:
    287     TRenFilter::setupZLUT( true, 30, iDistToLeft, ppiBaseShiftLutLeft, ppiBaseShiftLutRight, m_iBlendZThres, m_iBlendDistWeight, m_piInvZLUTLeft, m_piInvZLUTRight );
     289    TRenFilter<REN_BIT_DEPTH>::setupZLUT( true, 30, iDistToLeft, ppiBaseShiftLutLeft, ppiBaseShiftLutRight, m_iBlendZThres, m_iBlendDistWeight, m_piInvZLUTLeft, m_piInvZLUTRight );
    288290#if H_3D_VSO_EARLY_SKIP
    289291    xRenderL<true>( 0, 0, m_iWidth, m_iUsedHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0],false);
     
    452454#if H_3D_VSO_COLOR_PLANES             
    453455      // U Planes                   
    454       pcOutSampleRow[iPosX].iULeft        = 1 << (g_bitDepthC - 1);
    455       pcOutSampleRow[iPosX].iURight       = 1 << (g_bitDepthC - 1);
    456       pcOutSampleRow[iPosX].iUBlended     = 1 << (g_bitDepthC - 1);
    457                                      
    458       // V Planes                   
    459       pcOutSampleRow[iPosX].iVLeft        = 1 << (g_bitDepthC - 1);
    460       pcOutSampleRow[iPosX].iVRight       = 1 << (g_bitDepthC - 1);
    461       pcOutSampleRow[iPosX].iVBlended     = 1 << (g_bitDepthC - 1);
     456      pcOutSampleRow[iPosX].iULeft        = 1 << (REN_BIT_DEPTH - 1);
     457      pcOutSampleRow[iPosX].iURight       = 1 << (REN_BIT_DEPTH - 1);
     458      pcOutSampleRow[iPosX].iUBlended     = 1 << (REN_BIT_DEPTH - 1);
     459                                                  
     460      // V Planes                                 
     461      pcOutSampleRow[iPosX].iVLeft        = 1 << (REN_BIT_DEPTH - 1);
     462      pcOutSampleRow[iPosX].iVRight       = 1 << (REN_BIT_DEPTH - 1);
     463      pcOutSampleRow[iPosX].iVBlended     = 1 << (REN_BIT_DEPTH - 1);
    462464#endif
    463465      //// Input Samples
     
    475477#if H_3D_VSO_EARLY_SKIP
    476478template <BlenMod iBM, Bool bBitInc> RMDist
    477 TRenSingleModelC<iBM,bBitInc>::getDistDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData , Pel * piOrgData, Int iOrgStride )
     479TRenSingleModelC<iBM,bBitInc>::getDistDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData , const Pel * piOrgData, Int iOrgStride )
    478480#else
    479481template <BlenMod iBM, Bool bBitInc> RMDist
    480 TRenSingleModelC<iBM,bBitInc>::getDistDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData )
     482TRenSingleModelC<iBM,bBitInc>::getDistDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData )
    481483#endif
    482484{
     
    517519#if H_3D_VSO_EARLY_SKIP
    518520template <BlenMod iBM, Bool bBitInc> Void
    519 TRenSingleModelC<iBM,bBitInc>::setDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel* piOrgData, Int iOrgStride )
     521TRenSingleModelC<iBM,bBitInc>::setDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel* piOrgData, Int iOrgStride )
    520522#else
    521523template <BlenMod iBM, Bool bBitInc> Void
    522 TRenSingleModelC<iBM,bBitInc>::setDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData )
     524TRenSingleModelC<iBM,bBitInc>::setDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData )
    523525#endif
    524526{
     
    558560TRenSingleModelC<iBM,bBitInc>::getSynthVideo( Int iViewPos, TComPicYuv* pcPicYuv )
    559561
    560   AOT( pcPicYuv->getWidth() != m_iWidth );
    561   AOT( pcPicYuv->getHeight() < m_iUsedHeight + m_iHorOffset );
     562  AOT( pcPicYuv->getWidth( COMPONENT_Y  )  != m_iWidth );
     563  AOT( pcPicYuv->getChromaFormat()         != CHROMA_420 );
     564
     565  AOT( pcPicYuv->getHeight( COMPONENT_Y ) < m_iUsedHeight + m_iHorOffset );
    562566
    563567#if H_3D_VSO_COLOR_PLANES
     
    590594
    591595  AOT( iViewPos != 0 && iViewPos != 1);
    592   AOT( pcPicYuv->getWidth()  != m_iWidth  );
    593   AOT( pcPicYuv->getHeight() < m_iUsedHeight + m_iHorOffset );
     596  AOT( pcPicYuv->getWidth( COMPONENT_Y)  != m_iWidth  );
     597  AOT( pcPicYuv->getChromaFormat( )  != CHROMA_420 );
     598  AOT( pcPicYuv->getHeight( COMPONENT_Y ) < m_iUsedHeight + m_iHorOffset );
    594599
    595600  Pel RenModelOutPels::* piD = 0;
    596601  xGetSampleStrDepthPtrs(iViewPos, piD);
    597   xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, piD, pcPicYuv->getLumaAddr() + pcPicYuv->getStride() * m_iHorOffset, pcPicYuv->getStride(), m_iWidth, m_iUsedHeight );
    598   pcPicYuv->setChromaTo( 1 << (g_bitDepthC - 1) );   
     602  xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, piD, pcPicYuv->getAddr( COMPONENT_Y ) + pcPicYuv->getStride( COMPONENT_Y ) * m_iHorOffset, pcPicYuv->getStride( COMPONENT_Y ), m_iWidth, m_iUsedHeight );
     603  pcPicYuv->setChromaTo( 1 << (REN_BIT_DEPTH - 1) );   
    599604}
    600605
     
    603608TRenSingleModelC<iBM,bBitInc>::getRefVideo ( Int iViewPos, TComPicYuv* pcPicYuv )
    604609
    605   AOT( pcPicYuv->getWidth()  != m_iWidth  );
    606   AOT( pcPicYuv->getHeight() <  m_iUsedHeight + m_iHorOffset);
     610  AOT( pcPicYuv->getChromaFormat( ) != CHROMA_420 );
     611  AOT( pcPicYuv->getWidth( COMPONENT_Y )  != m_iWidth  );
     612  AOT( pcPicYuv->getHeight( COMPONENT_Y ) <  m_iUsedHeight + m_iHorOffset);
    607613
    608614#if H_3D_VSO_COLOR_PLANES
     
    633639
    634640template <BlenMod iBM, Bool bBitInc> RMDist
    635 TRenSingleModelC<iBM,bBitInc>::getDistVideo( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData )
     641TRenSingleModelC<iBM,bBitInc>::getDistVideo( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData )
    636642{
    637643  AOF(false);
     
    640646
    641647template <BlenMod iBM, Bool bBitInc> Void
    642 TRenSingleModelC<iBM,bBitInc>::setVideo( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData )
     648TRenSingleModelC<iBM,bBitInc>::setVideo( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData )
    643649{
    644650  AOF(false);
     
    665671#if H_3D_VSO_EARLY_SKIP
    666672template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline RMDist
    667 TRenSingleModelC<iBM,bBitInc>::xRenderL( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Bool bFast)
     673TRenSingleModelC<iBM,bBitInc>::xRenderL( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, Bool bFast)
    668674#else
    669675template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline RMDist
    670 TRenSingleModelC<iBM,bBitInc>::xRenderL( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData)
     676TRenSingleModelC<iBM,bBitInc>::xRenderL( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData)
    671677#endif
    672678{
     
    789795#ifdef  H_3D_VSO_EARLY_SKIP
    790796template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline RMDist
    791 TRenSingleModelC<iBM,bBitInc>::xRenderR( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData , Bool bFast)
     797TRenSingleModelC<iBM,bBitInc>::xRenderR( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData , Bool bFast)
    792798#else
    793799template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline RMDist
    794 TRenSingleModelC<iBM,bBitInc>::xRenderR( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData )
     800TRenSingleModelC<iBM,bBitInc>::xRenderR( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData )
    795801#endif
    796802{
     
    18771883TRenSingleModelC<iBM,bBitInc>::xCopy2PicYuv( Pel** ppiSrcVideoPel, Int* piStrides, TComPicYuv* rpcPicYuvTarget )
    18781884{
    1879   TRenFilter::copy            ( ppiSrcVideoPel[0], piStrides[0], m_iWidth, m_iUsedHeight, rpcPicYuvTarget->getLumaAddr() +  m_iHorOffset       * rpcPicYuvTarget->getStride() , rpcPicYuvTarget->getStride () );
    1880   TRenFilter::sampleDown2Tap13( ppiSrcVideoPel[1], piStrides[1], m_iWidth, m_iUsedHeight, rpcPicYuvTarget->getCbAddr  () + (m_iHorOffset >> 1) * rpcPicYuvTarget->getCStride(), rpcPicYuvTarget->getCStride() );
    1881   TRenFilter::sampleDown2Tap13( ppiSrcVideoPel[2], piStrides[2], m_iWidth, m_iUsedHeight, rpcPicYuvTarget->getCrAddr  () + (m_iHorOffset >> 1) * rpcPicYuvTarget->getCStride(), rpcPicYuvTarget->getCStride() );
     1885  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 ) );
     1886  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) );
     1887  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) );
    18821888}
    18831889
     
    18951901template <BlenMod iBM, Bool bBitInc>
    18961902__inline Bool
    1897 TRenSingleModelC<iBM,bBitInc>::xDetectEarlySkipL( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData,Pel* piOrgData, Int iOrgStride)
     1903TRenSingleModelC<iBM,bBitInc>::xDetectEarlySkipL( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel* piOrgData, Int iOrgStride)
    18981904{
    18991905  RM_AOF( m_bEarlySkip );
     
    19271933template <BlenMod iBM, Bool bBitInc>
    19281934__inline Bool
    1929 TRenSingleModelC<iBM,bBitInc>::xDetectEarlySkipR( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData,Pel* piOrgData, Int iOrgStride)
     1935TRenSingleModelC<iBM,bBitInc>::xDetectEarlySkipR( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel* piOrgData, Int iOrgStride)
    19301936{
    19311937  RM_AOF( m_bEarlySkip );
     
    19581964}
    19591965#endif
    1960 #endif // H_3D
    1961 
     1966#endif // NH_3D
     1967
  • branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenSingleModel.h

    r1179 r1200  
    5151#include <cstring>
    5252
    53 #if H_3D_VSO
     53#if NH_3D_VSO
    5454using namespace std;
    5555
     
    8282  // Set Data
    8383#if H_3D_VSO_EARLY_SKIP
    84   virtual Void   setDepth  ( Int iViewPos,                 Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel* piOrgData, Int iOrgStride )  = 0;
    85 #else
    86   virtual Void   setDepth  ( Int iViewPos,                 Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData )  = 0;
    87 #endif
    88   virtual Void   setVideo  ( Int iViewPos,     Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) = 0;
     84  virtual Void   setDepth  ( Int iViewPos,                 Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel* piOrgData, Int iOrgStride )  = 0;
     85#else
     86  virtual Void   setDepth  ( Int iViewPos,                 Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData )  = 0;
     87#endif
     88  virtual Void   setVideo  ( Int iViewPos,     Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ) = 0;
    8989
    9090  // Get Distortion
    9191#if H_3D_VSO_EARLY_SKIP
    92   virtual RMDist getDistDepth  ( Int iViewPos,             Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel * piOrgData , Int iOrgStride)=0;
    93 #else
    94   virtual RMDist getDistDepth  ( Int iViewPos,             Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) = 0;
    95 #endif
    96   virtual RMDist getDistVideo  ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) = 0;
     92  virtual RMDist getDistDepth  ( Int iViewPos,             Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel * piOrgData , Int iOrgStride)=0;
     93#else
     94  virtual RMDist getDistDepth  ( Int iViewPos,             Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ) = 0;
     95#endif
     96  virtual RMDist getDistVideo  ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ) = 0;
    9797
    9898  virtual Void   getSynthVideo  ( Int iViewPos, TComPicYuv* pcPicYuv ) = 0; 
     
    172172
    173173#if H_3D_VSO_EARLY_SKIP
    174   Void   setDepth  ( Int iViewPos,                 Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel* piOrgData, Int iOrgStride );
    175 #else
    176   Void   setDepth  ( Int iViewPos,                 Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData );
    177 #endif
    178   Void   setVideo  ( Int iViewPos,     Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData );
    179 
    180   // Get Distortion
    181 #if H_3D_VSO_EARLY_SKIP
    182   RMDist getDistDepth  ( Int iViewPos,             Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel * piOrgData , Int iOrgStride);
    183 #else
    184   RMDist getDistDepth  ( Int iViewPos,             Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData );
    185 #endif
    186   RMDist getDistVideo  ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData );
     174  Void   setDepth  ( Int iViewPos,                 Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel* piOrgData, Int iOrgStride );
     175#else                                                                                                                   
     176  Void   setDepth  ( Int iViewPos,                 Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData );
     177#endif                                                                                                                   
     178  Void   setVideo  ( Int iViewPos,     Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData );
     179                                                                                                                         
     180  // Get Distortion                                                                                                     
     181#if H_3D_VSO_EARLY_SKIP                                                                                                 
     182  RMDist getDistDepth  ( Int iViewPos,             Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel * piOrgData , Int iOrgStride);
     183#else                                                                                                                   
     184  RMDist getDistDepth  ( Int iViewPos,             Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData );
     185#endif                                                                                                                   
     186  RMDist getDistVideo  ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData );
    187187
    188188  Void   getSynthVideo  ( Int iViewPos, TComPicYuv* pcPicYuv ); 
     
    198198  // Left to Right
    199199#if H_3D_VSO_EARLY_SKIP
    200                       __inline Bool   xDetectEarlySkipL   ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData,Pel* piOrgData, Int iOrgStride );
    201                       __inline Bool   xDetectEarlySkipR   ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData,Pel* piOrgData, Int iOrgStride );
    202   template<Bool bSet> __inline RMDist xRenderL            ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Bool bFast );
    203   template<Bool bSet> __inline RMDist xRenderR            ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Bool bFast );
    204 #else
    205   template<Bool bSet> __inline RMDist xRenderR            ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData );
    206   template<Bool bSet> __inline RMDist xRenderL            ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData );
     200                      __inline Bool   xDetectEarlySkipL   ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel* piOrgData, Int iOrgStride );
     201                      __inline Bool   xDetectEarlySkipR   ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel* piOrgData, Int iOrgStride );
     202  template<Bool bSet> __inline RMDist xRenderL            ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, Bool bFast );
     203  template<Bool bSet> __inline RMDist xRenderR            ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, Bool bFast );
     204#else
     205  template<Bool bSet> __inline RMDist xRenderR            ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData );
     206  template<Bool bSet> __inline RMDist xRenderL            ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData );
    207207#endif
    208208                      __inline Void   xInitRenderPartL    ( Int iEndChangePos, Int iLastSPos  );
     
    353353  Int   m_iCurViewPos;                 // Current View Position 0: Left, 1: Right
    354354  Int   m_iOtherViewPos;               // Other View Position 0: Left, 1: Right
    355   Pel*  m_piNewDepthData;              // Pointer to new depth data
     355  const Pel*  m_piNewDepthData;              // Pointer to new depth data
    356356  Int   m_iStartChangePosX;            // Start Position of new data
    357357  Int   m_iNewDataWidth;               // Width of new data
     
    389389};
    390390
    391 #endif // H_3D
     391#endif // NH_3D
    392392#endif //__TRENSINGLEMODEL__
    393393
  • branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenTop.cpp

    r1179 r1200  
    4040#include <math.h>
    4141#include "../TLibCommon/CommonDef.h"
    42 #if H_3D
     42#if NH_3D
    4343
    4444
     
    114114    if (uiPlane == 0)
    115115    {
    116       TRenFilter::sampleHorUp    ( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
     116      TRenFilter<REN_BIT_DEPTH>::sampleHorUp    ( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
    117117    }
    118118    else
     
    120120      if ( m_bUVUp )
    121121      {
    122         TRenFilter::sampleCUpHorUp( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
     122        TRenFilter<REN_BIT_DEPTH>::sampleCUpHorUp( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
    123123      }
    124124      else
    125125      {
    126         TRenFilter::sampleCHorUp   ( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
     126        TRenFilter<REN_BIT_DEPTH>::sampleCHorUp   ( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
    127127      }
    128128    }
     
    147147  AOT( iLog2SamplingFactor > 2);
    148148
    149   TRenFilter::sampleHorUp(iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
     149  TRenFilter<REN_BIT_DEPTH>::sampleHorUp(iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
    150150
    151151  if ( !m_bUVUp ) //GT: depth down
     
    154154    PelImagePlane* pcTempPlane = new PelImagePlane(pcOrgInputImage->getPlane(0)->getWidth(), ( pcOrgInputImage->getPlane(0)->getHeight() >> 1), REN_LUMA_MARGIN );
    155155
    156     TRenFilter::sampleVerDown2Tap13(pcOrgInputImage->getPlane(0), pcTempPlane, PICYUV_PAD);
     156    TRenFilter<REN_BIT_DEPTH>::sampleVerDown2Tap13(pcOrgInputImage->getPlane(0), pcTempPlane, PICYUV_PAD);
    157157    pcConvPlane = pcConvInputImage->getPlane(1);
    158158
    159159    if ( iLog2SamplingFactor == 0 )
    160160    {
    161       TRenFilter::sampleHorDown2Tap13(pcTempPlane, pcConvPlane, 0 );
     161      TRenFilter<REN_BIT_DEPTH>::sampleHorDown2Tap13(pcTempPlane, pcConvPlane, 0 );
    162162    }
    163163    else
    164164    {
    165       TRenFilter::sampleHorUp    ( iLog2SamplingFactor - 1, pcTempPlane->getPlaneData(), pcTempPlane->getStride(), pcTempPlane->getWidth(), pcTempPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
     165      TRenFilter<REN_BIT_DEPTH>::sampleHorUp    ( iLog2SamplingFactor - 1, pcTempPlane->getPlaneData(), pcTempPlane->getStride(), pcTempPlane->getWidth(), pcTempPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
    166166    }
    167167    delete pcTempPlane;
     
    175175  {
    176176    m_pcTempImage->assign( pcOrgInputImage );
    177     TRenFilter::mirrorHor( m_pcTempImage );
     177    TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcTempImage );
    178178    m_pcTempImage->extendMargin();
    179179    xConvertInputVideo(    m_pcTempImage, pcConvInputImage );
    180180
    181181    m_pcTempImage->getPlane(0)->assign( pcOrgInputDepth->getPlane(0) );
    182     TRenFilter::mirrorHor( m_pcTempImage->getPlane(0) );
     182    TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcTempImage->getPlane(0) );
    183183    m_pcTempImage->getPlane(0)->extendMargin();
    184184    xConvertInputDepth( m_pcTempImage, pcConvInputDepth );
     
    209209    if ( uiPlane == 0 )
    210210    {
    211       TRenFilter::sampleHorDown( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
     211      TRenFilter<REN_BIT_DEPTH>::sampleHorDown( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
    212212    }
    213213    else
     
    215215      if ( m_bUVUp )
    216216      {
    217         TRenFilter::sampleCDownHorDown( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
     217        TRenFilter<REN_BIT_DEPTH>::sampleCDownHorDown( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
    218218      }
    219219      else
    220220      {
    221         TRenFilter::sampleCHorDown    ( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
     221        TRenFilter<REN_BIT_DEPTH>::sampleCHorDown    ( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
    222222      }
    223223    }
     
    226226  if ( bMirror )
    227227  {
    228     TRenFilter::mirrorHor( pcConvOutputImage );
     228    TRenFilter<REN_BIT_DEPTH>::mirrorHor( pcConvOutputImage );
    229229  }
    230230
     
    253253  if ( !m_bExtrapolate )
    254254  {
    255     TRenFilter::setupZLUT( m_bBlendUseDistWeight, m_iBlendZThresPerc, iRelDistToLeft, ppiBaseShiftLUTLeft, ppiBaseShiftLUTRight, m_iBlendZThres, m_iBlendDistWeight, m_piInvZLUTLeft, m_piInvZLUTRight);
     255    TRenFilter<REN_BIT_DEPTH>::setupZLUT( m_bBlendUseDistWeight, m_iBlendZThresPerc, iRelDistToLeft, ppiBaseShiftLUTLeft, ppiBaseShiftLUTRight, m_iBlendZThres, m_iBlendDistWeight, m_piInvZLUTLeft, m_piInvZLUTRight);
    256256  }
    257257}
     
    261261  AOF( m_bExtrapolate );
    262262  AOF( bRenderFromLeft ? m_ppiShiftLUTLeft || m_ppdShiftLUTLeft : m_ppiShiftLUTRight || m_ppdShiftLUTRight );
    263   AOF( m_auiInputResolution[0] == pcPicYuvVideo->getWidth ());
    264   AOF( m_auiInputResolution[1] == pcPicYuvVideo->getHeight());
     263  AOF( m_auiInputResolution[0] == pcPicYuvVideo->getWidth ( COMPONENT_Y ));
     264  AOF( m_auiInputResolution[1] == pcPicYuvVideo->getHeight( COMPONENT_Y ));
    265265
    266266  PelImage cInputImage ( pcPicYuvVideo    );
     
    284284{
    285285  AOF( bRenderFromLeft ? m_ppiShiftLUTLeft && m_ppdShiftLUTLeft : m_ppiShiftLUTRight && m_ppdShiftLUTRight );
    286   AOF(m_auiInputResolution[0] == pcPicYuvDepth->getWidth ());
    287   AOF(m_auiInputResolution[1] == pcPicYuvDepth->getHeight());
     286  AOF(m_auiInputResolution[0] == pcPicYuvDepth->getWidth (COMPONENT_Y));
     287  AOF(m_auiInputResolution[1] == pcPicYuvDepth->getHeight(COMPONENT_Y));
    288288
    289289  PelImage cInputDepth ( pcPicYuvDepth    , true);
     
    300300  if ( !bRenderFromLeft )
    301301  {
    302     TRenFilter::mirrorHor( m_pcFilled );
    303   }
    304 
    305   TRenFilter::filledToUsedPelMap( m_pcFilled, &cOutputImage, m_iUsedPelMapMarExt );
     302    TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcFilled );
     303  }
     304
     305  TRenFilter<REN_BIT_DEPTH>::filledToUsedPelMap( m_pcFilled, &cOutputImage, m_iUsedPelMapMarExt );
    306306};
    307307
     
    310310{
    311311  assert( !m_bExtrapolate );
    312   assert( m_auiInputResolution[0] == pcPicYuvVideoLeft ->getWidth () );
    313   assert( m_auiInputResolution[1] == pcPicYuvVideoRight->getHeight() );
     312  assert( m_auiInputResolution[0] == pcPicYuvVideoLeft ->getWidth ( COMPONENT_Y ) );
     313  assert( m_auiInputResolution[1] == pcPicYuvVideoRight->getHeight( COMPONENT_Y ) );
    314314
    315315  AOT( iBlendMode == 3);
     
    363363  xCreateAlphaMap( m_pcRightFilled,      m_pcRightFilled, false );
    364364
    365   TRenFilter::mirrorHor( m_pcRightOutputImage );
    366   TRenFilter::mirrorHor( m_pcRightOutputDepth );
    367   TRenFilter::mirrorHor( m_pcRightFilled      );
     365  TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcRightOutputImage );
     366  TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcRightOutputDepth );
     367  TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcRightFilled      );
    368368
    369369  xEnhSimilarity( m_pcLeftOutputImage, m_pcRightOutputImage, m_pcLeftFilled, m_pcRightFilled );
     
    377377    xCreateAlphaMap      ( m_pcLeftFilled,       m_pcLeftFilled,       true );
    378378
    379     TRenFilter::mirrorHor( m_pcRightInputImage );
     379    TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcRightInputImage );
    380380    xBackShiftPixels     ( m_pcRightInputImage,  m_pcOutputDepth,      m_pcRightOutputImage, m_pcRightFilled , true );
    381381    xFillHoles           ( m_pcRightOutputImage, m_pcRightFilled,      m_pcRightOutputImage, true);
    382382
    383     TRenFilter::mirrorHor( m_pcRightFilled );
     383    TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcRightFilled );
    384384    xCreateAlphaMap      ( m_pcRightFilled,      m_pcRightFilled,      true );
    385     TRenFilter::mirrorHor( m_pcRightFilled );
     385    TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcRightFilled );
    386386  }
    387387
     
    415415  {
    416416    case eRenPreProBinom:
    417       TRenFilter::binominal(pcOutImage, pcTemp, m_iPreFilterSize);
     417      TRenFilter<REN_BIT_DEPTH>::binominal(pcOutImage, pcTemp, m_iPreFilterSize);
    418418      break;
    419419    case eRenPreProNone:
     
    607607    {
    608608      apcDiffPlane[uiCurPlane] = new IntImagePlane( iWidth, iHeight, apcInputPlanes[uiCurPlane]->getPad());
    609       TRenFilter::diffHorSym(apcInputPlanes[uiCurPlane] , apcDiffPlane[uiCurPlane]);
     609      TRenFilter<REN_BIT_DEPTH>::diffHorSym(apcInputPlanes[uiCurPlane] , apcDiffPlane[uiCurPlane]);
    610610      ppiDiffPlanes[uiCurPlane] = apcDiffPlane[uiCurPlane]->getPlaneData();
    611611    }
     
    659659              for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
    660660              {
    661                 cVal  = TRenFilter::interpCHSpline(iInterPolPos, dShiftedPos, dPrevShiftedPos, apcInputData[uiCurPlane][iPosX - 1], ppiDiffPlanes[uiCurPlane][iPosX - 1], apcInputData[uiCurPlane][iPosX], ppiDiffPlanes[uiCurPlane][iPosX] );
     661                cVal  = TRenFilter<REN_BIT_DEPTH>::interpCHSpline(iInterPolPos, dShiftedPos, dPrevShiftedPos, apcInputData[uiCurPlane][iPosX - 1], ppiDiffPlanes[uiCurPlane][iPosX - 1], apcInputData[uiCurPlane][iPosX], ppiDiffPlanes[uiCurPlane][iPosX] );
    662662                apcOutputData[uiCurPlane][iInterPolPos]  = cVal;
    663663              }
     
    15161516  {
    15171517  case eRenPostProMed:
    1518     TRenFilter::lineMedian3(pcTemp);
     1518    TRenFilter<REN_BIT_DEPTH>::lineMedian3(pcTemp);
    15191519    break;
    15201520  case eRenPostProNone:
     
    15991599
    16001600Void TRenTop::xEnhSimilarityPlane       ( PelImagePlane** apcLeftPlane, PelImagePlane** apcRightPlane, PelImagePlane* pcFilledLeftPlane, PelImagePlane* pcFilledRightPlane, UInt uiNumberOfPlanes )
    1601 {
    1602   AOF( g_bitDepthC == g_bitDepthY );
     1601
    16031602  AOT( m_iSimEnhBaseView != 1 && m_iSimEnhBaseView != 2 );
    16041603  Int iWidth  = (*apcRightPlane)->getWidth ();
    16051604  Int iHeight = (*apcRightPlane)->getHeight();
    16061605
    1607   Int* aiHistLeft  = new Int[ ((Int64)1 ) << g_bitDepthY ];
    1608   Int* aiHistRight = new Int[ ((Int64)1 ) << g_bitDepthY ];
    1609   Pel* aiConvLUT   = new Pel[ ((Int64)1 ) << g_bitDepthY ];
     1606  Int* aiHistLeft  = new Int[ ((Int64)1 ) << REN_BIT_DEPTH ];
     1607  Int* aiHistRight = new Int[ ((Int64)1 ) << REN_BIT_DEPTH ];
     1608  Pel* aiConvLUT   = new Pel[ ((Int64)1 ) << REN_BIT_DEPTH ];
    16101609
    16111610  for (UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++ )
    16121611  {
    1613     for (Int iCurVal = 0 ; iCurVal < ( 1 << g_bitDepthY ); iCurVal++)
     1612    for (Int iCurVal = 0 ; iCurVal < ( 1 << REN_BIT_DEPTH ); iCurVal++)
    16141613    {
    16151614      aiHistLeft [iCurVal] = 0;
     
    16581657    Int iCheckSumRight = 0;
    16591658
    1660     for (Int iCurVal = 0 ; iCurVal < ( 1 << g_bitDepthY ); iCurVal++)
     1659    for (Int iCurVal = 0 ; iCurVal < ( 1 << REN_BIT_DEPTH ); iCurVal++)
    16611660    {
    16621661      iCheckSumLeft  += aiHistLeft [iCurVal];
     
    16651664
    16661665
    1667     while( iCurChangeVal < ( 1 << g_bitDepthY ) )
     1666    while( iCurChangeVal < ( 1 << REN_BIT_DEPTH ) )
    16681667    {
    16691668      if ( iCumSumBase == iCumSumChange )
    16701669      {
    1671         aiConvLUT[iCurChangeVal] = std::min( iCurBaseVal,  ( 1 << g_bitDepthY ) - 1 );
     1670        aiConvLUT[iCurChangeVal] = std::min( iCurBaseVal,  ( 1 << REN_BIT_DEPTH ) - 1 );
    16721671        iCurBaseVal  ++;
    16731672        iCurChangeVal++;
    16741673        iCumSumChange += aiHistChange[iCurChangeVal];
    1675         if (iCurBaseVal <  ( 1 << g_bitDepthY ) )
     1674        if (iCurBaseVal <  ( 1 << REN_BIT_DEPTH ) )
    16761675        {
    16771676          iCumSumBase   += aiHistBase  [iCurBaseVal]  ;
     
    16811680      {
    16821681        iCurBaseVal++;
    1683         if (iCurBaseVal < ( 1 << g_bitDepthY ) )
     1682        if (iCurBaseVal < ( 1 << REN_BIT_DEPTH ) )
    16841683        {
    16851684          iCumSumBase   += aiHistBase  [iCurBaseVal]  ;
     
    16881687      else if ( iCumSumBase > iCumSumChange)
    16891688      {
    1690         aiConvLUT[iCurChangeVal] = std::min(iCurBaseVal, ( 1 << g_bitDepthY )-1);
     1689        aiConvLUT[iCurChangeVal] = std::min(iCurBaseVal, ( 1 << REN_BIT_DEPTH )-1);
    16911690        iCurChangeVal++;
    16921691        iCumSumChange += aiHistChange  [iCurChangeVal]  ;
     
    18971896Void TRenTop::temporalFilterVSRS( TComPicYuv* pcPicYuvVideoCur, TComPicYuv* pcPicYuvDepthCur, TComPicYuv* pcPicYuvVideoLast, TComPicYuv* pcPicYuvDepthLast, Bool bFirstFrame )
    18981897{
    1899   AOF( g_bitDepthY == g_bitDepthC );
    19001898  Int iSADThres  = 100 ;  //threshold of sad in 4*4 block motion detection
    19011899
     
    19061904  Int* piFlagMoving =  m_aiBlkMoving + 2;
    19071905
    1908   Int iVideoCurStride     = pcPicYuvVideoCur ->getStride();
    1909   Int iVideoLastStride    = pcPicYuvVideoLast->getStride();
    1910   Int iDepthCurStride     = pcPicYuvDepthCur ->getStride();
    1911   Int iDepthLastStride    = pcPicYuvDepthLast->getStride();
    1912 
    1913   Pel* pcVideoCurData     = pcPicYuvVideoCur ->getLumaAddr();
    1914   Pel* pcVideoLastData    = pcPicYuvVideoLast->getLumaAddr();
    1915   Pel* pcDepthCurData     = pcPicYuvDepthCur ->getLumaAddr();
    1916   Pel* pcDepthLastData    = pcPicYuvDepthLast->getLumaAddr();
     1906  Int iVideoCurStride     = pcPicYuvVideoCur ->getStride( COMPONENT_Y );
     1907  Int iVideoLastStride    = pcPicYuvVideoLast->getStride( COMPONENT_Y );
     1908  Int iDepthCurStride     = pcPicYuvDepthCur ->getStride( COMPONENT_Y );
     1909  Int iDepthLastStride    = pcPicYuvDepthLast->getStride( COMPONENT_Y );
     1910
     1911  Pel* pcVideoCurData     = pcPicYuvVideoCur ->getAddr( COMPONENT_Y );
     1912  Pel* pcVideoLastData    = pcPicYuvVideoLast->getAddr( COMPONENT_Y );
     1913  Pel* pcDepthCurData     = pcPicYuvDepthCur ->getAddr( COMPONENT_Y );
     1914  Pel* pcDepthLastData    = pcPicYuvDepthLast->getAddr( COMPONENT_Y );
    19171915
    19181916  Pel* pcVideoCurDataFrm  = pcVideoCurData ;
     
    19641962            { //Weight: 0.75
    19651963              Int iFilt = (( (pcDepthLastDataBlk[iCurPosX] << 1 ) + pcDepthLastDataBlk[iCurPosX] + pcDepthCurDataBlk[iCurPosX] + 2 ) >> 2 );
    1966               assert( (iFilt >= 0) && (iFilt <  ( 1 << g_bitDepthY ) ) );
     1964              assert( (iFilt >= 0) && (iFilt <  ( 1 << REN_BIT_DEPTH ) ) );
    19671965              pcDepthCurDataBlk[iCurPosX] = pcDepthLastDataBlk[iCurPosX];
    19681966              pcDepthCurDataBlk[iCurPosX] = iFilt;
     
    21692167    }
    21702168
    2171     TRenFilter::setSubPelShiftLUT(m_iRelShiftLUTPrec, m_aaiSubPelShift, -1);
     2169    TRenFilter<REN_BIT_DEPTH>::setSubPelShiftLUT(m_iRelShiftLUTPrec, m_aaiSubPelShift, -1);
    21722170  }
    21732171
     
    22352233  if(m_aiBlkMoving         != NULL ) delete[] m_aiBlkMoving;
    22362234}
    2237 #endif // H_3D
    2238 
     2235#endif // NH_3D
     2236
  • branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenTop.h

    r1179 r1200  
    3939#include "../TLibCommon/TComPicYuv.h"
    4040
    41 #if H_3D
     41#if NH_3D
    4242#include <list>
    4343#include <vector>
     
    270270};
    271271
    272 #endif // H_3D
     272#endif // NH_3D
    273273#endif //__TRENTOP__
Note: See TracChangeset for help on using the changeset viewer.