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
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.