Changeset 1313 in 3DVCSoftware for trunk/source/Lib/TLibRenderer/TRenTop.cpp


Ignore:
Timestamp:
13 Aug 2015, 17:38:13 (9 years ago)
Author:
tech
Message:

Merged 14.1-update-dev1@1312.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibRenderer/TRenTop.cpp

    r1179 r1313  
    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
Note: See TracChangeset for help on using the changeset viewer.