Changeset 1172 in SHVCSoftware for branches/SHM-dev/source/Lib
- Timestamp:
- 8 Jul 2015, 01:45:57 (10 years ago)
- Location:
- branches/SHM-dev/source/Lib
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibCommon/SEI.h
r1098 r1172 42 42 #include "TypeDef.h" 43 43 #include "libmd5/MD5.h" 44 #if Q0078_ADD_LAYER_SETS44 #if SVC_EXTENSION 45 45 #include "TLibCommon/NAL.h" 46 46 #endif -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp
r1171 r1172 3219 3219 #endif 3220 3220 3221 #if Q0078_ADD_LAYER_SETS3222 3221 Void TComVPS::setPredictedLayerIds() 3223 3222 { … … 3288 3287 } 3289 3288 } 3290 #endif3291 3289 3292 3290 #if VIEW_ID_RELATED_SIGNALING -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h
r1171 r1172 596 596 TComPTL m_pcPTLList[MAX_NUM_LAYER_IDS + 1]; 597 597 #endif 598 #if Q0078_ADD_LAYER_SETS 598 599 599 std::vector< std::vector<Int> > m_layerSetLayerIdList; 600 600 std::vector<Int> m_numLayerInIdList; 601 #else 602 Int m_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_IDX_PLUS1]; 603 Int m_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1]; 604 #endif 601 605 602 UInt m_maxLayerId; 606 603 UInt m_numLayerSets; 607 #if Q0078_ADD_LAYER_SETS 604 608 605 UInt m_vpsNumLayerSetsMinus1; 609 606 Bool m_layerIdIncludedFlag[MAX_VPS_LAYER_SETS_PLUS1 + MAX_NUM_ADD_LAYER_SETS][MAX_NUM_LAYER_IDS]; 610 #else611 Bool m_layerIdIncludedFlag[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];612 #endif613 607 614 608 // ------------------------------------------ … … 626 620 UInt m_numScalabilityTypes; 627 621 UInt m_layerIdxInVps[MAX_NUM_LAYER_IDS]; // Maps layer_id_in_nuh with the layer ID in the VPS 628 629 #if Q0078_ADD_LAYER_SETS630 622 UInt m_maxSLInLayerSetMinus1[MAX_VPS_LAYER_SETS_PLUS1 + MAX_NUM_ADD_LAYER_SETS]; 631 #else632 UInt m_maxSLInLayerSetMinus1[MAX_VPS_LAYER_SETS_PLUS1];633 #endif634 623 Bool m_ilpSshSignalingEnabledFlag; 635 624 … … 642 631 // Target output layer signalling related 643 632 UInt m_numOutputLayerSets; 644 #if Q0078_ADD_LAYER_SETS645 633 UInt m_outputLayerSetIdx[MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS]; 646 634 Bool m_outputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS][MAX_VPS_LAYER_IDX_PLUS1]; 647 #else648 UInt m_outputLayerSetIdx[MAX_VPS_LAYER_SETS_PLUS1];649 Bool m_outputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];650 #endif651 652 635 Bool m_directDependencyFlag[MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1]; 653 636 UInt m_numDirectRefLayers[MAX_VPS_LAYER_IDX_PLUS1]; … … 709 692 Int m_avgPicRate [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 710 693 711 #if Q0078_ADD_LAYER_SETS712 694 Bool m_altOutputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS]; 713 #else714 Bool m_altOutputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1];715 #endif716 695 717 696 #if REPN_FORMAT_IN_VPS … … 734 713 Bool m_recursiveRefLayerFlag[MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS]; // flag to indicate if j-th layer is a direct or indirect reference layer of i-th layer 735 714 #endif 736 #if Q0078_ADD_LAYER_SETS737 715 Int m_numAddLayerSets; 738 716 UInt m_highestLayerIdxPlus1[MAX_NUM_ADD_LAYER_SETS][MAX_NUM_LAYER_IDS]; … … 742 720 Int m_numLayersInTreePartition[MAX_LAYERS]; 743 721 UInt m_treePartitionLayerIdList[MAX_LAYERS][MAX_LAYERS]; 744 #endif 722 745 723 Int m_TolsIdx; 746 724 #if VPS_DPB_SIZE_TABLE … … 750 728 Int m_maxVpsNumReorderPics [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS]; 751 729 Int m_maxVpsLatencyIncreasePlus1 [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS]; 752 #if Q0078_ADD_LAYER_SETS753 730 Int m_numSubDpbs [MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS]; 754 #else755 Int m_numSubDpbs [MAX_VPS_LAYER_SETS_PLUS1];756 #endif757 731 #endif 758 732 … … 905 879 Void setNumRefLayers(); 906 880 #endif 907 #if Q0078_ADD_LAYER_SETS 881 908 882 void deriveLayerIdListVariablesForAddLayerSets(); 909 883 UInt getVpsNumLayerSetsMinus1() { return m_vpsNumLayerSetsMinus1; } … … 925 899 UInt getTreePartitionLayerId(Int idx, Int layerIdx) { return m_treePartitionLayerIdList[idx][layerIdx]; } 926 900 Void setTreePartitionLayerId(Int idx, Int layerIdx, UInt layerId) { m_treePartitionLayerIdList[idx][layerIdx] = layerId; } 927 #endif 901 928 902 UInt getMaxLayerId() { return m_maxLayerId; } 929 903 Void setMaxLayerId(UInt v) { m_maxLayerId = v; } -
branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h
r1171 r1172 130 130 #endif 131 131 132 #define Q0078_ADD_LAYER_SETS 1 ///< JCTVC-Q0078: additional layer sets and layer set config133 132 #define MULTIPLE_PTL_SUPPORT 1 ///< Profile, tier and level signalling 134 133 -
branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r1170 r1172 1046 1046 assert( pcVPS->getMaxLayerId() < MAX_NUM_LAYER_IDS ); 1047 1047 READ_CODE( 6, uiCode, "vps_max_layer_id" ); pcVPS->setMaxLayerId( uiCode ); 1048 #if Q0078_ADD_LAYER_SETS1049 1048 READ_UVLC(uiCode, "vps_num_layer_sets_minus1"); pcVPS->setVpsNumLayerSetsMinus1(uiCode); 1050 1049 pcVPS->setNumLayerSets(pcVPS->getVpsNumLayerSetsMinus1() + 1); 1050 1051 1051 for (UInt opsIdx = 1; opsIdx <= pcVPS->getVpsNumLayerSetsMinus1(); opsIdx++) 1052 #else1053 READ_UVLC( uiCode, "vps_num_layer_sets_minus1" ); pcVPS->setNumLayerSets( uiCode + 1 );1054 for( UInt opsIdx = 1; opsIdx <= ( pcVPS->getNumLayerSets() - 1 ); opsIdx ++ )1055 #endif1056 1052 { 1057 1053 // Operation point set … … 1455 1451 } 1456 1452 #if DPB_CONSTRAINTS 1457 if(pcSlice->getVPS()->getVpsExtensionFlag()==1) 1458 { 1459 #if Q0078_ADD_LAYER_SETS 1460 for (Int ii = 1; ii < (pcSlice->getVPS()->getVpsNumLayerSetsMinus1() + 1); ii++) // prevent assert error when num_add_layer_sets > 0 1461 #else 1462 for (Int ii=1; ii< pcSlice->getVPS()->getNumOutputLayerSets(); ii++ ) 1463 #endif 1453 if( pcSlice->getVPS()->getVpsExtensionFlag() == 1 ) 1454 { 1455 for( Int ii = 1; ii < (pcSlice->getVPS()->getVpsNumLayerSetsMinus1() + 1); ii++ ) // prevent assert error when num_add_layer_sets > 0 1464 1456 { 1465 1457 Int layerSetIdxForOutputLayerSet = pcSlice->getVPS()->getOutputLayerSetIdx( ii ); … … 1472 1464 } 1473 1465 } 1474 if(chkAssert) 1466 1467 if( chkAssert ) 1475 1468 { 1476 1469 UInt layerIdc = pcSlice->getVPS()->getLayerIdcForOls( ii, pcSlice->getLayerId() ); … … 1480 1473 } 1481 1474 } 1482 1483 1484 } 1475 } 1476 1485 1477 if(pcSlice->getLayerId() == 0) 1486 1478 { … … 2785 2777 } 2786 2778 2787 #if Q0078_ADD_LAYER_SETS2788 2779 #if O0092_0094_DEPENDENCY_CONSTRAINT // Moved here 2789 2780 vps->setNumRefLayers(); … … 2799 2790 vps->setPredictedLayerIds(); 2800 2791 vps->setTreePartitionLayerIdList(); 2801 #endif 2802 #if Q0078_ADD_LAYER_SETS 2803 if (vps->getNumIndependentLayers() > 1) 2792 2793 if( vps->getNumIndependentLayers() > 1 ) 2804 2794 { 2805 2795 READ_UVLC(uiCode, "num_add_layer_sets"); vps->setNumAddLayerSets(uiCode); 2806 for (i = 0; i < vps->getNumAddLayerSets(); i++) 2807 { 2808 for (j = 1; j < vps->getNumIndependentLayers(); j++) 2809 { 2810 int len = 1; 2811 while ((1 << len) < (vps->getNumLayersInTreePartition(j) + 1)) 2796 2797 for( i = 0; i < vps->getNumAddLayerSets(); i++ ) 2798 { 2799 for( j = 1; j < vps->getNumIndependentLayers(); j++ ) 2800 { 2801 Int len = 1; 2802 while( (1 << len) < (vps->getNumLayersInTreePartition(j) + 1) ) 2812 2803 { 2813 2804 len++; 2814 2805 } 2806 2815 2807 READ_CODE(len, uiCode, "highest_layer_idx_plus1[i][j]"); vps->setHighestLayerIdxPlus1(i, j, uiCode); 2816 2808 } … … 2823 2815 vps->setNumAddLayerSets(0); 2824 2816 } 2825 #endif2826 2817 2827 2818 READ_FLAG( uiCode, "vps_sub_layers_max_minus1_present_flag"); vps->setMaxTSLayersPresentFlag(uiCode ? true : false); … … 2937 2928 Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx(i); 2938 2929 2939 #if Q0078_ADD_LAYER_SETS2940 2930 if( i > vps->getVpsNumLayerSetsMinus1() || vps->getDefaultTargetOutputLayerIdc() == 2 ) 2941 #else2942 if( i > (vps->getNumLayerSets() - 1) || vps->getDefaultTargetOutputLayerIdc() == 2 )2943 #endif2944 2931 { 2945 2932 for( j = 0; j < vps->getNumLayersInIdList(layerSetIdxForOutputLayerSet); j++ ) … … 3126 3113 } 3127 3114 } 3128 3129 #if !Q0078_ADD_LAYER_SETS3130 #if O0092_0094_DEPENDENCY_CONSTRAINT // Moved up3131 vps->setNumRefLayers();3132 3133 if(vps->getMaxLayers() > MAX_REF_LAYERS)3134 {3135 for(i = 1;i < vps->getMaxLayers(); i++)3136 {3137 assert( vps->getNumRefLayers(vps->getLayerIdInNuh(i)) <= MAX_REF_LAYERS);3138 }3139 }3140 #endif3141 #endif3142 3115 3143 3116 READ_UVLC( uiCode, "vps_non_vui_extension_length"); vps->setVpsNonVuiExtLength((Int)uiCode); … … 3603 3576 parseHrdParameters(vps->getBspHrd(i), i==0 ? 1 : vps->getBspCprmsPresentFlag(i), vps->getMaxTLayers()-1); 3604 3577 } 3605 #if Q0078_ADD_LAYER_SETS3606 3578 for (UInt h = 1; h <= vps->getVpsNumLayerSetsMinus1(); h++) 3607 #else3608 for( UInt h = 1; h <= (vps->getNumLayerSets()-1); h++ )3609 #endif3610 3579 { 3611 3580 READ_UVLC( uiCode, "num_bitstream_partitions[i]"); vps->setNumBitstreamPartitions(h, uiCode); -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
r1171 r1172 817 817 818 818 WRITE_CODE( pcVPS->getMaxLayerId(), 6, "vps_max_layer_id" ); 819 #if Q0078_ADD_LAYER_SETS820 819 WRITE_UVLC(pcVPS->getVpsNumLayerSetsMinus1(), "vps_num_layer_sets_minus1"); 821 for (UInt opsIdx = 1; opsIdx <= pcVPS->getVpsNumLayerSetsMinus1(); opsIdx++) 822 #else 823 WRITE_UVLC( pcVPS->getNumLayerSets() - 1, "vps_num_layer_sets_minus1" ); 824 for (UInt opsIdx = 1; opsIdx <= (pcVPS->getNumLayerSets() - 1); opsIdx++) 825 #endif 820 821 for( UInt opsIdx = 1; opsIdx <= pcVPS->getVpsNumLayerSetsMinus1(); opsIdx++ ) 826 822 { 827 823 // Operation point set … … 2071 2067 } 2072 2068 2073 #if Q0078_ADD_LAYER_SETS 2074 if (vps->getNumIndependentLayers() > 1) 2069 if( vps->getNumIndependentLayers() > 1 ) 2075 2070 { 2076 2071 WRITE_UVLC( vps->getNumAddLayerSets(), "num_add_layer_sets" ); 2077 for (i = 0; i < vps->getNumAddLayerSets(); i++) 2078 { 2079 for (j = 1; j < vps->getNumIndependentLayers(); j++) 2080 { 2081 int len = 1; 2082 while ((1 << len) < (vps->getNumLayersInTreePartition(j) + 1)) 2072 2073 for( i = 0; i < vps->getNumAddLayerSets(); i++ ) 2074 { 2075 for( j = 1; j < vps->getNumIndependentLayers(); j++ ) 2076 { 2077 Int len = 1; 2078 while( (1 << len) < (vps->getNumLayersInTreePartition(j) + 1) ) 2083 2079 { 2084 2080 len++; … … 2088 2084 } 2089 2085 } 2090 #endif2091 2086 2092 2087 WRITE_FLAG( vps->getMaxTSLayersPresentFlag(), "vps_sub_layers_max_minus1_present_flag"); … … 2162 2157 WRITE_CODE( vps->getOutputLayerSetIdx(i) - 1, numBits, "layer_set_idx_for_ols_minus1"); 2163 2158 } 2164 #if Q0078_ADD_LAYER_SETS 2165 if ( i > vps->getVpsNumLayerSetsMinus1() || vps->getDefaultTargetOutputLayerIdc() >= 2 ) //Instead of == 2, >= 2 is used to follow the agreement that value 3 should be interpreted as 2 2166 #else 2167 if ( i > (vps->getNumLayerSets() - 1) || vps->getDefaultTargetOutputLayerIdc() >= 2 ) //Instead of == 2, >= 2 is used to follow the agreement that value 3 should be interpreted as 2 2168 #endif 2169 { 2170 for( j = 0; j < vps->getNumLayersInIdList(layerSetIdxForOutputLayerSet) ; j++ ) 2159 2160 if( i > vps->getVpsNumLayerSetsMinus1() || vps->getDefaultTargetOutputLayerIdc() >= 2 ) //Instead of == 2, >= 2 is used to follow the agreement that value 3 should be interpreted as 2 2161 { 2162 for( j = 0; j < vps->getNumLayersInIdList(layerSetIdxForOutputLayerSet); j++ ) 2171 2163 { 2172 2164 WRITE_FLAG( vps->getOutputLayerFlag(i,j), "output_layer_flag[i][j]"); … … 2392 2384 if( vps->getBitRatePresentVpsFlag() || vps->getPicRatePresentVpsFlag() ) 2393 2385 { 2394 #if Q0078_ADD_LAYER_SETS2395 2386 for( i = vps->getBaseLayerInternalFlag() ? 0 : 1; i < vps->getNumLayerSets(); i++ ) 2396 #else2397 for( i = 0; i < vps->getNumLayerSets(); i++ )2398 #endif2399 2387 { 2400 2388 for( j = 0; j <= vps->getMaxSLayersInLayerSetMinus1(i); j++ ) … … 2404 2392 WRITE_FLAG( vps->getBitRatePresentFlag( i, j), "bit_rate_present_flag[i][j]" ); 2405 2393 } 2394 2406 2395 if( vps->getPicRatePresentVpsFlag() ) 2407 2396 { 2408 2397 WRITE_FLAG( vps->getPicRatePresentFlag( i, j), "pic_rate_present_flag[i][j]" ); 2409 2398 } 2399 2410 2400 if( vps->getBitRatePresentFlag(i, j) ) 2411 2401 { … … 2413 2403 WRITE_CODE( vps->getAvgBitRate( i, j ), 16, "max_bit_rate[i][j]" ); 2414 2404 } 2405 2415 2406 if( vps->getPicRatePresentFlag(i, j) ) 2416 2407 { … … 2539 2530 codeHrdParameters(vps->getBspHrd(i), i==0 ? 1 : vps->getBspCprmsPresentFlag(i), vps->getMaxTLayers()-1); 2540 2531 } 2541 #if Q0078_ADD_LAYER_SETS2542 2532 for( UInt h = 1; h <= vps->getVpsNumLayerSetsMinus1(); h++ ) 2543 #else2544 for( UInt h = 1; h <= (vps->getNumLayerSets()-1); h++ )2545 #endif2546 2533 { 2547 2534 WRITE_UVLC( vps->getNumBitstreamPartitions(h), "num_bitstream_partitions[i]"); -
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r1150 r1172 2370 2370 #if SVC_EXTENSION 2371 2371 nalu = NALUnit(NAL_UNIT_SPS, 0, m_layerId); 2372 2373 if( m_pcEncTop->getVPS()->getNumDirectRefLayers(m_layerId) == 0 && m_pcEncTop->getVPS()->getNumAddLayerSets() > 0 ) 2374 { 2375 // For independent base layer rewriting 2376 nalu.m_layerId = 0; 2377 } 2372 2378 #else 2373 2379 nalu = NALUnit(NAL_UNIT_SPS); 2374 2380 #endif 2375 #if Q0078_ADD_LAYER_SETS 2376 if (m_pcEncTop->getVPS()->getNumDirectRefLayers(m_layerId) == 0 && m_pcEncTop->getVPS()->getNumAddLayerSets() > 0) 2377 { 2378 nalu.m_layerId = 0; // For independent base layer rewriting 2379 } 2380 #endif 2381 2381 2382 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 2382 2383 if (m_bSeqFirst) … … 2415 2416 #if SVC_EXTENSION 2416 2417 nalu = NALUnit(NAL_UNIT_PPS, 0, m_layerId); 2418 2419 if( m_pcEncTop->getVPS()->getNumDirectRefLayers(m_layerId) == 0 && m_pcEncTop->getVPS()->getNumAddLayerSets() > 0 ) 2420 { 2421 // For independent base layer rewriting 2422 nalu.m_layerId = 0; 2423 } 2417 2424 #else 2418 2425 nalu = NALUnit(NAL_UNIT_PPS); 2419 2426 #endif 2420 #if Q0078_ADD_LAYER_SETS 2421 if (m_pcEncTop->getVPS()->getNumDirectRefLayers(m_layerId) == 0 && m_pcEncTop->getVPS()->getNumAddLayerSets() > 0) 2422 { 2423 nalu.m_layerId = 0; // For independent base layer rewriting 2424 } 2425 #endif 2427 2426 2428 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 2427 2429 #if O0092_0094_DEPENDENCY_CONSTRAINT -
branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp
r1163 r1172 743 743 m_cSPS.setNumDirectRefLayers(m_numDirectRefLayers); 744 744 #endif 745 #if Q0078_ADD_LAYER_SETS 745 746 746 if( !m_numDirectRefLayers && m_numAddLayerSets ) 747 747 { … … 752 752 m_cSPS.setLayerId(m_layerId); 753 753 } 754 #else755 m_cSPS.setLayerId(m_layerId);756 #endif757 754 #endif //SVC_EXTENSION 755 758 756 ProfileTierLevel& profileTierLevel = *m_cSPS.getPTL()->getGeneralPTL(); 759 757 profileTierLevel.setLevelIdc(m_level); … … 1029 1027 #endif 1030 1028 1031 #if Q0078_ADD_LAYER_SETS1032 1029 if( !m_numDirectRefLayers && m_numAddLayerSets ) 1033 1030 { 1034 1031 m_cPPS.setLayerId(0); // layer ID 0 for independent layers 1035 1032 } 1036 #endif1037 1033 1038 1034 if( m_layerId > 0 ) -
branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.h
r1148 r1172 147 147 Bool m_interLayerWeightedPredFlag; 148 148 #endif 149 #if Q0078_ADD_LAYER_SETS 150 int m_numAddLayerSets; 151 #endif 149 Int m_numAddLayerSets; 152 150 #if P0297_VPS_POC_LSB_ALIGNED_FLAG 153 151 Bool m_pocDecrementedInDPBFlag; … … 270 268 Void setNoOutputOfPriorPicsFlags(Bool x) { m_noOutputOfPriorPicsFlags = x; } 271 269 #endif 272 #if Q0078_ADD_LAYER_SETS273 270 Void setNumAddLayerSets(Int x) { m_numAddLayerSets = x; } 274 271 Int getNumAddLayerSets() { return m_numAddLayerSets; } 275 #endif276 272 #if P0297_VPS_POC_LSB_ALIGNED_FLAG 277 273 Void setPocDecrementedInDPBFlag(Bool x) { m_pocDecrementedInDPBFlag = x; }
Note: See TracChangeset for help on using the changeset viewer.