Changeset 1237 in SHVCSoftware for branches/SHM-dev/source/Lib
- Timestamp:
- 13 Jul 2015, 20:56:47 (10 years ago)
- Location:
- branches/SHM-dev/source/Lib
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
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.