Changeset 843 in 3DVCSoftware
- Timestamp:
- 8 Feb 2014, 19:59:02 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-10.0rc1-dev0/source/Lib/TLibEncoder/TEncSearch.cpp
r840 r843 3181 3181 { 3182 3182 #endif 3183 // set context models3183 // set context models 3184 3184 m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST] ); 3185 3186 // determine residual for partition3185 3186 // determine residual for partition 3187 3187 #if H_3D_VSO 3188 Dist uiPUDistY = 0;3188 Dist uiPUDistY = 0; 3189 3189 #else 3190 UInt uiPUDistY = 0;3191 #endif 3192 UInt uiPUDistC = 0;3193 Double dPUCost = 0.0;3190 UInt uiPUDistY = 0; 3191 #endif 3192 UInt uiPUDistC = 0; 3193 Double dPUCost = 0.0; 3194 3194 #if H_3D_VSO // M36 3195 if( m_pcRdCost->getUseRenModel() )3196 {3197 m_pcRdCost->setRenModelData( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight );3198 }3195 if( m_pcRdCost->getUseRenModel() ) 3196 { 3197 m_pcRdCost->setRenModelData( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight ); 3198 } 3199 3199 #endif 3200 3200 #if H_3D_DIM_SDC 3201 3202 3203 3204 3205 3206 3201 if( pcCU->getSDCFlag(uiPartOffset) ) 3202 { 3203 pcCU->setTrIdxSubParts(0, uiPartOffset, uiDepth + uiInitTrDepth); 3204 pcCU->setCbfSubParts(1, 1, 1, uiPartOffset, uiDepth + uiInitTrDepth); 3205 3206 // start encoding with SDC 3207 3207 #if QC_GENERIC_SDC_G0122 3208 3208 xIntraCodingSDC(pcCU, uiPartOffset, pcOrgYuv, pcPredYuv, uiPUDistY, dPUCost, ( testZeroResi != 0 ), iSDCDeltaResi ); 3209 3209 #else 3210 3211 #endif 3212 3213 3214 3210 xIntraCodingSDC(pcCU, uiPartOffset, pcOrgYuv, pcPredYuv, uiPUDistY, dPUCost, (testZeroResi!=0)); 3211 #endif 3212 } 3213 else 3214 { 3215 3215 #endif 3216 3216 #if HHI_RQT_INTRA_SPEEDUP 3217 3217 #if H_3D_DIM_ENC 3218 xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, true, dPUCost, (testZeroResi != 0) );3218 xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, true, dPUCost, (testZeroResi != 0) ); 3219 3219 #else 3220 xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, true, dPUCost );3220 xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, true, dPUCost ); 3221 3221 #endif 3222 3222 #else 3223 3223 #if H_3D_DIM_ENC 3224 xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, dPUCost, (testZeroResi != 0) );3224 xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, dPUCost, (testZeroResi != 0) ); 3225 3225 #else 3226 xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, dPUCost );3226 xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, dPUCost ); 3227 3227 #endif 3228 3228 #endif 3229 3229 #if H_3D_DIM_SDC 3230 3231 #endif 3232 3233 // check r-d cost3234 if( dPUCost < dBestPUCost )3235 {3230 } 3231 #endif 3232 3233 // check r-d cost 3234 if( dPUCost < dBestPUCost ) 3235 { 3236 3236 #if HHI_RQT_INTRA_SPEEDUP_MOD 3237 uiSecondBestMode = uiBestPUMode;3238 dSecondBestPUCost = dBestPUCost;3239 #endif 3240 uiBestPUMode = uiOrgMode;3241 uiBestPUDistY = uiPUDistY;3242 uiBestPUDistC = uiPUDistC;3243 dBestPUCost = dPUCost;3244 3237 uiSecondBestMode = uiBestPUMode; 3238 dSecondBestPUCost = dBestPUCost; 3239 #endif 3240 uiBestPUMode = uiOrgMode; 3241 uiBestPUDistY = uiPUDistY; 3242 uiBestPUDistC = uiPUDistC; 3243 dBestPUCost = dPUCost; 3244 3245 3245 #if H_3D_DIM_SDC 3246 if( pcCU->getSDCFlag(uiPartOffset) )3247 {3248 bBestUseSDC = true;3249 3250 // copy reconstruction3251 pcPredYuv->copyPartToPartYuv(pcRecoYuv, uiPartOffset, uiWidth, uiHeight);3252 3253 // copy DC values3254 apBestDCOffsets[0] = pcCU->getSDCSegmentDCOffset(0, uiPartOffset);3255 apBestDCOffsets[1] = pcCU->getSDCSegmentDCOffset(1, uiPartOffset);3256 }3257 else3258 {3259 bBestUseSDC = false;3260 #endif 3261 xSetIntraResultQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcRecoYuv );3262 3263 UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> ( ( pcCU->getDepth(0) + uiInitTrDepth ) << 1 );3264 ::memcpy( m_puhQTTempTrIdx, pcCU->getTransformIdx() + uiPartOffset, uiQPartNum * sizeof( UChar ) );3265 ::memcpy( m_puhQTTempCbf[0], pcCU->getCbf( TEXT_LUMA ) + uiPartOffset, uiQPartNum * sizeof( UChar ) );3266 ::memcpy( m_puhQTTempCbf[1], pcCU->getCbf( TEXT_CHROMA_U ) + uiPartOffset, uiQPartNum * sizeof( UChar ) );3267 ::memcpy( m_puhQTTempCbf[2], pcCU->getCbf( TEXT_CHROMA_V ) + uiPartOffset, uiQPartNum * sizeof( UChar ) );3268 ::memcpy( m_puhQTTempTransformSkipFlag[0], pcCU->getTransformSkip(TEXT_LUMA) + uiPartOffset, uiQPartNum * sizeof( UChar ) );3269 ::memcpy( m_puhQTTempTransformSkipFlag[1], pcCU->getTransformSkip(TEXT_CHROMA_U) + uiPartOffset, uiQPartNum * sizeof( UChar ) );3270 ::memcpy( m_puhQTTempTransformSkipFlag[2], pcCU->getTransformSkip(TEXT_CHROMA_V) + uiPartOffset, uiQPartNum * sizeof( UChar ) );3246 if( pcCU->getSDCFlag(uiPartOffset) ) 3247 { 3248 bBestUseSDC = true; 3249 3250 // copy reconstruction 3251 pcPredYuv->copyPartToPartYuv(pcRecoYuv, uiPartOffset, uiWidth, uiHeight); 3252 3253 // copy DC values 3254 apBestDCOffsets[0] = pcCU->getSDCSegmentDCOffset(0, uiPartOffset); 3255 apBestDCOffsets[1] = pcCU->getSDCSegmentDCOffset(1, uiPartOffset); 3256 } 3257 else 3258 { 3259 bBestUseSDC = false; 3260 #endif 3261 xSetIntraResultQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcRecoYuv ); 3262 3263 UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> ( ( pcCU->getDepth(0) + uiInitTrDepth ) << 1 ); 3264 ::memcpy( m_puhQTTempTrIdx, pcCU->getTransformIdx() + uiPartOffset, uiQPartNum * sizeof( UChar ) ); 3265 ::memcpy( m_puhQTTempCbf[0], pcCU->getCbf( TEXT_LUMA ) + uiPartOffset, uiQPartNum * sizeof( UChar ) ); 3266 ::memcpy( m_puhQTTempCbf[1], pcCU->getCbf( TEXT_CHROMA_U ) + uiPartOffset, uiQPartNum * sizeof( UChar ) ); 3267 ::memcpy( m_puhQTTempCbf[2], pcCU->getCbf( TEXT_CHROMA_V ) + uiPartOffset, uiQPartNum * sizeof( UChar ) ); 3268 ::memcpy( m_puhQTTempTransformSkipFlag[0], pcCU->getTransformSkip(TEXT_LUMA) + uiPartOffset, uiQPartNum * sizeof( UChar ) ); 3269 ::memcpy( m_puhQTTempTransformSkipFlag[1], pcCU->getTransformSkip(TEXT_CHROMA_U) + uiPartOffset, uiQPartNum * sizeof( UChar ) ); 3270 ::memcpy( m_puhQTTempTransformSkipFlag[2], pcCU->getTransformSkip(TEXT_CHROMA_V) + uiPartOffset, uiQPartNum * sizeof( UChar ) ); 3271 3271 #if H_3D_DIM_SDC 3272 }3273 #endif 3274 }3272 } 3273 #endif 3274 } 3275 3275 #if HHI_RQT_INTRA_SPEEDUP_MOD 3276 else if( dPUCost < dSecondBestPUCost )3277 {3278 uiSecondBestMode = uiOrgMode;3279 dSecondBestPUCost = dPUCost;3280 }3276 else if( dPUCost < dSecondBestPUCost ) 3277 { 3278 uiSecondBestMode = uiOrgMode; 3279 dSecondBestPUCost = dPUCost; 3280 } 3281 3281 #endif 3282 3282 #if H_3D_DIM_ENC || H_3D_DIM_SDC
Note: See TracChangeset for help on using the changeset viewer.