Ignore:
Timestamp:
24 Feb 2012, 20:22:58 (13 years ago)
Author:
poznan-univ
Message:

Poznan Tools

  • Encoding only disoccluded CUs in depended views
  • Depth based motion prediction
  • Texture QP adjustment based on depth data
  • Nonlinear depth representation
Location:
branches/0.3-poznan-univ/source/Lib/TLibRenderer
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/0.3-poznan-univ/source/Lib/TLibRenderer/TRenFilter.cpp

    r5 r28  
    6666  riBlendDistWeight = bBlendUseDistWeight ? iRelDistToLeft :  1 << (REN_VDWEIGHT_PREC - 1);
    6767
    68   for (UInt uiDepthValue = 0; uiDepthValue <= 256; uiDepthValue++)
     68  for (UInt uiDepthValue = 0; uiDepthValue <= SizeOfLUT; uiDepthValue++)
    6969  {
    7070    //GT: retrieve depth approx from shift
     
    7373  }
    7474  // Set Threshold
    75   riBlendZThres  = ( max( abs(piInvZLUTLeft[0]- piInvZLUTLeft[255]), abs(piInvZLUTRight[0]- piInvZLUTRight[255]) ) * iBlendZThresPerc + 50)  / 100;
     75  riBlendZThres  = ( max( abs(piInvZLUTLeft[0]- piInvZLUTLeft[SizeOfLUT-1]), abs(piInvZLUTRight[0]- piInvZLUTRight[SizeOfLUT-1]) ) * iBlendZThresPerc + 50)  / 100;
    7676}
    7777
  • branches/0.3-poznan-univ/source/Lib/TLibRenderer/TRenSingleModel.cpp

    r5 r28  
    139139  if (m_iMode == 2)
    140140  {
    141     m_piInvZLUTLeft  = new Int[257];
    142     m_piInvZLUTRight = new Int[257];
     141    m_piInvZLUTLeft  = new Int[SizeOfLUT+1];
     142    m_piInvZLUTRight = new Int[SizeOfLUT+1];
    143143  }
    144144
     
    448448      m_iLastOccludedSPosFP = xRangeLeftL( m_iLastOccludedSPos );
    449449      xExtrapolateMarginL  ( iCurSPos, iEndChangePos, iError );
    450       iMinChangedSPos       = Min( iMinChangedSPos, (iEndChangePos << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrement( Max(m_apiBaseDepthPelRow[m_iCurViewPos][iEndChangePos], m_piNewDepthData[iPosXinNewData] )) ]);
     450      iMinChangedSPos       = Min( iMinChangedSPos, (iEndChangePos << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrementLUT( Max(m_apiBaseDepthPelRow[m_iCurViewPos][iEndChangePos], m_piNewDepthData[iPosXinNewData] )) ]);
    451451      iLastSPos             = iCurSPos;
    452452      m_iLastDepth          = m_iCurDepth;
     
    466466    {
    467467      // Get minimal changed sample position
    468       iMinChangedSPos = Min( iMinChangedSPos, (iCurPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrement( Max(m_apiBaseDepthPelRow[m_iCurViewPos][iCurPosX], m_piNewDepthData[iPosXinNewData] )) ]);
     468      iMinChangedSPos = Min( iMinChangedSPos, (iCurPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrementLUT( Max(m_apiBaseDepthPelRow[m_iCurViewPos][iCurPosX], m_piNewDepthData[iPosXinNewData] )) ]);
    469469      Int iCurSPos    = xShiftNewData(iCurPosX,iPosXinNewData);
    470470      m_iCurDepth     = m_piNewDepthData[iPosXinNewData];
     
    541541      m_iLastOccludedSPosFP = xRangeRightR( m_iLastOccludedSPos );
    542542      xExtrapolateMarginR     ( iCurSPos, iStartChangePos, iError );
    543       iMaxChangedSPos       = Max( iMaxChangedSPos, (iStartChangePos << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrement( Max(m_apiBaseDepthPelRow[m_iCurViewPos][iStartChangePos], m_piNewDepthData[iPosXinNewData] )) ]);
     543      iMaxChangedSPos       = Max( iMaxChangedSPos, (iStartChangePos << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrementLUT( Max(m_apiBaseDepthPelRow[m_iCurViewPos][iStartChangePos], m_piNewDepthData[iPosXinNewData] )) ]);
    544544      iLastSPos             = iCurSPos;
    545545      m_iLastDepth          = m_iCurDepth;
     
    559559    {
    560560      // Get minimal changed sample position
    561       iMaxChangedSPos = Max( iMaxChangedSPos, (iCurPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrement( Max(m_apiBaseDepthPelRow[m_iCurViewPos][iCurPosX], m_piNewDepthData[iPosXinNewData] )) ]);
     561      iMaxChangedSPos = Max( iMaxChangedSPos, (iCurPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrementLUT( Max(m_apiBaseDepthPelRow[m_iCurViewPos][iCurPosX], m_piNewDepthData[iPosXinNewData] )) ]);
    562562      Int iCurSPos    = xShiftNewData(iCurPosX,iPosXinNewData);
    563563      m_iCurDepth     = m_piNewDepthData[iPosXinNewData];
     
    948948  AOF( iPosInNewData < m_iNewDataWidth );
    949949
    950   return (iPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrement( m_piNewDepthData[iPosInNewData] )];
     950  return (iPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrementLUT( m_piNewDepthData[iPosInNewData] )];
    951951}
    952952
     
    956956 AOT( iPosX <        0);
    957957 AOF( iPosX < m_iWidth);
    958  return (iPosX  << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrement( m_apiBaseDepthPelRow[m_iCurViewPos][iPosX] )];
     958 return (iPosX  << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrementLUT( m_apiBaseDepthPelRow[m_iCurViewPos][iPosX] )];
    959959}
    960960
     
    11491149      m_aapiSynthVideoPelRow                                   [1][2][iTargetSPos]  ,
    11501150#endif
    1151       m_piInvZLUTLeft [RemoveBitIncrement(m_iThisDepth)                            ],
    1152       m_piInvZLUTRight[RemoveBitIncrement(m_apiSynthDepthPelRow[1]   [iTargetSPos])],
     1151      m_piInvZLUTLeft [RemoveBitIncrementLUT(m_iThisDepth)                            ],
     1152      m_piInvZLUTRight[RemoveBitIncrementLUT(m_apiSynthDepthPelRow[1]   [iTargetSPos])],
    11531153      iFilled,
    11541154      m_apiFilledRow                                           [1]   [iTargetSPos]  ,
     
    11711171      m_aapiBaseVideoPelRow                                    [1][2][iSourcePos ],
    11721172#endif
    1173       m_piInvZLUTLeft [RemoveBitIncrement(m_apiSynthDepthPelRow[0]   [iTargetSPos])],
    1174       m_piInvZLUTRight[RemoveBitIncrement(m_iThisDepth)                            ],
     1173      m_piInvZLUTLeft [RemoveBitIncrementLUT(m_apiSynthDepthPelRow[0]   [iTargetSPos])],
     1174      m_piInvZLUTRight[RemoveBitIncrementLUT(m_iThisDepth)                            ],
    11751175      m_apiFilledRow                                           [0]   [iTargetSPos],
    11761176      iFilled                                                                     ,
  • branches/0.3-poznan-univ/source/Lib/TLibRenderer/TRenTop.cpp

    r5 r28  
    242242    for( UInt uiPlane = 0; uiPlane < 2; uiPlane++)
    243243    {
    244       for (UInt uiDepthValue = 0; uiDepthValue <= 256; uiDepthValue++)
     244      for (UInt uiDepthValue = 0; uiDepthValue <= SizeOfLUT; uiDepthValue++)
    245245      {
    246246        m_ppdShiftLUTRightMirror[uiPlane][uiDepthValue] = - m_ppdShiftLUTRight[uiPlane][uiDepthValue];
     
    280280};
    281281
     282#if POZNAN_SYNTH
     283Void TRenTop::extrapolateAvailabilityView( TComPicYuv* pcPicYuvVideo, TComPicYuv* pcPicYuvDepth, TComPicYuv* pcPicYuvSynthOut, TComPicYuv* pcPicYuvAvailOut, Bool bRenderFromLeft )
     284{
     285  AOF( m_bExtrapolate );
     286  AOF( bRenderFromLeft ? m_ppiShiftLUTLeft || m_ppdShiftLUTLeft : m_ppiShiftLUTRight || m_ppdShiftLUTRight );
     287  AOF( m_auiInputResolution[0] == pcPicYuvVideo->getWidth ());
     288  AOF( m_auiInputResolution[1] == pcPicYuvVideo->getHeight());
     289
     290  PelImage cInputImage ( pcPicYuvVideo    );
     291  PelImage cInputDepth ( pcPicYuvDepth    , true);
     292  PelImage cOutputImage( pcPicYuvSynthOut );
     293  PelImage cFillImage( pcPicYuvAvailOut );
     294   
     295  m_pcOutputImage->init();
     296  m_pcFilled     ->assign(REN_IS_HOLE);
     297 
     298  xPreProcessDepth ( &cInputDepth,  &cInputDepth);
     299  xConvertInputData( &cInputImage, &cInputDepth, m_pcInputImage, m_pcInputDepth, !bRenderFromLeft );
     300  xShiftPixels(m_pcInputImage, m_pcInputDepth, m_pcOutputImage, &cFillImage, bRenderFromLeft);
     301  xRemBoundaryNoise ( m_pcOutputImage, &cFillImage, m_pcOutputImage, bRenderFromLeft); // Erode
     302  xFillHoles        ( m_pcOutputImage, &cFillImage, m_pcOutputImage, bRenderFromLeft);
     303  xConvertOutputData( m_pcOutputImage, &cOutputImage, !bRenderFromLeft );
     304  if (!bRenderFromLeft)  TRenFilter::mirrorHor( &cFillImage );
     305  //xConvertOutputData( m_pcFilled, &cFillImage, !bRenderFromLeft );
     306  xPostProcessImage (&cOutputImage, &cOutputImage);
     307  xCutMargin        ( &cOutputImage );
     308};
     309#endif
     310
    282311Void TRenTop::getUsedSamplesMap( TComPicYuv* pcPicYuvDepth, TComPicYuv* pcUsedSampleMap, Bool bRenderFromLeft )
    283312{
     
    469498
    470499      // compute disparity and shift
    471       iShiftedPos  = ( iPosX << m_iRelShiftLUTPrec ) - m_aiShiftLUTCur[RemoveBitIncrement( pcDepthData[iPosX])];
     500      iShiftedPos  = ( iPosX << m_iRelShiftLUTPrec ) - m_aiShiftLUTCur[RemoveBitIncrementLUT( pcDepthData[iPosX])];
    472501
    473502      if (iPosX == 0)
     
    623652
    624653        // compute disparity and shift
    625         assert( RemoveBitIncrement(pcDepthData[iPosX]) >= 0 && RemoveBitIncrement(pcDepthData[iPosX]) <= 256 );
    626         dPrevShiftedPos  = (Double) iPosX - m_adShiftLUTCur[ RemoveBitIncrement(pcDepthData[iPosX])];
     654        assert( RemoveBitIncrementLUT(pcDepthData[iPosX]) >= 0 && RemoveBitIncrementLUT(pcDepthData[iPosX]) <= SizeOfLUT );
     655        dPrevShiftedPos  = (Double) iPosX - m_adShiftLUTCur[ RemoveBitIncrementLUT(pcDepthData[iPosX])];
    627656
    628657        if (iPosX == 0)
     
    804833    for(Int iPosX = 0; iPosX < iWidth; iPosX++)
    805834    {
    806       assert( RemoveBitIncrement(pcDepthData[iPosX]) >= 0 && RemoveBitIncrement(pcDepthData[iPosX]) <= 256 );
    807       Int iShiftedPos = iPosX - m_aiShiftLUTCur[ RemoveBitIncrement(pcDepthData[iPosX])] ;
     835      assert( RemoveBitIncrementLUT(pcDepthData[iPosX]) >= 0 && RemoveBitIncrementLUT(pcDepthData[iPosX]) <= SizeOfLUT );
     836      Int iShiftedPos = iPosX - m_aiShiftLUTCur[ RemoveBitIncrementLUT(pcDepthData[iPosX])] ;
    808837      if (iShiftedPos < iWidth && iShiftedPos >= 0)
    809838      {
     
    879908    for(Int iPosX = 0; iPosX < iOutputWidth; iPosX ++)
    880909    {
    881       Int iBackShiftedPos = (iPosX << m_iRelShiftLUTPrec) - m_aiShiftLUTCur[ RemoveBitIncrement( pcDepthData[iPosX] )];
     910      Int iBackShiftedPos = (iPosX << m_iRelShiftLUTPrec) - m_aiShiftLUTCur[ RemoveBitIncrementLUT( pcDepthData[iPosX] )];
    882911      if( ( pcFilledData[iPosX] == REN_IS_FILLED )  && (iBackShiftedPos >= 0 ) && ( iBackShiftedPos < iInputWidth ) )
    883912      {
     
    952981    {
    953982      // compute disparity and shift
    954       iShiftedPos  =  iPosX - m_aiShiftLUTCur[RemoveBitIncrement(pcDepthData[iPosX])];
     983      iShiftedPos  =  iPosX - m_aiShiftLUTCur[RemoveBitIncrementLUT(pcDepthData[iPosX])];
    955984
    956985      if ( iPosX == 0 )
     
    18371866        if      (  (pcFilledRightData[uiXPos] != REN_IS_HOLE ) && ( pcFilledLeftData[uiXPos] != REN_IS_HOLE) )
    18381867        {
    1839           Int iDepthDifference  = m_piInvZLUTLeft[RemoveBitIncrement(pcLeftDepthData[uiXPos])] - m_piInvZLUTRight[RemoveBitIncrement(pcRightDepthData[uiXPos])];
     1868          Int iDepthDifference  = m_piInvZLUTLeft[RemoveBitIncrementLUT(pcLeftDepthData[uiXPos])] - m_piInvZLUTRight[RemoveBitIncrementLUT(pcRightDepthData[uiXPos])];
    18401869
    18411870          if ( abs ( iDepthDifference ) <= m_iBlendZThres )
     
    18661895        else if ( (pcFilledRightData[uiXPos] == REN_IS_HOLE) && (pcFilledLeftData[uiXPos] == REN_IS_HOLE))
    18671896        {
    1868           pcOutputData[uiXPos] = m_piInvZLUTLeft[RemoveBitIncrement( pcLeftDepthData[uiXPos])]  < m_piInvZLUTRight[RemoveBitIncrement(pcRightDepthData[uiXPos])] ? pcLeftVideoData[uiXPos] : pcRightVideoData[uiXPos];
     1897          pcOutputData[uiXPos] = m_piInvZLUTLeft[RemoveBitIncrementLUT( pcLeftDepthData[uiXPos])]  < m_piInvZLUTRight[RemoveBitIncrementLUT(pcRightDepthData[uiXPos])] ? pcLeftVideoData[uiXPos] : pcRightVideoData[uiXPos];
    18691898        }
    18701899        else
     
    20302059
    20312060  m_ppdShiftLUTRightMirror    = new Double*[2];
    2032   m_ppdShiftLUTRightMirror[0] = new Double [257];
    2033   m_ppdShiftLUTRightMirror[1] = new Double [257];
     2061  m_ppdShiftLUTRightMirror[0] = new Double [SizeOfLUT+1];
     2062  m_ppdShiftLUTRightMirror[1] = new Double [SizeOfLUT+1];
    20342063
    20352064  m_adShiftLUTCur    = 0;
     
    20382067  m_ppiShiftLUTRight = 0;
    20392068  m_ppiShiftLUTRightMirror    = new Int*[2];
    2040   m_ppiShiftLUTRightMirror[0] = new Int[257];
    2041   m_ppiShiftLUTRightMirror[1] = new Int[257];
     2069  m_ppiShiftLUTRightMirror[0] = new Int[SizeOfLUT+1];
     2070  m_ppiShiftLUTRightMirror[1] = new Int[SizeOfLUT+1];
    20422071
    20432072  m_aiShiftLUTCur    = 0;
    2044   m_piInvZLUTLeft  = new Int[257];
    2045   m_piInvZLUTRight = new Int[257];
     2073  m_piInvZLUTLeft  = new Int[SizeOfLUT+1];
     2074  m_piInvZLUTRight = new Int[SizeOfLUT+1];
    20462075
    20472076  // Buffers
  • branches/0.3-poznan-univ/source/Lib/TLibRenderer/TRenTop.h

    r5 r28  
    109109                           Int         iBlendMode,
    110110                           Int         iSimEnhBaseView );
     111
     112#if POZNAN_SYNTH
     113  Void extrapolateAvailabilityView   
     114                         ( TComPicYuv* pcPicYuvVideo,
     115                           TComPicYuv* pcPicYuvDepth,
     116                           TComPicYuv* pcPicYuvSynthOut,
     117                           TComPicYuv* pcPicYuvAvailOut,
     118                           Bool bRenderFromLeft );
     119#endif
    111120  // Tools
    112121  Void getUsedSamplesMap ( TComPicYuv* pcPicYuvDepth,
Note: See TracChangeset for help on using the changeset viewer.