Changeset 1237 in SHVCSoftware
- Timestamp:
- 13 Jul 2015, 20:56:47 (9 years ago)
- Location:
- branches/SHM-dev/source
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.cpp
r1235 r1237 235 235 if( (m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) || !isNaluWithinTargetDecLayerIdSet(&nalu) || 236 236 #if CONFORMANCE_BITSTREAM_MODE 237 (nalu.m_ layerId > m_commonDecoderParams.getTargetLayerId()) )238 #else 239 (nalu.m_ layerId > m_tgtLayerId) )237 (nalu.m_nuhLayerId > m_commonDecoderParams.getTargetLayerId()) ) 238 #else 239 (nalu.m_nuhLayerId > m_tgtLayerId) ) 240 240 #endif 241 241 { … … 244 244 else 245 245 { 246 bNewPicture = m_acTDecTop[nalu.m_ layerId].decode(nalu, m_iSkipFrame, m_aiPOCLastDisplay[nalu.m_layerId], curLayerId, bNewPOC);246 bNewPicture = m_acTDecTop[nalu.m_nuhLayerId].decode(nalu, m_iSkipFrame, m_aiPOCLastDisplay[nalu.m_nuhLayerId], curLayerId, bNewPOC); 247 247 248 248 #if SVC_POC 249 if( (bNewPicture && m_acTDecTop[nalu.m_ layerId].getParseIdc() == 3) || (m_acTDecTop[nalu.m_layerId].getParseIdc() == 0) )249 if( (bNewPicture && m_acTDecTop[nalu.m_nuhLayerId].getParseIdc() == 3) || (m_acTDecTop[nalu.m_nuhLayerId].getParseIdc() == 0) ) 250 250 #else 251 251 if (bNewPicture) … … 267 267 } 268 268 #if SVC_POC 269 else if(m_acTDecTop[nalu.m_ layerId].getParseIdc() == 1)269 else if(m_acTDecTop[nalu.m_nuhLayerId].getParseIdc() == 1) 270 270 { 271 271 bitstreamFile.clear(); … … 283 283 284 284 #if SVC_POC 285 if( ( (bNewPicture && m_acTDecTop[nalu.m_ layerId].getParseIdc() == 3) || m_acTDecTop[nalu.m_layerId].getParseIdc() == 0 || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS ) &&286 !m_acTDecTop[nalu.m_ layerId].getFirstSliceInSequence() )285 if( ( (bNewPicture && m_acTDecTop[nalu.m_nuhLayerId].getParseIdc() == 3) || m_acTDecTop[nalu.m_nuhLayerId].getParseIdc() == 0 || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS ) && 286 !m_acTDecTop[nalu.m_nuhLayerId].getFirstSliceInSequence() ) 287 287 #else 288 288 if ( (bNewPicture || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS) && 289 !m_acTDecTop[nalu.m_ layerId].getFirstSliceInSequence() )289 !m_acTDecTop[nalu.m_nuhLayerId].getFirstSliceInSequence() ) 290 290 #endif 291 291 { … … 302 302 if (nalu.m_nalUnitType == NAL_UNIT_EOS) 303 303 { 304 m_acTDecTop[nalu.m_ layerId].setFirstSliceInSequence(true);304 m_acTDecTop[nalu.m_nuhLayerId].setFirstSliceInSequence(true); 305 305 } 306 306 } 307 307 else if ( (bNewPicture || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS ) && 308 m_acTDecTop[nalu.m_ layerId].getFirstSliceInSequence () )309 { 310 m_acTDecTop[nalu.m_ layerId].setFirstSliceInPicture (true);308 m_acTDecTop[nalu.m_nuhLayerId].getFirstSliceInSequence () ) 309 { 310 m_acTDecTop[nalu.m_nuhLayerId].setFirstSliceInPicture (true); 311 311 } 312 312 313 313 #if SVC_POC 314 if( bNewPicture && m_acTDecTop[nalu.m_ layerId].getParseIdc() == 0 )315 { 316 outputAllPictures( nalu.m_ layerId, true );314 if( bNewPicture && m_acTDecTop[nalu.m_nuhLayerId].getParseIdc() == 0 ) 315 { 316 outputAllPictures( nalu.m_nuhLayerId, true ); 317 317 } 318 318 #endif … … 333 333 Bool outputPicturesFlag = true; 334 334 335 if( m_acTDecTop[nalu.m_ layerId].getNoOutputPriorPicsFlag() )335 if( m_acTDecTop[nalu.m_nuhLayerId].getNoOutputPriorPicsFlag() ) 336 336 { 337 337 outputPicturesFlag = false; … … 340 340 if (nalu.m_nalUnitType == NAL_UNIT_EOS) // End of sequence 341 341 { 342 flushAllPictures( nalu.m_ layerId, outputPicturesFlag );342 flushAllPictures( nalu.m_nuhLayerId, outputPicturesFlag ); 343 343 } 344 344 345 345 #if SVC_POC 346 if( bNewPicture && m_acTDecTop[nalu.m_ layerId].getParseIdc() != 0 )346 if( bNewPicture && m_acTDecTop[nalu.m_nuhLayerId].getParseIdc() != 0 ) 347 347 // New picture, slice header parsed but picture not decoded 348 348 #else … … 356 356 || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP ) 357 357 { 358 flushAllPictures( nalu.m_ layerId, outputPicturesFlag );358 flushAllPictures( nalu.m_nuhLayerId, outputPicturesFlag ); 359 359 } 360 360 else 361 361 { 362 this->checkOutputBeforeDecoding( nalu.m_ layerId );362 this->checkOutputBeforeDecoding( nalu.m_nuhLayerId ); 363 363 } 364 364 } … … 1242 1242 } 1243 1243 #if SVC_EXTENSION 1244 if (nalu->m_ layerId == 0 && (nalu->m_nalUnitType == NAL_UNIT_VPS || nalu->m_nalUnitType == NAL_UNIT_SPS || nalu->m_nalUnitType == NAL_UNIT_PPS || nalu->m_nalUnitType == NAL_UNIT_EOS))1244 if (nalu->m_nuhLayerId == 0 && (nalu->m_nalUnitType == NAL_UNIT_VPS || nalu->m_nalUnitType == NAL_UNIT_SPS || nalu->m_nalUnitType == NAL_UNIT_PPS || nalu->m_nalUnitType == NAL_UNIT_EOS)) 1245 1245 { 1246 1246 return true; … … 1249 1249 for (std::vector<Int>::iterator it = m_targetDecLayerIdSet.begin(); it != m_targetDecLayerIdSet.end(); it++) 1250 1250 { 1251 if ( nalu->m_ reservedZero6Bits== (*it) )1251 if ( nalu->m_nuhLayerId == (*it) ) 1252 1252 { 1253 1253 return true; -
branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
r1235 r1237 1904 1904 { 1905 1905 OutputNALUnit nalu(NAL_UNIT_EOB); 1906 nalu.m_ layerId = 0;1906 nalu.m_nuhLayerId = 0; 1907 1907 1908 1908 AccessUnit& accessUnit = outputAccessUnits.back(); -
branches/SHM-dev/source/Lib/TLibCommon/NAL.h
r1029 r1237 50 50 NalUnitType m_nalUnitType; ///< nal_unit_type 51 51 UInt m_temporalId; ///< temporal_id 52 #if SVC_EXTENSION 53 UInt m_layerId; ///< layer id 54 #endif 55 UInt m_reservedZero6Bits; ///< reserved_zero_6bits 52 UInt m_nuhLayerId; ///< nuh_layer_id 56 53 57 54 /** construct an NALunit structure with given header values. */ 58 55 NALUnit( 59 56 NalUnitType nalUnitType, 60 57 Int temporalId = 0, 61 #if SVC_EXTENSION 62 UInt layerId = 0, 63 #endif 64 Int reservedZero6Bits = 0) 58 Int nuhLayerId = 0) 65 59 :m_nalUnitType (nalUnitType) 66 60 ,m_temporalId (temporalId) 67 #if SVC_EXTENSION 68 ,m_layerId (layerId) 69 #endif 70 ,m_reservedZero6Bits(reservedZero6Bits) 61 ,m_nuhLayerId (nuhLayerId) 71 62 {} 72 63 -
branches/SHM-dev/source/Lib/TLibDecoder/NALread.cpp
r1211 r1237 110 110 assert(forbidden_zero_bit == 0); 111 111 nalu.m_nalUnitType = (NalUnitType) bs.read(6); // nal_unit_type 112 nalu.m_reservedZero6Bits = bs.read(6); // nuh_reserved_zero_6bits 113 #if SVC_EXTENSION 114 nalu.m_layerId = nalu.m_reservedZero6Bits; 115 #else 116 assert(nalu.m_reservedZero6Bits == 0); 117 #endif 112 nalu.m_nuhLayerId = bs.read(6); // nuh_layer_id 118 113 nalu.m_temporalId = bs.read(3) - 1; // nuh_temporal_id_plus1 119 114 #if RExt__DECODER_DEBUG_BIT_STATISTICS … … 121 116 #endif 122 117 123 if ( nalu.m_temporalId ) 118 // only check these rules for base layer 119 if (nalu.m_nuhLayerId == 0) 124 120 { 121 if ( nalu.m_temporalId ) 122 { 123 assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_W_LP 124 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_W_RADL 125 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_N_LP 126 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR_W_RADL 127 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR_N_LP 128 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_CRA 129 && nalu.m_nalUnitType != NAL_UNIT_VPS 130 && nalu.m_nalUnitType != NAL_UNIT_SPS 131 && nalu.m_nalUnitType != NAL_UNIT_EOS 132 && nalu.m_nalUnitType != NAL_UNIT_EOB ); 133 } 134 else 135 { 136 assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_R 137 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_N 138 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_STSA_R 139 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_STSA_N ); 140 } 141 } 125 142 #if SVC_EXTENSION 143 else if ( nalu.m_temporalId ) 144 { 126 145 assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_W_LP 127 146 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_W_RADL … … 133 152 && nalu.m_nalUnitType != NAL_UNIT_SPS 134 153 && nalu.m_nalUnitType != NAL_UNIT_EOS); 135 #else136 assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_W_LP137 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_W_RADL138 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_N_LP139 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR_W_RADL140 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR_N_LP141 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_CRA142 && nalu.m_nalUnitType != NAL_UNIT_VPS143 && nalu.m_nalUnitType != NAL_UNIT_SPS144 && nalu.m_nalUnitType != NAL_UNIT_EOS145 && nalu.m_nalUnitType != NAL_UNIT_EOB );146 #endif147 154 } 148 155 else 149 156 { 150 #if SVC_EXTENSION151 157 assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_R 152 158 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_N 153 159 ); 154 #else 155 assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_R 156 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_N 157 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_STSA_R 158 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_STSA_N ); 160 } 159 161 #endif 160 }161 162 } 162 163 /** -
branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r1235 r1237 1006 1006 #else 1007 1007 READ_CODE( 2, uiCode, "vps_reserved_three_2bits" ); assert(uiCode == 3); 1008 READ_CODE( 6, uiCode, "vps_ reserved_zero_6bits" ); assert(uiCode == 0);1008 READ_CODE( 6, uiCode, "vps_max_layers_minus1" ); 1009 1009 #endif 1010 1010 READ_CODE( 3, uiCode, "vps_max_sub_layers_minus1" ); pcVPS->setMaxTLayers( uiCode + 1 ); assert(uiCode+1 <= MAX_TLAYER); -
branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
r1235 r1237 723 723 { 724 724 #if SVC_EXTENSION 725 m_apcSlicePilot->initSlice( nalu.m_ layerId );725 m_apcSlicePilot->initSlice( nalu.m_nuhLayerId ); 726 726 m_apcSlicePilot->setTLayer( nalu.m_temporalId ); 727 727 #else //SVC_EXTENSION … … 768 768 if( !vps->getBaseLayerAvailableFlag() ) 769 769 { 770 assert( nalu.m_ layerId != 0 );770 assert( nalu.m_nuhLayerId != 0 ); 771 771 assert( vps->getNumAddLayerSets() > 0 ); 772 772 … … 1512 1512 1513 1513 #if SVC_EXTENSION 1514 m_pcPic->setLayerId(nalu.m_ layerId);1515 pcSlice->setLayerId(nalu.m_ layerId);1514 m_pcPic->setLayerId(nalu.m_nuhLayerId); 1515 pcSlice->setLayerId(nalu.m_nuhLayerId); 1516 1516 pcSlice->setPic(m_pcPic); 1517 1517 #endif … … 1928 1928 #endif 1929 1929 { 1930 #if !SVC_EXTENSION 1931 // ignore all NAL units of layers > 0 1932 if (nalu.m_nuhLayerId > 0) 1933 { 1934 fprintf (stderr, "Warning: found NAL unit with nuh_layer_id equal to %d. Ignoring.\n", nalu.m_nuhLayerId); 1935 return false; 1936 } 1937 #endif 1930 1938 // Initialize entropy decoder 1931 1939 m_cEntropyDecoder.setEntropyDecoder (&m_cCavlcDecoder); … … 1934 1942 #if SVC_EXTENSION 1935 1943 // ignore any NAL units with nuh_layer_id == 63 1936 if( nalu.m_ layerId == 63 )1944 if( nalu.m_nuhLayerId == 63 ) 1937 1945 { 1938 1946 return false; … … 1943 1951 case NAL_UNIT_VPS: 1944 1952 #if SVC_EXTENSION 1945 assert( nalu.m_ layerId == 0 ); // Non-conforming bitstream. The value of nuh_layer_id of VPS NAL unit shall be equal to 0.1953 assert( nalu.m_nuhLayerId == 0 ); // Non-conforming bitstream. The value of nuh_layer_id of VPS NAL unit shall be equal to 0. 1946 1954 #endif 1947 1955 xDecodeVPS(nalu.m_Bitstream->getFifo()); … … 2041 2049 #if SVC_EXTENSION 2042 2050 //Check layer id of the nalu. if it is not 0, give a warning message. 2043 if (nalu.m_ layerId > 0)2051 if (nalu.m_nuhLayerId > 0) 2044 2052 { 2045 2053 printf( "\n\nThis bitstream is ended with EOB NALU that has layer id greater than 0\n" ); -
branches/SHM-dev/source/Lib/TLibEncoder/NALwrite.cpp
r1029 r1237 53 53 bsNALUHeader.write(0,1); // forbidden_zero_bit 54 54 bsNALUHeader.write(nalu.m_nalUnitType, 6); // nal_unit_type 55 #if SVC_EXTENSION 56 bsNALUHeader.write(nalu.m_layerId, 6); // reserved_one_5bits 57 #else 58 bsNALUHeader.write(nalu.m_reservedZero6Bits, 6); // nuh_reserved_zero_6bits 59 #endif 55 bsNALUHeader.write(nalu.m_nuhLayerId, 6); // nuh_layer_id 60 56 bsNALUHeader.write(nalu.m_temporalId+1, 3); // nuh_temporal_id_plus1 61 57 -
branches/SHM-dev/source/Lib/TLibEncoder/NALwrite.h
r1029 r1237 61 61 UInt temporalID = 0, 62 62 #if SVC_EXTENSION 63 UInt layerId = 0, 63 UInt layerId = 0) 64 #else 65 UInt reserved_zero_6bits = 0) 64 66 #endif 65 UInt reserved_zero_6bits = 0)66 67 #if SVC_EXTENSION 67 : NALUnit(nalUnitType, temporalID, layerId , reserved_zero_6bits)68 : NALUnit(nalUnitType, temporalID, layerId) 68 69 #else 69 70 : NALUnit(nalUnitType, temporalID, reserved_zero_6bits) -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
r1235 r1237 785 785 #else 786 786 WRITE_CODE( 3, 2, "vps_reserved_three_2bits" ); 787 WRITE_CODE( 0, 6, "vps_ reserved_zero_6bits" );787 WRITE_CODE( 0, 6, "vps_max_layers_minus1" ); 788 788 #endif 789 789 WRITE_CODE( pcVPS->getMaxTLayers() - 1, 3, "vps_max_sub_layers_minus1" ); -
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r1235 r1237 2139 2139 { 2140 2140 // For independent base layer rewriting 2141 nalu.m_ layerId = 0;2141 nalu.m_nuhLayerId = 0; 2142 2142 } 2143 2143 #else … … 2163 2163 { 2164 2164 // For independent base layer rewriting 2165 nalu.m_ layerId = 0;2165 nalu.m_nuhLayerId = 0; 2166 2166 } 2167 2167 #else
Note: See TracChangeset for help on using the changeset viewer.