Changeset 636 in 3DVCSoftware for branches/HTM-8.2-dev0-KWU/source/Lib
- Timestamp:
- 16 Oct 2013, 11:27:16 (12 years ago)
- Location:
- branches/HTM-8.2-dev0-KWU/source/Lib
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-8.2-dev0-KWU/source/Lib/TAppCommon/TAppComCamPara.cpp
r635 r636 1530 1530 #if KWU_RC_MADPRED_E0227 1531 1531 Void 1532 TAppComCamPara:: RCGetZNearZFar( Int iView, UInt uiFrame, Double& rdZNear, Double& rdZFar )1532 TAppComCamPara::getZNearZFar( Int iView, UInt uiFrame, Double& rdZNear, Double& rdZFar ) 1533 1533 { 1534 1534 UInt uiFoundLine = -1; … … 1547 1547 1548 1548 Void 1549 TAppComCamPara:: RCGetGeometryData( Int iView, UInt uiFrame, Double& rdFocalLength, Double& rdPosition, Double& rdCameraShift, Bool& rbInterpolated )1549 TAppComCamPara::getGeometryData( Int iView, UInt uiFrame, Double& rdFocalLength, Double& rdPosition, Double& rdCameraShift, Bool& rbInterpolated ) 1550 1550 { 1551 1551 UInt uiFoundLine = -1; -
branches/HTM-8.2-dev0-KWU/source/Lib/TAppCommon/TAppComCamPara.h
r635 r636 222 222 223 223 #if KWU_RC_MADPRED_E0227 224 Void RCGetZNearZFar ( Int iView, UInt uiFrame, Double& rdZNear, Double& rdZFar );225 Void RCGetGeometryData ( Int dView, UInt uiFrame, Double& rdFocalLength, Double& rdPosition, Double& rdCameraShift, Bool& rbInterpolated );224 Void getZNearZFar ( Int iView, UInt uiFrame, Double& rdZNear, Double& rdZFar ); 225 Void getGeometryData ( Int dView, UInt uiFrame, Double& rdFocalLength, Double& rdPosition, Double& rdCameraShift, Bool& rbInterpolated ); 226 226 #endif 227 227 }; -
branches/HTM-8.2-dev0-KWU/source/Lib/TLibCommon/TypeDef.h
r635 r636 310 310 #define RATE_CONTROL_INTRA 1 ///< JCTVC-M0257, rate control for intra 311 311 #endif 312 #define KWU_RC_VIEWRC_E0227 0///< JCT3V-E0227, view-wise target bitrate allocation313 #define KWU_RC_MADPRED_E0227 0///< JCT3V-E0227, inter-view MAD prediction312 #define KWU_RC_VIEWRC_E0227 1 ///< JCT3V-E0227, view-wise target bitrate allocation 313 #define KWU_RC_MADPRED_E0227 1 ///< JCT3V-E0227, inter-view MAD prediction 314 314 315 315 #define MAX_CPB_CNT 32 ///< Upper bound of (cpb_cnt_minus1 + 1) -
branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncCu.cpp
r635 r636 242 242 243 243 m_bUseSBACRD = pcEncTop->getUseSBACRD(); 244 245 #if KWU_RC_MADPRED_E0227 244 246 if(!pcEncTop->getIsDepth()) 247 { 245 248 m_pcRateCtrl = pcEncTop->getRateCtrl(); 249 } 246 250 else 247 251 { 248 252 m_pcRateCtrl = NULL; 249 253 } 254 #else 255 m_pcRateCtrl = pcEncTop->getRateCtrl(); 256 #endif 250 257 } 251 258 … … 2124 2131 #endif 2125 2132 2126 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT 2127 #if KWU_RC_MADPRED_E0227 2133 #if RATE_CONTROL_LAMBDA_DOMAIN && (!M0036_RC_IMPROVEMENT || KWU_RC_MADPRED_E0227) 2128 2134 if ( m_pcEncCfg->getUseRateCtrl() && m_pcEncCfg->getLCULevelRC() && ePartSize == SIZE_2Nx2N && uhDepth <= m_addSADDepth ) 2129 2135 { … … 2133 2139 m_temporalSAD = (Int)SAD; 2134 2140 } 2135 #endif2136 2141 #endif 2137 2142 #if !RATE_CONTROL_LAMBDA_DOMAIN && KWU_RC_MADPRED_E0227 … … 2268 2273 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 2269 2274 2270 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT 2271 #if KWU_RC_MADPRED_E0227 2275 #if RATE_CONTROL_LAMBDA_DOMAIN && (!M0036_RC_IMPROVEMENT || KWU_RC_MADPRED_E0227) 2272 2276 UChar uhDepth = rpcTempCU->getDepth( 0 ); 2273 2277 if ( m_pcEncCfg->getUseRateCtrl() && m_pcEncCfg->getLCULevelRC() && eSize == SIZE_2Nx2N && uhDepth <= m_addSADDepth ) … … 2278 2282 m_spatialSAD = (Int)SAD; 2279 2283 } 2280 #endif2281 2284 #endif 2282 2285 #if !RATE_CONTROL_LAMBDA_DOMAIN && KWU_RC_MADPRED_E0227 -
branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncGOP.cpp
r635 r636 984 984 #if KWU_RC_MADPRED_E0227 985 985 if(m_pcCfg->getLayerId() != 0) 986 { 986 987 m_pcRateCtrl->getRCPic()->setIVPic( m_pcEncTop->getEncTop()->getTEncTop(0)->getRateCtrl()->getRCPic() ); 987 //getEncTop()->getEncTop();//->getTEncTop(0);//->getUseRateCtrl()->getRCPic();988 } 988 989 #endif 989 990 … … 1037 1038 list<TEncRCPic*> listPreviousPicture = m_pcRateCtrl->getPicList(); 1038 1039 lambda = m_pcRateCtrl->getRCPic()->estimatePicLambdaIV( listPreviousPicture, pcSlice->getPOC() ); 1039 //printf("lambda : %lf\n", lambda);1040 1040 sliceQP = m_pcRateCtrl->getRCPic()->estimatePicQP( lambda, listPreviousPicture ); 1041 1041 } -
branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncRateCtrl.cpp
r635 r636 726 726 m_lastPicture = NULL; 727 727 list<TEncRCPic*>::reverse_iterator it; 728 #if KWU_RC_MADPRED_E0227 728 729 for ( it = listPreviousPictures.rbegin(); it != listPreviousPictures.rend(); it++ ) 729 730 { … … 734 735 } 735 736 } 737 #endif 736 738 #endif 737 739 … … 1092 1094 { 1093 1095 Pel* pOrg = pcCU->getSlice()->getIvPic(false, 0)->getPicYuvOrg()->getLumaAddr(pcCU->getAddr(), 0); 1094 Pel* pRec = pcCU->getSlice()->getIvPic(false, 0)->getPicYuv Pred()->getLumaAddr(pcCU->getAddr(), 0);1096 Pel* pRec = pcCU->getSlice()->getIvPic(false, 0)->getPicYuvRec()->getLumaAddr(pcCU->getAddr(), 0); 1095 1097 Pel* pDep = pcCU->getSlice()->getIvPic(true, pcCU->getSlice()->getViewIndex())->getPicYuvOrg()->getLumaAddr(pcCU->getAddr(), 0); 1096 1098 Int iStride = pcCU->getSlice()->getIvPic(true, pcCU->getSlice()->getViewIndex())->getPicYuvOrg()->getStride(); … … 1121 1123 pcCU->getPosInPic(0, PosX, PosY); 1122 1124 if((PosX + *iDisparity) < 0 || (PosX + *iDisparity + iWidth) >= pcCU->getSlice()->getSPS()->getMaxCUWidth()) 1125 { 1123 1126 Disp = 0; 1127 } 1124 1128 1125 1129 for( y = 0; y < iHeight; y++ ) … … 1138 1142 m_LCUs[ LCUIdx ].m_IVMAD = IVMAD; 1139 1143 if(m_lastPicture) 1144 { 1140 1145 m_LCUs[ LCUIdx ].m_MAD = m_lastPicture->getLCU(LCUIdx).m_MAD; 1146 } 1141 1147 1142 1148 MAD = m_LCUs[ LCUIdx ].m_IVMAD; … … 2076 2082 m_sourceHeightInLCU = (sourceHeight / maxCUHeight) + (( sourceHeight % maxCUHeight) ? 1 : 0); 2077 2083 m_isLowdelay = (sizeIntraPeriod == -1) ? true : false; 2084 #if KWU_RC_MADPRED_E0227 2078 2085 m_prevBitrate = ( targetKbps * 1000 ); // in units of 1,024 bps 2079 2086 m_currBitrate = ( targetKbps * 1000 ); 2087 #else 2088 m_prevBitrate = ( targetKbps << 10 ); // in units of 1,024 bps 2089 m_currBitrate = ( targetKbps << 10 ); 2090 #endif 2080 2091 m_frameRate = frameRate; 2081 2092 m_refFrameNum = m_isLowdelay ? (sizeGOP) : (sizeGOP>>1); … … 2453 2464 2454 2465 Pel* pOrg = pcCU->getPic()->getPicYuvOrg()->getLumaAddr(pcCU->getAddr(), 0); 2455 Pel* pRec = pcCU->getPic()->getPicYuv Pred()->getLumaAddr(pcCU->getAddr(), 0);2466 Pel* pRec = pcCU->getPic()->getPicYuvRec()->getLumaAddr(pcCU->getAddr(), 0); 2456 2467 Int stride = pcCU->getPic()->getStride(); 2457 2468 … … 2483 2494 2484 2495 Pel* pOrg = pcCU->getSlice()->getIvPic(false, 0)->getPicYuvOrg()->getLumaAddr(pcCU->getAddr(), 0); 2485 Pel* pRec = pcCU->getSlice()->getIvPic(false, 0)->getPicYuv Pred()->getLumaAddr(pcCU->getAddr(), 0);2496 Pel* pRec = pcCU->getSlice()->getIvPic(false, 0)->getPicYuvRec()->getLumaAddr(pcCU->getAddr(), 0); 2486 2497 Pel* pDep = pcCU->getSlice()->getIvPic(true, pcCU->getSlice()->getViewIndex())->getPicYuvOrg()->getLumaAddr(pcCU->getAddr(), 0); 2487 2498 Int iStride = pcCU->getSlice()->getIvPic(true, pcCU->getSlice()->getViewIndex())->getPicYuvOrg()->getStride(); -
branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncSlice.cpp
r635 r636 157 157 m_pdRdPicQp = (Double*)xMalloc( Double, m_pcCfg->getDeltaQpRD() * 2 + 1 ); 158 158 m_piRdPicQp = (Int* )xMalloc( Int, m_pcCfg->getDeltaQpRD() * 2 + 1 ); 159 #if KWU_RC_MADPRED_E0227 159 160 if(m_pcCfg->getUseRateCtrl()) 161 { 160 162 m_pcRateCtrl = pcEncTop->getRateCtrl(); 163 } 161 164 else 165 { 162 166 m_pcRateCtrl = NULL; 167 } 168 #else 169 m_pcRateCtrl = pcEncTop->getRateCtrl(); 170 #endif 163 171 } 164 172 … … 1136 1144 Int Direction = pcSlice->getViewId() - pcCU->getSlice()->getIvPic(false, 0)->getViewId(); 1137 1145 1138 pcEncTop->getCamParam()-> RCGetZNearZFar(pcSlice->getViewId(), pcSlice->getPOC(), Zn, Zf);1139 pcEncTop->getCamParam()-> RCGetGeometryData(0, pcSlice->getPOC(), FocalLength, BasePos, CamShift, bInterpolated);1140 pcEncTop->getCamParam()-> RCGetGeometryData(pcSlice->getViewId(), pcSlice->getPOC(), FocalLength, Position, CamShift, bInterpolated);1146 pcEncTop->getCamParam()->getZNearZFar(pcSlice->getViewId(), pcSlice->getPOC(), Zn, Zf); 1147 pcEncTop->getCamParam()->getGeometryData(0, pcSlice->getPOC(), FocalLength, BasePos, CamShift, bInterpolated); 1148 pcEncTop->getCamParam()->getGeometryData(pcSlice->getViewId(), pcSlice->getPOC(), FocalLength, Position, CamShift, bInterpolated); 1141 1149 1142 1150 m_pcRateCtrl->updateLCUDataEnhancedView(pcCU, pcCU->getTotalBits(), pcCU->getQP(0), BasePos, Position, FocalLength, Zn, Zf, (Direction > 0 ? 1 : -1)); … … 1250 1258 Int iDisparity; 1251 1259 1252 pcEncTop->getCamParam()-> RCGetZNearZFar(pcSlice->getViewId(), pcSlice->getPOC(), Zn, Zf);1253 pcEncTop->getCamParam()-> RCGetGeometryData(0, pcSlice->getPOC(), FocalLength, BasePos, CamShift, bInterpolated);1254 pcEncTop->getCamParam()-> RCGetGeometryData(pcSlice->getViewId(), pcSlice->getPOC(), FocalLength, Position, CamShift, bInterpolated);1260 pcEncTop->getCamParam()->getZNearZFar(pcSlice->getViewId(), pcSlice->getPOC(), Zn, Zf); 1261 pcEncTop->getCamParam()->getGeometryData(0, pcSlice->getPOC(), FocalLength, BasePos, CamShift, bInterpolated); 1262 pcEncTop->getCamParam()->getGeometryData(pcSlice->getViewId(), pcSlice->getPOC(), FocalLength, Position, CamShift, bInterpolated); 1255 1263 bpp = m_pcRateCtrl->getRCPic()->getLCUTargetBppforInterView( m_pcRateCtrl->getPicList(), pcCU, 1256 1264 BasePos, Position, FocalLength, Zn, Zf, (Direction > 0 ? 1 : -1), &iDisparity );
Note: See TracChangeset for help on using the changeset viewer.