Changeset 490 in 3DVCSoftware
- Timestamp:
- 23 Jun 2013, 05:16:22 (11 years ago)
- Location:
- branches/HTM-DEV-0.3-dev0/source
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-0.3-dev0/source/App/TAppEncoder/TAppEncTop.cpp
r488 r490 1004 1004 1005 1005 vps.checkVPSExtensionSyntax(); 1006 vps. calcIvRefLayers();1006 vps.setRefLayers(); 1007 1007 } 1008 1008 -
branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComSlice.cpp
r488 r490 114 114 , m_isDepth (false) 115 115 #endif 116 , m_discardableFlag (false) 117 , m_interLayerPredEnabledFlag (false) 118 , m_numInterLayerRefPicsMinus1 (0) 119 , m_interLayerSamplePredOnlyFlag (false) 120 , m_altCollocatedIndicationFlag (0) 121 , m_collocatedRefLayerIdx (0) 116 122 #endif 117 123 { … … 154 160 initWpAcDcParam(); 155 161 m_saoEnabledFlag = false; 162 #if H_MV 163 for (Int i = 0; i < MAX_NUM_LAYERS; i++ ) 164 { 165 m_interLayerPredLayerIdc[ i ] = 0; 166 } 167 #endif 156 168 } 157 169 … … 1440 1452 } 1441 1453 #if H_MV 1454 m_vpsNumberLayerSetsMinus1 = -1; 1455 m_vpsNumProfileTierLevelMinus1 = -1; 1456 1457 for ( Int i = 0; i < MAX_VPS_PROFILE_TIER_LEVEL; i++) 1458 { 1459 m_profileRefMinus1[ i ] = -1; 1460 } 1461 1462 m_moreOutputLayerSetsThanDefaultFlag = false; 1463 m_numAddOutputLayerSetsMinus1 = -1; 1464 m_defaultOneTargetOutputLayerFlag = false; 1465 1466 for ( Int i = 0; i < MAX_VPS_OUTPUTLAYER_SETS; i++) 1467 { 1468 m_outputLayerSetIdxMinus1[i] = -1; 1469 m_profileLevelTierIdx[i] = -1; 1470 for ( Int j = 0; j < MAX_VPS_NUH_LAYER_ID_PLUS1; j++) 1471 { 1472 m_outputLayerFlag[i][j] = false; 1473 } 1474 } 1475 1476 m_maxOneActiveRefLayerFlag = false; 1477 m_directDepTypeLenMinus2 = -1; 1478 1479 1442 1480 m_avcBaseLayerFlag = false; 1443 1481 m_splittingFlag = false; … … 1450 1488 1451 1489 m_vpsNuhLayerIdPresentFlag = false; 1452 m_numOutputLayerSets = 0; 1453 1490 1454 1491 for( Int i = 0; i < MAX_VPS_OP_SETS_PLUS1; i++ ) 1455 1492 { 1456 1493 m_vpsProfilePresentFlag [i] = false; 1457 m_profile LayerSetRefMinus1[i] = 0;1494 m_profileRefMinus1[i] = 0; 1458 1495 m_outputLayerSetIdxMinus1 [i] = 0; 1459 1496 for( Int j = 0; j < MAX_VPS_NUH_LAYER_ID_PLUS1; j++ ) … … 1470 1507 for( Int i = 0; i < MAX_NUM_LAYERS; i++ ) 1471 1508 { 1472 m_layerIdInNuh [i] = ( i == 0 ) ? 0 : -1; 1473 m_numDirectRefLayers[i] = 0; 1509 m_layerIdInNuh [i] = ( i == 0 ) ? 0 : -1; 1510 m_numDirectRefLayers [i] = 0; 1511 m_maxTidIlRefPicPlus1[i] = -1; 1474 1512 #if H_3D 1475 1513 m_viewIndex [i] = -1; … … 1479 1517 { 1480 1518 m_directDependencyFlag[i][j] = false; 1519 m_directDependencyType[i][j] = -1; 1481 1520 m_refLayerId[i][j] = -1; 1482 1521 } … … 1560 1599 } 1561 1600 1562 Void TComVPS::calcIvRefLayers() 1563 { 1564 for( Int i = 1; i <= getMaxLayers(); i++ ) 1565 { 1566 m_numDirectRefLayers[ i ] = 0; 1567 for( Int j = 0 ; j < i; j++ ) 1568 if( m_directDependencyFlag[ i ][ j ]) 1569 m_refLayerId[ i ][ m_numDirectRefLayers[ i ]++ ] = m_layerIdInNuh[ j ]; 1601 Void TComVPS::setRefLayers() 1602 { 1603 for( Int i = 0; i < MAX_NUM_LAYERS; i++ ) 1604 { 1605 m_numSamplePredRefLayers[ i ] = 0; 1606 m_numMotionPredRefLayers[ i ] = 0; 1607 m_numDirectRefLayers [ i ] = 0; 1608 for( Int j = 0; j < MAX_NUM_LAYERS; j++ ) { 1609 m_samplePredEnabledFlag[ i ][ j ] = 0; 1610 m_motionPredEnabledFlag[ i ][ j ] = 0; 1611 m_refLayerId[ i ][ j ] = 0; 1612 m_samplePredRefLayerId[ i ][ j ] = 0; 1613 m_motionPredRefLayerId[ i ][ j ] = 0; 1614 } 1615 } 1616 1617 for( Int i = 1; i <= getMaxLayers()- 1; i++ ) 1618 { 1619 for( Int j = 0; j < i; j++ ) 1620 { 1621 if( getDirectDependencyFlag(i,j) ) 1622 { 1623 m_refLayerId[ i ][m_numDirectRefLayers[ i ]++ ] = getLayerIdInNuh( j ); 1624 1625 m_samplePredEnabledFlag [ i ][ j ] = ( ( getDirectDependencyType( i , j ) + 1 ) & 1 ) == 1; 1626 m_numSamplePredRefLayers[ i ] += m_samplePredEnabledFlag [ i ][ j ] ? 1 : 0; 1627 m_motionPredEnabledFlag [ i ][ j ] = ( ( ( getDirectDependencyType( i , j ) + 1 ) & 2 ) >> 1 ) == 1; 1628 m_numMotionPredRefLayers[ i ] += m_motionPredEnabledFlag [ i][ j ] ? 1 : 0; 1629 } 1630 } 1631 } 1632 1633 for( Int i = 1, mIdx = 0, sIdx = 0; i <= getMaxLayers()- 1; i++ ) 1634 { 1635 for( Int j = 0; j < i; j++ ) 1636 { 1637 if( m_motionPredEnabledFlag[ i ][ j ] ) 1638 { 1639 m_motionPredRefLayerId[ i ][ mIdx++ ] = getLayerIdInNuh( j ); 1640 } 1641 1642 if( m_samplePredEnabledFlag[ i ][ j ] ) 1643 { 1644 m_samplePredRefLayerId[ i ][ sIdx++ ] = getLayerIdInNuh( j ); 1645 } 1646 } 1570 1647 } 1571 1648 } … … 1631 1708 1632 1709 #endif // H_3D 1710 1711 Int TComVPS::xCeilLog2( Int val ) 1712 { 1713 assert( val > 0 ); 1714 Int ceilLog2 = 0; 1715 while( val > ( 1 << ceilLog2 ) ) ceilLog2++; 1716 return ceilLog2; 1717 } 1718 1633 1719 #endif // H_MV 1634 1720 … … 1681 1767 #if H_MV 1682 1768 , m_interViewMvVertConstraintFlag (false) 1769 , m_numIlpRestrictedRefLayers ( 0 ) 1770 1683 1771 #endif 1684 1772 #if H_3D … … 1699 1787 ::memset(m_ltRefPicPocLsbSps, 0, sizeof(m_ltRefPicPocLsbSps)); 1700 1788 ::memset(m_usedByCurrPicLtSPSFlag, 0, sizeof(m_usedByCurrPicLtSPSFlag)); 1789 #if H_MV 1790 for (Int i = 0; i < MAX_NUM_LAYERS; i++ ) 1791 { 1792 m_minSpatialSegmentOffsetPlus1[ i ] = 0; 1793 m_ctuBasedOffsetEnabledFlag [ i ] = false; 1794 m_minHorizontalCtuOffsetPlus1 [ i ] = 0; 1795 } 1796 #endif 1701 1797 } 1702 1798 … … 2258 2354 } 2259 2355 } 2356 2357 Int TComSlice::xCeilLog2( Int val ) 2358 { 2359 assert( val > 0 ); 2360 Int ceilLog2 = 0; 2361 while( val > ( 1 << ceilLog2 ) ) ceilLog2++; 2362 return ceilLog2; 2363 } 2364 2260 2365 #endif 2261 2366 /** get scaling matrix from RefMatrixID -
branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComSlice.h
r488 r490 515 515 516 516 517 Int m_maxTidIlRefPicPlus1 [ MAX_NUM_LAYERS ]; 518 Int m_vpsNumberLayerSetsMinus1; 519 Int m_vpsNumProfileTierLevelMinus1; 520 Int m_profileRefMinus1 [ MAX_VPS_PROFILE_TIER_LEVEL ]; 521 Bool m_vpsMoreOutputLayerSetsThanDefaultFlag; 522 Int m_numAddOutputLayerSetsMinus1; 523 Bool m_defaultOneTargetOutputLayerFlag; 524 Int m_outputLayerSetIdxMinus1 [ MAX_VPS_OUTPUTLAYER_SETS ]; 525 Int m_profileLevelTierIdx [ MAX_VPS_OUTPUTLAYER_SETS ]; 526 Bool m_maxOneActiveRefLayerFlag; 527 Int m_directDepTypeLenMinus2; 528 Int m_directDependencyType [ MAX_NUM_LAYERS ] [ MAX_NUM_LAYERS ]; 529 530 #if H_MV 517 518 519 #if H_MV 520 /// VPS EXTENSION SYNTAX ELEMENTS 531 521 Bool m_avcBaseLayerFlag; 532 522 Bool m_splittingFlag; … … 534 524 Int m_dimensionIdLen [MAX_NUM_SCALABILITY_TYPES]; 535 525 Bool m_vpsNuhLayerIdPresentFlag; 536 Int m_layerIdInNuh [MAX_NUM_LAYER_IDS]; 526 Int m_layerIdInNuh [MAX_NUM_LAYER_IDS]; 527 Int m_dimensionId [MAX_NUM_LAYER_IDS][MAX_NUM_SCALABILITY_TYPES]; 528 Bool m_directDependencyFlag [MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS]; 529 Int m_maxTidIlRefPicPlus1 [MAX_NUM_LAYERS]; 530 Int m_vpsNumberLayerSetsMinus1; 531 Int m_vpsNumProfileTierLevelMinus1; 532 Bool m_vpsProfilePresentFlag [MAX_VPS_OP_SETS_PLUS1]; 533 Int m_profileRefMinus1 [MAX_VPS_PROFILE_TIER_LEVEL]; 534 Bool m_moreOutputLayerSetsThanDefaultFlag; 535 Int m_numAddOutputLayerSetsMinus1; 536 Bool m_defaultOneTargetOutputLayerFlag; 537 Int m_outputLayerSetIdxMinus1 [MAX_VPS_OUTPUTLAYER_SETS]; 538 Bool m_outputLayerFlag [MAX_VPS_OUTPUTLAYER_SETS][MAX_VPS_NUH_LAYER_ID_PLUS1]; 539 Int m_profileLevelTierIdx [MAX_VPS_OUTPUTLAYER_SETS ]; 540 Bool m_maxOneActiveRefLayerFlag; 541 Int m_directDepTypeLenMinus2; 542 Int m_directDependencyType [MAX_NUM_LAYERS] [MAX_NUM_LAYERS]; 543 544 // VPS EXTENSION SEMANTICS VARIABLES 537 545 Int m_layerIdInVps [MAX_NUM_LAYERS ]; 538 Int m_dimensionId [MAX_NUM_LAYER_IDS][MAX_NUM_SCALABILITY_TYPES]; 546 547 Int m_numDirectRefLayers [MAX_NUM_LAYERS]; 548 Int m_refLayerId [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 549 550 Int m_numSamplePredRefLayers [MAX_NUM_LAYERS]; 551 Bool m_samplePredEnabledFlag [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 552 Int m_samplePredRefLayerId [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 553 554 Int m_numMotionPredRefLayers [MAX_NUM_LAYERS]; 555 Bool m_motionPredEnabledFlag [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 556 Int m_motionPredRefLayerId [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 539 557 #if H_3D 540 558 Int m_viewIndex [MAX_NUM_LAYERS ]; 541 559 #endif 542 560 543 544 Bool m_vpsProfilePresentFlag [MAX_VPS_OP_SETS_PLUS1]; 545 Int m_profileLayerSetRefMinus1 [MAX_VPS_OP_SETS_PLUS1]; 546 Int m_numOutputLayerSets; 547 Bool m_outputLayerFlag [MAX_VPS_OUTPUTLAYER_SETS][MAX_VPS_NUH_LAYER_ID_PLUS1]; 548 Bool m_directDependencyFlag [MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS]; 549 550 Int m_numDirectRefLayers [ MAX_NUM_LAYERS ]; 551 Int m_refLayerId [ MAX_NUM_LAYERS ][MAX_NUM_LAYERS]; 552 553 Int xCeilLog2( Int val ) 554 { 555 assert( val > 0 ); 556 Int ceilLog2 = 0; 557 while( val > ( 1 << ceilLog2 ) ) ceilLog2++; 558 return ceilLog2; 559 } 561 Int xCeilLog2( Int val ); 562 560 563 561 564 #endif … … 634 637 Void setScalabilityMask( UInt val ); 635 638 636 Void setScalabilityMask( Int scalType, Bool val ) { m_scalabilityMask[scalType] = val; }637 Bool getScalabilityMask( Int scalType ) { return m_scalabilityMask[scalType]; }639 Void setScalabilityMask( Int scalType, Bool val ) { m_scalabilityMask[scalType] = val; } 640 Bool getScalabilityMask( Int scalType ) { return m_scalabilityMask[scalType]; } 638 641 639 642 Int getNumScalabilityTypes( ); … … 648 651 Int getLayerIdInNuh( Int layerIdInVps ) { assert( m_layerIdInNuh[layerIdInVps] >= 0 ); return m_layerIdInNuh[layerIdInVps]; } 649 652 653 Bool nuhLayerIdIncluded( Int layerIdinNuh ) { return ( m_layerIdInVps[ layerIdinNuh ] > 0 ); } 654 655 Void setDimensionId( Int layerIdInVps, Int scalIdx, Int val ) { m_dimensionId[layerIdInVps][scalIdx] = val; } 656 Int getDimensionId( Int layerIdInVps, Int scalIdx ) { return m_dimensionId[layerIdInVps][scalIdx]; } 657 658 Void setDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Bool val ) { m_directDependencyFlag[depLayeridInVps][refLayeridInVps] = val; } 659 Bool getDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps ) { return m_directDependencyFlag[depLayeridInVps][refLayeridInVps]; } 660 661 Void setMaxTidIlRefPicPlus1( Int layerIdInVps, Int val ) { m_maxTidIlRefPicPlus1[ layerIdInVps ] = val; } 662 Int getMaxTidIlRefPicPlus1( Int layerIdInVps ) { return m_maxTidIlRefPicPlus1[ layerIdInVps ]; } 663 664 Void setVpsNumberLayerSetsMinus1( Int val ) { m_vpsNumberLayerSetsMinus1 = val; } 665 Int getVpsNumberLayerSetsMinus1( ) { return m_vpsNumberLayerSetsMinus1; } 666 667 Void setVpsNumProfileTierLevelMinus1( Int val ) { m_vpsNumProfileTierLevelMinus1 = val; } 668 Int getVpsNumProfileTierLevelMinus1( ) { return m_vpsNumProfileTierLevelMinus1; } 669 670 Void setVpsProfilePresentFlag( Int layerSet, Bool val ) { m_vpsProfilePresentFlag[layerSet] = val; } 671 Bool getVpsProfilePresentFlag( Int layerSet ) { return m_vpsProfilePresentFlag[layerSet]; } 672 673 Void setProfileRefMinus1( Int profileTierLevelIdx, Int val ) { m_profileRefMinus1[ profileTierLevelIdx ] = val; } 674 Int getProfileRefMinus1( Int profileTierLevelIdx ) { return m_profileRefMinus1[ profileTierLevelIdx ]; } 675 676 Void setMoreOutputLayerSetsThanDefaultFlag( Bool flag ) { m_moreOutputLayerSetsThanDefaultFlag = flag; } 677 Bool getMoreOutputLayerSetsThanDefaultFlag() { return m_moreOutputLayerSetsThanDefaultFlag; } 678 679 Void setNumAddOutputLayerSetsMinus1( Int val ) { m_numAddOutputLayerSetsMinus1 = val; } 680 Int getNumAddOutputLayerSetsMinus1( ) { return m_numAddOutputLayerSetsMinus1; } 681 682 Void setDefaultOneTargetOutputLayerFlag( Bool flag ) { m_defaultOneTargetOutputLayerFlag = flag; } 683 Bool getDefaultOneTargetOutputLayerFlag( ) { return m_defaultOneTargetOutputLayerFlag; } 684 685 Void setOutputLayerSetIdxMinus1( Int outLayerSetIdx, Int val ) { m_outputLayerSetIdxMinus1[ outLayerSetIdx ] = val; } 686 Int getOutputLayerSetIdxMinus1( Int outLayerSetIdx ) { return m_outputLayerSetIdxMinus1[ outLayerSetIdx ]; } 687 688 Void setOutputLayerFlag( Int outLayerSetIdx, Int i, Bool flag ) { m_outputLayerFlag[ outLayerSetIdx ][ i ] = flag; } 689 Bool getOutputLayerFlag( Int outLayerSetIdx, Int i ) { return m_outputLayerFlag[ outLayerSetIdx ][ i ]; } 690 691 Void setProfileLevelTierIdx( Int outLayerSetIdx, Int val ) { m_profileLevelTierIdx[ outLayerSetIdx = val ]; } 692 Int getProfileLevelTierIdx( Int outLayerSetIdx ) { return m_profileLevelTierIdx[ outLayerSetIdx ]; } 693 694 Void setMaxOneActiveRefLayerFlag( Bool flag) { m_maxOneActiveRefLayerFlag = flag; } 695 Bool getMaxOneActiveRefLayerFlag( ) { return m_maxOneActiveRefLayerFlag; } 696 697 Void setDirectDepTypeLenMinus2( Int val) { m_directDepTypeLenMinus2 = val; } 698 Int getDirectDepTypeLenMinus2( ) { return m_directDepTypeLenMinus2; } 699 700 Void setDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps, Int val) { m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ] = val; } 701 Int getDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps) { return m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ]; } 702 703 // VPS EXTENSION SEMANTICS VARIABLES 650 704 Void setLayerIdInVps( Int layerIdInNuh, Int val ) { m_layerIdInVps[layerIdInNuh] = val; } 651 705 Int getLayerIdInVps( Int layerIdInNuh ) { assert( m_layerIdInVps[layerIdInNuh] >= 0 ); return m_layerIdInVps[layerIdInNuh]; } 652 706 653 Bool nuhLayerIdIncluded( Int layerIdinNuh ) { return ( m_layerIdInVps[ layerIdinNuh ] > 0 ); }654 655 Void setDimensionId( Int layerIdInVps, Int scalIdx, Int val ) { m_dimensionId[layerIdInVps][scalIdx] = val; }656 Int getDimensionId( Int layerIdInVps, Int scalIdx ) { return m_dimensionId[layerIdInVps][scalIdx]; }657 658 707 Int getScalabilityId ( Int layerIdInVps, ScalabilityType scalType ); 659 660 708 Int getViewId ( Int layerIdInVps ) { return getScalabilityId( layerIdInVps, VIEW_ID ); } 661 #if H_3D 662 Void initViewIndex(); 663 Int getViewIndex ( Int layerIdInVps ) { return m_viewIndex[ layerIdInVps ]; } 664 Int getDepthId ( Int layerIdInVps ) { return getScalabilityId( layerIdInVps, DEPTH_ID ); } 665 Int getLayerIdInNuh( Int viewIndex, Bool depthFlag ); 666 #endif 667 668 669 Void setVpsProfilePresentFlag( Int layerSet, Bool val ) { m_vpsProfilePresentFlag[layerSet] = val; } 670 Bool getVpsProfilePresentFlag( Int layerSet ) { return m_vpsProfilePresentFlag[layerSet]; } 671 672 Void setProfileLayerSetRefMinus1( Int layerSet, Int val ) { m_profileLayerSetRefMinus1[layerSet] = val; } 673 Bool getProfileLayerSetRefMinus1( Int layerSet ) { return m_profileLayerSetRefMinus1[layerSet]; } 674 675 Void setNumOutputLayerSets( Int val ) { m_numOutputLayerSets = val; } 676 Int getNumOutputLayerSets() { return m_numOutputLayerSets; } 677 678 Void setDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Bool val ) { m_directDependencyFlag[depLayeridInVps][refLayeridInVps] = val; } 679 Bool getDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps ) { return m_directDependencyFlag[depLayeridInVps][refLayeridInVps]; } 680 681 Void calcIvRefLayers(); 682 683 Int getNumDirectRefLayers( Int layerIdInVps ) { return m_numDirectRefLayers[ layerIdInVps ]; }; 684 Int getRefLayerId ( Int layerIdInVps, Int idx );; 685 709 710 Void setRefLayers(); 711 712 Int getNumDirectRefLayers ( Int layerIdInVps ) { return m_numDirectRefLayers[ layerIdInVps ]; }; 713 Int getRefLayerId ( Int layerIdInVps, Int idx );; 714 715 Int getNumSamplePredRefLayers( Int layerIdInVps ) { return m_numSamplePredRefLayers[layerIdInVps]; } 716 Bool getSamplePredEnabledFlag ( Int layerIdInVps, Int idx ) { return m_samplePredEnabledFlag [layerIdInVps][idx]; } 717 Int getSamplePredRefLayerId ( Int layerIdInVps, Int idx ) { return m_samplePredRefLayerId [layerIdInVps][idx]; } 718 719 Int getNumMotionPredRefLayers( Int layerIdInVps ) { return m_numMotionPredRefLayers[layerIdInVps]; } 720 Bool getMotionPredEnabledFlag ( Int layerIdInVps, Int idx ) { return m_motionPredEnabledFlag [layerIdInVps][idx]; } 721 Int getMotionPredRefLayerId ( Int layerIdInVps, Int idx ) { return m_motionPredRefLayerId [layerIdInVps][idx]; } 722 686 723 Bool checkVPSExtensionSyntax(); 687 724 Int scalTypeToScalIdx ( ScalabilityType scalType ); 688 689 690 Int getMaxTidIlRefPicPlus1 ( Int layerIdInVps ) { return m_maxTidIlRefPicPlus1 [ layerIdInVps ]; } 691 Void setMaxTidIlRefPicPlus1 ( Int layerIdInVps, Int val ) { m_maxTidIlRefPicPlus1 [ layerIdInVps ] = val; } 692 693 Int getVpsNumberLayerSetsMinus1 () { return m_vpsNumberLayerSetsMinus1 ; } 694 Void setVpsNumberLayerSetsMinus1 ( Int val ) { m_vpsNumberLayerSetsMinus1 = val; } 695 696 Int getVpsNumProfileTierLevelMinus1 () { return m_vpsNumProfileTierLevelMinus1 ; } 697 Void setVpsNumProfileTierLevelMinus1 ( Int val ) { m_vpsNumProfileTierLevelMinus1 = val; } 698 699 Void setProfileRefMinus1 ( Int profileTierLevelIdx, Int val ) { m_profileRefMinus1 [ profileTierLevelIdx ] = val; } 700 Int getProfileRefMinus1 ( Int profileTierLevelIdx ) { return m_profileRefMinus1 [ profileTierLevelIdx ]; } 701 702 Bool getVpsMoreOutputLayerSetsThanDefaultFlag() { return m_vpsMoreOutputLayerSetsThanDefaultFlag ; } 703 Void setVpsMoreOutputLayerSetsThanDefaultFlag( Bool flag ) { m_vpsMoreOutputLayerSetsThanDefaultFlag = flag; } 704 705 Int getNumAddOutputLayerSetsMinus1 () { return m_numAddOutputLayerSetsMinus1 ; } 706 Void setNumAddOutputLayerSetsMinus1 ( Int val ) { m_numAddOutputLayerSetsMinus1 = val; } 707 708 Bool getDefaultOneTargetOutputLayerFlag () { return m_defaultOneTargetOutputLayerFlag ; } 709 Void setDefaultOneTargetOutputLayerFlag ( Bool flag ) { m_defaultOneTargetOutputLayerFlag = flag; } 710 711 Int getOutputLayerSetIdxMinus1 ( Int outLayerSetIdx ) { return m_outputLayerSetIdxMinus1 [ outLayerSetIdx ] ; } 712 Void setOutputLayerSetIdxMinus1 ( Int outLayerSetIdx, Int val ) { m_outputLayerSetIdxMinus1 [ outLayerSetIdx ] = val; } 713 714 Int getProfileLevelTierIdx ( Int outLayerSetIdx ) { return m_profileLevelTierIdx [ outLayerSetIdx ] ; } 715 Void setProfileLevelTierIdx ( Int outLayerSetIdx, Int val ) { m_profileLevelTierIdx [ outLayerSetIdx ] = val; } 716 717 Bool getMaxOneActiveRefLayerFlag() { return m_maxOneActiveRefLayerFlag ; } 718 Void setMaxOneActiveRefLayerFlag ( Bool flag) { m_maxOneActiveRefLayerFlag = flag; } 719 720 Int getDirectDepTypeLenMinus2() { return m_directDepTypeLenMinus2 ; } 721 Void setDirectDepTypeLenMinus2 ( Int val) { m_directDepTypeLenMinus2 = val; } 722 723 Int getDirectDependencyType ( Int depLayeridInVps, Int refLayeridInVps) { return m_directDependencyType [ depLayeridInVps ][ refLayeridInVps ]; } 724 Void setDirectDependencyType ( Int depLayeridInVps, Int refLayeridInVps, Int val) { m_directDependencyType [ depLayeridInVps ][ refLayeridInVps ] = val ; } 725 726 Int getProfileLevelTierIdxLen() 727 { 728 return xCeilLog2( getVpsNumProfileTierLevelMinus1() + 1 ); 729 }; 730 731 Int getNumLayersInIdList ( Int lsIdx ) 725 726 727 Int getProfileLevelTierIdxLen() { return xCeilLog2( getVpsNumProfileTierLevelMinus1() + 1 ); }; 728 Int getNumLayersInIdList ( Int lsIdx ) 732 729 { 733 assert( lsIdx > 0 );734 assert( lsIdx < =getMaxOpSets() );730 assert( lsIdx >= 0 ); 731 assert( lsIdx < getMaxOpSets() ); 735 732 Int numLayersInIdList = 0; 736 733 for (Int layerId = 0; layerId < getVpsMaxLayerId(); layerId++ ) … … 740 737 return numLayersInIdList; 741 738 }; 742 739 #if H_3D 740 Void initViewIndex(); 741 Int getViewIndex ( Int layerIdInVps ) { return m_viewIndex[ layerIdInVps ]; } 742 Int getDepthId ( Int layerIdInVps ) { return getScalabilityId( layerIdInVps, DEPTH_ID ); } 743 Int getLayerIdInNuh( Int viewIndex, Bool depthFlag ); 744 #endif 743 745 #endif 744 746 }; … … 824 826 Int m_numTicksPocDiffOneMinus1; 825 827 #endif 826 828 #if H_MV 829 Bool m_tileBoundariesAlignedFlag; 830 #endif 827 831 public: 828 832 TComVUI() … … 860 864 ,m_numTicksPocDiffOneMinus1(0) 861 865 #endif 866 #if H_MV 867 ,m_tileBoundariesAlignedFlag(false) 868 #endif 862 869 {} 863 870 … … 961 968 Int getNumTicksPocDiffOneMinus1() {return m_numTicksPocDiffOneMinus1;} 962 969 Void setNumTicksPocDiffOneMinus1(Int x) { m_numTicksPocDiffOneMinus1 = x;} 970 #endif 971 #if H_MV 972 Bool getTileBoundariesAlignedFlag( ) { return m_tileBoundariesAlignedFlag; } 973 Void setTileBoundariesAlignedFlag( Bool flag ) { m_tileBoundariesAlignedFlag = flag; } 963 974 #endif 964 975 }; … … 1046 1057 #if H_MV 1047 1058 Bool m_interViewMvVertConstraintFlag; 1059 Int m_numIlpRestrictedRefLayers ; 1060 Int m_minSpatialSegmentOffsetPlus1[MAX_NUM_LAYERS]; 1061 Bool m_ctuBasedOffsetEnabledFlag [MAX_NUM_LAYERS]; 1062 Int m_minHorizontalCtuOffsetPlus1 [MAX_NUM_LAYERS]; 1048 1063 #endif 1049 1064 #if H_3D … … 1052 1067 Int m_aaiCodedScale [2][MAX_NUM_LAYERS]; 1053 1068 Int m_aaiCodedOffset[2][MAX_NUM_LAYERS]; 1069 #endif 1070 #if H_MV 1071 Int m_layerId; 1054 1072 #endif 1055 1073 public: … … 1186 1204 Void setInterViewMvVertConstraintFlag(Bool val) { m_interViewMvVertConstraintFlag = val; } 1187 1205 Bool getInterViewMvVertConstraintFlag() { return m_interViewMvVertConstraintFlag;} 1206 1207 //// sps_extension_vui_parameters( ) 1208 Void setNumIlpRestrictedRefLayers ( Int val ) { m_numIlpRestrictedRefLayers = val;} 1209 Int getNumIlpRestrictedRefLayers ( ) { return m_numIlpRestrictedRefLayers ;} 1210 1211 Void setMinSpatialSegmentOffsetPlus1( Int i, Int val ) { m_minSpatialSegmentOffsetPlus1[ i ] = val;} 1212 Int getMinSpatialSegmentOffsetPlus1( Int i ) { return m_minSpatialSegmentOffsetPlus1[ i ];} 1213 1214 Void setCtuBasedOffsetEnabledFlag ( Int i, Bool flag ) { m_ctuBasedOffsetEnabledFlag [ i ] = flag;} 1215 Bool getCtuBasedOffsetEnabledFlag ( Int i ) { return m_ctuBasedOffsetEnabledFlag [ i ];} 1216 1217 Void setMinHorizontalCtuOffsetPlus1 ( Int i, Int val ) { m_minHorizontalCtuOffsetPlus1 [ i ] = val;} 1218 Int getMinHorizontalCtuOffsetPlus1 ( Int i ) { return m_minHorizontalCtuOffsetPlus1 [ i ];} 1188 1219 #endif 1189 1220 #if H_3D … … 1196 1227 Int* getInvCodedOffset () { return m_aaiCodedOffset[1]; } 1197 1228 #endif 1229 #if H_MV 1230 Int getLayerId () { return m_layerId; } 1231 Void setLayerId ( Int val ) { m_layerId = val; } 1232 #endif 1233 1198 1234 }; 1199 1235 … … 1558 1594 Int m_aaiCodedOffset[2][MAX_NUM_LAYERS]; 1559 1595 #endif 1596 #endif 1597 #if H_MV 1598 // Additional slice header syntax elements 1599 Bool m_discardableFlag; 1600 Bool m_interLayerPredEnabledFlag; 1601 Int m_numInterLayerRefPicsMinus1; 1602 Int m_interLayerPredLayerIdc [MAX_NUM_LAYERS]; 1603 Bool m_interLayerSamplePredOnlyFlag; 1604 Bool m_altCollocatedIndicationFlag; 1605 Int m_collocatedRefLayerIdx; 1606 // Additional slice header semantics variables 1607 Int m_numActiveMotionPredRefLayers; 1608 Int m_activeMotionPredRefLayerId [ MAX_NUM_LAYER_IDS ]; 1609 1560 1610 #endif 1561 1611 public: … … 1829 1879 #endif 1830 1880 #endif 1881 #if H_MV 1882 // Additional slice header syntax elements 1883 Void setDiscardableFlag( Bool flag ) { m_discardableFlag = flag; } 1884 Bool getDiscardableFlag( ) { return m_discardableFlag; } 1885 1886 Void setInterLayerPredEnabledFlag( Bool flag ) { m_interLayerPredEnabledFlag = flag; } 1887 Bool getInterLayerPredEnabledFlag( ) { return m_interLayerPredEnabledFlag; } 1888 1889 Void setNumInterLayerRefPicsMinus1( Int val ) { m_numInterLayerRefPicsMinus1 = val; } 1890 Int getNumInterLayerRefPicsMinus1( ) { return m_numInterLayerRefPicsMinus1; } 1891 1892 Void setInterLayerPredLayerIdc( Int i, Int val ) { m_interLayerPredLayerIdc[i] = val; } 1893 Int getInterLayerPredLayerIdc( Int i ) { return m_interLayerPredLayerIdc[i]; } 1894 1895 Void setInterLayerSamplePredOnlyFlag( Bool flag ) { m_interLayerSamplePredOnlyFlag = flag; } 1896 Bool getInterLayerSamplePredOnlyFlag( ) { return m_interLayerSamplePredOnlyFlag; } 1897 1898 Void setAltCollocatedIndicationFlag( Bool flag ) { m_altCollocatedIndicationFlag = flag; } 1899 Bool getAltCollocatedIndicationFlag( ) { return m_altCollocatedIndicationFlag; } 1900 1901 Void setCollocatedRefLayerIdx( Int val ) { m_collocatedRefLayerIdx = val; } 1902 Int getCollocatedRefLayerIdx( ) { return m_collocatedRefLayerIdx; } 1903 1904 // Additional variables derived in slice header semantics 1905 1906 Int getNumInterLayerRefPicsMinus1Len( ) { return xCeilLog2( getVPS()->getNumDirectRefLayers( getLayerIdInVps() )); } 1907 Int getInterLayerPredLayerIdcLen ( ) { return xCeilLog2( getVPS()->getNumDirectRefLayers( getLayerIdInVps() )); } 1908 1909 Int getNumActiveRefLayerPics( ) 1910 { 1911 Int numActiveRefLayerPics; 1912 1913 if( getLayerId() == 0 || getVPS()->getNumDirectRefLayers( getLayerIdInVps() ) == 0 || !getInterLayerPredEnabledFlag() ) 1914 { 1915 numActiveRefLayerPics = 0; 1916 } 1917 else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumDirectRefLayers( getLayerIdInVps() ) == 1 ) 1918 { 1919 numActiveRefLayerPics = 1; 1920 } 1921 else 1922 { 1923 numActiveRefLayerPics = getNumInterLayerRefPicsMinus1() + 1; 1924 } 1925 return numActiveRefLayerPics; 1926 } 1927 1928 Int getRefPicLayerId( Int i ) 1929 { 1930 return getVPS()->getRefLayerId( getLayerIdInVps(), getInterLayerPredLayerIdc( i ) ); 1931 } 1932 1933 Void setActiveMotionPredRefLayers( ) 1934 { 1935 Int j = 0; 1936 for( Int i = 0; i < getNumActiveRefLayerPics(); i++) 1937 { 1938 if( getVPS()->getMotionPredEnabledFlag( getLayerIdInVps(), getInterLayerPredLayerIdc( i )) ) 1939 { 1940 m_activeMotionPredRefLayerId[ j++ ] = getVPS()->getRefLayerId( getLayerIdInVps(), i ); 1941 } 1942 } 1943 m_numActiveMotionPredRefLayers = j; 1944 1945 // Consider incorporating bitstream conformance tests on derived variables here. 1946 } 1947 1948 Int getActiveMotionPredRefLayerId( Int i ) { return m_activeMotionPredRefLayerId[i]; } 1949 Int getNumActiveMotionPredRefLayers( ) { return m_numActiveMotionPredRefLayers; } 1950 1951 Bool getInterRefEnabledInRPLFlag( ) 1952 { 1953 Bool interRefEnabledInRPLFlag; 1954 if ( getVPS()->getNumSamplePredRefLayers( getLayerIdInVps() ) > 0 && getNumActiveRefLayerPics() > 0 ) 1955 { 1956 interRefEnabledInRPLFlag = !getInterLayerSamplePredOnlyFlag(); 1957 } 1958 else 1959 { 1960 interRefEnabledInRPLFlag = 1; 1961 } 1962 return interRefEnabledInRPLFlag; 1963 } 1964 #endif 1831 1965 protected: 1832 1966 TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, … … 1835 1969 #if H_MV 1836 1970 TComPic* xGetInterLayerRefPic( std::vector<TComPic*>& rcListIlPic, Int layerId ); 1971 Int xCeilLog2( Int val ); 1837 1972 #endif 1838 1973 };// END CLASS DEFINITION TComSlice -
branches/HTM-DEV-0.3-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp
r488 r490 433 433 { 434 434 READ_FLAG( uiCode, "tiles_fixed_structure_flag"); pcVUI->setTilesFixedStructureFlag(uiCode); 435 #if H_MV 436 if ( pcSPS->getLayerId() > 0 ) 437 { 438 READ_FLAG( uiCode, "tile_boundaries_aligned_flag" ); pcVUI->setTileBoundariesAlignedFlag( uiCode == 1 ); 439 } 440 #endif 435 441 READ_FLAG( uiCode, "motion_vectors_over_pic_boundaries_flag"); pcVUI->setMotionVectorsOverPicBoundariesFlag(uiCode); 436 442 READ_FLAG( uiCode, "restricted_ref_pic_lists_flag"); pcVUI->setRestrictedRefPicListsFlag(uiCode); … … 721 727 READ_FLAG( uiCode, "inter_view_mv_vert_constraint_flag" ); pcSPS->setInterViewMvVertConstraintFlag(uiCode == 1 ? true : false); 722 728 READ_FLAG( uiCode, "sps_extension2_flag"); 729 //// sps_extension_vui_parameters( ) 730 if( pcSPS->getVuiParameters()->getBitstreamRestrictionFlag() ) 731 { 732 READ_UVLC( uiCode, "num_ilp_restricted_ref_layers" ); pcSPS->setNumIlpRestrictedRefLayers( uiCode ); 733 for( Int i = 0; i < pcSPS->getNumIlpRestrictedRefLayers( ); i++ ) 734 { 735 READ_UVLC( uiCode, "min_spatial_segment_offset_plus1" ); pcSPS->setMinSpatialSegmentOffsetPlus1( i, uiCode ); 736 if( pcSPS->getMinSpatialSegmentOffsetPlus1( i ) > 0 ) 737 { 738 READ_FLAG( uiCode, "ctu_based_offset_enabled_flag[ i ]"); pcSPS->setCtuBasedOffsetEnabledFlag(i, uiCode == 1 ); 739 if( pcSPS->getCtuBasedOffsetEnabledFlag( i ) ) 740 { 741 READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1[ i ]"); pcSPS->setMinHorizontalCtuOffsetPlus1( i, uiCode ); 742 } 743 } 744 } 745 } 746 747 //// sps_extension_vui_parameters( ) END 748 READ_UVLC( uiCode, "sps_shvc_reserved_zero_idc" ); 749 723 750 if ( uiCode ) 724 751 { … … 869 896 READ_FLAG( uiCode, "avc_base_layer_flag" ); pcVPS->setAvcBaseLayerFlag( uiCode == 1 ? true : false ); 870 897 READ_FLAG( uiCode, "splitting_flag" ); pcVPS->setSplittingFlag( uiCode == 1 ? true : false ); 871 872 // Parse scalability_mask[i] 898 873 899 for( Int sIdx = 0; sIdx < MAX_NUM_SCALABILITY_TYPES; sIdx++ ) 874 900 { … … 876 902 } 877 903 878 Int numScalabilityTypes = pcVPS->getNumScalabilityTypes(); 879 880 // Parse dimension_id_len_minus1[j] 881 for( Int sIdx = 0; sIdx < numScalabilityTypes; sIdx++ ) 904 for( Int sIdx = 0; sIdx < pcVPS->getNumScalabilityTypes( ) - ( pcVPS->getSplittingFlag() ? 1 : 0 ); sIdx++ ) 882 905 { 883 906 READ_CODE( 3, uiCode, "dimension_id_len_minus1[j]" ); pcVPS->setDimensionIdLen( sIdx, uiCode + 1 ); 884 907 } 885 886 // vps_nuh_layer_id_present_flag 908 887 909 READ_FLAG( uiCode, "vps_nuh_layer_id_present_flag" ); pcVPS->setVpsNuhLayerIdPresentFlag( uiCode == 1 ? true : false ); 888 910 889 // parse layer_id_in_nuh[i] and derive LayerIdInVps 890 // already updated to JCT3V-D0220 891 for( Int layer = 0; layer <= pcVPS->getMaxLayers() - 1; layer++ ) 892 { 893 UInt layerIdInNuh; 894 if ( pcVPS->getVpsNuhLayerIdPresentFlag() && ( layer != 0 ) ) 895 { 896 READ_CODE( 6, uiCode, "layer_id_in_nuh[i]" ); layerIdInNuh = uiCode; 911 for( Int i = 0; i <= pcVPS->getMaxLayers() - 1; i++ ) 912 { 913 914 if ( pcVPS->getVpsNuhLayerIdPresentFlag() && ( i > 0 ) ) 915 { 916 READ_CODE( 6, uiCode, "layer_id_in_nuh[i]" ); pcVPS->setLayerIdInNuh( i, uiCode ); 897 917 } 898 918 else 899 919 { 900 layerIdInNuh = layer; 901 } 902 903 pcVPS->setLayerIdInNuh( layer, layerIdInNuh ); 904 pcVPS->setLayerIdInVps( layerIdInNuh, layer ); 905 906 // parse dimension_id[i][j] 907 for( Int sIdx = 0; sIdx < numScalabilityTypes; sIdx++ ) 908 { 909 READ_CODE( pcVPS->getDimensionIdLen( sIdx ), uiCode, "dimension_id[i][j]" ); pcVPS->setDimensionId( layer, sIdx, uiCode ); 910 } 911 } 912 913 for( Int layerSet = 1; layerSet <= pcVPS->getMaxOpSets() - 1; layerSet++ ) 914 { 915 READ_FLAG( uiCode, "vps_profile_present_flag[lsIdx]" ); pcVPS->setVpsProfilePresentFlag( layerSet, uiCode == 1 ? true : false ); 916 if( pcVPS->getVpsProfilePresentFlag( layerSet ) == false ) 917 { 918 READ_UVLC( uiCode, "profile_layer_set_ref_minus1[lsIdx]" ); pcVPS->setProfileLayerSetRefMinus1( layerSet, uiCode ); 919 } 920 921 parsePTL ( pcVPS->getPTL( layerSet ), pcVPS->getVpsProfilePresentFlag( layerSet ), pcVPS->getMaxTLayers()-1); 922 if( pcVPS->getVpsProfilePresentFlag( layerSet ) == false ) 923 { 924 TComPTL temp = *pcVPS->getPTL( layerSet ); 925 *pcVPS->getPTL( layerSet ) = *pcVPS->getPTL( pcVPS->getProfileLayerSetRefMinus1( layerSet ) + 1 ); 926 pcVPS->getPTL( layerSet )->copyLevelFrom( &temp ); 927 } 928 } 929 930 READ_UVLC( uiCode, "num_output_layer_sets" ); pcVPS->setNumOutputLayerSets( uiCode ); 931 932 for( Int layerSet = 0; layerSet < pcVPS->getNumOutputLayerSets(); layerSet++ ) 933 { 934 READ_UVLC( uiCode, "output_layer_set_idx[i]" ); pcVPS->setOutputLayerSetIdxMinus1( layerSet, uiCode ); 935 for( Int layer = 0; layer <= pcVPS->getVpsMaxLayerId(); layer++ ) 936 { 937 if( pcVPS->getLayerIdIncludedFlag( pcVPS->getOutputLayerSetIdxMinus1( layerSet ), layer ) == true ) 938 { 939 // READ_FLAG( uiCode, "output_layer_flag" ); pcVPS->setOutputLayerFlag( layerSet, layer, uiCode == 1 ? true : false ); 920 pcVPS->setLayerIdInNuh( i, i );; 921 } 922 923 pcVPS->setLayerIdInVps( pcVPS->getLayerIdInNuh( i ), i ); 924 925 if ( !pcVPS->getSplittingFlag() ) 926 { 927 for( Int j = 0; j < pcVPS->getNumScalabilityTypes() ; j++ ) 928 { 929 READ_CODE( pcVPS->getDimensionIdLen( j ), uiCode, "dimension_id[i][j]" ); pcVPS->setDimensionId( i, j, uiCode ); 940 930 } 941 931 } … … 949 939 } 950 940 } 951 941 942 for( Int i = 0; i < pcVPS->getMaxLayers() - 1; i++ ) 943 { 944 READ_CODE( 3, uiCode, "max_tid_il_ref_pics_plus1[i]" ); pcVPS->setMaxTidIlRefPicPlus1( i , uiCode ); 945 } 946 947 READ_CODE( 10, uiCode, "vps_number_layer_sets_minus1" ); pcVPS->setVpsNumberLayerSetsMinus1 ( uiCode ); 948 READ_CODE( 6, uiCode, "vps_num_profile_tier_level_minus1" ); pcVPS->setVpsNumProfileTierLevelMinus1( uiCode ); 949 950 for( Int i = 1; i <= pcVPS->getMaxOpSets() - 1; i++ ) 951 { 952 READ_FLAG( uiCode, "vps_profile_present_flag[i]" ); pcVPS->setVpsProfilePresentFlag( i, uiCode == 1 ); 953 if( !pcVPS->getVpsProfilePresentFlag( i ) ) 954 { 955 READ_CODE( 6, uiCode, "profile_ref_minus1[i]" ); pcVPS->setProfileRefMinus1( i, uiCode ); 956 } 957 parsePTL ( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers()-1); 958 if( !pcVPS->getVpsProfilePresentFlag( i ) ) 959 { 960 TComPTL temp = *pcVPS->getPTL( i ); 961 *pcVPS->getPTL( i ) = *pcVPS->getPTL( pcVPS->getProfileRefMinus1( i ) + 1 ); 962 pcVPS->getPTL( i )->copyLevelFrom( &temp ); 963 } 964 } 965 966 Int numOutputLayerSets = pcVPS->getVpsNumberLayerSetsMinus1( ) + 1; 967 968 READ_FLAG( uiCode, "more_output_layer_sets_than_default_flag" ); pcVPS->setMoreOutputLayerSetsThanDefaultFlag( uiCode == 1 ); 969 970 if ( pcVPS->getMoreOutputLayerSetsThanDefaultFlag( ) ) 971 { 972 READ_CODE( 10, uiCode, "num_add_output_layer_sets_minus1" ); pcVPS->setNumAddOutputLayerSetsMinus1( uiCode ); 973 numOutputLayerSets += pcVPS->getNumAddOutputLayerSetsMinus1( ); 974 } 975 976 if( numOutputLayerSets > 1) 977 { 978 READ_FLAG( uiCode, "default_one_target_output_layer_flag" ); pcVPS->setDefaultOneTargetOutputLayerFlag( uiCode == 1); 979 } 980 981 for( Int i = 1; i < numOutputLayerSets; i++ ) 982 { 983 if( i > pcVPS->getVpsNumberLayerSetsMinus1( ) ) 984 { 985 READ_UVLC( uiCode, "output_layer_set_idx_minus1[i]" ); pcVPS->setOutputLayerSetIdxMinus1( i, uiCode ); 986 for( Int j = 0; j <= pcVPS->getNumLayersInIdList( j ); j++ ) 987 { 988 READ_FLAG( uiCode, "output_layer_flag" ); pcVPS->setOutputLayerFlag( i, j, uiCode == 1 ); 989 } 990 READ_CODE( pcVPS->getProfileLevelTierIdxLen(), uiCode,"profile_level_tier_idx[ i ]" ); pcVPS->setProfileLevelTierIdx( i , uiCode ); 991 } 992 } 993 994 READ_FLAG( uiCode , "max_one_active_ref_layer_flag" ); pcVPS->setMaxOneActiveRefLayerFlag( uiCode == 1 ); 995 READ_UVLC( uiCode, "direct_dep_type_len_minus2"); pcVPS->setDirectDepTypeLenMinus2 ( uiCode ); 996 997 for( Int i = 1; i <= pcVPS->getMaxLayers() - 1; i++ ) 998 { 999 for( Int j = 0; j < i; j++ ) 1000 { 1001 READ_CODE( pcVPS->getDirectDepTypeLenMinus2( ) + 2, uiCode, "direct_dependency_type[i][j]" ); pcVPS->setDirectDependencyType( i, j , uiCode); 1002 } 1003 } 1004 1005 READ_FLAG ( uiCode, "vps_shvc_reserved_zero_flag" ); 1006 1007 #if H_3D 952 1008 READ_FLAG( uiCode, "vps_extension2_flag" ); 953 1009 if (uiCode) … … 959 1015 } 960 1016 1017 #endif 1018 961 1019 pcVPS->checkVPSExtensionSyntax(); 962 1020 963 pcVPS-> calcIvRefLayers();1021 pcVPS->setRefLayers(); 964 1022 965 1023 #else … … 1059 1117 if(!rpcSlice->getDependentSliceSegmentFlag()) 1060 1118 { 1061 for (Int i = 0; i < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++) 1119 #if H_MV 1120 if ( rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > 0 ) 1121 { 1122 READ_FLAG( uiCode, "discardable_flag" ); rpcSlice->setDiscardableFlag( uiCode == 1 ); 1123 } 1124 1125 for (Int i = 1; i < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++) 1126 #else 1127 for (Int i = 0; i < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++) 1128 #endif 1062 1129 { 1063 1130 READ_FLAG(uiCode, "slice_reserved_undetermined_flag[]"); // ignored … … 1244 1311 } 1245 1312 } 1313 #if H_MV 1314 Int layerIdInVps = rpcSlice->getLayerIdInVps(); 1315 if( rpcSlice->getLayerId() > 0 && vps->getNumDirectRefLayers( layerIdInVps ) > 0 ) 1316 { 1317 READ_FLAG( uiCode, "inter_layer_pred_enabled_flag" ); rpcSlice->setInterLayerPredEnabledFlag( uiCode == 1 ); 1318 if( rpcSlice->getInterLayerPredEnabledFlag() && vps->getNumDirectRefLayers( layerIdInVps ) > 1 ) 1319 { 1320 if( !vps->getMaxOneActiveRefLayerFlag()) 1321 { 1322 READ_CODE( rpcSlice->getNumInterLayerRefPicsMinus1Len( ), uiCode, "num_inter_layer_ref_pics_minus1" ); rpcSlice->setNumInterLayerRefPicsMinus1( uiCode ); 1323 } 1324 for( Int i = 0; i < rpcSlice->getNumActiveRefLayerPics(); i++ ) 1325 { 1326 READ_CODE( rpcSlice->getInterLayerPredLayerIdcLen( ), uiCode, "inter_layer_pred_layer_idc" ); rpcSlice->setInterLayerPredLayerIdc( i, uiCode ); 1327 } 1328 } 1329 } 1330 1331 rpcSlice->setActiveMotionPredRefLayers( ); 1332 1333 if( vps->getNumSamplePredRefLayers( layerIdInVps ) > 0 && rpcSlice->getNumActiveRefLayerPics() > 0 ) 1334 { 1335 READ_FLAG( uiCode, "inter_layer_sample_pred_only_flag" ); rpcSlice->setInterLayerSamplePredOnlyFlag( uiCode == 1 ); 1336 } 1337 1338 #endif 1246 1339 if(sps->getUseSAO()) 1247 1340 { … … 1384 1477 if ( rpcSlice->getEnableTMVPFlag() ) 1385 1478 { 1479 #if H_MV 1480 if( rpcSlice->getLayerId() > 0 && rpcSlice->getNumActiveMotionPredRefLayers() > 0 ) 1481 { 1482 READ_FLAG( uiCode, "alt_collocated_indication_flag" ); rpcSlice->setAltCollocatedIndicationFlag( uiCode == 1 ); 1483 if( rpcSlice->getAltCollocatedIndicationFlag() && rpcSlice->getNumActiveMotionPredRefLayers() > 1 ) 1484 { 1485 READ_UVLC( uiCode, "collocated_ref_layer_idx" ); rpcSlice->setCollocatedRefLayerIdx( uiCode ); 1486 } 1487 } 1488 else 1489 { 1490 #endif 1386 1491 if ( rpcSlice->getSliceType() == B_SLICE ) 1387 1492 { … … 1405 1510 rpcSlice->setColRefIdx(0); 1406 1511 } 1512 #if H_MV 1513 } 1514 #endif 1407 1515 } 1408 1516 if ( (pps->getUseWP() && rpcSlice->getSliceType()==P_SLICE) || (pps->getWPBiPred() && rpcSlice->getSliceType()==B_SLICE) ) -
branches/HTM-DEV-0.3-dev0/source/Lib/TLibDecoder/TDecTop.cpp
r446 r490 1002 1002 { 1003 1003 TComSPS* sps = new TComSPS(); 1004 #if H_MV 1005 sps->setLayerId( getLayerId() ); 1006 #endif 1004 1007 #if H_3D 1005 // Preliminary fix. assuming that all sps refer to the same SPS.1008 // Preliminary fix. assuming that all sps refer to the same VPS. 1006 1009 // Parsing dependency should be resolved! 1007 1010 TComVPS* vps = m_parameterSetManagerDecoder.getPrefetchedVPS( 0 ); -
branches/HTM-DEV-0.3-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp
r488 r490 329 329 { 330 330 WRITE_FLAG(pcVUI->getTilesFixedStructureFlag(), "tiles_fixed_structure_flag"); 331 #if H_MV 332 if ( pcSPS->getLayerId() > 0 ) 333 { 334 WRITE_FLAG( pcVUI->getTileBoundariesAlignedFlag( ) ? 1 : 0 , "tile_boundaries_aligned_flag" ); 335 } 336 #endif 331 337 WRITE_FLAG(pcVUI->getMotionVectorsOverPicBoundariesFlag(), "motion_vectors_over_pic_boundaries_flag"); 332 338 WRITE_FLAG(pcVUI->getRestrictedRefPicListsFlag(), "restricted_ref_pic_lists_flag"); … … 556 562 WRITE_FLAG( 1, "sps_extension_flag" ); 557 563 WRITE_FLAG( pcSPS->getInterViewMvVertConstraintFlag() ? 1 : 0, "inter_view_mv_vert_constraint_flag" ); 564 //// sps_extension_vui_parameters( ) 565 if( pcSPS->getVuiParameters()->getBitstreamRestrictionFlag() ) 566 { 567 WRITE_UVLC( pcSPS->getNumIlpRestrictedRefLayers( ), "num_ilp_restricted_ref_layers" ); 568 for( Int i = 0; i < pcSPS->getNumIlpRestrictedRefLayers( ); i++ ) 569 { 570 WRITE_UVLC( pcSPS->getMinSpatialSegmentOffsetPlus1( i ), "min_spatial_segment_offset_plus1" ); 571 if( pcSPS->getMinSpatialSegmentOffsetPlus1( i ) > 0 ) 572 { 573 WRITE_FLAG( pcSPS->getCtuBasedOffsetEnabledFlag( i ), "ctu_based_offset_enabled_flag[ i ]"); 574 if( pcSPS->getCtuBasedOffsetEnabledFlag( i ) ) 575 { 576 WRITE_UVLC( pcSPS->getMinHorizontalCtuOffsetPlus1( i ), "min_horizontal_ctu_offset_plus1[ i ]"); 577 } 578 } 579 } 580 } 581 //// sps_extension_vui_parameters( ) END 582 WRITE_UVLC( 0, "sps_shvc_reserved_zero_idc" ); 558 583 #if !H_3D 559 584 WRITE_FLAG( 0, "sps_extension2_flag" ); … … 700 725 701 726 for( Int i = 0; i <= pcVPS->getMaxLayers() - 1; i++ ) 702 { 727 { 703 728 if ( pcVPS->getVpsNuhLayerIdPresentFlag() && ( i > 0 ) ) 704 729 { 705 730 WRITE_CODE( pcVPS->getLayerIdInNuh( i ), 6, "layer_id_in_nuh[i]"); 706 731 } 707 732 else 733 { 734 assert( pcVPS->getLayerIdInNuh( i ) == i ); 735 } 736 737 assert( pcVPS->getLayerIdInVps( pcVPS->getLayerIdInNuh( i ) ) == i ); 738 708 739 if ( !pcVPS->getSplittingFlag() ) 709 740 { … … 738 769 WRITE_CODE( pcVPS->getProfileRefMinus1( i ), 6, "profile_ref_minus1[i]" ); 739 770 } 740 741 771 codePTL( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers() - 1 ); 742 772 } 743 773 744 Int numOutputLayerSets = pcVPS->get NumOutputLayerSets();745 746 WRITE_FLAG( pcVPS->get VpsMoreOutputLayerSetsThanDefaultFlag( ) ? 1 : 0, "more_output_layer_sets_than_default_flag" );747 748 if ( pcVPS->get VpsMoreOutputLayerSetsThanDefaultFlag( ) )774 Int numOutputLayerSets = pcVPS->getVpsNumberLayerSetsMinus1( ) + 1; 775 776 WRITE_FLAG( pcVPS->getMoreOutputLayerSetsThanDefaultFlag( ) ? 1 : 0, "more_output_layer_sets_than_default_flag" ); 777 778 if ( pcVPS->getMoreOutputLayerSetsThanDefaultFlag( ) ) 749 779 { 750 780 WRITE_CODE( pcVPS->getNumAddOutputLayerSetsMinus1( ) , 10, "num_add_output_layer_sets_minus1" ); … … 760 790 { 761 791 if( i > pcVPS->getVpsNumberLayerSetsMinus1( ) ) 762 { 763 Int lsIdx = pcVPS->getOutputLayerSetIdxMinus1( i ) + 1; 764 WRITE_UVLC( lsIdx, "output_layer_set_idx[i]" ); 765 792 { 793 WRITE_UVLC( pcVPS->getOutputLayerSetIdxMinus1( i ), "output_layer_set_idx_minus1[i]" ); 766 794 for( Int j = 0; j <= pcVPS->getNumLayersInIdList( j ); j++ ) 767 795 { 768 //WRITE_FLAG( pcVPS->getOutputLayerFlag( i, j) ? 1 : 0, "output_layer_flag" ); 769 } 770 796 WRITE_FLAG( pcVPS->getOutputLayerFlag( i, j) ? 1 : 0, "output_layer_flag" ); 797 } 771 798 WRITE_CODE( pcVPS->getProfileLevelTierIdx( i ), pcVPS->getProfileLevelTierIdxLen() ,"profile_level_tier_idx[ i ]" ); 772 799 } … … 799 826 Void TEncCavlc::codeSliceHeader ( TComSlice* pcSlice ) 800 827 { 828 #if H_MV 829 TComVPS* vps = pcSlice->getVPS(); 830 #endif 801 831 #if ENC_DEC_TRACE 802 832 xTraceSliceHeader (pcSlice); … … 841 871 if ( !pcSlice->getDependentSliceSegmentFlag() ) 842 872 { 873 #if H_MV 874 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 0 ) 875 { 876 WRITE_FLAG( pcSlice->getDiscardableFlag( ) ? 1 : 0 , "discardable_flag" ); 877 } 878 879 for (Int i = 1; i < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++) 880 #else 843 881 for (Int i = 0; i < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++) 882 #endif 844 883 { 845 884 assert(!!"slice_reserved_undetermined_flag[]"); … … 994 1033 } 995 1034 } 1035 #if H_MV 1036 Int layerIdInVps = pcSlice->getLayerIdInVps(); 1037 if( pcSlice->getLayerId() > 0 && vps->getNumDirectRefLayers( layerIdInVps ) > 0 ) 1038 { 1039 WRITE_FLAG( pcSlice->getInterLayerPredEnabledFlag( ) ? 1 : 0 , "inter_layer_pred_enabled_flag" ); 1040 if( pcSlice->getInterLayerPredEnabledFlag() && vps->getNumDirectRefLayers( layerIdInVps ) > 1 ) 1041 { 1042 if( !vps->getMaxOneActiveRefLayerFlag()) 1043 { 1044 WRITE_CODE( pcSlice->getNumInterLayerRefPicsMinus1( ), pcSlice->getNumInterLayerRefPicsMinus1Len( ), "num_inter_layer_ref_pics_minus1" ); 1045 } 1046 for( Int i = 0; i < pcSlice->getNumActiveRefLayerPics(); i++ ) 1047 { 1048 WRITE_CODE( pcSlice->getInterLayerPredLayerIdc( i ), pcSlice->getInterLayerPredLayerIdcLen( ), "inter_layer_pred_layer_idc" ); 1049 } 1050 } 1051 } 1052 1053 pcSlice->setActiveMotionPredRefLayers( ); 1054 1055 if( vps->getNumSamplePredRefLayers( layerIdInVps ) > 0 && pcSlice->getNumActiveRefLayerPics() > 0 ) 1056 { 1057 WRITE_FLAG( pcSlice->getInterLayerSamplePredOnlyFlag( ) ? 1 : 0 , "inter_layer_sample_pred_only_flag" ); 1058 } 1059 1060 #endif 996 1061 if(pcSlice->getSPS()->getUseSAO()) 997 1062 { … … 1101 1166 if ( pcSlice->getEnableTMVPFlag() ) 1102 1167 { 1168 #if H_MV 1169 if( pcSlice->getLayerId() > 0 && pcSlice->getNumActiveMotionPredRefLayers() > 0 ) 1170 { 1171 WRITE_FLAG( pcSlice->getAltCollocatedIndicationFlag( ) ? 1 : 0 , "alt_collocated_indication_flag" ); 1172 1173 if( pcSlice->getAltCollocatedIndicationFlag() && pcSlice->getNumActiveMotionPredRefLayers() > 1 ) 1174 { 1175 WRITE_UVLC( pcSlice->getCollocatedRefLayerIdx( ), "collocated_ref_layer_idx" ); 1176 } 1177 } 1178 else 1179 { 1180 #endif 1181 1103 1182 if ( pcSlice->getSliceType() == B_SLICE ) 1104 1183 { … … 1113 1192 } 1114 1193 } 1194 #if H_MV 1195 } 1196 #endif 1115 1197 if ( (pcSlice->getPPS()->getUseWP() && pcSlice->getSliceType()==P_SLICE) || (pcSlice->getPPS()->getWPBiPred() && pcSlice->getSliceType()==B_SLICE) ) 1116 1198 { -
branches/HTM-DEV-0.3-dev0/source/Lib/TLibEncoder/TEncTop.cpp
r446 r490 512 512 { 513 513 #if H_MV 514 m_cSPS.setSPSId( getLayerIdInVps() ); 514 m_cSPS.setSPSId ( getLayerIdInVps() ); 515 m_cSPS.setLayerId( getLayerId() ); 515 516 #endif 516 517 ProfileTierLevel& profileTierLevel = *m_cSPS.getPTL()->getGeneralPTL();
Note: See TracChangeset for help on using the changeset viewer.