Ignore:
Timestamp:
3 Feb 2014, 11:35:43 (11 years ago)
Author:
rwth
Message:
  • first version of DBBP (requires some cleanup)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-9.3-dev1-RWTH/source/Lib/TLibCommon/TComDataCU.cpp

    r809 r816  
    153153  m_pucInterSDCMask       = NULL;
    154154#endif
     155#if H_3D_DBBP
     156  m_pbDBBPFlag         = NULL;
     157#endif
    155158
    156159#if MTK_DDD_G0063
     
    288291    }
    289292#endif
     293#if H_3D_DBBP
     294    m_pbDBBPFlag         = (Bool*  )xMalloc(Bool,   uiNumPartition);
     295#endif
    290296  }
    291297  else
     
    425431      if ( m_apSegmentInterDCOffset[i] ) { xFree( m_apSegmentInterDCOffset[i] ); m_apSegmentInterDCOffset[i] = NULL; }
    426432  }
     433#endif
     434#if H_3D_DBBP
     435    if ( m_pbDBBPFlag         ) { xFree(m_pbDBBPFlag);          m_pbDBBPFlag        = NULL; }
    427436#endif
    428437  }
     
    577586#if H_3D_INTER_SDC
    578587    m_pbInterSDCFlag[ui] = pcFrom->m_pbInterSDCFlag[ui];
     588#endif
     589#if H_3D_DBBP
     590    m_pbDBBPFlag[ui] = pcFrom->m_pbDBBPFlag[ui];
    579591#endif
    580592  }
     
    653665      memset( m_apSegmentInterDCOffset[i] + firstElement,     0,         numElements * sizeof( *m_apSegmentInterDCOffset[i] ) );
    654666    }
     667#endif
     668#if H_3D_DBBP
     669    memset( m_pbDBBPFlag        + firstElement, false,                    numElements * sizeof( *m_pbDBBPFlag ) );
    655670#endif
    656671  }
     
    832847      }
    833848#endif
     849#if H_3D_DBBP
     850      m_pbDBBPFlag[ui] = false;
     851#endif
    834852    }
    835853  }
     
    950968    memset( m_apSegmentInterDCOffset[i], 0, sizeof( Int ) * m_uiNumPartition );
    951969  }
     970#endif
     971#if H_3D_DBBP
     972  memset( m_pbDBBPFlag,         0, iSizeInBool  );
    952973#endif
    953974
     
    10341055      }
    10351056#endif
     1057#if H_3D_DBBP
     1058      m_pbDBBPFlag[ui]=pcCU->m_pbDBBPFlag[uiPartOffset+ui];
     1059#endif
    10361060    }
    10371061  }
     
    11951219  }
    11961220#endif
     1221#if H_3D_DBBP
     1222  m_pbDBBPFlag              = pcCU->getDBBPFlag()         + uiPart;
     1223#endif
    11971224  m_puhDepth=pcCU->getDepth()                     + uiPart;
    11981225  m_puhWidth=pcCU->getWidth()                     + uiPart;
     
    13111338  m_pucDisparityDerivedDepth         = pcCU->getDDDepth()              + uiAbsPartIdx;
    13121339  m_pbUseDDD                         = pcCU->getUseDDD()              + uiAbsPartIdx;
     1340#endif
     1341   
     1342#if H_3D_DBBP
     1343  m_pbDBBPFlag       = pcCU->getDBBPFlag()              + uiAbsPartIdx;
    13131344#endif
    13141345
     
    14001431  }
    14011432#endif
     1433#if H_3D_DBBP
     1434  memcpy( m_pbDBBPFlag          + uiOffset, pcCU->getDBBPFlag(),          iSizeInBool  );
     1435#endif
    14021436
    14031437  memcpy( m_puhDepth  + uiOffset, pcCU->getDepth(),  iSizeInUchar );
     
    15271561  }
    15281562#endif
     1563#if H_3D_DBBP
     1564  memcpy( rpcCU->getDBBPFlag()          + m_uiAbsIdxInLCU, m_pbDBBPFlag,          iSizeInBool  );
     1565#endif
     1566 
    15291567  memcpy( rpcCU->getDepth()  + m_uiAbsIdxInLCU, m_puhDepth,  iSizeInUchar );
    15301568  memcpy( rpcCU->getWidth()  + m_uiAbsIdxInLCU, m_puhWidth,  iSizeInUchar );
     
    16401678  }
    16411679#endif
     1680#if H_3D_DBBP
     1681  memcpy( rpcCU->getDBBPFlag()          + uiPartOffset, m_pbDBBPFlag,          iSizeInBool  );
     1682#endif
     1683 
    16421684  memcpy( rpcCU->getDepth()  + uiPartOffset, m_puhDepth,  iSizeInUchar );
    16431685  memcpy( rpcCU->getWidth()  + uiPartOffset, m_puhWidth,  iSizeInUchar );
     
    23782420
    23792421  return uiCtx;
     2422}
     2423#endif
     2424
     2425#if H_3D_DBBP
     2426Pel* TComDataCU::getVirtualDepthBlock(UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt& uiDepthStride)
     2427{
     2428  // get coded and reconstructed depth view
     2429  TComPicYuv* depthPicYuv = NULL;
     2430  Pel* pDepthPels = NULL;
     2431 
     2432  // DBBP is a texture coding tool
     2433  if( getSlice()->getIsDepth() )
     2434    return NULL;
     2435 
     2436#if H_3D_FCO
     2437  TComPic* depthPic = getSlice()->getIvPic(true, getSlice()->getViewIndex() );
     2438 
     2439  if( depthPic && depthPic->getPicYuvRec() != NULL && depthPic->getIsDepth() )  // depth first
     2440  {
     2441    depthPicYuv = depthPic->getPicYuvRec();
     2442    depthPicYuv->extendPicBorder();
     2443   
     2444    // get collocated depth block for current CU
     2445    uiDepthStride = depthPicYuv->getStride();
     2446    pDepthPels    = depthPicYuv->getLumaAddr( getAddr(), uiAbsPartIdx );
     2447  }
     2448  else  // texture first
     2449#else
     2450  {
     2451    DisInfo DvInfo = getDvInfo(uiAbsPartIdx);
     2452   
     2453    TComPic* baseDepthPic = getSlice()->getIvPic (true, DvInfo.m_aVIdxCan);
     2454   
     2455    if( baseDepthPic == NULL || baseDepthPic->getPicYuvRec() == NULL )
     2456      return NULL;
     2457   
     2458    depthPicYuv   = baseDepthPic->getPicYuvRec();
     2459    depthPicYuv->extendPicBorder();
     2460    uiDepthStride = depthPicYuv->getStride();
     2461   
     2462    Int iBlkX = ( getAddr() % baseDepthPic->getFrameWidthInCU() ) * g_uiMaxCUWidth  + g_auiRasterToPelX[ g_auiZscanToRaster[ getZorderIdxInCU()+uiAbsPartIdx ] ];
     2463    Int iBlkY = ( getAddr() / baseDepthPic->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ getZorderIdxInCU()+uiAbsPartIdx ] ];
     2464   
     2465    Int iPictureWidth  = depthPicYuv->getWidth();
     2466    Int iPictureHeight = depthPicYuv->getHeight();
     2467   
     2468    Int iWidth  = uiWidth;
     2469    Int iHeight = uiHeight;
     2470   
     2471    Bool depthRefineFlag = false;
     2472#if H_3D_NBDV_REF
     2473    depthRefineFlag = m_pcSlice->getVPS()->getDepthRefinementFlag( m_pcSlice->getLayerIdInVps() );
     2474#endif // H_3D_NBDV_REF
     2475   
     2476    TComMv cDv = depthRefineFlag ? DvInfo.m_acDoNBDV : DvInfo.m_acNBDV;
     2477   
     2478    Int depthPosX = Clip3(0,   iPictureWidth - iWidth,  iBlkX + ((cDv.getHor()+2)>>2));
     2479    Int depthPosY = Clip3(0,   iPictureHeight- iHeight, iBlkY + ((cDv.getVer()+2)>>2));
     2480   
     2481    pDepthPels = depthPicYuv->getLumaAddr() + depthPosX + depthPosY * uiDepthStride;
     2482  }
     2483#endif
     2484 
     2485  AOF( depthPicYuv != NULL );
     2486  AOF( pDepthPels != NULL );
     2487  AOF( uiDepthStride != 0 );
     2488 
     2489  return pDepthPels;
     2490}
     2491#endif
     2492
     2493#if H_3D_DBBP
     2494Void TComDataCU::setDBBPFlagSubParts ( Bool bDBBPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
     2495{
     2496  setSubPart( bDBBPFlag, m_pbDBBPFlag, uiAbsPartIdx, uiDepth, uiPartIdx );
    23802497}
    23812498#endif
     
    40304147#if H_3D_ARP
    40314148  Bool bARPFlag = getARPW(uiAbsPartIdx)>0 ? true : false;
     4149#endif
     4150#if H_3D_DBBP
     4151  Bool bDBBPFlag = getDBBPFlag(uiAbsPartIdx);
    40324152#endif
    40334153
     
    46964816      pbSPIVMPFlag[iCount] = true;
    46974817#endif
     4818#if H_3D_DBBP
     4819      pbSPIVMPFlag[iCount] &= !bDBBPFlag;
     4820#endif
    46984821      if( ( ivCandDir[0] & 1 ) == 1 )
    46994822      {
     
    58095932  Int height = 0;
    58105933  UInt partAddr;
     5934 
     5935#if H_3D_DBBP
     5936  if( getDBBPFlag(0) )
     5937    return true;
     5938#endif
    58115939
    58125940  getPartIndexAndSize( puIdx, partAddr, width, height );
Note: See TracChangeset for help on using the changeset viewer.