Ignore:
Timestamp:
6 Feb 2012, 00:52:17 (13 years ago)
Author:
poznan-univ
Message:

Poznan Tools

  • Depth base motion vector prediction
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/0.2-poznan-univ/source/Lib/TLibRenderer/TRenTop.cpp

    r11 r12  
    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];
     
    266266  PelImage cInputDepth ( pcPicYuvDepth    , true);
    267267  PelImage cOutputImage( pcPicYuvSynthOut );
    268    
     268
    269269  m_pcOutputImage->init();
    270270  m_pcFilled     ->assign(REN_IS_HOLE);
     271
    271272  xPreProcessDepth ( &cInputDepth,  &cInputDepth);
    272273  xConvertInputData( &cInputImage, &cInputDepth, m_pcInputImage, m_pcInputDepth, !bRenderFromLeft );
     
    279280};
    280281
    281 #if POZNAN_SYNTH
     282#if POZNAN_CU_SYNTH || POZNAN_CU_SKIP
    282283Void TRenTop::extrapolateAvailabilityView( TComPicYuv* pcPicYuvVideo, TComPicYuv* pcPicYuvDepth, TComPicYuv* pcPicYuvSynthOut, TComPicYuv* pcPicYuvAvailOut, Bool bRenderFromLeft )
    283284{
     
    292293  PelImage cFillImage( pcPicYuvAvailOut );
    293294   
     295  printf("0");
    294296  m_pcOutputImage->init();
    295297  m_pcFilled     ->assign(REN_IS_HOLE);
    296  
     298  printf("1");
    297299  xPreProcessDepth ( &cInputDepth,  &cInputDepth);
     300  printf("2");
    298301  xConvertInputData( &cInputImage, &cInputDepth, m_pcInputImage, m_pcInputDepth, !bRenderFromLeft );
     302  printf("3");
    299303  xShiftPixels(m_pcInputImage, m_pcInputDepth, m_pcOutputImage, &cFillImage, bRenderFromLeft);
     304  printf("4");
    300305  xRemBoundaryNoise ( m_pcOutputImage, &cFillImage, m_pcOutputImage, bRenderFromLeft); // Erode
     306  printf("5");
    301307  xFillHoles        ( m_pcOutputImage, &cFillImage, m_pcOutputImage, bRenderFromLeft);
     308  printf("6");
    302309  xConvertOutputData( m_pcOutputImage, &cOutputImage, !bRenderFromLeft );
    303310  if (!bRenderFromLeft)  TRenFilter::mirrorHor( &cFillImage );
    304311  //xConvertOutputData( m_pcFilled, &cFillImage, !bRenderFromLeft );
     312  printf("7");
    305313  xPostProcessImage (&cOutputImage, &cOutputImage);
     314  printf("8");
    306315  xCutMargin        ( &cOutputImage );
     316  printf("9");
    307317};
    308318#endif
     
    497507
    498508      // compute disparity and shift
    499       iShiftedPos  = ( iPosX << m_iRelShiftLUTPrec ) - m_aiShiftLUTCur[RemoveBitIncrement( pcDepthData[iPosX])];
     509      iShiftedPos  = ( iPosX << m_iRelShiftLUTPrec ) - m_aiShiftLUTCur[RemoveBitIncrementLUT( pcDepthData[iPosX])];
    500510
    501511      if (iPosX == 0)
     
    651661
    652662        // compute disparity and shift
    653         assert( RemoveBitIncrement(pcDepthData[iPosX]) >= 0 && RemoveBitIncrement(pcDepthData[iPosX]) <= 256 );
    654         dPrevShiftedPos  = (Double) iPosX - m_adShiftLUTCur[ RemoveBitIncrement(pcDepthData[iPosX])];
     663        assert( RemoveBitIncrementLUT(pcDepthData[iPosX]) >= 0 && RemoveBitIncrementLUT(pcDepthData[iPosX]) <= SizeOfLUT );
     664        dPrevShiftedPos  = (Double) iPosX - m_adShiftLUTCur[ RemoveBitIncrementLUT(pcDepthData[iPosX])];
    655665
    656666        if (iPosX == 0)
     
    832842    for(Int iPosX = 0; iPosX < iWidth; iPosX++)
    833843    {
    834       assert( RemoveBitIncrement(pcDepthData[iPosX]) >= 0 && RemoveBitIncrement(pcDepthData[iPosX]) <= 256 );
    835       Int iShiftedPos = iPosX - m_aiShiftLUTCur[ RemoveBitIncrement(pcDepthData[iPosX])] ;
     844      assert( RemoveBitIncrementLUT(pcDepthData[iPosX]) >= 0 && RemoveBitIncrementLUT(pcDepthData[iPosX]) <= SizeOfLUT );
     845      Int iShiftedPos = iPosX - m_aiShiftLUTCur[ RemoveBitIncrementLUT(pcDepthData[iPosX])] ;
    836846      if (iShiftedPos < iWidth && iShiftedPos >= 0)
    837847      {
     
    907917    for(Int iPosX = 0; iPosX < iOutputWidth; iPosX ++)
    908918    {
    909       Int iBackShiftedPos = (iPosX << m_iRelShiftLUTPrec) - m_aiShiftLUTCur[ RemoveBitIncrement( pcDepthData[iPosX] )];
     919      Int iBackShiftedPos = (iPosX << m_iRelShiftLUTPrec) - m_aiShiftLUTCur[ RemoveBitIncrementLUT( pcDepthData[iPosX] )];
    910920      if( ( pcFilledData[iPosX] == REN_IS_FILLED )  && (iBackShiftedPos >= 0 ) && ( iBackShiftedPos < iInputWidth ) )
    911921      {
     
    980990    {
    981991      // compute disparity and shift
    982       iShiftedPos  =  iPosX - m_aiShiftLUTCur[RemoveBitIncrement(pcDepthData[iPosX])];
     992      iShiftedPos  =  iPosX - m_aiShiftLUTCur[RemoveBitIncrementLUT(pcDepthData[iPosX])];
    983993
    984994      if ( iPosX == 0 )
     
    18651875        if      (  (pcFilledRightData[uiXPos] != REN_IS_HOLE ) && ( pcFilledLeftData[uiXPos] != REN_IS_HOLE) )
    18661876        {
    1867           Int iDepthDifference  = m_piInvZLUTLeft[RemoveBitIncrement(pcLeftDepthData[uiXPos])] - m_piInvZLUTRight[RemoveBitIncrement(pcRightDepthData[uiXPos])];
     1877          Int iDepthDifference  = m_piInvZLUTLeft[RemoveBitIncrementLUT(pcLeftDepthData[uiXPos])] - m_piInvZLUTRight[RemoveBitIncrementLUT(pcRightDepthData[uiXPos])];
    18681878
    18691879          if ( abs ( iDepthDifference ) <= m_iBlendZThres )
     
    18941904        else if ( (pcFilledRightData[uiXPos] == REN_IS_HOLE) && (pcFilledLeftData[uiXPos] == REN_IS_HOLE))
    18951905        {
    1896           pcOutputData[uiXPos] = m_piInvZLUTLeft[RemoveBitIncrement( pcLeftDepthData[uiXPos])]  < m_piInvZLUTRight[RemoveBitIncrement(pcRightDepthData[uiXPos])] ? pcLeftVideoData[uiXPos] : pcRightVideoData[uiXPos];
     1906          pcOutputData[uiXPos] = m_piInvZLUTLeft[RemoveBitIncrementLUT( pcLeftDepthData[uiXPos])]  < m_piInvZLUTRight[RemoveBitIncrementLUT(pcRightDepthData[uiXPos])] ? pcLeftVideoData[uiXPos] : pcRightVideoData[uiXPos];
    18971907        }
    18981908        else
     
    20582068
    20592069  m_ppdShiftLUTRightMirror    = new Double*[2];
    2060   m_ppdShiftLUTRightMirror[0] = new Double [257];
    2061   m_ppdShiftLUTRightMirror[1] = new Double [257];
     2070  m_ppdShiftLUTRightMirror[0] = new Double [SizeOfLUT+1];
     2071  m_ppdShiftLUTRightMirror[1] = new Double [SizeOfLUT+1];
    20622072
    20632073  m_adShiftLUTCur    = 0;
     
    20662076  m_ppiShiftLUTRight = 0;
    20672077  m_ppiShiftLUTRightMirror    = new Int*[2];
    2068   m_ppiShiftLUTRightMirror[0] = new Int[257];
    2069   m_ppiShiftLUTRightMirror[1] = new Int[257];
     2078  m_ppiShiftLUTRightMirror[0] = new Int[SizeOfLUT+1];
     2079  m_ppiShiftLUTRightMirror[1] = new Int[SizeOfLUT+1];
    20702080
    20712081  m_aiShiftLUTCur    = 0;
    2072   m_piInvZLUTLeft  = new Int[257];
    2073   m_piInvZLUTRight = new Int[257];
     2082  m_piInvZLUTLeft  = new Int[SizeOfLUT+1];
     2083  m_piInvZLUTRight = new Int[SizeOfLUT+1];
    20742084
    20752085  // Buffers
Note: See TracChangeset for help on using the changeset viewer.