Changeset 345 in SHVCSoftware for trunk/source/Lib/TLibEncoder/TEncSearch.cpp
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/SHM-3.0-dev (added) merged: 315-344 /trunk (added) merged: 312-314
- Property svn:mergeinfo changed
-
trunk/source
- Property svn:mergeinfo changed
/branches/SHM-3.0-dev/source (added) merged: 316-340 /trunk/source (added) merged: 312-314
- Property svn:mergeinfo changed
-
trunk/source/Lib/TLibEncoder/TEncSearch.cpp
r313 r345 906 906 m_pcEntropyCoder->encodePredMode( pcCU, 0, true ); 907 907 } 908 #if INTRA_BL 909 m_pcEntropyCoder->encodeIntraBLFlag ( pcCU, 0, true ); 910 if( pcCU->isIntraBL( 0 ) ) 911 { 912 return; 913 } 914 #endif 908 915 909 m_pcEntropyCoder ->encodePartSize( pcCU, 0, pcCU->getDepth(0), true ); 916 910 … … 950 944 } 951 945 } 952 #if INTRA_BL 953 if( pcCU->isIntraBL( 0 ) ) 954 { 955 return; 956 } 957 #endif 946 958 947 if( bChroma ) 959 948 { … … 1055 1044 pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, uiTrDepth, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail ); 1056 1045 //===== get prediction signal ===== 1057 #if INTRA_BL && !NO_RESIDUAL_FLAG_FOR_BLPRED1058 if(pcCU->isIntraBL ( uiAbsPartIdx ) )1059 {1060 pcCU->getBaseLumaBlk( uiWidth, uiHeight, uiAbsPartIdx, piPred, uiStride );1061 }1062 else1063 #endif1064 1046 predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail ); 1065 1047 // save prediction … … 1247 1229 1248 1230 //===== get prediction signal ===== 1249 #if INTRA_BL && !NO_RESIDUAL_FLAG_FOR_BLPRED 1250 if(pcCU->isIntraBL ( uiAbsPartIdx ) ) 1251 { 1252 pcCU->getBaseChromaBlk( uiWidth, uiHeight, uiAbsPartIdx, piPred, uiStride, uiChromaId ); 1253 } 1254 else 1255 #endif 1256 { 1257 predIntraChromaAng( pPatChroma, uiChromaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail ); 1258 } 1231 predIntraChromaAng( pPatChroma, uiChromaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail ); 1232 1259 1233 // save prediction 1260 1234 if( default0Save1Load2 == 1 ) … … 4567 4541 Void TEncSearch::encodeResAndCalcRdInterCU( TComDataCU* pcCU, TComYuv* pcYuvOrg, TComYuv* pcYuvPred, TComYuv*& rpcYuvResi, TComYuv*& rpcYuvResiBest, TComYuv*& rpcYuvRec, Bool bSkipRes ) 4568 4542 { 4569 #if NO_RESIDUAL_FLAG_FOR_BLPRED4570 if ( pcCU->isIntra(0) && !pcCU->isIntraBL(0))4571 #else4572 4543 if ( pcCU->isIntra(0) ) 4573 #endif4574 4544 { 4575 4545 return; … … 4682 4652 pcCU->setTransformSkipSubParts ( 0, 0, 0, 0, pcCU->getDepth(0) ); 4683 4653 } 4684 #if NO_RESIDUAL_FLAG_FOR_BLPRED4685 else if(pcCU->getLayerId() > 0 && pcCU->isIntraBL(0) && uiZeroDistortion == uiDistortion) // all zeros4686 {4687 const UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> (pcCU->getDepth(0) << 1);4688 ::memset( pcCU->getTransformIdx() , 0, uiQPartNum * sizeof(UChar) );4689 ::memset( pcCU->getCbf( TEXT_LUMA ) , 0, uiQPartNum * sizeof(UChar) );4690 ::memset( pcCU->getCbf( TEXT_CHROMA_U ), 0, uiQPartNum * sizeof(UChar) );4691 ::memset( pcCU->getCbf( TEXT_CHROMA_V ), 0, uiQPartNum * sizeof(UChar) );4692 ::memset( pcCU->getCoeffY() , 0, uiWidth * uiHeight * sizeof( TCoeff ) );4693 ::memset( pcCU->getCoeffCb() , 0, uiWidth * uiHeight * sizeof( TCoeff ) >> 2 );4694 ::memset( pcCU->getCoeffCr() , 0, uiWidth * uiHeight * sizeof( TCoeff ) >> 2 );4695 pcCU->setTransformSkipSubParts ( 0, 0, 0, 0, pcCU->getDepth(0) );4696 }4697 #endif4698 4654 else 4699 4655 { … … 4994 4950 Int scalingListType = 3 + g_eTTable[(Int)TEXT_LUMA]; 4995 4951 assert(scalingListType < 6); 4996 #if NO_RESIDUAL_FLAG_FOR_BLPRED4997 if(pcCU->isIntraBL(uiAbsPartIdx) )4998 {4999 m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA,DC_IDX, pcResiCurrY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(), pcCoeffCurrY, trWidth, trHeight, scalingListType );//this is for inter mode only5000 }5001 else5002 {5003 m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA,REG_DCT, pcResiCurrY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(), pcCoeffCurrY, trWidth, trHeight, scalingListType );//this is for inter mode only5004 }5005 #else5006 4952 m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA,REG_DCT, pcResiCurrY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(), pcCoeffCurrY, trWidth, trHeight, scalingListType );//this is for inter mode only 5007 #endif5008 5009 4953 const UInt uiNonzeroDistY = m_pcRdCost->getDistPart(g_bitDepthY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getLumaAddr( absTUPartIdx ), m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(), 5010 4954 pcResi->getLumaAddr( absTUPartIdx ), pcResi->getStride(), trWidth,trHeight ); … … 5275 5219 assert(scalingListType < 6); 5276 5220 5277 #if NO_RESIDUAL_FLAG_FOR_BLPRED5278 if(pcCU->isIntraBL(uiAbsPartIdx) )5279 {5280 m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA,DC_IDX, pcResiCurrY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(), pcCoeffCurrY, trWidth, trHeight, scalingListType, true );5281 }5282 else5283 {5284 m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA,REG_DCT, pcResiCurrY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(), pcCoeffCurrY, trWidth, trHeight, scalingListType, true );5285 }5286 #else5287 5221 m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA,REG_DCT, pcResiCurrY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(), pcCoeffCurrY, trWidth, trHeight, scalingListType, true ); 5288 #endif5289 5222 5290 5223 uiNonzeroDistY = m_pcRdCost->getDistPart(g_bitDepthY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getLumaAddr( absTUPartIdx ), m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(), … … 5617 5550 5618 5551 { 5619 #if INTRA_BL5620 #if NO_RESIDUAL_FLAG_FOR_BLPRED5621 assert( !pcCU->isIntra(uiAbsPartIdx) || pcCU->isIntraBL(uiAbsPartIdx));5622 #else5623 assert( !pcCU->isIntra(uiAbsPartIdx) );5624 #endif5625 #else5626 5552 assert( pcCU->getPredictionMode(uiAbsPartIdx) != MODE_INTRA ); 5627 #endif5628 5553 if( bSubdivAndCbf ) 5629 5554 { … … 5859 5784 } 5860 5785 m_pcEntropyCoder->encodeSkipFlag ( pcCU, 0, true ); 5861 #if INTRA_BL5862 if(m_pcEncCfg->getLayerId())5863 {5864 m_pcEntropyCoder->encodeIntraBLFlag(pcCU, 0, true);5865 #if !NO_RESIDUAL_FLAG_FOR_BLPRED5866 assert( pcCU->isIntraBL( 0 ) == false );5867 #endif5868 }5869 #endif5870 #if NO_RESIDUAL_FLAG_FOR_BLPRED5871 if( !pcCU->isIntraBL(0))5872 {5873 #endif5874 5786 m_pcEntropyCoder->encodePredMode( pcCU, 0, true ); 5875 5787 m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth(0), true ); 5876 5788 m_pcEntropyCoder->encodePredInfo( pcCU, 0, true ); 5877 #if NO_RESIDUAL_FLAG_FOR_BLPRED 5878 } 5879 #endif 5789 5880 5790 Bool bDummy = false; 5881 5791 m_pcEntropyCoder->encodeCoeff ( pcCU, 0, pcCU->getDepth(0), pcCU->getWidth(0), pcCU->getHeight(0), bDummy ); … … 6295 6205 #endif 6296 6206 6297 #if INTRA_BL6298 Void6299 TEncSearch::estIntraBLPredQT( TComDataCU* pcCU,6300 TComYuv* pcOrgYuv,6301 TComYuv* pcPredYuv,6302 TComYuv* pcResiYuv,6303 TComYuv* pcRecoYuv )6304 {6305 UInt uiDepth = pcCU->getDepth(0);6306 UInt uiOverallDistY = 0;6307 UInt uiOverallDistC = 0;6308 6309 //===== set QP and clear Cbf =====6310 if ( pcCU->getSlice()->getPPS()->getUseDQP() == true)6311 {6312 pcCU->setQPSubParts( pcCU->getQP(0), 0, uiDepth );6313 }6314 else6315 {6316 pcCU->setQPSubParts( pcCU->getSlice()->getSliceQp(), 0, uiDepth );6317 }6318 6319 //===== init pattern for luma prediction =====6320 Bool bAboveAvail = false;6321 Bool bLeftAvail = false;6322 pcCU->getPattern()->initPattern ( pcCU, 0, 0 );6323 pcCU->getPattern()->initAdiPattern( pcCU, 0, 0, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail );6324 6325 pcCU->setLumaIntraDirSubParts ( DC_IDX, 0, uiDepth );6326 6327 // set context models6328 if( m_bUseSBACRD )6329 {6330 m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST] );6331 }6332 6333 // determine residual for partition6334 Double dPUCost = 0.0;6335 xRecurIntraCodingQT( pcCU, 0, 0, false, pcOrgYuv, pcPredYuv, pcResiYuv, uiOverallDistY, uiOverallDistC, false, dPUCost );6336 xSetIntraResultQT( pcCU, 0, 0, false, pcRecoYuv );6337 6338 //=== update PU data ====6339 pcCU->copyToPic( uiDepth, 0, 0 );6340 6341 //===== reset context models =====6342 if(m_bUseSBACRD)6343 {6344 m_pcRDGoOnSbacCoder->load(m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST]);6345 }6346 6347 //===== set distortion (rate and r-d costs are determined later) =====6348 pcCU->getTotalDistortion() = uiOverallDistY + uiOverallDistC;6349 }6350 6351 #endif6352 6207 //! \}
Note: See TracChangeset for help on using the changeset viewer.