Changeset 1219 in 3DVCSoftware for branches/HTM-14.1-update-dev1-RWTH/source/App
- Timestamp:
- 20 May 2015, 20:08:27 (10 years ago)
- 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 91 91 #endif 92 92 93 #if H_3D94 TComDLT &dlt = m_dlt;93 #if NH_3D_DLT 94 TComDLT dlt = m_dlt; 95 95 #endif 96 96 … … 149 149 m_ivPicLists.setVPS ( &vps ); 150 150 #endif 151 #if H_3D151 #if NH_3D_DLT 152 152 xDeriveDltArray ( vps, dlt ); 153 153 #endif … … 308 308 m_cTEncTop.setVPS(&vps); 309 309 310 #if H_3D311 m_cTEncTop.setDLT( &dlt);310 #if NH_3D_DLT 311 m_cTEncTop.setDLT(dlt); 312 312 #endif 313 313 … … 1447 1447 } 1448 1448 1449 #if H_3D_DIM_DLT1449 #if NH_3D_DLT 1450 1450 Void TAppEncTop::xAnalyzeInputBaseDepth(UInt layer, UInt uiNumFrames, TComVPS* vps, TComDLT* dlt) 1451 1451 { 1452 1452 TComPicYuv* pcDepthPicYuvOrg = new TComPicYuv; 1453 TComPicYuv* pcDepthPicYuvTrueOrg = new TComPicYuv; 1453 1454 // 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 ); 1455 1457 1456 1458 TVideoIOYuv* depthVideoFile = new TVideoIOYuv; 1457 1459 1458 UInt uiMaxDepthValue = ((1 << g_bitDepthY)-1);1460 UInt uiMaxDepthValue = ((1 << m_inputBitDepth[CHANNEL_TYPE_LUMA])-1); 1459 1461 1460 Bool abValidDepths[256];1462 std::vector<Bool> abValidDepths(256, false); 1461 1463 1462 depthVideoFile->open( m_pchInputFileList[layer], false, m_inputBitDepth Y, m_inputBitDepthC, m_internalBitDepthY, m_internalBitDepthC ); // read mode1464 depthVideoFile->open( m_pchInputFileList[layer], false, m_inputBitDepth, m_MSBExtendedBitDepth, m_internalBitDepth ); 1463 1465 1464 // initialize boolean array1465 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); 1467 1469 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); 1473 1471 1474 1472 for(Int uiFrame=0; uiFrame < uiNumFrames; uiFrame++ ) 1475 1473 { 1476 depthVideoFile->read( pcDepthPicYuvOrg, m_aiPad);1474 depthVideoFile->read( pcDepthPicYuvOrg, pcDepthPicYuvTrueOrg, IPCOLOURSPACE_UNCHANGED, m_aiPad, m_InputChromaFormatIDC, m_bClipInputVideoToRec709Range ); 1477 1475 1478 1476 // check all pixel values … … 1494 1492 pcDepthPicYuvOrg->destroy(); 1495 1493 delete pcDepthPicYuvOrg; 1494 pcDepthPicYuvTrueOrg->destroy(); 1495 delete pcDepthPicYuvTrueOrg; 1496 1496 1497 1497 // convert boolean array to idx2Depth LUT 1498 Int* aiIdx2DepthValue = (Int*) calloc(uiMaxDepthValue, sizeof(Int));1498 std::vector<Int> aiIdx2DepthValue(256, 0); 1499 1499 Int iNumDepthValues = 0; 1500 1500 for(Int p=0; p<=uiMaxDepthValue; p++) … … 1506 1506 } 1507 1507 1508 if( uiNumFrames == 0 || numBitsForValue(iNumDepthValues) == g_bitDepthY)1508 if( uiNumFrames == 0 || gCeilLog2(iNumDepthValues) == m_inputBitDepth[CHANNEL_TYPE_LUMA] ) 1509 1509 { 1510 1510 dlt->setUseDLTFlag(layer, false); … … 1516 1516 dlt->setDepthLUTs(layer, aiIdx2DepthValue, iNumDepthValues); 1517 1517 } 1518 1519 // free temporary memory1520 free(aiIdx2DepthValue);1521 1518 } 1522 1519 #endif … … 2389 2386 2390 2387 2391 #if H_3D 2392 2388 #if NH_3D_DLT 2393 2389 Void TAppEncTop::xDeriveDltArray( TComVPS& vps, TComDLT& dlt ) 2394 2390 { … … 2411 2407 bDltPresentFlag = bDltPresentFlag || dlt.getUseDLTFlag(layer); 2412 2408 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 2413 2497 } 2414 2498 } … … 2416 2500 dlt.setDltPresentFlag( bDltPresentFlag ); 2417 2501 dlt.setNumDepthViews ( iNumDepthViews ); 2502 dlt.setDepthViewBitDepth( m_inputBitDepth[CHANNEL_TYPE_LUMA] ); 2418 2503 } 2419 2504 #endif -
branches/HTM-14.1-update-dev1-RWTH/source/App/TAppEncoder/TAppEncTop.h
r1200 r1219 90 90 #endif 91 91 92 #if H_3D92 #if NH_3D_DLT 93 93 TComDLT m_dlt; ///< dlt 94 94 #endif … … 154 154 Bool xLayerIdInTargetEncLayerIdList( Int nuhLayerId ); 155 155 #endif 156 #if H_3D156 #if NH_3D_DLT 157 157 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); 161 159 #endif 162 160
Note: See TracChangeset for help on using the changeset viewer.