Changeset 1172 in SHVCSoftware
- Timestamp:
- 8 Jul 2015, 01:45:57 (9 years ago)
- Location:
- branches/SHM-dev/source
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r1162 r1172 935 935 #endif 936 936 } 937 #if Q0078_ADD_LAYER_SETS 937 938 938 Int* cfg_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1]; 939 939 string cfg_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1]; … … 942 942 string cfg_highestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1]; 943 943 string* cfg_highestLayerIdxPtr[MAX_VPS_LAYER_SETS_PLUS1]; 944 944 945 for (UInt i = 0; i < MAX_VPS_LAYER_SETS_PLUS1; i++) 945 946 { … … 949 950 cfg_numHighestLayerIdx[i] = &m_numHighestLayerIdx[i]; 950 951 } 951 #endif 952 952 953 string* cfg_numOutputLayersInOutputLayerSet = new string; 953 954 string* cfg_listOfOutputLayers = new string[MAX_VPS_OUTPUT_LAYER_SETS_PLUS1]; … … 1059 1060 1060 1061 ("NumLayers", m_numLayers, 1, "Number of layers to code") 1061 #if Q0078_ADD_LAYER_SETS 1062 1062 1063 ("NumLayerSets", m_numLayerSets, 1, "Number of layer sets") 1063 1064 ("NumLayerInIdList%d", cfg_numLayerInIdList, 0, MAX_VPS_LAYER_IDX_PLUS1, "Number of layers in the set") … … 1066 1067 ("NumHighestLayerIdx%d", cfg_numHighestLayerIdx, 0, MAX_VPS_LAYER_IDX_PLUS1, "Number of highest layer idx") 1067 1068 ("HighestLayerIdx%d", cfg_highestLayerIdxPtr, string(""), MAX_VPS_LAYER_IDX_PLUS1, "Highest layer idx for an additional layer set") 1068 #endif 1069 1069 1070 ("DefaultTargetOutputLayerIdc", m_defaultTargetOutputLayerIdc, 1, "Default target output layers. 0: All layers are output layer, 1: Only highest layer is output layer, 2 or 3: No default output layers") 1070 1071 ("NumOutputLayerSets", m_numOutputLayerSets, 1, "Number of output layer sets excluding the 0-th output layer set") … … 2429 2430 } //for(Int layer = 0; layer < MAX_LAYERS; layer++) 2430 2431 2431 #if Q0078_ADD_LAYER_SETS2432 2432 for (Int layerSet = 1; layerSet < m_numLayerSets; layerSet++) 2433 2433 { … … 2435 2435 assert( scanStringToArray( cfg_layerSetLayerIdList[layerSet], m_numLayerInIdList[layerSet], "NumLayerInIdList", m_layerSetLayerIdList[layerSet] ) ); 2436 2436 } 2437 2437 2438 for (Int addLayerSet = 0; addLayerSet < m_numAddLayerSets; addLayerSet++) 2438 2439 { … … 2440 2441 assert( scanStringToArray( cfg_highestLayerIdx[addLayerSet], m_numHighestLayerIdx[addLayerSet], "HighestLayerIdx", m_highestLayerIdx[addLayerSet] ) ); 2441 2442 } 2442 #endif2443 2443 2444 2444 if( m_defaultTargetOutputLayerIdc != -1 ) … … 2446 2446 assert( m_defaultTargetOutputLayerIdc >= 0 && m_defaultTargetOutputLayerIdc <= 3 ); 2447 2447 } 2448 2448 2449 assert( m_numOutputLayerSets != 0 ); 2449 2450 assert( m_numOutputLayerSets >= m_numLayerSets + m_numAddLayerSets ); // Number of output layer sets must be at least as many as layer sets. -
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h
r1162 r1172 73 73 #endif 74 74 Bool m_maxTidRefPresentFlag; 75 #if Q0078_ADD_LAYER_SETS 75 76 76 Int m_numLayerSets; 77 Int m_numAddLayerSets; 77 78 Int m_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1]; 78 79 Int m_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_IDX_PLUS1]; 79 Int m_numAddLayerSets;80 80 Int m_numHighestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1]; 81 81 Int m_highestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_IDX_PLUS1]; 82 #endif 82 83 83 Int m_defaultTargetOutputLayerIdc; 84 84 Int m_numOutputLayerSets; -
branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
r1171 r1172 804 804 #endif 805 805 #endif 806 #if Q0078_ADD_LAYER_SETS807 806 m_acTEncTop[layer].setNumAddLayerSets ( m_numAddLayerSets ); 808 #endif809 807 } 810 808 } … … 1256 1254 vps->setVpsExtensionFlag( m_numLayers > 1 ? true : false ); 1257 1255 1258 #if Q0078_ADD_LAYER_SETS 1259 if (m_numLayerSets > 1) 1256 if( m_numLayerSets > 1 ) 1260 1257 { 1261 1258 vps->setNumLayerSets(m_numLayerSets); … … 1290 1287 { 1291 1288 // Default layer sets 1292 #endif1293 1289 vps->setNumLayerSets(m_numLayers); 1294 1290 for (Int setId = 1; setId < vps->getNumLayerSets(); setId++) … … 1315 1311 } 1316 1312 } 1317 #if Q0078_ADD_LAYER_SETS 1318 } 1319 #endif 1320 #if Q0078_ADD_LAYER_SETS 1313 } 1314 1321 1315 vps->setVpsNumLayerSetsMinus1(vps->getNumLayerSets() - 1); 1322 1316 vps->setNumAddLayerSets(m_numAddLayerSets); 1323 1317 vps->setNumLayerSets(vps->getNumLayerSets() + vps->getNumAddLayerSets()); 1324 if (m_numAddLayerSets > 0) 1318 1319 if( m_numAddLayerSets > 0 ) 1325 1320 { 1326 1321 for (Int setId = 0; setId < m_numAddLayerSets; setId++) … … 1332 1327 } 1333 1328 } 1334 #endif1335 1329 1336 1330 #if AVC_BASE … … 1494 1488 // The Layer ID List variables should be derived here. 1495 1489 vps->deriveLayerIdListVariables(); 1496 #if Q0078_ADD_LAYER_SETS1497 1490 vps->setPredictedLayerIds(); 1498 1491 vps->setTreePartitionLayerIdList(); 1499 1492 vps->deriveLayerIdListVariablesForAddLayerSets(); 1500 #endif1501 1493 1502 1494 vps->setDefaultTargetOutputLayerIdc( m_defaultTargetOutputLayerIdc ); // As per configuration file … … 1538 1530 for( UInt layer = 0; layer < vps->getNumLayersInIdList(lsIdx); layer++ ) 1539 1531 { 1540 #if !Q0078_ADD_LAYER_SETS // the following condition is incorrect and is not needed anyway 1541 if( vps->getLayerIdIncludedFlag(lsIdx, layer) ) 1542 #endif 1543 { 1544 switch(vps->getDefaultTargetOutputLayerIdc()) 1545 { 1546 case 0: vps->setOutputLayerFlag( lsIdx, layer, 1 ); 1547 break; 1548 case 1: vps->setOutputLayerFlag( lsIdx, layer, layer == vps->getNumLayersInIdList(lsIdx) - 1 ); 1549 break; 1550 case 2: 1551 case 3: vps->setOutputLayerFlag( lsIdx, layer, (layer != vps->getNumLayersInIdList(lsIdx) - 1) ? std::find( m_listOfOutputLayers[lsIdx].begin(), m_listOfOutputLayers[lsIdx].end(), m_layerSetLayerIdList[lsIdx][layer]) != m_listOfOutputLayers[lsIdx].end() 1552 : m_listOfOutputLayers[lsIdx][m_listOfOutputLayers[lsIdx].size()-1] == m_layerSetLayerIdList[lsIdx][layer] ); 1553 break; 1554 } 1532 switch( vps->getDefaultTargetOutputLayerIdc() ) 1533 { 1534 case 0: vps->setOutputLayerFlag( lsIdx, layer, 1 ); 1535 break; 1536 case 1: vps->setOutputLayerFlag( lsIdx, layer, layer == vps->getNumLayersInIdList(lsIdx) - 1 ); 1537 break; 1538 case 2: 1539 case 3: vps->setOutputLayerFlag( lsIdx, layer, (layer != vps->getNumLayersInIdList(lsIdx) - 1) ? std::find( m_listOfOutputLayers[lsIdx].begin(), m_listOfOutputLayers[lsIdx].end(), m_layerSetLayerIdList[lsIdx][layer]) != m_listOfOutputLayers[lsIdx].end() 1540 : m_listOfOutputLayers[lsIdx][m_listOfOutputLayers[lsIdx].size()-1] == m_layerSetLayerIdList[lsIdx][layer] ); 1541 break; 1555 1542 } 1556 1543 } … … 1616 1603 vps->setMaxOneActiveRefLayerFlag(maxDirectRefLayers > 1 ? false : true); 1617 1604 #if O0062_POC_LSB_NOT_PRESENT_FLAG 1618 for( i = 1; i< vps->getMaxLayers(); i++)1605 for( i = 1; i< vps->getMaxLayers(); i++ ) 1619 1606 { 1620 1607 if( vps->getNumDirectRefLayers( vps->getLayerIdInNuh(i) ) == 0 ) 1621 1608 { 1622 #if Q0078_ADD_LAYER_SETS 1623 vps->setPocLsbNotPresentFlag(i, true); // make independedent layers base-layer compliant 1624 #else 1625 vps->setPocLsbNotPresentFlag(i, false); 1626 #endif 1609 // make independedent layers base-layer compliant 1610 vps->setPocLsbNotPresentFlag(i, true); 1627 1611 } 1628 1612 } … … 1739 1723 { 1740 1724 vps->setVpsVuiBspHrdPresentFlag(true); 1741 #if Q0078_ADD_LAYER_SETS1742 1725 vps->setVpsNumBspHrdParametersMinus1(vps->getVpsNumLayerSetsMinus1() - 1); 1743 #else1744 vps->setVpsNumBspHrdParametersMinus1(vps->getNumLayerSets() - 2);1745 #endif1746 1726 vps->createBspHrdParamBuffer(vps->getVpsNumBspHrdParametersMinus1() + 1); 1747 1727 for ( i = 0; i <= vps->getVpsNumBspHrdParametersMinus1(); i++ ) … … 1776 1756 vps->setBspHrdParameters( i, pcCfgLayer->getFrameRate(), numDU, pcCfgLayer->getTargetBitrate(), ( pcCfgLayer->getIntraPeriod() > 0 ) ); 1777 1757 } 1778 #if Q0078_ADD_LAYER_SETS1779 1758 for (UInt h = 1; h <= vps->getVpsNumLayerSetsMinus1(); h++) 1780 #else1781 for(UInt h = 1; h <= (vps->getNumLayerSets()-1); h++)1782 #endif1783 1759 { 1784 1760 vps->setNumBitstreamPartitions(h, 1); -
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.