Changeset 1172 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibEncoder
- Timestamp:
- 8 Jul 2015, 01:45:57 (10 years ago)
- Location:
- branches/SHM-dev/source/Lib/TLibEncoder
- Files:
-
- 4 edited
-
TEncCavlc.cpp (modified) (8 diffs)
-
TEncGOP.cpp (modified) (2 diffs)
-
TEncTop.cpp (modified) (3 diffs)
-
TEncTop.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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.