Ignore:
Timestamp:
14 Jun 2013, 17:12:18 (11 years ago)
Author:
rwth
Message:

Integration of depth intra methods in macro H_3D_DIM, including:

  • Simplified Depth Coding (SDC) in H_3D_DIM_SDC
  • Depth Lookup Table (DLT) in H_3D_DIM_DLT
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-DEV-0.3-dev1/source/App/TAppEncoder/TAppEncTop.cpp

    r459 r467  
    123123  {
    124124    vps.setVpsDepthModesFlag( layer, ((vps.getDepthId( layer ) != 0) && (m_useDMM || m_useRBC || m_useSDC || m_useDLT)) ? true : false );
     125#if H_3D_DIM_DLT
     126    vps.setUseDLTFlag( layer , ((vps.getDepthId( layer ) != 0) && m_useDLT) ? true : false );
     127    if( vps.getUseDLTFlag( layer ) )
     128    {
     129      xAnalyzeInputBaseDepth(layer, max(m_iIntraPeriod, 24), &vps);
     130    }
     131#endif
    125132  }
    126133
     
    986993}
    987994
     995#if H_3D_DIM_DLT
     996Void TAppEncTop::xAnalyzeInputBaseDepth(UInt layer, UInt uiNumFrames, TComVPS* vps)
     997{
     998  TComPicYuv*       pcDepthPicYuvOrg = new TComPicYuv;
     999  // allocate original YUV buffer
     1000  pcDepthPicYuvOrg->create( m_iSourceWidth, m_iSourceHeight, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth );
     1001 
     1002  TVideoIOYuv* depthVideoFile = new TVideoIOYuv;
     1003 
     1004  UInt uiMaxDepthValue = ((1 << g_bitDepthY)-1);
     1005 
     1006  Bool abValidDepths[256];
     1007 
     1008  depthVideoFile->open( m_pchInputFileList[layer], false, m_inputBitDepthY, m_inputBitDepthC, m_internalBitDepthY, m_internalBitDepthC );  // read  mode
     1009 
     1010  // initialize boolean array
     1011  for(Int p=0; p<=uiMaxDepthValue; p++)
     1012    abValidDepths[p] = false;
     1013 
     1014  Int iHeight   = pcDepthPicYuvOrg->getHeight();
     1015  Int iWidth    = pcDepthPicYuvOrg->getWidth();
     1016  Int iStride   = pcDepthPicYuvOrg->getStride();
     1017 
     1018  Pel* pInDM    = pcDepthPicYuvOrg->getLumaAddr();
     1019 
     1020  for(Int uiFrame=0; uiFrame < uiNumFrames; uiFrame++ )
     1021  {
     1022    depthVideoFile->read( pcDepthPicYuvOrg, m_aiPad );
     1023   
     1024    // check all pixel values
     1025    for (Int i=0; i<iHeight; i++)
     1026    {
     1027      Int rowOffset = i*iStride;
     1028     
     1029      for (Int j=0; j<iWidth; j++)
     1030      {
     1031        Pel depthValue = pInDM[rowOffset+j];
     1032        abValidDepths[depthValue] = true;
     1033      }
     1034    }
     1035  }
     1036 
     1037  depthVideoFile->close();
     1038 
     1039  pcDepthPicYuvOrg->destroy();
     1040  delete pcDepthPicYuvOrg;
     1041 
     1042  // convert boolean array to idx2Depth LUT
     1043  Int* aiIdx2DepthValue = (Int*) calloc(uiMaxDepthValue, sizeof(Int));
     1044  Int iNumDepthValues = 0;
     1045  for(Int p=0; p<=uiMaxDepthValue; p++)
     1046  {
     1047    if( abValidDepths[p] == true)
     1048    {
     1049      aiIdx2DepthValue[iNumDepthValues++] = p;
     1050    }
     1051  }
     1052 
     1053  if( uiNumFrames == 0 || (Int)ceil(Log2(iNumDepthValues)) == (Int)ceil(Log2(((1 << g_bitDepthY)-1))) )
     1054  {
     1055    // don't use DLT
     1056    vps->setUseDLTFlag(layer, false);
     1057  }
     1058 
     1059  // assign LUT
     1060  if( vps->getUseDLTFlag(layer) )
     1061    vps->setDepthLUTs(layer, aiIdx2DepthValue, iNumDepthValues);
     1062 
     1063  // free temporary memory
     1064  free(aiIdx2DepthValue);
     1065}
     1066#endif
     1067
    9881068#if H_MV
    9891069Void TAppEncTop::xSetDimensionIdAndLength( TComVPS& vps )
Note: See TracChangeset for help on using the changeset viewer.