Changeset 905 in 3DVCSoftware
- Timestamp:
- 11 Apr 2014, 06:42:38 (11 years ago)
- Location:
- branches/HTM-10.2-dev2-Samsung
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-10.2-dev2-Samsung/source/Lib/TLibCommon/TComPrediction.cpp
r898 r905 851 851 852 852 UInt uiMaskStride= MAX_CU_SIZE; 853 #if SEC_DBBP_FILTERING_H0104 854 Pel filSrc = 0; 855 Pel* tmpTar = 0; 856 tmpTar = (Pel *)xMalloc(Pel, uiWidth*uiHeight); 857 #endif 853 858 854 859 // backup pointer … … 864 869 865 870 // filtering 871 #if SEC_DBBP_FILTERING_H0104 872 tmpTar[y*uiWidth+x] = piSrc[ucSegment][x]; 873 #else 866 874 Bool t = (y==0)?pMaskStart[(y+1)*uiMaskStride+x]:pMaskStart[(y-1)*uiMaskStride+x]; 867 875 Bool l = (x==0)?pMaskStart[y*uiMaskStride+x+1]:pMaskStart[y*uiMaskStride+x-1]; … … 871 879 Bool bBlend = !((t&&l&&b&&r) || (!t&&!l&&!b&&!r)); 872 880 piDst[x] = bBlend?((piSrc[0][x]+piSrc[1][x]+1)>>1):piSrc[ucSegment][x]; 881 #endif 873 882 } 874 883 875 884 piSrc[0] += uiSrcStride; 876 885 piSrc[1] += uiSrcStride; 886 #if !SEC_DBBP_FILTERING_H0104 877 887 piDst += uiDstStride; 888 #endif 878 889 pMask += uiMaskStride; 879 890 } 891 892 #if SEC_DBBP_FILTERING_H0104 893 for (Int y=0; y<uiHeight; y++) 894 { 895 for (Int x=0; x<uiWidth; x++) 896 { 897 Bool t = (y==0)?pMaskStart[y*uiMaskStride+x]:pMaskStart[(y-1)*uiMaskStride+x]; 898 Bool l = (x==0)?pMaskStart[y*uiMaskStride+x]:pMaskStart[y*uiMaskStride+x-1]; 899 Bool b = (y==uiHeight-1)?pMaskStart[y*uiMaskStride+x]:pMaskStart[(y+1)*uiMaskStride+x]; 900 Bool r = (x==uiWidth-1)?pMaskStart[y*uiMaskStride+x]:pMaskStart[y*uiMaskStride+x+1]; 901 Bool c =pMaskStart[y*uiMaskStride+x]; 902 903 Pel left, right, top, bottom; 904 left = (x==0) ? tmpTar[y*uiWidth+x] : tmpTar[y*uiWidth+x-1]; 905 right = (x==uiWidth-1) ? tmpTar[y*uiWidth+x] : tmpTar[y*uiWidth+x+1]; 906 top = (y==0) ? tmpTar[y*uiWidth+x] : tmpTar[(y-1)*uiWidth+x]; 907 bottom = (y==uiHeight-1) ? tmpTar[y*uiWidth+x] : tmpTar[(y+1)*uiWidth+x]; 908 909 if(!((l&&r&&c) || (!l&&!r&&!c))) 910 { 911 filSrc = Clip3( Pel( 0 ), Pel( 255 ), Pel(( left + (tmpTar[y*uiWidth+x] << 1) + right ) >> 2 )); 912 } 913 else 914 { 915 filSrc = tmpTar[y*uiWidth+x]; 916 } 917 918 if(!((t&&b&&c) || (!t&&!b&&!c))) 919 { 920 filSrc = Clip3( Pel( 0 ), Pel( 255 ), Pel(( top + (filSrc << 1) + bottom ) >> 2 )); 921 } 922 piDst[x] = filSrc; 923 } 924 piDst += uiDstStride; 925 } 926 if ( tmpTar ) { xFree(tmpTar); tmpTar = NULL; } 927 #endif 880 928 881 929 // now combine chroma … … 888 936 UInt uiWidthC = uiWidth >> 1; 889 937 UInt uiHeightC = uiHeight >> 1; 938 #if SEC_DBBP_FILTERING_H0104 939 Pel filSrcU = 0, filSrcV = 0; 940 Pel* tmpTarU = 0, *tmpTarV = 0; 941 tmpTarU = (Pel *)xMalloc(Pel, uiWidthC*uiHeightC); 942 tmpTarV = (Pel *)xMalloc(Pel, uiWidthC*uiHeightC); 943 #endif 890 944 pMask = pMaskStart; 891 945 … … 898 952 899 953 // filtering 954 #if SEC_DBBP_FILTERING_H0104 955 tmpTarU[y*uiWidthC+x] = piSrcU[ucSegment][x]; 956 tmpTarV[y*uiWidthC+x] = piSrcV[ucSegment][x]; 957 #else 900 958 Bool t = (y==0)?pMaskStart[(y+1)*2*uiMaskStride+x*2]:pMaskStart[(y-1)*2*uiMaskStride+x*2]; 901 959 Bool l = (x==0)?pMaskStart[y*2*uiMaskStride+(x+1)*2]:pMaskStart[y*2*uiMaskStride+(x-1)*2]; … … 907 965 piDstU[x] = bBlend?((piSrcU[0][x]+piSrcU[1][x]+1)>>1):piSrcU[ucSegment][x]; 908 966 piDstV[x] = bBlend?((piSrcV[0][x]+piSrcV[1][x]+1)>>1):piSrcV[ucSegment][x]; 967 #endif 909 968 } 910 969 … … 913 972 piSrcV[0] += uiSrcStrideC; 914 973 piSrcV[1] += uiSrcStrideC; 974 #if !SEC_DBBP_FILTERING_H0104 915 975 piDstU += uiDstStrideC; 916 976 piDstV += uiDstStrideC; 977 #endif 917 978 pMask += 2*uiMaskStride; 918 979 } 980 981 #if SEC_DBBP_FILTERING_H0104 982 for (Int y=0; y<uiHeightC; y++) 983 { 984 for (Int x=0; x<uiWidthC; x++) 985 { 986 Bool t = (y==0)?pMaskStart[y*2*uiMaskStride+x*2]:pMaskStart[(y-1)*2*uiMaskStride+x*2]; 987 Bool l = (x==0)?pMaskStart[y*2*uiMaskStride+x*2]:pMaskStart[y*2*uiMaskStride+(x-1)*2]; 988 Bool b = (y==uiHeightC-1)?pMaskStart[y*2*uiMaskStride+x*2]:pMaskStart[(y+1)*2*uiMaskStride+x*2]; 989 Bool r = (x==uiWidthC-1)?pMaskStart[y*2*uiMaskStride+x*2]:pMaskStart[y*2*uiMaskStride+(x+1)*2]; 990 Bool c =pMaskStart[y*2*uiMaskStride+x*2]; 991 992 Pel leftU, rightU, topU, bottomU; 993 leftU = (x==0) ? tmpTarU[y*uiWidthC+x] : tmpTarU[y*uiWidthC+x-1]; 994 rightU = (x==uiWidthC-1) ? tmpTarU[y*uiWidthC+x] : tmpTarU[y*uiWidthC+x+1]; 995 topU = (y==0) ? tmpTarU[y*uiWidthC+x] : tmpTarU[(y-1)*uiWidthC+x]; 996 bottomU = (y==uiHeightC-1) ? tmpTarU[y*uiWidthC+x] : tmpTarU[(y+1)*uiWidthC+x]; 997 998 Pel leftV, rightV, topV, bottomV; 999 leftV = (x==0) ? tmpTarV[y*uiWidthC+x] : tmpTarV[y*uiWidthC+x-1]; 1000 rightV = (x==uiWidthC-1) ? tmpTarV[y*uiWidthC+x] : tmpTarV[y*uiWidthC+x+1]; 1001 topV = (y==0) ? tmpTarV[y*uiWidthC+x] : tmpTarV[(y-1)*uiWidthC+x]; 1002 bottomV = (y==uiHeightC-1) ? tmpTarV[y*uiWidthC+x] : tmpTarV[(y+1)*uiWidthC+x]; 1003 1004 if(!((l&&r&&c) || (!l&&!r&&!c))) 1005 { 1006 filSrcU = Clip3( Pel( 0 ), Pel( 255 ), Pel(( leftU + (tmpTarU[y*uiWidthC+x] << 1) + rightU ) >> 2 )); 1007 filSrcV = Clip3( Pel( 0 ), Pel( 255 ), Pel(( leftV + (tmpTarV[y*uiWidthC+x] << 1) + rightV ) >> 2 )); 1008 } 1009 else 1010 { 1011 filSrcU = tmpTarU[y*uiWidthC+x]; 1012 filSrcV = tmpTarV[y*uiWidthC+x]; 1013 } 1014 1015 if(!((t&&b&&c) || (!t&&!b&&!c))) 1016 { 1017 filSrcU = Clip3( Pel( 0 ), Pel( 255 ), Pel(( topU + (filSrcU << 1) + bottomU ) >> 2 )); 1018 filSrcV = Clip3( Pel( 0 ), Pel( 255 ), Pel(( topV + (filSrcV << 1) + bottomV ) >> 2 )); 1019 } 1020 1021 piDstU[x] = filSrcU; 1022 piDstV[x] = filSrcV; 1023 } 1024 piDstU += uiDstStrideC; 1025 piDstV += uiDstStrideC; 1026 } 1027 if ( tmpTarU ) { xFree(tmpTarU); tmpTarU = NULL; } 1028 if ( tmpTarV ) { xFree(tmpTarV); tmpTarV = NULL; } 1029 #endif 919 1030 } 920 1031 #endif -
branches/HTM-10.2-dev2-Samsung/source/Lib/TLibCommon/TypeDef.h
r899 r905 297 297 #define MTK_DBBP_AMP_REM_H0072 1 298 298 #define RWTH_DBBP_NO_SPU_H0057 1 299 #define SEC_DBBP_FILTERING_H0104 1 299 300 #endif 300 301
Note: See TracChangeset for help on using the changeset viewer.