Changeset 438 in 3DVCSoftware for branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon
- Timestamp:
- 23 May 2013, 15:40:36 (12 years ago)
- Location:
- branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/CommonDef.h
r403 r438 57 57 58 58 #if H_MV 59 #define NV_VERSION "0. 2" ///< Current software version60 #define HM_VERSION "10. 1" ///<61 #else 62 #define NV_VERSION "10. 1" ///< Current software version59 #define NV_VERSION "0.1" ///< Current software version 60 #define HM_VERSION "10.0" ///< 61 #else 62 #define NV_VERSION "10.0" ///< 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_CLEANUP118 117 #define MAX_NUM_REF_LC MAX_NUM_REF_PICS // TODO: remove this macro definition (leftover from combined list concept) 119 #endif120 118 121 119 #define MAX_UINT 0xFFFFFFFFU ///< max. value of unsigned 32-bit integer … … 138 136 template <typename T> inline T ClipY(T x) { return std::min<T>(T((1 << g_bitDepthY)-1), std::max<T>( T(0), x)); } 139 137 template <typename T> inline T ClipC(T x) { return std::min<T>(T((1 << g_bitDepthC)-1), std::max<T>( T(0), x)); } 138 139 template <typename T> inline T Clip(T x) { return std::min<T>(T((1 << g_bitDepthY)-1), std::max<T>( T(0), x)); } 140 140 141 141 /** clip a, such that minVal <= a <= maxVal */ … … 168 168 169 169 #endif 170 170 171 171 172 // ==================================================================================================================== … … 215 216 216 217 NAL_UNIT_CODED_SLICE_TSA_N, // 2 217 NAL_UNIT_CODED_SLICE_TLA _R, // 3218 NAL_UNIT_CODED_SLICE_TLA, // 3 // Current name in the spec: TSA_R 218 219 219 220 NAL_UNIT_CODED_SLICE_STSA_N, // 4 … … 221 222 222 223 NAL_UNIT_CODED_SLICE_RADL_N, // 6 223 NAL_UNIT_CODED_SLICE_ RADL_R, // 7224 NAL_UNIT_CODED_SLICE_DLP, // 7 // Current name in the spec: RADL_R 224 225 225 226 NAL_UNIT_CODED_SLICE_RASL_N, // 8 226 NAL_UNIT_CODED_SLICE_ RASL_R, // 9227 228 NAL_UNIT_RESERVED_ VCL_N10,229 NAL_UNIT_RESERVED_ VCL_R11,230 NAL_UNIT_RESERVED_ VCL_N12,231 NAL_UNIT_RESERVED_ VCL_R13,232 NAL_UNIT_RESERVED_ VCL_N14,233 NAL_UNIT_RESERVED_ VCL_R15,234 235 NAL_UNIT_CODED_SLICE_BLA _W_LP, // 16236 NAL_UNIT_CODED_SLICE_BLA _W_RADL, // 17227 NAL_UNIT_CODED_SLICE_TFD, // 9 // Current name in the spec: RASL_R 228 229 NAL_UNIT_RESERVED_10, 230 NAL_UNIT_RESERVED_11, 231 NAL_UNIT_RESERVED_12, 232 NAL_UNIT_RESERVED_13, 233 NAL_UNIT_RESERVED_14, 234 NAL_UNIT_RESERVED_15, 235 236 NAL_UNIT_CODED_SLICE_BLA, // 16 // Current name in the spec: BLA_W_LP 237 NAL_UNIT_CODED_SLICE_BLANT, // 17 // Current name in the spec: BLA_W_DLP 237 238 NAL_UNIT_CODED_SLICE_BLA_N_LP, // 18 238 NAL_UNIT_CODED_SLICE_IDR _W_RADL, // 19239 NAL_UNIT_CODED_SLICE_IDR, // 19 // Current name in the spec: IDR_W_DLP 239 240 NAL_UNIT_CODED_SLICE_IDR_N_LP, // 20 240 241 NAL_UNIT_CODED_SLICE_CRA, // 21 241 NAL_UNIT_RESERVED_ IRAP_VCL22,242 NAL_UNIT_RESERVED_ IRAP_VCL23,243 244 NAL_UNIT_RESERVED_ VCL24,245 NAL_UNIT_RESERVED_ VCL25,246 NAL_UNIT_RESERVED_ VCL26,247 NAL_UNIT_RESERVED_ VCL27,248 NAL_UNIT_RESERVED_ VCL28,249 NAL_UNIT_RESERVED_ VCL29,250 NAL_UNIT_RESERVED_ VCL30,251 NAL_UNIT_RESERVED_ VCL31,242 NAL_UNIT_RESERVED_22, 243 NAL_UNIT_RESERVED_23, 244 245 NAL_UNIT_RESERVED_24, 246 NAL_UNIT_RESERVED_25, 247 NAL_UNIT_RESERVED_26, 248 NAL_UNIT_RESERVED_27, 249 NAL_UNIT_RESERVED_28, 250 NAL_UNIT_RESERVED_29, 251 NAL_UNIT_RESERVED_30, 252 NAL_UNIT_RESERVED_31, 252 253 253 254 NAL_UNIT_VPS, // 32 … … 258 259 NAL_UNIT_EOB, // 37 259 260 NAL_UNIT_FILLER_DATA, // 38 260 NAL_UNIT_ PREFIX_SEI, // 39261 NAL_UNIT_S UFFIX_SEI, // 40262 NAL_UNIT_RESERVED_ NVCL41,263 NAL_UNIT_RESERVED_ NVCL42,264 NAL_UNIT_RESERVED_ NVCL43,265 NAL_UNIT_RESERVED_ NVCL44,266 NAL_UNIT_RESERVED_ NVCL45,267 NAL_UNIT_RESERVED_ NVCL46,268 NAL_UNIT_RESERVED_ NVCL47,261 NAL_UNIT_SEI, // 39 Prefix SEI 262 NAL_UNIT_SEI_SUFFIX, // 40 Suffix SEI 263 NAL_UNIT_RESERVED_41, 264 NAL_UNIT_RESERVED_42, 265 NAL_UNIT_RESERVED_43, 266 NAL_UNIT_RESERVED_44, 267 NAL_UNIT_RESERVED_45, 268 NAL_UNIT_RESERVED_46, 269 NAL_UNIT_RESERVED_47, 269 270 NAL_UNIT_UNSPECIFIED_48, 270 271 NAL_UNIT_UNSPECIFIED_49, -
branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/NAL.h
r368 r438 47 47 NalUnitType m_nalUnitType; ///< nal_unit_type 48 48 UInt m_temporalId; ///< temporal_id 49 49 50 #if H_MV 50 51 Int m_layerId; ///< layer id … … 79 80 return m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_R 80 81 || m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_N 81 || m_nalUnitType == NAL_UNIT_CODED_SLICE_TLA _R82 || m_nalUnitType == NAL_UNIT_CODED_SLICE_TLA 82 83 || m_nalUnitType == NAL_UNIT_CODED_SLICE_TSA_N 83 84 || m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA_R 84 85 || m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA_N 85 || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA _W_LP86 || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA _W_RADL86 || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA 87 || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLANT 87 88 || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP 88 || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR _W_RADL89 || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR 89 90 || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP 90 91 || m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA 91 92 || m_nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N 92 || m_nalUnitType == NAL_UNIT_CODED_SLICE_ RADL_R93 || m_nalUnitType == NAL_UNIT_CODED_SLICE_DLP 93 94 || m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N 94 || m_nalUnitType == NAL_UNIT_CODED_SLICE_ RASL_R;95 || m_nalUnitType == NAL_UNIT_CODED_SLICE_TFD; 95 96 } 96 97 #if L0045_NON_NESTED_SEI_RESTRICTIONS 97 98 Bool isSei() 98 99 { 99 return m_nalUnitType == NAL_UNIT_ PREFIX_SEI100 || m_nalUnitType == NAL_UNIT_S UFFIX_SEI;100 return m_nalUnitType == NAL_UNIT_SEI 101 || m_nalUnitType == NAL_UNIT_SEI_SUFFIX; 101 102 } 102 103 -
branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/SEI.cpp
r362 r438 38 38 #include "CommonDef.h" 39 39 #include "SEI.h" 40 41 #if J0149_TONE_MAPPING_SEI42 //Table D-7 Meaning of camera iso sensitivity indicator and exposure index rating indicator43 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 #endif45 40 46 41 SEIMessages getSeisByType(SEIMessages &seiList, SEI::PayloadType seiType) -
branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/SEI.h
r362 r438 355 355 }; 356 356 357 #if L0208_SOP_DESCRIPTION_SEI358 class SEISOPDescription : public SEI359 {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 #endif375 376 #if J0149_TONE_MAPPING_SEI377 class SEIToneMappingInfo : public SEI378 {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 #endif410 411 357 typedef std::list<SEI*> SEIMessages; 412 358 … … 420 366 Void deleteSEIs (SEIMessages &seiList); 421 367 422 #if K0180_SCALABLE_NESTING_SEI423 class SEIScalableNesting : public SEI424 {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 != 0440 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 == 0445 UInt m_nestingNoOpMaxTemporalIdPlus1; //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0446 UInt m_nestingNumLayersMinus1; //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0447 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 values448 449 Bool m_callerOwnsSEIs;450 SEIMessages m_nestedSEIs;451 };452 #endif453 454 368 //! \} -
branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComBitStream.cpp
r362 r438 177 177 } 178 178 } 179 180 179 Void TComOutputBitstream::writeByteAlignment() 181 180 { … … 183 182 writeAlignZero(); 184 183 } 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 do194 {195 // find the next emulated 00 00 {00,01,02,03}196 // NB, end()-1, prevents finding a trailing two byte sequence197 found = search_n(found, rbsp.end()-1, 2, 0);198 found++;199 // if not found, found == end, otherwise found = second zero byte200 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 218 184 /** 219 185 * read #uiNumberOfBits# from bitstream without updating the bitstream -
branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComBitStream.h
r362 r438 154 154 Void addSubstream ( TComOutputBitstream* pcSubstream ); 155 155 Void writeByteAlignment(); 156 157 //! returns the number of start code emulations contained in the current buffer158 Int countStartCodeEmulations();159 156 }; 160 157 … … 166 163 { 167 164 std::vector<uint8_t> *m_fifo; /// FIFO for storage of complete bytes 168 std::vector<UInt> m_emulationPreventionByteLocation;169 165 170 166 protected: … … 210 206 UInt getNumBitsRead() { return m_numBitsRead; } 211 207 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; }219 208 }; 220 209 -
branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComDataCU.cpp
r364 r438 3200 3200 Bool bIsCurrRefLongTerm = m_pcSlice->getRefPic( eRefPicList, iRefIdx)->getIsLongTerm(); 3201 3201 Bool bIsNeibRefLongTerm = false; 3202 3202 3203 //--------------- V1 (END) ------------------// 3203 3204 if( pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) >= 0) -
branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComLoopFilter.cpp
r362 r438 57 57 // ==================================================================================================================== 58 58 59 const UChar TComLoopFilter::sm_tcTable[54] =59 const UChar tctable_8x8[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 TComLoopFilter::sm_betaTable[52] =64 const UChar betatable_8x8[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 = sm_tcTable[iIndexTC]*iBitdepthScale;588 Int iBeta = sm_betaTable[iIndexB]*iBitdepthScale;587 Int iTc = tctable_8x8[iIndexTC]*iBitdepthScale; 588 Int iBeta = betatable_8x8[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 = sm_tcTable[iIndexTC]*iBitdepthScale;737 Int iTc = tctable_8x8[iIndexTC]*iBitdepthScale; 738 738 739 739 for ( UInt uiStep = 0; uiStep < uiPelsInPartChroma; uiStep++ ) -
branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComLoopFilter.h
r362 r438 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 104 101 public: 105 102 TComLoopFilter(); … … 114 111 /// picture-level deblocking filter 115 112 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 }122 113 }; 123 114 -
branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComPic.cpp
r368 r438 481 481 #endif 482 482 483 484 483 //! \} -
branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComPic.h
r368 r438 93 93 #endif 94 94 #endif 95 95 96 public: 96 97 TComPic(); … … 115 116 #endif 116 117 #endif 118 117 119 Bool getUsedByCurr() { return m_bUsedByCurr; } 118 120 Void setUsedByCurr( Bool bUsed ) { m_bUsedByCurr = bUsed; } … … 184 186 Void print( Bool legend ); 185 187 #endif 188 189 190 186 191 /** transfer ownership of seis to this picture */ 187 192 void setSEIs(SEIMessages& seis) { m_SEIs = seis; } -
branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComPrediction.cpp
r362 r438 83 83 if( m_piYuvExt == NULL ) 84 84 { 85 Int extWidth = MAX_CU_SIZE+ 16;86 Int extHeight = MAX_CU_SIZE+ 1;85 Int extWidth = g_uiMaxCUWidth + 16; 86 Int extHeight = g_uiMaxCUHeight + 1; 87 87 Int i, j; 88 88 for (i = 0; i < 4; i++) … … 94 94 } 95 95 } 96 m_iYuvExtHeight = (( MAX_CU_SIZE+ 2) << 4);97 m_iYuvExtStride = (( MAX_CU_SIZE+ 8) << 4);96 m_iYuvExtHeight = ((g_uiMaxCUHeight + 2) << 4); 97 m_iYuvExtStride = ((g_uiMaxCUWidth + 8) << 4); 98 98 m_piYuvExt = new Int[ m_iYuvExtStride * m_iYuvExtHeight ]; 99 99 100 100 // new structure 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;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; 110 110 if (!m_pLumaRecBuffer) 111 111 { -
branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComRom.cpp
r362 r438 62 62 g_aucConvertToBit[ i ] = c; 63 63 64 // g_auiFrameScanXY[ g_aucConvertToBit[ transformSize ] ]: zigzag scan array for transformSize 64 65 c=2; 65 66 for ( i=0; i<MAX_CU_DEPTH; i++ ) … … 76 77 Void destroyROM() 77 78 { 78 for (Int i=0; i<MAX_CU_DEPTH; i++ ) 79 Int i; 80 81 for ( i=0; i<MAX_CU_DEPTH; i++ ) 79 82 { 80 83 delete[] g_auiSigLastScan[0][i]; -
branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComSlice.cpp
r396 r438 49 49 , m_iPOC ( 0 ) 50 50 , m_iLastIDR ( 0 ) 51 , m_eNalUnitType ( NAL_UNIT_CODED_SLICE_IDR _W_RADL)51 , m_eNalUnitType ( NAL_UNIT_CODED_SLICE_IDR ) 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_CLEANUP63 62 , m_bRefPicListModificationFlagLC ( false ) 64 63 , m_bRefPicListCombinationFlag ( false ) 65 #endif66 64 , m_bCheckLDC ( false ) 67 65 , m_iSliceQpDelta ( 0 ) … … 81 79 , m_dLambda ( 0.0 ) 82 80 #endif 83 #if !L0034_COMBINED_LIST_CLEANUP84 81 , m_bNoBackPredFlag ( false ) 85 #endif86 82 , m_uiTLayer ( 0 ) 87 83 , m_bTLayerSwitchingFlag ( false ) … … 115 111 #endif 116 112 { 117 #if L0034_COMBINED_LIST_CLEANUP118 m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = 0;119 #else120 113 m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = m_aiNumRefIdx[2] = 0; 121 #endif122 114 123 115 initEqualRef(); 124 116 125 #if L0034_COMBINED_LIST_CLEANUP126 for ( Int idx = 0; idx < MAX_NUM_REF; idx++ )127 {128 m_list1IdxToList0Idx[idx] = -1;129 }130 #else131 117 for(Int iNumCount = 0; iNumCount < MAX_NUM_REF_LC; iNumCount++) 132 118 { … … 138 124 m_iRefIdxOfL1FromRefIdxOfL0[iNumCount] = -1; 139 125 } 140 #endif141 126 for(Int iNumCount = 0; iNumCount < MAX_NUM_REF; iNumCount++) 142 127 { … … 150 135 #endif 151 136 } 152 resetWpScaling( );137 resetWpScaling(m_weightPredTable); 153 138 initWpAcDcParam(); 154 139 m_saoEnabledFlag = false; … … 171 156 m_colRefIdx = 0; 172 157 initEqualRef(); 173 #if !L0034_COMBINED_LIST_CLEANUP174 158 m_bNoBackPredFlag = false; 175 159 m_bRefPicListCombinationFlag = false; 176 160 m_bRefPicListModificationFlagLC = false; 177 #endif178 161 m_bCheckLDC = false; 179 162 m_iSliceQpDeltaCb = 0; 180 163 m_iSliceQpDeltaCr = 0; 181 164 182 #if !L0034_COMBINED_LIST_CLEANUP183 165 m_aiNumRefIdx[REF_PIC_LIST_C] = 0; 184 #endif185 166 186 167 m_maxNumMergeCand = MRG_MAX_NUM_CANDS; … … 196 177 Bool TComSlice::getRapPicFlag() 197 178 { 198 return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR _W_RADL179 return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR 199 180 || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP 200 181 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP 201 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA _W_RADL202 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA _W_LP182 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLANT 183 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA 203 184 || getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA; 204 185 } … … 270 251 271 252 272 TComPic* TComSlice::xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb) 253 TComPic* TComSlice::xGetLongTermRefPic (TComList<TComPic*>& rcListPic, 254 Int poc) 273 255 { 274 256 TComList<TComPic*>::iterator iterPic = rcListPic.begin(); 275 257 TComPic* pcPic = *(iterPic); 276 258 TComPic* pcStPic = pcPic; 277 278 Int pocCycle = 1 << getSPS()->getBitsForPOC();279 if (!pocHasMsb)280 {281 poc = poc % pocCycle;282 }283 284 259 while ( iterPic != rcListPic.end() ) 285 260 { 286 261 pcPic = *(iterPic); 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) 262 if(pcPic && (pcPic->getPOC()%(1<<getSPS()->getBitsForPOC())) == (poc%(1<<getSPS()->getBitsForPOC()))) 296 263 { 297 264 if(pcPic->getIsLongTerm()) … … 305 272 break; 306 273 } 307 }308 274 309 275 iterPic++; 310 276 } 311 312 277 return pcStPic; 313 278 } … … 328 293 } 329 294 330 #if L0034_COMBINED_LIST_CLEANUP331 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 #else348 295 Void TComSlice::generateCombinedList() 349 296 { … … 418 365 } 419 366 } 420 #endif421 367 422 368 #if H_MV 423 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& refPicSetInterLayer , Bool checkNumPocTotalCurr) 424 #else 425 #if FIX1071 426 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr ) 369 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& refPicSetInterLayer ) 427 370 #else 428 371 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic ) 429 372 #endif 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 } 373 { 374 if (m_eSliceType == I_SLICE) 375 { 376 ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList)); 377 ::memset( m_aiNumRefIdx, 0, sizeof ( m_aiNumRefIdx )); 443 378 379 return; 380 } 381 444 382 #if !H_MV 445 m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0); 446 m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1); 447 #endif 448 } 383 m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0); 384 m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1); 385 #endif 449 386 450 387 TComPic* pcRefPic= NULL; … … 473 410 } 474 411 } 475 476 412 for(; i < m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures(); i++) 477 413 { … … 486 422 } 487 423 } 488 489 424 for(i = m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()+m_pcRPS->getNumberOfLongtermPictures()-1; i > m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()-1 ; i--) 490 425 { 491 426 if(m_pcRPS->getUsed(i)) 492 427 { 493 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i) , m_pcRPS->getCheckLTMSBPresent(i));428 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i)); 494 429 pcRefPic->setIsLongTerm(1); 495 430 pcRefPic->getPicYuvRec()->extendPicBorder(); … … 499 434 if(pcRefPic==NULL) 500 435 { 501 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i) , m_pcRPS->getCheckLTMSBPresent(i));436 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i)); 502 437 } 503 438 pcRefPic->setCheckLTMSBPresent(m_pcRPS->getCheckLTMSBPresent(i)); … … 513 448 Int numPocTotalCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr; 514 449 #endif 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: 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 } 519 465 #if H_MV 520 // – If nuh_layer_id is equal to 0 and the current picture is a BLA picture or a CRA picture, the value of NumPocTotalCurr shall be equal to 0. 521 // – Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0. 522 if ( getRapPicFlag() && m_layerId == 0 ) 523 #else 524 // – If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0. 525 // – Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0. 526 if (getRapPicFlag()) 527 #endif 528 { 529 assert(numPocTotalCurr == 0); 530 } 531 532 if (m_eSliceType == I_SLICE) 533 { 534 ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList)); 535 ::memset( m_aiNumRefIdx, 0, sizeof ( m_aiNumRefIdx )); 536 537 return; 538 } 539 540 assert(numPocTotalCurr != 0); 541 542 m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0); 543 m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1); 544 } 545 #endif 546 547 Int cIdx = 0; 548 for ( i=0; i<NumPocStCurr0; i++, cIdx++) 549 { 550 rpsCurrList0[cIdx] = RefPicSetStCurr0[i]; 551 } 552 for ( i=0; i<NumPocStCurr1; i++, cIdx++) 553 { 554 rpsCurrList0[cIdx] = RefPicSetStCurr1[i]; 555 } 556 for ( i=0; i<NumPocLtCurr; i++, cIdx++) 557 { 558 rpsCurrList0[cIdx] = RefPicSetLtCurr[i]; 559 } 560 #if H_MV 561 for ( i=0; i<numDirectRefLayers; i++, cIdx++) 562 { 563 if( cIdx <= MAX_NUM_REF ) 564 { 565 rpsCurrList0[cIdx] = refPicSetInterLayer[i]; 566 } 567 } 568 #endif 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 } 569 475 570 476 if (m_eSliceType==B_SLICE) 571 477 { 572 cIdx = 0;478 Int cIdx = 0; 573 479 for ( i=0; i<NumPocStCurr1; i++, cIdx++) 574 480 { … … 679 585 } 680 586 681 Void TComSlice::checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA , TComList<TComPic *>& rcListPic)587 Void TComSlice::checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA) 682 588 { 683 589 for(Int i = 0; i < pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures(); i++) … … 692 598 if(pocCRA < MAX_UINT && getPOC() > pocCRA) 693 599 { 694 if (!pReferencePictureSet->getCheckLTMSBPresent(i))695 {696 assert(xGetLongTermRefPic(rcListPic, pReferencePictureSet->getPOC(i), false)->getPOC() >= pocCRA);697 }698 else699 {700 600 assert(pReferencePictureSet->getPOC(i) >= pocCRA); 701 601 } 702 602 } 703 } 704 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) // IDR picture found 603 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) // IDR picture found 705 604 { 706 605 pocCRA = getPOC(); … … 712 611 prevRAPisBLA = false; 713 612 } 714 else if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA _W_LP715 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA _W_RADL613 else if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA 614 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLANT 716 615 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP ) // BLA picture found 717 616 { … … 744 643 Int pocCurr = getPOC(); 745 644 746 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA _W_LP747 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA _W_RADL645 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA 646 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLANT 748 647 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP 749 || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR _W_RADL648 || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR 750 649 || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) // IDR or BLA picture 751 650 { … … 759 658 iterPic++; 760 659 } 761 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA _W_LP762 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA _W_RADL660 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA 661 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLANT 763 662 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP ) 764 663 { … … 774 673 { 775 674 rpcPic = *(iterPic); 776 if (rpcPic->getPOC() != pocCurr && rpcPic->getPOC() != pocCRA) 777 { 778 rpcPic->getSlice(0)->setReferenced(false); 779 } 675 if (rpcPic->getPOC() != pocCurr && rpcPic->getPOC() != pocCRA) rpcPic->getSlice(0)->setReferenced(false); 780 676 iterPic++; 781 677 } … … 811 707 m_deblockingFilterTcOffsetDiv2 = pSrc->m_deblockingFilterTcOffsetDiv2; 812 708 813 #if L0034_COMBINED_LIST_CLEANUP814 for (i = 0; i < 2; i++)815 #else816 709 for (i = 0; i < 3; i++) 817 #endif818 710 { 819 711 m_aiNumRefIdx[i] = pSrc->m_aiNumRefIdx[i]; 820 712 } 821 713 822 #if L0034_COMBINED_LIST_CLEANUP823 for (i = 0; i < MAX_NUM_REF; i++)824 {825 m_list1IdxToList0Idx[i] = pSrc->m_list1IdxToList0Idx[i];826 }827 #else828 714 for (i = 0; i < 2; i++) 829 715 { … … 842 728 m_bRefPicListModificationFlagLC = pSrc->m_bRefPicListModificationFlagLC; 843 729 m_bRefPicListCombinationFlag = pSrc->m_bRefPicListCombinationFlag; 844 #endif845 730 m_bCheckLDC = pSrc->m_bCheckLDC; 846 731 m_iSliceQpDelta = pSrc->m_iSliceQpDelta; … … 900 785 } 901 786 902 #if !L0034_COMBINED_LIST_CLEANUP903 787 m_bNoBackPredFlag = pSrc->m_bNoBackPredFlag; 904 #endif905 788 m_uiTLayer = pSrc->m_uiTLayer; 906 789 m_bTLayerSwitchingFlag = pSrc->m_bTLayerSwitchingFlag; … … 936 819 937 820 Int TComSlice::m_prevPOC = 0; 938 939 821 /** Function for setting the slice's temporal layer ID and corresponding temporal_layer_switching_point_flag. 940 822 * \param uiTLayer Temporal layer ID of the current slice … … 997 879 Int i, isReference; 998 880 881 Int j = 0; 999 882 // loop through all pictures in the reference picture buffer 1000 883 TComList<TComPic*>::iterator iterPic = rcListPic.begin(); 1001 884 while ( iterPic != rcListPic.end()) 1002 885 { 886 j++; 1003 887 rpcPic = *(iterPic++); 1004 1005 if(!rpcPic->getSlice( 0 )->isReferenced())1006 {1007 continue;1008 }1009 888 1010 889 isReference = 0; … … 1045 924 { 1046 925 rpcPic->getSlice( 0 )->setReferenced( false ); 1047 rpcPic->setUsedByCurr(0);1048 926 rpcPic->setIsLongTerm(0); 1049 927 } … … 1051 929 assert(rpcPic->getSlice( 0 )->isReferenced()==0||rpcPic->getUsedByCurr()==0||rpcPic->getTLayer()<=this->getTLayer()); 1052 930 //check that pictures of higher or equal temporal layer are not in the RPS if the current picture is a TSA picture 1053 if(this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TLA _R|| this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N)931 if(this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TLA || this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N) 1054 932 { 1055 933 assert(rpcPic->getSlice( 0 )->isReferenced()==0||rpcPic->getTLayer()<this->getTLayer()); 1056 934 } 935 1057 936 //check that pictures marked as temporal layer non-reference pictures are not used for reference 1058 937 if(rpcPic->getPicSym()->getSlice(0)->getPOC() != this->getPOC() && rpcPic->getTLayer()==this->getTLayer()) … … 1068 947 { 1069 948 TComPic* rpcPic; 1070 Int i, isAvailable ;949 Int i, isAvailable, j; 1071 950 Int atLeastOneLost = 0; 1072 951 Int atLeastOneRemoved = 0; … … 1077 956 for(i=pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures();i<pReferencePictureSet->getNumberOfPictures();i++) 1078 957 { 958 j = 0; 1079 959 isAvailable = 0; 1080 960 // loop through all pictures in the reference picture buffer … … 1082 962 while ( iterPic != rcListPic.end()) 1083 963 { 964 j++; 1084 965 rpcPic = *(iterPic++); 1085 966 if(pReferencePictureSet->getCheckLTMSBPresent(i)==true) … … 1104 985 while ( iterPic != rcListPic.end()) 1105 986 { 987 j++; 1106 988 rpcPic = *(iterPic++); 1107 989 1108 Int pocCycle = 1 << rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC(); 1109 Int curPoc = rpcPic->getPicSym()->getSlice(0)->getPOC(); 1110 Int refPoc = pReferencePictureSet->getPOC(i); 1111 if (!pReferencePictureSet->getCheckLTMSBPresent(i)) 1112 { 1113 curPoc = curPoc % pocCycle; 1114 refPoc = refPoc % pocCycle; 1115 } 1116 1117 if (rpcPic->getSlice(0)->isReferenced() && curPoc == refPoc) 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()) 1118 991 { 1119 992 isAvailable = 1; … … 1153 1026 for(i=0;i<pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures();i++) 1154 1027 { 1028 j = 0; 1155 1029 isAvailable = 0; 1156 1030 // loop through all pictures in the reference picture buffer … … 1158 1032 while ( iterPic != rcListPic.end()) 1159 1033 { 1034 j++; 1160 1035 rpcPic = *(iterPic++); 1161 1036 … … 1174 1049 { 1175 1050 if(printErrors) 1176 {1177 1051 printf("\nShort-term reference picture with POC = %3d seems to have been removed or not correctly decoded.", this->getPOC() + pReferencePictureSet->getDeltaPOC(i)); 1178 }1179 1052 atLeastOneRemoved = 1; 1180 1053 } … … 1182 1055 { 1183 1056 if(printErrors) 1184 {1185 1057 printf("\nShort-term reference picture with POC = %3d is lost or not correctly decoded!", this->getPOC() + pReferencePictureSet->getDeltaPOC(i)); 1186 }1187 1058 atLeastOneLost = 1; 1188 1059 iPocLost=this->getPOC() + pReferencePictureSet->getDeltaPOC(i); … … 1330 1201 * \returns Void 1331 1202 */ 1332 Void TComSlice::resetWpScaling( )1203 Void TComSlice::resetWpScaling(wpScalingParam wp[2][MAX_NUM_REF][3]) 1333 1204 { 1334 1205 for ( Int e=0 ; e<2 ; e++ ) … … 1338 1209 for ( Int yuv=0 ; yuv<3 ; yuv++ ) 1339 1210 { 1340 wpScalingParam *pwp = &( m_weightPredTable[e][i][yuv]);1211 wpScalingParam *pwp = &(wp[e][i][yuv]); 1341 1212 pwp->bPresentFlag = false; 1342 1213 pwp->uiLog2WeightDenom = 0; … … 1354 1225 Void TComSlice::initWpScaling() 1355 1226 { 1227 initWpScaling(m_weightPredTable); 1228 } 1229 1230 /** set WP tables 1231 * \param wpScalingParam 1232 * \returns Void 1233 */ 1234 Void TComSlice::initWpScaling(wpScalingParam wp[2][MAX_NUM_REF][3]) 1235 { 1356 1236 for ( Int e=0 ; e<2 ; e++ ) 1357 1237 { … … 1360 1240 for ( Int yuv=0 ; yuv<3 ; yuv++ ) 1361 1241 { 1362 wpScalingParam *pwp = &(m_weightPredTable[e][i][yuv]); 1363 if ( !pwp->bPresentFlag ) 1364 { 1242 wpScalingParam *pwp = &(wp[e][i][yuv]); 1243 if ( !pwp->bPresentFlag ) { 1365 1244 // Inferring values not present : 1366 1245 pwp->iWeight = (1 << pwp->uiLog2WeightDenom); … … 1396 1275 , m_cprmsPresentFlag (NULL) 1397 1276 { 1277 1398 1278 for( Int i = 0; i < MAX_TLAYER; i++) 1399 1279 { 1400 1280 m_numReorderPics[i] = 0; 1401 #if L0323_DPB1402 m_uiMaxDecPicBuffering[i] = 1;1403 #else1404 1281 m_uiMaxDecPicBuffering[i] = 0; 1405 #endif1406 1282 m_uiMaxLatencyIncrease[i] = 0; 1407 1283 } … … 1457 1333 TComVPS::~TComVPS() 1458 1334 { 1459 if( m_hrdParameters != NULL ) delete[]m_hrdParameters;1460 if( m_hrdOpSetIdx != NULL ) delete []m_hrdOpSetIdx;1461 if( m_cprmsPresentFlag != NULL ) delete []m_cprmsPresentFlag;1335 if( m_hrdParameters != NULL ) delete m_hrdParameters; 1336 if( m_hrdOpSetIdx != NULL ) delete m_hrdOpSetIdx; 1337 if( m_cprmsPresentFlag != NULL ) delete m_cprmsPresentFlag; 1462 1338 } 1463 1339 … … 1549 1425 } 1550 1426 #endif 1427 1551 1428 // ------------------------------------------------------------------------------------------------ 1552 1429 // Sequence parameter set (SPS) … … 1561 1438 , m_picWidthInLumaSamples (352) 1562 1439 , m_picHeightInLumaSamples (288) 1563 , m_log2MinCodingBlockSize ( 0)1564 , m_log2DiffMaxMinCodingBlockSize (0)1565 1440 , m_uiMaxCUWidth ( 32) 1566 1441 , m_uiMaxCUHeight ( 32) 1567 1442 , m_uiMaxCUDepth ( 3) 1443 , m_uiMinTrDepth ( 0) 1444 , m_uiMaxTrDepth ( 1) 1568 1445 , m_bLongTermRefsPresent (false) 1569 1446 , m_uiQuadtreeTULog2MaxSize ( 0) … … 1575 1452 , m_pcmLog2MaxSize ( 5) 1576 1453 , m_uiPCMLog2MinSize ( 7) 1577 #if !L0034_COMBINED_LIST_CLEANUP1578 1454 , m_bUseLComb (false) 1579 #endif1580 1455 , m_bitDepthY ( 8) 1581 1456 , m_bitDepthC ( 8) … … 1595 1470 , m_vuiParametersPresentFlag (false) 1596 1471 , m_vuiParameters () 1597 #if H_MV1598 , m_interViewMvVertConstraintFlag (false)1599 #endif1600 1472 { 1601 1473 for ( Int i = 0; i < MAX_TLAYER; i++ ) 1602 1474 { 1603 1475 m_uiMaxLatencyIncrease[i] = 0; 1604 #if L0323_DPB1605 m_uiMaxDecPicBuffering[i] = 1;1606 #else1607 1476 m_uiMaxDecPicBuffering[i] = 0; 1608 #endif1609 1477 m_numReorderPics[i] = 0; 1610 1478 } … … 1625 1493 m_RPSList.create(numRPS); 1626 1494 } 1627 1628 1495 Void TComSPS::setHrdParameters( UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess ) 1629 1496 { … … 1870 1737 return m_POC[bufferNum]; 1871 1738 } 1872 1873 1739 Void TComReferencePictureSet::setPOC(Int bufferNum, Int POC) 1874 1740 { 1875 1741 m_POC[bufferNum] = POC; 1876 1742 } 1877 1878 1743 Bool TComReferencePictureSet::getCheckLTMSBPresent(Int bufferNum) 1879 1744 { 1880 1745 return m_bCheckLTMSB[bufferNum]; 1881 1746 } 1882 1883 1747 Void TComReferencePictureSet::setCheckLTMSBPresent(Int bufferNum, Bool b) 1884 1748 { … … 2148 2012 } 2149 2013 #endif 2014 2150 2015 /** get scaling matrix from RefMatrixID 2151 2016 * \param sizeId size index … … 2157 2022 ::memcpy(getScalingListAddress(sizeId, listId),((listId == refListId)? getScalingListDefaultAddress(sizeId, refListId): getScalingListAddress(sizeId, refListId)),sizeof(Int)*min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId])); 2158 2023 } 2159 2160 2024 /** parse syntax infomation 2161 2025 * \param pchFile syntax infomation … … 2250 2114 m_scalingListCoef[SCALING_LIST_32x32][3] = m_scalingListCoef[SCALING_LIST_32x32][1]; // copy address for 32x32 2251 2115 } 2252 2253 2116 /** destroy quantization matrix array 2254 2117 */ … … 2263 2126 } 2264 2127 } 2265 2266 2128 /** get default address of quantization matrix 2267 2129 * \param sizeId size index … … 2293 2155 return src; 2294 2156 } 2295 2296 2157 /** process of default matrix 2297 2158 * \param sizeId size index … … 2303 2164 setScalingListDC(sizeId,listId,SCALING_LIST_DC); 2304 2165 } 2305 2306 2166 /** check DC value of matrix for default matrix signaling 2307 2167 */ … … 2364 2224 //! activate a PPS and depending on isIDR parameter also SPS and VPS 2365 2225 //! \returns true, if activation is successful 2366 Bool ParameterSetManager::activatePPS(Int ppsId, Bool isI RAP)2226 Bool ParameterSetManager::activatePPS(Int ppsId, Bool isIDR) 2367 2227 { 2368 2228 TComPPS *pps = m_ppsMap.getPS(ppsId); … … 2373 2233 // active parameter sets per layer should be used here 2374 2234 #else 2375 if (!isI RAP&& (spsId != m_activeSPSId))2376 { 2377 printf("Warning: tried to activate PPS referring to a inactive SPS at non-I RAP.");2235 if (!isIDR && (spsId != m_activeSPSId)) 2236 { 2237 printf("Warning: tried to activate PPS referring to a inactive SPS at non-IDR."); 2378 2238 return false; 2379 2239 } … … 2383 2243 { 2384 2244 Int vpsId = sps->getVPSId(); 2385 if (!isI RAP&& (vpsId != m_activeVPSId))2386 { 2387 printf("Warning: tried to activate PPS referring to a inactive VPS at non-I RAP.");2245 if (!isIDR && (vpsId != m_activeVPSId)) 2246 { 2247 printf("Warning: tried to activate PPS referring to a inactive VPS at non-IDR."); 2388 2248 return false; 2389 2249 } … … 2444 2304 } 2445 2305 #endif 2306 2446 2307 #if SIGNAL_BITRATE_PICRATE_IN_VPS 2447 2308 TComBitRatePicRateInfo::TComBitRatePicRateInfo() -
branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComSlice.h
r368 r438 248 248 ProfileTierLevel* getGeneralPTL() { return &m_generalPTL; } 249 249 ProfileTierLevel* getSubLayerPTL(Int i) { return &m_subLayerPTL[i]; } 250 250 251 #if H_MV 251 252 Void copyLevelFrom( TComPTL* source ); … … 535 536 536 537 #endif 538 537 539 public: 538 540 TComVPS(); … … 594 596 TComPTL* getPTL() { return &m_pcPTL; } 595 597 #endif 598 596 599 #if SIGNAL_BITRATE_PICRATE_IN_VPS 597 600 TComBitRatePicRateInfo *getBitratePicrateInfo() { return &m_bitRatePicRateInfo; } … … 600 603 TimingInfo* getTimingInfo() { return &m_timingInfo; } 601 604 #endif 605 602 606 #if H_MV 603 607 Void setAvcBaseLayerFlag( Bool val ) { m_avcBaseLayerFlag = val; } … … 901 905 UInt m_picHeightInLumaSamples; 902 906 903 Int m_log2MinCodingBlockSize;904 Int m_log2DiffMaxMinCodingBlockSize; 907 Window m_conformanceWindow; 908 905 909 UInt m_uiMaxCUWidth; 906 910 UInt m_uiMaxCUHeight; 907 911 UInt m_uiMaxCUDepth; 908 909 Window m_conformanceWindow; 910 912 UInt m_uiMinTrDepth; 913 UInt m_uiMaxTrDepth; 911 914 TComRPSList m_RPSList; 912 915 Bool m_bLongTermRefsPresent; … … 924 927 Bool m_useAMP; 925 928 926 #if !L0034_COMBINED_LIST_CLEANUP927 929 Bool m_bUseLComb; 928 #endif929 930 930 931 // Parameter … … 967 968 static const Int m_winUnitY[MAX_CHROMA_FORMAT_IDC+1]; 968 969 TComPTL m_pcPTL; 969 #if H_MV970 Bool m_interViewMvVertConstraintFlag;971 #endif972 970 public: 973 971 TComSPS(); … … 1001 999 Bool getUsedByCurrPicLtSPSFlag(Int i) {return m_usedByCurrPicLtSPSFlag[i];} 1002 1000 Void setUsedByCurrPicLtSPSFlag(Int i, Bool x) { m_usedByCurrPicLtSPSFlag[i] = x;} 1003 1004 Int getLog2MinCodingBlockSize() const { return m_log2MinCodingBlockSize; }1005 Void setLog2MinCodingBlockSize(Int val) { m_log2MinCodingBlockSize = val; }1006 Int getLog2DiffMaxMinCodingBlockSize() const { return m_log2DiffMaxMinCodingBlockSize; }1007 Void setLog2DiffMaxMinCodingBlockSize(Int val) { m_log2DiffMaxMinCodingBlockSize = val; }1008 1009 1001 Void setMaxCUWidth ( UInt u ) { m_uiMaxCUWidth = u; } 1010 1002 UInt getMaxCUWidth () { return m_uiMaxCUWidth; } … … 1023 1015 Bool getUseAMP() { return m_useAMP; } 1024 1016 Void setUseAMP( Bool b ) { m_useAMP = b; } 1017 Void setMinTrDepth ( UInt u ) { m_uiMinTrDepth = u; } 1018 UInt getMinTrDepth () { return m_uiMinTrDepth; } 1019 Void setMaxTrDepth ( UInt u ) { m_uiMaxTrDepth = u; } 1020 UInt getMaxTrDepth () { return m_uiMaxTrDepth; } 1025 1021 Void setQuadtreeTULog2MaxSize( UInt u ) { m_uiQuadtreeTULog2MaxSize = u; } 1026 1022 UInt getQuadtreeTULog2MaxSize() { return m_uiQuadtreeTULog2MaxSize; } … … 1044 1040 1045 1041 // Tool list 1046 #if !L0034_COMBINED_LIST_CLEANUP1047 1042 Void setUseLComb (Bool b) { m_bUseLComb = b; } 1048 1043 Bool getUseLComb () { return m_bUseLComb; } 1049 #endif1050 1044 1051 1045 Bool getUseLossless () { return m_useLossless; } … … 1100 1094 1101 1095 TComPTL* getPTL() { return &m_pcPTL; } 1102 #if H_MV1103 Void setInterViewMvVertConstraintFlag(Bool val) { m_interViewMvVertConstraintFlag = val; }1104 Bool getInterViewMvVertConstraintFlag() { return m_interViewMvVertConstraintFlag;}1105 #endif1106 1096 }; 1107 1097 … … 1130 1120 Void setRefPicSetIdxL1(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL1[idx] = refPicSetIdx; } 1131 1121 UInt getRefPicSetIdxL1(UInt idx) { return m_RefPicSetIdxL1[idx]; } 1122 1132 1123 #if H_MV 1133 1124 // Why not an listIdx for all members, would avoid code duplication?? … … 1366 1357 Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter 1367 1358 Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter 1368 #if L0034_COMBINED_LIST_CLEANUP 1369 Int m_list1IdxToList0Idx[MAX_NUM_REF]; 1370 Int m_aiNumRefIdx [2]; // for multiple reference of current slice 1371 #else 1359 1372 1360 Int m_aiNumRefIdx [3]; // for multiple reference of current slice 1373 1361 … … 1379 1367 Bool m_bRefPicListModificationFlagLC; 1380 1368 Bool m_bRefPicListCombinationFlag; 1381 #endif1382 1369 1383 1370 Bool m_bCheckLDC; … … 1420 1407 1421 1408 Bool m_abEqualRef [2][MAX_NUM_REF][MAX_NUM_REF]; 1422 #if !L0034_COMBINED_LIST_CLEANUP 1409 1423 1410 Bool m_bNoBackPredFlag; 1424 #endif1425 1411 UInt m_uiTLayer; 1426 1412 Bool m_bTLayerSwitchingFlag; … … 1457 1443 1458 1444 Bool m_enableTMVPFlag; 1445 1459 1446 #if H_MV 1460 1447 Int m_layerId; … … 1464 1451 #endif 1465 1452 #endif 1453 1466 1454 public: 1467 1455 TComSlice(); … … 1528 1516 Bool getMvdL1ZeroFlag () { return m_bLMvdL1Zero; } 1529 1517 Int getNumRpsCurrTempList(); 1530 #if L0034_COMBINED_LIST_CLEANUP1531 Int getList1IdxToList0Idx ( Int list1Idx ) { return m_list1IdxToList0Idx[list1Idx]; }1532 #else1533 1518 Int getRefIdxOfLC (RefPicList e, Int iRefIdx) { return m_iRefIdxOfLC[e][iRefIdx]; } 1534 1519 Int getListIdFromIdxOfLC(Int iRefIdx) { return m_eListIdFromIdxOfLC[iRefIdx]; } … … 1540 1525 Bool getRefPicListCombinationFlag() {return m_bRefPicListCombinationFlag;} 1541 1526 Void setRefPicListCombinationFlag(Bool bflag) {m_bRefPicListCombinationFlag=bflag;} 1542 #endif1543 1527 Void setReferenced(Bool b) { m_bRefenced = b; } 1544 1528 Bool isReferenced() { return m_bRefenced; } 1545 1529 Void setPOC ( Int i ) { m_iPOC = i; if(getTLayer()==0) m_prevPOC=i; } 1546 1530 Void setNalUnitType ( NalUnitType e ) { m_eNalUnitType = e; } 1547 NalUnitType getNalUnitType () const{ return m_eNalUnitType; }1531 NalUnitType getNalUnitType () { return m_eNalUnitType; } 1548 1532 Bool getRapPicFlag (); 1549 Bool getIdrPicFlag () { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; } 1550 Bool isIRAP () const { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); } 1551 Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA, TComList<TComPic *>& rcListPic); 1533 Bool getIdrPicFlag () { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; } 1534 Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA); 1552 1535 Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic); 1553 1536 Void setSliceType ( SliceType e ) { m_eSliceType = e; } … … 1575 1558 #endif 1576 1559 #if H_MV 1577 Void setRefPicList ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& interLayerRefPicSet , Bool checkNumPocTotalCurr = false ); 1578 #else 1579 #if FIX1071 1580 Void setRefPicList ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false ); 1560 Void setRefPicList ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& interLayerRefPicSet ); 1581 1561 #else 1582 1562 Void setRefPicList ( TComList<TComPic*>& rcListPic ); 1583 #endif1584 1563 #endif 1585 1564 Void setRefPOCList (); … … 1615 1594 1616 1595 static Void sortPicList ( TComList<TComPic*>& rcListPic ); 1617 #if L0034_COMBINED_LIST_CLEANUP 1618 Void setList1IdxToList0Idx(); 1619 #else 1596 1620 1597 Bool getNoBackPredFlag() { return m_bNoBackPredFlag; } 1621 1598 Void setNoBackPredFlag( Bool b ) { m_bNoBackPredFlag = b; } 1622 1599 Void generateCombinedList (); 1623 #endif1624 1600 1625 1601 UInt getTLayer () { return m_uiTLayer; } … … 1629 1605 Void decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum ); 1630 1606 Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList); 1607 1631 1608 #if H_MV 1632 1609 Void createAndApplyIvReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer ); … … 1637 1614 Void xPrintRefPicList(); 1638 1615 #endif 1616 1639 1617 Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic ); 1640 1618 Bool isStepwiseTemporalLayerSwitchingPointCandidate( TComList<TComPic*>& rcListPic ); … … 1677 1655 Void getWpScaling ( RefPicList e, Int iRefIdx, wpScalingParam *&wp); 1678 1656 1679 Void resetWpScaling (); 1657 Void resetWpScaling (wpScalingParam wp[2][MAX_NUM_REF][3]); 1658 Void initWpScaling (wpScalingParam wp[2][MAX_NUM_REF][3]); 1680 1659 Void initWpScaling (); 1681 1660 inline Bool applyWP () { return( (m_eSliceType==P_SLICE && m_pcPPS->getUseWP()) || (m_eSliceType==B_SLICE && m_pcPPS->getWPBiPred()) ); } … … 1723 1702 #endif 1724 1703 #endif 1704 1725 1705 protected: 1726 1706 TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, 1727 1707 Int poc); 1728 TComPic* xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb); 1708 TComPic* xGetLongTermRefPic (TComList<TComPic*>& rcListPic, 1709 Int poc); 1729 1710 #if H_MV 1730 1711 TComPic* xGetInterLayerRefPic( std::vector<TComPic*>& rcListIlPic, Int layerId ); … … 1813 1794 //! activate a PPS and depending on isIDR parameter also SPS and VPS 1814 1795 //! \returns true, if activation is successful 1815 Bool activatePPS(Int ppsId, Bool isI RAP);1796 Bool activatePPS(Int ppsId, Bool isIDR); 1816 1797 1817 1798 TComVPS* getActiveVPS(){ return m_vpsMap.getPS(m_activeVPSId); }; -
branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComTrQuant.cpp
r362 r438 1986 1986 } 1987 1987 1988 if(pi DstCoeff[minPos] == 32767 || piDstCoeff[minPos] == -32768)1988 if(piQCoef[minPos] == 32767 || piQCoef[minPos] == -32768) 1989 1989 { 1990 1990 finalChange = -1; -
branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TypeDef.h
r368 r438 49 49 #endif 50 50 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 51 ///// ***** HM 10.0 ********* 52 62 53 #define L0363_DU_BIT_RATE 1 ///< L0363: add bit_rate_du_value_minus1 to HRD parameters 63 54 #define L0328_SPLICING 1 ///< L0328: splicing support in HRD … … 84 75 #define SIGNAL_BITRATE_PICRATE_IN_VPS 0 ///< K0125: Signal bit_rate and pic_rate in VPS 85 76 #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 buffer88 89 #define L0034_COMBINED_LIST_CLEANUP 190 77 91 78 #define MAX_VPS_NUM_HRD_PARAMETERS 1 92 79 #define MAX_VPS_OP_SETS_PLUS1 1024 80 93 81 #if H_MV 94 82 #define MAX_VPS_NUH_LAYER_ID_PLUS1 64 … … 104 92 #define MAX_CPB_CNT 32 ///< Upper bound of (cpb_cnt_minus1 + 1) 105 93 #define MAX_NUM_LAYER_IDS 64 106 #if H_MV107 94 #define MAX_NUM_LAYERS 64 108 #endif109 95 110 96 #define COEF_REMAIN_BIN_REDUCTION 3 ///< indicates the level at which the VLC … … 426 412 REF_PIC_LIST_0 = 0, ///< reference list 0 427 413 REF_PIC_LIST_1 = 1, ///< reference list 1 428 #if !L0034_COMBINED_LIST_CLEANUP429 414 REF_PIC_LIST_C = 2, ///< combined reference list for uni-prediction in B-Slices 430 #endif431 415 REF_PIC_LIST_X = 100 ///< special mark 432 416 }; … … 570 554 #endif 571 555 #endif 556
Note: See TracChangeset for help on using the changeset viewer.