Changeset 630 in SHVCSoftware for branches/SHM-5.1-dev/source/Lib/TLibEncoder
- Timestamp:
- 15 Mar 2014, 06:28:53 (12 years ago)
- Location:
- branches/SHM-5.1-dev/source/Lib/TLibEncoder
- Files:
-
- 7 edited
-
TEncCavlc.cpp (modified) (2 diffs)
-
TEncCavlc.h (modified) (1 diff)
-
TEncEntropy.cpp (modified) (1 diff)
-
TEncEntropy.h (modified) (2 diffs)
-
TEncGOP.cpp (modified) (1 diff)
-
TEncSbac.cpp (modified) (1 diff)
-
TEncSbac.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-5.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
r628 r630 2056 2056 } 2057 2057 } 2058 2059 #if !POC_RESET_IDC_SIGNALlING // Wrong place to put slice header extension 2058 2060 if(pcSlice->getPPS()->getSliceHeaderExtensionPresentFlag()) 2059 2061 { 2060 2062 WRITE_UVLC(0,"slice_header_extension_length"); 2061 2063 } 2064 #endif 2062 2065 } 2063 2066 … … 2195 2198 } 2196 2199 2200 #if POC_RESET_IDC_SIGNALlING 2201 Void TEncCavlc::codeSliceHeaderExtn( TComSlice* slice, Int shBitsWrittenTillNow ) 2202 { 2203 Int tmpBitsBeforeWriting = getNumberOfWrittenBits(); 2204 if(slice->getPPS()->getSliceHeaderExtensionPresentFlag()) 2205 { 2206 // Derive the value of PocMsbValRequiredFlag 2207 slice->setPocMsbValRequiredFlag( slice->getCraPicFlag() || slice->getBlaPicFlag() 2208 /* || related to vps_poc_lsb_aligned_flag */ 2209 ); 2210 2211 // Determine value of SH extension length. 2212 Int shExtnLengthInBit = 0; 2213 if (slice->getPPS()->getPocResetInfoPresentFlag()) 2214 { 2215 shExtnLengthInBit += 2; 2216 if (slice->getPocResetIdc() > 0) 2217 { 2218 shExtnLengthInBit += 6; 2219 if (slice->getPocResetIdc() == 3) 2220 { 2221 shExtnLengthInBit += (slice->getSPS()->getBitsForPOC() + 1); 2222 } 2223 } 2224 } 2225 2226 2227 if ( slice->getPocMsbValRequiredFlag() ) 2228 { 2229 Int iMaxPOClsb = 1<< slice->getSPS()->getBitsForPOC(); 2230 2231 UInt lengthVal = 1; 2232 UInt tempVal = slice->getPocMsbVal() + 1; 2233 assert ( tempVal ); 2234 while( 1 != tempVal ) 2235 { 2236 tempVal >>= 1; 2237 lengthVal += 2; 2238 } 2239 shExtnLengthInBit += lengthVal; 2240 } 2241 Int shExtnAdditionalBits = 0; 2242 if(shExtnLengthInBit % 8 != 0) 2243 { 2244 shExtnAdditionalBits = 8 - (shExtnLengthInBit % 8); 2245 } 2246 Int shExtnLength = (shExtnLengthInBit + shExtnAdditionalBits) / 8; 2247 WRITE_UVLC( shExtnLength, "slice_header_extension_length" ); 2248 2249 if(slice->getPPS()->getPocResetInfoPresentFlag()) 2250 { 2251 WRITE_CODE( slice->getPocResetIdc(), 2, "poc_reset_idc"); 2252 } 2253 if(slice->getPocResetIdc() > 0) 2254 { 2255 WRITE_CODE( slice->getPocResetPeriodId(), 6, "poc_reset_period_id"); 2256 } 2257 if(slice->getPocResetIdc() == 3) 2258 { 2259 WRITE_FLAG( slice->getFullPocResetFlag() ? 1 : 0, "full_poc_reset_flag"); 2260 WRITE_CODE( slice->getPocLsbVal(), slice->getSPS()->getBitsForPOC(), "poc_lsb_val"); 2261 } 2262 2263 if( slice->getPocMsbValRequiredFlag() /* vps_poc_lsb_aligned_flag */ ) 2264 { 2265 WRITE_FLAG( slice->getPocMsbValPresentFlag(), "poc_msb_val_present_flag" ); 2266 } 2267 if( slice->getPocMsbValPresentFlag() ) 2268 { 2269 WRITE_UVLC( slice->getPocMsbVal(), "poc_msb_val" ); 2270 } 2271 for (Int i = 0; i < shExtnAdditionalBits; i++) 2272 { 2273 WRITE_FLAG( 1, "slice_segment_header_extension_reserved_bit"); 2274 } 2275 } 2276 shBitsWrittenTillNow += ( getNumberOfWrittenBits() - tmpBitsBeforeWriting ); 2277 2278 // Slice header byte_alignment() included in xAttachSliceDataToNalUnit 2279 } 2280 #endif 2281 2197 2282 Void TEncCavlc::codeTerminatingBit ( UInt uilsLast ) 2198 2283 { -
branches/SHM-5.1-dev/source/Lib/TLibEncoder/TEncCavlc.h
r609 r630 96 96 Void codeHrdParameters ( TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1 ); 97 97 Void codeTilesWPPEntryPoint( TComSlice* pSlice ); 98 #if POC_RESET_IDC_SIGNALlING 99 Void codeSliceHeaderExtn( TComSlice* slice, Int shBitsWrittenTillNow ); 100 #endif 98 101 Void codeTerminatingBit ( UInt uilsLast ); 99 102 Void codeSliceFinish (); -
branches/SHM-5.1-dev/source/Lib/TLibEncoder/TEncEntropy.cpp
r595 r630 60 60 } 61 61 62 #if POC_RESET_IDC_SIGNALlING 63 Void TEncEntropy::encodeSliceHeaderExtn( TComSlice* pSlice, Int shBitsWrittenTillNow ) 64 { 65 m_pcEntropyCoderIf->codeSliceHeaderExtn( pSlice, shBitsWrittenTillNow ); 66 } 67 #endif 68 62 69 Void TEncEntropy::encodeTerminatingBit ( UInt uiIsLast ) 63 70 { -
branches/SHM-5.1-dev/source/Lib/TLibEncoder/TEncEntropy.h
r609 r630 74 74 75 75 virtual Void codeTilesWPPEntryPoint ( TComSlice* pSlice ) = 0; 76 #if POC_RESET_IDC_SIGNALlING 77 virtual Void codeSliceHeaderExtn ( TComSlice* pSlice, Int shBitsWrittenTillNow ) = 0; 78 #endif 76 79 virtual Void codeTerminatingBit ( UInt uilsLast ) = 0; 77 80 virtual Void codeSliceFinish () = 0; … … 142 145 Void encodeSliceHeader ( TComSlice* pcSlice ); 143 146 Void encodeTilesWPPEntryPoint( TComSlice* pSlice ); 147 #if POC_RESET_IDC_SIGNALlING 148 Void encodeSliceHeaderExtn( TComSlice* pSlice, Int shBitsWrittenTillNow ); 149 #endif 144 150 Void encodeTerminatingBit ( UInt uiIsLast ); 145 151 Void encodeSliceFinish (); -
branches/SHM-5.1-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r628 r630 2215 2215 m_pcEntropyCoder->setEntropyCoder ( m_pcCavlcCoder, pcSlice ); 2216 2216 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 2217 #if !POC_RESET_IDC_SIGNALlING 2217 2218 m_pcEntropyCoder->encodeTilesWPPEntryPoint( pcSlice ); 2219 #else 2220 tmpBitsBeforeWriting = m_pcEntropyCoder->getNumberOfWrittenBits(); 2221 m_pcEntropyCoder->encodeTilesWPPEntryPoint( pcSlice ); 2222 actualHeadBits += ( m_pcEntropyCoder->getNumberOfWrittenBits() - tmpBitsBeforeWriting ); 2223 m_pcEntropyCoder->encodeSliceHeaderExtn( pcSlice, actualHeadBits ); 2224 #endif 2218 2225 2219 2226 // Substreams... -
branches/SHM-5.1-dev/source/Lib/TLibEncoder/TEncSbac.cpp
r609 r630 266 266 } 267 267 268 #if POC_RESET_IDC_SIGNALlING 269 Void TEncSbac::codeSliceHeaderExtn( TComSlice* pSlice, Int shBitsWrittenTillNow ) 270 { 271 assert (0); 272 return; 273 } 274 #endif 268 275 Void TEncSbac::codeTerminatingBit( UInt uilsLast ) 269 276 { -
branches/SHM-5.1-dev/source/Lib/TLibEncoder/TEncSbac.h
r609 r630 95 95 Void codeSliceHeader ( TComSlice* pcSlice ); 96 96 Void codeTilesWPPEntryPoint( TComSlice* pSlice ); 97 #if POC_RESET_IDC_SIGNALlING 98 Void codeSliceHeaderExtn ( TComSlice* pSlice, Int shBitsWrittenTillNow ); 99 #endif 97 100 Void codeTerminatingBit ( UInt uilsLast ); 98 101 Void codeSliceFinish ();
Note: See TracChangeset for help on using the changeset viewer.