Changeset 638 in 3DVCSoftware for branches/HTM-8.2-dev0-KWU/source
- Timestamp:
- 18 Oct 2013, 04:44:23 (11 years ago)
- Location:
- branches/HTM-8.2-dev0-KWU/source
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-8.2-dev0-KWU/source/App/TAppEncoder/TAppEncCfg.cpp
r637 r638 84 84 85 85 #if KWU_RC_MADPRED_E0227 86 m_ DepthMADPred = 0;86 m_depthMADPred = 0; 87 87 #endif 88 88 } … … 600 600 601 601 #if KWU_RC_VIEWRC_E0227 602 ("ViewWiseTargetBits, -vtbr" , m_ ViewTargetBits, std::vector<Int>(1, 32), "View-wise target bit-rate setting")603 ("TargetBitAssign, -ta", m_ ViewWiseRateCtrl, false, "View-wise rate control on/off")602 ("ViewWiseTargetBits, -vtbr" , m_viewTargetBits, std::vector<Int>(1, 32), "View-wise target bit-rate setting") 603 ("TargetBitAssign, -ta", m_viewWiseRateCtrl, false, "View-wise rate control on/off") 604 604 #endif 605 605 #if KWU_RC_MADPRED_E0227 606 ("DepthMADPred, -dm", m_ DepthMADPred, (UInt)0, "Depth based MAD prediction on/off")606 ("DepthMADPred, -dm", m_depthMADPred, (UInt)0, "Depth based MAD prediction on/off") 607 607 #endif 608 608 #else … … 612 612 613 613 #if KWU_RC_VIEWRC_E0227 614 ("ViewWiseTargetBits, -vtbr" , m_ ViewTargetBits, std::vector<Int>(1, 32), "View-wise target bit-rate setting")615 ("TargetBitAssign, -ta", m_ ViewWiseRateCtrl, false, "View-wise rate control on/off")614 ("ViewWiseTargetBits, -vtbr" , m_viewTargetBits, std::vector<Int>(1, 32), "View-wise target bit-rate setting") 615 ("TargetBitAssign, -ta", m_viewWiseRateCtrl, false, "View-wise rate control on/off") 616 616 #endif 617 617 #if KWU_RC_MADPRED_E0227 618 ("DepthMADPred, -dm", m_ DepthMADPred, (UInt)0, "Depth based MAD prediction on/off")618 ("DepthMADPred, -dm", m_depthMADPred, (UInt)0, "Depth based MAD prediction on/off") 619 619 #endif 620 620 #endif … … 2325 2325 2326 2326 #if KWU_RC_MADPRED_E0227 2327 printf("Depth based MAD prediction : %d\n", m_ DepthMADPred);2327 printf("Depth based MAD prediction : %d\n", m_depthMADPred); 2328 2328 #endif 2329 2329 #if KWU_RC_VIEWRC_E0227 2330 printf("View-wise Rate control : %d\n", m_ ViewWiseRateCtrl);2331 if(m_ ViewWiseRateCtrl)2330 printf("View-wise Rate control : %d\n", m_viewWiseRateCtrl); 2331 if(m_viewWiseRateCtrl) 2332 2332 { 2333 2333 2334 2334 printf("ViewWiseTargetBits : "); 2335 for ( int i = 0 ; i < m_iNumberOfViews ; i++)2336 printf("%d ", m_ ViewTargetBits[i]);2335 for (Int i = 0 ; i < m_iNumberOfViews ; i++) 2336 printf("%d ", m_viewTargetBits[i]); 2337 2337 printf("\n"); 2338 2338 } … … 2351 2351 2352 2352 #if KWU_RC_MADPRED_E0227 2353 printf("Depth based MAD prediction : %d\n", m_ DepthMADPred);2353 printf("Depth based MAD prediction : %d\n", m_depthMADPred); 2354 2354 #endif 2355 2355 #if KWU_RC_VIEWRC_E0227 2356 printf("View-wise Rate control : %d\n", m_ ViewWiseRateCtrl);2357 if(m_ ViewWiseRateCtrl)2356 printf("View-wise Rate control : %d\n", m_viewWiseRateCtrl); 2357 if(m_viewWiseRateCtrl) 2358 2358 { 2359 2359 2360 2360 printf("ViewWiseTargetBits : "); 2361 for ( int i = 0 ; i < m_iNumberOfViews ; i++)2362 printf("%d ", m_ ViewTargetBits[i]);2361 for (Int i = 0 ; i < m_iNumberOfViews ; i++) 2362 printf("%d ", m_viewTargetBits[i]); 2363 2363 printf("\n"); 2364 2364 } -
branches/HTM-8.2-dev0-KWU/source/App/TAppEncoder/TAppEncCfg.h
r636 r638 369 369 370 370 #if KWU_RC_VIEWRC_E0227 371 vector<Int> m_ ViewTargetBits;372 bool m_ViewWiseRateCtrl; ///< Flag for using view-wise rate control371 vector<Int> m_viewTargetBits; 372 Bool m_viewWiseRateCtrl; ///< Flag for using view-wise rate control 373 373 #endif 374 374 #if KWU_RC_MADPRED_E0227 375 UInt m_ DepthMADPred;375 UInt m_depthMADPred; 376 376 #endif 377 377 #else … … 381 381 382 382 #if KWU_RC_VIEWRC_E0227 383 vector<Int> m_ ViewTargetBits;384 bool m_ViewWiseRateCtrl; ///< Flag for using view-wise rate control383 vector<Int> m_viewTargetBits; 384 Bool m_viewWiseRateCtrl; ///< Flag for using view-wise rate control 385 385 #endif 386 386 #if KWU_RC_MADPRED_E0227 387 UInt m_ DepthMADPred;387 UInt m_depthMADPred; 388 388 #endif 389 389 #endif -
branches/HTM-8.2-dev0-KWU/source/App/TAppEncoder/TAppEncTop.cpp
r637 r638 536 536 if(m_cTEncTop.getUseRateCtrl() && !m_cTEncTop.getIsDepth()) 537 537 { 538 m_cTEncTop.setUseDepthMADPred(layerIdInVps ? m_ DepthMADPred : 0);538 m_cTEncTop.setUseDepthMADPred(layerIdInVps ? m_depthMADPred : 0); 539 539 540 540 if(m_cTEncTop.getUseDepthMADPred()) … … 547 547 if(m_cTEncTop.getUseRateCtrl() && !m_cTEncTop.getIsDepth()) 548 548 { 549 m_cTEncTop.setUseViewWiseRateCtrl(m_ ViewWiseRateCtrl);549 m_cTEncTop.setUseViewWiseRateCtrl(m_viewWiseRateCtrl); 550 550 551 551 if(m_iNumberOfViews == 1) 552 552 { 553 if(m_ ViewWiseRateCtrl)554 { 555 m_cTEncTop.setTargetBitrate(m_ ViewTargetBits[layerIdInVps>>1]);553 if(m_viewWiseRateCtrl) 554 { 555 m_cTEncTop.setTargetBitrate(m_viewTargetBits[layerIdInVps>>1]); 556 556 } 557 557 else … … 562 562 else 563 563 { 564 if(m_ ViewWiseRateCtrl)565 { 566 m_cTEncTop.setTargetBitrate(m_ ViewTargetBits[layerIdInVps>>1]);564 if(m_viewWiseRateCtrl) 565 { 566 m_cTEncTop.setTargetBitrate(m_viewTargetBits[layerIdInVps>>1]); 567 567 } 568 568 else … … 624 624 if(m_cTEncTop.getUseRateCtrl() && !m_cTEncTop.getIsDepth()) 625 625 { 626 m_cTEncTop.setUseDepthMADPred(layerIdInVps ? m_ DepthMADPred : 0);626 m_cTEncTop.setUseDepthMADPred(layerIdInVps ? m_depthMADPred : 0); 627 627 628 628 if(m_cTEncTop.getUseDepthMADPred()) … … 636 636 if(m_cTEncTop.getUseRateCtrl() && !m_cTEncTop.getIsDepth()) 637 637 { 638 m_cTEncTop.setUseViewWiseRateCtrl(m_ ViewWiseRateCtrl);638 m_cTEncTop.setUseViewWiseRateCtrl(m_viewWiseRateCtrl); 639 639 if(m_iNumberOfViews == 1) 640 640 { 641 if(m_ ViewWiseRateCtrl)642 { 643 m_cTEncTop.setTargetBitrate(m_ ViewTargetBits[layerIdInVps>>1]);641 if(m_viewWiseRateCtrl) 642 { 643 m_cTEncTop.setTargetBitrate(m_viewTargetBits[layerIdInVps>>1]); 644 644 } 645 645 else … … 650 650 else 651 651 { 652 if(m_ ViewWiseRateCtrl)653 { 654 m_cTEncTop.setTargetBitrate(m_ ViewTargetBits[layerIdInVps>>1]);652 if(m_viewWiseRateCtrl) 653 { 654 m_cTEncTop.setTargetBitrate(m_viewTargetBits[layerIdInVps>>1]); 655 655 } 656 656 else -
branches/HTM-8.2-dev0-KWU/source/Lib/TLibCommon/TypeDef.h
r637 r638 302 302 #endif 303 303 304 #define RATE_CONTROL_LAMBDA_DOMAIN 1///< JCTVC-K0103, rate control by R-lambda model304 #define RATE_CONTROL_LAMBDA_DOMAIN 0 ///< JCTVC-K0103, rate control by R-lambda model 305 305 #define M0036_RC_IMPROVEMENT 1 ///< JCTVC-M0036, improvement for R-lambda model based rate control 306 306 #define TICKET_1090_FIX 1 -
branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncCfg.h
r635 r638 312 312 313 313 #if KWU_RC_MADPRED_E0227 314 UInt m_ uiDepthMADPred;314 UInt m_depthMADPred; 315 315 #endif 316 316 #if KWU_RC_VIEWRC_E0227 … … 323 323 324 324 #if KWU_RC_MADPRED_E0227 325 UInt m_ uiDepthMADPred;325 UInt m_depthMADPred; 326 326 #endif 327 327 #if KWU_RC_VIEWRC_E0227 … … 842 842 843 843 #if KWU_RC_MADPRED_E0227 844 UInt getUseDepthMADPred () { return m_ uiDepthMADPred; }845 Void setUseDepthMADPred (UInt b) { m_ uiDepthMADPred = b; }844 UInt getUseDepthMADPred () { return m_depthMADPred; } 845 Void setUseDepthMADPred (UInt b) { m_depthMADPred = b; } 846 846 #endif 847 847 #if KWU_RC_VIEWRC_E0227 … … 858 858 859 859 #if KWU_RC_MADPRED_E0227 860 UInt getUseDepthMADPred () { return m_ uiDepthMADPred; }861 Void setUseDepthMADPred (UInt b) { m_ uiDepthMADPred = b; }860 UInt getUseDepthMADPred () { return m_depthMADPred; } 861 Void setUseDepthMADPred (UInt b) { m_depthMADPred = b; } 862 862 #endif 863 863 #if KWU_RC_VIEWRC_E0227 -
branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncCu.cpp
r637 r638 103 103 104 104 m_bEncodeDQP = false; 105 #if RATE_CONTROL_LAMBDA_DOMAIN && (!M0036_RC_IMPROVEMENT || KWU_RC_MADPRED_E0227) 105 #if RATE_CONTROL_LAMBDA_DOMAIN 106 #if !M0036_RC_IMPROVEMENT 107 m_LCUPredictionSAD = 0; 108 m_addSADDepth = 0; 109 m_temporalSAD = 0; 110 #endif 111 #if M0036_RC_IMPROVEMENT && KWU_RC_MADPRED_E0227 112 m_LCUPredictionSAD = 0; 113 m_addSADDepth = 0; 114 m_temporalSAD = 0; 115 #endif 116 #endif 117 #if KWU_RC_MADPRED_E0227 106 118 m_LCUPredictionSAD = 0; 107 119 m_addSADDepth = 0; … … 257 269 m_ppcTempCU[0]->initCU( rpcCU->getPic(), rpcCU->getAddr() ); 258 270 259 #if (RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT) || KWU_RC_MADPRED_E0227 271 #if RATE_CONTROL_LAMBDA_DOMAIN 272 #if !M0036_RC_IMPROVEMENT 273 m_LCUPredictionSAD = 0; 260 274 m_addSADDepth = 0; 275 m_temporalSAD = 0; 276 #endif 277 #if M0036_RC_IMPROVEMENT && KWU_RC_MADPRED_E0227 261 278 m_LCUPredictionSAD = 0; 279 m_addSADDepth = 0; 280 m_temporalSAD = 0; 281 #endif 282 #endif 283 #if KWU_RC_MADPRED_E0227 284 m_LCUPredictionSAD = 0; 285 m_addSADDepth = 0; 262 286 m_temporalSAD = 0; 263 287 m_spatialSAD = 0; … … 673 697 } 674 698 675 #if (RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT) || KWU_RC_MADPRED_E0227699 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT 676 700 if ( uiDepth <= m_addSADDepth ) 677 701 { … … 679 703 m_addSADDepth = uiDepth; 680 704 } 705 #endif 706 #if RATE_CONTROL_LAMBDA_DOMAIN && M0036_RC_IMPROVEMENT && KWU_RC_MADPRED_E0227 707 if ( uiDepth <= m_addSADDepth ) 708 { 709 m_LCUPredictionSAD += m_temporalSAD; 710 m_addSADDepth = uiDepth; 711 } 712 #endif 713 #if !RATE_CONTROL_LAMBDA_DOMAIN && KWU_RC_MADPRED_E0227 714 if ( uiDepth <= m_addSADDepth ) 715 { 716 m_LCUPredictionSAD += m_temporalSAD; 717 m_addSADDepth = uiDepth; 718 } 681 719 #endif 682 720 #if !RATE_CONTROL_LAMBDA_DOMAIN && KWU_FIX_URQ … … 1022 1060 { 1023 1061 xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_2Nx2N ); 1024 #if (RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT) || KWU_RC_MADPRED_E0227 1062 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT 1063 if ( uiDepth <= m_addSADDepth ) 1064 { 1065 m_LCUPredictionSAD += m_spatialSAD; 1066 m_addSADDepth = uiDepth; 1067 } 1068 #elif RATE_CONTROL_LAMBDA_DOMAIN && KWU_RC_MADPRED_E0227 1069 if ( uiDepth <= m_addSADDepth ) 1070 { 1071 m_LCUPredictionSAD += m_spatialSAD; 1072 m_addSADDepth = uiDepth; 1073 } 1074 #endif 1075 #if !RATE_CONTROL_LAMBDA_DOMAIN && KWU_RC_MADPRED_E0227 1025 1076 if ( uiDepth <= m_addSADDepth ) 1026 1077 { … … 2261 2312 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 2262 2313 2263 #if RATE_CONTROL_LAMBDA_DOMAIN && (!M0036_RC_IMPROVEMENT || KWU_RC_MADPRED_E0227) 2314 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT 2315 UChar uhDepth = rpcTempCU->getDepth( 0 ); 2316 if ( m_pcEncCfg->getUseRateCtrl() && m_pcEncCfg->getLCULevelRC() && eSize == SIZE_2Nx2N && uhDepth <= m_addSADDepth ) 2317 { 2318 UInt SAD = m_pcRdCost->getSADPart( g_bitDepthY, m_ppcPredYuvTemp[uhDepth]->getLumaAddr(), m_ppcPredYuvTemp[uhDepth]->getStride(), 2319 m_ppcOrigYuv[uhDepth]->getLumaAddr(), m_ppcOrigYuv[uhDepth]->getStride(), 2320 rpcTempCU->getWidth(0), rpcTempCU->getHeight(0) ); 2321 m_spatialSAD = (Int)SAD; 2322 } 2323 #elif RATE_CONTROL_LAMBDA_DOMAIN && KWU_RC_MADPRED_E0227 2264 2324 UChar uhDepth = rpcTempCU->getDepth( 0 ); 2265 2325 if ( m_pcEncCfg->getUseRateCtrl() && m_pcEncCfg->getLCULevelRC() && eSize == SIZE_2Nx2N && uhDepth <= m_addSADDepth ) -
branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncCu.h
r635 r638 102 102 Bool m_bUseSBACRD; 103 103 TEncRateCtrl* m_pcRateCtrl; 104 #if (RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT) || KWU_RC_MADPRED_E0227 104 #if RATE_CONTROL_LAMBDA_DOMAIN 105 #if !M0036_RC_IMPROVEMENT 106 UInt m_LCUPredictionSAD; 107 Int m_addSADDepth; 108 Int m_temporalSAD; 109 #endif 110 #if M0036_RC_IMPROVEMENT && KWU_RC_MADPRED_E0227 111 UInt m_LCUPredictionSAD; 112 Int m_addSADDepth; 113 Int m_temporalSAD; 114 #endif 115 #endif 116 #if KWU_RC_MADPRED_E0227 105 117 UInt m_LCUPredictionSAD; 106 118 Int m_addSADDepth; … … 108 120 Int m_spatialSAD; 109 121 #endif 122 110 123 public: 111 124 /// copy parameters from encoder class -
branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncRateCtrl.cpp
r637 r638 726 726 m_lastPicture = NULL; 727 727 list<TEncRCPic*>::reverse_iterator it; 728 #if KWU_RC_MADPRED_E0227729 728 for ( it = listPreviousPictures.rbegin(); it != listPreviousPictures.rend(); it++ ) 730 729 { … … 735 734 } 736 735 } 737 #endif738 736 #endif 739 737 … … 2486 2484 { 2487 2485 Int x, y; 2488 double dMAD = 0.0;2486 Double dMAD = 0.0; 2489 2487 Int Sum = 0; 2490 2488 Double SAD = 0.0; -
branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncSlice.cpp
r637 r638 1139 1139 if(pcSlice->getLayerId() != 0 && m_pcCfg->getUseDepthMADPred() && !pcSlice->getIsDepth()) 1140 1140 { 1141 double zn, zf, focallength, position, camshift;1142 double basepos;1143 bool bInterpolated;1141 Double zn, zf, focallength, position, camshift; 1142 Double basepos; 1143 Bool bInterpolated; 1144 1144 Int direction = pcSlice->getViewId() - pcCU->getSlice()->getIvPic(false, 0)->getViewId(); 1145 1145 … … 1252 1252 if(pcSlice->getLayerId() != 0 && m_pcCfg->getUseDepthMADPred() && !pcSlice->getIsDepth()) 1253 1253 { 1254 double zn, zf, focallength, position, camShift;1255 double basePos;1256 bool bInterpolated;1254 Double zn, zf, focallength, position, camShift; 1255 Double basePos; 1256 Bool bInterpolated; 1257 1257 Int direction = pcSlice->getViewId() - pcCU->getSlice()->getIvPic(false, 0)->getViewId(); 1258 1258 Int disparity;
Note: See TracChangeset for help on using the changeset viewer.