Changeset 630 in SHVCSoftware for branches/SHM-5.1-dev/source/Lib
- Timestamp:
- 15 Mar 2014, 06:28:53 (11 years ago)
- Location:
- branches/SHM-5.1-dev/source/Lib
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-5.1-dev/source/Lib/TLibCommon/TComSlice.cpp
r628 r630 115 115 , m_noRaslOutputFlag ( false ) 116 116 , m_handleCraAsBlaFlag ( false ) 117 #endif 118 #if POC_RESET_IDC_SIGNALlING 119 , m_pocResetIdc ( 0 ) 120 , m_pocResetPeriodId ( 0 ) 121 , m_fullPocResetFlag ( false ) 122 , m_pocLsbVal ( 0 ) 123 , m_pocMsbVal ( 0 ) 124 , m_pocMsbValRequiredFlag ( false ) 125 , m_pocMsbValPresentFlag ( false ) 117 126 #endif 118 127 #endif //SVC_EXTENSION -
branches/SHM-5.1-dev/source/Lib/TLibCommon/TComSlice.h
r628 r630 2047 2047 Bool m_handleCraAsBlaFlag; 2048 2048 #endif 2049 #if POC_RESET_IDC_SIGNALlING 2050 Int m_pocResetIdc; 2051 Int m_pocResetPeriodId; 2052 Bool m_fullPocResetFlag; 2053 Int m_pocLsbVal; 2054 Int m_pocMsbVal; 2055 Bool m_pocMsbValRequiredFlag; 2056 Bool m_pocMsbValPresentFlag; 2057 #endif 2049 2058 #endif //SVC_EXTENSION 2050 2059 … … 2374 2383 2375 2384 #endif 2385 #if POC_RESET_IDC_SIGNALlING 2386 Int getPocResetIdc () { return m_pocResetIdc; } 2387 Void setPocResetIdc (Int b) { m_pocResetIdc = b; } 2388 Int getPocResetPeriodId () { return m_pocResetPeriodId; } 2389 Void setPocResetPeriodId (Int b) { m_pocResetPeriodId = b; } 2390 Bool getFullPocResetFlag () { return m_fullPocResetFlag; } 2391 Void setFullPocResetFlag (Bool b) { m_fullPocResetFlag = b; } 2392 Int getPocLsbVal () { return m_pocLsbVal; } 2393 Void setPocLsbVal (Int b) { m_pocLsbVal = b; } 2394 Int getPocMsbVal () { return m_pocMsbVal; } 2395 Void setPocMsbVal (Int b) { m_pocMsbVal = b; } 2396 Bool getPocMsbValPresentFlag () { return m_pocMsbValPresentFlag; } 2397 Void setPocMsbValPresentFlag (Bool x) { m_pocMsbValPresentFlag = x; } 2398 Bool getPocMsbValRequiredFlag () { return m_pocMsbValRequiredFlag; } 2399 Void setPocMsbValRequiredFlag (Bool x) { m_pocMsbValRequiredFlag = x; } 2400 #endif 2376 2401 2377 2402 #endif //SVC_EXTENSION -
branches/SHM-5.1-dev/source/Lib/TLibCommon/TypeDef.h
r628 r630 91 91 #define POC_RESET_FLAG 1 ///< JCTVC-N0244: POC reset flag for layer pictures. 92 92 #define POC_RESET_IDC 1 ///< JCTVC-P0041: Include poc_reset_idc and related derivation - eventually will replace POC_RESET_FLAG 93 #if POC_RESET_IDC 94 #define POC_RESET_IDC_SIGNALLING 1 ///< JCTVC-P0041: Include signalling for poc_reset related syntax elements 95 #endif 93 96 #define NO_OUTPUT_OF_PRIOR_PICS 1 ///< Use no_output_of_prior_pics_flag 94 97 #define ALIGN_TSA_STSA_PICS 1 ///< JCTVC-N0084: Alignment of TSA and STSA pictures across AU. -
branches/SHM-5.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r629 r630 2862 2862 } 2863 2863 2864 #if POC_RESET_IDC_SIGNALlING 2865 Int sliceHederExtensionLength = 0; 2866 if(pps->getSliceHeaderExtensionPresentFlag()) 2867 { 2868 READ_UVLC( uiCode, "slice_header_extension_length"); sliceHederExtensionLength = uiCode; 2869 } 2870 else 2871 { 2872 sliceHederExtensionLength = 0; 2873 } 2874 UInt startBits = m_pcBitstream->getNumBitsRead(); // Start counter of # SH Extn bits 2875 if( sliceHederExtensionLength > 0 ) 2876 { 2877 if( rpcSlice->getPPS()->getPocResetInfoPresentFlag() ) 2878 { 2879 READ_CODE( 2, uiCode, "poc_reset_idc"); rpcSlice->setPocResetIdc(uiCode); 2880 } 2881 else 2882 { 2883 rpcSlice->setPocResetIdc( 0 ); 2884 } 2885 if( rpcSlice->getPocResetIdc() > 0 ) 2886 { 2887 READ_CODE(6, uiCode, "poc_reset_period_id"); rpcSlice->setPocResetPeriodId(uiCode); 2888 } 2889 else 2890 { 2891 2892 rpcSlice->setPocResetPeriodId( 0 ); 2893 } 2894 2895 if (rpcSlice->getPocResetIdc() == 3) 2896 { 2897 READ_FLAG( uiCode, "full_poc_reset_flag"); rpcSlice->setFullPocResetFlag((uiCode == 1) ? true : false); 2898 READ_CODE(rpcSlice->getSPS()->getBitsForPOC(), uiCode,"poc_lsb_val"); rpcSlice->setPocLsbVal(uiCode); 2899 } 2900 2901 // Derive the value of PocMsbValRequiredFlag 2902 rpcSlice->setPocMsbValRequiredFlag( rpcSlice->getCraPicFlag() || rpcSlice->getBlaPicFlag() 2903 /* || related to vps_poc_lsb_aligned_flag */ 2904 ); 2905 2906 if( rpcSlice->getPocMsbValRequiredFlag() /* vps_poc_lsb_aligned_flag */ ) 2907 { 2908 READ_FLAG( uiCode, "poc_msb_val_present_flag"); rpcSlice->setPocMsbValPresentFlag( uiCode ? true : false ); 2909 } 2910 else 2911 { 2912 if( rpcSlice->getPocMsbValRequiredFlag() ) 2913 { 2914 rpcSlice->setPocMsbValPresentFlag( true ); 2915 } 2916 else 2917 { 2918 rpcSlice->setPocMsbValPresentFlag( false ); 2919 } 2920 } 2921 2922 Int maxPocLsb = 1 << rpcSlice->getSPS()->getBitsForPOC(); 2923 if( rpcSlice->getPocMsbValPresentFlag() ) 2924 { 2925 READ_UVLC( uiCode, "poc_msb_val"); rpcSlice->setPocMsbVal( uiCode ); 2926 // Update POC of the slice based on this MSB val 2927 Int pocLsb = rpcSlice->getPOC() % maxPocLsb; 2928 rpcSlice->setPOC((rpcSlice->getPocMsbVal() * maxPocLsb) + pocLsb); 2929 } 2930 else 2931 { 2932 rpcSlice->setPocMsbVal( rpcSlice->getPOC() / maxPocLsb ); 2933 } 2934 2935 // Read remaining bits in the slice header extension. 2936 UInt endBits = m_pcBitstream->getNumBitsRead(); 2937 Int counter = (endBits - startBits) % 8; 2938 if( counter ) 2939 { 2940 counter = 8 - counter; 2941 } 2942 2943 while( counter ) 2944 { 2945 READ_FLAG( uiCode, "slice_segment_header_extension_reserved_bit" ); assert( uiCode == 1 ); 2946 counter--; 2947 } 2948 } 2949 #else 2864 2950 if(pps->getSliceHeaderExtensionPresentFlag()) 2865 2951 { … … 2871 2957 } 2872 2958 } 2959 #endif 2873 2960 m_pcBitstream->readByteAlignment(); 2874 2961 -
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.