Changeset 62 in 3DVCSoftware for branches/HTM-3.0-LG/source
- Timestamp:
- 18 May 2012, 09:38:25 (13 years ago)
- Location:
- branches/HTM-3.0-LG/source/Lib
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-3.0-LG/source/Lib/TLibCommon/TComDataCU.cpp
r56 r62 2883 2883 } 2884 2884 2885 #if LG_RESTRICTEDRESPRED_M24766 2886 Void TComDataCU::getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx, Bool bLCU) 2887 { 2888 UInt uiNumPartition = bLCU ? (getWidth(uiAbsPartIdx)*getHeight(uiAbsPartIdx) >> 4) : m_uiNumPartition; 2889 UInt uiTmpAbsPartIdx = bLCU ? uiAbsPartIdx : 0; 2890 2891 switch ( m_pePartSize[uiTmpAbsPartIdx] ) 2892 { 2893 case SIZE_2NxN: 2894 riWidth = getWidth(uiTmpAbsPartIdx); riHeight = getHeight(uiTmpAbsPartIdx) >> 1; ruiPartAddr = ( uiPartIdx == 0 )? 0 : uiNumPartition >> 1; 2895 break; 2896 case SIZE_Nx2N: 2897 riWidth = getWidth(uiTmpAbsPartIdx) >> 1; riHeight = getHeight(uiTmpAbsPartIdx); ruiPartAddr = ( uiPartIdx == 0 )? 0 : uiNumPartition >> 2; 2898 break; 2899 case SIZE_NxN: 2900 riWidth = getWidth(uiTmpAbsPartIdx) >> 1; riHeight = getHeight(uiTmpAbsPartIdx) >> 1; ruiPartAddr = ( uiNumPartition >> 2 ) * uiPartIdx; 2901 break; 2902 case SIZE_2NxnU: 2903 riWidth = getWidth(uiTmpAbsPartIdx); 2904 riHeight = ( uiPartIdx == 0 ) ? getHeight(uiTmpAbsPartIdx) >> 2 : ( getHeight(uiTmpAbsPartIdx) >> 2 ) + ( getHeight(uiTmpAbsPartIdx) >> 1 ); 2905 ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : uiNumPartition >> 3; 2906 break; 2907 case SIZE_2NxnD: 2908 riWidth = getWidth(uiTmpAbsPartIdx); 2909 riHeight = ( uiPartIdx == 0 ) ? ( getHeight(uiTmpAbsPartIdx) >> 2 ) + ( getHeight(uiTmpAbsPartIdx) >> 1 ) : getHeight(uiTmpAbsPartIdx) >> 2; 2910 ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : (uiNumPartition >> 1) + (uiNumPartition >> 3); 2911 break; 2912 case SIZE_nLx2N: 2913 riWidth = ( uiPartIdx == 0 ) ? getWidth(uiTmpAbsPartIdx) >> 2 : ( getWidth(uiTmpAbsPartIdx) >> 2 ) + ( getWidth(uiTmpAbsPartIdx) >> 1 ); 2914 riHeight = getHeight(uiTmpAbsPartIdx); 2915 ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : uiNumPartition >> 4; 2916 break; 2917 case SIZE_nRx2N: 2918 riWidth = ( uiPartIdx == 0 ) ? ( getWidth(uiTmpAbsPartIdx) >> 2 ) + ( getWidth(uiTmpAbsPartIdx) >> 1 ) : getWidth(uiTmpAbsPartIdx) >> 2; 2919 riHeight = getHeight(uiTmpAbsPartIdx); 2920 ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : (uiNumPartition >> 2) + (uiNumPartition >> 4); 2921 break; 2922 default: 2923 assert ( m_pePartSize[0] == SIZE_2Nx2N ); 2924 riWidth = getWidth(uiTmpAbsPartIdx); riHeight = getHeight(uiTmpAbsPartIdx); ruiPartAddr = 0; 2925 break; 2926 } 2927 } 2928 #else 2885 2929 Void TComDataCU::getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight ) 2886 2930 { … … 2922 2966 } 2923 2967 } 2924 2968 #endif 2969 2970 #if LG_RESTRICTEDRESPRED_M24766 2971 Int TComDataCU::getResiPredMode(UInt uiPartAddr) 2972 { 2973 Int iAddResiShift = -1; 2974 2975 for(UInt uiRefIdx = 0; uiRefIdx < 2; uiRefIdx++) 2976 { 2977 RefPicList eRefList = uiRefIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 2978 Int iBestRefIdx = getCUMvField(eRefList)->getRefIdx(uiPartAddr); 2979 if(iBestRefIdx >= 0 && getSlice()->getViewId() == getSlice()->getRefViewId(eRefList, iBestRefIdx)) 2980 iAddResiShift++; 2981 } 2982 2983 return iAddResiShift; 2984 } 2985 2986 Void TComDataCU::getPUResiPredShift(Int *iPUResiPredShift, UInt uiAbsPartIndex) 2987 { 2988 UInt uiPartSize = getPartitionSize(uiAbsPartIndex); 2989 UInt uiPartAddr; 2990 Int iWidth, iHeight; 2991 Int iAddResiShift; 2992 2993 if(uiPartSize == SIZE_2Nx2N) 2994 { 2995 iAddResiShift = getResiPredMode(uiAbsPartIndex); 2996 for(UInt i = 0; i < 4; i++) 2997 iPUResiPredShift[i] = (getSlice()->getPPS()->getUseWP() || getInterDir(uiAbsPartIndex) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1); 2998 return; 2999 } 3000 3001 if(uiPartSize == SIZE_2NxN || uiPartSize == SIZE_2NxnU || uiPartSize == SIZE_2NxnD) 3002 { 3003 for(UInt i = 0; i < 2; i++) 3004 { 3005 getPartIndexAndSize(i, uiPartAddr, iWidth, iHeight, uiAbsPartIndex, true); 3006 uiPartAddr += uiAbsPartIndex; 3007 iAddResiShift = getResiPredMode(uiPartAddr); 3008 iPUResiPredShift[2*i] = iPUResiPredShift[2*i+1] = (getSlice()->getPPS()->getUseWP() || getInterDir(uiPartAddr) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1); 3009 } 3010 return; 3011 } 3012 3013 if(uiPartSize == SIZE_Nx2N || uiPartSize == SIZE_nLx2N || uiPartSize == SIZE_nRx2N) 3014 { 3015 for(UInt i = 0; i < 2; i++) 3016 { 3017 getPartIndexAndSize(i, uiPartAddr, iWidth, iHeight, uiAbsPartIndex, true); 3018 uiPartAddr += uiAbsPartIndex; 3019 iAddResiShift = getResiPredMode(uiPartAddr); 3020 iPUResiPredShift[i] = iPUResiPredShift[2+i] = (getSlice()->getPPS()->getUseWP() || getInterDir(uiPartAddr) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1); 3021 } 3022 return; 3023 } 3024 3025 if(uiPartSize == SIZE_NxN) 3026 { 3027 for(UInt i = 0; i < 4; i++) 3028 { 3029 getPartIndexAndSize(i, uiPartAddr, iWidth, iHeight, uiAbsPartIndex, true); 3030 uiPartAddr += uiAbsPartIndex; 3031 iAddResiShift = getResiPredMode(uiPartAddr); 3032 iPUResiPredShift[i] = (getSlice()->getPPS()->getUseWP() || getInterDir(uiPartAddr) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1); 3033 } 3034 } 3035 3036 } 3037 #endif 2925 3038 2926 3039 Void TComDataCU::getMvField ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList, TComMvField& rcMvField ) -
branches/HTM-3.0-LG/source/Lib/TLibCommon/TComDataCU.h
r56 r62 526 526 // member functions for accessing partition information 527 527 // ------------------------------------------------------------------------------------------------------------------- 528 528 #if LG_RESTRICTEDRESPRED_M24766 529 Void getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx = 0, Bool bLCU = false); 530 #else 529 531 Void getPartIndexAndSize ( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight ); 532 #endif 533 #if LG_RESTRICTEDRESPRED_M24766 534 Int getResiPredMode(UInt uiPartAddr); 535 Void getPUResiPredShift (Int *iPUPredResiShift, UInt uiAbsPartIndex); 536 #endif 530 537 UChar getNumPartInter (); 531 538 Bool isFirstAbsZorderIdxInDepth (UInt uiAbsPartIdx, UInt uiDepth); -
branches/HTM-3.0-LG/source/Lib/TLibCommon/TComResidualGenerator.cpp
r56 r62 335 335 Pel* pRes = pcCUResidual->getLumaAddr(); 336 336 UInt uiLumaTrMode, uiChromaTrMode; 337 #if LG_RESTRICTEDRESPRED_M24766 338 Int iPUPredResiShift[4]; 339 #endif 337 340 pcCU->convertTransIdx ( 0, pcCU->getTransformIdx( 0 ), uiLumaTrMode, uiChromaTrMode ); 338 341 #if H0736_AVC_STYLE_QP_RANGE … … 363 366 Bool bOK = pcCU->getResidualSamples( 0, m_ppcYuvTmp[0] ); 364 367 AOF( bOK ); 368 #if LG_RESTRICTEDRESPRED_M24766 369 pcCU->getPUResiPredShift(iPUPredResiShift, 0); 370 pcCUResidual->add(iPUPredResiShift, pcCU->getPartitionSize(0), m_ppcYuvTmp[0], pcCU->getWidth( 0 ), pcCU->getHeight( 0 ) ); 371 #else 365 372 pcCUResidual->add( m_ppcYuvTmp[0], pcCU->getWidth( 0 ), pcCU->getHeight( 0 ) ); 373 #endif 366 374 } 367 375 -
branches/HTM-3.0-LG/source/Lib/TLibCommon/TComYuv.cpp
r56 r62 392 392 } 393 393 394 394 #if LG_RESTRICTEDRESPRED_M24766 395 Void 396 TComYuv::add(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract ) 397 { 398 addLuma (iPUResiPredShift, uhPartitionSize, pcYuvAdd, iWidth, iHeight, bSubtract ); 399 addChroma (iPUResiPredShift, uhPartitionSize, pcYuvAdd, iWidth>>1, iHeight>>1, bSubtract ); 400 } 401 #else 395 402 Void 396 403 TComYuv::add( TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract ) … … 399 406 addChroma ( pcYuvAdd, iWidth>>1, iHeight>>1, bSubtract ); 400 407 } 401 408 #endif 409 410 #if LG_RESTRICTEDRESPRED_M24766 411 void 412 TComYuv::getPUXYOffset(PartSize uhPartitionSize, Int iWidth, Int iHeight, Int &iXOffset, Int &iYOffset) 413 { 414 switch(uhPartitionSize) 415 { 416 case SIZE_2NxN: 417 iXOffset = iWidth; iYOffset = iHeight >> 1; break; 418 case SIZE_2NxnU: 419 iXOffset = iWidth; iYOffset = iHeight >> 2; break; 420 case SIZE_2NxnD: 421 iXOffset = iWidth; iYOffset = (iHeight >> 1) + (iHeight >> 2); break; 422 case SIZE_Nx2N: 423 iXOffset = iWidth >> 1; iYOffset = iHeight; break; 424 case SIZE_nLx2N: 425 iXOffset = iWidth >> 2; iYOffset = iHeight; break; 426 case SIZE_nRx2N: 427 iXOffset = (iWidth >> 1) + (iWidth >> 2); iYOffset = iHeight; break; 428 case SIZE_NxN: 429 iXOffset = iWidth >> 1; iYOffset = iHeight >> 1; break; 430 default: 431 assert(uhPartitionSize == SIZE_2Nx2N); 432 iXOffset = iWidth; iYOffset = iHeight; break; 433 } 434 } 435 #endif 436 437 #if LG_RESTRICTEDRESPRED_M24766 438 Void 439 TComYuv::addLuma(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract ) 440 #else 402 441 Void 403 442 TComYuv::addLuma( TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract ) 443 #endif 404 444 { 405 445 Int iScale = ( bSubtract ? -1 : 1 ); … … 408 448 Pel* pAddSamples = pcYuvAdd->getLumaAddr(); 409 449 Pel* pDstSamples = getLumaAddr(); 450 451 #if LG_RESTRICTEDRESPRED_M24766 452 Int iXOffset, iYOffset; 453 454 getPUXYOffset(uhPartitionSize, iWidth, iHeight, iXOffset, iYOffset); 455 456 for( Int iY = 0; iY < iYOffset; iY++, pDstSamples += iDstStride, pAddSamples += iAddStride ) 457 { 458 if(iPUResiPredShift[0] >= 0) 459 { 460 for( Int iX = 0; iX < iXOffset; iX++ ) 461 { 462 pDstSamples[iX] += iScale * (pAddSamples[iX] >> iPUResiPredShift[0]); 463 } 464 } 465 466 if(iPUResiPredShift[1] >= 0) 467 { 468 for( Int iX = iXOffset; iX < iWidth; iX++ ) 469 { 470 pDstSamples[iX] += iScale * (pAddSamples[iX] >> iPUResiPredShift[1]); 471 } 472 } 473 } 474 475 for( Int iY = iYOffset; iY < iHeight; iY++, pDstSamples += iDstStride, pAddSamples += iAddStride ) 476 { 477 if(iPUResiPredShift[2] >= 0) 478 { 479 for( Int iX = 0; iX < iXOffset; iX++ ) 480 { 481 pDstSamples[iX] += iScale * (pAddSamples[iX] >> iPUResiPredShift[2]); 482 } 483 } 484 485 if(iPUResiPredShift[3] >= 0) 486 { 487 for( Int iX = iXOffset; iX < iWidth; iX++ ) 488 { 489 pDstSamples[iX] += iScale * (pAddSamples[iX] >> iPUResiPredShift[3]); 490 } 491 } 492 } 493 #else 410 494 for( Int iY = 0; iY < iHeight; iY++, pDstSamples += iDstStride, pAddSamples += iAddStride ) 411 495 { … … 415 499 } 416 500 } 417 } 418 501 #endif 502 } 503 504 #if LG_RESTRICTEDRESPRED_M24766 505 Void 506 TComYuv::addChroma(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract ) 507 #else 419 508 Void 420 509 TComYuv::addChroma( TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract ) 510 #endif 421 511 { 422 512 Int iScale = ( bSubtract ? -1 : 1 ); … … 427 517 Pel* pDstSamplesCb = getCbAddr(); 428 518 Pel* pDstSamplesCr = getCrAddr(); 519 520 #if LG_RESTRICTEDRESPRED_M24766 521 Int iXOffset, iYOffset; 522 523 getPUXYOffset(uhPartitionSize, iWidth, iHeight, iXOffset, iYOffset); 524 525 for( Int iY = 0; iY < iYOffset; iY++, pDstSamplesCb += iDstStride, pAddSamplesCb += iAddStride, 526 pDstSamplesCr += iDstStride, pAddSamplesCr += iAddStride ) 527 { 528 if(iPUResiPredShift[0] >= 0) 529 { 530 for( Int iX = 0; iX < iXOffset; iX++ ) 531 { 532 pDstSamplesCb[iX] += iScale * (pAddSamplesCb[iX] >> iPUResiPredShift[0]); 533 pDstSamplesCr[iX] += iScale * (pAddSamplesCr[iX] >> iPUResiPredShift[0]); 534 } 535 } 536 537 if(iPUResiPredShift[1] >= 0) 538 { 539 for( Int iX = iXOffset; iX < iWidth; iX++ ) 540 { 541 pDstSamplesCb[iX] += iScale * (pAddSamplesCb[iX] >> iPUResiPredShift[1]); 542 pDstSamplesCr[iX] += iScale * (pAddSamplesCr[iX] >> iPUResiPredShift[1]); 543 } 544 } 545 } 546 547 for( Int iY = iYOffset; iY < iHeight; iY++, pDstSamplesCb += iDstStride, pAddSamplesCb += iAddStride, 548 pDstSamplesCr += iDstStride, pAddSamplesCr += iAddStride ) 549 { 550 if(iPUResiPredShift[2] >= 0) 551 { 552 for( Int iX = 0; iX < iXOffset; iX++ ) 553 { 554 pDstSamplesCb[iX] += iScale * (pAddSamplesCb[iX] >> iPUResiPredShift[2]); 555 pDstSamplesCr[iX] += iScale * (pAddSamplesCr[iX] >> iPUResiPredShift[2]); 556 } 557 } 558 559 if(iPUResiPredShift[3] >= 0) 560 { 561 for( Int iX = iXOffset; iX < iWidth; iX++ ) 562 { 563 pDstSamplesCb[iX] += iScale * (pAddSamplesCb[iX] >> iPUResiPredShift[3]); 564 pDstSamplesCr[iX] += iScale * (pAddSamplesCr[iX] >> iPUResiPredShift[3]); 565 } 566 } 567 } 568 #else 429 569 for( Int iY = 0; iY < iHeight; iY++, pDstSamplesCb += iDstStride, pAddSamplesCb += iAddStride, 430 570 pDstSamplesCr += iDstStride, pAddSamplesCr += iAddStride ) … … 436 576 } 437 577 } 578 #endif 438 579 } 439 580 … … 535 676 } 536 677 678 #if LG_RESTRICTEDRESPRED_M24766 679 Void TComYuv::subtract(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ) 680 { 681 subtractLuma (iPUResiPredShift, uhPartitionSize, pcYuvSrc0, pcYuvSrc1, uiTrUnitIdx, uiPartSize ); 682 subtractChroma(iPUResiPredShift, uhPartitionSize, pcYuvSrc0, pcYuvSrc1, uiTrUnitIdx, uiPartSize>>1 ); 683 } 684 #else 537 685 Void TComYuv::subtract( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ) 538 686 { 539 subtractLuma ( pcYuvSrc0, pcYuvSrc1, uiTrUnitIdx, uiPartSize ); 540 subtractChroma( pcYuvSrc0, pcYuvSrc1, uiTrUnitIdx, uiPartSize>>1 ); 541 } 542 687 subtractLuma ( pcYuvSrc0, pcYuvSrc1, uiTrUnitIdx, uiPartSize ); 688 subtractChroma( pcYuvSrc0, pcYuvSrc1, uiTrUnitIdx, uiPartSize>>1 ); 689 } 690 #endif 691 692 #if LG_RESTRICTEDRESPRED_M24766 693 Void TComYuv::subtractLuma(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ) 694 #else 543 695 Void TComYuv::subtractLuma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ) 696 #endif 544 697 { 545 698 Int x, y; … … 552 705 Int iSrc1Stride = pcYuvSrc1->getStride(); 553 706 Int iDstStride = getStride(); 707 708 #if LG_RESTRICTEDRESPRED_M24766 709 Int iXOffset, iYOffset; 710 711 getPUXYOffset(uhPartitionSize, uiPartSize, uiPartSize, iXOffset, iYOffset); 712 713 for ( y = uiPartSize-1; y >= iYOffset; y-- ) 714 { 715 if(iPUResiPredShift[3] >= 0) 716 { 717 for ( x = uiPartSize-1; x >= iXOffset; x-- ) 718 { 719 pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[3]); 720 } 721 } 722 723 if(iPUResiPredShift[2] >= 0) 724 { 725 for ( x = iXOffset-1; x >= 0; x-- ) 726 { 727 pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[2]); 728 } 729 } 730 pSrc0 += iSrc0Stride; 731 pSrc1 += iSrc1Stride; 732 pDst += iDstStride; 733 } 734 735 for ( y = iYOffset-1; y >= 0; y-- ) 736 { 737 if(iPUResiPredShift[1] >= 0) 738 { 739 for ( x = uiPartSize-1; x >= iXOffset; x-- ) 740 { 741 pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[3]); 742 } 743 } 744 745 if(iPUResiPredShift[0] >= 0) 746 { 747 for ( x = iXOffset-1; x >= 0; x-- ) 748 { 749 pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[2]); 750 } 751 } 752 pSrc0 += iSrc0Stride; 753 pSrc1 += iSrc1Stride; 754 pDst += iDstStride; 755 } 756 757 #else 554 758 for ( y = uiPartSize-1; y >= 0; y-- ) 555 759 { … … 562 766 pDst += iDstStride; 563 767 } 564 } 565 768 #endif 769 } 770 771 #if LG_RESTRICTEDRESPRED_M24766 772 Void TComYuv::subtractChroma(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ) 773 #else 566 774 Void TComYuv::subtractChroma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ) 775 #endif 567 776 { 568 777 Int x, y; … … 578 787 Int iSrc1Stride = pcYuvSrc1->getCStride(); 579 788 Int iDstStride = getCStride(); 789 #if LG_RESTRICTEDRESPRED_M24766 790 Int iXOffset, iYOffset; 791 792 getPUXYOffset(uhPartitionSize, uiPartSize, uiPartSize, iXOffset, iYOffset); 793 794 for ( y = uiPartSize-1; y >= iYOffset; y-- ) 795 { 796 if(iPUResiPredShift[3] >= 0) 797 { 798 for ( x = uiPartSize-1; x >= iXOffset; x-- ) 799 { 800 pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[3]); 801 pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[3]); 802 } 803 } 804 805 if(iPUResiPredShift[2] >= 0) 806 { 807 for ( x = iXOffset-1; x >= 0; x-- ) 808 { 809 pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[2]); 810 pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[2]); 811 } 812 } 813 pSrcU0 += iSrc0Stride; 814 pSrcU1 += iSrc1Stride; 815 pSrcV0 += iSrc0Stride; 816 pSrcV1 += iSrc1Stride; 817 pDstU += iDstStride; 818 pDstV += iDstStride; 819 } 820 821 for ( y = iYOffset-1; y >= 0; y-- ) 822 { 823 if(iPUResiPredShift[1] >= 0) 824 { 825 for ( x = uiPartSize-1; x >= iXOffset; x-- ) 826 { 827 pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[1]); 828 pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[1]); 829 } 830 } 831 832 if(iPUResiPredShift[0] >= 0) 833 { 834 for ( x = iXOffset-1; x >= 0; x-- ) 835 { 836 pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[0]); 837 pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[0]); 838 } 839 } 840 pSrcU0 += iSrc0Stride; 841 pSrcU1 += iSrc1Stride; 842 pSrcV0 += iSrc0Stride; 843 pSrcV1 += iSrc1Stride; 844 pDstU += iDstStride; 845 pDstV += iDstStride; 846 } 847 #else 580 848 for ( y = uiPartSize-1; y >= 0; y-- ) 581 849 { … … 592 860 pDstV += iDstStride; 593 861 } 862 #endif 594 863 } 595 864 -
branches/HTM-3.0-LG/source/Lib/TLibCommon/TComYuv.h
r56 r62 146 146 Void addClipPartLuma ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ); //GT 147 147 148 148 #if LG_RESTRICTEDRESPRED_M24766 149 149 // pcYuvSrc0 - pcYuvSrc1 -> m_apiBuf 150 Void subtract (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ); 151 Void subtractLuma (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ); 152 Void subtractChroma (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ); 153 #else 150 154 Void subtract ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ); 151 155 Void subtractLuma ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ); 152 156 Void subtractChroma ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ); 157 #endif 153 158 154 159 // (pcYuvSrc0 + pcYuvSrc1)/2 for YUV partition … … 161 166 // Remove High frequency 162 167 Void removeHighFreq ( TComYuv* pcYuvSrc, UInt uiPartIdx, UInt uiWidht, UInt uiHeight ); 163 168 #if LG_RESTRICTEDRESPRED_M24766 169 void getPUXYOffset (PartSize uhPartitionSize, Int iWidth, Int iHeight, Int &iXOffset, Int &iYOffset); 170 Void add (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract = false ); 171 Void addLuma (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract ); 172 Void addChroma (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract ); 173 #else 164 174 Void add ( TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract = false ); 165 175 Void addLuma ( TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract ); 166 176 Void addChroma ( TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract ); 177 #endif 167 178 168 179 Void clip ( Int iWidth, Int iHeight ); -
branches/HTM-3.0-LG/source/Lib/TLibCommon/TypeDef.h
r56 r62 68 68 69 69 70 70 #if HHI_INTER_VIEW_RESIDUAL_PRED 71 #define LG_RESTRICTEDRESPRED_M24766 1 // restricted inter-view residual prediction 72 #else 73 #define LG_RESTRICTEDRESPRED_M24766 0 74 #endif 71 75 72 76 -
branches/HTM-3.0-LG/source/Lib/TLibDecoder/TDecCu.cpp
r56 r62 638 638 Bool bOK = pcCU->getResidualSamples( 0, m_ppcYuvResPred[uiDepth] ); 639 639 AOF( bOK ); 640 #if LG_RESTRICTEDRESPRED_M24766 641 Int iPUResiPredShift[4]; 642 pcCU->getPUResiPredShift(iPUResiPredShift, 0); 643 m_ppcYuvReco[uiDepth]->add(iPUResiPredShift, pcCU->getPartitionSize(0), m_ppcYuvResPred[uiDepth], pcCU->getWidth( 0 ), pcCU->getHeight( 0 ) ); 644 #else 640 645 m_ppcYuvReco[uiDepth]->add( m_ppcYuvResPred[uiDepth], pcCU->getWidth( 0 ), pcCU->getHeight( 0 ) ); 646 #endif 641 647 } 642 648 #endif -
branches/HTM-3.0-LG/source/Lib/TLibDecoder/TDecEntropy.cpp
r56 r62 104 104 if( bResPredAvailable ) 105 105 { 106 #if LG_RESTRICTEDRESPRED_M24766 107 Int iPUResiPredShift[4]; 108 pcCU->getPUResiPredShift(iPUResiPredShift, uiAbsPartIdx); 109 if(iPUResiPredShift[0] >= 0 || iPUResiPredShift[1] >= 0 || iPUResiPredShift[2] >= 0 || iPUResiPredShift[3] >= 0 ) 110 #endif 106 111 m_pcEntropyDecoderIf->parseResPredFlag( pcCU, bResPredFlag, uiAbsPartIdx, uiDepth ); 107 112 } -
branches/HTM-3.0-LG/source/Lib/TLibEncoder/TEncCu.cpp
r56 r62 1903 1903 1904 1904 #if HHI_INTER_VIEW_RESIDUAL_PRED 1905 #if !LG_RESTRICTEDRESPRED_M24766 1905 1906 if( rpcTempCU->getResPredFlag( 0 ) ) 1906 1907 { // subtract residual prediction from original in motion search … … 1908 1909 } 1909 1910 #endif 1911 #endif 1910 1912 1911 1913 #if AMP_MRG 1912 1914 rpcTempCU->setMergeAMP (true); 1913 1915 #if HHI_INTERVIEW_SKIP 1916 #if LG_RESTRICTEDRESPRED_M24766 1917 m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcResPredTmp[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], bSkipRes, bUseMRG ); 1918 #else 1914 1919 m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], bSkipRes, bUseMRG ); 1920 #endif 1915 1921 #else 1916 1922 m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], false, bUseMRG ); … … 1925 1931 1926 1932 #if HHI_INTER_VIEW_RESIDUAL_PRED 1933 #if !LG_RESTRICTEDRESPRED_M24766 1927 1934 if( rpcTempCU->getResPredFlag( 0 ) ) 1928 1935 { // add residual prediction to original again 1929 1936 m_ppcOrigYuv[uhDepth]->add( m_ppcResPredTmp [uhDepth], rpcTempCU->getWidth( 0 ), rpcTempCU->getHeight( 0 ) ); 1930 1937 } 1938 #endif 1931 1939 #endif 1932 1940 -
branches/HTM-3.0-LG/source/Lib/TLibEncoder/TEncEntropy.cpp
r56 r62 471 471 ROTVS( pcCU->isIntra ( uiAbsPartIdx ) ); 472 472 ROFVS( pcCU->getResPredAvail ( uiAbsPartIdx ) ); 473 473 #if LG_RESTRICTEDRESPRED_M24766 474 Int iPUResiPredShift[4]; 475 pcCU->getPUResiPredShift(iPUResiPredShift, uiAbsPartIdx); 476 if(iPUResiPredShift[0] >= 0 || iPUResiPredShift[1] >= 0 || iPUResiPredShift[2] >= 0 || iPUResiPredShift[3] >= 0 ) 477 #endif 474 478 // encode flag 475 479 m_pcEntropyCoderIf->codeResPredFlag( pcCU, uiAbsPartIdx ); -
branches/HTM-3.0-LG/source/Lib/TLibEncoder/TEncSearch.cpp
r56 r62 2505 2505 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost, TComMvField* cMvFieldNeighbours, UChar* uhInterDirNeighbours, Int& numValidMergeCand ) 2506 2506 #else 2507 #if LG_RESTRICTEDRESPRED_M24766 2508 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, TComYuv* rpcResiPredYuv, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost ) 2509 #else 2507 2510 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost ) 2511 #endif 2508 2512 #endif 2509 2513 { … … 2553 2557 const int maxNumMergeCand = MRG_MAX_NUM_CANDS_SIGNALED + ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 ); 2554 2558 #endif 2555 2559 #if LG_RESTRICTEDRESPRED_M24766 2560 Int iPUResiPredShift[4]; 2561 Int iLastAddResiShift = -1000; 2562 #endif 2556 2563 ruiCost = MAX_UINT; 2557 2564 for( UInt uiMergeCand = 0; uiMergeCand < numValidMergeCand; ++uiMergeCand ) … … 2565 2572 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx ); 2566 2573 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx ); 2567 2574 #if LG_RESTRICTEDRESPRED_M24766 2575 Int iAddResiShift; 2576 UInt uiPartAddr; 2577 Int iRoiWidth, iRoiHeight; 2578 2579 pcCU->getPartIndexAndSize( iPUIdx, uiPartAddr, iRoiWidth, iRoiHeight ); 2580 iAddResiShift = pcCU->getResiPredMode(uiPartAddr); 2581 iAddResiShift = (pcCU->getSlice()->getPPS()->getUseWP() || pcCU->getInterDir(uiPartAddr) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1 - iAddResiShift : -1); 2582 2583 if( pcCU->getResPredFlag( 0 )) 2584 { // subtract residual prediction from original in motion search 2585 if(iLastAddResiShift != iAddResiShift) 2586 { 2587 //add subtracted residual last time 2588 if(iLastAddResiShift >= 0) 2589 { 2590 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iLastAddResiShift; 2591 pcYuvOrg->add(iPUResiPredShift, ePartSize, rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 )); 2592 } 2593 //subtract residual 2594 if(iAddResiShift >= 0) 2595 { 2596 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iAddResiShift; 2597 pcYuvOrg->add(iPUResiPredShift, ePartSize, rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ), true ); 2598 } 2599 iLastAddResiShift = iAddResiShift; 2600 } 2601 } 2602 #endif 2568 2603 xGetInterPredictionError( pcCU, pcYuvOrg, iPUIdx, uiCostCand, m_pcEncCfg->getUseHADME() ); 2569 2604 uiBitsCand = uiMergeCand + 1; … … 2587 2622 } 2588 2623 } 2624 #if LG_RESTRICTEDRESPRED_M24766 2625 if( pcCU->getResPredFlag( 0 ) && iLastAddResiShift >= 0) 2626 { 2627 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iLastAddResiShift; 2628 pcYuvOrg->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 )); 2629 } 2630 #endif 2589 2631 } 2590 2632 … … 2599 2641 */ 2600 2642 #if AMP_MRG 2643 #if LG_RESTRICTEDRESPRED_M24766 2644 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv* rpcResiPredYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG ) 2645 #else 2601 2646 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG ) 2647 #endif 2602 2648 #else 2603 2649 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes ) … … 2702 2748 for (Int iNumRef=0; iNumRef < MAX_NUM_REF; iNumRef++) uiCostTempL0[iNumRef] = MAX_UINT; 2703 2749 UInt uiBitsTempL0[MAX_NUM_REF]; 2704 2750 #if LG_RESTRICTEDRESPRED_M24766 2751 Int iPUResiPredShift[4] = {0, 0, 0, 0}; 2752 #endif 2705 2753 xGetBlkBits( ePartSize, pcCU->getSlice()->isInterP(), iPartIdx, uiLastMode, uiMbBits); 2706 2754 … … 2718 2766 { 2719 2767 #endif 2720 2768 #if LG_RESTRICTEDRESPRED_M24766 2769 Bool bLastResiFlag = false; 2770 #endif 2721 2771 // Uni-directional prediction 2722 2772 for ( Int iRefList = 0; iRefList < iNumPredDir; iRefList++ ) … … 2726 2776 for ( Int iRefIdxTemp = 0; iRefIdxTemp < pcCU->getSlice()->getNumRefIdx(eRefPicList); iRefIdxTemp++ ) 2727 2777 { 2778 #if LG_RESTRICTEDRESPRED_M24766 2779 if( pcCU->getResPredFlag( 0 )) 2780 { 2781 if(pcCU->getSlice()->getViewId() == pcCU->getSlice()->getRefViewId(eRefPicList, iRefIdxTemp)) 2782 { // subtract residual prediction from original in motion search 2783 if(!bLastResiFlag) 2784 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ), true ); 2785 bLastResiFlag = true; 2786 } 2787 else 2788 { 2789 if(bLastResiFlag) 2790 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 )); 2791 bLastResiFlag = false; 2792 } 2793 } 2794 #endif 2728 2795 uiBitsTemp = uiMbBits[iRefList]; 2729 2796 if ( pcCU->getSlice()->getNumRefIdx(eRefPicList) > 1 ) … … 2889 2956 } 2890 2957 } 2958 #if LG_RESTRICTEDRESPRED_M24766 2959 if( pcCU->getResPredFlag( 0 ) && bLastResiFlag) 2960 { // subtract residual prediction from original in motion search 2961 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 )); 2962 } 2963 #endif 2891 2964 // Bi-directional prediction 2892 2965 if ( pcCU->getSlice()->isInterB() ) 2893 2966 { 2894 2967 #if LG_RESTRICTEDRESPRED_M24766 2968 Int iLastAddResiShift = -1000; 2969 #endif 2895 2970 cMvBi[0] = cMv[0]; cMvBi[1] = cMv[1]; 2896 2971 iRefIdxBi[0] = iRefIdx[0]; iRefIdxBi[1] = iRefIdx[1]; … … 2994 3069 #else 2995 3070 uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdxBi[iRefList][iRefIdxTemp]][AMVP_MAX_NUM_CANDS]; 3071 #endif 3072 #if LG_RESTRICTEDRESPRED_M24766 3073 Int iAddResiShift = -1, iPredFrom = 0; 3074 Int iBestRefIdx = pcCU->getCUMvField(eRefPicList == REF_PIC_LIST_0 ? REF_PIC_LIST_1 : REF_PIC_LIST_0)->getRefIdx(uiPartAddr); 3075 3076 iPredFrom = iBestRefIdx >= 0 ? 3 : 1; 3077 if(iBestRefIdx >= 0 && pcCU->getSlice()->getViewId() == pcCU->getSlice()->getRefViewId(eRefPicList == REF_PIC_LIST_0 ? REF_PIC_LIST_1 : REF_PIC_LIST_0, iBestRefIdx)) 3078 iAddResiShift++; 3079 if(pcCU->getSlice()->getViewId() == pcCU->getSlice()->getRefViewId(eRefPicList, iRefIdxTemp)) 3080 iAddResiShift++; 3081 iAddResiShift = (pcCU->getSlice()->getPPS()->getUseWP() || iPredFrom != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1); 3082 3083 if( pcCU->getResPredFlag( 0 ) ) 3084 { 3085 if(iLastAddResiShift != iAddResiShift) 3086 { 3087 //add substracted residual last time 3088 if(iLastAddResiShift >= 0 ) 3089 { 3090 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iLastAddResiShift; 3091 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 )); 3092 } 3093 //substract residual 3094 if(iAddResiShift >= 0) 3095 { 3096 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iAddResiShift; 3097 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ), true ); 3098 } 3099 iLastAddResiShift = iAddResiShift; 3100 } 3101 } 2996 3102 #endif 2997 3103 // call ME … … 3049 3155 } 3050 3156 } // for loop-iter 3157 #if LG_RESTRICTEDRESPRED_M24766 3158 if( pcCU->getResPredFlag( 0 ) && iLastAddResiShift >= 0) 3159 { 3160 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iLastAddResiShift; 3161 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 )); 3162 } 3163 #endif 3051 3164 } // if (B_SLICE) 3052 3165 #if ZERO_MVD_EST … … 3255 3368 if (bTestNormalMC) 3256 3369 { 3370 #if LG_RESTRICTEDRESPRED_M24766 3371 Int iAddResiShift = pcCU->getResiPredMode(uiPartAddr); 3372 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = \ 3373 (pcCU->getSlice()->getPPS()->getUseWP() || pcCU->getInterDir(uiPartAddr) != 3)? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1); 3374 if(pcCU->getResPredFlag(0) && iAddResiShift >= 0) 3375 { 3376 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ), true); 3377 } 3378 #endif 3257 3379 xGetInterPredictionError( pcCU, pcOrgYuv, iPartIdx, uiMEError, m_pcEncCfg->getUseHADME() ); 3258 3380 uiMECost = uiMEError + m_pcRdCost->getCost( uiMEBits ); 3381 #if LG_RESTRICTEDRESPRED_M24766 3382 if(pcCU->getResPredFlag(0) && iAddResiShift >= 0) 3383 { 3384 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 )); 3385 } 3386 #endif 3259 3387 } 3260 3388 #else … … 3274 3402 xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand); 3275 3403 #else 3276 xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost ); 3404 #if LG_RESTRICTEDRESPRED_M24766 3405 xMergeEstimation( pcCU, pcOrgYuv, rpcResiPredYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost ); 3406 #else 3407 xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost ); 3408 #endif 3277 3409 #endif 3278 3410 if ( uiMRGCost < uiMECost ) … … 4116 4248 UInt uiWidth = pcCU->getWidth ( 0 ); 4117 4249 UInt uiHeight = pcCU->getHeight( 0 ); 4118 4250 #if LG_RESTRICTEDRESPRED_M24766 4251 Int iPUResiPredShift[4]; 4252 #endif 4119 4253 // No residual coding : SKIP mode 4120 4254 if ( ePredMode == MODE_SKIP && bSkipRes ) … … 4128 4262 if( pcCU->getResPredFlag( 0 ) ) 4129 4263 { 4264 #if LG_RESTRICTEDRESPRED_M24766 4265 pcCU->getPUResiPredShift(iPUResiPredShift, 0); 4266 rpcYuvRec->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcYuvResPrd, uiWidth, uiHeight ); 4267 #else 4130 4268 rpcYuvRec->add( rpcYuvResPrd, uiWidth, uiHeight ); 4269 #endif 4131 4270 rpcYuvRec->clip( uiWidth, uiHeight ); 4132 4271 } … … 4237 4376 else 4238 4377 { 4239 rpcYuvResi->subtract( pcYuvOrg, pcYuvPred, 0, uiWidth ); 4378 #if LG_RESTRICTEDRESPRED_M24766 4379 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = 0; 4380 rpcYuvResi->subtract(iPUResiPredShift, pcCU->getPartitionSize(0), pcYuvOrg, pcYuvPred, 0, uiWidth ); 4381 #else 4382 rpcYuvResi->subtract( pcYuvOrg, pcYuvPred, 0, uiWidth ); 4383 #endif 4240 4384 #if HHI_INTER_VIEW_RESIDUAL_PRED 4241 4385 // subtract residual prediction 4242 4386 if( pcCU->getResPredFlag( 0 ) ) 4243 4387 { 4388 #if LG_RESTRICTEDRESPRED_M24766 4389 pcCU->getPUResiPredShift(iPUResiPredShift, 0); 4390 rpcYuvResi->subtract(iPUResiPredShift, pcCU->getPartitionSize(0), rpcYuvResi, rpcYuvResPrd, 0, uiWidth ); 4391 #else 4244 4392 rpcYuvResi->subtract( rpcYuvResi, rpcYuvResPrd, 0, uiWidth ); 4393 #endif 4245 4394 } 4246 4395 #endif … … 4456 4605 { 4457 4606 pcYuvPred->copyToPartYuv( rpcYuvRec, 0 ); 4458 rpcYuvRec->add( rpcYuvResPrd, uiWidth, uiHeight ); 4459 rpcYuvRec->add( rpcYuvResiBest, uiWidth, uiHeight ); 4607 #if LG_RESTRICTEDRESPRED_M24766 4608 pcCU->getPUResiPredShift(iPUResiPredShift, 0); 4609 rpcYuvRec->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcYuvResPrd, uiWidth, uiHeight ); 4610 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = 0; 4611 rpcYuvRec->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcYuvResiBest, uiWidth, uiHeight ); 4612 #else 4613 rpcYuvRec->add( rpcYuvResPrd, uiWidth, uiHeight ); 4614 rpcYuvRec->add( rpcYuvResiBest, uiWidth, uiHeight ); 4615 #endif 4460 4616 rpcYuvRec->clip( uiWidth, uiHeight ); 4461 4617 } -
branches/HTM-3.0-LG/source/Lib/TLibEncoder/TEncSearch.h
r56 r62 188 188 Void predInterSearch ( TComDataCU* pcCU, 189 189 TComYuv* pcOrgYuv, 190 #if LG_RESTRICTEDRESPRED_M24766 191 TComYuv* rpcResiPredYuv, 192 #endif 190 193 TComYuv*& rpcPredYuv, 191 194 TComYuv*& rpcResiYuv, … … 440 443 Void xMergeEstimation ( TComDataCU* pcCU, 441 444 TComYuv* pcYuvOrg, 445 #if LG_RESTRICTEDRESPRED_M24766 446 TComYuv* rpcResiPredYuv, 447 #endif 442 448 Int iPartIdx, 443 449 UInt& uiInterDir,
Note: See TracChangeset for help on using the changeset viewer.