Changeset 540 in SHVCSoftware for trunk/source/Lib/TLibCommon
- Timestamp:
- 9 Jan 2014, 05:04:17 (11 years ago)
- Location:
- trunk
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/SHM-4.1-dev (added) merged: 501-539 /trunk merged: 499
- Property svn:mergeinfo changed
-
trunk/source
- Property svn:mergeinfo changed
/branches/SHM-4.1-dev/source (added) merged: 502-522,524-533,535,537-539
- Property svn:mergeinfo changed
-
trunk/source/Lib/TLibCommon/CommonDef.h
r499 r540 40 40 41 41 #include <algorithm> 42 43 42 #if _MSC_VER > 1000 44 43 // disable "signed and unsigned mismatch" … … 57 56 58 57 #if SVC_EXTENSION 59 #define NV_VERSION "4.0" ///< Current software version 58 #include <vector> 59 #define NV_VERSION "4.1" ///< Current software version 60 60 #else 61 #define NV_VERSION "12. 0" ///< Current software version61 #define NV_VERSION "12.1" ///< Current software version 62 62 #endif 63 63 … … 209 209 210 210 NAL_UNIT_CODED_SLICE_TSA_N, // 2 211 NAL_UNIT_CODED_SLICE_T LA_R, // 3211 NAL_UNIT_CODED_SLICE_TSA_R, // 3 212 212 213 213 NAL_UNIT_CODED_SLICE_STSA_N, // 4 … … 280 280 }; 281 281 282 #if OUTPUT_LAYER_SET_INDEX 283 class CommonDecoderParams 284 { 285 Int m_targetLayerId; 286 Int m_outputLayerSetIdx; 287 std::vector<Int> *m_targetDecLayerIdSet; 288 Bool m_valueCheckedFlag; 289 public: 290 CommonDecoderParams(): 291 m_targetLayerId(0) 292 , m_outputLayerSetIdx(-1) 293 , m_targetDecLayerIdSet(NULL) 294 , m_valueCheckedFlag(false) 295 {} 296 297 Void setTargetLayerId(const Int x) { m_targetLayerId = x; } 298 Int getTargetLayerId() { return m_targetLayerId;} 299 300 Void setOutputLayerSetIdx(const Int x) { m_outputLayerSetIdx = x; } 301 Int getOutputLayerSetIdx() { return m_outputLayerSetIdx;} 302 303 Void setTargetDecLayerIdSet(std::vector<Int> *x) { m_targetDecLayerIdSet = x; } 304 std::vector<Int>* getTargetDecLayerIdSet() { return m_targetDecLayerIdSet;} 305 306 Void setValueCheckedFlag(const Bool x) { m_valueCheckedFlag = x; } 307 Bool getValueCheckedFlag() { return m_valueCheckedFlag;} 308 309 }; 310 #endif 282 311 //! \} 283 312 -
trunk/source/Lib/TLibCommon/NAL.h
r313 r540 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_T LA_R78 || m_nalUnitType == NAL_UNIT_CODED_SLICE_TSA_R 79 79 || m_nalUnitType == NAL_UNIT_CODED_SLICE_TSA_N 80 80 || m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA_R -
trunk/source/Lib/TLibCommon/TComDataCU.cpp
r494 r540 309 309 } 310 310 } 311 311 #if !HM_CLEANUP_SAO 312 312 const NDBFBlockInfo& NDBFBlockInfo::operator= (const NDBFBlockInfo& src) 313 313 { … … 328 328 } 329 329 330 330 #endif 331 331 // ==================================================================================================================== 332 332 // Public member functions … … 3638 3638 return getPic()->getPicSym()->getInverseCUOrderMap(m_uiCUAddr)*(1<<(m_pcSlice->getSPS()->getMaxCUDepth()<<1))+m_uiAbsIdxInLCU; 3639 3639 } 3640 3640 #if !HM_CLEANUP_SAO 3641 3641 /** Set neighboring blocks availabilities for non-deblocked filtering 3642 3642 * \param numLCUInPicWidth number of LCUs in picture width … … 4008 4008 } 4009 4009 4010 #endif 4011 4010 4012 #if SVC_EXTENSION 4011 4013 TComDataCU* TComDataCU::getBaseColCU( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Int iMotionMapping ) … … 4028 4030 #endif 4029 4031 4032 #if O0098_SCALED_REF_LAYER_ID 4033 Int leftStartL = getSlice()->getSPS()->getScaledRefLayerWindowForLayer(getSlice()->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowLeftOffset(); 4034 Int topStartL = getSlice()->getSPS()->getScaledRefLayerWindowForLayer(getSlice()->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowTopOffset(); 4035 #else 4030 4036 Int leftStartL = this->getSlice()->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowLeftOffset(); 4031 4037 Int topStartL = this->getSlice()->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowTopOffset(); 4038 #endif 4032 4039 Int iBX = ((uiPelX - leftStartL)*g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16; 4033 4040 Int iBY = ((uiPelY - topStartL )*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16; -
trunk/source/Lib/TLibCommon/TComDataCU.h
r494 r540 55 55 //! \{ 56 56 57 #if !HM_CLEANUP_SAO 57 58 // ==================================================================================================================== 58 59 // Non-deblocking in-loop filter processing block data structure … … 92 93 const NDBFBlockInfo& operator= (const NDBFBlockInfo& src); //!< "=" operator 93 94 }; 95 #endif 94 96 95 97 … … 159 161 Pel* m_pcIPCMSampleCr; ///< PCM sample buffer (Cr) 160 162 163 #if !HM_CLEANUP_SAO 161 164 Int* m_piSliceSUMap; ///< pointer of slice ID map 162 165 std::vector<NDBFBlockInfo> m_vNDFBlock; 163 166 #endif 164 167 // ------------------------------------------------------------------------------------------------------------------- 165 168 // neighbour access variables … … 389 392 Void setIPCMFlagSubParts (Bool bIpcmFlag, UInt uiAbsPartIdx, UInt uiDepth); 390 393 394 #if !HM_CLEANUP_SAO 391 395 /// get slice ID for SU 392 396 Int getSUSliceID (UInt uiIdx) {return m_piSliceSUMap[uiIdx]; } … … 403 407 ,Bool bTopTileBoundary, Bool bDownTileBoundary, Bool bLeftTileBoundary, Bool bRightTileBoundary 404 408 ,Bool bIndependentTileBoundaryEnabled ); 409 #endif 405 410 // ------------------------------------------------------------------------------------------------------------------- 406 411 // member functions for accessing partition information -
trunk/source/Lib/TLibCommon/TComPic.cpp
r494 r540 59 59 , m_bNeededForOutput (false) 60 60 , m_uiCurrSliceIdx (0) 61 #if !HM_CLEANUP_SAO 61 62 , m_pSliceSUMap (NULL) 62 63 , m_pbValidSlice (NULL) … … 65 66 , m_bIndependentTileBoundaryForNDBFilter (false) 66 67 , m_pNDBFilterYuvTmp (NULL) 68 #endif 67 69 , m_bCheckLTMSB (false) 68 70 { … … 212 214 } 213 215 } 214 216 #if HM_CLEANUP_SAO 217 Bool TComPic::getSAOMergeAvailability(Int currAddr, Int mergeAddr) 218 { 219 Bool mergeCtbInSliceSeg = (mergeAddr >= getPicSym()->getCUOrderMap(getCU(currAddr)->getSlice()->getSliceCurStartCUAddr()/getNumPartInCU())); 220 Bool mergeCtbInTile = (getPicSym()->getTileIdxMap(mergeAddr) == getPicSym()->getTileIdxMap(currAddr)); 221 return (mergeCtbInSliceSeg && mergeCtbInTile); 222 } 223 #else 215 224 /** Create non-deblocked filter information 216 225 * \param pSliceStartAddress array for storing slice start addresses … … 548 557 549 558 } 559 #endif 550 560 551 561 #if SVC_EXTENSION -
trunk/source/Lib/TLibCommon/TComPic.h
r494 r540 75 75 Bool m_bNeededForOutput; 76 76 UInt m_uiCurrSliceIdx; // Index of current slice 77 #if !HM_CLEANUP_SAO 77 78 Int* m_pSliceSUMap; 78 79 Bool* m_pbValidSlice; … … 81 82 Bool m_bIndependentTileBoundaryForNDBFilter; 82 83 TComPicYuv* m_pNDBFilterYuvTmp; //!< temporary picture buffer when non-cross slice/tile boundary in-loop filtering is enabled 84 #endif 83 85 Bool m_bCheckLTMSB; 84 86 … … 199 201 Window& getDefDisplayWindow() { return m_defaultDisplayWindow; } 200 202 203 #if HM_CLEANUP_SAO 204 Bool getSAOMergeAvailability(Int currAddr, Int mergeAddr); 205 #else 201 206 Void createNonDBFilterInfo (std::vector<Int> sliceStartAddress, Int sliceGranularityDepth 202 207 ,std::vector<Bool>* LFCrossSliceBoundary … … 211 216 TComPicYuv* getYuvPicBufferForIndependentBoundaryProcessing() {return m_pNDBFilterYuvTmp;} 212 217 std::vector<TComDataCU*>& getOneSliceCUDataForNDBFilter (Int sliceID) { return m_vSliceCUDataLink[sliceID];} 218 #endif 213 219 214 220 /* field coding parameters*/ -
trunk/source/Lib/TLibCommon/TComPicSym.cpp
r442 r540 67 67 ,m_puiTileIdxMap(NULL) 68 68 ,m_puiInverseCUOrderMap(NULL) 69 #if HM_CLEANUP_SAO 70 ,m_saoBlkParams(NULL) 71 #endif 69 72 {}; 70 73 … … 127 130 m_puiInverseCUOrderMap[i] = i; 128 131 } 132 133 #if HM_CLEANUP_SAO 134 m_saoBlkParams = new SAOBlkParam[m_uiNumCUsInFrame]; 135 #else 129 136 m_saoParam = NULL; 137 #endif 130 138 } 131 139 … … 183 191 m_puiInverseCUOrderMap = NULL; 184 192 193 #if HM_CLEANUP_SAO 194 if(m_saoBlkParams) 195 { 196 delete[] m_saoBlkParams; m_saoBlkParams = NULL; 197 } 198 #else 185 199 if (m_saoParam) 186 200 { … … 189 203 m_saoParam = NULL; 190 204 } 205 #endif 191 206 } 192 207 … … 332 347 } 333 348 349 350 #if HM_CLEANUP_SAO 351 Void TComPicSym::deriveLoopFilterBoundaryAvailibility(Int ctu, 352 Bool& isLeftAvail, 353 Bool& isRightAvail, 354 Bool& isAboveAvail, 355 Bool& isBelowAvail, 356 Bool& isAboveLeftAvail, 357 Bool& isAboveRightAvail, 358 Bool& isBelowLeftAvail, 359 Bool& isBelowRightAvail 360 ) 361 { 362 363 isLeftAvail = (ctu % m_uiWidthInCU != 0); 364 isRightAvail = (ctu % m_uiWidthInCU != m_uiWidthInCU-1); 365 isAboveAvail = (ctu >= m_uiWidthInCU ); 366 isBelowAvail = (ctu < m_uiNumCUsInFrame - m_uiWidthInCU); 367 isAboveLeftAvail = (isAboveAvail && isLeftAvail); 368 isAboveRightAvail= (isAboveAvail && isRightAvail); 369 isBelowLeftAvail = (isBelowAvail && isLeftAvail); 370 isBelowRightAvail= (isBelowAvail && isRightAvail); 371 372 Bool isLoopFiltAcrossTilePPS = getCU(ctu)->getSlice()->getPPS()->getLoopFilterAcrossTilesEnabledFlag(); 373 374 { 375 TComDataCU* ctuCurr = getCU(ctu); 376 TComDataCU* ctuLeft = isLeftAvail ?getCU(ctu-1):NULL; 377 TComDataCU* ctuRight = isRightAvail?getCU(ctu+1):NULL; 378 TComDataCU* ctuAbove = isAboveAvail?getCU(ctu-m_uiWidthInCU):NULL; 379 TComDataCU* ctuBelow = isBelowAvail?getCU(ctu+m_uiWidthInCU):NULL; 380 TComDataCU* ctuAboveLeft = isAboveLeftAvail ? getCU(ctu-m_uiWidthInCU-1):NULL; 381 TComDataCU* ctuAboveRigtht= isAboveRightAvail? getCU(ctu-m_uiWidthInCU+1):NULL; 382 TComDataCU* ctuBelowLeft = isBelowLeftAvail ? getCU(ctu+m_uiWidthInCU-1):NULL; 383 TComDataCU* ctuBelowRight = isBelowRightAvail? getCU(ctu+m_uiWidthInCU+1):NULL; 384 385 { 386 //left 387 if(ctuLeft != NULL) 388 { 389 isLeftAvail = (ctuCurr->getSlice()->getSliceCurStartCUAddr() != ctuLeft->getSlice()->getSliceCurStartCUAddr())?ctuCurr->getSlice()->getLFCrossSliceBoundaryFlag():true; 390 } 391 //above 392 if(ctuAbove != NULL) 393 { 394 isAboveAvail = (ctuCurr->getSlice()->getSliceCurStartCUAddr() != ctuAbove->getSlice()->getSliceCurStartCUAddr())?ctuCurr->getSlice()->getLFCrossSliceBoundaryFlag():true; 395 } 396 //right 397 if(ctuRight != NULL) 398 { 399 isRightAvail = (ctuCurr->getSlice()->getSliceCurStartCUAddr() != ctuRight->getSlice()->getSliceCurStartCUAddr())?ctuRight->getSlice()->getLFCrossSliceBoundaryFlag():true; 400 } 401 //below 402 if(ctuBelow != NULL) 403 { 404 isBelowAvail = (ctuCurr->getSlice()->getSliceCurStartCUAddr() != ctuBelow->getSlice()->getSliceCurStartCUAddr())?ctuBelow->getSlice()->getLFCrossSliceBoundaryFlag():true; 405 } 406 //above-left 407 if(ctuAboveLeft != NULL) 408 { 409 isAboveLeftAvail = (ctuCurr->getSlice()->getSliceCurStartCUAddr() != ctuAboveLeft->getSlice()->getSliceCurStartCUAddr())?ctuCurr->getSlice()->getLFCrossSliceBoundaryFlag():true; 410 } 411 //below-right 412 if(ctuBelowRight != NULL) 413 { 414 isBelowRightAvail = (ctuCurr->getSlice()->getSliceCurStartCUAddr() != ctuBelowRight->getSlice()->getSliceCurStartCUAddr())?ctuBelowRight->getSlice()->getLFCrossSliceBoundaryFlag():true; 415 } 416 417 418 //above-right 419 if(ctuAboveRigtht != NULL) 420 { 421 Int curSliceStartTS = getCUOrderMap(ctuCurr->getSlice()->getSliceCurStartCUAddr()/m_uiNumPartitions); 422 Int aboveRigthtSliceStartTS = getCUOrderMap(ctuAboveRigtht->getSlice()->getSliceCurStartCUAddr()/m_uiNumPartitions); 423 424 isAboveRightAvail = (curSliceStartTS == aboveRigthtSliceStartTS)?(true): 425 ( 426 (curSliceStartTS > aboveRigthtSliceStartTS)?(ctuCurr->getSlice()->getLFCrossSliceBoundaryFlag()) 427 :(ctuAboveRigtht->getSlice()->getLFCrossSliceBoundaryFlag()) 428 ); 429 } 430 //below-left 431 if(ctuBelowLeft != NULL) 432 { 433 Int curSliceStartTS = getCUOrderMap(ctuCurr->getSlice()->getSliceCurStartCUAddr()/m_uiNumPartitions); 434 Int belowLeftSliceStartTS = getCUOrderMap(ctuBelowLeft->getSlice()->getSliceCurStartCUAddr()/m_uiNumPartitions); 435 436 isBelowLeftAvail = (curSliceStartTS == belowLeftSliceStartTS)?(true): 437 ( 438 (curSliceStartTS > belowLeftSliceStartTS)?(ctuCurr->getSlice()->getLFCrossSliceBoundaryFlag()) 439 :(ctuBelowLeft->getSlice()->getLFCrossSliceBoundaryFlag()) 440 ); 441 } 442 } 443 444 if(!isLoopFiltAcrossTilePPS) 445 { 446 isLeftAvail = (!isLeftAvail ) ?false:(getTileIdxMap( ctuLeft->getAddr() ) == getTileIdxMap( ctu )); 447 isAboveAvail = (!isAboveAvail ) ?false:(getTileIdxMap( ctuAbove->getAddr() ) == getTileIdxMap( ctu )); 448 isRightAvail = (!isRightAvail ) ?false:(getTileIdxMap( ctuRight->getAddr() ) == getTileIdxMap( ctu )); 449 isBelowAvail = (!isBelowAvail ) ?false:(getTileIdxMap( ctuBelow->getAddr() ) == getTileIdxMap( ctu )); 450 isAboveLeftAvail = (!isAboveLeftAvail ) ?false:(getTileIdxMap( ctuAboveLeft->getAddr() ) == getTileIdxMap( ctu )); 451 isAboveRightAvail= (!isAboveRightAvail) ?false:(getTileIdxMap( ctuAboveRigtht->getAddr() ) == getTileIdxMap( ctu )); 452 isBelowLeftAvail = (!isBelowLeftAvail ) ?false:(getTileIdxMap( ctuBelowLeft->getAddr() ) == getTileIdxMap( ctu )); 453 isBelowRightAvail= (!isBelowRightAvail) ?false:(getTileIdxMap( ctuBelowRight->getAddr() ) == getTileIdxMap( ctu )); 454 } 455 } 456 457 } 458 #else 334 459 Void TComPicSym::allocSaoParam(TComSampleAdaptiveOffset *sao) 335 460 { … … 337 462 sao->allocSaoParam(m_saoParam); 338 463 } 464 #endif 339 465 340 466 TComTile::TComTile() -
trunk/source/Lib/TLibCommon/TComPicSym.h
r494 r540 112 112 UInt* m_puiInverseCUOrderMap; 113 113 114 #if HM_CLEANUP_SAO 115 SAOBlkParam *m_saoBlkParams; 116 #else 114 117 SAOParam *m_saoParam; 118 #endif 119 115 120 public: 116 121 Void create ( Int iPicWidth, Int iPicHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth ); … … 171 176 Void xInitTiles(); 172 177 UInt xCalculateNxtCUAddr( UInt uiCurrCUAddr ); 178 #if HM_CLEANUP_SAO 179 SAOBlkParam* getSAOBlkParam() { return m_saoBlkParams;} 180 Void deriveLoopFilterBoundaryAvailibility(Int ctu, Bool& isLeftAvail,Bool& isRightAvail,Bool& isAboveAvail,Bool& isBelowAvail,Bool& isAboveLeftAvail,Bool& isAboveRightAvail,Bool& isBelowLeftAvail,Bool& isBelowRightAvail); 181 #else 173 182 Void allocSaoParam(TComSampleAdaptiveOffset *sao); 174 183 SAOParam *getSaoParam() { return m_saoParam; } 184 #endif 185 186 175 187 };// END CLASS DEFINITION TComPicSym 176 188 -
trunk/source/Lib/TLibCommon/TComRdCost.cpp
r494 r540 330 330 331 331 // Setting the Distortion Parameter for Inter (subpel ME with step) 332 #if NS_HAD333 Void TComRdCost::setDistParam( TComPattern* pcPatternKey, Pel* piRefY, Int iRefStride, Int iStep, DistParam& rcDistParam, Bool bHADME, Bool bUseNSHAD )334 #else335 332 Void TComRdCost::setDistParam( TComPattern* pcPatternKey, Pel* piRefY, Int iRefStride, Int iStep, DistParam& rcDistParam, Bool bHADME ) 336 #endif337 333 { 338 334 #if O0194_WEIGHTED_PREDICTION_CGS … … 353 349 rcDistParam.iCols = pcPatternKey->getROIYWidth(); 354 350 rcDistParam.iRows = pcPatternKey->getROIYHeight(); 355 #if NS_HAD356 rcDistParam.bUseNSHAD = bUseNSHAD;357 #endif358 351 359 352 // set distortion function … … 386 379 387 380 Void 388 #if NS_HAD389 TComRdCost::setDistParam( DistParam& rcDP, Pel* p1, Int iStride1, Pel* p2, Int iStride2, Int iWidth, Int iHeight, Bool bHadamard, Bool bUseNSHAD )390 #else391 381 TComRdCost::setDistParam( DistParam& rcDP, Int bitDepth, Pel* p1, Int iStride1, Pel* p2, Int iStride2, Int iWidth, Int iHeight, Bool bHadamard ) 392 #endif393 382 { 394 383 rcDP.pOrg = p1; … … 402 391 rcDP.bitDepth = bitDepth; 403 392 rcDP.DistFunc = m_afpDistortFunc[ ( bHadamard ? DF_HADS : DF_SADS ) + g_aucConvertToBit[ iWidth ] + 1 ]; 404 #if NS_HAD405 rcDP.bUseNSHAD = bUseNSHAD;406 #endif407 393 } 408 394 … … 453 439 } 454 440 455 #if WEIGHTED_CHROMA_DISTORTION456 441 UInt TComRdCost::getDistPart(Int bitDepth, Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, UInt uiBlkWidth, UInt uiBlkHeight, TextType eText, DFunc eDFunc) 457 #else458 UInt TComRdCost::getDistPart(Int bitDepth, Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, UInt uiBlkWidth, UInt uiBlkHeight, DFunc eDFunc )459 #endif460 442 { 461 443 DistParam cDtParam; … … 471 453 cDtParam.bitDepth = bitDepth; 472 454 473 #if WEIGHTED_CHROMA_DISTORTION474 455 if (eText == TEXT_CHROMA_U) 475 456 { … … 484 465 return cDtParam.DistFunc( &cDtParam ); 485 466 } 486 #else 487 return cDtParam.DistFunc( &cDtParam ); 488 #endif 489 } 490 491 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT 492 UInt TComRdCost::getSADPart ( Int bitDepth, Pel* pelCur, Int curStride, Pel* pelOrg, Int orgStride, UInt width, UInt height ) 493 { 494 UInt SAD = 0; 495 Int shift = DISTORTION_PRECISION_ADJUSTMENT(bitDepth-8); 496 for ( Int i=0; i<height; i++ ) 497 { 498 for( Int j=0; j<width; j++ ) 499 { 500 SAD += abs((pelCur[j] - pelOrg[j])) >> shift; 501 } 502 pelCur = pelCur + curStride; 503 pelOrg = pelOrg + orgStride; 504 } 505 return SAD; 506 } 507 #endif 467 } 508 468 509 469 // ==================================================================================================================== … … 1579 1539 } 1580 1540 1581 #if NS_HAD1582 UInt TComRdCost::xCalcHADs16x4( Pel *piOrg, Pel *piCur, Int iStrideOrg, Int iStrideCur, Int iStep )1583 {1584 Int k, i, j, jj, sad=0;1585 Int diff[64], m1[4][16], m2[4][16];1586 assert( iStep == 1 );1587 for( k = 0; k < 64; k += 16 )1588 {1589 diff[k+0] = piOrg[0] - piCur[0];1590 diff[k+1] = piOrg[1] - piCur[1];1591 diff[k+2] = piOrg[2] - piCur[2];1592 diff[k+3] = piOrg[3] - piCur[3];1593 diff[k+4] = piOrg[4] - piCur[4];1594 diff[k+5] = piOrg[5] - piCur[5];1595 diff[k+6] = piOrg[6] - piCur[6];1596 diff[k+7] = piOrg[7] - piCur[7];1597 1598 diff[k+8] = piOrg[8] - piCur[8] ;1599 diff[k+9] = piOrg[9] - piCur[9] ;1600 diff[k+10] = piOrg[10] - piCur[10];1601 diff[k+11] = piOrg[11] - piCur[11];1602 diff[k+12] = piOrg[12] - piCur[12];1603 diff[k+13] = piOrg[13] - piCur[13];1604 diff[k+14] = piOrg[14] - piCur[14];1605 diff[k+15] = piOrg[15] - piCur[15];1606 1607 piCur += iStrideCur;1608 piOrg += iStrideOrg;1609 }1610 1611 //horizontal1612 for (j=0; j < 4; j++)1613 {1614 jj = j << 4;1615 1616 m2[j][0] = diff[jj ] + diff[jj+8];1617 m2[j][1] = diff[jj+1] + diff[jj+9];1618 m2[j][2] = diff[jj+2] + diff[jj+10];1619 m2[j][3] = diff[jj+3] + diff[jj+11];1620 m2[j][4] = diff[jj+4] + diff[jj+12];1621 m2[j][5] = diff[jj+5] + diff[jj+13];1622 m2[j][6] = diff[jj+6] + diff[jj+14];1623 m2[j][7] = diff[jj+7] + diff[jj+15];1624 m2[j][8] = diff[jj ] - diff[jj+8];1625 m2[j][9] = diff[jj+1] - diff[jj+9];1626 m2[j][10] = diff[jj+2] - diff[jj+10];1627 m2[j][11] = diff[jj+3] - diff[jj+11];1628 m2[j][12] = diff[jj+4] - diff[jj+12];1629 m2[j][13] = diff[jj+5] - diff[jj+13];1630 m2[j][14] = diff[jj+6] - diff[jj+14];1631 m2[j][15] = diff[jj+7] - diff[jj+15];1632 1633 m1[j][0] = m2[j][0] + m2[j][4];1634 m1[j][1] = m2[j][1] + m2[j][5];1635 m1[j][2] = m2[j][2] + m2[j][6];1636 m1[j][3] = m2[j][3] + m2[j][7];1637 m1[j][4] = m2[j][0] - m2[j][4];1638 m1[j][5] = m2[j][1] - m2[j][5];1639 m1[j][6] = m2[j][2] - m2[j][6];1640 m1[j][7] = m2[j][3] - m2[j][7];1641 m1[j][8] = m2[j][8] + m2[j][12];1642 m1[j][9] = m2[j][9] + m2[j][13];1643 m1[j][10] = m2[j][10] + m2[j][14];1644 m1[j][11] = m2[j][11] + m2[j][15];1645 m1[j][12] = m2[j][8] - m2[j][12];1646 m1[j][13] = m2[j][9] - m2[j][13];1647 m1[j][14] = m2[j][10] - m2[j][14];1648 m1[j][15] = m2[j][11] - m2[j][15];1649 1650 m2[j][0] = m1[j][0] + m1[j][2];1651 m2[j][1] = m1[j][1] + m1[j][3];1652 m2[j][2] = m1[j][0] - m1[j][2];1653 m2[j][3] = m1[j][1] - m1[j][3];1654 m2[j][4] = m1[j][4] + m1[j][6];1655 m2[j][5] = m1[j][5] + m1[j][7];1656 m2[j][6] = m1[j][4] - m1[j][6];1657 m2[j][7] = m1[j][5] - m1[j][7];1658 m2[j][8] = m1[j][8] + m1[j][10];1659 m2[j][9] = m1[j][9] + m1[j][11];1660 m2[j][10] = m1[j][8] - m1[j][10];1661 m2[j][11] = m1[j][9] - m1[j][11];1662 m2[j][12] = m1[j][12] + m1[j][14];1663 m2[j][13] = m1[j][13] + m1[j][15];1664 m2[j][14] = m1[j][12] - m1[j][14];1665 m2[j][15] = m1[j][13] - m1[j][15];1666 1667 m1[j][0] = m2[j][0] + m2[j][1];1668 m1[j][1] = m2[j][0] - m2[j][1];1669 m1[j][2] = m2[j][2] + m2[j][3];1670 m1[j][3] = m2[j][2] - m2[j][3];1671 m1[j][4] = m2[j][4] + m2[j][5];1672 m1[j][5] = m2[j][4] - m2[j][5];1673 m1[j][6] = m2[j][6] + m2[j][7];1674 m1[j][7] = m2[j][6] - m2[j][7];1675 m1[j][8] = m2[j][8] + m2[j][9];1676 m1[j][9] = m2[j][8] - m2[j][9];1677 m1[j][10] = m2[j][10] + m2[j][11];1678 m1[j][11] = m2[j][10] - m2[j][11];1679 m1[j][12] = m2[j][12] + m2[j][13];1680 m1[j][13] = m2[j][12] - m2[j][13];1681 m1[j][14] = m2[j][14] + m2[j][15];1682 m1[j][15] = m2[j][14] - m2[j][15];1683 }1684 1685 //vertical1686 for (i=0; i < 16; i++)1687 {1688 m2[0][i] = m1[0][i] + m1[2][i];1689 m2[1][i] = m1[1][i] + m1[3][i];1690 m2[2][i] = m1[0][i] - m1[2][i];1691 m2[3][i] = m1[1][i] - m1[3][i];1692 1693 m1[0][i] = m2[0][i] + m2[1][i];1694 m1[1][i] = m2[0][i] - m2[1][i];1695 m1[2][i] = m2[2][i] + m2[3][i];1696 m1[3][i] = m2[2][i] - m2[3][i];1697 }1698 1699 for (i = 0; i < 4; i++)1700 {1701 for (j = 0; j < 16; j++)1702 {1703 sad += abs(m1[i][j]);1704 }1705 }1706 1707 sad=((sad+2)>>2);1708 1709 return sad;1710 }1711 1712 UInt TComRdCost::xCalcHADs4x16( Pel *piOrg, Pel *piCur, Int iStrideOrg, Int iStrideCur, Int iStep )1713 {1714 Int k, i, j, jj, sad=0;1715 Int diff[64], m1[16][4], m2[16][4], m3[16][4];1716 assert( iStep == 1 );1717 for( k = 0; k < 64; k += 4 )1718 {1719 diff[k+0] = piOrg[0] - piCur[0];1720 diff[k+1] = piOrg[1] - piCur[1];1721 diff[k+2] = piOrg[2] - piCur[2];1722 diff[k+3] = piOrg[3] - piCur[3];1723 1724 piCur += iStrideCur;1725 piOrg += iStrideOrg;1726 }1727 1728 //horizontal1729 for (j=0; j < 16; j++)1730 {1731 jj = j << 2;1732 m2[j][0] = diff[jj ] + diff[jj+2];1733 m2[j][1] = diff[jj+1] + diff[jj+3];1734 m2[j][2] = diff[jj ] - diff[jj+2];1735 m2[j][3] = diff[jj+1] - diff[jj+3];1736 1737 m1[j][0] = m2[j][0] + m2[j][1];1738 m1[j][1] = m2[j][0] - m2[j][1];1739 m1[j][2] = m2[j][2] + m2[j][3];1740 m1[j][3] = m2[j][2] - m2[j][3];1741 }1742 1743 //vertical1744 for (i=0; i < 4; i++)1745 {1746 m2[0][i] = m1[0][i] + m1[8][i];1747 m2[1][i] = m1[1][i] + m1[9][i];1748 m2[2][i] = m1[2][i] + m1[10][i];1749 m2[3][i] = m1[3][i] + m1[11][i];1750 m2[4][i] = m1[4][i] + m1[12][i];1751 m2[5][i] = m1[5][i] + m1[13][i];1752 m2[6][i] = m1[6][i] + m1[14][i];1753 m2[7][i] = m1[7][i] + m1[15][i];1754 m2[8][i] = m1[0][i] - m1[8][i];1755 m2[9][i] = m1[1][i] - m1[9][i];1756 m2[10][i] = m1[2][i] - m1[10][i];1757 m2[11][i] = m1[3][i] - m1[11][i];1758 m2[12][i] = m1[4][i] - m1[12][i];1759 m2[13][i] = m1[5][i] - m1[13][i];1760 m2[14][i] = m1[6][i] - m1[14][i];1761 m2[15][i] = m1[7][i] - m1[15][i];1762 1763 m3[0][i] = m2[0][i] + m2[4][i];1764 m3[1][i] = m2[1][i] + m2[5][i];1765 m3[2][i] = m2[2][i] + m2[6][i];1766 m3[3][i] = m2[3][i] + m2[7][i];1767 m3[4][i] = m2[0][i] - m2[4][i];1768 m3[5][i] = m2[1][i] - m2[5][i];1769 m3[6][i] = m2[2][i] - m2[6][i];1770 m3[7][i] = m2[3][i] - m2[7][i];1771 m3[8][i] = m2[8][i] + m2[12][i];1772 m3[9][i] = m2[9][i] + m2[13][i];1773 m3[10][i] = m2[10][i] + m2[14][i];1774 m3[11][i] = m2[11][i] + m2[15][i];1775 m3[12][i] = m2[8][i] - m2[12][i];1776 m3[13][i] = m2[9][i] - m2[13][i];1777 m3[14][i] = m2[10][i] - m2[14][i];1778 m3[15][i] = m2[11][i] - m2[15][i];1779 1780 m1[0][i] = m3[0][i] + m3[2][i];1781 m1[1][i] = m3[1][i] + m3[3][i];1782 m1[2][i] = m3[0][i] - m3[2][i];1783 m1[3][i] = m3[1][i] - m3[3][i];1784 m1[4][i] = m3[4][i] + m3[6][i];1785 m1[5][i] = m3[5][i] + m3[7][i];1786 m1[6][i] = m3[4][i] - m3[6][i];1787 m1[7][i] = m3[5][i] - m3[7][i];1788 m1[8][i] = m3[8][i] + m3[10][i];1789 m1[9][i] = m3[9][i] + m3[11][i];1790 m1[10][i] = m3[8][i] - m3[10][i];1791 m1[11][i] = m3[9][i] - m3[11][i];1792 m1[12][i] = m3[12][i] + m3[14][i];1793 m1[13][i] = m3[13][i] + m3[15][i];1794 m1[14][i] = m3[12][i] - m3[14][i];1795 m1[15][i] = m3[13][i] - m3[15][i];1796 1797 m2[0][i] = m1[0][i] + m1[1][i];1798 m2[1][i] = m1[0][i] - m1[1][i];1799 m2[2][i] = m1[2][i] + m1[3][i];1800 m2[3][i] = m1[2][i] - m1[3][i];1801 m2[4][i] = m1[4][i] + m1[5][i];1802 m2[5][i] = m1[4][i] - m1[5][i];1803 m2[6][i] = m1[6][i] + m1[7][i];1804 m2[7][i] = m1[6][i] - m1[7][i];1805 m2[8][i] = m1[8][i] + m1[9][i];1806 m2[9][i] = m1[8][i] - m1[9][i];1807 m2[10][i] = m1[10][i] + m1[11][i];1808 m2[11][i] = m1[10][i] - m1[11][i];1809 m2[12][i] = m1[12][i] + m1[13][i];1810 m2[13][i] = m1[12][i] - m1[13][i];1811 m2[14][i] = m1[14][i] + m1[15][i];1812 m2[15][i] = m1[14][i] - m1[15][i];1813 }1814 1815 for (i = 0; i < 16; i++)1816 {1817 for (j = 0; j < 4; j++)1818 {1819 sad += abs(m2[i][j]);1820 }1821 }1822 1823 sad=((sad+2)>>2);1824 1825 return sad;1826 }1827 #endif1828 1829 1541 UInt TComRdCost::xGetHADs4( DistParam* pcDtParam ) 1830 1542 { … … 1909 1621 UInt uiSum = 0; 1910 1622 1911 #if NS_HAD1912 if( ( ( iRows % 8 == 0) && (iCols % 8 == 0) && ( iRows == iCols ) ) || ( ( iRows % 8 == 0 ) && (iCols % 8 == 0) && !pcDtParam->bUseNSHAD ) )1913 #else1914 1623 if( ( iRows % 8 == 0) && (iCols % 8 == 0) ) 1915 #endif1916 1624 { 1917 1625 Int iOffsetOrg = iStrideOrg<<3; … … 1927 1635 } 1928 1636 } 1929 #if NS_HAD1930 else if ( ( iCols > 8 ) && ( iCols > iRows ) && pcDtParam->bUseNSHAD )1931 {1932 Int iOffsetOrg = iStrideOrg<<2;1933 Int iOffsetCur = iStrideCur<<2;1934 for ( y=0; y<iRows; y+= 4 )1935 {1936 for ( x=0; x<iCols; x+= 16 )1937 {1938 uiSum += xCalcHADs16x4( &piOrg[x], &piCur[x*iStep], iStrideOrg, iStrideCur, iStep );1939 }1940 piOrg += iOffsetOrg;1941 piCur += iOffsetCur;1942 }1943 }1944 else if ( ( iRows > 8 ) && ( iCols < iRows ) && pcDtParam->bUseNSHAD )1945 {1946 Int iOffsetOrg = iStrideOrg<<4;1947 Int iOffsetCur = iStrideCur<<4;1948 for ( y=0; y<iRows; y+= 16 )1949 {1950 for ( x=0; x<iCols; x+= 4 )1951 {1952 uiSum += xCalcHADs4x16( &piOrg[x], &piCur[x*iStep], iStrideOrg, iStrideCur, iStep );1953 }1954 piOrg += iOffsetOrg;1955 piCur += iOffsetCur;1956 }1957 }1958 #endif1959 1637 else if( ( iRows % 4 == 0) && (iCols % 4 == 0) ) 1960 1638 { -
trunk/source/Lib/TLibCommon/TComRdCost.h
r442 r540 84 84 UInt uiComp; // uiComp = 0 (luma Y), 1 (chroma U), 2 (chroma V) 85 85 86 #if NS_HAD87 Bool bUseNSHAD;88 #endif89 90 86 // (vertical) subsampling shift (for reducing complexity) 91 87 // - 0 = no subsampling, 1 = even rows, 2 = every 4th, etc. … … 104 100 iSubShift = 0; 105 101 bitDepth = 0; 106 #if NS_HAD107 bUseNSHAD = false;108 #endif109 102 } 110 103 }; … … 123 116 #endif 124 117 125 #if WEIGHTED_CHROMA_DISTORTION126 118 Double m_cbDistortionWeight; 127 119 Double m_crDistortionWeight; 128 #endif129 120 Double m_dLambda; 130 121 Double m_sqrtLambda; … … 155 146 Double calcRdCost64( UInt64 uiBits, UInt64 uiDistortion, Bool bFlag = false, DFunc eDFunc = DF_DEFAULT ); 156 147 157 #if WEIGHTED_CHROMA_DISTORTION158 148 Void setCbDistortionWeight ( Double cbDistortionWeight) { m_cbDistortionWeight = cbDistortionWeight; }; 159 149 Void setCrDistortionWeight ( Double crDistortionWeight) { m_crDistortionWeight = crDistortionWeight; }; 160 #endif161 150 Void setLambda ( Double dLambda ); 162 151 Void setFrameLambda ( Double dLambda ) { m_dFrameLambda = dLambda; } … … 164 153 Double getSqrtLambda () { return m_sqrtLambda; } 165 154 166 #if RATE_CONTROL_LAMBDA_DOMAIN167 155 Double getLambda() { return m_dLambda; } 168 #if M0036_RC_IMPROVEMENT169 156 Double getChromaWeight () {return((m_cbDistortionWeight+m_crDistortionWeight)/2.0);} 170 #endif171 #endif172 157 173 158 // Distortion Functions … … 176 161 Void setDistParam( UInt uiBlkWidth, UInt uiBlkHeight, DFunc eDFunc, DistParam& rcDistParam ); 177 162 Void setDistParam( TComPattern* pcPatternKey, Pel* piRefY, Int iRefStride, DistParam& rcDistParam ); 178 #if NS_HAD179 Void setDistParam( TComPattern* pcPatternKey, Pel* piRefY, Int iRefStride, Int iStep, DistParam& rcDistParam, Bool bHADME=false, Bool bUseNSHAD=false );180 Void setDistParam( DistParam& rcDP, Int bitDepth, Pel* p1, Int iStride1, Pel* p2, Int iStride2, Int iWidth, Int iHeight, Bool bHadamard = false, Bool bUseNSHAD=false );181 #else182 163 Void setDistParam( TComPattern* pcPatternKey, Pel* piRefY, Int iRefStride, Int iStep, DistParam& rcDistParam, Bool bHADME=false ); 183 164 Void setDistParam( DistParam& rcDP, Int bitDepth, Pel* p1, Int iStride1, Pel* p2, Int iStride2, Int iWidth, Int iHeight, Bool bHadamard = false ); 184 #endif185 165 186 166 UInt calcHAD(Int bitDepth, Pel* pi0, Int iStride0, Pel* pi1, Int iStride1, Int iWidth, Int iHeight ); … … 253 233 static UInt xCalcHADs4x4 ( Pel *piOrg, Pel *piCurr, Int iStrideOrg, Int iStrideCur, Int iStep ); 254 234 static UInt xCalcHADs8x8 ( Pel *piOrg, Pel *piCurr, Int iStrideOrg, Int iStrideCur, Int iStep ); 255 #if NS_HAD256 static UInt xCalcHADs16x4 ( Pel *piOrg, Pel *piCurr, Int iStrideOrg, Int iStrideCur, Int iStep );257 static UInt xCalcHADs4x16 ( Pel *piOrg, Pel *piCurr, Int iStrideOrg, Int iStrideCur, Int iStep );258 #endif259 235 260 236 public: 261 #if WEIGHTED_CHROMA_DISTORTION262 237 UInt getDistPart(Int bitDepth, Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, UInt uiBlkWidth, UInt uiBlkHeight, TextType eText = TEXT_LUMA, DFunc eDFunc = DF_SSE ); 263 #else 264 UInt getDistPart(Int bitDepth, Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, UInt uiBlkWidth, UInt uiBlkHeight, DFunc eDFunc = DF_SSE ); 265 #endif 266 267 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT 268 UInt getSADPart ( Int bitDepth, Pel* pelCur, Int curStride, Pel* pelOrg, Int orgStride, UInt width, UInt height ); 269 #endif 238 270 239 };// END CLASS DEFINITION TComRdCost 271 240 -
trunk/source/Lib/TLibCommon/TComRom.cpp
r494 r540 363 363 const UInt g_uiGroupIdx[ 32 ] = {0,1,2,3,4,4,5,5,6,6,6,6,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9}; 364 364 365 // Rice parameters for absolute transform levels366 const UInt g_auiGoRiceRange[5] =367 {368 7, 14, 26, 46, 78369 };370 371 const UInt g_auiGoRicePrefixLen[5] =372 {373 8, 7, 6, 5, 4374 };375 376 365 Void initSigLastScan(UInt* pBuffD, UInt* pBuffH, UInt* pBuffV, Int iWidth, Int iHeight) 377 366 { … … 541 530 Int g_mvScalingFactor [MAX_LAYERS][2] = {{0,0}, {0,0}}; 542 531 Int g_posScalingFactor [MAX_LAYERS][2] = {{0,0}, {0,0}}; 543 544 #if IL_SL_SIGNALLING_N0371545 Int ref_scalingListDC [MAX_LAYERS][SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM];546 Int ref_scalingListCoef [MAX_LAYERS][SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM][MAX_MATRIX_COEF_NUM];547 Int activeRefPPSId [MAX_LAYERS];548 Int activeRefSPSId [MAX_LAYERS];549 #endif550 532 #endif 551 533 -
trunk/source/Lib/TLibCommon/TComRom.h
r494 r540 131 131 extern const UInt g_uiMinInGroup[ 10 ]; 132 132 133 extern const UInt g_auiGoRiceRange[5]; //!< maximum value coded with Rice codes134 extern const UInt g_auiGoRicePrefixLen[5]; //!< prefix length for each maximum value135 136 133 extern const UInt g_sigLastScan8x8[ 3 ][ 4 ]; //!< coefficient group scan order for 8x8 TUs 137 134 extern UInt g_sigLastScanCG32x32[ 64 ]; … … 291 288 #if SVC_EXTENSION 292 289 extern Int g_mvScalingFactor [MAX_LAYERS][2]; 293 extern Int g_posScalingFactor [MAX_LAYERS][2]; 294 295 #if IL_SL_SIGNALLING_N0371 296 extern Int ref_scalingListDC [MAX_LAYERS][SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; 297 extern Int ref_scalingListCoef [MAX_LAYERS][SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM][MAX_MATRIX_COEF_NUM]; 298 extern Int activeRefPPSId [MAX_LAYERS]; 299 extern Int activeRefSPSId [MAX_LAYERS]; 300 #endif 290 extern Int g_posScalingFactor [MAX_LAYERS][2]; 301 291 #endif 302 292 -
trunk/source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp
r442 r540 44 44 //! \ingroup TLibCommon 45 45 //! \{ 46 #if HM_CLEANUP_SAO 47 UInt g_saoMaxOffsetQVal[NUM_SAO_COMPONENTS]; 48 49 SAOOffset::SAOOffset() 50 { 51 reset(); 52 } 53 54 SAOOffset::~SAOOffset() 55 { 56 57 } 58 59 Void SAOOffset::reset() 60 { 61 modeIdc = SAO_MODE_OFF; 62 typeIdc = -1; 63 typeAuxInfo = -1; 64 ::memset(offset, 0, sizeof(Int)* MAX_NUM_SAO_CLASSES); 65 } 66 67 const SAOOffset& SAOOffset::operator= (const SAOOffset& src) 68 { 69 modeIdc = src.modeIdc; 70 typeIdc = src.typeIdc; 71 typeAuxInfo = src.typeAuxInfo; 72 ::memcpy(offset, src.offset, sizeof(Int)* MAX_NUM_SAO_CLASSES); 73 74 return *this; 75 } 76 77 78 SAOBlkParam::SAOBlkParam() 79 { 80 reset(); 81 } 82 83 SAOBlkParam::~SAOBlkParam() 84 { 85 86 } 87 88 Void SAOBlkParam::reset() 89 { 90 for(Int compIdx=0; compIdx< 3; compIdx++) 91 { 92 offsetParam[compIdx].reset(); 93 } 94 } 95 96 const SAOBlkParam& SAOBlkParam::operator= (const SAOBlkParam& src) 97 { 98 for(Int compIdx=0; compIdx< 3; compIdx++) 99 { 100 offsetParam[compIdx] = src.offsetParam[compIdx]; 101 } 102 return *this; 103 104 } 105 106 TComSampleAdaptiveOffset::TComSampleAdaptiveOffset() 107 { 108 m_tempPicYuv = NULL; 109 for(Int compIdx=0; compIdx < NUM_SAO_COMPONENTS; compIdx++) 110 { 111 m_offsetClipTable[compIdx] = NULL; 112 } 113 m_signTable = NULL; 114 115 116 m_lineBufWidth = 0; 117 m_signLineBuf1 = NULL; 118 m_signLineBuf2 = NULL; 119 } 120 121 122 TComSampleAdaptiveOffset::~TComSampleAdaptiveOffset() 123 { 124 destroy(); 125 126 if (m_signLineBuf1) delete[] m_signLineBuf1; m_signLineBuf1 = NULL; 127 if (m_signLineBuf2) delete[] m_signLineBuf2; m_signLineBuf2 = NULL; 128 } 129 130 #if AUXILIARY_PICTURES 131 Void TComSampleAdaptiveOffset::create( Int picWidth, Int picHeight, ChromaFormat chromaFormatIDC, UInt maxCUWidth, UInt maxCUHeight, UInt maxCUDepth ) 132 #else 133 Void TComSampleAdaptiveOffset::create( Int picWidth, Int picHeight, UInt maxCUWidth, UInt maxCUHeight, UInt maxCUDepth ) 134 #endif 135 { 136 destroy(); 137 138 m_picWidth = picWidth; 139 m_picHeight= picHeight; 140 m_maxCUWidth= maxCUWidth; 141 m_maxCUHeight= maxCUHeight; 142 143 m_numCTUInWidth = (m_picWidth/m_maxCUWidth) + ((m_picWidth % m_maxCUWidth)?1:0); 144 m_numCTUInHeight= (m_picHeight/m_maxCUHeight) + ((m_picHeight % m_maxCUHeight)?1:0); 145 m_numCTUsPic = m_numCTUInHeight*m_numCTUInWidth; 146 147 //temporary picture buffer 148 if ( !m_tempPicYuv ) 149 { 150 m_tempPicYuv = new TComPicYuv; 151 #if AUXILIARY_PICTURES 152 m_tempPicYuv->create( m_picWidth, m_picHeight, chromaFormatIDC, m_maxCUWidth, m_maxCUHeight, maxCUDepth ); 153 #else 154 m_tempPicYuv->create( m_picWidth, m_picHeight, m_maxCUWidth, m_maxCUHeight, maxCUDepth ); 155 #endif 156 } 157 158 //bit-depth related 159 for(Int compIdx =0; compIdx < NUM_SAO_COMPONENTS; compIdx++) 160 { 161 Int bitDepthSample = (compIdx == SAO_Y)?g_bitDepthY:g_bitDepthC; 162 m_offsetStepLog2 [compIdx] = max(bitDepthSample - MAX_SAO_TRUNCATED_BITDEPTH, 0); 163 g_saoMaxOffsetQVal[compIdx] = (1<<(min(bitDepthSample,MAX_SAO_TRUNCATED_BITDEPTH)-5))-1; //Table 9-32, inclusive 164 } 165 166 //look-up table for clipping 167 for(Int compIdx =0; compIdx < NUM_SAO_COMPONENTS; compIdx++) 168 { 169 Int bitDepthSample = (compIdx == SAO_Y)?g_bitDepthY:g_bitDepthC; //exclusive 170 Int maxSampleValue = (1<< bitDepthSample); //exclusive 171 Int maxOffsetValue = (g_saoMaxOffsetQVal[compIdx] << m_offsetStepLog2[compIdx]); 172 173 m_offsetClipTable[compIdx] = new Int[(maxSampleValue + maxOffsetValue -1)+ (maxOffsetValue)+1 ]; //positive & negative range plus 0 174 m_offsetClip[compIdx] = &(m_offsetClipTable[compIdx][maxOffsetValue]); 175 176 //assign clipped values 177 Int* offsetClipPtr = m_offsetClip[compIdx]; 178 for(Int k=0; k< maxSampleValue; k++) 179 { 180 *(offsetClipPtr + k) = k; 181 } 182 for(Int k=0; k< maxOffsetValue; k++ ) 183 { 184 *(offsetClipPtr + maxSampleValue+ k) = maxSampleValue-1; 185 *(offsetClipPtr -k -1 ) = 0; 186 } 187 if(compIdx == SAO_Y) //g_bitDepthY is always larger than or equal to g_bitDepthC 188 { 189 m_signTable = new Short[ 2*(maxSampleValue-1) + 1 ]; 190 m_sign = &(m_signTable[maxSampleValue-1]); 191 192 m_sign[0] = 0; 193 for(Int k=1; k< maxSampleValue; k++) 194 { 195 m_sign[k] = 1; 196 m_sign[-k]= -1; 197 } 198 } 199 } 200 201 } 202 203 Void TComSampleAdaptiveOffset::destroy() 204 { 205 if ( m_tempPicYuv ) 206 { 207 m_tempPicYuv->destroy(); 208 delete m_tempPicYuv; 209 m_tempPicYuv = NULL; 210 } 211 212 for(Int compIdx=0; compIdx < NUM_SAO_COMPONENTS; compIdx++) 213 { 214 if(m_offsetClipTable[compIdx]) 215 { 216 delete[] m_offsetClipTable[compIdx]; m_offsetClipTable[compIdx] = NULL; 217 } 218 } 219 if( m_signTable ) 220 { 221 delete[] m_signTable; m_signTable = NULL; 222 } 223 } 224 225 Void TComSampleAdaptiveOffset::invertQuantOffsets(Int compIdx, Int typeIdc, Int typeAuxInfo, Int* dstOffsets, Int* srcOffsets) 226 { 227 Int codedOffset[MAX_NUM_SAO_CLASSES]; 228 229 ::memcpy(codedOffset, srcOffsets, sizeof(Int)*MAX_NUM_SAO_CLASSES); 230 ::memset(dstOffsets, 0, sizeof(Int)*MAX_NUM_SAO_CLASSES); 231 232 if(typeIdc == SAO_TYPE_START_BO) 233 { 234 for(Int i=0; i< 4; i++) 235 { 236 dstOffsets[(typeAuxInfo+ i)%NUM_SAO_BO_CLASSES] = codedOffset[(typeAuxInfo+ i)%NUM_SAO_BO_CLASSES]*(1<<m_offsetStepLog2[compIdx]); 237 } 238 } 239 else //EO 240 { 241 for(Int i=0; i< NUM_SAO_EO_CLASSES; i++) 242 { 243 dstOffsets[i] = codedOffset[i] *(1<<m_offsetStepLog2[compIdx]); 244 } 245 assert(dstOffsets[SAO_CLASS_EO_PLAIN] == 0); //keep EO plain offset as zero 246 } 247 248 } 249 250 Int TComSampleAdaptiveOffset::getMergeList(TComPic* pic, Int ctu, SAOBlkParam* blkParams, std::vector<SAOBlkParam*>& mergeList) 251 { 252 Int ctuX = ctu % m_numCTUInWidth; 253 Int ctuY = ctu / m_numCTUInWidth; 254 Int mergedCTUPos; 255 Int numValidMergeCandidates = 0; 256 257 for(Int mergeType=0; mergeType< NUM_SAO_MERGE_TYPES; mergeType++) 258 { 259 SAOBlkParam* mergeCandidate = NULL; 260 261 switch(mergeType) 262 { 263 case SAO_MERGE_ABOVE: 264 { 265 if(ctuY > 0) 266 { 267 mergedCTUPos = ctu- m_numCTUInWidth; 268 if( pic->getSAOMergeAvailability(ctu, mergedCTUPos) ) 269 { 270 mergeCandidate = &(blkParams[mergedCTUPos]); 271 } 272 } 273 } 274 break; 275 case SAO_MERGE_LEFT: 276 { 277 if(ctuX > 0) 278 { 279 mergedCTUPos = ctu- 1; 280 if( pic->getSAOMergeAvailability(ctu, mergedCTUPos) ) 281 { 282 mergeCandidate = &(blkParams[mergedCTUPos]); 283 } 284 } 285 } 286 break; 287 default: 288 { 289 printf("not a supported merge type"); 290 assert(0); 291 exit(-1); 292 } 293 } 294 295 mergeList.push_back(mergeCandidate); 296 if (mergeCandidate != NULL) 297 { 298 numValidMergeCandidates++; 299 } 300 } 301 302 return numValidMergeCandidates; 303 } 304 305 306 Void TComSampleAdaptiveOffset::reconstructBlkSAOParam(SAOBlkParam& recParam, std::vector<SAOBlkParam*>& mergeList) 307 { 308 for(Int compIdx=0; compIdx< NUM_SAO_COMPONENTS; compIdx++) 309 { 310 SAOOffset& offsetParam = recParam[compIdx]; 311 312 if(offsetParam.modeIdc == SAO_MODE_OFF) 313 { 314 continue; 315 } 316 317 switch(offsetParam.modeIdc) 318 { 319 case SAO_MODE_NEW: 320 { 321 invertQuantOffsets(compIdx, offsetParam.typeIdc, offsetParam.typeAuxInfo, offsetParam.offset, offsetParam.offset); 322 } 323 break; 324 case SAO_MODE_MERGE: 325 { 326 SAOBlkParam* mergeTarget = mergeList[offsetParam.typeIdc]; 327 assert(mergeTarget != NULL); 328 329 offsetParam = (*mergeTarget)[compIdx]; 330 } 331 break; 332 default: 333 { 334 printf("Not a supported mode"); 335 assert(0); 336 exit(-1); 337 } 338 } 339 } 340 } 341 342 Void TComSampleAdaptiveOffset::reconstructBlkSAOParams(TComPic* pic, SAOBlkParam* saoBlkParams) 343 { 344 m_picSAOEnabled[SAO_Y] = m_picSAOEnabled[SAO_Cb] = m_picSAOEnabled[SAO_Cr] = false; 345 346 for(Int ctu=0; ctu< m_numCTUsPic; ctu++) 347 { 348 std::vector<SAOBlkParam*> mergeList; 349 getMergeList(pic, ctu, saoBlkParams, mergeList); 350 351 reconstructBlkSAOParam(saoBlkParams[ctu], mergeList); 352 353 for(Int compIdx=0; compIdx< NUM_SAO_COMPONENTS; compIdx++) 354 { 355 if(saoBlkParams[ctu][compIdx].modeIdc != SAO_MODE_OFF) 356 { 357 m_picSAOEnabled[compIdx] = true; 358 } 359 } 360 } 361 362 363 } 364 365 366 Void TComSampleAdaptiveOffset::offsetBlock(Int compIdx, Int typeIdx, Int* offset 367 , Pel* srcBlk, Pel* resBlk, Int srcStride, Int resStride, Int width, Int height 368 , Bool isLeftAvail, Bool isRightAvail, Bool isAboveAvail, Bool isBelowAvail, Bool isAboveLeftAvail, Bool isAboveRightAvail, Bool isBelowLeftAvail, Bool isBelowRightAvail) 369 { 370 if(m_lineBufWidth != m_maxCUWidth) 371 { 372 m_lineBufWidth = m_maxCUWidth; 373 374 if (m_signLineBuf1) delete[] m_signLineBuf1; m_signLineBuf1 = NULL; 375 m_signLineBuf1 = new Char[m_lineBufWidth+1]; 376 377 if (m_signLineBuf2) delete[] m_signLineBuf2; m_signLineBuf2 = NULL; 378 m_signLineBuf2 = new Char[m_lineBufWidth+1]; 379 } 380 381 Int* offsetClip = m_offsetClip[compIdx]; 382 383 Int x,y, startX, startY, endX, endY, edgeType; 384 Int firstLineStartX, firstLineEndX, lastLineStartX, lastLineEndX; 385 Char signLeft, signRight, signDown; 386 387 Pel* srcLine = srcBlk; 388 Pel* resLine = resBlk; 389 390 switch(typeIdx) 391 { 392 case SAO_TYPE_EO_0: 393 { 394 offset += 2; 395 startX = isLeftAvail ? 0 : 1; 396 endX = isRightAvail ? width : (width -1); 397 for (y=0; y< height; y++) 398 { 399 signLeft = (Char)m_sign[srcLine[startX] - srcLine[startX-1]]; 400 for (x=startX; x< endX; x++) 401 { 402 signRight = (Char)m_sign[srcLine[x] - srcLine[x+1]]; 403 edgeType = signRight + signLeft; 404 signLeft = -signRight; 405 406 resLine[x] = offsetClip[srcLine[x] + offset[edgeType]]; 407 } 408 srcLine += srcStride; 409 resLine += resStride; 410 } 411 412 } 413 break; 414 case SAO_TYPE_EO_90: 415 { 416 offset += 2; 417 Char *signUpLine = m_signLineBuf1; 418 419 startY = isAboveAvail ? 0 : 1; 420 endY = isBelowAvail ? height : height-1; 421 if (!isAboveAvail) 422 { 423 srcLine += srcStride; 424 resLine += resStride; 425 } 426 427 Pel* srcLineAbove= srcLine- srcStride; 428 for (x=0; x< width; x++) 429 { 430 signUpLine[x] = (Char)m_sign[srcLine[x] - srcLineAbove[x]]; 431 } 432 433 Pel* srcLineBelow; 434 for (y=startY; y<endY; y++) 435 { 436 srcLineBelow= srcLine+ srcStride; 437 438 for (x=0; x< width; x++) 439 { 440 signDown = (Char)m_sign[srcLine[x] - srcLineBelow[x]]; 441 edgeType = signDown + signUpLine[x]; 442 signUpLine[x]= -signDown; 443 444 resLine[x] = offsetClip[srcLine[x] + offset[edgeType]]; 445 } 446 srcLine += srcStride; 447 resLine += resStride; 448 } 449 450 } 451 break; 452 case SAO_TYPE_EO_135: 453 { 454 offset += 2; 455 Char *signUpLine, *signDownLine, *signTmpLine; 456 457 signUpLine = m_signLineBuf1; 458 signDownLine= m_signLineBuf2; 459 460 startX = isLeftAvail ? 0 : 1 ; 461 endX = isRightAvail ? width : (width-1); 462 463 //prepare 2nd line's upper sign 464 Pel* srcLineBelow= srcLine+ srcStride; 465 for (x=startX; x< endX+1; x++) 466 { 467 signUpLine[x] = (Char)m_sign[srcLineBelow[x] - srcLine[x- 1]]; 468 } 469 470 //1st line 471 Pel* srcLineAbove= srcLine- srcStride; 472 firstLineStartX = isAboveLeftAvail ? 0 : 1; 473 firstLineEndX = isAboveAvail? endX: 1; 474 for(x= firstLineStartX; x< firstLineEndX; x++) 475 { 476 edgeType = m_sign[srcLine[x] - srcLineAbove[x- 1]] - signUpLine[x+1]; 477 resLine[x] = offsetClip[srcLine[x] + offset[edgeType]]; 478 } 479 srcLine += srcStride; 480 resLine += resStride; 481 482 483 //middle lines 484 for (y= 1; y< height-1; y++) 485 { 486 srcLineBelow= srcLine+ srcStride; 487 488 for (x=startX; x<endX; x++) 489 { 490 signDown = (Char)m_sign[srcLine[x] - srcLineBelow[x+ 1]] ; 491 edgeType = signDown + signUpLine[x]; 492 resLine[x] = offsetClip[srcLine[x] + offset[edgeType]]; 493 494 signDownLine[x+1] = -signDown; 495 } 496 signDownLine[startX] = (Char)m_sign[srcLineBelow[startX] - srcLine[startX-1]]; 497 498 signTmpLine = signUpLine; 499 signUpLine = signDownLine; 500 signDownLine = signTmpLine; 501 502 srcLine += srcStride; 503 resLine += resStride; 504 } 505 506 //last line 507 srcLineBelow= srcLine+ srcStride; 508 lastLineStartX = isBelowAvail ? startX : (width -1); 509 lastLineEndX = isBelowRightAvail ? width : (width -1); 510 for(x= lastLineStartX; x< lastLineEndX; x++) 511 { 512 edgeType = m_sign[srcLine[x] - srcLineBelow[x+ 1]] + signUpLine[x]; 513 resLine[x] = offsetClip[srcLine[x] + offset[edgeType]]; 514 515 } 516 } 517 break; 518 case SAO_TYPE_EO_45: 519 { 520 offset += 2; 521 Char *signUpLine = m_signLineBuf1+1; 522 523 startX = isLeftAvail ? 0 : 1; 524 endX = isRightAvail ? width : (width -1); 525 526 //prepare 2nd line upper sign 527 Pel* srcLineBelow= srcLine+ srcStride; 528 for (x=startX-1; x< endX; x++) 529 { 530 signUpLine[x] = (Char)m_sign[srcLineBelow[x] - srcLine[x+1]]; 531 } 532 533 534 //first line 535 Pel* srcLineAbove= srcLine- srcStride; 536 firstLineStartX = isAboveAvail ? startX : (width -1 ); 537 firstLineEndX = isAboveRightAvail ? width : (width-1); 538 for(x= firstLineStartX; x< firstLineEndX; x++) 539 { 540 edgeType = m_sign[srcLine[x] - srcLineAbove[x+1]] -signUpLine[x-1]; 541 resLine[x] = offsetClip[srcLine[x] + offset[edgeType]]; 542 } 543 srcLine += srcStride; 544 resLine += resStride; 545 546 //middle lines 547 for (y= 1; y< height-1; y++) 548 { 549 srcLineBelow= srcLine+ srcStride; 550 551 for(x= startX; x< endX; x++) 552 { 553 signDown = (Char)m_sign[srcLine[x] - srcLineBelow[x-1]] ; 554 edgeType = signDown + signUpLine[x]; 555 resLine[x] = offsetClip[srcLine[x] + offset[edgeType]]; 556 signUpLine[x-1] = -signDown; 557 } 558 signUpLine[endX-1] = (Char)m_sign[srcLineBelow[endX-1] - srcLine[endX]]; 559 srcLine += srcStride; 560 resLine += resStride; 561 } 562 563 //last line 564 srcLineBelow= srcLine+ srcStride; 565 lastLineStartX = isBelowLeftAvail ? 0 : 1; 566 lastLineEndX = isBelowAvail ? endX : 1; 567 for(x= lastLineStartX; x< lastLineEndX; x++) 568 { 569 edgeType = m_sign[srcLine[x] - srcLineBelow[x-1]] + signUpLine[x]; 570 resLine[x] = offsetClip[srcLine[x] + offset[edgeType]]; 571 572 } 573 } 574 break; 575 case SAO_TYPE_BO: 576 { 577 Int shiftBits = ((compIdx == SAO_Y)?g_bitDepthY:g_bitDepthC)- NUM_SAO_BO_CLASSES_LOG2; 578 for (y=0; y< height; y++) 579 { 580 for (x=0; x< width; x++) 581 { 582 resLine[x] = offsetClip[ srcLine[x] + offset[srcLine[x] >> shiftBits] ]; 583 } 584 srcLine += srcStride; 585 resLine += resStride; 586 } 587 } 588 break; 589 default: 590 { 591 printf("Not a supported SAO types\n"); 592 assert(0); 593 exit(-1); 594 } 595 } 596 597 598 } 599 600 Void TComSampleAdaptiveOffset::offsetCTU(Int ctu, TComPicYuv* srcYuv, TComPicYuv* resYuv, SAOBlkParam& saoblkParam, TComPic* pPic) 601 { 602 Bool isLeftAvail,isRightAvail,isAboveAvail,isBelowAvail,isAboveLeftAvail,isAboveRightAvail,isBelowLeftAvail,isBelowRightAvail; 603 604 if( 605 (saoblkParam[SAO_Y ].modeIdc == SAO_MODE_OFF) && 606 (saoblkParam[SAO_Cb].modeIdc == SAO_MODE_OFF) && 607 (saoblkParam[SAO_Cr].modeIdc == SAO_MODE_OFF) 608 ) 609 { 610 return; 611 } 612 613 //block boundary availability 614 pPic->getPicSym()->deriveLoopFilterBoundaryAvailibility(ctu, isLeftAvail,isRightAvail,isAboveAvail,isBelowAvail,isAboveLeftAvail,isAboveRightAvail,isBelowLeftAvail,isBelowRightAvail); 615 616 Int yPos = (ctu / m_numCTUInWidth)*m_maxCUHeight; 617 Int xPos = (ctu % m_numCTUInWidth)*m_maxCUWidth; 618 Int height = (yPos + m_maxCUHeight > m_picHeight)?(m_picHeight- yPos):m_maxCUHeight; 619 Int width = (xPos + m_maxCUWidth > m_picWidth )?(m_picWidth - xPos):m_maxCUWidth; 620 621 for(Int compIdx= 0; compIdx < NUM_SAO_COMPONENTS; compIdx++) 622 { 623 SAOOffset& ctbOffset = saoblkParam[compIdx]; 624 625 if(ctbOffset.modeIdc != SAO_MODE_OFF) 626 { 627 Bool isLuma = (compIdx == SAO_Y); 628 Int formatShift= isLuma?0:1; 629 630 Int blkWidth = (width >> formatShift); 631 Int blkHeight = (height >> formatShift); 632 Int blkYPos = (yPos >> formatShift); 633 Int blkXPos = (xPos >> formatShift); 634 635 Int srcStride = isLuma?srcYuv->getStride():srcYuv->getCStride(); 636 Pel* srcBlk = getPicBuf(srcYuv, compIdx)+ (yPos >> formatShift)*srcStride+ (xPos >> formatShift); 637 638 Int resStride = isLuma?resYuv->getStride():resYuv->getCStride(); 639 Pel* resBlk = getPicBuf(resYuv, compIdx)+ blkYPos*resStride+ blkXPos; 640 641 offsetBlock( compIdx, ctbOffset.typeIdc, ctbOffset.offset 642 , srcBlk, resBlk, srcStride, resStride, blkWidth, blkHeight 643 , isLeftAvail, isRightAvail 644 , isAboveAvail, isBelowAvail 645 , isAboveLeftAvail, isAboveRightAvail 646 , isBelowLeftAvail, isBelowRightAvail 647 ); 648 } 649 } //compIdx 650 651 } 652 653 654 Void TComSampleAdaptiveOffset::SAOProcess(TComPic* pDecPic) 655 { 656 if(!m_picSAOEnabled[SAO_Y] && !m_picSAOEnabled[SAO_Cb] && !m_picSAOEnabled[SAO_Cr]) 657 { 658 return; 659 } 660 TComPicYuv* resYuv = pDecPic->getPicYuvRec(); 661 TComPicYuv* srcYuv = m_tempPicYuv; 662 resYuv->copyToPic(srcYuv); 663 for(Int ctu= 0; ctu < m_numCTUsPic; ctu++) 664 { 665 offsetCTU(ctu, srcYuv, resYuv, (pDecPic->getPicSym()->getSAOBlkParam())[ctu], pDecPic); 666 } //ctu 667 } 668 669 670 Pel* TComSampleAdaptiveOffset::getPicBuf(TComPicYuv* pPicYuv, Int compIdx) 671 { 672 Pel* pBuf = NULL; 673 switch(compIdx) 674 { 675 case SAO_Y: 676 { 677 pBuf = pPicYuv->getLumaAddr(); 678 } 679 break; 680 case SAO_Cb: 681 { 682 pBuf = pPicYuv->getCbAddr(); 683 } 684 break; 685 case SAO_Cr: 686 { 687 pBuf = pPicYuv->getCrAddr(); 688 } 689 break; 690 default: 691 { 692 printf("Not a legal component ID for SAO\n"); 693 assert(0); 694 exit(-1); 695 } 696 } 697 698 return pBuf; 699 } 700 #else 46 701 47 702 SAOParam::~SAOParam() … … 1364 2019 } 1365 2020 } 1366 2021 #endif 1367 2022 /** PCM LF disable process. 1368 2023 * \param pcPic picture (TComPic) pointer -
trunk/source/Lib/TLibCommon/TComSampleAdaptiveOffset.h
r313 r540 45 45 //! \{ 46 46 47 48 #if HM_CLEANUP_SAO 49 // ==================================================================================================================== 50 // Constants 51 // ==================================================================================================================== 52 53 #define MAX_SAO_TRUNCATED_BITDEPTH 10 54 // ==================================================================================================================== 55 // Class definition 56 // ==================================================================================================================== 57 extern UInt g_saoMaxOffsetQVal[NUM_SAO_COMPONENTS]; 58 59 class TComSampleAdaptiveOffset 60 { 61 public: 62 TComSampleAdaptiveOffset(); 63 virtual ~TComSampleAdaptiveOffset(); 64 Void SAOProcess(TComPic* pDecPic); 65 #if AUXILIARY_PICTURES 66 Void create( Int picWidth, Int picHeight, ChromaFormat chromaFormatIDC, UInt maxCUWidth, UInt maxCUHeight, UInt maxCUDepth ); 67 #else 68 Void create( Int picWidth, Int picHeight, UInt maxCUWidth, UInt maxCUHeight, UInt maxCUDepth ); 69 #endif 70 Void destroy(); 71 Void reconstructBlkSAOParams(TComPic* pic, SAOBlkParam* saoBlkParams); 72 Void PCMLFDisableProcess (TComPic* pcPic); 73 protected: 74 Void offsetBlock(Int compIdx, Int typeIdx, Int* offset, Pel* srcBlk, Pel* resBlk, Int srcStride, Int resStride, Int width, Int height 75 , Bool isLeftAvail, Bool isRightAvail, Bool isAboveAvail, Bool isBelowAvail, Bool isAboveLeftAvail, Bool isAboveRightAvail, Bool isBelowLeftAvail, Bool isBelowRightAvail); 76 Pel* getPicBuf(TComPicYuv* pPicYuv, Int compIdx); 77 Void invertQuantOffsets(Int compIdx, Int typeIdc, Int typeAuxInfo, Int* dstOffsets, Int* srcOffsets); 78 Void reconstructBlkSAOParam(SAOBlkParam& recParam, std::vector<SAOBlkParam*>& mergeList); 79 Int getMergeList(TComPic* pic, Int ctu, SAOBlkParam* blkParams, std::vector<SAOBlkParam*>& mergeList); 80 Void offsetCTU(Int ctu, TComPicYuv* srcYuv, TComPicYuv* resYuv, SAOBlkParam& saoblkParam, TComPic* pPic); 81 Void xPCMRestoration(TComPic* pcPic); 82 Void xPCMCURestoration ( TComDataCU* pcCU, UInt uiAbsZorderIdx, UInt uiDepth ); 83 Void xPCMSampleRestoration (TComDataCU* pcCU, UInt uiAbsZorderIdx, UInt uiDepth, TextType ttText); 84 protected: 85 UInt m_offsetStepLog2[NUM_SAO_COMPONENTS]; //offset step 86 Int* m_offsetClip[NUM_SAO_COMPONENTS]; //clip table for fast operation 87 Short* m_sign; //sign table for fast operation 88 TComPicYuv* m_tempPicYuv; //temporary buffer 89 Int m_picWidth; 90 Int m_picHeight; 91 Int m_maxCUWidth; 92 Int m_maxCUHeight; 93 Int m_numCTUInWidth; 94 Int m_numCTUInHeight; 95 Int m_numCTUsPic; 96 97 98 Int m_lineBufWidth; 99 Char* m_signLineBuf1; 100 Char* m_signLineBuf2; 101 private: 102 Bool m_picSAOEnabled[NUM_SAO_COMPONENTS]; 103 Int* m_offsetClipTable[NUM_SAO_COMPONENTS]; 104 Short* m_signTable; 105 106 }; 107 #else 108 47 109 // ==================================================================================================================== 48 110 // Constants … … 145 207 }; 146 208 209 #endif 210 147 211 //! \} 148 212 #endif -
trunk/source/Lib/TLibCommon/TComSlice.cpp
r494 r540 48 48 ParameterSetMap<TComVPS> ParameterSetManager::m_vpsMap(MAX_NUM_VPS); 49 49 Int ParameterSetManager::m_activeVPSId = -1; 50 #if IL_SL_SIGNALLING_N037151 TComSPS* TComSPS::m_pcSPS[MAX_LAYERS];52 TComPPS* TComPPS::m_pcPPS[MAX_LAYERS];53 #endif54 50 #endif 55 51 … … 80 76 , m_colFromL0Flag ( 1 ) 81 77 , m_colRefIdx ( 0 ) 82 #if SAO_CHROMA_LAMBDA83 , m_dLambdaLuma( 0.0 )84 , m_dLambdaChroma( 0.0 )85 #else86 , m_dLambda ( 0.0 )87 #endif88 78 , m_uiTLayer ( 0 ) 89 79 , m_bTLayerSwitchingFlag ( false ) … … 118 108 #endif 119 109 , m_bDiscardableFlag ( false ) 110 #if O0149_CROSS_LAYER_BLA_FLAG 111 , m_bCrossLayerBLAFlag ( false ) 112 #endif 120 113 #endif //SVC_EXTENSION 121 114 { … … 143 136 initEqualRef(); 144 137 138 for (Int component = 0; component < 3; component++) 139 { 140 m_lambdas[component] = 0.0; 141 } 142 145 143 for ( Int idx = 0; idx < MAX_NUM_REF; idx++ ) 146 144 { … … 157 155 initWpAcDcParam(); 158 156 m_saoEnabledFlag = false; 157 #if HM_CLEANUP_SAO 158 m_saoEnabledFlagChroma = false; 159 #endif 159 160 } 160 161 … … 276 277 } 277 278 iterPic++; 279 #if SVC_EXTENSION 280 // return NULL, if picture with requested POC is not in the list, otherwise iterator goes outside of the list 281 if( iterPic == rcListPic.end() ) 282 { 283 return NULL; 284 } 285 #endif 278 286 pcPic = *(iterPic); 279 287 } … … 308 316 } 309 317 318 #if POC_RESET_RPS 319 if( ((!pocHasMsb) && ((poc & (pocCycle-1)) == picPoc)) || ( pocHasMsb && (poc == picPoc)) ) 320 #else 310 321 if (poc == picPoc) 322 #endif 311 323 { 312 324 if (pcPic->getIsLongTerm()) … … 357 369 } 358 370 359 #if FIX1071360 371 #if SVC_EXTENSION 361 372 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr, TComPic** ilpPic) … … 363 374 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr ) 364 375 #endif 365 #else 366 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic ) 367 #endif 368 { 369 #if FIX1071 376 { 370 377 if (!checkNumPocTotalCurr) 371 #endif372 378 { 373 379 if (m_eSliceType == I_SLICE) … … 522 528 memset( refResamplingLayer, 0, sizeof( refResamplingLayer ) ); 523 529 #endif 530 #if !RESAMPLING_CONSTRAINT_BUG_FIX 524 531 const Window &scalEL = getSPS()->getScaledRefLayerWindow(m_interLayerPredLayerIdc[i]); 525 532 Int scalingOffset = ((scalEL.getWindowLeftOffset() == 0 ) && … … 528 535 (scalEL.getWindowBottomOffset() == 0 ) 529 536 ); 537 #endif 530 538 531 539 for( i=0; i < m_activeNumILRRefIdx; i++ ) 532 540 { 533 541 UInt refLayerIdc = m_interLayerPredLayerIdc[i]; 542 #if RESAMPLING_CONSTRAINT_BUG_FIX 543 #if O0098_SCALED_REF_LAYER_ID 544 const Window &scalEL = getSPS()->getScaledRefLayerWindowForLayer(m_pcVPS->getRefLayerId( m_layerId, m_interLayerPredLayerIdc[i] )); 545 #else 546 const Window &scalEL = getSPS()->getScaledRefLayerWindow(m_interLayerPredLayerIdc[i]); 547 #endif 548 Int scalingOffset = ((scalEL.getWindowLeftOffset() == 0 ) && 549 (scalEL.getWindowRightOffset() == 0 ) && 550 (scalEL.getWindowTopOffset() == 0 ) && 551 (scalEL.getWindowBottomOffset() == 0 ) 552 ); 553 #endif 534 554 if(!( g_posScalingFactor[refLayerIdc][0] == 65536 && g_posScalingFactor[refLayerIdc][1] == 65536 ) || (!scalingOffset)) // ratio 1x 535 555 { … … 585 605 Int numPocTotalCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr; 586 606 #endif //SVC_EXTENSION 587 #if FIX1071 607 588 608 if (checkNumPocTotalCurr) 589 609 { … … 615 635 m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1); 616 636 } 617 #endif618 637 619 638 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG … … 932 951 numRpsCurrTempList += getNumILRRefIdx(); 933 952 #endif 934 953 } 935 954 #endif 936 955 … … 1038 1057 * If the current picture has a nal_ref_idc that is not 0, it will remain marked as "used for reference". 1039 1058 */ 1059 #if NO_CLRAS_OUTPUT_FLAG 1060 Void TComSlice::decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag) 1061 #else 1040 1062 Void TComSlice::decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic) 1063 #endif 1041 1064 { 1042 1065 TComPic* rpcPic; … … 1056 1079 rpcPic = *(iterPic); 1057 1080 rpcPic->setCurrSliceIdx(0); 1081 #if NO_CLRAS_OUTPUT_FLAG 1082 if (noClrasOutputFlag) 1083 { 1084 if (rpcPic->getPOC() != pocCurr) rpcPic->getSlice(0)->setReferenced(false); // all layers 1085 } 1086 else 1087 { 1088 if (rpcPic->getPOC() != pocCurr && rpcPic->getLayerId() == m_layerId) rpcPic->getSlice(0)->setReferenced(false); // only current layer 1089 } 1090 #else 1058 1091 if (rpcPic->getPOC() != pocCurr) rpcPic->getSlice(0)->setReferenced(false); 1092 #endif 1059 1093 iterPic++; 1060 1094 } … … 1160 1194 m_colFromL0Flag = pSrc->m_colFromL0Flag; 1161 1195 m_colRefIdx = pSrc->m_colRefIdx; 1162 #if SAO_CHROMA_LAMBDA 1163 m_dLambdaLuma = pSrc->m_dLambdaLuma; 1164 m_dLambdaChroma = pSrc->m_dLambdaChroma; 1165 #else 1166 m_dLambda = pSrc->m_dLambda; 1167 #endif 1196 setLambdas(pSrc->getLambdas()); 1168 1197 for (i = 0; i < 2; i++) 1169 1198 { … … 1490 1519 assert(rpcPic->getSlice( 0 )->isReferenced()==0||rpcPic->getUsedByCurr()==0||rpcPic->getTLayer()<=this->getTLayer()); 1491 1520 //check that pictures of higher or equal temporal layer are not in the RPS if the current picture is a TSA picture 1492 if(this->getNalUnitType() == NAL_UNIT_CODED_SLICE_T LA_R || this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N)1521 if(this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_R || this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N) 1493 1522 { 1494 1523 assert(rpcPic->getSlice( 0 )->isReferenced()==0||rpcPic->getTLayer()<this->getTLayer()); … … 1649 1678 /** Function for constructing an explicit Reference Picture Set out of the available pictures in a referenced Reference Picture Set 1650 1679 */ 1651 #if FIX10711652 1680 Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP) 1653 #else1654 Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet)1655 #endif1656 1681 { 1657 1682 TComPic* rpcPic; … … 1678 1703 // and should be added to the explicit Reference Picture Set 1679 1704 pcRPS->setDeltaPOC(k, pReferencePictureSet->getDeltaPOC(i)); 1680 #if FIX10711681 1705 pcRPS->setUsed(k, pReferencePictureSet->getUsed(i) && (!isRAP)); 1682 #else1683 pcRPS->setUsed(k, pReferencePictureSet->getUsed(i));1684 #endif1685 1706 if(pcRPS->getDeltaPOC(k) < 0) 1686 1707 { … … 1834 1855 TComVPS *vps = getVPS(); 1835 1856 UInt retVal, layerId = getLayerId(); 1857 #if O0096_REP_FORMAT_INDEX 1858 if ( layerId == 0 ) 1859 { 1860 retVal = sps->getPicWidthInLumaSamples(); 1861 } 1862 else 1863 { 1864 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : layerId) )->getPicWidthVpsInLumaSamples(); 1865 } 1866 #else 1836 1867 if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() ) 1837 1868 { … … 1842 1873 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getPicWidthVpsInLumaSamples(); 1843 1874 } 1875 #endif 1844 1876 return retVal; 1845 1877 } … … 1849 1881 TComVPS *vps = getVPS(); 1850 1882 UInt retVal, layerId = getLayerId(); 1883 #if O0096_REP_FORMAT_INDEX 1884 if( layerId == 0 ) 1885 { 1886 retVal = sps->getPicHeightInLumaSamples(); 1887 } 1888 else 1889 { 1890 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : layerId) )->getPicHeightVpsInLumaSamples(); 1891 } 1892 #else 1851 1893 if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() ) 1852 1894 { … … 1857 1899 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getPicHeightVpsInLumaSamples(); 1858 1900 } 1901 #endif 1859 1902 return retVal; 1860 1903 } … … 1873 1916 UInt retVal, layerId = getLayerId(); 1874 1917 #endif 1918 #if O0096_REP_FORMAT_INDEX 1919 if( layerId == 0 ) 1920 { 1921 retVal = sps->getChromaFormatIdc(); 1922 } 1923 else 1924 { 1925 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : layerId) )->getChromaFormatVpsIdc(); 1926 } 1927 #else 1875 1928 if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() ) 1876 1929 { … … 1881 1934 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getChromaFormatVpsIdc(); 1882 1935 } 1936 #endif 1883 1937 return retVal; 1884 1938 } … … 1888 1942 TComVPS *vps = getVPS(); 1889 1943 UInt retVal, layerId = getLayerId(); 1944 #if O0096_REP_FORMAT_INDEX 1945 if( layerId == 0 ) 1946 { 1947 retVal = sps->getBitDepthY(); 1948 } 1949 else 1950 { 1951 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : layerId) )->getBitDepthVpsLuma(); 1952 } 1953 #else 1890 1954 if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() ) 1891 1955 { … … 1896 1960 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getBitDepthVpsLuma(); 1897 1961 } 1962 #endif 1898 1963 return retVal; 1899 1964 } … … 1903 1968 TComVPS *vps = getVPS(); 1904 1969 UInt retVal, layerId = getLayerId(); 1970 #if O0096_REP_FORMAT_INDEX 1971 if( layerId == 0 ) 1972 { 1973 retVal = sps->getBitDepthC(); 1974 } 1975 else 1976 { 1977 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : layerId) )->getBitDepthVpsChroma(); 1978 } 1979 #else 1905 1980 if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() ) 1906 1981 { … … 1911 1986 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getBitDepthVpsChroma(); 1912 1987 } 1988 #endif 1913 1989 return retVal; 1914 1990 } … … 2023 2099 ::memset(m_pocLsbNotPresentFlag, 0, sizeof(m_pocLsbNotPresentFlag)); 2024 2100 #endif 2101 #if O0223_PICTURE_TYPES_ALIGN_FLAG 2102 m_crossLayerPictureTypeAlignFlag = true; 2103 #endif 2025 2104 #if N0147_IRAP_ALIGN_FLAG 2026 2105 m_crossLayerIrapAlignFlag = true; … … 2042 2121 } 2043 2122 #endif 2123 #if VPS_VUI_TILES_NOT_IN_USE__FLAG 2124 m_tilesNotInUseFlag = true; 2125 ::memset(m_tilesInUseFlag, 0, sizeof(m_tilesInUseFlag)); 2126 ::memset(m_loopFilterNotAcrossTilesFlag, 0, sizeof(m_loopFilterNotAcrossTilesFlag)); 2127 #endif 2044 2128 #if TILE_BOUNDARY_ALIGNED_FLAG 2045 2129 ::memset(m_tileBoundariesAlignedFlag, 0, sizeof(m_tileBoundariesAlignedFlag)); 2046 2130 #endif 2131 #if VPS_VUI_WPP_NOT_IN_USE__FLAG 2132 m_wppNotInUseFlag = true; 2133 ::memset(m_wppInUseFlag, 0, sizeof(m_wppInUseFlag)); 2134 #endif 2047 2135 #if N0160_VUI_EXT_ILP_REF 2048 2136 m_numIlpRestrictedRefLayers = false; … … 2050 2138 ::memset(m_ctuBasedOffsetEnabledFlag, 0, sizeof(m_ctuBasedOffsetEnabledFlag)); 2051 2139 ::memset(m_minHorizontalCtuOffsetPlus1, 0, sizeof(m_minHorizontalCtuOffsetPlus1)); 2140 #endif 2141 #if VPS_VUI_VIDEO_SIGNAL 2142 m_vidSigPresentVpsFlag=true; 2143 m_vpsVidSigInfo=1; 2144 ::memset( m_vpsVidSigIdx, 0, sizeof(m_vpsVidSigIdx) ); 2145 m_vpsVidSigIdx[0]=0; 2146 for (Int i=0; i < 16; i++) 2147 { 2148 m_vpsVidFormat[i] = 5; 2149 m_vpsFullRangeFlag[i] = false; 2150 m_vpsColorPrimaries[i] = 2; 2151 m_vpsTransChar[i] = 2; 2152 m_vpsMatCoeff[i] = 2; 2153 } 2052 2154 #endif 2053 2155 #if VPS_VUI_BITRATE_PICRATE … … 2064 2166 #if VIEW_ID_RELATED_SIGNALING 2065 2167 ::memset(m_viewIdVal, 0, sizeof(m_viewIdVal)); 2168 #endif 2169 #if O0092_0094_DEPENDENCY_CONSTRAINT 2170 for (Int i = 0; i < MAX_NUM_LAYER_IDS; i++) 2171 { 2172 m_numberRefLayers[i] = 0; 2173 for (Int j = 0; j < MAX_NUM_LAYER_IDS; j++) 2174 { 2175 m_recursiveRefLayerFlag[i][j] = 0; 2176 } 2177 } 2178 #endif 2179 #if VPS_DPB_SIZE_TABLE 2180 ::memset( m_subLayerFlagInfoPresentFlag, 0, sizeof(m_subLayerFlagInfoPresentFlag ) ); 2181 ::memset( m_subLayerDpbInfoPresentFlag, 0, sizeof(m_subLayerDpbInfoPresentFlag ) ); 2182 ::memset( m_maxVpsDecPicBufferingMinus1, 0, sizeof(m_maxVpsDecPicBufferingMinus1 ) ); 2183 ::memset( m_maxVpsNumReorderPics, 0, sizeof(m_maxVpsNumReorderPics ) ); 2184 ::memset( m_maxVpsLatencyIncreasePlus1, 0, sizeof(m_maxVpsLatencyIncreasePlus1 ) ); 2185 ::memset( m_numSubDpbs , 0, sizeof(m_numSubDpbs) ); 2066 2186 #endif 2067 2187 } … … 2117 2237 } 2118 2238 #endif 2119 2120 #if IL_SL_SIGNALLING_N0371 2121 Bool TComVPS::checkLayerDependency(UInt i, UInt j) 2122 { 2123 if( this->getDirectDependencyFlag(i, j) == true ) 2124 { 2125 return true; 2126 } 2127 else 2128 { 2129 for(UInt k=i-1; k>j; k--) 2130 { 2131 if( this->getDirectDependencyFlag(i, k) == true ) 2132 { 2133 checkLayerDependency( k,j ); 2134 } 2135 } 2136 } 2137 return false; 2239 #if VPS_DPB_SIZE_TABLE 2240 Void TComVPS::deriveNumberOfSubDpbs() 2241 { 2242 // Derive number of sub-DPBs 2243 // For output layer set 0 2244 setNumSubDpbs(0, 1); 2245 // For other output layer sets 2246 for( Int i = 1; i < getNumOutputLayerSets(); i++) 2247 { 2248 setNumSubDpbs( i, getNumLayersInIdList( getOutputLayerSetIdx(i)) ); 2249 } 2250 } 2251 #endif 2252 #if VPS_VUI_TILES_NOT_IN_USE__FLAG 2253 Void TComVPS::setTilesNotInUseFlag(Bool x) 2254 { 2255 m_tilesNotInUseFlag = x; 2256 if (m_tilesNotInUseFlag) 2257 { 2258 for (int i = 0; i < getMaxLayers(); i++) 2259 { 2260 m_tilesInUseFlag[i] = m_loopFilterNotAcrossTilesFlag[i] = m_tilesNotInUseFlag; 2261 } 2262 } 2263 #if TILE_BOUNDARY_ALIGNED_FLAG 2264 if (m_tilesNotInUseFlag) 2265 { 2266 for (int i = 1; i < getMaxLayers(); i++) 2267 { 2268 for(int j = 0; j < getNumDirectRefLayers(getLayerIdInNuh(i)); j++) 2269 { 2270 setTileBoundariesAlignedFlag(i, j, m_tilesNotInUseFlag); 2271 } 2272 } 2273 } 2274 #endif 2275 } 2276 #endif 2277 #if VPS_VUI_WPP_NOT_IN_USE__FLAG 2278 Void TComVPS::setWppNotInUseFlag(Bool x) 2279 { 2280 m_wppNotInUseFlag = x; 2281 if (m_wppNotInUseFlag) 2282 { 2283 for (int i = 0; i < getMaxLayers(); i++) 2284 { 2285 m_wppInUseFlag[i] = m_wppNotInUseFlag; 2286 } 2287 } 2288 } 2289 #endif 2290 #if O0092_0094_DEPENDENCY_CONSTRAINT 2291 Void TComVPS::setRefLayersFlags(Int currLayerId) 2292 { 2293 for (Int i = 0; i < getNumDirectRefLayers(currLayerId); i++) 2294 { 2295 UInt refLayerId = getRefLayerId(currLayerId, i); 2296 setRecursiveRefLayerFlag(currLayerId, refLayerId, true); 2297 for (Int k = 0; k < MAX_NUM_LAYER_IDS; k++) 2298 { 2299 setRecursiveRefLayerFlag(currLayerId, k, (getRecursiveRefLayerFlag(currLayerId, k) | getRecursiveRefLayerFlag(refLayerId, k))); 2300 } 2301 } 2302 } 2303 2304 Void TComVPS::setNumRefLayers(Int currLayerId) 2305 { 2306 for (Int i = 0; i <= getMaxLayers(); i++) 2307 { 2308 UInt iNuhLId = getLayerIdInNuh(i); 2309 setRefLayersFlags(iNuhLId); 2310 for (UInt j = 0; j < MAX_NUM_LAYER_IDS; j++) 2311 { 2312 m_numberRefLayers[iNuhLId] += (getRecursiveRefLayerFlag(iNuhLId, j) == true ? 1 : 0); 2313 } 2314 } 2138 2315 } 2139 2316 #endif … … 2224 2401 #if REPN_FORMAT_IN_VPS 2225 2402 , m_updateRepFormatFlag (false) 2403 #if O0096_REP_FORMAT_INDEX 2404 , m_updateRepFormatIndex (0) 2405 #endif 2406 #endif 2407 #if SCALINGLIST_INFERRING 2408 , m_inferScalingListFlag ( false ) 2409 , m_scalingListRefLayerId ( 0 ) 2226 2410 #endif 2227 2411 #endif //SVC_EXTENSION … … 2248 2432 TComSPS::~TComSPS() 2249 2433 { 2434 #if SCALINGLIST_INFERRING 2435 if( !m_inferScalingListFlag ) 2436 #endif 2250 2437 delete m_scalingList; 2251 2438 m_RPSList.destroy(); … … 2373 2560 const Int TComSPS::m_winUnitX[]={1,2,2,1}; 2374 2561 const Int TComSPS::m_winUnitY[]={1,2,1,1}; 2562 2563 #if O0098_SCALED_REF_LAYER_ID 2564 Window& TComSPS::getScaledRefLayerWindowForLayer(Int layerId) 2565 { 2566 static Window win; 2567 2568 for (Int i = 0; i < m_numScaledRefLayerOffsets; i++) 2569 { 2570 if (layerId == m_scaledRefLayerId[i]) 2571 { 2572 return m_scaledRefLayerWindow[i]; 2573 } 2574 } 2575 2576 win.resetWindow(); // scaled reference layer offsets are inferred to be zero when not present 2577 return win; 2578 } 2579 #endif 2375 2580 2376 2581 TComPPS::TComPPS() … … 2407 2612 , m_listsModificationPresentFlag( 0) 2408 2613 , m_numExtraSliceHeaderBits(0) 2614 #if SCALINGLIST_INFERRING 2615 , m_inferScalingListFlag ( false ) 2616 , m_scalingListRefLayerId ( 0 ) 2617 #endif 2409 2618 { 2410 2619 m_scalingList = new TComScalingList; … … 2423 2632 m_puiRowHeight = NULL; 2424 2633 } 2634 2635 #if SCALINGLIST_INFERRING 2636 if( !m_inferScalingListFlag ) 2637 #endif 2425 2638 delete m_scalingList; 2426 2639 } … … 2640 2853 /** set default quantization matrix to array 2641 2854 */ 2642 #if IL_SL_SIGNALLING_N03712643 Void TComSlice::setDefaultScalingList( UInt layerId )2644 #else2645 2855 Void TComSlice::setDefaultScalingList() 2646 #endif2647 2856 { 2648 2857 for(UInt sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++) … … 2650 2859 for(UInt listId=0;listId<g_scalingListNum[sizeId];listId++) 2651 2860 { 2652 #if IL_SL_SIGNALLING_N0371 2653 getScalingList()->processDefaultMarix(sizeId, listId, layerId); 2654 #else 2655 getScalingList()->processDefaultMarix(sizeId, listId); 2656 #endif 2861 getScalingList()->processDefaultMatrix(sizeId, listId); 2657 2862 } 2658 2863 } … … 2829 3034 * \param Index of input matrix 2830 3035 */ 2831 #if IL_SL_SIGNALLING_N0371 2832 Void TComScalingList::processDefaultMarix(UInt sizeId, UInt listId, UInt layerId) 2833 #else 2834 Void TComScalingList::processDefaultMarix(UInt sizeId, UInt listId) 2835 #endif 2836 { 2837 #if IL_SL_SIGNALLING_N0371 2838 Int i,coefNum = min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId]); 2839 UInt* scan = (sizeId == 0) ? g_auiSigLastScan [ SCAN_DIAG ] [ 1 ] : g_sigLastScanCG32x32; 2840 Int *src = getScalingListDefaultAddress(sizeId, listId); 2841 #endif 2842 3036 Void TComScalingList::processDefaultMatrix(UInt sizeId, UInt listId) 3037 { 2843 3038 ::memcpy(getScalingListAddress(sizeId, listId),getScalingListDefaultAddress(sizeId,listId),sizeof(Int)*min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId])); 2844 2845 #if IL_SL_SIGNALLING_N03712846 for(i = 0; i < coefNum; i++)2847 {2848 ref_scalingListCoef[layerId][sizeId][listId][i] = src[scan[i]];2849 }2850 #endif2851 2852 3039 setScalingListDC(sizeId,listId,SCALING_LIST_DC); 2853 #if IL_SL_SIGNALLING_N03712854 ref_scalingListDC[layerId][sizeId][listId] = SCALING_LIST_DC;2855 #endif2856 3040 } 2857 3041 2858 3042 /** check DC value of matrix for default matrix signaling 2859 3043 */ 2860 #if IL_SL_SIGNALLING_N03712861 Void TComScalingList::checkDcOfMatrix( UInt layerId )2862 #else2863 3044 Void TComScalingList::checkDcOfMatrix() 2864 #endif2865 3045 { 2866 3046 for(UInt sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++) … … 2871 3051 if(getScalingListDC(sizeId,listId) == 0) 2872 3052 { 2873 #if IL_SL_SIGNALLING_N0371 2874 processDefaultMarix(sizeId, listId, layerId); 2875 #else 2876 processDefaultMarix(sizeId, listId); 2877 #endif 3053 processDefaultMatrix(sizeId, listId); 2878 3054 } 2879 3055 } … … 2956 3132 m_activeVPSId = vpsId; 2957 3133 m_activeSPSId = spsId; 2958 2959 #if IL_SL_SIGNALLING_N03712960 activeRefPPSId[ sps->getLayerId() ] = ppsId;2961 activeRefSPSId[ sps->getLayerId() ] = spsId;2962 #endif2963 3134 2964 3135 return true; … … 3068 3239 #endif 3069 3240 3070 VoidTComSlice::setBaseColPic( TComList<TComPic*>& rcListPic, UInt refLayerIdc )3241 Bool TComSlice::setBaseColPic( TComList<TComPic*>& rcListPic, UInt refLayerIdc ) 3071 3242 { 3072 3243 if(m_layerId == 0) 3073 3244 { 3074 3245 memset( m_pcBaseColPic, 0, sizeof( m_pcBaseColPic ) ); 3075 return ;3246 return false; 3076 3247 } 3077 3248 #if POC_RESET_FLAG 3078 if( this->getPocResetFlag() ) 3079 { 3080 setBaseColPic(refLayerIdc, xGetRefPic(rcListPic, 0)); 3249 TComPic* pic = xGetRefPic( rcListPic, m_bPocResetFlag ? 0 : m_iPOC ); 3250 3251 if( pic ) 3252 { 3253 setBaseColPic(refLayerIdc, pic ); 3081 3254 } 3082 3255 else 3083 3256 { 3084 setBaseColPic(refLayerIdc, xGetRefPic(rcListPic, getPOC())); 3085 } 3257 return false; 3258 } 3259 3260 return true; 3086 3261 #else 3087 3262 setBaseColPic(refLayerIdc, xGetRefPic(rcListPic, getPOC())); -
trunk/source/Lib/TLibCommon/TComSlice.h
r494 r540 156 156 Void setScalingListPresentFlag (Bool b) { m_scalingListPresentFlag = b; } 157 157 Bool getScalingListPresentFlag () { return m_scalingListPresentFlag; } 158 159 #if IL_SL_SIGNALLING_N0371160 UInt m_layerId;161 162 Void setPredScalingListFlag (Bool b) { m_predScalingListFlag = b; }163 Bool getPredScalingListFlag () { return m_predScalingListFlag; }164 Void setScalingListRefLayerId (UInt b) { m_scalingListRefLayerId = b; }165 UInt getScalingListRefLayerId () { return m_scalingListRefLayerId; }166 #endif167 168 158 Int* getScalingListAddress (UInt sizeId, UInt listId) { return m_scalingListCoef[sizeId][listId]; } //!< get matrix coefficient 169 159 Bool checkPredMode (UInt sizeId, UInt listId); … … 171 161 UInt getRefMatrixId (UInt sizeId, UInt listId) { return m_refMatrixId[sizeId][listId]; } //!< get reference matrix ID 172 162 Int* getScalingListDefaultAddress (UInt sizeId, UInt listId); //!< get default matrix coefficient 173 174 #if IL_SL_SIGNALLING_N0371 175 Void processDefaultMarix (UInt sizeId, UInt listId, UInt layerId ); 176 #else 177 Void processDefaultMarix (UInt sizeId, UInt listId); 178 #endif 179 163 Void processDefaultMatrix (UInt sizeId, UInt listId); 180 164 Void setScalingListDC (UInt sizeId, UInt listId, UInt u) { m_scalingListDC[sizeId][listId] = u; } //!< set DC value 181 165 182 166 Int getScalingListDC (UInt sizeId, UInt listId) { return m_scalingListDC[sizeId][listId]; } //!< get DC value 183 184 #if IL_SL_SIGNALLING_N0371185 Void setLayerId(UInt layerId) { m_layerId = layerId; }186 UInt getLayerId() { return m_layerId; }187 Void checkDcOfMatrix ( UInt m_layerId );188 #else189 167 Void checkDcOfMatrix (); 190 #endif191 192 168 Void processRefMatrix (UInt sizeId, UInt listId , UInt refListId ); 193 169 Bool xParseScalingList (Char* pchFile); … … 200 176 UInt m_refMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< RefMatrixID 201 177 Bool m_scalingListPresentFlag; //!< flag for using default matrix 202 203 #if IL_SL_SIGNALLING_N0371204 Bool m_predScalingListFlag; //!< flag for inter-layer scaling-list prediction205 UInt m_scalingListRefLayerId; //!< scaling_list_ref_layer_id206 #endif207 208 178 UInt m_predMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< reference list index 209 179 Int *m_scalingListCoef [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< quantization matrix … … 436 406 class RepFormat 437 407 { 408 #if REPN_FORMAT_CONTROL_FLAG 409 Bool m_chromaAndBitDepthVpsPresentFlag; 410 #endif 438 411 #if AUXILIARY_PICTURES 439 412 ChromaFormat m_chromaFormatVpsIdc; … … 449 422 public: 450 423 RepFormat(); 424 425 #if REPN_FORMAT_CONTROL_FLAG 426 Bool getChromaAndBitDepthVpsPresentFlag() { return m_chromaAndBitDepthVpsPresentFlag; } 427 void setChromaAndBitDepthVpsPresentFlag(Bool x) { m_chromaAndBitDepthVpsPresentFlag = x; } 428 #endif 451 429 452 430 #if AUXILIARY_PICTURES … … 504 482 Int m_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 505 483 Int m_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1]; 506 #endif507 #if IL_SL_SIGNALLING_N0371508 Bool m_scalingListLayerDependency[MAX_LAYERS][MAX_LAYERS]; // layer dependency for scaling list509 484 #endif 510 485 #if VPS_EXTN_OFFSET … … 555 530 #if M0457_PREDICTION_INDICATIONS 556 531 UInt m_directDepTypeLen; 532 #if O0096_DEFAULT_DEPENDENCY_TYPE 533 Bool m_defaultDirectDependencyTypeFlag; 534 UInt m_defaultDirectDependencyType; 535 #endif 557 536 UInt m_directDependencyType[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 558 537 #endif … … 569 548 Bool m_pocLsbNotPresentFlag[MAX_VPS_LAYER_ID_PLUS1]; 570 549 #endif 550 #if O0223_PICTURE_TYPES_ALIGN_FLAG 551 Bool m_crossLayerPictureTypeAlignFlag; 552 #endif 571 553 #if N0147_IRAP_ALIGN_FLAG 572 554 Bool m_crossLayerIrapAlignFlag; … … 582 564 Bool m_maxTidRefPresentFlag; 583 565 #endif 566 #if VPS_TSLAYERS 567 Bool m_maxTSLayersPresentFlag; 568 UInt m_maxTSLayerMinus1[MAX_VPS_LAYER_ID_PLUS1 - 1]; 569 #endif 584 570 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 585 571 Bool m_singleLayerForNonIrapFlag; 586 572 #endif 573 #if HIGHER_LAYER_IRAP_SKIP_FLAG 574 Bool m_higherLayerIrapSkipFlag; 575 #endif 576 #if VPS_VUI_TILES_NOT_IN_USE__FLAG 577 Bool m_tilesNotInUseFlag; 578 Bool m_tilesInUseFlag[MAX_VPS_LAYER_ID_PLUS1]; 579 Bool m_loopFilterNotAcrossTilesFlag[MAX_VPS_LAYER_ID_PLUS1]; 580 #endif 587 581 #if TILE_BOUNDARY_ALIGNED_FLAG 588 582 Bool m_tileBoundariesAlignedFlag[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 583 #endif 584 #if VPS_VUI_WPP_NOT_IN_USE__FLAG 585 Bool m_wppNotInUseFlag; 586 Bool m_wppInUseFlag[MAX_VPS_LAYER_ID_PLUS1]; 589 587 #endif 590 588 #if N0160_VUI_EXT_ILP_REF … … 593 591 Bool m_ctuBasedOffsetEnabledFlag [MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 594 592 Int m_minHorizontalCtuOffsetPlus1 [MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 593 #endif 594 #if VPS_VUI_VIDEO_SIGNAL 595 Bool m_vidSigPresentVpsFlag; 596 Int m_vpsVidSigInfo; 597 Int m_vpsVidSigIdx[MAX_VPS_LAYER_ID_PLUS1]; 598 Int m_vpsVidFormat[16]; 599 Bool m_vpsFullRangeFlag[16]; 600 Int m_vpsColorPrimaries[16]; 601 Int m_vpsTransChar[16]; 602 Int m_vpsMatCoeff[16]; 595 603 #endif 596 604 #if VPS_VUI_BITRATE_PICRATE … … 604 612 Int m_avgPicRate [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 605 613 #endif 614 #if O0153_ALT_OUTPUT_LAYER_FLAG 615 Bool m_altOutputLayerFlag; 616 #endif 606 617 #if REPN_FORMAT_IN_VPS 607 618 Bool m_repFormatIdxPresentFlag; … … 617 628 #if O0215_PHASE_ALIGNMENT 618 629 Bool m_phaseAlignFlag; 630 #endif 631 632 #if O0092_0094_DEPENDENCY_CONSTRAINT 633 Int m_numberRefLayers[MAX_NUM_LAYER_IDS]; // number of direct and indirect reference layers of a coding layer 634 Bool m_recursiveRefLayerFlag[MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS]; // flag to indicate if j-th layer is a direct or indirect reference layer of i-th layer 635 #endif 636 #if VPS_DPB_SIZE_TABLE 637 Bool m_subLayerFlagInfoPresentFlag [MAX_VPS_OP_LAYER_SETS_PLUS1]; 638 Bool m_subLayerDpbInfoPresentFlag [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS]; 639 Int m_maxVpsDecPicBufferingMinus1 [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS][MAX_TLAYER]; 640 Int m_maxVpsNumReorderPics [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS]; 641 Int m_maxVpsLatencyIncreasePlus1 [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS]; 642 Int m_numSubDpbs [MAX_VPS_OP_LAYER_SETS_PLUS1]; 619 643 #endif 620 644 #endif //SVC_EXTENSION … … 683 707 Void deriveLayerIdListVariables(); 684 708 #endif 685 686 #if IL_SL_SIGNALLING_N0371 687 Bool checkLayerDependency(UInt i, UInt j); 688 Bool getScalingListLayerDependency ( UInt layerId, UInt refLayerId ) { return m_scalingListLayerDependency[layerId][refLayerId]; } 689 Void setScalingListLayerDependency ( UInt layerId, UInt refLayerId, Bool val ) { m_scalingListLayerDependency[layerId][refLayerId] = val; } 690 #endif 691 709 #if VPS_DPB_SIZE_TABLE 710 Void deriveNumberOfSubDpbs(); 711 #endif 712 713 #if O0092_0094_DEPENDENCY_CONSTRAINT 714 Void setRefLayersFlags(Int currLayerId); 715 Bool getRecursiveRefLayerFlag(Int currLayerId, Int refLayerId) { return m_recursiveRefLayerFlag[currLayerId][refLayerId];} 716 Void setRecursiveRefLayerFlag(Int currLayerId, Int refLayerId, Bool x) { m_recursiveRefLayerFlag[currLayerId][refLayerId] = x; } 717 Int getNumRefLayers(Int currLayerId) { return m_numberRefLayers[currLayerId]; } 718 Void setNumRefLayers(Int currLayerId); 719 #endif 692 720 #if VPS_RENAME 693 721 UInt getMaxLayerId() { return m_maxLayerId; } … … 764 792 UInt getDirectDepTypeLen() { return m_directDepTypeLen; } 765 793 Void setDirectDepTypeLen(UInt x) { m_directDepTypeLen = x; } 766 794 #if O0096_DEFAULT_DEPENDENCY_TYPE 795 Bool getDefaultDirectDependencyTypeFlag() { return m_defaultDirectDependencyTypeFlag; } 796 Void setDefaultDirectDependecyTypeFlag(Bool x) { m_defaultDirectDependencyTypeFlag = x; } 797 UInt getDefaultDirectDependencyType() { return m_defaultDirectDependencyType; } 798 Void setDefaultDirectDependecyType(UInt x) { m_defaultDirectDependencyType = x; } 799 #endif 767 800 UInt getDirectDependencyType(Int currLayerId, Int refLayerId) { return m_directDependencyType[currLayerId][refLayerId]; } 768 801 Void setDirectDependencyType(Int currLayerId, Int refLayerId, UInt x) { m_directDependencyType[currLayerId][refLayerId] = x; } … … 791 824 Void setPocLsbNotPresentFlag(Int i, Bool x) { m_pocLsbNotPresentFlag[i] = x; } 792 825 #endif 826 #if O0223_PICTURE_TYPES_ALIGN_FLAG 827 Bool getCrossLayerPictureTypeAlignFlag() { return m_crossLayerPictureTypeAlignFlag; } 828 Void setCrossLayerPictureTypeAlignFlag(Bool x) { m_crossLayerPictureTypeAlignFlag = x; } 829 #endif 793 830 #if N0147_IRAP_ALIGN_FLAG 794 831 Bool getCrossLayerIrapAlignFlag() { return m_crossLayerIrapAlignFlag; } … … 808 845 Void setMaxTidRefPresentFlag(Bool x) { m_maxTidRefPresentFlag = x;} 809 846 #endif 847 #if VPS_TSLAYERS 848 Bool getMaxTSLayersPresentFlag() { return m_maxTSLayersPresentFlag ;} 849 Void setMaxTSLayersPresentFlag(Bool x) { m_maxTSLayersPresentFlag = x;} 850 UInt getMaxTSLayersMinus1(Int layerId) { return m_maxTSLayerMinus1[layerId];} 851 Void setMaxTSLayersMinus1(Int layerId, UInt maxTSublayer) { m_maxTSLayerMinus1[layerId] = maxTSublayer;} 852 #endif 810 853 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 811 854 Bool getSingleLayerForNonIrapFlag() { return m_singleLayerForNonIrapFlag; } 812 855 Void setSingleLayerForNonIrapFlag(Bool x) { m_singleLayerForNonIrapFlag = x; } 813 856 #endif 857 #if HIGHER_LAYER_IRAP_SKIP_FLAG 858 Bool getHigherLayerIrapSkipFlag() { return m_higherLayerIrapSkipFlag; } 859 Void setHigherLayerIrapSkipFlag(Bool x) { m_higherLayerIrapSkipFlag = x; } 860 #endif 861 #if VPS_VUI_TILES_NOT_IN_USE__FLAG 862 Bool getTilesNotInUseFlag() { return m_tilesNotInUseFlag; } 863 Void setTilesNotInUseFlag(Bool x); 864 Bool getTilesInUseFlag(Int currLayerId) { return m_tilesInUseFlag[currLayerId]; } 865 Void setTilesInUseFlag(Int currLayerId, Bool x) { m_tilesInUseFlag[currLayerId] = x; } 866 Bool getLoopFilterNotAcrossTilesFlag(Int currLayerId) { return m_loopFilterNotAcrossTilesFlag[currLayerId]; } 867 Void setLoopFilterNotAcrossTilesFlag(Int currLayerId, Bool x) { m_loopFilterNotAcrossTilesFlag[currLayerId] = x; } 868 #endif 814 869 #if TILE_BOUNDARY_ALIGNED_FLAG 815 870 Bool getTileBoundariesAlignedFlag(Int currLayerId, Int refLayerId) { return m_tileBoundariesAlignedFlag[currLayerId][refLayerId]; } 816 871 Void setTileBoundariesAlignedFlag(Int currLayerId, Int refLayerId, Bool x) { m_tileBoundariesAlignedFlag[currLayerId][refLayerId] = x; } 817 872 #endif 873 #if VPS_VUI_WPP_NOT_IN_USE__FLAG 874 Bool getWppNotInUseFlag() { return m_wppNotInUseFlag; } 875 Void setWppNotInUseFlag(Bool x); 876 Bool getWppInUseFlag(Int currLayerId) { return m_wppInUseFlag[currLayerId]; } 877 Void setWppInUseFlag(Int currLayerId, Bool x) { m_wppInUseFlag[currLayerId] = x; } 878 #endif 818 879 #if N0160_VUI_EXT_ILP_REF 819 880 Bool getNumIlpRestrictedRefLayers ( ) { return m_numIlpRestrictedRefLayers ;} … … 828 889 Int getMinHorizontalCtuOffsetPlus1 ( Int currLayerId, Int refLayerId ) { return m_minHorizontalCtuOffsetPlus1[currLayerId][refLayerId];} 829 890 Void setMinHorizontalCtuOffsetPlus1 ( Int currLayerId, Int refLayerId, Int val ) { m_minHorizontalCtuOffsetPlus1[currLayerId][refLayerId] = val;} 891 #endif 892 #if VPS_VUI_VIDEO_SIGNAL 893 Bool getVideoSigPresentVpsFlag() { return m_vidSigPresentVpsFlag; } 894 Void setVideoSigPresentVpsFlag(Bool x) { m_vidSigPresentVpsFlag = x; } 895 Int getNumVideoSignalInfo() { return m_vpsVidSigInfo; } 896 Void setNumVideoSignalInfo(Int x) { m_vpsVidSigInfo = x; } 897 Int getVideoSignalInfoIdx(Int idx) { return m_vpsVidSigIdx[idx]; } 898 Void setVideoSignalInfoIdx(Int idx, Int x) { m_vpsVidSigIdx[idx] = x; } 899 Int getVideoVPSFormat(Int idx) { return m_vpsVidFormat[idx]; } 900 Void setVideoVPSFormat(Int idx, Int x) { m_vpsVidFormat[idx] = x; } 901 Bool getVideoFullRangeVpsFlag(Int idx) { return m_vpsFullRangeFlag[idx];} 902 Void setVideoFullRangeVpsFlag(Int idx, Bool x) { m_vpsFullRangeFlag[idx] = x; } 903 Int getColorPrimaries(Int idx) { return m_vpsColorPrimaries[idx]; } 904 Void setColorPrimaries(Int idx, Int x) { m_vpsColorPrimaries[idx] = x; } 905 Int getTransCharacter(Int idx) { return m_vpsTransChar[idx]; } 906 Void setTransCharacter(Int idx, Int x) { m_vpsTransChar[idx] = x; } 907 Int getMaxtrixCoeff(Int idx) { return m_vpsMatCoeff[idx]; } 908 Void setMaxtrixCoeff(Int idx, Int x) { m_vpsMatCoeff[idx] = x; } 830 909 #endif 831 910 #if VPS_VUI_BITRATE_PICRATE … … 850 929 Void setAvgPicRate(Int i, Int j, Int x) { m_avgPicRate[i][j] = x; } 851 930 #endif 852 931 #if O0153_ALT_OUTPUT_LAYER_FLAG 932 Bool getAltOuputLayerFlag() { return m_altOutputLayerFlag; } 933 Void setAltOuputLayerFlag(Bool x) { m_altOutputLayerFlag = x; } 934 #endif 853 935 #if REPN_FORMAT_IN_VPS 854 936 Bool getRepFormatIdxPresentFlag() { return m_repFormatIdxPresentFlag; } … … 883 965 Bool getPhaseAlignFlag() { return m_phaseAlignFlag; } 884 966 Void setPhaseAlignFlag(Bool x) { m_phaseAlignFlag = x; } 967 #endif 968 #if VPS_DPB_SIZE_TABLE 969 Bool getSubLayerFlagInfoPresentFlag(Int i) {return m_subLayerFlagInfoPresentFlag[i]; } 970 Void setSubLayerFlagInfoPresentFlag(Int i, Bool x) {m_subLayerFlagInfoPresentFlag[i] = x; } 971 972 Bool getSubLayerDpbInfoPresentFlag(Int i, Int j) {return m_subLayerDpbInfoPresentFlag[i][j]; } 973 Void setSubLayerDpbInfoPresentFlag(Int i, Int j, Bool x) {m_subLayerDpbInfoPresentFlag[i][j] = x; } 974 975 // For the 0-th output layer set, use the date from the active SPS for base layer. 976 Int getMaxVpsDecPicBufferingMinus1(Int i, Int k, Int j) { assert(i != 0); return m_maxVpsDecPicBufferingMinus1[i][k][j]; } 977 Void setMaxVpsDecPicBufferingMinus1(Int i, Int k, Int j, Int x) { m_maxVpsDecPicBufferingMinus1[i][k][j] = x; } 978 979 Int getMaxVpsNumReorderPics(Int i, Int j) { assert(i != 0); return m_maxVpsNumReorderPics[i][j]; } 980 Void setMaxVpsNumReorderPics(Int i, Int j, Int x) { m_maxVpsNumReorderPics[i][j] = x; } 981 982 Int getMaxVpsLatencyIncreasePlus1(Int i, Int j) { assert(i != 0); return m_maxVpsLatencyIncreasePlus1[i][j]; } 983 Void setMaxVpsLatencyIncreasePlus1(Int i, Int j, Int x) { m_maxVpsLatencyIncreasePlus1[i][j] = x; } 984 985 Int getNumSubDpbs(Int i) { return m_numSubDpbs[i]; } 986 Void setNumSubDpbs(Int i, Int x) { m_numSubDpbs[i] = x; } 885 987 #endif 886 988 #endif //SVC_EXTENSION … … 1185 1287 UInt m_layerId; 1186 1288 1187 #if IL_SL_SIGNALLING_N03711188 TComVPS* m_pVPS;1189 static TComSPS* m_pcSPS[MAX_LAYERS];1190 Bool m_predScalingListFlag;1191 UInt m_scalingListRefLayerId;1192 #endif1193 1194 1289 #if REF_IDX_MFM 1195 1290 #if !M0457_COL_PICTURE_SIGNALING … … 1198 1293 #endif 1199 1294 UInt m_numScaledRefLayerOffsets; 1295 #if O0098_SCALED_REF_LAYER_ID 1296 UInt m_scaledRefLayerId[MAX_LAYERS]; 1297 #endif 1200 1298 Window m_scaledRefLayerWindow[MAX_LAYERS]; 1201 1299 #if REPN_FORMAT_IN_VPS 1202 1300 Bool m_updateRepFormatFlag; 1301 #if O0096_REP_FORMAT_INDEX 1302 UInt m_updateRepFormatIndex; 1303 #endif 1304 #endif 1305 #if SCALINGLIST_INFERRING 1306 Bool m_inferScalingListFlag; 1307 UInt m_scalingListRefLayerId; 1203 1308 #endif 1204 1309 #endif //SVC_EXTENSION … … 1322 1427 Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } 1323 1428 1324 #if IL_SL_SIGNALLING_N0371 1325 Bool getPredScalingListFlag() { return m_predScalingListFlag; } 1326 Void setPredScalingListFlag( Bool b ) { m_predScalingListFlag = b; } 1327 UInt getScalingListRefLayerId() { return m_scalingListRefLayerId; } 1328 Void setScalingListRefLayerId( UInt b ) { m_scalingListRefLayerId = b; } 1329 1330 TComVPS* getVPS() { return m_pVPS; } 1331 Void setVPS( TComVPS* vps ) { m_pVPS = vps; } 1332 static TComSPS* getSPS(UInt layerId) { return m_pcSPS[layerId]; } 1333 static Void setSPS(UInt layerId, TComSPS* sps) { m_pcSPS[layerId] = sps; } 1334 #endif 1335 1429 #if SCALINGLIST_INFERRING 1430 Void setScalingList( TComScalingList *scalingList ) { m_scalingList = scalingList; } 1431 #else 1336 1432 Void setScalingList ( TComScalingList *scalingList); 1433 #endif 1337 1434 TComScalingList* getScalingList () { return m_scalingList; } //!< get ScalingList class pointer in SPS 1338 1435 … … 1380 1477 UInt getNumScaledRefLayerOffsets() { return m_numScaledRefLayerOffsets; } 1381 1478 Void setNumScaledRefLayerOffsets(Int x) { m_numScaledRefLayerOffsets = x; } 1479 #if O0098_SCALED_REF_LAYER_ID 1480 UInt getScaledRefLayerId(Int x) { return m_scaledRefLayerId[x]; } 1481 Void setScaledRefLayerId(Int x, UInt id) { m_scaledRefLayerId[x] = id; } 1482 Window& getScaledRefLayerWindowForLayer( Int layerId ); 1483 #endif 1382 1484 Window& getScaledRefLayerWindow( Int x ) { return m_scaledRefLayerWindow[x]; } 1383 1485 #if REPN_FORMAT_IN_VPS 1384 1486 Bool getUpdateRepFormatFlag() { return m_updateRepFormatFlag; } 1385 1487 Void setUpdateRepFormatFlag(Bool x) { m_updateRepFormatFlag = x; } 1488 #if O0096_REP_FORMAT_INDEX 1489 Int getUpdateRepFormatIndex() { return m_updateRepFormatIndex; } 1490 Void setUpdateRepFormatIndex(UInt index) { m_updateRepFormatIndex = index; } 1491 #endif 1492 #endif 1493 #if SCALINGLIST_INFERRING 1494 Bool getInferScalingListFlag() { return m_inferScalingListFlag; } 1495 UInt getScalingListRefLayerId() { return m_scalingListRefLayerId; } 1496 Void setInferScalingListFlag( Bool flag ) { m_inferScalingListFlag = flag; } 1497 Void setScalingListRefLayerId( UInt layerId ) { m_scalingListRefLayerId = layerId; } 1386 1498 #endif 1387 1499 #endif //SVC_EXTENSION … … 1468 1580 Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter 1469 1581 Bool m_scalingListPresentFlag; 1470 1471 #if SVC_EXTENSION1472 UInt m_layerId;1473 1474 #if IL_SL_SIGNALLING_N03711475 static TComPPS* m_pcPPS[MAX_LAYERS];1476 Bool m_predScalingListFlag;1477 UInt m_scalingListRefLayerId;1478 #endif1479 1480 #endif1481 1482 1582 TComScalingList* m_scalingList; //!< ScalingList class pointer 1483 1484 1583 Bool m_listsModificationPresentFlag; 1485 1584 UInt m_log2ParallelMergeLevelMinus2; 1486 1585 Int m_numExtraSliceHeaderBits; 1586 1587 #if SVC_EXTENSION 1588 #if SCALINGLIST_INFERRING 1589 UInt m_layerId; 1590 Bool m_inferScalingListFlag; 1591 UInt m_scalingListRefLayerId; 1592 #endif 1593 #endif 1487 1594 1488 1595 public: … … 1596 1703 Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } 1597 1704 1598 #if IL_SL_SIGNALLING_N0371 1599 Void setLayerId(UInt layerId) { m_layerId = layerId; } 1705 #if SCALINGLIST_INFERRING 1600 1706 UInt getLayerId() { return m_layerId; } 1601 1602 Bool get PredScalingListFlag() { return m_predScalingListFlag;}1603 Void setPredScalingListFlag( Bool b ) { m_predScalingListFlag = b;}1604 UInt getScalingListRefLayerId() { return m_scalingListRefLayerId; }1605 Void setScalingListRefLayerId( UInt b ) { m_scalingListRefLayerId = b;}1606 1607 static TComPPS* getPPS(UInt layerId) { return m_pcPPS[layerId]; } 1608 static Void setPPS(UInt layerId, TComPPS* pps) { m_pcPPS[layerId] = pps; } 1609 #endif 1610 1707 Void setLayerId( UInt layerId ) { m_layerId = layerId; } 1708 Bool getInferScalingListFlag() { return m_inferScalingListFlag; } 1709 UInt getScalingListRefLayerId() { return m_scalingListRefLayerId; } 1710 Void setInferScalingListFlag( Bool flag ) { m_inferScalingListFlag = flag; } 1711 Void setScalingListRefLayerId( UInt layerId ) { m_scalingListRefLayerId = layerId; } 1712 #endif 1713 1714 #if SCALINGLIST_INFERRING 1715 Void setScalingList( TComScalingList *scalingList ) { m_scalingList = scalingList; } 1716 #else 1611 1717 Void setScalingList ( TComScalingList *scalingList); 1718 #endif 1612 1719 TComScalingList* getScalingList () { return m_scalingList; } //!< get ScalingList class pointer in PPS 1613 1720 Bool getListsModificationPresentFlag () { return m_listsModificationPresentFlag; } … … 1705 1812 UInt m_maxNumMergeCand; 1706 1813 1707 #if SAO_CHROMA_LAMBDA 1708 Double m_dLambdaLuma; 1709 Double m_dLambdaChroma; 1710 #else 1711 Double m_dLambda; 1712 #endif 1814 Double m_lambdas[3]; 1713 1815 1714 1816 Bool m_abEqualRef [2][MAX_NUM_REF][MAX_NUM_REF]; … … 1780 1882 #endif 1781 1883 Bool m_bDiscardableFlag; 1884 #if O0149_CROSS_LAYER_BLA_FLAG 1885 Bool m_bCrossLayerBLAFlag; 1886 #endif 1782 1887 #endif //SVC_EXTENSION 1783 1888 … … 1819 1924 Int getRPSidx () { return m_iBDidx; } 1820 1925 Int getPrevTid0POC () { return m_prevTid0POC; } 1926 #if PREVTID0_POC_RESET 1927 Void adjustPrevTid0POC (Int adj) { m_prevTid0POC=m_prevTid0POC-adj; } 1928 #endif 1821 1929 TComRefPicListModification* getRefPicListModification() { return &m_RefPicListModification; } 1822 1930 Void setLastIDR(Int iIDRPOC) { m_iLastIDR = iIDRPOC; } … … 1866 1974 Bool isIRAP () const { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); } 1867 1975 Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic); 1976 #if NO_CLRAS_OUTPUT_FLAG 1977 Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag); 1978 #else 1868 1979 Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic); 1980 #endif 1869 1981 Void setSliceType ( SliceType e ) { m_eSliceType = e; } 1870 1982 Void setSliceQp ( Int i ) { m_iSliceQp = i; } … … 1886 1998 Void setDepth ( Int iDepth ) { m_iDepth = iDepth; } 1887 1999 1888 #if FIX10711889 2000 #if SVC_EXTENSION 1890 2001 Void setRefPicList ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false, TComPic** ilpPic = NULL ); 1891 2002 #else 1892 2003 Void setRefPicList ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false ); 1893 #endif1894 #else1895 Void setRefPicList ( TComList<TComPic*>& rcListPic );1896 2004 #endif 1897 2005 Void setRefPOCList (); … … 1905 2013 Bool isInterP () { return m_eSliceType == P_SLICE; } 1906 2014 1907 #if SAO_CHROMA_LAMBDA 1908 Void setLambda( Double d, Double e ) { m_dLambdaLuma = d; m_dLambdaChroma = e;} 1909 Double getLambdaLuma() { return m_dLambdaLuma; } 1910 Double getLambdaChroma() { return m_dLambdaChroma; } 1911 #else 1912 Void setLambda( Double d ) { m_dLambda = d; } 1913 Double getLambda() { return m_dLambda; } 1914 #endif 2015 Void setLambdas ( const Double lambdas[3] ) { for (Int component = 0; component < 3; component++) m_lambdas[component] = lambdas[component]; } 2016 const Double* getLambdas() const { return m_lambdas; } 1915 2017 1916 2018 Void initEqualRef(); … … 1939 2041 Bool isStepwiseTemporalLayerSwitchingPointCandidate( TComList<TComPic*>& rcListPic ); 1940 2042 Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0); 1941 #if FIX10711942 2043 Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP); 1943 #else1944 Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet);1945 #endif1946 2044 1947 2045 Void setMaxNumMergeCand (UInt val ) { m_maxNumMergeCand = val; } … … 2001 2099 Void setScalingList ( TComScalingList* scalingList ) { m_scalingList = scalingList; } 2002 2100 TComScalingList* getScalingList () { return m_scalingList; } 2003 2004 #if IL_SL_SIGNALLING_N03712005 Void setDefaultScalingList ( UInt m_layerId );2006 #else2007 2101 Void setDefaultScalingList (); 2008 #endif2009 2010 2102 Bool checkDefaultScalingList (); 2011 2103 Void setCabacInitFlag ( Bool val ) { m_cabacInitFlag = val; } //!< set CABAC initial flag … … 2022 2114 2023 2115 #if SVC_EXTENSION 2024 VoidsetBaseColPic ( TComList<TComPic*>& rcListPic , UInt refLayerIdc );2116 Bool setBaseColPic ( TComList<TComPic*>& rcListPic , UInt refLayerIdc ); 2025 2117 Void setBaseColPic (UInt refLayerIdc, TComPic* p) { m_pcBaseColPic[refLayerIdc] = p; } 2026 2118 TComPic* getBaseColPic (UInt refLayerIdc) { return m_pcBaseColPic[refLayerIdc]; } … … 2099 2191 Bool getDiscardableFlag () { return m_bDiscardableFlag; } 2100 2192 Void setDiscardableFlag (Bool b) { m_bDiscardableFlag = b; } 2193 #if O0149_CROSS_LAYER_BLA_FLAG 2194 Bool getCrossLayerBLAFlag () { return m_bCrossLayerBLAFlag; } 2195 Void setCrossLayerBLAFlag (Bool b) { m_bCrossLayerBLAFlag = b; } 2196 #endif 2101 2197 2102 2198 #if RPL_INIT_N0316_N0082 -
trunk/source/Lib/TLibCommon/TComTrQuant.cpp
r442 r540 54 54 { 55 55 iNNZbeforePos0 = 0; 56 d64CodedLevelandDist = 0;57 d64UncodedDist = 0;58 d64SigCost = 0;59 d64SigCost_0 = 0;56 d64CodedLevelandDist = 0; 57 d64UncodedDist = 0; 58 d64SigCost = 0; 59 d64SigCost_0 = 0; 60 60 } 61 61 #endif … … 1944 1944 Int64 costUp = rdFactor * ( - deltaU[uiBlkPos] ) + rateIncUp[uiBlkPos] ; 1945 1945 Int64 costDown = rdFactor * ( deltaU[uiBlkPos] ) + rateIncDown[uiBlkPos] 1946 - ( abs(piDstCoeff[uiBlkPos])==1?((1<<15)+sigRateDelta[uiBlkPos]):0);1946 - ((abs(piDstCoeff[uiBlkPos]) == 1) ? sigRateDelta[uiBlkPos] : 0); 1947 1947 1948 1948 if(lastCG==1 && lastNZPosInCG==n && abs(piDstCoeff[uiBlkPos])==1) … … 2163 2163 { 2164 2164 Double dErr = Double( lLevelDouble - ( uiAbsLevel << iQBits ) ); 2165 Double dCurrCost = dErr * dErr * dTemp + xGetIC RateCost( uiAbsLevel, ui16CtxNumOne, ui16CtxNumAbs, ui16AbsGoRice, c1Idx, c2Idx);2165 Double dCurrCost = dErr * dErr * dTemp + xGetICost(xGetICRate( uiAbsLevel, ui16CtxNumOne, ui16CtxNumAbs, ui16AbsGoRice, c1Idx, c2Idx )); 2166 2166 dCurrCost += dCurrCostSig; 2167 2167 … … 2184 2184 * \returns cost of given absolute transform level 2185 2185 */ 2186 __inline Double TComTrQuant::xGetICRateCost( UInt uiAbsLevel,2186 __inline Int TComTrQuant::xGetICRate ( UInt uiAbsLevel, 2187 2187 UShort ui16CtxNumOne, 2188 2188 UShort ui16CtxNumAbs, … … 2192 2192 ) const 2193 2193 { 2194 Double iRate = xGetIEPRate();2194 Int iRate = Int(xGetIEPRate()); 2195 2195 UInt baseLevel = (c1Idx < C1FLAG_NUMBER)? (2 + (c2Idx < C2FLAG_NUMBER)) : 1; 2196 2196 … … 2236 2236 else 2237 2237 { 2238 assert (0); 2239 } 2240 return xGetICost( iRate ); 2241 } 2242 2243 __inline Int TComTrQuant::xGetICRate ( UInt uiAbsLevel, 2244 UShort ui16CtxNumOne, 2245 UShort ui16CtxNumAbs, 2246 UShort ui16AbsGoRice 2247 , UInt c1Idx, 2248 UInt c2Idx 2249 ) const 2250 { 2251 Int iRate = 0; 2252 UInt baseLevel = (c1Idx < C1FLAG_NUMBER)? (2 + (c2Idx < C2FLAG_NUMBER)) : 1; 2253 2254 if ( uiAbsLevel >= baseLevel ) 2255 { 2256 UInt uiSymbol = uiAbsLevel - baseLevel; 2257 UInt uiMaxVlc = g_auiGoRiceRange[ ui16AbsGoRice ]; 2258 Bool bExpGolomb = ( uiSymbol > uiMaxVlc ); 2259 2260 if( bExpGolomb ) 2261 { 2262 uiAbsLevel = uiSymbol - uiMaxVlc; 2263 Int iEGS = 1; for( UInt uiMax = 2; uiAbsLevel >= uiMax; uiMax <<= 1, iEGS += 2 ); 2264 iRate += iEGS << 15; 2265 uiSymbol = min<UInt>( uiSymbol, ( uiMaxVlc + 1 ) ); 2266 } 2267 2268 UShort ui16PrefLen = UShort( uiSymbol >> ui16AbsGoRice ) + 1; 2269 UShort ui16NumBins = min<UInt>( ui16PrefLen, g_auiGoRicePrefixLen[ ui16AbsGoRice ] ) + ui16AbsGoRice; 2270 2271 iRate += ui16NumBins << 15; 2272 2273 if (c1Idx < C1FLAG_NUMBER) 2274 { 2275 iRate += m_pcEstBitsSbac->m_greaterOneBits[ ui16CtxNumOne ][ 1 ]; 2276 2277 if (c2Idx < C2FLAG_NUMBER) 2278 { 2279 iRate += m_pcEstBitsSbac->m_levelAbsBits[ ui16CtxNumAbs ][ 1 ]; 2280 } 2281 } 2282 } 2283 else 2284 if( uiAbsLevel == 0 ) 2285 { 2286 return 0; 2287 } 2288 else if( uiAbsLevel == 1 ) 2289 { 2290 iRate += m_pcEstBitsSbac->m_greaterOneBits[ ui16CtxNumOne ][ 0 ]; 2291 } 2292 else if( uiAbsLevel == 2 ) 2293 { 2294 iRate += m_pcEstBitsSbac->m_greaterOneBits[ ui16CtxNumOne ][ 1 ]; 2295 iRate += m_pcEstBitsSbac->m_levelAbsBits[ ui16CtxNumAbs ][ 0 ]; 2296 } 2297 else 2298 { 2299 assert(0); 2238 iRate = 0; 2300 2239 } 2301 2240 return iRate; … … 2494 2433 /** set flat matrix value to quantized coefficient 2495 2434 */ 2496 #if IL_SL_SIGNALLING_N03712497 Void TComTrQuant::setFlatScalingList( UInt m_layerId )2498 #else2499 2435 Void TComTrQuant::setFlatScalingList() 2500 #endif2501 2436 { 2502 2437 UInt size,list; … … 2507 2442 for(list = 0; list < g_scalingListNum[size]; list++) 2508 2443 { 2509 #if IL_SL_SIGNALLING_N03712510 ref_scalingListDC[m_layerId][size][list] = SCALING_LIST_DC;2511 for(UInt i=0; i<MAX_MATRIX_COEF_NUM; i++)2512 {2513 ref_scalingListCoef[m_layerId][size][list][i] = SCALING_LIST_DC;2514 }2515 #endif2516 2517 2444 for(qp=0;qp<SCALING_LIST_REM_NUM;qp++) 2518 2445 { -
trunk/source/Lib/TLibCommon/TComTrQuant.h
r442 r540 150 150 151 151 #if RDOQ_CHROMA_LAMBDA 152 Void setLambda (Double dLambdaLuma, Double dLambdaChroma) { m_dLambdaLuma = dLambdaLuma; m_dLambdaChroma = dLambdaChroma; }153 Void selectLambda(TextType eTType) { m_dLambda = (eTType == TEXT_LUMA) ? m_ dLambdaLuma : m_dLambdaChroma; }152 Void setLambdas ( const Double lambdas[3] ) { for (Int component = 0; component < 3; component++) m_lambdas[component] = lambdas[component]; } 153 Void selectLambda(TextType eTType) { m_dLambda = (eTType == TEXT_LUMA) ? m_lambdas[0] : ((eTType == TEXT_CHROMA_U) ? m_lambdas[1] : m_lambdas[2]); } 154 154 #else 155 155 Void setLambda(Double dLambda) { m_dLambda = dLambda;} … … 181 181 Void setUseScalingList ( Bool bUseScalingList){ m_scalingListEnabledFlag = bUseScalingList; }; 182 182 Bool getUseScalingList (){ return m_scalingListEnabledFlag; }; 183 184 #if IL_SL_SIGNALLING_N0371185 Void setFlatScalingList ( UInt m_layerId );186 #else187 183 Void setFlatScalingList (); 188 #endif189 190 184 Void xsetFlatScalingList ( UInt list, UInt size, UInt qp); 191 185 Void xSetScalingListEnc ( TComScalingList *scalingList, UInt list, UInt size, UInt qp); … … 213 207 QpParam m_cQP; 214 208 #if RDOQ_CHROMA_LAMBDA 215 Double m_dLambdaLuma; 216 Double m_dLambdaChroma; 209 Double m_lambdas[3]; 217 210 #endif 218 211 Double m_dLambda; … … 279 272 Double dTemp, 280 273 Bool bLast ) const; 281 __inline Double xGetICRateCost ( UInt uiAbsLevel,282 UShort ui16CtxNumOne,283 UShort ui16CtxNumAbs,284 UShort ui16AbsGoRice285 , UInt c1Idx,286 UInt c2Idx287 ) const;288 274 __inline Int xGetICRate ( UInt uiAbsLevel, 289 275 UShort ui16CtxNumOne, -
trunk/source/Lib/TLibCommon/TypeDef.h
r494 r540 51 51 #define O0194_JOINT_US_BITSHIFT 1 ///< JCTVC-O0194: Joint Upsampling and bit-shift 52 52 #endif 53 #define O0194_WEIGHTED_PREDICTION_CGS 1///< JCTVC-O0194: Weighted prediciton for color gamut scalability53 #define O0194_WEIGHTED_PREDICTION_CGS 0 ///< JCTVC-O0194: Weighted prediciton for color gamut scalability 54 54 #define MFM_ENCCONSTRAINT 1 ///< JCTVC-O0216: Encoder constraint for motion field mapping 55 55 #define VPS_NUH_LAYER_ID 1 ///< JCTVC-N0085: Assert that the nuh_layer_id of VPS NAL unit should be 0 … … 57 57 #define ALIGN_TSA_STSA_PICS 1 ///< JCTVC-N0084: Alignment of TSA and STSA pictures across AU. 58 58 #define REPN_FORMAT_IN_VPS 1 ///< JCTVC-N0092: Signal represenation format (spatial resolution, bit depth, colour format) in the VPS 59 #if REPN_FORMAT_IN_VPS 60 #define REPN_FORMAT_CONTROL_FLAG 1 ///< JCTVC-O0179: Add control flag in representation format to control sending of chroma and bitdepth parameters 61 #endif 59 62 #define TIMING_INFO_NONZERO_LAYERID_SPS 1 ///< JCTVC-N0085: Semantics of vui_timing_info_present_flag to always set that flag to zero for non-zero layer ID SPS 60 63 #define RPL_INIT_N0316_N0082 1 ///< JCTVC-N0316, JCTVC-N0082: initial reference picture list construction 61 64 62 #define IL_SL_SIGNALLING_N0371 0///< JCTVC-N0371: inter-layer scaling list65 #define SCALINGLIST_INFERRING 1 ///< JCTVC-N0371: inter-layer scaling list 63 66 #define M0463_VUI_EXT_ILP_REF 0 ///< JCTVC-M0463: VUI extension inter-layer dependency offset signalling 64 67 #define SPS_EXTENSION 1 ///< Define sps_extension() syntax structure 68 #if SPS_EXTENSION 69 #define O0142_CONDITIONAL_SPS_EXTENSION 1 ///< JCTVC-O0142: Conditional SPS extension 70 #endif 65 71 #define VERT_MV_CONSTRAINT 1 ///< Vertical MV component constraint flag 66 72 #define SCALABILITY_MASK_E0104 1 ///< JCT3V-E0104: scalability mask for depth 67 73 #define LAYER_CTB 0 ///< enable layer-specific CTB structure 74 #if POC_RESET_FLAG 75 #define PREVTID0_POC_RESET 1 ///< JCTVC-O0117 Modification of the PicOrderCntVal of prevTid0Pic 76 #define POC_RESET_RPS 1 ///< JCTVC-O0117 Modification to the decoding process for rps 77 #endif 68 78 69 79 #define ILP_SSH_SIG 1 ///< JCTVC-N0195 proposal 2, JCTVC-N0118: add presence flag in VPS ext to condition inter-layer prediction signaling in slice segment header … … 86 96 87 97 #if VPS_VUI 98 #define VPS_VUI_TILES_NOT_IN_USE__FLAG 1 ///< JCTVC-O0226: VPS VUI flag to indicate tile not in use 99 #define VPS_VUI_WPP_NOT_IN_USE__FLAG 1 ///< JCTVC-O0226: VPS VUI flag to indicate tile not in use 88 100 #define TILE_BOUNDARY_ALIGNED_FLAG 1 ///< JCTVC-N0160/JCTVC-N0199 proposal 2 variant 2: VPS VUI flag to indicate tile boundary alignment 89 101 #define N0160_VUI_EXT_ILP_REF 1 ///< VUI extension inter-layer dependency offset signalling 90 102 #define VPS_VUI_BITRATE_PICRATE 1 ///< JCTVC-N0085: Signal bit rate and picture in VPS VUI 103 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 104 #define HIGHER_LAYER_IRAP_SKIP_FLAG 1 ///< JCTVC-O0199: Indication that higher layer IRAP picture uses skip blocks only 105 #endif 106 #define VPS_VUI_VIDEO_SIGNAL 1 ///< JCTVC-O0118 video signal information 91 107 #endif //VPS_VUI 92 108 … … 127 143 #define N0120_MAX_TID_REF_CFG 1 ///< set max_tid_il_ref_pics_plus1 and max_tid_ref_present_flag in the config. file (configuration setting) 128 144 #define O0225_MAX_TID_FOR_REF_LAYERS 1 145 #define O0225_TID_BASED_IL_RPS_DERIV 1 146 147 #define VPS_TSLAYERS 1 ///< JCTVC-O0120 signal max temporal sub-layers for each layer 148 #define TSLAYERS_IL_RPS 1 ///< JCTVC-O0120 IL RPS based on max temporal sub-layers 129 149 #endif 130 150 #if REF_IDX_MFM … … 139 159 #define M0457_IL_SAMPLE_PRED_ONLY_FLAG 0 ///< shall be 0, JCTVC-N0107 140 160 #endif 161 162 #define O0223_PICTURE_TYPES_ALIGN_FLAG 1 ///< a flag to indicatate whether picture types are aligned across layers. 141 163 142 164 #define N0147_IRAP_ALIGN_FLAG 1 ///< a flag to indicatate whether IRAPs are aligned across layers … … 166 188 #define SHM_FIX7 1 ///< fix for SHVC WD ticket #7 167 189 190 #define O0092_0094_DEPENDENCY_CONSTRAINT 1 ///< JCTVC-O0092: constraint on the layer_id of SPS/PPS 191 #if O0092_0094_DEPENDENCY_CONSTRAINT 192 #define MAX_REF_LAYERS 7 193 #endif 194 #define O0096_REP_FORMAT_INDEX 1 ///< JCTVC-O0096: identify SPS rep_format() with an index into the lists of formats in VPS extension. 195 #define O0096_DEFAULT_DEPENDENCY_TYPE 1 ///< JCTVC-O0096: specify default dependency type for all direct reference layers 196 197 #define RESAMPLING_CONSTRAINT_BUG_FIX 1 198 #define O0098_SCALED_REF_LAYER_ID 1 ///< JCTVC-O0098: signal scaled reference id 199 200 #define O0153_ALT_OUTPUT_LAYER_FLAG 1 ///< JCTVC-O0153: alt output layer flag 201 202 #define VPS_DPB_SIZE_TABLE 1 ///< JCTVC-O0217: DPB operations: signaling DPB-related parameters 203 #if VPS_DPB_SIZE_TABLE 204 #define OUTPUT_LAYER_SET_INDEX 1 ///< JCTVC-O0217: DPB operations: Inference/input of output layer set index 205 #if OUTPUT_LAYER_SET_INDEX 206 #define USE_DPB_SIZE_TABLE 1 ///< JCTVC-O0217: DPB operations: Use signaled DPB-size table parameters in the decoder 207 #endif 208 #endif 209 210 #define NO_CLRAS_OUTPUT_FLAG 1 211 #define O0149_CROSS_LAYER_BLA_FLAG 1 ///< JCTVC-O0149: signal cross_layer_bla_flag in slice header 212 168 213 #else 169 214 #define SYNTAX_OUTPUT 0 … … 174 219 //! \{ 175 220 176 #define FIX1071 1 ///< fix for issue #1071 221 #define HM_CLEANUP_SAO 1 ///< JCTVC-N0230, 1) three SAO encoder-only software bugfixes. 2) new SAO implementation without picture quadtree, fine-grained slice legacies, and other redundancies. 222 #if HM_CLEANUP_SAO 223 #define SAO_ENCODE_ALLOW_USE_PREDEBLOCK 1 224 #endif 177 225 178 226 #define MAX_NUM_PICS_IN_SOP 1024 … … 184 232 #define MAX_VPS_NUM_SCALABILITY_TYPES 16 185 233 #endif 234 #define MAX_VPS_OP_LAYER_SETS_PLUS1 3 186 235 #if VPS_RENAME 187 236 #define MAX_VPS_LAYER_SETS_PLUS1 1024 … … 192 241 #define MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1 1 193 242 #endif 194 #define RATE_CONTROL_LAMBDA_DOMAIN 1 ///< JCTVC-K0103, rate control by R-lambda model195 #define M0036_RC_IMPROVEMENT 1 ///< JCTVC-M0036, improvement for R-lambda model based rate control196 #define TICKET_1090_FIX 1197 198 #define RC_FIX 1 /// suggested fix for M0036199 #define RATE_CONTROL_INTRA 1 ///< JCTVC-M0257, rate control for intra200 243 201 244 #define MAX_CPB_CNT 32 ///< Upper bound of (cpb_cnt_minus1 + 1) … … 216 259 #define C1FLAG_NUMBER 8 // maximum number of largerThan1 flag coded in one chunk : 16 in HM5 217 260 #define C2FLAG_NUMBER 1 // maximum number of largerThan2 flag coded in one chunk: 16 in HM5 218 261 #if !HM_CLEANUP_SAO 219 262 #define REMOVE_SAO_LCU_ENC_CONSTRAINTS_3 1 ///< disable the encoder constraint that conditionally disable SAO for chroma for entire slice in interleaved mode 220 263 #endif 221 264 #define SAO_ENCODING_CHOICE 1 ///< I0184: picture early termination 222 265 #if SAO_ENCODING_CHOICE … … 232 275 #define MAX_NUM_PPS 64 233 276 234 #define WEIGHTED_CHROMA_DISTORTION 1 ///< F386: weighting of chroma for RDO235 277 #define RDOQ_CHROMA_LAMBDA 1 ///< F386: weighting of chroma for RDOQ 236 #define SAO_CHROMA_LAMBDA 1 ///< F386: weighting of chroma for SAO237 278 238 279 #define MIN_SCAN_POS_CROSS 4 … … 248 289 #define LEVEL_RANGE 30 ///< G382: max coefficient level in statistics collection 249 290 #endif 250 251 #define NS_HAD 0252 291 253 292 #define HHI_RQT_INTRA_SPEEDUP 1 ///< tests one best mode with full rqt … … 316 355 #define AMP_MRG 1 ///< encoder only force merge for AMP partition (no motion search for AMP) 317 356 #endif 318 319 #define SCALING_LIST_OUTPUT_RESULT 0 //JCTVC-G880/JCTVC-G1016 quantization matrices320 357 321 358 #define CABAC_INIT_PRESENT_FLAG 1 … … 377 414 }; 378 415 416 #if HM_CLEANUP_SAO 417 enum SAOComponentIdx 418 { 419 SAO_Y =0, 420 SAO_Cb, 421 SAO_Cr, 422 NUM_SAO_COMPONENTS 423 }; 424 425 enum SAOMode //mode 426 { 427 SAO_MODE_OFF = 0, 428 SAO_MODE_NEW, 429 SAO_MODE_MERGE, 430 NUM_SAO_MODES 431 }; 432 433 enum SAOModeMergeTypes 434 { 435 SAO_MERGE_LEFT =0, 436 SAO_MERGE_ABOVE, 437 NUM_SAO_MERGE_TYPES 438 }; 439 440 441 enum SAOModeNewTypes 442 { 443 SAO_TYPE_START_EO =0, 444 SAO_TYPE_EO_0 = SAO_TYPE_START_EO, 445 SAO_TYPE_EO_90, 446 SAO_TYPE_EO_135, 447 SAO_TYPE_EO_45, 448 449 SAO_TYPE_START_BO, 450 SAO_TYPE_BO = SAO_TYPE_START_BO, 451 452 NUM_SAO_NEW_TYPES 453 }; 454 #define NUM_SAO_EO_TYPES_LOG2 2 455 456 enum SAOEOClasses 457 { 458 SAO_CLASS_EO_FULL_VALLEY = 0, 459 SAO_CLASS_EO_HALF_VALLEY = 1, 460 SAO_CLASS_EO_PLAIN = 2, 461 SAO_CLASS_EO_HALF_PEAK = 3, 462 SAO_CLASS_EO_FULL_PEAK = 4, 463 NUM_SAO_EO_CLASSES, 464 }; 465 466 467 #define NUM_SAO_BO_CLASSES_LOG2 5 468 enum SAOBOClasses 469 { 470 //SAO_CLASS_BO_BAND0 = 0, 471 //SAO_CLASS_BO_BAND1, 472 //SAO_CLASS_BO_BAND2, 473 //... 474 //SAO_CLASS_BO_BAND31, 475 476 NUM_SAO_BO_CLASSES = (1<<NUM_SAO_BO_CLASSES_LOG2), 477 }; 478 #define MAX_NUM_SAO_CLASSES 32 //(NUM_SAO_EO_GROUPS > NUM_SAO_BO_GROUPS)?NUM_SAO_EO_GROUPS:NUM_SAO_BO_GROUPS 479 480 struct SAOOffset 481 { 482 Int modeIdc; //NEW, MERGE, OFF 483 Int typeIdc; //NEW: EO_0, EO_90, EO_135, EO_45, BO. MERGE: left, above 484 Int typeAuxInfo; //BO: starting band index 485 Int offset[MAX_NUM_SAO_CLASSES]; 486 487 SAOOffset(); 488 ~SAOOffset(); 489 Void reset(); 490 491 const SAOOffset& operator= (const SAOOffset& src); 492 }; 493 494 struct SAOBlkParam 495 { 496 497 SAOBlkParam(); 498 ~SAOBlkParam(); 499 Void reset(); 500 const SAOBlkParam& operator= (const SAOBlkParam& src); 501 SAOOffset& operator[](Int compIdx){ return offsetParam[compIdx];} 502 private: 503 SAOOffset offsetParam[NUM_SAO_COMPONENTS]; 504 505 }; 506 507 508 #else 379 509 #define NUM_DOWN_PART 4 380 510 … … 448 578 ~SAOParam(); 449 579 }; 450 580 #endif 451 581 /// parameters for deblocking filter 452 582 typedef struct _LFCUParam
Note: See TracChangeset for help on using the changeset viewer.