Changeset 133 in SHVCSoftware for branches/SHM-2.0-dev/source/Lib/TLibCommon
- Timestamp:
- 28 Apr 2013, 08:49:16 (12 years ago)
- Location:
- branches/SHM-2.0-dev/source/Lib/TLibCommon
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-2.0-dev/source/Lib/TLibCommon/CommonDef.h
r125 r133 56 56 // ==================================================================================================================== 57 57 58 #define NV_VERSION " 1.2" ///< Current software version58 #define NV_VERSION "2.0" ///< Current software version 59 59 60 60 // ==================================================================================================================== … … 110 110 #define MAX_NUM_REF_PICS 16 ///< max. number of pictures used for reference 111 111 #define MAX_NUM_REF 16 ///< max. number of entries in picture reference list 112 #if !L0034_COMBINED_LIST_CLEANUP 112 113 #define MAX_NUM_REF_LC MAX_NUM_REF_PICS // TODO: remove this macro definition (leftover from combined list concept) 114 #endif 113 115 114 116 #define MAX_UINT 0xFFFFFFFFU ///< max. value of unsigned 32-bit integer … … 197 199 198 200 NAL_UNIT_CODED_SLICE_TSA_N, // 2 199 NAL_UNIT_CODED_SLICE_TLA , // 3 // Current name in the spec: TSA_R201 NAL_UNIT_CODED_SLICE_TLA_R, // 3 200 202 201 203 NAL_UNIT_CODED_SLICE_STSA_N, // 4 … … 203 205 204 206 NAL_UNIT_CODED_SLICE_RADL_N, // 6 205 NAL_UNIT_CODED_SLICE_ DLP, // 7 // Current name in the spec: RADL_R207 NAL_UNIT_CODED_SLICE_RADL_R, // 7 206 208 207 209 NAL_UNIT_CODED_SLICE_RASL_N, // 8 208 NAL_UNIT_CODED_SLICE_ TFD, // 9 // Current name in the spec: RASL_R209 210 NAL_UNIT_RESERVED_ 10,211 NAL_UNIT_RESERVED_ 11,212 NAL_UNIT_RESERVED_ 12,213 NAL_UNIT_RESERVED_ 13,214 NAL_UNIT_RESERVED_ 14,215 NAL_UNIT_RESERVED_ 15,216 217 NAL_UNIT_CODED_SLICE_BLA , // 16 // Current name in the spec: BLA_W_LP218 NAL_UNIT_CODED_SLICE_BLA NT, // 17 // Current name in the spec: BLA_W_DLP210 NAL_UNIT_CODED_SLICE_RASL_R, // 9 211 212 NAL_UNIT_RESERVED_VCL_N10, 213 NAL_UNIT_RESERVED_VCL_R11, 214 NAL_UNIT_RESERVED_VCL_N12, 215 NAL_UNIT_RESERVED_VCL_R13, 216 NAL_UNIT_RESERVED_VCL_N14, 217 NAL_UNIT_RESERVED_VCL_R15, 218 219 NAL_UNIT_CODED_SLICE_BLA_W_LP, // 16 220 NAL_UNIT_CODED_SLICE_BLA_W_RADL, // 17 219 221 NAL_UNIT_CODED_SLICE_BLA_N_LP, // 18 220 NAL_UNIT_CODED_SLICE_IDR , // 19 // Current name in the spec: IDR_W_DLP222 NAL_UNIT_CODED_SLICE_IDR_W_RADL, // 19 221 223 NAL_UNIT_CODED_SLICE_IDR_N_LP, // 20 222 224 NAL_UNIT_CODED_SLICE_CRA, // 21 223 NAL_UNIT_RESERVED_ 22,224 NAL_UNIT_RESERVED_ 23,225 226 NAL_UNIT_RESERVED_ 24,227 NAL_UNIT_RESERVED_ 25,228 NAL_UNIT_RESERVED_ 26,229 NAL_UNIT_RESERVED_ 27,230 NAL_UNIT_RESERVED_ 28,231 NAL_UNIT_RESERVED_ 29,232 NAL_UNIT_RESERVED_ 30,233 NAL_UNIT_RESERVED_ 31,225 NAL_UNIT_RESERVED_IRAP_VCL22, 226 NAL_UNIT_RESERVED_IRAP_VCL23, 227 228 NAL_UNIT_RESERVED_VCL24, 229 NAL_UNIT_RESERVED_VCL25, 230 NAL_UNIT_RESERVED_VCL26, 231 NAL_UNIT_RESERVED_VCL27, 232 NAL_UNIT_RESERVED_VCL28, 233 NAL_UNIT_RESERVED_VCL29, 234 NAL_UNIT_RESERVED_VCL30, 235 NAL_UNIT_RESERVED_VCL31, 234 236 235 237 NAL_UNIT_VPS, // 32 … … 240 242 NAL_UNIT_EOB, // 37 241 243 NAL_UNIT_FILLER_DATA, // 38 242 NAL_UNIT_ SEI, // 39 Prefix SEI243 NAL_UNIT_S EI_SUFFIX, // 40 Suffix SEI244 NAL_UNIT_RESERVED_ 41,245 NAL_UNIT_RESERVED_ 42,246 NAL_UNIT_RESERVED_ 43,247 NAL_UNIT_RESERVED_ 44,248 NAL_UNIT_RESERVED_ 45,249 NAL_UNIT_RESERVED_ 46,250 NAL_UNIT_RESERVED_ 47,244 NAL_UNIT_PREFIX_SEI, // 39 245 NAL_UNIT_SUFFIX_SEI, // 40 246 NAL_UNIT_RESERVED_NVCL41, 247 NAL_UNIT_RESERVED_NVCL42, 248 NAL_UNIT_RESERVED_NVCL43, 249 NAL_UNIT_RESERVED_NVCL44, 250 NAL_UNIT_RESERVED_NVCL45, 251 NAL_UNIT_RESERVED_NVCL46, 252 NAL_UNIT_RESERVED_NVCL47, 251 253 NAL_UNIT_UNSPECIFIED_48, 252 254 NAL_UNIT_UNSPECIFIED_49, -
branches/SHM-2.0-dev/source/Lib/TLibCommon/NAL.h
r125 r133 76 76 return m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_R 77 77 || m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_N 78 || m_nalUnitType == NAL_UNIT_CODED_SLICE_TLA 78 || m_nalUnitType == NAL_UNIT_CODED_SLICE_TLA_R 79 79 || m_nalUnitType == NAL_UNIT_CODED_SLICE_TSA_N 80 80 || m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA_R 81 81 || m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA_N 82 || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA 83 || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA NT82 || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP 83 || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL 84 84 || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP 85 || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR 85 || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL 86 86 || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP 87 87 || m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA 88 88 || m_nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N 89 || m_nalUnitType == NAL_UNIT_CODED_SLICE_ DLP89 || m_nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R 90 90 || m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N 91 || m_nalUnitType == NAL_UNIT_CODED_SLICE_ TFD;91 || m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R; 92 92 } 93 93 #if L0045_NON_NESTED_SEI_RESTRICTIONS 94 94 Bool isSei() 95 95 { 96 return m_nalUnitType == NAL_UNIT_ SEI97 || m_nalUnitType == NAL_UNIT_S EI_SUFFIX;96 return m_nalUnitType == NAL_UNIT_PREFIX_SEI 97 || m_nalUnitType == NAL_UNIT_SUFFIX_SEI; 98 98 } 99 99 -
branches/SHM-2.0-dev/source/Lib/TLibCommon/SEI.cpp
r127 r133 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/SHM-2.0-dev/source/Lib/TLibCommon/SEI.h
r125 r133 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/SHM-2.0-dev/source/Lib/TLibCommon/TComBitStream.cpp
r125 r133 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/SHM-2.0-dev/source/Lib/TLibCommon/TComBitStream.h
r125 r133 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/SHM-2.0-dev/source/Lib/TLibCommon/TComLoopFilter.cpp
r125 r133 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/SHM-2.0-dev/source/Lib/TLibCommon/TComLoopFilter.h
r125 r133 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/SHM-2.0-dev/source/Lib/TLibCommon/TComPic.cpp
r125 r133 559 559 } 560 560 561 Void TComPic:: 561 Void TComPic::copyUpsampledPictureYuv(TComPicYuv* pcPicYuvIn, TComPicYuv* pcPicYuvOut) 562 562 { 563 563 Int upsampledRowWidthLuma = pcPicYuvOut->getStride(); // 2 * pcPicYuvOut->getLumaMargin() + pcPicYuvOut->getWidth(); -
branches/SHM-2.0-dev/source/Lib/TLibCommon/TComPicYuv.cpp
r125 r133 60 60 m_piPicOrgU = NULL; 61 61 m_piPicOrgV = NULL; 62 62 63 m_bIsBorderExtended = false; 63 64 } -
branches/SHM-2.0-dev/source/Lib/TLibCommon/TComPrediction.cpp
r125 r133 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/SHM-2.0-dev/source/Lib/TLibCommon/TComRom.cpp
r125 r133 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/SHM-2.0-dev/source/Lib/TLibCommon/TComSlice.cpp
r125 r133 54 54 , m_iPOC ( 0 ) 55 55 , m_iLastIDR ( 0 ) 56 , m_eNalUnitType ( NAL_UNIT_CODED_SLICE_IDR )56 , m_eNalUnitType ( NAL_UNIT_CODED_SLICE_IDR_W_RADL ) 57 57 , m_eSliceType ( I_SLICE ) 58 58 , m_iSliceQp ( 0 ) … … 65 65 , m_deblockingFilterBetaOffsetDiv2 ( 0 ) 66 66 , m_deblockingFilterTcOffsetDiv2 ( 0 ) 67 #if !L0034_COMBINED_LIST_CLEANUP 67 68 , m_bRefPicListModificationFlagLC ( false ) 68 69 , m_bRefPicListCombinationFlag ( false ) 70 #endif 69 71 , m_bCheckLDC ( false ) 70 72 , m_iSliceQpDelta ( 0 ) … … 84 86 , m_dLambda ( 0.0 ) 85 87 #endif 86 , m_bNoBackPredFlag ( false ) 88 #if !L0034_COMBINED_LIST_CLEANUP 89 , m_bNoBackPredFlag ( false ) 90 #endif 87 91 , m_uiTLayer ( 0 ) 88 92 #if SVC_EXTENSION … … 113 117 , m_enableTMVPFlag ( true ) 114 118 { 119 #if L0034_COMBINED_LIST_CLEANUP 120 m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = 0; 121 #else 115 122 m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = m_aiNumRefIdx[2] = 0; 123 #endif 116 124 117 125 #if REF_LIST_BUGFIX … … 120 128 initEqualRef(); 121 129 130 #if L0034_COMBINED_LIST_CLEANUP 131 for ( Int idx = 0; idx < MAX_NUM_REF; idx++ ) 132 { 133 m_list1IdxToList0Idx[idx] = -1; 134 } 135 #else 122 136 for(Int iNumCount = 0; iNumCount < MAX_NUM_REF_LC; iNumCount++) 123 137 { … … 129 143 m_iRefIdxOfL1FromRefIdxOfL0[iNumCount] = -1; 130 144 } 145 #endif 131 146 for(Int iNumCount = 0; iNumCount < MAX_NUM_REF; iNumCount++) 132 147 { … … 136 151 m_aiRefPOCList [1][iNumCount] = 0; 137 152 } 138 resetWpScaling( m_weightPredTable);153 resetWpScaling(); 139 154 initWpAcDcParam(); 140 155 m_saoEnabledFlag = false; … … 173 188 m_colRefIdx = 0; 174 189 initEqualRef(); 190 #if !L0034_COMBINED_LIST_CLEANUP 175 191 m_bNoBackPredFlag = false; 176 192 m_bRefPicListCombinationFlag = false; 177 193 m_bRefPicListModificationFlagLC = false; 194 #endif 178 195 m_bCheckLDC = false; 179 196 m_iSliceQpDeltaCb = 0; 180 197 m_iSliceQpDeltaCr = 0; 181 198 199 #if !L0034_COMBINED_LIST_CLEANUP 182 200 m_aiNumRefIdx[REF_PIC_LIST_C] = 0; 201 #endif 183 202 184 203 m_maxNumMergeCand = MRG_MAX_NUM_CANDS; … … 194 213 Bool TComSlice::getRapPicFlag() 195 214 { 196 return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR 215 return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL 197 216 || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP 198 217 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP 199 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA NT200 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA 218 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL 219 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 201 220 || getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA; 202 221 } … … 213 232 } 214 233 215 Void TComSlice::sortPicList 234 Void TComSlice::sortPicList(TComList<TComPic*>& rcListPic) 216 235 { 217 236 TComPic* pcPicExtract; … … 268 287 269 288 270 TComPic* TComSlice::xGetLongTermRefPic (TComList<TComPic*>& rcListPic, 271 Int poc) 289 TComPic* TComSlice::xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb) 272 290 { 273 291 TComList<TComPic*>::iterator iterPic = rcListPic.begin(); 274 292 TComPic* pcPic = *(iterPic); 275 293 TComPic* pcStPic = pcPic; 294 295 Int pocCycle = 1 << getSPS()->getBitsForPOC(); 296 if (!pocHasMsb) 297 { 298 poc = poc % pocCycle; 299 } 300 276 301 while ( iterPic != rcListPic.end() ) 277 302 { 278 303 pcPic = *(iterPic); 279 if(pcPic && (pcPic->getPOC()%(1<<getSPS()->getBitsForPOC())) == (poc%(1<<getSPS()->getBitsForPOC()))) 280 { 281 if(pcPic->getIsLongTerm()) 304 if (pcPic && pcPic->getPOC()!=this->getPOC() && pcPic->getSlice( 0 )->isReferenced()) 305 { 306 Int picPoc = pcPic->getPOC(); 307 if (!pocHasMsb) 308 { 309 picPoc = picPoc % pocCycle; 310 } 311 312 if (poc == picPoc) 313 { 314 if (pcPic->getIsLongTerm()) 282 315 { 283 316 return pcPic; … … 289 322 break; 290 323 } 324 } 291 325 292 326 iterPic++; 293 327 } 328 294 329 return pcStPic; 295 330 } 296 331 297 Void TComSlice::setRefPOCList 332 Void TComSlice::setRefPOCList() 298 333 { 299 334 for (Int iDir = 0; iDir < 2; iDir++) … … 307 342 } 308 343 344 #if L0034_COMBINED_LIST_CLEANUP 345 Void TComSlice::setList1IdxToList0Idx() 346 { 347 Int idxL0, idxL1; 348 for ( idxL1 = 0; idxL1 < getNumRefIdx( REF_PIC_LIST_1 ); idxL1++ ) 349 { 350 m_list1IdxToList0Idx[idxL1] = -1; 351 for ( idxL0 = 0; idxL0 < getNumRefIdx( REF_PIC_LIST_0 ); idxL0++ ) 352 { 353 if ( m_apcRefPicList[REF_PIC_LIST_0][idxL0]->getPOC() == m_apcRefPicList[REF_PIC_LIST_1][idxL1]->getPOC() ) 354 { 355 m_list1IdxToList0Idx[idxL1] = idxL0; 356 break; 357 } 358 } 359 } 360 } 361 #else 309 362 Void TComSlice::generateCombinedList() 310 363 { … … 369 422 } 370 423 } 371 372 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic) 373 { 424 #endif 425 426 #if FIX1071 427 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr ) 428 #else 429 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic ) 430 #endif 431 { 432 #if FIX1071 433 if (!checkNumPocTotalCurr) 434 #endif 435 { 374 436 #if REF_IDX_FRAMEWORK 375 437 if( m_eSliceType == I_SLICE || ( getSPS()->getLayerId() && 376 (getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA ) &&438 (getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && 377 439 (getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) ) ) 378 440 #else … … 388 450 m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0); 389 451 m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1); 452 } 390 453 391 454 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)); … … 443 508 TComPic* rpsCurrList1[MAX_NUM_REF+1]; 444 509 Int numPocTotalCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr; 445 446 { 510 #if FIX1071 511 if (checkNumPocTotalCurr) 512 { 513 // 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: 514 // – If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0. 515 // – Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0. 516 if (getRapPicFlag()) 517 { 518 assert(numPocTotalCurr == 0); 519 } 520 521 if (m_eSliceType == I_SLICE) 522 { 523 ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList)); 524 ::memset( m_aiNumRefIdx, 0, sizeof ( m_aiNumRefIdx )); 525 526 return; 527 } 528 529 assert(numPocTotalCurr != 0); 530 531 m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0); 532 m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1); 533 } 534 #endif 535 447 536 Int cIdx = 0; 448 537 for ( i=0; i<NumPocStCurr0; i++, cIdx++) … … 458 547 rpsCurrList0[cIdx] = RefPicSetLtCurr[i]; 459 548 } 460 }461 549 462 550 if (m_eSliceType==B_SLICE) 463 551 { 464 IntcIdx = 0;552 cIdx = 0; 465 553 for ( i=0; i<NumPocStCurr1; i++, cIdx++) 466 554 { … … 509 597 } 510 598 511 if(this->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA && this->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) 599 if(this->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && this->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) 600 { 512 601 return; 602 } 513 603 514 604 TComRefPicListModification* refPicListModification = this->getRefPicListModification(); … … 589 679 590 680 //temporal reference pictures 591 if( !(getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA && getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) )681 if( !(getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) ) 592 682 { 593 683 for(i=0; i < m_pcRPS->getNumberOfNegativePictures(); i++) … … 619 709 if(m_pcRPS->getUsed(i)) 620 710 { 621 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i) );711 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i)); 622 712 pcRefPic->setIsLongTerm(1); 623 713 pcRefPic->getPicYuvRec()->extendPicBorder(); … … 627 717 if(pcRefPic==NULL) 628 718 { 629 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i) );719 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i)); 630 720 } 631 721 pcRefPic->setCheckLTMSBPresent(m_pcRPS->getCheckLTMSBPresent(i)); … … 636 726 #if REF_IDX_MFM 637 727 assert(m_aiNumILRRefIdx == 1); 638 if(!(getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA && getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) && getSPS()->getMFMEnabledFlag())728 if(!(getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) && getSPS()->getMFMEnabledFlag()) 639 729 { 640 730 ilpPic[0]->copyUpsampledMvField(getBaseColPic()); … … 672 762 { 673 763 for ( i=0; i<NumPocStCurr0 && cIdx<numRpsCurrTempList0; cIdx++,i++) 674 refPicListTemp0[cIdx] = RefPicSetStCurr0[ i ]; 675 for ( i=0; i<NumPocStCurr1 && cIdx<numRpsCurrTempList0; cIdx++,i++) 676 refPicListTemp0[cIdx] = RefPicSetStCurr1[ i ]; 677 for ( i=0; i<NumPocLtCurr && cIdx<numRpsCurrTempList0; cIdx++,i++) 764 { 765 refPicListTemp0[cIdx] = RefPicSetStCurr0[ i ]; 766 } 767 for ( i=0; i<NumPocStCurr1 && cIdx<numRpsCurrTempList0; cIdx++,i++) 768 { 769 refPicListTemp0[cIdx] = RefPicSetStCurr1[ i ]; 770 } 771 for ( i=0; i<NumPocLtCurr && cIdx<numRpsCurrTempList0; cIdx++,i++) 772 { 678 773 refPicListTemp0[cIdx] = RefPicSetLtCurr[ i ]; 774 } 679 775 for ( i=0; i<m_aiNumILRRefIdx && cIdx<numRpsCurrTempList0; cIdx++,i++) 776 { 680 777 refPicListTemp0[cIdx] = ilpPic[ i ]; 778 } 681 779 } 682 780 cIdx = 0; 683 781 while (cIdx<numRpsCurrTempList1 && m_eSliceType==B_SLICE) 684 782 { 685 for ( i=0; i<NumPocStCurr1 && cIdx<numRpsCurrTempList1; cIdx++,i++) 783 for ( i=0; i<NumPocStCurr1 && cIdx<numRpsCurrTempList1; cIdx++,i++) 784 { 686 785 refPicListTemp1[cIdx] = RefPicSetStCurr1[ i ]; 687 for ( i=0; i<NumPocStCurr0 && cIdx<numRpsCurrTempList1; cIdx++,i++) 688 refPicListTemp1[cIdx] = RefPicSetStCurr0[ i ]; 689 for ( i=0; i<NumPocLtCurr && cIdx<numRpsCurrTempList1; cIdx++,i++) 786 } 787 for ( i=0; i<NumPocStCurr0 && cIdx<numRpsCurrTempList1; cIdx++,i++) 788 { 789 refPicListTemp1[cIdx] = RefPicSetStCurr0[ i ]; 790 } 791 for ( i=0; i<NumPocLtCurr && cIdx<numRpsCurrTempList1; cIdx++,i++) 792 { 690 793 refPicListTemp1[cIdx] = RefPicSetLtCurr[ i ]; 794 } 691 795 for ( i=0; i<m_aiNumILRRefIdx && cIdx<numRpsCurrTempList1; cIdx++,i++) 796 { 692 797 refPicListTemp1[cIdx] = ilpPic[ i ]; 798 } 693 799 } 694 800 ::memset(m_bIsUsedAsLongTerm, 0, sizeof(m_bIsUsedAsLongTerm)); … … 724 830 #if REF_IDX_FRAMEWORK 725 831 if( m_eSliceType == I_SLICE || ( getSPS()->getLayerId() && 726 (getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA ) &&832 (getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && 727 833 (getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) ) ) 728 834 #else … … 793 899 } 794 900 795 Void TComSlice::checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA )901 Void TComSlice::checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA, TComList<TComPic *>& rcListPic) 796 902 { 797 903 for(Int i = 0; i < pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures(); i++) … … 806 912 if(pocCRA < MAX_UINT && getPOC() > pocCRA) 807 913 { 914 if (!pReferencePictureSet->getCheckLTMSBPresent(i)) 915 { 916 assert(xGetLongTermRefPic(rcListPic, pReferencePictureSet->getPOC(i), false)->getPOC() >= pocCRA); 917 } 918 else 919 { 808 920 assert(pReferencePictureSet->getPOC(i) >= pocCRA); 809 921 } 810 922 } 811 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) // IDR picture found 923 } 924 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) // IDR picture found 812 925 { 813 926 pocCRA = getPOC(); … … 819 932 prevRAPisBLA = false; 820 933 } 821 else if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA 822 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA NT934 else if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 935 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL 823 936 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP ) // BLA picture found 824 937 { … … 851 964 Int pocCurr = getPOC(); 852 965 853 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA 854 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA NT966 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 967 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL 855 968 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP 856 || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR 969 || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL 857 970 || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) // IDR or BLA picture 858 971 { … … 866 979 iterPic++; 867 980 } 868 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA 869 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA NT981 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 982 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL 870 983 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP ) 871 984 { … … 881 994 { 882 995 rpcPic = *(iterPic); 883 if (rpcPic->getPOC() != pocCurr && rpcPic->getPOC() != pocCRA) rpcPic->getSlice(0)->setReferenced(false); 996 if (rpcPic->getPOC() != pocCurr && rpcPic->getPOC() != pocCRA) 997 { 998 rpcPic->getSlice(0)->setReferenced(false); 999 } 884 1000 iterPic++; 885 1001 } … … 912 1028 m_deblockingFilterTcOffsetDiv2 = pSrc->m_deblockingFilterTcOffsetDiv2; 913 1029 1030 #if L0034_COMBINED_LIST_CLEANUP 1031 for (i = 0; i < 2; i++) 1032 #else 914 1033 for (i = 0; i < 3; i++) 1034 #endif 915 1035 { 916 1036 m_aiNumRefIdx[i] = pSrc->m_aiNumRefIdx[i]; 917 1037 } 918 1038 1039 #if L0034_COMBINED_LIST_CLEANUP 1040 for (i = 0; i < MAX_NUM_REF; i++) 1041 { 1042 m_list1IdxToList0Idx[i] = pSrc->m_list1IdxToList0Idx[i]; 1043 } 1044 #else 919 1045 for (i = 0; i < 2; i++) 920 1046 { … … 933 1059 m_bRefPicListModificationFlagLC = pSrc->m_bRefPicListModificationFlagLC; 934 1060 m_bRefPicListCombinationFlag = pSrc->m_bRefPicListCombinationFlag; 1061 #endif 935 1062 m_bCheckLDC = pSrc->m_bCheckLDC; 936 1063 m_iSliceQpDelta = pSrc->m_iSliceQpDelta; … … 984 1111 } 985 1112 1113 #if !L0034_COMBINED_LIST_CLEANUP 986 1114 m_bNoBackPredFlag = pSrc->m_bNoBackPredFlag; 1115 #endif 987 1116 m_uiTLayer = pSrc->m_uiTLayer; 988 1117 m_bTLayerSwitchingFlag = pSrc->m_bTLayerSwitchingFlag; … … 1018 1147 1019 1148 Int TComSlice::m_prevPOC = 0; 1149 1020 1150 /** Function for setting the slice's temporal layer ID and corresponding temporal_layer_switching_point_flag. 1021 1151 * \param uiTLayer Temporal layer ID of the current slice … … 1078 1208 Int i, isReference; 1079 1209 1080 Int j = 0;1081 1210 // loop through all pictures in the reference picture buffer 1082 1211 TComList<TComPic*>::iterator iterPic = rcListPic.begin(); 1083 1212 while ( iterPic != rcListPic.end()) 1084 1213 { 1085 j++;1086 1214 rpcPic = *(iterPic++); 1215 1216 if(!rpcPic->getSlice( 0 )->isReferenced()) 1217 { 1218 continue; 1219 } 1087 1220 1088 1221 isReference = 0; … … 1123 1256 { 1124 1257 rpcPic->getSlice( 0 )->setReferenced( false ); 1258 rpcPic->setUsedByCurr(0); 1125 1259 rpcPic->setIsLongTerm(0); 1126 1260 } … … 1128 1262 assert(rpcPic->getSlice( 0 )->isReferenced()==0||rpcPic->getUsedByCurr()==0||rpcPic->getTLayer()<=this->getTLayer()); 1129 1263 //check that pictures of higher or equal temporal layer are not in the RPS if the current picture is a TSA picture 1130 if(this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TLA || this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N)1264 if(this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TLA_R || this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N) 1131 1265 { 1132 1266 assert(rpcPic->getSlice( 0 )->isReferenced()==0||rpcPic->getTLayer()<this->getTLayer()); … … 1145 1279 { 1146 1280 TComPic* rpcPic; 1147 Int i, isAvailable , j;1281 Int i, isAvailable; 1148 1282 Int atLeastOneLost = 0; 1149 1283 Int atLeastOneRemoved = 0; … … 1154 1288 for(i=pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures();i<pReferencePictureSet->getNumberOfPictures();i++) 1155 1289 { 1156 j = 0;1157 1290 isAvailable = 0; 1158 1291 // loop through all pictures in the reference picture buffer … … 1160 1293 while ( iterPic != rcListPic.end()) 1161 1294 { 1162 j++;1163 1295 rpcPic = *(iterPic++); 1164 1296 if(pReferencePictureSet->getCheckLTMSBPresent(i)==true) … … 1183 1315 while ( iterPic != rcListPic.end()) 1184 1316 { 1185 j++;1186 1317 rpcPic = *(iterPic++); 1187 1318 1188 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()) 1319 Int pocCycle = 1 << rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC(); 1320 Int curPoc = rpcPic->getPicSym()->getSlice(0)->getPOC(); 1321 Int refPoc = pReferencePictureSet->getPOC(i); 1322 if (!pReferencePictureSet->getCheckLTMSBPresent(i)) 1323 { 1324 curPoc = curPoc % pocCycle; 1325 refPoc = refPoc % pocCycle; 1326 } 1327 1328 if (rpcPic->getSlice(0)->isReferenced() && curPoc == refPoc) 1189 1329 { 1190 1330 isAvailable = 1; … … 1224 1364 for(i=0;i<pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures();i++) 1225 1365 { 1226 j = 0;1227 1366 isAvailable = 0; 1228 1367 // loop through all pictures in the reference picture buffer … … 1230 1369 while ( iterPic != rcListPic.end()) 1231 1370 { 1232 j++;1233 1371 rpcPic = *(iterPic++); 1234 1372 … … 1247 1385 { 1248 1386 if(printErrors) 1387 { 1249 1388 printf("\nShort-term reference picture with POC = %3d seems to have been removed or not correctly decoded.", this->getPOC() + pReferencePictureSet->getDeltaPOC(i)); 1389 } 1250 1390 atLeastOneRemoved = 1; 1251 1391 } … … 1253 1393 { 1254 1394 if(printErrors) 1395 { 1255 1396 printf("\nShort-term reference picture with POC = %3d is lost or not correctly decoded!", this->getPOC() + pReferencePictureSet->getDeltaPOC(i)); 1397 } 1256 1398 atLeastOneLost = 1; 1257 1399 iPocLost=this->getPOC() + pReferencePictureSet->getDeltaPOC(i); … … 1399 1541 * \returns Void 1400 1542 */ 1401 Void TComSlice::resetWpScaling( wpScalingParam wp[2][MAX_NUM_REF][3])1543 Void TComSlice::resetWpScaling() 1402 1544 { 1403 1545 for ( Int e=0 ; e<2 ; e++ ) … … 1407 1549 for ( Int yuv=0 ; yuv<3 ; yuv++ ) 1408 1550 { 1409 wpScalingParam *pwp = &( wp[e][i][yuv]);1551 wpScalingParam *pwp = &(m_weightPredTable[e][i][yuv]); 1410 1552 pwp->bPresentFlag = false; 1411 1553 pwp->uiLog2WeightDenom = 0; … … 1423 1565 Void TComSlice::initWpScaling() 1424 1566 { 1425 initWpScaling(m_weightPredTable);1426 }1427 1428 /** set WP tables1429 * \param wpScalingParam1430 * \returns Void1431 */1432 Void TComSlice::initWpScaling(wpScalingParam wp[2][MAX_NUM_REF][3])1433 {1434 1567 for ( Int e=0 ; e<2 ; e++ ) 1435 1568 { … … 1438 1571 for ( Int yuv=0 ; yuv<3 ; yuv++ ) 1439 1572 { 1440 wpScalingParam *pwp = &(wp[e][i][yuv]); 1441 if ( !pwp->bPresentFlag ) { 1573 wpScalingParam *pwp = &(m_weightPredTable[e][i][yuv]); 1574 if ( !pwp->bPresentFlag ) 1575 { 1442 1576 // Inferring values not present : 1443 1577 pwp->iWeight = (1 << pwp->uiLog2WeightDenom); … … 1482 1616 { 1483 1617 m_numReorderPics[i] = 0; 1618 #if L0323_DPB 1619 m_uiMaxDecPicBuffering[i] = 1; 1620 #else 1484 1621 m_uiMaxDecPicBuffering[i] = 0; 1622 #endif 1485 1623 m_uiMaxLatencyIncrease[i] = 0; 1486 1624 } … … 1516 1654 TComVPS::~TComVPS() 1517 1655 { 1518 if( m_hrdParameters != NULL ) delete m_hrdParameters;1519 if( m_hrdOpSetIdx != NULL ) delete m_hrdOpSetIdx;1520 if( m_cprmsPresentFlag != NULL ) delete m_cprmsPresentFlag;1656 if( m_hrdParameters != NULL ) delete[] m_hrdParameters; 1657 if( m_hrdOpSetIdx != NULL ) delete[] m_hrdOpSetIdx; 1658 if( m_cprmsPresentFlag != NULL ) delete[] m_cprmsPresentFlag; 1521 1659 } 1522 1660 … … 1533 1671 , m_picWidthInLumaSamples (352) 1534 1672 , m_picHeightInLumaSamples (288) 1673 , m_log2MinCodingBlockSize ( 0) 1674 , m_log2DiffMaxMinCodingBlockSize (0) 1535 1675 , m_uiMaxCUWidth ( 32) 1536 1676 , m_uiMaxCUHeight ( 32) 1537 1677 , m_uiMaxCUDepth ( 3) 1538 , m_uiMinTrDepth ( 0)1539 , m_uiMaxTrDepth ( 1)1540 1678 , m_bLongTermRefsPresent (false) 1541 1679 , m_uiQuadtreeTULog2MaxSize ( 0) … … 1547 1685 , m_pcmLog2MaxSize ( 5) 1548 1686 , m_uiPCMLog2MinSize ( 7) 1687 #if !L0034_COMBINED_LIST_CLEANUP 1549 1688 , m_bUseLComb (false) 1689 #endif 1550 1690 , m_bitDepthY ( 8) 1551 1691 , m_bitDepthC ( 8) … … 1572 1712 { 1573 1713 m_uiMaxLatencyIncrease[i] = 0; 1714 #if L0323_DPB 1715 m_uiMaxDecPicBuffering[i] = 1; 1716 #else 1574 1717 m_uiMaxDecPicBuffering[i] = 0; 1718 #endif 1575 1719 m_numReorderPics[i] = 0; 1576 1720 } … … 1591 1735 m_RPSList.create(numRPS); 1592 1736 } 1737 1593 1738 Void TComSPS::setHrdParameters( UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess ) 1594 1739 { … … 1835 1980 return m_POC[bufferNum]; 1836 1981 } 1982 1837 1983 Void TComReferencePictureSet::setPOC(Int bufferNum, Int POC) 1838 1984 { 1839 1985 m_POC[bufferNum] = POC; 1840 1986 } 1987 1841 1988 Bool TComReferencePictureSet::getCheckLTMSBPresent(Int bufferNum) 1842 1989 { 1843 1990 return m_bCheckLTMSB[bufferNum]; 1844 1991 } 1992 1845 1993 Void TComReferencePictureSet::setCheckLTMSBPresent(Int bufferNum, Bool b) 1846 1994 { … … 2022 2170 return (defaultCounter == (SCALING_LIST_NUM * SCALING_LIST_SIZE_NUM - 4)) ? false : true; // -4 for 32x32 2023 2171 } 2172 2024 2173 /** get scaling matrix from RefMatrixID 2025 2174 * \param sizeId size index … … 2031 2180 ::memcpy(getScalingListAddress(sizeId, listId),((listId == refListId)? getScalingListDefaultAddress(sizeId, refListId): getScalingListAddress(sizeId, refListId)),sizeof(Int)*min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId])); 2032 2181 } 2182 2033 2183 /** parse syntax infomation 2034 2184 * \param pchFile syntax infomation … … 2123 2273 m_scalingListCoef[SCALING_LIST_32x32][3] = m_scalingListCoef[SCALING_LIST_32x32][1]; // copy address for 32x32 2124 2274 } 2275 2125 2276 /** destroy quantization matrix array 2126 2277 */ … … 2135 2286 } 2136 2287 } 2288 2137 2289 /** get default address of quantization matrix 2138 2290 * \param sizeId size index … … 2164 2316 return src; 2165 2317 } 2318 2166 2319 /** process of default matrix 2167 2320 * \param sizeId size index … … 2173 2326 setScalingListDC(sizeId,listId,SCALING_LIST_DC); 2174 2327 } 2328 2175 2329 /** check DC value of matrix for default matrix signaling 2176 2330 */ … … 2240 2394 //! activate a PPS and depending on isIDR parameter also SPS and VPS 2241 2395 //! \returns true, if activation is successful 2242 Bool ParameterSetManager::activatePPS(Int ppsId, Bool isI DR)2396 Bool ParameterSetManager::activatePPS(Int ppsId, Bool isIRAP) 2243 2397 { 2244 2398 TComPPS *pps = m_ppsMap.getPS(ppsId); … … 2246 2400 { 2247 2401 Int spsId = pps->getSPSId(); 2248 if (!isI DR&& (spsId != m_activeSPSId))2249 { 2250 printf("Warning: tried to activate PPS referring to a inactive SPS at non-I DR.");2402 if (!isIRAP && (spsId != m_activeSPSId)) 2403 { 2404 printf("Warning: tried to activate PPS referring to a inactive SPS at non-IRAP."); 2251 2405 return false; 2252 2406 } … … 2255 2409 { 2256 2410 Int vpsId = sps->getVPSId(); 2257 if (!isI DR&& (vpsId != m_activeVPSId))2258 { 2259 printf("Warning: tried to activate PPS referring to a inactive VPS at non-I DR.");2411 if (!isIRAP && (vpsId != m_activeVPSId)) 2412 { 2413 printf("Warning: tried to activate PPS referring to a inactive VPS at non-IRAP."); 2260 2414 return false; 2261 2415 } … … 2403 2557 assert(iRefPicNum == 1); 2404 2558 #if RAP_MFM_INIT 2405 if(!(getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA && getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) && getSPS()->getMFMEnabledFlag())2559 if(!(getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) && getSPS()->getMFMEnabledFlag()) 2406 2560 #else 2407 2561 if( getPOC() != 0 ) -
branches/SHM-2.0-dev/source/Lib/TLibCommon/TComSlice.h
r125 r133 908 908 UInt m_picHeightInLumaSamples; 909 909 910 Window m_conformanceWindow;911 910 Int m_log2MinCodingBlockSize; 911 Int m_log2DiffMaxMinCodingBlockSize; 912 912 UInt m_uiMaxCUWidth; 913 913 UInt m_uiMaxCUHeight; 914 914 UInt m_uiMaxCUDepth; 915 UInt m_uiMinTrDepth; 916 UInt m_uiMaxTrDepth; 915 916 Window m_conformanceWindow; 917 917 918 TComRPSList m_RPSList; 918 919 Bool m_bLongTermRefsPresent; … … 930 931 Bool m_useAMP; 931 932 933 #if !L0034_COMBINED_LIST_CLEANUP 932 934 Bool m_bUseLComb; 935 #endif 933 936 934 937 // Parameter … … 1009 1012 Bool getUsedByCurrPicLtSPSFlag(Int i) {return m_usedByCurrPicLtSPSFlag[i];} 1010 1013 Void setUsedByCurrPicLtSPSFlag(Int i, Bool x) { m_usedByCurrPicLtSPSFlag[i] = x;} 1014 1015 Int getLog2MinCodingBlockSize() const { return m_log2MinCodingBlockSize; } 1016 Void setLog2MinCodingBlockSize(Int val) { m_log2MinCodingBlockSize = val; } 1017 Int getLog2DiffMaxMinCodingBlockSize() const { return m_log2DiffMaxMinCodingBlockSize; } 1018 Void setLog2DiffMaxMinCodingBlockSize(Int val) { m_log2DiffMaxMinCodingBlockSize = val; } 1019 1011 1020 Void setMaxCUWidth ( UInt u ) { m_uiMaxCUWidth = u; } 1012 1021 UInt getMaxCUWidth () { return m_uiMaxCUWidth; } … … 1025 1034 Bool getUseAMP() { return m_useAMP; } 1026 1035 Void setUseAMP( Bool b ) { m_useAMP = b; } 1027 Void setMinTrDepth ( UInt u ) { m_uiMinTrDepth = u; }1028 UInt getMinTrDepth () { return m_uiMinTrDepth; }1029 Void setMaxTrDepth ( UInt u ) { m_uiMaxTrDepth = u; }1030 UInt getMaxTrDepth () { return m_uiMaxTrDepth; }1031 1036 Void setQuadtreeTULog2MaxSize( UInt u ) { m_uiQuadtreeTULog2MaxSize = u; } 1032 1037 UInt getQuadtreeTULog2MaxSize() { return m_uiQuadtreeTULog2MaxSize; } … … 1050 1055 1051 1056 // Tool list 1057 #if !L0034_COMBINED_LIST_CLEANUP 1052 1058 Void setUseLComb (Bool b) { m_bUseLComb = b; } 1053 1059 Bool getUseLComb () { return m_bUseLComb; } 1060 #endif 1054 1061 1055 1062 Bool getUseLossless () { return m_useLossless; } … … 1370 1377 Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter 1371 1378 Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter 1372 1373 Int m_aiNumRefIdx [3]; // for multiple reference of current slice1374 1375 1379 #if REF_LIST_BUGFIX 1376 1380 Int m_aiNumILRRefIdx; //< for inter-layer reference picture ser 1377 1381 #endif 1378 1382 #if L0034_COMBINED_LIST_CLEANUP 1383 Int m_list1IdxToList0Idx[MAX_NUM_REF]; 1384 Int m_aiNumRefIdx [2]; // for multiple reference of current slice 1385 #else 1386 Int m_aiNumRefIdx [3]; // for multiple reference of current slice 1379 1387 Int m_iRefIdxOfLC[2][MAX_NUM_REF_LC]; 1380 1388 Int m_eListIdFromIdxOfLC[MAX_NUM_REF_LC]; … … 1384 1392 Bool m_bRefPicListModificationFlagLC; 1385 1393 Bool m_bRefPicListCombinationFlag; 1394 #endif 1386 1395 1387 1396 Bool m_bCheckLDC; … … 1421 1430 1422 1431 Bool m_abEqualRef [2][MAX_NUM_REF][MAX_NUM_REF]; 1423 1432 #if !L0034_COMBINED_LIST_CLEANUP 1424 1433 Bool m_bNoBackPredFlag; 1434 #endif 1425 1435 UInt m_uiTLayer; 1426 1436 #if SVC_EXTENSION … … 1533 1543 Bool getMvdL1ZeroFlag () { return m_bLMvdL1Zero; } 1534 1544 Int getNumRpsCurrTempList(); 1545 #if L0034_COMBINED_LIST_CLEANUP 1546 Int getList1IdxToList0Idx ( Int list1Idx ) { return m_list1IdxToList0Idx[list1Idx]; } 1547 #else 1535 1548 Int getRefIdxOfLC (RefPicList e, Int iRefIdx) { return m_iRefIdxOfLC[e][iRefIdx]; } 1536 1549 Int getListIdFromIdxOfLC(Int iRefIdx) { return m_eListIdFromIdxOfLC[iRefIdx]; } … … 1542 1555 Bool getRefPicListCombinationFlag() {return m_bRefPicListCombinationFlag;} 1543 1556 Void setRefPicListCombinationFlag(Bool bflag) {m_bRefPicListCombinationFlag=bflag;} 1557 #endif 1544 1558 Void setReferenced(Bool b) { m_bRefenced = b; } 1545 1559 Bool isReferenced() { return m_bRefenced; } 1546 1560 Void setPOC ( Int i ) { m_iPOC = i; if(getTLayer()==0) m_prevPOC=i; } 1547 1561 Void setNalUnitType ( NalUnitType e ) { m_eNalUnitType = e; } 1548 NalUnitType getNalUnitType () 1562 NalUnitType getNalUnitType () const { return m_eNalUnitType; } 1549 1563 Bool getRapPicFlag (); 1550 Bool getIdrPicFlag () { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; } 1551 Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA); 1564 Bool getIdrPicFlag () { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; } 1565 Bool isIRAP () const { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); } 1566 Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA, TComList<TComPic *>& rcListPic); 1552 1567 Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic); 1553 1568 Void setSliceType ( SliceType e ) { m_eSliceType = e; } … … 1590 1605 #endif 1591 1606 1607 #if FIX1071 1608 Void setRefPicList ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false ); 1609 #else 1592 1610 Void setRefPicList ( TComList<TComPic*>& rcListPic ); 1611 #endif 1593 1612 Void setRefPOCList (); 1594 1613 Void setColFromL0Flag ( UInt colFromL0 ) { m_colFromL0Flag = colFromL0; } … … 1628 1647 1629 1648 static Void sortPicList ( TComList<TComPic*>& rcListPic ); 1630 1649 #if L0034_COMBINED_LIST_CLEANUP 1650 Void setList1IdxToList0Idx(); 1651 #else 1631 1652 Bool getNoBackPredFlag() { return m_bNoBackPredFlag; } 1632 1653 Void setNoBackPredFlag( Bool b ) { m_bNoBackPredFlag = b; } 1633 1654 Void generateCombinedList (); 1655 #endif 1634 1656 1635 1657 UInt getTLayer () { return m_uiTLayer; } … … 1679 1701 Void getWpScaling ( RefPicList e, Int iRefIdx, wpScalingParam *&wp); 1680 1702 1681 Void resetWpScaling (wpScalingParam wp[2][MAX_NUM_REF][3]); 1682 Void initWpScaling (wpScalingParam wp[2][MAX_NUM_REF][3]); 1703 Void resetWpScaling (); 1683 1704 Void initWpScaling (); 1684 1705 inline Bool applyWP () { return( (m_eSliceType==P_SLICE && m_pcPPS->getUseWP()) || (m_eSliceType==B_SLICE && m_pcPPS->getWPBiPred()) ); } … … 1720 1741 TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, 1721 1742 Int poc); 1722 TComPic* xGetLongTermRefPic (TComList<TComPic*>& rcListPic, 1723 Int poc); 1743 TComPic* xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb); 1724 1744 };// END CLASS DEFINITION TComSlice 1725 1745 … … 1805 1825 //! activate a PPS and depending on isIDR parameter also SPS and VPS 1806 1826 //! \returns true, if activation is successful 1807 Bool activatePPS(Int ppsId, Bool isI DR);1827 Bool activatePPS(Int ppsId, Bool isIRAP); 1808 1828 1809 1829 TComVPS* getActiveVPS(){ return m_vpsMap.getPS(m_activeVPSId); }; -
branches/SHM-2.0-dev/source/Lib/TLibCommon/TComTrQuant.cpp
r125 r133 2007 2007 } 2008 2008 2009 if(pi QCoef[minPos] == 32767 || piQCoef[minPos] == -32768)2009 if(piDstCoeff[minPos] == 32767 || piDstCoeff[minPos] == -32768) 2010 2010 { 2011 2011 finalChange = -1; -
branches/SHM-2.0-dev/source/Lib/TLibCommon/TypeDef.h
r125 r133 65 65 66 66 #define AVC_BASE 0 ///< YUV BL reading for AVC base SVC 67 #define REF_IDX_FRAMEWORK 0///< inter-layer reference framework67 #define REF_IDX_FRAMEWORK 1 ///< inter-layer reference framework 68 68 69 69 #if SVC_UPSAMPLING … … 114 114 //! \ingroup TLibCommon 115 115 //! \{ 116 117 #define FIX1071 1 ///< Temporary fix for issue #1071 118 119 #define L0208_SOP_DESCRIPTION_SEI 1 ///< L0208: add SOP descrioption SEI 120 #define MAX_NUM_PICS_IN_SOP 1024 121 122 #define K0180_SCALABLE_NESTING_SEI 1 ///JCTVC-K0180 scalable nesting sei message 123 #define MAX_NESTING_NUM_OPS 1024 124 #define MAX_NESTING_NUM_LAYER 64 125 126 #define J0149_TONE_MAPPING_SEI 1 ///< J0149: Tone mapping information SEI 116 127 #define L0363_DU_BIT_RATE 1 ///< L0363: add bit_rate_du_value_minus1 to HRD parameters 117 128 #define L0328_SPLICING 1 ///< L0328: splicing support in HRD … … 138 149 #define SIGNAL_BITRATE_PICRATE_IN_VPS 0 ///< K0125: Signal bit_rate and pic_rate in VPS 139 150 #define L0232_RD_PENALTY 1 ///< L0232: RD-penalty for 32x32 TU for intra in non-intra slices 151 #define L0386_DB_METRIC 1 ///< L0386: non-normative blockiness metric (automatically configures deblocking parameters in bitstream) 152 #define L0323_DPB 1 ///< L0323: Specification of active reference indices and decoded picture buffer 153 154 #define L0034_COMBINED_LIST_CLEANUP 1 140 155 141 156 #if VPS_EXTN_MASK_AND_DIM_INFO … … 477 492 REF_PIC_LIST_0 = 0, ///< reference list 0 478 493 REF_PIC_LIST_1 = 1, ///< reference list 1 494 #if !L0034_COMBINED_LIST_CLEANUP 479 495 REF_PIC_LIST_C = 2, ///< combined reference list for uni-prediction in B-Slices 496 #endif 480 497 REF_PIC_LIST_X = 100 ///< special mark 481 498 };
Note: See TracChangeset for help on using the changeset viewer.