Changeset 1219 in 3DVCSoftware for branches/HTM-14.1-update-dev1-RWTH/source/Lib
- Timestamp:
- 20 May 2015, 20:08:27 (10 years ago)
- Location:
- branches/HTM-14.1-update-dev1-RWTH/source/Lib
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibCommon/TComPrediction.cpp
r1209 r1219 557 557 Pel deltaDC1 = pcCU->getDmmDeltaDC( dmmType, 0, uiAbsPartIdx ); 558 558 Pel deltaDC2 = pcCU->getDmmDeltaDC( dmmType, 1, uiAbsPartIdx ); 559 #if H_3D_DIM_DLT559 #if NH_3D_DLT 560 560 segDC1 = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC1 ) + deltaDC1 ); 561 561 segDC2 = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC2 ) + deltaDC2 ); -
branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibCommon/TComRom.h
r1209 r1219 111 111 __inline Void mapDmmToIntraDir( UInt& intraMode ) { if( isDmmMode( intraMode ) ) intraMode = DC_IDX; } 112 112 __inline Void mapDmmToIntraDir( Int& intraMode ) { if( isDmmMode( intraMode ) ) intraMode = DC_IDX; } 113 #endif114 #if H_3D_DIM_SDC || H_3D_DIM_DLT115 __inline UInt numBitsForValue( UInt value ) { UInt bits = 0; while (value != 0) { value >>= 1; bits++; } return bits; };116 113 #endif 117 114 // ==================================================================================================================== -
branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibCommon/TComSlice.cpp
r1200 r1219 2827 2827 , m_ppsScalingListRefLayerId (0) 2828 2828 , m_pocResetInfoPresentFlag (false) 2829 #if H_3D2830 , m_pcDLT(NULL)2831 #endif2832 2829 #endif 2833 2830 … … 2846 2843 } 2847 2844 2848 #if H_3D2845 #if NH_3D_DLT 2849 2846 TComDLT::TComDLT() 2850 2847 : m_bDltPresentFlag(false) … … 2852 2849 , m_uiDepthViewBitDepth(8) 2853 2850 { 2854 m_uiDepthViewBitDepth = g_bitDepthY;2855 2856 2851 for( Int i = 0; i < MAX_NUM_LAYERS; i++ ) 2857 2852 { … … 2861 2856 // allocate some memory and initialize with default mapping 2862 2857 m_iNumDepthmapValues[i] = ((1 << m_uiDepthViewBitDepth)-1)+1; 2863 m_iDepthValue2Idx[i] = (Int*) xMalloc(Int,m_iNumDepthmapValues[i]);2864 m_iIdx2DepthValue[i] = (Int*) xMalloc(Int,m_iNumDepthmapValues[i]);2858 m_iDepthValue2Idx[i] = std::vector<Int>(m_iNumDepthmapValues[i]); 2859 m_iIdx2DepthValue[i] = std::vector<Int>(m_iNumDepthmapValues[i]); 2865 2860 2866 2861 //default mapping … … 2875 2870 TComDLT::~TComDLT() 2876 2871 { 2877 for( Int i = 0; i < MAX_NUM_LAYERS; i++ ) 2878 { 2879 if ( m_iDepthValue2Idx[i] != NULL ) 2880 { 2881 xFree( m_iDepthValue2Idx[i] ); 2882 m_iDepthValue2Idx[i] = NULL; 2883 } 2884 2885 if ( m_iIdx2DepthValue[i] != NULL ) 2886 { 2887 xFree( m_iIdx2DepthValue[i] ); 2888 m_iIdx2DepthValue[i] = NULL; 2889 } 2890 } 2891 } 2892 2893 Void TComDLT::setDepthLUTs(Int layerIdInVps, Int* idxToDepthValueTable, Int iNumDepthValues) 2894 { 2895 if( idxToDepthValueTable == NULL || iNumDepthValues == 0 ) // default mapping only 2872 2873 } 2874 2875 Void TComDLT::setDepthLUTs(Int layerIdInVps, std::vector<Int> idxToDepthValueTable, Int iNumDepthValues) 2876 { 2877 if( iNumDepthValues == 0 ) // default mapping only 2896 2878 return; 2897 2879 2898 2880 // copy idx2DepthValue to internal array 2899 m emcpy(m_iIdx2DepthValue[layerIdInVps], idxToDepthValueTable, iNumDepthValues*sizeof(UInt));2900 2901 UInt uiMaxDepthValue = ((1 << g_bitDepthY)-1);2881 m_iIdx2DepthValue[layerIdInVps] = idxToDepthValueTable; 2882 2883 UInt uiMaxDepthValue = ((1 << m_uiDepthViewBitDepth)-1); 2902 2884 for(Int p=0; p<=uiMaxDepthValue; p++) 2903 2885 { … … 2936 2918 } 2937 2919 2938 Void TComDLT::getDeltaDLT( Int layerIdInVps, Int* piDLTInRef, UInt uiDLTInRefNum, Int* piDeltaDLTOut, UInt *puiDeltaDLTOutNum )2920 Void TComDLT::getDeltaDLT( Int layerIdInVps, std::vector<Int> piDLTInRef, UInt uiDLTInRefNum, std::vector<Int>& riDeltaDLTOut, UInt&ruiDeltaDLTOutNum ) const 2939 2921 { 2940 2922 Bool abBM0[ 256 ]; … … 2955 2937 } 2956 2938 2957 *puiDeltaDLTOutNum = 0;2939 ruiDeltaDLTOutNum = 0; 2958 2940 for( Int i = 0; i < 256; i++ ) 2959 2941 { 2960 2942 if( abBM0[ i ] ^ abBM1[ i ] ) 2961 2943 { 2962 piDeltaDLTOut[ *puiDeltaDLTOutNum ] = i; 2963 *puiDeltaDLTOutNum = *puiDeltaDLTOutNum + 1; 2964 } 2965 } 2966 } 2967 2968 Void TComDLT::setDeltaDLT( Int layerIdInVps, Int* piDLTInRef, UInt uiDLTInRefNum, Int* piDeltaDLTIn, UInt uiDeltaDLTInNum ) 2944 riDeltaDLTOut[ ruiDeltaDLTOutNum++ ] = i; 2945 } 2946 } 2947 } 2948 2949 Void TComDLT::setDeltaDLT( Int layerIdInVps, std::vector<Int> piDLTInRef, UInt uiDLTInRefNum, std::vector<Int> piDeltaDLTIn, UInt uiDeltaDLTInNum ) 2969 2950 { 2970 2951 Bool abBM0[ 256 ]; … … 2985 2966 } 2986 2967 2987 Int aiIdx2DepthValue[256];2968 std::vector<Int> aiIdx2DepthValue(256, 0); 2988 2969 UInt uiNumDepthValues = 0; 2989 memset( aiIdx2DepthValue, 0, sizeof( aiIdx2DepthValue ));2970 std::fill(aiIdx2DepthValue.begin(), aiIdx2DepthValue.end(), 0); 2990 2971 2991 2972 for( Int i = 0; i < 256; i++ ) -
branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibCommon/TComSlice.h
r1209 r1219 1357 1357 }; 1358 1358 1359 #if H_3D1359 #if NH_3D_DLT 1360 1360 class TComDLT 1361 1361 { 1362 1362 private: 1363 Bool m_bDltPresentFlag; 1364 Bool m_bUseDLTFlag [ MAX_NUM_LAYERS ]; 1365 Bool m_bInterViewDltPredEnableFlag[ MAX_NUM_LAYERS ]; 1366 1367 Int m_iNumDepthmapValues [ MAX_NUM_LAYERS ]; 1368 Int* m_iDepthValue2Idx [ MAX_NUM_LAYERS ]; 1369 Int* m_iIdx2DepthValue [ MAX_NUM_LAYERS ]; 1370 1371 Int m_iNumDepthViews; 1372 UInt m_uiDepthViewBitDepth; 1363 Bool m_bDltPresentFlag; 1364 Bool m_bUseDLTFlag [ MAX_NUM_LAYERS ]; 1365 Bool m_bInterViewDltPredEnableFlag [ MAX_NUM_LAYERS ]; 1366 Bool m_bDltBitMapRepFlag [ MAX_NUM_LAYERS ]; 1367 1368 Int m_iNumDepthmapValues [ MAX_NUM_LAYERS ]; 1369 std::vector<Int> m_iDepthValue2Idx [ MAX_NUM_LAYERS ]; 1370 std::vector<Int> m_iIdx2DepthValue [ MAX_NUM_LAYERS ]; 1371 1372 Int m_iNumDepthViews; 1373 UInt m_uiDepthViewBitDepth; 1374 1375 // mapping 1376 Int m_iDepthIdxToLayerId [ MAX_NUM_LAYERS ]; 1377 1378 // these are only needed at the encoder to decide on coding 1373 1379 1374 1380 public: 1375 1381 TComDLT(); 1376 ~TComDLT(); 1377 1378 Bool getDltPresentFlag () { return m_bDltPresentFlag; } 1382 ~TComDLT(); 1383 1384 Int getDepthIdxToLayerId(Int depthIdx) const { return m_iDepthIdxToLayerId[depthIdx]; } 1385 Void setDepthIdxToLayerId(Int depthIdx, Int layerId) { m_iDepthIdxToLayerId[depthIdx] = layerId; } 1386 1387 Bool getDltPresentFlag () const { return m_bDltPresentFlag; } 1379 1388 Void setDltPresentFlag ( Bool b ) { m_bDltPresentFlag = b; } 1380 1389 1381 Bool getUseDLTFlag ( Int layerIdInVps ) { return m_bUseDLTFlag[ layerIdInVps ]; }1390 Bool getUseDLTFlag ( Int layerIdInVps ) const { return m_bUseDLTFlag[ layerIdInVps ]; } 1382 1391 Void setUseDLTFlag ( Int layerIdInVps, Bool b ) { m_bUseDLTFlag[ layerIdInVps ] = b; } 1383 1392 1384 Bool getInterViewDltPredEnableFlag( Int layerIdInVps ) { return m_bInterViewDltPredEnableFlag[ layerIdInVps ]; }1393 Bool getInterViewDltPredEnableFlag( Int layerIdInVps ) const { return m_bInterViewDltPredEnableFlag[ layerIdInVps ]; } 1385 1394 Void setInterViewDltPredEnableFlag( Int layerIdInVps, Bool b ) { m_bInterViewDltPredEnableFlag[ layerIdInVps ] = b; } 1395 1396 Bool getUseBitmapRep ( Int layerIdInVps ) const { return m_bDltBitMapRepFlag[ layerIdInVps ]; } 1397 Void setUseBitmapRep ( Int layerIdInVps, Bool b ) { m_bDltBitMapRepFlag[ layerIdInVps ] = b; } 1386 1398 1387 1399 Void setNumDepthViews ( Int n ) { m_iNumDepthViews = n; } 1388 Int getNumDepthViews () { return m_iNumDepthViews; }1400 Int getNumDepthViews () const { return m_iNumDepthViews; } 1389 1401 1390 1402 Void setDepthViewBitDepth( UInt n ) { m_uiDepthViewBitDepth = n; } 1391 UInt getDepthViewBitDepth() { return m_uiDepthViewBitDepth; }1392 1393 Int getNumDepthValues( Int layerIdInVps ) { return getUseDLTFlag(layerIdInVps)?m_iNumDepthmapValues[layerIdInVps]:((1 << g_bitDepthY)-1); }1394 Int depthValue2idx( Int layerIdInVps, Pel value ) { return getUseDLTFlag(layerIdInVps)?m_iDepthValue2Idx[layerIdInVps][value]:value; }1395 Pel idx2DepthValue( Int layerIdInVps, UInt uiIdx ) { return getUseDLTFlag(layerIdInVps)?m_iIdx2DepthValue[layerIdInVps][ClipY(uiIdx)]:uiIdx; }1396 Void setDepthLUTs( Int layerIdInVps, Int* idx2DepthValue = NULL, Int iNumDepthValues = 0 );1397 Int* idx2DepthValue( Int layerIdInVps ){ return m_iIdx2DepthValue[layerIdInVps]; }1398 Void getDeltaDLT( Int layerIdInVps, Int* piDLTInRef, UInt uiDLTInRefNum, Int* piDeltaDLTOut, UInt *puiDeltaDLTOutNum );1399 Void setDeltaDLT( Int layerIdInVps, Int* piDLTInRef, UInt uiDLTInRefNum, Int*piDeltaDLTIn, UInt uiDeltaDLTInNum );1403 UInt getDepthViewBitDepth() const { return m_uiDepthViewBitDepth; } 1404 1405 Int getNumDepthValues( Int layerIdInVps ) const { return getUseDLTFlag(layerIdInVps)?m_iNumDepthmapValues[layerIdInVps]:(1 << m_uiDepthViewBitDepth); } 1406 Int depthValue2idx( Int layerIdInVps, Pel value ) const { return getUseDLTFlag(layerIdInVps)?m_iDepthValue2Idx[layerIdInVps][value]:value; } 1407 Pel idx2DepthValue( Int layerIdInVps, UInt uiIdx ) const { return getUseDLTFlag(layerIdInVps)?m_iIdx2DepthValue[layerIdInVps][ClipBD(uiIdx,m_uiDepthViewBitDepth)]:uiIdx; } 1408 Void setDepthLUTs( Int layerIdInVps, std::vector<Int> idx2DepthValue, Int iNumDepthValues = 0 ); 1409 std::vector<Int> idx2DepthValue( Int layerIdInVps ) const { return m_iIdx2DepthValue[layerIdInVps]; } 1410 Void getDeltaDLT( Int layerIdInVps, std::vector<Int> piDLTInRef, UInt uiDLTInRefNum, std::vector<Int>& riDeltaDLTOut, UInt& ruiDeltaDLTOutNum ) const; 1411 Void setDeltaDLT( Int layerIdInVps, std::vector<Int> piDLTInRef, UInt uiDLTInRefNum, std::vector<Int> piDeltaDLTIn, UInt uiDeltaDLTInNum ); 1400 1412 }; 1401 1413 #endif … … 2256 2268 #endif 2257 2269 2258 #if H_3D2259 TComDLT * m_pcDLT;2270 #if NH_3D_DLT 2271 TComDLT m_cDLT; 2260 2272 #endif 2261 2273 … … 2281 2293 UInt getMaxCuDQPDepth() const { return m_uiMaxCuDQPDepth; } 2282 2294 2283 #if H_3D 2284 Void setDLT( TComDLT* pcDLT ) { m_pcDLT = pcDLT; } 2285 TComDLT* getDLT() { return m_pcDLT; } 2295 #if NH_3D_DLT 2296 Void setDLT( TComDLT cDLT ) { m_cDLT = cDLT; } 2297 const TComDLT* getDLT() const { return &m_cDLT; } 2298 TComDLT* getDLT() { return &m_cDLT; } 2286 2299 #endif 2287 2300 -
branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibCommon/TypeDef.h
r1209 r1219 71 71 #define NH_3D_DMM 1 // Depth modeling modes 72 72 #define NH_3D_SDC 1 // Segment-wise DC coding for intra and inter 73 #define NH_3D_DLT 1 // Depth Lookup Table 73 74 #define NH_3D_ENC_DEPTH 1 // Encoder optimizations for depth, incl. 74 75 // HHI_DEPTH_INTRA_SEARCH_RAU_C0160 -
branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibDecoder/TDecCAVLC.cpp
r1209 r1219 496 496 Void TDecCavlc::parsePps3dExtension( TComPPS* pcPPS ) 497 497 { 498 #if H_3D498 #if NH_3D_DLT 499 499 UInt uiCode = 0; 500 500 // 501 TComDLT* pcDLT = new TComDLT;501 TComDLT* pcDLT = pcPPS->getDLT(); 502 502 //Ed.(GT): PPSs are copied in HM16.4. This would cause that the only the DLT pointer is copied. Therefore, a deep copy of the DLT needs to be implemented. Another option would be to use a vectors for the DLT arrays in TComDLT. 503 503 … … 508 508 { 509 509 READ_CODE(6, uiCode, "pps_depth_layers_minus1"); 510 pcDLT->setNumDepthViews( uiCode );511 510 pcDLT->setNumDepthViews( uiCode+1 ); 511 512 512 READ_CODE(4, uiCode, "pps_bit_depth_for_depth_views_minus8"); 513 513 pcDLT->setDepthViewBitDepth( (uiCode+8) ); 514 515 //Ed.(GT): Please remove parsing dependency from VPS here ! 516 for( Int i = 0; i <= pcVPS->getMaxLayersMinus1(); i++ ) 517 { 518 if ( i != 0 ) 519 { 520 if( pcVPS->getDepthId( i ) == 1 ) 521 { 522 READ_FLAG(uiCode, "dlt_flag[i]"); 523 pcDLT->setUseDLTFlag(i, (uiCode == 1) ? true : false); 524 525 if ( pcDLT->getUseDLTFlag( i ) ) 514 515 for( Int i = 0; i <= pcDLT->getNumDepthViews(); i++ ) 516 { 517 Int layerId = pcDLT->getDepthIdxToLayerId(i); 518 519 READ_FLAG(uiCode, "dlt_flag[i]"); 520 pcDLT->setUseDLTFlag(layerId, (uiCode == 1) ? true : false); 521 522 if ( pcDLT->getUseDLTFlag( layerId ) ) 523 { 524 Bool bDltBitMapRepFlag = false; 525 UInt uiMaxDiff = INT_MAX; 526 UInt uiMinDiff = 0; 527 UInt uiCodeLength = 0; 528 529 READ_FLAG(uiCode, "inter_view_dlt_pred_enable_flag[ i ]"); 530 531 if( uiCode ) 532 { 533 assert( pcDLT->getUseDLTFlag( 1 )); 534 } 535 pcDLT->setInterViewDltPredEnableFlag( layerId, (uiCode == 1) ? true : false ); 536 537 if ( pcDLT->getInterViewDltPredEnableFlag( layerId ) == false ) 538 { 539 READ_FLAG(uiCode, "dlt_bit_map_rep_flag[ layerId ]"); 540 bDltBitMapRepFlag = (uiCode == 1) ? true : false; 541 } 542 else 543 { 544 bDltBitMapRepFlag = false; 545 } 546 547 UInt uiNumDepthValues = 0; 548 std::vector<Int> aiIdx2DepthValue(256); 549 550 // Bit map 551 if ( bDltBitMapRepFlag ) 552 { 553 for (UInt d=0; d<256; d++) 526 554 { 527 Bool bDltBitMapRepFlag = false; 528 UInt uiMaxDiff = 0xffffffff; 529 UInt uiMinDiff = 0; 530 UInt uiCodeLength = 0; 531 532 READ_FLAG(uiCode, "inter_view_dlt_pred_enable_flag[ i ]"); 533 534 if( uiCode ) 555 READ_FLAG(uiCode, "dlt_bit_map_flag[ layerId ][ j ]"); 556 if (uiCode == 1) 535 557 { 536 assert( pcDLT->getUseDLTFlag( 1 )); 558 aiIdx2DepthValue[uiNumDepthValues] = d; 559 uiNumDepthValues++; 537 560 } 538 pcDLT->setInterViewDltPredEnableFlag( i, (uiCode == 1) ? true : false ); 539 540 if ( pcDLT->getInterViewDltPredEnableFlag( i ) == false ) 561 } 562 } 563 // Diff Coding 564 else 565 { 566 READ_CODE(8, uiNumDepthValues, "num_depth_values_in_dlt[i]"); // num_entry 567 568 { 569 // The condition if( pcVPS->getNumDepthValues(i) > 0 ) is always true since for Single-view Diff Coding, there is at least one depth value in depth component. 570 571 if (uiNumDepthValues > 1) 541 572 { 542 READ_ FLAG(uiCode, "dlt_bit_map_rep_flag[ layerId ]");543 bDltBitMapRepFlag = (uiCode == 1) ? true : false;573 READ_CODE(8, uiCode, "max_diff[ layerId ]"); 574 uiMaxDiff = uiCode; 544 575 } 545 576 else 546 577 { 547 bDltBitMapRepFlag = false;578 uiMaxDiff = 0; // when there is only one value in DLT 548 579 } 549 580 550 UInt uiNumDepthValues = 0; 551 Int aiIdx2DepthValue[256]; 552 553 // Bit map 554 if ( bDltBitMapRepFlag ) 581 if (uiNumDepthValues > 2) 555 582 { 556 for (UInt d=0; d<256; d++) 583 uiCodeLength = (UInt) gCeilLog2(uiMaxDiff + 1); 584 READ_CODE(uiCodeLength, uiCode, "min_diff_minus1[ layerId ]"); 585 uiMinDiff = uiCode + 1; 586 } 587 else 588 { 589 uiMinDiff = uiMaxDiff; // when there are only one or two values in DLT 590 } 591 592 READ_CODE(8, uiCode, "dlt_depth_value0[layerId]"); // entry0 593 aiIdx2DepthValue[0] = uiCode; 594 595 if (uiMaxDiff == uiMinDiff) 596 { 597 for (UInt d=1; d<uiNumDepthValues; d++) 557 598 { 558 READ_FLAG(uiCode, "dlt_bit_map_flag[ layerId ][ j ]"); 559 if (uiCode == 1) 560 { 561 aiIdx2DepthValue[uiNumDepthValues] = d; 562 uiNumDepthValues++; 563 } 599 aiIdx2DepthValue[d] = aiIdx2DepthValue[d-1] + uiMinDiff + 0; 564 600 } 565 601 } 566 // Diff Coding567 602 else 568 603 { 569 READ_CODE(8, uiNumDepthValues, "num_depth_values_in_dlt[i]"); // num_entry570 604 uiCodeLength = (UInt) gCeilLog2(uiMaxDiff - uiMinDiff + 1); 605 for (UInt d=1; d<uiNumDepthValues; d++) 571 606 { 572 // The condition if( pcVPS->getNumDepthValues(i) > 0 ) is always true since for Single-view Diff Coding, there is at least one depth value in depth component. 573 574 if (uiNumDepthValues > 1) 575 { 576 READ_CODE(8, uiCode, "max_diff[ layerId ]"); 577 uiMaxDiff = uiCode; 578 } 579 else 580 { 581 uiMaxDiff = 0; // when there is only one value in DLT 582 } 583 584 if (uiNumDepthValues > 2) 585 { 586 uiCodeLength = (UInt) ceil(Log2(uiMaxDiff + 1)); 587 READ_CODE(uiCodeLength, uiCode, "min_diff_minus1[ layerId ]"); 588 uiMinDiff = uiCode + 1; 589 } 590 else 591 { 592 uiMinDiff = uiMaxDiff; // when there are only one or two values in DLT 593 } 594 595 READ_CODE(8, uiCode, "dlt_depth_value0[layerId]"); // entry0 596 aiIdx2DepthValue[0] = uiCode; 597 598 if (uiMaxDiff == uiMinDiff) 599 { 600 for (UInt d=1; d<uiNumDepthValues; d++) 601 { 602 aiIdx2DepthValue[d] = aiIdx2DepthValue[d-1] + uiMinDiff + 0; 603 } 604 } 605 else 606 { 607 uiCodeLength = (UInt) ceil(Log2(uiMaxDiff - uiMinDiff + 1)); 608 for (UInt d=1; d<uiNumDepthValues; d++) 609 { 610 READ_CODE(uiCodeLength, uiCode, "dlt_depth_value_diff_minus_min[ layerId ][ j ]"); 611 aiIdx2DepthValue[d] = aiIdx2DepthValue[d-1] + uiMinDiff + uiCode; 612 } 613 } 614 607 READ_CODE(uiCodeLength, uiCode, "dlt_depth_value_diff_minus_min[ layerId ][ j ]"); 608 aiIdx2DepthValue[d] = aiIdx2DepthValue[d-1] + uiMinDiff + uiCode; 615 609 } 616 610 } 617 611 618 if( pcDLT->getInterViewDltPredEnableFlag( i ) )619 {620 // interpret decoded values as delta DLT621 AOF( pcVPS->getDepthId( 1 ) == 1 );622 AOF( i > 1 );623 // assumes ref layer id to be 1624 Int* piRefDLT = pcDLT->idx2DepthValue( 1 );625 UInt uiRefNum = pcDLT->getNumDepthValues( 1 );626 pcDLT->setDeltaDLT(i, piRefDLT, uiRefNum, aiIdx2DepthValue, uiNumDepthValues);627 }628 else629 {630 // store final DLT631 pcDLT->setDepthLUTs(i, aiIdx2DepthValue, uiNumDepthValues);632 }633 634 612 } 635 613 } 636 } 637 } 638 } 639 640 pcPPS->setDLT( pcDLT ); 614 615 if( pcDLT->getInterViewDltPredEnableFlag( layerId ) ) 616 { 617 // interpret decoded values as delta DLT 618 AOF( layerId > 1 ); 619 // assumes ref layer id to be 1 620 std::vector<Int> viRefDLT = pcDLT->idx2DepthValue( 1 ); 621 UInt uiRefNum = pcDLT->getNumDepthValues( 1 ); 622 pcDLT->setDeltaDLT(layerId, viRefDLT, uiRefNum, aiIdx2DepthValue, uiNumDepthValues); 623 } 624 else 625 { 626 // store final DLT 627 pcDLT->setDepthLUTs(layerId, aiIdx2DepthValue, uiNumDepthValues); 628 } 629 630 #ifdef DEBUG 631 printf("---------------------------------------------\n"); 632 printf("LayerId: %d\n", layerId); 633 printf("getUseDLTFlag: %d\n", pcDLT->getUseDLTFlag(layerId)); 634 printf("getInterViewDltPredEnableFlag: %d\n", pcDLT->getInterViewDltPredEnableFlag(layerId)); 635 printf("getUseBitmapRep: %d\n", pcDLT->getUseBitmapRep(layerId)); 636 printf("getNumDepthValues: %d\n", pcDLT->getNumDepthValues(layerId)); 637 for(Int i=0; i<pcDLT->getNumDepthValues(layerId); i++) 638 printf("depthValue[%d] = %d\n", i, pcDLT->idx2DepthValue(layerId, i)); 639 #endif 640 } 641 } 642 } 641 643 #endif 642 644 } -
branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibDecoder/TDecCu.cpp
r1209 r1219 1461 1461 for( UInt uiSegment = 0; uiSegment < uiNumSegments; uiSegment++ ) 1462 1462 { 1463 #if H_3D_DIM_DLT1463 #if NH_3D_DLT 1464 1464 Pel pPredIdx = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] ); 1465 1465 Pel pResiIdx = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx); -
branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibDecoder/TDecTop.cpp
r1200 r1219 1323 1323 // GT: Please don't add parsing dependency of SPS from VPS here again!!! 1324 1324 #endif 1325 #if NH_3D_DLT 1326 // create mapping from depth layer indexes to layer ids 1327 Int j=0; 1328 for( Int i=0; i<=m_parameterSetManager.getFirstVPS()->getMaxLayersMinus1(); i++ ) 1329 { 1330 Int layerId = m_parameterSetManager.getFirstVPS()->getLayerIdInNuh(i); 1331 if( m_parameterSetManager.getFirstVPS()->getDepthId(layerId) ) 1332 pps->getDLT()->setDepthIdxToLayerId(j++, i); 1333 } 1334 #endif 1325 1335 m_cEntropyDecoder.decodePPS( pps ); 1326 1336 -
branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncCavlc.cpp
r1209 r1219 384 384 // GT: Please add a function e.g. xSetDLT in e.g. TEncSlice to find the best DLT syntax representation and do ONLY the coding of the DLT here !! 385 385 386 #if H_3D 387 WRITE_FLAG( pcDLT->getDltPresentFlag() ? 1 : 0, "dlt_present_flag" ); 388 389 if ( pcDLT->getDltPresentFlag() ) 390 { 391 WRITE_CODE(pcDLT->getNumDepthViews(), 6, "pps_depth_layers_minus1"); 392 WRITE_CODE((pcDLT->getDepthViewBitDepth() - 8), 4, "pps_bit_depth_for_depth_views_minus8"); 393 394 for( Int i = 0; i <= pcVPS->getMaxLayersMinus1(); i++ ) 395 { 396 if ( i != 0 ) 397 { 398 if ( pcVPS->getDepthId( i ) == 1 ) 399 { 400 WRITE_FLAG( pcDLT->getUseDLTFlag( i ) ? 1 : 0, "dlt_flag[i]" ); 401 402 if ( pcDLT->getUseDLTFlag( i ) ) 386 #if NH_3D_DLT 387 WRITE_FLAG( pcPPS->getDLT()->getDltPresentFlag() ? 1 : 0, "dlt_present_flag" ); 388 389 if ( pcPPS->getDLT()->getDltPresentFlag() ) 390 { 391 WRITE_CODE(pcPPS->getDLT()->getNumDepthViews() - 1, 6, "pps_depth_layers_minus1"); 392 WRITE_CODE((pcPPS->getDLT()->getDepthViewBitDepth() - 8), 4, "pps_bit_depth_for_depth_views_minus8"); 393 394 for( Int i = 0; i <= pcPPS->getDLT()->getNumDepthViews(); i++ ) 395 { 396 Int layerId = pcPPS->getDLT()->getDepthIdxToLayerId(i); 397 398 WRITE_FLAG( pcPPS->getDLT()->getUseDLTFlag( layerId ) ? 1 : 0, "dlt_flag[layerId]" ); 399 400 if ( pcPPS->getDLT()->getUseDLTFlag( layerId ) ) 401 { 402 std::vector<Int> aiIdx2DepthValue_coded(256, 0); 403 UInt uiNumDepthValues_coded = pcPPS->getDLT()->getNumDepthValues(layerId); 404 405 // ----------------------------- Actual coding ----------------------------- 406 WRITE_FLAG( pcPPS->getDLT()->getInterViewDltPredEnableFlag( layerId ) ? 1 : 0, "inter_view_dlt_pred_enable_flag[ layerId ]"); 407 if ( pcPPS->getDLT()->getInterViewDltPredEnableFlag( layerId ) == false ) 408 { 409 WRITE_FLAG( pcPPS->getDLT()->getUseBitmapRep( layerId ) ? 1 : 0, "dlt_bit_map_rep_flag[ layerId ]" ); 410 411 for( UInt ui = 0; ui<uiNumDepthValues_coded; ui++ ) 403 412 { 404 WRITE_FLAG( pcDLT->getInterViewDltPredEnableFlag( i ) ? 1 : 0, "inter_view_dlt_pred_enable_flag[ i ]");405 406 // ----------------------------- determine whether to use bit-map -----------------------------407 Bool bDltBitMapRepFlag = false;408 UInt uiNumBitsNonBitMap = 0;409 UInt uiNumBitsBitMap = 0;410 411 UInt uiMaxDiff = 0;412 UInt uiMinDiff = 0xffffffff;413 UInt uiLengthMinDiff = 0;414 UInt uiLengthDltDiffMinusMin = 0;415 416 UInt* puiDltDiffValues = NULL;417 418 Int aiIdx2DepthValue_coded[256];419 UInt uiNumDepthValues_coded= 0;420 421 uiNumDepthValues_coded = pcDLT->getNumDepthValues(i);422 for( UInt ui = 0; ui<uiNumDepthValues_coded; ui++)413 aiIdx2DepthValue_coded[ui] = pcPPS->getDLT()->idx2DepthValue(layerId, ui); 414 } 415 } 416 else 417 { 418 AOF( layerId > 1 ); 419 // assumes ref layer id to be 1 420 std::vector<Int> viRefDLT = pcPPS->getDLT()->idx2DepthValue( 1 ); 421 UInt uiRefNum = pcPPS->getDLT()->getNumDepthValues( 1 ); 422 pcPPS->getDLT()->getDeltaDLT(layerId, viRefDLT, uiRefNum, aiIdx2DepthValue_coded, uiNumDepthValues_coded); 423 } 424 425 // bit map coding 426 if ( pcPPS->getDLT()->getUseBitmapRep( layerId ) ) 427 { 428 UInt uiDltArrayIndex = 0; 429 for (UInt d=0; d < 256; d++) 430 { 431 if ( d == aiIdx2DepthValue_coded[uiDltArrayIndex] ) 423 432 { 424 aiIdx2DepthValue_coded[ui] = pcDLT->idx2DepthValue(i, ui); 425 } 426 427 if( pcDLT->getInterViewDltPredEnableFlag( i ) ) 428 { 429 AOF( pcVPS->getDepthId( 1 ) == 1 ); 430 AOF( i > 1 ); 431 // assumes ref layer id to be 1 432 Int* piRefDLT = pcDLT->idx2DepthValue( 1 ); 433 UInt uiRefNum = pcDLT->getNumDepthValues( 1 ); 434 pcDLT->getDeltaDLT(i, piRefDLT, uiRefNum, aiIdx2DepthValue_coded, &uiNumDepthValues_coded); 435 } 436 437 if ( NULL == (puiDltDiffValues = (UInt *)calloc(uiNumDepthValues_coded, sizeof(UInt))) ) 438 { 439 // This should be changed to an assertion. 440 exit(-1); 441 } 442 443 for (UInt d = 1; d < uiNumDepthValues_coded; d++) 444 { 445 puiDltDiffValues[d] = aiIdx2DepthValue_coded[d] - aiIdx2DepthValue_coded[d-1]; 446 447 if ( uiMaxDiff < puiDltDiffValues[d] ) 448 { 449 uiMaxDiff = puiDltDiffValues[d]; 450 } 451 452 if ( uiMinDiff > puiDltDiffValues[d] ) 453 { 454 uiMinDiff = puiDltDiffValues[d]; 455 } 456 } 457 458 // counting bits 459 // diff coding branch 460 uiNumBitsNonBitMap += 8; // u(v) bits for num_depth_values_in_dlt[layerId] (i.e. num_entry[ layerId ]) 461 462 if ( uiNumDepthValues_coded > 1 ) 463 { 464 uiNumBitsNonBitMap += 8; // u(v) bits for max_diff[ layerId ] 465 } 466 467 if ( uiNumDepthValues_coded > 2 ) 468 { 469 uiLengthMinDiff = (UInt) ceil(Log2(uiMaxDiff + 1)); 470 uiNumBitsNonBitMap += uiLengthMinDiff; // u(v) bits for min_diff[ layerId ] 471 } 472 473 uiNumBitsNonBitMap += 8; // u(v) bits for dlt_depth_value0[ layerId ] 474 475 if (uiMaxDiff > uiMinDiff) 476 { 477 uiLengthDltDiffMinusMin = (UInt) ceil(Log2(uiMaxDiff - uiMinDiff + 1)); 478 uiNumBitsNonBitMap += uiLengthDltDiffMinusMin * (uiNumDepthValues_coded - 1); // u(v) bits for dlt_depth_value_diff_minus_min[ layerId ][ j ] 479 } 480 481 // bit map branch 482 uiNumBitsBitMap = 256; // uiNumBitsBitMap = 1 << pcDLT->getDepthViewBitDepth(); 483 484 // determine bDltBitMapFlag 485 bDltBitMapRepFlag = (uiNumBitsBitMap > uiNumBitsNonBitMap) ? false : true; 486 487 // ----------------------------- Actual coding ----------------------------- 488 if ( pcDLT->getInterViewDltPredEnableFlag( i ) == false ) 489 { 490 WRITE_FLAG( bDltBitMapRepFlag ? 1 : 0, "dlt_bit_map_rep_flag[ layerId ]" ); 433 WRITE_FLAG(1, "dlt_bit_map_flag[ layerId ][ j ]"); 434 uiDltArrayIndex++; 491 435 } 492 436 else 493 437 { 494 bDltBitMapRepFlag = false;438 WRITE_FLAG(0, "dlt_bit_map_flag[ layerId ][ j ]"); 495 439 } 496 497 // bit map coding 498 if ( bDltBitMapRepFlag ) 440 } 441 } 442 // Diff Coding 443 else 444 { 445 UInt uiMaxDiff = 0; 446 UInt uiMinDiff = INT_MAX; 447 UInt uiLengthMinDiff = 0; 448 UInt uiLengthDltDiffMinusMin = 0; 449 450 std::vector<UInt> puiDltDiffValues(uiNumDepthValues_coded, 0); 451 452 for (UInt d = 1; d < uiNumDepthValues_coded; d++) 453 { 454 puiDltDiffValues[d] = aiIdx2DepthValue_coded[d] - aiIdx2DepthValue_coded[d-1]; 455 456 if ( uiMaxDiff < puiDltDiffValues[d] ) 499 457 { 500 UInt uiDltArrayIndex = 0; 501 for (UInt d=0; d < 256; d++) 458 uiMaxDiff = puiDltDiffValues[d]; 459 } 460 461 if ( uiMinDiff > puiDltDiffValues[d] ) 462 { 463 uiMinDiff = puiDltDiffValues[d]; 464 } 465 } 466 467 if ( uiNumDepthValues_coded > 2 ) 468 { 469 uiLengthMinDiff = (UInt) gCeilLog2(uiMaxDiff + 1); 470 } 471 if (uiMaxDiff > uiMinDiff) 472 { 473 uiLengthDltDiffMinusMin = (UInt) gCeilLog2(uiMaxDiff - uiMinDiff + 1); 474 } 475 476 WRITE_CODE(uiNumDepthValues_coded, 8, "num_depth_values_in_dlt[layerId]"); // num_entry 477 { 478 // The condition if( uiNumDepthValues_coded > 0 ) is always true since for Single-view Diff Coding, there is at least one depth value in depth component. 479 if ( uiNumDepthValues_coded > 1 ) 480 { 481 WRITE_CODE(uiMaxDiff, 8, "max_diff[ layerId ]"); // max_diff 482 } 483 484 if ( uiNumDepthValues_coded > 2 ) 485 { 486 WRITE_CODE((uiMinDiff - 1), uiLengthMinDiff, "min_diff_minus1[ layerId ]"); // min_diff_minus1 487 } 488 489 WRITE_CODE(aiIdx2DepthValue_coded[0], 8, "dlt_depth_value0[layerId]"); // entry0 490 491 if (uiMaxDiff > uiMinDiff) 492 { 493 for (UInt d=1; d < uiNumDepthValues_coded; d++) 502 494 { 503 if ( d == aiIdx2DepthValue_coded[uiDltArrayIndex] ) 504 { 505 WRITE_FLAG(1, "dlt_bit_map_flag[ layerId ][ j ]"); 506 uiDltArrayIndex++; 507 } 508 else 509 { 510 WRITE_FLAG(0, "dlt_bit_map_flag[ layerId ][ j ]"); 511 } 495 WRITE_CODE( (puiDltDiffValues[d] - uiMinDiff), uiLengthDltDiffMinusMin, "dlt_depth_value_diff_minus_min[ layerId ][ j ]"); // entry_value_diff_minus_min[ k ] 512 496 } 513 497 } 514 // Diff Coding515 else516 {517 WRITE_CODE(uiNumDepthValues_coded, 8, "num_depth_values_in_dlt[i]"); // num_entry518 {519 // The condition if( uiNumDepthValues_coded > 0 ) is always true since for Single-view Diff Coding, there is at least one depth value in depth component.520 if ( uiNumDepthValues_coded > 1 )521 {522 WRITE_CODE(uiMaxDiff, 8, "max_diff[ layerId ]"); // max_diff523 }524 525 if ( uiNumDepthValues_coded > 2 )526 {527 WRITE_CODE((uiMinDiff - 1), uiLengthMinDiff, "min_diff_minus1[ layerId ]"); // min_diff_minus1528 }529 530 WRITE_CODE(aiIdx2DepthValue_coded[0], 8, "dlt_depth_value0[layerId]"); // entry0531 532 if (uiMaxDiff > uiMinDiff)533 {534 for (UInt d=1; d < uiNumDepthValues_coded; d++)535 {536 WRITE_CODE( (puiDltDiffValues[d] - uiMinDiff), uiLengthDltDiffMinusMin, "dlt_depth_value_diff_minus_min[ layerId ][ j ]"); // entry_value_diff_minus_min[ k ]537 }538 }539 }540 }541 542 free(puiDltDiffValues);543 498 } 499 544 500 } 545 501 } -
branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncCfg.h
r1200 r1219 383 383 #endif 384 384 385 #if H_3D386 TComDLT *m_cDLT;385 #if NH_3D_DLT 386 TComDLT m_cDLT; 387 387 #endif 388 388 Bool m_recalculateQPAccordingToLambda; ///< recalculate QP value according to the lambda value … … 1011 1011 #endif 1012 1012 1013 #if H_3D1014 Void setDLT( TComDLT *p ) s{ m_cDLT = p; }1015 TComDLT* getDLT() s{ returnm_cDLT; }1013 #if NH_3D_DLT 1014 Void setDLT( TComDLT p ) { m_cDLT = p; } 1015 TComDLT* getDLT() { return &m_cDLT; } 1016 1016 #endif 1017 1017 Void setUseRecalculateQPAccordingToLambda (Bool b) { m_recalculateQPAccordingToLambda = b; } -
branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncSearch.cpp
r1209 r1219 2266 2266 Pel pDCRec = ( !bZeroResidual ) ? apDCOrigValues[uiSegment] : apDCPredValues[uiSegment]; 2267 2267 // get residual (idx) 2268 #if H_3D_DIM_DLT2268 #if NH_3D_DLT 2269 2269 Pel pResidualIdx = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pDCRec ) - pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] ); 2270 2270 #else … … 2288 2288 for( UInt uiSegment = 0; uiSegment < uiNumSegments; uiSegment++ ) 2289 2289 { 2290 #if H_3D_DIM_DLT2290 #if NH_3D_DLT 2291 2291 Pel pPredIdx = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] ); 2292 2292 Pel pResiIdx = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx); … … 7661 7661 #endif 7662 7662 7663 #if H_3D_DIM_DLT7664 rDeltaDC1 = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), ClipBD(predDC1 + rDeltaDC1 ), bitDepthY) - pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC1 );7665 rDeltaDC2 = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), ClipBD(predDC2 + rDeltaDC2 ), bitDepthY) - pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC2 );7663 #if NH_3D_DLT 7664 rDeltaDC1 = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), ClipBD(predDC1 + rDeltaDC1, bitDepthY )) - pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC1 ); 7665 rDeltaDC2 = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), ClipBD(predDC2 + rDeltaDC2, bitDepthY )) - pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC2 ); 7666 7666 #endif 7667 7667 } -
branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncTop.cpp
r1200 r1219 987 987 #endif 988 988 989 #if H_3D 990 m_cPPS.setDLT( getDLT() ); 989 #if NH_3D_DLT 990 // create mapping from depth layer indexes to layer ids 991 Int j=0; 992 for( Int i=0; i<=getVPS()->getMaxLayersMinus1(); i++ ) 993 { 994 Int layerId = getVPS()->getLayerIdInNuh(i); 995 if( getVPS()->getDepthId(layerId) ) 996 m_cDLT.setDepthIdxToLayerId(j++, i); 997 } 998 m_cPPS.setDLT( m_cDLT ); 991 999 #endif 992 1000
Note: See TracChangeset for help on using the changeset viewer.