Ignore:
Timestamp:
5 Feb 2012, 22:00:22 (13 years ago)
Author:
poznan-univ
Message:

Poznan disocclusion coding - CU Skip

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified branches/0.2-poznan-univ/source/Lib/TLibDecoder/TDecCu.cpp

    r5 r11  
    4949  m_ppcYuvReco    = NULL;
    5050  m_ppcYuvResPred = NULL;
     51#if POZNAN_AVAIL_MAP
     52  m_ppcYuvAvail   = NULL;
     53#endif
     54#if POZNAN_SYNTH_VIEW
     55  m_ppcYuvSynth   = NULL;
     56#endif
    5157  m_ppcCU         = NULL;
    5258}
     
    7581  m_ppcYuvReco    = new TComYuv*    [m_uiMaxDepth-1];
    7682  m_ppcYuvResPred = new TComYuv*    [m_uiMaxDepth-1];
     83#if POZNAN_AVAIL_MAP
     84  m_ppcYuvAvail   = new TComYuv*    [m_uiMaxDepth-1];
     85#endif
     86#if POZNAN_SYNTH_VIEW
     87  m_ppcYuvSynth   = new TComYuv*    [m_uiMaxDepth-1];
     88#endif
    7789  m_ppcCU         = new TComDataCU* [m_uiMaxDepth-1];
    7890 
     
    8799    m_ppcYuvReco   [ui] = new TComYuv;    m_ppcYuvReco   [ui]->create( uiWidth, uiHeight );
    88100    m_ppcYuvResPred[ui] = new TComYuv;    m_ppcYuvResPred[ui]->create( uiWidth, uiHeight );
     101#if POZNAN_AVAIL_MAP
     102    m_ppcYuvAvail  [ui] = new TComYuv;    m_ppcYuvAvail  [ui]->create( uiWidth, uiHeight );
     103#endif
     104#if POZNAN_SYNTH_VIEW
     105    m_ppcYuvSynth  [ui] = new TComYuv;    m_ppcYuvSynth  [ui]->create( uiWidth, uiHeight );
     106#endif
     107
    89108    m_ppcCU        [ui] = new TComDataCU; m_ppcCU        [ui]->create( uiNumPartitions, uiWidth, uiHeight, true );
    90109  }
     
    106125    m_ppcYuvReco   [ui]->destroy(); delete m_ppcYuvReco   [ui]; m_ppcYuvReco   [ui] = NULL;
    107126    m_ppcYuvResPred[ui]->destroy(); delete m_ppcYuvResPred[ui]; m_ppcYuvResPred[ui] = NULL;
     127#if POZNAN_AVAIL_MAP
     128    m_ppcYuvAvail  [ui]->destroy(); delete m_ppcYuvAvail  [ui]; m_ppcYuvAvail  [ui] = NULL;
     129#endif
     130#if POZNAN_SYNTH_VIEW
     131    m_ppcYuvSynth  [ui]->destroy(); delete m_ppcYuvSynth  [ui]; m_ppcYuvSynth  [ui] = NULL;
     132#endif
    108133    m_ppcCU        [ui]->destroy(); delete m_ppcCU        [ui]; m_ppcCU        [ui] = NULL;
    109134  }
     
    112137  delete [] m_ppcYuvReco;    m_ppcYuvReco    = NULL;
    113138  delete [] m_ppcYuvResPred; m_ppcYuvResPred = NULL;
     139#if POZNAN_AVAIL_MAP
     140  delete [] m_ppcYuvAvail;   m_ppcYuvAvail   = NULL;
     141#endif
     142#if POZNAN_SYNTH_VIEW
     143  delete [] m_ppcYuvSynth;   m_ppcYuvSynth   = NULL;
     144#endif
     145
    114146  delete [] m_ppcCU;         m_ppcCU         = NULL;
    115147}
     
    184216{
    185217  TComPic* pcPic = pcCU->getPic();
     218
     219#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     220  Bool bWholeCUCanBeSynthesized = false;
     221  Bool bOneSubCUCanNotBeSynthesied = false;
     222  Bool bSubCUCanBeSynthesized[4];
     223  Bool * pbSubCUCanBeSynthesized = bSubCUCanBeSynthesized;
     224  pcPic->checkSynthesisAvailability(pcCU, pcCU->getAddr(), uiAbsPartIdx, uiDepth, pbSubCUCanBeSynthesized); //KUBA SYNTH
     225  Int  iSubCUCanNotBeSynthesized = 0;
     226  Int  iSubCUCanBeSynthesizedCnt = 0;
     227  for(Int i = 0; i < 4; i++)
     228  {
     229    if (!bSubCUCanBeSynthesized[i])
     230    {
     231      iSubCUCanNotBeSynthesized = i;
     232    }
     233    else
     234    {
     235      iSubCUCanBeSynthesizedCnt ++;
     236    }
     237  }
     238  if(iSubCUCanBeSynthesizedCnt == 4)
     239  {
     240    bWholeCUCanBeSynthesized = true;
     241  }
     242  else if(iSubCUCanBeSynthesizedCnt == 3)
     243  {
     244    bOneSubCUCanNotBeSynthesied = true;
     245  }
     246
     247  if(bWholeCUCanBeSynthesized)
     248  {
     249    pcCU->setPredModeSubParts( MODE_SYNTH, uiAbsPartIdx, uiDepth );
     250    pcCU->setDepthSubParts( uiDepth, uiAbsPartIdx );
     251    pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
     252    pcCU->setSizeSubParts( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth );
     253    //pcCU->setSizeSubParts( pcCU->getSlice()->getSPS()->getMaxCUWidth()>>uiDepth, pcCU->getSlice()->getSPS()->getMaxCUHeight()>>uiDepth, uiAbsPartIdx, uiDepth );
     254    return;   
     255  }
     256#endif
     257
    186258  UInt uiCurNumParts    = pcPic->getNumPartInCU() >> (uiDepth<<1);
    187259  UInt uiQNumParts      = uiCurNumParts>>2;
     
    195267  if( ( uiRPelX < pcCU->getSlice()->getSPS()->getWidth() ) && ( uiBPelY < pcCU->getSlice()->getSPS()->getHeight() ) )
    196268  {
     269#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     270    if(bOneSubCUCanNotBeSynthesied && (uiDepth < g_uiMaxCUDepth - g_uiAddCUDepth )) // KUBA SYNTH check if CU has 3 synthesied subCU - no split flag is send in that case and CU split is assumed
     271    {
     272      pcCU->setDepthSubParts( uiDepth + 1, uiAbsPartIdx );
     273    }
     274    else
     275#endif
    197276#if HHI_MPI
    198277    if( pcCU->getTextureModeDepth( uiAbsPartIdx ) == -1 || uiDepth < pcCU->getTextureModeDepth( uiAbsPartIdx ) )
     
    367446{
    368447  TComPic* pcPic = pcCU->getPic();
     448#if POZNAN_SYNTH_VIEW
     449  if(pcPic->getPicYuvSynth())  m_ppcYuvSynth[uiDepth]->copyFromPicYuv( pcPic->getPicYuvSynth(), pcCU->getAddr(), uiAbsPartIdx );
     450#endif
     451#if POZNAN_AVAIL_MAP
     452  if(pcPic->getPicYuvAvail())  m_ppcYuvAvail[uiDepth]->copyFromPicYuv( pcPic->getPicYuvAvail(), pcCU->getAddr(), uiAbsPartIdx );
     453#endif
    369454 
    370455  Bool bBoundary = false;
     
    411496      xReconIntraQT( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth );
    412497      break;
     498#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     499    case MODE_SYNTH:
     500    //  break;
     501#if POZNAN_FILL_OCCLUDED_CU_WITH_SYNTHESIS
     502      m_ppcYuvReco[uiDepth]->copyFromPicYuv(pcPic->getPicYuvSynth(), pcCU->getAddr(), uiAbsPartIdx);
     503#else
     504      m_ppcYuvReco[uiDepth]->copyFromPicYuv(pcPic->getPicYuvAvail(), pcCU->getAddr(), uiAbsPartIdx); //Poprawiæ
     505#endif
     506      //m_ppcYuvReco[uiDepth]->clear();
     507      break;
     508#endif
    413509    default:
    414510      assert(0);
Note: See TracChangeset for help on using the changeset viewer.