Changeset 1219 in 3DVCSoftware for branches/HTM-14.1-update-dev1-RWTH/source/App


Ignore:
Timestamp:
20 May 2015, 20:08:27 (10 years ago)
Author:
rwth
Message:
  • updated Xcode project
  • migrated transmission of DLT (including minor fixes)
Location:
branches/HTM-14.1-update-dev1-RWTH/source/App/TAppEncoder
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-14.1-update-dev1-RWTH/source/App/TAppEncoder/TAppEncTop.cpp

    r1209 r1219  
    9191#endif
    9292
    93 #if H_3D
    94   TComDLT& dlt = m_dlt;
     93#if NH_3D_DLT
     94  TComDLT dlt = m_dlt;
    9595#endif
    9696
     
    149149  m_ivPicLists.setVPS      ( &vps );
    150150#endif
    151 #if H_3D
     151#if NH_3D_DLT
    152152  xDeriveDltArray          ( vps, dlt );
    153153#endif
     
    308308  m_cTEncTop.setVPS(&vps);
    309309
    310 #if H_3D
    311   m_cTEncTop.setDLT(&dlt);
     310#if NH_3D_DLT
     311  m_cTEncTop.setDLT(dlt);
    312312#endif
    313313
     
    14471447}
    14481448
    1449 #if H_3D_DIM_DLT
     1449#if NH_3D_DLT
    14501450Void TAppEncTop::xAnalyzeInputBaseDepth(UInt layer, UInt uiNumFrames, TComVPS* vps, TComDLT* dlt)
    14511451{
    14521452  TComPicYuv*       pcDepthPicYuvOrg = new TComPicYuv;
     1453  TComPicYuv*       pcDepthPicYuvTrueOrg = new TComPicYuv;
    14531454  // allocate original YUV buffer
    1454   pcDepthPicYuvOrg->create( m_iSourceWidth, m_iSourceHeight, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth );
     1455  pcDepthPicYuvOrg->create( m_iSourceWidth, m_iSourceHeight, CHROMA_420, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxTotalCUDepth, false );
     1456  pcDepthPicYuvTrueOrg->create( m_iSourceWidth, m_iSourceHeight, CHROMA_420, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxTotalCUDepth, false );
    14551457 
    14561458  TVideoIOYuv* depthVideoFile = new TVideoIOYuv;
    14571459 
    1458   UInt uiMaxDepthValue = ((1 << g_bitDepthY)-1);
     1460  UInt uiMaxDepthValue = ((1 << m_inputBitDepth[CHANNEL_TYPE_LUMA])-1);
    14591461 
    1460   Bool abValidDepths[256];
     1462  std::vector<Bool> abValidDepths(256, false);
    14611463 
    1462   depthVideoFile->open( m_pchInputFileList[layer], false, m_inputBitDepthY, m_inputBitDepthC, m_internalBitDepthY, m_internalBitDepthC );  // read  mode
     1464  depthVideoFile->open( m_pchInputFileList[layer], false, m_inputBitDepth, m_MSBExtendedBitDepth, m_internalBitDepth );
    14631465 
    1464   // initialize boolean array
    1465   for(Int p=0; p<=uiMaxDepthValue; p++)
    1466     abValidDepths[p] = false;
     1466  Int iHeight   = pcDepthPicYuvOrg->getHeight(COMPONENT_Y);
     1467  Int iWidth    = pcDepthPicYuvOrg->getWidth(COMPONENT_Y);
     1468  Int iStride   = pcDepthPicYuvOrg->getStride(COMPONENT_Y);
    14671469 
    1468   Int iHeight   = pcDepthPicYuvOrg->getHeight();
    1469   Int iWidth    = pcDepthPicYuvOrg->getWidth();
    1470   Int iStride   = pcDepthPicYuvOrg->getStride();
    1471  
    1472   Pel* pInDM    = pcDepthPicYuvOrg->getLumaAddr();
     1470  Pel* pInDM    = pcDepthPicYuvOrg->getAddr(COMPONENT_Y);
    14731471 
    14741472  for(Int uiFrame=0; uiFrame < uiNumFrames; uiFrame++ )
    14751473  {
    1476     depthVideoFile->read( pcDepthPicYuvOrg, m_aiPad );
     1474    depthVideoFile->read( pcDepthPicYuvOrg, pcDepthPicYuvTrueOrg, IPCOLOURSPACE_UNCHANGED, m_aiPad, m_InputChromaFormatIDC, m_bClipInputVideoToRec709Range );
    14771475   
    14781476    // check all pixel values
     
    14941492  pcDepthPicYuvOrg->destroy();
    14951493  delete pcDepthPicYuvOrg;
     1494  pcDepthPicYuvTrueOrg->destroy();
     1495  delete pcDepthPicYuvTrueOrg;
    14961496 
    14971497  // convert boolean array to idx2Depth LUT
    1498   Int* aiIdx2DepthValue = (Int*) calloc(uiMaxDepthValue, sizeof(Int));
     1498  std::vector<Int> aiIdx2DepthValue(256, 0);
    14991499  Int iNumDepthValues = 0;
    15001500  for(Int p=0; p<=uiMaxDepthValue; p++)
     
    15061506  }
    15071507 
    1508   if( uiNumFrames == 0 || numBitsForValue(iNumDepthValues) == g_bitDepthY )
     1508  if( uiNumFrames == 0 || gCeilLog2(iNumDepthValues) == m_inputBitDepth[CHANNEL_TYPE_LUMA] )
    15091509  {
    15101510    dlt->setUseDLTFlag(layer, false);
     
    15161516    dlt->setDepthLUTs(layer, aiIdx2DepthValue, iNumDepthValues);
    15171517  }
    1518  
    1519   // free temporary memory
    1520   free(aiIdx2DepthValue);
    15211518}
    15221519#endif
     
    23892386
    23902387
    2391 #if H_3D
    2392 
     2388#if NH_3D_DLT
    23932389Void TAppEncTop::xDeriveDltArray( TComVPS& vps, TComDLT& dlt )
    23942390{
     
    24112407      bDltPresentFlag = bDltPresentFlag || dlt.getUseDLTFlag(layer);
    24122408      dlt.setInterViewDltPredEnableFlag(layer, (dlt.getUseDLTFlag(layer) && (layer>1)));
     2409     
     2410      // ----------------------------- determine whether to use bit-map -----------------------------
     2411      Bool bDltBitMapRepFlag       = false;
     2412      UInt uiNumBitsNonBitMap      = 0;
     2413      UInt uiNumBitsBitMap         = 0;
     2414     
     2415      UInt uiMaxDiff               = 0;
     2416      UInt uiMinDiff               = INT_MAX;
     2417      UInt uiLengthMinDiff         = 0;
     2418      UInt uiLengthDltDiffMinusMin = 0;
     2419     
     2420      std::vector<Int> aiIdx2DepthValue_coded(256, 0);
     2421      UInt uiNumDepthValues_coded = 0;
     2422     
     2423      uiNumDepthValues_coded = dlt.getNumDepthValues(layer);
     2424      for( UInt ui = 0; ui<uiNumDepthValues_coded; ui++ )
     2425      {
     2426        aiIdx2DepthValue_coded[ui] = dlt.idx2DepthValue(layer, ui);
     2427      }
     2428     
     2429      if( dlt.getInterViewDltPredEnableFlag( layer ) )
     2430      {
     2431        AOF( vps.getDepthId( 1 ) == 1 );
     2432        AOF( layer > 1 );
     2433        // assumes ref layer id to be 1
     2434        std::vector<Int> piRefDLT = dlt.idx2DepthValue( 1 );
     2435        UInt uiRefNum = dlt.getNumDepthValues( 1 );
     2436        dlt.getDeltaDLT(layer, piRefDLT, uiRefNum, aiIdx2DepthValue_coded, uiNumDepthValues_coded);
     2437      }
     2438     
     2439      std::vector<UInt> puiDltDiffValues(uiNumDepthValues_coded, 0);
     2440     
     2441      for (UInt d = 1; d < uiNumDepthValues_coded; d++)
     2442      {
     2443        puiDltDiffValues[d] = aiIdx2DepthValue_coded[d] - aiIdx2DepthValue_coded[d-1];
     2444       
     2445        if ( uiMaxDiff < puiDltDiffValues[d] )
     2446        {
     2447          uiMaxDiff = puiDltDiffValues[d];
     2448        }
     2449       
     2450        if ( uiMinDiff > puiDltDiffValues[d] )
     2451        {
     2452          uiMinDiff = puiDltDiffValues[d];
     2453        }
     2454      }
     2455     
     2456      // counting bits
     2457      // diff coding branch
     2458      uiNumBitsNonBitMap += 8;                          // u(v) bits for num_depth_values_in_dlt[layerId] (i.e. num_entry[ layerId ])
     2459     
     2460      if ( uiNumDepthValues_coded > 1 )
     2461      {
     2462        uiNumBitsNonBitMap += 8;                        // u(v) bits for max_diff[ layerId ]
     2463      }
     2464     
     2465      if ( uiNumDepthValues_coded > 2 )
     2466      {
     2467        uiLengthMinDiff    = (UInt) gCeilLog2(uiMaxDiff + 1);
     2468        uiNumBitsNonBitMap += uiLengthMinDiff;          // u(v)  bits for min_diff[ layerId ]
     2469      }
     2470     
     2471      uiNumBitsNonBitMap += 8;                          // u(v) bits for dlt_depth_value0[ layerId ]
     2472     
     2473      if (uiMaxDiff > uiMinDiff)
     2474      {
     2475        uiLengthDltDiffMinusMin = (UInt) gCeilLog2(uiMaxDiff - uiMinDiff + 1);
     2476        uiNumBitsNonBitMap += uiLengthDltDiffMinusMin * (uiNumDepthValues_coded - 1);  // u(v) bits for dlt_depth_value_diff_minus_min[ layerId ][ j ]
     2477      }
     2478     
     2479      // bit map branch
     2480      uiNumBitsBitMap = 1 << m_inputBitDepth[CHANNEL_TYPE_LUMA];
     2481     
     2482      // determine bDltBitMapFlag
     2483      bDltBitMapRepFlag = (uiNumBitsBitMap > uiNumBitsNonBitMap) ? false : true;
     2484     
     2485      dlt.setUseBitmapRep(layer, bDltBitMapRepFlag);
     2486     
     2487#ifdef DEBUG
     2488      printf("---------------------------------------------\n");
     2489      printf("LayerId: %d\n", layer);
     2490      printf("getUseDLTFlag: %d\n", dlt.getUseDLTFlag(layer));
     2491      printf("getInterViewDltPredEnableFlag: %d\n", dlt.getInterViewDltPredEnableFlag(layer));
     2492      printf("getUseBitmapRep: %d\n", dlt.getUseBitmapRep(layer));
     2493      printf("getNumDepthValues: %d\n", dlt.getNumDepthValues(layer));
     2494      for(Int i=0; i<dlt.getNumDepthValues(layer); i++)
     2495        printf("depthValue[%d] = %d\n", i, dlt.idx2DepthValue(layer, i));
     2496#endif
    24132497    }
    24142498  }
     
    24162500  dlt.setDltPresentFlag( bDltPresentFlag );
    24172501  dlt.setNumDepthViews ( iNumDepthViews  );
     2502  dlt.setDepthViewBitDepth( m_inputBitDepth[CHANNEL_TYPE_LUMA] );
    24182503}
    24192504#endif
  • branches/HTM-14.1-update-dev1-RWTH/source/App/TAppEncoder/TAppEncTop.h

    r1200 r1219  
    9090#endif
    9191
    92 #if H_3D
     92#if NH_3D_DLT
    9393  TComDLT                    m_dlt;                         ///< dlt
    9494#endif
     
    154154  Bool xLayerIdInTargetEncLayerIdList( Int nuhLayerId );
    155155#endif
    156 #if H_3D
     156#if NH_3D_DLT
    157157  Void xDeriveDltArray( TComVPS& vps, TComDLT& dlt );
    158 #endif
    159 #if H_3D_DIM_DLT
    160   Void  xAnalyzeInputBaseDepth(UInt layer, UInt uiNumFrames, TComVPS* vps, TComDLT* dlt);
     158  Void xAnalyzeInputBaseDepth(UInt layer, UInt uiNumFrames, TComVPS* vps, TComDLT* dlt);
    161159#endif
    162160
Note: See TracChangeset for help on using the changeset viewer.