Changeset 189 in SHVCSoftware for trunk/source/Lib/TLibCommon
- Timestamp:
- 13 May 2013, 16:58:44 (12 years ago)
- Location:
- trunk/source
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source
- Property svn:mergeinfo changed
/branches/SHM-2.0-dev/source (added) merged: 133-167,169-182,184-188
- Property svn:mergeinfo changed
-
trunk/source/Lib/TLibCommon/CommonDef.h
r125 r189 56 56 // ==================================================================================================================== 57 57 58 #define NV_VERSION " 1.2" ///< Current software version58 #define NV_VERSION "2.0rc1" ///< 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, -
trunk/source/Lib/TLibCommon/NAL.h
r125 r189 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 -
trunk/source/Lib/TLibCommon/SEI.cpp
r127 r189 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) -
trunk/source/Lib/TLibCommon/SEI.h
r125 r189 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 //! \} -
trunk/source/Lib/TLibCommon/TComBitStream.cpp
r125 r189 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 -
trunk/source/Lib/TLibCommon/TComBitStream.h
r125 r189 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 -
trunk/source/Lib/TLibCommon/TComDataCU.cpp
r125 r189 1802 1802 UInt TComDataCU::getCtxIntraBLFlag( UInt uiAbsPartIdx ) 1803 1803 { 1804 #if INTRA_BL_CTX_CHANGE 1805 Int cuDepth = getDepth(uiAbsPartIdx); 1806 Int maxCuDepth = g_uiMaxCUDepth - g_uiAddCUDepth; 1807 UInt uiCtx = (maxCuDepth==3 && cuDepth > 0) ? (cuDepth - 1) : cuDepth; 1808 return uiCtx; 1809 #else 1804 1810 TComDataCU* pcTempCU; 1805 1811 UInt uiTempPartIdx; … … 1824 1830 1825 1831 return uiCtx; 1832 #endif 1826 1833 } 1827 1834 #endif … … 1835 1842 { 1836 1843 Int refIdxL0 = cMvFieldL0.getRefIdx(); 1837 if(getSlice()->getRefPic(REF_PIC_LIST_0, refIdxL0)->isILR( ))1844 if(getSlice()->getRefPic(REF_PIC_LIST_0, refIdxL0)->isILR(m_layerId)) 1838 1845 { 1839 1846 checkZeroMVILR &= (cMvFieldL0.getHor() == 0 && cMvFieldL0.getVer() == 0); … … 1843 1850 { 1844 1851 Int refIdxL1 = cMvFieldL1.getRefIdx(); 1845 if(getSlice()->getRefPic(REF_PIC_LIST_1, refIdxL1)->isILR( ))1852 if(getSlice()->getRefPic(REF_PIC_LIST_1, refIdxL1)->isILR(m_layerId)) 1846 1853 { 1847 1854 checkZeroMVILR &= (cMvFieldL1.getHor() == 0 && cMvFieldL1.getVer() == 0); … … 1859 1866 Bool checkZeroMVILR = true; 1860 1867 1861 if(getSlice()->getRefPic(eRefPicList, iRefIdx)->isILR( ))1868 if(getSlice()->getRefPic(eRefPicList, iRefIdx)->isILR(m_layerId)) 1862 1869 { 1863 1870 AMVPInfo* pcAMVPInfo = getCUMvField(eRefPicList)->getAMVPInfo(); … … 2530 2537 if(m_layerId) 2531 2538 { 2532 #if MV_SCALING_POS_FIX2533 2539 pcColCU = getBaseColCU( xP + nPSW/2, yP + nPSH/2, uiCUAddrBase, uiAbsPartAddrBase ); 2534 #else2535 UInt uiPartIdxCenter;2536 xDeriveCenterIdx( cCurPS, uiPUIdx, uiPartIdxCenter );2537 uiPartIdxCenter -= m_uiAbsIdxInLCU;2538 pcColCU = getBaseColCU( uiPartIdxCenter, uiCUAddrBase, uiAbsPartAddrBase );2539 #endif2540 2540 2541 2541 #if INTRA_BL … … 2671 2671 #endif 2672 2672 Bool isAvailableB0 = pcCUAboveRight && 2673 #if SVC_MVP 2673 #if SVC_MVP && !IL_MRG_SIMPLIFIED_PRUNING 2674 2674 ( !pcColCU || pcColCU->isIntra( uiAbsPartAddrBase ) || !pcCUAboveRight->hasEqualMotion( uiAboveRightPartIdx, puhInterDirNeighbours[0], &pcMvFieldNeighbours[0] )) && 2675 2675 #endif … … 2715 2715 Bool isAvailableA0 = pcCULeftBottom && 2716 2716 pcCULeftBottom->isDiffMER(xP-1, yP+nPSH, xP, yP) && 2717 #if SVC_MVP 2717 #if SVC_MVP && !IL_MRG_SIMPLIFIED_PRUNING 2718 2718 ( !pcColCU || pcColCU->isIntra( uiAbsPartAddrBase ) || !pcCULeftBottom->hasEqualMotion( uiLeftBottomPartIdx, puhInterDirNeighbours[0], &pcMvFieldNeighbours[0])) && 2719 2719 #endif … … 2759 2759 Bool isAvailableB2 = pcCUAboveLeft && 2760 2760 pcCUAboveLeft->isDiffMER(xP-1, yP-1, xP, yP) && 2761 #if SVC_MVP 2761 #if SVC_MVP && !IL_MRG_SIMPLIFIED_PRUNING 2762 2762 ( !pcColCU || pcColCU->isIntra( uiAbsPartAddrBase ) || !pcCUAboveLeft->hasEqualMotion( uiAboveLeftPartIdx, puhInterDirNeighbours[0], &pcMvFieldNeighbours[0] )) && 2763 2763 #endif … … 4175 4175 TComPic* cBaseColPic = m_pcSlice->getBaseColPic(); 4176 4176 4177 #if SVC_UPSAMPLING 4177 #if !SIMPLIFIED_MV_POS_SCALING 4178 #if SVC_UPSAMPLING && !ILP_DECODED_PICTURE 4178 4179 const Window &confBL = cBaseColPic->getPicYuvRec()->getConformanceWindow(); 4179 4180 const Window &confEL = m_pcPic->getPicYuvRec()->getConformanceWindow(); … … 4191 4192 Int heightEL = m_pcPic->getPicYuvRec()->getHeight(); 4192 4193 #endif 4194 #endif 4193 4195 4194 4196 uiPelX = (UInt)Clip3<UInt>(0, m_pcPic->getPicYuvRec()->getWidth() - 1, uiPelX); … … 4197 4199 UInt uiMinUnitSize = m_pcPic->getMinCUWidth(); 4198 4200 4201 #if SIMPLIFIED_MV_POS_SCALING 4202 #if SCALED_REF_LAYER_OFFSETS 4203 Int leftStartL = this->getSlice()->getSPS()->getScaledRefLayerWindow().getWindowLeftOffset(); 4204 Int topStartL = this->getSlice()->getSPS()->getScaledRefLayerWindow().getWindowTopOffset(); 4205 Int iBX = ((uiPelX - leftStartL)*g_posScalingFactor[m_layerId][0] + (1<<15)) >> 16; 4206 Int iBY = ((uiPelY - topStartL )*g_posScalingFactor[m_layerId][1] + (1<<15)) >> 16; 4207 #else 4208 Int iBX = (uiPelX*g_posScalingFactor[m_layerId][0] + (1<<15)) >> 16; 4209 Int iBY = (uiPelY*g_posScalingFactor[m_layerId][1] + (1<<15)) >> 16; 4210 #endif 4211 #else 4199 4212 Int iBX = (uiPelX*widthBL + widthEL/2)/widthEL; 4200 4213 Int iBY = (uiPelY*heightBL+ heightEL/2)/heightEL; 4201 4214 #endif 4215 4216 #if SCALED_REF_LAYER_OFFSETS 4217 if ( iBX >= cBaseColPic->getPicYuvRec()->getWidth() || iBY >= cBaseColPic->getPicYuvRec()->getHeight() || 4218 iBX < 0 || iBY < 0 ) 4219 #else 4202 4220 if ( iBX >= cBaseColPic->getPicYuvRec()->getWidth() || iBY >= cBaseColPic->getPicYuvRec()->getHeight()) 4221 #endif 4203 4222 { 4204 4223 return NULL; 4205 4224 } 4206 4225 4207 #if AVC_SYNTAX 4226 #if AVC_SYNTAX && !ILP_DECODED_PICTURE 4227 #if !ILP_DECODED_PICTURE 4228 const Window &confBL = cBaseColPic->getPicYuvRec()->getConformanceWindow(); 4229 const Window &confEL = m_pcPic->getPicYuvRec()->getConformanceWindow(); 4230 4231 Int widthBL = m_pcSlice->getBaseColPic()->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset(); 4232 Int heightBL = m_pcSlice->getBaseColPic()->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset(); 4233 #endif 4208 4234 if( iBX >= widthBL || iBY >= heightBL ) //outside of the reference layer cropped picture 4209 4235 { … … 4228 4254 TComMvField cMvFieldBase; 4229 4255 TComMv cMv; 4230 4231 #if MV_SCALING_FIX 4256 #if SIMPLIFIED_MV_POS_SCALING 4257 cMv = rcMvFieldBase.getMv().scaleMv( g_mvScalingFactor[m_layerId][0], g_mvScalingFactor[m_layerId][1] ); 4258 #else 4232 4259 const Window &confBL = m_pcSlice->getBaseColPic()->getPicYuvRec()->getConformanceWindow(); 4233 4260 const Window &confEL = m_pcPic->getPicYuvRec()->getConformanceWindow(); … … 4238 4265 Int widthEL = m_pcPic->getPicYuvRec()->getWidth() - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset(); 4239 4266 Int heightEL = m_pcPic->getPicYuvRec()->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset(); 4240 #else4241 Int widthBL = m_pcSlice->getBaseColPic()->getPicYuvRec()->getWidth();4242 Int heightBL = m_pcSlice->getBaseColPic()->getPicYuvRec()->getHeight();4243 4244 Int widthEL = m_pcPic->getPicYuvRec()->getWidth();4245 Int heightEL = m_pcPic->getPicYuvRec()->getHeight();4246 #endif4247 4267 4248 4268 Int iMvX = (rcMvFieldBase.getHor()*widthEL + (widthBL/2 -1) * (rcMvFieldBase.getHor() > 0 ? 1: -1) )/widthBL; … … 4250 4270 4251 4271 cMv.set(iMvX, iMvY); 4272 #endif 4252 4273 4253 4274 rcMvFieldEnhance.setMvField( cMv, rcMvFieldBase.getRefIdx() ); -
trunk/source/Lib/TLibCommon/TComLoopFilter.cpp
r125 r189 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++ ) -
trunk/source/Lib/TLibCommon/TComLoopFilter.h
r125 r189 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 -
trunk/source/Lib/TLibCommon/TComMv.h
r125 r189 149 149 return TComMv( mvx, mvy ); 150 150 } 151 #if SIMPLIFIED_MV_POS_SCALING 152 const TComMv scaleMv( Int iScaleX, Int iScaleY ) const 153 { 154 Int mvx = Clip3( -32768, 32767, (iScaleX * getHor() + 127 + (iScaleX * getHor() < 0)) >> 8 ); 155 Int mvy = Clip3( -32768, 32767, (iScaleY * getVer() + 127 + (iScaleY * getVer() < 0)) >> 8 ); 156 return TComMv( mvx, mvy ); 157 } 158 #endif 151 159 };// END CLASS DEFINITION TComMV 152 160 -
trunk/source/Lib/TLibCommon/TComPic.cpp
r125 r189 116 116 return; 117 117 } 118 #if REF_IDX_FRAMEWORK119 Void TComPic::createWithOutYuv( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, TComSPS* pcSps, Bool bIsVirtual)120 {121 m_apcPicSym = new TComPicSym; m_apcPicSym ->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth );122 if (!bIsVirtual)123 {124 m_apcPicYuv[0] = new TComPicYuv; m_apcPicYuv[0]->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps );125 }126 m_apcPicYuv[1] = NULL;127 128 #if SVC_UPSAMPLING129 if (m_bSpatialEnhLayer)130 {131 m_pcFullPelBaseRec = new TComPicYuv; m_pcFullPelBaseRec->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps );132 }133 #endif134 135 /* there are no SEI messages associated with this picture initially */136 m_SEIs.clear();137 m_bUsedByCurr = false;138 return;139 }140 #endif141 118 #else 142 119 Void TComPic::create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, … … 559 536 } 560 537 561 Void TComPic:: 538 Void TComPic::copyUpsampledPictureYuv(TComPicYuv* pcPicYuvIn, TComPicYuv* pcPicYuvOut) 562 539 { 563 540 Int upsampledRowWidthLuma = pcPicYuvOut->getStride(); // 2 * pcPicYuvOut->getLumaMargin() + pcPicYuvOut->getWidth(); … … 585 562 586 563 #if REF_IDX_MFM 587 #if !REUSE_BLKMAPPING588 Void TComPic::deriveUnitIdxBase( UInt upsamplePelX, UInt upsamplePelY, UInt ratio, UInt& baseCUAddr, UInt& baseAbsPartIdx )589 {590 //pixel in the base layer591 592 UInt pelX = (upsamplePelX<<1)/ratio;593 UInt pelY = (upsamplePelY<<1)/ratio;594 UInt baseWidth = getPicYuvRec()->getWidth();595 UInt baseHeight = getPicYuvRec()->getHeight();596 597 UInt widthInCU = ( baseWidth % g_uiMaxCUWidth ) ? baseWidth /g_uiMaxCUWidth + 1 : baseWidth /g_uiMaxCUWidth;598 599 #if MFM_CLIPPING_FIX600 pelX = (UInt)Clip3<UInt>(0, getPicYuvRec()->getWidth() - 1, pelX);601 pelY = (UInt)Clip3<UInt>(0, getPicYuvRec()->getHeight() - 1, pelY);602 #else603 UInt heightInCU = ( baseHeight% g_uiMaxCUHeight ) ? baseHeight/ g_uiMaxCUHeight + 1 : baseHeight/ g_uiMaxCUHeight;604 605 pelX = (UInt)Clip3<UInt>(0, widthInCU * g_uiMaxCUWidth - 1, pelX);606 pelY = (UInt)Clip3<UInt>(0, heightInCU * g_uiMaxCUHeight - 1, pelY);607 #endif608 609 baseCUAddr = pelY / g_uiMaxCUHeight * widthInCU + pelX / g_uiMaxCUWidth;610 611 UInt widthMinPU = g_uiMaxCUWidth / (1<<g_uiMaxCUDepth);612 UInt heightMinPU = g_uiMaxCUHeight/(1<<g_uiMaxCUDepth);613 614 UInt absPelX = pelX - (pelX / g_uiMaxCUWidth) * g_uiMaxCUWidth;615 UInt absPelY = pelY - (pelY / g_uiMaxCUHeight) * g_uiMaxCUHeight;616 617 UInt rasterIdx = absPelY / heightMinPU * (g_uiMaxCUWidth/widthMinPU) + absPelX / widthMinPU;618 baseAbsPartIdx = g_auiRasterToZscan[rasterIdx];619 620 return;621 }622 #endif623 624 564 Void TComPic::copyUpsampledMvField(TComPic* pcPicBase) 625 565 { 626 #if !REUSE_MVSCALE || !REUSE_BLKMAPPING || AVC_SYNTAX566 #if AVC_SYNTAX && !ILP_DECODED_PICTURE 627 567 const Window &confBL = pcPicBase->getConformanceWindow(); 628 568 const Window &confEL = getPicYuvRec()->getConformanceWindow(); … … 633 573 Int widthEL = getPicYuvRec()->getWidth() - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset(); 634 574 Int heightEL = getPicYuvRec()->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset(); 635 #endif636 637 #if !REUSE_MVSCALE || !REUSE_BLKMAPPING638 UInt upSampleRatio = 0;639 if(widthEL == widthBL && heightEL == heightBL)640 {641 upSampleRatio = 2;642 }643 else if(2*widthEL == 3*widthBL && 2*heightEL == 3*heightBL)644 {645 upSampleRatio = 3;646 }647 else if(widthEL == 2*widthBL && heightEL == 2*heightBL)648 {649 upSampleRatio = 4;650 }651 else652 {653 assert(0);654 }655 575 #endif 656 576 … … 671 591 UInt baseCUAddr, baseAbsPartIdx; 672 592 673 #if REUSE_BLKMAPPING674 593 TComDataCU *pcColCU = 0; 675 594 pcColCU = pcCUDes->getBaseColCU(pelX + 8, pelY + 8, baseCUAddr, baseAbsPartIdx); 676 #else 677 pcPicBase->deriveUnitIdxBase(pelX + 8, pelY + 8, upSampleRatio, baseCUAddr, baseAbsPartIdx); 678 #endif 679 680 #if AVC_SYNTAX 595 596 #if AVC_SYNTAX && !ILP_DECODED_PICTURE 681 597 Int xBL = ( (pelX + 8) * widthBL + widthEL/2 ) / widthEL; 682 598 Int yBL = ( (pelY + 8) * heightBL+ heightEL/2 ) / heightEL; 683 599 684 #if REUSE_BLKMAPPING685 600 if( ( xBL < widthBL && yBL < heightBL ) && pcColCU && (pcColCU->getPredictionMode(baseAbsPartIdx) != MODE_NONE) && (pcColCU->getPredictionMode(baseAbsPartIdx) != MODE_INTRA) ) //base layer unit not skip and invalid mode 686 601 #else 687 if( ( xBL < widthBL && yBL < heightBL ) && (pcPicBase->getCU(baseCUAddr)->getPredictionMode(baseAbsPartIdx) != MODE_NONE) && (pcPicBase->getCU(baseCUAddr)->getPredictionMode(baseAbsPartIdx) != MODE_INTRA) ) //base layer unit not skip and invalid mode688 #endif689 #else690 #if REUSE_BLKMAPPING691 602 if( pcColCU && (pcColCU->getPredictionMode(baseAbsPartIdx) != MODE_NONE) && (pcColCU->getPredictionMode(baseAbsPartIdx) != MODE_INTRA) ) //base layer unit not skip and invalid mode 692 #else693 if( (pcPicBase->getCU(baseCUAddr)->getPredictionMode(baseAbsPartIdx) != MODE_NONE) && (pcPicBase->getCU(baseCUAddr)->getPredictionMode(baseAbsPartIdx) != MODE_INTRA) ) //base layer unit not skip and invalid mode694 #endif695 603 #endif 696 604 { 697 605 for(UInt refPicList = 0; refPicList < 2; refPicList++) //for each reference list 698 606 { 699 #if REUSE_MVSCALE700 607 TComMvField sMvFieldBase, sMvField; 701 #if REUSE_BLKMAPPING702 608 pcColCU->getMvField( pcColCU, baseAbsPartIdx, (RefPicList)refPicList, sMvFieldBase); 703 #else704 pcPicBase->getCU(baseCUAddr)->getMvField( pcPicBase->getCU(baseCUAddr), baseAbsPartIdx, (RefPicList)refPicList, sMvFieldBase);705 #endif706 609 pcCUDes->scaleBaseMV( sMvField, sMvFieldBase ); 707 #else708 TComMv cMv = pcPicBase->getCU(baseCUAddr)->getCUMvField((RefPicList)refPicList)->getMv(baseAbsPartIdx);709 Int refIdx = pcPicBase->getCU(baseCUAddr)->getCUMvField((RefPicList)refPicList)->getRefIdx(baseAbsPartIdx);710 711 Int hor = ((Int)upSampleRatio * cMv.getHor())/2 ;712 Int ver = ((Int)upSampleRatio * cMv.getVer())/2 ;713 714 TComMv cScaledMv(hor, ver);715 TComMvField sMvField;716 sMvField.setMvField(cScaledMv, refIdx);717 #endif718 610 719 611 pcCUDes->getCUMvField((RefPicList)refPicList)->setMvField(sMvField, absPartIdx); … … 739 631 } 740 632 } 741 #endif 742 743 #if RAP_MFM_INIT 633 744 634 Void TComPic::initUpsampledMvField() 745 635 { … … 774 664 } 775 665 666 #if ILP_DECODED_PICTURE 667 UInt width = this->getPicYuvRec()->getWidth(); 668 UInt height = this->getPicYuvRec()->getHeight(); 669 #else 776 670 const Window &conf = this->getPicYuvRec()->getConformanceWindow(); 777 671 UInt width = this->getPicYuvRec()->getWidth() - conf.getWindowLeftOffset() - conf.getWindowRightOffset(); 778 672 UInt height = this->getPicYuvRec()->getHeight() - conf.getWindowTopOffset() - conf.getWindowBottomOffset(); 673 #endif 779 674 UInt64 poc = (UInt64)this->getPOC(); 780 675 UInt partWidth = width / 4; … … 853 748 } 854 749 750 #if ILP_DECODED_PICTURE 751 UInt width = this->getPicYuvRec()->getWidth(); 752 UInt height = this->getPicYuvRec()->getHeight(); 753 #else 855 754 const Window &conf = this->getConformanceWindow(); 856 755 UInt width = this->getPicYuvRec()->getWidth() - conf.getWindowLeftOffset() - conf.getWindowRightOffset(); 857 756 UInt height = this->getPicYuvRec()->getHeight() - conf.getWindowTopOffset() - conf.getWindowBottomOffset(); 757 #endif 858 758 859 759 UInt64 poc = (UInt64)this->getPOC(); -
trunk/source/Lib/TLibCommon/TComPic.h
r125 r189 103 103 Void create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, 104 104 Int *numReorderPics, TComSPS* pcSps = NULL, Bool bIsVirtual = false ); 105 #if REF_IDX_FRAMEWORK106 Void createWithOutYuv( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, TComSPS* pcSps = NULL, Bool bIsVirtual = false );107 Void setPicYuvRec(TComPicYuv *pPicYuv) { m_apcPicYuv[1]=pPicYuv; }108 #endif109 105 #else 110 106 Void create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, … … 124 120 #endif 125 121 #if REF_IDX_ME_ZEROMV || ENCODER_FAST_MODE || REF_IDX_MFM 126 Bool isILR( UInt refLayer = 0 ) {return (getIsLongTerm() && m_layerId == refLayer);}122 Bool isILR( UInt currLayerId ) { return ( getIsLongTerm() && m_layerId < currLayerId ); } 127 123 #endif 128 124 129 125 #if REF_IDX_MFM 130 126 Void copyUpsampledMvField ( TComPic* pcPicBase ); 131 #if !REUSE_BLKMAPPING132 Void deriveUnitIdxBase ( UInt upsamplePelX, UInt upsamplePelY, UInt ratio, UInt& baseCUAddr, UInt& baseAbsPartIdx );133 #endif134 #if RAP_MFM_INIT135 127 Void initUpsampledMvField (); 136 #endif137 128 #endif 138 129 -
trunk/source/Lib/TLibCommon/TComPicYuv.cpp
r125 r189 60 60 m_piPicOrgU = NULL; 61 61 m_piPicOrgV = NULL; 62 62 63 m_bIsBorderExtended = false; 63 64 } -
trunk/source/Lib/TLibCommon/TComPrediction.cpp
r125 r189 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 { … … 495 495 496 496 #if REF_IDX_ME_ZEROMV 497 assert( ( pcCU->getSlice()->getRefPic(eRefPicList, iRefIdx)->isILR( ) && cMv.getHor() == 0 && cMv.getVer() == 0 ) || pcCU->getSlice()->getRefPic(eRefPicList, iRefIdx)->isILR() == false );497 assert( ( pcCU->getSlice()->getRefPic(eRefPicList, iRefIdx)->isILR(pcCU->getLayerId()) && cMv.getHor() == 0 && cMv.getVer() == 0 ) || pcCU->getSlice()->getRefPic(eRefPicList, iRefIdx)->isILR(pcCU->getLayerId()) == false ); 498 498 #endif 499 499 … … 773 773 774 774 #if SVC_UPSAMPLING 775 #if SCALED_REF_LAYER_OFFSETS 776 Void TComPrediction::upsampleBasePic( TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window) 777 { 778 m_cUsf.upsampleBasePic( pcUsPic, pcBasePic, pcTempPic, window); 779 } 780 #else 775 781 Void TComPrediction::upsampleBasePic( TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic) 776 782 { 777 783 m_cUsf.upsampleBasePic( pcUsPic, pcBasePic, pcTempPic); 778 784 } 785 #endif 779 786 #endif 780 787 //! \} -
trunk/source/Lib/TLibCommon/TComPrediction.h
r125 r189 122 122 123 123 #if SVC_UPSAMPLING 124 #if SCALED_REF_LAYER_OFFSETS 125 Void upsampleBasePic( TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window ); 126 #else 124 127 Void upsampleBasePic( TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic ); 128 #endif 125 129 #endif 126 130 }; -
trunk/source/Lib/TLibCommon/TComRom.cpp
r125 r189 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]; … … 521 518 Int g_eTTable[4] = {0,3,1,2}; 522 519 520 #if SIMPLIFIED_MV_POS_SCALING 521 Int g_mvScalingFactor [MAX_LAYERS][2] = {{0,0}, {0,0}}; 522 Int g_posScalingFactor [MAX_LAYERS][2] = {{0,0}, {0,0}}; 523 #endif 524 523 525 //! \} -
trunk/source/Lib/TLibCommon/TComRom.h
r125 r189 273 273 extern UInt g_scalingListNum [SCALING_LIST_SIZE_NUM]; 274 274 extern Int g_eTTable[4]; 275 276 #if SIMPLIFIED_MV_POS_SCALING 277 extern Int g_mvScalingFactor [MAX_LAYERS][2]; 278 extern Int g_posScalingFactor [MAX_LAYERS][2]; 279 #endif 280 275 281 //! \} 276 282 -
trunk/source/Lib/TLibCommon/TComSlice.cpp
r125 r189 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 #if REF_LIST_BUGFIX 118 m_aiNumILRRefIdx = 0; 119 #endif 125 #if REF_IDX_FRAMEWORK 126 #if JCTVC_M0458_INTERLAYER_RPS_SIG 127 m_activeNumILRRefIdx = 0; 128 m_interLayerPredEnabledFlag = 0; 129 ::memset( m_interLayerPredLayerIdc, 0, sizeof(m_interLayerPredLayerIdc) ); 130 #else 131 m_numILRRefIdx = 0; 132 #endif 133 #endif 134 120 135 initEqualRef(); 121 136 137 #if L0034_COMBINED_LIST_CLEANUP 138 for ( Int idx = 0; idx < MAX_NUM_REF; idx++ ) 139 { 140 m_list1IdxToList0Idx[idx] = -1; 141 } 142 #else 122 143 for(Int iNumCount = 0; iNumCount < MAX_NUM_REF_LC; iNumCount++) 123 144 { … … 129 150 m_iRefIdxOfL1FromRefIdxOfL0[iNumCount] = -1; 130 151 } 152 #endif 131 153 for(Int iNumCount = 0; iNumCount < MAX_NUM_REF; iNumCount++) 132 154 { … … 136 158 m_aiRefPOCList [1][iNumCount] = 0; 137 159 } 138 resetWpScaling( m_weightPredTable);160 resetWpScaling(); 139 161 initWpAcDcParam(); 140 162 m_saoEnabledFlag = false; … … 159 181 m_aiNumRefIdx[0] = 0; 160 182 m_aiNumRefIdx[1] = 0; 161 #if REF_LIST_BUGFIX 162 if(layerId) 163 { 164 m_aiNumILRRefIdx = 1; // to be set to NumDirectRefLayers[LayerIdInVps[nuh_layer_id]] 165 } 166 else 167 { 168 m_aiNumILRRefIdx = 0; 169 } 183 #if REF_IDX_FRAMEWORK 184 #if JCTVC_M0458_INTERLAYER_RPS_SIG 185 m_activeNumILRRefIdx = 0; 186 m_interLayerPredEnabledFlag = 0; 187 #else 188 m_numILRRefIdx = 0; 189 #endif 190 170 191 #endif 171 192 m_colFromL0Flag = 1; … … 173 194 m_colRefIdx = 0; 174 195 initEqualRef(); 196 #if !L0034_COMBINED_LIST_CLEANUP 175 197 m_bNoBackPredFlag = false; 176 198 m_bRefPicListCombinationFlag = false; 177 199 m_bRefPicListModificationFlagLC = false; 200 #endif 178 201 m_bCheckLDC = false; 179 202 m_iSliceQpDeltaCb = 0; 180 203 m_iSliceQpDeltaCr = 0; 181 204 205 #if !L0034_COMBINED_LIST_CLEANUP 182 206 m_aiNumRefIdx[REF_PIC_LIST_C] = 0; 207 #endif 183 208 184 209 m_maxNumMergeCand = MRG_MAX_NUM_CANDS; … … 194 219 Bool TComSlice::getRapPicFlag() 195 220 { 196 return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR 221 return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL 197 222 || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP 198 223 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP 199 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA NT200 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA 224 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL 225 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 201 226 || getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA; 202 227 } … … 213 238 } 214 239 215 Void TComSlice::sortPicList 240 Void TComSlice::sortPicList(TComList<TComPic*>& rcListPic) 216 241 { 217 242 TComPic* pcPicExtract; … … 268 293 269 294 270 TComPic* TComSlice::xGetLongTermRefPic (TComList<TComPic*>& rcListPic, 271 Int poc) 295 TComPic* TComSlice::xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb) 272 296 { 273 297 TComList<TComPic*>::iterator iterPic = rcListPic.begin(); 274 298 TComPic* pcPic = *(iterPic); 275 299 TComPic* pcStPic = pcPic; 300 301 Int pocCycle = 1 << getSPS()->getBitsForPOC(); 302 if (!pocHasMsb) 303 { 304 poc = poc % pocCycle; 305 } 306 276 307 while ( iterPic != rcListPic.end() ) 277 308 { 278 309 pcPic = *(iterPic); 279 if(pcPic && (pcPic->getPOC()%(1<<getSPS()->getBitsForPOC())) == (poc%(1<<getSPS()->getBitsForPOC()))) 280 { 281 if(pcPic->getIsLongTerm()) 310 if (pcPic && pcPic->getPOC()!=this->getPOC() && pcPic->getSlice( 0 )->isReferenced()) 311 { 312 Int picPoc = pcPic->getPOC(); 313 if (!pocHasMsb) 314 { 315 picPoc = picPoc % pocCycle; 316 } 317 318 if (poc == picPoc) 319 { 320 if (pcPic->getIsLongTerm()) 282 321 { 283 322 return pcPic; … … 289 328 break; 290 329 } 330 } 291 331 292 332 iterPic++; 293 333 } 334 294 335 return pcStPic; 295 336 } 296 337 297 Void TComSlice::setRefPOCList 338 Void TComSlice::setRefPOCList() 298 339 { 299 340 for (Int iDir = 0; iDir < 2; iDir++) … … 307 348 } 308 349 350 #if L0034_COMBINED_LIST_CLEANUP 351 Void TComSlice::setList1IdxToList0Idx() 352 { 353 Int idxL0, idxL1; 354 for ( idxL1 = 0; idxL1 < getNumRefIdx( REF_PIC_LIST_1 ); idxL1++ ) 355 { 356 m_list1IdxToList0Idx[idxL1] = -1; 357 for ( idxL0 = 0; idxL0 < getNumRefIdx( REF_PIC_LIST_0 ); idxL0++ ) 358 { 359 if ( m_apcRefPicList[REF_PIC_LIST_0][idxL0]->getPOC() == m_apcRefPicList[REF_PIC_LIST_1][idxL1]->getPOC() ) 360 { 361 m_list1IdxToList0Idx[idxL1] = idxL0; 362 break; 363 } 364 } 365 } 366 } 367 #else 309 368 Void TComSlice::generateCombinedList() 310 369 { … … 369 428 } 370 429 } 371 372 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic) 373 { 374 #if REF_IDX_FRAMEWORK 375 if( m_eSliceType == I_SLICE || ( getSPS()->getLayerId() && 376 (getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA) && 377 (getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) ) ) 378 #else 379 if (m_eSliceType == I_SLICE) 380 #endif 381 { 382 ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList)); 383 ::memset( m_aiNumRefIdx, 0, sizeof ( m_aiNumRefIdx )); 384 385 return; 386 } 430 #endif 431 432 #if FIX1071 433 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr, TComPic** ilpPic) 434 #else 435 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic ) 436 #endif 437 { 438 #if FIX1071 439 if (!checkNumPocTotalCurr) 440 #endif 441 { 442 if( m_eSliceType == I_SLICE ) 443 { 444 ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList)); 445 ::memset( m_aiNumRefIdx, 0, sizeof ( m_aiNumRefIdx )); 446 return; 447 } 387 448 388 m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0); 389 m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1); 449 m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0); 450 m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1); 451 } 390 452 391 453 TComPic* pcRefPic= NULL; … … 398 460 Int i; 399 461 462 #if REF_IDX_FRAMEWORK 463 #if ZERO_NUM_DIRECT_LAYERS 464 if( m_layerId == 0 || ( m_layerId > 0 && ( m_activeNumILRRefIdx == 0 || !((getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && (getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA)) ) ) ) 465 #else 466 if ((getLayerId() == 0) || 467 ((getSPS()->getLayerId()) && !((getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && 468 (getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA)) ) 469 ) 470 #endif 471 { 472 #endif 400 473 for(i=0; i < m_pcRPS->getNumberOfNegativePictures(); i++) 401 474 { … … 410 483 } 411 484 } 485 412 486 for(; i < m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures(); i++) 413 487 { … … 422 496 } 423 497 } 498 424 499 for(i = m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()+m_pcRPS->getNumberOfLongtermPictures()-1; i > m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()-1 ; i--) 425 500 { 426 501 if(m_pcRPS->getUsed(i)) 427 502 { 428 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i) );503 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i)); 429 504 pcRefPic->setIsLongTerm(1); 430 505 pcRefPic->getPicYuvRec()->extendPicBorder(); … … 434 509 if(pcRefPic==NULL) 435 510 { 436 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i) );511 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i)); 437 512 } 438 513 pcRefPic->setCheckLTMSBPresent(m_pcRPS->getCheckLTMSBPresent(i)); 439 514 } 440 515 #if REF_IDX_FRAMEWORK 516 } 517 #endif 518 519 #if REF_IDX_FRAMEWORK 520 //inter-layer reference picture 521 #if REF_IDX_MFM 522 #if ZERO_NUM_DIRECT_LAYERS 523 if( m_layerId > 0 && m_activeNumILRRefIdx > 0 ) 524 #else 525 if (getLayerId()) 526 #endif 527 { 528 if(!(getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) && getSPS()->getMFMEnabledFlag()) 529 { 530 ilpPic[0]->copyUpsampledMvField(getBaseColPic()); 531 } 532 else 533 { 534 ilpPic[0]->initUpsampledMvField(); 535 } 536 #endif 537 ilpPic[0]->setIsLongTerm(1); 538 } 539 #endif 441 540 // ref_pic_list_init 442 541 TComPic* rpsCurrList0[MAX_NUM_REF+1]; 443 542 TComPic* rpsCurrList1[MAX_NUM_REF+1]; 543 #if REF_IDX_FRAMEWORK 544 #if JCTVC_M0458_INTERLAYER_RPS_SIG 545 Int numPocTotalCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr + m_activeNumILRRefIdx; 546 #else 547 Int numPocTotalCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr + m_numILRRefIdx; 548 #endif 549 #else 444 550 Int numPocTotalCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr; 445 446 { 551 #endif 552 #if FIX1071 553 if (checkNumPocTotalCurr) 554 { 555 // 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: 556 // – If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0. 557 // – Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0. 558 if (getRapPicFlag()) 559 { 560 assert(numPocTotalCurr == 0); 561 } 562 563 if (m_eSliceType == I_SLICE) 564 { 565 ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList)); 566 ::memset( m_aiNumRefIdx, 0, sizeof ( m_aiNumRefIdx )); 567 568 return; 569 } 570 571 assert(numPocTotalCurr != 0); 572 573 m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0); 574 m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1); 575 } 576 #endif 577 447 578 Int cIdx = 0; 448 579 for ( i=0; i<NumPocStCurr0; i++, cIdx++) … … 458 589 rpsCurrList0[cIdx] = RefPicSetLtCurr[i]; 459 590 } 460 } 461 591 #if REF_IDX_FRAMEWORK 592 if(getLayerId()) 593 { 594 #if JCTVC_M0458_INTERLAYER_RPS_SIG 595 for( i = 0; i < m_activeNumILRRefIdx && cIdx < numPocTotalCurr; cIdx ++, i ++) 596 #else 597 for( i = 0; i < m_numILRRefIdx && cIdx < numPocTotalCurr; cIdx ++, i ++) 598 #endif 599 { 600 rpsCurrList0[cIdx] = ilpPic[i]; 601 } 602 } 603 #endif 462 604 if (m_eSliceType==B_SLICE) 463 605 { 464 IntcIdx = 0;606 cIdx = 0; 465 607 for ( i=0; i<NumPocStCurr1; i++, cIdx++) 466 608 { … … 475 617 rpsCurrList1[cIdx] = RefPicSetLtCurr[i]; 476 618 } 619 #if REF_IDX_FRAMEWORK 620 if(getLayerId()) 621 { 622 #if JCTVC_M0458_INTERLAYER_RPS_SIG 623 for( i = 0; i < m_activeNumILRRefIdx && cIdx < numPocTotalCurr; cIdx ++, i ++) 624 #else 625 for( i = 0; i < m_numILRRefIdx && cIdx < numPocTotalCurr; cIdx ++, i ++) 626 #endif 627 { 628 rpsCurrList1[cIdx] = ilpPic[i]; 629 } 630 } 631 #endif 477 632 } 478 633 … … 501 656 } 502 657 503 #if REF_ LIST_BUGFIX658 #if REF_IDX_FRAMEWORK 504 659 Void TComSlice::setRefPicListModificationSvc() 505 660 { … … 509 664 } 510 665 511 if(this->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA && this->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) 666 if(this->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && this->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) 667 { 512 668 return; 669 } 513 670 514 671 TComRefPicListModification* refPicListModification = this->getRefPicListModification(); … … 537 694 else 538 695 { 539 for(Int i = m_aiNumILRRefIdx; i > 0; i-- ) 696 #if JCTVC_M0458_INTERLAYER_RPS_SIG 697 for(Int i = m_activeNumILRRefIdx; i > 0; i-- ) 698 #else 699 for(Int i = m_numILRRefIdx; i > 0; i-- ) 700 #endif 540 701 { 541 702 refPicListModification->setRefPicSetIdxL0(m_aiNumRefIdx[REF_PIC_LIST_0] - i, numberOfRpsCurrTempList - i); … … 563 724 else 564 725 { 565 for(Int i = m_aiNumILRRefIdx; i > 0; i-- ) 726 #if JCTVC_M0458_INTERLAYER_RPS_SIG 727 for(Int i = m_activeNumILRRefIdx; i > 0; i-- ) 728 #else 729 for(Int i = m_numILRRefIdx; i > 0; i-- ) 730 #endif 566 731 { 567 732 refPicListModification->setRefPicSetIdxL1(m_aiNumRefIdx[REF_PIC_LIST_1] - i, numberOfRpsCurrTempList - i); … … 569 734 } 570 735 } 571 return;572 }573 574 Void TComSlice::setRefPicListSvc( TComList<TComPic*>& rcListPic, TComPic** ilpPic )575 {576 assert(getLayerId() > 0);577 578 m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0);579 m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1);580 581 TComPic* pcRefPic= NULL;582 TComPic* RefPicSetStCurr0[16];583 TComPic* RefPicSetStCurr1[16];584 TComPic* RefPicSetLtCurr[16];585 UInt NumPocStCurr0 = 0;586 UInt NumPocStCurr1 = 0;587 UInt NumPocLtCurr = 0;588 Int i;589 590 //temporal reference pictures591 if( !(getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA && getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) )592 {593 for(i=0; i < m_pcRPS->getNumberOfNegativePictures(); i++)594 {595 if(m_pcRPS->getUsed(i))596 {597 pcRefPic = xGetRefPic(rcListPic, getPOC()+m_pcRPS->getDeltaPOC(i));598 pcRefPic->setIsLongTerm(0);599 pcRefPic->getPicYuvRec()->extendPicBorder();600 RefPicSetStCurr0[NumPocStCurr0] = pcRefPic;601 NumPocStCurr0++;602 pcRefPic->setCheckLTMSBPresent(false);603 }604 }605 for(; i < m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures(); i++)606 {607 if(m_pcRPS->getUsed(i))608 {609 pcRefPic = xGetRefPic(rcListPic, getPOC()+m_pcRPS->getDeltaPOC(i));610 pcRefPic->setIsLongTerm(0);611 pcRefPic->getPicYuvRec()->extendPicBorder();612 RefPicSetStCurr1[NumPocStCurr1] = pcRefPic;613 NumPocStCurr1++;614 pcRefPic->setCheckLTMSBPresent(false);615 }616 }617 for(i = m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()+m_pcRPS->getNumberOfLongtermPictures()-1; i > m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()-1 ; i--)618 {619 if(m_pcRPS->getUsed(i))620 {621 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i));622 pcRefPic->setIsLongTerm(1);623 pcRefPic->getPicYuvRec()->extendPicBorder();624 RefPicSetLtCurr[NumPocLtCurr] = pcRefPic;625 NumPocLtCurr++;626 }627 if(pcRefPic==NULL)628 {629 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i));630 }631 pcRefPic->setCheckLTMSBPresent(m_pcRPS->getCheckLTMSBPresent(i));632 }633 }634 635 //inter-layer reference picture636 #if REF_IDX_MFM637 assert(m_aiNumILRRefIdx == 1);638 if(!(getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA && getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) && getSPS()->getMFMEnabledFlag())639 {640 ilpPic[0]->copyUpsampledMvField(getBaseColPic());641 }642 else643 {644 ilpPic[0]->initUpsampledMvField();645 }646 #endif647 ilpPic[0]->setIsLongTerm(1);648 649 // ref_pic_list_init650 UInt cIdx = 0;651 UInt num_ref_idx_l0_active_minus1 = m_aiNumRefIdx[0] - 1;652 UInt num_ref_idx_l1_active_minus1 = m_aiNumRefIdx[1] - 1;653 TComPic* refPicListTemp0[MAX_NUM_REF+1];654 TComPic* refPicListTemp1[MAX_NUM_REF+1];655 Int numRpsCurrTempList0, numRpsCurrTempList1;656 657 numRpsCurrTempList0 = numRpsCurrTempList1 = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr + m_aiNumILRRefIdx;658 if (numRpsCurrTempList0 <= num_ref_idx_l0_active_minus1)659 {660 numRpsCurrTempList0 = num_ref_idx_l0_active_minus1 + 1;661 }662 if (numRpsCurrTempList1 <= num_ref_idx_l1_active_minus1)663 {664 numRpsCurrTempList1 = num_ref_idx_l1_active_minus1 + 1;665 }666 667 assert(numRpsCurrTempList0 <= MAX_NUM_REF);668 assert(numRpsCurrTempList1 <= MAX_NUM_REF);669 670 cIdx = 0;671 while (cIdx < numRpsCurrTempList0)672 {673 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++)678 refPicListTemp0[cIdx] = RefPicSetLtCurr[ i ];679 for ( i=0; i<m_aiNumILRRefIdx && cIdx<numRpsCurrTempList0; cIdx++,i++)680 refPicListTemp0[cIdx] = ilpPic[ i ];681 }682 cIdx = 0;683 while (cIdx<numRpsCurrTempList1 && m_eSliceType==B_SLICE)684 {685 for ( i=0; i<NumPocStCurr1 && cIdx<numRpsCurrTempList1; cIdx++,i++)686 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++)690 refPicListTemp1[cIdx] = RefPicSetLtCurr[ i ];691 for ( i=0; i<m_aiNumILRRefIdx && cIdx<numRpsCurrTempList1; cIdx++,i++)692 refPicListTemp1[cIdx] = ilpPic[ i ];693 }694 ::memset(m_bIsUsedAsLongTerm, 0, sizeof(m_bIsUsedAsLongTerm));695 for (Int rIdx = 0; rIdx <= (m_aiNumRefIdx[0]-1); rIdx ++)696 {697 m_apcRefPicList[0][rIdx] = m_RefPicListModification.getRefPicListModificationFlagL0() ? refPicListTemp0[ m_RefPicListModification.getRefPicSetIdxL0(rIdx) ] : refPicListTemp0[rIdx % numRpsCurrTempList0];698 m_bIsUsedAsLongTerm[0][rIdx] = m_RefPicListModification.getRefPicListModificationFlagL0() ? (m_RefPicListModification.getRefPicSetIdxL0(rIdx) >= (NumPocStCurr0 + NumPocStCurr1))699 : ((rIdx % numRpsCurrTempList0) >= (NumPocStCurr0 + NumPocStCurr1));700 }701 if ( m_eSliceType == P_SLICE )702 {703 m_aiNumRefIdx[1] = 0;704 ::memset( m_apcRefPicList[1], 0, sizeof(m_apcRefPicList[1]));705 }706 else707 {708 for (Int rIdx = 0; rIdx <= (m_aiNumRefIdx[1]-1); rIdx ++)709 {710 m_apcRefPicList[1][rIdx] = m_RefPicListModification.getRefPicListModificationFlagL1() ? refPicListTemp1[ m_RefPicListModification.getRefPicSetIdxL1(rIdx) ] : refPicListTemp1[rIdx % numRpsCurrTempList1];711 m_bIsUsedAsLongTerm[1][rIdx] = m_RefPicListModification.getRefPicListModificationFlagL1() ?712 (m_RefPicListModification.getRefPicSetIdxL1(rIdx) >= (NumPocStCurr0 + NumPocStCurr1)): ((rIdx % numRpsCurrTempList1) >= (NumPocStCurr0 + NumPocStCurr1));713 }714 }715 716 736 return; 717 737 } … … 724 744 #if REF_IDX_FRAMEWORK 725 745 if( m_eSliceType == I_SLICE || ( getSPS()->getLayerId() && 726 (getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA ) &&746 (getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && 727 747 (getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) ) ) 728 748 #else … … 730 750 #endif 731 751 { 732 #if REF_LIST_BUGFIX 733 return m_aiNumILRRefIdx; 752 #if REF_IDX_FRAMEWORK 753 #if JCTVC_M0458_INTERLAYER_RPS_SIG 754 return m_activeNumILRRefIdx; 755 #else 756 return getNumILRRefIdx(); 757 #endif 734 758 #else 735 759 return 0; … … 743 767 } 744 768 } 745 #if REF_ LIST_BUGFIX769 #if REF_IDX_FRAMEWORK 746 770 if(getLayerId()) 747 771 { 772 #if JCTVC_M0458_INTERLAYER_RPS_SIG 773 numRpsCurrTempList += m_activeNumILRRefIdx; 774 #else 748 775 numRpsCurrTempList += getNumILRRefIdx(); 776 #endif 749 777 } 750 778 #endif … … 793 821 } 794 822 795 Void TComSlice::checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA )823 Void TComSlice::checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA, TComList<TComPic *>& rcListPic) 796 824 { 797 825 for(Int i = 0; i < pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures(); i++) … … 806 834 if(pocCRA < MAX_UINT && getPOC() > pocCRA) 807 835 { 836 if (!pReferencePictureSet->getCheckLTMSBPresent(i)) 837 { 838 assert(xGetLongTermRefPic(rcListPic, pReferencePictureSet->getPOC(i), false)->getPOC() >= pocCRA); 839 } 840 else 841 { 808 842 assert(pReferencePictureSet->getPOC(i) >= pocCRA); 809 843 } 810 844 } 811 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) // IDR picture found 845 } 846 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) // IDR picture found 812 847 { 813 848 pocCRA = getPOC(); … … 819 854 prevRAPisBLA = false; 820 855 } 821 else if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA 822 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA NT856 else if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 857 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL 823 858 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP ) // BLA picture found 824 859 { … … 851 886 Int pocCurr = getPOC(); 852 887 853 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA 854 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA NT888 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 889 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL 855 890 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP 856 || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR 891 || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL 857 892 || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) // IDR or BLA picture 858 893 { … … 866 901 iterPic++; 867 902 } 868 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA 869 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA NT903 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 904 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL 870 905 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP ) 871 906 { … … 881 916 { 882 917 rpcPic = *(iterPic); 883 if (rpcPic->getPOC() != pocCurr && rpcPic->getPOC() != pocCRA) rpcPic->getSlice(0)->setReferenced(false); 918 if (rpcPic->getPOC() != pocCurr && rpcPic->getPOC() != pocCRA) 919 { 920 rpcPic->getSlice(0)->setReferenced(false); 921 } 884 922 iterPic++; 885 923 } … … 912 950 m_deblockingFilterTcOffsetDiv2 = pSrc->m_deblockingFilterTcOffsetDiv2; 913 951 952 #if L0034_COMBINED_LIST_CLEANUP 953 for (i = 0; i < 2; i++) 954 #else 914 955 for (i = 0; i < 3; i++) 956 #endif 915 957 { 916 958 m_aiNumRefIdx[i] = pSrc->m_aiNumRefIdx[i]; 917 959 } 918 960 961 #if L0034_COMBINED_LIST_CLEANUP 962 for (i = 0; i < MAX_NUM_REF; i++) 963 { 964 m_list1IdxToList0Idx[i] = pSrc->m_list1IdxToList0Idx[i]; 965 } 966 #else 919 967 for (i = 0; i < 2; i++) 920 968 { … … 933 981 m_bRefPicListModificationFlagLC = pSrc->m_bRefPicListModificationFlagLC; 934 982 m_bRefPicListCombinationFlag = pSrc->m_bRefPicListCombinationFlag; 983 #endif 935 984 m_bCheckLDC = pSrc->m_bCheckLDC; 936 985 m_iSliceQpDelta = pSrc->m_iSliceQpDelta; … … 958 1007 959 1008 // access channel 1009 #if SVC_EXTENSION 1010 m_pcVPS = pSrc->m_pcVPS; 1011 #if JCTVC_M0458_INTERLAYER_RPS_SIG 1012 m_activeNumILRRefIdx = pSrc->m_activeNumILRRefIdx; 1013 m_interLayerPredEnabledFlag = pSrc->m_interLayerPredEnabledFlag; 1014 m_numInterLayerRefPics = pSrc->m_numInterLayerRefPics; 1015 memcpy( m_interLayerPredLayerIdc, pSrc->m_interLayerPredLayerIdc, sizeof( m_interLayerPredLayerIdc ) ); 1016 #elif REF_IDX_FRAMEWORK 1017 m_numILRRefIdx = pSrc->m_numILRRefIdx; 1018 #endif 1019 #endif 960 1020 m_pcSPS = pSrc->m_pcSPS; 961 1021 m_pcPPS = pSrc->m_pcPPS; … … 984 1044 } 985 1045 1046 #if !L0034_COMBINED_LIST_CLEANUP 986 1047 m_bNoBackPredFlag = pSrc->m_bNoBackPredFlag; 1048 #endif 987 1049 m_uiTLayer = pSrc->m_uiTLayer; 988 1050 m_bTLayerSwitchingFlag = pSrc->m_bTLayerSwitchingFlag; … … 1018 1080 1019 1081 Int TComSlice::m_prevPOC = 0; 1082 1020 1083 /** Function for setting the slice's temporal layer ID and corresponding temporal_layer_switching_point_flag. 1021 1084 * \param uiTLayer Temporal layer ID of the current slice … … 1078 1141 Int i, isReference; 1079 1142 1080 Int j = 0;1081 1143 // loop through all pictures in the reference picture buffer 1082 1144 TComList<TComPic*>::iterator iterPic = rcListPic.begin(); 1083 1145 while ( iterPic != rcListPic.end()) 1084 1146 { 1085 j++;1086 1147 rpcPic = *(iterPic++); 1148 1149 if(!rpcPic->getSlice( 0 )->isReferenced()) 1150 { 1151 continue; 1152 } 1087 1153 1088 1154 isReference = 0; … … 1123 1189 { 1124 1190 rpcPic->getSlice( 0 )->setReferenced( false ); 1191 rpcPic->setUsedByCurr(0); 1125 1192 rpcPic->setIsLongTerm(0); 1126 1193 } … … 1128 1195 assert(rpcPic->getSlice( 0 )->isReferenced()==0||rpcPic->getUsedByCurr()==0||rpcPic->getTLayer()<=this->getTLayer()); 1129 1196 //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)1197 if(this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TLA_R || this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N) 1131 1198 { 1132 1199 assert(rpcPic->getSlice( 0 )->isReferenced()==0||rpcPic->getTLayer()<this->getTLayer()); … … 1145 1212 { 1146 1213 TComPic* rpcPic; 1147 Int i, isAvailable , j;1214 Int i, isAvailable; 1148 1215 Int atLeastOneLost = 0; 1149 1216 Int atLeastOneRemoved = 0; … … 1154 1221 for(i=pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures();i<pReferencePictureSet->getNumberOfPictures();i++) 1155 1222 { 1156 j = 0;1157 1223 isAvailable = 0; 1158 1224 // loop through all pictures in the reference picture buffer … … 1160 1226 while ( iterPic != rcListPic.end()) 1161 1227 { 1162 j++;1163 1228 rpcPic = *(iterPic++); 1164 1229 if(pReferencePictureSet->getCheckLTMSBPresent(i)==true) … … 1183 1248 while ( iterPic != rcListPic.end()) 1184 1249 { 1185 j++;1186 1250 rpcPic = *(iterPic++); 1187 1251 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()) 1252 Int pocCycle = 1 << rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC(); 1253 Int curPoc = rpcPic->getPicSym()->getSlice(0)->getPOC(); 1254 Int refPoc = pReferencePictureSet->getPOC(i); 1255 if (!pReferencePictureSet->getCheckLTMSBPresent(i)) 1256 { 1257 curPoc = curPoc % pocCycle; 1258 refPoc = refPoc % pocCycle; 1259 } 1260 1261 if (rpcPic->getSlice(0)->isReferenced() && curPoc == refPoc) 1189 1262 { 1190 1263 isAvailable = 1; … … 1224 1297 for(i=0;i<pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures();i++) 1225 1298 { 1226 j = 0;1227 1299 isAvailable = 0; 1228 1300 // loop through all pictures in the reference picture buffer … … 1230 1302 while ( iterPic != rcListPic.end()) 1231 1303 { 1232 j++;1233 1304 rpcPic = *(iterPic++); 1234 1305 … … 1247 1318 { 1248 1319 if(printErrors) 1320 { 1249 1321 printf("\nShort-term reference picture with POC = %3d seems to have been removed or not correctly decoded.", this->getPOC() + pReferencePictureSet->getDeltaPOC(i)); 1322 } 1250 1323 atLeastOneRemoved = 1; 1251 1324 } … … 1253 1326 { 1254 1327 if(printErrors) 1328 { 1255 1329 printf("\nShort-term reference picture with POC = %3d is lost or not correctly decoded!", this->getPOC() + pReferencePictureSet->getDeltaPOC(i)); 1330 } 1256 1331 atLeastOneLost = 1; 1257 1332 iPocLost=this->getPOC() + pReferencePictureSet->getDeltaPOC(i); … … 1399 1474 * \returns Void 1400 1475 */ 1401 Void TComSlice::resetWpScaling( wpScalingParam wp[2][MAX_NUM_REF][3])1476 Void TComSlice::resetWpScaling() 1402 1477 { 1403 1478 for ( Int e=0 ; e<2 ; e++ ) … … 1407 1482 for ( Int yuv=0 ; yuv<3 ; yuv++ ) 1408 1483 { 1409 wpScalingParam *pwp = &( wp[e][i][yuv]);1484 wpScalingParam *pwp = &(m_weightPredTable[e][i][yuv]); 1410 1485 pwp->bPresentFlag = false; 1411 1486 pwp->uiLog2WeightDenom = 0; … … 1423 1498 Void TComSlice::initWpScaling() 1424 1499 { 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 1500 for ( Int e=0 ; e<2 ; e++ ) 1435 1501 { … … 1438 1504 for ( Int yuv=0 ; yuv<3 ; yuv++ ) 1439 1505 { 1440 wpScalingParam *pwp = &(wp[e][i][yuv]); 1441 if ( !pwp->bPresentFlag ) { 1506 wpScalingParam *pwp = &(m_weightPredTable[e][i][yuv]); 1507 if ( !pwp->bPresentFlag ) 1508 { 1442 1509 // Inferring values not present : 1443 1510 pwp->iWeight = (1 << pwp->uiLog2WeightDenom); … … 1477 1544 , m_numOutputLayerSets (0) 1478 1545 #endif 1479 { 1480 1546 #if VPS_PROFILE_OUTPUT_LAYERS 1547 , m_numProfileTierLevel (0) 1548 , m_moreOutputLayerSetsThanDefaultFlag (false) 1549 , m_numAddOutputLayerSets (0) 1550 , m_defaultOneTargetOutputLayerFlag (false) 1551 #endif 1552 { 1481 1553 for( Int i = 0; i < MAX_TLAYER; i++) 1482 1554 { 1483 1555 m_numReorderPics[i] = 0; 1556 #if L0323_DPB 1557 m_uiMaxDecPicBuffering[i] = 1; 1558 #else 1484 1559 m_uiMaxDecPicBuffering[i] = 0; 1560 #endif 1485 1561 m_uiMaxLatencyIncrease[i] = 0; 1486 1562 } … … 1512 1588 ::memset(m_refLayerId, 0, sizeof(m_refLayerId )); 1513 1589 #endif 1590 #if DERIVE_LAYER_ID_LIST_VARIABLES 1591 ::memset(m_layerSetLayerIdList, 0, sizeof(m_layerSetLayerIdList)); 1592 ::memset(m_numLayerInIdList, 0, sizeof(m_numLayerInIdList )); 1593 #endif 1594 #if VPS_PROFILE_OUTPUT_LAYERS 1595 ::memset(m_profileLevelTierIdx, 0, sizeof(m_profileLevelTierIdx)); 1596 #endif 1597 #if JCTVC_M0458_INTERLAYER_RPS_SIG 1598 m_maxOneActiveRefLayerFlag = true; 1599 #endif 1514 1600 } 1515 1601 1516 1602 TComVPS::~TComVPS() 1517 1603 { 1518 if( m_hrdParameters != NULL ) delete m_hrdParameters; 1519 if( m_hrdOpSetIdx != NULL ) delete m_hrdOpSetIdx; 1520 if( m_cprmsPresentFlag != NULL ) delete m_cprmsPresentFlag; 1521 } 1522 1604 if( m_hrdParameters != NULL ) delete[] m_hrdParameters; 1605 if( m_hrdOpSetIdx != NULL ) delete[] m_hrdOpSetIdx; 1606 if( m_cprmsPresentFlag != NULL ) delete[] m_cprmsPresentFlag; 1607 } 1608 #if DERIVE_LAYER_ID_LIST_VARIABLES 1609 Void TComVPS::deriveLayerIdListVariables() 1610 { 1611 // For layer 0 1612 setNumLayersInIdList(0, 1); 1613 setLayerSetLayerIdList(0, 0, 0); 1614 1615 // For other layers 1616 Int i, m, n; 1617 for( i = 1; i <= getNumLayerSets() - 1; i++ ) 1618 { 1619 n = 0; 1620 for( m = 0; m <= this->getMaxLayerId(); m++) 1621 { 1622 if(this->getLayerIdIncludedFlag(i, m)) 1623 { 1624 setLayerSetLayerIdList(i, n, m); 1625 n++; 1626 } 1627 } 1628 setNumLayersInIdList(i, n); 1629 } 1630 } 1631 #endif 1523 1632 // ------------------------------------------------------------------------------------------------ 1524 1633 // Sequence parameter set (SPS) … … 1533 1642 , m_picWidthInLumaSamples (352) 1534 1643 , m_picHeightInLumaSamples (288) 1644 , m_log2MinCodingBlockSize ( 0) 1645 , m_log2DiffMaxMinCodingBlockSize (0) 1535 1646 , m_uiMaxCUWidth ( 32) 1536 1647 , m_uiMaxCUHeight ( 32) 1537 1648 , m_uiMaxCUDepth ( 3) 1538 , m_uiMinTrDepth ( 0)1539 , m_uiMaxTrDepth ( 1)1540 1649 , m_bLongTermRefsPresent (false) 1541 1650 , m_uiQuadtreeTULog2MaxSize ( 0) … … 1547 1656 , m_pcmLog2MaxSize ( 5) 1548 1657 , m_uiPCMLog2MinSize ( 7) 1658 #if !L0034_COMBINED_LIST_CLEANUP 1549 1659 , m_bUseLComb (false) 1660 #endif 1550 1661 , m_bitDepthY ( 8) 1551 1662 , m_bitDepthC ( 8) … … 1572 1683 { 1573 1684 m_uiMaxLatencyIncrease[i] = 0; 1685 #if L0323_DPB 1686 m_uiMaxDecPicBuffering[i] = 1; 1687 #else 1574 1688 m_uiMaxDecPicBuffering[i] = 0; 1689 #endif 1575 1690 m_numReorderPics[i] = 0; 1576 1691 } … … 1591 1706 m_RPSList.create(numRPS); 1592 1707 } 1708 1593 1709 Void TComSPS::setHrdParameters( UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess ) 1594 1710 { … … 1835 1951 return m_POC[bufferNum]; 1836 1952 } 1953 1837 1954 Void TComReferencePictureSet::setPOC(Int bufferNum, Int POC) 1838 1955 { 1839 1956 m_POC[bufferNum] = POC; 1840 1957 } 1958 1841 1959 Bool TComReferencePictureSet::getCheckLTMSBPresent(Int bufferNum) 1842 1960 { 1843 1961 return m_bCheckLTMSB[bufferNum]; 1844 1962 } 1963 1845 1964 Void TComReferencePictureSet::setCheckLTMSBPresent(Int bufferNum, Bool b) 1846 1965 { … … 2022 2141 return (defaultCounter == (SCALING_LIST_NUM * SCALING_LIST_SIZE_NUM - 4)) ? false : true; // -4 for 32x32 2023 2142 } 2143 2024 2144 /** get scaling matrix from RefMatrixID 2025 2145 * \param sizeId size index … … 2031 2151 ::memcpy(getScalingListAddress(sizeId, listId),((listId == refListId)? getScalingListDefaultAddress(sizeId, refListId): getScalingListAddress(sizeId, refListId)),sizeof(Int)*min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId])); 2032 2152 } 2153 2033 2154 /** parse syntax infomation 2034 2155 * \param pchFile syntax infomation … … 2123 2244 m_scalingListCoef[SCALING_LIST_32x32][3] = m_scalingListCoef[SCALING_LIST_32x32][1]; // copy address for 32x32 2124 2245 } 2246 2125 2247 /** destroy quantization matrix array 2126 2248 */ … … 2135 2257 } 2136 2258 } 2259 2137 2260 /** get default address of quantization matrix 2138 2261 * \param sizeId size index … … 2164 2287 return src; 2165 2288 } 2289 2166 2290 /** process of default matrix 2167 2291 * \param sizeId size index … … 2173 2297 setScalingListDC(sizeId,listId,SCALING_LIST_DC); 2174 2298 } 2299 2175 2300 /** check DC value of matrix for default matrix signaling 2176 2301 */ … … 2240 2365 //! activate a PPS and depending on isIDR parameter also SPS and VPS 2241 2366 //! \returns true, if activation is successful 2242 Bool ParameterSetManager::activatePPS(Int ppsId, Bool isI DR)2367 Bool ParameterSetManager::activatePPS(Int ppsId, Bool isIRAP) 2243 2368 { 2244 2369 TComPPS *pps = m_ppsMap.getPS(ppsId); … … 2246 2371 { 2247 2372 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.");2373 if (!isIRAP && (spsId != m_activeSPSId)) 2374 { 2375 printf("Warning: tried to activate PPS referring to a inactive SPS at non-IRAP."); 2251 2376 return false; 2252 2377 } … … 2255 2380 { 2256 2381 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.");2382 if (!isIRAP && (vpsId != m_activeVPSId)) 2383 { 2384 printf("Warning: tried to activate PPS referring to a inactive VPS at non-IRAP."); 2260 2385 return false; 2261 2386 } … … 2345 2470 // Assumed that RPL of the base layer is same to the EL, otherwise this information should be also dumped and read from the metadata file 2346 2471 setPOC( pcSlice->getPOC() ); 2347 if( pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA && pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA )2472 if( pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA ) 2348 2473 { 2349 2474 setSliceType( I_SLICE ); … … 2395 2520 #endif 2396 2521 2397 #if REF_IDX_FRAMEWORK2398 Void TComSlice::addRefPicList( TComPic **pIlpPicList, Int iRefPicNum, Int iInsertOffset )2399 {2400 if(getSPS()->getLayerId() && m_eSliceType != I_SLICE)2401 {2402 #if REF_IDX_MFM2403 assert(iRefPicNum == 1);2404 #if RAP_MFM_INIT2405 if(!(getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA && getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) && getSPS()->getMFMEnabledFlag())2406 #else2407 if( getPOC() != 0 )2408 #endif2409 {2410 pIlpPicList[0]->copyUpsampledMvField(getBaseColPic());2411 }2412 #if RAP_MFM_INIT2413 else2414 {2415 pIlpPicList[0]->initUpsampledMvField();2416 }2417 #endif2418 #endif2419 //add to list 0;2420 Int iOffset;2421 m_aiNumRefIdx[REF_PIC_LIST_0] += iInsertOffset;2422 iOffset = m_aiNumRefIdx[REF_PIC_LIST_0];2423 for (Int i=0; i<iRefPicNum; i++)2424 {2425 pIlpPicList[i]->setIsLongTerm(1); //mark ilp as long-term reference2426 m_bIsUsedAsLongTerm[REF_PIC_LIST_0][iOffset + i] = 1; //mark ilp as long-term reference2427 m_apcRefPicList[REF_PIC_LIST_0][iOffset + i] = pIlpPicList[i];2428 m_aiNumRefIdx[REF_PIC_LIST_0]++;2429 //m_aiNumRefIdx[REF_PIC_LIST_C]++;2430 }2431 if(m_eSliceType == B_SLICE)2432 {2433 m_aiNumRefIdx[REF_PIC_LIST_1] += iInsertOffset;2434 iOffset = m_aiNumRefIdx[REF_PIC_LIST_1];2435 for (Int i=0; i<iRefPicNum; i++)2436 {2437 pIlpPicList[i]->setIsLongTerm(1); //mark ilp as long-term reference2438 m_bIsUsedAsLongTerm[REF_PIC_LIST_1][iOffset + i] = 1; //mark ilp as long-term reference2439 m_apcRefPicList[REF_PIC_LIST_1][iOffset + i] = pIlpPicList[i];2440 m_aiNumRefIdx[REF_PIC_LIST_1]++;2441 //m_aiNumRefIdx[REF_PIC_LIST_C]++;2442 }2443 }2444 }2445 }2446 2447 2522 #if REF_IDX_MFM 2448 2523 Void TComSlice::setRefPOCListILP( TComPic** ilpPic, TComPic *pcRefPicBL ) … … 2453 2528 assert(thePoc == pcRefPicBL->getPOC()); 2454 2529 2455 #if REUSE_MVSCALE || REUSE_BLKMAPPING2456 2530 ilpPic[0]->getSlice(0)->setBaseColPic( pcRefPicBL ); 2457 #endif2458 2531 2459 2532 //copy reference pictures marking from the reference layer … … 2486 2559 #endif 2487 2560 2488 2489 #endif2490 2561 //! \} -
trunk/source/Lib/TLibCommon/TComSlice.h
r125 r189 504 504 Bool m_layerIdIncludedFlag[MAX_VPS_OP_SETS_PLUS1][MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1]; 505 505 #endif 506 506 #if DERIVE_LAYER_ID_LIST_VARIABLES 507 Int m_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 508 Int m_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1]; 509 #endif 507 510 TComPTL m_pcPTL; 508 511 #if SIGNAL_BITRATE_PICRATE_IN_VPS … … 547 550 UInt m_refLayerId[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 548 551 #endif 549 552 #if VPS_PROFILE_OUTPUT_LAYERS 553 UInt m_numProfileTierLevel; 554 Bool m_moreOutputLayerSetsThanDefaultFlag; 555 Int m_numAddOutputLayerSets; 556 Bool m_defaultOneTargetOutputLayerFlag; 557 Int m_profileLevelTierIdx[64]; 558 #endif 559 #if JCTVC_M0458_INTERLAYER_RPS_SIG 560 Bool m_maxOneActiveRefLayerFlag; 561 #endif 550 562 public: 551 563 TComVPS(); … … 604 616 Bool getLayerIdIncludedFlag(UInt opsIdx, UInt id) { return m_layerIdIncludedFlag[opsIdx][id]; } 605 617 Void setLayerIdIncludedFlag(Bool v, UInt opsIdx, UInt id) { m_layerIdIncludedFlag[opsIdx][id] = v; } 606 618 #if DERIVE_LAYER_ID_LIST_VARIABLES 619 Int getLayerSetLayerIdList(Int set, Int layerId) { return m_layerSetLayerIdList[set][layerId]; } 620 Void setLayerSetLayerIdList(Int set, Int layerId, Int x) { m_layerSetLayerIdList[set][layerId] = x ; } 621 622 Int getNumLayersInIdList(Int set) { return m_numLayerInIdList[set]; } 623 Void setNumLayersInIdList(Int set, Int x) { m_numLayerInIdList[set] = x ; } 624 625 Void deriveLayerIdListVariables(); 626 #endif 607 627 TComPTL* getPTL() { return &m_pcPTL; } 608 628 #if SIGNAL_BITRATE_PICRATE_IN_VPS … … 663 683 #if VPS_EXTN_DIRECT_REF_LAYERS 664 684 // Direct dependency of layers 665 Bool getDirectDependencyFlag(Int i, Int j) { return m_directDependencyFlag[i][j]; } 666 Void setDirectDependencyFlag(Int i, Int j, Bool x) { m_directDependencyFlag[i][j] = x; } 667 668 UInt getNumDirectRefLayers(Int i) { return m_numDirectRefLayers[i]; } 669 Void setNumDirectRefLayers(Int i, UInt x) { m_numDirectRefLayers[i] = x; } 670 671 UInt getRefLayerId(Int i, Int j) { return m_refLayerId[i][j]; } 672 Void setRefLayerId(Int i, Int j, UInt x) { m_refLayerId[i][j] = x; } 673 #endif 685 Bool getDirectDependencyFlag(Int currLayerId, Int refLayerId) { return m_directDependencyFlag[currLayerId][refLayerId]; } 686 Void setDirectDependencyFlag(Int currLayerId, Int refLayerId, Bool x) { m_directDependencyFlag[currLayerId][refLayerId] = x; } 687 688 UInt getNumDirectRefLayers(Int layerId) { return m_numDirectRefLayers[layerId]; } 689 Void setNumDirectRefLayers(Int layerId, UInt refLayerNum) { m_numDirectRefLayers[layerId] = refLayerNum; } 690 691 UInt getRefLayerId(Int layerId, Int refLayerIdx) { return m_refLayerId[layerId][refLayerIdx]; } 692 Void setRefLayerId(Int layerId, Int refLayerIdx, UInt refLayerId) { m_refLayerId[layerId][refLayerIdx] = refLayerId; } 693 #endif 694 #if VPS_PROFILE_OUTPUT_LAYERS 695 UInt getNumProfileTierLevel() { return m_numProfileTierLevel; } 696 Void setNumProfileTierLevel(Int x) { m_numProfileTierLevel = x; } 697 698 Bool getMoreOutputLayerSetsThanDefaultFlag() { return m_moreOutputLayerSetsThanDefaultFlag;} 699 Void setMoreOutputLayerSetsThanDefaultFlag(Bool x) { m_moreOutputLayerSetsThanDefaultFlag = x ;} 700 701 Int getNumAddOutputLayerSets() { return m_numAddOutputLayerSets; } 702 Void setNumAddOutputLayerSets(Int x) { m_numAddOutputLayerSets = x ; } 703 704 Bool getDefaultOneTargetOutputLayerFlag() { return m_defaultOneTargetOutputLayerFlag;} 705 Void setDefaultOneTargetOutputLayerFlag(Bool x) { m_defaultOneTargetOutputLayerFlag= x ;} 706 707 Int getProfileLevelTierIdx(Int i) { return m_profileLevelTierIdx[i]; } 708 Void setProfileLevelTierIdx(Int i, Int x) { m_profileLevelTierIdx[i] = x ; } 709 #endif 710 #if JCTVC_M0458_INTERLAYER_RPS_SIG 711 Bool getMaxOneActiveRefLayerFlag() { return m_maxOneActiveRefLayerFlag; } 712 Void setMaxOneActiveRefLayerFlag(Bool x) { m_maxOneActiveRefLayerFlag = x; } 713 #endif 674 714 }; 675 715 … … 908 948 UInt m_picHeightInLumaSamples; 909 949 910 Window m_conformanceWindow;911 950 Int m_log2MinCodingBlockSize; 951 Int m_log2DiffMaxMinCodingBlockSize; 912 952 UInt m_uiMaxCUWidth; 913 953 UInt m_uiMaxCUHeight; 914 954 UInt m_uiMaxCUDepth; 915 UInt m_uiMinTrDepth; 916 UInt m_uiMaxTrDepth; 955 956 Window m_conformanceWindow; 957 917 958 TComRPSList m_RPSList; 918 959 Bool m_bLongTermRefsPresent; … … 930 971 Bool m_useAMP; 931 972 973 #if !L0034_COMBINED_LIST_CLEANUP 932 974 Bool m_bUseLComb; 975 #endif 933 976 934 977 // Parameter … … 978 1021 Bool m_bMFMEnabledFlag; 979 1022 #endif 1023 #if SCALED_REF_LAYER_OFFSETS 1024 Window m_scaledRefLayerWindow; 1025 #endif 980 1026 public: 981 1027 TComSPS(); … … 1009 1055 Bool getUsedByCurrPicLtSPSFlag(Int i) {return m_usedByCurrPicLtSPSFlag[i];} 1010 1056 Void setUsedByCurrPicLtSPSFlag(Int i, Bool x) { m_usedByCurrPicLtSPSFlag[i] = x;} 1057 1058 Int getLog2MinCodingBlockSize() const { return m_log2MinCodingBlockSize; } 1059 Void setLog2MinCodingBlockSize(Int val) { m_log2MinCodingBlockSize = val; } 1060 Int getLog2DiffMaxMinCodingBlockSize() const { return m_log2DiffMaxMinCodingBlockSize; } 1061 Void setLog2DiffMaxMinCodingBlockSize(Int val) { m_log2DiffMaxMinCodingBlockSize = val; } 1062 1011 1063 Void setMaxCUWidth ( UInt u ) { m_uiMaxCUWidth = u; } 1012 1064 UInt getMaxCUWidth () { return m_uiMaxCUWidth; } … … 1025 1077 Bool getUseAMP() { return m_useAMP; } 1026 1078 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 1079 Void setQuadtreeTULog2MaxSize( UInt u ) { m_uiQuadtreeTULog2MaxSize = u; } 1032 1080 UInt getQuadtreeTULog2MaxSize() { return m_uiQuadtreeTULog2MaxSize; } … … 1050 1098 1051 1099 // Tool list 1100 #if !L0034_COMBINED_LIST_CLEANUP 1052 1101 Void setUseLComb (Bool b) { m_bUseLComb = b; } 1053 1102 Bool getUseLComb () { return m_bUseLComb; } 1103 #endif 1054 1104 1055 1105 Bool getUseLossless () { return m_useLossless; } … … 1112 1162 Void setMFMEnabledFlag(Bool flag) {m_bMFMEnabledFlag = flag;} 1113 1163 Bool getMFMEnabledFlag() {return m_bMFMEnabledFlag;} 1164 #endif 1165 #if SCALED_REF_LAYER_OFFSETS 1166 Window& getScaledRefLayerWindow( ) { return m_scaledRefLayerWindow; } 1114 1167 #endif 1115 1168 }; … … 1370 1423 Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter 1371 1424 Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter 1372 1425 #if JCTVC_M0458_INTERLAYER_RPS_SIG 1426 Int m_activeNumILRRefIdx; //< Active inter-layer reference pictures 1427 Int m_interLayerPredLayerIdc [MAX_VPS_LAYER_ID_PLUS1]; 1428 #else 1429 #if REF_IDX_FRAMEWORK 1430 Int m_numILRRefIdx; //< for inter-layer reference picture ser 1431 #endif 1432 #endif 1433 #if L0034_COMBINED_LIST_CLEANUP 1434 Int m_list1IdxToList0Idx[MAX_NUM_REF]; 1435 Int m_aiNumRefIdx [2]; // for multiple reference of current slice 1436 #else 1373 1437 Int m_aiNumRefIdx [3]; // for multiple reference of current slice 1374 1375 #if REF_LIST_BUGFIX1376 Int m_aiNumILRRefIdx; //< for inter-layer reference picture ser1377 #endif1378 1379 1438 Int m_iRefIdxOfLC[2][MAX_NUM_REF_LC]; 1380 1439 Int m_eListIdFromIdxOfLC[MAX_NUM_REF_LC]; … … 1384 1443 Bool m_bRefPicListModificationFlagLC; 1385 1444 Bool m_bRefPicListCombinationFlag; 1445 #endif 1386 1446 1387 1447 Bool m_bCheckLDC; … … 1421 1481 1422 1482 Bool m_abEqualRef [2][MAX_NUM_REF][MAX_NUM_REF]; 1423 1483 #if !L0034_COMBINED_LIST_CLEANUP 1424 1484 Bool m_bNoBackPredFlag; 1485 #endif 1425 1486 UInt m_uiTLayer; 1426 1487 #if SVC_EXTENSION … … 1462 1523 1463 1524 Bool m_enableTMVPFlag; 1525 #if JCTVC_M0458_INTERLAYER_RPS_SIG 1526 Bool m_interLayerPredEnabledFlag; 1527 Int m_numInterLayerRefPics; 1528 #endif 1464 1529 public: 1465 1530 TComSlice(); … … 1517 1582 Int getDeblockingFilterBetaOffsetDiv2() { return m_deblockingFilterBetaOffsetDiv2; } 1518 1583 Int getDeblockingFilterTcOffsetDiv2() { return m_deblockingFilterTcOffsetDiv2; } 1519 #if REF_LIST_BUGFIX 1520 Int getNumILRRefIdx ( ) { return m_aiNumILRRefIdx; } 1521 Void setNumILRRefIdx ( Int i ) { m_aiNumILRRefIdx = i; } 1522 #endif 1584 1523 1585 Int getNumRefIdx ( RefPicList e ) { return m_aiNumRefIdx[e]; } 1524 1586 TComPic* getPic () { return m_pcPic; } … … 1533 1595 Bool getMvdL1ZeroFlag () { return m_bLMvdL1Zero; } 1534 1596 Int getNumRpsCurrTempList(); 1597 #if L0034_COMBINED_LIST_CLEANUP 1598 Int getList1IdxToList0Idx ( Int list1Idx ) { return m_list1IdxToList0Idx[list1Idx]; } 1599 #else 1535 1600 Int getRefIdxOfLC (RefPicList e, Int iRefIdx) { return m_iRefIdxOfLC[e][iRefIdx]; } 1536 1601 Int getListIdFromIdxOfLC(Int iRefIdx) { return m_eListIdFromIdxOfLC[iRefIdx]; } … … 1542 1607 Bool getRefPicListCombinationFlag() {return m_bRefPicListCombinationFlag;} 1543 1608 Void setRefPicListCombinationFlag(Bool bflag) {m_bRefPicListCombinationFlag=bflag;} 1609 #endif 1544 1610 Void setReferenced(Bool b) { m_bRefenced = b; } 1545 1611 Bool isReferenced() { return m_bRefenced; } 1546 1612 Void setPOC ( Int i ) { m_iPOC = i; if(getTLayer()==0) m_prevPOC=i; } 1547 1613 Void setNalUnitType ( NalUnitType e ) { m_eNalUnitType = e; } 1548 NalUnitType getNalUnitType () 1614 NalUnitType getNalUnitType () const { return m_eNalUnitType; } 1549 1615 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); 1616 Bool getIdrPicFlag () { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; } 1617 Bool isIRAP () const { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); } 1618 Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA, TComList<TComPic *>& rcListPic); 1552 1619 Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic); 1553 1620 Void setSliceType ( SliceType e ) { m_eSliceType = e; } … … 1569 1636 Void setPic ( TComPic* p ) { m_pcPic = p; } 1570 1637 Void setDepth ( Int iDepth ) { m_iDepth = iDepth; } 1571 1572 #if SVC_EXTENSION 1573 Void setBaseColPic ( TComPic* p) { m_pcBaseColPic = p; } 1574 Void setBaseColPic ( TComList<TComPic*>& rcListPic , UInt layerID ); 1575 TComPic* getBaseColPic () { return m_pcBaseColPic; } 1576 1577 Void setLayerId (UInt layerId) { m_layerId = layerId; } 1578 UInt getLayerId () { return m_layerId; } 1579 1580 Void setFullPelBaseRec ( TComPicYuv* p) { m_pcFullPelBaseRec = p; } 1581 TComPicYuv* getFullPelBaseRec () { return m_pcFullPelBaseRec; } 1582 1583 #if AVC_SYNTAX 1584 Void initBaseLayerRPL( TComSlice *pcSlice ); 1585 #endif 1586 #endif 1587 1588 #if REF_IDX_MFM 1589 Void setRefPOCListILP(TComPic** ilpPic, TComPic *pcRefPicBL); 1590 #endif 1591 1638 1639 #if FIX1071 1640 Void setRefPicList ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false, TComPic** ilpPic = NULL ); 1641 #else 1592 1642 Void setRefPicList ( TComList<TComPic*>& rcListPic ); 1643 #endif 1593 1644 Void setRefPOCList (); 1594 1645 Void setColFromL0Flag ( UInt colFromL0 ) { m_colFromL0Flag = colFromL0; } … … 1596 1647 Void setCheckLDC ( Bool b ) { m_bCheckLDC = b; } 1597 1648 Void setMvdL1ZeroFlag ( Bool b) { m_bLMvdL1Zero = b; } 1598 1599 #if REF_LIST_BUGFIX1600 Void setRefPicListModificationSvc();1601 Void setRefPicListSvc ( TComList<TComPic*>& rcListPic, TComPic** ilpPic );1602 #endif1603 1649 1604 1650 Bool isIntra () { return m_eSliceType == I_SLICE; } … … 1628 1674 1629 1675 static Void sortPicList ( TComList<TComPic*>& rcListPic ); 1630 1676 #if L0034_COMBINED_LIST_CLEANUP 1677 Void setList1IdxToList0Idx(); 1678 #else 1631 1679 Bool getNoBackPredFlag() { return m_bNoBackPredFlag; } 1632 1680 Void setNoBackPredFlag( Bool b ) { m_bNoBackPredFlag = b; } 1633 1681 Void generateCombinedList (); 1682 #endif 1634 1683 1635 1684 UInt getTLayer () { return m_uiTLayer; } … … 1679 1728 Void getWpScaling ( RefPicList e, Int iRefIdx, wpScalingParam *&wp); 1680 1729 1681 Void resetWpScaling (wpScalingParam wp[2][MAX_NUM_REF][3]); 1682 Void initWpScaling (wpScalingParam wp[2][MAX_NUM_REF][3]); 1730 Void resetWpScaling (); 1683 1731 Void initWpScaling (); 1684 1732 inline Bool applyWP () { return( (m_eSliceType==P_SLICE && m_pcPPS->getUseWP()) || (m_eSliceType==B_SLICE && m_pcPPS->getWPBiPred()) ); } … … 1714 1762 Void setEnableTMVPFlag ( Bool b ) { m_enableTMVPFlag = b; } 1715 1763 Bool getEnableTMVPFlag () { return m_enableTMVPFlag;} 1764 1765 #if SVC_EXTENSION 1766 Void setBaseColPic ( TComList<TComPic*>& rcListPic , UInt layerID ); 1767 Void setBaseColPic ( TComPic* p) { m_pcBaseColPic = p; } 1768 TComPic* getBaseColPic () { return m_pcBaseColPic; } 1769 1770 Void setLayerId (UInt layerId) { m_layerId = layerId; } 1771 UInt getLayerId () { return m_layerId; } 1772 1773 Void setFullPelBaseRec ( TComPicYuv* p) { m_pcFullPelBaseRec = p; } 1774 TComPicYuv* getFullPelBaseRec () { return m_pcFullPelBaseRec; } 1775 1776 #if AVC_SYNTAX 1777 Void initBaseLayerRPL( TComSlice *pcSlice ); 1778 #endif 1779 1716 1780 #if REF_IDX_FRAMEWORK 1717 Void addRefPicList( TComPic **pIlpPicList, Int iRefPicNum, Int iInsertOffset=0 ); 1718 #endif 1781 Void setRefPicListModificationSvc(); 1782 Int getNumILRRefIdx ( ) { return m_pcVPS->getNumDirectRefLayers( m_layerId ); } 1783 1784 #if REF_IDX_MFM 1785 Void setRefPOCListILP(TComPic** ilpPic, TComPic *pcRefPicBL); 1786 #endif 1787 1788 #if JCTVC_M0458_INTERLAYER_RPS_SIG 1789 Int getActiveNumILRRefIdx ( ) { return m_activeNumILRRefIdx; } 1790 Void setActiveNumILRRefIdx ( Int i ) { m_activeNumILRRefIdx = i; } 1791 1792 Int getInterLayerPredLayerIdc (UInt Idx ) { return m_interLayerPredLayerIdc[Idx];} 1793 Void setInterLayerPredLayerIdc (UInt val, UInt Idx) { m_interLayerPredLayerIdc[Idx] = val; } 1794 1795 Void setInterLayerPredEnabledFlag ( Bool val ) { m_interLayerPredEnabledFlag = val; } 1796 Bool getInterLayerPredEnabledFlag () { return m_interLayerPredEnabledFlag;} 1797 1798 Void setNumInterLayerRefPics ( UInt val ) { m_numInterLayerRefPics = val; } 1799 UInt getNumInterLayerRefPics () { return m_numInterLayerRefPics;} 1800 #else 1801 Void setNumILRRefIdx ( Int i ) { m_numILRRefIdx = i; } 1802 #endif 1803 #endif 1804 1805 #endif //SVC_EXTENSION 1806 1719 1807 protected: 1720 1808 TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, 1721 1809 Int poc); 1722 TComPic* xGetLongTermRefPic (TComList<TComPic*>& rcListPic, 1723 Int poc); 1810 TComPic* xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb); 1724 1811 };// END CLASS DEFINITION TComSlice 1725 1812 … … 1805 1892 //! activate a PPS and depending on isIDR parameter also SPS and VPS 1806 1893 //! \returns true, if activation is successful 1807 Bool activatePPS(Int ppsId, Bool isI DR);1894 Bool activatePPS(Int ppsId, Bool isIRAP); 1808 1895 1809 1896 TComVPS* getActiveVPS(){ return m_vpsMap.getPS(m_activeVPSId); }; -
trunk/source/Lib/TLibCommon/TComTrQuant.cpp
r125 r189 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; -
trunk/source/Lib/TLibCommon/TComUpsampleFilter.cpp
r125 r189 128 128 } 129 129 130 #if SCALED_REF_LAYER_OFFSETS 131 Void TComUpsampleFilter::upsampleBasePic( TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window ) 132 #else 130 133 Void TComUpsampleFilter::upsampleBasePic( TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic ) 134 #endif 131 135 { 132 136 assert ( NTAPS_US_LUMA == 8 ); … … 136 140 137 141 //========== Y component upsampling =========== 142 #if SCALED_REF_LAYER_OFFSETS 143 const Window &scalEL = window; 144 145 Int widthBL = pcBasePic->getWidth (); 146 Int heightBL = pcBasePic->getHeight(); 147 Int strideBL = pcBasePic->getStride(); 148 149 Int widthEL = pcUsPic->getWidth () - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset(); 150 Int heightEL = pcUsPic->getHeight() - scalEL.getWindowTopOffset() - scalEL.getWindowBottomOffset(); 151 Int strideEL = pcUsPic->getStride(); 152 #else 138 153 const Window &confBL = pcBasePic->getConformanceWindow(); 139 154 const Window &confEL = pcUsPic->getConformanceWindow(); … … 146 161 Int heightEL = pcUsPic->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset(); 147 162 Int strideEL = pcUsPic->getStride(); 148 163 #endif 149 164 Pel* piTempBufY = pcTempPic->getLumaAddr(); 150 165 Pel* piSrcBufY = pcBasePic->getLumaAddr(); … … 329 344 const Double sFactor12 = sFactor * 12; 330 345 #endif 346 #if ILP_DECODED_PICTURE 347 widthBL = pcBasePic->getWidth (); 348 heightBL = pcBasePic->getHeight(); 349 350 widthEL = pcUsPic->getWidth (); 351 heightEL = pcUsPic->getHeight(); 352 #endif 353 #if SCALED_REF_LAYER_OFFSETS 354 Int leftStartL = scalEL.getWindowLeftOffset(); 355 Int rightEndL = pcUsPic->getWidth() - scalEL.getWindowRightOffset(); 356 Int topStartL = scalEL.getWindowTopOffset(); 357 Int bottomEndL = pcUsPic->getHeight() - scalEL.getWindowBottomOffset(); 358 #endif 331 359 332 360 //========== horizontal upsampling =========== 333 361 for( i = 0; i < widthEL; i++ ) 334 362 { 363 #if SCALED_REF_LAYER_OFFSETS 364 Int x = Clip3( leftStartL, rightEndL - 1, i ); 365 #endif 335 366 #if PHASE_DERIVATION_IN_INTEGER 367 #if SCALED_REF_LAYER_OFFSETS 368 refPos16 = (((x - leftStartL)*scaleX + addX) >> shiftXM4) - deltaX; 369 #else 336 370 refPos16 = ((i*scaleX + addX) >> shiftXM4) - deltaX; 371 #endif 337 372 phase = refPos16 & 15; 338 373 refPos = refPos16 >> 4; … … 366 401 Int iOffset = 1 << (nShift - 1); 367 402 403 #if SCALED_REF_LAYER_OFFSETS 404 for( j = 0; j < pcTempPic->getHeight(); j++ ) 405 #else 368 406 for( j = 0; j < heightEL; j++ ) 369 { 407 #endif 408 { 409 #if SCALED_REF_LAYER_OFFSETS 410 Int y = Clip3(topStartL, bottomEndL - 1, j); 411 #endif 370 412 #if PHASE_DERIVATION_IN_INTEGER 413 #if SCALED_REF_LAYER_OFFSETS 414 refPos16 = ((( y - topStartL )*scaleY + addY) >> shiftYM4) - deltaY; 415 #else 371 416 refPos16 = ((j*scaleY + addY) >> shiftYM4) - deltaY; 417 #endif 372 418 phase = refPos16 & 15; 373 419 refPos = refPos16 >> 4; … … 382 428 piSrcY = piTempBufY + (refPos -((NTAPS_US_LUMA>>1) - 1))*strideEL; 383 429 piDstY = piDstBufY + j * strideEL; 384 430 #if SCALED_REF_LAYER_OFFSETS 431 for( i = 0; i < pcTempPic->getWidth(); i++ ) 432 #else 385 433 for( i = 0; i < widthEL; i++ ) 434 #endif 386 435 { 387 436 *piDstY = ClipY( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift)); 437 #if SCALED_REF_LAYER_OFFSETS 438 // Only increase the x position of reference upsample picture when within the window 439 // "-2" to ensure that pointer doesn't go beyond the boundary rightEndL-1 440 if( (i >= leftStartL) && (i <= rightEndL-2) ) 441 { 442 piSrcY++; 443 } 444 #else 388 445 piSrcY++; 446 #endif 389 447 piDstY++; 390 448 } 391 449 } 450 451 #if ILP_DECODED_PICTURE 452 #if SCALED_REF_LAYER_OFFSETS 453 widthBL = pcBasePic->getWidth (); 454 heightBL = pcBasePic->getHeight(); 455 456 widthEL = pcUsPic->getWidth () - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset(); 457 heightEL = pcUsPic->getHeight() - scalEL.getWindowTopOffset() - scalEL.getWindowBottomOffset(); 458 #else 459 widthBL = pcBasePic->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset(); 460 heightBL = pcBasePic->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset(); 461 462 widthEL = pcUsPic->getWidth () - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset(); 463 heightEL = pcUsPic->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset(); 464 #endif 465 #endif 392 466 393 467 //========== UV component upsampling =========== … … 401 475 strideBL = pcBasePic->getCStride(); 402 476 strideEL = pcUsPic->getCStride(); 477 #if SCALED_REF_LAYER_OFFSETS 478 Int leftStartC = scalEL.getWindowLeftOffset() >> 1; 479 Int rightEndC = (pcUsPic->getWidth() >> 1) - (scalEL.getWindowRightOffset() >> 1); 480 Int topStartC = scalEL.getWindowTopOffset() >> 1; 481 Int bottomEndC = (pcUsPic->getHeight() >> 1) - (scalEL.getWindowBottomOffset() >> 1); 482 #endif 403 483 404 484 #if PHASE_DERIVATION_IN_INTEGER … … 422 502 #endif 423 503 504 #if ILP_DECODED_PICTURE 505 widthBL = pcBasePic->getWidth () >> 1; 506 heightBL = pcBasePic->getHeight() >> 1; 507 508 widthEL = pcUsPic->getWidth () >> 1; 509 heightEL = pcUsPic->getHeight() >> 1; 510 #endif 511 424 512 //========== horizontal upsampling =========== 425 513 for( i = 0; i < widthEL; i++ ) 426 514 { 515 #if SCALED_REF_LAYER_OFFSETS 516 Int x = Clip3(leftStartC, rightEndC - 1, i); 517 #endif 427 518 #if PHASE_DERIVATION_IN_INTEGER 519 #if SCALED_REF_LAYER_OFFSETS 520 refPos16 = (((x - leftStartC)*scaleX + addX) >> shiftXM4) - deltaX; 521 #else 428 522 refPos16 = ((i*scaleX + addX) >> shiftXM4) - deltaX; 523 #endif 429 524 phase = refPos16 & 15; 430 525 refPos = refPos16 >> 4; … … 460 555 pcTempPic->setHeight(heightEL << 1); 461 556 462 for( j = 0; j < heightEL; j++ ) 463 { 557 #if SCALED_REF_LAYER_OFFSETS 558 for( j = 0; j < pcTempPic->getHeight() >> 1; j++ ) 559 #else 560 for( j = 0; j < heightEL; j++ ) 561 #endif 562 { 563 #if SCALED_REF_LAYER_OFFSETS 564 Int y = Clip3(topStartC, bottomEndC - 1, j); 565 #endif 464 566 #if PHASE_DERIVATION_IN_INTEGER 567 #if SCALED_REF_LAYER_OFFSETS 568 refPos16 = (((y - topStartC)*scaleY + addY) >> shiftYM4) - deltaY; 569 #else 465 570 refPos16 = ((j*scaleY + addY) >> shiftYM4) - deltaY; 571 #endif 466 572 phase = refPos16 & 15; 467 573 refPos = refPos16 >> 4; … … 488 594 piDstV = piDstBufV + j*strideEL; 489 595 596 #if SCALED_REF_LAYER_OFFSETS 597 for( i = 0; i < pcTempPic->getWidth() >> 1; i++ ) 598 #else 490 599 for( i = 0; i < widthEL; i++ ) 600 #endif 491 601 { 492 602 *piDstU = ClipC( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift)); 493 603 *piDstV = ClipC( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift)); 494 604 605 #if SCALED_REF_LAYER_OFFSETS 606 // Only increase the x position of reference upsample picture when within the window 607 // "-2" to ensure that pointer doesn't go beyond the boundary rightEndC-1 608 if( (i >= leftStartC) && (i <= rightEndC-2) ) 609 { 610 piSrcU++; 611 piSrcV++; 612 } 613 #else 495 614 piSrcU++; 496 615 piSrcV++; 616 #endif 497 617 piDstU++; 498 618 piDstV++; -
trunk/source/Lib/TLibCommon/TComUpsampleFilter.h
r2 r189 52 52 ~TComUpsampleFilter(void); 53 53 54 #if SCALED_REF_LAYER_OFFSETS 55 Void upsampleBasePic( TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window ); 56 #else 54 57 Void upsampleBasePic( TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic ); 58 #endif 55 59 }; 56 60 -
trunk/source/Lib/TLibCommon/TypeDef.h
r125 r189 44 44 45 45 #if SVC_EXTENSION 46 #define SCALED_REF_LAYER_OFFSETS 1 ///< M0309: Signal scaled reference layer offsets in SPS 47 #define MAX_LAYERS 2 ///< max number of layers the codec is supposed to handle 48 46 49 #define VPS_RENAME 1 ///< Rename variables max_layer_id and num_layer_sets_minus1 in VPS 47 50 #define VPS_EXTNS 1 ///< Include function structure for VPS extensions … … 51 54 #define VPS_EXTN_PROFILE_INFO 1 ///< Include profile information for layer sets in VPS extension 52 55 #define VPS_EXTN_DIRECT_REF_LAYERS 1 ///< Include indication of direct dependency of layers in VPS extension 53 #endif 54 #define MAX_LAYERS 2 ///< max number of layers the codec is supposed to handle 56 #define VPS_EXTN_DIRECT_REF_LAYERS_CONTINUE 1 57 #define VPS_OUTPUT_LAYER_SET_IDX 1 ///< M0268: Signal output_layer_set_idx[i] as output_layer_set_idx_minus1[i] 58 #define VPS_MOVE_DIR_DEPENDENCY_FLAG 1 ///< M0268: Move the syntax element direct_dependency_flag to follow the syntax element dimension_id 59 #define VPS_PROFILE_OUTPUT_LAYERS 1 ///< M0268: Signal profile information and output layer information as in Sec. 3 of M0268v2 60 #endif 61 62 #define DERIVE_LAYER_ID_LIST_VARIABLES 1 ///< Derived variables based on the variables in VPS - for use in syntax table parsing 55 63 56 64 #define SVC_COL_BLK 1 ///< get co-located block … … 60 68 #define CHROMA_UPSAMPLING 1 ///< L0335: Chroma upsampling with 5 bits coefficients 61 69 62 #define MV_SCALING_FIX 1 ///< fixing the base layer MV scaling 63 #define MV_SCALING_POS_FIX 1 ///< use center pixels to get co-located base layer block 64 #define MFM_CLIPPING_FIX 1 ///< set the right picture size for the clipping 65 66 #define AVC_BASE 0 ///< YUV BL reading for AVC base SVC 67 #define REF_IDX_FRAMEWORK 0 ///< inter-layer reference framework 68 69 #if SVC_UPSAMPLING 70 #define SIMPLIFIED_MV_POS_SCALING 1 ///< M0133/M0449: inter-layer MV scaling and pixel mapping position calculation 71 #define ILP_DECODED_PICTURE 1 ///< M0274: use decoded picture for inter-layer prediction 72 #define JCTVC_M0259_LAMBDAREFINEMENT 1 ///< JCTVC-M0259: lambda refinement (encoder only optimization) 73 74 #define REF_IDX_FRAMEWORK 1 ///< inter-layer reference framework 75 76 #if SVC_UPSAMPLING && !ILP_DECODED_PICTURE 70 77 #define JCTVC_L0178 1 ///< implementation of JCTVC-L0178 (code only supports right and bottom croppping offsets) 71 78 #endif … … 73 80 #define IDR_ALIGNMENT 1 ///< align IDR picures across layers 74 81 82 #define AVC_BASE 1 ///< YUV BL reading for AVC base SVC 75 83 #if AVC_BASE 76 #define AVC_SYNTAX 1///< Syntax reading for AVC base84 #define AVC_SYNTAX 0 ///< Syntax reading for AVC base 77 85 #endif 78 86 … … 80 88 #define REF_IDX_ME_ZEROMV 1 ///< L0051: use zero motion for inter-layer reference picture (without fractional ME) 81 89 #define ENCODER_FAST_MODE 1 ///< L0174: enable encoder fast mode. TestMethod 1 is enabled by setting to 1 and TestMethod 2 is enable by setting to 2. By default it is set to 1. 82 #if !AVC_BASE || AVC_SYNTAX83 90 #define REF_IDX_MFM 1 ///< L0336: motion vector mapping of inter-layer reference picture 84 #endif 85 86 #if REF_IDX_MFM 87 #define REUSE_MVSCALE 1 ///< using the base layer MV scaling function 88 #define REUSE_BLKMAPPING 1 ///< using the base layer get co-located block function 89 #define RAP_MFM_INIT 1 ///< initilizing MFM when base layer is RAP picture 90 #define REF_LIST_BUGFIX 1 91 #endif 92 91 #define JCTVC_M0458_INTERLAYER_RPS_SIG 1 ///< implementation of JCTVC-L0178 (currently only one reference layer is supported ) 92 #if JCTVC_M0458_INTERLAYER_RPS_SIG 93 #define ZERO_NUM_DIRECT_LAYERS 1 ///< support of zero direct reference layers 94 #endif 93 95 #else 94 96 #define INTRA_BL 1 ///< inter-layer texture prediction … … 97 99 #define INTRA_BL_DST4x4 1 ///< L0067/L0204: DST4x4 for Intra BL 98 100 #define NO_RESIDUAL_FLAG_FOR_BLPRED 1 ///< L0437: Root cbf for Intra_BL 101 #define IL_MRG_SIMPLIFIED_PRUNING 1 ///< M0124: simplified pruning, Only the left and above candidates are checked with BL-C candidate for redundancy removal 102 #define INTRA_BL_CTX_CHANGE 1 ///< M0075: spatial dependency removal for IntraBL flag context derivation 99 103 100 104 // Hooks … … 109 113 #endif 110 114 #else 115 #define ILP_DECODED_PICTURE 0 111 116 #define SYNTAX_OUTPUT 0 112 117 #endif … … 114 119 //! \ingroup TLibCommon 115 120 //! \{ 121 122 #define FIX1071 1 ///< Temporary fix for issue #1071 123 124 #define L0208_SOP_DESCRIPTION_SEI 1 ///< L0208: add SOP descrioption SEI 125 #define MAX_NUM_PICS_IN_SOP 1024 126 127 #define K0180_SCALABLE_NESTING_SEI 1 ///JCTVC-K0180 scalable nesting sei message 128 #define MAX_NESTING_NUM_OPS 1024 129 #define MAX_NESTING_NUM_LAYER 64 130 131 #define J0149_TONE_MAPPING_SEI 1 ///< J0149: Tone mapping information SEI 116 132 #define L0363_DU_BIT_RATE 1 ///< L0363: add bit_rate_du_value_minus1 to HRD parameters 117 133 #define L0328_SPLICING 1 ///< L0328: splicing support in HRD … … 138 154 #define SIGNAL_BITRATE_PICRATE_IN_VPS 0 ///< K0125: Signal bit_rate and pic_rate in VPS 139 155 #define L0232_RD_PENALTY 1 ///< L0232: RD-penalty for 32x32 TU for intra in non-intra slices 156 #define L0386_DB_METRIC 1 ///< L0386: non-normative blockiness metric (automatically configures deblocking parameters in bitstream) 157 #define L0323_DPB 1 ///< L0323: Specification of active reference indices and decoded picture buffer 158 159 #define L0034_COMBINED_LIST_CLEANUP 1 140 160 141 161 #if VPS_EXTN_MASK_AND_DIM_INFO … … 144 164 #if VPS_RENAME 145 165 #define MAX_VPS_LAYER_SETS_PLUS1 1024 146 #define MAX_VPS_LAYER_ID_PLUS1 2166 #define MAX_VPS_LAYER_ID_PLUS1 MAX_LAYERS 147 167 #else 148 168 #define MAX_VPS_NUM_HRD_PARAMETERS 1 … … 477 497 REF_PIC_LIST_0 = 0, ///< reference list 0 478 498 REF_PIC_LIST_1 = 1, ///< reference list 1 499 #if !L0034_COMBINED_LIST_CLEANUP 479 500 REF_PIC_LIST_C = 2, ///< combined reference list for uni-prediction in B-Slices 501 #endif 480 502 REF_PIC_LIST_X = 100 ///< special mark 481 503 };
Note: See TracChangeset for help on using the changeset viewer.