Changeset 1063 in 3DVCSoftware for branches/HTM-12.0-dev1/source
- Timestamp:
- 9 Oct 2014, 12:35:18 (10 years ago)
- Location:
- branches/HTM-12.0-dev1/source
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-12.0-dev1/source/App/TAppDecoder/TAppDecTop.cpp
r1060 r1063 1155 1155 Int curLayerId = m_tDecTop[dIdx]->getLayerId(); 1156 1156 Int curLayerIdxInVps = m_vps->getLayerIdInNuh( curLayerId ); 1157 #if H_MV_HLS10_REF_PRED_LAYERS 1158 if ( m_vps->getDependencyFlag(optLayerIdxInVps, curLayerIdxInVps ) ) 1159 #else 1157 1160 if ( m_vps->getInDirectDependencyFlag(optLayerIdxInVps, curLayerIdxInVps ) ) 1161 #endif 1158 1162 { 1159 1163 TComPic* curPic = m_ivPicLists.getPic( curLayerId, pocLastPic ); -
branches/HTM-12.0-dev1/source/App/TAppEncoder/TAppEncTop.cpp
r1060 r1063 1591 1591 } 1592 1592 1593 #if H_MV_HLS10_PTL 1594 Void TAppEncTop::xSetProfileTierLevel(TComVPS& vps, Int profileTierLevelIdx, Int subLayer, Profile::Name profile, Level::Name level, Level::Tier tier, Bool progressiveSourceFlag, Bool interlacedSourceFlag, Bool nonPackedConstraintFlag, Bool frameOnlyConstraintFlag, Bool inbldFlag) 1595 { 1596 TComPTL* ptlStruct = vps.getPTL( profileTierLevelIdx ); 1597 assert( ptlStruct != NULL ); 1598 1599 ProfileTierLevel* ptl; 1600 if ( subLayer == -1 ) 1601 { 1602 ptl = ptlStruct->getGeneralPTL(); 1603 } 1604 else 1605 { 1606 ptl = ptlStruct->getSubLayerPTL( subLayer ); 1607 } 1608 1609 assert( ptl != NULL ); 1610 1611 1612 ptl->setProfileIdc( profile ); 1613 ptl->setTierFlag ( tier ); 1614 ptl->setLevelIdc ( level ); 1615 ptl->setProfileCompatibilityFlag( profile, true ); 1616 1617 switch ( profile ) 1618 { 1619 case Profile::MAIN: 1620 break; 1621 case Profile::MULTIVIEWMAIN: 1622 #if H_3D 1623 case Profile::MAIN3D: 1624 #endif 1625 ptl->setMax12bitConstraintFlag ( true ); 1626 ptl->setMax12bitConstraintFlag ( true ); 1627 ptl->setMax10bitConstraintFlag ( true ); 1628 ptl->setMax8bitConstraintFlag ( true ); 1629 ptl->setMax422chromaConstraintFlag ( true ); 1630 ptl->setMax420chromaConstraintFlag ( true ); 1631 ptl->setMaxMonochromeConstraintFlag ( false ); 1632 ptl->setIntraConstraintFlag ( false ); 1633 ptl->setOnePictureOnlyConstraintFlag( false ); 1634 ptl->setLowerBitRateConstraintFlag ( true ); 1635 break; 1636 default: 1637 assert( 0 ); // other profiles currently not supported 1638 break; 1639 } 1640 } 1641 #endif 1593 1642 1594 1643 Void TAppEncTop::xSetRepFormat( TComVPS& vps ) … … 2072 2121 } 2073 2122 } 2074 #endif 2123 #if H_MV_HLS10_GEN_FIX 2124 Bool TAppEncTop::xLayerIdInTargetEncLayerIdList(Int nuhLayerId) 2125 { 2126 return ( std::find(m_targetEncLayerIdList.begin(), m_targetEncLayerIdList.end(), nuhLayerId) != m_targetEncLayerIdList.end()) ; 2127 } 2128 #endif 2129 2130 2131 #endif 2132 2133 2075 2134 #if H_3D 2076 2135 Void TAppEncTop::xSetVPSExtension2( TComVPS& vps ) -
branches/HTM-12.0-dev1/source/App/TAppEncoder/TAppEncTop.h
r1054 r1063 138 138 Bool progressiveSourceFlag, Bool interlacedSourceFlag, 139 139 Bool nonPackedConstraintFlag, Bool frameOnlyConstraintFlag, 140 Bool inbldFlag ) 141 { 142 TComPTL* ptlStruct = vps.getPTL( profileTierLevelIdx ); 143 assert( ptlStruct != NULL ); 144 145 ProfileTierLevel* ptl; 146 if ( subLayer == -1 ) 147 { 148 ptl = ptlStruct->getGeneralPTL(); 149 } 150 else 151 { 152 ptl = ptlStruct->getSubLayerPTL( subLayer ); 153 } 154 155 assert( ptl != NULL ); 156 157 158 ptl->setProfileIdc( profile ); 159 ptl->setTierFlag ( tier ); 160 ptl->setLevelIdc ( level ); 161 ptl->setProfileCompatibilityFlag( profile, true ); 162 163 switch ( profile ) 164 { 165 case Profile::MAIN: 166 break; 167 case Profile::MULTIVIEWMAIN: 168 #if H_3D 169 case Profile::MAIN3D: 170 #endif 171 ptl->setMax12bitConstraintFlag ( true ); 172 ptl->setMax12bitConstraintFlag ( true ); 173 ptl->setMax10bitConstraintFlag ( true ); 174 ptl->setMax8bitConstraintFlag ( true ); 175 ptl->setMax422chromaConstraintFlag ( true ); 176 ptl->setMax420chromaConstraintFlag ( true ); 177 ptl->setMaxMonochromeConstraintFlag ( false ); 178 ptl->setIntraConstraintFlag ( false ); 179 ptl->setOnePictureOnlyConstraintFlag( false ); 180 ptl->setLowerBitRateConstraintFlag ( true ); 181 break; 182 default: 183 assert( 0 ); // other profiles currently not supported 184 break; 185 } 186 } 187 188 140 Bool inbldFlag ); 189 141 #endif 190 142 Void xSetRepFormat ( TComVPS& vps ); … … 194 146 Int xGetMax( std::vector<Int>& vec); 195 147 #if H_MV_HLS10_GEN_FIX 196 Bool xLayerIdInTargetEncLayerIdList( Int nuhLayerId ) 197 { 198 return ( std::find(m_targetEncLayerIdList.begin(), m_targetEncLayerIdList.end(), nuhLayerId) != m_targetEncLayerIdList.end()) ; 199 } 148 Bool xLayerIdInTargetEncLayerIdList( Int nuhLayerId ); 200 149 #endif 201 150 #endif -
branches/HTM-12.0-dev1/source/Lib/TLibCommon/TComSlice.cpp
r1062 r1063 2449 2449 } 2450 2450 2451 #if !H_MV_HLS10_REF_PRED_LAYERS 2451 2452 Bool TComVPS::getInDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Int depth /*= 0 */ ) 2452 2453 { … … 2468 2469 #endif 2469 2470 } 2471 #endif 2470 2472 2471 2473 Void TComVPS::deriveLayerSetLayerIdList() … … 2623 2625 } 2624 2626 } 2625 #endif 2627 2628 #endif 2629 2630 #if H_MV_HLS10_PTL_FIX 2631 Int TComVPS::inferProfileTierLevelIdx(Int i, Int j) 2632 { 2633 Bool inferZero = ( i == 0 && j == 0 && getVpsBaseLayerInternalFlag() ); 2634 Bool inferGreaterZero = getNecessaryLayerFlag(i,j) && ( getVpsNumProfileTierLevelMinus1() == 0 ); 2635 assert( inferZero || inferGreaterZero ); 2636 2637 Bool ptlIdx = 0; // inference for greaterZero 2638 if ( inferZero ) 2639 { 2640 ptlIdx = getMaxLayersMinus1() > 0 ? 1 : 0; 2641 if ( inferGreaterZero ) 2642 { 2643 assert( ptlIdx == 0 ); 2644 // This should never happen since : 2645 // When vps_max_layers_minus1 is greater than 0, the value of vps_num_profile_tier_level_minus1 shall be greater than or equal to 1. 2646 } 2647 } 2648 return ptlIdx; 2649 } 2650 #endif 2651 2652 #if H_MV_HLS10_ADD_LAYERSETS 2653 Void TComVPS::deriveAddLayerSetLayerIdList(Int i) 2654 { 2655 assert( m_layerSetLayerIdList.size() == ( getVpsNumLayerSetsMinus1() + 1 + i ) ); 2656 std::vector<Int> layerSetLayerIdList; 2657 2658 for( Int treeIdx = 1; treeIdx < getNumIndependentLayers(); treeIdx++ ) 2659 { 2660 // The value of highest_layer_idx_plus1[ i ][ j ] shall be in the range of 0 to NumLayersInTreePartition[ j ], inclusive. 2661 assert( getHighestLayerIdxPlus1( i, treeIdx ) >= 0 && getHighestLayerIdxPlus1( i, treeIdx ) <= getNumLayersInTreePartition( treeIdx ) ); 2662 2663 for( Int layerCnt = 0; layerCnt < getHighestLayerIdxPlus1( i, treeIdx ); layerCnt++ ) 2664 { 2665 layerSetLayerIdList.push_back( getTreePartitionLayerIdList( treeIdx, layerCnt ) ); 2666 } 2667 } 2668 m_layerSetLayerIdList.push_back( layerSetLayerIdList ); 2669 2670 //It is a requirement of bitstream conformance that 2671 //NumLayersInIdList[ vps_num_layer_sets_minus1 + 1 + i ] shall be greater than 0. 2672 assert( getNumLayersInIdList( getVpsNumLayerSetsMinus1() + 1 + i ) > 0 ); 2673 } 2674 2675 #endif 2676 2677 #if H_MV_HLS10_NESSECARY_LAYER 2678 Void TComVPS::deriveNecessaryLayerFlags(Int olsIdx) 2679 { 2680 AOF( olsIdx >= 0 && olsIdx < getNumOutputLayerSets() ); 2681 Int lsIdx = olsIdxToLsIdx( olsIdx ); 2682 for( Int lsLayerIdx = 0; lsLayerIdx < getNumLayersInIdList( lsIdx) ; lsLayerIdx++ ) 2683 { 2684 m_necessaryLayerFlag[ olsIdx ][ lsLayerIdx ] = 0; 2685 } 2686 for( Int lsLayerIdx = 0; lsLayerIdx < getNumLayersInIdList( lsIdx ); lsLayerIdx++ ) 2687 { 2688 if( getOutputLayerFlag( olsIdx, lsLayerIdx )) 2689 { 2690 m_necessaryLayerFlag[ olsIdx ][ lsLayerIdx ] = 1; 2691 Int currLayerId = getLayerSetLayerIdList( lsIdx, lsLayerIdx ); 2692 for( Int rLsLayerIdx = 0; rLsLayerIdx < lsLayerIdx; rLsLayerIdx++ ) 2693 { 2694 Int refLayerId = getLayerSetLayerIdList( lsIdx, rLsLayerIdx ); 2695 if( getDependencyFlag( getLayerIdInVps( currLayerId ), getLayerIdInVps( refLayerId ) ) ) 2696 { 2697 m_necessaryLayerFlag[ olsIdx ][ rLsLayerIdx ] = 1; 2698 } 2699 } 2700 } 2701 } 2702 m_numNecessaryLayers[ olsIdx ] = 0; 2703 for( Int lsLayerIdx = 0; lsLayerIdx < getNumLayersInIdList( lsIdx ); lsLayerIdx++ ) 2704 { 2705 m_numNecessaryLayers[ olsIdx ] += m_necessaryLayerFlag[ olsIdx ][ lsLayerIdx ]; 2706 } 2707 } 2708 #endif 2709 2710 #if H_MV_HLS10_ADD_LAYERSETS 2711 Void TComVPS::printPTL() 2712 { 2713 std::vector<Int> idx; 2714 std::vector<Int> num; 2715 std::vector< std::vector<Int> > ptlInfo; 2716 2717 std::cout << std::right << std::setw(60) << std::setfill('-') << " " << std::setfill(' ') << std::endl << "PTLI" << std::endl; 2718 2719 for ( Int i = 0; i <= getVpsNumProfileTierLevelMinus1(); i++ ) 2720 { 2721 std::vector<Int> curPtlInfo; 2722 ProfileTierLevel* ptl = getPTL( i )->getGeneralPTL(); 2723 curPtlInfo.push_back( (Int) ptl->getProfileIdc() ); 2724 curPtlInfo.push_back( (Int) ptl->getTierFlag() ); 2725 curPtlInfo.push_back( (Int) ptl->getLevelIdc() ); 2726 curPtlInfo.push_back( (Int) ptl->getInbldFlag() ); 2727 2728 idx.push_back ( i ); 2729 num.push_back ( 4 ); 2730 ptlInfo.push_back( curPtlInfo ); 2731 } 2732 2733 xPrintArray( "VpsProfileTierLevel", getVpsNumProfileTierLevelMinus1() + 1, idx, num, ptlInfo, false ); 2734 2735 num.clear(); 2736 idx.clear(); 2737 for (Int i = 0; i < getNumOutputLayerSets(); i++) 2738 { 2739 num.push_back ( getNumLayersInIdList( olsIdxToLsIdx( i )) ); 2740 idx.push_back( i ); 2741 } 2742 2743 xPrintArray( "profile_tier_level_idx", getNumOutputLayerSets(), idx, num, m_profileTierLevelIdx, true ); 2744 std::cout << std::endl; 2745 } 2746 2747 Void TComVPS::printLayerDependencies() 2748 { 2749 vector<Int> fullArray; 2750 vector<Int> range; 2751 2752 #if H_3D 2753 vector<Int> depthId; 2754 #endif 2755 2756 #if H_MV_HLS10_AUX 2757 vector<Int> viewOrderIndex; 2758 vector<Int> auxId; 2759 vector<Int> dependencyId; 2760 vector<Int> viewId; 2761 #endif 2762 for (Int i = 0; i <= getMaxLayersMinus1(); i++ ) 2763 { 2764 fullArray.push_back( getMaxLayersMinus1() + 1 ); 2765 range.push_back( i ); 2766 #if H_MV_HLS10_AUX 2767 viewOrderIndex.push_back( getViewIndex ( i ) ); 2768 dependencyId .push_back( getDependencyId( i ) ); 2769 auxId .push_back( getAuxId ( i ) ); 2770 viewId .push_back( getViewId ( getLayerIdInNuh( i ) ) ); 2771 #if H_3D 2772 depthId.push_back( getDepthId( i ) ); 2773 #endif 2774 #endif 2775 } 2776 std::cout << std::right << std::setw(60) << std::setfill('-') << " " << std::setfill(' ') << std::endl << "Layer Dependencies" << std::endl; 2777 xPrintArray( "direct_dependency_flag", getMaxLayersMinus1()+1, range, fullArray, m_directDependencyFlag, false ); 2778 xPrintArray( "DependencyFlag", getMaxLayersMinus1()+1, range, fullArray, m_dependencyFlag, false ); 2779 xPrintArray( "layer_id_in_nuh", getMaxLayersMinus1()+1, m_layerIdInNuh, true ); 2780 xPrintArray( "IdPredictedLayer", getMaxLayersMinus1() + 1, m_layerIdInNuh, m_numPredictedLayers, m_idPredictedLayer, true ); 2781 xPrintArray( "IdRefLayer" , getMaxLayersMinus1() + 1, m_layerIdInNuh, m_numRefLayers, m_idRefLayer, true ); 2782 xPrintArray( "IdDirectRefLayer", getMaxLayersMinus1() + 1, m_layerIdInNuh, m_numDirectRefLayers, m_idDirectRefLayer, true ); 2783 std::cout << std::endl; 2784 } 2785 2786 #if H_MV_HLS10_AUX 2787 Void TComVPS::printScalabilityId() 2788 { 2789 vector<Int> layerIdxInVps; 2790 2791 #if H_3D 2792 vector<Int> depthId; 2793 #endif 2794 2795 vector<Int> viewOrderIndex; 2796 vector<Int> auxId; 2797 vector<Int> dependencyId; 2798 vector<Int> viewId; 2799 2800 for (Int i = 0; i <= getMaxLayersMinus1(); i++ ) 2801 { 2802 Int layerIdInNuh = getLayerIdInNuh( i ); 2803 layerIdxInVps .push_back( i ); 2804 viewOrderIndex.push_back( getViewIndex ( layerIdInNuh ) ); 2805 dependencyId .push_back( getDependencyId( layerIdInNuh ) ); 2806 auxId .push_back( getAuxId ( layerIdInNuh ) ); 2807 viewId .push_back( getViewId ( layerIdInNuh ) ); 2808 #if H_3D 2809 depthId .push_back( getDepthId ( layerIdInNuh ) ); 2810 #endif 2811 } 2812 2813 std::cout << std::right << std::setw(60) << std::setfill('-') << " " << std::setfill(' ') << std::endl << "Scalability Ids" << std::endl; 2814 xPrintArray( "layerIdxInVps" , getMaxLayersMinus1()+1, layerIdxInVps, false ); 2815 xPrintArray( "layer_id_in_nuh", getMaxLayersMinus1()+1, m_layerIdInNuh, false ); 2816 2817 xPrintArray( "ViewOrderIndex", getMaxLayersMinus1()+1, viewOrderIndex, false ); 2818 xPrintArray( "DependencyId" , getMaxLayersMinus1()+1, dependencyId , false ); 2819 xPrintArray( "AuxId" , getMaxLayersMinus1()+1, auxId , false ); 2820 xPrintArray( "ViewId" , getMaxLayersMinus1()+1, viewId , false ); 2821 2822 std::cout << std::endl; 2823 } 2824 #endif 2825 2826 Void TComVPS::printLayerSets() 2827 { 2828 vector<Int> fullArray; 2829 vector<Int> numLayersInIdList; 2830 vector<Int> rangeLayerSets; 2831 2832 2833 for (Int i = 0; i < getNumLayerSets(); i++ ) 2834 { 2835 numLayersInIdList.push_back( getNumLayersInIdList( i ) ); 2836 rangeLayerSets.push_back( i ); 2837 } 2838 2839 vector<Int> rangeOutputLayerSets; 2840 vector<Int> numOutputLayersInOutputLayerSet; 2841 vector<Int> numDecLayer; 2842 vector<Int> numLayersInLayerSetForOutputLayerSet; 2843 vector<Int> vOlsIdxToLsIdx; 2844 for (Int i = 0; i < getNumOutputLayerSets(); i++ ) 2845 { 2846 vOlsIdxToLsIdx.push_back( olsIdxToLsIdx(i)); 2847 numOutputLayersInOutputLayerSet.push_back( getNumOutputLayersInOutputLayerSet( i ) ); 2848 numDecLayer.push_back( (Int) m_targetDecLayerIdLists[ i ].size() ); 2849 rangeOutputLayerSets.push_back( i ); 2850 numLayersInLayerSetForOutputLayerSet.push_back( getNumLayersInIdList( olsIdxToLsIdx( i ) ) ); 2851 } 2852 2853 vector<Int> rangeIndependentLayers; 2854 for(Int i = 0; i < getNumIndependentLayers(); i++ ) 2855 { 2856 rangeIndependentLayers.push_back( i ); 2857 } 2858 2859 vector<Int> rangeAddLayerSets; 2860 vector<Int> numHighestLayerIdxPlus1; 2861 for(Int i = 0; i < getNumAddLayerSets(); i++ ) 2862 { 2863 rangeAddLayerSets.push_back( i ); 2864 numHighestLayerIdxPlus1.push_back( getNumIndependentLayers() ); 2865 } 2866 2867 std::cout << std::right << std::setw(60) << std::setfill('-') << " " << std::setfill(' ') << std::endl << "Layer Sets" << std::endl; 2868 xPrintArray( "TreePartitionLayerIdList", getNumIndependentLayers(), rangeIndependentLayers, m_numLayersInTreePartition, m_treePartitionLayerIdList, true ); 2869 xPrintArray( "highest_layer_idx_plus1", getNumAddLayerSets(), rangeAddLayerSets, numHighestLayerIdxPlus1, m_highestLayerIdxPlus1, true ); 2870 xPrintArray( "LayerSetLayerIdList" , (Int) getNumLayerSets() , rangeLayerSets , numLayersInIdList, m_layerSetLayerIdList, true ); 2871 xPrintArray( "OlsIdxToLsIdx", (Int) vOlsIdxToLsIdx.size(), vOlsIdxToLsIdx, true ); 2872 xPrintArray( "OutputLayerFlag" , getNumOutputLayerSets(), rangeOutputLayerSets, numLayersInLayerSetForOutputLayerSet, m_outputLayerFlag, true ); 2873 xPrintArray( "TargetOptLayerIdList", getNumOutputLayerSets(), rangeOutputLayerSets, numOutputLayersInOutputLayerSet, m_targetOptLayerIdLists, true ); 2874 xPrintArray( "NecessaryLayerFlag" , getNumOutputLayerSets(), rangeOutputLayerSets, numLayersInLayerSetForOutputLayerSet, m_necessaryLayerFlag , true ); 2875 xPrintArray( "TargetDecLayerIdList", getNumOutputLayerSets(), rangeOutputLayerSets, numDecLayer, m_targetDecLayerIdLists, true ); 2876 std::cout << endl; 2877 } 2878 2879 #endif 2880 2626 2881 #endif // H_MV 2627 2882 … … 3238 3493 } 3239 3494 3495 #if H_MV_HLS10_MULTILAYERSPS 3496 Void TComSPS::inferSpsMaxSubLayersMinus1(Bool atPsActivation, TComVPS* vps) 3497 { 3498 assert( getLayerId() != 0 ); 3499 if ( !atPsActivation ) 3500 { 3501 assert( vps == NULL ); 3502 if (getSpsExtOrMaxSubLayersMinus1() != 7) 3503 { 3504 setSpsMaxSubLayersMinus1( getSpsExtOrMaxSubLayersMinus1() ); 3505 } 3506 } 3507 else 3508 { 3509 assert( vps != NULL ); 3510 if (getSpsExtOrMaxSubLayersMinus1() == 7) 3511 { 3512 setSpsMaxSubLayersMinus1( vps->getMaxSubLayersMinus1() ); 3513 } 3514 } 3515 } 3516 #endif 3240 3517 #endif 3241 3518 … … 4432 4709 } 4433 4710 4711 #if H_MV_HLS10_PTL_INFER_FIX 4712 Bool ProfileTierLevel::getV2ConstraintsPresentFlag() 4713 { 4714 return ( 4715 getProfileIdc( ) == 4 || getProfileCompatibilityFlag( 4 ) || getProfileIdc( ) == 5 || getProfileCompatibilityFlag( 5 ) || 4716 getProfileIdc( ) == 6 || getProfileCompatibilityFlag( 6 ) || getProfileIdc( ) == 7 || getProfileCompatibilityFlag( 7 ) 4717 ); 4718 } 4719 4720 Bool ProfileTierLevel::getInbldPresentFlag() 4721 { 4722 return ( 4723 ( getProfileIdc() >= 1 && getProfileIdc() <= 5 ) || getProfileCompatibilityFlag( 1 ) || getProfileCompatibilityFlag( 2 ) || 4724 getProfileCompatibilityFlag( 3 ) || getProfileCompatibilityFlag( 4 ) || getProfileCompatibilityFlag( 5 ) 4725 ); 4726 } 4727 4728 Void ProfileTierLevel::copyV2ConstraintFlags(ProfileTierLevel* ptlRef) 4729 { 4730 setMax12bitConstraintFlag ( ptlRef->getMax12bitConstraintFlag ( ) ); 4731 setMax10bitConstraintFlag ( ptlRef->getMax10bitConstraintFlag ( ) ); 4732 setMax8bitConstraintFlag ( ptlRef->getMax8bitConstraintFlag ( ) ); 4733 setMax422chromaConstraintFlag ( ptlRef->getMax422chromaConstraintFlag ( ) ); 4734 setMax420chromaConstraintFlag ( ptlRef->getMax420chromaConstraintFlag ( ) ); 4735 setMaxMonochromeConstraintFlag ( ptlRef->getMaxMonochromeConstraintFlag ( ) ); 4736 setIntraConstraintFlag ( ptlRef->getIntraConstraintFlag ( ) ); 4737 setOnePictureOnlyConstraintFlag ( ptlRef->getOnePictureOnlyConstraintFlag ( ) ); 4738 setLowerBitRateConstraintFlag ( ptlRef->getLowerBitRateConstraintFlag ( ) ); 4739 } 4740 4741 Void ProfileTierLevel::copyProfile(ProfileTierLevel* ptlRef) 4742 { 4743 setProfileSpace ( ptlRef->getProfileSpace ( ) ); 4744 setTierFlag ( ptlRef->getTierFlag ( ) ); 4745 setProfileIdc ( ptlRef->getProfileIdc ( ) ); 4746 for (Int j = 0; j < 32; j++) 4747 { 4748 setProfileCompatibilityFlag(j, ptlRef->getProfileCompatibilityFlag ( j ) ); 4749 } 4750 setProgressiveSourceFlag ( ptlRef->getProgressiveSourceFlag ( ) ); 4751 setInterlacedSourceFlag ( ptlRef->getInterlacedSourceFlag ( ) ); 4752 setNonPackedConstraintFlag ( ptlRef->getNonPackedConstraintFlag ( ) ); 4753 setFrameOnlyConstraintFlag ( ptlRef->getFrameOnlyConstraintFlag ( ) ); 4754 copyV2ConstraintFlags ( ptlRef ); 4755 } 4756 4757 #endif 4758 4434 4759 TComPTL::TComPTL() 4435 4760 { … … 4449 4774 } 4450 4775 } 4776 #else 4777 Void TComPTL::inferGeneralValues(Bool profilePresentFlag, Int k, TComPTL* refPTL) 4778 { 4779 ProfileTierLevel* refProfileTierLevel = NULL; 4780 if ( k > 0 ) 4781 { 4782 assert( refPTL != NULL); 4783 refProfileTierLevel = refPTL->getGeneralPTL(); 4784 } 4785 4786 ProfileTierLevel* curProfileTierLevel = getGeneralPTL( ); 4787 4788 if( !profilePresentFlag ) 4789 { 4790 assert( k > 0 ); 4791 assert( refProfileTierLevel != NULL ); 4792 curProfileTierLevel->copyProfile( refProfileTierLevel); 4793 } 4794 else 4795 { 4796 if ( !curProfileTierLevel->getV2ConstraintsPresentFlag() ) 4797 { 4798 curProfileTierLevel->setMax12bitConstraintFlag ( false ); 4799 curProfileTierLevel->setMax10bitConstraintFlag ( false ); 4800 curProfileTierLevel->setMax8bitConstraintFlag ( false ); 4801 curProfileTierLevel->setMax422chromaConstraintFlag ( false ); 4802 curProfileTierLevel->setMax420chromaConstraintFlag ( false ); 4803 curProfileTierLevel->setMaxMonochromeConstraintFlag ( false ); 4804 curProfileTierLevel->setIntraConstraintFlag ( false ); 4805 curProfileTierLevel->setOnePictureOnlyConstraintFlag ( false ); 4806 curProfileTierLevel->setLowerBitRateConstraintFlag ( false ); 4807 } 4808 4809 if ( !curProfileTierLevel->getInbldPresentFlag() ) 4810 { 4811 curProfileTierLevel->setInbldFlag( false ); 4812 } 4813 } 4814 } 4815 4816 Void TComPTL::inferSubLayerValues(Int maxNumSubLayersMinus1, Int k, TComPTL* refPTL) 4817 { 4818 assert( k == 0 || refPTL != NULL ); 4819 4820 for (Int i = maxNumSubLayersMinus1; i >= 0; i--) 4821 { 4822 ProfileTierLevel* refProfileTierLevel; 4823 if ( k != 0 ) 4824 { 4825 refProfileTierLevel = refPTL->getSubLayerPTL( i ); 4826 } 4827 else 4828 { 4829 if ( i == maxNumSubLayersMinus1) 4830 { 4831 refProfileTierLevel = getGeneralPTL(); 4832 } 4833 else 4834 { 4835 refProfileTierLevel = getSubLayerPTL( i + 1 ); 4836 } 4837 } 4838 4839 ProfileTierLevel* curProfileTierLevel = getSubLayerPTL( i ); 4840 if( !getSubLayerLevelPresentFlag( i ) ) 4841 { 4842 curProfileTierLevel->setLevelIdc( refProfileTierLevel->getLevelIdc() ); 4843 } 4844 4845 if( !getSubLayerProfilePresentFlag( i ) ) 4846 { 4847 curProfileTierLevel->copyProfile( refProfileTierLevel); 4848 } 4849 else 4850 { 4851 if ( !curProfileTierLevel->getV2ConstraintsPresentFlag() ) 4852 { 4853 curProfileTierLevel->copyV2ConstraintFlags( refProfileTierLevel ); 4854 } 4855 4856 if ( !curProfileTierLevel->getInbldPresentFlag() ) 4857 { 4858 curProfileTierLevel->setInbldFlag( refProfileTierLevel->getInbldFlag() ); 4859 } 4860 } 4861 } 4862 } 4863 4451 4864 #endif 4452 4865 #endif -
branches/HTM-12.0-dev1/source/Lib/TLibCommon/TComSlice.h
r1062 r1063 283 283 #endif 284 284 #if H_MV_HLS10_PTL_INFER_FIX 285 286 Bool getV2ConstraintsPresentFlag() 287 { 288 return ( 289 getProfileIdc( ) == 4 || getProfileCompatibilityFlag( 4 ) || getProfileIdc( ) == 5 || getProfileCompatibilityFlag( 5 ) || 290 getProfileIdc( ) == 6 || getProfileCompatibilityFlag( 6 ) || getProfileIdc( ) == 7 || getProfileCompatibilityFlag( 7 ) 291 ); 292 } 293 294 Bool getInbldPresentFlag() 295 { 296 return ( 297 ( getProfileIdc() >= 1 && getProfileIdc() <= 5 ) || getProfileCompatibilityFlag( 1 ) || getProfileCompatibilityFlag( 2 ) || 298 getProfileCompatibilityFlag( 3 ) || getProfileCompatibilityFlag( 4 ) || getProfileCompatibilityFlag( 5 ) 299 ); 300 } 301 302 Void copyV2ConstraintFlags( ProfileTierLevel* ptlRef ) 303 { 304 setMax12bitConstraintFlag ( ptlRef->getMax12bitConstraintFlag ( ) ); 305 setMax10bitConstraintFlag ( ptlRef->getMax10bitConstraintFlag ( ) ); 306 setMax8bitConstraintFlag ( ptlRef->getMax8bitConstraintFlag ( ) ); 307 setMax422chromaConstraintFlag ( ptlRef->getMax422chromaConstraintFlag ( ) ); 308 setMax420chromaConstraintFlag ( ptlRef->getMax420chromaConstraintFlag ( ) ); 309 setMaxMonochromeConstraintFlag ( ptlRef->getMaxMonochromeConstraintFlag ( ) ); 310 setIntraConstraintFlag ( ptlRef->getIntraConstraintFlag ( ) ); 311 setOnePictureOnlyConstraintFlag ( ptlRef->getOnePictureOnlyConstraintFlag ( ) ); 312 setLowerBitRateConstraintFlag ( ptlRef->getLowerBitRateConstraintFlag ( ) ); 313 } 314 315 Void copyProfile( ProfileTierLevel* ptlRef ) 316 { 317 setProfileSpace ( ptlRef->getProfileSpace ( ) ); 318 setTierFlag ( ptlRef->getTierFlag ( ) ); 319 setProfileIdc ( ptlRef->getProfileIdc ( ) ); 320 for (Int j = 0; j < 32; j++) 321 { 322 setProfileCompatibilityFlag(j, ptlRef->getProfileCompatibilityFlag ( j ) ); 323 } 324 setProgressiveSourceFlag ( ptlRef->getProgressiveSourceFlag ( ) ); 325 setInterlacedSourceFlag ( ptlRef->getInterlacedSourceFlag ( ) ); 326 setNonPackedConstraintFlag ( ptlRef->getNonPackedConstraintFlag ( ) ); 327 setFrameOnlyConstraintFlag ( ptlRef->getFrameOnlyConstraintFlag ( ) ); 328 copyV2ConstraintFlags ( ptlRef ); 329 } 330 #endif 331 #endif 332 285 Bool getV2ConstraintsPresentFlag(); 286 Bool getInbldPresentFlag(); 287 Void copyV2ConstraintFlags( ProfileTierLevel* ptlRef ); 288 Void copyProfile( ProfileTierLevel* ptlRef ); 289 #endif 290 #endif 333 291 }; 334 292 … … 353 311 #if H_MV 354 312 #if H_MV_HLS10_PTL_INFER_FIX 355 Void inferGeneralValues( Bool profilePresentFlag, Int k, TComPTL* refPTL ) 356 { 357 ProfileTierLevel* refProfileTierLevel = NULL; 358 if ( k > 0 ) 359 { 360 assert( refPTL != NULL); 361 refProfileTierLevel = refPTL->getGeneralPTL(); 362 } 363 364 ProfileTierLevel* curProfileTierLevel = getGeneralPTL( ); 365 366 if( !profilePresentFlag ) 367 { 368 assert( k > 0 ); 369 assert( refProfileTierLevel != NULL ); 370 curProfileTierLevel->copyProfile( refProfileTierLevel); 371 } 372 else 373 { 374 if ( !curProfileTierLevel->getV2ConstraintsPresentFlag() ) 375 { 376 curProfileTierLevel->setMax12bitConstraintFlag ( false ); 377 curProfileTierLevel->setMax10bitConstraintFlag ( false ); 378 curProfileTierLevel->setMax8bitConstraintFlag ( false ); 379 curProfileTierLevel->setMax422chromaConstraintFlag ( false ); 380 curProfileTierLevel->setMax420chromaConstraintFlag ( false ); 381 curProfileTierLevel->setMaxMonochromeConstraintFlag ( false ); 382 curProfileTierLevel->setIntraConstraintFlag ( false ); 383 curProfileTierLevel->setOnePictureOnlyConstraintFlag ( false ); 384 curProfileTierLevel->setLowerBitRateConstraintFlag ( false ); 385 } 386 387 if ( !curProfileTierLevel->getInbldPresentFlag() ) 388 { 389 curProfileTierLevel->setInbldFlag( false ); 390 } 391 } 392 }; 393 394 Void inferSubLayerValues( Int maxNumSubLayersMinus1, Int k, TComPTL* refPTL ) 395 { 396 assert( k == 0 || refPTL != NULL ); 397 398 for (Int i = maxNumSubLayersMinus1; i >= 0; i--) 399 { 400 ProfileTierLevel* refProfileTierLevel; 401 if ( k != 0 ) 402 { 403 refProfileTierLevel = refPTL->getSubLayerPTL( i ); 404 } 405 else 406 { 407 if ( i == maxNumSubLayersMinus1) 408 { 409 refProfileTierLevel = getGeneralPTL(); 410 } 411 else 412 { 413 refProfileTierLevel = getSubLayerPTL( i + 1 ); 414 } 415 } 416 417 ProfileTierLevel* curProfileTierLevel = getSubLayerPTL( i ); 418 if( !getSubLayerLevelPresentFlag( i ) ) 419 { 420 curProfileTierLevel->setLevelIdc( refProfileTierLevel->getLevelIdc() ); 421 } 422 423 if( !getSubLayerProfilePresentFlag( i ) ) 424 { 425 curProfileTierLevel->copyProfile( refProfileTierLevel); 426 } 427 else 428 { 429 if ( !curProfileTierLevel->getV2ConstraintsPresentFlag() ) 430 { 431 curProfileTierLevel->copyV2ConstraintFlags( refProfileTierLevel ); 432 } 433 434 if ( !curProfileTierLevel->getInbldPresentFlag() ) 435 { 436 curProfileTierLevel->setInbldFlag( refProfileTierLevel->getInbldFlag() ); 437 } 438 } 439 } 440 }; 313 Void inferGeneralValues ( Bool profilePresentFlag , Int k, TComPTL* refPTL );; 314 Void inferSubLayerValues( Int maxNumSubLayersMinus1, Int k, TComPTL* refPTL );; 441 315 #else 442 316 Void copyLevelFrom( TComPTL* source ); … … 1356 1230 Void setProfileTierLevelIdx( Int i, Int j, Int val ) { m_profileTierLevelIdx[ i ][ j ] = val; } 1357 1231 Int getProfileTierLevelIdx( Int i, Int j ) { return m_profileTierLevelIdx[ i ][ j ]; } 1358 #if H_MV_HLS10_PTL 1359 Int inferProfileTierLevelIdx( Int i, Int j ) 1360 { 1361 Bool inferZero = ( i == 0 && j == 0 && getVpsBaseLayerInternalFlag() ); 1362 Bool inferGreaterZero = getNecessaryLayerFlag(i,j) && ( getVpsNumProfileTierLevelMinus1() == 0 ); 1363 assert( inferZero || inferGreaterZero ); 1364 1365 Bool ptlIdx = 0; // inference for greaterZero 1366 if ( inferZero ) 1367 { 1368 ptlIdx = getMaxLayersMinus1() > 0 ? 1 : 0; 1369 if ( inferGreaterZero ) 1370 { 1371 assert( ptlIdx == 0 ); 1372 // This should never happen since : 1373 // When vps_max_layers_minus1 is greater than 0, the value of vps_num_profile_tier_level_minus1 shall be greater than or equal to 1. 1374 } 1375 } 1376 return ptlIdx; 1377 } 1232 #if H_MV_HLS10_PTL_FIX 1233 Int inferProfileTierLevelIdx( Int i, Int j ); 1378 1234 #endif 1379 1235 #else … … 1508 1364 1509 1365 #if H_MV_HLS10_ADD_LAYERSETS 1510 Void deriveAddLayerSetLayerIdList( Int i ) 1511 { 1512 assert( m_layerSetLayerIdList.size() == ( getVpsNumLayerSetsMinus1() + 1 + i ) ); 1513 std::vector<Int> layerSetLayerIdList; 1514 1515 for( Int treeIdx = 1; treeIdx < getNumIndependentLayers(); treeIdx++ ) 1516 { 1517 // The value of highest_layer_idx_plus1[ i ][ j ] shall be in the range of 0 to NumLayersInTreePartition[ j ], inclusive. 1518 assert( getHighestLayerIdxPlus1( i, treeIdx ) >= 0 && getHighestLayerIdxPlus1( i, treeIdx ) <= getNumLayersInTreePartition( treeIdx ) ); 1519 1520 for( Int layerCnt = 0; layerCnt < getHighestLayerIdxPlus1( i, treeIdx ); layerCnt++ ) 1521 { 1522 layerSetLayerIdList.push_back( getTreePartitionLayerIdList( treeIdx, layerCnt ) ); 1523 } 1524 } 1525 m_layerSetLayerIdList.push_back( layerSetLayerIdList ); 1526 1527 //It is a requirement of bitstream conformance that 1528 //NumLayersInIdList[ vps_num_layer_sets_minus1 + 1 + i ] shall be greater than 0. 1529 assert( getNumLayersInIdList( getVpsNumLayerSetsMinus1() + 1 + i ) > 0 ); 1530 1531 } 1366 Void deriveAddLayerSetLayerIdList( Int i ); 1532 1367 #endif 1533 1368 #if H_MV_HLS10_NESSECARY_LAYER 1534 Void deriveNecessaryLayerFlags( Int olsIdx ) 1535 { 1536 AOF( olsIdx >= 0 && olsIdx < getNumOutputLayerSets() ); 1537 Int lsIdx = olsIdxToLsIdx( olsIdx ); 1538 for( Int lsLayerIdx = 0; lsLayerIdx < getNumLayersInIdList( lsIdx) ; lsLayerIdx++ ) 1539 { 1540 m_necessaryLayerFlag[ olsIdx ][ lsLayerIdx ] = 0; 1541 } 1542 for( Int lsLayerIdx = 0; lsLayerIdx < getNumLayersInIdList( lsIdx ); lsLayerIdx++ ) 1543 { 1544 if( getOutputLayerFlag( olsIdx, lsLayerIdx )) 1545 { 1546 m_necessaryLayerFlag[ olsIdx ][ lsLayerIdx ] = 1; 1547 Int currLayerId = getLayerSetLayerIdList( lsIdx, lsLayerIdx ); 1548 for( Int rLsLayerIdx = 0; rLsLayerIdx < lsLayerIdx; rLsLayerIdx++ ) 1549 { 1550 Int refLayerId = getLayerSetLayerIdList( lsIdx, rLsLayerIdx ); 1551 if( getDependencyFlag( getLayerIdInVps( currLayerId ), getLayerIdInVps( refLayerId ) ) ) 1552 { 1553 m_necessaryLayerFlag[ olsIdx ][ rLsLayerIdx ] = 1; 1554 } 1555 } 1556 } 1557 } 1558 m_numNecessaryLayers[ olsIdx ] = 0; 1559 for( Int lsLayerIdx = 0; lsLayerIdx < getNumLayersInIdList( lsIdx ); lsLayerIdx++ ) 1560 { 1561 m_numNecessaryLayers[ olsIdx ] += m_necessaryLayerFlag[ olsIdx ][ lsLayerIdx ]; 1562 } 1563 }; 1564 1565 Int getNecessaryLayerFlag( Int i, Int j ) { AOF( i >= 0 && i < getNumOutputLayerSets() ); AOF( j >= 0 && j < getNumLayersInIdList( olsIdxToLsIdx( i ) ) ); return m_necessaryLayerFlag[i][j]; }; 1566 1567 #endif 1568 1369 Void deriveNecessaryLayerFlags( Int olsIdx );; 1370 Int getNecessaryLayerFlag( Int i, Int j ) { AOF( i >= 0 && i < getNumOutputLayerSets() ); AOF( j >= 0 && j < getNumLayersInIdList( olsIdxToLsIdx( i ) ) ); return m_necessaryLayerFlag[i][j]; }; 1371 #endif 1569 1372 1570 1373 Int getMaxSubLayersInLayerSetMinus1( Int i ); 1571 1374 Int getHighestLayerIdxPlus1Len( Int j ) { return gCeilLog2( getNumLayersInTreePartition( j ) + 1 ); }; 1572 1573 Bool getAltOutputLayerFlagVar( Int i );; 1375 Bool getAltOutputLayerFlagVar( Int i );; 1574 1376 1575 1377 // inference … … 1578 1380 1579 1381 // helpers 1580 1382 #if !H_MV_HLS10_REF_PRED_LAYERS 1581 1383 Bool getInDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Int depth = 0 ); 1384 #endif 1582 1385 #if !H_MV_HLS10_MAXNUMPICS 1583 1386 Int getMaxNumPics( Int layerId ); 1584 1387 #endif 1585 1388 #if H_MV_HLS10_ADD_LAYERSETS 1586 1587 Void printPTL() 1588 { 1589 std::vector<Int> idx; 1590 std::vector<Int> num; 1591 std::vector< std::vector<Int> > ptlInfo; 1592 1593 std::cout << std::right << std::setw(60) << std::setfill('-') << " " << std::setfill(' ') << std::endl << "PTLI" << std::endl; 1594 1595 for ( Int i = 0; i <= getVpsNumProfileTierLevelMinus1(); i++ ) 1596 { 1597 std::vector<Int> curPtlInfo; 1598 ProfileTierLevel* ptl = getPTL( i )->getGeneralPTL(); 1599 curPtlInfo.push_back( (Int) ptl->getProfileIdc() ); 1600 curPtlInfo.push_back( (Int) ptl->getTierFlag() ); 1601 curPtlInfo.push_back( (Int) ptl->getLevelIdc() ); 1602 curPtlInfo.push_back( (Int) ptl->getInbldFlag() ); 1603 1604 idx.push_back ( i ); 1605 num.push_back ( 4 ); 1606 ptlInfo.push_back( curPtlInfo ); 1607 } 1608 1609 xPrintArray( "VpsProfileTierLevel", getVpsNumProfileTierLevelMinus1() + 1, idx, num, ptlInfo, false ); 1610 1611 num.clear(); 1612 idx.clear(); 1613 for (Int i = 0; i < getNumOutputLayerSets(); i++) 1614 { 1615 num.push_back ( getNumLayersInIdList( olsIdxToLsIdx( i )) ); 1616 idx.push_back( i ); 1617 } 1618 1619 xPrintArray( "profile_tier_level_idx", getNumOutputLayerSets(), idx, num, m_profileTierLevelIdx, true ); 1620 std::cout << std::endl; 1621 } 1622 1623 Void printLayerDependencies() 1624 { 1625 vector<Int> fullArray; 1626 vector<Int> range; 1627 1628 #if H_3D 1629 vector<Int> depthId; 1630 #endif 1631 1389 Void printPTL(); 1390 Void printLayerDependencies(); 1632 1391 #if H_MV_HLS10_AUX 1633 vector<Int> viewOrderIndex; 1634 vector<Int> auxId; 1635 vector<Int> dependencyId; 1636 vector<Int> viewId; 1637 #endif 1638 for (Int i = 0; i <= getMaxLayersMinus1(); i++ ) 1639 { 1640 fullArray.push_back( getMaxLayersMinus1() + 1 ); 1641 range.push_back( i ); 1642 #if H_MV_HLS10_AUX 1643 viewOrderIndex.push_back( getViewIndex ( i ) ); 1644 dependencyId .push_back( getDependencyId( i ) ); 1645 auxId .push_back( getAuxId ( i ) ); 1646 viewId .push_back( getViewId ( getLayerIdInNuh( i ) ) ); 1647 #if H_3D 1648 depthId.push_back( getDepthId( i ) ); 1649 #endif 1650 #endif 1651 } 1652 std::cout << std::right << std::setw(60) << std::setfill('-') << " " << std::setfill(' ') << std::endl << "Layer Dependencies" << std::endl; 1653 xPrintArray( "direct_dependency_flag", getMaxLayersMinus1()+1, range, fullArray, m_directDependencyFlag, false ); 1654 xPrintArray( "DependencyFlag", getMaxLayersMinus1()+1, range, fullArray, m_dependencyFlag, false ); 1655 xPrintArray( "layer_id_in_nuh", getMaxLayersMinus1()+1, m_layerIdInNuh, true ); 1656 xPrintArray( "IdPredictedLayer", getMaxLayersMinus1() + 1, m_layerIdInNuh, m_numPredictedLayers, m_idPredictedLayer, true ); 1657 xPrintArray( "IdRefLayer" , getMaxLayersMinus1() + 1, m_layerIdInNuh, m_numRefLayers, m_idRefLayer, true ); 1658 xPrintArray( "IdDirectRefLayer", getMaxLayersMinus1() + 1, m_layerIdInNuh, m_numDirectRefLayers, m_idDirectRefLayer, true ); 1659 std::cout << std::endl; 1660 1661 }; 1662 1663 #if H_MV_HLS10_AUX 1664 Void printScalabilityId() 1665 { 1666 vector<Int> layerIdxInVps; 1667 1668 #if H_3D 1669 vector<Int> depthId; 1670 #endif 1671 1672 vector<Int> viewOrderIndex; 1673 vector<Int> auxId; 1674 vector<Int> dependencyId; 1675 vector<Int> viewId; 1676 1677 for (Int i = 0; i <= getMaxLayersMinus1(); i++ ) 1678 { 1679 Int layerIdInNuh = getLayerIdInNuh( i ); 1680 layerIdxInVps .push_back( i ); 1681 viewOrderIndex.push_back( getViewIndex ( layerIdInNuh ) ); 1682 dependencyId .push_back( getDependencyId( layerIdInNuh ) ); 1683 auxId .push_back( getAuxId ( layerIdInNuh ) ); 1684 viewId .push_back( getViewId ( layerIdInNuh ) ); 1685 #if H_3D 1686 depthId .push_back( getDepthId ( layerIdInNuh ) ); 1687 #endif 1688 } 1689 1690 std::cout << std::right << std::setw(60) << std::setfill('-') << " " << std::setfill(' ') << std::endl << "Scalability Ids" << std::endl; 1691 xPrintArray( "layerIdxInVps" , getMaxLayersMinus1()+1, layerIdxInVps, false ); 1692 xPrintArray( "layer_id_in_nuh", getMaxLayersMinus1()+1, m_layerIdInNuh, false ); 1693 1694 xPrintArray( "ViewOrderIndex", getMaxLayersMinus1()+1, viewOrderIndex, false ); 1695 xPrintArray( "DependencyId" , getMaxLayersMinus1()+1, dependencyId , false ); 1696 xPrintArray( "AuxId" , getMaxLayersMinus1()+1, auxId , false ); 1697 xPrintArray( "ViewId" , getMaxLayersMinus1()+1, viewId , false ); 1698 1699 std::cout << std::endl; 1700 }; 1701 #endif 1702 1703 1704 1705 Void printLayerSets() 1706 { 1707 vector<Int> fullArray; 1708 vector<Int> numLayersInIdList; 1709 vector<Int> rangeLayerSets; 1710 1711 1712 for (Int i = 0; i < getNumLayerSets(); i++ ) 1713 { 1714 numLayersInIdList.push_back( getNumLayersInIdList( i ) ); 1715 rangeLayerSets.push_back( i ); 1716 } 1717 1718 vector<Int> rangeOutputLayerSets; 1719 vector<Int> numOutputLayersInOutputLayerSet; 1720 vector<Int> numDecLayer; 1721 vector<Int> numLayersInLayerSetForOutputLayerSet; 1722 vector<Int> vOlsIdxToLsIdx; 1723 for (Int i = 0; i < getNumOutputLayerSets(); i++ ) 1724 { 1725 vOlsIdxToLsIdx.push_back( olsIdxToLsIdx(i)); 1726 numOutputLayersInOutputLayerSet.push_back( getNumOutputLayersInOutputLayerSet( i ) ); 1727 numDecLayer.push_back( (Int) m_targetDecLayerIdLists[ i ].size() ); 1728 rangeOutputLayerSets.push_back( i ); 1729 numLayersInLayerSetForOutputLayerSet.push_back( getNumLayersInIdList( olsIdxToLsIdx( i ) ) ); 1730 } 1731 1732 vector<Int> rangeIndependentLayers; 1733 for(Int i = 0; i < getNumIndependentLayers(); i++ ) 1734 { 1735 rangeIndependentLayers.push_back( i ); 1736 } 1737 1738 vector<Int> rangeAddLayerSets; 1739 vector<Int> numHighestLayerIdxPlus1; 1740 for(Int i = 0; i < getNumAddLayerSets(); i++ ) 1741 { 1742 rangeAddLayerSets.push_back( i ); 1743 numHighestLayerIdxPlus1.push_back( getNumIndependentLayers() ); 1744 } 1745 1746 std::cout << std::right << std::setw(60) << std::setfill('-') << " " << std::setfill(' ') << std::endl << "Layer Sets" << std::endl; 1747 xPrintArray( "TreePartitionLayerIdList", getNumIndependentLayers(), rangeIndependentLayers, m_numLayersInTreePartition, m_treePartitionLayerIdList, true ); 1748 xPrintArray( "highest_layer_idx_plus1", getNumAddLayerSets(), rangeAddLayerSets, numHighestLayerIdxPlus1, m_highestLayerIdxPlus1, true ); 1749 xPrintArray( "LayerSetLayerIdList" , (Int) getNumLayerSets() , rangeLayerSets , numLayersInIdList, m_layerSetLayerIdList, true ); 1750 xPrintArray( "OlsIdxToLsIdx", (Int) vOlsIdxToLsIdx.size(), vOlsIdxToLsIdx, true ); 1751 xPrintArray( "OutputLayerFlag" , getNumOutputLayerSets(), rangeOutputLayerSets, numLayersInLayerSetForOutputLayerSet, m_outputLayerFlag, true ); 1752 xPrintArray( "TargetOptLayerIdList", getNumOutputLayerSets(), rangeOutputLayerSets, numOutputLayersInOutputLayerSet, m_targetOptLayerIdLists, true ); 1753 xPrintArray( "NecessaryLayerFlag" , getNumOutputLayerSets(), rangeOutputLayerSets, numLayersInLayerSetForOutputLayerSet, m_necessaryLayerFlag , true ); 1754 xPrintArray( "TargetDecLayerIdList", getNumOutputLayerSets(), rangeOutputLayerSets, numDecLayer, m_targetDecLayerIdLists, true ); 1755 std::cout << endl; 1756 }; 1392 Void printScalabilityId();; 1393 #endif 1394 Void printLayerSets();; 1757 1395 1758 1396 … … 2412 2050 Void setSpsExtOrMaxSubLayersMinus1( Int val ) { m_spsExtOrMaxSubLayersMinus1 = val; } 2413 2051 Int getSpsExtOrMaxSubLayersMinus1( ) { return m_spsExtOrMaxSubLayersMinus1; } 2414 Void inferSpsMaxSubLayersMinus1( Bool atPsActivation, TComVPS* vps ) 2415 { 2416 assert( getLayerId() != 0 ); 2417 if ( !atPsActivation ) 2418 { 2419 assert( vps == NULL ); 2420 if (getSpsExtOrMaxSubLayersMinus1() != 7) 2421 { 2422 setSpsMaxSubLayersMinus1( getSpsExtOrMaxSubLayersMinus1() ); 2423 } 2424 } 2425 else 2426 { 2427 assert( vps != NULL ); 2428 if (getSpsExtOrMaxSubLayersMinus1() == 7) 2429 { 2430 setSpsMaxSubLayersMinus1( vps->getMaxSubLayersMinus1() ); 2431 } 2432 } 2433 } 2052 Void inferSpsMaxSubLayersMinus1( Bool atPsActivation, TComVPS* vps ); 2434 2053 2435 2054 Bool getMultiLayerExtSpsFlag() { return ( getLayerId() != 0 && getSpsExtOrMaxSubLayersMinus1() == 7 ); } -
branches/HTM-12.0-dev1/source/Lib/TLibDecoder/TDecCAVLC.cpp
r1062 r1063 1122 1122 } 1123 1123 #endif 1124 1125 #if H_MV_HLS10_PPS 1126 Void TDecCavlc::parsePPSMultilayerExtension(TComPPS* pcPPS) 1127 { 1128 UInt uiCode = 0; 1129 READ_FLAG( uiCode, "poc_reset_info_present_flag" ); pcPPS->setPocResetInfoPresentFlag( uiCode == 1 ); 1130 READ_FLAG( uiCode, "pps_infer_scaling_list_flag" ); pcPPS->setPpsInferScalingListFlag( uiCode == 1 ); 1131 READ_CODE( 6, uiCode, "pps_scaling_list_ref_layer_id" ); pcPPS->setPpsScalingListRefLayerId( uiCode ); 1132 READ_UVLC( uiCode, "num_ref_loc_offsets" ); assert( uiCode == 0 ); 1133 } 1134 1135 #endif 1124 1136 #endif 1125 1137 -
branches/HTM-12.0-dev1/source/Lib/TLibDecoder/TDecCAVLC.h
r1054 r1063 99 99 #if H_MV_HLS10_PPS 100 100 #if H_MV 101 Void parsePPSMultilayerExtension( TComPPS* pcPPS ) 102 { 103 UInt uiCode = 0; 104 READ_FLAG( uiCode, "poc_reset_info_present_flag" ); pcPPS->setPocResetInfoPresentFlag( uiCode == 1 ); 105 READ_FLAG( uiCode, "pps_infer_scaling_list_flag" ); pcPPS->setPpsInferScalingListFlag( uiCode == 1 ); 106 READ_CODE( 6, uiCode, "pps_scaling_list_ref_layer_id" ); pcPPS->setPpsScalingListRefLayerId( uiCode ); 107 READ_UVLC( uiCode, "num_ref_loc_offsets" ); assert( uiCode == 0 ); 108 } 101 Void parsePPSMultilayerExtension( TComPPS* pcPPS ); 109 102 #endif 110 103 #endif -
branches/HTM-12.0-dev1/source/Lib/TLibDecoder/TDecTop.cpp
r1055 r1063 730 730 #if H_MV 731 731 m_apcSlicePilot->setVPS(vps); 732 #if H_MV_HLS10_REF_PRED_LAYERS 733 // The nuh_layer_id value of the NAL unit containing the PPS that is activated for a layer layerA with nuh_layer_id equal to nuhLayerIdA shall be equal to 0, or nuhLayerIdA, or the nuh_layer_id of a direct or indirect reference layer of layerA. 734 assert( pps->getLayerId() == m_layerId || pps->getLayerId( ) == 0 || vps->getDependencyFlag( m_layerId, pps->getLayerId() ) ); 735 // The nuh_layer_id value of the NAL unit containing the SPS that is activated for a layer layerA with nuh_layer_id equal to nuhLayerIdA shall be equal to 0, or nuhLayerIdA, or the nuh_layer_id of a direct or indirect reference layer of layerA. 736 assert( sps->getLayerId() == m_layerId || sps->getLayerId( ) == 0 || vps->getDependencyFlag( m_layerId, sps->getLayerId() ) ); 737 #else 732 738 // The nuh_layer_id value of the NAL unit containing the PPS that is activated for a layer layerA with nuh_layer_id equal to nuhLayerIdA shall be equal to 0, or nuhLayerIdA, or the nuh_layer_id of a direct or indirect reference layer of layerA. 733 739 assert( pps->getLayerId() == m_layerId || pps->getLayerId( ) == 0 || vps->getInDirectDependencyFlag( m_layerId, pps->getLayerId() ) ); 734 740 // The nuh_layer_id value of the NAL unit containing the SPS that is activated for a layer layerA with nuh_layer_id equal to nuhLayerIdA shall be equal to 0, or nuhLayerIdA, or the nuh_layer_id of a direct or indirect reference layer of layerA. 735 741 assert( sps->getLayerId() == m_layerId || sps->getLayerId( ) == 0 || vps->getInDirectDependencyFlag( m_layerId, sps->getLayerId() ) ); 742 #endif 736 743 sps->inferRepFormat ( vps , m_layerId ); 737 744 sps->inferScalingList( m_parameterSetManagerDecoder.getActiveSPS( sps->getSpsScalingListRefLayerId() ) ); -
branches/HTM-12.0-dev1/source/Lib/TLibEncoder/TEncCavlc.cpp
r1062 r1063 934 934 #endif 935 935 } 936 937 938 #if H_MV_HLS10_PPS 939 Void TEncCavlc::codePPSMultilayerExtension(TComPPS* pcPPS) 940 { 941 WRITE_FLAG( pcPPS->getPocResetInfoPresentFlag( ) ? 1 : 0 , "poc_reset_info_present_flag" ); 942 WRITE_FLAG( pcPPS->getPpsInferScalingListFlag( ) ? 1 : 0 , "pps_infer_scaling_list_flag" ); 943 WRITE_CODE( pcPPS->getPpsScalingListRefLayerId( ), 6, "pps_scaling_list_ref_layer_id" ); 944 WRITE_UVLC( 0, "num_ref_loc_offsets" ); 945 } 946 #endif 947 936 948 #endif 937 949 … … 950 962 #endif 951 963 } 952 #endif 964 965 966 #endif 967 968 969 953 970 954 971 Void TEncCavlc::codeVPS( TComVPS* pcVPS ) -
branches/HTM-12.0-dev1/source/Lib/TLibEncoder/TEncCavlc.h
r1054 r1063 109 109 #if H_MV_HLS10_PPS 110 110 #if H_MV 111 Void codePPSMultilayerExtension( TComPPS* pcPPS ) 112 { 113 WRITE_FLAG( pcPPS->getPocResetInfoPresentFlag( ) ? 1 : 0 , "poc_reset_info_present_flag" ); 114 WRITE_FLAG( pcPPS->getPpsInferScalingListFlag( ) ? 1 : 0 , "pps_infer_scaling_list_flag" ); 115 WRITE_CODE( pcPPS->getPpsScalingListRefLayerId( ), 6, "pps_scaling_list_ref_layer_id" ); 116 WRITE_UVLC( 0, "num_ref_loc_offsets" ); 117 } 111 Void codePPSMultilayerExtension( TComPPS* pcPPS ); 118 112 #endif 119 113 #endif
Note: See TracChangeset for help on using the changeset viewer.