Changeset 362 in 3DVCSoftware for branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon
- Timestamp:
- 3 May 2013, 15:34:11 (12 years ago)
- Location:
- branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/CommonDef.h
r324 r362 58 58 #if H_MV 59 59 #define NV_VERSION "0.1" ///< Current software version 60 #define HM_VERSION "10. 0" ///<61 #else 62 #define NV_VERSION "10. 0" ///< Current software version60 #define HM_VERSION "10.1" ///< 61 #else 62 #define NV_VERSION "10.1" ///< Current software version 63 63 #endif 64 64 … … 115 115 #define MAX_NUM_REF_PICS 16 ///< max. number of pictures used for reference 116 116 #define MAX_NUM_REF 16 ///< max. number of entries in picture reference list 117 #if !L0034_COMBINED_LIST_CLEANUP 117 118 #define MAX_NUM_REF_LC MAX_NUM_REF_PICS // TODO: remove this macro definition (leftover from combined list concept) 119 #endif 118 120 119 121 #define MAX_UINT 0xFFFFFFFFU ///< max. value of unsigned 32-bit integer … … 214 216 215 217 NAL_UNIT_CODED_SLICE_TSA_N, // 2 216 NAL_UNIT_CODED_SLICE_TLA , // 3 // Current name in the spec: TSA_R218 NAL_UNIT_CODED_SLICE_TLA_R, // 3 217 219 218 220 NAL_UNIT_CODED_SLICE_STSA_N, // 4 … … 220 222 221 223 NAL_UNIT_CODED_SLICE_RADL_N, // 6 222 NAL_UNIT_CODED_SLICE_ DLP, // 7 // Current name in the spec: RADL_R224 NAL_UNIT_CODED_SLICE_RADL_R, // 7 223 225 224 226 NAL_UNIT_CODED_SLICE_RASL_N, // 8 225 NAL_UNIT_CODED_SLICE_ TFD, // 9 // Current name in the spec: RASL_R226 227 NAL_UNIT_RESERVED_ 10,228 NAL_UNIT_RESERVED_ 11,229 NAL_UNIT_RESERVED_ 12,230 NAL_UNIT_RESERVED_ 13,231 NAL_UNIT_RESERVED_ 14,232 NAL_UNIT_RESERVED_ 15,233 234 NAL_UNIT_CODED_SLICE_BLA , // 16 // Current name in the spec: BLA_W_LP235 NAL_UNIT_CODED_SLICE_BLA NT, // 17 // Current name in the spec: BLA_W_DLP227 NAL_UNIT_CODED_SLICE_RASL_R, // 9 228 229 NAL_UNIT_RESERVED_VCL_N10, 230 NAL_UNIT_RESERVED_VCL_R11, 231 NAL_UNIT_RESERVED_VCL_N12, 232 NAL_UNIT_RESERVED_VCL_R13, 233 NAL_UNIT_RESERVED_VCL_N14, 234 NAL_UNIT_RESERVED_VCL_R15, 235 236 NAL_UNIT_CODED_SLICE_BLA_W_LP, // 16 237 NAL_UNIT_CODED_SLICE_BLA_W_RADL, // 17 236 238 NAL_UNIT_CODED_SLICE_BLA_N_LP, // 18 237 NAL_UNIT_CODED_SLICE_IDR , // 19 // Current name in the spec: IDR_W_DLP239 NAL_UNIT_CODED_SLICE_IDR_W_RADL, // 19 238 240 NAL_UNIT_CODED_SLICE_IDR_N_LP, // 20 239 241 NAL_UNIT_CODED_SLICE_CRA, // 21 240 NAL_UNIT_RESERVED_ 22,241 NAL_UNIT_RESERVED_ 23,242 243 NAL_UNIT_RESERVED_ 24,244 NAL_UNIT_RESERVED_ 25,245 NAL_UNIT_RESERVED_ 26,246 NAL_UNIT_RESERVED_ 27,247 NAL_UNIT_RESERVED_ 28,248 NAL_UNIT_RESERVED_ 29,249 NAL_UNIT_RESERVED_ 30,250 NAL_UNIT_RESERVED_ 31,242 NAL_UNIT_RESERVED_IRAP_VCL22, 243 NAL_UNIT_RESERVED_IRAP_VCL23, 244 245 NAL_UNIT_RESERVED_VCL24, 246 NAL_UNIT_RESERVED_VCL25, 247 NAL_UNIT_RESERVED_VCL26, 248 NAL_UNIT_RESERVED_VCL27, 249 NAL_UNIT_RESERVED_VCL28, 250 NAL_UNIT_RESERVED_VCL29, 251 NAL_UNIT_RESERVED_VCL30, 252 NAL_UNIT_RESERVED_VCL31, 251 253 252 254 NAL_UNIT_VPS, // 32 … … 257 259 NAL_UNIT_EOB, // 37 258 260 NAL_UNIT_FILLER_DATA, // 38 259 NAL_UNIT_ SEI, // 39 Prefix SEI260 NAL_UNIT_S EI_SUFFIX, // 40 Suffix SEI261 NAL_UNIT_RESERVED_ 41,262 NAL_UNIT_RESERVED_ 42,263 NAL_UNIT_RESERVED_ 43,264 NAL_UNIT_RESERVED_ 44,265 NAL_UNIT_RESERVED_ 45,266 NAL_UNIT_RESERVED_ 46,267 NAL_UNIT_RESERVED_ 47,261 NAL_UNIT_PREFIX_SEI, // 39 262 NAL_UNIT_SUFFIX_SEI, // 40 263 NAL_UNIT_RESERVED_NVCL41, 264 NAL_UNIT_RESERVED_NVCL42, 265 NAL_UNIT_RESERVED_NVCL43, 266 NAL_UNIT_RESERVED_NVCL44, 267 NAL_UNIT_RESERVED_NVCL45, 268 NAL_UNIT_RESERVED_NVCL46, 269 NAL_UNIT_RESERVED_NVCL47, 268 270 NAL_UNIT_UNSPECIFIED_48, 269 271 NAL_UNIT_UNSPECIFIED_49, -
branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/NAL.h
r324 r362 80 80 return m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_R 81 81 || m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_N 82 || m_nalUnitType == NAL_UNIT_CODED_SLICE_TLA 82 || m_nalUnitType == NAL_UNIT_CODED_SLICE_TLA_R 83 83 || m_nalUnitType == NAL_UNIT_CODED_SLICE_TSA_N 84 84 || m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA_R 85 85 || m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA_N 86 || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA 87 || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA NT86 || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP 87 || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL 88 88 || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP 89 || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR 89 || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL 90 90 || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP 91 91 || m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA 92 92 || m_nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N 93 || m_nalUnitType == NAL_UNIT_CODED_SLICE_ DLP93 || m_nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R 94 94 || m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N 95 || m_nalUnitType == NAL_UNIT_CODED_SLICE_ TFD;95 || m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R; 96 96 } 97 97 #if L0045_NON_NESTED_SEI_RESTRICTIONS 98 98 Bool isSei() 99 99 { 100 return m_nalUnitType == NAL_UNIT_ SEI101 || m_nalUnitType == NAL_UNIT_S EI_SUFFIX;100 return m_nalUnitType == NAL_UNIT_PREFIX_SEI 101 || m_nalUnitType == NAL_UNIT_SUFFIX_SEI; 102 102 } 103 103 -
branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/SEI.cpp
r324 r362 38 38 #include "CommonDef.h" 39 39 #include "SEI.h" 40 41 #if J0149_TONE_MAPPING_SEI 42 //Table D-7 Meaning of camera iso sensitivity indicator and exposure index rating indicator 43 Int Table_exp_indicator[32] = {0, 10, 12, 16, 20, 25, 32, 40, 50, 64, 80, 100, 125, 160, 200, 250, 320, 400, 500, 640, 800, 1000, 1250, 1600, 2000, 2500, 3200, 4000, 5000, 6400, 8000, -1}; 44 #endif 40 45 41 46 SEIMessages getSeisByType(SEIMessages &seiList, SEI::PayloadType seiType) -
branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/SEI.h
r324 r362 355 355 }; 356 356 357 #if L0208_SOP_DESCRIPTION_SEI 358 class SEISOPDescription : public SEI 359 { 360 public: 361 PayloadType payloadType() const { return SOP_DESCRIPTION; } 362 363 SEISOPDescription() {} 364 virtual ~SEISOPDescription() {} 365 366 UInt m_sopSeqParameterSetId; 367 UInt m_numPicsInSopMinus1; 368 369 UInt m_sopDescVclNaluType[MAX_NUM_PICS_IN_SOP]; 370 UInt m_sopDescTemporalId[MAX_NUM_PICS_IN_SOP]; 371 UInt m_sopDescStRpsIdx[MAX_NUM_PICS_IN_SOP]; 372 Int m_sopDescPocDelta[MAX_NUM_PICS_IN_SOP]; 373 }; 374 #endif 375 376 #if J0149_TONE_MAPPING_SEI 377 class SEIToneMappingInfo : public SEI 378 { 379 public: 380 PayloadType payloadType() const { return TONE_MAPPING_INFO; } 381 SEIToneMappingInfo() {} 382 virtual ~SEIToneMappingInfo() {} 383 384 Int m_toneMapId; 385 Bool m_toneMapCancelFlag; 386 Bool m_toneMapPersistenceFlag; 387 Int m_codedDataBitDepth; 388 Int m_targetBitDepth; 389 Int m_modelId; 390 Int m_minValue; 391 Int m_maxValue; 392 Int m_sigmoidMidpoint; 393 Int m_sigmoidWidth; 394 std::vector<Int> m_startOfCodedInterval; 395 Int m_numPivots; 396 std::vector<Int> m_codedPivotValue; 397 std::vector<Int> m_targetPivotValue; 398 Int m_cameraIsoSpeedIdc; 399 Int m_cameraIsoSpeedValue; 400 Int m_exposureCompensationValueSignFlag; 401 Int m_exposureCompensationValueNumerator; 402 Int m_exposureCompensationValueDenomIdc; 403 Int m_refScreenLuminanceWhite; 404 Int m_extendedRangeWhiteLevel; 405 Int m_nominalBlackLevelLumaCodeValue; 406 Int m_nominalWhiteLevelLumaCodeValue; 407 Int m_extendedWhiteLevelLumaCodeValue; 408 }; 409 #endif 410 357 411 typedef std::list<SEI*> SEIMessages; 358 412 … … 366 420 Void deleteSEIs (SEIMessages &seiList); 367 421 422 #if K0180_SCALABLE_NESTING_SEI 423 class SEIScalableNesting : public SEI 424 { 425 public: 426 PayloadType payloadType() const { return SCALABLE_NESTING; } 427 428 SEIScalableNesting() {} 429 virtual ~SEIScalableNesting() 430 { 431 if (!m_callerOwnsSEIs) 432 { 433 deleteSEIs(m_nestedSEIs); 434 } 435 } 436 437 Bool m_bitStreamSubsetFlag; 438 Bool m_nestingOpFlag; 439 Bool m_defaultOpFlag; //value valid if m_nestingOpFlag != 0 440 UInt m_nestingNumOpsMinus1; // -"- 441 UInt m_nestingMaxTemporalIdPlus1[MAX_TLAYER]; // -"- 442 UInt m_nestingOpIdx[MAX_NESTING_NUM_OPS]; // -"- 443 444 Bool m_allLayersFlag; //value valid if m_nestingOpFlag == 0 445 UInt m_nestingNoOpMaxTemporalIdPlus1; //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0 446 UInt m_nestingNumLayersMinus1; //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0 447 UChar m_nestingLayerId[MAX_NESTING_NUM_LAYER]; //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0. This can e.g. be a static array of 64 unsigned char values 448 449 Bool m_callerOwnsSEIs; 450 SEIMessages m_nestedSEIs; 451 }; 452 #endif 453 368 454 //! \} -
branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/TComBitStream.cpp
r324 r362 177 177 } 178 178 } 179 179 180 Void TComOutputBitstream::writeByteAlignment() 180 181 { … … 182 183 writeAlignZero(); 183 184 } 185 186 Int TComOutputBitstream::countStartCodeEmulations() 187 { 188 UInt cnt = 0; 189 vector<uint8_t>& rbsp = getFIFO(); 190 for (vector<uint8_t>::iterator it = rbsp.begin(); it != rbsp.end();) 191 { 192 vector<uint8_t>::iterator found = it; 193 do 194 { 195 // find the next emulated 00 00 {00,01,02,03} 196 // NB, end()-1, prevents finding a trailing two byte sequence 197 found = search_n(found, rbsp.end()-1, 2, 0); 198 found++; 199 // if not found, found == end, otherwise found = second zero byte 200 if (found == rbsp.end()) 201 { 202 break; 203 } 204 if (*(++found) <= 3) 205 { 206 break; 207 } 208 } while (true); 209 it = found; 210 if (found != rbsp.end()) 211 { 212 cnt++; 213 } 214 } 215 return cnt; 216 } 217 184 218 /** 185 219 * read #uiNumberOfBits# from bitstream without updating the bitstream -
branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/TComBitStream.h
r324 r362 154 154 Void addSubstream ( TComOutputBitstream* pcSubstream ); 155 155 Void writeByteAlignment(); 156 157 //! returns the number of start code emulations contained in the current buffer 158 Int countStartCodeEmulations(); 156 159 }; 157 160 … … 163 166 { 164 167 std::vector<uint8_t> *m_fifo; /// FIFO for storage of complete bytes 168 std::vector<UInt> m_emulationPreventionByteLocation; 165 169 166 170 protected: … … 206 210 UInt getNumBitsRead() { return m_numBitsRead; } 207 211 Void readByteAlignment(); 212 213 Void pushEmulationPreventionByteLocation ( UInt pos ) { m_emulationPreventionByteLocation.push_back( pos ); } 214 UInt numEmulationPreventionBytesRead () { return (UInt) m_emulationPreventionByteLocation.size(); } 215 std::vector<UInt> getEmulationPreventionByteLocation () { return m_emulationPreventionByteLocation; } 216 UInt getEmulationPreventionByteLocation ( UInt idx ) { return m_emulationPreventionByteLocation[ idx ]; } 217 Void clearEmulationPreventionByteLocation() { m_emulationPreventionByteLocation.clear(); } 218 Void setEmulationPreventionByteLocation ( std::vector<UInt> vec ) { m_emulationPreventionByteLocation = vec; } 208 219 }; 209 220 -
branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/TComLoopFilter.cpp
r324 r362 57 57 // ==================================================================================================================== 58 58 59 const UChar tctable_8x8[54] =59 const UChar TComLoopFilter::sm_tcTable[54] = 60 60 { 61 61 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,5,5,6,6,7,8,9,10,11,13,14,16,18,20,22,24 62 62 }; 63 63 64 const UChar betatable_8x8[52] =64 const UChar TComLoopFilter::sm_betaTable[52] = 65 65 { 66 66 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,7,8,9,10,11,12,13,14,15,16,17,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64 … … 585 585 Int iIndexB = Clip3(0, MAX_QP, iQP + (betaOffsetDiv2 << 1)); 586 586 587 Int iTc = tctable_8x8[iIndexTC]*iBitdepthScale;588 Int iBeta = betatable_8x8[iIndexB]*iBitdepthScale;587 Int iTc = sm_tcTable[iIndexTC]*iBitdepthScale; 588 Int iBeta = sm_betaTable[iIndexB]*iBitdepthScale; 589 589 Int iSideThreshold = (iBeta+(iBeta>>1))>>3; 590 590 Int iThrCut = iTc*10; … … 735 735 736 736 Int iIndexTC = Clip3(0, MAX_QP+DEFAULT_INTRA_TC_OFFSET, iQP + DEFAULT_INTRA_TC_OFFSET*(ucBs - 1) + (tcOffsetDiv2 << 1)); 737 Int iTc = tctable_8x8[iIndexTC]*iBitdepthScale;737 Int iTc = sm_tcTable[iIndexTC]*iBitdepthScale; 738 738 739 739 for ( UInt uiStep = 0; uiStep < uiPelsInPartChroma; uiStep++ ) -
branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/TComLoopFilter.h
r324 r362 99 99 __inline Int xCalcDQ( Pel* piSrc, Int iOffset); 100 100 101 static const UChar sm_tcTable[54]; 102 static const UChar sm_betaTable[52]; 103 101 104 public: 102 105 TComLoopFilter(); … … 111 114 /// picture-level deblocking filter 112 115 Void loopFilterPic( TComPic* pcPic ); 116 117 static Int getBeta( Int qp ) 118 { 119 Int indexB = Clip3( 0, MAX_QP, qp ); 120 return sm_betaTable[ indexB ]; 121 } 113 122 }; 114 123 -
branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/TComPrediction.cpp
r324 r362 83 83 if( m_piYuvExt == NULL ) 84 84 { 85 Int extWidth = g_uiMaxCUWidth+ 16;86 Int extHeight = g_uiMaxCUHeight+ 1;85 Int extWidth = MAX_CU_SIZE + 16; 86 Int extHeight = MAX_CU_SIZE + 1; 87 87 Int i, j; 88 88 for (i = 0; i < 4; i++) … … 94 94 } 95 95 } 96 m_iYuvExtHeight = (( g_uiMaxCUHeight+ 2) << 4);97 m_iYuvExtStride = (( g_uiMaxCUWidth+ 8) << 4);96 m_iYuvExtHeight = ((MAX_CU_SIZE + 2) << 4); 97 m_iYuvExtStride = ((MAX_CU_SIZE + 8) << 4); 98 98 m_piYuvExt = new Int[ m_iYuvExtStride * m_iYuvExtHeight ]; 99 99 100 100 // new structure 101 m_acYuvPred[0] .create( g_uiMaxCUWidth, g_uiMaxCUHeight);102 m_acYuvPred[1] .create( g_uiMaxCUWidth, g_uiMaxCUHeight);103 104 m_cYuvPredTemp.create( g_uiMaxCUWidth, g_uiMaxCUHeight);105 } 106 107 if (m_iLumaRecStride != ( g_uiMaxCUWidth>>1) + 1)108 { 109 m_iLumaRecStride = ( g_uiMaxCUWidth>>1) + 1;101 m_acYuvPred[0] .create( MAX_CU_SIZE, MAX_CU_SIZE ); 102 m_acYuvPred[1] .create( MAX_CU_SIZE, MAX_CU_SIZE ); 103 104 m_cYuvPredTemp.create( MAX_CU_SIZE, MAX_CU_SIZE ); 105 } 106 107 if (m_iLumaRecStride != (MAX_CU_SIZE>>1) + 1) 108 { 109 m_iLumaRecStride = (MAX_CU_SIZE>>1) + 1; 110 110 if (!m_pLumaRecBuffer) 111 111 { -
branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/TComRom.cpp
r324 r362 62 62 g_aucConvertToBit[ i ] = c; 63 63 64 // g_auiFrameScanXY[ g_aucConvertToBit[ transformSize ] ]: zigzag scan array for transformSize65 64 c=2; 66 65 for ( i=0; i<MAX_CU_DEPTH; i++ ) … … 77 76 Void destroyROM() 78 77 { 79 Int i; 80 81 for ( i=0; i<MAX_CU_DEPTH; i++ ) 78 for (Int i=0; i<MAX_CU_DEPTH; i++ ) 82 79 { 83 80 delete[] g_auiSigLastScan[0][i]; -
branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/TComSlice.cpp
r331 r362 49 49 , m_iPOC ( 0 ) 50 50 , m_iLastIDR ( 0 ) 51 , m_eNalUnitType ( NAL_UNIT_CODED_SLICE_IDR )51 , m_eNalUnitType ( NAL_UNIT_CODED_SLICE_IDR_W_RADL ) 52 52 , m_eSliceType ( I_SLICE ) 53 53 , m_iSliceQp ( 0 ) … … 60 60 , m_deblockingFilterBetaOffsetDiv2 ( 0 ) 61 61 , m_deblockingFilterTcOffsetDiv2 ( 0 ) 62 #if !L0034_COMBINED_LIST_CLEANUP 62 63 , m_bRefPicListModificationFlagLC ( false ) 63 64 , m_bRefPicListCombinationFlag ( false ) 65 #endif 64 66 , m_bCheckLDC ( false ) 65 67 , m_iSliceQpDelta ( 0 ) … … 79 81 , m_dLambda ( 0.0 ) 80 82 #endif 83 #if !L0034_COMBINED_LIST_CLEANUP 81 84 , m_bNoBackPredFlag ( false ) 85 #endif 82 86 , m_uiTLayer ( 0 ) 83 87 , m_bTLayerSwitchingFlag ( false ) … … 111 115 #endif 112 116 { 117 #if L0034_COMBINED_LIST_CLEANUP 118 m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = 0; 119 #else 113 120 m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = m_aiNumRefIdx[2] = 0; 121 #endif 114 122 115 123 initEqualRef(); 116 124 125 #if L0034_COMBINED_LIST_CLEANUP 126 for ( Int idx = 0; idx < MAX_NUM_REF; idx++ ) 127 { 128 m_list1IdxToList0Idx[idx] = -1; 129 } 130 #else 117 131 for(Int iNumCount = 0; iNumCount < MAX_NUM_REF_LC; iNumCount++) 118 132 { … … 124 138 m_iRefIdxOfL1FromRefIdxOfL0[iNumCount] = -1; 125 139 } 140 #endif 126 141 for(Int iNumCount = 0; iNumCount < MAX_NUM_REF; iNumCount++) 127 142 { … … 135 150 #endif 136 151 } 137 resetWpScaling( m_weightPredTable);152 resetWpScaling(); 138 153 initWpAcDcParam(); 139 154 m_saoEnabledFlag = false; … … 156 171 m_colRefIdx = 0; 157 172 initEqualRef(); 173 #if !L0034_COMBINED_LIST_CLEANUP 158 174 m_bNoBackPredFlag = false; 159 175 m_bRefPicListCombinationFlag = false; 160 176 m_bRefPicListModificationFlagLC = false; 177 #endif 161 178 m_bCheckLDC = false; 162 179 m_iSliceQpDeltaCb = 0; 163 180 m_iSliceQpDeltaCr = 0; 164 181 182 #if !L0034_COMBINED_LIST_CLEANUP 165 183 m_aiNumRefIdx[REF_PIC_LIST_C] = 0; 184 #endif 166 185 167 186 m_maxNumMergeCand = MRG_MAX_NUM_CANDS; … … 177 196 Bool TComSlice::getRapPicFlag() 178 197 { 179 return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR 198 return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL 180 199 || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP 181 200 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP 182 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA NT183 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA 201 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL 202 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 184 203 || getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA; 185 204 } … … 251 270 252 271 253 TComPic* TComSlice::xGetLongTermRefPic (TComList<TComPic*>& rcListPic, 254 Int poc) 272 TComPic* TComSlice::xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb) 255 273 { 256 274 TComList<TComPic*>::iterator iterPic = rcListPic.begin(); 257 275 TComPic* pcPic = *(iterPic); 258 276 TComPic* pcStPic = pcPic; 277 278 Int pocCycle = 1 << getSPS()->getBitsForPOC(); 279 if (!pocHasMsb) 280 { 281 poc = poc % pocCycle; 282 } 283 259 284 while ( iterPic != rcListPic.end() ) 260 285 { 261 286 pcPic = *(iterPic); 262 if(pcPic && (pcPic->getPOC()%(1<<getSPS()->getBitsForPOC())) == (poc%(1<<getSPS()->getBitsForPOC()))) 287 if (pcPic && pcPic->getPOC()!=this->getPOC() && pcPic->getSlice( 0 )->isReferenced()) 288 { 289 Int picPoc = pcPic->getPOC(); 290 if (!pocHasMsb) 291 { 292 picPoc = picPoc % pocCycle; 293 } 294 295 if (poc == picPoc) 263 296 { 264 297 if(pcPic->getIsLongTerm()) … … 272 305 break; 273 306 } 307 } 274 308 275 309 iterPic++; 276 310 } 311 277 312 return pcStPic; 278 313 } … … 293 328 } 294 329 330 #if L0034_COMBINED_LIST_CLEANUP 331 Void TComSlice::setList1IdxToList0Idx() 332 { 333 Int idxL0, idxL1; 334 for ( idxL1 = 0; idxL1 < getNumRefIdx( REF_PIC_LIST_1 ); idxL1++ ) 335 { 336 m_list1IdxToList0Idx[idxL1] = -1; 337 for ( idxL0 = 0; idxL0 < getNumRefIdx( REF_PIC_LIST_0 ); idxL0++ ) 338 { 339 if ( m_apcRefPicList[REF_PIC_LIST_0][idxL0]->getPOC() == m_apcRefPicList[REF_PIC_LIST_1][idxL1]->getPOC() ) 340 { 341 m_list1IdxToList0Idx[idxL1] = idxL0; 342 break; 343 } 344 } 345 } 346 } 347 #else 295 348 Void TComSlice::generateCombinedList() 296 349 { … … 365 418 } 366 419 } 420 #endif 367 421 368 422 #if H_MV 369 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& refPicSetInterLayer ) 423 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr,std::vector<TComPic*>& refPicSetInterLayer ) 424 #else 425 #if FIX1071 426 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr ) 370 427 #else 371 428 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic ) 372 429 #endif 373 { 374 if (m_eSliceType == I_SLICE) 375 { 376 ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList)); 377 ::memset( m_aiNumRefIdx, 0, sizeof ( m_aiNumRefIdx )); 430 #endif 431 { 432 #if FIX1071 433 if (!checkNumPocTotalCurr) 434 #endif 435 { 436 if (m_eSliceType == I_SLICE) 437 { 438 ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList)); 439 ::memset( m_aiNumRefIdx, 0, sizeof ( m_aiNumRefIdx )); 440 441 return; 442 } 378 443 379 return;380 }381 382 444 #if !H_MV 383 m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0); 384 m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1); 385 #endif 445 m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0); 446 m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1); 447 #endif 448 } 386 449 387 450 TComPic* pcRefPic= NULL; … … 410 473 } 411 474 } 475 412 476 for(; i < m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures(); i++) 413 477 { … … 422 486 } 423 487 } 488 424 489 for(i = m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()+m_pcRPS->getNumberOfLongtermPictures()-1; i > m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()-1 ; i--) 425 490 { 426 491 if(m_pcRPS->getUsed(i)) 427 492 { 428 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i) );493 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i)); 429 494 pcRefPic->setIsLongTerm(1); 430 495 pcRefPic->getPicYuvRec()->extendPicBorder(); … … 434 499 if(pcRefPic==NULL) 435 500 { 436 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i) );501 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i)); 437 502 } 438 503 pcRefPic->setCheckLTMSBPresent(m_pcRPS->getCheckLTMSBPresent(i)); … … 448 513 Int numPocTotalCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr; 449 514 #endif 450 451 { 452 Int cIdx = 0; 453 for ( i=0; i<NumPocStCurr0; i++, cIdx++) 454 { 455 rpsCurrList0[cIdx] = RefPicSetStCurr0[i]; 456 } 457 for ( i=0; i<NumPocStCurr1; i++, cIdx++) 458 { 459 rpsCurrList0[cIdx] = RefPicSetStCurr1[i]; 460 } 461 for ( i=0; i<NumPocLtCurr; i++, cIdx++) 462 { 463 rpsCurrList0[cIdx] = RefPicSetLtCurr[i]; 464 } 515 #if FIX1071 516 if (checkNumPocTotalCurr) 517 { 518 // The variable NumPocTotalCurr is derived as specified in subclause 7.4.7.2. It is a requirement of bitstream conformance that the following applies to the value of NumPocTotalCurr: 519 // – If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0. 520 // – Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0. 521 if (getRapPicFlag()) 522 { 523 assert(numPocTotalCurr == 0); 524 } 525 526 if (m_eSliceType == I_SLICE) 527 { 528 ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList)); 529 ::memset( m_aiNumRefIdx, 0, sizeof ( m_aiNumRefIdx )); 530 531 return; 532 } 533 534 assert(numPocTotalCurr != 0); 535 536 m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0); 537 m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1); 538 } 539 #endif 540 541 Int cIdx = 0; 542 for ( i=0; i<NumPocStCurr0; i++, cIdx++) 543 { 544 rpsCurrList0[cIdx] = RefPicSetStCurr0[i]; 545 } 546 for ( i=0; i<NumPocStCurr1; i++, cIdx++) 547 { 548 rpsCurrList0[cIdx] = RefPicSetStCurr1[i]; 549 } 550 for ( i=0; i<NumPocLtCurr; i++, cIdx++) 551 { 552 rpsCurrList0[cIdx] = RefPicSetLtCurr[i]; 553 } 465 554 #if H_MV 466 for ( i=0; i<numDirectRefLayers; i++, cIdx++) 467 { 468 if( cIdx <= MAX_NUM_REF ) 469 { 470 rpsCurrList0[cIdx] = refPicSetInterLayer[i]; 471 } 472 } 473 #endif 474 } 555 for ( i=0; i<numDirectRefLayers; i++, cIdx++) 556 { 557 if( cIdx <= MAX_NUM_REF ) 558 { 559 rpsCurrList0[cIdx] = refPicSetInterLayer[i]; 560 } 561 } 562 #endif 475 563 476 564 if (m_eSliceType==B_SLICE) 477 565 { 478 IntcIdx = 0;566 cIdx = 0; 479 567 for ( i=0; i<NumPocStCurr1; i++, cIdx++) 480 568 { … … 585 673 } 586 674 587 Void TComSlice::checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA )675 Void TComSlice::checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA, TComList<TComPic *>& rcListPic) 588 676 { 589 677 for(Int i = 0; i < pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures(); i++) … … 598 686 if(pocCRA < MAX_UINT && getPOC() > pocCRA) 599 687 { 688 if (!pReferencePictureSet->getCheckLTMSBPresent(i)) 689 { 690 assert(xGetLongTermRefPic(rcListPic, pReferencePictureSet->getPOC(i), false)->getPOC() >= pocCRA); 691 } 692 else 693 { 600 694 assert(pReferencePictureSet->getPOC(i) >= pocCRA); 601 695 } 602 696 } 603 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) // IDR picture found 697 } 698 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) // IDR picture found 604 699 { 605 700 pocCRA = getPOC(); … … 611 706 prevRAPisBLA = false; 612 707 } 613 else if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA 614 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA NT708 else if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 709 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL 615 710 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP ) // BLA picture found 616 711 { … … 643 738 Int pocCurr = getPOC(); 644 739 645 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA 646 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA NT740 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 741 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL 647 742 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP 648 || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR 743 || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL 649 744 || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) // IDR or BLA picture 650 745 { … … 658 753 iterPic++; 659 754 } 660 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA 661 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA NT755 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 756 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL 662 757 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP ) 663 758 { … … 673 768 { 674 769 rpcPic = *(iterPic); 675 if (rpcPic->getPOC() != pocCurr && rpcPic->getPOC() != pocCRA) rpcPic->getSlice(0)->setReferenced(false); 770 if (rpcPic->getPOC() != pocCurr && rpcPic->getPOC() != pocCRA) 771 { 772 rpcPic->getSlice(0)->setReferenced(false); 773 } 676 774 iterPic++; 677 775 } … … 707 805 m_deblockingFilterTcOffsetDiv2 = pSrc->m_deblockingFilterTcOffsetDiv2; 708 806 807 #if L0034_COMBINED_LIST_CLEANUP 808 for (i = 0; i < 2; i++) 809 #else 709 810 for (i = 0; i < 3; i++) 811 #endif 710 812 { 711 813 m_aiNumRefIdx[i] = pSrc->m_aiNumRefIdx[i]; 712 814 } 713 815 816 #if L0034_COMBINED_LIST_CLEANUP 817 for (i = 0; i < MAX_NUM_REF; i++) 818 { 819 m_list1IdxToList0Idx[i] = pSrc->m_list1IdxToList0Idx[i]; 820 } 821 #else 714 822 for (i = 0; i < 2; i++) 715 823 { … … 728 836 m_bRefPicListModificationFlagLC = pSrc->m_bRefPicListModificationFlagLC; 729 837 m_bRefPicListCombinationFlag = pSrc->m_bRefPicListCombinationFlag; 838 #endif 730 839 m_bCheckLDC = pSrc->m_bCheckLDC; 731 840 m_iSliceQpDelta = pSrc->m_iSliceQpDelta; … … 785 894 } 786 895 896 #if !L0034_COMBINED_LIST_CLEANUP 787 897 m_bNoBackPredFlag = pSrc->m_bNoBackPredFlag; 898 #endif 788 899 m_uiTLayer = pSrc->m_uiTLayer; 789 900 m_bTLayerSwitchingFlag = pSrc->m_bTLayerSwitchingFlag; … … 819 930 820 931 Int TComSlice::m_prevPOC = 0; 932 821 933 /** Function for setting the slice's temporal layer ID and corresponding temporal_layer_switching_point_flag. 822 934 * \param uiTLayer Temporal layer ID of the current slice … … 879 991 Int i, isReference; 880 992 881 Int j = 0;882 993 // loop through all pictures in the reference picture buffer 883 994 TComList<TComPic*>::iterator iterPic = rcListPic.begin(); 884 995 while ( iterPic != rcListPic.end()) 885 996 { 886 j++;887 997 rpcPic = *(iterPic++); 998 999 if(!rpcPic->getSlice( 0 )->isReferenced()) 1000 { 1001 continue; 1002 } 888 1003 889 1004 isReference = 0; … … 924 1039 { 925 1040 rpcPic->getSlice( 0 )->setReferenced( false ); 1041 rpcPic->setUsedByCurr(0); 926 1042 rpcPic->setIsLongTerm(0); 927 1043 } … … 929 1045 assert(rpcPic->getSlice( 0 )->isReferenced()==0||rpcPic->getUsedByCurr()==0||rpcPic->getTLayer()<=this->getTLayer()); 930 1046 //check that pictures of higher or equal temporal layer are not in the RPS if the current picture is a TSA picture 931 if(this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TLA || this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N)1047 if(this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TLA_R || this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N) 932 1048 { 933 1049 assert(rpcPic->getSlice( 0 )->isReferenced()==0||rpcPic->getTLayer()<this->getTLayer()); 934 1050 } 935 936 1051 //check that pictures marked as temporal layer non-reference pictures are not used for reference 937 1052 if(rpcPic->getPicSym()->getSlice(0)->getPOC() != this->getPOC() && rpcPic->getTLayer()==this->getTLayer()) … … 947 1062 { 948 1063 TComPic* rpcPic; 949 Int i, isAvailable , j;1064 Int i, isAvailable; 950 1065 Int atLeastOneLost = 0; 951 1066 Int atLeastOneRemoved = 0; … … 956 1071 for(i=pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures();i<pReferencePictureSet->getNumberOfPictures();i++) 957 1072 { 958 j = 0;959 1073 isAvailable = 0; 960 1074 // loop through all pictures in the reference picture buffer … … 962 1076 while ( iterPic != rcListPic.end()) 963 1077 { 964 j++;965 1078 rpcPic = *(iterPic++); 966 1079 if(pReferencePictureSet->getCheckLTMSBPresent(i)==true) … … 985 1098 while ( iterPic != rcListPic.end()) 986 1099 { 987 j++;988 1100 rpcPic = *(iterPic++); 989 1101 990 if((rpcPic->getPicSym()->getSlice(0)->getPOC()%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC())) == (this->getPOC() + pReferencePictureSet->getDeltaPOC(i))%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC()) && rpcPic->getSlice(0)->isReferenced()) 1102 Int pocCycle = 1 << rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC(); 1103 Int curPoc = rpcPic->getPicSym()->getSlice(0)->getPOC(); 1104 Int refPoc = pReferencePictureSet->getPOC(i); 1105 if (!pReferencePictureSet->getCheckLTMSBPresent(i)) 1106 { 1107 curPoc = curPoc % pocCycle; 1108 refPoc = refPoc % pocCycle; 1109 } 1110 1111 if (rpcPic->getSlice(0)->isReferenced() && curPoc == refPoc) 991 1112 { 992 1113 isAvailable = 1; … … 1026 1147 for(i=0;i<pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures();i++) 1027 1148 { 1028 j = 0;1029 1149 isAvailable = 0; 1030 1150 // loop through all pictures in the reference picture buffer … … 1032 1152 while ( iterPic != rcListPic.end()) 1033 1153 { 1034 j++;1035 1154 rpcPic = *(iterPic++); 1036 1155 … … 1049 1168 { 1050 1169 if(printErrors) 1170 { 1051 1171 printf("\nShort-term reference picture with POC = %3d seems to have been removed or not correctly decoded.", this->getPOC() + pReferencePictureSet->getDeltaPOC(i)); 1172 } 1052 1173 atLeastOneRemoved = 1; 1053 1174 } … … 1055 1176 { 1056 1177 if(printErrors) 1178 { 1057 1179 printf("\nShort-term reference picture with POC = %3d is lost or not correctly decoded!", this->getPOC() + pReferencePictureSet->getDeltaPOC(i)); 1180 } 1058 1181 atLeastOneLost = 1; 1059 1182 iPocLost=this->getPOC() + pReferencePictureSet->getDeltaPOC(i); … … 1201 1324 * \returns Void 1202 1325 */ 1203 Void TComSlice::resetWpScaling( wpScalingParam wp[2][MAX_NUM_REF][3])1326 Void TComSlice::resetWpScaling() 1204 1327 { 1205 1328 for ( Int e=0 ; e<2 ; e++ ) … … 1209 1332 for ( Int yuv=0 ; yuv<3 ; yuv++ ) 1210 1333 { 1211 wpScalingParam *pwp = &( wp[e][i][yuv]);1334 wpScalingParam *pwp = &(m_weightPredTable[e][i][yuv]); 1212 1335 pwp->bPresentFlag = false; 1213 1336 pwp->uiLog2WeightDenom = 0; … … 1225 1348 Void TComSlice::initWpScaling() 1226 1349 { 1227 initWpScaling(m_weightPredTable);1228 }1229 1230 /** set WP tables1231 * \param wpScalingParam1232 * \returns Void1233 */1234 Void TComSlice::initWpScaling(wpScalingParam wp[2][MAX_NUM_REF][3])1235 {1236 1350 for ( Int e=0 ; e<2 ; e++ ) 1237 1351 { … … 1240 1354 for ( Int yuv=0 ; yuv<3 ; yuv++ ) 1241 1355 { 1242 wpScalingParam *pwp = &(wp[e][i][yuv]); 1243 if ( !pwp->bPresentFlag ) { 1356 wpScalingParam *pwp = &(m_weightPredTable[e][i][yuv]); 1357 if ( !pwp->bPresentFlag ) 1358 { 1244 1359 // Inferring values not present : 1245 1360 pwp->iWeight = (1 << pwp->uiLog2WeightDenom); … … 1275 1390 , m_cprmsPresentFlag (NULL) 1276 1391 { 1277 1278 1392 for( Int i = 0; i < MAX_TLAYER; i++) 1279 1393 { 1280 1394 m_numReorderPics[i] = 0; 1395 #if L0323_DPB 1396 m_uiMaxDecPicBuffering[i] = 1; 1397 #else 1281 1398 m_uiMaxDecPicBuffering[i] = 0; 1399 #endif 1282 1400 m_uiMaxLatencyIncrease[i] = 0; 1283 1401 } … … 1333 1451 TComVPS::~TComVPS() 1334 1452 { 1335 if( m_hrdParameters != NULL ) deletem_hrdParameters;1336 if( m_hrdOpSetIdx != NULL ) delete m_hrdOpSetIdx;1337 if( m_cprmsPresentFlag != NULL ) delete m_cprmsPresentFlag;1453 if( m_hrdParameters != NULL ) delete[] m_hrdParameters; 1454 if( m_hrdOpSetIdx != NULL ) delete[] m_hrdOpSetIdx; 1455 if( m_cprmsPresentFlag != NULL ) delete[] m_cprmsPresentFlag; 1338 1456 } 1339 1457 … … 1438 1556 , m_picWidthInLumaSamples (352) 1439 1557 , m_picHeightInLumaSamples (288) 1558 , m_log2MinCodingBlockSize ( 0) 1559 , m_log2DiffMaxMinCodingBlockSize (0) 1440 1560 , m_uiMaxCUWidth ( 32) 1441 1561 , m_uiMaxCUHeight ( 32) 1442 1562 , m_uiMaxCUDepth ( 3) 1443 , m_uiMinTrDepth ( 0)1444 , m_uiMaxTrDepth ( 1)1445 1563 , m_bLongTermRefsPresent (false) 1446 1564 , m_uiQuadtreeTULog2MaxSize ( 0) … … 1452 1570 , m_pcmLog2MaxSize ( 5) 1453 1571 , m_uiPCMLog2MinSize ( 7) 1572 #if !L0034_COMBINED_LIST_CLEANUP 1454 1573 , m_bUseLComb (false) 1574 #endif 1455 1575 , m_bitDepthY ( 8) 1456 1576 , m_bitDepthC ( 8) … … 1477 1597 { 1478 1598 m_uiMaxLatencyIncrease[i] = 0; 1599 #if L0323_DPB 1600 m_uiMaxDecPicBuffering[i] = 1; 1601 #else 1479 1602 m_uiMaxDecPicBuffering[i] = 0; 1603 #endif 1480 1604 m_numReorderPics[i] = 0; 1481 1605 } … … 1496 1620 m_RPSList.create(numRPS); 1497 1621 } 1622 1498 1623 Void TComSPS::setHrdParameters( UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess ) 1499 1624 { … … 1740 1865 return m_POC[bufferNum]; 1741 1866 } 1867 1742 1868 Void TComReferencePictureSet::setPOC(Int bufferNum, Int POC) 1743 1869 { 1744 1870 m_POC[bufferNum] = POC; 1745 1871 } 1872 1746 1873 Bool TComReferencePictureSet::getCheckLTMSBPresent(Int bufferNum) 1747 1874 { 1748 1875 return m_bCheckLTMSB[bufferNum]; 1749 1876 } 1877 1750 1878 Void TComReferencePictureSet::setCheckLTMSBPresent(Int bufferNum, Bool b) 1751 1879 { … … 2025 2153 ::memcpy(getScalingListAddress(sizeId, listId),((listId == refListId)? getScalingListDefaultAddress(sizeId, refListId): getScalingListAddress(sizeId, refListId)),sizeof(Int)*min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId])); 2026 2154 } 2155 2027 2156 /** parse syntax infomation 2028 2157 * \param pchFile syntax infomation … … 2117 2246 m_scalingListCoef[SCALING_LIST_32x32][3] = m_scalingListCoef[SCALING_LIST_32x32][1]; // copy address for 32x32 2118 2247 } 2248 2119 2249 /** destroy quantization matrix array 2120 2250 */ … … 2129 2259 } 2130 2260 } 2261 2131 2262 /** get default address of quantization matrix 2132 2263 * \param sizeId size index … … 2158 2289 return src; 2159 2290 } 2291 2160 2292 /** process of default matrix 2161 2293 * \param sizeId size index … … 2167 2299 setScalingListDC(sizeId,listId,SCALING_LIST_DC); 2168 2300 } 2301 2169 2302 /** check DC value of matrix for default matrix signaling 2170 2303 */ … … 2227 2360 //! activate a PPS and depending on isIDR parameter also SPS and VPS 2228 2361 //! \returns true, if activation is successful 2229 Bool ParameterSetManager::activatePPS(Int ppsId, Bool isI DR)2362 Bool ParameterSetManager::activatePPS(Int ppsId, Bool isIRAP) 2230 2363 { 2231 2364 TComPPS *pps = m_ppsMap.getPS(ppsId); … … 2236 2369 // active parameter sets per layer should be used here 2237 2370 #else 2238 if (!isI DR&& (spsId != m_activeSPSId))2239 { 2240 printf("Warning: tried to activate PPS referring to a inactive SPS at non-I DR.");2371 if (!isIRAP && (spsId != m_activeSPSId)) 2372 { 2373 printf("Warning: tried to activate PPS referring to a inactive SPS at non-IRAP."); 2241 2374 return false; 2242 2375 } … … 2246 2379 { 2247 2380 Int vpsId = sps->getVPSId(); 2248 if (!isI DR&& (vpsId != m_activeVPSId))2249 { 2250 printf("Warning: tried to activate PPS referring to a inactive VPS at non-I DR.");2381 if (!isIRAP && (vpsId != m_activeVPSId)) 2382 { 2383 printf("Warning: tried to activate PPS referring to a inactive VPS at non-IRAP."); 2251 2384 return false; 2252 2385 } … … 2307 2440 } 2308 2441 #endif 2309 2310 2442 #if SIGNAL_BITRATE_PICRATE_IN_VPS 2311 2443 TComBitRatePicRateInfo::TComBitRatePicRateInfo() -
branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/TComSlice.h
r331 r362 905 905 UInt m_picHeightInLumaSamples; 906 906 907 Window m_conformanceWindow;908 907 Int m_log2MinCodingBlockSize; 908 Int m_log2DiffMaxMinCodingBlockSize; 909 909 UInt m_uiMaxCUWidth; 910 910 UInt m_uiMaxCUHeight; 911 911 UInt m_uiMaxCUDepth; 912 UInt m_uiMinTrDepth; 913 UInt m_uiMaxTrDepth; 912 913 Window m_conformanceWindow; 914 914 915 TComRPSList m_RPSList; 915 916 Bool m_bLongTermRefsPresent; … … 927 928 Bool m_useAMP; 928 929 930 #if !L0034_COMBINED_LIST_CLEANUP 929 931 Bool m_bUseLComb; 932 #endif 930 933 931 934 // Parameter … … 1004 1007 Bool getUsedByCurrPicLtSPSFlag(Int i) {return m_usedByCurrPicLtSPSFlag[i];} 1005 1008 Void setUsedByCurrPicLtSPSFlag(Int i, Bool x) { m_usedByCurrPicLtSPSFlag[i] = x;} 1009 1010 Int getLog2MinCodingBlockSize() const { return m_log2MinCodingBlockSize; } 1011 Void setLog2MinCodingBlockSize(Int val) { m_log2MinCodingBlockSize = val; } 1012 Int getLog2DiffMaxMinCodingBlockSize() const { return m_log2DiffMaxMinCodingBlockSize; } 1013 Void setLog2DiffMaxMinCodingBlockSize(Int val) { m_log2DiffMaxMinCodingBlockSize = val; } 1014 1006 1015 Void setMaxCUWidth ( UInt u ) { m_uiMaxCUWidth = u; } 1007 1016 UInt getMaxCUWidth () { return m_uiMaxCUWidth; } … … 1020 1029 Bool getUseAMP() { return m_useAMP; } 1021 1030 Void setUseAMP( Bool b ) { m_useAMP = b; } 1022 Void setMinTrDepth ( UInt u ) { m_uiMinTrDepth = u; }1023 UInt getMinTrDepth () { return m_uiMinTrDepth; }1024 Void setMaxTrDepth ( UInt u ) { m_uiMaxTrDepth = u; }1025 UInt getMaxTrDepth () { return m_uiMaxTrDepth; }1026 1031 Void setQuadtreeTULog2MaxSize( UInt u ) { m_uiQuadtreeTULog2MaxSize = u; } 1027 1032 UInt getQuadtreeTULog2MaxSize() { return m_uiQuadtreeTULog2MaxSize; } … … 1045 1050 1046 1051 // Tool list 1052 #if !L0034_COMBINED_LIST_CLEANUP 1047 1053 Void setUseLComb (Bool b) { m_bUseLComb = b; } 1048 1054 Bool getUseLComb () { return m_bUseLComb; } 1055 #endif 1049 1056 1050 1057 Bool getUseLossless () { return m_useLossless; } … … 1130 1137 Void setRefPicSetIdxL1(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL1[idx] = refPicSetIdx; } 1131 1138 UInt getRefPicSetIdxL1(UInt idx) { return m_RefPicSetIdxL1[idx]; } 1132 1133 1139 #if H_MV 1134 1140 // Why not an listIdx for all members, would avoid code duplication?? … … 1367 1373 Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter 1368 1374 Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter 1369 1375 #if L0034_COMBINED_LIST_CLEANUP 1376 Int m_list1IdxToList0Idx[MAX_NUM_REF]; 1377 Int m_aiNumRefIdx [2]; // for multiple reference of current slice 1378 #else 1370 1379 Int m_aiNumRefIdx [3]; // for multiple reference of current slice 1371 1380 … … 1377 1386 Bool m_bRefPicListModificationFlagLC; 1378 1387 Bool m_bRefPicListCombinationFlag; 1388 #endif 1379 1389 1380 1390 Bool m_bCheckLDC; … … 1417 1427 1418 1428 Bool m_abEqualRef [2][MAX_NUM_REF][MAX_NUM_REF]; 1419 1429 #if !L0034_COMBINED_LIST_CLEANUP 1420 1430 Bool m_bNoBackPredFlag; 1431 #endif 1421 1432 UInt m_uiTLayer; 1422 1433 Bool m_bTLayerSwitchingFlag; … … 1526 1537 Bool getMvdL1ZeroFlag () { return m_bLMvdL1Zero; } 1527 1538 Int getNumRpsCurrTempList(); 1539 #if L0034_COMBINED_LIST_CLEANUP 1540 Int getList1IdxToList0Idx ( Int list1Idx ) { return m_list1IdxToList0Idx[list1Idx]; } 1541 #else 1528 1542 Int getRefIdxOfLC (RefPicList e, Int iRefIdx) { return m_iRefIdxOfLC[e][iRefIdx]; } 1529 1543 Int getListIdFromIdxOfLC(Int iRefIdx) { return m_eListIdFromIdxOfLC[iRefIdx]; } … … 1535 1549 Bool getRefPicListCombinationFlag() {return m_bRefPicListCombinationFlag;} 1536 1550 Void setRefPicListCombinationFlag(Bool bflag) {m_bRefPicListCombinationFlag=bflag;} 1551 #endif 1537 1552 Void setReferenced(Bool b) { m_bRefenced = b; } 1538 1553 Bool isReferenced() { return m_bRefenced; } 1539 1554 Void setPOC ( Int i ) { m_iPOC = i; if(getTLayer()==0) m_prevPOC=i; } 1540 1555 Void setNalUnitType ( NalUnitType e ) { m_eNalUnitType = e; } 1541 NalUnitType getNalUnitType () 1556 NalUnitType getNalUnitType () const { return m_eNalUnitType; } 1542 1557 Bool getRapPicFlag (); 1543 Bool getIdrPicFlag () { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; } 1544 Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA); 1558 Bool getIdrPicFlag () { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; } 1559 Bool isIRAP () const { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); } 1560 Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA, TComList<TComPic *>& rcListPic); 1545 1561 Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic); 1546 1562 Void setSliceType ( SliceType e ) { m_eSliceType = e; } … … 1568 1584 #endif 1569 1585 #if H_MV 1570 Void setRefPicList ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& interLayerRefPicSet ); 1586 Void setRefPicList ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false , std::vector<TComPic*>& interLayerRefPicSet ); 1587 #else 1588 #if FIX1071 1589 Void setRefPicList ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false ); 1571 1590 #else 1572 1591 Void setRefPicList ( TComList<TComPic*>& rcListPic ); 1592 #endif 1593 1573 1594 #endif 1574 1595 Void setRefPOCList (); … … 1604 1625 1605 1626 static Void sortPicList ( TComList<TComPic*>& rcListPic ); 1606 1627 #if L0034_COMBINED_LIST_CLEANUP 1628 Void setList1IdxToList0Idx(); 1629 #else 1607 1630 Bool getNoBackPredFlag() { return m_bNoBackPredFlag; } 1608 1631 Void setNoBackPredFlag( Bool b ) { m_bNoBackPredFlag = b; } 1609 1632 Void generateCombinedList (); 1633 #endif 1610 1634 1611 1635 UInt getTLayer () { return m_uiTLayer; } … … 1665 1689 Void getWpScaling ( RefPicList e, Int iRefIdx, wpScalingParam *&wp); 1666 1690 1667 Void resetWpScaling (wpScalingParam wp[2][MAX_NUM_REF][3]); 1668 Void initWpScaling (wpScalingParam wp[2][MAX_NUM_REF][3]); 1691 Void resetWpScaling (); 1669 1692 Void initWpScaling (); 1670 1693 inline Bool applyWP () { return( (m_eSliceType==P_SLICE && m_pcPPS->getUseWP()) || (m_eSliceType==B_SLICE && m_pcPPS->getWPBiPred()) ); } … … 1712 1735 #endif 1713 1736 #endif 1714 1715 1737 protected: 1716 1738 TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, 1717 1739 Int poc); 1718 TComPic* xGetLongTermRefPic (TComList<TComPic*>& rcListPic, 1719 Int poc); 1740 TComPic* xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb); 1720 1741 #if H_MV 1721 1742 TComPic* xGetInterLayerRefPic( std::vector<TComPic*>& rcListIlPic, Int layerId ); … … 1804 1825 //! activate a PPS and depending on isIDR parameter also SPS and VPS 1805 1826 //! \returns true, if activation is successful 1806 Bool activatePPS(Int ppsId, Bool isI DR);1827 Bool activatePPS(Int ppsId, Bool isIRAP); 1807 1828 1808 1829 TComVPS* getActiveVPS(){ return m_vpsMap.getPS(m_activeVPSId); }; -
branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/TComTrQuant.cpp
r324 r362 1986 1986 } 1987 1987 1988 if(pi QCoef[minPos] == 32767 || piQCoef[minPos] == -32768)1988 if(piDstCoeff[minPos] == 32767 || piDstCoeff[minPos] == -32768) 1989 1989 { 1990 1990 finalChange = -1; -
branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/TypeDef.h
r324 r362 49 49 #endif 50 50 51 ///// ***** HM 10.0 ********* 52 51 ///// ***** HM 10.1 ********* 52 #define FIX1071 1 ///< Temporary fix for issue #1071 53 54 #define L0208_SOP_DESCRIPTION_SEI 1 ///< L0208: add SOP descrioption SEI 55 #define MAX_NUM_PICS_IN_SOP 1024 56 57 #define K0180_SCALABLE_NESTING_SEI 1 ///JCTVC-K0180 scalable nesting sei message 58 #define MAX_NESTING_NUM_OPS 1024 59 #define MAX_NESTING_NUM_LAYER 64 60 61 #define J0149_TONE_MAPPING_SEI 1 ///< J0149: Tone mapping information SEI 53 62 #define L0363_DU_BIT_RATE 1 ///< L0363: add bit_rate_du_value_minus1 to HRD parameters 54 63 #define L0328_SPLICING 1 ///< L0328: splicing support in HRD … … 75 84 #define SIGNAL_BITRATE_PICRATE_IN_VPS 0 ///< K0125: Signal bit_rate and pic_rate in VPS 76 85 #define L0232_RD_PENALTY 1 ///< L0232: RD-penalty for 32x32 TU for intra in non-intra slices 86 #define L0386_DB_METRIC 1 ///< L0386: non-normative blockiness metric (automatically configures deblocking parameters in bitstream) 87 #define L0323_DPB 1 ///< L0323: Specification of active reference indices and decoded picture buffer 88 89 #define L0034_COMBINED_LIST_CLEANUP 1 77 90 78 91 #define MAX_VPS_NUM_HRD_PARAMETERS 1 … … 412 425 REF_PIC_LIST_0 = 0, ///< reference list 0 413 426 REF_PIC_LIST_1 = 1, ///< reference list 1 427 #if !L0034_COMBINED_LIST_CLEANUP 414 428 REF_PIC_LIST_C = 2, ///< combined reference list for uni-prediction in B-Slices 429 #endif 415 430 REF_PIC_LIST_X = 100 ///< special mark 416 431 };
Note: See TracChangeset for help on using the changeset viewer.