Changeset 1325 in 3DVCSoftware for branches/HTM-15.1-MV-draft-4/source/Lib/TLibEncoder/TEncSlice.cpp
- Timestamp:
- 7 Sep 2015, 18:40:35 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-15.1-MV-draft-4/source/Lib/TLibEncoder/TEncSlice.cpp
r1313 r1325 136 136 m_pdRdPicQp = (Double*)xMalloc( Double, m_pcCfg->getDeltaQpRD() * 2 + 1 ); 137 137 m_piRdPicQp = (Int* )xMalloc( Int, m_pcCfg->getDeltaQpRD() * 2 + 1 ); 138 #if KWU_RC_MADPRED_E0227139 if(m_pcCfg->getUseRateCtrl())140 {141 m_pcRateCtrl = pcEncTop->getRateCtrl();142 }143 else144 {145 m_pcRateCtrl = NULL;146 }147 #else148 138 m_pcRateCtrl = pcEncTop->getRateCtrl(); 149 #endif150 139 151 140 } … … 217 206 rpcSlice->setViewId ( pVPS->getViewId ( layerId ) ); 218 207 rpcSlice->setViewIndex ( pVPS->getViewIndex ( layerId ) ); 219 #if NH_3D220 rpcSlice->setIsDepth ( pVPS->getDepthId ( layerId ) != 0 );221 #endif222 208 #endif 223 209 rpcSlice->setSliceBits(0); … … 226 212 rpcSlice->setPicOutputFlag( true ); 227 213 rpcSlice->setPOC( pocCurr ); 228 #if NH_3D_IC229 rpcSlice->setApplyIC( false );230 #endif231 214 // depth computation based on GOP size 232 215 Int depth; … … 439 422 setUpLambda(rpcSlice, dLambda, iQP); 440 423 441 #if NH_3D_VSO442 m_pcRdCost->setUseLambdaScaleVSO ( (m_pcCfg->getUseVSO() || m_pcCfg->getForceLambdaScaleVSO()) && m_pcCfg->getIsDepth() );443 m_pcRdCost->setLambdaVSO ( dLambda * m_pcCfg->getLambdaScaleVSO() );444 445 // Should be moved to TEncTop446 447 // SAIT_VSO_EST_A0033448 m_pcRdCost->setDisparityCoeff( m_pcCfg->getDispCoeff() );449 450 // LGE_WVSO_A0119451 if( m_pcCfg->getUseWVSO() && m_pcCfg->getIsDepth() )452 {453 m_pcRdCost->setDWeight ( m_pcCfg->getDWeight() );454 m_pcRdCost->setVSOWeight( m_pcCfg->getVSOWeight() );455 m_pcRdCost->setVSDWeight( m_pcCfg->getVSDWeight() );456 }457 458 #endif459 424 460 425 if (m_pcCfg->getFastMEForGenBLowDelayEnabled()) … … 567 532 rpcSlice->setSliceSegmentMode ( m_pcCfg->getSliceSegmentMode() ); 568 533 rpcSlice->setSliceSegmentArgument ( m_pcCfg->getSliceSegmentArgument() ); 569 #if NH_3D_IV_MERGE570 #else571 534 rpcSlice->setMaxNumMergeCand ( m_pcCfg->getMaxNumMergeCand() ); 572 #endif573 535 } 574 536 … … 682 644 compressSlice ( pcPic, true, m_pcCfg->getFastDeltaQp()); 683 645 684 #if NH_3D_VSO685 Dist64 uiPicDist = m_uiPicDist;686 #else687 646 UInt64 uiPicDist = m_uiPicDist; // Distortion, as calculated by compressSlice. 688 647 // NOTE: This distortion is the chroma-weighted SSE distortion for the slice. … … 693 652 // m_pcGOPEncoder->preLoopFilterPicAll( pcPic, uiPicDist ); 694 653 695 #endif696 654 697 655 // compute RD cost and choose the best 698 656 Double dPicRdCost = m_pcRdCost->calcRdCost64( m_uiPicTotalBits, uiPicDist, true, DF_SSE_FRAME); // NOTE: Is the 'true' parameter really necessary? 699 #if H_3D700 // Above calculation need to be fixed for VSO, including frameLambda value.701 #endif702 657 703 658 if ( dPicRdCost < dPicRdCostBest ) … … 825 780 #endif 826 781 827 #if NH_3D_IC828 if ( m_pcCfg->getViewIndex() && m_pcCfg->getUseIC() &&829 !( ( pcSlice->getSliceType() == P_SLICE && pcSlice->getPPS()->getUseWP() ) || ( pcSlice->getSliceType() == B_SLICE && pcSlice->getPPS()->getWPBiPred() ) )830 )831 {832 pcSlice ->xSetApplyIC(m_pcCfg->getUseICLowLatencyEnc());833 if ( pcSlice->getApplyIC() )834 {835 pcSlice->setIcSkipParseFlag( pcSlice->getPOC() % m_pcCfg->getIntraPeriod() != 0 );836 }837 }838 #endif839 782 840 783 … … 857 800 858 801 // for every CTU in the slice segment (may terminate sooner if there is a byte limit on the slice-segment) 859 #if NH_3D_VSO860 Int iLastPosY = -1;861 #endif862 802 863 803 for( UInt ctuTsAddr = startCtuTsAddr; ctuTsAddr < boundingCtuTsAddr; ++ctuTsAddr ) … … 867 807 TComDataCU* pCtu = pcPic->getCtu( ctuRsAddr ); 868 808 pCtu->initCtu( pcPic, ctuRsAddr ); 869 #if NH_3D_VSO870 if ( m_pcRdCost->getUseRenModel() )871 {872 // updated renderer model if necessary873 Int iCurPosX;874 Int iCurPosY;875 pCtu->getPosInPic(0, iCurPosX, iCurPosY );876 if ( iCurPosY != iLastPosY )877 {878 iLastPosY = iCurPosY;879 TEncTop* pcEncTop = (TEncTop*) m_pcCfg; // Fix this later.880 pcEncTop->setupRenModel( pcSlice->getPOC() , pcSlice->getViewIndex(), pcSlice->getIsDepth() ? 1 : 0, iCurPosY, pcSlice->getSPS()->getMaxCUHeight() );881 }882 }883 #endif884 809 885 810 // update CABAC state … … 931 856 else 932 857 { 933 #if KWU_RC_MADPRED_E0227934 if(pcSlice->getLayerId() != 0 && m_pcCfg->getUseDepthMADPred() && !pcSlice->getIsDepth())935 {936 Double zn, zf, focallength, position, camShift;937 Double basePos;938 Bool bInterpolated;939 Int direction = pcSlice->getViewId() - pcCU->getSlice()->getIvPic(false, 0)->getViewId();940 Int disparity;941 942 pcEncTop->getCamParam()->xGetZNearZFar(pcEncTop->getCamParam()->getBaseViewNumbers()[pcSlice->getViewIndex()], pcSlice->getPOC(), zn, zf);943 pcEncTop->getCamParam()->xGetGeometryData(pcEncTop->getCamParam()->getBaseViewNumbers()[0], pcSlice->getPOC(), focallength, basePos, camShift, bInterpolated);944 pcEncTop->getCamParam()->xGetGeometryData(pcEncTop->getCamParam()->getBaseViewNumbers()[pcSlice->getViewIndex()], pcSlice->getPOC(), focallength, position, camShift, bInterpolated);945 bpp = m_pcRateCtrl->getRCPic()->getLCUTargetBppforInterView( m_pcRateCtrl->getPicList(), pcCU,946 basePos, position, focallength, zn, zf, (direction > 0 ? 1 : -1), &disparity );947 }948 else949 {950 #endif951 858 bpp = m_pcRateCtrl->getRCPic()->getLCUTargetBpp(pcSlice->getSliceType()); 952 859 if ( pcPic->getSlice( 0 )->getSliceType() == I_SLICE) … … 959 866 estQP = m_pcRateCtrl->getRCPic()->getLCUEstQP ( estLambda, pcSlice->getSliceQp() ); 960 867 } 961 #if KWU_RC_MADPRED_E0227962 estLambda = m_pcRateCtrl->getRCPic()->getLCUEstLambda( bpp );963 estQP = m_pcRateCtrl->getRCPic()->getLCUEstQP ( estLambda, pcSlice->getSliceQp() );964 #endif965 868 966 869 estQP = Clip3( -pcSlice->getSPS()->getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, estQP ); … … 1039 942 if ( m_pcCfg->getUseRateCtrl() ) 1040 943 { 1041 #if KWU_RC_MADPRED_E02271042 UInt SAD = m_pcCuEncoder->getLCUPredictionSAD();1043 Int height = min( pcSlice->getSPS()->getMaxCUHeight(),pcSlice->getSPS()->getPicHeightInLumaSamples() - uiCUAddr / rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUHeight() );1044 Int width = min( pcSlice->getSPS()->getMaxCUWidth(),pcSlice->getSPS()->getPicWidthInLumaSamples() - uiCUAddr % rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUWidth() );1045 Double MAD = (Double)SAD / (Double)(height * width);1046 MAD = MAD * MAD;1047 ( m_pcRateCtrl->getRCPic()->getLCU(uiCUAddr) ).m_MAD = MAD;1048 #endif1049 944 1050 945 Int actualQP = g_RCInvalidQPValue; … … 1203 1098 } 1204 1099 1205 #if NH_3D_QTLPC1206 pcPic->setReduceBitsFlag(true);1207 #endif1208 1100 if ( pcSlice->getSPS()->getUseSAO() ) 1209 1101 { … … 1275 1167 } 1276 1168 } 1277 #if NH_3D_QTLPC1278 pcPic->setReduceBitsFlag(false);1279 #endif1280 1169 } // CTU-loop 1281 1170
Note: See TracChangeset for help on using the changeset viewer.