Changeset 838 in 3DVCSoftware
- Timestamp:
- 8 Feb 2014, 01:07:38 (11 years ago)
- Location:
- branches/HTM-10.0rc1-dev0/source
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-10.0rc1-dev0/source/App/TAppDecoder/TAppDecTop.cpp
r837 r838 279 279 bitstreamFile.seekg(location-streamoff(3)); 280 280 bytestream.reset(); 281 #if ENC_DEC_TRACE282 281 #if H_MV_ENC_DEC_TRAC 283 282 const Bool resetCounter = false; … … 290 289 g_disableHLSTrace = true; // Trancing of second parsing of SH is not carried out 291 290 } 292 #else293 g_nSymbolCounter = symCount;294 #endif295 291 #endif 296 292 } -
branches/HTM-10.0rc1-dev0/source/App/TAppEncoder/TAppEncCfg.cpp
r837 r838 444 444 ("QuadtreeTUMaxDepthIntra", m_uiQuadtreeTUMaxDepthIntra, 1u, "Depth of TU tree for intra CUs") 445 445 ("QuadtreeTUMaxDepthInter", m_uiQuadtreeTUMaxDepthInter, 2u, "Depth of TU tree for inter CUs") 446 #if H_MV 446 447 // Coding structure parameters 447 #if H_MV448 448 ("IntraPeriod,-ip", m_iIntraPeriod,std::vector<Int>(1,-1), "Intra period in frames, (-1: only first frame), per layer") 449 449 #else 450 // Coding structure paramters 450 451 ("IntraPeriod,-ip", m_iIntraPeriod, -1, "Intra period in frames, (-1: only first frame)") 451 452 #endif … … 629 630 630 631 ("TransquantBypassEnableFlag", m_TransquantBypassEnableFlag, false, "transquant_bypass_enable_flag indicator in PPS") 631 ("CUTransquantBypassFlag Value", m_CUTransquantBypassFlagValue, false, "Fixed cu_transquant_bypass_flag value, when transquant_bypass_enable_flag is enabled")632 ("CUTransquantBypassFlagForce", m_CUTransquantBypassFlagForce, false, "Force transquant bypass mode, when transquant_bypass_enable_flag is enabled") 632 633 ("RecalculateQPAccordingToLambda", m_recalculateQPAccordingToLambda, false, "Recalculate QP values according to lambda values. Do not suggest to be enabled in all intra case") 633 634 ("StrongIntraSmoothing,-sis", m_useStrongIntraSmoothing, true, "Enable strong intra smoothing for 32x32 blocks") … … 2361 2362 printf("IBD:%d ", g_bitDepthY > m_inputBitDepthY || g_bitDepthC > m_inputBitDepthC); 2362 2363 printf("HAD:%d ", m_bUseHADME ); 2363 printf("SRD:%d ", m_bUseSBACRD );2364 2364 printf("RDQ:%d ", m_useRDOQ ); 2365 2365 printf("RDQTS:%d ", m_useRDOQTS ); -
branches/HTM-10.0rc1-dev0/source/App/TAppEncoder/TAppEncCfg.h
r837 r838 286 286 287 287 // coding tools (encoder-only parameters) 288 Bool m_bUseSBACRD; ///< flag for using RD optimization based on SBAC289 288 Bool m_bUseASR; ///< flag for using adaptive motion search range 290 289 Bool m_bUseHADME; ///< flag for using HAD in sub-pel ME … … 385 384 UInt m_depthMADPred; 386 385 #endif 387 #else388 Bool m_enableRateCtrl; ///< Flag for using rate control algorithm389 Int m_targetBitrate; ///< target bitrate390 Int m_numLCUInUnit; ///< Total number of LCUs in a frame should be completely divided by the NumLCUInUnit391 392 #if KWU_RC_VIEWRC_E0227393 vector<Int> m_viewTargetBits;394 Bool m_viewWiseRateCtrl; ///< Flag for using view-wise rate control395 #endif396 #if KWU_RC_MADPRED_E0227397 UInt m_depthMADPred;398 #endif399 #endif400 386 Int m_useScalingListId; ///< using quantization matrix 401 387 Char* m_scalingListFile; ///< quantization matrix file name -
branches/HTM-10.0rc1-dev0/source/Lib/TLibCommon/TComPic.cpp
r837 r838 111 111 memcpy(m_numReorderPics, numReorderPics, MAX_TLAYER*sizeof(Int)); 112 112 113 /* initialize the texture to depth reference status */114 113 #if H_3D_FCO 114 /* initialize the texture to depth reference status */ 115 115 for (int j=0; j<2; j++) 116 116 { -
branches/HTM-10.0rc1-dev0/source/Lib/TLibCommon/TComPic.h
r837 r838 192 192 Window& getDefDisplayWindow() { return m_defaultDisplayWindow; } 193 193 194 Bool getSAOMergeAvailability(Int currAddr, Int mergeAddr); 194 195 195 196 /* field coding parameters*/ -
branches/HTM-10.0rc1-dev0/source/Lib/TLibCommon/TComPicSym.cpp
r837 r838 123 123 m_puiInverseCUOrderMap[i] = i; 124 124 } 125 126 m_saoBlkParams = new SAOBlkParam[m_uiNumCUsInFrame]; 125 127 } 126 128 -
branches/HTM-10.0rc1-dev0/source/Lib/TLibCommon/TComRom.cpp
r837 r838 327 327 UInt g_uiPCMBitDepthChroma = 8; // PCM bit-depth 328 328 329 #if H_3D_DIM_DMM 329 330 // ==================================================================================================================== 330 331 // Depth coding modes 331 332 // ==================================================================================================================== 332 #if H_3D_DIM_DMM333 333 const WedgeResolution g_dmmWedgeResolution[6] = 334 334 { -
branches/HTM-10.0rc1-dev0/source/Lib/TLibCommon/TComTrQuant.h
r837 r838 150 150 151 151 #if RDOQ_CHROMA_LAMBDA 152 Void setLambdas ( const Double lambdas[3] ) { for (Int component = 0; component < 3; component++) m_lambdas[component] = lambdas[component]; } 152 153 Void setLambda(Double dLambdaLuma, Double dLambdaChroma) { m_dLambdaLuma = dLambdaLuma; m_dLambdaChroma = dLambdaChroma; } 153 154 Void selectLambda(TextType eTType) { m_dLambda = (eTType == TEXT_LUMA) ? m_lambdas[0] : ((eTType == TEXT_CHROMA_U) ? m_lambdas[1] : m_lambdas[2]); } -
branches/HTM-10.0rc1-dev0/source/Lib/TLibCommon/TypeDef.h
r837 r838 551 551 }; 552 552 553 enum SAOComponentIdx 554 { 555 SAO_Y =0, 556 SAO_Cb, 557 SAO_Cr, 558 NUM_SAO_COMPONENTS 559 }; 553 560 554 561 enum SAOMode //mode -
branches/HTM-10.0rc1-dev0/source/Lib/TLibDecoder/TDecSbac.cpp
r837 r838 234 234 #endif 235 235 m_cCUPartSizeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_PART_SIZE ); 236 m_cCUAMPSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_CU_AMP_POS );237 236 m_cCUPredModeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_PRED_MODE ); 238 237 m_cCUIntraPredSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTRA_PRED_MODE ); … … 2016 2015 } 2017 2016 2017 Void TDecSbac::parseSaoSign(UInt& val) 2018 2018 { 2019 2019 m_pcTDecBinIf->decodeBinEP ( val ); -
branches/HTM-10.0rc1-dev0/source/Lib/TLibEncoder/TEncCavlc.h
r837 r838 120 120 121 121 Void codeMVPIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList ); 122 Void codeSAOBlkParam(SAOBlkParam& saoBlkParam, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail, Bool onlyEstMergeInfo = false){printf("only supported in CABAC"); assert(0); exit(-1);} 122 123 Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ); 123 124 Void codeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); -
branches/HTM-10.0rc1-dev0/source/Lib/TLibEncoder/TEncCu.cpp
r837 r838 423 423 m_ppcOrigYuv[uiDepth]->copyFromPicYuv( pcPic->getPicYuvOrg(), rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU() ); 424 424 425 // variables for fast encoder decision426 425 #if H_3D_QTLPC 427 426 Bool bTrySplit = true; … … 623 622 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N, bFMD ); rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );//by Competition for inter_2Nx2N 624 623 #else 625 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N, bIsLosslessMode ); rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );//by Competition for inter_2Nx2N 624 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N ); 625 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );//by Competition for inter_2Nx2N 626 626 #endif 627 627 #if H_3D_VSP … … 651 651 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N, bFMD ); rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 652 652 #else 653 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N ); rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 653 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N ); 654 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 654 655 #endif 655 656 #if H_3D_VSP … … 1876 1877 rpcTempCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeCand].m_acDvInfo, 0, 0, uhDepth ); 1877 1878 #endif 1878 1879 1879 #if MTK_DDD_G0063 1880 1880 if( rpcTempCU->getSlice()->getIsDepth() && rpcTempCU->getSlice()->getViewIndex() != 0 && iDDDCand == uiMergeCand ) … … 1888 1888 } 1889 1889 #endif 1890 1891 1890 #if H_3D_SPIVMP 1892 1891 rpcTempCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMergeCand], 0, 0, uhDepth); … … 1896 1895 Int iWidth = rpcTempCU->getWidth(0); 1897 1896 Int iHeight = rpcTempCU->getHeight(0); 1898 1899 1897 Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight; 1900 1901 1898 rpcTempCU->getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight); 1902 1903 1899 for (Int iPartitionIdx = 0; iPartitionIdx < iNumSP; iPartitionIdx++) 1904 1900 { … … 1918 1914 Int width, height; 1919 1915 rpcTempCU->getPartIndexAndSize( 0, partAddr, width, height ); 1920 1921 1916 if( uhInterDirNeighbours[ uiMergeCand ] & 0x01 ) 1922 1917 { … … 1937 1932 rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level 1938 1933 } 1939 1940 1934 rpcTempCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeCand], 0, 0, uhDepth ); // interprets depth relative to LCU level 1941 1935 } 1942 1936 else 1943 #endif1944 1937 { 1938 #endif 1945 1939 rpcTempCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeCand], 0, 0, uhDepth ); // interprets depth relative to LCU level 1946 1940 rpcTempCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level 1947 1941 rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level 1942 #if NTT_STORE_SPDV_VSP_G0148 1948 1943 } 1944 #endif 1949 1945 // do MC 1950 1946 m_pcPredSearch->motionCompensation ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] ); -
branches/HTM-10.0rc1-dev0/source/Lib/TLibEncoder/TEncEntropy.h
r837 r838 127 127 virtual Void codeCoeffNxN ( TComDataCU* pcCU, TCoeff* pcCoef, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt uiDepth, TextType eTType ) = 0; 128 128 virtual Void codeTransformSkipFlags ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt width, UInt height, TextType eTType ) = 0; 129 virtual Void codeSAOBlkParam(SAOBlkParam& saoBlkParam, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail, Bool onlyEstMergeInfo = false) =0; 129 130 virtual Void estBit (estBitsSbacStruct* pcEstBitsSbac, Int width, Int height, TextType eTType) = 0; 130 131 … … 227 228 228 229 Void estimateBit ( estBitsSbacStruct* pcEstBitsSbac, Int width, Int height, TextType eTType); 230 Void encodeSAOBlkParam(SAOBlkParam& saoBlkParam, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail){m_pcEntropyCoderIf->codeSAOBlkParam(saoBlkParam, sliceEnabled, leftMergeAvail, aboveMergeAvail, false);} 229 231 static Int countNonZeroCoeffs( TCoeff* pcCoef, UInt uiSize ); 230 232 -
branches/HTM-10.0rc1-dev0/source/Lib/TLibEncoder/TEncRateCtrl.cpp
r837 r838 1660 1660 } 1661 1661 1662 #else1663 1664 #define ADJUSTMENT_FACTOR 0.601665 #define HIGH_QSTEP_THRESHOLD 9.52381666 #define HIGH_QSTEP_ALPHA 4.93711667 #define HIGH_QSTEP_BETA 0.09221668 #define LOW_QSTEP_ALPHA 16.74291669 #define LOW_QSTEP_BETA -1.14941670 1671 #define MAD_PRED_Y1 1.01672 #define MAD_PRED_Y2 0.01673 1674 enum MAD_HISOTRY {1675 MAD_PPPrevious = 0,1676 MAD_PPrevious = 1,1677 MAD_Previous = 21678 };1679 1680 Void MADLinearModel::initMADLinearModel()1681 {1682 m_activeOn = false;1683 m_paramY1 = 1.0;1684 m_paramY2 = 0.0;1685 m_costMADs[0] = m_costMADs[1] = m_costMADs[2] = 0.0;1686 }1687 1688 Double MADLinearModel::getMAD()1689 {1690 Double costPredMAD = m_paramY1 * m_costMADs[MAD_Previous] + m_paramY2;1691 1692 if(costPredMAD < 0)1693 {1694 costPredMAD = m_costMADs[MAD_Previous];1695 m_paramY1 = MAD_PRED_Y1;1696 m_paramY2 = MAD_PRED_Y2;1697 }1698 return costPredMAD;1699 }1700 1701 Void MADLinearModel::updateMADLiearModel()1702 {1703 Double dNewY1 = ((m_costMADs[MAD_Previous] - m_costMADs[MAD_PPrevious]) / (m_costMADs[MAD_PPrevious] - m_costMADs[MAD_PPPrevious]));1704 Double dNewY2 = (m_costMADs[MAD_Previous] - (dNewY1*m_costMADs[MAD_PPrevious]));1705 1706 m_paramY1 = 0.70+0.20*m_paramY1+ 0.10*dNewY1;1707 m_paramY2 = 0.20*m_paramY2+ 0.10*dNewY2;1708 }1709 1710 Void MADLinearModel::updateMADHistory(Double dMAD)1711 {1712 m_costMADs[MAD_PPPrevious] = m_costMADs[MAD_PPrevious];1713 m_costMADs[MAD_PPrevious ] = m_costMADs[MAD_Previous ];1714 m_costMADs[MAD_Previous ] = dMAD;1715 m_activeOn = (m_costMADs[MAD_Previous ] && m_costMADs[MAD_PPrevious ] && m_costMADs[MAD_PPPrevious]);1716 }1717 1718 1719 Void PixelBaseURQQuadraticModel::initPixelBaseQuadraticModel()1720 {1721 m_paramHighX1 = HIGH_QSTEP_ALPHA;1722 m_paramHighX2 = HIGH_QSTEP_BETA;1723 m_paramLowX1 = LOW_QSTEP_ALPHA;1724 m_paramLowX2 = LOW_QSTEP_BETA;1725 }1726 1727 Int PixelBaseURQQuadraticModel::getQP(Int qp, Int targetBits, Int numberOfPixels, Double costPredMAD)1728 {1729 Double qStep;1730 Double bppPerMAD = (Double)(targetBits/(numberOfPixels*costPredMAD));1731 1732 if(xConvertQP2QStep(qp) >= HIGH_QSTEP_THRESHOLD)1733 {1734 qStep = 1/( sqrt((bppPerMAD/m_paramHighX1)+((m_paramHighX2*m_paramHighX2)/(4*m_paramHighX1*m_paramHighX1))) - (m_paramHighX2/(2*m_paramHighX1)));1735 }1736 else1737 {1738 qStep = 1/( sqrt((bppPerMAD/m_paramLowX1)+((m_paramLowX2*m_paramLowX2)/(4*m_paramLowX1*m_paramLowX1))) - (m_paramLowX2/(2*m_paramLowX1)));1739 }1740 1741 return xConvertQStep2QP(qStep);1742 }1743 1744 Void PixelBaseURQQuadraticModel::updatePixelBasedURQQuadraticModel (Int qp, Int bits, Int numberOfPixels, Double costMAD)1745 {1746 Double qStep = xConvertQP2QStep(qp);1747 Double invqStep = (1/qStep);1748 Double paramNewX1, paramNewX2;1749 1750 if(qStep >= HIGH_QSTEP_THRESHOLD)1751 {1752 paramNewX2 = (((bits/(numberOfPixels*costMAD))-(23.3772*invqStep*invqStep))/((1-200*invqStep)*invqStep));1753 paramNewX1 = (23.3772-200*paramNewX2);1754 m_paramHighX1 = 0.70*HIGH_QSTEP_ALPHA + 0.20 * m_paramHighX1 + 0.10 * paramNewX1;1755 m_paramHighX2 = 0.70*HIGH_QSTEP_BETA + 0.20 * m_paramHighX2 + 0.10 * paramNewX2;1756 }1757 else1758 {1759 paramNewX2 = (((bits/(numberOfPixels*costMAD))-(5.8091*invqStep*invqStep))/((1-9.5455*invqStep)*invqStep));1760 paramNewX1 = (5.8091-9.5455*paramNewX2);1761 m_paramLowX1 = 0.90*LOW_QSTEP_ALPHA + 0.09 * m_paramLowX1 + 0.01 * paramNewX1;1762 m_paramLowX2 = 0.90*LOW_QSTEP_BETA + 0.09 * m_paramLowX2 + 0.01 * paramNewX2;1763 }1764 }1765 1766 Bool PixelBaseURQQuadraticModel::checkUpdateAvailable(Int qpReference )1767 {1768 Double qStep = xConvertQP2QStep(qpReference);1769 1770 if (qStep > xConvertQP2QStep(MAX_QP)1771 ||qStep < xConvertQP2QStep(MIN_QP) )1772 {1773 return false;1774 }1775 1776 return true;1777 }1778 1779 Double PixelBaseURQQuadraticModel::xConvertQP2QStep(Int qp )1780 {1781 Int i;1782 Double qStep;1783 static const Double mapQP2QSTEP[6] = { 0.625, 0.703, 0.797, 0.891, 1.000, 1.125 };1784 1785 qStep = mapQP2QSTEP[qp % 6];1786 for( i=0; i<(qp/6); i++)1787 {1788 qStep *= 2;1789 }1790 1791 return qStep;1792 }1793 1794 Int PixelBaseURQQuadraticModel::xConvertQStep2QP(Double qStep )1795 {1796 Int per = 0, rem = 0;1797 1798 if( qStep < xConvertQP2QStep(MIN_QP))1799 {1800 return MIN_QP;1801 }1802 else if (qStep > xConvertQP2QStep(MAX_QP) )1803 {1804 return MAX_QP;1805 }1806 1807 while( qStep > xConvertQP2QStep(5) )1808 {1809 qStep /= 2.0;1810 per++;1811 }1812 1813 if (qStep <= 0.625)1814 {1815 rem = 0;1816 }1817 else if (qStep <= 0.703)1818 {1819 rem = 1;1820 }1821 else if (qStep <= 0.797)1822 {1823 rem = 2;1824 }1825 else if (qStep <= 0.891)1826 {1827 rem = 3;1828 }1829 else if (qStep <= 1.000)1830 {1831 rem = 4;1832 }1833 else1834 {1835 rem = 5;1836 }1837 return (per * 6 + rem);1838 }1839 1840 1841 Void TEncRateCtrl::create(Int sizeIntraPeriod, Int sizeGOP, Int frameRate, Int targetKbps, Int qp, Int numLCUInBasicUnit, Int sourceWidth, Int sourceHeight, Int maxCUWidth, Int maxCUHeight)1842 {1843 Int leftInHeight, leftInWidth;1844 1845 m_sourceWidthInLCU = (sourceWidth / maxCUWidth ) + (( sourceWidth % maxCUWidth ) ? 1 : 0);1846 m_sourceHeightInLCU = (sourceHeight / maxCUHeight) + (( sourceHeight % maxCUHeight) ? 1 : 0);1847 m_isLowdelay = (sizeIntraPeriod == -1) ? true : false;1848 1849 m_prevBitrate = ( targetKbps << 10 ); // in units of 1,024 bps1850 m_currBitrate = ( targetKbps << 10 );1851 1852 m_frameRate = frameRate;1853 m_refFrameNum = m_isLowdelay ? (sizeGOP) : (sizeGOP>>1);1854 m_nonRefFrameNum = sizeGOP-m_refFrameNum;1855 m_sizeGOP = sizeGOP;1856 m_numOfPixels = ((sourceWidth*sourceHeight*3)>>1);1857 m_indexGOP = 0;1858 m_indexFrame = 0;1859 m_indexLCU = 0;1860 m_indexUnit = 0;1861 m_indexRefFrame = 0;1862 m_indexNonRefFrame = 0;1863 m_occupancyVB = 0;1864 m_initialOVB = 0;1865 m_targetBufLevel = 0;1866 m_initialTBL = 0;1867 m_occupancyVBInFrame = 0;1868 m_remainingBitsInGOP = (m_currBitrate*sizeGOP/m_frameRate);1869 m_remainingBitsInFrame = 0;1870 m_numUnitInFrame = m_sourceWidthInLCU*m_sourceHeightInLCU;1871 m_cMADLinearModel. initMADLinearModel();1872 m_cPixelURQQuadraticModel.initPixelBaseQuadraticModel();1873 1874 m_costRefAvgWeighting = 0.0;1875 m_costNonRefAvgWeighting = 0.0;1876 m_costAvgbpp = 0.0;1877 m_activeUnitLevelOn = false;1878 1879 m_pcFrameData = new FrameData [sizeGOP+1]; initFrameData(qp);1880 m_pcLCUData = new LCUData [m_numUnitInFrame]; initUnitData (qp);1881 1882 for(Int i = 0, addressUnit = 0; i < m_sourceHeightInLCU*maxCUHeight; i += maxCUHeight)1883 {1884 leftInHeight = sourceHeight - i;1885 leftInHeight = min(leftInHeight, maxCUHeight);1886 for(Int j = 0; j < m_sourceWidthInLCU*maxCUWidth; j += maxCUWidth, addressUnit++)1887 {1888 leftInWidth = sourceWidth - j;1889 leftInWidth = min(leftInWidth, maxCUWidth);1890 m_pcLCUData[addressUnit].m_widthInPixel = leftInWidth;1891 m_pcLCUData[addressUnit].m_heightInPixel= leftInHeight;1892 m_pcLCUData[addressUnit].m_pixels = ((leftInHeight*leftInWidth*3)>>1);1893 }1894 }1895 }1896 1897 Void TEncRateCtrl::destroy()1898 {1899 if(m_pcFrameData)1900 {1901 delete [] m_pcFrameData;1902 m_pcFrameData = NULL;1903 }1904 if(m_pcLCUData)1905 {1906 delete [] m_pcLCUData;1907 m_pcLCUData = NULL;1908 }1909 }1910 1911 Void TEncRateCtrl::initFrameData (Int qp)1912 {1913 for(Int i = 0 ; i <= m_sizeGOP; i++)1914 {1915 m_pcFrameData[i].m_isReferenced = false;1916 m_pcFrameData[i].m_costMAD = 0.0;1917 m_pcFrameData[i].m_bits = 0;1918 m_pcFrameData[i].m_qp = qp;1919 }1920 }1921 1922 Void TEncRateCtrl::initUnitData (Int qp)1923 {1924 for(Int i = 1 ; i < m_numUnitInFrame; i++)1925 {1926 m_pcLCUData[i].m_qp = qp;1927 m_pcLCUData[i].m_bits = 0;1928 m_pcLCUData[i].m_pixels = 0;1929 m_pcLCUData[i].m_widthInPixel = 0;1930 m_pcLCUData[i].m_heightInPixel = 0;1931 m_pcLCUData[i].m_costMAD = 0.0;1932 }1933 }1934 1935 Int TEncRateCtrl::getFrameQP(Bool isReferenced, Int POC)1936 {1937 Int numofReferenced = 0;1938 Int finalQP = 0;1939 FrameData* pcFrameData;1940 1941 m_indexPOCInGOP = (POC%m_sizeGOP) == 0 ? m_sizeGOP : (POC%m_sizeGOP);1942 pcFrameData = &m_pcFrameData[m_indexPOCInGOP];1943 1944 if(m_indexFrame != 0)1945 {1946 if(isReferenced)1947 {1948 Double gamma = m_isLowdelay ? 0.5 : 0.25;1949 Double beta = m_isLowdelay ? 0.9 : 0.6;1950 Int numRemainingRefFrames = m_refFrameNum - m_indexRefFrame;1951 Int numRemainingNRefFrames = m_nonRefFrameNum - m_indexNonRefFrame;1952 1953 Double targetBitsOccupancy = (m_currBitrate/(Double)m_frameRate) + gamma*(m_targetBufLevel-m_occupancyVB - (m_initialOVB/(Double)m_frameRate));1954 Double targetBitsLeftBudget = ((m_costRefAvgWeighting*m_remainingBitsInGOP)/((m_costRefAvgWeighting*numRemainingRefFrames)+(m_costNonRefAvgWeighting*numRemainingNRefFrames)));1955 1956 m_targetBits = (Int)(beta * targetBitsLeftBudget + (1-beta) * targetBitsOccupancy);1957 1958 if(m_targetBits <= 0 || m_remainingBitsInGOP <= 0)1959 {1960 finalQP = m_pcFrameData[m_indexPrevPOCInGOP].m_qp + 2;1961 }1962 else1963 {1964 Double costPredMAD = m_cMADLinearModel.getMAD();1965 Int qpLowerBound = m_pcFrameData[m_indexPrevPOCInGOP].m_qp-2;1966 Int qpUpperBound = m_pcFrameData[m_indexPrevPOCInGOP].m_qp+2;1967 finalQP = m_cPixelURQQuadraticModel.getQP(m_pcFrameData[m_indexPrevPOCInGOP].m_qp, m_targetBits, m_numOfPixels, costPredMAD);1968 finalQP = max(qpLowerBound, min(qpUpperBound, finalQP));1969 m_activeUnitLevelOn = true;1970 m_remainingBitsInFrame = m_targetBits;1971 m_costAvgbpp = (m_targetBits/(Double)m_numOfPixels);1972 }1973 1974 m_indexRefFrame++;1975 }1976 else1977 {1978 Int bwdQP = m_pcFrameData[m_indexPOCInGOP-1].m_qp;1979 Int fwdQP = m_pcFrameData[m_indexPOCInGOP+1].m_qp;1980 1981 if( (fwdQP+bwdQP) == m_pcFrameData[m_indexPOCInGOP-1].m_qp1982 ||(fwdQP+bwdQP) == m_pcFrameData[m_indexPOCInGOP+1].m_qp)1983 {1984 finalQP = (fwdQP+bwdQP);1985 }1986 else if(bwdQP != fwdQP)1987 {1988 finalQP = ((bwdQP+fwdQP+2)>>1);1989 }1990 else1991 {1992 finalQP = bwdQP+2;1993 }1994 m_indexNonRefFrame++;1995 }1996 }1997 else1998 {1999 Int lastQPminus2 = m_pcFrameData[0].m_qp - 2;2000 Int lastQPplus2 = m_pcFrameData[0].m_qp + 2;2001 2002 for(Int idx = 1; idx <= m_sizeGOP; idx++)2003 {2004 if(m_pcFrameData[idx].m_isReferenced)2005 {2006 finalQP += m_pcFrameData[idx].m_qp;2007 numofReferenced++;2008 }2009 }2010 2011 finalQP = (numofReferenced == 0) ? m_pcFrameData[0].m_qp : ((finalQP + (1<<(numofReferenced>>1)))/numofReferenced);2012 finalQP = max( lastQPminus2, min( lastQPplus2, finalQP));2013 2014 Double costAvgFrameBits = m_remainingBitsInGOP/(Double)m_sizeGOP;2015 Int bufLevel = m_occupancyVB + m_initialOVB;2016 2017 if(abs(bufLevel) > costAvgFrameBits)2018 {2019 if(bufLevel < 0)2020 {2021 finalQP -= 2;2022 }2023 else2024 {2025 finalQP += 2;2026 }2027 }2028 m_indexRefFrame++;2029 }2030 finalQP = max(MIN_QP, min(MAX_QP, finalQP));2031 2032 for(Int indexLCU = 0 ; indexLCU < m_numUnitInFrame; indexLCU++)2033 {2034 m_pcLCUData[indexLCU].m_qp = finalQP;2035 }2036 2037 pcFrameData->m_isReferenced = isReferenced;2038 pcFrameData->m_qp = finalQP;2039 2040 return finalQP;2041 }2042 2043 Bool TEncRateCtrl::calculateUnitQP ()2044 {2045 if(!m_activeUnitLevelOn || m_indexLCU == 0)2046 {2047 return false;2048 }2049 Int upperQPBound, lowerQPBound, finalQP;2050 Int colQP = m_pcLCUData[m_indexLCU].m_qp;2051 Double colMAD = m_pcLCUData[m_indexLCU].m_costMAD;2052 Double budgetInUnit = m_pcLCUData[m_indexLCU].m_pixels*m_costAvgbpp;2053 2054 2055 Int targetBitsOccupancy = (Int)(budgetInUnit - (m_occupancyVBInFrame/(m_numUnitInFrame-m_indexUnit)));2056 Int targetBitsLeftBudget= (Int)((m_remainingBitsInFrame*m_pcLCUData[m_indexLCU].m_pixels)/(Double)(m_numOfPixels-m_codedPixels));2057 Int targetBits = (targetBitsLeftBudget>>1) + (targetBitsOccupancy>>1);2058 2059 2060 if( m_indexLCU >= m_sourceWidthInLCU)2061 {2062 upperQPBound = ( (m_pcLCUData[m_indexLCU-1].m_qp + m_pcLCUData[m_indexLCU - m_sourceWidthInLCU].m_qp)>>1) + MAX_DELTA_QP;2063 lowerQPBound = ( (m_pcLCUData[m_indexLCU-1].m_qp + m_pcLCUData[m_indexLCU - m_sourceWidthInLCU].m_qp)>>1) - MAX_DELTA_QP;2064 }2065 else2066 {2067 upperQPBound = m_pcLCUData[m_indexLCU-1].m_qp + MAX_DELTA_QP;2068 lowerQPBound = m_pcLCUData[m_indexLCU-1].m_qp - MAX_DELTA_QP;2069 }2070 2071 if(targetBits < 0)2072 {2073 finalQP = m_pcLCUData[m_indexLCU-1].m_qp + 1;2074 }2075 else2076 {2077 finalQP = m_cPixelURQQuadraticModel.getQP(colQP, targetBits, m_pcLCUData[m_indexLCU].m_pixels, colMAD);2078 }2079 2080 finalQP = max(lowerQPBound, min(upperQPBound, finalQP));2081 m_pcLCUData[m_indexLCU].m_qp = max(MIN_QP, min(MAX_QP, finalQP));2082 2083 return true;2084 }2085 2086 Void TEncRateCtrl::updateRCGOPStatus()2087 {2088 m_remainingBitsInGOP = ((m_currBitrate/m_frameRate)*m_sizeGOP) - m_occupancyVB;2089 2090 FrameData cFrameData = m_pcFrameData[m_sizeGOP];2091 initFrameData();2092 2093 m_pcFrameData[0] = cFrameData;2094 m_indexGOP++;2095 m_indexFrame = 0;2096 m_indexRefFrame = 0;2097 m_indexNonRefFrame = 0;2098 }2099 2100 Void TEncRateCtrl::updataRCFrameStatus(Int frameBits, SliceType eSliceType)2101 {2102 FrameData* pcFrameData = &m_pcFrameData[m_indexPOCInGOP];2103 Int occupancyBits;2104 Double adjustmentBits;2105 2106 m_remainingBitsInGOP = m_remainingBitsInGOP + ( ((m_currBitrate-m_prevBitrate)/m_frameRate)*(m_sizeGOP-m_indexFrame) ) - frameBits;2107 occupancyBits = (Int)((Double)frameBits - (m_currBitrate/(Double)m_frameRate));2108 2109 if( (occupancyBits < 0) && (m_initialOVB > 0) )2110 {2111 adjustmentBits = xAdjustmentBits(occupancyBits, m_initialOVB );2112 2113 if(m_initialOVB < 0)2114 {2115 adjustmentBits = m_initialOVB;2116 occupancyBits += (Int)adjustmentBits;2117 m_initialOVB = 0;2118 }2119 }2120 else if( (occupancyBits > 0) && (m_initialOVB < 0) )2121 {2122 adjustmentBits = xAdjustmentBits(m_initialOVB, occupancyBits );2123 2124 if(occupancyBits < 0)2125 {2126 adjustmentBits = occupancyBits;2127 m_initialOVB += (Int)adjustmentBits;2128 occupancyBits = 0;2129 }2130 }2131 2132 if(m_indexGOP == 0)2133 {2134 m_initialOVB = occupancyBits;2135 }2136 else2137 {2138 m_occupancyVB= m_occupancyVB + occupancyBits;2139 }2140 2141 if(pcFrameData->m_isReferenced)2142 {2143 m_costRefAvgWeighting = ((pcFrameData->m_bits*pcFrameData->m_qp)/8.0) + (7.0*(m_costRefAvgWeighting)/8.0);2144 2145 if(m_indexFrame == 0)2146 {2147 m_initialTBL = m_targetBufLevel = (frameBits - (m_currBitrate/m_frameRate));2148 }2149 else2150 {2151 Int distance = (m_costNonRefAvgWeighting == 0) ? 0 : 1;2152 m_targetBufLevel = m_targetBufLevel2153 - (m_initialTBL/(m_refFrameNum-1))2154 + (Int)((m_costRefAvgWeighting*(distance+1)*m_currBitrate)/(m_frameRate*(m_costRefAvgWeighting+(m_costNonRefAvgWeighting*distance))))2155 - (m_currBitrate/m_frameRate);2156 }2157 2158 if(m_cMADLinearModel.IsUpdateAvailable())2159 {2160 m_cMADLinearModel.updateMADLiearModel();2161 }2162 2163 if(eSliceType != I_SLICE &&2164 m_cPixelURQQuadraticModel.checkUpdateAvailable(pcFrameData->m_qp))2165 {2166 m_cPixelURQQuadraticModel.updatePixelBasedURQQuadraticModel(pcFrameData->m_qp, pcFrameData->m_bits, m_numOfPixels, pcFrameData->m_costMAD);2167 }2168 }2169 else2170 {2171 m_costNonRefAvgWeighting = ((pcFrameData->m_bits*pcFrameData->m_qp)/8.0) + (7.0*(m_costNonRefAvgWeighting)/8.0);2172 }2173 2174 m_indexFrame++;2175 m_indexLCU = 0;2176 m_indexUnit = 0;2177 m_occupancyVBInFrame = 0;2178 m_remainingBitsInFrame = 0;2179 m_codedPixels = 0;2180 m_activeUnitLevelOn = false;2181 m_costAvgbpp = 0.0;2182 }2183 Void TEncRateCtrl::updataRCUnitStatus ()2184 {2185 if(!m_activeUnitLevelOn || m_indexLCU == 0)2186 {2187 return;2188 }2189 2190 m_codedPixels += m_pcLCUData[m_indexLCU-1].m_pixels;2191 m_remainingBitsInFrame = m_remainingBitsInFrame - m_pcLCUData[m_indexLCU-1].m_bits;2192 m_occupancyVBInFrame = (Int)(m_occupancyVBInFrame + m_pcLCUData[m_indexLCU-1].m_bits - m_pcLCUData[m_indexLCU-1].m_pixels*m_costAvgbpp);2193 2194 if( m_cPixelURQQuadraticModel.checkUpdateAvailable(m_pcLCUData[m_indexLCU-1].m_qp) )2195 {2196 m_cPixelURQQuadraticModel.updatePixelBasedURQQuadraticModel(m_pcLCUData[m_indexLCU-1].m_qp, m_pcLCUData[m_indexLCU-1].m_bits, m_pcLCUData[m_indexLCU-1].m_pixels, m_pcLCUData[m_indexLCU-1].m_costMAD);2197 }2198 2199 m_indexUnit++;2200 }2201 2202 Void TEncRateCtrl::updateFrameData(UInt64 actualFrameBits)2203 {2204 Double costMAD = 0.0;2205 2206 for(Int i = 0; i < m_numUnitInFrame; i++)2207 {2208 costMAD += m_pcLCUData[i].m_costMAD;2209 }2210 2211 m_pcFrameData[m_indexPOCInGOP].m_costMAD = (costMAD/(Double)m_numUnitInFrame);2212 m_pcFrameData[m_indexPOCInGOP].m_bits = (Int)actualFrameBits;2213 2214 if(m_pcFrameData[m_indexPOCInGOP].m_isReferenced)2215 {2216 m_indexPrevPOCInGOP = m_indexPOCInGOP;2217 m_cMADLinearModel.updateMADHistory(m_pcFrameData[m_indexPOCInGOP].m_costMAD);2218 }2219 }2220 2221 Void TEncRateCtrl::updateLCUData(TComDataCU* pcCU, UInt64 actualLCUBits, Int qp)2222 {2223 Int x, y;2224 Double costMAD = 0.0;2225 2226 Pel* pOrg = pcCU->getPic()->getPicYuvOrg()->getLumaAddr(pcCU->getAddr(), 0);2227 Pel* pRec = pcCU->getPic()->getPicYuvRec()->getLumaAddr(pcCU->getAddr(), 0);2228 Int stride = pcCU->getPic()->getStride();2229 2230 Int width = m_pcLCUData[m_indexLCU].m_widthInPixel;2231 Int height = m_pcLCUData[m_indexLCU].m_heightInPixel;2232 2233 for( y = 0; y < height; y++ )2234 {2235 for( x = 0; x < width; x++ )2236 {2237 costMAD += abs( pOrg[x] - pRec[x] );2238 }2239 pOrg += stride;2240 pRec += stride;2241 }2242 m_pcLCUData[m_indexLCU ].m_qp = qp;2243 m_pcLCUData[m_indexLCU ].m_costMAD = (costMAD /(Double)(width*height));2244 m_pcLCUData[m_indexLCU++].m_bits = (Int)actualLCUBits;2245 }2246 2247 2248 #if KWU_RC_MADPRED_E02272249 Void TEncRateCtrl::updateLCUDataEnhancedView(TComDataCU* pcCU, UInt64 uiBits, Int qp, Double basePos, Double curPos, Double focalLen, Double znear, Double zfar, Int direction)2250 {2251 Int x, y;2252 Double dMAD = 0.0;2253 Int Sum = 0;2254 Double SAD = 0.0;2255 2256 Pel* pOrg = pcCU->getSlice()->getIvPic(false, 0)->getPicYuvOrg()->getLumaAddr(pcCU->getAddr(), 0);2257 Pel* pRec = pcCU->getSlice()->getIvPic(false, 0)->getPicYuvRec()->getLumaAddr(pcCU->getAddr(), 0);2258 Pel* pDep = pcCU->getSlice()->getIvPic(true, pcCU->getSlice()->getViewIndex())->getPicYuvOrg()->getLumaAddr(pcCU->getAddr(), 0);2259 Int iStride = pcCU->getSlice()->getIvPic(true, pcCU->getSlice()->getViewIndex())->getPicYuvOrg()->getStride();2260 2261 Int width = m_pcLCUData[m_indexLCU].m_widthInPixel;2262 Int height = m_pcLCUData[m_indexLCU].m_heightInPixel;2263 2264 for( y = 0 ; y < pcCU->getSlice()->getSPS()->getMaxCUHeight() ; y+=8)2265 {2266 for( x = 0 ; x < pcCU->getSlice()->getSPS()->getMaxCUWidth() ; x+=8)2267 {2268 Sum += pDep[x];2269 }2270 pDep += iStride;2271 }2272 2273 Double AvgDepth = (Double)Sum/((pcCU->getSlice()->getSPS()->getMaxCUHeight()/8)*(pcCU->getSlice()->getSPS()->getMaxCUWidth()/8));2274 Double fL = focalLen * abs( basePos - curPos );2275 Double z = abs( 1.0 / znear - 1.0 / zfar ) * ((Double)(AvgDepth) / (( 1 << g_bitDepthY ) - 1) ) + abs(1.0 / zfar);2276 Int disparity = (Int)(direction*fL * z);2277 Int shift = DISTORTION_PRECISION_ADJUSTMENT(g_bitDepthY-8);2278 Int disp = disparity;2279 2280 for( y = 0; y < height; y++ )2281 {2282 for( x = 0; x < width; x++ )2283 {2284 SAD += abs( pOrg[Clip3(0, (Int)(pcCU->getPic()->getPicYuvOrg()->getWidth() - pcCU->getSlice()->getSPS()->getMaxCUWidth()), x + disp)]2285 - pRec[Clip3(0, (Int)(pcCU->getPic()->getPicYuvOrg()->getWidth() - pcCU->getSlice()->getSPS()->getMaxCUWidth()), x + disp)] )>>shift;2286 }2287 pOrg += iStride;2288 pRec += iStride;2289 }2290 m_pcLCUData[m_indexLCU].m_qp = qp;2291 m_pcLCUData[m_indexLCU].m_costMAD = (SAD /(Double)(width*height));2292 m_pcLCUData[m_indexLCU].m_bits = (Int)uiBits;2293 }2294 #endif2295 2296 2297 Double TEncRateCtrl::xAdjustmentBits(Int& reductionBits, Int& compensationBits)2298 {2299 Double adjustment = ADJUSTMENT_FACTOR*reductionBits;2300 reductionBits -= (Int)adjustment;2301 compensationBits += (Int)adjustment;2302 2303 return adjustment;2304 }2305 2306 #endif2307 -
branches/HTM-10.0rc1-dev0/source/Lib/TLibEncoder/TEncRateCtrl.h
r837 r838 326 326 TRCLCU* m_LCUs; 327 327 Int m_picActualHeaderBits; // only SH and potential APS 328 #if !M0036_RC_IMPROVEMENT329 Double m_totalMAD;330 #endif331 328 Double m_totalCostIntra; 332 329 Double m_remainingCostIntra; -
branches/HTM-10.0rc1-dev0/source/Lib/TLibEncoder/TEncSbac.cpp
r837 r838 2129 2129 { 2130 2130 m_pcBinIf->encodeBin( 1, m_cSaoTypeIdxSCModel.get( 0, 0, 0 ) ); 2131 m_pcBinIf->encodeBinEP( uiCode <= 4 ? 1 : 0);2131 m_pcBinIf->encodeBinEP( uiCode == 1 ? 0 : 1 ); 2132 2132 } 2133 2133 } … … 2332 2332 } 2333 2333 2334 Void TEncSbac::codeSAOOffsetParam(Int compIdx, SAOOffset& ctbParam, Bool sliceEnabled) 2335 { 2336 UInt uiSymbol; 2337 if(!sliceEnabled) 2338 { 2339 assert(ctbParam.modeIdc == SAO_MODE_OFF); 2340 return; 2341 } 2342 2343 //type 2344 if(compIdx == SAO_Y || compIdx == SAO_Cb) 2345 { 2346 //sao_type_idx_luma or sao_type_idx_chroma 2347 if(ctbParam.modeIdc == SAO_MODE_OFF) 2348 { 2349 uiSymbol =0; 2350 } 2351 else if(ctbParam.typeIdc == SAO_TYPE_BO) //BO 2352 { 2353 uiSymbol = 1; 2354 } 2355 else 2356 { 2357 assert(ctbParam.typeIdc < SAO_TYPE_START_BO); //EO 2358 uiSymbol = 2; 2359 } 2360 codeSaoTypeIdx(uiSymbol); 2361 } 2362 2363 if(ctbParam.modeIdc == SAO_MODE_NEW) 2364 { 2365 Int numClasses = (ctbParam.typeIdc == SAO_TYPE_BO)?4:NUM_SAO_EO_CLASSES; 2366 Int offset[4]; 2367 Int k=0; 2368 for(Int i=0; i< numClasses; i++) 2369 { 2370 if(ctbParam.typeIdc != SAO_TYPE_BO && i == SAO_CLASS_EO_PLAIN) 2371 { 2372 continue; 2373 } 2374 Int classIdx = (ctbParam.typeIdc == SAO_TYPE_BO)?( (ctbParam.typeAuxInfo+i)% NUM_SAO_BO_CLASSES ):i; 2375 offset[k] = ctbParam.offset[classIdx]; 2376 k++; 2377 } 2378 2379 for(Int i=0; i< 4; i++) 2380 { 2381 codeSaoMaxUvlc((offset[i]<0)?(-offset[i]):(offset[i]), g_saoMaxOffsetQVal[compIdx] ); //sao_offset_abs 2382 } 2383 2384 2385 if(ctbParam.typeIdc == SAO_TYPE_BO) 2386 { 2387 for(Int i=0; i< 4; i++) 2388 { 2389 if(offset[i] != 0) 2390 { 2391 codeSAOSign((offset[i]< 0)?1:0); 2392 } 2393 } 2394 2395 codeSaoUflc(NUM_SAO_BO_CLASSES_LOG2, ctbParam.typeAuxInfo ); //sao_band_position 2396 } 2397 else //EO 2398 { 2399 if(compIdx == SAO_Y || compIdx == SAO_Cb) 2400 { 2401 assert(ctbParam.typeIdc - SAO_TYPE_START_EO >=0); 2402 codeSaoUflc(NUM_SAO_EO_TYPES_LOG2, ctbParam.typeIdc - SAO_TYPE_START_EO ); //sao_eo_class_luma or sao_eo_class_chroma 2403 } 2404 } 2405 2406 } 2407 } 2408 2409 2410 Void TEncSbac::codeSAOBlkParam(SAOBlkParam& saoBlkParam 2411 , Bool* sliceEnabled 2412 , Bool leftMergeAvail 2413 , Bool aboveMergeAvail 2414 , Bool onlyEstMergeInfo // = false 2415 ) 2416 { 2417 2418 Bool isLeftMerge = false; 2419 Bool isAboveMerge= false; 2420 2421 if(leftMergeAvail) 2422 { 2423 isLeftMerge = ((saoBlkParam[SAO_Y].modeIdc == SAO_MODE_MERGE) && (saoBlkParam[SAO_Y].typeIdc == SAO_MERGE_LEFT)); 2424 codeSaoMerge( isLeftMerge?1:0 ); //sao_merge_left_flag 2425 } 2426 2427 if( aboveMergeAvail && !isLeftMerge) 2428 { 2429 isAboveMerge = ((saoBlkParam[SAO_Y].modeIdc == SAO_MODE_MERGE) && (saoBlkParam[SAO_Y].typeIdc == SAO_MERGE_ABOVE)); 2430 codeSaoMerge( isAboveMerge?1:0 ); //sao_merge_left_flag 2431 } 2432 2433 if(onlyEstMergeInfo) 2434 { 2435 return; //only for RDO 2436 } 2437 2438 if(!isLeftMerge && !isAboveMerge) //not merge mode 2439 { 2440 for(Int compIdx=0; compIdx < NUM_SAO_COMPONENTS; compIdx++) 2441 { 2442 codeSAOOffsetParam(compIdx, saoBlkParam[compIdx], sliceEnabled[compIdx]); 2443 } 2444 } 2445 } 2446 2334 2447 #if H_3D_INTER_SDC 2335 2448 #if QC_SDC_UNIFY_G0130 -
branches/HTM-10.0rc1-dev0/source/Lib/TLibEncoder/TEncSearch.cpp
r837 r838 726 726 Pel* piRefPos; 727 727 Int iRefStride = m_filteredBlock[0][0].getStride(); 728 #if NS_HAD729 m_pcRdCost->setDistParam( pcPatternKey, m_filteredBlock[0][0].getLumaAddr(), iRefStride, 1, m_cDistParam, m_pcEncCfg->getUseHADME(), m_pcEncCfg->getUseNSQT() );730 #else731 728 m_pcRdCost->setDistParam( pcPatternKey, m_filteredBlock[0][0].getLumaAddr(), iRefStride, 1, m_cDistParam, m_pcEncCfg->getUseHADME() ); 732 #endif733 729 734 730 const TComMv* pcMvRefine = (iFrac == 2 ? s_acMvRefineH : s_acMvRefineQ); … … 3950 3946 } 3951 3947 else 3952 #endif 3953 { 3948 { 3949 #endif 3954 3950 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx ); 3955 3951 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx ); 3956 3952 } 3957 3953 #if NTT_STORE_SPDV_VSP_G0148 3954 } 3955 #endif 3958 3956 #if H_3D_VSP && !NTT_STORE_SPDV_VSP_G0148 3959 3957 pcCU->setVSPFlagSubParts( vspFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) ); … … 5597 5595 { 5598 5596 #endif 5599 #if WEIGHTED_CHROMA_DISTORTION5600 5597 uiDistortion = m_pcRdCost->getDistPart(g_bitDepthY, rpcYuvRec->getLumaAddr(), rpcYuvRec->getStride(), pcYuvOrg->getLumaAddr(), pcYuvOrg->getStride(), uiWidth, uiHeight ) 5601 5598 + m_pcRdCost->getDistPart(g_bitDepthC, rpcYuvRec->getCbAddr(), rpcYuvRec->getCStride(), pcYuvOrg->getCbAddr(), pcYuvOrg->getCStride(), uiWidth >> 1, uiHeight >> 1, TEXT_CHROMA_U ) 5602 5599 + m_pcRdCost->getDistPart(g_bitDepthC, rpcYuvRec->getCrAddr(), rpcYuvRec->getCStride(), pcYuvOrg->getCrAddr(), pcYuvOrg->getCStride(), uiWidth >> 1, uiHeight >> 1, TEXT_CHROMA_V ); 5603 #else5604 uiDistortion = m_pcRdCost->getDistPart(g_bitDepthY, rpcYuvRec->getLumaAddr(), rpcYuvRec->getStride(), pcYuvOrg->getLumaAddr(), pcYuvOrg->getStride(), uiWidth, uiHeight )5605 + m_pcRdCost->getDistPart(g_bitDepthC, rpcYuvRec->getCbAddr(), rpcYuvRec->getCStride(), pcYuvOrg->getCbAddr(), pcYuvOrg->getCStride(), uiWidth >> 1, uiHeight >> 1 )5606 + m_pcRdCost->getDistPart(g_bitDepthC, rpcYuvRec->getCrAddr(), rpcYuvRec->getCStride(), pcYuvOrg->getCrAddr(), pcYuvOrg->getCStride(), uiWidth >> 1, uiHeight >> 1 );5607 #endif5608 5609 5600 #if H_3D_VSO // MIgnore 5610 5601 } -
branches/HTM-10.0rc1-dev0/source/Lib/TLibEncoder/TEncSlice.cpp
r837 r838 564 564 m_pcRdCost->setCrDistortionWeight(weight[1]); 565 565 566 const Double lambdaArray[3] = {lambda, (lambda / weight[0]), (lambda / weight[1])}; 566 567 567 568 #if RDOQ_CHROMA_LAMBDA
Note: See TracChangeset for help on using the changeset viewer.