Changeset 967 in 3DVCSoftware for branches/HTM-11.1-dev0/source/Lib/TLibCommon/TComPrediction.cpp
- Timestamp:
- 5 Jul 2014, 08:19:26 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-11.1-dev0/source/Lib/TLibCommon/TComPrediction.cpp
r964 r967 500 500 Pel* pDst = piPred; 501 501 xAssignBiSegDCs( pDst, uiStride, biSegPattern, patternStride, segDC1, segDC2 ); 502 #if HS_DMM_SDC_PREDICTOR_UNIFY_H0108503 502 pcCU->setDmmPredictor(segDC1, 0); 504 503 pcCU->setDmmPredictor(segDC2, 1); 505 #endif506 504 507 505 #if H_3D_DIM_DMM … … 647 645 648 646 // start mapping process 649 #if !MTK_DBBP_AMP_REM_H0072650 Bool bAMPAvail = uiSize > 8;651 Int matchedPartSum[6][2] = {{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}}; // counter for each part size and boolean option652 PartSize virtualPartSizes[6] = { SIZE_Nx2N, SIZE_2NxN, SIZE_2NxnU, SIZE_2NxnD, SIZE_nLx2N, SIZE_nRx2N };653 #else654 647 Int matchedPartSum[2][2] = {{0,0},{0,0}}; // counter for each part size and boolean option 655 648 PartSize virtualPartSizes[2] = { SIZE_Nx2N, SIZE_2NxN}; 656 #endif657 649 658 650 UInt uiHalfSize = uiSize>>1; 659 #if !MTK_DBBP_AMP_REM_H0072660 UInt uiQuarterSize = uiSize>>2;661 #endif662 663 651 for (Int y=0; y<uiSize; y+=iSubSample) 664 652 { … … 691 679 matchedPartSum[1][1-ucSegment]++; 692 680 } 693 694 #if !MTK_DBBP_AMP_REM_H0072695 if( bAMPAvail )696 {697 // SIZE_2NxnU698 if(y<uiQuarterSize) // top (1/4)699 {700 matchedPartSum[2][ucSegment]++;701 }702 else // bottom (3/4)703 {704 matchedPartSum[2][1-ucSegment]++;705 }706 707 // SIZE_2NxnD708 if(y<(uiQuarterSize*3)) // top (3/4)709 {710 matchedPartSum[3][ucSegment]++;711 }712 else // bottom (1/4)713 {714 matchedPartSum[3][1-ucSegment]++;715 }716 717 // SIZE_nLx2N718 if(x<uiQuarterSize) // left (1/4)719 {720 matchedPartSum[4][ucSegment]++;721 }722 else // right (3/4)723 {724 matchedPartSum[4][1-ucSegment]++;725 }726 727 // SIZE_nRx2N728 if(x<(uiQuarterSize*3)) // left (3/4)729 {730 matchedPartSum[5][ucSegment]++;731 }732 else // right (1/4)733 {734 matchedPartSum[5][1-ucSegment]++;735 }736 }737 #endif738 681 } 739 682 … … 745 688 746 689 Int iMaxMatchSum = 0; 747 #if !MTK_DBBP_AMP_REM_H0072748 for(Int p=0; p<6; p++) // loop over partition749 #else750 690 for(Int p=0; p<2; p++) // loop over partition 751 #endif752 691 { 753 692 for( Int b=0; b<=1; b++ ) // loop over boolean options … … 859 798 860 799 UInt uiMaskStride= MAX_CU_SIZE; 861 #if SEC_DBBP_FILTERING_H0104862 800 Pel filSrc = 0; 863 801 Pel* tmpTar = 0; 864 802 tmpTar = (Pel *)xMalloc(Pel, uiWidth*uiHeight); 865 #endif866 803 867 804 // backup pointer … … 877 814 878 815 // filtering 879 #if SEC_DBBP_FILTERING_H0104880 816 tmpTar[y*uiWidth+x] = piSrc[ucSegment][x]; 881 #else882 Bool t = (y==0)?pMaskStart[(y+1)*uiMaskStride+x]:pMaskStart[(y-1)*uiMaskStride+x];883 Bool l = (x==0)?pMaskStart[y*uiMaskStride+x+1]:pMaskStart[y*uiMaskStride+x-1];884 Bool b = (y==uiHeight-1)?pMaskStart[(y-1)*uiMaskStride+x]:pMaskStart[(y+1)*uiMaskStride+x];885 Bool r = (x==uiWidth-1)?pMaskStart[y*uiMaskStride+x-1]:pMaskStart[y*uiMaskStride+x+1];886 887 Bool bBlend = !((t&&l&&b&&r) || (!t&&!l&&!b&&!r));888 piDst[x] = bBlend?((piSrc[0][x]+piSrc[1][x]+1)>>1):piSrc[ucSegment][x];889 #endif890 817 } 891 818 892 819 piSrc[0] += uiSrcStride; 893 820 piSrc[1] += uiSrcStride; 894 #if !SEC_DBBP_FILTERING_H0104895 piDst += uiDstStride;896 #endif897 821 pMask += uiMaskStride; 898 822 } 899 823 900 #if SEC_DBBP_FILTERING_H0104901 824 for (Int y=0; y<uiHeight; y++) 902 825 { … … 933 856 } 934 857 if ( tmpTar ) { xFree(tmpTar); tmpTar = NULL; } 935 #endif936 858 937 859 // now combine chroma … … 944 866 UInt uiWidthC = uiWidth >> 1; 945 867 UInt uiHeightC = uiHeight >> 1; 946 #if SEC_DBBP_FILTERING_H0104947 868 Pel filSrcU = 0, filSrcV = 0; 948 869 Pel* tmpTarU = 0, *tmpTarV = 0; 949 870 tmpTarU = (Pel *)xMalloc(Pel, uiWidthC*uiHeightC); 950 871 tmpTarV = (Pel *)xMalloc(Pel, uiWidthC*uiHeightC); 951 #endif952 872 pMask = pMaskStart; 953 873 … … 960 880 961 881 // filtering 962 #if SEC_DBBP_FILTERING_H0104963 882 tmpTarU[y*uiWidthC+x] = piSrcU[ucSegment][x]; 964 883 tmpTarV[y*uiWidthC+x] = piSrcV[ucSegment][x]; 965 #else966 Bool t = (y==0)?pMaskStart[(y+1)*2*uiMaskStride+x*2]:pMaskStart[(y-1)*2*uiMaskStride+x*2];967 Bool l = (x==0)?pMaskStart[y*2*uiMaskStride+(x+1)*2]:pMaskStart[y*2*uiMaskStride+(x-1)*2];968 Bool b = (y==uiHeightC-1)?pMaskStart[(y-1)*2*uiMaskStride+x*2]:pMaskStart[(y+1)*2*uiMaskStride+x*2];969 Bool r = (x==uiWidthC-1)?pMaskStart[y*2*uiMaskStride+(x-1)*2]:pMaskStart[y*2*uiMaskStride+(x+1)*2];970 971 Bool bBlend = !((t&&l&&b&&r) || (!t&&!l&&!b&&!r));972 973 piDstU[x] = bBlend?((piSrcU[0][x]+piSrcU[1][x]+1)>>1):piSrcU[ucSegment][x];974 piDstV[x] = bBlend?((piSrcV[0][x]+piSrcV[1][x]+1)>>1):piSrcV[ucSegment][x];975 #endif976 884 } 977 885 … … 980 888 piSrcV[0] += uiSrcStrideC; 981 889 piSrcV[1] += uiSrcStrideC; 982 #if !SEC_DBBP_FILTERING_H0104983 piDstU += uiDstStrideC;984 piDstV += uiDstStrideC;985 #endif986 890 pMask += 2*uiMaskStride; 987 891 } 988 892 989 #if SEC_DBBP_FILTERING_H0104990 893 for (Int y=0; y<uiHeightC; y++) 991 894 { … … 1035 938 if ( tmpTarU ) { xFree(tmpTarU); tmpTarU = NULL; } 1036 939 if ( tmpTarV ) { xFree(tmpTarV); tmpTarV = NULL; } 1037 #endif1038 940 } 1039 941 #endif … … 2328 2230 if (orgDC == false) 2329 2231 { 2330 #if !HS_DMM_SDC_PREDICTOR_UNIFY_H0108 2331 if ( getDimType(uiIntraMode) == DMM1_IDX ) 2332 { 2333 UChar ucSegmentLT = pMask[0]; 2334 UChar ucSegmentRT = pMask[uiSize-1]; 2335 UChar ucSegmentLB = pMask[uiMaskStride * (uiSize-1)]; 2336 UChar ucSegmentRB = pMask[uiMaskStride * (uiSize-1) + (uiSize-1)]; 2337 2338 rpSegMeans[ucSegmentLT] = pOrig[0]; 2339 rpSegMeans[ucSegmentRT] = pOrig[uiSize-1]; 2340 rpSegMeans[ucSegmentLB] = pOrig[uiStride * (uiSize-1) ]; 2341 rpSegMeans[ucSegmentRB] = pOrig[uiStride * (uiSize-1) + (uiSize-1) ]; 2342 } 2343 else if( getDimType( uiIntraMode ) == DMM4_IDX ) 2344 { 2345 Pel *ptmpOrig = pOrig; 2346 Bool *ptmpMask = pMask, bBreak = false; 2347 UChar ucSegment = ptmpMask? (UChar) ptmpMask[0] : 0; 2348 UChar bFirstSeg = ucSegment; 2349 2350 rpSegMeans[ucSegment] = ptmpOrig[0]; 2351 for ( Int y = 0; y < uiSize; y++ ) 2352 { 2353 for ( Int x = 0; x < uiSize; x++ ) 2354 { 2355 ucSegment = ptmpMask[x]; 2356 assert( ucSegment < uiNumSegments ); 2357 2358 if( bFirstSeg != ucSegment ) 2359 { 2360 rpSegMeans[ucSegment] = ptmpOrig[x]; 2361 bBreak = true; 2362 break; 2363 } 2364 } 2365 2366 if( bBreak ) 2367 { 2368 break; 2369 } 2370 2371 ptmpOrig += uiStride; 2372 ptmpMask += uiMaskStride; 2373 } 2374 } 2375 else 2376 #endif 2377 { 2378 Pel* pLeftTop = pOrig; 2379 Pel* pRightTop = pOrig + (uiSize-1); 2380 Pel* pLeftBottom = (pOrig+ (uiStride*(uiSize-1))); 2381 Pel* pRightBottom = (pOrig+ (uiStride*(uiSize-1)) + (uiSize-1)); 2382 2383 rpSegMeans[0] = (*pLeftTop + *pRightTop + *pLeftBottom + *pRightBottom + 2)>>2; 2384 } 2232 Pel* pLeftTop = pOrig; 2233 Pel* pRightTop = pOrig + (uiSize-1); 2234 Pel* pLeftBottom = (pOrig+ (uiStride*(uiSize-1))); 2235 Pel* pRightBottom = (pOrig+ (uiStride*(uiSize-1)) + (uiSize-1)); 2236 2237 rpSegMeans[0] = (*pLeftTop + *pRightTop + *pLeftBottom + *pRightBottom + 2)>>2; 2385 2238 return; 2386 2239 }
Note: See TracChangeset for help on using the changeset viewer.