Changeset 1029 in 3DVCSoftware for branches/HTM11.2dev0/source/Lib/TLibCommon/TComPrediction.cpp
 Timestamp:
 30 Jul 2014, 18:43:21 (10 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

branches/HTM11.2dev0/source/Lib/TLibCommon/TComPrediction.cpp
r1013 r1029 836 836 } 837 837 838 #if SHARP_DBBP_SIMPLE_FLTER_I0109 839 Void TComPrediction::combineSegmentsWithMask( TComYuv* pInYuv[2], TComYuv* pOutYuv, Bool* pMask, UInt uiWidth, UInt uiHeight, UInt uiPartAddr, UInt partSize ) 840 #else 838 841 Void TComPrediction::combineSegmentsWithMask( TComYuv* pInYuv[2], TComYuv* pOutYuv, Bool* pMask, UInt uiWidth, UInt uiHeight, UInt uiPartAddr ) 842 #endif 839 843 { 840 844 Pel* piSrc[2] = {pInYuv[0]>getLumaAddr(uiPartAddr), pInYuv[1]>getLumaAddr(uiPartAddr)}; … … 844 848 845 849 UInt uiMaskStride= MAX_CU_SIZE; 850 #if !SHARP_DBBP_SIMPLE_FLTER_I0109 846 851 Pel filSrc = 0; 852 #endif 847 853 Pel* tmpTar = 0; 848 854 tmpTar = (Pel *)xMalloc(Pel, uiWidth*uiHeight); … … 868 874 } 869 875 876 #if SHARP_DBBP_SIMPLE_FLTER_I0109 877 if (partSize == SIZE_Nx2N) 878 { 879 for (Int y=0; y<uiHeight; y++) 880 { 881 for (Int x=0; x<uiWidth; x++) 882 { 883 Bool l = (x==0)?pMaskStart[y*uiMaskStride+x]:pMaskStart[y*uiMaskStride+x1]; 884 Bool r = (x==uiWidth1)?pMaskStart[y*uiMaskStride+x]:pMaskStart[y*uiMaskStride+x+1]; 885 886 Pel left, right; 887 left = (x==0) ? tmpTar[y*uiWidth+x] : tmpTar[y*uiWidth+x1]; 888 right = (x==uiWidth1) ? tmpTar[y*uiWidth+x] : tmpTar[y*uiWidth+x+1]; 889 890 piDst[x] = (l!=r) ? ClipY( Pel(( left + (tmpTar[y*uiWidth+x] << 1) + right ) >> 2 )) : tmpTar[y*uiWidth+x]; 891 } 892 piDst += uiDstStride; 893 } 894 } 895 else // SIZE_2NxN 896 { 897 for (Int y=0; y<uiHeight; y++) 898 { 899 for (Int x=0; x<uiWidth; x++) 900 { 901 Bool t = (y==0)?pMaskStart[y*uiMaskStride+x]:pMaskStart[(y1)*uiMaskStride+x]; 902 Bool b = (y==uiHeight1)?pMaskStart[y*uiMaskStride+x]:pMaskStart[(y+1)*uiMaskStride+x]; 903 904 Pel top, bottom; 905 top = (y==0) ? tmpTar[y*uiWidth+x] : tmpTar[(y1)*uiWidth+x]; 906 bottom = (y==uiHeight1) ? tmpTar[y*uiWidth+x] : tmpTar[(y+1)*uiWidth+x]; 907 908 piDst[x] = (t!=b) ? ClipY( Pel(( top + (tmpTar[y*uiWidth+x] << 1) + bottom ) >> 2 )) : tmpTar[y*uiWidth+x]; 909 } 910 piDst += uiDstStride; 911 } 912 } 913 #else 870 914 for (Int y=0; y<uiHeight; y++) 871 915 { … … 901 945 piDst += uiDstStride; 902 946 } 947 #endif 948 903 949 if ( tmpTar ) { xFree(tmpTar); tmpTar = NULL; } 904 950 … … 937 983 } 938 984 985 #if SHARP_DBBP_SIMPLE_FLTER_I0109 986 if (partSize == SIZE_Nx2N) 987 { 988 for (Int y=0; y<uiHeightC; y++) 989 { 990 for (Int x=0; x<uiWidthC; x++) 991 { 992 Bool l = (x==0)?pMaskStart[y*2*uiMaskStride+x*2]:pMaskStart[y*2*uiMaskStride+(x1)*2]; 993 Bool r = (x==uiWidthC1)?pMaskStart[y*2*uiMaskStride+x*2]:pMaskStart[y*2*uiMaskStride+(x+1)*2]; 994 995 Pel leftU, rightU; 996 leftU = (x==0) ? tmpTarU[y*uiWidthC+x] : tmpTarU[y*uiWidthC+x1]; 997 rightU = (x==uiWidthC1) ? tmpTarU[y*uiWidthC+x] : tmpTarU[y*uiWidthC+x+1]; 998 Pel leftV, rightV; 999 leftV = (x==0) ? tmpTarV[y*uiWidthC+x] : tmpTarV[y*uiWidthC+x1]; 1000 rightV = (x==uiWidthC1) ? tmpTarV[y*uiWidthC+x] : tmpTarV[y*uiWidthC+x+1]; 1001 1002 if (l!=r) 1003 { 1004 filSrcU = ClipC( Pel(( leftU + (tmpTarU[y*uiWidthC+x] << 1) + rightU ) >> 2 )); 1005 filSrcV = ClipC( Pel(( leftV + (tmpTarV[y*uiWidthC+x] << 1) + rightV ) >> 2 )); 1006 } 1007 else 1008 { 1009 filSrcU = tmpTarU[y*uiWidthC+x]; 1010 filSrcV = tmpTarV[y*uiWidthC+x]; 1011 } 1012 piDstU[x] = filSrcU; 1013 piDstV[x] = filSrcV; 1014 } 1015 piDstU += uiDstStrideC; 1016 piDstV += uiDstStrideC; 1017 } 1018 } 1019 else 1020 { 1021 for (Int y=0; y<uiHeightC; y++) 1022 { 1023 for (Int x=0; x<uiWidthC; x++) 1024 { 1025 Bool t = (y==0)?pMaskStart[y*2*uiMaskStride+x*2]:pMaskStart[(y1)*2*uiMaskStride+x*2]; 1026 Bool b = (y==uiHeightC1)?pMaskStart[y*2*uiMaskStride+x*2]:pMaskStart[(y+1)*2*uiMaskStride+x*2]; 1027 1028 Pel topU, bottomU; 1029 topU = (y==0) ? tmpTarU[y*uiWidthC+x] : tmpTarU[(y1)*uiWidthC+x]; 1030 bottomU = (y==uiHeightC1) ? tmpTarU[y*uiWidthC+x] : tmpTarU[(y+1)*uiWidthC+x]; 1031 Pel topV, bottomV; 1032 topV = (y==0) ? tmpTarV[y*uiWidthC+x] : tmpTarV[(y1)*uiWidthC+x]; 1033 bottomV = (y==uiHeightC1) ? tmpTarV[y*uiWidthC+x] : tmpTarV[(y+1)*uiWidthC+x]; 1034 1035 if (t!=b) 1036 { 1037 filSrcU = ClipC( Pel(( topU + (tmpTarU[y*uiWidthC+x] << 1) + bottomU ) >> 2 )); 1038 filSrcV = ClipC( Pel(( topV + (tmpTarV[y*uiWidthC+x] << 1) + bottomV ) >> 2 )); 1039 } 1040 else 1041 { 1042 filSrcU = tmpTarU[y*uiWidthC+x]; 1043 filSrcV = tmpTarV[y*uiWidthC+x]; 1044 } 1045 piDstU[x] = filSrcU; 1046 piDstV[x] = filSrcV; 1047 } 1048 piDstU += uiDstStrideC; 1049 piDstV += uiDstStrideC; 1050 } 1051 } 1052 #else 939 1053 for (Int y=0; y<uiHeightC; y++) 940 1054 { … … 982 1096 piDstV += uiDstStrideC; 983 1097 } 1098 #endif 984 1099 if ( tmpTarU ) { xFree(tmpTarU); tmpTarU = NULL; } 985 1100 if ( tmpTarV ) { xFree(tmpTarV); tmpTarV = NULL; }
Note: See TracChangeset for help on using the changeset viewer.