Changeset 62 in 3DVCSoftware for branches/HTM-3.0-LG/source/Lib/TLibCommon
- Timestamp:
- 18 May 2012, 09:38:25 (12 years ago)
- Location:
- branches/HTM-3.0-LG/source/Lib/TLibCommon
- Files:
-
- 6 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
Note: See TracChangeset for help on using the changeset viewer.