Changeset 748 in 3DVCSoftware for branches/HTM-9.1-dev0-ZTE/source/Lib/TLibDecoder
- Timestamp:
- 18 Dec 2013, 09:00:24 (11 years ago)
- Location:
- branches/HTM-9.1-dev0-ZTE/source/Lib/TLibDecoder
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-9.1-dev0-ZTE/source/Lib/TLibDecoder/TDecCAVLC.cpp
r738 r748 215 215 } 216 216 217 #if DLT_DIFF_CODING_IN_PPS 218 Void TDecCavlc::parsePPS(TComPPS* pcPPS, TComVPS* pcVPS ) 219 #else 217 220 Void TDecCavlc::parsePPS(TComPPS* pcPPS) 221 #endif 218 222 { 219 223 #if ENC_DEC_TRACE … … 364 368 if (uiCode) 365 369 { 366 while ( xMoreRbspData() ) 367 { 368 READ_FLAG( uiCode, "pps_extension_data_flag"); 369 } 370 } 371 } 370 #if DLT_DIFF_CODING_IN_PPS 371 parsePPSExtension( pcPPS, pcVPS ); 372 READ_FLAG( uiCode, "pps_extension2_flag"); 373 if ( uiCode ) 374 { 375 #endif 376 while ( xMoreRbspData() ) 377 { 378 READ_FLAG( uiCode, "pps_extension_data_flag"); 379 } 380 #if DLT_DIFF_CODING_IN_PPS 381 } 382 #endif 383 } 384 } 385 386 #if DLT_DIFF_CODING_IN_PPS 387 Void TDecCavlc::parsePPSExtension( TComPPS* pcPPS, TComVPS* pcVPS ) 388 { 389 UInt uiCode = 0; 390 TComDLT* pcDLT = new TComDLT; 391 392 READ_FLAG(uiCode, "dlt_present_flag"); 393 pcDLT->setDltPresentFlag( (uiCode == 1) ? true : false ); 394 395 if ( pcDLT->getDltPresentFlag() ) 396 { 397 READ_CODE(6, uiCode, "pps_depth_layers_minus1"); 398 pcDLT->setNumDepthViews( uiCode ); 399 400 READ_CODE(4, uiCode, "pps_bit_depth_for_depth_views_minus8"); 401 pcDLT->setDepthViewBitDepth( (uiCode+8) ); 402 403 for( Int i = 0; i <= pcVPS->getMaxLayersMinus1(); i++ ) 404 { 405 if ( i != 0 ) 406 { 407 if( pcVPS->getDepthId( i ) == 1 ) 408 { 409 READ_FLAG(uiCode, "dlt_flag[i]"); 410 pcDLT->setUseDLTFlag(i, (uiCode == 1) ? true : false); 411 412 if ( pcDLT->getUseDLTFlag( i ) ) 413 { 414 UInt uiNumDepthValues = 0; 415 Bool bDltBitMapRepFlag = false; 416 UInt uiMaxDiff = 0xffffffff; 417 UInt uiMinDiff = 0; 418 UInt uiCodeLength = 0; 419 UInt uiDiffMaxMinDltValue = 0; 420 421 READ_FLAG(uiCode, "inter_view_dlt_pred_enable_flag[ i ]"); 422 pcDLT->setInterViewDltPredEnableFlag( i, (uiCode == 1) ? true : false ); 423 424 if ( pcDLT->getInterViewDltPredEnableFlag( i ) == false ) 425 { 426 READ_FLAG(uiCode, "dlt_bit_map_rep_flag[ layerId ]"); 427 bDltBitMapRepFlag = (uiCode == 1) ? true : false; 428 } 429 else 430 { 431 bDltBitMapRepFlag = false; 432 } 433 434 // Bit map 435 if ( bDltBitMapRepFlag ) 436 { 437 UInt uiNumDepthValues = 0; 438 Int aiIdx2DepthValue[256]; 439 440 for (UInt d=0; d<256; d++) 441 { 442 READ_FLAG(uiCode, "dlt_bit_map_flag[ layerId ][ j ]"); 443 if (uiCode == 1) 444 { 445 aiIdx2DepthValue[uiNumDepthValues] = d; 446 uiNumDepthValues++; 447 } 448 } 449 450 pcDLT->setDepthLUTs(i, aiIdx2DepthValue, uiNumDepthValues); 451 } 452 // Diff Coding 453 else 454 { 455 READ_CODE(8, uiNumDepthValues, "num_depth_values_in_dlt[i]"); // num_entry 456 457 if ( pcDLT->getInterViewDltPredEnableFlag( i ) == false ) // Single-view DLT Diff Coding 458 { 459 // 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. 460 461 Int* aiIdx2DepthValue = (Int*) calloc(uiNumDepthValues, sizeof(Int)); 462 463 if (uiNumDepthValues > 1) 464 { 465 READ_CODE(8, uiCode, "max_diff[ layerId ]"); 466 uiMaxDiff = uiCode; 467 } 468 else 469 { 470 uiMaxDiff = 0; // when there is only one value in DLT 471 } 472 473 if (uiNumDepthValues > 2) 474 { 475 uiCodeLength = (UInt) ceil(Log2(uiMaxDiff + 1)); 476 READ_CODE(uiCodeLength, uiCode, "min_diff_minus1[ layerId ]"); 477 uiMinDiff = uiCode + 1; 478 } 479 else 480 { 481 uiMinDiff = uiMaxDiff; // when there are only one or two values in DLT 482 } 483 484 READ_CODE(8, uiCode, "dlt_depth_value0[layerId]"); // entry0 485 aiIdx2DepthValue[0] = uiCode; 486 487 if (uiMaxDiff == uiMinDiff) 488 { 489 for (UInt d=1; d<uiNumDepthValues; d++) 490 { 491 aiIdx2DepthValue[d] = aiIdx2DepthValue[d-1] + uiMinDiff + 0; 492 } 493 } 494 else 495 { 496 uiCodeLength = (UInt) ceil(Log2(uiMaxDiff - uiMinDiff + 1)); 497 for (UInt d=1; d<uiNumDepthValues; d++) 498 { 499 READ_CODE(uiCodeLength, uiCode, "dlt_depth_value_diff_minus_min[ layerId ][ j ]"); 500 aiIdx2DepthValue[d] = aiIdx2DepthValue[d-1] + uiMinDiff + uiCode; 501 } 502 } 503 504 pcDLT->setDepthLUTs(i, aiIdx2DepthValue, uiNumDepthValues); 505 506 free(aiIdx2DepthValue); 507 } 508 } 509 } 510 } 511 } 512 } 513 } 514 515 pcPPS->setDLT( pcDLT ); 516 } 517 #endif 372 518 373 519 Void TDecCavlc::parseVUI(TComVUI* pcVUI, TComSPS *pcSPS) … … 1738 1884 // READ_FLAG( uiCode, "lim_qt_pred_flag[i]"); pcVPS->setLimQtPreFlag ( i, uiCode == 1 ? true : false ); 1739 1885 #if H_3D_DIM_DLT 1886 #if !DLT_DIFF_CODING_IN_PPS 1740 1887 if( pcVPS->getVpsDepthModesFlag( i ) ) 1741 1888 { … … 1762 1909 free(aiIdx2DepthValue); 1763 1910 } 1911 #endif 1764 1912 #endif 1765 1913 #if H_3D_INTER_SDC -
branches/HTM-9.1-dev0-ZTE/source/Lib/TLibDecoder/TDecCAVLC.h
r738 r748 105 105 Void parseSPS ( TComSPS* pcSPS ); 106 106 #endif 107 108 #if DLT_DIFF_CODING_IN_PPS 109 Void parsePPS ( TComPPS* pcPPS, TComVPS* pcVPS ); 110 Void parsePPSExtension ( TComPPS* pcPPS, TComVPS* pcVPS ); 111 #else 112 Void parsePPS ( TComPPS* pcPPS); 113 #endif 114 107 115 Void parsePPS ( TComPPS* pcPPS); 108 116 Void parseVUI ( TComVUI* pcVUI, TComSPS* pcSPS ); -
branches/HTM-9.1-dev0-ZTE/source/Lib/TLibDecoder/TDecCu.cpp
r735 r748 781 781 { 782 782 #if LGE_PRED_RES_CODING_DLT_DOMAIN_F0159 783 if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getVPS()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) ) 783 #if DLT_DIFF_CODING_IN_PPS 784 if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) ) 785 #else 786 if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getVPS()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) ) 787 #endif 784 788 { 785 pReco [ uiX ] = pcCU->getSlice()->getVPS()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), Clip3( 0, pcCU->getSlice()->getVPS()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ) - 1, pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] ) + pResi[ uiX ] ) ); 789 #if DLT_DIFF_CODING_IN_PPS 790 pReco [ uiX ] = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), Clip3( 0, pcCU->getSlice()->getPPS()->getDLT()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ) - 1, pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] ) + pResi[ uiX ] ) ); 791 #else 792 pReco [ uiX ] = pcCU->getSlice()->getVPS()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), Clip3( 0, pcCU->getSlice()->getVPS()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ) - 1, pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] ) + pResi[ uiX ] ) ); 793 #endif 786 794 } 787 795 else … … 1000 1008 { 1001 1009 #if H_3D_DIM_DLT 1010 #if DLT_DIFF_CODING_IN_PPS 1011 Pel pPredIdx = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] ); 1012 Pel pResiIdx = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx); 1013 Pel pRecoValue = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pPredIdx + pResiIdx ); 1014 #else 1002 1015 Pel pPredIdx = pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] ); 1003 1016 Pel pResiIdx = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx); 1004 1017 Pel pRecoValue = pcCU->getSlice()->getVPS()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pPredIdx + pResiIdx ); 1005 1018 #endif 1019 1006 1020 apDCResiValues[uiSegment] = pRecoValue - apDCPredValues[uiSegment]; 1007 1021 #else -
branches/HTM-9.1-dev0-ZTE/source/Lib/TLibDecoder/TDecEntropy.h
r655 r748 71 71 virtual Void parseSPS ( TComSPS* pcSPS ) = 0; 72 72 #endif 73 #if DLT_DIFF_CODING_IN_PPS 74 virtual Void parsePPS ( TComPPS* pcPPS, TComVPS* pcVPS ) = 0; 75 #else 73 76 virtual Void parsePPS ( TComPPS* pcPPS ) = 0; 77 #endif 74 78 75 79 virtual Void parseSliceHeader ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager) = 0; … … 148 152 Void decodeSPS ( TComSPS* pcSPS ) { m_pcEntropyDecoderIf->parseSPS(pcSPS); } 149 153 #endif 154 #if DLT_DIFF_CODING_IN_PPS 155 Void decodePPS ( TComPPS* pcPPS, TComVPS* pcVPS ) { m_pcEntropyDecoderIf->parsePPS(pcPPS, pcVPS); } 156 #else 150 157 Void decodePPS ( TComPPS* pcPPS ) { m_pcEntropyDecoderIf->parsePPS(pcPPS); } 158 #endif 151 159 Void decodeSliceHeader ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager) { m_pcEntropyDecoderIf->parseSliceHeader(rpcSlice, parameterSetManager); } 152 160 -
branches/HTM-9.1-dev0-ZTE/source/Lib/TLibDecoder/TDecSbac.cpp
r724 r748 568 568 569 569 #if H_3D_DIM_DLT 570 #if DLT_DIFF_CODING_IN_PPS 571 UInt uiMaxResidualBits = pcCU->getSlice()->getPPS()->getDLT()->getBitsPerDepthValue( pcCU->getSlice()->getLayerIdInVps() ); 572 #else 570 573 UInt uiMaxResidualBits = pcCU->getSlice()->getVPS()->getBitsPerDepthValue( pcCU->getSlice()->getLayerIdInVps() ); 574 #endif 571 575 #else 572 576 UInt uiMaxResidualBits = g_bitDepthY; … … 592 596 UInt uiCount = 0; 593 597 #if H_3D_DIM_DLT 598 #if DLT_DIFF_CODING_IN_PPS 599 UInt uiNumDepthValues = pcCU->getSlice()->getPPS()->getDLT()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ); 600 #else 594 601 UInt uiNumDepthValues = pcCU->getSlice()->getVPS()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ); 602 #endif 595 603 #else 596 604 UInt uiNumDepthValues = ((1 << g_bitDepthY)-1); -
branches/HTM-9.1-dev0-ZTE/source/Lib/TLibDecoder/TDecSbac.h
r724 r748 81 81 Void parseSPS ( TComSPS* /*pcSPS*/ ) {} 82 82 #endif 83 #if DLT_DIFF_CODING_IN_PPS 84 Void parsePPS ( TComPPS* /*pcPPS*/, TComVPS* /*pcVPS*/ ) {} 85 #else 83 86 Void parsePPS ( TComPPS* /*pcPPS*/ ) {} 87 #endif 84 88 85 89 Void parseSliceHeader ( TComSlice*& /*rpcSlice*/, ParameterSetManagerDecoder* /*parameterSetManager*/) {} -
branches/HTM-9.1-dev0-ZTE/source/Lib/TLibDecoder/TDecTop.cpp
r738 r748 1151 1151 pps->setLayerId( getLayerId() ); 1152 1152 #endif 1153 #if DLT_DIFF_CODING_IN_PPS 1154 // Assuming that all PPS indirectly refer to the same VPS via different SPS 1155 // There is no parsing dependency in decoding DLT in PPS. 1156 // The VPS information passed to decodePPS() is used to arrange the decoded DLT tables to their corresponding layers. 1157 // This is equivalent to the process of 1158 // Step 1) decoding DLT tables based on the number of depth layers, and 1159 // Step 2) mapping DLT tables to the depth layers 1160 // as descripted in the 3D-HEVC WD. 1161 TComVPS* vps = m_parameterSetManagerDecoder.getPrefetchedVPS( 0 ); 1162 m_cEntropyDecoder.decodePPS( pps, vps ); 1163 #else 1153 1164 m_cEntropyDecoder.decodePPS( pps ); 1165 #endif 1154 1166 m_parameterSetManagerDecoder.storePrefetchedPPS( pps ); 1155 1167 }
Note: See TracChangeset for help on using the changeset viewer.