Changeset 11 in 3DVCSoftware for branches/0.2-poznan-univ/source/Lib/TLibCommon


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

Poznan disocclusion coding - CU Skip

Location:
branches/0.2-poznan-univ/source/Lib/TLibCommon
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • branches/0.2-poznan-univ/source/Lib/TLibCommon/CommonDef.h

    r8 r11  
    5858
    5959#define HM_VERSION        "3.0rc2"                 ///< Current software version
    60 #define NV_VERSION        "0.2"                   ///< Current software version
     60#define NV_VERSION        "0.3"                   ///< Current software version
    6161
    6262// ====================================================================================================================
     
    137137#define LOG2_DISP_PREC_LUT                              2                               ///< log2 of disparity precision used in integer disparity LUTs
    138138
    139 
    140139#if ( HHI_INTER_VIEW_MOTION_PRED || HHI_INTER_VIEW_RESIDUAL_PRED )
    141140#define DEPTH_MAP_GENERATION        1
     
    171170#define OUTPUT_RESIDUAL_PICTURES          0         // output residual pictures (for debugging)
    172171
    173 #define HHI_MPI_MERGE_POS                     0         // position of mvi in merge list (0..5)
    174 
     172#define HHI_MPI_MERGE_POS                 0           // position of mvi in merge list (0..5)
     173
     174// ====================================================================================================================
     175// POZNAN DEFINE SECTION
     176// ====================================================================================================================
     177#define POZNAN_OUTPUT_AVAILABLE_MAP       0           // output available map (for debugging)
     178#define POZNAN_OUTPUT_SYNTH               0           // output synthesised view (for debugging)
    175179
    176180// ====================================================================================================================
  • branches/0.2-poznan-univ/source/Lib/TLibCommon/TComDataCU.cpp

    r5 r11  
    27112711    pcCULeft = NULL;
    27122712  }
    2713   if( pcCULeft && !pcCULeft->isIntra( uiLeftPartIdx ) )
     2713  if( pcCULeft && !pcCULeft->isIntra( uiLeftPartIdx )
     2714#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     2715    && !pcCULeft->isCUSkiped( uiLeftPartIdx )
     2716#endif
     2717  )
    27142718  {
    27152719    abCandIsInter[uiLeftAddr] = true;
     
    27372741    pcCUAbove = NULL;
    27382742  }
    2739   if ( pcCUAbove && !pcCUAbove->isIntra( uiAbovePartIdx ) )
     2743  if ( pcCUAbove && !pcCUAbove->isIntra( uiAbovePartIdx )
     2744#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     2745    && !pcCUAbove->isCUSkiped( uiAbovePartIdx )
     2746#endif
     2747  )
    27402748  {
    27412749    abCandIsInter[uiAboveAddr] = true;
     
    32713279  if( uiIter == 0 )
    32723280  {
    3273     if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) )
     3281    if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx )
     3282#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     3283       && !pcCorner->isCUSkiped( uiCornerPUIdx )
     3284#endif
     3285    )
    32743286    {
    32753287      rbValidCand = true;
     
    33063318  else
    33073319  {
    3308     if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) )
     3320    if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx )
     3321#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     3322       && !pcCorner->isCUSkiped( uiCornerPUIdx )
     3323#endif
     3324    )
    33093325    {
    33103326      rbValidCand = true;
     
    44254441  if (pColCU->isIntra(uiPartIdxCenter))
    44264442    return false;
     4443
     4444#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     4445  if (pColCU->isSkipped(uiPartIdxCenter))
     4446    return false;
     4447#endif
    44274448 
    44284449  if( m_pcSlice->getRefPic(eRefPicList, iRefIdx)->getViewIdx() != m_pcSlice->getViewIdx() )
  • branches/0.2-poznan-univ/source/Lib/TLibCommon/TComDataCU.h

    r5 r11  
    529529  Bool          isIntra   ( UInt uiPartIdx )  { return m_pePredMode[ uiPartIdx ] == MODE_INTRA; }
    530530  Bool          isSkipped ( UInt uiPartIdx );                                                     ///< SKIP (no residual)
     531#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     532  Bool          isCUSkiped( UInt uiPartIdx )  { return m_pePredMode[ uiPartIdx ] == MODE_SYNTH; }
     533#endif
    531534 
    532535  // -------------------------------------------------------------------------------------------------------------------
  • branches/0.2-poznan-univ/source/Lib/TLibCommon/TComDepthMapGenerator.cpp

    r5 r11  
    971971    xInterPredictCUDepthMap( pcSubCU, pcSubDM );
    972972    break;
     973#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     974  case MODE_SYNTH:
     975    //What to do? Need Fix!
     976    xIntraPredictCUDepthMap( pcSubCU, pcSubDM );
     977    break;
     978#endif
    973979  default:
    974980    AOT( true );
  • branches/0.2-poznan-univ/source/Lib/TLibCommon/TComLoopFilter.cpp

    r5 r11  
    444444 
    445445  //-- Set BS for Intra MB : BS = 4 or 3
    446   if ( pcCUP->isIntra(uiPartP) || pcCUQ->isIntra(uiPartQ) )
     446  if ( pcCUP->isIntra(uiPartP) || pcCUQ->isIntra(uiPartQ)
     447#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     448     || pcCUP->isCUSkiped(uiPartP) || pcCUQ->isCUSkiped(uiPartQ)
     449#endif
     450  )
    447451  {
    448452    uiBs = bAtCUBoundary ? 4 : 3;   // Intra MB && MB boundary
    449453  }
    450  
     454
    451455  //-- Set BS for not Intra MB : BS = 2 or 1 or 0
    452   if ( !pcCUP->isIntra(uiPartP) && !pcCUQ->isIntra(uiPartQ) )
     456  if ( !pcCUP->isIntra(uiPartP) && !pcCUQ->isIntra(uiPartQ)
     457#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     458     && !pcCUP->isCUSkiped(uiPartP) && !pcCUQ->isCUSkiped(uiPartQ)
     459#endif
     460  )
    453461  {
    454462    if ( pcCUQ->getCbf( uiPartQ, TEXT_LUMA, pcCUQ->getTransformIdx(uiPartQ)) != 0 || pcCUP->getCbf( uiPartP, TEXT_LUMA, pcCUP->getTransformIdx(uiPartP) ) != 0)
     
    527535    }   // enf of "if( one of BCBP == 0 )"
    528536  }   // enf of "if( not Intra )"
    529  
     537
     538#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU //if one of the block is CUSkipped dont use loop filter
     539  if ( pcCUP->isCUSkiped(uiPartP) || pcCUQ->isCUSkiped(uiPartQ))
     540  {
     541    uiBs = 0;
     542  }
     543#endif
     544
    530545  m_aapucBS[iDir][0][uiAbsPartIdx] = uiBs;
    531546  if ( bAtCUBoundary || bAtCUHalf )
  • branches/0.2-poznan-univ/source/Lib/TLibCommon/TComPic.cpp

    r5 r11  
    5050  m_apcPicYuv[0]      = NULL;
    5151  m_apcPicYuv[1]      = NULL;
     52#if POZNAN_AVAIL_MAP
     53  m_apcPicYuvAvail     = NULL;
     54#endif
     55#if POZNAN_SYNTH_VIEW
     56  m_apcPicYuvSynth     = NULL;
     57#endif
    5258#if DEPTH_MAP_GENERATION
    5359  m_pcPredDepthMap    = NULL;
     
    116122    m_apcPicYuv[1]  = NULL;
    117123  }
     124#if POZNAN_AVAIL_MAP
     125  if (m_apcPicYuvAvail)
     126  {
     127    m_apcPicYuvAvail->destroy();
     128    delete m_apcPicYuvAvail;
     129    m_apcPicYuvAvail  = NULL;
     130  }
     131#endif
     132
     133#if POZNAN_SYNTH_VIEW
     134  if (m_apcPicYuvSynth)
     135  {
     136    m_apcPicYuvSynth->destroy();
     137    delete m_apcPicYuvSynth;
     138    m_apcPicYuvSynth  = NULL;
     139  }
     140#endif
    118141 
    119142#if DEPTH_MAP_GENERATION
     
    193216}
    194217
     218#if POZNAN_AVAIL_MAP
     219Void
     220TComPic::addAvailabilityBuffer()
     221{
     222  AOT( m_apcPicYuvAvail );
     223  AOF( m_apcPicYuv[1] );
     224  Int   iWidth        = m_apcPicYuv[1]->getWidth      ();
     225  Int   iHeight       = m_apcPicYuv[1]->getHeight     ();
     226  UInt  uiMaxCuWidth  = m_apcPicYuv[1]->getMaxCuWidth ();
     227  UInt  uiMaxCuHeight = m_apcPicYuv[1]->getMaxCuHeight();
     228  UInt  uiMaxCuDepth  = m_apcPicYuv[1]->getMaxCuDepth ();
     229  m_apcPicYuvAvail      = new TComPicYuv;
     230  m_apcPicYuvAvail      ->create( iWidth, iHeight, uiMaxCuWidth, uiMaxCuHeight, uiMaxCuDepth );
     231}
     232#endif
     233
     234#if POZNAN_SYNTH_VIEW
     235Void
     236TComPic::addSynthesisBuffer()
     237{
     238  AOT( m_apcPicYuvSynth );
     239  AOF( m_apcPicYuv[1] );
     240  Int   iWidth        = m_apcPicYuv[1]->getWidth      ();
     241  Int   iHeight       = m_apcPicYuv[1]->getHeight     ();
     242  UInt  uiMaxCuWidth  = m_apcPicYuv[1]->getMaxCuWidth ();
     243  UInt  uiMaxCuHeight = m_apcPicYuv[1]->getMaxCuHeight();
     244  UInt  uiMaxCuDepth  = m_apcPicYuv[1]->getMaxCuDepth ();
     245  m_apcPicYuvSynth      = new TComPicYuv;
     246  m_apcPicYuvSynth      ->create( iWidth, iHeight, uiMaxCuWidth, uiMaxCuHeight, uiMaxCuDepth );
     247}
     248#endif
     249
    195250#if PARALLEL_MERGED_DEBLK
    196251Void
     
    284339}
    285340
     341#if POZNAN_AVAIL_MAP
     342Void
     343TComPic::removeAvailabilityBuffer()
     344{
     345  if( m_apcPicYuvAvail )
     346  {
     347    m_apcPicYuvAvail->destroy();
     348    delete m_apcPicYuvAvail;
     349    m_apcPicYuvAvail  = NULL;
     350  }
     351}
     352#endif
     353
     354#if POZNAN_SYNTH_VIEW
     355Void
     356TComPic::removeSynthesisBuffer()
     357{
     358  if( m_apcPicYuvSynth )
     359  {
     360    m_apcPicYuvSynth->destroy();
     361    delete m_apcPicYuvSynth;
     362    m_apcPicYuvSynth  = NULL;
     363  }
     364}
     365#endif
     366
    286367#if PARALLEL_MERGED_DEBLK
    287368Void
     
    349430#endif
    350431
     432#if POZNAN_AVAIL_MAP
     433Void TComPic::checkSynthesisAvailability( TComDataCU*& rpcCU, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth, Bool *&rpbCUSynthesied )
     434{
     435  rpbCUSynthesied[0] = true;
     436  rpbCUSynthesied[1] = true;
     437  rpbCUSynthesied[2] = true;
     438  rpbCUSynthesied[3] = true;
     439
     440  if (!getPicYuvAvail())
     441  {
     442    rpbCUSynthesied[0] = false;
     443    rpbCUSynthesied[1] = false;
     444    rpbCUSynthesied[2] = false;
     445    rpbCUSynthesied[3] = false;
     446    return;   
     447  }
     448 
     449  Int x, y;
     450  Bool bAvailable = true;
     451  Pel* pAvail  = getPicYuvAvail()->getLumaAddr ( iCuAddr, uiAbsZorderIdx );
     452  Int CUHeight = g_uiMaxCUHeight >> uiPartDepth; //rpcCU->getHeight(uiAbsZorderIdx);
     453  Int CUWidth  = g_uiMaxCUWidth  >> uiPartDepth; //rpcCU->getWidth(uiAbsZorderIdx);
     454 
     455  Int  iStride  = getPicYuvAvail()->getStride();
     456  for ( y = ((CUHeight - 1) >> 1); y >= 0; y-- )
     457  {
     458    for ( x = ((CUWidth - 1) >> 1); x >= 0; x-- )
     459    {
     460      rpbCUSynthesied[0] &= (pAvail[x] != 0);
     461    }
     462    for ( x = CUWidth - 1; x >= ((CUWidth) >> 1); x-- )
     463    {
     464      rpbCUSynthesied[1] &= (pAvail[x] != 0);
     465    }
     466    pAvail += iStride;
     467  }
     468  //for ( y = CUHeight - 1; y >= ((CUHeight) >> 1); y-- )
     469  for ( y = ((CUHeight - 1) >> 1); y >= 0; y-- ) //Owieczka
     470  {
     471    for ( x = ((CUWidth - 1) >> 1); x >= 0; x-- )
     472    {
     473      rpbCUSynthesied[2] &= (pAvail[x] != 0);
     474    }
     475    for ( x = CUWidth - 1; x >= ((CUWidth) >> 1); x-- )
     476    {
     477      rpbCUSynthesied[3] &= (pAvail[x] != 0);
     478    }
     479    pAvail += iStride;
     480  }
     481
     482  //rpbCUSynthesied[0] = !rpbCUSynthesied[0];
     483  //rpbCUSynthesied[1] = !rpbCUSynthesied[1];
     484  //rpbCUSynthesied[2] = !rpbCUSynthesied[2];
     485  //rpbCUSynthesied[3] = !rpbCUSynthesied[3];
     486}
     487#endif
  • branches/0.2-poznan-univ/source/Lib/TLibCommon/TComPic.h

    r5 r11  
    6161
    6262  TComPicYuv*           m_apcPicYuv[2];           //  Texture,  0:org / 1:rec
     63
     64#if POZNAN_AVAIL_MAP
     65  TComPicYuv*           m_apcPicYuvAvail;         //  Availability Map - Does the given pixel can be synthesised in receiver
     66#endif
     67
     68#if POZNAN_SYNTH_VIEW
     69  TComPicYuv*           m_apcPicYuvSynth;         //  Sythesied image
     70#endif
     71
    6372#if DEPTH_MAP_GENERATION
    6473  TComPicYuv*           m_pcPredDepthMap;         //  estimated depth map
     
    126135  TComPicYuv*   getPicYuvOrg()        { return  m_apcPicYuv[0]; }
    127136  TComPicYuv*   getPicYuvRec()        { return  m_apcPicYuv[1]; }
     137
     138#if POZNAN_AVAIL_MAP
     139  TComPicYuv*   getPicYuvAvail()      { return  m_apcPicYuvAvail; } //Owieczka - returns available map from other pic image
     140#endif
     141
     142#if POZNAN_SYNTH_VIEW
     143  TComPicYuv*   getPicYuvSynth()      { return  m_apcPicYuvSynth; } //Owieczka - returns synth form other pic in image
     144#endif
    128145
    129146#if DEPTH_MAP_GENERATION
     
    196213
    197214  Void          addOriginalBuffer       ();
     215#if POZNAN_AVAIL_MAP
     216  Void          addAvailabilityBuffer   ();
     217#endif
     218#if POZNAN_SYNTH_VIEW
     219  Void          addSynthesisBuffer      ();
     220#endif
    198221#if PARALLEL_MERGED_DEBLK
    199222  Void          addDeblockBuffer        ();
     
    214237
    215238  Void          removeOriginalBuffer    ();
     239#if POZNAN_SYNTH_VIEW
     240  Void          removeSynthesisBuffer   ();
     241#endif
     242#if POZNAN_AVAIL_MAP
     243  Void          removeAvailabilityBuffer();
     244#endif
    216245#if PARALLEL_MERGED_DEBLK
    217246  Void          removeDeblockBuffer     ();
     
    228257#if HHI_INTERVIEW_SKIP
    229258  Void          removeUsedPelsMapBuffer ();
     259#endif
     260
     261#if POZNAN_AVAIL_MAP
     262  Void          checkSynthesisAvailability(  TComDataCU*& rpcBestCU, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth, Bool *&rpbCUSynthesied);
    230263#endif
    231264
  • branches/0.2-poznan-univ/source/Lib/TLibCommon/TComResidualGenerator.cpp

    r5 r11  
    306306    xSetRecResidualInterCU( pcSubCU, pcSubRes );
    307307    break;
     308#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     309  case MODE_SYNTH:
     310    xSetRecResidualIntraCU( pcSubCU, pcSubRes ); //MayBe it should be seperate function
     311    break;
     312#endif
    308313  default:
    309314    AOT( true );
  • branches/0.2-poznan-univ/source/Lib/TLibCommon/TComSlice.cpp

    r5 r11  
    676676  // AMVP parameter
    677677  ::memset( m_aeAMVPMode, 0, sizeof( m_aeAMVPMode ) );
     678#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    678679  m_bUseDMM = false;
     680#endif
    679681}
    680682
  • branches/0.2-poznan-univ/source/Lib/TLibCommon/TComSlice.h

    r5 r11  
    452452
    453453  Void      setSPS          ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; }
    454   TComSPS*  getSPS          () { return m_pcSPS; }
     454                                                                                               TComSPS*  getSPS          () { return m_pcSPS; }
    455455
    456456  Void      setPPS          ( TComPPS* pcPPS ) { m_pcPPS = pcPPS; }
  • branches/0.2-poznan-univ/source/Lib/TLibCommon/TypeDef.h

    r5 r11  
    6161//<<<<< HHI 3DV tools <<<<<
    6262
     63//<<<<< Poznan 3DV tools <<<<<<
     64#define POZNAN_CU_SKIP              1 //Poznan Cu Skip
     65#define POZNAN_CU_SYNTH             1 //Poznan Cu Synth
     66
     67#define POZNAN_AVAIL_MAP            1 //Creates Availibity buffers in all needed classes
     68
     69#define POZNAN_SYNTH_VIEW           1 //Creates view synthesis buffers in all needed classes
     70#define POZNAN_SYNTH_DEPTH          1
     71
     72#define POZNAN_SYNTH                1 //Creates aligned synthesis classes in encoder and decoder
     73
     74#define POZNAN_ENCODE_ONLY_DISOCCLUDED_CU          1 //Poznan CU Skip
     75#define POZNAN_FILL_OCCLUDED_CU_WITH_SYNTHESIS     1 //Fills not sended CUs with synthesized data
     76
     77#define POZNAN_CU_SKIP_PSNR         1 //Poznan Cu Skip Display psnr of the codded CU only
     78//<<<<< Poznan 3DV tools <<<<<<
    6379
    6480////////////////////////////
     
    575591  MODE_INTER,           ///< inter-prediction mode
    576592  MODE_INTRA,           ///< intra-prediction mode
     593#if POZNAN_CU_SKIP
     594  MODE_SYNTH,           ///< synth-mode
     595#endif
    577596  MODE_NONE = 15
    578597};
Note: See TracChangeset for help on using the changeset viewer.