Changeset 635 in 3DVCSoftware for branches/HTM-8.2-dev0-KWU
- Timestamp:
- 14 Oct 2013, 20:13:58 (11 years ago)
- Location:
- branches/HTM-8.2-dev0-KWU
- Files:
-
- 4 added
- 1 deleted
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-8.2-dev0-KWU/cfg/3D-HEVC/baseCfg_3view+depth.cfg
r622 r635 224 224 RCForceIntraQP : 0 # Rate control: force intra QP to be equal to initial QP 225 225 226 DepthMADPred : 0 # 0: Disable Depth based MAD prediction for extended view 1: Enable Depth based MAD prediction for extended view 227 TargetBitAssign : 0 # Manual assignment of target bit-rate 228 ViewWiseTargetBits : 950000 315000 358000 # View-wise target bit-rate setting 229 230 #============ Rate Control URQ ====================== 231 #RateControl : 0 # 0: Disable rate control 1: Enable rate control with total target 232 #DepthMADPred : 0 # 0: Disable Depth based MAD prediction for extended view 1: Enable Depth based MAD prediction for extended view 233 #TargetBitAssign : 0 # Manual assignment of target bit-rate 234 #ViewWiseTargetBits : 952 315 360 # View-wise target bit-rate setting 235 #TargetBitrate : 1500 # input target bitrate when RateCtrl is enable 236 #NumLCUInUnit : 1 # Number of LCU in an Unit. Fraction is not allowed 237 226 238 #========== multiview coding tools ========== 227 239 IvMvPred : 1 # Inter-view motion prediction -
branches/HTM-8.2-dev0-KWU/cfg/3D-HEVC/fullCfg.cfg
r622 r635 230 230 RCForceIntraQP : 0 # Rate control: force intra QP to be equal to initial QP 231 231 232 DepthMADPred : 0 # 0: Disable Depth based MAD prediction for extended view 1: Enable Depth based MAD prediction for extended view 233 TargetBitAssign : 0 # Manual assignment of target bit-rate 234 ViewWiseTargetBits : 950000 315000 358000 # View-wise target bit-rate setting 235 236 #============ Rate Control URQ ====================== 237 #RateControl : 0 # 0: Disable rate control 1: Enable rate control with total target 238 #DepthMADPred : 0 # 0: Disable Depth based MAD prediction for extended view 1: Enable Depth based MAD prediction for extended view 239 #TargetBitAssign : 0 # Manual assignment of target bit-rate 240 #ViewWiseTargetBits : 952 315 360 # View-wise target bit-rate setting 241 #TargetBitrate : 1500 # input target bitrate when RateCtrl is enable 242 #NumLCUInUnit : 1 # Number of LCU in an Unit. Fraction is not allowed 243 232 244 #========== multiview coding tools ========== 233 245 IvMvPred : 1 # Inter-view motion prediction -
branches/HTM-8.2-dev0-KWU/source/App/TAppEncoder/TAppEncCfg.cpp
r630 r635 82 82 m_codedPivotValue = NULL; 83 83 m_targetPivotValue = NULL; 84 85 #if KWU_RC_MADPRED_E0227 86 m_uiDepthMADPred = 0; 87 #endif 84 88 } 85 89 … … 594 598 ( "InitialQP", m_RCInitialQP, 0, "Rate control: initial QP" ) 595 599 ( "RCForceIntraQP", m_RCForceIntraQP, false, "Rate control: force intra QP to be equal to initial QP" ) 596 #else 597 ("RateCtrl,-rc", m_enableRateCtrl, false, "Rate control on/off") 600 601 #if KWU_RC_VIEWRC_E0227 602 ("ViewWiseTargetBits, -vtbr" , m_pchViewTargetBits, std::vector<Int>(1, 32), "View-wise target bit-rate setting") 603 ("TargetBitAssign, -ta", m_bViewWiseRateCtrl, false, "View-wise rate control on/off") 604 #endif 605 #if KWU_RC_MADPRED_E0227 606 ("DepthMADPred, -dm", m_uiDepthMADPred, (UInt)0, "Depth based MAD prediction on/off") 607 #endif 608 #else 609 ("RateControl,-rc", m_enableRateCtrl, false, "Rate control on/off") 598 610 ("TargetBitrate,-tbr", m_targetBitrate, 0, "Input target bitrate") 599 611 ("NumLCUInUnit,-nu", m_numLCUInUnit, 0, "Number of LCUs in an Unit") 612 613 #if KWU_RC_VIEWRC_E0227 614 ("ViewWiseTargetBits, -vtbr" , m_pchViewTargetBits, std::vector<Int>(1, 32), "View-wise target bit-rate setting") 615 ("TargetBitAssign, -ta", m_bViewWiseRateCtrl, false, "View-wise rate control on/off") 616 #endif 617 #if KWU_RC_MADPRED_E0227 618 ("DepthMADPred, -dm", m_uiDepthMADPred, (UInt)0, "Depth based MAD prediction on/off") 619 #endif 600 620 #endif 601 621 … … 2159 2179 xConfirmPara( (numLCUInPic % m_numLCUInUnit) != 0, "total number of LCUs in a frame should be completely divided by NumLCUInUnit" ); 2160 2180 2161 m_iMaxDeltaQP = MAX_DELTA_QP;2181 //m_iMaxDeltaQP = MAX_DELTA_QP; 2162 2182 m_iMaxCuDQPDepth = MAX_CUDQP_DEPTH; 2163 2183 } … … 2301 2321 printf("InitialQP : %d\n", m_RCInitialQP ); 2302 2322 printf("ForceIntraQP : %d\n", m_RCForceIntraQP ); 2323 2324 #if KWU_RC_MADPRED_E0227 2325 printf("Depth based MAD prediction : %d\n", m_uiDepthMADPred); 2326 #endif 2327 #if KWU_RC_VIEWRC_E0227 2328 printf("View-wise Rate control : %d\n", m_bViewWiseRateCtrl); 2329 if(m_bViewWiseRateCtrl) 2330 { 2331 2332 printf("ViewWiseTargetBits : "); 2333 for (int i = 0 ; i < m_iNumberOfViews ; i++) 2334 printf("%d ", m_pchViewTargetBits[i]); 2335 printf("\n"); 2336 } 2337 else 2338 { 2339 printf("TargetBitrate : %d\n", m_RCTargetBitrate ); 2340 } 2341 #endif 2303 2342 } 2304 2343 #else … … 2308 2347 printf("TargetBitrate : %d\n", m_targetBitrate); 2309 2348 printf("NumLCUInUnit : %d\n", m_numLCUInUnit); 2349 2350 #if KWU_RC_MADPRED_E0227 2351 printf("Depth based MAD prediction : %d\n", m_uiDepthMADPred); 2352 #endif 2353 #if KWU_RC_VIEWRC_E0227 2354 printf("View-wise Rate control : %d\n", m_bViewWiseRateCtrl); 2355 if(m_bViewWiseRateCtrl) 2356 { 2357 2358 printf("ViewWiseTargetBits : "); 2359 for (int i = 0 ; i < m_iNumberOfViews ; i++) 2360 printf("%d ", m_pchViewTargetBits[i]); 2361 printf("\n"); 2362 } 2363 else 2364 { 2365 printf("TargetBitrate : %d\n", m_targetBitrate ); 2366 } 2367 #endif 2310 2368 } 2311 2369 #endif -
branches/HTM-8.2-dev0-KWU/source/App/TAppEncoder/TAppEncCfg.h
r622 r635 367 367 Int m_RCInitialQP; ///< inital QP for rate control 368 368 Bool m_RCForceIntraQP; ///< force all intra picture to use initial QP or not 369 370 #if KWU_RC_VIEWRC_E0227 371 vector<Int> m_pchViewTargetBits; 372 bool m_bViewWiseRateCtrl; ///< Flag for using view-wise rate control 373 #endif 374 #if KWU_RC_MADPRED_E0227 375 UInt m_uiDepthMADPred; 376 #endif 369 377 #else 370 378 Bool m_enableRateCtrl; ///< Flag for using rate control algorithm 371 379 Int m_targetBitrate; ///< target bitrate 372 380 Int m_numLCUInUnit; ///< Total number of LCUs in a frame should be completely divided by the NumLCUInUnit 381 382 #if KWU_RC_VIEWRC_E0227 383 vector<Int> m_pchViewTargetBits; 384 bool m_bViewWiseRateCtrl; ///< Flag for using view-wise rate control 385 #endif 386 #if KWU_RC_MADPRED_E0227 387 UInt m_uiDepthMADPred; 388 #endif 373 389 #endif 374 390 Int m_useScalingListId; ///< using quantization matrix -
branches/HTM-8.2-dev0-KWU/source/App/TAppEncoder/TAppEncTop.cpp
r622 r635 512 512 m_cTEncTop.setSignHideFlag(m_signHideFlag); 513 513 #if RATE_CONTROL_LAMBDA_DOMAIN 514 m_cTEncTop.setUseRateCtrl ( m_RCEnableRateControl ); 514 if(!m_cTEncTop.getIsDepth()) //only for texture 515 m_cTEncTop.setUseRateCtrl ( m_RCEnableRateControl ); 516 else 517 m_cTEncTop.setUseRateCtrl ( 0 ); 518 #if !KWU_RC_VIEWRC_E0227 515 519 m_cTEncTop.setTargetBitrate ( m_RCTargetBitrate ); 520 #endif 516 521 m_cTEncTop.setKeepHierBit ( m_RCKeepHierarchicalBit ); 517 522 m_cTEncTop.setLCULevelRC ( m_RCLCULevelRC ); … … 519 524 m_cTEncTop.setInitialQP ( m_RCInitialQP ); 520 525 m_cTEncTop.setForceIntraQP ( m_RCForceIntraQP ); 521 #else 522 m_cTEncTop.setUseRateCtrl ( m_enableRateCtrl); 523 m_cTEncTop.setTargetBitrate ( m_targetBitrate); 524 m_cTEncTop.setNumLCUInUnit ( m_numLCUInUnit); 526 527 #if KWU_RC_MADPRED_E0227 528 if(m_cTEncTop.getUseRateCtrl() && !m_cTEncTop.getIsDepth()) 529 { 530 m_cTEncTop.setUseDepthMADPred(layerIdInVps ? m_uiDepthMADPred : 0); 531 532 if(m_cTEncTop.getUseDepthMADPred()) 533 m_cTEncTop.setCamParam(&m_cCameraData); 534 } 535 #endif 536 #if KWU_RC_VIEWRC_E0227 537 if(m_cTEncTop.getUseRateCtrl() && !m_cTEncTop.getIsDepth()) 538 { 539 m_cTEncTop.setUseViewWiseRateCtrl(m_bViewWiseRateCtrl); 540 541 if(m_iNumberOfViews == 1) 542 { 543 if(m_bViewWiseRateCtrl) 544 { 545 m_cTEncTop.setTargetBitrate(m_pchViewTargetBits[layerIdInVps>>1]); 546 } 547 else 548 m_cTEncTop.setTargetBitrate ( m_RCTargetBitrate ); 549 } 550 else 551 { 552 if(m_bViewWiseRateCtrl) 553 { 554 m_cTEncTop.setTargetBitrate(m_pchViewTargetBits[layerIdInVps>>1]); 555 } 556 else 557 { 558 if(m_iNumberOfViews == 2) 559 { 560 if(m_cTEncTop.getViewId() == 0) 561 m_cTEncTop.setTargetBitrate ( (m_RCTargetBitrate*80)/100 ); 562 else if(m_cTEncTop.getViewId() == 1) 563 m_cTEncTop.setTargetBitrate ( (m_RCTargetBitrate*20)/100 ); 564 } 565 else if(m_iNumberOfViews == 3) 566 { 567 if(m_cTEncTop.getViewId() == 0) 568 m_cTEncTop.setTargetBitrate ( (m_RCTargetBitrate*66)/100 ); 569 else if(m_cTEncTop.getViewId() == 1) 570 m_cTEncTop.setTargetBitrate ( (m_RCTargetBitrate*17)/100 ); 571 else if(m_cTEncTop.getViewId() == 2) 572 m_cTEncTop.setTargetBitrate ( (m_RCTargetBitrate*17)/100 ); 573 } 574 else 575 m_cTEncTop.setTargetBitrate ( m_RCTargetBitrate ); 576 } 577 } 578 } 579 #endif 580 #else 581 if(!m_cTEncTop.getIsDepth()) //only for texture 582 { 583 m_cTEncTop.setUseRateCtrl ( m_enableRateCtrl ); 584 #if !KWU_RC_VIEWRC_E0227 585 m_cTEncTop.setTargetBitrate ( m_targetBitrate ); 586 #endif 587 m_cTEncTop.setNumLCUInUnit ( m_numLCUInUnit); 588 } 589 else 590 m_cTEncTop.setUseRateCtrl ( 0 ); 591 592 #if KWU_RC_MADPRED_E0227 593 if(m_cTEncTop.getUseRateCtrl() && !m_cTEncTop.getIsDepth()) 594 { 595 m_cTEncTop.setUseDepthMADPred(layerIdInVps ? m_uiDepthMADPred : 0); 596 597 if(m_cTEncTop.getUseDepthMADPred()) 598 m_cTEncTop.setCamParam(&m_cCameraData); 599 } 600 #endif 601 602 #if KWU_RC_VIEWRC_E0227 603 if(m_cTEncTop.getUseRateCtrl() && !m_cTEncTop.getIsDepth()) 604 { 605 m_cTEncTop.setUseViewWiseRateCtrl(m_bViewWiseRateCtrl); 606 if(m_iNumberOfViews == 1) 607 { 608 if(m_bViewWiseRateCtrl) 609 { 610 m_cTEncTop.setTargetBitrate(m_pchViewTargetBits[layerIdInVps>>1]); 611 } 612 else 613 m_cTEncTop.setTargetBitrate ( m_targetBitrate ); 614 } 615 else 616 { 617 if(m_bViewWiseRateCtrl) 618 { 619 m_cTEncTop.setTargetBitrate(m_pchViewTargetBits[layerIdInVps>>1]); 620 } 621 else 622 { 623 if(m_iNumberOfViews == 2) 624 { 625 if(m_cTEncTop.getViewId() == 0) 626 m_cTEncTop.setTargetBitrate ( (m_targetBitrate*80)/100 ); 627 else if(m_cTEncTop.getViewId() == 1) 628 m_cTEncTop.setTargetBitrate ( (m_targetBitrate*20)/100 ); 629 } 630 else if(m_iNumberOfViews == 3) 631 { 632 if(m_cTEncTop.getViewId() == 0) 633 m_cTEncTop.setTargetBitrate ( (m_targetBitrate*66)/100 ); 634 else if(m_cTEncTop.getViewId() == 1) 635 m_cTEncTop.setTargetBitrate ( (m_targetBitrate*17)/100 ); 636 else if(m_cTEncTop.getViewId() == 2) 637 m_cTEncTop.setTargetBitrate ( (m_targetBitrate*17)/100 ); 638 } 639 else 640 m_cTEncTop.setTargetBitrate ( m_targetBitrate ); 641 } 642 } 643 } 644 #endif 525 645 #endif 526 646 m_cTEncTop.setTransquantBypassEnableFlag(m_TransquantBypassEnableFlag); … … 669 789 for(Int layer=0; layer<m_numberOfLayers; layer++) 670 790 { 791 #if KWU_RC_MADPRED_E0227 792 m_acTEncTopList[layer]->init( this ); 793 #else 671 794 m_acTEncTopList[layer]->init( ); 795 #endif 672 796 } 673 797 #else … … 789 913 } 790 914 } 915 916 #if !RATE_CONTROL_LAMBDA_DOMAIN 917 for(Int layer=0; layer < m_numberOfLayers; layer++ ) 918 { 919 if(m_acTEncTopList[layer]->getUseRateCtrl() && !m_acTEncTopList[layer]->getIsDepth()) 920 { 921 m_acTEncTopList[layer]->getRateCtrl()->updateRCGOPStatus(); 922 } 923 } 924 #endif 925 791 926 gopSize = maxGopSize; 792 927 } -
branches/HTM-8.2-dev0-KWU/source/App/TAppEncoder/TAppEncTop.h
r622 r635 50 50 #endif 51 51 52 #if KWU_RC_MADPRED_E0227 53 class TEncTop; 54 #endif 52 55 //! \ingroup TAppEncoder 53 56 //! \{ -
branches/HTM-8.2-dev0-KWU/source/Lib/TAppCommon/TAppComCamPara.cpp
r608 r635 1526 1526 } 1527 1527 #endif 1528 1529 1530 #if KWU_RC_MADPRED_E0227 1531 Void 1532 TAppComCamPara::RCGetZNearZFar( Int iView, UInt uiFrame, Double& rdZNear, Double& rdZFar ) 1533 { 1534 UInt uiFoundLine = -1; 1535 if( !xGetCameraDataRow( m_aiBaseViews[iView], uiFrame, uiFoundLine ) || !( m_aadCameraParameters[ uiFoundLine ].size() < 8 ) ) 1536 { 1537 rdZNear = m_aadCameraParameters[ uiFoundLine ][ 6 ]; 1538 rdZFar = m_aadCameraParameters[ uiFoundLine ][ 7 ]; 1539 } 1540 else 1541 { 1542 std::cerr << "No ZNear or no ZFar for View " << (Double)iView / m_dViewNumPrec << " and Frame " << uiFrame << " given in CameraParameterFile" << std::endl; 1543 exit( EXIT_FAILURE ); 1544 } 1545 } 1546 1547 1548 Void 1549 TAppComCamPara::RCGetGeometryData( Int iView, UInt uiFrame, Double& rdFocalLength, Double& rdPosition, Double& rdCameraShift, Bool& rbInterpolated ) 1550 { 1551 UInt uiFoundLine = -1; 1552 if ( !xGetCameraDataRow( m_aiBaseViews[iView], uiFrame, uiFoundLine ) ) 1553 { 1554 AOT( m_aadCameraParameters[ uiFoundLine ].size() < 6 ); 1555 rbInterpolated = false; 1556 rdFocalLength = m_aadCameraParameters[ uiFoundLine ][ 3 ]; 1557 rdPosition = m_aadCameraParameters[ uiFoundLine ][ 4 ]; 1558 rdCameraShift = m_aadCameraParameters[ uiFoundLine ][ 5 ]; 1559 } 1560 else 1561 { 1562 UInt uiLeftViewLine; 1563 UInt uiRightViewLine; 1564 Int iLeftView; 1565 Int iRightView; 1566 Int iDummy; 1567 1568 if( !xGetLeftRightView( iView, m_aiViewsInCfgFile, iLeftView, iRightView, iDummy, iDummy ) || 1569 xGetCameraDataRow( iLeftView, uiFrame, uiLeftViewLine ) || 1570 xGetCameraDataRow( iRightView, uiFrame, uiRightViewLine ) 1571 ) 1572 { 1573 std::cerr << "No Left or no Right View next to View " << (Double)iView / m_dViewNumPrec << " for Frame " << uiFrame << " given in CameraParameterFile" << std::endl; 1574 AOT(true); 1575 exit( EXIT_FAILURE ); 1576 } 1577 AOT( m_aadCameraParameters[ uiLeftViewLine ].size() < 6 ); 1578 AOT( m_aadCameraParameters[ uiRightViewLine ].size() < 6 ); 1579 1580 // Linear Interpolation 1581 Double dFactor = ( (Double)( iView - iLeftView ) ) / ( (Double)( iRightView - iLeftView ) ); 1582 rdFocalLength = m_aadCameraParameters[ uiLeftViewLine ][ 3 ] + dFactor * ( m_aadCameraParameters[ uiRightViewLine ][ 3 ] - m_aadCameraParameters[ uiLeftViewLine ][ 3 ] ); 1583 rdPosition = m_aadCameraParameters[ uiLeftViewLine ][ 4 ] + dFactor * ( m_aadCameraParameters[ uiRightViewLine ][ 4 ] - m_aadCameraParameters[ uiLeftViewLine ][ 4 ] ); 1584 rdCameraShift = m_aadCameraParameters[ uiLeftViewLine ][ 5 ] + dFactor * ( m_aadCameraParameters[ uiRightViewLine ][ 5 ] - m_aadCameraParameters[ uiLeftViewLine ][ 5 ] ); 1585 rbInterpolated = true; 1586 } 1587 } 1588 #endif -
branches/HTM-8.2-dev0-KWU/source/Lib/TAppCommon/TAppComCamPara.h
r608 r635 220 220 Int** getCodedScale () { return m_aaiCodedScale; } 221 221 Int** getCodedOffset () { return m_aaiCodedOffset; } 222 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 ); 226 #endif 222 227 }; 223 228 -
branches/HTM-8.2-dev0-KWU/source/Lib/TLibCommon/TComRdCost.cpp
r622 r635 614 614 #endif 615 615 616 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT616 #if (RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT) || KWU_RC_MADPRED_E0227 617 617 UInt TComRdCost::getSADPart ( Int bitDepth, Pel* pelCur, Int curStride, Pel* pelOrg, Int orgStride, UInt width, UInt height ) 618 618 { -
branches/HTM-8.2-dev0-KWU/source/Lib/TLibCommon/TComRdCost.h
r622 r635 343 343 #endif 344 344 345 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT345 #if (RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT) || KWU_RC_MADPRED_E0227 346 346 UInt getSADPart ( Int bitDepth, Pel* pelCur, Int curStride, Pel* pelOrg, Int orgStride, UInt width, UInt height ); 347 347 #endif -
branches/HTM-8.2-dev0-KWU/source/Lib/TLibCommon/TComSlice.cpp
r622 r635 472 472 { 473 473 // The variable NumPocTotalCurr is derived as specified in subclause 7.4.7.2. It is a requirement of bitstream conformance that the following applies to the value of NumPocTotalCurr: 474 // If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0.475 // Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.474 // ?If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0. 475 // ?Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0. 476 476 if (getRapPicFlag()) 477 477 { … … 827 827 // The variable NumPocTotalCurr is derived as specified in subclause 7.4.7.2. It is a requirement of bitstream conformance that the following applies to the value of NumPocTotalCurr: 828 828 #if H_MV 829 // âIf nuh_layer_id is equal to 0 and the current picture is a BLA picture or a CRA picture, the value of NumPocTotalCurr shall be equal to 0.830 // âOtherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.829 // ??If nuh_layer_id is equal to 0 and the current picture is a BLA picture or a CRA picture, the value of NumPocTotalCurr shall be equal to 0. 830 // ??Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0. 831 831 if ( getRapPicFlag() && m_layerId == 0 ) 832 832 #else 833 // âIf the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0.834 // âOtherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.833 // ??If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0. 834 // ??Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0. 835 835 if (getRapPicFlag()) 836 836 #endif -
branches/HTM-8.2-dev0-KWU/source/Lib/TLibCommon/TypeDef.h
r632 r635 306 306 #define TICKET_1090_FIX 1 307 307 308 #if RATE_CONTROL_LAMBDA_DOMAIN 308 309 #define RC_FIX 1 /// suggested fix for M0036 309 310 #define RATE_CONTROL_INTRA 1 ///< JCTVC-M0257, rate control for intra 311 #endif 312 #define KWU_RC_VIEWRC_E0227 0 ///< JCT3V-E0227, view-wise target bitrate allocation 313 #define KWU_RC_MADPRED_E0227 0 ///< JCT3V-E0227, inter-view MAD prediction 310 314 311 315 #define MAX_CPB_CNT 32 ///< Upper bound of (cpb_cnt_minus1 + 1) -
branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncCfg.h
r622 r635 310 310 Int m_RCInitialQP; 311 311 Bool m_RCForceIntraQP; 312 313 #if KWU_RC_MADPRED_E0227 314 UInt m_uiDepthMADPred; 315 #endif 316 #if KWU_RC_VIEWRC_E0227 317 Bool m_bViewWiseRateCtrl; 318 #endif 312 319 #else 313 320 Bool m_enableRateCtrl; ///< Flag for using rate control algorithm 314 321 Int m_targetBitrate; ///< target bitrate 315 322 Int m_numLCUInUnit; ///< Total number of LCUs in a frame should be divided by the NumLCUInUnit 323 324 #if KWU_RC_MADPRED_E0227 325 UInt m_uiDepthMADPred; 326 #endif 327 #if KWU_RC_VIEWRC_E0227 328 Bool m_bViewWiseRateCtrl; 329 #endif 316 330 #endif 317 331 Bool m_TransquantBypassEnableFlag; ///< transquant_bypass_enable_flag setting in PPS. … … 826 840 Bool getForceIntraQP () { return m_RCForceIntraQP; } 827 841 Void setForceIntraQP ( Bool b ) { m_RCForceIntraQP = b; } 842 843 #if KWU_RC_MADPRED_E0227 844 UInt getUseDepthMADPred () { return m_uiDepthMADPred; } 845 Void setUseDepthMADPred (UInt b) { m_uiDepthMADPred = b; } 846 #endif 847 #if KWU_RC_VIEWRC_E0227 848 Bool getUseViewWiseRateCtrl () { return m_bViewWiseRateCtrl; } 849 Void setUseViewWiseRateCtrl (Bool b) { m_bViewWiseRateCtrl = b; } 850 #endif 828 851 #else 829 852 Bool getUseRateCtrl () { return m_enableRateCtrl; } … … 833 856 Int getNumLCUInUnit () { return m_numLCUInUnit; } 834 857 Void setNumLCUInUnit (Int numLCUs) { m_numLCUInUnit = numLCUs; } 858 859 #if KWU_RC_MADPRED_E0227 860 UInt getUseDepthMADPred () { return m_uiDepthMADPred; } 861 Void setUseDepthMADPred (UInt b) { m_uiDepthMADPred = b; } 862 #endif 863 #if KWU_RC_VIEWRC_E0227 864 Bool getUseViewWiseRateCtrl () { return m_bViewWiseRateCtrl; } 865 Void setUseViewWiseRateCtrl (Bool b) { m_bViewWiseRateCtrl = b; } 866 #endif 835 867 #endif 836 868 Bool getTransquantBypassEnableFlag() { return m_TransquantBypassEnableFlag; } -
branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncCu.cpp
r622 r635 103 103 104 104 m_bEncodeDQP = false; 105 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT105 #if (RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT) || KWU_RC_MADPRED_E0227 106 106 m_LCUPredictionSAD = 0; 107 107 m_addSADDepth = 0; 108 108 m_temporalSAD = 0; 109 m_spatialSAD = 0; 109 110 #endif 110 111 … … 241 242 242 243 m_bUseSBACRD = pcEncTop->getUseSBACRD(); 243 m_pcRateCtrl = pcEncTop->getRateCtrl(); 244 if(!pcEncTop->getIsDepth()) 245 m_pcRateCtrl = pcEncTop->getRateCtrl(); 246 else 247 { 248 m_pcRateCtrl = NULL; 249 } 244 250 } 245 251 … … 256 262 m_ppcTempCU[0]->initCU( rpcCU->getPic(), rpcCU->getAddr() ); 257 263 258 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT264 #if (RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT) || KWU_RC_MADPRED_E0227 259 265 m_addSADDepth = 0; 260 266 m_LCUPredictionSAD = 0; 261 267 m_temporalSAD = 0; 268 m_spatialSAD = 0; 262 269 #endif 263 270 … … 464 471 465 472 #if RATE_CONTROL_LAMBDA_DOMAIN 466 if ( m_pcEncCfg->getUseRateCtrl() )473 if ( m_pcEncCfg->getUseRateCtrl() && !m_pcEncCfg->getIsDepth() ) 467 474 { 468 475 iMinQP = m_pcRateCtrl->getRCQP(); … … 470 477 } 471 478 #else 472 if(m_pcEncCfg->getUseRateCtrl() )479 if(m_pcEncCfg->getUseRateCtrl() && !m_pcEncCfg->getIsDepth()) 473 480 { 474 481 Int qp = m_pcRateCtrl->getUnitQP(); … … 671 678 } 672 679 673 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT680 #if (RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT) || KWU_RC_MADPRED_E0227 674 681 if ( uiDepth <= m_addSADDepth ) 675 682 { 676 683 m_LCUPredictionSAD += m_temporalSAD; 677 684 m_addSADDepth = uiDepth; 685 } 686 #endif 687 #if !RATE_CONTROL_LAMBDA_DOMAIN 688 if(m_pcEncCfg->getUseRateCtrl()) 689 { 690 Int qp = m_pcRateCtrl->getUnitQP(); 691 iMinQP = Clip3( MIN_QP, MAX_QP, qp); 692 iMaxQP = Clip3( MIN_QP, MAX_QP, qp); 678 693 } 679 694 #endif … … 1012 1027 { 1013 1028 xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_2Nx2N ); 1029 #if (RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT) || KWU_RC_MADPRED_E0227 1030 if ( uiDepth <= m_addSADDepth ) 1031 { 1032 m_LCUPredictionSAD += m_spatialSAD; 1033 m_addSADDepth = uiDepth; 1034 } 1035 #endif 1014 1036 rpcTempCU->initEstData( uiDepth, iQP ); 1015 1037 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth ) … … 1146 1168 } 1147 1169 #if RATE_CONTROL_LAMBDA_DOMAIN 1148 if ( m_pcEncCfg->getUseRateCtrl() )1170 if ( m_pcEncCfg->getUseRateCtrl() && !m_pcEncCfg->getIsDepth() ) 1149 1171 { 1150 1172 iMinQP = m_pcRateCtrl->getRCQP(); … … 1152 1174 } 1153 1175 #else 1154 if(m_pcEncCfg->getUseRateCtrl() )1176 if(m_pcEncCfg->getUseRateCtrl() && !m_pcEncCfg->getIsDepth()) 1155 1177 { 1156 1178 Int qp = m_pcRateCtrl->getUnitQP(); … … 2102 2124 #endif 2103 2125 2104 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT 2126 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT 2127 #if KWU_RC_MADPRED_E0227 2105 2128 if ( m_pcEncCfg->getUseRateCtrl() && m_pcEncCfg->getLCULevelRC() && ePartSize == SIZE_2Nx2N && uhDepth <= m_addSADDepth ) 2129 { 2130 UInt SAD = m_pcRdCost->getSADPart( g_bitDepthY, m_ppcPredYuvTemp[uhDepth]->getLumaAddr(), m_ppcPredYuvTemp[uhDepth]->getStride(), 2131 m_ppcOrigYuv[uhDepth]->getLumaAddr(), m_ppcOrigYuv[uhDepth]->getStride(), 2132 rpcTempCU->getWidth(0), rpcTempCU->getHeight(0) ); 2133 m_temporalSAD = (Int)SAD; 2134 } 2135 #endif 2136 #endif 2137 #if !RATE_CONTROL_LAMBDA_DOMAIN && KWU_RC_MADPRED_E0227 2138 if ( m_pcEncCfg->getUseRateCtrl() && ePartSize == SIZE_2Nx2N && uhDepth <= m_addSADDepth ) 2106 2139 { 2107 2140 UInt SAD = m_pcRdCost->getSADPart( g_bitDepthY, m_ppcPredYuvTemp[uhDepth]->getLumaAddr(), m_ppcPredYuvTemp[uhDepth]->getStride(), … … 2235 2268 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 2236 2269 2270 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT 2271 #if KWU_RC_MADPRED_E0227 2272 UChar uhDepth = rpcTempCU->getDepth( 0 ); 2273 if ( m_pcEncCfg->getUseRateCtrl() && m_pcEncCfg->getLCULevelRC() && eSize == SIZE_2Nx2N && uhDepth <= m_addSADDepth ) 2274 { 2275 UInt SAD = m_pcRdCost->getSADPart( g_bitDepthY, m_ppcPredYuvTemp[uhDepth]->getLumaAddr(), m_ppcPredYuvTemp[uhDepth]->getStride(), 2276 m_ppcOrigYuv[uhDepth]->getLumaAddr(), m_ppcOrigYuv[uhDepth]->getStride(), 2277 rpcTempCU->getWidth(0), rpcTempCU->getHeight(0) ); 2278 m_spatialSAD = (Int)SAD; 2279 } 2280 #endif 2281 #endif 2282 #if !RATE_CONTROL_LAMBDA_DOMAIN && KWU_RC_MADPRED_E0227 2283 UChar uhDepth = rpcTempCU->getDepth( 0 ); 2284 if ( m_pcEncCfg->getUseRateCtrl() && eSize == SIZE_2Nx2N && uhDepth <= m_addSADDepth ) 2285 { 2286 UInt SAD = m_pcRdCost->getSADPart( g_bitDepthY, m_ppcPredYuvTemp[uhDepth]->getLumaAddr(), m_ppcPredYuvTemp[uhDepth]->getStride(), 2287 m_ppcOrigYuv[uhDepth]->getLumaAddr(), m_ppcOrigYuv[uhDepth]->getStride(), 2288 rpcTempCU->getWidth(0), rpcTempCU->getHeight(0) ); 2289 m_spatialSAD = (Int)SAD; 2290 } 2291 #endif 2237 2292 xCheckDQP( rpcTempCU ); 2238 2293 xCheckBestMode(rpcBestCU, rpcTempCU, uiDepth); -
branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncCu.h
r608 r635 102 102 Bool m_bUseSBACRD; 103 103 TEncRateCtrl* m_pcRateCtrl; 104 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT104 #if (RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT) || KWU_RC_MADPRED_E0227 105 105 UInt m_LCUPredictionSAD; 106 106 Int m_addSADDepth; 107 107 Int m_temporalSAD; 108 Int m_spatialSAD; 108 109 #endif 109 110 public: … … 124 125 125 126 Void setBitCounter ( TComBitCounter* pcBitCounter ) { m_pcBitCounter = pcBitCounter; } 126 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT127 #if (RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT) || KWU_RC_MADPRED_E0227 127 128 UInt getLCUPredictionSAD() { return m_LCUPredictionSAD; } 128 129 #endif -
branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncGOP.cpp
r630 r635 153 153 #endif 154 154 #endif 155 156 #if !RATE_CONTROL_LAMBDA_DOMAIN 157 m_pcRateCtrl = pcTEncTop->getRateCtrl(); 158 #endif 155 159 } 156 160 … … 977 981 } 978 982 m_pcRateCtrl->initRCPic( frameLevel ); 983 984 #if KWU_RC_MADPRED_E0227 985 if(m_pcCfg->getLayerId() != 0) 986 m_pcRateCtrl->getRCPic()->setIVPic( m_pcEncTop->getEncTop()->getTEncTop(0)->getRateCtrl()->getRCPic() ); 987 //getEncTop()->getEncTop();//->getTEncTop(0);//->getUseRateCtrl()->getRCPic(); 988 #endif 989 979 990 estimatedBits = m_pcRateCtrl->getRCPic()->getTargetBits(); 980 991 … … 1021 1032 else // normal case 1022 1033 { 1034 #if KWU_RC_MADPRED_E0227 1035 if(m_pcRateCtrl->getLayerID() != 0) 1036 { 1037 list<TEncRCPic*> listPreviousPicture = m_pcRateCtrl->getPicList(); 1038 lambda = m_pcRateCtrl->getRCPic()->estimatePicLambdaIV( listPreviousPicture, pcSlice->getPOC() ); 1039 //printf("lambda : %lf\n", lambda); 1040 sliceQP = m_pcRateCtrl->getRCPic()->estimatePicQP( lambda, listPreviousPicture ); 1041 } 1042 else 1043 { 1044 #endif 1023 1045 list<TEncRCPic*> listPreviousPicture = m_pcRateCtrl->getPicList(); 1024 1046 #if RATE_CONTROL_INTRA … … 1028 1050 #endif 1029 1051 sliceQP = m_pcRateCtrl->getRCPic()->estimatePicQP( lambda, listPreviousPicture ); 1052 #if KWU_RC_MADPRED_E0227 1053 } 1054 #endif 1030 1055 } 1031 1056 … … 2191 2216 delete[] pcSubstreamsOut; 2192 2217 } 2193 #if !RATE_CONTROL_LAMBDA_DOMAIN 2194 if(m_pcCfg->getUseRateCtrl()) 2195 { 2196 m_pcRateCtrl->updateRCGOPStatus(); 2197 } 2198 #endif 2218 2199 2219 delete pcBitstreamRedirect; 2200 2220 -
branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncGOP.h
r622 r635 57 57 #include "TEncAnalyze.h" 58 58 #include "TEncRateCtrl.h" 59 #if KWU_RC_MADPRED_E0227 60 #include "../App/TAppEncoder/TAppEncTop.h" 61 #endif 59 62 #include <vector> 60 63 … … 176 179 Void preLoopFilterPicAll ( TComPic* pcPic, UInt64& ruiDist, UInt64& ruiBits ); 177 180 #endif 178 181 182 #if KWU_RC_MADPRED_E0227 183 TEncTop* getEncTop() { return m_pcEncTop; } 184 #endif 185 179 186 TEncSlice* getSliceEncoder() { return m_pcSliceEncoder; } 180 187 NalUnitType getNalUnitType( Int pocCurr, Int lastIdr ); -
branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncRateCtrl.cpp
r608 r635 537 537 m_lastPicture = NULL; 538 538 #endif 539 540 #if KWU_RC_MADPRED_E0227 541 m_lastIVPicture = NULL; 542 #endif 543 539 544 m_picActualHeaderBits = 0; 540 545 #if !M0036_RC_IMPROVEMENT … … 544 549 m_picQP = 0; 545 550 m_picLambda = 0.0; 551 552 #if KWU_RC_MADPRED_E0227 553 m_IVtotalMAD = 0.0; 554 #endif 546 555 } 547 556 … … 621 630 } 622 631 632 #if KWU_RC_MADPRED_E0227 633 Void TEncRCPic::addToPictureLsitIV( list<TEncRCPic*>& listPreviousPictures ) 634 { 635 m_lastIVPicture = NULL; 636 m_lastIVPicture = this; 637 } 638 639 Void TEncRCPic::setIVPic( TEncRCPic* BaseRCPic ) 640 { 641 m_lastIVPicture = BaseRCPic; 642 } 643 #endif 644 645 #if KWU_RC_MADPRED_E0227 646 Void TEncRCPic::create( TEncRCSeq* encRCSeq, TEncRCGOP* encRCGOP, Int frameLevel, list<TEncRCPic*>& listPreviousPictures, Int LayerID ) 647 #else 623 648 Void TEncRCPic::create( TEncRCSeq* encRCSeq, TEncRCGOP* encRCGOP, Int frameLevel, list<TEncRCPic*>& listPreviousPictures ) 649 #endif 624 650 { 625 651 destroy(); … … 673 699 Int currHeight = ( (j == picHeightInLCU-1) ? picHeight - LCUHeight*(picHeightInLCU-1) : LCUHeight ); 674 700 m_LCUs[LCUIdx].m_numberOfPixel = currWidth * currHeight; 701 702 #if KWU_RC_MADPRED_E0227 703 m_LCUs[LCUIdx].m_CUWidth = currWidth; 704 m_LCUs[LCUIdx].m_CUHeight = currHeight; 705 m_LCUs[LCUIdx].m_IVMAD = -1.0; 706 #endif 675 707 } 676 708 } … … 683 715 m_picLambda = 0.0; 684 716 717 718 #if KWU_RC_MADPRED_E0227 719 m_LayerID = LayerID; 720 m_lastIVPicture = NULL; 721 m_IVtotalMAD = 0.0; 722 #endif 723 724 685 725 #if !M0036_RC_IMPROVEMENT 686 726 m_lastPicture = NULL; 687 727 list<TEncRCPic*>::reverse_iterator it; 728 for ( it = listPreviousPictures.rbegin(); it != listPreviousPictures.rend(); it++ ) 729 { 730 if ( (*it)->getFrameLevel() == m_frameLevel ) 731 { 732 m_lastPicture = (*it); 733 break; 734 } 735 } 736 #endif 737 738 #if KWU_RC_MADPRED_E0227 739 list<TEncRCPic*>::reverse_iterator it; 740 if( m_LayerID != 0) 741 { 742 m_lastIVPicture = NULL; 743 for ( it = listPreviousPictures.rbegin(); it != listPreviousPictures.rend(); it++ ) 744 { 745 if ( (*it)->getLayerID() == 0 ) 746 { 747 m_lastIVPicture = (*it); 748 break; 749 } 750 } 751 } 752 753 m_lastPicture = NULL; 688 754 for ( it = listPreviousPictures.rbegin(); it != listPreviousPictures.rend(); it++ ) 689 755 { … … 856 922 } 857 923 924 925 #if KWU_RC_MADPRED_E0227 926 Double TEncRCPic::estimatePicLambdaIV( list<TEncRCPic*>& listPreviousPictures, Int CurPOC ) 927 { 928 Double alpha = m_encRCSeq->getPicPara( m_frameLevel ).m_alpha; 929 Double beta = m_encRCSeq->getPicPara( m_frameLevel ).m_beta; 930 Double bpp = (Double)m_targetBits/(Double)m_numberOfPixel; 931 Double estLambda = alpha * pow( bpp, beta ); 932 Double lastLevelLambda = -1.0; 933 Double lastPicLambda = -1.0; 934 Double lastValidLambda = -1.0; 935 list<TEncRCPic*>::iterator it; 936 937 if(listPreviousPictures.size() == 0 || CurPOC%8 == 0) 938 { 939 lastLevelLambda = m_lastIVPicture->getPicActualLambda(); 940 lastPicLambda = m_lastIVPicture->getPicActualLambda(); 941 } 942 else 943 { 944 for ( it = listPreviousPictures.begin(); it != listPreviousPictures.end(); it++ ) 945 { 946 if ( (*it)->getFrameLevel() == m_frameLevel ) 947 { 948 lastLevelLambda = (*it)->getPicActualLambda(); 949 } 950 lastPicLambda = (*it)->getPicActualLambda(); 951 952 if ( lastPicLambda > 0.0 ) 953 { 954 lastValidLambda = lastPicLambda; 955 } 956 } 957 } 958 959 if ( lastLevelLambda > 0.0 ) 960 { 961 lastLevelLambda = Clip3( 0.1, 10000.0, lastLevelLambda ); 962 estLambda = Clip3( lastLevelLambda * pow( 2.0, -3.0/3.0 ), lastLevelLambda * pow( 2.0, 3.0/3.0 ), estLambda ); 963 } 964 965 if ( lastPicLambda > 0.0 ) 966 { 967 lastPicLambda = Clip3( 0.1, 2000.0, lastPicLambda ); 968 estLambda = Clip3( lastPicLambda * pow( 2.0, -10.0/3.0 ), lastPicLambda * pow( 2.0, 10.0/3.0 ), estLambda ); 969 } 970 else if ( lastValidLambda > 0.0 ) 971 { 972 lastValidLambda = Clip3( 0.1, 2000.0, lastValidLambda ); 973 estLambda = Clip3( lastValidLambda * pow(2.0, -10.0/3.0), lastValidLambda * pow(2.0, 10.0/3.0), estLambda ); 974 } 975 else 976 { 977 estLambda = Clip3( 0.1, 10000.0, estLambda ); 978 } 979 980 if ( estLambda < 0.1 ) 981 { 982 estLambda = 0.1; 983 } 984 985 m_estPicLambda = estLambda; 986 return estLambda; 987 } 988 #endif 989 990 858 991 #if RATE_CONTROL_INTRA 859 992 Double TEncRCPic::getLCUTargetBpp(SliceType eSliceType) … … 937 1070 } 938 1071 1072 1073 #if KWU_RC_MADPRED_E0227 1074 Double TEncRCPic::getLCUTargetBppforInterView( list<TEncRCPic*>& listPreviousPictures, TComDataCU* pcCU, Double BasePos, Double CurPos, Double FocalLen, Double Znear, Double Zfar, Int Direction, Int* iDisparity ) 1075 { 1076 Int LCUIdx = getLCUCoded(); 1077 Double bpp = -1.0; 1078 Int avgBits = 0; 1079 #if !M0036_RC_IMPROVEMENT 1080 Double totalMAD = -1.0; 1081 Double MAD = -1.0; 1082 #endif 1083 1084 Double totalMAD = -1.0; 1085 Double MAD = -1.0; 1086 1087 Double IVMAD = -1.0; 1088 Double SAD = 0.0; 1089 Int x, y; 1090 Int Sum = 0; 1091 1092 { 1093 Pel* pOrg = pcCU->getSlice()->getIvPic(false, 0)->getPicYuvOrg()->getLumaAddr(pcCU->getAddr(), 0); 1094 Pel* pRec = pcCU->getSlice()->getIvPic(false, 0)->getPicYuvPred()->getLumaAddr(pcCU->getAddr(), 0); 1095 Pel* pDep = pcCU->getSlice()->getIvPic(true, pcCU->getSlice()->getViewIndex())->getPicYuvOrg()->getLumaAddr(pcCU->getAddr(), 0); 1096 Int iStride = pcCU->getSlice()->getIvPic(true, pcCU->getSlice()->getViewIndex())->getPicYuvOrg()->getStride(); 1097 1098 Int iWidth = m_LCUs[ LCUIdx ].m_CUWidth; 1099 Int iHeight = m_LCUs[ LCUIdx ].m_CUHeight; 1100 1101 for( y = 0 ; y < pcCU->getSlice()->getSPS()->getMaxCUHeight() ; y+=8) 1102 { 1103 for( x = 0 ; x < pcCU->getSlice()->getSPS()->getMaxCUWidth() ; x+=8) 1104 { 1105 Sum += pDep[x]; 1106 } 1107 pDep += iStride; 1108 } 1109 1110 Double AvgDepth = (Double)Sum/((pcCU->getSlice()->getSPS()->getMaxCUHeight()/8)*(pcCU->getSlice()->getSPS()->getMaxCUWidth()/8)); 1111 1112 //Int iDisparity = pDepthGen->RCGetDisparityFromVirtDepth(0, (Int)AvgDepth); 1113 1114 Double dFL = FocalLen * abs( BasePos - CurPos ); 1115 Double dZ = abs( 1.0 / Znear - 1.0 / Zfar ) * ((Double)(AvgDepth) / (( 1 << g_bitDepthY ) - 1) ) + abs(1.0 / Zfar); 1116 *iDisparity = (Int)(Direction*dFL * dZ); 1117 Int shift = DISTORTION_PRECISION_ADJUSTMENT(g_bitDepthY-8); 1118 1119 Int Disp = *iDisparity; 1120 Int PosX, PosY; 1121 pcCU->getPosInPic(0, PosX, PosY); 1122 if((PosX + *iDisparity) < 0 || (PosX + *iDisparity + iWidth) >= pcCU->getSlice()->getSPS()->getMaxCUWidth()) 1123 Disp = 0; 1124 1125 for( y = 0; y < iHeight; y++ ) 1126 { 1127 for( x = 0; x < iWidth; x++ ) 1128 { 1129 SAD += abs( pOrg[Clip3(0, (Int)(pcCU->getPic()->getPicYuvOrg()->getWidth() - pcCU->getSlice()->getSPS()->getMaxCUWidth()), x + Disp)] 1130 - pRec[Clip3(0, (Int)(pcCU->getPic()->getPicYuvOrg()->getWidth() - pcCU->getSlice()->getSPS()->getMaxCUWidth()), x + Disp)] )>>shift; 1131 } 1132 pOrg += iStride; 1133 pRec += iStride; 1134 } 1135 IVMAD = SAD / (Double)(iHeight * iWidth); 1136 IVMAD = IVMAD * IVMAD; 1137 1138 m_LCUs[ LCUIdx ].m_IVMAD = IVMAD; 1139 if(m_lastPicture) 1140 m_LCUs[ LCUIdx ].m_MAD = m_lastPicture->getLCU(LCUIdx).m_MAD; 1141 1142 MAD = m_LCUs[ LCUIdx ].m_IVMAD; 1143 1144 if(m_lastPicture) 1145 { 1146 totalMAD = m_lastPicture->getTotalMAD(); // get total MAD of temporal frame 1147 for ( Int i=0; i<LCUIdx; i++ ) 1148 { 1149 totalMAD -= m_lastPicture->getLCU(i).m_MAD; 1150 } 1151 } 1152 else 1153 { 1154 totalMAD = m_lastIVPicture->getTotalMAD(); // get total MAD of inter-view frame 1155 for ( Int i=0; i<LCUIdx; i++ ) 1156 { 1157 totalMAD -= m_lastIVPicture->getLCU(i).m_MAD; 1158 } 1159 } 1160 1161 1162 if ( totalMAD > 0.1 ) 1163 { 1164 avgBits = Int( (m_bitsLeft * MAD) / totalMAD ); 1165 } 1166 else 1167 { 1168 avgBits = Int( (m_bitsLeft) / m_LCULeft ); 1169 } 1170 } 1171 1172 if ( avgBits < 5 ) 1173 { 1174 avgBits = 5; 1175 } 1176 1177 bpp = ( Double )avgBits/( Double )m_LCUs[ LCUIdx ].m_numberOfPixel; 1178 m_LCUs[ LCUIdx ].m_targetBits = avgBits; 1179 1180 return bpp; 1181 } 1182 #endif 1183 1184 1185 1186 939 1187 Double TEncRCPic::getLCUEstLambda( Double bpp ) 940 1188 { … … 1185 1433 } 1186 1434 m_picLambda = averageLambda; 1187 #if !M0036_RC_IMPROVEMENT 1435 #if !M0036_RC_IMPROVEMENT || KWU_RC_MADPRED_E0227 1436 m_totalMAD = 0; 1188 1437 for ( Int i=0; i<m_numberOfLCU; i++ ) 1189 1438 { … … 1393 1642 1394 1643 #if M0036_RC_IMPROVEMENT 1644 #if KWU_RC_MADPRED_E0227 1645 Void TEncRateCtrl::init( Int totalFrames, Int targetBitrate, Int frameRate, Int GOPSize, Int picWidth, Int picHeight, Int LCUWidth, Int LCUHeight, Bool keepHierBits, Bool useLCUSeparateModel, GOPEntry GOPList[MAX_GOP], Int LayerID ) 1646 #else 1395 1647 Void TEncRateCtrl::init( Int totalFrames, Int targetBitrate, Int frameRate, Int GOPSize, Int picWidth, Int picHeight, Int LCUWidth, Int LCUHeight, Int keepHierBits, Bool useLCUSeparateModel, GOPEntry GOPList[MAX_GOP] ) 1648 #endif 1396 1649 #else 1397 1650 Void TEncRateCtrl::init( Int totalFrames, Int targetBitrate, Int frameRate, Int GOPSize, Int picWidth, Int picHeight, Int LCUWidth, Int LCUHeight, Bool keepHierBits, Bool useLCUSeparateModel, GOPEntry GOPList[MAX_GOP] ) … … 1607 1860 } 1608 1861 1862 #if KWU_RC_MADPRED_E0227 1863 setLayerID(LayerID); 1864 #endif 1865 1609 1866 delete[] bitsRatio; 1610 1867 delete[] GOPID2Level; … … 1614 1871 { 1615 1872 m_encRCPic = new TEncRCPic; 1873 #if KWU_RC_MADPRED_E0227 1874 m_encRCPic->create( m_encRCSeq, m_encRCGOP, frameLevel, m_listRCPictures, m_LayerID ); 1875 #else 1616 1876 m_encRCPic->create( m_encRCSeq, m_encRCGOP, frameLevel, m_listRCPictures ); 1877 #endif 1617 1878 } 1618 1879 … … 1815 2076 m_sourceHeightInLCU = (sourceHeight / maxCUHeight) + (( sourceHeight % maxCUHeight) ? 1 : 0); 1816 2077 m_isLowdelay = (sizeIntraPeriod == -1) ? true : false; 1817 m_prevBitrate = ( targetKbps << 10 ); // in units of 1,024 bps1818 m_currBitrate = ( targetKbps << 10 );2078 m_prevBitrate = ( targetKbps * 1000 ); // in units of 1,024 bps 2079 m_currBitrate = ( targetKbps * 1000 ); 1819 2080 m_frameRate = frameRate; 1820 2081 m_refFrameNum = m_isLowdelay ? (sizeGOP) : (sizeGOP>>1); … … 2192 2453 2193 2454 Pel* pOrg = pcCU->getPic()->getPicYuvOrg()->getLumaAddr(pcCU->getAddr(), 0); 2194 Pel* pRec = pcCU->getPic()->getPicYuv Rec()->getLumaAddr(pcCU->getAddr(), 0);2455 Pel* pRec = pcCU->getPic()->getPicYuvPred()->getLumaAddr(pcCU->getAddr(), 0); 2195 2456 Int stride = pcCU->getPic()->getStride(); 2196 2457 … … 2212 2473 } 2213 2474 2475 2476 #if KWU_RC_MADPRED_E0227 2477 Void TEncRateCtrl::updateLCUDataEnhancedView(TComDataCU* pcCU, UInt64 uiBits, Int iQP, Double BasePos, Double CurPos, Double FocalLen, Double Znear, Double Zfar, Int Direction) 2478 { 2479 Int x, y; 2480 double dMAD = 0.0; 2481 Int Sum = 0; 2482 Double SAD = 0.0; 2483 2484 Pel* pOrg = pcCU->getSlice()->getIvPic(false, 0)->getPicYuvOrg()->getLumaAddr(pcCU->getAddr(), 0); 2485 Pel* pRec = pcCU->getSlice()->getIvPic(false, 0)->getPicYuvPred()->getLumaAddr(pcCU->getAddr(), 0); 2486 Pel* pDep = pcCU->getSlice()->getIvPic(true, pcCU->getSlice()->getViewIndex())->getPicYuvOrg()->getLumaAddr(pcCU->getAddr(), 0); 2487 Int iStride = pcCU->getSlice()->getIvPic(true, pcCU->getSlice()->getViewIndex())->getPicYuvOrg()->getStride(); 2488 2489 Int iWidth = m_pcLCUData[m_indexLCU].m_widthInPixel; 2490 Int iHeight = m_pcLCUData[m_indexLCU].m_heightInPixel; 2491 2492 for( y = 0 ; y < pcCU->getSlice()->getSPS()->getMaxCUHeight() ; y+=8) 2493 { 2494 for( x = 0 ; x < pcCU->getSlice()->getSPS()->getMaxCUWidth() ; x+=8) 2495 { 2496 Sum += pDep[x]; 2497 } 2498 pDep += iStride; 2499 } 2500 2501 Double AvgDepth = (Double)Sum/((pcCU->getSlice()->getSPS()->getMaxCUHeight()/8)*(pcCU->getSlice()->getSPS()->getMaxCUWidth()/8)); 2502 2503 //Int iDisparity = pDepthGen->RCGetDisparityFromVirtDepth(0, (Int)AvgDepth); 2504 2505 Double dFL = FocalLen * abs( BasePos - CurPos ); 2506 Double dZ = abs( 1.0 / Znear - 1.0 / Zfar ) * ((Double)(AvgDepth) / (( 1 << g_bitDepthY ) - 1) ) + abs(1.0 / Zfar); 2507 Int iDisparity = (Int)(Direction*dFL * dZ); 2508 Int shift = DISTORTION_PRECISION_ADJUSTMENT(g_bitDepthY-8); 2509 Int Disp = iDisparity; 2510 2511 for( y = 0; y < iHeight; y++ ) 2512 { 2513 for( x = 0; x < iWidth; x++ ) 2514 { 2515 SAD += abs( pOrg[Clip3(0, (Int)(pcCU->getPic()->getPicYuvOrg()->getWidth() - pcCU->getSlice()->getSPS()->getMaxCUWidth()), x + Disp)] 2516 - pRec[Clip3(0, (Int)(pcCU->getPic()->getPicYuvOrg()->getWidth() - pcCU->getSlice()->getSPS()->getMaxCUWidth()), x + Disp)] )>>shift; 2517 } 2518 pOrg += iStride; 2519 pRec += iStride; 2520 } 2521 m_pcLCUData[m_indexLCU].m_qp = iQP; 2522 m_pcLCUData[m_indexLCU].m_costMAD = (SAD /(Double)(iWidth*iHeight)); 2523 m_pcLCUData[m_indexLCU].m_bits = (Int)uiBits; 2524 } 2525 #endif 2526 2527 2214 2528 Double TEncRateCtrl::xAdjustmentBits(Int& reductionBits, Int& compensationBits) 2215 2529 { -
branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncRateCtrl.h
r608 r635 98 98 Int m_targetBitsLeft; 99 99 #endif 100 101 #if KWU_RC_MADPRED_E0227 102 Double m_MAD; 103 104 Int m_CUWidth; 105 Int m_CUHeight; 106 Double m_IVMAD; 107 #endif 100 108 }; 101 109 … … 248 256 249 257 public: 258 #if KWU_RC_MADPRED_E0227 259 Void create( TEncRCSeq* encRCSeq, TEncRCGOP* encRCGOP, Int frameLevel, list<TEncRCPic*>& listPreviousPictures, Int LayerID ); 260 #else 250 261 Void create( TEncRCSeq* encRCSeq, TEncRCGOP* encRCGOP, Int frameLevel, list<TEncRCPic*>& listPreviousPictures ); 262 #endif 251 263 Void destroy(); 252 264 265 #if KWU_RC_MADPRED_E0227 266 Double estimatePicLambdaIV( list<TEncRCPic*>& listPreviousPictures, Int CurPOC ); 267 #endif 253 268 #if !RATE_CONTROL_INTRA 254 269 Double estimatePicLambda( list<TEncRCPic*>& listPreviousPictures ); … … 267 282 Double getLCUTargetBpp(); 268 283 #endif 284 285 #if KWU_RC_MADPRED_E0227 286 Double getLCUTargetBppforInterView( list<TEncRCPic*>& listPreviousPictures, TComDataCU* pcCU, Double BasePos, Double CurPos, Double FocalLen, Double Znear, Double Zfar, Int Direction, Int* iDisparity ); 287 #endif 288 269 289 Double getLCUEstLambda( Double bpp ); 270 290 Int getLCUEstQP( Double lambda, Int clipPicQP ); … … 282 302 283 303 Void addToPictureLsit( list<TEncRCPic*>& listPreviousPictures ); 304 305 #if KWU_RC_MADPRED_E0227 306 Void addToPictureLsitIV( list<TEncRCPic*>& listPreviousPictures ); 307 Void setIVPic( TEncRCPic* BaseRCPic ); 308 #endif 309 284 310 #if !M0036_RC_IMPROVEMENT 285 311 Double getEffectivePercentage(); … … 322 348 #endif 323 349 350 #if KWU_RC_MADPRED_E0227 351 Double getTotalMAD() { return m_totalMAD; } 352 Void setTotalMAD( Double MAD ) { m_totalMAD = MAD; } 353 354 Double getIVTotalMAD() { return m_IVtotalMAD; } 355 Void setIVTotalMAD( Double MAD ) { m_IVtotalMAD = MAD; } 356 #endif 357 324 358 Int getPicActualBits() { return m_picActualBits; } 325 359 Int getPicActualQP() { return m_picQP; } … … 330 364 Void setPicEstLambda( Double lambda ) { m_picLambda = lambda; } 331 365 366 #if KWU_RC_MADPRED_E0227 367 Int getLayerID() { return m_LayerID; } 368 Void setLayerID(Int layerid) { m_LayerID = layerid; } 369 #endif 370 332 371 private: 333 372 TEncRCSeq* m_encRCSeq; … … 361 400 TEncRCPic* m_lastPicture; 362 401 #endif 402 403 #if KWU_RC_MADPRED_E0227 404 Double m_totalMAD; 405 TEncRCPic* m_lastPicture; 406 Int m_LayerID; 407 TEncRCPic* m_lastIVPicture; 408 Double m_IVtotalMAD; 409 #endif 363 410 }; 364 411 … … 371 418 public: 372 419 #if M0036_RC_IMPROVEMENT 420 #if KWU_RC_MADPRED_E0227 421 Void init( Int totalFrames, Int targetBitrate, Int frameRate, Int GOPSize, Int picWidth, Int picHeight, Int LCUWidth, Int LCUHeight, Bool keepHierBits, Bool useLCUSeparateModel, GOPEntry GOPList[MAX_GOP], Int LayerID ); 422 #else 373 423 Void init( Int totalFrames, Int targetBitrate, Int frameRate, Int GOPSize, Int picWidth, Int picHeight, Int LCUWidth, Int LCUHeight, Int keepHierBits, Bool useLCUSeparateModel, GOPEntry GOPList[MAX_GOP] ); 424 #endif 374 425 #else 375 426 Void init( Int totalFrames, Int targetBitrate, Int frameRate, Int GOPSize, Int picWidth, Int picHeight, Int LCUWidth, Int LCUHeight, Bool keepHierBits, Bool useLCUSeparateModel, GOPEntry GOPList[MAX_GOP] ); … … 388 439 list<TEncRCPic*>& getPicList() { return m_listRCPictures; } 389 440 441 #if KWU_RC_MADPRED_E0227 442 Int getLayerID() { return m_LayerID; } 443 Void setLayerID(Int layerid) { m_LayerID = layerid; } 444 #endif 445 390 446 private: 391 447 TEncRCSeq* m_encRCSeq; … … 394 450 list<TEncRCPic*> m_listRCPictures; 395 451 Int m_RCQP; 452 453 #if KWU_RC_MADPRED_E0227 454 Int m_LayerID; 455 #endif 396 456 }; 397 457 … … 518 578 Void updataRCUnitStatus (); 519 579 Void updateLCUData (TComDataCU* pcCU, UInt64 actualLCUBits, Int qp); 580 #if KWU_RC_MADPRED_E0227 581 Void updateLCUDataEnhancedView(TComDataCU* pcCU, UInt64 uiBits, Int iQP, Double BasePos, Double CurPos, Double FocalLen, Double Znear, Double Zfar, Int Direction); 582 #endif 520 583 Void updateFrameData (UInt64 actualFrameBits); 521 584 Double xAdjustmentBits (Int& reductionBits, Int& compensationBits); -
branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncSlice.cpp
r622 r635 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 m_pcRateCtrl = pcEncTop->getRateCtrl(); 159 if(m_pcCfg->getUseRateCtrl()) 160 m_pcRateCtrl = pcEncTop->getRateCtrl(); 161 else 162 m_pcRateCtrl = NULL; 160 163 } 161 164 … … 321 324 } 322 325 #if !RATE_CONTROL_LAMBDA_DOMAIN 323 if ( m_pcCfg->getUseRateCtrl() )326 if ( m_pcCfg->getUseRateCtrl() && !m_pcCfg->getIsDepth()) 324 327 { 325 328 dQP = m_pcRateCtrl->getFrameQP(rpcSlice->isReferenced(), rpcSlice->getPOC()); … … 1123 1126 #endif 1124 1127 #if !RATE_CONTROL_LAMBDA_DOMAIN 1125 if(m_pcCfg->getUseRateCtrl()) 1126 { 1128 if(m_pcCfg->getUseRateCtrl() && !m_pcCfg->getIsDepth()) 1129 { 1130 #if KWU_RC_MADPRED_E0227 1131 if(pcSlice->getLayerId() != 0 && m_pcCfg->getUseDepthMADPred() && !pcSlice->getIsDepth()) 1132 { 1133 double Zn, Zf, FocalLength, Position, CamShift; 1134 double BasePos; 1135 bool bInterpolated; 1136 Int Direction = pcSlice->getViewId() - pcCU->getSlice()->getIvPic(false, 0)->getViewId(); 1137 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); 1141 1142 m_pcRateCtrl->updateLCUDataEnhancedView(pcCU, pcCU->getTotalBits(), pcCU->getQP(0), BasePos, Position, FocalLength, Zn, Zf, (Direction > 0 ? 1 : -1)); 1143 } 1144 #endif 1127 1145 if(m_pcRateCtrl->calculateUnitQP()) 1128 1146 { … … 1223 1241 else 1224 1242 { 1243 #if KWU_RC_MADPRED_E0227 1244 if(pcSlice->getLayerId() != 0 && m_pcCfg->getUseDepthMADPred() && !pcSlice->getIsDepth()) 1245 { 1246 double Zn, Zf, FocalLength, Position, CamShift; 1247 double BasePos; 1248 bool bInterpolated; 1249 Int Direction = pcSlice->getViewId() - pcCU->getSlice()->getIvPic(false, 0)->getViewId(); 1250 Int iDisparity; 1251 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); 1255 bpp = m_pcRateCtrl->getRCPic()->getLCUTargetBppforInterView( m_pcRateCtrl->getPicList(), pcCU, 1256 BasePos, Position, FocalLength, Zn, Zf, (Direction > 0 ? 1 : -1), &iDisparity ); 1257 } 1258 else 1259 { 1260 #endif 1225 1261 #if RATE_CONTROL_INTRA 1226 1262 bpp = m_pcRateCtrl->getRCPic()->getLCUTargetBpp(pcSlice->getSliceType()); … … 1239 1275 estQP = m_pcRateCtrl->getRCPic()->getLCUEstQP ( estLambda, pcSlice->getSliceQp() ); 1240 1276 #endif 1241 1277 #if KWU_RC_MADPRED_E0227 1278 } 1279 #endif 1280 #if KWU_RC_MADPRED_E0227 1281 estLambda = m_pcRateCtrl->getRCPic()->getLCUEstLambda( bpp ); 1282 estQP = m_pcRateCtrl->getRCPic()->getLCUEstQP ( estLambda, pcSlice->getSliceQp() ); 1283 #endif 1242 1284 estQP = Clip3( -pcSlice->getSPS()->getQpBDOffsetY(), MAX_QP, estQP ); 1243 1285 … … 1341 1383 #if TICKET_1090_FIX 1342 1384 #if RATE_CONTROL_LAMBDA_DOMAIN 1343 if ( m_pcCfg->getUseRateCtrl() )1344 { 1345 #if !M0036_RC_IMPROVEMENT 1385 if ( m_pcCfg->getUseRateCtrl() && !m_pcCfg->getIsDepth() ) 1386 { 1387 #if !M0036_RC_IMPROVEMENT || KWU_RC_MADPRED_E0227 1346 1388 UInt SAD = m_pcCuEncoder->getLCUPredictionSAD(); 1347 1389 Int height = min( pcSlice->getSPS()->getMaxCUHeight(),pcSlice->getSPS()->getPicHeightInLumaSamples() - uiCUAddr / rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUHeight() ); … … 1406 1448 m_uiPicDist += pcCU->getTotalDistortion(); 1407 1449 #if !RATE_CONTROL_LAMBDA_DOMAIN 1408 if(m_pcCfg->getUseRateCtrl() )1450 if(m_pcCfg->getUseRateCtrl() && !m_pcCfg->getIsDepth()) 1409 1451 { 1410 1452 m_pcRateCtrl->updateLCUData(pcCU, pcCU->getTotalBits(), pcCU->getQP(0)); … … 1427 1469 xRestoreWPparam( pcSlice ); 1428 1470 #if !RATE_CONTROL_LAMBDA_DOMAIN 1429 if(m_pcCfg->getUseRateCtrl() )1471 if(m_pcCfg->getUseRateCtrl() && !m_pcCfg->getIsDepth()) 1430 1472 { 1431 1473 m_pcRateCtrl->updateFrameData(m_uiPicTotalBits); -
branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncTop.cpp
r622 r635 123 123 if ( m_RCEnableRateControl ) 124 124 { 125 #if KWU_RC_MADPRED_E0227 126 m_cRateCtrl.init( m_framesToBeEncoded, m_RCTargetBitrate, m_iFrameRate, m_iGOPSize, m_iSourceWidth, m_iSourceHeight, 127 g_uiMaxCUWidth, g_uiMaxCUHeight, m_RCKeepHierarchicalBit, m_RCUseLCUSeparateModel, m_GOPList, getLayerId() ); 128 #else 125 129 m_cRateCtrl.init( m_framesToBeEncoded, m_RCTargetBitrate, m_iFrameRate, m_iGOPSize, m_iSourceWidth, m_iSourceHeight, 126 130 g_uiMaxCUWidth, g_uiMaxCUHeight, m_RCKeepHierarchicalBit, m_RCUseLCUSeparateModel, m_GOPList ); 127 } 128 #else 129 m_cRateCtrl.create(getIntraPeriod(), getGOPSize(), getFrameRate(), getTargetBitrate(), getQP(), getNumLCUInUnit(), getSourceWidth(), getSourceHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight); 131 #endif 132 } 133 #else 134 if(m_enableRateCtrl) 135 m_cRateCtrl.create(getIntraPeriod(), getGOPSize(), getFrameRate(), getTargetBitrate(), getQP(), getNumLCUInUnit(), getSourceWidth(), getSourceHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight); 130 136 #endif 131 137 // if SBAC-based RD optimization is used … … 224 230 } 225 231 m_cLoopFilter. destroy(); 226 m_cRateCtrl. destroy();227 232 // SBAC RD 228 233 if( m_bUseSBACRD ) … … 284 289 } 285 290 291 #if KWU_RC_MADPRED_E0227 292 Void TEncTop::init(TAppEncTop* pcTAppEncTop) 293 #else 286 294 Void TEncTop::init() 295 #endif 287 296 { 288 297 // initialize SPS … … 310 319 m_cCuEncoder. init( this ); 311 320 321 #if KWU_RC_MADPRED_E0227 322 m_pcTAppEncTop = pcTAppEncTop; 323 #endif 312 324 // initialize transform & quantization class 313 325 m_pcCavlcCoder = getCavlcCoder(); … … 739 751 m_cPPS.setMinCuDQPSize( m_cPPS.getSPS()->getMaxCUWidth() >> ( m_cPPS.getMaxCuDQPDepth()) ); 740 752 } 753 #else 754 if ( m_enableRateCtrl ) 755 { 756 m_cPPS.setUseDQP(true); 757 m_cPPS.setMaxCuDQPDepth( 0 ); 758 m_cPPS.setMinCuDQPSize( m_cPPS.getSPS()->getMaxCUWidth() >> ( m_cPPS.getMaxCuDQPDepth()) ); 759 } 741 760 #endif 742 761 -
branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncTop.h
r608 r635 64 64 // ==================================================================================================================== 65 65 66 #if KWU_RC_MADPRED_E0227 67 class TAppEncTop; 68 #endif 66 69 /// encoder class 67 70 class TEncTop : public TEncCfg … … 124 127 TComScalingList m_scalingList; ///< quantization matrix information 125 128 TEncRateCtrl m_cRateCtrl; ///< Rate control class 129 130 #if KWU_RC_MADPRED_E0227 131 TAppEncTop* m_pcTAppEncTop; 132 TAppComCamPara* m_cCamParam; 133 #endif 126 134 127 135 #if H_MV … … 145 153 Void create (); 146 154 Void destroy (); 155 #if KWU_RC_MADPRED_E0227 156 Void init ( TAppEncTop* pcTAppEncTop ); 157 #else 147 158 Void init (); 159 #endif 160 148 161 #if H_MV 149 162 TComPicLists* getIvPicLists() { return m_ivPicLists; } … … 185 198 TEncSbac* getRDGoOnSbacCoders () { return m_pcRDGoOnSbacCoders; } 186 199 TEncRateCtrl* getRateCtrl () { return &m_cRateCtrl; } 200 #if KWU_RC_MADPRED_E0227 201 TAppEncTop* getEncTop () { return m_pcTAppEncTop; } 202 TAppComCamPara* getCamParam() { return m_cCamParam;} 203 Void setCamParam(TAppComCamPara * pCamparam) { m_cCamParam = pCamparam;} 204 #endif 187 205 TComSPS* getSPS () { return &m_cSPS; } 188 206 TComPPS* getPPS () { return &m_cPPS; }
Note: See TracChangeset for help on using the changeset viewer.