Changeset 1219 in 3DVCSoftware for branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibDecoder
- Timestamp:
- 20 May 2015, 20:08:27 (10 years ago)
- Location:
- branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibDecoder
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset for help on using the changeset viewer.