Changeset 537 in 3DVCSoftware for branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSearch.cpp
- Timestamp:
- 13 Jul 2013, 15:51:26 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSearch.cpp
r532 r537 1067 1067 } 1068 1068 #endif 1069 1070 1069 // save prediction 1071 1070 if(default0Save1Load2 == 1) … … 1427 1426 #if H_3D_DIM_ENC 1428 1427 , Bool zeroResi 1429 #endif 1430 1428 #endif 1429 ) 1431 1430 { 1432 1431 UInt uiFullDepth = pcCU->getDepth( 0 ) + uiTrDepth; … … 1436 1435 1437 1436 #if HHI_RQT_INTRA_SPEEDUP 1438 #if L0232_RD_PENALTY1439 1437 Int maxTuSize = pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize(); 1440 1438 Int isIntraSlice = (pcCU->getSlice()->getSliceType() == I_SLICE); … … 1453 1451 } 1454 1452 if( bCheckFirst && noSplitIntraMaxTuSize ) 1453 { 1454 bCheckSplit = false; 1455 } 1455 1456 #else 1456 if( bCheckFirst && bCheckFull )1457 #endif1458 {1459 bCheckSplit = false;1460 }1461 #else1462 #if L0232_RD_PENALTY1463 1457 Int maxTuSize = pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize(); 1464 1458 Int isIntraSlice = (pcCU->getSlice()->getSliceType() == I_SLICE); … … 1469 1463 } 1470 1464 #endif 1471 #endif1472 1465 #if H_3D_DIM 1473 1466 if( isDimMode( pcCU->getLumaIntraDir( uiAbsPartIdx ) ) ) … … 1476 1469 } 1477 1470 #endif 1478 1479 1471 Double dSingleCost = MAX_DOUBLE; 1480 1472 #if H_3D_VSO … … 1667 1659 //----- determine rate and r-d cost ----- 1668 1660 UInt uiSingleBits = xGetIntraBitsQT( pcCU, uiTrDepth, uiAbsPartIdx, true, !bLumaOnly, false ); 1669 #if L0232_RD_PENALTY1670 1661 if(m_pcEncCfg->getRDpenalty() && (uiLog2TrSize==5) && !isIntraSlice) 1671 1662 { 1672 1663 uiSingleBits=uiSingleBits*4; 1673 1664 } 1674 #endif1675 1665 #if H_3D_VSO // M40 1676 1666 if ( m_pcRdCost->getUseLambdaScaleVSO()) … … 1823 1813 } 1824 1814 } 1825 1826 1815 #if H_3D_VSO // M42 1827 1816 if ( m_pcRdCost->getUseRenModel() && bCheckFull ) … … 1836 1825 } 1837 1826 #endif 1838 1839 1827 ruiDistY += uiSingleDistY; 1840 1828 ruiDistC += uiSingleDistC; … … 2788 2776 2789 2777 UInt iModeBits = xModeBitsIntra( pcCU, uiMode, uiPU, uiPartOffset, uiDepth, uiInitTrDepth ); 2790 2791 2792 2778 #if H_3D_VSO // M35 2793 2779 #if H_3D_VSO_FIX // This fix should be enabled after verification … … 2924 2910 } 2925 2911 #endif 2926 2927 2912 //===== check modes (using r-d costs) ===== 2928 2913 #if HHI_RQT_INTRA_SPEEDUP_MOD … … 3112 3097 UInt uiPUDistC = 0; 3113 3098 Double dPUCost = 0.0; 3114 3115 3099 #if H_3D_VSO // M37 3116 3100 // reset Model … … 3164 3148 { 3165 3149 #endif 3166 3167 //--- update transform index and cbf --- 3150 //--- update transform index and cbf --- 3168 3151 UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> ( ( pcCU->getDepth(0) + uiInitTrDepth ) << 1 ); 3169 3152 ::memcpy( pcCU->getTransformIdx() + uiPartOffset, m_puhQTTempTrIdx, uiQPartNum * sizeof( UChar ) ); … … 3764 3747 UInt uiBitsTempL0[MAX_NUM_REF]; 3765 3748 3766 #if L0034_COMBINED_LIST_CLEANUP3767 3749 TComMv mvValidList1; 3768 3750 Int refIdxValidList1 = 0; 3769 3751 UInt bitsValidList1 = MAX_UINT; 3770 3752 UInt costValidList1 = MAX_UINT; 3771 #endif3772 3753 3773 3754 xGetBlkBits( ePartSize, pcCU->getSlice()->isInterP(), iPartIdx, uiLastMode, uiMbBits); … … 3821 3802 uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdx[iRefList][iRefIdxTemp]][AMVP_MAX_NUM_CANDS]; 3822 3803 #if ZERO_MVD_EST 3823 #if L0034_COMBINED_LIST_CLEANUP3824 3804 if ( iRefList == 0 || pcCU->getSlice()->getList1IdxToList0Idx( iRefIdxTemp ) < 0 ) 3825 #else3826 if ((iRefList != 1 || !pcCU->getSlice()->getNoBackPredFlag()) &&3827 (pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) <= 0 || pcCU->getSlice()->getRefIdxOfLC(eRefPicList, iRefIdxTemp)>=0))3828 #endif3829 3805 { 3830 3806 uiZeroMvdBitsTemp = uiBitsTemp; … … 3846 3822 3847 3823 #if GPB_SIMPLE_UNI 3848 #if L0034_COMBINED_LIST_CLEANUP3849 3824 if ( iRefList == 1 ) // list 1 3850 3825 { … … 3871 3846 } 3872 3847 #else 3873 if ( pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0)3874 {3875 if ( iRefList && ( pcCU->getSlice()->getNoBackPredFlag() || (pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && !pcCU->getSlice()->getNoBackPredFlag() && pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)>=0 ) ) )3876 {3877 if ( pcCU->getSlice()->getNoBackPredFlag() )3878 {3879 cMvTemp[1][iRefIdxTemp] = cMvTemp[0][iRefIdxTemp];3880 uiCostTemp = uiCostTempL0[iRefIdxTemp];3881 /*first subtract the bit-rate part of the cost of the other list*/3882 uiCostTemp -= m_pcRdCost->getCost( uiBitsTempL0[iRefIdxTemp] );3883 }3884 else3885 {3886 cMvTemp[1][iRefIdxTemp] = cMvTemp[0][pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)];3887 uiCostTemp = uiCostTempL0[pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)];3888 /*first subtract the bit-rate part of the cost of the other list*/3889 uiCostTemp -= m_pcRdCost->getCost( uiBitsTempL0[pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)] );3890 }3891 /*correct the bit-rate part of the current ref*/3892 m_pcRdCost->setPredictor ( cMvPred[iRefList][iRefIdxTemp] );3893 uiBitsTemp += m_pcRdCost->getBits( cMvTemp[1][iRefIdxTemp].getHor(), cMvTemp[1][iRefIdxTemp].getVer() );3894 /*calculate the correct cost*/3895 uiCostTemp += m_pcRdCost->getCost( uiBitsTemp );3896 }3897 else3898 {3899 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp );3900 }3901 }3902 else3903 {3904 if (iRefList && pcCU->getSlice()->getNoBackPredFlag())3905 {3906 uiCostTemp = MAX_UINT;3907 cMvTemp[1][iRefIdxTemp] = cMvTemp[0][iRefIdxTemp];3908 }3909 else3910 {3911 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp );3912 }3913 }3914 #endif3915 #else3916 3848 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp ); 3917 3849 #endif … … 3919 3851 xCheckBestMVP(pcCU, eRefPicList, cMvTemp[iRefList][iRefIdxTemp], cMvPred[iRefList][iRefIdxTemp], aaiMvpIdx[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp); 3920 3852 3921 #if L0034_COMBINED_LIST_CLEANUP3922 3853 if ( iRefList == 0 ) 3923 3854 { … … 3944 3875 refIdxValidList1 = iRefIdxTemp; 3945 3876 } 3946 #else3947 if(pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && !pcCU->getSlice()->getNoBackPredFlag())3948 {3949 if(iRefList==REF_PIC_LIST_0)3950 {3951 uiCostTempL0[iRefIdxTemp] = uiCostTemp;3952 uiBitsTempL0[iRefIdxTemp] = uiBitsTemp;3953 if(pcCU->getSlice()->getRefIdxOfLC(REF_PIC_LIST_0, iRefIdxTemp)<0)3954 {3955 uiCostTemp = MAX_UINT;3956 }3957 }3958 else3959 {3960 if(pcCU->getSlice()->getRefIdxOfLC(REF_PIC_LIST_1, iRefIdxTemp)<0)3961 {3962 uiCostTemp = MAX_UINT;3963 }3964 }3965 }3966 3967 if ( ( iRefList == 0 && uiCostTemp < uiCost[iRefList] ) ||3968 ( iRefList == 1 && pcCU->getSlice()->getNoBackPredFlag() && iRefIdxTemp == iRefIdx[0] ) ||3969 ( iRefList == 1 && (pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0) && (iRefIdxTemp==0 || iRefIdxTemp == iRefIdx[0]) && !pcCU->getSlice()->getNoBackPredFlag() && (iRefIdxTemp == pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)) ) ||3970 ( iRefList == 1 && !pcCU->getSlice()->getNoBackPredFlag() && uiCostTemp < uiCost[iRefList] ) )3971 {3972 uiCost[iRefList] = uiCostTemp;3973 uiBits[iRefList] = uiBitsTemp; // storing for bi-prediction3974 3975 // set motion3976 cMv[iRefList] = cMvTemp[iRefList][iRefIdxTemp];3977 iRefIdx[iRefList] = iRefIdxTemp;3978 pcCU->getCUMvField(eRefPicList)->setAllMv( cMv[iRefList], ePartSize, uiPartAddr, 0, iPartIdx );3979 pcCU->getCUMvField(eRefPicList)->setAllRefIdx( iRefIdx[iRefList], ePartSize, uiPartAddr, 0, iPartIdx );3980 3981 if(!pcCU->getSlice()->getMvdL1ZeroFlag())3982 {3983 // storing list 1 prediction signal for iterative bi-directional prediction3984 if ( eRefPicList == REF_PIC_LIST_1 )3985 {3986 TComYuv* pcYuvPred = &m_acYuvPred[iRefList];3987 motionCompensation ( pcCU, pcYuvPred, eRefPicList, iPartIdx );3988 }3989 if ( (pcCU->getSlice()->getNoBackPredFlag() || (pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(0)==0 )) && eRefPicList == REF_PIC_LIST_0 )3990 {3991 TComYuv* pcYuvPred = &m_acYuvPred[iRefList];3992 motionCompensation ( pcCU, pcYuvPred, eRefPicList, iPartIdx );3993 }3994 }3995 }3996 #endif3997 3877 } 3998 3878 } … … 4058 3938 4059 3939 Int iRefList = iIter % 2; 4060 #if L0034_COMBINED_LIST_CLEANUP4061 3940 if ( m_pcEncCfg->getUseFastEnc() ) 4062 3941 { … … 4081 3960 motionCompensation ( pcCU, pcYuvPred, RefPicList(1-iRefList), iPartIdx ); 4082 3961 } 4083 #else4084 if ( m_pcEncCfg->getUseFastEnc() && (pcCU->getSlice()->getNoBackPredFlag() || (pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(0)==0 )) )4085 {4086 iRefList = 1;4087 }4088 #endif4089 3962 RefPicList eRefPicList = ( iRefList ? REF_PIC_LIST_1 : REF_PIC_LIST_0 ); 4090 3963 … … 4221 4094 UInt uiMEBits = 0; 4222 4095 // Set Motion Field_ 4223 #if L0034_COMBINED_LIST_CLEANUP4224 4096 cMv[1] = mvValidList1; 4225 4097 iRefIdx[1] = refIdxValidList1; 4226 4098 uiBits[1] = bitsValidList1; 4227 4099 uiCost[1] = costValidList1; 4228 #else4229 if ( pcCU->getSlice()->getNoBackPredFlag() || (pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(0)==0 ) )4230 {4231 uiCost[1] = MAX_UINT;4232 }4233 #endif4234 4100 #if AMP_MRG 4235 4101 if (bTestNormalMC)
Note: See TracChangeset for help on using the changeset viewer.