Changeset 389 in SHVCSoftware for branches/SHM-3.1-dev/source/Lib/TLibCommon
- Timestamp:
- 10 Sep 2013, 17:27:55 (11 years ago)
- Location:
- branches/SHM-3.1-dev/source/Lib/TLibCommon
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-3.1-dev/source/Lib/TLibCommon/TComDataCU.cpp
r378 r389 1273 1273 UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth(); 1274 1274 1275 #if REPN_FORMAT_IN_VPS 1276 if( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxRT] + m_pcPic->getMinCUWidth() ) >= m_pcSlice->getPicWidthInLumaSamples() ) 1277 #else 1275 1278 if( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxRT] + m_pcPic->getMinCUWidth() ) >= m_pcSlice->getSPS()->getPicWidthInLumaSamples() ) 1279 #endif 1276 1280 { 1277 1281 uiARPartUnitIdx = MAX_UINT; … … 1335 1339 UInt uiAbsZorderCUIdxLB = g_auiZscanToRaster[ m_uiAbsIdxInLCU ] + (m_puhHeight[0] / m_pcPic->getMinCUHeight() - 1)*m_pcPic->getNumPartInWidth(); 1336 1340 UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth(); 1337 1341 1342 #if REPN_FORMAT_IN_VPS 1343 if( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxLB] + m_pcPic->getMinCUHeight() ) >= m_pcSlice->getPicHeightInLumaSamples() ) 1344 #else 1338 1345 if( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxLB] + m_pcPic->getMinCUHeight() ) >= m_pcSlice->getSPS()->getPicHeightInLumaSamples() ) 1346 #endif 1339 1347 { 1340 1348 uiBLPartUnitIdx = MAX_UINT; … … 1384 1392 UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth(); 1385 1393 1394 #if REPN_FORMAT_IN_VPS 1395 if( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxLB] + (m_pcPic->getPicSym()->getMinCUHeight() * uiPartUnitOffset)) >= m_pcSlice->getPicHeightInLumaSamples()) 1396 #else 1386 1397 if( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxLB] + (m_pcPic->getPicSym()->getMinCUHeight() * uiPartUnitOffset)) >= m_pcSlice->getSPS()->getPicHeightInLumaSamples()) 1398 #endif 1387 1399 { 1388 1400 uiBLPartUnitIdx = MAX_UINT; … … 1432 1444 UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth(); 1433 1445 1446 #if REPN_FORMAT_IN_VPS 1447 if( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxRT] + (m_pcPic->getPicSym()->getMinCUHeight() * uiPartUnitOffset)) >= m_pcSlice->getPicWidthInLumaSamples() ) 1448 #else 1434 1449 if( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxRT] + (m_pcPic->getPicSym()->getMinCUHeight() * uiPartUnitOffset)) >= m_pcSlice->getSPS()->getPicWidthInLumaSamples() ) 1450 #endif 1435 1451 { 1436 1452 uiARPartUnitIdx = MAX_UINT; … … 2684 2700 Int uiLCUIdx = -1; 2685 2701 2702 #if REPN_FORMAT_IN_VPS 2703 if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() ) >= m_pcSlice->getPicWidthInLumaSamples() ) // image boundary check 2704 { 2705 } 2706 else if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() ) >= m_pcSlice->getPicHeightInLumaSamples() ) 2707 { 2708 } 2709 #else 2686 2710 if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() ) >= m_pcSlice->getSPS()->getPicWidthInLumaSamples() ) // image boundary check 2687 2711 { … … 2690 2714 { 2691 2715 } 2716 #endif 2692 2717 else 2693 2718 { … … 3020 3045 uiAbsPartIdx = g_auiZscanToRaster[uiPartIdxRB]; 3021 3046 Int uiLCUIdx = -1; 3047 #if REPN_FORMAT_IN_VPS 3048 if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdx] + m_pcPic->getMinCUWidth() ) >= m_pcSlice->getPicWidthInLumaSamples() ) // image boundary check 3049 { 3050 } 3051 else if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdx] + m_pcPic->getMinCUHeight() ) >= m_pcSlice->getPicHeightInLumaSamples() ) 3052 { 3053 } 3054 #else 3022 3055 if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdx] + m_pcPic->getMinCUWidth() ) >= m_pcSlice->getSPS()->getPicWidthInLumaSamples() ) // image boundary check 3023 3056 { … … 3026 3059 { 3027 3060 } 3061 #endif 3028 3062 else 3029 3063 { … … 3095 3129 Int iMvShift = 2; 3096 3130 Int iOffset = 8; 3131 #if REPN_FORMAT_IN_VPS 3132 Int iHorMax = ( m_pcSlice->getPicWidthInLumaSamples() + iOffset - m_uiCUPelX - 1 ) << iMvShift; 3133 #else 3097 3134 Int iHorMax = ( m_pcSlice->getSPS()->getPicWidthInLumaSamples() + iOffset - m_uiCUPelX - 1 ) << iMvShift; 3135 #endif 3098 3136 Int iHorMin = ( -(Int)g_uiMaxCUWidth - iOffset - (Int)m_uiCUPelX + 1 ) << iMvShift; 3099 3137 3138 #if REPN_FORMAT_IN_VPS 3139 Int iVerMax = ( m_pcSlice->getPicHeightInLumaSamples() + iOffset - m_uiCUPelY - 1 ) << iMvShift; 3140 #else 3100 3141 Int iVerMax = ( m_pcSlice->getSPS()->getPicHeightInLumaSamples() + iOffset - m_uiCUPelY - 1 ) << iMvShift; 3142 #endif 3101 3143 Int iVerMin = ( -(Int)g_uiMaxCUHeight - iOffset - (Int)m_uiCUPelY + 1 ) << iMvShift; 3102 3144 -
branches/SHM-3.1-dev/source/Lib/TLibCommon/TComLoopFilter.cpp
r313 r389 180 180 UInt uiLPelX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsZorderIdx] ]; 181 181 UInt uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsZorderIdx] ]; 182 #if REPN_FORMAT_IN_VPS 183 if( ( uiLPelX < pcCU->getSlice()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getPicHeightInLumaSamples() ) ) 184 #else 182 185 if( ( uiLPelX < pcCU->getSlice()->getSPS()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples() ) ) 186 #endif 183 187 { 184 188 xDeblockCU( pcCU, uiAbsZorderIdx, uiDepth+1, Edge ); -
branches/SHM-3.1-dev/source/Lib/TLibCommon/TComPic.cpp
r377 r389 213 213 UInt maxNumSUInLCU = getNumPartInCU(); 214 214 UInt numLCUInPic = getNumCUsInFrame(); 215 #if REPN_FORMAT_IN_VPS 216 UInt picWidth = getSlice(0)->getPicWidthInLumaSamples(); 217 UInt picHeight = getSlice(0)->getPicHeightInLumaSamples(); 218 #else 215 219 UInt picWidth = getSlice(0)->getSPS()->getPicWidthInLumaSamples(); 216 220 UInt picHeight = getSlice(0)->getSPS()->getPicHeightInLumaSamples(); 221 #endif 217 222 Int numLCUsInPicWidth = getFrameWidthInCU(); 218 223 Int numLCUsInPicHeight= getFrameHeightInCU(); -
branches/SHM-3.1-dev/source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp
r313 r389 1414 1414 UInt uiLPelX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsZorderIdx] ]; 1415 1415 UInt uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsZorderIdx] ]; 1416 #if REPN_FORMAT_IN_VPS 1417 if( ( uiLPelX < pcCU->getSlice()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getPicHeightInLumaSamples() ) ) 1418 #else 1416 1419 if( ( uiLPelX < pcCU->getSlice()->getSPS()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples() ) ) 1420 #endif 1417 1421 xPCMCURestoration( pcCU, uiAbsZorderIdx, uiDepth+1 ); 1418 1422 } -
branches/SHM-3.1-dev/source/Lib/TLibCommon/TComSlice.cpp
r387 r389 1587 1587 } 1588 1588 1589 #if REPN_FORMAT_IN_VPS 1590 UInt TComSlice::getPicWidthInLumaSamples() 1591 { 1592 TComSPS *sps = getSPS(); 1593 TComVPS *vps = getVPS(); 1594 UInt retVal, layerId = getLayerId(); 1595 if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() ) 1596 { 1597 retVal = sps->getPicWidthInLumaSamples(); 1598 } 1599 else 1600 { 1601 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getPicWidthVpsInLumaSamples(); 1602 } 1603 return retVal; 1604 } 1605 UInt TComSlice::getPicHeightInLumaSamples() 1606 { 1607 TComSPS *sps = getSPS(); 1608 TComVPS *vps = getVPS(); 1609 UInt retVal, layerId = getLayerId(); 1610 if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() ) 1611 { 1612 retVal = sps->getPicHeightInLumaSamples(); 1613 } 1614 else 1615 { 1616 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getPicHeightVpsInLumaSamples(); 1617 } 1618 return retVal; 1619 } 1620 UInt TComSlice::getChromaFormatIdc() 1621 { 1622 TComSPS *sps = getSPS(); 1623 TComVPS *vps = getVPS(); 1624 UInt retVal, layerId = getLayerId(); 1625 if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() ) 1626 { 1627 retVal = sps->getChromaFormatIdc(); 1628 } 1629 else 1630 { 1631 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getChromaFormatVpsIdc(); 1632 } 1633 return retVal; 1634 } 1635 UInt TComSlice::getBitDepthY() 1636 { 1637 TComSPS *sps = getSPS(); 1638 TComVPS *vps = getVPS(); 1639 UInt retVal, layerId = getLayerId(); 1640 if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() ) 1641 { 1642 retVal = sps->getBitDepthY(); 1643 } 1644 else 1645 { 1646 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getBitDepthVpsLuma(); 1647 } 1648 return retVal; 1649 } 1650 UInt TComSlice::getBitDepthC() 1651 { 1652 TComSPS *sps = getSPS(); 1653 TComVPS *vps = getVPS(); 1654 UInt retVal, layerId = getLayerId(); 1655 if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() ) 1656 { 1657 retVal = sps->getBitDepthC(); 1658 } 1659 else 1660 { 1661 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getBitDepthVpsChroma(); 1662 } 1663 return retVal; 1664 } 1665 Int TComSlice::getQpBDOffsetY() 1666 { 1667 return (getBitDepthY() - 8) * 6; 1668 } 1669 Int TComSlice::getQpBDOffsetC() 1670 { 1671 return (getBitDepthC() - 8) * 6; 1672 } 1673 1674 RepFormat::RepFormat() 1675 : m_chromaFormatVpsIdc (0) 1676 , m_separateColourPlaneVpsFlag (false) 1677 , m_picWidthVpsInLumaSamples (0) 1678 , m_picHeightVpsInLumaSamples (0) 1679 , m_bitDepthVpsLuma (0) 1680 , m_bitDepthVpsChroma (0) 1681 {} 1682 #endif 1683 1589 1684 // ------------------------------------------------------------------------------------------------ 1590 1685 // Video parameter set (VPS) … … 1619 1714 , m_picRatePresentVpsFlag (false) 1620 1715 #endif 1716 #if REPN_FORMAT_IN_VPS 1717 , m_repFormatIdxPresentFlag (true) 1718 , m_vpsNumRepFormats (1) 1719 #endif 1621 1720 { 1622 1721 for( Int i = 0; i < MAX_TLAYER; i++) … … 1692 1791 ::memset(m_constPicRateIdc , 0, sizeof(m_constPicRateIdc) ); 1693 1792 ::memset(m_avgPicRate , 0, sizeof(m_avgPicRate) ); 1793 #endif 1794 #if REPN_FORMAT_IN_VPS 1795 ::memset( m_vpsRepFormatIdx, 0, sizeof(m_vpsRepFormatIdx) ); 1694 1796 #endif 1695 1797 } … … 1778 1880 , m_numScaledRefLayerOffsets (0) 1779 1881 #endif 1882 #if REPN_FORMAT_IN_VPS 1883 , m_updateRepFormatFlag (false) 1884 #endif 1780 1885 { 1781 1886 for ( Int i = 0; i < MAX_TLAYER; i++ ) -
branches/SHM-3.1-dev/source/Lib/TLibCommon/TComSlice.h
r386 r389 406 406 }; 407 407 408 #if REPN_FORMAT_IN_VPS 409 class RepFormat 410 { 411 Int m_chromaFormatVpsIdc; 412 Bool m_separateColourPlaneVpsFlag; 413 Int m_picWidthVpsInLumaSamples; 414 Int m_picHeightVpsInLumaSamples; 415 Int m_bitDepthVpsLuma; // coded as minus8 416 Int m_bitDepthVpsChroma; // coded as minus8 417 418 public: 419 RepFormat(); 420 421 Int getChromaFormatVpsIdc() { return m_chromaFormatVpsIdc; } 422 Void setChromaFormatVpsIdc(Int x) { m_chromaFormatVpsIdc = x; } 423 424 Bool getSeparateColourPlaneVpsFlag() { return m_separateColourPlaneVpsFlag; } 425 Void setSeparateColourPlaneVpsFlag(Bool x) { m_separateColourPlaneVpsFlag = x; } 426 427 Int getPicWidthVpsInLumaSamples() { return m_picWidthVpsInLumaSamples; } 428 Void setPicWidthVpsInLumaSamples(Int x) { m_picWidthVpsInLumaSamples = x; } 429 430 Int getPicHeightVpsInLumaSamples() { return m_picHeightVpsInLumaSamples; } 431 Void setPicHeightVpsInLumaSamples(Int x) { m_picHeightVpsInLumaSamples = x; } 432 433 Int getBitDepthVpsLuma() { return m_bitDepthVpsLuma; } 434 Void setBitDepthVpsLuma(Int x) { m_bitDepthVpsLuma = x; } 435 436 Int getBitDepthVpsChroma() { return m_bitDepthVpsChroma; } 437 Void setBitDepthVpsChroma(Int x) { m_bitDepthVpsChroma = x; } 438 }; 439 #endif 408 440 class TComVPS 409 441 { … … 519 551 Int m_avgPicRate [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 520 552 #endif 553 #if REPN_FORMAT_IN_VPS 554 Bool m_repFormatIdxPresentFlag; 555 Int m_vpsNumRepFormats; // coded as minus1 556 RepFormat m_vpsRepFormat[16]; 557 Int m_vpsRepFormatIdx[16]; 558 #endif 521 559 public: 522 560 TComVPS(); … … 727 765 Int getAvgPicRate(Int i, Int j) { return m_avgPicRate[i][j]; } 728 766 Void setAvgPicRate(Int i, Int j, Int x) { m_avgPicRate[i][j] = x; } 767 #endif 768 769 #if REPN_FORMAT_IN_VPS 770 Bool getRepFormatIdxPresentFlag() { return m_repFormatIdxPresentFlag; } 771 Void setRepFormatIdxPresentFlag(Bool x) { m_repFormatIdxPresentFlag = x; } 772 773 Int getVpsNumRepFormats() { return m_vpsNumRepFormats; } 774 Void setVpsNumRepFormats(Int x) { m_vpsNumRepFormats = x; } 775 776 RepFormat* getVpsRepFormat(Int idx) { return &m_vpsRepFormat[idx]; } 777 778 Int getVpsRepFormatIdx(Int idx) { return m_vpsRepFormatIdx[idx]; } 779 Void setVpsRepFormatIdx(Int idx, Int x) { m_vpsRepFormatIdx[idx] = x; } 729 780 #endif 730 781 }; … … 1041 1092 UInt m_numScaledRefLayerOffsets; 1042 1093 Window m_scaledRefLayerWindow[MAX_LAYERS]; 1094 #endif 1095 #if REPN_FORMAT_IN_VPS 1096 Bool m_updateRepFormatFlag; 1043 1097 #endif 1044 1098 public: … … 1200 1254 Window& getScaledRefLayerWindow( Int x ) { return m_scaledRefLayerWindow[x]; } 1201 1255 #endif 1256 #if REPN_FORMAT_IN_VPS 1257 Bool getUpdateRepFormatFlag() { return m_updateRepFormatFlag; } 1258 Void setUpdateRepFormatFlag(Bool x) { m_updateRepFormatFlag = x; } 1259 #endif 1202 1260 }; 1203 1261 … … 1866 1924 #endif //SVC_EXTENSION 1867 1925 1926 #if REPN_FORMAT_IN_VPS 1927 UInt getPicWidthInLumaSamples(); 1928 UInt getPicHeightInLumaSamples(); 1929 UInt getChromaFormatIdc(); 1930 UInt getBitDepthY(); 1931 UInt getBitDepthC(); 1932 Int getQpBDOffsetY(); 1933 Int getQpBDOffsetC(); 1934 #endif 1868 1935 protected: 1869 1936 TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, -
branches/SHM-3.1-dev/source/Lib/TLibCommon/TComTrQuant.cpp
r345 r389 42 42 #include "TComPic.h" 43 43 #include "ContextTables.h" 44 44 #define MAYBE_BUGFIX 1 45 45 typedef struct 46 46 { … … 50 50 Double d64SigCost; 51 51 Double d64SigCost_0; 52 #if MAYBE_BUGFIX 53 Void init() 54 { 55 iNNZbeforePos0 = 0; 56 d64CodedLevelandDist = 0; 57 d64UncodedDist = 0; 58 d64SigCost = 0; 59 d64SigCost_0 = 0; 60 } 61 #endif 52 62 } coeffGroupRDStats; 53 63 … … 1033 1043 1034 1044 Int qpScaled; 1045 #if REPN_FORMAT_IN_VPS 1046 Int qpBDOffset = (eTType == TEXT_LUMA)? pcCU->getSlice()->getQpBDOffsetY() : pcCU->getSlice()->getQpBDOffsetC(); 1047 #else 1035 1048 Int qpBDOffset = (eTType == TEXT_LUMA)? pcCU->getSlice()->getSPS()->getQpBDOffsetY() : pcCU->getSlice()->getSPS()->getQpBDOffsetC(); 1049 #endif 1036 1050 1037 1051 if(eTType == TEXT_LUMA) … … 1581 1595 UInt uiCGPosY = uiCGBlkPos / uiNumBlkSide; 1582 1596 UInt uiCGPosX = uiCGBlkPos - (uiCGPosY * uiNumBlkSide); 1597 #if MAYBE_BUGFIX 1598 rdStats.init(); 1599 #else 1583 1600 ::memset( &rdStats, 0, sizeof (coeffGroupRDStats)); 1584 1601 #endif 1585 1602 const Int patternSigCtx = TComTrQuant::calcPatternSigCtx(uiSigCoeffGroupFlag, uiCGPosX, uiCGPosY, uiWidth, uiHeight); 1586 1603 for (Int iScanPosinCG = uiCGSize-1; iScanPosinCG >= 0; iScanPosinCG--) -
branches/SHM-3.1-dev/source/Lib/TLibCommon/TypeDef.h
r386 r389 48 48 #if SVC_EXTENSION 49 49 #define MAX_LAYERS 2 ///< max number of layers the codec is supposed to handle 50 #define REPN_FORMAT_IN_VPS 1 ///< N0092: Signal represenation format (spatial resolution, bit depth, colour format) in the VPS 50 51 #define TIMING_INFO_NONZERO_LAYERID_SPS 1 ///< N0085: Semantics of vui_timing_info_present_flag to always set that flag to zero for non-zero layer ID SPS 51 52 #define RPL_INIT_N0316_N0082 1 ///< N0316, N0082: initial reference picture list construction
Note: See TracChangeset for help on using the changeset viewer.