Changeset 125 in SHVCSoftware for trunk/source/Lib/TLibDecoder
- Timestamp:
- 16 Apr 2013, 06:39:31 (12 years ago)
- Location:
- trunk/source/Lib/TLibDecoder
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibDecoder/AnnexBread.cpp
r2 r125 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 31 31 * THE POSSIBILITY OF SUCH DAMAGE. 32 32 */ 33 34 /** 35 \file AnnexBread.cpp 36 \brief reading functions for Annex B byte streams 37 */ 38 33 39 34 40 #include <stdint.h> … … 147 153 * otherwise true. 148 154 */ 149 bool155 Bool 150 156 byteStreamNALUnit( 151 157 InputByteStream& bs, … … 153 159 AnnexBStats& stats) 154 160 { 155 bool eof = false;161 Bool eof = false; 156 162 try 157 163 { … … 162 168 eof = true; 163 169 } 164 stats.m_numBytesInNALUnit = unsigned(nalUnit.size());170 stats.m_numBytesInNALUnit = UInt(nalUnit.size()); 165 171 return eof; 166 172 } -
trunk/source/Lib/TLibDecoder/AnnexBread.h
r2 r125 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 32 32 */ 33 33 34 /** 35 \file AnnexBread.h 36 \brief reading functions for Annex B byte streams 37 */ 38 34 39 #pragma once 35 40 … … 37 42 #include <istream> 38 43 #include <vector> 44 45 #include "TLibCommon/TypeDef.h" 39 46 40 47 //! \ingroup TLibDecoder … … 75 82 * n bytes. 76 83 */ 77 bool eofBeforeNBytes(unsignedn)84 Bool eofBeforeNBytes(UInt n) 78 85 { 79 86 assert(n <= 4); … … 84 91 try 85 92 { 86 for ( unsignedi = 0; i < n; i++)93 for (UInt i = 0; i < n; i++) 87 94 { 88 95 m_FutureBytes = (m_FutureBytes << 8) | m_Input.get(); … … 109 116 * 110 117 */ 111 uint32_t peekBytes( unsignedn)118 uint32_t peekBytes(UInt n) 112 119 { 113 120 eofBeforeNBytes(n); … … 139 146 * the return value. 140 147 */ 141 uint32_t readBytes( unsignedn)148 uint32_t readBytes(UInt n) 142 149 { 143 150 uint32_t val = 0; 144 for ( unsignedi = 0; i < n; i++)151 for (UInt i = 0; i < n; i++) 145 152 val = (val << 8) | readByte(); 146 153 return val; … … 148 155 149 156 private: 150 unsignedm_NumFutureBytes; /* number of valid bytes in m_FutureBytes */157 UInt m_NumFutureBytes; /* number of valid bytes in m_FutureBytes */ 151 158 uint32_t m_FutureBytes; /* bytes that have been peeked */ 152 159 std::istream& m_Input; /* Input stream to read from */ … … 158 165 struct AnnexBStats 159 166 { 160 unsignedm_numLeadingZero8BitsBytes;161 unsignedm_numZeroByteBytes;162 unsignedm_numStartCodePrefixBytes;163 unsignedm_numBytesInNALUnit;164 unsignedm_numTrailingZero8BitsBytes;167 UInt m_numLeadingZero8BitsBytes; 168 UInt m_numZeroByteBytes; 169 UInt m_numStartCodePrefixBytes; 170 UInt m_numBytesInNALUnit; 171 UInt m_numTrailingZero8BitsBytes; 165 172 166 173 AnnexBStats& operator+=(const AnnexBStats& rhs) … … 175 182 }; 176 183 177 bool byteStreamNALUnit(InputByteStream& bs, std::vector<uint8_t>& nalUnit, AnnexBStats& stats);184 Bool byteStreamNALUnit(InputByteStream& bs, std::vector<uint8_t>& nalUnit, AnnexBStats& stats); 178 185 179 186 //! \} -
trunk/source/Lib/TLibDecoder/NALread.cpp
r2 r125 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 32 32 */ 33 33 34 /** 35 \file NALread.cpp 36 \brief reading funtionality for NAL units 37 */ 38 39 34 40 #include <vector> 35 41 #include <algorithm> … … 44 50 //! \ingroup TLibDecoder 45 51 //! \{ 46 static void convertPayloadToRBSP(vector<uint8_t>& nalUnitBuf, TComInputBitstream *pcBitstream)52 static void convertPayloadToRBSP(vector<uint8_t>& nalUnitBuf, Bool isVclNalUnit) 47 53 { 48 unsignedzeroCount = 0;54 UInt zeroCount = 0; 49 55 vector<uint8_t>::iterator it_read, it_write; 50 56 51 57 for (it_read = it_write = nalUnitBuf.begin(); it_read != nalUnitBuf.end(); it_read++, it_write++) 52 58 { 59 assert(zeroCount < 2 || *it_read >= 0x03); 53 60 if (zeroCount == 2 && *it_read == 0x03) 54 61 { 55 62 it_read++; 56 63 zeroCount = 0; 64 if (it_read == nalUnitBuf.end()) 65 { 66 break; 67 } 57 68 } 58 69 zeroCount = (*it_read == 0x00) ? zeroCount+1 : 0; 59 70 *it_write = *it_read; 71 } 72 assert(zeroCount == 0); 73 74 if (isVclNalUnit) 75 { 76 // Remove cabac_zero_word from payload if present 77 Int n = 0; 78 79 while (it_write[-1] == 0x00) 80 { 81 it_write--; 82 n++; 83 } 84 85 if (n > 0) 86 { 87 printf("\nDetected %d instances of cabac_zero_word", n/2); 88 } 60 89 } 61 90 … … 63 92 } 64 93 65 #if NAL_UNIT_HEADER66 94 Void readNalUnitHeader(InputNALUnit& nalu) 67 95 { 68 96 TComInputBitstream& bs = *nalu.m_Bitstream; 69 97 70 bool forbidden_zero_bit = bs.read(1); // forbidden_zero_bit98 Bool forbidden_zero_bit = bs.read(1); // forbidden_zero_bit 71 99 assert(forbidden_zero_bit == 0); 72 100 nalu.m_nalUnitType = (NalUnitType) bs.read(6); // nal_unit_type 101 nalu.m_reservedZero6Bits = bs.read(6); // nuh_reserved_zero_6bits 73 102 #if SVC_EXTENSION 74 nalu.m_reservedZero6Bits = bs.read(6); // nuh_reserved_zero_6bits75 103 nalu.m_layerId = nalu.m_reservedZero6Bits; 76 104 #else 77 #if TARGET_DECLAYERID_SET78 nalu.m_reservedZero6Bits = bs.read(6); // nuh_reserved_zero_6bits79 105 assert(nalu.m_reservedZero6Bits == 0); 80 #else81 unsigned reserved_one_6bits = bs.read(6); // nuh_reserved_zero_6bits82 assert(reserved_one_6bits == 0);83 #endif84 106 #endif 85 107 nalu.m_temporalId = bs.read(3) - 1; // nuh_temporal_id_plus1 … … 87 109 if ( nalu.m_temporalId ) 88 110 { 89 #if NAL_UNIT_TYPES_J1003_D790 111 assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA 91 112 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLANT … … 98 119 && nalu.m_nalUnitType != NAL_UNIT_EOS 99 120 && nalu.m_nalUnitType != NAL_UNIT_EOB ); 100 #else101 assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_CRA102 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_CRANT103 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA104 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLANT105 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR106 && nalu.m_nalUnitType != NAL_UNIT_VPS107 && nalu.m_nalUnitType != NAL_UNIT_SPS );108 #endif109 121 } 110 122 else 111 123 { 112 #if NAL_UNIT_TYPES_J1003_D7113 124 assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TLA 114 125 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_N 115 126 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_STSA_R 116 127 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_STSA_N ); 117 #else118 assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TLA );119 #endif120 128 } 121 129 } 122 #endif123 130 /** 124 131 * create a NALunit structure with given header values and storage for … … 129 136 /* perform anti-emulation prevention */ 130 137 TComInputBitstream *pcBitstream = new TComInputBitstream(NULL); 131 convertPayloadToRBSP(nalUnitBuf, pcBitstream);132 138 convertPayloadToRBSP(nalUnitBuf, (nalUnitBuf[0] & 64) == 0); 139 133 140 nalu.m_Bitstream = new TComInputBitstream(&nalUnitBuf); 134 141 delete pcBitstream; 135 #if NAL_UNIT_HEADER136 142 readNalUnitHeader(nalu); 137 #else138 TComInputBitstream& bs = *nalu.m_Bitstream;139 140 bool forbidden_zero_bit = bs.read(1);141 assert(forbidden_zero_bit == 0);142 #if !REMOVE_NAL_REF_FLAG143 nalu.m_nalRefFlag = (bs.read(1) != 0 );144 #endif145 nalu.m_nalUnitType = (NalUnitType) bs.read(6);146 #if REMOVE_NAL_REF_FLAG147 unsigned reserved_one_6bits = bs.read(6);148 assert(reserved_one_6bits == 0);149 #endif150 #if TEMPORAL_ID_PLUS1151 nalu.m_temporalId = bs.read(3) - 1;152 #if !REMOVE_NAL_REF_FLAG153 unsigned reserved_one_5bits = bs.read(5);154 assert(reserved_one_5bits == 0);155 #endif156 #else157 nalu.m_temporalId = bs.read(3);158 unsigned reserved_one_5bits = bs.read(5);159 #if SVC_EXTENSION160 assert(reserved_one_5bits >= 1);161 nalu.m_layerId = reserved_one_5bits - 1;162 #else163 assert(reserved_one_5bits == 1);164 #endif165 #endif166 167 if ( nalu.m_temporalId )168 {169 #if NAL_UNIT_TYPES_J1003_D7170 assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA171 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLANT172 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_N_LP173 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR174 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR_N_LP175 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_CRA );176 #else177 assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_CRA178 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_CRANT179 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA180 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLANT181 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR );182 #endif183 }184 #endif185 143 } 186 144 //! \} -
trunk/source/Lib/TLibDecoder/NALread.h
r2 r125 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 32 32 */ 33 33 34 /** 35 \file NALread.h 36 \brief reading funtionality for NAL units 37 */ 38 34 39 #pragma once 35 40 -
trunk/source/Lib/TLibDecoder/SEIread.cpp
r2 r125 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 32 32 */ 33 33 34 /** 35 \file SEIread.cpp 36 \brief reading functionality for SEI messages 37 */ 38 34 39 #include "TLibCommon/CommonDef.h" 35 40 #include "TLibCommon/TComBitStream.h" … … 55 60 fprintf( g_hTrace, "=========== Decoded picture hash SEI message ===========\n"); 56 61 break; 57 #if ACTIVE_PARAMETER_SETS_SEI_MESSAGE58 case SEI::ACTIVE_PARAMETER_SETS:59 fprintf( g_hTrace, "=========== Active Parameter Sets SEI message ===========\n");60 break;61 #endif62 62 case SEI::USER_DATA_UNREGISTERED: 63 63 fprintf( g_hTrace, "=========== User Data Unregistered SEI message ===========\n"); 64 break; 65 case SEI::ACTIVE_PARAMETER_SETS: 66 fprintf( g_hTrace, "=========== Active Parameter sets SEI message ===========\n"); 67 break; 68 case SEI::BUFFERING_PERIOD: 69 fprintf( g_hTrace, "=========== Buffering period SEI message ===========\n"); 70 break; 71 case SEI::PICTURE_TIMING: 72 fprintf( g_hTrace, "=========== Picture timing SEI message ===========\n"); 73 break; 74 case SEI::RECOVERY_POINT: 75 fprintf( g_hTrace, "=========== Recovery point SEI message ===========\n"); 76 break; 77 case SEI::FRAME_PACKING: 78 fprintf( g_hTrace, "=========== Frame Packing Arrangement SEI message ===========\n"); 79 break; 80 case SEI::DISPLAY_ORIENTATION: 81 fprintf( g_hTrace, "=========== Display Orientation SEI message ===========\n"); 82 break; 83 case SEI::TEMPORAL_LEVEL0_INDEX: 84 fprintf( g_hTrace, "=========== Temporal Level Zero Index SEI message ===========\n"); 85 break; 86 case SEI::REGION_REFRESH_INFO: 87 fprintf( g_hTrace, "=========== Gradual Decoding Refresh Information SEI message ===========\n"); 88 break; 89 case SEI::DECODING_UNIT_INFO: 90 fprintf( g_hTrace, "=========== Decoding Unit Information SEI message ===========\n"); 64 91 break; 65 92 default: … … 73 100 * unmarshal a single SEI message from bitstream bs 74 101 */ 75 void SEIReader::parseSEImessage(TComInputBitstream* bs, SEI messages& seis)102 void SEIReader::parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps) 76 103 { 77 104 setBitstream(bs); … … 80 107 do 81 108 { 82 xReadSEImessage(seis );109 xReadSEImessage(seis, nalUnitType, sps); 83 110 /* SEI messages are an integer number of bytes, something has failed 84 111 * in the parsing if bitstream not byte-aligned */ 85 112 assert(!m_pcBitstream->getNumBitsUntilByteAligned()); 86 } while (0x80 != m_pcBitstream->peekBits(8)); 87 assert(m_pcBitstream->getNumBitsLeft() == 8); /* rsbp_trailing_bits */ 88 } 89 90 Void SEIReader::xReadSEImessage(SEImessages& seis) 113 } while (m_pcBitstream->getNumBitsLeft() > 8); 114 115 UInt rbspTrailingBits; 116 READ_CODE(8, rbspTrailingBits, "rbsp_trailing_bits"); 117 assert(rbspTrailingBits == 0x80); 118 } 119 120 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps) 91 121 { 92 122 #if ENC_DEC_TRACE … … 113 143 #endif 114 144 115 switch (payloadType) 116 { 117 case SEI::USER_DATA_UNREGISTERED: 118 seis.user_data_unregistered = new SEIuserDataUnregistered; 119 xParseSEIuserDataUnregistered(*seis.user_data_unregistered, payloadSize); 120 break; 121 #if ACTIVE_PARAMETER_SETS_SEI_MESSAGE 122 case SEI::ACTIVE_PARAMETER_SETS: 123 seis.active_parameter_sets = new SEIActiveParameterSets; 124 xParseSEIActiveParameterSets(*seis.active_parameter_sets, payloadSize); 125 break; 126 #endif 127 case SEI::DECODED_PICTURE_HASH: 128 seis.picture_digest = new SEIDecodedPictureHash; 129 xParseSEIDecodedPictureHash(*seis.picture_digest, payloadSize); 130 break; 131 #if BUFFERING_PERIOD_AND_TIMING_SEI 132 case SEI::BUFFERING_PERIOD: 133 seis.buffering_period = new SEIBufferingPeriod; 134 seis.buffering_period->m_sps = seis.m_pSPS; 135 xParseSEIBufferingPeriod(*seis.buffering_period, payloadSize); 136 break; 137 case SEI::PICTURE_TIMING: 138 seis.picture_timing = new SEIPictureTiming; 139 seis.picture_timing->m_sps = seis.m_pSPS; 140 xParseSEIPictureTiming(*seis.picture_timing, payloadSize); 141 break; 142 #endif 143 #if RECOVERY_POINT_SEI 144 case SEI::RECOVERY_POINT: 145 seis.recovery_point = new SEIRecoveryPoint; 146 xParseSEIRecoveryPoint(*seis.recovery_point, payloadSize); 147 break; 148 #endif 149 default: 150 assert(!"Unhandled SEI message"); 151 } 145 /* extract the payload for this single SEI message. 146 * This allows greater safety in erroneous parsing of an SEI message 147 * from affecting subsequent messages. 148 * After parsing the payload, bs needs to be restored as the primary 149 * bitstream. 150 */ 151 TComInputBitstream *bs = getBitstream(); 152 setBitstream(bs->extractSubstream(payloadSize * 8)); 153 154 SEI *sei = NULL; 155 156 if(nalUnitType == NAL_UNIT_SEI) 157 { 158 switch (payloadType) 159 { 160 case SEI::USER_DATA_UNREGISTERED: 161 sei = new SEIuserDataUnregistered; 162 xParseSEIuserDataUnregistered((SEIuserDataUnregistered&) *sei, payloadSize); 163 break; 164 case SEI::ACTIVE_PARAMETER_SETS: 165 sei = new SEIActiveParameterSets; 166 xParseSEIActiveParameterSets((SEIActiveParameterSets&) *sei, payloadSize); 167 break; 168 case SEI::DECODING_UNIT_INFO: 169 if (!sps) 170 { 171 printf ("Warning: Found Decoding unit SEI message, but no active SPS is available. Ignoring."); 172 } 173 else 174 { 175 sei = new SEIDecodingUnitInfo; 176 xParseSEIDecodingUnitInfo((SEIDecodingUnitInfo&) *sei, payloadSize, sps); 177 } 178 break; 179 case SEI::BUFFERING_PERIOD: 180 if (!sps) 181 { 182 printf ("Warning: Found Buffering period SEI message, but no active SPS is available. Ignoring."); 183 } 184 else 185 { 186 sei = new SEIBufferingPeriod; 187 xParseSEIBufferingPeriod((SEIBufferingPeriod&) *sei, payloadSize, sps); 188 } 189 break; 190 case SEI::PICTURE_TIMING: 191 if (!sps) 192 { 193 printf ("Warning: Found Picture timing SEI message, but no active SPS is available. Ignoring."); 194 } 195 else 196 { 197 sei = new SEIPictureTiming; 198 xParseSEIPictureTiming((SEIPictureTiming&)*sei, payloadSize, sps); 199 } 200 break; 201 case SEI::RECOVERY_POINT: 202 sei = new SEIRecoveryPoint; 203 xParseSEIRecoveryPoint((SEIRecoveryPoint&) *sei, payloadSize); 204 break; 205 case SEI::FRAME_PACKING: 206 sei = new SEIFramePacking; 207 xParseSEIFramePacking((SEIFramePacking&) *sei, payloadSize); 208 break; 209 case SEI::DISPLAY_ORIENTATION: 210 sei = new SEIDisplayOrientation; 211 xParseSEIDisplayOrientation((SEIDisplayOrientation&) *sei, payloadSize); 212 break; 213 case SEI::TEMPORAL_LEVEL0_INDEX: 214 sei = new SEITemporalLevel0Index; 215 xParseSEITemporalLevel0Index((SEITemporalLevel0Index&) *sei, payloadSize); 216 break; 217 case SEI::REGION_REFRESH_INFO: 218 sei = new SEIGradualDecodingRefreshInfo; 219 xParseSEIGradualDecodingRefreshInfo((SEIGradualDecodingRefreshInfo&) *sei, payloadSize); 220 break; 221 default: 222 for (UInt i = 0; i < payloadSize; i++) 223 { 224 UInt seiByte; 225 READ_CODE (8, seiByte, "unknown prefix SEI payload byte"); 226 } 227 printf ("Unknown prefix SEI message (payloadType = %d) was found!\n", payloadType); 228 } 229 } 230 else 231 { 232 switch (payloadType) 233 { 234 #if L0363_SEI_ALLOW_SUFFIX 235 case SEI::USER_DATA_UNREGISTERED: 236 sei = new SEIuserDataUnregistered; 237 xParseSEIuserDataUnregistered((SEIuserDataUnregistered&) *sei, payloadSize); 238 break; 239 #endif 240 case SEI::DECODED_PICTURE_HASH: 241 sei = new SEIDecodedPictureHash; 242 xParseSEIDecodedPictureHash((SEIDecodedPictureHash&) *sei, payloadSize); 243 break; 244 default: 245 for (UInt i = 0; i < payloadSize; i++) 246 { 247 UInt seiByte; 248 READ_CODE (8, seiByte, "unknown suffix SEI payload byte"); 249 } 250 printf ("Unknown suffix SEI message (payloadType = %d) was found!\n", payloadType); 251 } 252 } 253 if (sei != NULL) 254 { 255 seis.push_back(sei); 256 } 257 258 /* By definition the underlying bitstream terminates in a byte-aligned manner. 259 * 1. Extract all bar the last MIN(bitsremaining,nine) bits as reserved_payload_extension_data 260 * 2. Examine the final 8 bits to determine the payload_bit_equal_to_one marker 261 * 3. Extract the remainingreserved_payload_extension_data bits. 262 * 263 * If there are fewer than 9 bits available, extract them. 264 */ 265 Int payloadBitsRemaining = getBitstream()->getNumBitsLeft(); 266 if (payloadBitsRemaining) /* more_data_in_payload() */ 267 { 268 for (; payloadBitsRemaining > 9; payloadBitsRemaining--) 269 { 270 UInt reservedPayloadExtensionData; 271 READ_CODE (1, reservedPayloadExtensionData, "reserved_payload_extension_data"); 272 } 273 274 /* 2 */ 275 Int finalBits = getBitstream()->peekBits(payloadBitsRemaining); 276 Int finalPayloadBits = 0; 277 for (Int mask = 0xff; finalBits & (mask >> finalPayloadBits); finalPayloadBits++) 278 { 279 continue; 280 } 281 282 /* 3 */ 283 for (; payloadBitsRemaining > 9 - finalPayloadBits; payloadBitsRemaining--) 284 { 285 UInt reservedPayloadExtensionData; 286 READ_CODE (1, reservedPayloadExtensionData, "reserved_payload_extension_data"); 287 } 288 289 UInt dummy; 290 READ_CODE (1, dummy, "payload_bit_equal_to_one"); 291 READ_CODE (payloadBitsRemaining-1, dummy, "payload_bit_equal_to_zero"); 292 } 293 294 /* restore primary bitstream for sei_message */ 295 delete getBitstream(); 296 setBitstream(bs); 152 297 } 153 298 … … 186 331 * of payloadSize bytes into sei. 187 332 */ 188 Void SEIReader::xParseSEIDecodedPictureHash(SEIDecodedPictureHash& sei, UInt payloadSize)333 Void SEIReader::xParseSEIDecodedPictureHash(SEIDecodedPictureHash& sei, UInt /*payloadSize*/) 189 334 { 190 335 UInt val; 191 336 READ_CODE (8, val, "hash_type"); 192 337 sei.method = static_cast<SEIDecodedPictureHash::Method>(val); 193 for( int yuvIdx = 0; yuvIdx < 3; yuvIdx++)338 for(Int yuvIdx = 0; yuvIdx < 3; yuvIdx++) 194 339 { 195 340 if(SEIDecodedPictureHash::MD5 == sei.method) 196 341 { 197 for ( unsignedi = 0; i < 16; i++)342 for (UInt i = 0; i < 16; i++) 198 343 { 199 344 READ_CODE(8, val, "picture_md5"); … … 217 362 } 218 363 } 219 #if ACTIVE_PARAMETER_SETS_SEI_MESSAGE 220 Void SEIReader::xParseSEIActiveParameterSets(SEIActiveParameterSets& sei, unsigned payloadSize) 364 Void SEIReader::xParseSEIActiveParameterSets(SEIActiveParameterSets& sei, UInt /*payloadSize*/) 221 365 { 222 366 UInt val; 223 READ_CODE(4, val, "active_vps_id"); 224 sei.activeVPSId = val; 225 226 READ_CODE(1, val, "active_sps_id_present_flag"); 227 sei.activeSPSIdPresentFlag = val; 228 229 if(sei.activeSPSIdPresentFlag) 230 { 231 READ_UVLC(val, "active_seq_param_set_id"); 232 sei.activeSeqParamSetId = val; 233 } 234 235 READ_CODE(1, val, "active_param_set_sei_extension_flag"); 236 sei.activeParamSetSEIExtensionFlag = val; 237 367 READ_CODE(4, val, "active_vps_id"); sei.activeVPSId = val; 368 #if L0047_APS_FLAGS 369 READ_FLAG( val, "full_random_access_flag"); sei.m_fullRandomAccessFlag = val ? true : false; 370 READ_FLAG( val, "no_param_set_update_flag"); sei.m_noParamSetUpdateFlag = val ? true : false; 371 #endif 372 READ_UVLC( val, "num_sps_ids_minus1"); sei.numSpsIdsMinus1 = val; 373 374 sei.activeSeqParamSetId.resize(sei.numSpsIdsMinus1 + 1); 375 for (Int i=0; i < (sei.numSpsIdsMinus1 + 1); i++) 376 { 377 READ_UVLC(val, "active_seq_param_set_id"); sei.activeSeqParamSetId[i] = val; 378 } 379 238 380 UInt uibits = m_pcBitstream->getNumBitsUntilByteAligned(); 239 381 … … 243 385 } 244 386 } 245 #endif 246 247 #if BUFFERING_PERIOD_AND_TIMING_SEI 248 Void SEIReader::xParseSEIBufferingPeriod(SEIBufferingPeriod& sei, UInt payloadSize) 387 388 Void SEIReader::xParseSEIDecodingUnitInfo(SEIDecodingUnitInfo& sei, UInt /*payloadSize*/, TComSPS *sps) 389 { 390 UInt val; 391 READ_UVLC(val, "decoding_unit_idx"); 392 sei.m_decodingUnitIdx = val; 393 394 TComVUI *vui = sps->getVuiParameters(); 395 if(vui->getHrdParameters()->getSubPicCpbParamsInPicTimingSEIFlag()) 396 { 397 READ_CODE( ( vui->getHrdParameters()->getDuCpbRemovalDelayLengthMinus1() + 1 ), val, "du_spt_cpb_removal_delay"); 398 sei.m_duSptCpbRemovalDelay = val; 399 } 400 else 401 { 402 sei.m_duSptCpbRemovalDelay = 0; 403 } 404 #if L0044_DU_DPB_OUTPUT_DELAY_HRD 405 READ_FLAG( val, "dpb_output_du_delay_present_flag"); sei.m_dpbOutputDuDelayPresentFlag = val ? true : false; 406 if(sei.m_dpbOutputDuDelayPresentFlag) 407 { 408 READ_CODE(vui->getHrdParameters()->getDpbOutputDelayDuLengthMinus1() + 1, val, "pic_spt_dpb_output_du_delay"); 409 sei.m_picSptDpbOutputDuDelay = val; 410 } 411 #endif 412 xParseByteAlign(); 413 } 414 415 Void SEIReader::xParseSEIBufferingPeriod(SEIBufferingPeriod& sei, UInt /*payloadSize*/, TComSPS *sps) 249 416 { 250 417 Int i, nalOrVcl; 251 418 UInt code; 252 419 253 TComVUI *pVUI = sei.m_sps->getVuiParameters(); 254 255 READ_UVLC( code, "seq_parameter_set_id" ); sei.m_seqParameterSetId = code; 256 if( !pVUI->getSubPicCpbParamsPresentFlag() ) 257 { 258 READ_FLAG( code, "alt_cpb_params_present_flag" ); sei.m_altCpbParamsPresentFlag = code; 259 } 260 420 TComVUI *pVUI = sps->getVuiParameters(); 421 TComHRD *pHRD = pVUI->getHrdParameters(); 422 423 READ_UVLC( code, "bp_seq_parameter_set_id" ); sei.m_bpSeqParameterSetId = code; 424 if( !pHRD->getSubPicCpbParamsPresentFlag() ) 425 { 426 READ_FLAG( code, "rap_cpb_params_present_flag" ); sei.m_rapCpbParamsPresentFlag = code; 427 } 428 #if L0328_SPLICING 429 //read splicing flag and cpb_removal_delay_delta 430 READ_FLAG( code, "concatenation_flag"); 431 sei.m_concatenationFlag = code; 432 READ_CODE( ( pHRD->getCpbRemovalDelayLengthMinus1() + 1 ), code, "au_cpb_removal_delay_delta_minus1" ); 433 sei.m_auCpbRemovalDelayDelta = code + 1; 434 #endif 435 #if L0044_CPB_DPB_DELAY_OFFSET 436 if( sei.m_rapCpbParamsPresentFlag ) 437 { 438 READ_CODE( pHRD->getCpbRemovalDelayLengthMinus1() + 1, code, "cpb_delay_offset" ); sei.m_cpbDelayOffset = code; 439 READ_CODE( pHRD->getDpbOutputDelayLengthMinus1() + 1, code, "dpb_delay_offset" ); sei.m_dpbDelayOffset = code; 440 } 441 #endif 261 442 for( nalOrVcl = 0; nalOrVcl < 2; nalOrVcl ++ ) 262 443 { 263 if( ( ( nalOrVcl == 0 ) && ( p VUI->getNalHrdParametersPresentFlag() ) ) ||264 ( ( nalOrVcl == 1 ) && ( p VUI->getVclHrdParametersPresentFlag() ) ) )265 { 266 for( i = 0; i < ( p VUI->getCpbCntMinus1( 0 ) + 1 ); i ++ )267 { 268 READ_CODE( ( p VUI->getInitialCpbRemovalDelayLengthMinus1() + 1 ) , code, "initial_cpb_removal_delay" );444 if( ( ( nalOrVcl == 0 ) && ( pHRD->getNalHrdParametersPresentFlag() ) ) || 445 ( ( nalOrVcl == 1 ) && ( pHRD->getVclHrdParametersPresentFlag() ) ) ) 446 { 447 for( i = 0; i < ( pHRD->getCpbCntMinus1( 0 ) + 1 ); i ++ ) 448 { 449 READ_CODE( ( pHRD->getInitialCpbRemovalDelayLengthMinus1() + 1 ) , code, "initial_cpb_removal_delay" ); 269 450 sei.m_initialCpbRemovalDelay[i][nalOrVcl] = code; 270 READ_CODE( ( p VUI->getInitialCpbRemovalDelayLengthMinus1() + 1 ) , code, "initial_cpb_removal_delay_offset" );451 READ_CODE( ( pHRD->getInitialCpbRemovalDelayLengthMinus1() + 1 ) , code, "initial_cpb_removal_delay_offset" ); 271 452 sei.m_initialCpbRemovalDelayOffset[i][nalOrVcl] = code; 272 if( p VUI->getSubPicCpbParamsPresentFlag() || sei.m_altCpbParamsPresentFlag )453 if( pHRD->getSubPicCpbParamsPresentFlag() || sei.m_rapCpbParamsPresentFlag ) 273 454 { 274 READ_CODE( ( p VUI->getInitialCpbRemovalDelayLengthMinus1() + 1 ) , code, "initial_alt_cpb_removal_delay" );455 READ_CODE( ( pHRD->getInitialCpbRemovalDelayLengthMinus1() + 1 ) , code, "initial_alt_cpb_removal_delay" ); 275 456 sei.m_initialAltCpbRemovalDelay[i][nalOrVcl] = code; 276 READ_CODE( ( p VUI->getInitialCpbRemovalDelayLengthMinus1() + 1 ) , code, "initial_alt_cpb_removal_delay_offset" );457 READ_CODE( ( pHRD->getInitialCpbRemovalDelayLengthMinus1() + 1 ) , code, "initial_alt_cpb_removal_delay_offset" ); 277 458 sei.m_initialAltCpbRemovalDelayOffset[i][nalOrVcl] = code; 278 459 } … … 282 463 xParseByteAlign(); 283 464 } 284 Void SEIReader::xParseSEIPictureTiming(SEIPictureTiming& sei, UInt payloadSize)465 Void SEIReader::xParseSEIPictureTiming(SEIPictureTiming& sei, UInt /*payloadSize*/, TComSPS *sps) 285 466 { 286 467 Int i; 287 468 UInt code; 288 469 289 TComVUI *vui = sei.m_sps->getVuiParameters(); 290 291 if( !vui->getNalHrdParametersPresentFlag() && !vui->getVclHrdParametersPresentFlag() ) 470 TComVUI *vui = sps->getVuiParameters(); 471 TComHRD *hrd = vui->getHrdParameters(); 472 473 #if !L0045_CONDITION_SIGNALLING 474 // This condition was probably OK before the pic_struct, progressive_source_idc, duplicate_flag were added 475 if( !hrd->getNalHrdParametersPresentFlag() && !hrd->getVclHrdParametersPresentFlag() ) 292 476 { 293 477 return; 294 478 } 295 296 READ_CODE( ( vui->getCpbRemovalDelayLengthMinus1() + 1 ), code, "au_cpb_removal_delay" ); 297 sei.m_auCpbRemovalDelay = code; 298 READ_CODE( ( vui->getDpbOutputDelayLengthMinus1() + 1 ), code, "pic_dpb_output_delay" ); 299 sei.m_picDpbOutputDelay = code; 300 301 if( sei.m_sps->getVuiParameters()->getSubPicCpbParamsPresentFlag() ) 302 { 303 READ_UVLC( code, "num_decoding_units_minus1"); 304 sei.m_numDecodingUnitsMinus1 = code; 305 READ_FLAG( code, "du_common_cpb_removal_delay_flag" ); 306 sei.m_duCommonCpbRemovalDelayFlag = code; 307 if( sei.m_duCommonCpbRemovalDelayFlag ) 308 { 309 READ_CODE( ( vui->getDuCpbRemovalDelayLengthMinus1() + 1 ), code, "du_common_cpb_removal_delay_minus1" ); 310 sei.m_duCommonCpbRemovalDelayMinus1 = code; 311 } 312 else 313 { 479 #endif 480 481 if( vui->getFrameFieldInfoPresentFlag() ) 482 { 483 READ_CODE( 4, code, "pic_struct" ); sei.m_picStruct = code; 484 #if L0046_RENAME_PROG_SRC_IDC 485 READ_CODE( 2, code, "source_scan_type" ); sei.m_sourceScanType = code; 486 #else 487 READ_CODE( 2, code, "progressive_source_idc" ); sei.m_progressiveSourceIdc = code; 488 #endif 489 READ_FLAG( code, "duplicate_flag" ); sei.m_duplicateFlag = ( code == 1 ? true : false ); 490 } 491 492 #if L0045_CONDITION_SIGNALLING 493 if( hrd->getCpbDpbDelaysPresentFlag()) 494 { 495 #endif 496 READ_CODE( ( hrd->getCpbRemovalDelayLengthMinus1() + 1 ), code, "au_cpb_removal_delay_minus1" ); 497 sei.m_auCpbRemovalDelay = code + 1; 498 READ_CODE( ( hrd->getDpbOutputDelayLengthMinus1() + 1 ), code, "pic_dpb_output_delay" ); 499 sei.m_picDpbOutputDelay = code; 500 501 #if L0044_DU_DPB_OUTPUT_DELAY_HRD 502 if(hrd->getSubPicCpbParamsPresentFlag()) 503 { 504 READ_CODE(hrd->getDpbOutputDelayDuLengthMinus1()+1, code, "pic_dpb_output_du_delay" ); 505 sei.m_picDpbOutputDuDelay = code; 506 } 507 #endif 508 if( hrd->getSubPicCpbParamsPresentFlag() && hrd->getSubPicCpbParamsInPicTimingSEIFlag() ) 509 { 510 READ_UVLC( code, "num_decoding_units_minus1"); 511 sei.m_numDecodingUnitsMinus1 = code; 512 READ_FLAG( code, "du_common_cpb_removal_delay_flag" ); 513 sei.m_duCommonCpbRemovalDelayFlag = code; 514 if( sei.m_duCommonCpbRemovalDelayFlag ) 515 { 516 READ_CODE( ( hrd->getDuCpbRemovalDelayLengthMinus1() + 1 ), code, "du_common_cpb_removal_delay_minus1" ); 517 sei.m_duCommonCpbRemovalDelayMinus1 = code; 518 } 314 519 if( sei.m_numNalusInDuMinus1 != NULL ) 315 520 { … … 323 528 sei.m_duCpbRemovalDelayMinus1 = new UInt[ ( sei.m_numDecodingUnitsMinus1 + 1 ) ]; 324 529 325 for( i = 0; i < ( sei.m_numDecodingUnitsMinus1 + 1 ); i ++ )530 for( i = 0; i <= sei.m_numDecodingUnitsMinus1; i ++ ) 326 531 { 327 532 READ_UVLC( code, "num_nalus_in_du_minus1"); 328 533 sei.m_numNalusInDuMinus1[ i ] = code; 329 READ_CODE( ( vui->getDuCpbRemovalDelayLengthMinus1() + 1 ), code, "du_cpb_removal_delay_minus1" ); 330 sei.m_duCpbRemovalDelayMinus1[ i ] = code; 331 } 332 } 333 } 334 xParseByteAlign(); 335 } 336 #endif 337 #if RECOVERY_POINT_SEI 338 Void SEIReader::xParseSEIRecoveryPoint(SEIRecoveryPoint& sei, UInt payloadSize) 534 if( ( !sei.m_duCommonCpbRemovalDelayFlag ) && ( i < sei.m_numDecodingUnitsMinus1 ) ) 535 { 536 READ_CODE( ( hrd->getDuCpbRemovalDelayLengthMinus1() + 1 ), code, "du_cpb_removal_delay_minus1" ); 537 sei.m_duCpbRemovalDelayMinus1[ i ] = code; 538 } 539 } 540 } 541 #if L0045_CONDITION_SIGNALLING 542 } 543 #endif 544 xParseByteAlign(); 545 } 546 Void SEIReader::xParseSEIRecoveryPoint(SEIRecoveryPoint& sei, UInt /*payloadSize*/) 339 547 { 340 548 Int iCode; … … 345 553 xParseByteAlign(); 346 554 } 347 #endif 348 349 #if RECOVERY_POINT_SEI || BUFFERING_PERIOD_AND_TIMING_SEI 555 Void SEIReader::xParseSEIFramePacking(SEIFramePacking& sei, UInt /*payloadSize*/) 556 { 557 UInt val; 558 READ_UVLC( val, "frame_packing_arrangement_id" ); sei.m_arrangementId = val; 559 READ_FLAG( val, "frame_packing_arrangement_cancel_flag" ); sei.m_arrangementCancelFlag = val; 560 561 if ( !sei.m_arrangementCancelFlag ) 562 { 563 READ_CODE( 7, val, "frame_packing_arrangement_type" ); sei.m_arrangementType = val; 564 #if L0444_FPA_TYPE 565 assert((sei.m_arrangementType > 2) && (sei.m_arrangementType < 6) ); 566 #endif 567 READ_FLAG( val, "quincunx_sampling_flag" ); sei.m_quincunxSamplingFlag = val; 568 569 READ_CODE( 6, val, "content_interpretation_type" ); sei.m_contentInterpretationType = val; 570 READ_FLAG( val, "spatial_flipping_flag" ); sei.m_spatialFlippingFlag = val; 571 READ_FLAG( val, "frame0_flipped_flag" ); sei.m_frame0FlippedFlag = val; 572 READ_FLAG( val, "field_views_flag" ); sei.m_fieldViewsFlag = val; 573 READ_FLAG( val, "current_frame_is_frame0_flag" ); sei.m_currentFrameIsFrame0Flag = val; 574 READ_FLAG( val, "frame0_self_contained_flag" ); sei.m_frame0SelfContainedFlag = val; 575 READ_FLAG( val, "frame1_self_contained_flag" ); sei.m_frame1SelfContainedFlag = val; 576 577 if ( sei.m_quincunxSamplingFlag == 0 && sei.m_arrangementType != 5) 578 { 579 READ_CODE( 4, val, "frame0_grid_position_x" ); sei.m_frame0GridPositionX = val; 580 READ_CODE( 4, val, "frame0_grid_position_y" ); sei.m_frame0GridPositionY = val; 581 READ_CODE( 4, val, "frame1_grid_position_x" ); sei.m_frame1GridPositionX = val; 582 READ_CODE( 4, val, "frame1_grid_position_y" ); sei.m_frame1GridPositionY = val; 583 } 584 585 READ_CODE( 8, val, "frame_packing_arrangement_reserved_byte" ); sei.m_arrangementReservedByte = val; 586 #if L0045_PERSISTENCE_FLAGS 587 READ_FLAG( val, "frame_packing_arrangement_persistence_flag" ); sei.m_arrangementPersistenceFlag = val ? true : false; 588 #else 589 READ_UVLC( val, "frame_packing_arrangement_repetition_period" ); sei.m_arrangementRepetetionPeriod = val; 590 #endif 591 } 592 READ_FLAG( val, "upsampled_aspect_ratio" ); sei.m_upsampledAspectRatio = val; 593 594 xParseByteAlign(); 595 } 596 597 Void SEIReader::xParseSEIDisplayOrientation(SEIDisplayOrientation& sei, UInt /*payloadSize*/) 598 { 599 UInt val; 600 READ_FLAG( val, "display_orientation_cancel_flag" ); sei.cancelFlag = val; 601 if( !sei.cancelFlag ) 602 { 603 READ_FLAG( val, "hor_flip" ); sei.horFlip = val; 604 READ_FLAG( val, "ver_flip" ); sei.verFlip = val; 605 READ_CODE( 16, val, "anticlockwise_rotation" ); sei.anticlockwiseRotation = val; 606 #if L0045_PERSISTENCE_FLAGS 607 READ_FLAG( val, "display_orientation_persistence_flag" ); sei.persistenceFlag = val; 608 #else 609 READ_UVLC( val, "display_orientation_repetition_period" ); sei.repetitionPeriod = val; 610 #endif 611 #if !REMOVE_SINGLE_SEI_EXTENSION_FLAGS 612 READ_FLAG( val, "display_orientation_extension_flag" ); sei.extensionFlag = val; 613 assert( !sei.extensionFlag ); 614 #endif 615 } 616 xParseByteAlign(); 617 } 618 619 Void SEIReader::xParseSEITemporalLevel0Index(SEITemporalLevel0Index& sei, UInt /*payloadSize*/) 620 { 621 UInt val; 622 READ_CODE ( 8, val, "tl0_idx" ); sei.tl0Idx = val; 623 READ_CODE ( 8, val, "rap_idx" ); sei.rapIdx = val; 624 xParseByteAlign(); 625 } 626 627 Void SEIReader::xParseSEIGradualDecodingRefreshInfo(SEIGradualDecodingRefreshInfo& sei, UInt /*payloadSize*/) 628 { 629 UInt val; 630 READ_FLAG( val, "gdr_foreground_flag" ); sei.m_gdrForegroundFlag = val ? 1 : 0; 631 xParseByteAlign(); 632 } 633 350 634 Void SEIReader::xParseByteAlign() 351 635 { … … 360 644 } 361 645 } 362 #endif363 646 //! \} -
trunk/source/Lib/TLibDecoder/SEIread.h
r2 r125 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 32 32 */ 33 33 34 /** 35 \file SEIread.h 36 \brief reading funtionality for SEI messages 37 */ 38 34 39 #ifndef __SEIREAD__ 35 40 #define __SEIREAD__ … … 44 49 #include "TLibCommon/SEI.h" 45 50 class TComInputBitstream; 46 class SEImessages;47 51 48 52 … … 52 56 SEIReader() {}; 53 57 virtual ~SEIReader() {}; 54 Void parseSEImessage(TComInputBitstream* bs, SEI messages& seis);58 Void parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps); 55 59 protected: 56 Void xReadSEImessage (SEI messages& seis);60 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps); 57 61 Void xParseSEIuserDataUnregistered (SEIuserDataUnregistered &sei, UInt payloadSize); 58 #if ACTIVE_PARAMETER_SETS_SEI_MESSAGE 59 Void xParseSEIActiveParameterSets (SEIActiveParameterSets& sei, UInt payloadSize); 60 #endif 62 Void xParseSEIActiveParameterSets (SEIActiveParameterSets &sei, UInt payloadSize); 63 Void xParseSEIDecodingUnitInfo (SEIDecodingUnitInfo& sei, UInt payloadSize, TComSPS *sps); 61 64 Void xParseSEIDecodedPictureHash (SEIDecodedPictureHash& sei, UInt payloadSize); 62 #if BUFFERING_PERIOD_AND_TIMING_SEI 63 Void xParseSEIBufferingPeriod (SEIBufferingPeriod& sei, UInt payloadSize); 64 Void xParseSEIPictureTiming (SEIPictureTiming& sei, UInt payloadSize); 65 #endif 66 #if RECOVERY_POINT_SEI 65 Void xParseSEIBufferingPeriod (SEIBufferingPeriod& sei, UInt payloadSize, TComSPS *sps); 66 Void xParseSEIPictureTiming (SEIPictureTiming& sei, UInt payloadSize, TComSPS *sps); 67 67 Void xParseSEIRecoveryPoint (SEIRecoveryPoint& sei, UInt payloadSize); 68 #endif 69 #if RECOVERY_POINT_SEI || BUFFERING_PERIOD_AND_TIMING_SEI 68 Void xParseSEIFramePacking (SEIFramePacking& sei, UInt payloadSize); 69 Void xParseSEIDisplayOrientation (SEIDisplayOrientation &sei, UInt payloadSize); 70 Void xParseSEITemporalLevel0Index (SEITemporalLevel0Index &sei, UInt payloadSize); 71 Void xParseSEIGradualDecodingRefreshInfo (SEIGradualDecodingRefreshInfo &sei, UInt payloadSize); 70 72 Void xParseByteAlign(); 71 #endif72 73 }; 73 74 -
trunk/source/Lib/TLibDecoder/SyntaxElementParser.cpp
r2 r125 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
trunk/source/Lib/TLibDecoder/SyntaxElementParser.h
r2 r125 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 90 90 public: 91 91 Void setBitstream ( TComInputBitstream* p ) { m_pcBitstream = p; } 92 TComInputBitstream* getBitstream() { return m_pcBitstream; } 92 93 }; 93 94 -
trunk/source/Lib/TLibDecoder/TDecBinCoder.h
r2 r125 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 62 62 63 63 virtual Void resetBac () = 0; 64 virtual Void decodeNumSubseqIPCM( Int& numSubseqIPCM ) = 0;65 64 virtual Void decodePCMAlignBits() = 0; 66 65 virtual Void xReadPCMCode ( UInt uiLength, UInt& ruiCode) = 0; -
trunk/source/Lib/TLibDecoder/TDecBinCoderCABAC.cpp
r2 r125 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 251 251 } 252 252 253 /** Decode subsequent_pcm_num.254 * \param numSubseqIPCM255 * \returns Void256 */257 Void TDecBinCABAC::decodeNumSubseqIPCM( Int& numSubseqIPCM )258 {259 UInt bit = 0;260 261 numSubseqIPCM = 0;262 263 do264 {265 m_uiValue += m_uiValue;266 if ( ++m_bitsNeeded >= 0 )267 {268 m_bitsNeeded = -8;269 m_uiValue += m_pcTComBitstream->readByte();270 }271 bit = ((m_uiValue&128)>>7);272 numSubseqIPCM++;273 }274 while( bit && (numSubseqIPCM < 3 ));275 276 if( bit && (numSubseqIPCM == 3 ))277 {278 numSubseqIPCM++;279 }280 281 numSubseqIPCM --;282 }283 284 253 /** Decode PCM alignment zero bits. 285 254 * \returns Void -
trunk/source/Lib/TLibDecoder/TDecBinCoderCABAC.h
r2 r125 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 64 64 65 65 Void resetBac (); 66 Void decodeNumSubseqIPCM( Int& numSubseqIPCM ) ;67 66 Void decodePCMAlignBits(); 68 67 Void xReadPCMCode ( UInt uiLength, UInt& ruiCode ); -
trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp
r33 r125 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 55 55 } 56 56 57 #if !REMOVE_APS58 Void xTraceAPSHeader (TComAPS *pAPS)59 {60 fprintf( g_hTrace, "=========== Adaptation Parameter Set ===========\n");61 }62 #endif63 64 57 Void xTraceSliceHeader (TComSlice *pSlice) 65 58 { … … 75 68 TDecCavlc::TDecCavlc() 76 69 { 77 #if !REMOVE_FGS78 m_iSliceGranularity = 0;79 #endif80 70 } 81 71 … … 93 83 UInt code; 94 84 UInt interRPSPred; 95 READ_FLAG(interRPSPred, "inter_ref_pic_set_prediction_flag"); rps->setInterRPSPrediction(interRPSPred); 85 if (idx > 0) 86 { 87 READ_FLAG(interRPSPred, "inter_ref_pic_set_prediction_flag"); rps->setInterRPSPrediction(interRPSPred); 88 } 89 else 90 { 91 interRPSPred = false; 92 rps->setInterRPSPrediction(false); 93 } 94 96 95 if (interRPSPred) 97 96 { 98 97 UInt bit; 99 #if J0234_INTER_RPS_SIMPL100 98 if(idx == sps->getRPSList()->getNumberOfReferencePictureSets()) 101 99 { … … 107 105 } 108 106 assert(code <= idx-1); // delta_idx_minus1 shall not be larger than idx-1, otherwise we will predict from a negative row position that does not exist. When idx equals 0 there is no legal value and interRPSPred must be zero. See J0185-r2 109 #else110 READ_UVLC(code, "delta_idx_minus1" ); // delta index of the Reference Picture Set used for prediction minus 1111 #endif112 107 Int rIdx = idx - 1 - code; 113 #if J0234_INTER_RPS_SIMPL114 108 assert (rIdx <= idx-1 && rIdx >= 0); // Made assert tighter; if rIdx = idx then prediction is done from itself. rIdx must belong to range 0, idx-1, inclusive, see J0185-r2 115 #else116 assert (rIdx <= idx && rIdx >= 0);117 #endif118 109 TComReferencePictureSet* rpsRef = sps->getRPSList()->getReferencePictureSet(rIdx); 119 110 Int k = 0, k0 = 0, k1 = 0; 120 111 READ_CODE(1, bit, "delta_rps_sign"); // delta_RPS_sign 121 112 READ_UVLC(code, "abs_delta_rps_minus1"); // absolute delta RPS minus 1 122 Int deltaRPS = (1 - (bit<<1)) * (code + 1); // delta_RPS113 Int deltaRPS = (1 - 2 * bit) * (code + 1); // delta_RPS 123 114 for(Int j=0 ; j <= rpsRef->getNumberOfPictures(); j++) 124 115 { … … 136 127 rps->setUsed(k, (refIdc == 1)); 137 128 138 if (deltaPOC < 0) { 129 if (deltaPOC < 0) 130 { 139 131 k0++; 140 132 } … … 183 175 } 184 176 185 #if !REMOVE_APS186 Void TDecCavlc::parseAPS(TComAPS* aps)187 {188 #if ENC_DEC_TRACE189 xTraceAPSHeader(aps);190 #endif191 192 UInt uiCode;193 READ_UVLC(uiCode, "aps_id"); aps->setAPSID(uiCode);194 #if !REMOVE_ALF195 for(Int compIdx=0; compIdx< 3; compIdx++)196 {197 xParseAlfParam( (aps->getAlfParam())[compIdx]);198 }199 #endif200 READ_FLAG( uiCode, "aps_extension_flag");201 if (uiCode)202 {203 while ( xMoreRbspData() )204 {205 READ_FLAG( uiCode, "aps_extension_data_flag");206 }207 }208 209 }210 #endif211 212 177 /** copy SAO parameter 213 178 * \param dst … … 221 186 if (dst->typeIdx != -1) 222 187 { 223 #if SAO_TYPE_CODING224 188 dst->subTypeIdx = src->subTypeIdx ; 225 #else226 if (dst->typeIdx == SAO_BO)227 {228 dst->bandPosition = src->bandPosition ;229 }230 else231 {232 dst->bandPosition = 0;233 }234 #endif235 189 dst->length = src->length; 236 190 for (i=0;i<dst->length;i++) … … 249 203 } 250 204 251 #if !REMOVE_ALF252 Void TDecCavlc::xParseAlfParam(ALFParam* pAlfParam)253 {254 UInt uiSymbol;255 char syntaxString[50];256 sprintf(syntaxString, "alf_aps_filter_flag[%d]", pAlfParam->componentID);257 READ_FLAG(uiSymbol, syntaxString);258 pAlfParam->alf_flag = uiSymbol;259 if(pAlfParam->alf_flag ==0)260 {261 return;262 }263 Int iSymbol;264 pAlfParam->num_coeff = (Int)ALF_MAX_NUM_COEF;265 switch(pAlfParam->componentID)266 {267 case ALF_Cb:268 case ALF_Cr:269 {270 pAlfParam->filter_shape = ALF_CROSS9x7_SQUARE3x3;271 pAlfParam->filters_per_group = 1;272 for(Int pos=0; pos< pAlfParam->num_coeff; pos++)273 {274 READ_SVLC(iSymbol, "alf_filt_coeff");275 pAlfParam->coeffmulti[0][pos] = iSymbol;276 }277 }278 break;279 case ALF_Y:280 {281 pAlfParam->filters_per_group = 0;282 memset (pAlfParam->filterPattern, 0 , sizeof(Int)*NO_VAR_BINS);283 pAlfParam->filter_shape = 0;284 // filters_per_fr285 READ_UVLC (uiSymbol, "alf_no_filters_minus1");286 pAlfParam->filters_per_group = uiSymbol + 1;287 288 if(uiSymbol == 1) // filters_per_group == 2289 {290 READ_UVLC (uiSymbol, "alf_start_second_filter");291 pAlfParam->startSecondFilter = uiSymbol;292 pAlfParam->filterPattern [uiSymbol] = 1;293 }294 else if (uiSymbol > 1) // filters_per_group > 2295 {296 pAlfParam->filters_per_group = 1;297 Int numMergeFlags = 16;298 for (Int i=1; i<numMergeFlags; i++)299 {300 READ_FLAG (uiSymbol, "alf_filter_pattern");301 pAlfParam->filterPattern[i] = uiSymbol;302 pAlfParam->filters_per_group += uiSymbol;303 }304 }305 for(Int idx = 0; idx < pAlfParam->filters_per_group; ++idx)306 {307 for(Int i = 0; i < pAlfParam->num_coeff; i++)308 {309 pAlfParam->coeffmulti[idx][i] = xGolombDecode(kTableTabShapes[ALF_CROSS9x7_SQUARE3x3][i]);310 }311 }312 }313 break;314 default:315 {316 printf("Not a legal component ID for ALF\n");317 assert(0);318 exit(-1);319 }320 }321 }322 323 Int TDecCavlc::xGolombDecode(Int k)324 {325 Int coeff;326 UInt symbol;327 xReadEpExGolomb( symbol, k );328 coeff = symbol;329 if(symbol != 0)330 {331 xReadFlag(symbol);332 if(symbol == 0)333 {334 coeff = -coeff;335 }336 }337 #if ENC_DEC_TRACE338 fprintf( g_hTrace, "%8lld ", g_nSymbolCounter++ );339 fprintf( g_hTrace, "%-40s se(v) : %d\n", "alf_filt_coeff", coeff );340 #endif341 return coeff;342 }343 #endif344 345 205 Void TDecCavlc::parsePPS(TComPPS* pcPPS) 346 206 { … … 352 212 Int iCode; 353 213 354 READ_UVLC( uiCode, "pic_parameter_set_id"); pcPPS->setPPSId (uiCode); 355 READ_UVLC( uiCode, "seq_parameter_set_id"); pcPPS->setSPSId (uiCode); 356 214 READ_UVLC( uiCode, "pps_pic_parameter_set_id"); pcPPS->setPPSId (uiCode); 215 READ_UVLC( uiCode, "pps_seq_parameter_set_id"); pcPPS->setSPSId (uiCode); 216 READ_FLAG( uiCode, "dependent_slice_segments_enabled_flag" ); pcPPS->setDependentSliceSegmentsEnabledFlag ( uiCode == 1 ); 217 #if L0255_MOVE_PPS_FLAGS 218 READ_FLAG( uiCode, "output_flag_present_flag" ); pcPPS->setOutputFlagPresentFlag( uiCode==1 ); 219 220 READ_CODE(3, uiCode, "num_extra_slice_header_bits"); pcPPS->setNumExtraSliceHeaderBits(uiCode); 221 #endif 357 222 READ_FLAG ( uiCode, "sign_data_hiding_flag" ); pcPPS->setSignHideFlag( uiCode ); 358 223 359 224 READ_FLAG( uiCode, "cabac_init_present_flag" ); pcPPS->setCabacInitPresentFlag( uiCode ? true : false ); 360 225 226 #if L0323_LIMIT_DEFAULT_LIST_SIZE 227 READ_UVLC(uiCode, "num_ref_idx_l0_default_active_minus1"); 228 assert(uiCode <= 14); 229 pcPPS->setNumRefIdxL0DefaultActive(uiCode+1); 230 231 READ_UVLC(uiCode, "num_ref_idx_l1_default_active_minus1"); 232 assert(uiCode <= 14); 233 pcPPS->setNumRefIdxL1DefaultActive(uiCode+1); 234 #else 361 235 READ_UVLC(uiCode, "num_ref_idx_l0_default_active_minus1"); pcPPS->setNumRefIdxL0DefaultActive(uiCode+1); 362 236 READ_UVLC(uiCode, "num_ref_idx_l1_default_active_minus1"); pcPPS->setNumRefIdxL1DefaultActive(uiCode+1); 363 364 READ_SVLC(iCode, "pic_init_qp_minus26" ); pcPPS->setPicInitQPMinus26(iCode); 237 #endif 238 239 READ_SVLC(iCode, "init_qp_minus26" ); pcPPS->setPicInitQPMinus26(iCode); 365 240 READ_FLAG( uiCode, "constrained_intra_pred_flag" ); pcPPS->setConstrainedIntraPred( uiCode ? true : false ); 366 #if PPS_TS_FLAG367 241 READ_FLAG( uiCode, "transform_skip_enabled_flag" ); 368 242 pcPPS->setUseTransformSkip ( uiCode ? true : false ); 369 #endif 370 371 #if !REMOVE_FGS 372 READ_CODE( 2, uiCode, "slice_granularity" ); pcPPS->setSliceGranularity(uiCode); 373 #endif 374 375 // alf_param() ? 376 #if CU_DQP_ENABLE_FLAG 243 377 244 READ_FLAG( uiCode, "cu_qp_delta_enabled_flag" ); pcPPS->setUseDQP( uiCode ? true : false ); 378 245 if( pcPPS->getUseDQP() ) 379 246 { 380 247 READ_UVLC( uiCode, "diff_cu_qp_delta_depth" ); 381 #if REMOVE_FGS382 248 pcPPS->setMaxCuDQPDepth( uiCode ); 383 #else384 pcPPS->setMaxCuDQPDepth( uiCode + pcPPS->getSliceGranularity() );385 #endif386 249 } 387 250 else … … 389 252 pcPPS->setMaxCuDQPDepth( 0 ); 390 253 } 391 #else 392 READ_UVLC( uiCode, "diff_cu_qp_delta_depth"); 393 if(uiCode == 0) 394 { 395 pcPPS->setUseDQP (false); 396 pcPPS->setMaxCuDQPDepth( 0 ); 397 } 398 else 399 { 400 pcPPS->setUseDQP (true); 401 #if REMOVE_FGS 402 pcPPS->setMaxCuDQPDepth(uiCode - 1); 403 #else 404 pcPPS->setMaxCuDQPDepth(uiCode + pcPPS->getSliceGranularity() - 1); 405 #endif 406 } 407 #endif 408 READ_SVLC( iCode, "cb_qp_offset"); 254 READ_SVLC( iCode, "pps_cb_qp_offset"); 409 255 pcPPS->setChromaCbQpOffset(iCode); 410 #if CHROMA_QP_EXTENSION411 256 assert( pcPPS->getChromaCbQpOffset() >= -12 ); 412 257 assert( pcPPS->getChromaCbQpOffset() <= 12 ); 413 #endif 414 415 READ_SVLC( iCode, "cr_qp_offset"); 258 259 READ_SVLC( iCode, "pps_cr_qp_offset"); 416 260 pcPPS->setChromaCrQpOffset(iCode); 417 #if CHROMA_QP_EXTENSION418 261 assert( pcPPS->getChromaCrQpOffset() >= -12 ); 419 262 assert( pcPPS->getChromaCrQpOffset() <= 12 ); 420 #endif 421 422 #if CHROMA_QP_EXTENSION 423 READ_FLAG( uiCode, "slicelevel_chroma_qp_flag" ); 263 264 READ_FLAG( uiCode, "pps_slice_chroma_qp_offsets_present_flag" ); 424 265 pcPPS->setSliceChromaQpFlag( uiCode ? true : false ); 425 #endif426 266 427 267 READ_FLAG( uiCode, "weighted_pred_flag" ); // Use of Weighting Prediction (P_SLICE) … … 429 269 READ_FLAG( uiCode, "weighted_bipred_flag" ); // Use of Bi-Directional Weighting Prediction (B_SLICE) 430 270 pcPPS->setWPBiPred( uiCode==1 ); 431 printf("TDecCavlc::parsePPS():\tm_bUseWeightPred=%d\tm_uiBiPredIdc=%d\n", pcPPS->getUseWP(), pcPPS->getWPBiPred()); 432 271 272 #if !L0255_MOVE_PPS_FLAGS 433 273 READ_FLAG( uiCode, "output_flag_present_flag" ); 434 274 pcPPS->setOutputFlagPresentFlag( uiCode==1 ); 435 436 #if !TILES_WPP_ENTROPYSLICES_FLAGS 437 #if DEPENDENT_SLICES 438 READ_FLAG( uiCode, "dependent_slices_enabled_flag" ); 439 pcPPS->setDependentSliceEnabledFlag( uiCode==1 ); 440 #endif 441 #endif 442 275 #endif 443 276 READ_FLAG( uiCode, "transquant_bypass_enable_flag"); 444 277 pcPPS->setTransquantBypassEnableFlag(uiCode ? true : false); 445 446 #if TILES_WPP_ENTROPYSLICES_FLAGS447 #if DEPENDENT_SLICES448 READ_FLAG( uiCode, "dependent_slices_enabled_flag" ); pcPPS->setDependentSliceEnabledFlag ( uiCode == 1 );449 #endif450 278 READ_FLAG( uiCode, "tiles_enabled_flag" ); pcPPS->setTilesEnabledFlag ( uiCode == 1 ); 451 READ_FLAG( uiCode, "entropy_coding_sync_enabled_flag" ); pcPPS->setEntropyCodingSyncEnabledFlag( uiCode == 1 ); 452 READ_FLAG( uiCode, "entropy_slice_enabled_flag" ); pcPPS->setEntropySliceEnabledFlag ( uiCode == 1 ); 453 279 READ_FLAG( uiCode, "entropy_coding_sync_enabled_flag" ); pcPPS->setEntropyCodingSyncEnabledFlag( uiCode == 1 ); 280 454 281 if( pcPPS->getTilesEnabledFlag() ) 455 #else456 READ_CODE(2, uiCode, "tiles_or_entropy_coding_sync_idc"); pcPPS->setTilesOrEntropyCodingSyncIdc(uiCode);457 if(pcPPS->getTilesOrEntropyCodingSyncIdc() == 1)458 #endif459 282 { 460 283 READ_UVLC ( uiCode, "num_tile_columns_minus1" ); pcPPS->setNumColumnsMinus1( uiCode ); … … 488 311 } 489 312 } 490 #if !TILES_WPP_ENTROPYSLICES_FLAGS491 #if DEPENDENT_SLICES492 else if( pcPPS->getTilesOrEntropyCodingSyncIdc()==3 )493 {494 READ_FLAG ( uiCode, "cabac_independent_flag" );495 pcPPS->setCabacIndependentFlag( (uiCode == 1)? true : false );496 }497 #endif498 #endif499 #if MOVE_LOOP_FILTER_SLICES_FLAG500 313 READ_FLAG( uiCode, "loop_filter_across_slices_enabled_flag" ); pcPPS->setLoopFilterAcrossSlicesEnabledFlag( uiCode ? true : false ); 501 #endif502 314 READ_FLAG( uiCode, "deblocking_filter_control_present_flag" ); pcPPS->setDeblockingFilterControlPresentFlag( uiCode ? true : false ); 503 315 if(pcPPS->getDeblockingFilterControlPresentFlag()) 504 316 { 505 317 READ_FLAG( uiCode, "deblocking_filter_override_enabled_flag" ); pcPPS->setDeblockingFilterOverrideEnabledFlag( uiCode ? true : false ); 506 READ_FLAG( uiCode, "p ic_disable_deblocking_filter_flag" ); pcPPS->setPicDisableDeblockingFilterFlag(uiCode ? true : false );318 READ_FLAG( uiCode, "pps_disable_deblocking_filter_flag" ); pcPPS->setPicDisableDeblockingFilterFlag(uiCode ? true : false ); 507 319 if(!pcPPS->getPicDisableDeblockingFilterFlag()) 508 320 { … … 516 328 parseScalingList( pcPPS->getScalingList() ); 517 329 } 330 331 READ_FLAG( uiCode, "lists_modification_present_flag"); 332 pcPPS->setListsModificationPresentFlag(uiCode); 333 518 334 READ_UVLC( uiCode, "log2_parallel_merge_level_minus2"); 519 335 pcPPS->setLog2ParallelMergeLevelMinus2 (uiCode); 520 336 521 #if SLICE_HEADER_EXTENSION 522 READ_FLAG( uiCode, "slice_header_extension_present_flag"); 337 #if !L0255_MOVE_PPS_FLAGS 338 READ_CODE(3, uiCode, "num_extra_slice_header_bits"); 339 pcPPS->setNumExtraSliceHeaderBits(uiCode); 340 #endif 341 READ_FLAG( uiCode, "slice_segment_header_extension_present_flag"); 523 342 pcPPS->setSliceHeaderExtensionPresentFlag(uiCode); 524 #endif525 343 526 344 READ_FLAG( uiCode, "pps_extension_flag"); … … 534 352 } 535 353 536 #if SUPPORT_FOR_VUI537 #if !BUFFERING_PERIOD_AND_TIMING_SEI538 Void TDecCavlc::parseVUI(TComVUI* pcVUI)539 #else540 354 Void TDecCavlc::parseVUI(TComVUI* pcVUI, TComSPS *pcSPS) 541 #endif542 355 { 543 356 #if ENC_DEC_TRACE … … 553 366 { 554 367 READ_CODE(16, uiCode, "sar_width"); pcVUI->setSarWidth(uiCode); 555 READ_CODE(16, uiCode, "sar_height"); pcVUI->setSar Width(uiCode);368 READ_CODE(16, uiCode, "sar_height"); pcVUI->setSarHeight(uiCode); 556 369 } 557 370 } … … 589 402 assert(pcVUI->getFieldSeqFlag() == false); // not supported yet 590 403 404 READ_FLAG(uiCode, "frame_field_info_present_flag"); pcVUI->setFrameFieldInfoPresentFlag(uiCode); 405 406 READ_FLAG( uiCode, "default_display_window_flag"); 407 if (uiCode != 0) 408 { 409 Window &defDisp = pcVUI->getDefaultDisplayWindow(); 410 READ_UVLC( uiCode, "def_disp_win_left_offset" ); defDisp.setWindowLeftOffset ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc()) ); 411 READ_UVLC( uiCode, "def_disp_win_right_offset" ); defDisp.setWindowRightOffset ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc()) ); 412 READ_UVLC( uiCode, "def_disp_win_top_offset" ); defDisp.setWindowTopOffset ( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc()) ); 413 READ_UVLC( uiCode, "def_disp_win_bottom_offset" ); defDisp.setWindowBottomOffset( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc()) ); 414 } 415 #if L0043_TIMING_INFO 416 TimingInfo *timingInfo = pcVUI->getTimingInfo(); 417 READ_FLAG( uiCode, "vui_timing_info_present_flag"); timingInfo->setTimingInfoPresentFlag (uiCode ? true : false); 418 if(timingInfo->getTimingInfoPresentFlag()) 419 { 420 READ_CODE( 32, uiCode, "vui_num_units_in_tick"); timingInfo->setNumUnitsInTick (uiCode); 421 READ_CODE( 32, uiCode, "vui_time_scale"); timingInfo->setTimeScale (uiCode); 422 READ_FLAG( uiCode, "vui_poc_proportional_to_timing_flag"); timingInfo->setPocProportionalToTimingFlag(uiCode ? true : false); 423 if(timingInfo->getPocProportionalToTimingFlag()) 424 { 425 READ_UVLC( uiCode, "vui_num_ticks_poc_diff_one_minus1"); timingInfo->setNumTicksPocDiffOneMinus1 (uiCode); 426 } 427 #endif 591 428 READ_FLAG( uiCode, "hrd_parameters_present_flag"); pcVUI->setHrdParametersPresentFlag(uiCode); 592 #if !BUFFERING_PERIOD_AND_TIMING_SEI593 assert(pcVUI->getHrdParametersPresentFlag() == false); // not supported yet594 #else595 429 if( pcVUI->getHrdParametersPresentFlag() ) 596 430 { 597 READ_FLAG( uiCode, "timing_info_present_flag" ); pcVUI->setTimingInfoPresentFlag( uiCode ); 598 if( pcVUI->getTimingInfoPresentFlag() ) 599 { 600 READ_CODE( 32, uiCode, "num_units_in_tick" ); pcVUI->setNumUnitsInTick( uiCode ); 601 READ_CODE( 32, uiCode, "time_scale" ); pcVUI->setTimeScale( uiCode ); 602 } 603 READ_FLAG( uiCode, "nal_hrd_parameters_present_flag" ); pcVUI->setNalHrdParametersPresentFlag( uiCode ); 604 READ_FLAG( uiCode, "vcl_hrd_parameters_present_flag" ); pcVUI->setVclHrdParametersPresentFlag( uiCode ); 605 if( pcVUI->getNalHrdParametersPresentFlag() || pcVUI->getVclHrdParametersPresentFlag() ) 606 { 607 READ_FLAG( uiCode, "sub_pic_Cpb_params_present_flag" ); pcVUI->setSubPicCpbParamsPresentFlag( uiCode ); 608 if( pcVUI->getSubPicCpbParamsPresentFlag() ) 609 { 610 READ_CODE( 8, uiCode, "tick_divisor_minus2" ); pcVUI->setTickDivisorMinus2( uiCode ); 611 READ_CODE( 5, uiCode, "du_cpb_removal_delay_length_minus1" ); pcVUI->setDuCpbRemovalDelayLengthMinus1( uiCode ); 612 } 613 READ_CODE( 4, uiCode, "bit_rate_scale" ); pcVUI->setBitRateScale( uiCode ); 614 READ_CODE( 4, uiCode, "cpb_size_scale" ); pcVUI->setCpbSizeScale( uiCode ); 615 READ_CODE( 5, uiCode, "initial_cpb_removal_delay_length_minus1" ); pcVUI->setInitialCpbRemovalDelayLengthMinus1( uiCode ); 616 READ_CODE( 5, uiCode, "cpb_removal_delay_length_minus1" ); pcVUI->setCpbRemovalDelayLengthMinus1( uiCode ); 617 READ_CODE( 5, uiCode, "dpb_output_delay_length_minus1" ); pcVUI->setDpbOutputDelayLengthMinus1( uiCode ); 618 } 619 620 Int i, j, nalOrVcl; 621 for( i = 0; i < pcSPS->getMaxTLayers(); i ++ ) 622 { 623 READ_FLAG( uiCode, "fixed_pic_rate_flag" ); pcVUI->setFixedPicRateFlag( i, uiCode ); 624 if( pcVUI->getFixedPicRateFlag( i ) ) 625 { 626 READ_UVLC( uiCode, "pic_duration_in_tc_minus1" ); pcVUI->setPicDurationInTcMinus1( i, uiCode ); 627 } 628 READ_FLAG( uiCode, "low_delay_hrd_flag" ); pcVUI->setLowDelayHrdFlag( i, uiCode ); 629 READ_UVLC( uiCode, "cpb_cnt_minus1" ); pcVUI->setCpbCntMinus1( i, uiCode ); 630 for( nalOrVcl = 0; nalOrVcl < 2; nalOrVcl ++ ) 631 { 632 if( ( ( nalOrVcl == 0 ) && ( pcVUI->getNalHrdParametersPresentFlag() ) ) || 633 ( ( nalOrVcl == 1 ) && ( pcVUI->getVclHrdParametersPresentFlag() ) ) ) 634 { 635 for( j = 0; j < ( pcVUI->getCpbCntMinus1( i ) + 1 ); j ++ ) 636 { 637 READ_UVLC( uiCode, "bit_size_value_minus1" ); pcVUI->setBitRateValueMinus1( i, j, nalOrVcl, uiCode ); 638 READ_UVLC( uiCode, "cpb_size_value_minus1" ); pcVUI->setCpbSizeValueMinus1( i, j, nalOrVcl, uiCode ); 639 READ_FLAG( uiCode, "cbr_flag" ); pcVUI->setCbrFlag( i, j, nalOrVcl, uiCode ); 640 } 641 } 642 } 643 } 431 parseHrdParameters( pcVUI->getHrdParameters(), 1, pcSPS->getMaxTLayers() - 1 ); 432 } 433 #if L0043_TIMING_INFO 434 } 435 #endif 436 #if !L0043_TIMING_INFO 437 READ_FLAG( uiCode, "poc_proportional_to_timing_flag" ); pcVUI->setPocProportionalToTimingFlag(uiCode ? true : false); 438 if( pcVUI->getPocProportionalToTimingFlag() && pcVUI->getHrdParameters()->getTimingInfoPresentFlag() ) 439 { 440 READ_UVLC( uiCode, "num_ticks_poc_diff_one_minus1" ); pcVUI->setNumTicksPocDiffOneMinus1(uiCode); 644 441 } 645 442 #endif … … 649 446 READ_FLAG( uiCode, "tiles_fixed_structure_flag"); pcVUI->setTilesFixedStructureFlag(uiCode); 650 447 READ_FLAG( uiCode, "motion_vectors_over_pic_boundaries_flag"); pcVUI->setMotionVectorsOverPicBoundariesFlag(uiCode); 448 READ_FLAG( uiCode, "restricted_ref_pic_lists_flag"); pcVUI->setRestrictedRefPicListsFlag(uiCode); 449 #if L0043_MSS_IDC 450 READ_UVLC( uiCode, "min_spatial_segmentation_idc"); pcVUI->setMinSpatialSegmentationIdc(uiCode); 451 assert(uiCode < 4096); 452 #else 453 READ_CODE( 8, uiCode, "min_spatial_segmentation_idc"); pcVUI->setMinSpatialSegmentationIdc(uiCode); 454 #endif 651 455 READ_UVLC( uiCode, "max_bytes_per_pic_denom" ); pcVUI->setMaxBytesPerPicDenom(uiCode); 652 456 READ_UVLC( uiCode, "max_bits_per_mincu_denom" ); pcVUI->setMaxBitsPerMinCuDenom(uiCode); … … 655 459 } 656 460 } 657 #endif 461 462 Void TDecCavlc::parseHrdParameters(TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1) 463 { 464 UInt uiCode; 465 if( commonInfPresentFlag ) 466 { 467 #if !L0043_TIMING_INFO 468 READ_FLAG( uiCode, "timing_info_present_flag" ); hrd->setTimingInfoPresentFlag( uiCode == 1 ? true : false ); 469 if( hrd->getTimingInfoPresentFlag() ) 470 { 471 READ_CODE( 32, uiCode, "num_units_in_tick" ); hrd->setNumUnitsInTick( uiCode ); 472 READ_CODE( 32, uiCode, "time_scale" ); hrd->setTimeScale( uiCode ); 473 } 474 #endif 475 READ_FLAG( uiCode, "nal_hrd_parameters_present_flag" ); hrd->setNalHrdParametersPresentFlag( uiCode == 1 ? true : false ); 476 READ_FLAG( uiCode, "vcl_hrd_parameters_present_flag" ); hrd->setVclHrdParametersPresentFlag( uiCode == 1 ? true : false ); 477 if( hrd->getNalHrdParametersPresentFlag() || hrd->getVclHrdParametersPresentFlag() ) 478 { 479 READ_FLAG( uiCode, "sub_pic_cpb_params_present_flag" ); hrd->setSubPicCpbParamsPresentFlag( uiCode == 1 ? true : false ); 480 if( hrd->getSubPicCpbParamsPresentFlag() ) 481 { 482 READ_CODE( 8, uiCode, "tick_divisor_minus2" ); hrd->setTickDivisorMinus2( uiCode ); 483 READ_CODE( 5, uiCode, "du_cpb_removal_delay_length_minus1" ); hrd->setDuCpbRemovalDelayLengthMinus1( uiCode ); 484 READ_FLAG( uiCode, "sub_pic_cpb_params_in_pic_timing_sei_flag" ); hrd->setSubPicCpbParamsInPicTimingSEIFlag( uiCode == 1 ? true : false ); 485 #if L0044_DU_DPB_OUTPUT_DELAY_HRD 486 READ_CODE( 5, uiCode, "dpb_output_delay_du_length_minus1" ); hrd->setDpbOutputDelayDuLengthMinus1( uiCode ); 487 #endif 488 } 489 READ_CODE( 4, uiCode, "bit_rate_scale" ); hrd->setBitRateScale( uiCode ); 490 READ_CODE( 4, uiCode, "cpb_size_scale" ); hrd->setCpbSizeScale( uiCode ); 491 if( hrd->getSubPicCpbParamsPresentFlag() ) 492 { 493 READ_CODE( 4, uiCode, "cpb_size_du_scale" ); hrd->setDuCpbSizeScale( uiCode ); 494 } 495 READ_CODE( 5, uiCode, "initial_cpb_removal_delay_length_minus1" ); hrd->setInitialCpbRemovalDelayLengthMinus1( uiCode ); 496 READ_CODE( 5, uiCode, "au_cpb_removal_delay_length_minus1" ); hrd->setCpbRemovalDelayLengthMinus1( uiCode ); 497 READ_CODE( 5, uiCode, "dpb_output_delay_length_minus1" ); hrd->setDpbOutputDelayLengthMinus1( uiCode ); 498 } 499 } 500 Int i, j, nalOrVcl; 501 for( i = 0; i <= maxNumSubLayersMinus1; i ++ ) 502 { 503 READ_FLAG( uiCode, "fixed_pic_rate_general_flag" ); hrd->setFixedPicRateFlag( i, uiCode == 1 ? true : false ); 504 if( !hrd->getFixedPicRateFlag( i ) ) 505 { 506 READ_FLAG( uiCode, "fixed_pic_rate_within_cvs_flag" ); hrd->setFixedPicRateWithinCvsFlag( i, uiCode == 1 ? true : false ); 507 } 508 else 509 { 510 hrd->setFixedPicRateWithinCvsFlag( i, true ); 511 } 512 #if L0372 513 hrd->setLowDelayHrdFlag( i, 0 ); // Infered to be 0 when not present 514 hrd->setCpbCntMinus1 ( i, 0 ); // Infered to be 0 when not present 515 #endif 516 if( hrd->getFixedPicRateWithinCvsFlag( i ) ) 517 { 518 READ_UVLC( uiCode, "elemental_duration_in_tc_minus1" ); hrd->setPicDurationInTcMinus1( i, uiCode ); 519 } 520 #if L0372 521 else 522 { 523 READ_FLAG( uiCode, "low_delay_hrd_flag" ); hrd->setLowDelayHrdFlag( i, uiCode == 1 ? true : false ); 524 } 525 if (!hrd->getLowDelayHrdFlag( i )) 526 { 527 READ_UVLC( uiCode, "cpb_cnt_minus1" ); hrd->setCpbCntMinus1( i, uiCode ); 528 } 529 #else 530 READ_FLAG( uiCode, "low_delay_hrd_flag" ); hrd->setLowDelayHrdFlag( i, uiCode == 1 ? true : false ); 531 READ_UVLC( uiCode, "cpb_cnt_minus1" ); hrd->setCpbCntMinus1( i, uiCode ); 532 #endif 533 for( nalOrVcl = 0; nalOrVcl < 2; nalOrVcl ++ ) 534 { 535 if( ( ( nalOrVcl == 0 ) && ( hrd->getNalHrdParametersPresentFlag() ) ) || 536 ( ( nalOrVcl == 1 ) && ( hrd->getVclHrdParametersPresentFlag() ) ) ) 537 { 538 for( j = 0; j <= ( hrd->getCpbCntMinus1( i ) ); j ++ ) 539 { 540 READ_UVLC( uiCode, "bit_rate_value_minus1" ); hrd->setBitRateValueMinus1( i, j, nalOrVcl, uiCode ); 541 READ_UVLC( uiCode, "cpb_size_value_minus1" ); hrd->setCpbSizeValueMinus1( i, j, nalOrVcl, uiCode ); 542 if( hrd->getSubPicCpbParamsPresentFlag() ) 543 { 544 #if L0363_DU_BIT_RATE 545 READ_UVLC( uiCode, "bit_rate_du_value_minus1" ); hrd->setDuBitRateValueMinus1( i, j, nalOrVcl, uiCode ); 546 #endif 547 READ_UVLC( uiCode, "cpb_size_du_value_minus1" ); hrd->setDuCpbSizeValueMinus1( i, j, nalOrVcl, uiCode ); 548 } 549 READ_FLAG( uiCode, "cbr_flag" ); hrd->setCbrFlag( i, j, nalOrVcl, uiCode == 1 ? true : false ); 550 } 551 } 552 } 553 } 554 } 658 555 659 556 Void TDecCavlc::parseSPS(TComSPS* pcSPS) … … 664 561 665 562 UInt uiCode; 666 #if SPS_SYNTAX_CHANGES 667 READ_CODE( 4, uiCode, "video_parameter_set_id"); pcSPS->setVPSId ( uiCode ); 563 READ_CODE( 4, uiCode, "sps_video_parameter_set_id"); pcSPS->setVPSId ( uiCode ); 668 564 READ_CODE( 3, uiCode, "sps_max_sub_layers_minus1" ); pcSPS->setMaxTLayers ( uiCode+1 ); 669 READ_FLAG( uiCode, "sps_reserved_zero_bit"); assert(uiCode == 0); 565 READ_FLAG( uiCode, "sps_temporal_id_nesting_flag" ); pcSPS->setTemporalIdNestingFlag ( uiCode > 0 ? true : false ); 566 if ( pcSPS->getMaxTLayers() == 1 ) 567 { 568 // sps_temporal_id_nesting_flag must be 1 when sps_max_sub_layers_minus1 is 0 569 assert( uiCode == 1 ); 570 } 571 670 572 parsePTL(pcSPS->getPTL(), 1, pcSPS->getMaxTLayers() - 1); 671 READ_UVLC( uiCode, "s eq_parameter_set_id" );pcSPS->setSPSId( uiCode );573 READ_UVLC( uiCode, "sps_seq_parameter_set_id" ); pcSPS->setSPSId( uiCode ); 672 574 READ_UVLC( uiCode, "chroma_format_idc" ); pcSPS->setChromaFormatIdc( uiCode ); 673 575 // in the first version we only support chroma_format_idc equal to 1 (4:2:0), so separate_colour_plane_flag cannot appear in the bitstream … … 678 580 } 679 581 680 #else681 READ_CODE( 3, uiCode, "profile_space" ); pcSPS->setProfileSpace( uiCode );682 READ_CODE( 5, uiCode, "profile_idc" ); pcSPS->setProfileIdc( uiCode );683 READ_CODE(16, uiCode, "reserved_indicator_flags" ); pcSPS->setRsvdIndFlags( uiCode );684 READ_CODE( 8, uiCode, "level_idc" ); pcSPS->setLevelIdc( uiCode );685 READ_CODE(32, uiCode, "profile_compatibility"); pcSPS->setProfileCompat( uiCode );686 READ_UVLC( uiCode, "seq_parameter_set_id" ); pcSPS->setSPSId( uiCode );687 READ_UVLC( uiCode, "video_parameter_set_id" ); pcSPS->setVPSId( uiCode );688 READ_UVLC( uiCode, "chroma_format_idc" ); pcSPS->setChromaFormatIdc( uiCode );689 READ_CODE( 3, uiCode, "max_temporal_layers_minus1" ); pcSPS->setMaxTLayers( uiCode+1 );690 #endif691 582 READ_UVLC ( uiCode, "pic_width_in_luma_samples" ); pcSPS->setPicWidthInLumaSamples ( uiCode ); 692 583 READ_UVLC ( uiCode, "pic_height_in_luma_samples" ); pcSPS->setPicHeightInLumaSamples( uiCode ); 693 READ_FLAG( uiCode, " pic_cropping_flag"); pcSPS->setPicCroppingFlag ( uiCode ? true : false);584 READ_FLAG( uiCode, "conformance_window_flag"); 694 585 if (uiCode != 0) 695 586 { 696 READ_UVLC( uiCode, "pic_crop_left_offset" ); pcSPS->setPicCropLeftOffset ( uiCode * TComSPS::getCropUnitX( pcSPS->getChromaFormatIdc() ));697 READ_UVLC( uiCode, " pic_crop_right_offset" ); pcSPS->setPicCropRightOffset ( uiCode * TComSPS::getCropUnitX( pcSPS->getChromaFormatIdc() ) );698 READ_UVLC( uiCode, " pic_crop_top_offset" ); pcSPS->setPicCropTopOffset ( uiCode * TComSPS::getCropUnitY( pcSPS->getChromaFormatIdc() ) );699 READ_UVLC( uiCode, " pic_crop_bottom_offset" ); pcSPS->setPicCropBottomOffset( uiCode * TComSPS::getCropUnitY( pcSPS->getChromaFormatIdc() ) );700 }701 702 #if FULL_NBIT 587 Window &conf = pcSPS->getConformanceWindow(); 588 READ_UVLC( uiCode, "conf_win_left_offset" ); conf.setWindowLeftOffset ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc() ) ); 589 READ_UVLC( uiCode, "conf_win_right_offset" ); conf.setWindowRightOffset ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc() ) ); 590 READ_UVLC( uiCode, "conf_win_top_offset" ); conf.setWindowTopOffset ( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc() ) ); 591 READ_UVLC( uiCode, "conf_win_bottom_offset" ); conf.setWindowBottomOffset( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc() ) ); 592 } 593 703 594 READ_UVLC( uiCode, "bit_depth_luma_minus8" ); 704 g_uiBitDepth = 8 + uiCode; 705 g_uiBitIncrement = 0; 706 pcSPS->setBitDepth(g_uiBitDepth); 707 pcSPS->setBitIncrement(g_uiBitIncrement); 708 UInt m_uiSaoBitIncrease = g_uiBitDepth + (g_uiBitDepth-8) - min((Int)(g_uiBitDepth + (g_uiBitDepth-8)), 10); 709 #else 710 READ_UVLC( uiCode, "bit_depth_luma_minus8" ); 711 g_uiBitDepth = 8; 712 g_uiBitIncrement = uiCode; 713 pcSPS->setBitDepth(g_uiBitDepth); 714 pcSPS->setBitIncrement(g_uiBitIncrement); 715 #endif 595 g_bitDepthY = 8 + uiCode; 596 pcSPS->setBitDepthY(g_bitDepthY); 716 597 pcSPS->setQpBDOffsetY( (Int) (6*uiCode) ); 717 598 718 g_uiBASE_MAX = ((1<<(g_uiBitDepth))-1);719 720 #if IBDI_NOCLIP_RANGE721 g_uiIBDI_MAX = g_uiBASE_MAX << g_uiBitIncrement;722 #else723 g_uiIBDI_MAX = ((1<<(g_uiBitDepth+g_uiBitIncrement))-1);724 #endif725 599 READ_UVLC( uiCode, "bit_depth_chroma_minus8" ); 600 g_bitDepthC = 8 + uiCode; 601 pcSPS->setBitDepthC(g_bitDepthC); 726 602 pcSPS->setQpBDOffsetC( (Int) (6*uiCode) ); 727 603 728 READ_FLAG( uiCode, "pcm_enabled_flag" ); pcSPS->setUsePCM( uiCode ? true : false );729 730 if( pcSPS->getUsePCM() )731 {732 READ_CODE( 4, uiCode, "pcm_bit_depth_luma_minus1" ); pcSPS->setPCMBitDepthLuma ( 1 + uiCode );733 READ_CODE( 4, uiCode, "pcm_bit_depth_chroma_minus1" ); pcSPS->setPCMBitDepthChroma ( 1 + uiCode );734 }735 736 604 READ_UVLC( uiCode, "log2_max_pic_order_cnt_lsb_minus4" ); pcSPS->setBitsForPOC( 4 + uiCode ); 605 606 UInt subLayerOrderingInfoPresentFlag; 607 READ_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag"); 737 608 for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++) 738 609 { 739 READ_UVLC ( uiCode, " max_dec_pic_buffering");610 READ_UVLC ( uiCode, "sps_max_dec_pic_buffering"); 740 611 pcSPS->setMaxDecPicBuffering( uiCode, i); 741 READ_UVLC ( uiCode, " num_reorder_pics" );612 READ_UVLC ( uiCode, "sps_num_reorder_pics" ); 742 613 pcSPS->setNumReorderPics(uiCode, i); 743 READ_UVLC ( uiCode, " max_latency_increase");614 READ_UVLC ( uiCode, "sps_max_latency_increase"); 744 615 pcSPS->setMaxLatencyIncrease( uiCode, i ); 745 } 746 747 READ_FLAG( uiCode, "restricted_ref_pic_lists_flag" );748 pcSPS->setRestrictedRefPicListsFlag( uiCode );749 if( pcSPS->getRestrictedRefPicListsFlag() )750 {751 READ_FLAG( uiCode, "lists_modification_present_flag");752 pcSPS->setListsModificationPresentFlag(uiCode);753 }754 else755 {756 pcSPS->setListsModificationPresentFlag(true);757 } 616 617 if (!subLayerOrderingInfoPresentFlag) 618 { 619 for (i++; i <= pcSPS->getMaxTLayers()-1; i++) 620 { 621 pcSPS->setMaxDecPicBuffering(pcSPS->getMaxDecPicBuffering(0), i); 622 pcSPS->setNumReorderPics(pcSPS->getNumReorderPics(0), i); 623 pcSPS->setMaxLatencyIncrease(pcSPS->getMaxLatencyIncrease(0), i); 624 } 625 break; 626 } 627 } 628 758 629 READ_UVLC( uiCode, "log2_min_coding_block_size_minus3" ); 759 630 UInt log2MinCUSize = uiCode + 3; … … 766 637 READ_UVLC( uiCode, "log2_diff_max_min_transform_block_size" ); pcSPS->setQuadtreeTULog2MaxSize( uiCode + pcSPS->getQuadtreeTULog2MinSize() ); 767 638 pcSPS->setMaxTrSize( 1<<(uiCode + pcSPS->getQuadtreeTULog2MinSize()) ); 768 if( pcSPS->getUsePCM() )769 {770 READ_UVLC( uiCode, "log2_min_pcm_coding_block_size_minus3" ); pcSPS->setPCMLog2MinSize (uiCode+3);771 READ_UVLC( uiCode, "log2_diff_max_min_pcm_coding_block_size" ); pcSPS->setPCMLog2MaxSize ( uiCode+pcSPS->getPCMLog2MinSize() );772 }773 639 774 640 READ_UVLC( uiCode, "max_transform_hierarchy_depth_inter" ); pcSPS->setQuadtreeTUMaxDepthInter( uiCode+1 ); … … 793 659 } 794 660 } 795 #if !REMOVE_LMCHROMA 796 READ_FLAG( uiCode, "chroma_pred_from_luma_enabled_flag" ); pcSPS->setUseLMChroma ( uiCode ? true : false ); 797 #endif 798 #if !PPS_TS_FLAG 799 READ_FLAG( uiCode, "transform_skip_enabled_flag" ); pcSPS->setUseTransformSkip ( uiCode ? true : false ); 800 #endif 801 #if !MOVE_LOOP_FILTER_SLICES_FLAG 802 READ_FLAG( uiCode, "loop_filter_across_slice_flag" ); pcSPS->setLFCrossSliceBoundaryFlag( uiCode ? true : false); 803 #endif 804 READ_FLAG( uiCode, "asymmetric_motion_partitions_enabled_flag" ); pcSPS->setUseAMP( uiCode ); 805 #if !REMOVE_NSQT 806 READ_FLAG( uiCode, "non_square_quadtree_enabled_flag" ); pcSPS->setUseNSQT( uiCode ); 807 #endif 661 READ_FLAG( uiCode, "amp_enabled_flag" ); pcSPS->setUseAMP( uiCode ); 808 662 READ_FLAG( uiCode, "sample_adaptive_offset_enabled_flag" ); pcSPS->setUseSAO ( uiCode ? true : false ); 809 #if !REMOVE_ALF 810 READ_FLAG( uiCode, "adaptive_loop_filter_enabled_flag" ); pcSPS->setUseALF ( uiCode ? true : false ); 811 #endif 663 664 READ_FLAG( uiCode, "pcm_enabled_flag" ); pcSPS->setUsePCM( uiCode ? true : false ); 812 665 if( pcSPS->getUsePCM() ) 813 666 { 814 READ_FLAG( uiCode, "pcm_loop_filter_disable_flag" ); pcSPS->setPCMFilterDisableFlag ( uiCode ? true : false ); 815 } 816 817 READ_FLAG( uiCode, "temporal_id_nesting_flag" ); pcSPS->setTemporalIdNestingFlag ( uiCode > 0 ? true : false ); 667 READ_CODE( 4, uiCode, "pcm_sample_bit_depth_luma_minus1" ); pcSPS->setPCMBitDepthLuma ( 1 + uiCode ); 668 READ_CODE( 4, uiCode, "pcm_sample_bit_depth_chroma_minus1" ); pcSPS->setPCMBitDepthChroma ( 1 + uiCode ); 669 READ_UVLC( uiCode, "log2_min_pcm_luma_coding_block_size_minus3" ); pcSPS->setPCMLog2MinSize (uiCode+3); 670 READ_UVLC( uiCode, "log2_diff_max_min_pcm_luma_coding_block_size" ); pcSPS->setPCMLog2MaxSize ( uiCode+pcSPS->getPCMLog2MinSize() ); 671 READ_FLAG( uiCode, "pcm_loop_filter_disable_flag" ); pcSPS->setPCMFilterDisableFlag ( uiCode ? true : false ); 672 } 818 673 819 674 READ_UVLC( uiCode, "num_short_term_ref_pic_sets" ); … … 829 684 } 830 685 READ_FLAG( uiCode, "long_term_ref_pics_present_flag" ); pcSPS->setLongTermRefsPresent(uiCode); 831 #if LTRP_IN_SPS832 686 if (pcSPS->getLongTermRefsPresent()) 833 687 { … … 837 691 { 838 692 READ_CODE( pcSPS->getBitsForPOC(), uiCode, "lt_ref_pic_poc_lsb_sps" ); 839 pcSPS->setLtRefPicPocLsbSps( uiCode, k);693 pcSPS->setLtRefPicPocLsbSps(k, uiCode); 840 694 READ_FLAG( uiCode, "used_by_curr_pic_lt_sps_flag[i]"); 841 695 pcSPS->setUsedByCurrPicLtSPSFlag(k, uiCode?1:0); 842 696 } 843 697 } 844 #endif845 698 READ_FLAG( uiCode, "sps_temporal_mvp_enable_flag" ); pcSPS->setTMVPFlagsPresent(uiCode); 846 699 #if REF_IDX_MFM … … 849 702 READ_FLAG( uiCode, "sps_enh_mfm_enable_flag" ); 850 703 pcSPS->setMFMEnabledFlag( uiCode ? true : false ); 851 assert(pcSPS->getMFMEnabledFlag());852 } 853 #endif 854 #if SUPPORT_FOR_VUI 704 } 705 #endif 706 READ_FLAG( uiCode, "sps_strong_intra_smoothing_enable_flag" ); pcSPS->setUseStrongIntraSmoothing(uiCode); 707 855 708 READ_FLAG( uiCode, "vui_parameters_present_flag" ); pcSPS->setVuiParametersPresentFlag(uiCode); 856 709 857 710 if (pcSPS->getVuiParametersPresentFlag()) 858 711 { 859 #if !BUFFERING_PERIOD_AND_TIMING_SEI860 parseVUI(pcSPS->getVuiParameters());861 #else862 712 parseVUI(pcSPS->getVuiParameters(), pcSPS); 863 #endif 864 } 865 #endif 866 #if !SPS_AMVP_CLEANUP 867 // AMVP mode for each depth (AM_NONE or AM_EXPL) 868 for (Int i = 0; i < pcSPS->getMaxCUDepth(); i++) 869 { 870 xReadFlag( uiCode ); 871 pcSPS->setAMVPMode( i, (AMVP_MODE)uiCode ); 872 } 873 #endif 713 } 714 874 715 READ_FLAG( uiCode, "sps_extension_flag"); 875 716 if (uiCode) … … 886 727 UInt uiCode; 887 728 888 #if VPS_SYNTAX_CHANGES 889 READ_CODE( 4, uiCode, "video_parameter_set_id" ); pcVPS->setVPSId( uiCode ); 729 READ_CODE( 4, uiCode, "vps_video_parameter_set_id" ); pcVPS->setVPSId( uiCode ); 730 READ_CODE( 2, uiCode, "vps_reserved_three_2bits" ); assert(uiCode == 3); 731 #if VPS_RENAME 732 READ_CODE( 6, uiCode, "vps_max_layers_minus1" ); pcVPS->setMaxLayers( uiCode + 1); 733 #else 734 READ_CODE( 6, uiCode, "vps_reserved_zero_6bits" ); assert(uiCode == 0); 735 #endif 736 READ_CODE( 3, uiCode, "vps_max_sub_layers_minus1" ); pcVPS->setMaxTLayers( uiCode + 1 ); 890 737 READ_FLAG( uiCode, "vps_temporal_id_nesting_flag" ); pcVPS->setTemporalNestingFlag( uiCode ? true:false ); 891 READ_CODE( 2, uiCode, "vps_reserved_zero_2bits" ); assert(uiCode == 0); 892 READ_CODE( 6, uiCode, "vps_reserved_zero_6bits" ); assert(uiCode == 0); 893 READ_CODE( 3, uiCode, "vps_max_sub_layers_minus1" ); pcVPS->setMaxTLayers( uiCode + 1 ); 738 assert (pcVPS->getMaxTLayers()>1||pcVPS->getTemporalNestingFlag()); 739 READ_CODE( 16, uiCode, "vps_reserved_ffff_16bits" ); assert(uiCode == 0xffff); 894 740 parsePTL ( pcVPS->getPTL(), true, pcVPS->getMaxTLayers()-1); 895 READ_CODE( 12, uiCode, "vps_reserved_zero_12bits" ); assert(uiCode == 0); 896 #else 897 READ_CODE( 3, uiCode, "vps_max_temporal_layers_minus1" ); pcVPS->setMaxTLayers( uiCode + 1 ); 898 READ_CODE( 5, uiCode, "vps_max_layers_minus1" ); pcVPS->setMaxLayers( uiCode + 1 ); 899 READ_UVLC( uiCode, "video_parameter_set_id" ); pcVPS->setVPSId( uiCode ); 900 READ_FLAG( uiCode, "vps_temporal_id_nesting_flag" ); pcVPS->setTemporalNestingFlag( uiCode ? true:false ); 901 #endif 741 #if SIGNAL_BITRATE_PICRATE_IN_VPS 742 parseBitratePicRateInfo( pcVPS->getBitratePicrateInfo(), 0, pcVPS->getMaxTLayers() - 1); 743 #endif 744 UInt subLayerOrderingInfoPresentFlag; 745 READ_FLAG(subLayerOrderingInfoPresentFlag, "vps_sub_layer_ordering_info_present_flag"); 902 746 for(UInt i = 0; i <= pcVPS->getMaxTLayers()-1; i++) 903 747 { … … 905 749 READ_UVLC( uiCode, "vps_num_reorder_pics[i]" ); pcVPS->setNumReorderPics( uiCode, i ); 906 750 READ_UVLC( uiCode, "vps_max_latency_increase[i]" ); pcVPS->setMaxLatencyIncrease( uiCode, i ); 907 } 908 #if VPS_SYNTAX_CHANGES 909 READ_UVLC( uiCode, "vps_num_hrd_parameters" ); assert(uiCode == 0); 910 // hrd_parameters 911 #endif 912 READ_FLAG( uiCode, "vps_extension_flag" ); assert(!uiCode); 913 //future extensions go here.. 751 752 if (!subLayerOrderingInfoPresentFlag) 753 { 754 for (i++; i <= pcVPS->getMaxTLayers()-1; i++) 755 { 756 pcVPS->setMaxDecPicBuffering(pcVPS->getMaxDecPicBuffering(0), i); 757 pcVPS->setNumReorderPics(pcVPS->getNumReorderPics(0), i); 758 pcVPS->setMaxLatencyIncrease(pcVPS->getMaxLatencyIncrease(0), i); 759 } 760 break; 761 } 762 } 763 764 #if VPS_RENAME 765 assert( pcVPS->getNumHrdParameters() < MAX_VPS_LAYER_SETS_PLUS1 ); 766 assert( pcVPS->getMaxLayerId() < MAX_VPS_LAYER_ID_PLUS1 ); 767 READ_CODE( 6, uiCode, "vps_max_layer_id" ); pcVPS->setMaxLayerId( uiCode ); 768 READ_UVLC( uiCode, "vps_num_layer_sets_minus1" ); pcVPS->setNumLayerSets( uiCode + 1 ); 769 for( UInt opsIdx = 1; opsIdx <= ( pcVPS->getNumLayerSets() - 1 ); opsIdx ++ ) 770 { 771 // Operation point set 772 for( UInt i = 0; i <= pcVPS->getMaxLayerId(); i ++ ) 773 #else 774 assert( pcVPS->getNumHrdParameters() < MAX_VPS_OP_SETS_PLUS1 ); 775 assert( pcVPS->getMaxNuhReservedZeroLayerId() < MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1 ); 776 READ_CODE( 6, uiCode, "vps_max_nuh_reserved_zero_layer_id" ); pcVPS->setMaxNuhReservedZeroLayerId( uiCode ); 777 READ_UVLC( uiCode, "vps_max_op_sets_minus1" ); pcVPS->setMaxOpSets( uiCode + 1 ); 778 for( UInt opsIdx = 1; opsIdx <= ( pcVPS->getMaxOpSets() - 1 ); opsIdx ++ ) 779 { 780 // Operation point set 781 for( UInt i = 0; i <= pcVPS->getMaxNuhReservedZeroLayerId(); i ++ ) 782 #endif 783 { 784 READ_FLAG( uiCode, "layer_id_included_flag[opsIdx][i]" ); pcVPS->setLayerIdIncludedFlag( uiCode == 1 ? true : false, opsIdx, i ); 785 } 786 } 787 #if L0043_TIMING_INFO 788 TimingInfo *timingInfo = pcVPS->getTimingInfo(); 789 READ_FLAG( uiCode, "vps_timing_info_present_flag"); timingInfo->setTimingInfoPresentFlag (uiCode ? true : false); 790 if(timingInfo->getTimingInfoPresentFlag()) 791 { 792 READ_CODE( 32, uiCode, "vps_num_units_in_tick"); timingInfo->setNumUnitsInTick (uiCode); 793 READ_CODE( 32, uiCode, "vps_time_scale"); timingInfo->setTimeScale (uiCode); 794 READ_FLAG( uiCode, "vps_poc_proportional_to_timing_flag"); timingInfo->setPocProportionalToTimingFlag(uiCode ? true : false); 795 if(timingInfo->getPocProportionalToTimingFlag()) 796 { 797 READ_UVLC( uiCode, "vps_num_ticks_poc_diff_one_minus1"); timingInfo->setNumTicksPocDiffOneMinus1 (uiCode); 798 } 799 #endif 800 READ_UVLC( uiCode, "vps_num_hrd_parameters" ); pcVPS->setNumHrdParameters( uiCode ); 801 802 if( pcVPS->getNumHrdParameters() > 0 ) 803 { 804 pcVPS->createHrdParamBuffer(); 805 } 806 for( UInt i = 0; i < pcVPS->getNumHrdParameters(); i ++ ) 807 { 808 READ_UVLC( uiCode, "hrd_op_set_idx" ); pcVPS->setHrdOpSetIdx( uiCode, i ); 809 if( i > 0 ) 810 { 811 READ_FLAG( uiCode, "cprms_present_flag[i]" ); pcVPS->setCprmsPresentFlag( uiCode == 1 ? true : false, i ); 812 } 813 parseHrdParameters(pcVPS->getHrdParameters(i), pcVPS->getCprmsPresentFlag( i ), pcVPS->getMaxTLayers() - 1); 814 } 815 #if L0043_TIMING_INFO 816 } 817 #endif 818 READ_FLAG( uiCode, "vps_extension_flag" ); 819 if (uiCode) 820 { 821 #if VPS_EXTNS 822 parseVPSExtension(pcVPS); 823 READ_FLAG( uiCode, "vps_entension2_flag" ); 824 if(uiCode) 825 { 826 while ( xMoreRbspData() ) 827 { 828 READ_FLAG( uiCode, "vps_extension_data_flag"); 829 } 830 } 831 #else 832 while ( xMoreRbspData() ) 833 { 834 READ_FLAG( uiCode, "vps_extension_data_flag"); 835 } 836 #endif 837 } 914 838 915 839 return; 916 840 } 917 841 842 #if VPS_EXTNS 843 Void TDecCavlc::parseVPSExtension(TComVPS *vps) 844 { 845 UInt uiCode; 846 // ... More syntax elements to be parsed here 847 #if VPS_EXTN_MASK_AND_DIM_INFO 848 UInt numScalabilityTypes = 0, i = 0, j = 0; 849 850 READ_FLAG( uiCode, "avc_base_layer_flag" ); vps->setAvcBaseLayerFlag(uiCode ? true : false); 851 READ_FLAG( uiCode, "splitting_flag" ); vps->setSplittingFlag(uiCode ? true : false); 852 853 for(i = 0; i < MAX_VPS_NUM_SCALABILITY_TYPES; i++) 854 { 855 READ_FLAG( uiCode, "scalability_mask[i]" ); vps->setScalabilityMask(i, uiCode ? true : false); 856 numScalabilityTypes += uiCode; 857 if( i != 1 ) 858 { 859 // Multiview and reserved masks are not used in this version of software 860 assert( uiCode == 0 ); 861 } 862 } 863 vps->setNumScalabilityTypes(numScalabilityTypes); 864 865 for(j = 0; j < numScalabilityTypes; j++) 866 { 867 READ_CODE( 3, uiCode, "dimension_id_len_minus1[j]" ); vps->setDimensionIdLen(j, uiCode + 1); 868 } 869 if(vps->getSplittingFlag()) 870 { 871 UInt numBits = 0; 872 for(j = 0; j < numScalabilityTypes; j++) 873 { 874 numBits += vps->getDimensionIdLen(j); 875 } 876 assert( numBits <= 6 ); 877 } 878 879 READ_FLAG( uiCode, "vps_nuh_layer_id_present_flag" ); vps->setNuhLayerIdPresentFlag(uiCode ? true : false); 880 vps->setLayerIdInNuh(0, 0); 881 vps->setLayerIdInVps(0, 0); 882 for(i = 1; i < vps->getMaxLayers(); i++) 883 { 884 if( vps->getNuhLayerIdPresentFlag() ) 885 { 886 READ_CODE( 6, uiCode, "layer_id_in_nuh[i]" ); vps->setLayerIdInNuh(i, uiCode); 887 assert( uiCode > vps->getLayerIdInNuh(i-1) ); 888 } 889 else 890 { 891 vps->setLayerIdInNuh(i, i); 892 } 893 vps->setLayerIdInVps(vps->getLayerIdInNuh(i), i); 894 895 for(j = 0; j < numScalabilityTypes; j++) 896 { 897 READ_CODE( vps->getDimensionIdLen(j), uiCode, "dimension_id[i][j]" ); vps->setDimensionId(i, j, uiCode); 898 assert( uiCode <= vps->getMaxLayerId() ); 899 } 900 } 901 #endif 902 903 #if VPS_EXTN_PROFILE_INFO 904 // Profile-tier-level signalling 905 vps->getPTLForExtnPtr()->resize(vps->getNumLayerSets()); 906 for(Int idx = 1; idx <= vps->getNumLayerSets() - 1; idx++) 907 { 908 READ_FLAG( uiCode, "vps_profile_present_flag[i]" ); vps->setProfilePresentFlag(idx, uiCode ? true : false); 909 if( !vps->getProfilePresentFlag(idx) ) 910 { 911 READ_UVLC( uiCode, "vps_profile_layer_set_ref_minus1[i]" ); vps->setProfileLayerSetRef(idx, uiCode + 1); 912 assert( vps->getProfileLayerSetRef(idx) < idx ); 913 // Copy profile information as indicated 914 vps->getPTLForExtn(idx)->copyProfileInfo( vps->getPTLForExtn( vps->getProfileLayerSetRef(idx) ) ); 915 } 916 parsePTL( vps->getPTLForExtn(idx), vps->getProfilePresentFlag(idx), vps->getMaxTLayers() - 1 ); 917 } 918 #endif 919 920 #if VPS_EXTN_OP_LAYER_SETS 921 // Target output layer signalling 922 READ_UVLC( uiCode, "vps_num_output_layer_sets"); vps->setNumOutputLayerSets(uiCode); 923 for(i = 0; i < vps->getNumOutputLayerSets(); i++) 924 { 925 READ_UVLC( uiCode, "vps_output_layer_set_idx[i]"); vps->setOutputLayerSetIdx(i, uiCode); 926 Int lsIdx = vps->getOutputLayerSetIdx(i); 927 for(j = 0; j <= vps->getMaxLayerId(); j++) 928 { 929 if(vps->getLayerIdIncludedFlag(lsIdx, j)) 930 { 931 READ_FLAG( uiCode, "vps_output_layer_flag[lsIdx][j]"); vps->setOutputLayerFlag(lsIdx, j, uiCode); 932 } 933 } 934 } 935 #endif 936 #if VPS_EXTN_DIRECT_REF_LAYERS 937 // For layer 0 938 vps->setNumDirectRefLayers(0, 0); 939 // For other layers 940 for( Int layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++) 941 { 942 UInt numDirectRefLayers = 0; 943 for( Int refLayerCtr = 0; refLayerCtr < layerCtr; refLayerCtr++) 944 { 945 READ_FLAG(uiCode, "direct_dependency_flag[i][j]" ); vps->setDirectDependencyFlag(layerCtr, refLayerCtr, uiCode? true : false); 946 if(uiCode) 947 { 948 vps->setRefLayerId(layerCtr, numDirectRefLayers, refLayerCtr); 949 numDirectRefLayers++; 950 } 951 } 952 vps->setNumDirectRefLayers(layerCtr, numDirectRefLayers); 953 } 954 #endif 955 } 956 #endif 957 918 958 Void TDecCavlc::parseSliceHeader (TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager) 919 959 { … … 927 967 TComSPS* sps = NULL; 928 968 929 UInt firstSliceInPic; 930 READ_FLAG( firstSliceInPic, "first_slice_in_pic_flag" ); 931 #if SPLICING_FRIENDLY_PARAMS 969 UInt firstSliceSegmentInPic; 970 READ_FLAG( firstSliceSegmentInPic, "first_slice_segment_in_pic_flag" ); 932 971 if( rpcSlice->getRapPicFlag()) 933 972 { 934 973 READ_FLAG( uiCode, "no_output_of_prior_pics_flag" ); //ignored 935 974 } 936 #endif 937 READ_UVLC ( uiCode, "pic_parameter_set_id" ); rpcSlice->setPPSId(uiCode); 975 READ_UVLC ( uiCode, "slice_pic_parameter_set_id" ); rpcSlice->setPPSId(uiCode); 938 976 pps = parameterSetManager->getPrefetchedPPS(uiCode); 939 977 //!KS: need to add error handling code here, if PPS is not available … … 944 982 rpcSlice->setSPS(sps); 945 983 rpcSlice->setPPS(pps); 946 947 Int numCUs = ((sps->getPicWidthInLumaSamples()+sps->getMaxCUWidth()-1)/sps->getMaxCUWidth())*((sps->getPicHeightInLumaSamples()+sps->getMaxCUHeight()-1)/sps->getMaxCUHeight()); 984 if( pps->getDependentSliceSegmentsEnabledFlag() && ( !firstSliceSegmentInPic )) 985 { 986 READ_FLAG( uiCode, "dependent_slice_segment_flag" ); rpcSlice->setDependentSliceSegmentFlag(uiCode ? true : false); 987 } 988 else 989 { 990 rpcSlice->setDependentSliceSegmentFlag(false); 991 } 992 Int numCTUs = ((sps->getPicWidthInLumaSamples()+sps->getMaxCUWidth()-1)/sps->getMaxCUWidth())*((sps->getPicHeightInLumaSamples()+sps->getMaxCUHeight()-1)/sps->getMaxCUHeight()); 948 993 Int maxParts = (1<<(sps->getMaxCUDepth()<<1)); 949 #if REMOVE_FGS 950 Int numParts = 0; 951 #else 952 Int numParts = (1<<(pps->getSliceGranularity()<<1)); 953 #endif 954 UInt lCUAddress = 0; 955 Int reqBitsOuter = 0; 956 while(numCUs>(1<<reqBitsOuter)) 957 { 958 reqBitsOuter++; 959 } 960 Int reqBitsInner = 0; 961 while((numParts)>(1<<reqBitsInner)) 962 { 963 reqBitsInner++; 964 } 965 966 UInt innerAddress = 0; 967 Int sliceAddress = 0; 968 if(!firstSliceInPic) 969 { 970 UInt address; 971 READ_CODE( reqBitsOuter+reqBitsInner, address, "slice_address" ); 972 lCUAddress = address >> reqBitsInner; 973 innerAddress = address - (lCUAddress<<reqBitsInner); 994 UInt sliceSegmentAddress = 0; 995 Int bitsSliceSegmentAddress = 0; 996 while(numCTUs>(1<<bitsSliceSegmentAddress)) 997 { 998 bitsSliceSegmentAddress++; 999 } 1000 1001 if(!firstSliceSegmentInPic) 1002 { 1003 READ_CODE( bitsSliceSegmentAddress, sliceSegmentAddress, "slice_segment_address" ); 974 1004 } 975 1005 //set uiCode to equal slice start address (or dependent slice start address) 976 #if REMOVE_FGS 977 sliceAddress=(maxParts*lCUAddress)+(innerAddress); 978 #else 979 sliceAddress=(maxParts*lCUAddress)+(innerAddress*(maxParts>>(pps->getSliceGranularity()<<1))); 980 #endif 981 rpcSlice->setDependentSliceCurStartCUAddr( sliceAddress ); 982 rpcSlice->setDependentSliceCurEndCUAddr(numCUs*maxParts); 983 984 #if SLICEHEADER_SYNTAX_FIX 985 if( pps->getDependentSliceEnabledFlag() && (sliceAddress !=0 )) 986 { 987 READ_FLAG( uiCode, "dependent_slice_flag" ); rpcSlice->setDependentSliceFlag(uiCode ? true : false); 1006 Int startCuAddress = maxParts*sliceSegmentAddress; 1007 rpcSlice->setSliceSegmentCurStartCUAddr( startCuAddress ); 1008 rpcSlice->setSliceSegmentCurEndCUAddr(numCTUs*maxParts); 1009 1010 if (rpcSlice->getDependentSliceSegmentFlag()) 1011 { 1012 rpcSlice->setNextSlice ( false ); 1013 rpcSlice->setNextSliceSegment ( true ); 988 1014 } 989 1015 else 990 1016 { 991 rpcSlice->setDependentSliceFlag(false);992 }993 994 if (rpcSlice->getDependentSliceFlag())995 {996 rpcSlice->setNextSlice ( false );997 rpcSlice->setNextDependentSlice ( true );998 }999 else1000 {1001 1017 rpcSlice->setNextSlice ( true ); 1002 rpcSlice->setNext DependentSlice( false );1003 1004 rpcSlice->setSliceCurStartCUAddr(s liceAddress);1005 rpcSlice->setSliceCurEndCUAddr(numC Us*maxParts);1018 rpcSlice->setNextSliceSegment ( false ); 1019 1020 rpcSlice->setSliceCurStartCUAddr(startCuAddress); 1021 rpcSlice->setSliceCurEndCUAddr(numCTUs*maxParts); 1006 1022 } 1007 1023 1008 if(!rpcSlice->getDependentSliceFlag()) 1009 { 1010 #endif 1024 if(!rpcSlice->getDependentSliceSegmentFlag()) 1025 { 1026 for (Int i = 0; i < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++) 1027 { 1028 READ_FLAG(uiCode, "slice_reserved_undetermined_flag[]"); // ignored 1029 } 1030 1011 1031 READ_UVLC ( uiCode, "slice_type" ); rpcSlice->setSliceType((SliceType)uiCode); 1012 #if !SLICEHEADER_SYNTAX_FIX1013 // lightweight_slice_flag1014 READ_FLAG( uiCode, "dependent_slice_flag" );1015 Bool bDependentSlice = uiCode ? true : false;1016 #if DEPENDENT_SLICES1017 if( rpcSlice->getPPS()->getDependentSliceEnabledFlag())1018 {1019 if(bDependentSlice)1020 {1021 rpcSlice->setNextSlice ( false );1022 rpcSlice->setNextDependentSlice( true );1023 #if BYTE_ALIGNMENT1024 m_pcBitstream->readByteAlignment();1025 #else1026 m_pcBitstream->readOutTrailingBits();1027 #endif1028 return;1029 }1030 }1031 #endif1032 if (bDependentSlice)1033 {1034 rpcSlice->setNextSlice ( false );1035 rpcSlice->setNextDependentSlice ( true );1036 }1037 else1038 {1039 rpcSlice->setNextSlice ( true );1040 rpcSlice->setNextDependentSlice ( false );1041 1042 rpcSlice->setSliceCurStartCUAddr(sliceAddress);1043 rpcSlice->setSliceCurEndCUAddr(numCUs*maxParts);1044 }1045 1046 if (!bDependentSlice)1047 {1048 #endif // !SLICEHEADER_SYNTAX_FIX1049 1032 if( pps->getOutputFlagPresentFlag() ) 1050 1033 { … … 1060 1043 // colour_plane_id u(2) 1061 1044 1062 #if !SPLICING_FRIENDLY_PARAMS1063 if( rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR1064 #if SUPPORT_FOR_RAP_N_LP1065 || rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP1066 || rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP1067 #endif1068 || rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLANT1069 || rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA1070 #if !NAL_UNIT_TYPES_J1003_D71071 || rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRANT1072 #endif1073 || rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA )1074 {1075 READ_UVLC( uiCode, "rap_pic_id" ); //ignored1076 READ_FLAG( uiCode, "no_output_of_prior_pics_flag" ); //ignored1077 }1078 #endif1079 #if SUPPORT_FOR_RAP_N_LP1080 1045 if( rpcSlice->getIdrPicFlag() ) 1081 #else1082 if( rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR )1083 #endif1084 1046 { 1085 1047 rpcSlice->setPOC(0); … … 1112 1074 iPOCmsb = iPrevPOCmsb; 1113 1075 } 1114 #if SUPPORT_FOR_RAP_N_LP1115 1076 if ( rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA 1116 1077 || rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLANT 1117 1078 || rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP ) 1118 #else1119 if( rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA1120 || rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLANT )1121 #endif1122 1079 { 1123 1080 // For BLA picture types, POCmsb is set to 0. … … 1136 1093 else // use reference to short-term reference picture set in PPS 1137 1094 { 1138 READ_UVLC( uiCode, "short_term_ref_pic_set_idx"); rpcSlice->setRPS(sps->getRPSList()->getReferencePictureSet(uiCode)); 1095 Int numBits = 0; 1096 while ((1 << numBits) < rpcSlice->getSPS()->getRPSList()->getNumberOfReferencePictureSets()) 1097 { 1098 numBits++; 1099 } 1100 if (numBits > 0) 1101 { 1102 READ_CODE( numBits, uiCode, "short_term_ref_pic_set_idx"); 1103 } 1104 else 1105 { 1106 uiCode = 0; 1107 } 1108 rpcSlice->setRPS(sps->getRPSList()->getReferencePictureSet(uiCode)); 1109 1139 1110 rps = rpcSlice->getRPS(); 1140 1111 } … … 1142 1113 { 1143 1114 Int offset = rps->getNumberOfNegativePictures()+rps->getNumberOfPositivePictures(); 1144 #if LTRP_IN_SPS1145 1115 UInt numOfLtrp = 0; 1146 1116 UInt numLtrpInSPS = 0; … … 1152 1122 rps->setNumberOfLongtermPictures(numOfLtrp); 1153 1123 } 1154 Int bitsForLtrpInSPS = 1;1124 Int bitsForLtrpInSPS = 0; 1155 1125 while (rpcSlice->getSPS()->getNumLongTermRefPicSPS() > (1 << bitsForLtrpInSPS)) 1126 { 1156 1127 bitsForLtrpInSPS++; 1128 } 1157 1129 READ_UVLC( uiCode, "num_long_term_pics"); rps->setNumberOfLongtermPictures(uiCode); 1158 1130 numOfLtrp += uiCode; 1159 1131 rps->setNumberOfLongtermPictures(numOfLtrp); 1160 #else1161 READ_UVLC( uiCode, "num_long_term_pics"); rps->setNumberOfLongtermPictures(uiCode);1162 #endif1163 1132 Int maxPicOrderCntLSB = 1 << rpcSlice->getSPS()->getBitsForPOC(); 1164 1133 Int prevLSB = 0, prevDeltaMSB = 0, deltaPocMSBCycleLT = 0;; 1165 #if LTRP_IN_SPS1166 1134 for(Int j=offset+rps->getNumberOfLongtermPictures()-1, k = 0; k < numOfLtrp; j--, k++) 1167 #else 1168 for(Int j=offset+rps->getNumberOfLongtermPictures()-1 ; j > offset-1; j--) 1169 #endif 1170 { 1171 #if LTRP_IN_SPS 1135 { 1136 Int pocLsbLt; 1172 1137 if (k < numLtrpInSPS) 1173 1138 { 1174 READ_CODE(bitsForLtrpInSPS, uiCode, "lt_idx_sps[i]"); 1139 uiCode = 0; 1140 if (bitsForLtrpInSPS > 0) 1141 { 1142 READ_CODE(bitsForLtrpInSPS, uiCode, "lt_idx_sps[i]"); 1143 } 1175 1144 Int usedByCurrFromSPS=rpcSlice->getSPS()->getUsedByCurrPicLtSPSFlag(uiCode); 1176 1145 1177 uiCode= rpcSlice->getSPS()->getLtRefPicPocLsbSps(uiCode);1146 pocLsbLt = rpcSlice->getSPS()->getLtRefPicPocLsbSps(uiCode); 1178 1147 rps->setUsed(j,usedByCurrFromSPS); 1179 1148 } 1180 1149 else 1181 1150 { 1182 READ_CODE(rpcSlice->getSPS()->getBitsForPOC(), uiCode, "poc_lsb_lt"); 1151 READ_CODE(rpcSlice->getSPS()->getBitsForPOC(), uiCode, "poc_lsb_lt"); pocLsbLt= uiCode; 1183 1152 READ_FLAG( uiCode, "used_by_curr_pic_lt_flag"); rps->setUsed(j,uiCode); 1184 1153 } 1185 #else1186 READ_CODE(rpcSlice->getSPS()->getBitsForPOC(), uiCode, "poc_lsb_lt");1187 #endif1188 Int poc_lsb_lt = uiCode;1189 1154 READ_FLAG(uiCode,"delta_poc_msb_present_flag"); 1190 1155 Bool mSBPresentFlag = uiCode ? true : false; … … 1193 1158 READ_UVLC( uiCode, "delta_poc_msb_cycle_lt[i]" ); 1194 1159 Bool deltaFlag = false; 1195 #if LTRP_IN_SPS1196 1160 // First LTRP || First LTRP from SH || curr LSB != prev LSB 1197 if( (j == offset+rps->getNumberOfLongtermPictures()-1) || (j == offset+(numOfLtrp-numLtrpInSPS)-1) || (poc_lsb_lt != prevLSB) ) 1198 #else 1199 // First LTRP || curr LSB != prev LSB 1200 if( (j == offset+rps->getNumberOfLongtermPictures()-1) || (poc_lsb_lt != prevLSB) ) 1201 #endif 1161 if( (j == offset+rps->getNumberOfLongtermPictures()-1) || (j == offset+(numOfLtrp-numLtrpInSPS)-1) || (pocLsbLt != prevLSB) ) 1202 1162 { 1203 1163 deltaFlag = true; … … 1213 1173 1214 1174 Int pocLTCurr = rpcSlice->getPOC() - deltaPocMSBCycleLT * maxPicOrderCntLSB 1215 - iPOClsb + poc _lsb_lt;1175 - iPOClsb + pocLsbLt; 1216 1176 rps->setPOC (j, pocLTCurr); 1217 1177 rps->setDeltaPOC(j, - rpcSlice->getPOC() + pocLTCurr); … … 1220 1180 else 1221 1181 { 1222 rps->setPOC (j, poc _lsb_lt);1223 rps->setDeltaPOC(j, - rpcSlice->getPOC() + poc _lsb_lt);1182 rps->setPOC (j, pocLsbLt); 1183 rps->setDeltaPOC(j, - rpcSlice->getPOC() + pocLsbLt); 1224 1184 rps->setCheckLTMSBPresent(j,false); 1225 1185 } 1226 #if !LTRP_IN_SPS 1227 READ_FLAG( uiCode, "used_by_curr_pic_lt_flag"); rps->setUsed(j,uiCode); 1228 #endif 1229 prevLSB = poc_lsb_lt; 1186 prevLSB = pocLsbLt; 1230 1187 prevDeltaMSB = deltaPocMSBCycleLT; 1231 1188 } … … 1233 1190 rps->setNumberOfPictures(offset); 1234 1191 } 1235 #if SUPPORT_FOR_RAP_N_LP1236 1192 if ( rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA 1237 1193 || rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLANT 1238 1194 || rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP ) 1239 #else1240 if( rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA1241 || rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLANT )1242 #endif1243 1195 { 1244 1196 // In the case of BLA picture types, rps data is read from slice header but ignored … … 1250 1202 rpcSlice->setRPS(rps); 1251 1203 } 1252 } 1253 #if REMOVE_ALF 1204 if (rpcSlice->getSPS()->getTMVPFlagsPresent()) 1205 { 1206 READ_FLAG( uiCode, "slice_temporal_mvp_enable_flag" ); 1207 rpcSlice->setEnableTMVPFlag( uiCode == 1 ? true : false ); 1208 } 1209 else 1210 { 1211 rpcSlice->setEnableTMVPFlag(false); 1212 } 1213 } 1254 1214 if(sps->getUseSAO()) 1255 #else 1256 if(sps->getUseSAO() || sps->getUseALF()) 1257 #endif 1258 { 1259 if (sps->getUseSAO()) 1260 { 1261 READ_FLAG(uiCode, "slice_sao_luma_flag"); rpcSlice->setSaoEnabledFlag((Bool)uiCode); 1262 #if !SAO_LUM_CHROMA_ONOFF_FLAGS 1263 if (rpcSlice->getSaoEnabledFlag() ) 1264 #endif 1265 { 1266 #if SAO_TYPE_SHARING 1267 READ_FLAG(uiCode, "slice_sao_chroma_flag"); rpcSlice->setSaoEnabledFlagChroma((Bool)uiCode); 1268 #else 1269 READ_FLAG(uiCode, "sao_cb_enable_flag"); rpcSlice->setSaoEnabledFlagCb((Bool)uiCode); 1270 READ_FLAG(uiCode, "sao_cr_enable_flag"); rpcSlice->setSaoEnabledFlagCr((Bool)uiCode); 1271 #endif 1272 } 1273 #if !SAO_LUM_CHROMA_ONOFF_FLAGS 1274 else 1275 { 1276 #if SAO_TYPE_SHARING 1277 rpcSlice->setSaoEnabledFlagChroma(0); 1278 #else 1279 rpcSlice->setSaoEnabledFlagCb(0); 1280 rpcSlice->setSaoEnabledFlagCr(0); 1281 #endif 1282 } 1283 #endif 1284 } 1285 #if !REMOVE_APS 1286 READ_UVLC ( uiCode, "aps_id" ); rpcSlice->setAPSId(uiCode); 1287 #endif 1215 { 1216 READ_FLAG(uiCode, "slice_sao_luma_flag"); rpcSlice->setSaoEnabledFlag((Bool)uiCode); 1217 READ_FLAG(uiCode, "slice_sao_chroma_flag"); rpcSlice->setSaoEnabledFlagChroma((Bool)uiCode); 1218 } 1219 1220 if (rpcSlice->getIdrPicFlag()) 1221 { 1222 rpcSlice->setEnableTMVPFlag(false); 1288 1223 } 1289 1224 if (!rpcSlice->isIntra()) 1290 1225 { 1291 if (rpcSlice->getSPS()->getTMVPFlagsPresent()) 1292 { 1293 READ_FLAG( uiCode, "enable_temporal_mvp_flag" ); 1294 rpcSlice->setEnableTMVPFlag(uiCode); 1295 } 1296 else 1297 { 1298 rpcSlice->setEnableTMVPFlag(false); 1299 } 1226 1300 1227 READ_FLAG( uiCode, "num_ref_idx_active_override_flag"); 1301 1228 if (uiCode) … … 1328 1255 if(!rpcSlice->isIntra()) 1329 1256 { 1330 if( !rpcSlice->get SPS()->getListsModificationPresentFlag())1257 if( !rpcSlice->getPPS()->getListsModificationPresentFlag() || rpcSlice->getNumRpsCurrTempList() <= 1 ) 1331 1258 { 1332 1259 refPicListModification->setRefPicListModificationFlagL0( 0 ); … … 1371 1298 if(rpcSlice->isInterB()) 1372 1299 { 1373 if( !rpcSlice->get SPS()->getListsModificationPresentFlag())1300 if( !rpcSlice->getPPS()->getListsModificationPresentFlag() || rpcSlice->getNumRpsCurrTempList() <= 1 ) 1374 1301 { 1375 1302 refPicListModification->setRefPicListModificationFlagL1( 0 ); … … 1411 1338 refPicListModification->setRefPicListModificationFlagL1(0); 1412 1339 } 1413 #if !SLICEHEADER_SYNTAX_FIX1414 }1415 else1416 {1417 // initialize from previous slice1418 pps = rpcSlice->getPPS();1419 sps = rpcSlice->getSPS();1420 }1421 #endif1422 1340 if (rpcSlice->isInterB()) 1423 1341 { … … 1432 1350 } 1433 1351 1434 #if !SLICEHEADER_SYNTAX_FIX1435 if(!bDependentSlice)1436 {1437 #else1438 1352 if ( rpcSlice->getEnableTMVPFlag() ) 1439 1353 { … … 1449 1363 1450 1364 if ( rpcSlice->getSliceType() != I_SLICE && 1451 ((rpcSlice->getColFromL0Flag()==1 && rpcSlice->getNumRefIdx(REF_PIC_LIST_0)>1)||1452 (rpcSlice->getColFromL0Flag() ==0 && rpcSlice->getNumRefIdx(REF_PIC_LIST_1)>1)))1365 ((rpcSlice->getColFromL0Flag() == 1 && rpcSlice->getNumRefIdx(REF_PIC_LIST_0) > 1)|| 1366 (rpcSlice->getColFromL0Flag() == 0 && rpcSlice->getNumRefIdx(REF_PIC_LIST_1) > 1))) 1453 1367 { 1454 1368 READ_UVLC( uiCode, "collocated_ref_idx" ); … … 1465 1379 rpcSlice->initWpScaling(); 1466 1380 } 1467 READ_UVLC( uiCode, "five_minus_max_num_merge_cand"); 1468 rpcSlice->setMaxNumMergeCand(MRG_MAX_NUM_CANDS - uiCode); 1469 1470 #endif 1471 READ_SVLC( iCode, "slice_qp_delta" ); 1381 if (!rpcSlice->isIntra()) 1382 { 1383 READ_UVLC( uiCode, "five_minus_max_num_merge_cand"); 1384 rpcSlice->setMaxNumMergeCand(MRG_MAX_NUM_CANDS - uiCode); 1385 } 1386 1387 READ_SVLC( iCode, "slice_qp_delta" ); 1472 1388 rpcSlice->setSliceQp (26 + pps->getPicInitQPMinus26() + iCode); 1473 1389 … … 1475 1391 assert( rpcSlice->getSliceQp() <= 51 ); 1476 1392 1477 #if CHROMA_QP_EXTENSION1478 1393 if (rpcSlice->getPPS()->getSliceChromaQpFlag()) 1479 1394 { … … 1492 1407 assert( (rpcSlice->getPPS()->getChromaCrQpOffset() + rpcSlice->getSliceQpDeltaCr()) <= 12 ); 1493 1408 } 1494 #endif1495 1409 1496 1410 if (rpcSlice->getPPS()->getDeblockingFilterControlPresentFlag()) … … 1520 1434 } 1521 1435 } 1522 #if !SLICEHEADER_SYNTAX_FIX 1523 if ( rpcSlice->getEnableTMVPFlag() ) 1524 { 1525 if ( rpcSlice->getSliceType() == B_SLICE ) 1526 { 1527 READ_FLAG( uiCode, "collocated_from_l0_flag" ); 1528 rpcSlice->setColFromL0Flag(uiCode); 1529 } 1530 1531 if ( rpcSlice->getSliceType() != I_SLICE && 1532 ((rpcSlice->getColFromL0Flag()==1 && rpcSlice->getNumRefIdx(REF_PIC_LIST_0)>1)|| 1533 (rpcSlice->getColFromL0Flag() ==0 && rpcSlice->getNumRefIdx(REF_PIC_LIST_1)>1))) 1534 { 1535 READ_UVLC( uiCode, "collocated_ref_idx" ); 1536 rpcSlice->setColRefIdx(uiCode); 1537 } 1538 else 1539 { 1540 rpcSlice->setColRefIdx(0); 1541 } 1542 } 1543 if ( (pps->getUseWP() && rpcSlice->getSliceType()==P_SLICE) || (pps->getWPBiPred() && rpcSlice->getSliceType()==B_SLICE) ) 1544 { 1545 xParsePredWeightTable(rpcSlice); 1546 rpcSlice->initWpScaling(); 1547 } 1548 } 1549 1550 READ_UVLC( uiCode, "five_minus_max_num_merge_cand"); 1551 rpcSlice->setMaxNumMergeCand(MRG_MAX_NUM_CANDS - uiCode); 1552 1553 if (!bDependentSlice) 1554 { 1555 #endif 1556 #if !REMOVE_ALF 1557 if(sps->getUseALF()) 1558 { 1559 char syntaxString[50]; 1560 for(Int compIdx=0; compIdx< 3; compIdx++) 1561 { 1562 sprintf(syntaxString, "alf_slice_filter_flag[%d]", compIdx); 1563 READ_FLAG(uiCode, syntaxString); 1564 rpcSlice->setAlfEnabledFlag( (uiCode ==1), compIdx); 1565 } 1566 } 1567 Bool isAlfEnabled = (!rpcSlice->getSPS()->getUseALF())?(false):(rpcSlice->getAlfEnabledFlag(0)||rpcSlice->getAlfEnabledFlag(1)||rpcSlice->getAlfEnabledFlag(2)); 1568 #endif 1569 #if !SAO_LUM_CHROMA_ONOFF_FLAGS 1570 Bool isSAOEnabled = (!rpcSlice->getSPS()->getUseSAO())?(false):(rpcSlice->getSaoEnabledFlag()); 1436 else 1437 { 1438 rpcSlice->setDeblockingFilterDisable ( false ); 1439 rpcSlice->setDeblockingFilterBetaOffsetDiv2( 0 ); 1440 rpcSlice->setDeblockingFilterTcOffsetDiv2 ( 0 ); 1441 } 1442 1443 Bool isSAOEnabled = (!rpcSlice->getSPS()->getUseSAO())?(false):(rpcSlice->getSaoEnabledFlag()||rpcSlice->getSaoEnabledFlagChroma()); 1444 Bool isDBFEnabled = (!rpcSlice->getDeblockingFilterDisable()); 1445 1446 if(rpcSlice->getPPS()->getLoopFilterAcrossSlicesEnabledFlag() && ( isSAOEnabled || isDBFEnabled )) 1447 { 1448 READ_FLAG( uiCode, "slice_loop_filter_across_slices_enabled_flag"); 1449 } 1450 else 1451 { 1452 uiCode = rpcSlice->getPPS()->getLoopFilterAcrossSlicesEnabledFlag()?1:0; 1453 } 1454 rpcSlice->setLFCrossSliceBoundaryFlag( (uiCode==1)?true:false); 1455 1456 } 1457 1458 if( pps->getTilesEnabledFlag() || pps->getEntropyCodingSyncEnabledFlag() ) 1459 { 1460 UInt *entryPointOffset = NULL; 1461 UInt numEntryPointOffsets, offsetLenMinus1; 1462 1463 READ_UVLC(numEntryPointOffsets, "num_entry_point_offsets"); rpcSlice->setNumEntryPointOffsets ( numEntryPointOffsets ); 1464 if (numEntryPointOffsets>0) 1465 { 1466 READ_UVLC(offsetLenMinus1, "offset_len_minus1"); 1467 } 1468 entryPointOffset = new UInt[numEntryPointOffsets]; 1469 for (UInt idx=0; idx<numEntryPointOffsets; idx++) 1470 { 1471 #if L0116_ENTRY_POINT 1472 READ_CODE(offsetLenMinus1+1, uiCode, "entry_point_offset_minus1"); 1473 entryPointOffset[ idx ] = uiCode + 1; 1571 1474 #else 1572 Bool isSAOEnabled = (!rpcSlice->getSPS()->getUseSAO())?(false):(rpcSlice->getSaoEnabledFlag()||rpcSlice->getSaoEnabledFlagChroma()); 1573 #endif 1574 Bool isDBFEnabled = (!rpcSlice->getDeblockingFilterDisable()); 1575 1576 #if REMOVE_ALF 1577 #if MOVE_LOOP_FILTER_SLICES_FLAG 1578 if(rpcSlice->getPPS()->getLoopFilterAcrossSlicesEnabledFlag() && ( isSAOEnabled || isDBFEnabled )) 1579 #else 1580 if(rpcSlice->getSPS()->getLFCrossSliceBoundaryFlag() && ( isSAOEnabled || isDBFEnabled )) 1581 #endif 1582 #else 1583 if(rpcSlice->getSPS()->getLFCrossSliceBoundaryFlag() && ( isAlfEnabled || isSAOEnabled || isDBFEnabled )) 1584 #endif 1585 { 1586 READ_FLAG( uiCode, "slice_loop_filter_across_slices_enabled_flag"); 1587 } 1588 else 1589 { 1590 #if MOVE_LOOP_FILTER_SLICES_FLAG 1591 uiCode = rpcSlice->getPPS()->getLoopFilterAcrossSlicesEnabledFlag()?1:0; 1592 #else 1593 uiCode = rpcSlice->getSPS()->getLFCrossSliceBoundaryFlag()?1:0; 1594 #endif 1595 } 1596 rpcSlice->setLFCrossSliceBoundaryFlag( (uiCode==1)?true:false); 1597 1598 #if !SLICEHEADER_SYNTAX_FIX 1599 } 1600 #else 1601 } 1602 if( pps->getTilesEnabledFlag() || pps->getEntropyCodingSyncEnabledFlag() ) 1603 #endif 1604 { 1605 #if !SLICEHEADER_SYNTAX_FIX 1606 Int tilesOrEntropyCodingSyncIdc = pps->getTilesOrEntropyCodingSyncIdc(); 1607 #endif 1608 UInt *entryPointOffset = NULL; 1609 UInt numEntryPointOffsets, offsetLenMinus1; 1610 1611 #if !SLICEHEADER_SYNTAX_FIX 1612 rpcSlice->setNumEntryPointOffsets ( 0 ); // default 1613 1614 if (tilesOrEntropyCodingSyncIdc>0) 1615 { 1616 #endif 1617 READ_UVLC(numEntryPointOffsets, "num_entry_point_offsets"); rpcSlice->setNumEntryPointOffsets ( numEntryPointOffsets ); 1618 if (numEntryPointOffsets>0) 1619 { 1620 READ_UVLC(offsetLenMinus1, "offset_len_minus1"); 1621 } 1622 entryPointOffset = new UInt[numEntryPointOffsets]; 1623 for (UInt idx=0; idx<numEntryPointOffsets; idx++) 1624 { 1625 READ_CODE(offsetLenMinus1+1, uiCode, "entry_point_offset"); 1626 entryPointOffset[ idx ] = uiCode; 1627 } 1628 #if !SLICEHEADER_SYNTAX_FIX 1629 } 1630 #endif 1631 1632 #if !SLICEHEADER_SYNTAX_FIX 1633 if ( tilesOrEntropyCodingSyncIdc == 1 ) // tiles 1634 #else 1635 if ( pps->getTilesEnabledFlag() ) 1636 #endif 1637 { 1638 rpcSlice->setTileLocationCount( numEntryPointOffsets ); 1639 1640 UInt prevPos = 0; 1641 for (Int idx=0; idx<rpcSlice->getTileLocationCount(); idx++) 1642 { 1643 rpcSlice->setTileLocation( idx, prevPos + entryPointOffset [ idx ] ); 1644 prevPos += entryPointOffset[ idx ]; 1645 } 1646 } 1647 #if !SLICEHEADER_SYNTAX_FIX 1648 else if ( tilesOrEntropyCodingSyncIdc == 2 ) // wavefront 1649 #else 1650 else if ( pps->getEntropyCodingSyncEnabledFlag() ) 1651 #endif 1652 { 1653 Int numSubstreams = rpcSlice->getNumEntryPointOffsets()+1; 1654 rpcSlice->allocSubstreamSizes(numSubstreams); 1655 UInt *pSubstreamSizes = rpcSlice->getSubstreamSizes(); 1656 for (Int idx=0; idx<numSubstreams-1; idx++) 1657 { 1658 if ( idx < numEntryPointOffsets ) 1659 { 1660 pSubstreamSizes[ idx ] = ( entryPointOffset[ idx ] << 3 ) ; 1661 } 1662 else 1663 { 1664 pSubstreamSizes[ idx ] = 0; 1665 } 1666 } 1667 } 1668 1669 if (entryPointOffset) 1670 { 1671 delete [] entryPointOffset; 1672 } 1673 } 1674 #if SLICEHEADER_SYNTAX_FIX 1675 else 1676 { 1677 rpcSlice->setNumEntryPointOffsets ( 0 ); 1678 } 1679 #endif 1680 1681 #if SLICE_HEADER_EXTENSION 1475 READ_CODE(offsetLenMinus1+1, uiCode, "entry_point_offset"); 1476 entryPointOffset[ idx ] = uiCode; 1477 #endif 1478 } 1479 1480 if ( pps->getTilesEnabledFlag() ) 1481 { 1482 rpcSlice->setTileLocationCount( numEntryPointOffsets ); 1483 1484 UInt prevPos = 0; 1485 for (Int idx=0; idx<rpcSlice->getTileLocationCount(); idx++) 1486 { 1487 rpcSlice->setTileLocation( idx, prevPos + entryPointOffset [ idx ] ); 1488 prevPos += entryPointOffset[ idx ]; 1489 } 1490 } 1491 else if ( pps->getEntropyCodingSyncEnabledFlag() ) 1492 { 1493 Int numSubstreams = rpcSlice->getNumEntryPointOffsets()+1; 1494 rpcSlice->allocSubstreamSizes(numSubstreams); 1495 UInt *pSubstreamSizes = rpcSlice->getSubstreamSizes(); 1496 for (Int idx=0; idx<numSubstreams-1; idx++) 1497 { 1498 if ( idx < numEntryPointOffsets ) 1499 { 1500 pSubstreamSizes[ idx ] = ( entryPointOffset[ idx ] << 3 ) ; 1501 } 1502 else 1503 { 1504 pSubstreamSizes[ idx ] = 0; 1505 } 1506 } 1507 } 1508 1509 if (entryPointOffset) 1510 { 1511 delete [] entryPointOffset; 1512 } 1513 } 1514 else 1515 { 1516 rpcSlice->setNumEntryPointOffsets ( 0 ); 1517 } 1518 1682 1519 if(pps->getSliceHeaderExtensionPresentFlag()) 1683 1520 { … … 1689 1526 } 1690 1527 } 1691 #endif1692 #if BYTE_ALIGNMENT1693 1528 m_pcBitstream->readByteAlignment(); 1694 #else1695 if (!bDependentSlice)1696 {1697 // Reading location information1698 // read out trailing bits1699 m_pcBitstream->readOutTrailingBits();1700 }1701 #endif1702 1529 return; 1703 1530 } 1704 1531 1705 #if PROFILE_TIER_LEVEL_SYNTAX1706 1532 Void TDecCavlc::parsePTL( TComPTL *rpcPTL, Bool profilePresentFlag, Int maxNumSubLayersMinus1 ) 1707 1533 { … … 1713 1539 READ_CODE( 8, uiCode, "general_level_idc" ); rpcPTL->getGeneralPTL()->setLevelIdc(uiCode); 1714 1540 1541 #if L0363_BYTE_ALIGN 1542 for (Int i = 0; i < maxNumSubLayersMinus1; i++) 1543 { 1544 if(profilePresentFlag) 1545 { 1546 READ_FLAG( uiCode, "sub_layer_profile_present_flag[i]" ); rpcPTL->setSubLayerProfilePresentFlag(i, uiCode); 1547 } 1548 READ_FLAG( uiCode, "sub_layer_level_present_flag[i]" ); rpcPTL->setSubLayerLevelPresentFlag (i, uiCode); 1549 } 1550 1551 if (maxNumSubLayersMinus1 > 0) 1552 { 1553 for (Int i = maxNumSubLayersMinus1; i < 8; i++) 1554 { 1555 READ_CODE(2, uiCode, "reserved_zero_2bits"); 1556 assert(uiCode == 0); 1557 } 1558 } 1559 #endif 1560 1715 1561 for(Int i = 0; i < maxNumSubLayersMinus1; i++) 1716 1562 { 1717 READ_FLAG( uiCode, "sub_layer_profile_present_flag[i]" ); rpcPTL->setSubLayerProfilePresentFlag(i, uiCode); 1563 #if !L0363_BYTE_ALIGN 1564 if(profilePresentFlag) 1565 { 1566 READ_FLAG( uiCode, "sub_layer_profile_present_flag[i]" ); rpcPTL->setSubLayerProfilePresentFlag(i, uiCode); 1567 } 1718 1568 READ_FLAG( uiCode, "sub_layer_level_present_flag[i]" ); rpcPTL->setSubLayerLevelPresentFlag (i, uiCode); 1569 #endif 1719 1570 if( profilePresentFlag && rpcPTL->getSubLayerProfilePresentFlag(i) ) 1720 1571 { … … 1727 1578 } 1728 1579 } 1580 1729 1581 Void TDecCavlc::parseProfileTier(ProfileTierLevel *ptl) 1730 1582 { … … 1737 1589 READ_FLAG( uiCode, "XXX_profile_compatibility_flag[][j]"); ptl->setProfileCompatibilityFlag(j, uiCode ? 1 : 0); 1738 1590 } 1739 READ_CODE(16, uiCode, "XXX_reserved_zero_16bits[]"); assert( uiCode == 0 ); 1740 } 1741 #endif 1591 #if L0046_CONSTRAINT_FLAGS 1592 READ_FLAG(uiCode, "general_progressive_source_flag"); 1593 ptl->setProgressiveSourceFlag(uiCode ? true : false); 1594 1595 READ_FLAG(uiCode, "general_interlaced_source_flag"); 1596 ptl->setInterlacedSourceFlag(uiCode ? true : false); 1597 1598 READ_FLAG(uiCode, "general_non_packed_constraint_flag"); 1599 ptl->setNonPackedConstraintFlag(uiCode ? true : false); 1600 1601 READ_FLAG(uiCode, "general_frame_only_constraint_flag"); 1602 ptl->setFrameOnlyConstraintFlag(uiCode ? true : false); 1603 1604 READ_CODE(16, uiCode, "XXX_reserved_zero_44bits[0..15]"); 1605 READ_CODE(16, uiCode, "XXX_reserved_zero_44bits[16..31]"); 1606 READ_CODE(12, uiCode, "XXX_reserved_zero_44bits[32..43]"); 1607 #elif L0363_MORE_BITS 1608 READ_CODE(16, uiCode, "XXX_reserved_zero_48bits[0..15]"); 1609 READ_CODE(16, uiCode, "XXX_reserved_zero_48bits[16..31]"); 1610 READ_CODE(16, uiCode, "XXX_reserved_zero_48bits[32..47]"); 1611 #else 1612 READ_CODE(16, uiCode, "XXX_reserved_zero_16bits[]"); assert( uiCode == 0 ); 1613 #endif 1614 } 1615 #if SIGNAL_BITRATE_PICRATE_IN_VPS 1616 Void TDecCavlc::parseBitratePicRateInfo(TComBitRatePicRateInfo *info, Int tempLevelLow, Int tempLevelHigh) 1617 { 1618 UInt uiCode; 1619 for(Int i = tempLevelLow; i <= tempLevelHigh; i++) 1620 { 1621 READ_FLAG( uiCode, "bit_rate_info_present_flag[i]" ); info->setBitRateInfoPresentFlag(i, uiCode ? true : false); 1622 READ_FLAG( uiCode, "pic_rate_info_present_flag[i]" ); info->setPicRateInfoPresentFlag(i, uiCode ? true : false); 1623 if(info->getBitRateInfoPresentFlag(i)) 1624 { 1625 READ_CODE( 16, uiCode, "avg_bit_rate[i]" ); info->setAvgBitRate(i, uiCode); 1626 READ_CODE( 16, uiCode, "max_bit_rate[i]" ); info->setMaxBitRate(i, uiCode); 1627 } 1628 if(info->getPicRateInfoPresentFlag(i)) 1629 { 1630 READ_CODE( 2, uiCode, "constant_pic_rate_idc[i]" ); info->setConstantPicRateIdc(i, uiCode); 1631 READ_CODE( 16, uiCode, "avg_pic_rate[i]" ); info->setAvgPicRate(i, uiCode); 1632 } 1633 } 1634 } 1635 #endif 1742 1636 Void TDecCavlc::parseTerminatingBit( UInt& ruiBit ) 1743 1637 { … … 1754 1648 } 1755 1649 1756 Void TDecCavlc::parseSkipFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth)1650 Void TDecCavlc::parseSkipFlag( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ ) 1757 1651 { 1758 1652 assert(0); 1759 1653 } 1760 1654 1761 Void TDecCavlc::parseCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth)1655 Void TDecCavlc::parseCUTransquantBypassFlag( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ ) 1762 1656 { 1763 1657 assert(0); 1764 1658 } 1765 1659 1766 #if INTRA_BL 1767 Void TDecCavlc::parseIntraBLFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 1660 Void TDecCavlc::parseMVPIdx( Int& /*riMVPIdx*/ ) 1768 1661 { 1769 1662 assert(0); 1770 1663 } 1771 #endif 1772 1773 Void TDecCavlc::parseMVPIdx( Int& riMVPIdx ) 1664 1665 Void TDecCavlc::parseSplitFlag ( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ ) 1774 1666 { 1775 1667 assert(0); 1776 1668 } 1777 1669 1778 Void TDecCavlc::parse SplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth)1670 Void TDecCavlc::parsePartSize( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ ) 1779 1671 { 1780 1672 assert(0); 1781 1673 } 1782 1674 1783 Void TDecCavlc::parsePartSize( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 1784 { 1785 assert(0); 1786 } 1787 1788 Void TDecCavlc::parsePredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 1675 Void TDecCavlc::parsePredMode( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ ) 1789 1676 { 1790 1677 assert(0); … … 1799 1686 * If I_PCM flag indicates that the CU is I_PCM, parse its PCM alignment bits and codes. 1800 1687 */ 1801 Void TDecCavlc::parseIPCMInfo( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth)1688 Void TDecCavlc::parseIPCMInfo( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ ) 1802 1689 { 1803 1690 assert(0); 1804 1691 } 1805 1692 1806 Void TDecCavlc::parseIntraDirLumaAng ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth)1693 Void TDecCavlc::parseIntraDirLumaAng ( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ ) 1807 1694 { 1808 1695 assert(0); 1809 1696 } 1810 1697 1811 Void TDecCavlc::parseIntraDirChroma( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth)1698 Void TDecCavlc::parseIntraDirChroma( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ ) 1812 1699 { 1813 1700 assert(0); 1814 1701 } 1815 1702 1816 Void TDecCavlc::parseInterDir( TComDataCU* pcCU, UInt& ruiInterDir, UInt uiAbsPartIdx, UInt uiDepth)1703 Void TDecCavlc::parseInterDir( TComDataCU* /*pcCU*/, UInt& /*ruiInterDir*/, UInt /*uiAbsPartIdx*/ ) 1817 1704 { 1818 1705 assert(0); 1819 1706 } 1820 1707 1821 Void TDecCavlc::parseRefFrmIdx( TComDataCU* pcCU, Int& riRefFrmIdx, UInt uiAbsPartIdx, UInt uiDepth, RefPicList eRefList)1708 Void TDecCavlc::parseRefFrmIdx( TComDataCU* /*pcCU*/, Int& /*riRefFrmIdx*/, RefPicList /*eRefList*/ ) 1822 1709 { 1823 1710 assert(0); 1824 1711 } 1825 1712 1826 Void TDecCavlc::parseMvd( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth, RefPicList eRefList)1713 Void TDecCavlc::parseMvd( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiPartIdx*/, UInt /*uiDepth*/, RefPicList /*eRefList*/ ) 1827 1714 { 1828 1715 assert(0); … … 1845 1732 } 1846 1733 1847 Void TDecCavlc::parseCoeffNxN( TComDataCU* pcCU, TCoeff* pcCoef, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt uiDepth, TextType eTType)1734 Void TDecCavlc::parseCoeffNxN( TComDataCU* /*pcCU*/, TCoeff* /*pcCoef*/, UInt /*uiAbsPartIdx*/, UInt /*uiWidth*/, UInt /*uiHeight*/, UInt /*uiDepth*/, TextType /*eTType*/ ) 1848 1735 { 1849 1736 assert(0); 1850 1737 } 1851 1738 1852 Void TDecCavlc::parseTransformSubdivFlag( UInt& ruiSubdivFlag, UInt uiLog2TransformBlockSize)1739 Void TDecCavlc::parseTransformSubdivFlag( UInt& /*ruiSubdivFlag*/, UInt /*uiLog2TransformBlockSize*/ ) 1853 1740 { 1854 1741 assert(0); 1855 1742 } 1856 1743 1857 Void TDecCavlc::parseQtCbf( TComDataCU* pcCU, UInt uiAbsPartIdx, TextType eType, UInt uiTrDepth, UInt uiDepth)1744 Void TDecCavlc::parseQtCbf( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, TextType /*eType*/, UInt /*uiTrDepth*/, UInt /*uiDepth*/ ) 1858 1745 { 1859 1746 assert(0); 1860 1747 } 1861 1748 1862 Void TDecCavlc::parseQtRootCbf( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt& uiQtRootCbf)1749 Void TDecCavlc::parseQtRootCbf( UInt /*uiAbsPartIdx*/, UInt& /*uiQtRootCbf*/ ) 1863 1750 { 1864 1751 assert(0); 1865 1752 } 1866 1753 1867 Void TDecCavlc::parseTransformSkipFlags (TComDataCU* pcCU, UInt uiAbsPartIdx, UInt width, UInt height, UInt uiDepth, TextType eTType)1754 Void TDecCavlc::parseTransformSkipFlags (TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*width*/, UInt /*height*/, UInt /*uiDepth*/, TextType /*eTType*/) 1868 1755 { 1869 1756 assert(0); 1870 1757 } 1871 1758 1872 Void TDecCavlc::parseMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx)1759 Void TDecCavlc::parseMergeFlag ( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/, UInt /*uiPUIdx*/ ) 1873 1760 { 1874 1761 assert(0); 1875 1762 } 1876 1763 1877 Void TDecCavlc::parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex, UInt uiAbsPartIdx, UInt uiDepth)1764 Void TDecCavlc::parseMergeIndex ( TComDataCU* /*pcCU*/, UInt& /*ruiMergeIndex*/ ) 1878 1765 { 1879 1766 assert(0); … … 1900 1787 { 1901 1788 xReadFlag( uiSymbol ); 1902 1903 if(uiSymbol) 1904 { 1905 printf("\nWarning! pcm_align_zero include a non-zero value.\n"); 1906 } 1789 assert( uiSymbol == 0 ); 1907 1790 } 1908 1791 } … … 2004 1887 wpScalingParam *wp; 2005 1888 Bool bChroma = true; // color always present in HEVC ? 2006 TComPPS* pps = pcSlice->getPPS();2007 1889 SliceType eSliceType = pcSlice->getSliceType(); 2008 1890 Int iNbRef = (eSliceType == B_SLICE ) ? (2) : (1); 2009 1891 UInt uiLog2WeightDenomLuma, uiLog2WeightDenomChroma; 2010 UInt uiMode = 0;2011 #if NUM_WP_LIMIT2012 1892 UInt uiTotalSignalledWeightFlags = 0; 2013 #endif 2014 if ( (eSliceType==P_SLICE && pps->getUseWP()) || (eSliceType==B_SLICE && pps->getWPBiPred()) ) 2015 { 2016 uiMode = 1; // explicit 2017 } 2018 if ( uiMode == 1 ) // explicit 2019 { 2020 printf("\nTDecCavlc::xParsePredWeightTable(poc=%d) explicit...\n", pcSlice->getPOC()); 2021 Int iDeltaDenom; 2022 // decode delta_luma_log2_weight_denom : 2023 READ_UVLC( uiLog2WeightDenomLuma, "luma_log2_weight_denom" ); // ue(v): luma_log2_weight_denom 2024 if( bChroma ) 2025 { 2026 READ_SVLC( iDeltaDenom, "delta_chroma_log2_weight_denom" ); // se(v): delta_chroma_log2_weight_denom 2027 assert((iDeltaDenom + (Int)uiLog2WeightDenomLuma)>=0); 2028 uiLog2WeightDenomChroma = (UInt)(iDeltaDenom + uiLog2WeightDenomLuma); 2029 } 2030 2031 for ( Int iNumRef=0 ; iNumRef<iNbRef ; iNumRef++ ) 2032 { 2033 RefPicList eRefPicList = ( iNumRef ? REF_PIC_LIST_1 : REF_PIC_LIST_0 ); 1893 1894 Int iDeltaDenom; 1895 // decode delta_luma_log2_weight_denom : 1896 READ_UVLC( uiLog2WeightDenomLuma, "luma_log2_weight_denom" ); // ue(v): luma_log2_weight_denom 1897 if( bChroma ) 1898 { 1899 READ_SVLC( iDeltaDenom, "delta_chroma_log2_weight_denom" ); // se(v): delta_chroma_log2_weight_denom 1900 assert((iDeltaDenom + (Int)uiLog2WeightDenomLuma)>=0); 1901 uiLog2WeightDenomChroma = (UInt)(iDeltaDenom + uiLog2WeightDenomLuma); 1902 } 1903 1904 for ( Int iNumRef=0 ; iNumRef<iNbRef ; iNumRef++ ) 1905 { 1906 RefPicList eRefPicList = ( iNumRef ? REF_PIC_LIST_1 : REF_PIC_LIST_0 ); 1907 for ( Int iRefIdx=0 ; iRefIdx<pcSlice->getNumRefIdx(eRefPicList) ; iRefIdx++ ) 1908 { 1909 pcSlice->getWpScaling(eRefPicList, iRefIdx, wp); 1910 1911 wp[0].uiLog2WeightDenom = uiLog2WeightDenomLuma; 1912 wp[1].uiLog2WeightDenom = uiLog2WeightDenomChroma; 1913 wp[2].uiLog2WeightDenom = uiLog2WeightDenomChroma; 1914 1915 UInt uiCode; 1916 READ_FLAG( uiCode, "luma_weight_lX_flag" ); // u(1): luma_weight_l0_flag 1917 wp[0].bPresentFlag = ( uiCode == 1 ); 1918 uiTotalSignalledWeightFlags += wp[0].bPresentFlag; 1919 } 1920 if ( bChroma ) 1921 { 1922 UInt uiCode; 2034 1923 for ( Int iRefIdx=0 ; iRefIdx<pcSlice->getNumRefIdx(eRefPicList) ; iRefIdx++ ) 2035 1924 { 2036 1925 pcSlice->getWpScaling(eRefPicList, iRefIdx, wp); 2037 2038 wp[0].uiLog2WeightDenom = uiLog2WeightDenomLuma; 2039 wp[1].uiLog2WeightDenom = uiLog2WeightDenomChroma; 2040 wp[2].uiLog2WeightDenom = uiLog2WeightDenomChroma; 2041 2042 UInt uiCode; 2043 READ_FLAG( uiCode, "luma_weight_lX_flag" ); // u(1): luma_weight_l0_flag 2044 wp[0].bPresentFlag = ( uiCode == 1 ); 2045 #if NUM_WP_LIMIT 2046 uiTotalSignalledWeightFlags += wp[0].bPresentFlag; 1926 READ_FLAG( uiCode, "chroma_weight_lX_flag" ); // u(1): chroma_weight_l0_flag 1927 wp[1].bPresentFlag = ( uiCode == 1 ); 1928 wp[2].bPresentFlag = ( uiCode == 1 ); 1929 uiTotalSignalledWeightFlags += 2*wp[1].bPresentFlag; 1930 } 1931 } 1932 for ( Int iRefIdx=0 ; iRefIdx<pcSlice->getNumRefIdx(eRefPicList) ; iRefIdx++ ) 1933 { 1934 pcSlice->getWpScaling(eRefPicList, iRefIdx, wp); 1935 if ( wp[0].bPresentFlag ) 1936 { 1937 Int iDeltaWeight; 1938 READ_SVLC( iDeltaWeight, "delta_luma_weight_lX" ); // se(v): delta_luma_weight_l0[i] 1939 wp[0].iWeight = (iDeltaWeight + (1<<wp[0].uiLog2WeightDenom)); 1940 READ_SVLC( wp[0].iOffset, "luma_offset_lX" ); // se(v): luma_offset_l0[i] 1941 } 1942 else 1943 { 1944 wp[0].iWeight = (1 << wp[0].uiLog2WeightDenom); 1945 wp[0].iOffset = 0; 2047 1946 } 2048 1947 if ( bChroma ) 2049 1948 { 2050 UInt uiCode; 2051 for ( Int iRefIdx=0 ; iRefIdx<pcSlice->getNumRefIdx(eRefPicList) ; iRefIdx++ ) 2052 { 2053 pcSlice->getWpScaling(eRefPicList, iRefIdx, wp); 2054 READ_FLAG( uiCode, "chroma_weight_lX_flag" ); // u(1): chroma_weight_l0_flag 2055 wp[1].bPresentFlag = ( uiCode == 1 ); 2056 wp[2].bPresentFlag = ( uiCode == 1 ); 2057 uiTotalSignalledWeightFlags += 2*wp[1].bPresentFlag; 2058 } 2059 } 2060 for ( Int iRefIdx=0 ; iRefIdx<pcSlice->getNumRefIdx(eRefPicList) ; iRefIdx++ ) 2061 { 2062 pcSlice->getWpScaling(eRefPicList, iRefIdx, wp); 2063 #endif 2064 if ( wp[0].bPresentFlag ) 2065 { 2066 Int iDeltaWeight; 2067 READ_SVLC( iDeltaWeight, "delta_luma_weight_lX" ); // se(v): delta_luma_weight_l0[i] 2068 wp[0].iWeight = (iDeltaWeight + (1<<wp[0].uiLog2WeightDenom)); 2069 READ_SVLC( wp[0].iOffset, "luma_offset_lX" ); // se(v): luma_offset_l0[i] 1949 if ( wp[1].bPresentFlag ) 1950 { 1951 for ( Int j=1 ; j<3 ; j++ ) 1952 { 1953 Int iDeltaWeight; 1954 READ_SVLC( iDeltaWeight, "delta_chroma_weight_lX" ); // se(v): chroma_weight_l0[i][j] 1955 wp[j].iWeight = (iDeltaWeight + (1<<wp[1].uiLog2WeightDenom)); 1956 1957 Int iDeltaChroma; 1958 READ_SVLC( iDeltaChroma, "delta_chroma_offset_lX" ); // se(v): delta_chroma_offset_l0[i][j] 1959 Int pred = ( 128 - ( ( 128*wp[j].iWeight)>>(wp[j].uiLog2WeightDenom) ) ); 1960 wp[j].iOffset = Clip3(-128, 127, (iDeltaChroma + pred) ); 1961 } 2070 1962 } 2071 1963 else 2072 1964 { 2073 wp[0].iWeight = (1 << wp[0].uiLog2WeightDenom); 2074 wp[0].iOffset = 0; 2075 } 2076 if ( bChroma ) 2077 { 2078 #if !NUM_WP_LIMIT 2079 READ_FLAG( uiCode, "chroma_weight_lX_flag" ); // u(1): chroma_weight_l0_flag 2080 wp[1].bPresentFlag = ( uiCode == 1 ); 2081 wp[2].bPresentFlag = ( uiCode == 1 ); 2082 #endif 2083 if ( wp[1].bPresentFlag ) 1965 for ( Int j=1 ; j<3 ; j++ ) 2084 1966 { 2085 for ( Int j=1 ; j<3 ; j++ ) 2086 { 2087 Int iDeltaWeight; 2088 READ_SVLC( iDeltaWeight, "delta_chroma_weight_lX" ); // se(v): chroma_weight_l0[i][j] 2089 wp[j].iWeight = (iDeltaWeight + (1<<wp[1].uiLog2WeightDenom)); 2090 2091 Int iDeltaChroma; 2092 READ_SVLC( iDeltaChroma, "delta_chroma_offset_lX" ); // se(v): delta_chroma_offset_l0[i][j] 2093 Int shift = ((1<<(g_uiBitDepth+g_uiBitIncrement-1))); 2094 Int pred = ( shift - ( ( shift*wp[j].iWeight)>>(wp[j].uiLog2WeightDenom) ) ); 2095 #if WP_PARAM_RANGE_LIMIT 2096 wp[j].iOffset = Clip3(-128, 127, (iDeltaChroma + pred) ); 2097 #else 2098 wp[j].iOffset = iDeltaChroma + pred; 2099 #endif 2100 } 1967 wp[j].iWeight = (1 << wp[j].uiLog2WeightDenom); 1968 wp[j].iOffset = 0; 2101 1969 } 2102 else 2103 { 2104 for ( Int j=1 ; j<3 ; j++ ) 2105 { 2106 wp[j].iWeight = (1 << wp[j].uiLog2WeightDenom); 2107 wp[j].iOffset = 0; 2108 } 2109 } 2110 } 2111 } 2112 2113 for ( Int iRefIdx=pcSlice->getNumRefIdx(eRefPicList) ; iRefIdx<MAX_NUM_REF ; iRefIdx++ ) 2114 { 2115 pcSlice->getWpScaling(eRefPicList, iRefIdx, wp); 2116 2117 wp[0].bPresentFlag = false; 2118 wp[1].bPresentFlag = false; 2119 wp[2].bPresentFlag = false; 2120 } 2121 } 2122 #if NUM_WP_LIMIT 2123 assert(uiTotalSignalledWeightFlags<=24); 2124 #endif 2125 } 2126 else 2127 { 2128 printf("\n wrong weight pred table syntax \n "); 2129 assert(0); 2130 } 1970 } 1971 } 1972 } 1973 1974 for ( Int iRefIdx=pcSlice->getNumRefIdx(eRefPicList) ; iRefIdx<MAX_NUM_REF ; iRefIdx++ ) 1975 { 1976 pcSlice->getWpScaling(eRefPicList, iRefIdx, wp); 1977 1978 wp[0].bPresentFlag = false; 1979 wp[1].bPresentFlag = false; 1980 wp[2].bPresentFlag = false; 1981 } 1982 } 1983 assert(uiTotalSignalledWeightFlags<=24); 2131 1984 } 2132 1985 … … 2176 2029 Int scalingListDcCoefMinus8 = 0; 2177 2030 Int nextCoef = SCALING_LIST_START_VALUE; 2178 #if REMOVE_ZIGZAG_SCAN2179 2031 UInt* scan = (sizeId == 0) ? g_auiSigLastScan [ SCAN_DIAG ] [ 1 ] : g_sigLastScanCG32x32; 2180 #else2181 UInt* scan = g_auiFrameScanXY [ (sizeId == 0)? 1 : 2 ];2182 #endif2183 2032 Int *dst = scalingList->getScalingListAddress(sizeId, listId); 2184 2033 … … 2227 2076 } 2228 2077 2078 #if INTRA_BL 2079 Void TDecCavlc::parseIntraBLFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 2080 { 2081 assert(0); 2082 } 2083 #endif 2084 2229 2085 //! \} 2230 2086 -
trunk/source/Lib/TLibDecoder/TDecCAVLC.h
r2 r125 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 53 53 // ==================================================================================================================== 54 54 55 class SEImessages;56 57 55 /// CAVLC decoder class 58 56 class TDecCavlc : public SyntaxElementParser, public TDecEntropyIf … … 73 71 void parseShortTermRefPicSet (TComSPS* pcSPS, TComReferencePictureSet* pcRPS, Int idx); 74 72 private: 75 #if !REMOVE_FGS76 Int m_iSliceGranularity; //!< slice granularity77 #endif78 73 79 74 public: 80 75 81 76 /// rest entropy coder by intial QP and IDC in CABAC 82 Void resetEntropy ( TComSlice* pcSlice) { assert(0); };77 Void resetEntropy ( TComSlice* /*pcSlice*/ ) { assert(0); }; 83 78 Void setBitstream ( TComInputBitstream* p ) { m_pcBitstream = p; } 84 #if !REMOVE_FGS85 /// set slice granularity86 Void setSliceGranularity(Int iSliceGranularity) {m_iSliceGranularity = iSliceGranularity;}87 88 /// get slice granularity89 Int getSliceGranularity() {return m_iSliceGranularity; }90 #endif91 79 Void parseTransformSubdivFlag( UInt& ruiSubdivFlag, UInt uiLog2TransformBlockSize ); 92 80 Void parseQtCbf ( TComDataCU* pcCU, UInt uiAbsPartIdx, TextType eType, UInt uiTrDepth, UInt uiDepth ); 93 Void parseQtRootCbf ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt& uiQtRootCbf );81 Void parseQtRootCbf ( UInt uiAbsPartIdx, UInt& uiQtRootCbf ); 94 82 Void parseVPS ( TComVPS* pcVPS ); 83 #if VPS_EXTNS 84 Void parseVPSExtension ( TComVPS* pcVPS ); 85 #endif 95 86 Void parseSPS ( TComSPS* pcSPS ); 96 87 Void parsePPS ( TComPPS* pcPPS); 97 #if SUPPORT_FOR_VUI98 #if !BUFFERING_PERIOD_AND_TIMING_SEI99 Void parseVUI ( TComVUI* pcVUI );100 #else101 88 Void parseVUI ( TComVUI* pcVUI, TComSPS* pcSPS ); 102 #endif 103 #endif 104 Void parseSEI(SEImessages&); 105 #if !REMOVE_APS 106 Void parseAPS ( TComAPS* pAPS ); 107 #endif 108 #if PROFILE_TIER_LEVEL_SYNTAX 89 Void parseSEI ( SEIMessages& ); 109 90 Void parsePTL ( TComPTL *rpcPTL, Bool profilePresentFlag, Int maxNumSubLayersMinus1 ); 110 91 Void parseProfileTier (ProfileTierLevel *ptl); 92 #if SIGNAL_BITRATE_PICRATE_IN_VPS 93 Void parseBitratePicRateInfo(TComBitRatePicRateInfo *info, Int tempLevelLow, Int tempLevelHigh); 111 94 #endif 95 Void parseHrdParameters (TComHRD *hrd, Bool cprms_present_flag, UInt tempLevelHigh); 112 96 Void parseSliceHeader ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager); 113 97 Void parseTerminatingBit ( UInt& ruiBit ); … … 118 102 Void parseCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 119 103 Void parseMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ); 120 Void parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex , UInt uiAbsPartIdx, UInt uiDepth);104 Void parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex ); 121 105 Void parseSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 122 106 Void parsePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); … … 127 111 Void parseIntraDirChroma ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 128 112 129 Void parseInterDir ( TComDataCU* pcCU, UInt& ruiInterDir, UInt uiAbsPartIdx , UInt uiDepth);130 Void parseRefFrmIdx ( TComDataCU* pcCU, Int& riRefFrmIdx, UInt uiAbsPartIdx, UInt uiDepth,RefPicList eRefList );113 Void parseInterDir ( TComDataCU* pcCU, UInt& ruiInterDir, UInt uiAbsPartIdx ); 114 Void parseRefFrmIdx ( TComDataCU* pcCU, Int& riRefFrmIdx, RefPicList eRefList ); 131 115 Void parseMvd ( TComDataCU* pcCU, UInt uiAbsPartAddr,UInt uiPartIdx, UInt uiDepth, RefPicList eRefList ); 132 116 … … 137 121 Void parseIPCMInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth); 138 122 123 Void updateContextTables ( SliceType /*eSliceType*/, Int /*iQp*/ ) { return; } 124 139 125 #if INTRA_BL 140 126 Void parseIntraBLFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 141 127 #endif 142 Void updateContextTables ( SliceType eSliceType, Int iQp ) { return; }143 Void decodeFlush() {};144 128 145 129 Void xParsePredWeightTable ( TComSlice* pcSlice ); … … 147 131 Void xDecodeScalingList ( TComScalingList *scalingList, UInt sizeId, UInt listId); 148 132 protected: 149 #if !REMOVE_ALF150 Void xParseAlfParam ( ALFParam* pAlfParam );151 Int xGolombDecode ( Int k );152 #endif153 133 Bool xMoreRbspData(); 154 134 }; -
trunk/source/Lib/TLibDecoder/TDecCu.cpp
r55 r125 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 62 62 #if SVC_EXTENSION 63 63 Void TDecCu::init(TDecTop** ppcDecTop, TDecEntropy* pcEntropyDecoder, TComTrQuant* pcTrQuant, TComPrediction* pcPrediction, UInt layerId) 64 { 65 m_pcEntropyDecoder = pcEntropyDecoder; 66 m_pcTrQuant = pcTrQuant; 67 m_pcPrediction = pcPrediction; 68 m_ppcTDecTop = ppcDecTop; 69 m_layerId = layerId; 70 71 for ( UInt ui = 0; ui < m_uiMaxDepth-1; ui++ ) 72 { 73 m_ppcCU [ui]->setLayerId(layerId); 74 } 75 } 64 76 #else 65 77 Void TDecCu::init( TDecEntropy* pcEntropyDecoder, TComTrQuant* pcTrQuant, TComPrediction* pcPrediction) 66 #endif67 78 { 68 79 m_pcEntropyDecoder = pcEntropyDecoder; 69 80 m_pcTrQuant = pcTrQuant; 70 81 m_pcPrediction = pcPrediction; 71 #if SVC_EXTENSION 72 m_ppcTDecTop = ppcDecTop; 73 m_layerId = layerId; 74 75 for ( UInt ui = 0; ui < m_uiMaxDepth-1; ui++ ) 76 { 77 m_ppcCU [ui]->setLayerId(layerId); 78 } 79 #endif 80 } 82 } 83 #endif 81 84 82 85 /** … … 114 117 // initialize conversion matrix from partition index to pel 115 118 initRasterToPelXY( uiMaxWidth, uiMaxHeight, m_uiMaxDepth ); 116 initMotionReferIdx ( uiMaxWidth, uiMaxHeight, m_uiMaxDepth );117 119 } 118 120 … … 145 147 } 146 148 147 pcCU->setNumSucIPCM(0);148 149 149 // start from the top level CU 150 150 #if SVC_EXTENSION … … 158 158 Void TDecCu::decompressCU( TComDataCU* pcCU ) 159 159 { 160 xDecompressCU( pcCU, pcCU,0, 0 );160 xDecompressCU( pcCU, 0, 0 ); 161 161 } 162 162 … … 179 179 UInt uiWidth = pcSlice->getSPS()->getPicWidthInLumaSamples(); 180 180 UInt uiHeight = pcSlice->getSPS()->getPicHeightInLumaSamples(); 181 #if REMOVE_FGS182 181 UInt uiGranularityWidth = g_uiMaxCUWidth; 183 #else184 UInt uiGranularityWidth = g_uiMaxCUWidth>>(pcSlice->getPPS()->getSliceGranularity());185 #endif186 182 UInt uiPosX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ]; 187 183 UInt uiPosY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ]; … … 199 195 if(uiIsLast) 200 196 { 201 if(pcSlice->isNext DependentSlice()&&!pcSlice->isNextSlice())202 { 203 pcSlice->set DependentSliceCurEndCUAddr(pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts);197 if(pcSlice->isNextSliceSegment()&&!pcSlice->isNextSlice()) 198 { 199 pcSlice->setSliceSegmentCurEndCUAddr(pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts); 204 200 } 205 201 else 206 202 { 207 203 pcSlice->setSliceCurEndCUAddr(pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts); 208 pcSlice->set DependentSliceCurEndCUAddr(pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts);204 pcSlice->setSliceSegmentCurEndCUAddr(pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts); 209 205 } 210 206 } … … 233 229 234 230 TComSlice * pcSlice = pcCU->getPic()->getSlice(pcCU->getPic()->getCurrSliceIdx()); 235 Bool bStartInCU = pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts>pcSlice->get DependentSliceCurStartCUAddr()&&pcCU->getSCUAddr()+uiAbsPartIdx<pcSlice->getDependentSliceCurStartCUAddr();231 Bool bStartInCU = pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts>pcSlice->getSliceSegmentCurStartCUAddr()&&pcCU->getSCUAddr()+uiAbsPartIdx<pcSlice->getSliceSegmentCurStartCUAddr(); 236 232 if((!bStartInCU) && ( uiRPelX < pcSlice->getSPS()->getPicWidthInLumaSamples() ) && ( uiBPelY < pcSlice->getSPS()->getPicHeightInLumaSamples() ) ) 237 233 { 238 if(pcCU->getNumSucIPCM() == 0) 239 { 240 m_pcEntropyDecoder->decodeSplitFlag( pcCU, uiAbsPartIdx, uiDepth ); 241 } 242 else 243 { 244 pcCU->setDepthSubParts( uiDepth, uiAbsPartIdx ); 245 } 234 m_pcEntropyDecoder->decodeSplitFlag( pcCU, uiAbsPartIdx, uiDepth ); 246 235 } 247 236 else … … 264 253 uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiIdx] ]; 265 254 266 Bool bSubInSlice = pcCU->getSCUAddr()+uiIdx+uiQNumParts>pcSlice->get DependentSliceCurStartCUAddr();255 Bool bSubInSlice = pcCU->getSCUAddr()+uiIdx+uiQNumParts>pcSlice->getSliceSegmentCurStartCUAddr(); 267 256 if ( bSubInSlice ) 268 257 { 269 if ( ( uiLPelX < pcCU->getSlice()->getSPS()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples() ) )258 if ( !ruiIsLast && ( uiLPelX < pcCU->getSlice()->getSPS()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples() ) ) 270 259 { 271 260 xDecodeCU( pcCU, uiIdx, uiDepth+1, ruiIsLast ); … … 276 265 } 277 266 } 278 if(ruiIsLast)279 {280 break;281 }282 267 283 268 uiIdx += uiQNumParts; … … 288 273 { 289 274 UInt uiQPSrcPartIdx; 290 if ( pcPic->getCU( pcCU->getAddr() )->get DependentSliceStartCU(uiAbsPartIdx) != pcSlice->getDependentSliceCurStartCUAddr() )275 if ( pcPic->getCU( pcCU->getAddr() )->getSliceSegmentStartCU(uiAbsPartIdx) != pcSlice->getSliceSegmentCurStartCUAddr() ) 291 276 { 292 uiQPSrcPartIdx = pcSlice->get DependentSliceCurStartCUAddr() % pcPic->getNumPartInCU();277 uiQPSrcPartIdx = pcSlice->getSliceSegmentCurStartCUAddr() % pcPic->getNumPartInCU(); 293 278 } 294 279 else … … 308 293 } 309 294 310 if (pcCU->getSlice()->getPPS()->getTransquantBypassEnableFlag() && pcCU->getNumSucIPCM() == 0)295 if (pcCU->getSlice()->getPPS()->getTransquantBypassEnableFlag()) 311 296 { 312 297 m_pcEntropyDecoder->decodeCUTransquantBypassFlag( pcCU, uiAbsPartIdx, uiDepth ); … … 314 299 315 300 // decode CU mode and the partition size 316 if( !pcCU->getSlice()->isIntra() && pcCU->getNumSucIPCM() == 0)301 if( !pcCU->getSlice()->isIntra()) 317 302 { 318 303 m_pcEntropyDecoder->decodeSkipFlag( pcCU, uiAbsPartIdx, uiDepth ); … … 330 315 uhInterDirNeighbours[ui] = 0; 331 316 } 332 m_pcEntropyDecoder->decodeMergeIndex( pcCU, 0, uiAbsPartIdx, SIZE_2Nx2N, uhInterDirNeighbours, cMvFieldNeighbours,uiDepth );317 m_pcEntropyDecoder->decodeMergeIndex( pcCU, 0, uiAbsPartIdx, uiDepth ); 333 318 UInt uiMergeIndex = pcCU->getMergeIndex(uiAbsPartIdx); 334 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, uiDepth,cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );319 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 335 320 pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiAbsPartIdx, 0, uiDepth ); 336 321 … … 359 344 #endif 360 345 361 if( pcCU->getNumSucIPCM() == 0 ) 362 { 363 m_pcEntropyDecoder->decodePredMode( pcCU, uiAbsPartIdx, uiDepth ); 364 m_pcEntropyDecoder->decodePartSize( pcCU, uiAbsPartIdx, uiDepth ); 365 } 366 else 367 { 368 pcCU->setPredModeSubParts( MODE_INTRA, uiAbsPartIdx, uiDepth ); 369 pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 370 pcCU->setSizeSubParts( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth ); 371 pcCU->setTrIdxSubParts( 0, uiAbsPartIdx, uiDepth ); 372 } 346 m_pcEntropyDecoder->decodePredMode( pcCU, uiAbsPartIdx, uiDepth ); 347 m_pcEntropyDecoder->decodePartSize( pcCU, uiAbsPartIdx, uiDepth ); 373 348 374 349 if (pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) … … 381 356 return; 382 357 } 383 } 358 } 384 359 #if INTRA_BL 385 360 // prediction mode ( Intra : direction mode, Inter : Mv, reference idx ) … … 409 384 pcCU->setQPSubParts( getdQPFlag()?pcCU->getRefQP(uiAbsPartIdx):pcCU->getCodedQP(), uiAbsPartIdx, uiDepth ); // set QP 410 385 } 411 if( pcCU->getNumSucIPCM() > 0 )412 {413 ruiIsLast = 0;414 return;415 }416 386 417 387 ruiIsLast = xDecodeSliceEnd( pcCU, uiAbsPartIdx, uiDepth); 418 388 } 419 389 420 Void TDecCu::xDecompressCU( TComDataCU* pcCU, TComDataCU* pcCUCur,UInt uiAbsPartIdx, UInt uiDepth )390 Void TDecCu::xDecompressCU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 421 391 { 422 392 TComPic* pcPic = pcCU->getPic(); … … 430 400 UInt uiCurNumParts = pcPic->getNumPartInCU() >> (uiDepth<<1); 431 401 TComSlice * pcSlice = pcCU->getPic()->getSlice(pcCU->getPic()->getCurrSliceIdx()); 432 Bool bStartInCU = pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts>pcSlice->get DependentSliceCurStartCUAddr()&&pcCU->getSCUAddr()+uiAbsPartIdx<pcSlice->getDependentSliceCurStartCUAddr();402 Bool bStartInCU = pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts>pcSlice->getSliceSegmentCurStartCUAddr()&&pcCU->getSCUAddr()+uiAbsPartIdx<pcSlice->getSliceSegmentCurStartCUAddr(); 433 403 if(bStartInCU||( uiRPelX >= pcSlice->getSPS()->getPicWidthInLumaSamples() ) || ( uiBPelY >= pcSlice->getSPS()->getPicHeightInLumaSamples() ) ) 434 404 { … … 446 416 uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiIdx] ]; 447 417 448 Bool binSlice = (pcCU->getSCUAddr()+uiIdx+uiQNumParts>pcSlice->get DependentSliceCurStartCUAddr())&&(pcCU->getSCUAddr()+uiIdx<pcSlice->getDependentSliceCurEndCUAddr());418 Bool binSlice = (pcCU->getSCUAddr()+uiIdx+uiQNumParts>pcSlice->getSliceSegmentCurStartCUAddr())&&(pcCU->getSCUAddr()+uiIdx<pcSlice->getSliceSegmentCurEndCUAddr()); 449 419 if(binSlice&&( uiLPelX < pcSlice->getSPS()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcSlice->getSPS()->getPicHeightInLumaSamples() ) ) 450 420 { 451 xDecompressCU(pcCU, m_ppcCU[uiNextDepth],uiIdx, uiNextDepth );421 xDecompressCU(pcCU, uiIdx, uiNextDepth ); 452 422 } 453 423 … … 465 435 { 466 436 case MODE_INTER: 467 xReconInter( m_ppcCU[uiDepth], ui AbsPartIdx, uiDepth );437 xReconInter( m_ppcCU[uiDepth], uiDepth ); 468 438 break; 469 439 case MODE_INTRA: 470 xReconIntraQT( m_ppcCU[uiDepth], ui AbsPartIdx, uiDepth );440 xReconIntraQT( m_ppcCU[uiDepth], uiDepth ); 471 441 break; 472 442 #if INTRA_BL … … 485 455 if ( m_ppcCU[uiDepth]->isLosslessCoded(0) && (m_ppcCU[uiDepth]->getIPCMFlag(0) == false)) 486 456 { 487 xFillPCMBuffer(m_ppcCU[uiDepth], ui AbsPartIdx, uiDepth);457 xFillPCMBuffer(m_ppcCU[uiDepth], uiDepth); 488 458 } 489 459 … … 491 461 } 492 462 493 Void TDecCu::xReconInter( TComDataCU* pcCU, UInt ui AbsPartIdx, UInt uiDepth )463 Void TDecCu::xReconInter( TComDataCU* pcCU, UInt uiDepth ) 494 464 { 495 465 … … 553 523 else 554 524 #endif 555 m_pcPrediction->predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, pcCU,bAboveAvail, bLeftAvail );525 m_pcPrediction->predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail ); 556 526 557 527 //===== inverse transform ===== … … 572 542 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 573 543 { 574 pReco [ uiX ] = Clip ( pPred[ uiX ] + pResi[ uiX ] );544 pReco [ uiX ] = ClipY( pPred[ uiX ] + pResi[ uiX ] ); 575 545 pRecIPred[ uiX ] = pReco[ uiX ]; 576 546 } … … 629 599 pcCU->getPattern()->initPattern ( pcCU, uiTrDepth, uiAbsPartIdx ); 630 600 631 #if !REMOVE_LMCHROMA632 if( uiChromaPredMode == LM_CHROMA_IDX && uiChromaId == 0 )633 {634 pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, uiTrDepth,635 m_pcPrediction->getPredicBuf (),636 m_pcPrediction->getPredicBufWidth (),637 m_pcPrediction->getPredicBufHeight (),638 bAboveAvail, bLeftAvail,639 true );640 641 m_pcPrediction->getLumaRecPixels( pcCU->getPattern(), uiWidth, uiHeight );642 }643 #endif644 645 601 pcCU->getPattern()->initAdiPatternChroma( pcCU, uiAbsPartIdx, uiTrDepth, 646 602 m_pcPrediction->getPredicBuf (), … … 658 614 else 659 615 #endif 660 #if !REMOVE_LMCHROMA661 if( uiChromaPredMode == LM_CHROMA_IDX )662 {663 m_pcPrediction->predLMIntraChroma( pcCU->getPattern(), pPatChroma, piPred, uiStride, uiWidth, uiHeight, uiChromaId );664 }665 else666 #endif667 616 { 668 617 if( uiChromaPredMode == DM_CHROMA_IDX ) … … 670 619 uiChromaPredMode = pcCU->getLumaIntraDir( 0 ); 671 620 } 672 m_pcPrediction->predIntraChromaAng( p cCU->getPattern(), pPatChroma, uiChromaPredMode, piPred, uiStride, uiWidth, uiHeight, pcCU, bAboveAvail, bLeftAvail );621 m_pcPrediction->predIntraChromaAng( pPatChroma, uiChromaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail ); 673 622 } 674 623 675 624 //===== inverse transform ===== 676 #if CHROMA_QP_EXTENSION677 625 Int curChromaQpOffset; 678 626 if(eText == TEXT_CHROMA_U) … … 685 633 } 686 634 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), eText, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset ); 687 #else688 if(eText == TEXT_CHROMA_U)689 {690 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), eText, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), pcCU->getSlice()->getPPS()->getChromaCbQpOffset() );691 }692 else693 {694 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), eText, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), pcCU->getSlice()->getPPS()->getChromaCrQpOffset() );695 }696 #endif697 635 698 636 Int scalingListType = (pcCU->isIntra(uiAbsPartIdx) ? 0 : 3) + g_eTTable[(Int)eText]; … … 709 647 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 710 648 { 711 pReco [ uiX ] = Clip ( pPred[ uiX ] + pResi[ uiX ] );649 pReco [ uiX ] = ClipC( pPred[ uiX ] + pResi[ uiX ] ); 712 650 pRecIPred[ uiX ] = pReco[ uiX ]; 713 651 } … … 721 659 722 660 Void 723 TDecCu::xReconIntraQT( TComDataCU* pcCU, UInt ui AbsPartIdx, UInt uiDepth )661 TDecCu::xReconIntraQT( TComDataCU* pcCU, UInt uiDepth ) 724 662 { 725 663 UInt uiInitTrDepth = ( pcCU->getPartitionSize(0) == SIZE_2Nx2N ? 0 : 1 ); … … 729 667 if (pcCU->getIPCMFlag(0)) 730 668 { 731 xReconPCM( pcCU, ui AbsPartIdx, uiDepth );669 xReconPCM( pcCU, uiDepth ); 732 670 return; 733 671 } … … 744 682 745 683 } 746 747 #if NO_RESIDUAL_FLAG_FOR_BLPRED748 Void749 TDecCu::xReconIntraBL( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )750 {751 m_ppcYuvReco[uiDepth]->copyFromPicLuma ( pcCU->getSlice()->getFullPelBaseRec(), pcCU->getAddr(), pcCU->getZorderIdxInCU(), 0, pcCU->getWidth(0), pcCU->getHeight(0));752 m_ppcYuvReco[uiDepth]->copyFromPicChroma( pcCU->getSlice()->getFullPelBaseRec(), pcCU->getAddr(), pcCU->getZorderIdxInCU(), 0, (pcCU->getWidth(0)>>1), (pcCU->getHeight(0)>>1), 0);753 m_ppcYuvReco[uiDepth]->copyFromPicChroma( pcCU->getSlice()->getFullPelBaseRec(), pcCU->getAddr(), pcCU->getZorderIdxInCU(), 0, (pcCU->getWidth(0)>>1), (pcCU->getHeight(0)>>1), 1);754 755 // inter recon756 xDecodeInterTexture( pcCU, 0, uiDepth );757 758 // clip for only non-zero cbp case759 if ( ( pcCU->getCbf( 0, TEXT_LUMA ) ) || ( pcCU->getCbf( 0, TEXT_CHROMA_U ) ) || ( pcCU->getCbf(0, TEXT_CHROMA_V ) ) )760 {761 m_ppcYuvReco[uiDepth]->addClip( m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth], 0, pcCU->getWidth( 0 ) );762 }763 else764 {765 m_ppcYuvReco[uiDepth]->copyPartToPartYuv( m_ppcYuvReco[uiDepth],0, pcCU->getWidth( 0 ),pcCU->getHeight( 0 ));766 }767 }768 #endif769 684 770 685 /** Function for deriving recontructed PU/CU Luma sample with QTree structure … … 853 768 854 769 Pel* pResi; 855 UInt uiLumaTrMode, uiChromaTrMode; 856 857 pcCU->convertTransIdx( uiAbsPartIdx, pcCU->getTransformIdx( uiAbsPartIdx ), uiLumaTrMode, uiChromaTrMode ); 770 UInt trMode = pcCU->getTransformIdx( uiAbsPartIdx ); 858 771 859 772 // Y … … 863 776 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), TEXT_LUMA, pcCU->getSlice()->getSPS()->getQpBDOffsetY(), 0 ); 864 777 865 m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_LUMA, pResi, 0, m_ppcYuvResi[uiDepth]->getStride(), uiWidth, uiHeight, uiLumaTrMode, 0, piCoeff );778 m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_LUMA, pResi, 0, m_ppcYuvResi[uiDepth]->getStride(), uiWidth, uiHeight, trMode, 0, piCoeff ); 866 779 867 780 // Cb and Cr 868 #if CHROMA_QP_EXTENSION869 781 Int curChromaQpOffset = pcCU->getSlice()->getPPS()->getChromaCbQpOffset() + pcCU->getSlice()->getSliceQpDeltaCb(); 870 782 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), TEXT_CHROMA, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset ); 871 #else872 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), TEXT_CHROMA, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), pcCU->getSlice()->getPPS()->getChromaCbQpOffset() );873 #endif874 783 875 784 uiWidth >>= 1; 876 785 uiHeight >>= 1; 877 786 piCoeff = pcCU->getCoeffCb(); pResi = m_ppcYuvResi[uiDepth]->getCbAddr(); 878 m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_CHROMA_U, pResi, 0, m_ppcYuvResi[uiDepth]->getCStride(), uiWidth, uiHeight, uiChromaTrMode, 0, piCoeff ); 879 880 #if CHROMA_QP_EXTENSION 787 m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_CHROMA_U, pResi, 0, m_ppcYuvResi[uiDepth]->getCStride(), uiWidth, uiHeight, trMode, 0, piCoeff ); 788 881 789 curChromaQpOffset = pcCU->getSlice()->getPPS()->getChromaCrQpOffset() + pcCU->getSlice()->getSliceQpDeltaCr(); 882 790 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), TEXT_CHROMA, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset ); 883 #else884 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), TEXT_CHROMA, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), pcCU->getSlice()->getPPS()->getChromaCrQpOffset() );885 #endif886 791 887 792 piCoeff = pcCU->getCoeffCr(); pResi = m_ppcYuvResi[uiDepth]->getCrAddr(); 888 m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_CHROMA_V, pResi, 0, m_ppcYuvResi[uiDepth]->getCStride(), uiWidth, uiHeight, uiChromaTrMode, 0, piCoeff );793 m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_CHROMA_V, pResi, 0, m_ppcYuvResi[uiDepth]->getCStride(), uiWidth, uiHeight, trMode, 0, piCoeff ); 889 794 } 890 795 … … 911 816 uiPicStride = pcCU->getPic()->getPicYuvRec()->getStride(); 912 817 piPicReco = pcCU->getPic()->getPicYuvRec()->getLumaAddr(pcCU->getAddr(), pcCU->getZorderIdxInCU()+uiPartIdx); 913 uiPcmLeftShiftBit = g_ uiBitDepth + g_uiBitIncrement- pcCU->getSlice()->getSPS()->getPCMBitDepthLuma();818 uiPcmLeftShiftBit = g_bitDepthY - pcCU->getSlice()->getSPS()->getPCMBitDepthLuma(); 914 819 } 915 820 else … … 925 830 piPicReco = pcCU->getPic()->getPicYuvRec()->getCrAddr(pcCU->getAddr(), pcCU->getZorderIdxInCU()+uiPartIdx); 926 831 } 927 uiPcmLeftShiftBit = g_ uiBitDepth + g_uiBitIncrement- pcCU->getSlice()->getSPS()->getPCMBitDepthChroma();832 uiPcmLeftShiftBit = g_bitDepthC - pcCU->getSlice()->getSPS()->getPCMBitDepthChroma(); 928 833 } 929 834 … … 943 848 /** Function for reconstructing a PCM mode CU. 944 849 * \param pcCU pointer to current CU 945 * \param uiAbsPartIdx CU index946 850 * \param uiDepth CU Depth 947 851 * \returns Void 948 852 */ 949 Void TDecCu::xReconPCM( TComDataCU* pcCU, UInt ui AbsPartIdx, UInt uiDepth )853 Void TDecCu::xReconPCM( TComDataCU* pcCU, UInt uiDepth ) 950 854 { 951 855 // Luma … … 977 881 /** Function for filling the PCM buffer of a CU using its reconstructed sample array 978 882 * \param pcCU pointer to current CU 979 * \param uiAbsPartIdx CU index980 883 * \param uiDepth CU Depth 981 884 * \returns Void 982 885 */ 983 Void TDecCu::xFillPCMBuffer(TComDataCU* pCU, UInt absPartIdx, UIntdepth)886 Void TDecCu::xFillPCMBuffer(TComDataCU* pCU, UInt depth) 984 887 { 985 888 // Luma … … 1028 931 } 1029 932 933 #if NO_RESIDUAL_FLAG_FOR_BLPRED 934 Void 935 TDecCu::xReconIntraBL( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 936 { 937 m_ppcYuvReco[uiDepth]->copyFromPicLuma ( pcCU->getSlice()->getFullPelBaseRec(), pcCU->getAddr(), pcCU->getZorderIdxInCU(), 0, pcCU->getWidth(0), pcCU->getHeight(0)); 938 m_ppcYuvReco[uiDepth]->copyFromPicChroma( pcCU->getSlice()->getFullPelBaseRec(), pcCU->getAddr(), pcCU->getZorderIdxInCU(), 0, (pcCU->getWidth(0)>>1), (pcCU->getHeight(0)>>1), 0); 939 m_ppcYuvReco[uiDepth]->copyFromPicChroma( pcCU->getSlice()->getFullPelBaseRec(), pcCU->getAddr(), pcCU->getZorderIdxInCU(), 0, (pcCU->getWidth(0)>>1), (pcCU->getHeight(0)>>1), 1); 940 941 // inter recon 942 xDecodeInterTexture( pcCU, 0, uiDepth ); 943 944 // clip for only non-zero cbp case 945 if ( ( pcCU->getCbf( 0, TEXT_LUMA ) ) || ( pcCU->getCbf( 0, TEXT_CHROMA_U ) ) || ( pcCU->getCbf(0, TEXT_CHROMA_V ) ) ) 946 { 947 m_ppcYuvReco[uiDepth]->addClip( m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth], 0, pcCU->getWidth( 0 ) ); 948 } 949 else 950 { 951 m_ppcYuvReco[uiDepth]->copyPartToPartYuv( m_ppcYuvReco[uiDepth],0, pcCU->getWidth( 0 ),pcCU->getHeight( 0 )); 952 } 953 } 954 #endif 955 1030 956 //! \} -
trunk/source/Lib/TLibDecoder/TDecCu.h
r17 r125 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 91 91 Void init ( TDecEntropy* pcEntropyDecoder, TComTrQuant* pcTrQuant, TComPrediction* pcPrediction ); 92 92 #endif 93 93 94 94 /// create internal buffers 95 95 Void create ( UInt uiMaxDepth, UInt uiMaxWidth, UInt uiMaxHeight ); … … 106 106 #if SVC_EXTENSION 107 107 TDecTop* getLayerDec ( UInt LayerId ) { return m_ppcTDecTop[LayerId]; } 108 #endif109 108 #if INTRA_BL 110 109 Void setBaseRecPic ( TComPicYuv* p ) { m_pcPicYuvRecBase = p; } 111 110 #endif 111 #endif 112 112 protected: 113 113 … … 115 115 Void xFinishDecodeCU ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt &ruiIsLast); 116 116 Bool xDecodeSliceEnd ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth); 117 Void xDecompressCU ( TComDataCU* pcCU, TComDataCU* pcCUCur,UInt uiAbsPartIdx, UInt uiDepth );117 Void xDecompressCU ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 118 118 119 Void xReconInter ( TComDataCU* pcCU, UInt ui AbsPartIdx, UInt uiDepth );119 Void xReconInter ( TComDataCU* pcCU, UInt uiDepth ); 120 120 121 Void xReconIntraQT ( TComDataCU* pcCU, UInt ui AbsPartIdx, UInt uiDepth );121 Void xReconIntraQT ( TComDataCU* pcCU, UInt uiDepth ); 122 122 Void xIntraRecLumaBlk ( TComDataCU* pcCU, UInt uiTrDepth, UInt uiAbsPartIdx, TComYuv* pcRecoYuv, TComYuv* pcPredYuv, TComYuv* pcResiYuv ); 123 123 Void xIntraRecChromaBlk ( TComDataCU* pcCU, UInt uiTrDepth, UInt uiAbsPartIdx, TComYuv* pcRecoYuv, TComYuv* pcPredYuv, TComYuv* pcResiYuv, UInt uiChromaId ); … … 126 126 #endif 127 127 128 Void xReconPCM ( TComDataCU* pcCU, UInt ui AbsPartIdx, UInt uiDepth );128 Void xReconPCM ( TComDataCU* pcCU, UInt uiDepth ); 129 129 130 130 Void xDecodeInterTexture ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); … … 138 138 Bool getdQPFlag () { return m_bDecodeDQP; } 139 139 Void setdQPFlag ( Bool b ) { m_bDecodeDQP = b; } 140 Void xFillPCMBuffer (TComDataCU* pCU, UInt absPartIdx, UIntdepth);140 Void xFillPCMBuffer (TComDataCU* pCU, UInt depth); 141 141 }; 142 142 -
trunk/source/Lib/TLibDecoder/TDecEntropy.cpp
r17 r125 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 46 46 } 47 47 48 #include "TLibCommon/TComAdaptiveLoopFilter.h"49 48 #include "TLibCommon/TComSampleAdaptiveOffset.h" 50 49 … … 88 87 * \returns Void 89 88 */ 90 Void TDecEntropy::decodeMergeIndex( TComDataCU* pcCU, UInt uiPartIdx, UInt uiAbsPartIdx, PartSize eCUMode, UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours,UInt uiDepth )89 Void TDecEntropy::decodeMergeIndex( TComDataCU* pcCU, UInt uiPartIdx, UInt uiAbsPartIdx, UInt uiDepth ) 91 90 { 92 91 UInt uiMergeIndex = 0; 93 m_pcEntropyDecoderIf->parseMergeIndex( pcCU, uiMergeIndex , uiAbsPartIdx, uiDepth);92 m_pcEntropyDecoderIf->parseMergeIndex( pcCU, uiMergeIndex ); 94 93 pcCU->setMergeIndexSubParts( uiMergeIndex, uiAbsPartIdx, uiPartIdx, uiDepth ); 95 94 } … … 178 177 } 179 178 Int numValidMergeCand = 0; 180 bool isMerged = false;179 Bool isMerged = false; 181 180 182 181 pcSubCU->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 ); … … 187 186 if ( pcCU->getMergeFlag( uiSubPartIdx ) ) 188 187 { 189 decodeMergeIndex( pcCU, uiPartIdx, uiSubPartIdx, ePartSize, uhInterDirNeighbours, cMvFieldNeighbours,uiDepth );188 decodeMergeIndex( pcCU, uiPartIdx, uiSubPartIdx, uiDepth ); 190 189 UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); 191 #if REF_IDX_FRAMEWORK // HM bug fix190 #if 0 //REF_IDX_FRAMEWORK // HM bug fix 192 191 if(uiPartIdx) 193 192 { … … 204 203 if ( !isMerged ) 205 204 { 206 pcSubCU->getInterMergeCandidates( 0, 0, uiDepth,cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );205 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); 207 206 isMerged = true; 208 207 } … … 212 211 { 213 212 uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); 214 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth,cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );213 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 215 214 } 216 215 pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); … … 268 267 else 269 268 { 270 m_pcEntropyDecoderIf->parseInterDir( pcCU, uiInterDir, uiAbsPartIdx , uiDepth);269 m_pcEntropyDecoderIf->parseInterDir( pcCU, uiInterDir, uiAbsPartIdx ); 271 270 } 272 271 … … 281 280 if ( pcCU->getSlice()->getNumRefIdx( eRefList ) > 1 && iParseRefFrmIdx ) 282 281 { 283 m_pcEntropyDecoderIf->parseRefFrmIdx( pcCU, iRefFrmIdx, uiAbsPartIdx, uiDepth,eRefList );282 m_pcEntropyDecoderIf->parseRefFrmIdx( pcCU, iRefFrmIdx, eRefList ); 284 283 } 285 284 else if ( !iParseRefFrmIdx ) … … 326 325 cMv = cZeroMv; 327 326 328 #if !SPS_AMVP_CLEANUP329 if ( (pcSubCU->getInterDir(uiPartAddr) & ( 1 << eRefList )) && (pcSubCU->getAMVPMode(uiPartAddr) == AM_EXPL) )330 #else331 327 if ( (pcSubCU->getInterDir(uiPartAddr) & ( 1 << eRefList )) ) 332 #endif333 328 { 334 329 m_pcEntropyDecoderIf->parseMVPIdx( iMVPIdx ); … … 339 334 if ( iRefIdx >= 0 ) 340 335 { 341 m_pcPrediction->getMvPredAMVP( pcSubCU, uiPartIdx, uiPartAddr, eRefList, iRefIdx,cMv);336 m_pcPrediction->getMvPredAMVP( pcSubCU, uiPartIdx, uiPartAddr, eRefList, cMv); 342 337 cMv += pcSubCUMvField->getMvd( uiPartAddr ); 343 338 } … … 347 342 } 348 343 349 Void TDecEntropy::xDecodeTransform( TComDataCU* pcCU, UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt absTUPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, UInt uiInnerQuadIdx, Bool& bCodeDQP)344 Void TDecEntropy::xDecodeTransform( TComDataCU* pcCU, UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP) 350 345 { 351 346 UInt uiSubdiv; … … 388 383 { 389 384 assert( uiLog2TrafoSize > pcCU->getQuadtreeTULog2MinSizeInCU(uiAbsPartIdx) ); 390 #if TRANS_SPLIT_FLAG_CTX_REDUCTION391 385 m_pcEntropyDecoderIf->parseTransformSubdivFlag( uiSubdiv, 5 - uiLog2TrafoSize ); 392 #else393 m_pcEntropyDecoderIf->parseTransformSubdivFlag( uiSubdiv, uiDepth );394 #endif395 386 } 396 387 … … 431 422 const UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1); 432 423 const UInt uiStartAbsPartIdx = uiAbsPartIdx; 433 UInt uiLumaTrMode, uiChromaTrMode;434 pcCU->convertTransIdx( uiStartAbsPartIdx, uiTrDepth+1, uiLumaTrMode, uiChromaTrMode );435 424 UInt uiYCbf = 0; 436 425 UInt uiUCbf = 0; … … 439 428 for( Int i = 0; i < 4; i++ ) 440 429 { 441 #if REMOVE_NSQT 442 UInt nsAddr = uiAbsPartIdx; 443 #else 444 UInt nsAddr = 0; 445 nsAddr = pcCU->getNSAbsPartIdx( uiLog2TrafoSize-1, uiAbsPartIdx, absTUPartIdx, i, uiTrDepth+1 ); 446 #endif 447 xDecodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, nsAddr, uiDepth, width, height, uiTrIdx, i, bCodeDQP ); 448 uiYCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiLumaTrMode ); 449 uiUCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiChromaTrMode ); 450 uiVCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiChromaTrMode ); 430 xDecodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP ); 431 uiYCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrDepth+1 ); 432 uiUCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth+1 ); 433 uiVCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth+1 ); 451 434 uiAbsPartIdx += uiQPartNum; 452 435 offsetLuma += size; offsetChroma += (size>>2); 453 436 } 454 437 455 pcCU->convertTransIdx( uiStartAbsPartIdx, uiTrDepth, uiLumaTrMode, uiChromaTrMode );456 438 for( UInt ui = 0; ui < 4 * uiQPartNum; ++ui ) 457 439 { 458 pcCU->getCbf( TEXT_LUMA )[uiStartAbsPartIdx + ui] |= uiYCbf << ui LumaTrMode;459 pcCU->getCbf( TEXT_CHROMA_U )[uiStartAbsPartIdx + ui] |= uiUCbf << ui ChromaTrMode;460 pcCU->getCbf( TEXT_CHROMA_V )[uiStartAbsPartIdx + ui] |= uiVCbf << ui ChromaTrMode;440 pcCU->getCbf( TEXT_LUMA )[uiStartAbsPartIdx + ui] |= uiYCbf << uiTrDepth; 441 pcCU->getCbf( TEXT_CHROMA_U )[uiStartAbsPartIdx + ui] |= uiUCbf << uiTrDepth; 442 pcCU->getCbf( TEXT_CHROMA_V )[uiStartAbsPartIdx + ui] |= uiVCbf << uiTrDepth; 461 443 } 462 444 } … … 477 459 } 478 460 479 UInt uiLumaTrMode, uiChromaTrMode;480 pcCU->convertTransIdx( uiAbsPartIdx, uiTrDepth, uiLumaTrMode, uiChromaTrMode );481 #if !REMOVE_NSQT482 if(pcCU->getPredictionMode( uiAbsPartIdx ) == MODE_INTER && pcCU->useNonSquarePU( uiAbsPartIdx ) )483 {484 pcCU->setNSQTIdxSubParts( uiLog2TrafoSize, uiAbsPartIdx, absTUPartIdx, uiLumaTrMode );485 }486 #endif487 461 pcCU->setCbfSubParts ( 0, TEXT_LUMA, uiAbsPartIdx, uiDepth ); 488 462 #if INTRA_BL … … 496 470 #endif 497 471 { 498 pcCU->setCbfSubParts( 1 << ui LumaTrMode, TEXT_LUMA, uiAbsPartIdx, uiDepth );472 pcCU->setCbfSubParts( 1 << uiTrDepth, TEXT_LUMA, uiAbsPartIdx, uiDepth ); 499 473 } 500 474 else 501 475 { 502 m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_LUMA, ui LumaTrMode, uiDepth );476 m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_LUMA, uiTrDepth, uiDepth ); 503 477 } 504 478 … … 533 507 Int trWidth = width; 534 508 Int trHeight = height; 535 #if !REMOVE_NSQT536 pcCU->getNSQTSize( uiTrIdx, uiAbsPartIdx, trWidth, trHeight );537 #endif538 509 m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffY()+offsetLuma), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_LUMA ); 539 510 } … … 542 513 Int trWidth = width >> 1; 543 514 Int trHeight = height >> 1; 544 #if !REMOVE_NSQT545 pcCU->getNSQTSize( uiTrIdx, uiAbsPartIdx, trWidth, trHeight );546 #endif547 515 if( cbfU ) 548 516 { … … 561 529 Int trWidth = width; 562 530 Int trHeight = height; 563 #if !REMOVE_NSQT564 pcCU->getNSQTSize( uiTrIdx - 1, uiAbsPartIdx, trWidth, trHeight );565 #endif566 531 if( cbfU ) 567 532 { … … 613 578 if( !( pcCU->getPartitionSize( uiAbsPartIdx) == SIZE_2Nx2N && pcCU->getMergeFlag( uiAbsPartIdx ) ) ) 614 579 { 615 m_pcEntropyDecoderIf->parseQtRootCbf( pcCU, uiAbsPartIdx, uiDepth, uiQtRootCbf );580 m_pcEntropyDecoderIf->parseQtRootCbf( uiAbsPartIdx, uiQtRootCbf ); 616 581 } 617 582 if ( !uiQtRootCbf ) … … 619 584 pcCU->setCbfSubParts( 0, 0, 0, uiAbsPartIdx, uiDepth ); 620 585 pcCU->setTrIdxSubParts( 0 , uiAbsPartIdx, uiDepth ); 621 #if !REMOVE_NSQT622 pcCU->setNSQTIdxSubParts( uiAbsPartIdx, uiDepth );623 #endif624 586 return; 625 587 } 626 588 627 589 } 628 xDecodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, ui AbsPartIdx, uiDepth, uiWidth, uiHeight, 0, 0, bCodeDQP );590 xDecodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, bCodeDQP ); 629 591 } 630 592 -
trunk/source/Lib/TLibDecoder/TDecEntropy.h
r2 r125 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 44 44 #include "TLibCommon/TComPic.h" 45 45 #include "TLibCommon/TComPrediction.h" 46 #include "TLibCommon/TComAdaptiveLoopFilter.h"47 46 #include "TLibCommon/TComSampleAdaptiveOffset.h" 48 47 49 48 class TDecSbac; 50 49 class TDecCavlc; 51 class SEImessages;52 50 class ParameterSetManagerDecoder; 53 51 … … 67 65 virtual Void setBitstream ( TComInputBitstream* p ) = 0; 68 66 69 virtual Void decodeFlush() = 0;70 67 virtual Void parseVPS ( TComVPS* pcVPS ) = 0; 71 68 virtual Void parseSPS ( TComSPS* pcSPS ) = 0; 72 69 virtual Void parsePPS ( TComPPS* pcPPS ) = 0; 73 #if !REMOVE_APS74 virtual Void parseAPS ( TComAPS* pAPS ) = 0;75 #endif76 70 77 71 virtual Void parseSliceHeader ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager) = 0; … … 86 80 virtual Void parseSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 87 81 virtual Void parseMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ) = 0; 88 virtual Void parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex , UInt uiAbsPartIdx, UInt uiDepth) = 0;82 virtual Void parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex ) = 0; 89 83 virtual Void parsePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 90 84 virtual Void parsePredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; … … 94 88 virtual Void parseIntraDirChroma( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 95 89 96 virtual Void parseInterDir ( TComDataCU* pcCU, UInt& ruiInterDir, UInt uiAbsPartIdx , UInt uiDepth) = 0;97 virtual Void parseRefFrmIdx ( TComDataCU* pcCU, Int& riRefFrmIdx, UInt uiAbsPartIdx, UInt uiDepth,RefPicList eRefList ) = 0;90 virtual Void parseInterDir ( TComDataCU* pcCU, UInt& ruiInterDir, UInt uiAbsPartIdx ) = 0; 91 virtual Void parseRefFrmIdx ( TComDataCU* pcCU, Int& riRefFrmIdx, RefPicList eRefList ) = 0; 98 92 virtual Void parseMvd ( TComDataCU* pcCU, UInt uiAbsPartAddr, UInt uiPartIdx, UInt uiDepth, RefPicList eRefList ) = 0; 99 93 100 94 virtual Void parseTransformSubdivFlag( UInt& ruiSubdivFlag, UInt uiLog2TransformBlockSize ) = 0; 101 95 virtual Void parseQtCbf ( TComDataCU* pcCU, UInt uiAbsPartIdx, TextType eType, UInt uiTrDepth, UInt uiDepth ) = 0; 102 virtual Void parseQtRootCbf ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt& uiQtRootCbf ) = 0;96 virtual Void parseQtRootCbf ( UInt uiAbsPartIdx, UInt& uiQtRootCbf ) = 0; 103 97 104 98 virtual Void parseDeltaQP ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; … … 112 106 virtual Void parseIntraBLFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) = 0; 113 107 #endif 114 #if !REMOVE_FGS115 /// set slice granularity116 virtual Void setSliceGranularity(Int iSliceGranularity) = 0;117 108 118 /// get slice granularity119 virtual Int getSliceGranularity() = 0;120 #endif121 109 virtual Void updateContextTables( SliceType eSliceType, Int iQp ) = 0; 122 110 … … 147 135 Void decodeVPS ( TComVPS* pcVPS ) { m_pcEntropyDecoderIf->parseVPS(pcVPS); } 148 136 Void decodeSPS ( TComSPS* pcSPS ) { m_pcEntropyDecoderIf->parseSPS(pcSPS); } 149 Void decodePPS ( TComPPS* pcPPS, ParameterSetManagerDecoder *parameterSet ) { m_pcEntropyDecoderIf->parsePPS(pcPPS); } 150 #if !REMOVE_APS 151 Void decodeAPS ( TComAPS* pAPS ) { m_pcEntropyDecoderIf->parseAPS(pAPS);} 152 #endif 137 Void decodePPS ( TComPPS* pcPPS ) { m_pcEntropyDecoderIf->parsePPS(pcPPS); } 153 138 Void decodeSliceHeader ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager) { m_pcEntropyDecoderIf->parseSliceHeader(rpcSlice, parameterSetManager); } 154 139 … … 162 147 Void decodeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 163 148 Void decodeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ); 164 Void decodeMergeIndex ( TComDataCU* pcSubCU, UInt uiPartIdx, UInt uiPartAddr, PartSize eCUMode, UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours,UInt uiDepth );149 Void decodeMergeIndex ( TComDataCU* pcSubCU, UInt uiPartIdx, UInt uiPartAddr, UInt uiDepth ); 165 150 Void decodePredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 166 151 Void decodePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); … … 182 167 183 168 private: 184 Void xDecodeTransform ( TComDataCU* pcCU, UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt absTUPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, UInt uiInnerQuadIdx, Bool& bCodeDQP );169 Void xDecodeTransform ( TComDataCU* pcCU, UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP ); 185 170 186 171 public: 187 172 Void decodeCoeff ( TComDataCU* pcCU , UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, Bool& bCodeDQP ); 188 173 189 #if !REMOVE_FGS190 /// set slice granularity191 Void setSliceGranularity (Int iSliceGranularity) {m_pcEntropyDecoderIf->setSliceGranularity(iSliceGranularity);}192 #endif193 194 Void decodeFlush() { m_pcEntropyDecoderIf->decodeFlush(); }195 196 174 };// END CLASS DEFINITION TDecEntropy 197 175 -
trunk/source/Lib/TLibDecoder/TDecGop.cpp
r28 r125 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 36 36 */ 37 37 38 extern bool g_md5_mismatch; ///< top level flag to signal when there is a decode problem39 40 38 #include "TDecGop.h" 41 39 #include "TDecCAVLC.h" … … 51 49 #include <time.h> 52 50 51 extern Bool g_md5_mismatch; ///< top level flag to signal when there is a decode problem 52 53 53 //! \ingroup TLibDecoder 54 54 //! \{ 55 static void calcAndPrintHashStatus(TComPicYuv& pic, const SEI messages* seis);55 static void calcAndPrintHashStatus(TComPicYuv& pic, const SEIDecodedPictureHash* pictureHashSEI); 56 56 // ==================================================================================================================== 57 57 // Constructor / destructor / initialization / destroy … … 60 60 TDecGop::TDecGop() 61 61 { 62 m_iGopSize = 0;63 62 m_dDecTime = 0; 64 63 m_pcSbacDecoders = NULL; … … 97 96 TDecSlice* pcSliceDecoder, 98 97 TComLoopFilter* pcLoopFilter, 99 #if !REMOVE_ALF100 TComAdaptiveLoopFilter* pcAdaptiveLoopFilter,101 #endif102 98 TComSampleAdaptiveOffset* pcSAO 103 99 ) … … 109 105 m_pcSliceDecoder = pcSliceDecoder; 110 106 m_pcLoopFilter = pcLoopFilter; 111 #if !REMOVE_ALF112 m_pcAdaptiveLoopFilter = pcAdaptiveLoopFilter;113 #endif114 107 m_pcSAO = pcSAO; 115 108 #if SVC_EXTENSION … … 136 129 long iBeforeTime = clock(); 137 130 138 UInt uiStartCUAddr = pcSlice->get DependentSliceCurStartCUAddr();131 UInt uiStartCUAddr = pcSlice->getSliceSegmentCurStartCUAddr(); 139 132 140 133 UInt uiSliceStartCuAddr = pcSlice->getSliceCurStartCUAddr(); … … 147 140 m_pcEntropyDecoder->setEntropyDecoder (m_pcSbacDecoder); 148 141 149 #if TILES_WPP_ENTROPYSLICES_FLAGS150 142 UInt uiNumSubstreams = pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag() ? pcSlice->getNumEntryPointOffsets()+1 : pcSlice->getPPS()->getNumSubstreams(); 151 #else152 UInt uiNumSubstreams = pcSlice->getPPS()->getTilesOrEntropyCodingSyncIdc() == 2 ? pcSlice->getNumEntryPointOffsets()+1 : pcSlice->getPPS()->getNumSubstreams();153 #endif154 143 155 144 // init each couple {EntropyDecoder, Substream} … … 178 167 { 179 168 m_LFCrossSliceBoundaryFlag.push_back( pcSlice->getLFCrossSliceBoundaryFlag()); 180 #if !REMOVE_ALF181 if(pcSlice->getSPS()->getUseALF())182 {183 for(Int compIdx=0; compIdx < 3; compIdx++)184 {185 m_sliceAlfEnabled[compIdx].push_back( pcSlice->getAlfEnabledFlag(compIdx) );186 }187 }188 #endif189 169 } 190 170 m_pcSbacDecoders[0].load(m_pcSbacDecoder); 191 m_pcSliceDecoder->decompressSlice( p cBitstream, ppcSubstreams, rpcPic, m_pcSbacDecoder, m_pcSbacDecoders);171 m_pcSliceDecoder->decompressSlice( ppcSubstreams, rpcPic, m_pcSbacDecoder, m_pcSbacDecoders); 192 172 m_pcEntropyDecoder->setBitstream( ppcSubstreams[uiNumSubstreams-1] ); 193 173 // deallocate all created substreams, including internal buffers. … … 201 181 delete[] m_pcBinCABACs; m_pcBinCABACs = NULL; 202 182 203 m_dDecTime += ( double)(clock()-iBeforeTime) / CLOCKS_PER_SEC;183 m_dDecTime += (Double)(clock()-iBeforeTime) / CLOCKS_PER_SEC; 204 184 } 205 185 … … 213 193 // deblocking filter 214 194 Bool bLFCrossTileBoundary = pcSlice->getPPS()->getLoopFilterAcrossTilesEnabledFlag(); 215 m_pcLoopFilter->setCfg( pcSlice->getPPS()->getDeblockingFilterControlPresentFlag(), pcSlice->getDeblockingFilterDisable(), pcSlice->getDeblockingFilterBetaOffsetDiv2(), pcSlice->getDeblockingFilterTcOffsetDiv2(),bLFCrossTileBoundary);195 m_pcLoopFilter->setCfg(bLFCrossTileBoundary); 216 196 m_pcLoopFilter->loopFilterPic( rpcPic ); 217 197 218 pcSlice = rpcPic->getSlice(0);219 #if REMOVE_ALF220 198 if(pcSlice->getSPS()->getUseSAO()) 221 #else 222 if(pcSlice->getSPS()->getUseSAO() || pcSlice->getSPS()->getUseALF()) 223 #endif 224 { 225 #if !REMOVE_FGS 226 Int sliceGranularity = pcSlice->getPPS()->getSliceGranularity(); 227 #endif 199 { 228 200 m_sliceStartCUAddress.push_back(rpcPic->getNumCUsInFrame()* rpcPic->getNumPartInCU()); 229 #if REMOVE_FGS230 201 rpcPic->createNonDBFilterInfo(m_sliceStartCUAddress, 0, &m_LFCrossSliceBoundaryFlag, rpcPic->getPicSym()->getNumTiles(), bLFCrossTileBoundary); 231 #else232 rpcPic->createNonDBFilterInfo(m_sliceStartCUAddress, sliceGranularity, &m_LFCrossSliceBoundaryFlag, rpcPic->getPicSym()->getNumTiles(), bLFCrossTileBoundary);233 #endif234 202 } 235 203 236 204 if( pcSlice->getSPS()->getUseSAO() ) 237 205 { 238 #if !SAO_LUM_CHROMA_ONOFF_FLAGS 239 if(pcSlice->getSaoEnabledFlag()) 240 #else 241 if(pcSlice->getSaoEnabledFlag()||pcSlice->getSaoEnabledFlagChroma()) 242 #endif 243 { 244 #if REMOVE_APS 206 { 245 207 SAOParam *saoParam = rpcPic->getPicSym()->getSaoParam(); 246 #else247 SAOParam *saoParam = pcSlice->getAPS()->getSaoParam();248 #endif249 208 saoParam->bSaoFlag[0] = pcSlice->getSaoEnabledFlag(); 250 #if SAO_TYPE_SHARING251 209 saoParam->bSaoFlag[1] = pcSlice->getSaoEnabledFlagChroma(); 252 #else253 saoParam->bSaoFlag[1] = pcSlice->getSaoEnabledFlagCb();254 saoParam->bSaoFlag[2] = pcSlice->getSaoEnabledFlagCr();255 #endif256 210 m_pcSAO->setSaoLcuBasedOptimization(1); 257 m_pcSAO->createPicSaoInfo(rpcPic, (Int) m_sliceStartCUAddress.size() - 1); 258 m_pcSAO->SAOProcess(rpcPic, saoParam); 259 #if !REMOVE_ALF 260 m_pcAdaptiveLoopFilter->PCMLFDisableProcess(rpcPic); 261 #else 211 m_pcSAO->createPicSaoInfo(rpcPic); 212 m_pcSAO->SAOProcess(saoParam); 262 213 m_pcSAO->PCMLFDisableProcess(rpcPic); 263 #endif264 214 m_pcSAO->destroyPicSaoInfo(); 265 215 } 266 216 } 267 217 268 #if !REMOVE_ALF269 // adaptive loop filter270 if( pcSlice->getSPS()->getUseALF() )271 {272 m_pcAdaptiveLoopFilter->createPicAlfInfo(rpcPic, (Int) m_sliceStartCUAddress.size()-1);273 m_pcAdaptiveLoopFilter->ALFProcess(rpcPic, pcSlice->getAPS()->getAlfParam(), m_sliceAlfEnabled);274 m_pcAdaptiveLoopFilter->PCMLFDisableProcess(rpcPic);275 m_pcAdaptiveLoopFilter->destroyPicAlfInfo();276 }277 #endif278 279 #if REMOVE_ALF280 218 if(pcSlice->getSPS()->getUseSAO()) 281 #else282 if(pcSlice->getSPS()->getUseSAO() || pcSlice->getSPS()->getUseALF())283 #endif284 219 { 285 220 rpcPic->destroyNonDBFilterInfo(); … … 287 222 288 223 rpcPic->compressMotion(); 289 290 291 224 Char c = (pcSlice->isIntra() ? 'I' : pcSlice->isInterP() ? 'P' : 'B'); 292 225 if (!pcSlice->isReferenced()) c += 32; … … 305 238 pcSlice->getSliceQp() ); 306 239 #endif 307 m_dDecTime += ( double)(clock()-iBeforeTime) / CLOCKS_PER_SEC;240 m_dDecTime += (Double)(clock()-iBeforeTime) / CLOCKS_PER_SEC; 308 241 printf ("[DT %6.3f] ", m_dDecTime ); 309 242 m_dDecTime = 0; … … 320 253 if (m_decodedPictureHashSEIEnabled) 321 254 { 322 calcAndPrintHashStatus(*rpcPic->getPicYuvRec(), rpcPic->getSEIs()); 323 } 324 325 #if FIXED_ROUNDING_FRAME_MEMORY 326 rpcPic->getPicYuvRec()->xFixedRoundingPic(); 327 #endif 255 SEIMessages pictureHashes = getSeisByType(rpcPic->getSEIs(), SEI::DECODED_PICTURE_HASH ); 256 const SEIDecodedPictureHash *hash = ( pictureHashes.size() > 0 ) ? (SEIDecodedPictureHash*) *(pictureHashes.begin()) : NULL; 257 if (pictureHashes.size() > 1) 258 { 259 printf ("Warning: Got multiple decoded picture hash SEI messages. Using first."); 260 } 261 calcAndPrintHashStatus(*rpcPic->getPicYuvRec(), hash); 262 } 328 263 329 264 rpcPic->setOutputMark(true); 330 265 rpcPic->setReconMark(true); 331 266 m_sliceStartCUAddress.clear(); 332 #if !REMOVE_ALF333 for(Int compIdx=0; compIdx < 3; compIdx++)334 {335 m_sliceAlfEnabled[compIdx].clear();336 }337 #endif338 267 m_LFCrossSliceBoundaryFlag.clear(); 339 268 } … … 350 279 * unk - no SEI message was available for comparison 351 280 */ 352 static void calcAndPrintHashStatus(TComPicYuv& pic, const SEI messages* seis)281 static void calcAndPrintHashStatus(TComPicYuv& pic, const SEIDecodedPictureHash* pictureHashSEI) 353 282 { 354 283 /* calculate MD5sum for entire reconstructed picture */ 355 unsigned char recon_digest[3][16];356 int numChar=0;357 const char* hashType = "\0";358 359 if ( seis && seis->picture_digest)360 { 361 switch ( seis->picture_digest->method)284 UChar recon_digest[3][16]; 285 Int numChar=0; 286 const Char* hashType = "\0"; 287 288 if (pictureHashSEI) 289 { 290 switch (pictureHashSEI->method) 362 291 { 363 292 case SEIDecodedPictureHash::MD5: … … 390 319 391 320 /* compare digest against received version */ 392 const char* ok = "(unk)";393 bool mismatch = false;394 395 if ( seis && seis->picture_digest)321 const Char* ok = "(unk)"; 322 Bool mismatch = false; 323 324 if (pictureHashSEI) 396 325 { 397 326 ok = "(OK)"; 398 for( int yuvIdx = 0; yuvIdx < 3; yuvIdx++)399 { 400 for ( unsignedi = 0; i < numChar; i++)401 { 402 if (recon_digest[yuvIdx][i] != seis->picture_digest->digest[yuvIdx][i])327 for(Int yuvIdx = 0; yuvIdx < 3; yuvIdx++) 328 { 329 for (UInt i = 0; i < numChar; i++) 330 { 331 if (recon_digest[yuvIdx][i] != pictureHashSEI->digest[yuvIdx][i]) 403 332 { 404 333 ok = "(***ERROR***)"; … … 414 343 { 415 344 g_md5_mismatch = true; 416 printf("[rx%s:%s] ", hashType, digestToString( seis->picture_digest->digest, numChar));345 printf("[rx%s:%s] ", hashType, digestToString(pictureHashSEI->digest, numChar)); 417 346 } 418 347 } -
trunk/source/Lib/TLibDecoder/TDecGop.h
r2 r125 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 49 49 #include "TLibCommon/TComPic.h" 50 50 #include "TLibCommon/TComLoopFilter.h" 51 #include "TLibCommon/TComAdaptiveLoopFilter.h"52 51 #include "TLibCommon/TComSampleAdaptiveOffset.h" 53 52 … … 68 67 { 69 68 private: 70 Int m_iGopSize;71 69 TComList<TComPic*> m_cListPic; // Dynamic buffer 72 70 … … 81 79 TComLoopFilter* m_pcLoopFilter; 82 80 83 #if !REMOVE_ALF84 // Adaptive Loop filter85 TComAdaptiveLoopFilter* m_pcAdaptiveLoopFilter;86 #endif87 81 TComSampleAdaptiveOffset* m_pcSAO; 88 82 Double m_dDecTime; 89 83 Int m_decodedPictureHashSEIEnabled; ///< Checksum(3)/CRC(2)/MD5(1)/disable(0) acting on decoded picture hash SEI message 90 84 91 //! list that contains the CU address of each slice plus the end address 85 //! list that contains the CU address of each slice plus the end address 92 86 std::vector<Int> m_sliceStartCUAddress; 93 87 std::vector<Bool> m_LFCrossSliceBoundaryFlag; 94 #if !REMOVE_ALF95 std::vector<Bool> m_sliceAlfEnabled[3];96 #endif97 88 98 89 #if SVC_EXTENSION … … 115 106 TDecSlice* pcSliceDecoder, 116 107 TComLoopFilter* pcLoopFilter, 117 #if !REMOVE_ALF118 TComAdaptiveLoopFilter* pcAdaptiveLoopFilter,119 #endif120 108 TComSampleAdaptiveOffset* pcSAO 121 109 ); … … 126 114 #endif 127 115 Void destroy (); 128 // Void decompressGop(TComInputBitstream* pcBitstream, TComPic*& rpcPic, Bool bExecuteDeblockAndAlf );129 116 Void decompressSlice(TComInputBitstream* pcBitstream, TComPic*& rpcPic ); 130 117 Void filterPicture (TComPic*& rpcPic ); 131 Void setGopSize( Int i) { m_iGopSize = i; }132 118 133 119 void setDecodedPictureHashSEIEnabled(Int enabled) { m_decodedPictureHashSEIEnabled = enabled; } -
trunk/source/Lib/TLibDecoder/TDecSbac.cpp
r2 r125 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 56 56 , m_cCUPartSizeSCModel ( 1, 1, NUM_PART_SIZE_CTX , m_contextModels + m_numContextModels, m_numContextModels) 57 57 , m_cCUPredModeSCModel ( 1, 1, NUM_PRED_MODE_CTX , m_contextModels + m_numContextModels, m_numContextModels) 58 , m_cCUAlfCtrlFlagSCModel ( 1, 1, NUM_ALF_CTRL_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels)59 58 , m_cCUIntraPredSCModel ( 1, 1, NUM_ADI_CTX , m_contextModels + m_numContextModels, m_numContextModels) 60 59 , m_cCUChromaPredSCModel ( 1, 1, NUM_CHROMA_PRED_CTX , m_contextModels + m_numContextModels, m_numContextModels) … … 73 72 , m_cCUAbsSCModel ( 1, 1, NUM_ABS_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 74 73 , m_cMVPIdxSCModel ( 1, 1, NUM_MVP_IDX_CTX , m_contextModels + m_numContextModels, m_numContextModels) 75 , m_cALFFlagSCModel ( 1, 1, NUM_ALF_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels)76 , m_cALFUvlcSCModel ( 1, 1, NUM_ALF_UVLC_CTX , m_contextModels + m_numContextModels, m_numContextModels)77 , m_cALFSvlcSCModel ( 1, 1, NUM_ALF_SVLC_CTX , m_contextModels + m_numContextModels, m_numContextModels)78 74 , m_cCUAMPSCModel ( 1, 1, NUM_CU_AMP_CTX , m_contextModels + m_numContextModels, m_numContextModels) 79 #if !SAO_ABS_BY_PASS80 , m_cSaoUvlcSCModel ( 1, 1, NUM_SAO_UVLC_CTX , m_contextModels + m_numContextModels, m_numContextModels)81 #endif82 #if SAO_MERGE_ONE_CTX83 75 , m_cSaoMergeSCModel ( 1, 1, NUM_SAO_MERGE_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 84 #else 85 , m_cSaoMergeLeftSCModel ( 1, 1, NUM_SAO_MERGE_LEFT_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 86 , m_cSaoMergeUpSCModel ( 1, 1, NUM_SAO_MERGE_UP_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 87 #endif 76 , m_cSaoTypeIdxSCModel ( 1, 1, NUM_SAO_TYPE_IDX_CTX , m_contextModels + m_numContextModels, m_numContextModels) 77 , m_cTransformSkipSCModel ( 1, 2, NUM_TRANSFORMSKIP_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 78 , m_CUTransquantBypassFlagSCModel( 1, 1, NUM_CU_TRANSQUANT_BYPASS_FLAG_CTX, m_contextModels + m_numContextModels, m_numContextModels) 88 79 #if INTRA_BL 89 80 , m_cIntraBLPredFlagSCModel (1, 1, NUM_INTRA_BL_PRED_CTX , m_contextModels + m_numContextModels, m_numContextModels) 90 81 #endif 91 , m_cSaoTypeIdxSCModel ( 1, 1, NUM_SAO_TYPE_IDX_CTX , m_contextModels + m_numContextModels, m_numContextModels)92 , m_cTransformSkipSCModel ( 1, 2, NUM_TRANSFORMSKIP_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels)93 , m_CUTransquantBypassFlagSCModel( 1, 1, NUM_CU_TRANSQUANT_BYPASS_FLAG_CTX, m_contextModels + m_numContextModels, m_numContextModels)94 82 { 95 83 assert( m_numContextModels <= MAX_NUM_CTX_MOD ); 96 #if !REMOVE_FGS97 m_iSliceGranularity = 0;98 #endif99 84 } 100 85 … … 131 116 m_cCUMergeFlagExtSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_MERGE_FLAG_EXT ); 132 117 m_cCUMergeIdxExtSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_MERGE_IDX_EXT ); 133 m_cCUAlfCtrlFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_ALF_CTRL_FLAG );134 118 m_cCUPartSizeSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_PART_SIZE ); 135 119 m_cCUAMPSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_CU_AMP_POS ); … … 150 134 m_cCUAbsSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_ABS_FLAG ); 151 135 m_cMVPIdxSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_MVP_IDX ); 152 m_cALFFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_ALF_FLAG );153 m_cALFUvlcSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_ALF_UVLC );154 m_cALFSvlcSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_ALF_SVLC );155 #if !SAO_ABS_BY_PASS156 m_cSaoUvlcSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SAO_UVLC );157 #endif158 #if SAO_MERGE_ONE_CTX159 136 m_cSaoMergeSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SAO_MERGE_FLAG ); 160 #else161 m_cSaoMergeLeftSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SAO_MERGE_LEFT_FLAG );162 m_cSaoMergeUpSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SAO_MERGE_UP_FLAG );163 #endif164 137 m_cSaoTypeIdxSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SAO_TYPE_IDX ); 165 138 … … 191 164 m_cCUMergeFlagExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT ); 192 165 m_cCUMergeIdxExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_IDX_EXT ); 193 m_cCUAlfCtrlFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ALF_CTRL_FLAG );194 166 m_cCUPartSizeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_PART_SIZE ); 195 167 m_cCUAMPSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_CU_AMP_POS ); … … 210 182 m_cCUAbsSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ABS_FLAG ); 211 183 m_cMVPIdxSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MVP_IDX ); 212 m_cALFFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ALF_FLAG );213 m_cALFUvlcSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ALF_UVLC );214 m_cALFSvlcSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ALF_SVLC );215 #if !SAO_ABS_BY_PASS216 m_cSaoUvlcSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SAO_UVLC );217 #endif218 #if SAO_MERGE_ONE_CTX219 184 m_cSaoMergeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SAO_MERGE_FLAG ); 220 #else221 m_cSaoMergeLeftSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SAO_MERGE_LEFT_FLAG );222 m_cSaoMergeUpSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SAO_MERGE_UP_FLAG );223 #endif224 185 m_cSaoTypeIdxSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SAO_TYPE_IDX ); 225 186 m_cCUTransSubdivFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_TRANS_SUBDIV_FLAG ); … … 334 295 prefix -= codeWord; 335 296 codeWord=0; 336 #if COEF_REMAIN_BIN_REDUCTION337 297 if (prefix < COEF_REMAIN_BIN_REDUCTION ) 338 #else339 if (prefix < 8 )340 #endif341 298 { 342 299 m_pcTDecBinIf->decodeBinsEP(codeWord,rParam); … … 345 302 else 346 303 { 347 #if COEF_REMAIN_BIN_REDUCTION348 304 m_pcTDecBinIf->decodeBinsEP(codeWord,prefix-COEF_REMAIN_BIN_REDUCTION+rParam); 349 305 rSymbol = (((1<<(prefix-COEF_REMAIN_BIN_REDUCTION))+COEF_REMAIN_BIN_REDUCTION-1)<<rParam)+codeWord; 350 #else351 m_pcTDecBinIf->decodeBinsEP(codeWord,prefix-8+rParam);352 rSymbol = (((1<<(prefix-8))+8-1)<<rParam)+codeWord;353 #endif354 306 } 355 307 } … … 366 318 { 367 319 UInt uiSymbol; 368 Int numSubseqIPCM = 0;369 320 Bool readPCMSampleFlag = false; 370 321 371 if(pcCU->getNumSucIPCM() > 0)372 {373 readPCMSampleFlag = true;374 }375 else376 {377 322 m_pcTDecBinIf->decodeBinTrm(uiSymbol); 378 323 … … 380 325 { 381 326 readPCMSampleFlag = true; 382 m_pcTDecBinIf->decodeNumSubseqIPCM(numSubseqIPCM);383 pcCU->setNumSucIPCM(numSubseqIPCM + 1);384 327 m_pcTDecBinIf->decodePCMAlignBits(); 385 328 } 386 }387 329 388 330 if (readPCMSampleFlag == true) … … 453 395 } 454 396 455 pcCU->setNumSucIPCM( pcCU->getNumSucIPCM() - 1);456 if(pcCU->getNumSucIPCM() == 0)457 {458 397 m_pcTDecBinIf->resetBac(); 459 }460 398 } 461 399 } … … 494 432 if( uiSymbol ) 495 433 { 496 #if SKIP_FLAG497 434 pcCU->setSkipFlagSubParts( true, uiAbsPartIdx, uiDepth ); 498 #endif499 435 pcCU->setPredModeSubParts( MODE_INTER, uiAbsPartIdx, uiDepth ); 500 436 pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); … … 555 491 } 556 492 557 Void TDecSbac::parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex , UInt uiAbsPartIdx, UInt uiDepth)493 Void TDecSbac::parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex ) 558 494 { 559 495 UInt uiUnaryIdx = 0; … … 783 719 else 784 720 { 785 #if !REMOVE_LMCHROMA786 if( pcCU->getSlice()->getSPS()->getUseLMChroma() )787 {788 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUChromaPredSCModel.get( 0, 0, 1 ) );789 }790 else791 {792 uiSymbol = 1;793 }794 795 if( uiSymbol == 0 )796 {797 uiSymbol = LM_CHROMA_IDX;798 }799 else800 #endif801 721 { 802 722 UInt uiIPredMode; … … 811 731 } 812 732 813 Void TDecSbac::parseInterDir( TComDataCU* pcCU, UInt& ruiInterDir, UInt uiAbsPartIdx , UInt uiDepth)733 Void TDecSbac::parseInterDir( TComDataCU* pcCU, UInt& ruiInterDir, UInt uiAbsPartIdx ) 814 734 { 815 735 UInt uiSymbol; 816 736 const UInt uiCtx = pcCU->getCtxInterDir( uiAbsPartIdx ); 817 737 ContextModel *pCtx = m_cCUInterDirSCModel.get( 0 ); 818 #if DISALLOW_BIPRED_IN_8x4_4x8PUS819 738 uiSymbol = 0; 820 739 if (pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N || pcCU->getHeight(uiAbsPartIdx) != 8 ) 821 740 { 822 #endif823 741 m_pcTDecBinIf->decodeBin( uiSymbol, *( pCtx + uiCtx ) ); 824 #if DISALLOW_BIPRED_IN_8x4_4x8PUS 825 } 826 #endif 742 } 827 743 828 744 if( uiSymbol ) … … 841 757 } 842 758 843 Void TDecSbac::parseRefFrmIdx( TComDataCU* pcCU, Int& riRefFrmIdx, UInt uiAbsPartIdx, UInt uiDepth,RefPicList eRefList )759 Void TDecSbac::parseRefFrmIdx( TComDataCU* pcCU, Int& riRefFrmIdx, RefPicList eRefList ) 844 760 { 845 761 UInt uiSymbol; … … 850 766 if( uiSymbol ) 851 767 { 852 #if REF_IDX_BYPASS853 768 UInt uiRefNum = pcCU->getSlice()->getNumRefIdx( eRefList ) - 2; 854 769 pCtx++; … … 870 785 } 871 786 uiSymbol = ui + 1; 872 #else873 xReadUnaryMaxSymbol( uiSymbol, pCtx + 1, 1, pcCU->getSlice()->getNumRefIdx( eRefList )-2 );874 uiSymbol++;875 #endif876 787 } 877 788 riRefFrmIdx = uiSymbol; … … 958 869 } 959 870 960 Void TDecSbac::parseQtRootCbf( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt& uiQtRootCbf )871 Void TDecSbac::parseQtRootCbf( UInt uiAbsPartIdx, UInt& uiQtRootCbf ) 961 872 { 962 873 UInt uiSymbol; … … 982 893 Int iDQp; 983 894 984 #if CU_DQP_TU_EG985 895 UInt uiSymbol; 986 896 … … 1010 920 qp = pcCU->getRefQP(uiAbsPartIdx); 1011 921 } 1012 #else1013 m_pcTDecBinIf->decodeBin( uiDQp, m_cCUDeltaQpSCModel.get( 0, 0, 0 ) );1014 1015 if ( uiDQp == 0 )1016 {1017 qp = pcCU->getRefQP(uiAbsPartIdx);1018 }1019 else1020 {1021 UInt uiSign;1022 Int qpBdOffsetY = pcCU->getSlice()->getSPS()->getQpBDOffsetY();1023 m_pcTDecBinIf->decodeBinEP(uiSign);1024 1025 UInt uiMaxAbsDQpMinus1 = 24 + (qpBdOffsetY/2) + (uiSign);1026 UInt uiAbsDQpMinus1;1027 xReadUnaryMaxSymbol (uiAbsDQpMinus1, &m_cCUDeltaQpSCModel.get( 0, 0, 1 ), 1, uiMaxAbsDQpMinus1);1028 1029 iDQp = uiAbsDQpMinus1 + 1;1030 1031 if(uiSign)1032 {1033 iDQp = -iDQp;1034 }1035 1036 qp = (((Int) pcCU->getRefQP( uiAbsPartIdx ) + iDQp + 52 + 2*qpBdOffsetY )%(52+qpBdOffsetY)) - qpBdOffsetY;1037 }1038 #endif1039 922 pcCU->setQPSubParts(qp, uiAbsPartIdx, uiDepth); 1040 923 pcCU->setCodedQP(qp); … … 1044 927 { 1045 928 UInt uiSymbol; 1046 const UInt uiCtx = pcCU->getCtxQtCbf( uiAbsPartIdx,eType, uiTrDepth );929 const UInt uiCtx = pcCU->getCtxQtCbf( eType, uiTrDepth ); 1047 930 m_pcTDecBinIf->decodeBin( uiSymbol , m_cCUQtCbfSCModel.get( 0, eType ? TEXT_CHROMA: eType, uiCtx ) ); 1048 931 … … 1068 951 return; 1069 952 } 1070 #if !INTER_TRANSFORMSKIP1071 if(!pcCU->isIntra(uiAbsPartIdx))1072 {1073 return;1074 }1075 #endif1076 953 if(width != 4 || height != 4) 1077 954 { … … 1205 1082 uiHeight = pcCU->getSlice()->getSPS()->getMaxTrSize(); 1206 1083 } 1207 #if PPS_TS_FLAG1208 1084 if(pcCU->getSlice()->getPPS()->getUseTransformSkip()) 1209 #else1210 if(pcCU->getSlice()->getSPS()->getUseTransformSkip())1211 #endif1212 1085 { 1213 1086 parseTransformSkipFlags( pcCU, uiAbsPartIdx, uiWidth, uiHeight, uiDepth, eTType); … … 1221 1094 const UInt uiMaxNumCoeffM1 = uiMaxNumCoeff - 1; 1222 1095 UInt uiScanIdx = pcCU->getCoefScanIdx(uiAbsPartIdx, uiWidth, eTType==TEXT_LUMA, pcCU->isIntra(uiAbsPartIdx)); 1223 int blockType = uiLog2BlockSize;1224 if (uiWidth != uiHeight)1225 {1226 uiScanIdx = SCAN_DIAG;1227 blockType = 4;1228 }1229 1096 1230 1097 //===== decode last significant ===== … … 1235 1102 1236 1103 //===== decode significance flags ===== 1237 UInt uiScanPosLast = uiBlkPosLast; 1238 if (uiScanIdx == SCAN_ZIGZAG) 1239 { 1240 // Map zigzag to diagonal scan 1241 uiScanIdx = SCAN_DIAG; 1242 } 1243 #if REMOVE_NSQT 1244 const UInt *scan = g_auiSigLastScan[ uiScanIdx ][ uiLog2BlockSize-1 ]; 1245 #else 1246 const UInt * scan; 1247 if (uiWidth == uiHeight) 1248 { 1249 scan = g_auiSigLastScan[ uiScanIdx ][ uiLog2BlockSize-1 ]; 1250 } 1251 else 1252 { 1253 scan = g_sigScanNSQT[ uiLog2BlockSize - 2 ]; 1254 } 1255 #endif 1104 UInt uiScanPosLast = uiBlkPosLast; 1105 const UInt *scan = g_auiSigLastScan[ uiScanIdx ][ uiLog2BlockSize-1 ]; 1256 1106 for( uiScanPosLast = 0; uiScanPosLast < uiMaxNumCoeffM1; uiScanPosLast++ ) 1257 1107 { … … 1267 1117 1268 1118 const Int iLastScanSet = uiScanPosLast >> LOG2_SCAN_SET_SIZE; 1269 #if REMOVE_NUM_GREATER11270 1119 UInt c1 = 1; 1271 #else1272 UInt uiNumOne = 0;1273 #endif1274 1120 UInt uiGoRiceParam = 0; 1275 1121 … … 1289 1135 const UInt uiNumBlkSide = uiWidth >> (MLS_CG_SIZE >> 1); 1290 1136 const UInt * scanCG; 1291 #if !REMOVE_NSQT1292 if (uiWidth == uiHeight)1293 #endif1294 1137 { 1295 1138 scanCG = g_auiSigLastScan[ uiScanIdx ][ uiLog2BlockSize > 3 ? uiLog2BlockSize-2-1 : 0 ]; … … 1303 1146 } 1304 1147 } 1305 #if !REMOVE_NSQT1306 else1307 {1308 scanCG = g_sigCGScanNSQT[ uiLog2BlockSize - 2 ];1309 }1310 #endif1311 1148 Int iScanPosSig = (Int) uiScanPosLast; 1312 1149 for( Int iSubSet = iLastScanSet; iSubSet >= 0; iSubSet-- ) … … 1332 1169 Int iCGPosY = iCGBlkPos / uiNumBlkSide; 1333 1170 Int iCGPosX = iCGBlkPos - (iCGPosY * uiNumBlkSide); 1334 #if !REMOVAL_8x2_2x8_CG1335 if( uiWidth == 8 && uiHeight == 8 && (uiScanIdx == SCAN_HOR || uiScanIdx == SCAN_VER) )1336 {1337 iCGPosY = (uiScanIdx == SCAN_HOR ? iCGBlkPos : 0);1338 iCGPosX = (uiScanIdx == SCAN_VER ? iCGBlkPos : 0);1339 }1340 #endif1341 1171 if( iSubSet == iLastScanSet || iSubSet == 0) 1342 1172 { … … 1346 1176 { 1347 1177 UInt uiSigCoeffGroup; 1348 UInt uiCtxSig = TComTrQuant::getSigCoeffGroupCtxInc( uiSigCoeffGroupFlag, iCGPosX, iCGPosY, ui ScanIdx, uiWidth, uiHeight );1178 UInt uiCtxSig = TComTrQuant::getSigCoeffGroupCtxInc( uiSigCoeffGroupFlag, iCGPosX, iCGPosY, uiWidth, uiHeight ); 1349 1179 m_pcTDecBinIf->decodeBin( uiSigCoeffGroup, baseCoeffGroupCtx[ uiCtxSig ] ); 1350 1180 uiSigCoeffGroupFlag[ iCGBlkPos ] = uiSigCoeffGroup; … … 1365 1195 if( iScanPosSig > iSubPos || iSubSet == 0 || numNonZero ) 1366 1196 { 1367 #if REMOVAL_8x2_2x8_CG 1368 uiCtxSig = TComTrQuant::getSigCtxInc( patternSigCtx, uiScanIdx, uiPosX, uiPosY, blockType, uiWidth, uiHeight, eTType ); 1369 #else 1370 uiCtxSig = TComTrQuant::getSigCtxInc( patternSigCtx, uiPosX, uiPosY, blockType, uiWidth, uiHeight, eTType ); 1371 #endif 1197 uiCtxSig = TComTrQuant::getSigCtxInc( patternSigCtx, uiScanIdx, uiPosX, uiPosY, uiLog2BlockSize, eTType ); 1372 1198 m_pcTDecBinIf->decodeBin( uiSig, baseCtx[ uiCtxSig ] ); 1373 1199 } … … 1394 1220 Bool signHidden = ( lastNZPosInCG - firstNZPosInCG >= SBH_THRESHOLD ); 1395 1221 absSum = 0; 1396 #if !REMOVE_NUM_GREATER11397 UInt c1 = 1;1398 #endif1399 1222 UInt uiCtxSet = (iSubSet > 0 && eTType==TEXT_LUMA) ? 2 : 0; 1400 1223 UInt uiBin; 1401 #if REMOVE_NUM_GREATER11402 1224 if( c1 == 0 ) 1403 #else1404 if( uiNumOne > 0 )1405 #endif1406 1225 { 1407 1226 uiCtxSet++; 1408 1227 } 1409 #if REMOVE_NUM_GREATER11410 1228 c1 = 1; 1411 #else1412 uiNumOne >>= 1;1413 #endif1414 1229 ContextModel *baseCtxMod = ( eTType==TEXT_LUMA ) ? m_cCUOneSCModel.get( 0, 0 ) + 4 * uiCtxSet : m_cCUOneSCModel.get( 0, 0 ) + NUM_ONE_FLAG_CTX_LUMA + 4 * uiCtxSet; 1415 1230 Int absCoeff[SCAN_SET_SIZE]; … … 1480 1295 { 1481 1296 iFirstCoeff2 = 0; 1482 #if !REMOVE_NUM_GREATER11483 uiNumOne++;1484 #endif1485 1297 } 1486 1298 } … … 1510 1322 } 1511 1323 } 1512 #if !REMOVE_NUM_GREATER11513 else1514 {1515 uiNumOne >>= 1;1516 }1517 #endif1518 1324 } 1519 1325 … … 1532 1338 UInt code; 1533 1339 Int i; 1534 #if SAO_ABS_BY_PASS1535 1340 m_pcTDecBinIf->decodeBinEP( code ); 1536 #else1537 m_pcTDecBinIf->decodeBin( code, m_cSaoUvlcSCModel.get( 0, 0, 0 ) );1538 #endif1539 1341 if ( code == 0 ) 1540 1342 { … … 1546 1348 while (1) 1547 1349 { 1548 #if SAO_ABS_BY_PASS1549 1350 m_pcTDecBinIf->decodeBinEP( code ); 1550 #else1551 m_pcTDecBinIf->decodeBin( code, m_cSaoUvlcSCModel.get( 0, 0, 1 ) );1552 #endif1553 1351 if ( code == 0 ) 1554 1352 { … … 1564 1362 val = i; 1565 1363 } 1566 #if SAO_TYPE_CODING1567 1364 Void TDecSbac::parseSaoUflc (UInt uiLength, UInt& riVal) 1568 1365 { 1569 1366 m_pcTDecBinIf->decodeBinsEP ( riVal, uiLength ); 1570 1367 } 1571 #else1572 Void TDecSbac::parseSaoUflc (UInt& riVal)1573 {1574 m_pcTDecBinIf->decodeBinsEP ( riVal, 5 );1575 }1576 #endif1577 #if SAO_MERGE_ONE_CTX1578 1368 Void TDecSbac::parseSaoMerge (UInt& ruiVal) 1579 #else1580 Void TDecSbac::parseSaoMergeLeft (UInt& ruiVal, UInt uiCompIdx)1581 #endif1582 1369 { 1583 1370 UInt uiCode; 1584 #if SAO_MERGE_ONE_CTX1585 1371 m_pcTDecBinIf->decodeBin( uiCode, m_cSaoMergeSCModel.get( 0, 0, 0 ) ); 1586 #else1587 #if SAO_SINGLE_MERGE1588 m_pcTDecBinIf->decodeBin( uiCode, m_cSaoMergeLeftSCModel.get( 0, 0, 0 ) );1589 #else1590 m_pcTDecBinIf->decodeBin( uiCode, m_cSaoMergeLeftSCModel.get( 0, 0, uiCompIdx ) );1591 #endif1592 #endif1593 1372 ruiVal = (Int)uiCode; 1594 1373 } 1595 #if !SAO_MERGE_ONE_CTX 1596 Void TDecSbac::parseSaoMergeUp (UInt& ruiVal) 1374 Void TDecSbac::parseSaoTypeIdx (UInt& ruiVal) 1597 1375 { 1598 1376 UInt uiCode; 1599 m_pcTDecBinIf->decodeBin( uiCode, m_cSaoMergeUpSCModel.get( 0, 0, 0 ) );1600 ruiVal = (Int)uiCode;1601 }1602 #endif1603 Void TDecSbac::parseSaoTypeIdx (UInt& ruiVal)1604 {1605 UInt uiCode;1606 #if SAO_TYPE_CODING1607 1377 m_pcTDecBinIf->decodeBin( uiCode, m_cSaoTypeIdxSCModel.get( 0, 0, 0 ) ); 1608 1378 if (uiCode == 0) … … 1622 1392 } 1623 1393 } 1624 #else1625 Int i;1626 m_pcTDecBinIf->decodeBin( uiCode, m_cSaoTypeIdxSCModel.get( 0, 0, 0 ) );1627 if ( uiCode == 0 )1628 {1629 ruiVal = 0;1630 return;1631 }1632 i=1;1633 while (1)1634 {1635 m_pcTDecBinIf->decodeBin( uiCode, m_cSaoTypeIdxSCModel.get( 0, 0, 1 ) );1636 if ( uiCode == 0 )1637 {1638 break;1639 }1640 i++;1641 }1642 ruiVal = i;1643 #endif1644 1394 } 1645 1395 … … 1651 1401 if (psDst->typeIdx != -1) 1652 1402 { 1653 #if SAO_TYPE_CODING1654 1403 psDst->subTypeIdx = psSrc->subTypeIdx ; 1655 #else1656 if (psDst->typeIdx == SAO_BO)1657 {1658 psDst->bandPosition = psSrc->bandPosition ;1659 }1660 else1661 {1662 psDst->bandPosition = 0;1663 }1664 #endif1665 1404 psDst->length = psSrc->length; 1666 1405 for (i=0;i<psDst->length;i++) … … 1679 1418 } 1680 1419 1681 #if SAO_TYPE_SHARING1682 1420 Void TDecSbac::parseSaoOffset(SaoLcuParam* psSaoLcuParam, UInt compIdx) 1683 #else1684 Void TDecSbac::parseSaoOffset(SaoLcuParam* psSaoLcuParam)1685 #endif1686 1421 { 1687 1422 UInt uiSymbol; … … 1695 1430 }; 1696 1431 1697 #if SAO_TYPE_SHARING 1698 if (compIdx==2) 1699 { 1700 uiSymbol = (UInt)( psSaoLcuParam->typeIdx + 1); 1701 } 1702 else 1703 { 1704 parseSaoTypeIdx(uiSymbol); 1705 } 1706 #else 1707 parseSaoTypeIdx(uiSymbol); 1708 #endif 1432 if (compIdx==2) 1433 { 1434 uiSymbol = (UInt)( psSaoLcuParam->typeIdx + 1); 1435 } 1436 else 1437 { 1438 parseSaoTypeIdx(uiSymbol); 1439 } 1709 1440 psSaoLcuParam->typeIdx = (Int)uiSymbol - 1; 1710 1441 if (uiSymbol) 1711 1442 { 1712 1443 psSaoLcuParam->length = iTypeLength[psSaoLcuParam->typeIdx]; 1713 #if FULL_NBIT 1714 Int offsetTh = 1 << ( min((Int)(g_uiBitDepth + (g_uiBitDepth-8)-5),5) ); 1715 #else 1716 Int offsetTh = 1 << ( min((Int)(g_uiBitDepth + g_uiBitIncrement-5),5) ); 1717 #endif 1444 1445 Int bitDepth = compIdx ? g_bitDepthC : g_bitDepthY; 1446 Int offsetTh = 1 << min(bitDepth - 5,5); 1718 1447 1719 1448 if( psSaoLcuParam->typeIdx == SAO_BO ) 1720 1449 { 1721 #if !SAO_TYPE_CODING1722 // Parse Left Band Index1723 parseSaoUflc( uiSymbol );1724 psSaoLcuParam->bandPosition = uiSymbol;1725 #endif1726 1450 for(Int i=0; i< psSaoLcuParam->length; i++) 1727 1451 { … … 1740 1464 } 1741 1465 } 1742 #if SAO_TYPE_CODING1743 1466 parseSaoUflc(5, uiSymbol ); 1744 1467 psSaoLcuParam->subTypeIdx = uiSymbol; 1745 #endif1746 1468 } 1747 1469 else if( psSaoLcuParam->typeIdx < 4 ) … … 1751 1473 parseSaoMaxUvlc(uiSymbol, offsetTh -1 ); psSaoLcuParam->offset[2] = -(Int)uiSymbol; 1752 1474 parseSaoMaxUvlc(uiSymbol, offsetTh -1 ); psSaoLcuParam->offset[3] = -(Int)uiSymbol; 1753 #if SAO_TYPE_CODING1754 #if SAO_TYPE_SHARING1755 1475 if (compIdx != 2) 1756 1476 { … … 1759 1479 psSaoLcuParam->typeIdx += psSaoLcuParam->subTypeIdx; 1760 1480 } 1761 #else1762 parseSaoUflc(2, uiSymbol );1763 psSaoLcuParam->subTypeIdx = uiSymbol;1764 psSaoLcuParam->typeIdx += psSaoLcuParam->subTypeIdx;1765 #endif1766 #endif1767 1481 } 1768 1482 } … … 1777 1491 Int iAddr = pcCU->getAddr(); 1778 1492 UInt uiSymbol; 1779 #if SAO_SINGLE_MERGE1780 1493 for (Int iCompIdx=0; iCompIdx<3; iCompIdx++) 1781 1494 { 1782 1495 pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeUpFlag = 0; 1783 1496 pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeLeftFlag = 0; 1784 #if SAO_TYPE_CODING1785 1497 pSaoParam->saoLcuParam[iCompIdx][iAddr].subTypeIdx = 0; 1786 #else1787 pSaoParam->saoLcuParam[iCompIdx][iAddr].bandPosition = 0;1788 #endif1789 1498 pSaoParam->saoLcuParam[iCompIdx][iAddr].typeIdx = -1; 1790 1499 pSaoParam->saoLcuParam[iCompIdx][iAddr].offset[0] = 0; … … 1794 1503 1795 1504 } 1796 #if SAO_TYPE_SHARING1797 1505 if (pSaoParam->bSaoFlag[0] || pSaoParam->bSaoFlag[1] ) 1798 #else1799 if (pSaoParam->bSaoFlag[0] || pSaoParam->bSaoFlag[1] || pSaoParam->bSaoFlag[2])1800 #endif1801 1506 { 1802 1507 if (rx>0 && iCUAddrInSlice!=0 && allowMergeLeft) 1803 1508 { 1804 #if SAO_MERGE_ONE_CTX1805 1509 parseSaoMerge(uiSymbol); 1806 1510 pSaoParam->saoLcuParam[0][iAddr].mergeLeftFlag = (Bool)uiSymbol; 1807 #else1808 parseSaoMergeLeft(uiSymbol, 0);1809 pSaoParam->saoLcuParam[0][iAddr].mergeLeftFlag = (Bool)uiSymbol;1810 #endif1811 1511 } 1812 1512 if (pSaoParam->saoLcuParam[0][iAddr].mergeLeftFlag==0) … … 1814 1514 if ((ry > 0) && (iCUAddrUpInSlice>=0) && allowMergeUp) 1815 1515 { 1816 #if SAO_MERGE_ONE_CTX1817 1516 parseSaoMerge(uiSymbol); 1818 1517 pSaoParam->saoLcuParam[0][iAddr].mergeUpFlag = (Bool)uiSymbol; 1819 #else 1820 parseSaoMergeUp(uiSymbol); 1821 pSaoParam->saoLcuParam[0][iAddr].mergeUpFlag = (Bool)uiSymbol; 1822 #endif 1823 } 1824 } 1825 } 1826 #endif 1518 } 1519 } 1520 } 1827 1521 1828 1522 for (Int iCompIdx=0; iCompIdx<3; iCompIdx++) 1829 1523 { 1830 #if !SAO_SINGLE_MERGE1831 pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeUpFlag = 0;1832 pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeLeftFlag = 0;1833 pSaoParam->saoLcuParam[iCompIdx][iAddr].bandPosition = 0;1834 pSaoParam->saoLcuParam[iCompIdx][iAddr].typeIdx = -1;1835 pSaoParam->saoLcuParam[iCompIdx][iAddr].offset[0] = 0;1836 pSaoParam->saoLcuParam[iCompIdx][iAddr].offset[1] = 0;1837 pSaoParam->saoLcuParam[iCompIdx][iAddr].offset[2] = 0;1838 pSaoParam->saoLcuParam[iCompIdx][iAddr].offset[3] = 0;1839 #endif1840 #if SAO_TYPE_SHARING1841 1524 if ((iCompIdx == 0 && pSaoParam->bSaoFlag[0]) || (iCompIdx > 0 && pSaoParam->bSaoFlag[1]) ) 1842 #else1843 if (pSaoParam->bSaoFlag[iCompIdx])1844 #endif1845 1525 { 1846 1526 if (rx>0 && iCUAddrInSlice!=0 && allowMergeLeft) 1847 1527 { 1848 #if SAO_SINGLE_MERGE1849 1528 pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeLeftFlag = pSaoParam->saoLcuParam[0][iAddr].mergeLeftFlag; 1850 #else1851 parseSaoMergeLeft(uiSymbol,iCompIdx); pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeLeftFlag = (Int)uiSymbol;1852 #endif1853 1529 } 1854 1530 else … … 1861 1537 if ((ry > 0) && (iCUAddrUpInSlice>=0) && allowMergeUp) 1862 1538 { 1863 #if SAO_SINGLE_MERGE1864 1539 pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeUpFlag = pSaoParam->saoLcuParam[0][iAddr].mergeUpFlag; 1865 #else1866 parseSaoMergeUp(uiSymbol); pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeUpFlag = uiSymbol;1867 #endif1868 1540 } 1869 1541 else … … 1873 1545 if (!pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeUpFlag) 1874 1546 { 1875 #if SAO_TYPE_SHARING1876 1547 pSaoParam->saoLcuParam[2][iAddr].typeIdx = pSaoParam->saoLcuParam[1][iAddr].typeIdx; 1877 1548 parseSaoOffset(&(pSaoParam->saoLcuParam[iCompIdx][iAddr]), iCompIdx); 1878 #else1879 parseSaoOffset(&(pSaoParam->saoLcuParam[iCompIdx][iAddr]));1880 #endif1881 1549 } 1882 1550 else … … 1893 1561 { 1894 1562 pSaoParam->saoLcuParam[iCompIdx][iAddr].typeIdx = -1; 1895 #if SAO_TYPE_CODING1896 1563 pSaoParam->saoLcuParam[iCompIdx][iAddr].subTypeIdx = 0; 1897 #else 1898 pSaoParam->saoLcuParam[iCompIdx][iAddr].bandPosition = 0; 1899 #endif 1900 } 1901 } 1902 } 1903 1904 #if !REMOVE_ALF 1905 Void TDecSbac::parseAlfCtrlFlag (Int compIdx, UInt& code) 1906 { 1907 UInt decodedSymbol; 1908 m_pcTDecBinIf->decodeBin( decodedSymbol, m_cCUAlfCtrlFlagSCModel.get( 0, 0, 0 ) ); 1909 code = decodedSymbol; 1910 1911 DTRACE_CABAC_VL( g_nSymbolCounter++ ) 1912 DTRACE_CABAC_T( "parseAlfCtrlFlag()" ) 1913 DTRACE_CABAC_T( "\tsymbol=" ) 1914 DTRACE_CABAC_V( decodedSymbol ) 1915 DTRACE_CABAC_T( "\tcompIdx=" ) 1916 DTRACE_CABAC_V( compIdx ) 1917 DTRACE_CABAC_T( "\n" ) 1918 } 1919 #endif 1564 } 1565 } 1566 } 1920 1567 1921 1568 /** … … 1947 1594 xCopyContextsFrom(pScr); 1948 1595 } 1949 1950 Void TDecSbac::decodeFlush ( )1951 {1952 UInt uiBit;1953 m_pcTDecBinIf->decodeBinTrm(uiBit);1954 m_pcTDecBinIf->flush();1955 1956 }1957 1596 //! \} -
trunk/source/Lib/TLibDecoder/TDecSbac.h
r2 r125 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 58 58 // ==================================================================================================================== 59 59 60 class SEImessages;61 62 60 /// SBAC decoder class 63 61 class TDecSbac : public TDecEntropyIf … … 74 72 Void xCopyFrom ( TDecSbac* pSrc ); 75 73 Void xCopyContextsFrom ( TDecSbac* pSrc ); 76 Void decodeFlush();77 74 78 75 Void resetEntropy (TComSlice* pSlice ); 79 76 Void setBitstream ( TComInputBitstream* p ) { m_pcBitstream = p; m_pcTDecBinIf->init( p ); } 80 Void parseVPS ( TComVPS* pcVPS ) {} 81 Void parseSPS ( TComSPS* pcSPS ) {} 82 Void parsePPS ( TComPPS* pcPPS ) {} 83 #if !REMOVE_APS 84 Void parseAPS ( TComAPS* pAPS ) {} 85 #endif 77 Void parseVPS ( TComVPS* /*pcVPS*/ ) {} 78 Void parseSPS ( TComSPS* /*pcSPS*/ ) {} 79 Void parsePPS ( TComPPS* /*pcPPS*/ ) {} 86 80 87 Void parseSliceHeader ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager) {}81 Void parseSliceHeader ( TComSlice*& /*rpcSlice*/, ParameterSetManagerDecoder* /*parameterSetManager*/) {} 88 82 Void parseTerminatingBit ( UInt& ruiBit ); 89 83 Void parseMVPIdx ( Int& riMVPIdx ); 90 84 Void parseSaoMaxUvlc ( UInt& val, UInt maxSymbol ); 91 #if SAO_MERGE_ONE_CTX92 85 Void parseSaoMerge ( UInt& ruiVal ); 93 #else94 Void parseSaoMergeLeft ( UInt& ruiVal, UInt uiCompIdx );95 Void parseSaoMergeUp ( UInt& ruiVal );96 #endif97 86 Void parseSaoTypeIdx ( UInt& ruiVal ); 98 #if SAO_TYPE_CODING99 87 Void parseSaoUflc ( UInt uiLength, UInt& ruiVal ); 100 #else101 Void parseSaoUflc ( UInt& ruiVal );102 #endif103 88 Void parseSaoOneLcuInterleaving(Int rx, Int ry, SAOParam* pSaoParam, TComDataCU* pcCU, Int iCUAddrInSlice, Int iCUAddrUpInSlice, Int allowMergeLeft, Int allowMergeUp); 104 #if SAO_TYPE_SHARING105 89 Void parseSaoOffset (SaoLcuParam* psSaoLcuParam, UInt compIdx); 106 #else107 Void parseSaoOffset (SaoLcuParam* psSaoLcuParam);108 #endif109 90 private: 110 91 Void xReadUnarySymbol ( UInt& ruiSymbol, ContextModel* pcSCModel, Int iOffset ); … … 116 97 TDecBinIf* m_pcTDecBinIf; 117 98 118 #if !REMOVE_FGS119 Int m_iSliceGranularity; //!< slice granularity120 #endif121 122 99 public: 123 #if !REMOVE_ALF124 Void parseAlfCtrlFlag (Int compIdx, UInt& code);125 #endif126 #if !REMOVE_FGS127 /// set slice granularity128 Void setSliceGranularity(Int iSliceGranularity) {m_iSliceGranularity = iSliceGranularity;}129 130 /// get slice granularity131 Int getSliceGranularity() {return m_iSliceGranularity; }132 #endif133 100 134 101 Void parseSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); … … 136 103 Void parseSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 137 104 Void parseMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ); 138 Void parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex , UInt uiAbsPartIdx, UInt uiDepth);105 Void parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex ); 139 106 Void parsePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 140 107 Void parsePredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); … … 144 111 Void parseIntraDirChroma( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 145 112 146 Void parseInterDir ( TComDataCU* pcCU, UInt& ruiInterDir, UInt uiAbsPartIdx , UInt uiDepth);147 Void parseRefFrmIdx ( TComDataCU* pcCU, Int& riRefFrmIdx, UInt uiAbsPartIdx, UInt uiDepth,RefPicList eRefList );113 Void parseInterDir ( TComDataCU* pcCU, UInt& ruiInterDir, UInt uiAbsPartIdx ); 114 Void parseRefFrmIdx ( TComDataCU* pcCU, Int& riRefFrmIdx, RefPicList eRefList ); 148 115 Void parseMvd ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth, RefPicList eRefList ); 149 116 150 117 Void parseTransformSubdivFlag( UInt& ruiSubdivFlag, UInt uiLog2TransformBlockSize ); 151 118 Void parseQtCbf ( TComDataCU* pcCU, UInt uiAbsPartIdx, TextType eType, UInt uiTrDepth, UInt uiDepth ); 152 Void parseQtRootCbf ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt& uiQtRootCbf );119 Void parseQtRootCbf ( UInt uiAbsPartIdx, UInt& uiQtRootCbf ); 153 120 154 121 Void parseDeltaQP ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); … … 162 129 Void updateContextTables( SliceType eSliceType, Int iQp ); 163 130 164 Void parseScalingList ( TComScalingList* scalingList) {}131 Void parseScalingList ( TComScalingList* /*scalingList*/ ) {} 165 132 166 133 #if INTRA_BL … … 179 146 ContextModel3DBuffer m_cCUPartSizeSCModel; 180 147 ContextModel3DBuffer m_cCUPredModeSCModel; 181 ContextModel3DBuffer m_cCUAlfCtrlFlagSCModel;182 148 ContextModel3DBuffer m_cCUIntraPredSCModel; 183 149 ContextModel3DBuffer m_cCUChromaPredSCModel; … … 199 165 ContextModel3DBuffer m_cMVPIdxSCModel; 200 166 201 ContextModel3DBuffer m_cALFFlagSCModel;202 ContextModel3DBuffer m_cALFUvlcSCModel;203 ContextModel3DBuffer m_cALFSvlcSCModel;204 167 ContextModel3DBuffer m_cCUAMPSCModel; 205 #if !SAO_ABS_BY_PASS206 ContextModel3DBuffer m_cSaoUvlcSCModel;207 #endif208 #if SAO_MERGE_ONE_CTX209 168 ContextModel3DBuffer m_cSaoMergeSCModel; 210 #else 211 ContextModel3DBuffer m_cSaoMergeLeftSCModel; 212 ContextModel3DBuffer m_cSaoMergeUpSCModel; 213 #endif 169 ContextModel3DBuffer m_cSaoTypeIdxSCModel; 170 ContextModel3DBuffer m_cTransformSkipSCModel; 171 ContextModel3DBuffer m_CUTransquantBypassFlagSCModel; 214 172 #if INTRA_BL 215 173 ContextModel3DBuffer m_cIntraBLPredFlagSCModel; 216 174 #endif 217 ContextModel3DBuffer m_cSaoTypeIdxSCModel;218 ContextModel3DBuffer m_cTransformSkipSCModel;219 ContextModel3DBuffer m_CUTransquantBypassFlagSCModel;220 175 }; 221 176 -
trunk/source/Lib/TLibDecoder/TDecSlice.cpp
r2 r125 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 41 41 //! \{ 42 42 43 #if SVC_EXTENSION 44 ParameterSetMap<TComVPS> ParameterSetManagerDecoder::m_vpsBuffer(MAX_NUM_VPS); 45 #endif 46 43 47 ////////////////////////////////////////////////////////////////////// 44 48 // Construction/Destruction … … 55 59 TDecSlice::~TDecSlice() 56 60 { 57 #if DEPENDENT_SLICES58 61 for (std::vector<TDecSbac*>::iterator i = CTXMem.begin(); i != CTXMem.end(); i++) 59 62 { … … 61 64 } 62 65 CTXMem.clear(); 63 #endif 64 } 65 66 #if DEPENDENT_SLICES 66 } 67 67 68 Void TDecSlice::initCtxMem( UInt i ) 68 69 { … … 74 75 CTXMem.resize(i); 75 76 } 76 #endif 77 78 Void TDecSlice::create( TComSlice* pcSlice, Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth ) 77 78 Void TDecSlice::create() 79 79 { 80 80 } … … 106 106 #if SVC_EXTENSION 107 107 Void TDecSlice::init(TDecTop** ppcDecTop,TDecEntropy* pcEntropyDecoder, TDecCu* pcCuDecoder) 108 { 109 m_pcEntropyDecoder = pcEntropyDecoder; 110 m_pcCuDecoder = pcCuDecoder; 111 m_ppcTDecTop = ppcDecTop; 112 } 108 113 #else 109 114 Void TDecSlice::init(TDecEntropy* pcEntropyDecoder, TDecCu* pcCuDecoder) 110 #endif111 115 { 112 116 m_pcEntropyDecoder = pcEntropyDecoder; 113 117 m_pcCuDecoder = pcCuDecoder; 114 #if SVC_EXTENSION 115 m_ppcTDecTop = ppcDecTop; 116 #endif 117 } 118 119 Void TDecSlice::decompressSlice(TComInputBitstream* pcBitstream, TComInputBitstream** ppcSubstreams, TComPic*& rpcPic, TDecSbac* pcSbacDecoder, TDecSbac* pcSbacDecoders) 118 } 119 #endif 120 121 Void TDecSlice::decompressSlice(TComInputBitstream** ppcSubstreams, TComPic*& rpcPic, TDecSbac* pcSbacDecoder, TDecSbac* pcSbacDecoders) 120 122 { 121 123 TComDataCU* pcCU; 122 124 UInt uiIsLast = 0; 123 Int iStartCUEncOrder = max(rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getSliceCurStartCUAddr()/rpcPic->getNumPartInCU(), rpcPic->getSlice(rpcPic->getCurrSliceIdx())->get DependentSliceCurStartCUAddr()/rpcPic->getNumPartInCU());125 Int iStartCUEncOrder = max(rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getSliceCurStartCUAddr()/rpcPic->getNumPartInCU(), rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getSliceSegmentCurStartCUAddr()/rpcPic->getNumPartInCU()); 124 126 Int iStartCUAddr = rpcPic->getPicSym()->getCUOrderMap(iStartCUEncOrder); 125 127 … … 194 196 UInt uiTileStartLCU; 195 197 UInt uiTileLCUX; 196 UInt uiTileLCUY;197 UInt uiTileWidth;198 UInt uiTileHeight;199 198 Int iNumSubstreamsPerTile = 1; // if independent. 200 201 199 #if INTRA_BL 202 200 m_pcCuDecoder->setBaseRecPic( rpcPic->getLayerId() > 0 ? rpcPic->getFullPelBaseRec() : NULL); 203 201 #endif 204 #if DEPENDENT_SLICES 205 Bool bAllowDependence = false; 206 #if TILES_WPP_ENTROPYSLICES_FLAGS 207 if( rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getPPS()->getDependentSliceEnabledFlag()&& (!rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getPPS()->getEntropySliceEnabledFlag()) ) 208 #else 209 if( rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getPPS()->getDependentSliceEnabledFlag()&& (!rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getPPS()->getCabacIndependentFlag()) ) 210 #endif 211 { 212 bAllowDependence = true; 213 } 214 if( bAllowDependence ) 215 { 216 if( !rpcPic->getSlice(rpcPic->getCurrSliceIdx())->isNextSlice() ) 217 { 218 uiTileCol = 0; 219 #if TILES_WPP_ENTROPYSLICES_FLAGS 202 Bool depSliceSegmentsEnabled = rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getPPS()->getDependentSliceSegmentsEnabledFlag(); 203 uiTileStartLCU = rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iStartCUAddr))->getFirstCUAddr(); 204 if( depSliceSegmentsEnabled ) 205 { 206 if( (!rpcPic->getSlice(rpcPic->getCurrSliceIdx())->isNextSlice()) && 207 iStartCUAddr != rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iStartCUAddr))->getFirstCUAddr()) 208 { 220 209 if(pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag()) 221 #else 222 if(pcSlice->getPPS()->getTilesOrEntropyCodingSyncIdc()==2) 223 #endif 224 { 210 { 211 uiTileCol = rpcPic->getPicSym()->getTileIdxMap(iStartCUAddr) % (rpcPic->getPicSym()->getNumColumnsMinus1()+1); 225 212 m_pcBufferSbacDecoders[uiTileCol].loadContexts( CTXMem[1] );//2.LCU 213 if ( (iStartCUAddr%uiWidthInLCUs+1) >= uiWidthInLCUs ) 214 { 215 uiTileLCUX = uiTileStartLCU % uiWidthInLCUs; 216 uiCol = iStartCUAddr % uiWidthInLCUs; 217 if(uiCol==uiTileLCUX) 218 { 219 CTXMem[0]->loadContexts(pcSbacDecoder); 220 } 221 } 226 222 } 227 223 pcSbacDecoder->loadContexts(CTXMem[0] ); //end of depSlice-1 … … 230 226 else 231 227 { 232 #if TILES_WPP_ENTROPYSLICES_FLAGS233 228 if(pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag()) 234 #else235 if(pcSlice->getPPS()->getTilesOrEntropyCodingSyncIdc()==2)236 #endif237 229 { 238 230 CTXMem[1]->loadContexts(pcSbacDecoder); … … 241 233 } 242 234 } 243 #endif244 235 for( Int iCUAddr = iStartCUAddr; !uiIsLast && iCUAddr < rpcPic->getNumCUsInFrame(); iCUAddr = rpcPic->getPicSym()->xCalculateNxtCUAddr(iCUAddr) ) 245 236 { … … 249 240 uiTileStartLCU = rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getFirstCUAddr(); 250 241 uiTileLCUX = uiTileStartLCU % uiWidthInLCUs; 251 uiTileLCUY = uiTileStartLCU / uiWidthInLCUs;252 uiTileWidth = rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getTileWidth();253 uiTileHeight = rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getTileHeight();254 242 uiCol = iCUAddr % uiWidthInLCUs; 255 243 // The 'line' is now relative to the 1st line in the slice, not the 1st line in the picture. 256 244 uiLin = (iCUAddr/uiWidthInLCUs)-(iStartCUAddr/uiWidthInLCUs); 257 245 // inherit from TR if necessary, select substream to use. 258 #if DEPENDENT_SLICES 259 #if TILES_WPP_ENTROPYSLICES_FLAGS 260 if( (pcSlice->getPPS()->getNumSubstreams() > 1) || ( bAllowDependence && (uiCol == uiTileLCUX)&&(pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag()) )) 261 #else 262 if( (pcSlice->getPPS()->getNumSubstreams() > 1) || ( bAllowDependence && (uiCol == uiTileLCUX)&&(pcSlice->getPPS()->getTilesOrEntropyCodingSyncIdc()==2) )) 263 #endif 264 #else 265 if( pcSlice->getPPS()->getNumSubstreams() > 1 ) 266 #endif 246 if( (pcSlice->getPPS()->getNumSubstreams() > 1) || ( depSliceSegmentsEnabled && (uiCol == uiTileLCUX)&&(pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag()) )) 267 247 { 268 248 // independent tiles => substreams are "per tile". iNumSubstreams has already been multiplied. … … 272 252 m_pcEntropyDecoder->setBitstream( ppcSubstreams[uiSubStrm] ); 273 253 // Synchronize cabac probabilities with upper-right LCU if it's available and we're at the start of a line. 274 #if DEPENDENT_SLICES 275 #if TILES_WPP_ENTROPYSLICES_FLAGS 276 if (((pcSlice->getPPS()->getNumSubstreams() > 1) || bAllowDependence ) && (uiCol == uiTileLCUX)&&(pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag())) 277 #else 278 if (((pcSlice->getPPS()->getNumSubstreams() > 1) || bAllowDependence ) && (uiCol == uiTileLCUX)&&(pcSlice->getPPS()->getTilesOrEntropyCodingSyncIdc()==2)) 279 #endif 280 #else 281 if (pcSlice->getPPS()->getNumSubstreams() > 1 && uiCol == uiTileLCUX) 282 #endif 254 if (((pcSlice->getPPS()->getNumSubstreams() > 1) || depSliceSegmentsEnabled ) && (uiCol == uiTileLCUX)&&(pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag())) 283 255 { 284 256 // We'll sync if the TR is available. … … 296 268 ((pcCUTR->getSCUAddr()+uiMaxParts-1) < pcSlice->getSliceCurStartCUAddr()) || 297 269 ((rpcPic->getPicSym()->getTileIdxMap( pcCUTR->getAddr() ) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr))) 298 ))||299 (true/*bEnforceDependentSliceRestriction*/ &&300 ((pcCUTR==NULL) || (pcCUTR->getSlice()==NULL) ||301 ((pcCUTR->getSCUAddr()+uiMaxParts-1) < pcSlice->getDependentSliceCurStartCUAddr()) ||302 ((rpcPic->getPicSym()->getTileIdxMap( pcCUTR->getAddr() ) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr)))303 270 )) 304 271 ) 305 272 { 306 #if DEPENDENT_SLICES307 if( (iCUAddr!=0) && ((pcCUTR->getSCUAddr()+uiMaxParts-1) >= pcSlice->getSliceCurStartCUAddr()) && bAllowDependence)308 {309 pcSbacDecoders[uiSubStrm].loadContexts( &m_pcBufferSbacDecoders[uiTileCol] );310 }311 #endif312 273 // TR not available. 313 274 } … … 328 289 if ( (iCUAddr == rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getFirstCUAddr()) && // 1st in tile. 329 290 (iCUAddr!=0) && (iCUAddr!=rpcPic->getPicSym()->getPicSCUAddr(rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getSliceCurStartCUAddr())/rpcPic->getNumPartInCU()) 330 #if DEPENDENT_SLICES 331 && (iCUAddr!=rpcPic->getPicSym()->getPicSCUAddr(rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getDependentSliceCurStartCUAddr())/rpcPic->getNumPartInCU()) 332 #endif 291 && (iCUAddr!=rpcPic->getPicSym()->getPicSCUAddr(rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getSliceSegmentCurStartCUAddr())/rpcPic->getNumPartInCU()) 333 292 ) // !1st in frame && !1st in slice 334 293 { … … 366 325 g_bJustDoIt = g_bEncDecTraceEnable; 367 326 #endif 368 #if !SAO_LUM_CHROMA_ONOFF_FLAGS369 if ( pcSlice->getSPS()->getUseSAO() && pcSlice->getSaoEnabledFlag() )370 #else371 327 if ( pcSlice->getSPS()->getUseSAO() && (pcSlice->getSaoEnabledFlag()||pcSlice->getSaoEnabledFlagChroma()) ) 372 #endif 373 { 374 #if REMOVE_APS 328 { 375 329 SAOParam *saoParam = rpcPic->getPicSym()->getSaoParam(); 376 #else377 SAOParam *saoParam = pcSlice->getAPS()->getSaoParam();378 #endif379 330 saoParam->bSaoFlag[0] = pcSlice->getSaoEnabledFlag(); 380 331 if (iCUAddr == iStartCUAddr) 381 332 { 382 #if SAO_TYPE_SHARING383 333 saoParam->bSaoFlag[1] = pcSlice->getSaoEnabledFlagChroma(); 384 #else385 saoParam->bSaoFlag[1] = pcSlice->getSaoEnabledFlagCb();386 saoParam->bSaoFlag[2] = pcSlice->getSaoEnabledFlagCr();387 #endif388 334 } 389 335 Int numCuInWidth = saoParam->numCuInWidth; … … 410 356 pcSbacDecoder->parseSaoOneLcuInterleaving(rx, ry, saoParam,pcCU, cuAddrInSlice, cuAddrUpInSlice, allowMergeLeft, allowMergeUp); 411 357 } 412 #if !REMOVE_ALF 413 if(pcSlice->getSPS()->getUseALF()) 414 { 415 UInt alfEnabledFlag; 416 for(Int compIdx=0; compIdx< 3; compIdx++) 417 { 418 alfEnabledFlag = 0; 419 if(pcSlice->getAlfEnabledFlag(compIdx)) 420 { 421 pcSbacDecoder->parseAlfCtrlFlag(compIdx, alfEnabledFlag); 422 } 423 pcCU->setAlfLCUEnabled((alfEnabledFlag==1)?true:false, compIdx); 424 } 425 } 426 #endif 358 else if ( pcSlice->getSPS()->getUseSAO() ) 359 { 360 Int addr = pcCU->getAddr(); 361 SAOParam *saoParam = rpcPic->getPicSym()->getSaoParam(); 362 for (Int cIdx=0; cIdx<3; cIdx++) 363 { 364 SaoLcuParam *saoLcuParam = &(saoParam->saoLcuParam[cIdx][addr]); 365 if ( ((cIdx == 0) && !pcSlice->getSaoEnabledFlag()) || ((cIdx == 1 || cIdx == 2) && !pcSlice->getSaoEnabledFlagChroma())) 366 { 367 saoLcuParam->mergeUpFlag = 0; 368 saoLcuParam->mergeLeftFlag = 0; 369 saoLcuParam->subTypeIdx = 0; 370 saoLcuParam->typeIdx = -1; 371 saoLcuParam->offset[0] = 0; 372 saoLcuParam->offset[1] = 0; 373 saoLcuParam->offset[2] = 0; 374 saoLcuParam->offset[3] = 0; 375 } 376 } 377 } 427 378 m_pcCuDecoder->decodeCU ( pcCU, uiIsLast ); 428 379 m_pcCuDecoder->decompressCU ( pcCU ); … … 431 382 g_bJustDoIt = g_bEncDecTraceDisable; 432 383 #endif 433 /*If at the end of a LCU line but not at the end of a substream, perform CABAC flush*/434 if (!uiIsLast && pcSlice->getPPS()->getNumSubstreams() > 1)435 {436 if ((uiCol == uiTileLCUX+uiTileWidth-1) && (uiLin+iNumSubstreamsPerTile < uiTileLCUY+uiTileHeight))437 {438 m_pcEntropyDecoder->decodeFlush();439 }440 }441 384 pcSbacDecoders[uiSubStrm].load(pcSbacDecoder); 442 385 443 386 //Store probabilities of second LCU in line into buffer 444 #if DEPENDENT_SLICES 445 #if TILES_WPP_ENTROPYSLICES_FLAGS 446 if ( (uiCol == uiTileLCUX+1)&& (bAllowDependence || (pcSlice->getPPS()->getNumSubstreams() > 1)) && (pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag()) ) 447 #else 448 if ( (uiCol == uiTileLCUX+1)&& (bAllowDependence || (pcSlice->getPPS()->getNumSubstreams() > 1)) && (pcSlice->getPPS()->getTilesOrEntropyCodingSyncIdc() == 2)) 449 #endif 450 #else 451 if (pcSlice->getPPS()->getNumSubstreams() > 1 && (uiCol == uiTileLCUX+1)) 452 #endif 387 if ( (uiCol == uiTileLCUX+1)&& (depSliceSegmentsEnabled || (pcSlice->getPPS()->getNumSubstreams() > 1)) && (pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag()) ) 453 388 { 454 389 m_pcBufferSbacDecoders[uiTileCol].loadContexts( &pcSbacDecoders[uiSubStrm] ); 455 390 } 456 #if DEPENDENT_SLICES 457 if( uiIsLast && bAllowDependence ) 458 { 459 #if TILES_WPP_ENTROPYSLICES_FLAGS 391 if( uiIsLast && depSliceSegmentsEnabled ) 392 { 460 393 if (pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag()) 461 #else462 if (pcSlice->getPPS()->getTilesOrEntropyCodingSyncIdc()==2)463 #endif464 394 { 465 395 CTXMem[1]->loadContexts( &m_pcBufferSbacDecoders[uiTileCol] );//ctx 2.LCU … … 468 398 return; 469 399 } 470 #endif471 400 } 472 401 } 473 402 474 403 ParameterSetManagerDecoder::ParameterSetManagerDecoder() 404 #if SVC_EXTENSION 405 : m_spsBuffer(MAX_NUM_SPS) 406 , m_ppsBuffer(MAX_NUM_PPS) 407 #else 475 408 : m_vpsBuffer(MAX_NUM_VPS) 476 ,m_spsBuffer(256) 477 , m_ppsBuffer(16) 478 #if !REMOVE_APS 479 , m_apsBuffer(64) 480 #endif 481 { 482 409 , m_spsBuffer(MAX_NUM_SPS) 410 , m_ppsBuffer(MAX_NUM_PPS) 411 #endif 412 { 483 413 } 484 414 … … 525 455 } 526 456 527 #if !REMOVE_APS528 TComAPS* ParameterSetManagerDecoder::getPrefetchedAPS (Int apsId)529 {530 if (m_apsBuffer.getPS(apsId) != NULL )531 {532 return m_apsBuffer.getPS(apsId);533 }534 else535 {536 return getAPS(apsId);537 }538 }539 #endif540 541 457 Void ParameterSetManagerDecoder::applyPrefetchedPS() 542 458 { 543 459 m_vpsMap.mergePSList(m_vpsBuffer); 544 #if !REMOVE_APS545 m_apsMap.mergePSList(m_apsBuffer);546 #endif547 460 m_ppsMap.mergePSList(m_ppsBuffer); 548 461 m_spsMap.mergePSList(m_spsBuffer); -
trunk/source/Lib/TLibDecoder/TDecSlice.h
r2 r125 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 71 71 TDecSbac* m_pcBufferLowLatSbacDecoders; ///< dependent tiles: line to store temporary contexts, one per column of tiles. 72 72 TDecBinCABAC* m_pcBufferLowLatBinCABACs; 73 #if DEPENDENT_SLICES74 73 std::vector<TDecSbac*> CTXMem; 75 #endif76 77 74 #if SVC_EXTENSION 78 75 TDecTop** m_ppcTDecTop; 79 #endif 76 #endif 80 77 81 78 public: … … 88 85 Void init ( TDecEntropy* pcEntropyDecoder, TDecCu* pcMbDecoder ); 89 86 #endif 90 Void create ( TComSlice* pcSlice, Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth);87 Void create (); 91 88 Void destroy (); 92 89 93 Void decompressSlice ( TComInputBitstream* pcBitstream, TComInputBitstream** ppcSubstreams, TComPic*& rpcPic, TDecSbac* pcSbacDecoder, TDecSbac* pcSbacDecoders ); 94 #if DEPENDENT_SLICES 90 Void decompressSlice ( TComInputBitstream** ppcSubstreams, TComPic*& rpcPic, TDecSbac* pcSbacDecoder, TDecSbac* pcSbacDecoders ); 95 91 Void initCtxMem( UInt i ); 96 Void setCtxMem( TDecSbac* sb, int b ) { CTXMem[b] = sb; } 97 #endif 98 92 Void setCtxMem( TDecSbac* sb, Int b ) { CTXMem[b] = sb; } 99 93 #if SVC_EXTENSION 100 94 TDecTop* getLayerDec ( UInt LayerId ) { return m_ppcTDecTop[LayerId]; } 101 #endif 95 #endif 102 96 }; 103 97 … … 114 108 Void storePrefetchedPPS(TComPPS *pps) { m_ppsBuffer.storePS( pps->getPPSId(), pps); }; 115 109 TComPPS* getPrefetchedPPS (Int ppsId); 116 #if !REMOVE_APS117 Void storePrefetchedAPS(TComAPS *aps) { m_apsBuffer.storePS( aps->getAPSID(), aps); };118 TComAPS* getPrefetchedAPS (Int apsId);119 #endif120 110 Void applyPrefetchedPS(); 121 111 122 112 private: 113 #if SVC_EXTENSION 114 static ParameterSetMap<TComVPS> m_vpsBuffer; 115 #else 123 116 ParameterSetMap<TComVPS> m_vpsBuffer; 117 #endif 124 118 ParameterSetMap<TComSPS> m_spsBuffer; 125 119 ParameterSetMap<TComPPS> m_ppsBuffer; 126 #if !REMOVE_APS127 ParameterSetMap<TComAPS> m_apsBuffer;128 #endif129 120 }; 130 121 -
trunk/source/Lib/TLibDecoder/TDecTop.cpp
r55 r125 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 40 40 41 41 #if SVC_EXTENSION 42 ParameterSetManagerDecoder TDecTop::m_parameterSetManagerDecoder; // storage for parameter sets43 42 UInt TDecTop::m_prevPOC = MAX_UINT; 44 43 UInt TDecTop::m_uiPrevLayerId = MAX_UINT; … … 50 49 51 50 TDecTop::TDecTop() 52 : m_SEIs(0)53 51 { 54 52 m_pcPic = 0; 55 m_iGopSize = 0;56 m_bGopSizeSet = false;57 53 m_iMaxRefPicNum = 0; 58 54 #if ENC_DEC_TRACE … … 61 57 g_nSymbolCounter = 0; 62 58 #endif 63 m_bRefreshPending = 0;64 59 m_pocCRA = 0; 65 60 m_prevRAPisBLA = false; … … 134 129 #endif 135 130 #if SVC_EXTENSION 136 #if REMOVE_ALF137 131 m_cGopDecoder.init( m_ppcTDecTop, &m_cEntropyDecoder, &m_cSbacDecoder, &m_cBinCABAC, &m_cCavlcDecoder, &m_cSliceDecoder, &m_cLoopFilter, &m_cSAO); 138 #else139 m_cGopDecoder.init( m_ppcTDecTop, &m_cEntropyDecoder, &m_cSbacDecoder, &m_cBinCABAC, &m_cCavlcDecoder, &m_cSliceDecoder, &m_cLoopFilter, &m_cAdaptiveLoopFilter, &m_cSAO);140 #endif141 132 m_cSliceDecoder.init( m_ppcTDecTop, &m_cEntropyDecoder, &m_cCuDecoder ); 142 133 #else 143 #if REMOVE_ALF144 134 m_cGopDecoder.init( &m_cEntropyDecoder, &m_cSbacDecoder, &m_cBinCABAC, &m_cCavlcDecoder, &m_cSliceDecoder, &m_cLoopFilter, &m_cSAO); 145 #else146 m_cGopDecoder.init( &m_cEntropyDecoder, &m_cSbacDecoder, &m_cBinCABAC, &m_cCavlcDecoder, &m_cSliceDecoder, &m_cLoopFilter, &m_cAdaptiveLoopFilter, &m_cSAO);147 #endif148 135 m_cSliceDecoder.init( &m_cEntropyDecoder, &m_cCuDecoder ); 149 136 #endif … … 156 143 if(m_layerId>0) 157 144 { 145 Int numReorderPics[MAX_TLAYER]; 146 Window &conformanceWindow = pcSPS->getConformanceWindow(); 147 Window defaultDisplayWindow = pcSPS->getVuiParametersPresentFlag() ? pcSPS->getVuiParameters()->getDefaultDisplayWindow() : Window(); 148 149 for( Int temporalLayer=0; temporalLayer < MAX_TLAYER; temporalLayer++) 150 { 151 numReorderPics[temporalLayer] = pcSPS->getNumReorderPics(temporalLayer); 152 } 153 158 154 if (m_cIlpPic[0] == NULL) 159 155 { … … 163 159 //m_cIlpPic[j]->createWithOutYuv(m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, &m_cSPS, true); 164 160 #if SVC_UPSAMPLING 165 m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, pcSPS, true); 166 #else 167 m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true); 168 #endif 169 #if REF_IDX_ME_AROUND_ZEROMV || REF_IDX_ME_ZEROMV || REF_IDX_MFM 170 m_cIlpPic[j]->setIsILR(true); 161 m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, pcSPS, true); 162 #else 163 m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true); 171 164 #endif 172 165 for (Int i=0; i<m_cIlpPic[j]->getPicSym()->getNumberOfCUsInFrame(); i++) … … 186 179 m_cIlpPic[0]->copyUpsampledPictureYuv(pcPic->getFullPelBaseRec(), m_cIlpPic[0]->getPicYuvRec()); 187 180 m_cIlpPic[0]->getSlice(0)->setPOC(pcPic->getPOC()); 181 m_cIlpPic[0]->setLayerId(0); //set reference layerId 188 182 m_cIlpPic[0]->getPicYuvRec()->setBorderExtension(false); 189 183 m_cIlpPic[0]->getPicYuvRec()->extendPicBorder(); … … 216 210 } 217 211 218 #if !REMOVE_ALF219 // destroy ALF temporary buffers220 m_cAdaptiveLoopFilter.destroy();221 #endif222 223 212 m_cSAO.destroy(); 224 213 … … 231 220 } 232 221 233 Void TDecTop::xUpdateGopSize (TComSlice* pcSlice)234 {235 if ( !pcSlice->isIntra() && !m_bGopSizeSet)236 {237 m_iGopSize = pcSlice->getPOC();238 m_bGopSizeSet = true;239 240 m_cGopDecoder.setGopSize(m_iGopSize);241 }242 }243 244 222 Void TDecTop::xGetNewPicBuffer ( TComSlice* pcSlice, TComPic*& rpcPic ) 245 223 { 246 xUpdateGopSize(pcSlice); 247 224 Int numReorderPics[MAX_TLAYER]; 225 Window &conformanceWindow = pcSlice->getSPS()->getConformanceWindow(); 226 Window defaultDisplayWindow = pcSlice->getSPS()->getVuiParametersPresentFlag() ? pcSlice->getSPS()->getVuiParameters()->getDefaultDisplayWindow() : Window(); 227 228 for( Int temporalLayer=0; temporalLayer < MAX_TLAYER; temporalLayer++) 229 { 230 numReorderPics[temporalLayer] = pcSlice->getSPS()->getNumReorderPics(temporalLayer); 231 } 232 248 233 m_iMaxRefPicNum = pcSlice->getSPS()->getMaxDecPicBuffering(pcSlice->getTLayer())+pcSlice->getSPS()->getNumReorderPics(pcSlice->getTLayer()) + 1; // +1 to have space for the picture currently being decoded 249 234 if (m_cListPic.size() < (UInt)m_iMaxRefPicNum) 250 235 { 251 236 rpcPic = new TComPic(); 252 237 253 238 #if SVC_EXTENSION //Temporal solution, should be modified 254 239 if(m_layerId > 0) … … 265 250 266 251 #if SVC_UPSAMPLING 267 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, pcSlice->getSPS(), true);268 #else 269 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true); 270 #endif 271 272 # if REMOVE_APS252 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 253 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 254 #else 255 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 256 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 257 #endif 273 258 rpcPic->getPicSym()->allocSaoParam(&m_cSAO); 274 #endif275 276 277 259 m_cListPic.pushBack( rpcPic ); 278 260 … … 314 296 315 297 #if SVC_UPSAMPLING 316 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, pcSlice->getSPS(), true); 317 #else 318 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true); 319 #endif 320 #if REMOVE_APS 298 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 299 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 300 301 #else 302 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 303 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 304 #endif 321 305 rpcPic->getPicSym()->allocSaoParam(&m_cSAO); 322 #endif 323 324 325 } 326 327 Void TDecTop::executeDeblockAndAlf(UInt& ruiPOC, TComList<TComPic*>*& rpcListPic, Int& iSkipFrame, Int& iPOCLastDisplay) 306 } 307 308 Void TDecTop::executeLoopFilters(Int& poc, TComList<TComPic*>*& rpcListPic) 328 309 { 329 310 if (!m_pcPic) … … 335 316 TComPic*& pcPic = m_pcPic; 336 317 337 // Execute Deblock and ALF only+ Cleanup318 // Execute Deblock + Cleanup 338 319 339 320 m_cGopDecoder.filterPicture(pcPic); … … 342 323 pcPic->wrireBLSyntax( getBLSyntaxFile(), SYNTAX_BYTES ); 343 324 #endif 344 345 325 TComSlice::sortPicList( m_cListPic ); // sorting for application output 346 ruiPOC= pcPic->getSlice(m_uiSliceIdx-1)->getPOC();326 poc = pcPic->getSlice(m_uiSliceIdx-1)->getPOC(); 347 327 rpcListPic = &m_cListPic; 348 328 m_cCuDecoder.destroy(); … … 356 336 printf("\ninserting lost poc : %d\n",iLostPoc); 357 337 TComSlice cFillSlice; 338 #if SVC_EXTENSION 339 cFillSlice.setSPS( m_parameterSetManagerDecoder[m_layerId].getFirstSPS() ); 340 cFillSlice.setPPS( m_parameterSetManagerDecoder[m_layerId].getFirstPPS() ); 341 cFillSlice.initSlice( m_layerId ); 342 #else 358 343 cFillSlice.setSPS( m_parameterSetManagerDecoder.getFirstSPS() ); 359 344 cFillSlice.setPPS( m_parameterSetManagerDecoder.getFirstPPS() ); 360 #if SET_SLICE_LAYER_ID361 cFillSlice.initSlice( m_parameterSetManagerDecoder.getFirstSPS()->getLayerId() );362 #else363 345 cFillSlice.initSlice(); 364 346 #endif 365 347 TComPic *cFillPic; 366 348 xGetNewPicBuffer(&cFillSlice,cFillPic); 349 #if SVC_EXTENSION 350 cFillPic->getSlice(0)->setSPS( m_parameterSetManagerDecoder[m_layerId].getFirstSPS() ); 351 cFillPic->getSlice(0)->setPPS( m_parameterSetManagerDecoder[m_layerId].getFirstPPS() ); 352 cFillPic->getSlice(0)->initSlice( m_layerId ); 353 #else 367 354 cFillPic->getSlice(0)->setSPS( m_parameterSetManagerDecoder.getFirstSPS() ); 368 355 cFillPic->getSlice(0)->setPPS( m_parameterSetManagerDecoder.getFirstPPS() ); 369 #if SET_SLICE_LAYER_ID370 cFillPic->getSlice(0)->initSlice( cFillPic->getLayerId() );371 #else372 356 cFillPic->getSlice(0)->initSlice(); 373 357 #endif … … 412 396 Void TDecTop::xActivateParameterSets() 413 397 { 398 #if SVC_EXTENSION 399 m_parameterSetManagerDecoder[m_layerId].applyPrefetchedPS(); 400 401 TComPPS *pps = m_parameterSetManagerDecoder[m_layerId].getPPS(m_apcSlicePilot->getPPSId()); 402 assert (pps != 0); 403 404 TComSPS *sps = m_parameterSetManagerDecoder[m_layerId].getSPS(pps->getSPSId()); 405 assert (sps != 0); 406 407 if( false == m_parameterSetManagerDecoder[m_layerId].activatePPS(m_apcSlicePilot->getPPSId(), m_apcSlicePilot->getIdrPicFlag()) ) 408 #else 414 409 m_parameterSetManagerDecoder.applyPrefetchedPS(); 415 410 416 411 TComPPS *pps = m_parameterSetManagerDecoder.getPPS(m_apcSlicePilot->getPPSId()); 417 412 assert (pps != 0); … … 419 414 TComSPS *sps = m_parameterSetManagerDecoder.getSPS(pps->getSPSId()); 420 415 assert (sps != 0); 416 417 if (false == m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->getIdrPicFlag())) 418 #endif 419 { 420 printf ("Parameter set activation failed!"); 421 assert (0); 422 } 421 423 422 424 m_apcSlicePilot->setPPS(pps); 423 425 m_apcSlicePilot->setSPS(sps); 424 426 pps->setSPS(sps); 425 #if TILES_WPP_ENTROPYSLICES_FLAGS426 427 pps->setNumSubstreams(pps->getEntropyCodingSyncEnabledFlag() ? ((sps->getPicHeightInLumaSamples() + sps->getMaxCUHeight() - 1) / sps->getMaxCUHeight()) * (pps->getNumColumnsMinus1() + 1) : 1); 427 #else428 pps->setNumSubstreams(pps->getTilesOrEntropyCodingSyncIdc() == 2 ? ((sps->getPicHeightInLumaSamples() + sps->getMaxCUHeight() - 1) / sps->getMaxCUHeight()) * (pps->getNumColumnsMinus1() + 1) : 1);429 #endif430 #if !REMOVE_APS431 #if REMOVE_ALF432 if(sps->getUseSAO())433 #else434 if(sps->getUseSAO() || sps->getUseALF())435 #endif436 {437 m_apcSlicePilot->setAPS( m_parameterSetManagerDecoder.getAPS(m_apcSlicePilot->getAPSId()) );438 }439 #endif440 428 pps->setMinCuDQPSize( sps->getMaxCUWidth() >> ( pps->getMaxCuDQPDepth()) ); 441 429 … … 451 439 452 440 m_cSAO.destroy(); 453 m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight , g_uiMaxCUDepth);441 m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight ); 454 442 m_cLoopFilter. create( g_uiMaxCUDepth ); 455 443 } … … 462 450 { 463 451 TComPic*& pcPic = m_pcPic; 464 #if S ET_SLICE_LAYER_ID452 #if SVC_EXTENSION 465 453 m_apcSlicePilot->initSlice( nalu.m_layerId ); 466 454 #else … … 479 467 480 468 m_apcSlicePilot->setNalUnitType(nalu.m_nalUnitType); 481 #if TEMPORAL_LAYER_NON_REFERENCE482 469 if((m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TRAIL_N) || 483 470 (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N) || … … 486 473 m_apcSlicePilot->setTemporalLayerNonReferenceFlag(true); 487 474 } 488 #endif489 #if REMOVE_NAL_REF_FLAG490 475 m_apcSlicePilot->setReferenced(true); // Putting this as true ensures that picture is referenced the first time it is in an RPS 491 #else492 m_apcSlicePilot->setReferenced(nalu.m_nalRefFlag);493 #endif494 476 m_apcSlicePilot->setTLayerInfo(nalu.m_temporalId); 477 478 #if SVC_EXTENSION 479 m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder[m_layerId]); 480 #else 495 481 m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder); 496 #if !BYTE_ALIGNMENT 497 // byte align 498 { 499 Int numBitsForByteAlignment = nalu.m_Bitstream->getNumBitsUntilByteAligned(); 500 if ( numBitsForByteAlignment > 0 ) 501 { 502 UInt bitsForByteAlignment; 503 nalu.m_Bitstream->read( numBitsForByteAlignment, bitsForByteAlignment ); 504 assert( bitsForByteAlignment == ( ( 1 << numBitsForByteAlignment ) - 1 ) ); 505 } 506 } 507 #endif 482 #endif 483 if (m_apcSlicePilot->isNextSlice()) 484 { 485 // Skip pictures due to random access 486 if (isRandomAccessSkipPicture(iSkipFrame, iPOCLastDisplay)) 487 { 488 return false; 489 } 490 // Skip TFD pictures associated with BLA/BLANT pictures 491 if (isSkipPictureForBLA(iPOCLastDisplay)) 492 { 493 return false; 494 } 495 } 496 508 497 // exit when a new picture is found 509 498 #if SVC_EXTENSION 510 499 bNewPOC = (m_apcSlicePilot->getPOC()!= m_prevPOC); 511 if (m_apcSlicePilot->isNextSlice() && (bNewPOC || m_layerId!=m_uiPrevLayerId) 512 && !m_bFirstSliceInSequence ) 500 if (m_apcSlicePilot->isNextSlice() && (bNewPOC || m_layerId!=m_uiPrevLayerId) && !m_bFirstSliceInSequence ) 513 501 { 514 502 m_prevPOC = m_apcSlicePilot->getPOC(); … … 540 528 } 541 529 m_bFirstSliceInSequence = false; 542 if (m_apcSlicePilot->isNextSlice())543 {544 // Skip pictures due to random access545 if (isRandomAccessSkipPicture(iSkipFrame, iPOCLastDisplay))546 {547 return false;548 }549 // Skip TFD pictures associated with BLA/BLANT pictures550 if (isSkipPictureForBLA(iPOCLastDisplay))551 {552 return false;553 }554 }555 530 //detect lost reference picture and insert copy of earlier frame. 556 531 Int lostPoc; … … 566 541 TComPic* pBLPic = (*m_ppcTDecTop[0]->getListPic()->begin()); 567 542 fstream* pFile = m_ppcTDecTop[0]->getBLReconFile(); 568 UInt uiWidth = pBLPic->getPicYuvRec()->getWidth() - pBLPic->getPicYuvRec()->getPicCropLeftOffset() - pBLPic->getPicYuvRec()->getPicCropRightOffset();; 569 UInt uiHeight = pBLPic->getPicYuvRec()->getHeight() - pBLPic->getPicYuvRec()->getPicCropTopOffset() - pBLPic->getPicYuvRec()->getPicCropBottomOffset(); 543 const Window &conf = pBLPic->getConformanceWindow(); 544 UInt uiWidth = pBLPic->getPicYuvRec()->getWidth() - conf.getWindowLeftOffset() - conf.getWindowRightOffset(); 545 UInt uiHeight = pBLPic->getPicYuvRec()->getHeight() - conf.getWindowTopOffset() - conf.getWindowBottomOffset(); 570 546 571 547 if( pFile->good() ) … … 617 593 xGetNewPicBuffer (m_apcSlicePilot, pcPic); 618 594 619 / * transfer any SEI messages that have been received to the picture */595 // transfer any SEI messages that have been received to the picture 620 596 pcPic->setSEIs(m_SEIs); 621 m_SEIs = NULL;597 m_SEIs.clear(); 622 598 623 599 // Recursive structure … … 630 606 m_cTrQuant.init ( g_uiMaxCUWidth, g_uiMaxCUHeight, m_apcSlicePilot->getSPS()->getMaxTrSize()); 631 607 632 m_cSliceDecoder.create( m_apcSlicePilot, m_apcSlicePilot->getSPS()->getPicWidthInLumaSamples(), m_apcSlicePilot->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 633 } 634 608 m_cSliceDecoder.create(); 609 } 610 else 611 { 612 // Check if any new SEI has arrived 613 if(!m_SEIs.empty()) 614 { 615 // Currently only decoding Unit SEI message occurring between VCL NALUs copied 616 SEIMessages &picSEI = pcPic->getSEIs(); 617 SEIMessages decodingUnitInfos = extractSeisByType (m_SEIs, SEI::DECODING_UNIT_INFO); 618 picSEI.insert(picSEI.end(), decodingUnitInfos.begin(), decodingUnitInfos.end()); 619 deleteSEIs(m_SEIs); 620 } 621 } 622 635 623 // Set picture slice pointer 636 624 TComSlice* pcSlice = m_apcSlicePilot; … … 712 700 713 701 //convert the start and end CU addresses of the slice and dependent slice into encoding order 714 pcSlice->set DependentSliceCurStartCUAddr( pcPic->getPicSym()->getPicSCUEncOrder(pcSlice->getDependentSliceCurStartCUAddr()) );715 pcSlice->set DependentSliceCurEndCUAddr( pcPic->getPicSym()->getPicSCUEncOrder(pcSlice->getDependentSliceCurEndCUAddr()) );702 pcSlice->setSliceSegmentCurStartCUAddr( pcPic->getPicSym()->getPicSCUEncOrder(pcSlice->getSliceSegmentCurStartCUAddr()) ); 703 pcSlice->setSliceSegmentCurEndCUAddr( pcPic->getPicSym()->getPicSCUEncOrder(pcSlice->getSliceSegmentCurEndCUAddr()) ); 716 704 if(pcSlice->isNextSlice()) 717 705 { … … 744 732 if (bNextSlice) 745 733 { 746 pcSlice->checkCRA(pcSlice->getRPS(), m_pocCRA, m_prevRAPisBLA, m_cListPic); 747 #if !REF_IDX_FRAMEWORK || AVC_SYNTAX 734 pcSlice->checkCRA(pcSlice->getRPS(), m_pocCRA, m_prevRAPisBLA ); 748 735 // Set reference list 736 #if REF_LIST_BUGFIX 737 if (m_layerId == 0) 738 { 739 pcSlice->setRefPicList( m_cListPic ); 740 } 741 #else 749 742 pcSlice->setRefPicList( m_cListPic ); 750 743 #endif … … 788 781 789 782 #if REF_IDX_FRAMEWORK 790 #if !AVC_SYNTAX791 // Set reference list792 pcSlice->setRefPicList( m_cListPic );793 #endif794 783 if(m_layerId > 0) 795 784 { … … 798 787 pcSlice->setRefPOCListILP(m_ppcTDecTop[m_layerId]->m_cIlpPic, pcSlice->getBaseColPic()); 799 788 #endif 800 789 #if REF_LIST_BUGFIX 790 pcSlice->setRefPicListSvc( m_cListPic, m_cIlpPic); 791 #else 801 792 pcSlice->addRefPicList ( m_cIlpPic, 802 793 1, 803 794 ((pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA) && 804 795 (pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA)) ? 0: -1); 796 #endif 805 797 } 806 798 #endif … … 818 810 } 819 811 } 820 if ( pcSlice->isInterB())812 if (!pcSlice->isIntra()) 821 813 { 822 814 Bool bLowDelay = true; … … 831 823 } 832 824 } 833 for (iRefIdx = 0; iRefIdx < pcSlice->getNumRefIdx(REF_PIC_LIST_1) && bLowDelay; iRefIdx++)834 { 835 if ( pcSlice->getRefPic(REF_PIC_LIST_1, iRefIdx)->getPOC() > iCurrPOC)825 if (pcSlice->isInterB()) 826 { 827 for (iRefIdx = 0; iRefIdx < pcSlice->getNumRefIdx(REF_PIC_LIST_1) && bLowDelay; iRefIdx++) 836 828 { 837 bLowDelay = false; 838 } 829 if ( pcSlice->getRefPic(REF_PIC_LIST_1, iRefIdx)->getPOC() > iCurrPOC ) 830 { 831 bLowDelay = false; 832 } 833 } 839 834 } 840 835 … … 870 865 pcSlice->setScalingList ( pcSlice->getPPS()->getScalingList() ); 871 866 } 872 #if TS_FLAT_QUANTIZATION_MATRIX873 867 pcSlice->getScalingList()->setUseTransformSkip(pcSlice->getPPS()->getUseTransformSkip()); 874 #endif875 868 if(!pcSlice->getPPS()->getScalingListPresentFlag() && !pcSlice->getSPS()->getScalingListPresentFlag()) 876 869 { … … 900 893 901 894 m_cEntropyDecoder.decodeVPS( vps ); 895 #if SVC_EXTENSION 896 m_parameterSetManagerDecoder[0].storePrefetchedVPS(vps); 897 #else 902 898 m_parameterSetManagerDecoder.storePrefetchedVPS(vps); 899 #endif 903 900 } 904 901 … … 910 907 #endif 911 908 m_cEntropyDecoder.decodeSPS( sps ); 909 #if SVC_EXTENSION 910 m_parameterSetManagerDecoder[m_layerId].storePrefetchedSPS(sps); 911 #else 912 912 m_parameterSetManagerDecoder.storePrefetchedSPS(sps); 913 #if REF_IDX_MFM914 m_pcSPS = sps;915 setMFMEnabledFlag(sps->getMFMEnabledFlag());916 #endif917 #if !REMOVE_ALF918 m_cAdaptiveLoopFilter.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth );919 913 #endif 920 914 #if REF_IDX_FRAMEWORK … … 929 923 { 930 924 TComPPS* pps = new TComPPS(); 931 m_cEntropyDecoder.decodePPS( pps, &m_parameterSetManagerDecoder ); 925 m_cEntropyDecoder.decodePPS( pps ); 926 #if SVC_EXTENSION 927 m_parameterSetManagerDecoder[m_layerId].storePrefetchedPPS( pps ); 928 #else 932 929 m_parameterSetManagerDecoder.storePrefetchedPPS( pps ); 933 934 #if DEPENDENT_SLICES 935 #if TILES_WPP_ENTROPYSLICES_FLAGS 936 if( pps->getDependentSliceEnabledFlag() && (!pps->getEntropySliceEnabledFlag()) ) 937 #else 938 if( pps->getDependentSliceEnabledFlag() && (!pps->getCabacIndependentFlag()) ) 939 #endif 940 { 941 #if TILES_WPP_ENTROPYSLICES_FLAGS 942 int NumCtx = pps->getEntropyCodingSyncEnabledFlag()?2:1; 943 #else 944 int NumCtx = (pps->getTilesOrEntropyCodingSyncIdc() == 2)?2:1; 945 #endif 930 #endif 931 932 if( pps->getDependentSliceSegmentsEnabledFlag() ) 933 { 934 Int NumCtx = pps->getEntropyCodingSyncEnabledFlag()?2:1; 946 935 m_cSliceDecoder.initCtxMem(NumCtx); 947 936 for ( UInt st = 0; st < NumCtx; st++ ) … … 953 942 } 954 943 } 955 #endif 956 } 957 958 #if !REMOVE_APS 959 Void TDecTop::xDecodeAPS() 960 { 961 TComAPS *aps = new TComAPS(); 962 allocAPS (aps); 963 decodeAPS(aps); 964 m_parameterSetManagerDecoder.storePrefetchedAPS(aps); 965 } 966 #endif 967 968 Void TDecTop::xDecodeSEI( TComInputBitstream* bs ) 969 { 970 #if RECOVERY_POINT_SEI || BUFFERING_PERIOD_AND_TIMING_SEI 971 if ( m_SEIs == NULL ) 972 #endif 973 m_SEIs = new SEImessages; 974 #if BUFFERING_PERIOD_AND_TIMING_SEI 975 m_SEIs->m_pSPS = m_parameterSetManagerDecoder.getSPS(0); 976 #endif 977 m_seiReader.parseSEImessage( bs, *m_SEIs ); 944 } 945 946 Void TDecTop::xDecodeSEI( TComInputBitstream* bs, const NalUnitType nalUnitType ) 947 { 948 #if SVC_EXTENSION 949 if(nalUnitType == NAL_UNIT_SEI_SUFFIX) 950 { 951 m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder[m_layerId].getActiveSPS() ); 952 } 953 else 954 { 955 m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder[m_layerId].getActiveSPS() ); 956 SEIMessages activeParamSets = getSeisByType(m_SEIs, SEI::ACTIVE_PARAMETER_SETS); 957 if (activeParamSets.size()>0) 958 { 959 SEIActiveParameterSets *seiAps = (SEIActiveParameterSets*)(*activeParamSets.begin()); 960 m_parameterSetManagerDecoder[m_layerId].applyPrefetchedPS(); 961 assert(seiAps->activeSeqParamSetId.size()>0); 962 if (! m_parameterSetManagerDecoder[m_layerId].activateSPSWithSEI(seiAps->activeSeqParamSetId[0] )) 963 { 964 printf ("Warning SPS activation with Active parameter set SEI failed"); 965 } 966 } 967 } 968 #else 969 if(nalUnitType == NAL_UNIT_SEI_SUFFIX) 970 { 971 m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveSPS() ); 972 } 973 else 974 { 975 m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder.getActiveSPS() ); 976 SEIMessages activeParamSets = getSeisByType(m_SEIs, SEI::ACTIVE_PARAMETER_SETS); 977 if (activeParamSets.size()>0) 978 { 979 SEIActiveParameterSets *seiAps = (SEIActiveParameterSets*)(*activeParamSets.begin()); 980 m_parameterSetManagerDecoder.applyPrefetchedPS(); 981 assert(seiAps->activeSeqParamSetId.size()>0); 982 if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParamSetId[0] )) 983 { 984 printf ("Warning SPS activation with Active parameter set SEI failed"); 985 } 986 } 987 } 988 #endif 978 989 } 979 990 … … 1001 1012 if( nalu.m_layerId == 1 && pBLPic->getPicYuvRec() == NULL ) 1002 1013 { 1014 TComSPS* sps = new TComSPS(); 1015 Int numReorderPics[MAX_TLAYER]; 1016 Window &conformanceWindow = sps->getConformanceWindow(); 1017 Window defaultDisplayWindow = sps->getVuiParametersPresentFlag() ? sps->getVuiParameters()->getDefaultDisplayWindow() : Window(); 1003 1018 #if SVC_UPSAMPLING 1004 1019 #if AVC_SYNTAX 1005 TComSPS* sps = new TComSPS(); 1006 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, sps, true);1007 #else 1008 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, NULL, true);1009 #endif 1010 #else 1011 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true);1020 1021 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, sps, true); 1022 #else 1023 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, NULL, true); 1024 #endif 1025 #else 1026 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, onformanceWindow, defaultDisplayWindow, numReorderPics, true); 1012 1027 #endif 1013 1028 } … … 1019 1034 xDecodePPS(); 1020 1035 return false; 1021 #if !REMOVE_APS1022 case NAL_UNIT_APS:1023 xDecodeAPS();1024 return false;1025 #endif1026 1036 1027 1037 case NAL_UNIT_SEI: 1028 xDecodeSEI( nalu.m_Bitstream ); 1038 case NAL_UNIT_SEI_SUFFIX: 1039 xDecodeSEI( nalu.m_Bitstream, nalu.m_nalUnitType ); 1029 1040 return false; 1030 1041 1031 #if NAL_UNIT_TYPES_J1003_D71032 1042 case NAL_UNIT_CODED_SLICE_TRAIL_R: 1033 1043 case NAL_UNIT_CODED_SLICE_TRAIL_N: … … 1042 1052 case NAL_UNIT_CODED_SLICE_IDR_N_LP: 1043 1053 case NAL_UNIT_CODED_SLICE_CRA: 1054 case NAL_UNIT_CODED_SLICE_RADL_N: 1044 1055 case NAL_UNIT_CODED_SLICE_DLP: 1056 case NAL_UNIT_CODED_SLICE_RASL_N: 1045 1057 case NAL_UNIT_CODED_SLICE_TFD: 1046 #else1047 case NAL_UNIT_CODED_SLICE:1048 case NAL_UNIT_CODED_SLICE_TFD:1049 case NAL_UNIT_CODED_SLICE_TLA:1050 case NAL_UNIT_CODED_SLICE_CRA:1051 case NAL_UNIT_CODED_SLICE_CRANT:1052 case NAL_UNIT_CODED_SLICE_BLA:1053 case NAL_UNIT_CODED_SLICE_BLANT:1054 case NAL_UNIT_CODED_SLICE_IDR:1055 #endif1056 1058 #if SVC_EXTENSION 1057 1059 return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay, curLayerId, bNewPOC); … … 1075 1077 Bool TDecTop::isSkipPictureForBLA(Int& iPOCLastDisplay) 1076 1078 { 1077 if (m_prevRAPisBLA && m_apcSlicePilot->getPOC() < m_pocCRA && m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TFD)1079 if (m_prevRAPisBLA && m_apcSlicePilot->getPOC() < m_pocCRA && (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TFD || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N)) 1078 1080 { 1079 1081 iPOCLastDisplay++; … … 1106 1108 { 1107 1109 if ( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA 1108 #if !NAL_UNIT_TYPES_J1003_D71109 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRANT1110 #endif1111 1110 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA 1112 #if SUPPORT_FOR_RAP_N_LP1113 1111 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP 1114 #endif1115 1112 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLANT ) 1116 1113 { … … 1118 1115 m_pocRandomAccess = m_apcSlicePilot->getPOC(); 1119 1116 } 1120 #if SUPPORT_FOR_RAP_N_LP1121 1117 else if ( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) 1122 #else 1123 else if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR) 1124 #endif 1125 { 1126 m_pocRandomAccess = 0; // no need to skip the reordered pictures in IDR, they are decodable. 1118 { 1119 m_pocRandomAccess = -MAX_INT; // no need to skip the reordered pictures in IDR, they are decodable. 1127 1120 } 1128 1121 else 1129 1122 { 1130 static bool warningMessage = false;1123 static Bool warningMessage = false; 1131 1124 if(!warningMessage) 1132 1125 { … … 1138 1131 } 1139 1132 // skip the reordered pictures, if necessary 1140 else if (m_apcSlicePilot->getPOC() < m_pocRandomAccess && m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TFD)1133 else if (m_apcSlicePilot->getPOC() < m_pocRandomAccess && (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TFD || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N)) 1141 1134 { 1142 1135 iPOCLastDisplay++; … … 1147 1140 } 1148 1141 1149 #if !REMOVE_APS1150 Void TDecTop::allocAPS (TComAPS* pAPS)1151 {1152 // we don't know the SPS before it has been activated. These fields could exist1153 // depending on the corresponding flags in the APS, but SAO/ALF allocation functions will1154 // have to be moved for that1155 pAPS->createSaoParam();1156 m_cSAO.allocSaoParam(pAPS->getSaoParam());1157 #if !REMOVE_ALF1158 pAPS->createAlfParam();1159 #endif1160 }1161 #endif1162 1163 1142 //! \} -
trunk/source/Lib/TLibDecoder/TDecTop.h
r55 r125 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 65 65 { 66 66 private: 67 Int m_iGopSize;68 Bool m_bGopSizeSet;69 67 Int m_iMaxRefPicNum; 70 68 71 Bool m_bRefreshPending; ///< refresh pending flag72 69 Int m_pocCRA; ///< POC number of the latest CRA picture 73 70 Bool m_prevRAPisBLA; ///< true if the previous RAP (CRA/CRANT/BLA/BLANT/IDR) picture is a BLA/BLANT picture … … 76 73 TComList<TComPic*> m_cListPic; // Dynamic buffer 77 74 #if SVC_EXTENSION 78 static ParameterSetManagerDecoder m_parameterSetManagerDecoder; // storage for parameter sets75 ParameterSetManagerDecoder m_parameterSetManagerDecoder[MAX_LAYERS]; // storage for parameter sets 79 76 #else 80 77 ParameterSetManagerDecoder m_parameterSetManagerDecoder; // storage for parameter sets 81 78 #endif 82 79 83 #if REF_IDX_MFM84 TComSPS* m_pcSPS;85 Bool m_bMFMEnabledFlag;86 #endif87 88 80 TComSlice* m_apcSlicePilot; 89 81 90 SEI messages *m_SEIs; ///< "all" SEI messages. If not NULL, we own the object.82 SEIMessages m_SEIs; ///< List of SEI messages that have been received before the first slice and between slices 91 83 92 84 // functional classes … … 102 94 SEIReader m_seiReader; 103 95 TComLoopFilter m_cLoopFilter; 104 #if !REMOVE_ALF105 TComAdaptiveLoopFilter m_cAdaptiveLoopFilter;106 #endif107 96 TComSampleAdaptiveOffset m_cSAO; 108 97 … … 157 146 Void deletePicBuffer(); 158 147 159 Void execute DeblockAndAlf(UInt& ruiPOC, TComList<TComPic*>*& rpcListPic, Int& iSkipFrame, Int& iPOCLastDisplay);148 Void executeLoopFilters(Int& poc, TComList<TComPic*>*& rpcListPic); 160 149 161 150 #if SVC_EXTENSION … … 183 172 Void setILRPic(TComPic *pcPic); 184 173 #endif 185 #if REF_IDX_MFM186 TComSPS* getSPS() {return m_pcSPS;}187 Void setMFMEnabledFlag(Bool flag) {m_bMFMEnabledFlag = flag;}188 Bool getMFMEnabledFlag() {return m_bMFMEnabledFlag;}189 #endif190 174 191 175 protected: 192 176 Void xGetNewPicBuffer (TComSlice* pcSlice, TComPic*& rpcPic); 193 Void xUpdateGopSize (TComSlice* pcSlice);194 177 Void xCreateLostPicture (Int iLostPOC); 195 178 196 #if !REMOVE_APS197 Void decodeAPS( TComAPS* cAPS) { m_cEntropyDecoder.decodeAPS(cAPS); };198 #endif199 179 Void xActivateParameterSets(); 200 180 #if SVC_EXTENSION … … 206 186 Void xDecodeSPS(); 207 187 Void xDecodePPS(); 208 #if !REMOVE_APS 209 Void xDecodeAPS(); 210 #endif 211 Void xDecodeSEI( TComInputBitstream* bs ); 188 Void xDecodeSEI( TComInputBitstream* bs, const NalUnitType nalUnitType ); 212 189 213 #if !REMOVE_APS214 Void allocAPS (TComAPS* pAPS); //!< memory allocation for APS215 #endif216 190 };// END CLASS DEFINITION TDecTop 217 191
Note: See TracChangeset for help on using the changeset viewer.