Changeset 1200 in 3DVCSoftware for branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer
- Timestamp:
- 4 May 2015, 18:38:08 (10 years ago)
- Location:
- branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenFilter.cpp
r1179 r1200 36 36 #include "TRenFilter.h" 37 37 #include "TRenInterpFilter.h" 38 #if H_3D38 #if NH_3D 39 39 40 40 ///// COMMON ///// 41 Void TRenFilter::setSubPelShiftLUT( Int iLutPrec, Int** piSubPelShiftLUT, Int iShift ) 41 template<UInt bitDepth> 42 Void TRenFilter<bitDepth>::setSubPelShiftLUT( Int iLutPrec, Int** piSubPelShiftLUT, Int iShift ) 42 43 { 43 44 //ToDo: use same rounding for left and right … … 59 60 } 60 61 } 61 62 Void TRenFilter ::setupZLUT( Bool bBlendUseDistWeight, Int iBlendZThresPerc, Int iRelDistToLeft, Int** ppiBaseShiftLUTLeft, Int** ppiBaseShiftLUTRight, Int& riBlendZThres, Int& riBlendDistWeight, Int* piInvZLUTLeft, Int* piInvZLUTRight )62 template<UInt bitDepth> 63 Void TRenFilter<bitDepth>::setupZLUT( Bool bBlendUseDistWeight, Int iBlendZThresPerc, Int iRelDistToLeft, Int** ppiBaseShiftLUTLeft, Int** ppiBaseShiftLUTRight, Int& riBlendZThres, Int& riBlendDistWeight, Int* piInvZLUTLeft, Int* piInvZLUTRight ) 63 64 { 64 65 AOT( iRelDistToLeft == -1 ); … … 75 76 } 76 77 77 Void TRenFilter::filledToUsedPelMap( PelImage* pcFilledImage, PelImage* pcUsedPelsImage, Int iUsedPelMapMarExt ) 78 template<UInt bitDepth> 79 Void TRenFilter<bitDepth>::filledToUsedPelMap( PelImage* pcFilledImage, PelImage* pcUsedPelsImage, Int iUsedPelMapMarExt ) 78 80 { 79 81 // Convert to binary map … … 156 158 157 159 /////////// Copy ///////////// 158 Void TRenFilter::copy(Pel* pcInputPlaneData, Int iInputStride, Int iWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride ) 160 template<UInt bitDepth> 161 Void TRenFilter<bitDepth>::copy(const Pel* pcInputPlaneData, Int iInputStride, Int iWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride ) 159 162 { 160 163 xDistributeArray(pcInputPlaneData, iInputStride, 1, 1, iWidth, iHeight ,pcOutputPlaneData, iOutputStride, 1 , 1 ); … … 163 166 164 167 /////////// Horizontal Mirror /////////// 165 template <typename T>166 Void TRenFilter ::mirrorHor( TRenImage<T> *pcImage )168 template<UInt bitDepth> template <typename T> 169 Void TRenFilter<bitDepth>::mirrorHor( TRenImage<T> *pcImage ) 167 170 { 168 171 for (UInt uCurPlane = 0 ; uCurPlane < pcImage->getNumberOfPlanes(); uCurPlane++ ) … … 172 175 } 173 176 174 template <typename T>175 Void TRenFilter ::mirrorHor( TRenImagePlane<T> *pcImagePlane )177 template<UInt bitDepth> template <typename T> 178 Void TRenFilter<bitDepth>::mirrorHor( TRenImagePlane<T> *pcImagePlane ) 176 179 { 177 180 T* pcPlaneData = pcImagePlane->getPlaneDataOrg(); … … 194 197 195 198 /////////// Comparison /////////// 196 Int64 TRenFilter::SSE (PelImagePlane* pcInputPlane1, PelImagePlane* pcInputPlane2, Bool bLuma ) 199 template<UInt bitDepth> 200 Int64 TRenFilter<bitDepth>::SSE (PelImagePlane* pcInputPlane1, PelImagePlane* pcInputPlane2, Bool bLuma ) 197 201 { 198 202 UInt uiWidth = pcInputPlane1->getWidth(); … … 208 212 } 209 213 210 Int64 TRenFilter::SSE( Pel* piSrc1, Int iSrcStride1, Int iWidth, Int iHeight, Pel* piSrc2, Int iSrcStride2, Bool bLuma ) 214 template<UInt bitDepth> 215 Int64 TRenFilter<bitDepth>::SSE( Pel* piSrc1, Int iSrcStride1, Int iWidth, Int iHeight, Pel* piSrc2, Int iSrcStride2, Bool bLuma ) 211 216 { 212 217 Int64 iSSE = 0; 213 218 214 219 215 Int iShift = DISTORTION_PRECISION_ADJUSTMENT( ( bLuma ? g_bitDepthY : g_bitDepthC )- 8 ) << 1 ;220 Int iShift = ( bitDepth - 8 ) << 1 ; 216 221 for(Int iPosY = 0; iPosY < iHeight; iPosY++) 217 222 { … … 227 232 } 228 233 229 template <typename T>230 Bool TRenFilter ::compare( TRenImage<T> *pInputImage1, TRenImage<T> *pInputImage2 )234 template<UInt bitDepth> template <typename T> 235 Bool TRenFilter<bitDepth>::compare( TRenImage<T> *pInputImage1, TRenImage<T> *pInputImage2 ) 231 236 { 232 237 Bool bIsEqual = true; … … 238 243 } 239 244 240 template <typename T>241 Bool TRenFilter ::compare (TRenImagePlane<T>* pcInputPlane1 , TRenImagePlane<T>* pcInputPlane2 )245 template<UInt bitDepth> template <typename T> 246 Bool TRenFilter<bitDepth>::compare (TRenImagePlane<T>* pcInputPlane1 , TRenImagePlane<T>* pcInputPlane2 ) 242 247 { 243 248 UInt uiWidth = pcInputPlane1->getWidth(); … … 265 270 266 271 /////////// Sampling /////////// 267 268 inline Void TRenFilter ::sampleUp2Tap13(PelImage* pcInputImage, PelImage* pcOutputImage)272 template<UInt bitDepth> 273 inline Void TRenFilter<bitDepth>::sampleUp2Tap13(PelImage* pcInputImage, PelImage* pcOutputImage) 269 274 { // UpSampling from JSVM Software (DownConvertStatic) ??? 270 275 271 AOF( g_bitDepthC == g_bitDepthY );272 276 UInt uiNumPlanes = pcInputImage->getNumberOfPlanes(); 273 277 … … 400 404 { 401 405 // Scale and copy to image buffer. 402 pcOutputPlaneData[iOffset+i] = Clip Y((Pel) ((piDst[i] + iAddH) / iDivH));406 pcOutputPlaneData[iOffset+i] = ClipBD((Pel) ((piDst[i] + iAddH) / iDivH), bitDepth); 403 407 } 404 408 } … … 410 414 } 411 415 412 413 Void TRenFilter ::sampleDown2Tap13(PelImage* pcInputImage, PelImage* pcOutputImage)416 template<UInt bitDepth> 417 Void TRenFilter<bitDepth>::sampleDown2Tap13(PelImage* pcInputImage, PelImage* pcOutputImage) 414 418 { // DownSampling from JSVM Software (DownConvertStatic) ?? 415 419 … … 422 426 }; 423 427 424 Void TRenFilter::sampleDown2Tap13( Pel* pcInputPlaneData, Int iInputStride, Int iWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride ) 428 template<UInt bitDepth> 429 Void TRenFilter<bitDepth>::sampleDown2Tap13( Pel* pcInputPlaneData, Int iInputStride, Int iWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride ) 425 430 { // DownSampling from JSVM Software (DownConvertStatic) ?? 426 427 AOF( g_bitDepthC == g_bitDepthY );428 431 429 432 Int iOffset, iPosX, iPosY, k; … … 549 552 { 550 553 // Scale and copy back to image buffer. 551 pcOutputPlaneData[iOutputStride*iPosY+iPosX] = Clip Y( ( Pel) ( (piDst[iPosY] + iAddV) / iDivV));554 pcOutputPlaneData[iOutputStride*iPosY+iPosX] = ClipBD( ( Pel) ( (piDst[iPosY] + iAddV) / iDivV), bitDepth ); 552 555 } 553 556 } … … 557 560 } 558 561 559 Void TRenFilter::sampleDown2Tap13(PelImagePlane* pcInputPlane, PelImagePlane* pcOutputPlane) 562 template<UInt bitDepth> 563 Void TRenFilter<bitDepth>::sampleDown2Tap13(PelImagePlane* pcInputPlane, PelImagePlane* pcOutputPlane) 560 564 { // DownSampling from JSVM Software (DownConvertStatic) ?? 561 565 Int iWidth = pcInputPlane->getWidth(); … … 574 578 }; 575 579 576 Void TRenFilter::sampleVerDown2Tap13( PelImagePlane* pcInputPlane, PelImagePlane* pcOutputPlane, Int uiPad) 577 { 578 assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth580 template<UInt bitDepth> 581 Void TRenFilter<bitDepth>::sampleVerDown2Tap13( PelImagePlane* pcInputPlane, PelImagePlane* pcOutputPlane, Int uiPad) 582 { 579 583 // DownSampling from JSVM Software (DownConvertStatic) ?? 580 584 Int iWidth = pcInputPlane->getWidth(); … … 622 626 623 627 Int iSum = iTmp4 + iTmp3 - iTmp2 + ((iTmp0 + iTmp4 + iTmp5 - iTmp2) << 1) + ( ( iTmp3 - iTmp1) << 2) + ( iTmp5 << 3 ) + (( iTmp4 + iTmp5 ) << 4); 624 pcOutputPlaneData[ iXPos ] = (Pel) Clip Y((iSum + 32) >> 6);628 pcOutputPlaneData[ iXPos ] = (Pel) ClipBD((iSum + 32) >> 6, bitDepth); 625 629 pcTmpIn++; 626 630 } … … 630 634 }; 631 635 632 Void TRenFilter::sampleHorDown2Tap13( PelImagePlane* pcInputPlane, PelImagePlane* pcOutputPlane, Int uiPad ) 636 template<UInt bitDepth> 637 Void TRenFilter<bitDepth>::sampleHorDown2Tap13( PelImagePlane* pcInputPlane, PelImagePlane* pcOutputPlane, Int uiPad ) 633 638 { 634 assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth 635 // DownSampling from JSVM Software (DownConvertStatic) ?? 639 // DownSampling from JSVM Software (DownConvertStatic) ?? 636 640 Int iWidth = pcInputPlane->getWidth(); 637 641 Int iHeight = pcInputPlane->getHeight(); … … 663 667 664 668 Int iSum = iTmp4 + iTmp3 - iTmp2 + ((iTmp0 + iTmp4 + iTmp5 - iTmp2) << 1) + ( ( iTmp3 - iTmp1) << 2) + ( iTmp5 << 3 ) + (( iTmp4 + iTmp5 ) << 4); 665 pcOutputPlaneData[ iXPos ] = (Pel) Clip Y((iSum + 32) >> 6);669 pcOutputPlaneData[ iXPos ] = (Pel) ClipBD((iSum + 32) >> 6, bitDepth); 666 670 pcTmpIn += 2; 667 671 } … … 671 675 }; 672 676 673 inline Pel TRenFilter::xMedian3(Pel* pcData) 677 template<UInt bitDepth> 678 inline Pel TRenFilter<bitDepth>::xMedian3(Pel* pcData) 674 679 { 675 680 Bool bGT01 = pcData[0] > pcData[1]; … … 680 685 } 681 686 682 683 Void TRenFilter ::lineMedian3( PelImage* pcImage )687 template<UInt bitDepth> 688 Void TRenFilter<bitDepth>::lineMedian3( PelImage* pcImage ) 684 689 { 685 690 … … 722 727 } 723 728 724 725 Void TRenFilter ::convRect( PelImage* pcImage, UInt uiSize )729 template<UInt bitDepth> 730 Void TRenFilter<bitDepth>::convRect( PelImage* pcImage, UInt uiSize ) 726 731 { 727 732 DoubleImage cKernel(uiSize, uiSize,1,0); … … 730 735 } 731 736 732 Void TRenFilter::binominal( PelImage* pcInputImage, PelImage* pcOutputImage, UInt uiSize ) 737 template<UInt bitDepth> 738 Void TRenFilter<bitDepth>::binominal( PelImage* pcInputImage, PelImage* pcOutputImage, UInt uiSize ) 733 739 { 734 740 assert( pcInputImage->getNumberOfFullPlanes() == pcOutputImage->getNumberOfFullPlanes () ); … … 747 753 } 748 754 749 Void TRenFilter::binominal( PelImagePlane* pcInputPlane, PelImagePlane* pcOutputPlane, UInt uiSize ) 755 template<UInt bitDepth> 756 Void TRenFilter<bitDepth>::binominal( PelImagePlane* pcInputPlane, PelImagePlane* pcOutputPlane, UInt uiSize ) 750 757 { 751 758 Int iWidth = pcInputPlane ->getWidth (); … … 777 784 { 778 785 case 1: 779 fpFilter = &TRenFilter ::xFiltBinom3;786 fpFilter = &TRenFilter<bitDepth>::xFiltBinom3; 780 787 break; 781 788 case 2: 782 fpFilter = &TRenFilter ::xFiltBinom5;789 fpFilter = &TRenFilter<bitDepth>::xFiltBinom5; 783 790 break; 784 791 case 3: 785 fpFilter = &TRenFilter ::xFiltBinom7;792 fpFilter = &TRenFilter<bitDepth>::xFiltBinom7; 786 793 break; 787 794 case 4: 788 fpFilter = &TRenFilter ::xFiltBinom9;795 fpFilter = &TRenFilter<bitDepth>::xFiltBinom9; 789 796 break; 790 797 default: … … 818 825 } 819 826 820 Pel TRenFilter::xFiltBinom3( Pel* pcInputData, Int iStride ) 821 { 822 assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth 823 827 template<UInt bitDepth> 828 Pel TRenFilter<bitDepth>::xFiltBinom3( Pel* pcInputData, Int iStride ) 829 { 824 830 Int iSum = pcInputData[-1 * iStride ] + pcInputData[ 0 ] + (pcInputData[iStride ] << 1 ); 825 return Clip Y( (iSum + 2) >> 2);826 } 827 828 Pel TRenFilter::xFiltBinom5( Pel* pcInputData, Int iStride ) 829 { 830 assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth 831 // { 1,4,6,4,1 }831 return ClipBD( (iSum + 2) >> 2 , bitDepth); 832 } 833 834 template<UInt bitDepth> 835 Pel TRenFilter<bitDepth>::xFiltBinom5( Pel* pcInputData, Int iStride ) 836 { 837 // { 1,4,6,4,1 } 832 838 Int iStride0 = 0; 833 839 Int iStrideM1 = iStride0 - iStride; … … 841 847 842 848 Int iSum = iTmp0 + (iTmp2 << 1) + ((iTmp1 + iTmp2) << 2); 843 return Clip Y( (iSum + 8) >> 4);844 } 845 846 Pel TRenFilter::xFiltBinom7( Pel* pcInputData, Int iStride ) 847 { 848 assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth 849 // { 1,6,15,20,15,6,1 }849 return ClipBD( (iSum + 8) >> 4 , bitDepth); 850 } 851 852 template<UInt bitDepth> 853 Pel TRenFilter<bitDepth>::xFiltBinom7( Pel* pcInputData, Int iStride ) 854 { 855 // { 1,6,15,20,15,6,1 } 850 856 Int iStride0 = 0; 851 857 Int iStrideM1 = iStride0 - iStride; … … 863 869 Int iSum = iTmp0 - iTmp2 + ( iTmp1 << 1) + ( (iTmp1 + iTmp3) << 2) + ((iTmp2 + iTmp3) << 4); 864 870 865 return Clip Y( (iSum + 32) >> 6);866 } 867 868 Pel TRenFilter::xFiltBinom9( Pel* pcInputData, Int iStride ) 869 { 870 assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth871 return ClipBD( (iSum + 32) >> 6 , bitDepth); 872 } 873 874 template<UInt bitDepth> 875 Pel TRenFilter<bitDepth>::xFiltBinom9( Pel* pcInputData, Int iStride ) 876 { 871 877 // { 1 8 28 56 70 56 28 8 1 } 872 878 Int iStride0 = 0; … … 888 894 Int iSum = iTmp0 + ((iTmp4 ) << 1) + ( ( iTmp4 - iTmp2 ) << 2) + ( (iTmp1 - iTmp3) << 3 ) + ((iTmp2 ) << 5) + ((iTmp3+ iTmp4 ) << 6); 889 895 890 return Clip Y( (iSum + 128) >> 8);891 } 892 893 894 Pel TRenFilter ::interpCHSpline(Double dX, Double dS0, Double dS1, Int iQ0, Int iQ1, Int iQ2, Int iQ3)896 return ClipBD( (iSum + 128) >> 8 , bitDepth); 897 } 898 899 template<UInt bitDepth> 900 Pel TRenFilter<bitDepth>::interpCHSpline(Double dX, Double dS0, Double dS1, Int iQ0, Int iQ1, Int iQ2, Int iQ3) 895 901 { 896 902 Double dSq = (dX - dS0) / (dS1 - dS0); … … 916 922 } 917 923 918 Void TRenFilter::diffHorSym(PelImage* pcInputImage, IntImage* pcOutputImage) 924 template<UInt bitDepth> 925 Void TRenFilter<bitDepth>::diffHorSym(PelImage* pcInputImage, IntImage* pcOutputImage) 919 926 { 920 927 for (UInt uiCurPlane = 0; uiCurPlane < pcInputImage->getNumberOfPlanes(); uiCurPlane++) … … 924 931 } 925 932 926 Void TRenFilter::diffHorSym(PelImagePlane* pcInputPlane, IntImagePlane* pcOutputPlane) 933 template<UInt bitDepth> 934 Void TRenFilter<bitDepth>::diffHorSym(PelImagePlane* pcInputPlane, IntImagePlane* pcOutputPlane) 927 935 { 928 936 UInt uiInputStride = pcInputPlane ->getStride(); … … 950 958 } 951 959 952 Void TRenFilter::laplace( DoubleImage* pcInputImage, DoubleImage* pcOutputImage ) 960 template<UInt bitDepth> 961 Void TRenFilter<bitDepth>::laplace( DoubleImage* pcInputImage, DoubleImage* pcOutputImage ) 953 962 { 954 963 for (UInt uiCurPlane = 0; uiCurPlane < pcInputImage->getNumberOfPlanes(); uiCurPlane++) … … 1022 1031 } 1023 1032 1024 1025 Void TRenFilter ::conv( PelImage* pcImage, DoubleImage* pcKernel )1033 template<UInt bitDepth> 1034 Void TRenFilter<bitDepth>::conv( PelImage* pcImage, DoubleImage* pcKernel ) 1026 1035 { 1027 1036 PelImage* pcTemp = pcImage->create(); … … 1096 1105 1097 1106 // Horizontal Up sampling luma 1098 Void TRenFilter::sampleHorUp( Int iLog2HorSampFac, Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride ) 1099 { 1100 TRenInterpFilter cFilter; 1107 template<UInt bitDepth> 1108 Void TRenFilter<bitDepth>::sampleHorUp( Int iLog2HorSampFac, Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride ) 1109 { 1110 TRenInterpFilter<bitDepth> cFilter; 1101 1111 switch ( iLog2HorSampFac ) 1102 1112 { … … 1118 1128 1119 1129 // horizontal up sampling chroma 1120 Void TRenFilter::sampleCHorUp(Int iLog2HorSampFac, Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride ) 1130 template<UInt bitDepth> 1131 Void TRenFilter<bitDepth>::sampleCHorUp(Int iLog2HorSampFac, Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride ) 1121 1132 { 1122 1133 switch ( iLog2HorSampFac ) … … 1127 1138 case 1: 1128 1139 xDistributeArray( pcInputPlaneData, iInputStride , 1, 1, iInputWidth, iHeight , pcOutputPlaneData , iOutputStride, 2 , 1 ); 1129 xInterpHorChroma( pcInputPlaneData , iInputStride , 1, 1, iInputWidth, iHeight , pcOutputPlaneData +1, iOutputStride, 2 , 1, &TRenInterpFilter ::xCTI_Filter_VPS04_C_HAL );1140 xInterpHorChroma( pcInputPlaneData , iInputStride , 1, 1, iInputWidth, iHeight , pcOutputPlaneData +1, iOutputStride, 2 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VPS04_C_HAL ); 1130 1141 break; 1131 1142 case 2: 1132 1143 xDistributeArray( pcInputPlaneData, iInputStride , 1, 1, iInputWidth, iHeight , pcOutputPlaneData , iOutputStride, 4 , 1 ); 1133 xInterpHorChroma( pcInputPlaneData , iInputStride , 1, 1, iInputWidth, iHeight , pcOutputPlaneData +1, iOutputStride, 4 , 1, &TRenInterpFilter::xCTI_Filter_VP04_C_QUA0 ); 1134 xInterpHorChroma( pcInputPlaneData , iInputStride , 1, 1, iInputWidth, iHeight , pcOutputPlaneData +2, iOutputStride, 4 , 1, &TRenInterpFilter::xCTI_Filter_VPS04_C_HAL ); 1135 xInterpHorChroma( pcInputPlaneData , iInputStride , 1, 1, iInputWidth, iHeight , pcOutputPlaneData +3, iOutputStride, 4 , 1, &TRenInterpFilter::xCTI_Filter_VP04_C_QUA1 ); 1136 break; 1137 } 1138 } 1139 1140 Void TRenFilter::sampleCUpHorUp( Int iLog2HorSampFac, Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride ) 1144 xInterpHorChroma( pcInputPlaneData , iInputStride , 1, 1, iInputWidth, iHeight , pcOutputPlaneData +1, iOutputStride, 4 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VP04_C_QUA0 ); 1145 xInterpHorChroma( pcInputPlaneData , iInputStride , 1, 1, iInputWidth, iHeight , pcOutputPlaneData +2, iOutputStride, 4 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VPS04_C_HAL ); 1146 xInterpHorChroma( pcInputPlaneData , iInputStride , 1, 1, iInputWidth, iHeight , pcOutputPlaneData +3, iOutputStride, 4 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VP04_C_QUA1 ); 1147 break; 1148 } 1149 } 1150 1151 template<UInt bitDepth> 1152 Void TRenFilter<bitDepth>::sampleCUpHorUp( Int iLog2HorSampFac, Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride ) 1141 1153 { 1142 1154 … … 1145 1157 case 0: 1146 1158 xDistributeArray( pcInputPlaneData-1, iInputStride , 1, 1, iInputWidth+3, iHeight , pcOutputPlaneData -2, iOutputStride, 2, 2 ); 1147 xInterpVerChroma( pcInputPlaneData-1, iInputStride , 1, 1, iInputWidth+3, iHeight , pcOutputPlaneData+1*iOutputStride-2, iOutputStride, 2 , 2, &TRenInterpFilter ::xCTI_Filter_VPS04_C_HAL );1148 xInterpHorChroma( pcOutputPlaneData , iOutputStride , 2, 1, iInputWidth, iHeight*2 , pcOutputPlaneData+1 , iOutputStride, 2 , 1, &TRenInterpFilter ::xCTI_Filter_VPS04_C_HAL );1159 xInterpVerChroma( pcInputPlaneData-1, iInputStride , 1, 1, iInputWidth+3, iHeight , pcOutputPlaneData+1*iOutputStride-2, iOutputStride, 2 , 2, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VPS04_C_HAL ); 1160 xInterpHorChroma( pcOutputPlaneData , iOutputStride , 2, 1, iInputWidth, iHeight*2 , pcOutputPlaneData+1 , iOutputStride, 2 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VPS04_C_HAL ); 1149 1161 break; 1150 1162 case 1: 1151 1163 xDistributeArray( pcInputPlaneData-1, iInputStride , 1, 1, iInputWidth+3, iHeight , pcOutputPlaneData -4, iOutputStride, 4 , 2 ); 1152 xInterpVerChroma( pcInputPlaneData-1, iInputStride , 1, 1, iInputWidth+3, iHeight , pcOutputPlaneData+1*iOutputStride-4, iOutputStride, 4 , 2, &TRenInterpFilter ::xCTI_Filter_VPS04_C_HAL );1153 xInterpHorChroma( pcOutputPlaneData , iOutputStride , 4, 1, iInputWidth, iHeight*2 , pcOutputPlaneData +1, iOutputStride, 4 , 1, &TRenInterpFilter ::xCTI_Filter_VP04_C_QUA0 );1154 xInterpHorChroma( pcOutputPlaneData , iOutputStride , 4, 1, iInputWidth, iHeight*2 , pcOutputPlaneData +2, iOutputStride, 4 , 1, &TRenInterpFilter ::xCTI_Filter_VPS04_C_HAL );1155 xInterpHorChroma( pcOutputPlaneData , iOutputStride , 4, 1, iInputWidth, iHeight*2 , pcOutputPlaneData +3, iOutputStride, 4 , 1, &TRenInterpFilter ::xCTI_Filter_VP04_C_QUA1 );1164 xInterpVerChroma( pcInputPlaneData-1, iInputStride , 1, 1, iInputWidth+3, iHeight , pcOutputPlaneData+1*iOutputStride-4, iOutputStride, 4 , 2, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VPS04_C_HAL ); 1165 xInterpHorChroma( pcOutputPlaneData , iOutputStride , 4, 1, iInputWidth, iHeight*2 , pcOutputPlaneData +1, iOutputStride, 4 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VP04_C_QUA0 ); 1166 xInterpHorChroma( pcOutputPlaneData , iOutputStride , 4, 1, iInputWidth, iHeight*2 , pcOutputPlaneData +2, iOutputStride, 4 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VPS04_C_HAL ); 1167 xInterpHorChroma( pcOutputPlaneData , iOutputStride , 4, 1, iInputWidth, iHeight*2 , pcOutputPlaneData +3, iOutputStride, 4 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VP04_C_QUA1 ); 1156 1168 break; 1157 1169 case 2: 1158 1170 xDistributeArray( pcInputPlaneData-1, iInputStride , 1, 1, iInputWidth+3, iHeight , pcOutputPlaneData -8, iOutputStride, 8 , 2 ); 1159 xInterpVerChroma( pcInputPlaneData-1, iInputStride , 1, 1, iInputWidth+3, iHeight , pcOutputPlaneData+1*iOutputStride-8, iOutputStride, 8 , 2, &TRenInterpFilter ::xCTI_Filter_VPS04_C_HAL );1160 xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth, iHeight*2 , pcOutputPlaneData +1, iOutputStride, 8 , 1, &TRenInterpFilter ::xCTI_Filter_VP04_C_OCT0 );1161 xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth, iHeight*2 , pcOutputPlaneData +2, iOutputStride, 8 , 1, &TRenInterpFilter ::xCTI_Filter_VP04_C_QUA0 );1162 xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth, iHeight*2 , pcOutputPlaneData +3, iOutputStride, 8 , 1, &TRenInterpFilter ::xCTI_Filter_VP04_C_OCT1 );1163 xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth, iHeight*2 , pcOutputPlaneData +4, iOutputStride, 8 , 1, &TRenInterpFilter ::xCTI_Filter_VPS04_C_HAL );1164 xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth, iHeight*2 , pcOutputPlaneData +5, iOutputStride, 8 , 1, &TRenInterpFilter ::xCTI_Filter_VP04_C_OCT2 );1165 xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth, iHeight*2 , pcOutputPlaneData +6, iOutputStride, 8 , 1, &TRenInterpFilter ::xCTI_Filter_VP04_C_QUA1 );1166 xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth, iHeight*2 , pcOutputPlaneData +7, iOutputStride, 8 , 1, &TRenInterpFilter ::xCTI_Filter_VP04_C_OCT3 );1171 xInterpVerChroma( pcInputPlaneData-1, iInputStride , 1, 1, iInputWidth+3, iHeight , pcOutputPlaneData+1*iOutputStride-8, iOutputStride, 8 , 2, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VPS04_C_HAL ); 1172 xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth, iHeight*2 , pcOutputPlaneData +1, iOutputStride, 8 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VP04_C_OCT0 ); 1173 xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth, iHeight*2 , pcOutputPlaneData +2, iOutputStride, 8 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VP04_C_QUA0 ); 1174 xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth, iHeight*2 , pcOutputPlaneData +3, iOutputStride, 8 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VP04_C_OCT1 ); 1175 xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth, iHeight*2 , pcOutputPlaneData +4, iOutputStride, 8 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VPS04_C_HAL ); 1176 xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth, iHeight*2 , pcOutputPlaneData +5, iOutputStride, 8 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VP04_C_OCT2 ); 1177 xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth, iHeight*2 , pcOutputPlaneData +6, iOutputStride, 8 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VP04_C_QUA1 ); 1178 xInterpHorChroma( pcOutputPlaneData , iOutputStride , 8, 1, iInputWidth, iHeight*2 , pcOutputPlaneData +7, iOutputStride, 8 , 1, &TRenInterpFilter<REN_BIT_DEPTH>::xCTI_Filter_VP04_C_OCT3 ); 1167 1179 break; 1168 1180 } … … 1171 1183 // Down Sampling 1172 1184 // Down sample luma 1173 Void TRenFilter::sampleHorDown(Int iLog2HorSampFac, Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride ) 1185 template<UInt bitDepth> 1186 Void TRenFilter<bitDepth>::sampleHorDown(Int iLog2HorSampFac, Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride ) 1174 1187 { 1175 1188 switch ( iLog2HorSampFac ) … … 1187 1200 } 1188 1201 1189 1190 Void TRenFilter ::sampleCHorDown(Int iLog2HorSampFac, Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride )1202 template<UInt bitDepth> 1203 Void TRenFilter<bitDepth>::sampleCHorDown(Int iLog2HorSampFac, Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride ) 1191 1204 { 1192 1205 //GT: currently the same as for luma … … 1197 1210 1198 1211 // Up sampling chroma 1199 Void TRenFilter::sampleCDownHorDown( Int iLog2HorSampFac, Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iInputHeight, Pel* pcOutputPlaneData, Int iOutputStride ) 1212 template<UInt bitDepth> 1213 Void TRenFilter<bitDepth>::sampleCDownHorDown( Int iLog2HorSampFac, Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iInputHeight, Pel* pcOutputPlaneData, Int iOutputStride ) 1200 1214 { 1201 1215 // create buffer … … 1219 1233 } 1220 1234 1221 Void TRenFilter::xDistributeArray(Pel* pcSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* pcDst, Int iDstStride, Int iDstStepX, Int iDstStepY) 1235 template<UInt bitDepth> 1236 Void TRenFilter<bitDepth>::xDistributeArray(const Pel* pcSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* pcDst, Int iDstStride, Int iDstStepX, Int iDstStepY) 1222 1237 { 1223 1238 iDstStride *= iDstStepY; … … 1226 1241 { 1227 1242 Pel* pcCurDst = pcDst; 1228 Pel* pcCurSrc = pcSrc;1243 const Pel* pcCurSrc = pcSrc; 1229 1244 for (Int iXPos = 0; iXPos < iWidth; iXPos ++) 1230 1245 { … … 1239 1254 } 1240 1255 1241 Void TRenFilter::xInterpHorChroma( Pel* piSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* piDst, Int iDstStride, Int iDstStepX, Int iDstStepY, FpChromaIntFilt fpFilter ) 1242 { 1243 assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth 1256 template<UInt bitDepth> 1257 Void TRenFilter<bitDepth>::xInterpHorChroma( Pel* piSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* piDst, Int iDstStride, Int iDstStepX, Int iDstStepY, FpChromaIntFilt fpFilter ) 1258 { 1244 1259 Int iSum; 1245 1260 Pel* piSrcTmp; 1246 1261 1247 TRenInterpFilter cFilter;1262 TRenInterpFilter<REN_BIT_DEPTH> cFilter; 1248 1263 for ( Int y = iHeight; y != 0; y-- ) 1249 1264 { … … 1252 1267 { 1253 1268 iSum = (cFilter.*fpFilter)( piSrcTmp, iSrcStepX ); 1254 piDst[x * iDstStepX ] = Clip C ((iSum + 32) >> 6);1269 piDst[x * iDstStepX ] = ClipBD ((iSum + 32) >> 6 , bitDepth); 1255 1270 piSrcTmp+= iSrcStepX; 1256 1271 } … … 1260 1275 } 1261 1276 1262 Void TRenFilter::xInterpVerChroma( Pel* piSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* piDst, Int iDstStride, Int iDstStepX, Int iDstStepY, FpChromaIntFilt fpFilter ) 1263 { 1264 assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth1277 template<UInt bitDepth> 1278 Void TRenFilter<bitDepth>::xInterpVerChroma( Pel* piSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* piDst, Int iDstStride, Int iDstStepX, Int iDstStepY, FpChromaIntFilt fpFilter ) 1279 { 1265 1280 Int iSum; 1266 1281 Pel* piSrcTmp; 1267 1282 1268 TRenInterpFilter cFilter;1283 TRenInterpFilter<bitDepth> cFilter; 1269 1284 for ( Int y = iHeight; y != 0; y-- ) 1270 1285 { … … 1273 1288 { 1274 1289 iSum = (cFilter.*fpFilter)( piSrcTmp, iSrcStepY * iSrcStride ); 1275 piDst[x * iDstStepX ] = Clip C ((iSum + 32) >> 6);1290 piDst[x * iDstStepX ] = ClipBD ((iSum + 32) >> 6, bitDepth ); 1276 1291 piSrcTmp += iSrcStepX; 1277 1292 } … … 1281 1296 } 1282 1297 1283 1284 Void TRenFilter::xSampleDownHor2( Pel* piSrc, Int iSrcStride, Int iSrcWidth, Int iHeight, Pel* piDst, Int iDstStride ) 1285 { 1286 1287 assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth 1298 template<UInt bitDepth> 1299 Void TRenFilter<bitDepth>::xSampleDownHor2( Pel* piSrc, Int iSrcStride, Int iSrcWidth, Int iHeight, Pel* piDst, Int iDstStride ) 1300 { 1288 1301 1289 1302 Int iSum; … … 1298 1311 // { 1,2,1 } 1299 1312 iSum = piSrcTmp[0] + piSrcTmp[2] + (piSrcTmp[1] << 1); 1300 piDst[x] = Clip Y( (iSum + 2) >> 2);1313 piDst[x] = ClipBD( (iSum + 2) >> 2 , bitDepth); 1301 1314 piSrcTmp += 2; 1302 1315 } … … 1306 1319 }; 1307 1320 1308 Void TRenFilter::xSampleDownVer2( Pel* piSrc, Int iSrcStride, Int iSrcWidth, Int iSrcHeight, Pel* piDst, Int iDstStride ) 1309 { 1310 assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth 1311 1321 template<UInt bitDepth> 1322 Void TRenFilter<bitDepth>::xSampleDownVer2( Pel* piSrc, Int iSrcStride, Int iSrcWidth, Int iSrcHeight, Pel* piDst, Int iDstStride ) 1323 { 1312 1324 Int iSum; 1313 1325 Pel* piSrcTmp; … … 1320 1332 // { 1,2,1 } 1321 1333 iSum = piSrcTmp[0] + piSrcTmp[ iSrcStride << 1] + (piSrcTmp[ iSrcStride ] << 1); 1322 piDst[x] = Clip Y( (iSum + 2) >> 2);1334 piDst[x] = ClipBD( (iSum + 2) >> 2, bitDepth ); 1323 1335 piSrcTmp += 1; 1324 1336 } … … 1328 1340 }; 1329 1341 1330 Void TRenFilter::xSampleDownHor4( Pel* piSrc, Int iSrcStride, Int iSrcWidth, Int iHeight, Pel* piDst, Int iDstStride ) 1331 { 1332 assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth1342 template<UInt bitDepth> 1343 Void TRenFilter<bitDepth>::xSampleDownHor4( Pel* piSrc, Int iSrcStride, Int iSrcWidth, Int iHeight, Pel* piDst, Int iDstStride ) 1344 { 1333 1345 1334 1346 Int iSum; … … 1348 1360 1349 1361 iSum = iTmp0 + (iTmp2 << 1) + ((iTmp1 + iTmp2) << 2); 1350 piDst[x] = Clip Y( (iSum + 8) >> 4);1362 piDst[x] = ClipBD( (iSum + 8) >> 4, bitDepth ); 1351 1363 piSrcTmp += 4; 1352 1364 } … … 1356 1368 }; 1357 1369 1358 Void TRenFilter::xSampleDownHor8( Pel* piSrc, Int iSrcStride, Int iSrcWidth, Int iHeight, Pel* piDst, Int iDstStride ) 1359 { 1360 assert( g_bitDepthY == g_bitDepthC); // ToDo: Update renderer to work with different luma/chroma bit depth 1361 1370 template<UInt bitDepth> 1371 Void TRenFilter<bitDepth>::xSampleDownHor8( Pel* piSrc, Int iSrcStride, Int iSrcWidth, Int iHeight, Pel* piDst, Int iDstStride ) 1372 { 1362 1373 Int iSum; 1363 1374 Pel* piSrcTmp; … … 1377 1388 1378 1389 iSum = iTmp0 - iTmp2 + ( iTmp1 << 1) + ( (iTmp1 + iTmp3) << 2) + ((iTmp2 + iTmp3) << 4); 1379 piDst[x] = Clip Y( (iSum + 32) >> 6);1390 piDst[x] = ClipBD( (iSum + 32) >> 6 , bitDepth); 1380 1391 piSrcTmp += 8; 1381 1392 } … … 1385 1396 }; 1386 1397 1387 Void TRenFilter::xDilate( Pel* piSrc, Int iSrcStride, Int iWidth, Int iHeight, Pel* piDst, Int iDstStride, Int iSize, Bool bVerticalDir, Bool bToTopOrLeft ) 1398 template<UInt bitDepth> 1399 Void TRenFilter<bitDepth>::xDilate( Pel* piSrc, Int iSrcStride, Int iWidth, Int iHeight, Pel* piDst, Int iDstStride, Int iSize, Bool bVerticalDir, Bool bToTopOrLeft ) 1388 1400 { 1389 1401 Int iFDimStart = 0; … … 1452 1464 1453 1465 1454 template Bool TRenFilter::compare (TRenImage<Pel >*, TRenImage<Pel>* ); 1455 template Bool TRenFilter::compare (TRenImagePlane<Pel>*, TRenImagePlane<Pel>* ); 1456 1457 template Void TRenFilter::mirrorHor( TRenImage<Double> *pcImage ); 1458 template Void TRenFilter::mirrorHor( TRenImage<Pel> *pcImage ); 1459 template Void TRenFilter::mirrorHor( TRenImage<Int> *pcImage ); 1460 template Void TRenFilter::mirrorHor( TRenImagePlane<Pel> *pcImagePlane ); 1466 template class TRenFilter<REN_BIT_DEPTH>; 1467 1468 template Bool TRenFilter<REN_BIT_DEPTH>::compare (TRenImage<Pel >*, TRenImage<Pel>* ); 1469 template Bool TRenFilter<REN_BIT_DEPTH>::compare (TRenImagePlane<Pel>*, TRenImagePlane<Pel>* ); 1470 1471 template Void TRenFilter<REN_BIT_DEPTH>::mirrorHor( TRenImage<Double> *pcImage ); 1472 template Void TRenFilter<REN_BIT_DEPTH>::mirrorHor( TRenImage<Pel> *pcImage ); 1473 template Void TRenFilter<REN_BIT_DEPTH>::mirrorHor( TRenImage<Int> *pcImage ); 1474 template Void TRenFilter<REN_BIT_DEPTH>::mirrorHor( TRenImagePlane<Pel> *pcImagePlane ); 1461 1475 1462 1476 #endif -
branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenFilter.h
r1179 r1200 39 39 #include "TRenImage.h" 40 40 #include "TRenInterpFilter.h" 41 #if H_3D41 #if NH_3D 42 42 43 typedef Int (TRenInterpFilter ::*FpChromaIntFilt) ( Pel*, Int );43 typedef Int (TRenInterpFilter<REN_BIT_DEPTH>::*FpChromaIntFilt) ( Pel*, Int ); 44 44 45 template<UInt bitDepthLuma> 45 46 class TRenFilter 46 47 { … … 53 54 54 55 /////////// Copy /////////// 55 static Void copy( Pel* pcInputPlaneData, Int iInputStride, Int iWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride);56 static Void copy( const Pel* pcInputPlaneData, Int iInputStride, Int iWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride); 56 57 57 58 /////////// Horizontal Mirroring /////////// … … 129 130 static Void xInterpVerChroma(Pel* piSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* piDst, Int iDstStride, Int iDstStepX, Int iDstStepY, FpChromaIntFilt fpFilter); 130 131 static Void xInterpHorChroma(Pel* piSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* piDst, Int iDstStride, Int iDstStepX, Int iDstStepY, FpChromaIntFilt fpFilter); 131 static Void xDistributeArray( Pel* pcSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* pcDst, Int iDstStride, Int iDstStepX, Int iDstStepY );132 static Void xDistributeArray(const Pel* pcSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* pcDst, Int iDstStride, Int iDstStepX, Int iDstStepY ); 132 133 133 134 // Binominal Filtering -
branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenImage.cpp
r1179 r1200 37 37 #include "TRenFilter.h" 38 38 #include "assert.h" 39 #if H_3D39 #if NH_3D 40 40 41 41 42 42 template<typename T> 43 43 TRenImage<T>::TRenImage( TRenImage& rcIn ) 44 { 44 { 45 45 allocatePlanes( rcIn.getPlane(0)->getWidth(), rcIn.getPlane(0)->getHeight(), rcIn.getNumberOfFullPlanes(), rcIn.getNumberOfQuaterPlanes() ) ; assign(&rcIn); 46 46 } … … 48 48 template<typename T> 49 49 TRenImage<T>::TRenImage( UInt uiWidth, UInt uiHeight, UInt uiNumberOfFullPlanes, UInt uiNumberOfQuaterPlanes ) 50 { 50 { 51 51 allocatePlanes( uiWidth, uiHeight, uiNumberOfFullPlanes, uiNumberOfQuaterPlanes ); 52 52 } … … 55 55 TRenImage<T>::TRenImage() : m_uiNumberOfFullPlanes(0), m_uiNumberOfQuaterPlanes(0), m_uiNumberOfPlanes(0), m_apcPlanes(0) 56 56 { 57 57 58 58 } 59 59 … … 61 61 template<> 62 62 TRenImage<Pel>::TRenImage( TComPicYuv* pcPicYuv, Bool bFirstPlaneOnly ) 63 { 63 { 64 64 if (bFirstPlaneOnly) //400 65 65 { … … 68 68 m_uiNumberOfQuaterPlanes = 0; 69 69 m_apcPlanes = new TRenImagePlane<Pel>*[ m_uiNumberOfPlanes ]; 70 m_apcPlanes[0] = new TRenImagePlane<Pel>( pcPicYuv->getBuf Y(), pcPicYuv->getWidth() + (REN_LUMA_MARGIN << 1), pcPicYuv->getHeight()+ (REN_LUMA_MARGIN << 1), pcPicYuv->getStride (), REN_LUMA_MARGIN );70 m_apcPlanes[0] = new TRenImagePlane<Pel>( pcPicYuv->getBuf( COMPONENT_Y ), pcPicYuv->getWidth( COMPONENT_Y ) + (REN_LUMA_MARGIN << 1), pcPicYuv->getHeight( COMPONENT_Y ) + (REN_LUMA_MARGIN << 1), pcPicYuv->getStride( COMPONENT_Y ), REN_LUMA_MARGIN ); 71 71 } 72 72 else //420 … … 77 77 78 78 m_apcPlanes = new TRenImagePlane<Pel>*[ m_uiNumberOfPlanes ]; 79 m_apcPlanes[0] = new TRenImagePlane<Pel>( pcPicYuv->getBuf Y(), pcPicYuv->getWidth() + (REN_LUMA_MARGIN << 1), pcPicYuv->getHeight() + (REN_LUMA_MARGIN << 1), pcPicYuv->getStride (), REN_LUMA_MARGIN );80 m_apcPlanes[1] = new TRenImagePlane<Pel>( pcPicYuv->getBuf U(), (pcPicYuv->getWidth()>>1)+ REN_LUMA_MARGIN , (pcPicYuv->getHeight()>>1) + REN_LUMA_MARGIN , pcPicYuv->getCStride(), REN_LUMA_MARGIN >> 1 );81 m_apcPlanes[2] = new TRenImagePlane<Pel>( pcPicYuv->getBuf V(), (pcPicYuv->getWidth()>>1)+ REN_LUMA_MARGIN , (pcPicYuv->getHeight()>>1) + REN_LUMA_MARGIN , pcPicYuv->getCStride(), REN_LUMA_MARGIN >> 1 );79 m_apcPlanes[0] = new TRenImagePlane<Pel>( pcPicYuv->getBuf( COMPONENT_Y ), pcPicYuv->getWidth( COMPONENT_Y ) + (REN_LUMA_MARGIN << 1), pcPicYuv->getHeight( COMPONENT_Y ) + (REN_LUMA_MARGIN << 1), pcPicYuv->getStride( COMPONENT_Y ), REN_LUMA_MARGIN ); 80 m_apcPlanes[1] = new TRenImagePlane<Pel>( pcPicYuv->getBuf( COMPONENT_Cb ), pcPicYuv->getWidth( COMPONENT_Cb ) + REN_LUMA_MARGIN , pcPicYuv->getHeight( COMPONENT_Cb ) + REN_LUMA_MARGIN , pcPicYuv->getStride( COMPONENT_Cb), REN_LUMA_MARGIN >> 1 ); 81 m_apcPlanes[2] = new TRenImagePlane<Pel>( pcPicYuv->getBuf( COMPONENT_Cr ), pcPicYuv->getWidth( COMPONENT_Cr ) + REN_LUMA_MARGIN , pcPicYuv->getHeight( COMPONENT_Cr ) + REN_LUMA_MARGIN , pcPicYuv->getStride( COMPONENT_Cr), REN_LUMA_MARGIN >> 1 ); 82 82 } 83 83 } … … 109 109 110 110 template<typename T> 111 Void TRenImage<T>::getDataAndStrides( T** pptData, Int* piStrides ) 111 Void TRenImage<T>::getDataAndStrides( T** pptData, Int* piStrides ) const 112 112 { 113 113 for (UInt uiCurPlane = 0; uiCurPlane < m_uiNumberOfPlanes; uiCurPlane++ ) … … 120 120 121 121 template<typename T> 122 Void TRenImage<T>::getWidthAndHeight( Int* ppiWidths, Int* ppiHeights ) 122 Void TRenImage<T>::getWidthAndHeight( Int* ppiWidths, Int* ppiHeights ) const 123 123 { 124 124 for (UInt uiCurPlane = 0; uiCurPlane < m_uiNumberOfPlanes; uiCurPlane++ ) … … 233 233 for (UInt uiCurPlane = 1; uiCurPlane < m_uiNumberOfPlanes; uiCurPlane++) 234 234 { 235 m_apcPlanes[uiCurPlane]->assign( (Pel) ( 1 << ( g_bitDepthC - 1 ) ) ); 236 } 237 } 238 239 240 template<class T> 241 TRenImage<T>::~TRenImage() { 235 m_apcPlanes[uiCurPlane]->assign( (Pel) ( 1 << ( REN_BIT_DEPTH - 1 ) ) ); 236 } 237 } 238 239 240 template<class T> 241 TRenImage<T>::~TRenImage() 242 { 242 243 xDeletePlanes(); 243 244 delete[] m_apcPlanes; … … 272 273 template Void TRenImage<Pel>::assign<Pel> (TRenImage<Pel>* ); 273 274 274 #endif // H_3D275 #endif // NH_3D -
branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenImage.h
r1179 r1200 39 39 #include "../TLibCommon/TComPicYuv.h" 40 40 #include "TRenImagePlane.h" 41 #if H_3D41 #if NH_3D 42 42 43 43 … … 70 70 TRenImagePlane<T>** getPlanes() const; 71 71 72 Void getDataAndStrides ( T** pptData, Int* piStrides );73 Void getWidthAndHeight ( Int* piWidths, Int* piHeights );72 Void getDataAndStrides ( T** pptData, Int* piStrides ) const ; 73 Void getWidthAndHeight ( Int* piWidths, Int* piHeights ) const ; 74 74 75 75 UInt getNumberOfPlanes() const; 76 76 UInt getNumberOfQuaterPlanes() const; 77 77 UInt getNumberOfFullPlanes() const; 78 Bool is420() {return m_uiNumberOfFullPlanes == 1 && m_uiNumberOfQuaterPlanes == 2; };79 Bool is444() {return m_uiNumberOfFullPlanes == 3 && m_uiNumberOfQuaterPlanes == 0; };80 Bool is400() {return m_uiNumberOfFullPlanes == 1 && m_uiNumberOfQuaterPlanes == 0; };78 Bool is420() const {return m_uiNumberOfFullPlanes == 1 && m_uiNumberOfQuaterPlanes == 2; }; 79 Bool is444() const {return m_uiNumberOfFullPlanes == 3 && m_uiNumberOfQuaterPlanes == 0; }; 80 Bool is400() const {return m_uiNumberOfFullPlanes == 1 && m_uiNumberOfQuaterPlanes == 0; }; 81 81 82 82 // Assign … … 95 95 UInt m_uiNumberOfQuaterPlanes; 96 96 UInt m_uiNumberOfPlanes; 97 UInt m_bitDepth; 97 98 TRenImagePlane<T> ** m_apcPlanes; // First Full Planes, then Quater Planes 98 99 … … 100 101 }; 101 102 102 #endif // H_3D103 #endif // NH_3D 103 104 #endif // __TRENIMAGE__ 104 105 -
branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenImagePlane.cpp
r1179 r1200 36 36 #include "TRenFilter.h" 37 37 #include <string.h> 38 #if H_3D38 #if NH_3D 39 39 40 40 /////// TRenImagePlane /////// … … 528 528 template class TRenImagePlanePart<Bool>; 529 529 template class TRenImagePlanePart<Int>; 530 #endif // H_3D531 530 #endif // NH_3D 531 -
branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenImagePlane.h
r1179 r1200 39 39 #include "../TLibCommon/TComPicYuv.h" 40 40 41 #if H_3D41 #if NH_3D 42 42 #define PelImagePlane TRenImagePlane<Pel> 43 43 #define DoubleImagePlane TRenImagePlane<Double> … … 122 122 }; 123 123 124 #endif // H_3D124 #endif // NH_3D 125 125 #endif // __TRENIMAGEPLANE__ -
branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenInterpFilter.cpp
r1179 r1200 39 39 40 40 #include "TRenInterpFilter.h" 41 #if H_3D41 #if NH_3D 42 42 43 43 // ==================================================================================================================== … … 45 45 // ==================================================================================================================== 46 46 47 TRenInterpFilter::TRenInterpFilter() 47 template<UInt bitDepthLuma> 48 TRenInterpFilter<bitDepthLuma>::TRenInterpFilter() 48 49 { 49 50 // initial number of taps for Luma 50 51 } 51 52 52 #endif // H_3D 53 template class TRenInterpFilter<REN_BIT_DEPTH>; 54 #endif // NH_3D 53 55 -
branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenInterpFilter.h
r1179 r1200 44 44 #include "TLibCommon/CommonDef.h" 45 45 #include "assert.h" 46 #if H_3D46 #if NH_3D 47 47 48 48 // ==================================================================================================================== … … 60 60 61 61 /// interpolation filter class 62 template<UInt bitDepth> 62 63 class TRenInterpFilter 63 64 { … … 104 105 __inline Int xCTI_Filter_VP04_C_OCT3( Pel* pSrc, Int iStride ); 105 106 __inline Int xCTI_Filter_VI04_C_OCT3( Int* pSrc, Int iStride ); 107 private: 108 __inline Int xClipY( Pel x ) { return std::min<Pel>(Pel((1 << bitDepth)-1), std::max<Pel>( Pel(0), x)); } 109 __inline Int xClipC( Pel x ) { return std::min<Pel>(Pel((1 << bitDepth)-1), std::max<Pel>( Pel(0), x)); } 106 110 107 111 }; … … 111 115 // DCTIF filters 112 116 // ------------------------------------------------------------------------------------------------ 113 114 __inline Void TRenInterpFilter::xCTI_FilterHalfHor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst) 115 { 116 assert( g_bitDepthC == g_bitDepthY); // ToDo: Update renderer to work with different luma/chroma bit depth 117 117 template<UInt bitDepth> 118 __inline Void TRenInterpFilter<bitDepth>::xCTI_FilterHalfHor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst) 119 { 118 120 Pel* piDst = rpiDst; 119 121 Int iSum; … … 146 148 - iTmp0 - iTmp2; 147 149 148 piDst [x * iDstStep] = ClipY( (iSum + 32) >> 6 );150 piDst [x * iDstStep] = xClipY( (iSum + 32) >> 6 ); 149 151 piSrcTmp += iSrcStep; 150 152 } … … 155 157 } 156 158 157 __inline Void TRenInterpFilter::xCTI_FilterHalfHor(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst) 158 { 159 assert( g_bitDepthC == g_bitDepthY); // ToDo: Update renderer to work with different luma/chroma bit depth 160 159 template<UInt bitDepth> 160 __inline Void TRenInterpFilter<bitDepth>::xCTI_FilterHalfHor(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst) 161 { 161 162 Pel* piDst = rpiDst; 162 163 Int iSum; … … 189 190 - iTmp0 - iTmp2; 190 191 191 piDst [x * iDstStep] = ClipY( (iSum + 2048) >> 12 );192 piDst [x * iDstStep] = xClipY( (iSum + 2048) >> 12 ); 192 193 piSrcTmp += iSrcStep; 193 194 } … … 198 199 } 199 200 200 __inline Void TRenInterpFilter::xCTI_FilterQuarter0Hor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst) 201 { 202 assert( g_bitDepthC == g_bitDepthY); // ToDo: Update renderer to work with different luma/chroma bit depth201 template<UInt bitDepth> 202 __inline Void TRenInterpFilter<bitDepth>::xCTI_FilterQuarter0Hor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst) 203 { 203 204 Pel* piDst = rpiDst; 204 205 Int iSum; … … 229 230 + ( piSrcTmp[iSrcStep4] << 4 ); 230 231 231 piDst [x * iDstStep] = ClipY(( (iSum + 32) >> 6 )+ piSrcTmp[iSrcStep3]);232 piDst [x * iDstStep] = xClipY(( (iSum + 32) >> 6 )+ piSrcTmp[iSrcStep3]); 232 233 piSrcTmp += iSrcStep; 233 234 } … … 238 239 } 239 240 240 __inline Void TRenInterpFilter::xCTI_FilterQuarter0Hor(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst) 241 { 242 assert( g_bitDepthC == g_bitDepthY); // ToDo: Update renderer to work with different luma/chroma bit depth 243 241 template<UInt bitDepth> 242 __inline Void TRenInterpFilter<bitDepth>::xCTI_FilterQuarter0Hor(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst) 243 { 244 244 Pel* piDst = rpiDst; 245 245 Int iSum; … … 271 271 + ( piSrcTmp[iSrcStep3] << 6 ); 272 272 273 piDst [x * iDstStep] = ClipY( (iSum + 2048) >> 12 );273 piDst [x * iDstStep] = xClipY( (iSum + 2048) >> 12 ); 274 274 piSrcTmp += iSrcStep; 275 275 } … … 280 280 } 281 281 282 __inline Void TRenInterpFilter::xCTI_FilterQuarter1Hor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst) 283 { 284 assert( g_bitDepthC == g_bitDepthY); // ToDo: Update renderer to work with different luma/chroma bit depth 282 template<UInt bitDepth> 283 __inline Void TRenInterpFilter<bitDepth>::xCTI_FilterQuarter1Hor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst) 284 { 285 285 Pel* piDst = rpiDst; 286 286 Int iSum; … … 310 310 + ( piSrcTmp[iSrcStep3] << 4 ); 311 311 312 piDst [x * iDstStep] = ClipY( ((iSum + 32) >> 6) + piSrcTmp[iSrcStep4] );312 piDst [x * iDstStep] = xClipY( ((iSum + 32) >> 6) + piSrcTmp[iSrcStep4] ); 313 313 piSrcTmp += iSrcStep; 314 314 } … … 319 319 } 320 320 321 __inline Void TRenInterpFilter::xCTI_FilterQuarter1Hor(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst) 322 { 323 assert( g_bitDepthC == g_bitDepthY); // ToDo: Update renderer to work with different luma/chroma bit depth 324 321 template<UInt bitDepth> 322 __inline Void TRenInterpFilter<bitDepth>::xCTI_FilterQuarter1Hor(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst) 323 { 325 324 Pel* piDst = rpiDst; 326 325 Int iSum; … … 351 350 + ( piSrcTmp[iSrcStep4] << 6 ); 352 351 353 piDst [x * iDstStep] = ClipY( (iSum + 2048) >> 12 );352 piDst [x * iDstStep] = xClipY( (iSum + 2048) >> 12 ); 354 353 piSrcTmp += iSrcStep; 355 354 } … … 360 359 } 361 360 362 __inline Void TRenInterpFilter::xCTI_FilterHalfVer (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst, Int iDstStridePel, Pel*& rpiDstPel ) 363 { 364 assert( g_bitDepthC == g_bitDepthY); // ToDo: Update renderer to work with different luma/chroma bit depth 361 template<UInt bitDepth> 362 __inline Void TRenInterpFilter<bitDepth>::xCTI_FilterHalfVer (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst, Int iDstStridePel, Pel*& rpiDstPel ) 363 { 365 364 Int* piDst = rpiDst; 366 365 Pel* piDstPel = rpiDstPel; … … 394 393 395 394 piDst[x * iDstStep] = iSum; 396 piDstPel[x * iDstStep] = ClipY( (iSum + 32) >> 6 );395 piDstPel[x * iDstStep] = xClipY( (iSum + 32) >> 6 ); 397 396 piSrcTmp += iSrcStep; 398 397 } … … 404 403 } 405 404 406 __inline Void TRenInterpFilter::xCTI_FilterHalfVer (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst) 405 template<UInt bitDepth> 406 __inline Void TRenInterpFilter<bitDepth>::xCTI_FilterHalfVer (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst) 407 407 { 408 408 Int* piDst = rpiDst; … … 444 444 } 445 445 446 __inline Void TRenInterpFilter::xCTI_FilterHalfVer (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst) 447 { 448 assert( g_bitDepthC == g_bitDepthY); // ToDo: Update renderer to work with different luma/chroma bit depth 446 template<UInt bitDepth> 447 __inline Void TRenInterpFilter<bitDepth>::xCTI_FilterHalfVer (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst) 448 { 449 449 Pel* piDst = rpiDst; 450 450 Int iSum; … … 477 477 - iTmp0 - iTmp2; 478 478 479 piDst[x * iDstStep] = ClipY( (iSum + 32) >> 6 );479 piDst[x * iDstStep] = xClipY( (iSum + 32) >> 6 ); 480 480 piSrcTmp += iSrcStep; 481 481 } … … 486 486 } 487 487 488 __inline Void TRenInterpFilter::xCTI_FilterQuarter0Ver (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst) 488 template<UInt bitDepth> 489 __inline Void TRenInterpFilter<bitDepth>::xCTI_FilterQuarter0Ver (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst) 489 490 { 490 491 Int* piDst = rpiDst; … … 525 526 } 526 527 527 __inline Void TRenInterpFilter::xCTI_FilterQuarter0Ver (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst) 528 { 529 assert( g_bitDepthC == g_bitDepthY ); // ToDo: Update renderer to work with different luma/chroma bit depth 528 template<UInt bitDepth> 529 __inline Void TRenInterpFilter<bitDepth>::xCTI_FilterQuarter0Ver (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst) 530 { 530 531 Pel* piDst = rpiDst; 531 532 Int iSum; … … 556 557 + ( piSrcTmp[iSrcStride4] << 4 ); 557 558 558 piDst[x * iDstStep] = ClipY( ((iSum + 32) >> 6) + piSrcTmp[iSrcStride3] );559 piDst[x * iDstStep] = xClipY( ((iSum + 32) >> 6) + piSrcTmp[iSrcStride3] ); 559 560 piSrcTmp += iSrcStep; 560 561 } … … 565 566 } 566 567 567 __inline Void TRenInterpFilter::xCTI_FilterQuarter1Ver (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst) 568 template<UInt bitDepth> 569 __inline Void TRenInterpFilter<bitDepth>::xCTI_FilterQuarter1Ver (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst) 568 570 { 569 571 Int* piDst = rpiDst; … … 604 606 } 605 607 606 __inline Void TRenInterpFilter::xCTI_FilterQuarter1Ver (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst) 607 { 608 assert( g_bitDepthC == g_bitDepthY); // ToDo: Update renderer to work with different luma/chroma bit depth 609 608 template<UInt bitDepth> 609 __inline Void TRenInterpFilter<bitDepth>::xCTI_FilterQuarter1Ver (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst) 610 { 610 611 Pel* piDst = rpiDst; 611 612 Int iSum; … … 635 636 + ( piSrcTmp[iSrcStride3] << 4 ); 636 637 637 piDst[x * iDstStep] = ClipY( ((iSum + 32) >> 6) + piSrcTmp[iSrcStride4] );638 piDst[x * iDstStep] = xClipY( ((iSum + 32) >> 6) + piSrcTmp[iSrcStride4] ); 638 639 piSrcTmp += iSrcStep; 639 640 } … … 647 648 // DCTIF filters for Chroma 648 649 // ------------------------------------------------------------------------------------------------ 649 __inline Void TRenInterpFilter::xCTI_Filter2DVerC (Pel* piSrc, Int iSrcStride, Int iWidth, Int iHeight, Int iDstStride, Int*& rpiDst, Int iMV) 650 template<UInt bitDepth> 651 __inline Void TRenInterpFilter<bitDepth>::xCTI_Filter2DVerC (Pel* piSrc, Int iSrcStride, Int iWidth, Int iHeight, Int iDstStride, Int*& rpiDst, Int iMV) 650 652 { 651 653 Int* piDst = rpiDst; … … 774 776 } 775 777 776 __inline Void TRenInterpFilter::xCTI_Filter2DHorC(Int* piSrc, Int iSrcStride, Int iWidth, Int iHeight, Int iDstStride, Pel*& rpiDst, Int iMV) 777 { 778 assert( g_bitDepthC == g_bitDepthY); // ToDo: Update renderer to work with different luma/chroma bit depth 778 template<UInt bitDepth> 779 __inline Void TRenInterpFilter<bitDepth>::xCTI_Filter2DHorC(Int* piSrc, Int iSrcStride, Int iWidth, Int iHeight, Int iDstStride, Pel*& rpiDst, Int iMV) 780 { 779 781 Pel* piDst = rpiDst; 780 782 Int iSum; … … 791 793 { 792 794 iSum = xCTI_Filter_VI04_C_OCT0( piSrcTmp, 1 ); 793 piDst [x ] = ClipC ((iSum + 2048) >> 12 );795 piDst [x ] = xClipC ((iSum + 2048) >> 12 ); 794 796 piSrcTmp++; 795 797 } … … 807 809 { 808 810 iSum = xCTI_Filter_VI04_C_QUA0( piSrcTmp, 1 ); 809 piDst [x ] = ClipC ((iSum + 2048) >> 12 );811 piDst [x ] = xClipC ((iSum + 2048) >> 12 ); 810 812 piSrcTmp++; 811 813 } … … 823 825 { 824 826 iSum = xCTI_Filter_VI04_C_QUA1( piSrcTmp, 1 ); 825 piDst [x ] = ClipC ((iSum + 2048) >> 12 );827 piDst [x ] = xClipC ((iSum + 2048) >> 12 ); 826 828 piSrcTmp++; 827 829 } … … 839 841 { 840 842 iSum = xCTI_Filter_VI04_C_OCT1( piSrcTmp, 1 ); 841 piDst [x ] = ClipC ((iSum + 2048) >> 12 );843 piDst [x ] = xClipC ((iSum + 2048) >> 12 ); 842 844 piSrcTmp++; 843 845 } … … 855 857 { 856 858 iSum = xCTI_Filter_VI04_C_OCT2( piSrcTmp, 1 ); 857 piDst [x ] = ClipC ((iSum + 2048) >> 12 );859 piDst [x ] = xClipC ((iSum + 2048) >> 12 ); 858 860 piSrcTmp++; 859 861 } … … 871 873 { 872 874 iSum = xCTI_Filter_VI04_C_OCT3( piSrcTmp, 1 ); 873 piDst [x ] = ClipC ((iSum + 2048) >> 12 );875 piDst [x ] = xClipC ((iSum + 2048) >> 12 ); 874 876 piSrcTmp++; 875 877 } … … 887 889 { 888 890 iSum = xCTI_Filter_VIS04_C_HAL( piSrcTmp, 1 ); 889 piDst [x ] = ClipC ((iSum + 2048) >> 12 );891 piDst [x ] = xClipC ((iSum + 2048) >> 12 ); 890 892 piSrcTmp++; 891 893 } … … 902 904 } 903 905 904 __inline Void TRenInterpFilter::xCTI_Filter1DVerC (Pel* piSrc, Int iSrcStride, Int iWidth, Int iHeight, Int iDstStride, Pel*& rpiDst, Int iMV) 905 { 906 assert( g_bitDepthC == g_bitDepthY); // ToDo: Update renderer to work with different luma/chroma bit depth 907 906 template<UInt bitDepth> 907 __inline Void TRenInterpFilter<bitDepth>::xCTI_Filter1DVerC (Pel* piSrc, Int iSrcStride, Int iWidth, Int iHeight, Int iDstStride, Pel*& rpiDst, Int iMV) 908 { 908 909 Pel* piDst = rpiDst; 909 910 Int iSum; … … 920 921 { 921 922 iSum = xCTI_Filter_VP04_C_OCT0( piSrcTmp, iSrcStride ); 922 piDst[x ] = ClipC ((iSum + 32) >> 6 );923 piDst[x ] = xClipC ((iSum + 32) >> 6 ); 923 924 piSrcTmp++; 924 925 } … … 936 937 { 937 938 iSum = xCTI_Filter_VP04_C_QUA0( piSrcTmp, iSrcStride ); 938 piDst[x ] = ClipC ((iSum + 32) >> 6 );939 piDst[x ] = xClipC ((iSum + 32) >> 6 ); 939 940 piSrcTmp++; 940 941 } … … 952 953 { 953 954 iSum = xCTI_Filter_VP04_C_QUA1( piSrcTmp, iSrcStride ); 954 piDst[x ] = ClipC ((iSum + 32) >> 6 );955 piDst[x ] = xClipC ((iSum + 32) >> 6 ); 955 956 piSrcTmp++; 956 957 } … … 968 969 { 969 970 iSum = xCTI_Filter_VP04_C_OCT1( piSrcTmp, iSrcStride ); 970 piDst[x ] = ClipC ((iSum + 32) >> 6 );971 piDst[x ] = xClipC ((iSum + 32) >> 6 ); 971 972 piSrcTmp++; 972 973 } … … 984 985 { 985 986 iSum = xCTI_Filter_VP04_C_OCT2( piSrcTmp, iSrcStride ); 986 piDst[x ] = ClipC ((iSum + 32) >> 6 );987 piDst[x ] = xClipC ((iSum + 32) >> 6 ); 987 988 piSrcTmp++; 988 989 } … … 1000 1001 { 1001 1002 iSum = xCTI_Filter_VP04_C_OCT3( piSrcTmp, iSrcStride ); 1002 piDst[x ] = ClipC ((iSum + 32) >> 6 );1003 piDst[x ] = xClipC ((iSum + 32) >> 6 ); 1003 1004 piSrcTmp++; 1004 1005 } … … 1016 1017 { 1017 1018 iSum = xCTI_Filter_VPS04_C_HAL( piSrcTmp, iSrcStride ); 1018 piDst[x ] = ClipC ((iSum + 32) >> 6 );1019 piDst[x ] = xClipC ((iSum + 32) >> 6 ); 1019 1020 piSrcTmp++; 1020 1021 } … … 1030 1031 } 1031 1032 1032 __inline Void TRenInterpFilter::xCTI_Filter1DHorC(Pel* piSrc, Int iSrcStride, Int iWidth, Int iHeight, Int iDstStride, Pel*& rpiDst, Int iMV) 1033 template<UInt bitDepth> 1034 __inline Void TRenInterpFilter<bitDepth>::xCTI_Filter1DHorC(Pel* piSrc, Int iSrcStride, Int iWidth, Int iHeight, Int iDstStride, Pel*& rpiDst, Int iMV) 1033 1035 { 1034 1036 Pel* piDst = rpiDst; … … 1046 1048 { 1047 1049 iSum = xCTI_Filter_VP04_C_OCT0( piSrcTmp, 1 ); 1048 piDst[x ] = ClipC ((iSum + 32) >> 6 );1050 piDst[x ] = xClipC ((iSum + 32) >> 6 ); 1049 1051 piSrcTmp++; 1050 1052 } … … 1062 1064 { 1063 1065 iSum = xCTI_Filter_VP04_C_QUA0( piSrcTmp, 1 ); 1064 piDst[x ] = ClipC ((iSum + 32) >> 6 );1066 piDst[x ] = xClipC ((iSum + 32) >> 6 ); 1065 1067 piSrcTmp++; 1066 1068 } … … 1078 1080 { 1079 1081 iSum = xCTI_Filter_VP04_C_QUA1( piSrcTmp, 1 ); 1080 piDst[x ] = ClipC ((iSum + 32) >> 6 );1082 piDst[x ] = xClipC ((iSum + 32) >> 6 ); 1081 1083 piSrcTmp++; 1082 1084 } … … 1094 1096 { 1095 1097 iSum = xCTI_Filter_VP04_C_OCT1( piSrcTmp, 1 ); 1096 piDst[x ] = ClipC ((iSum + 32) >> 6 );1098 piDst[x ] = xClipC ((iSum + 32) >> 6 ); 1097 1099 piSrcTmp++; 1098 1100 } … … 1110 1112 { 1111 1113 iSum = xCTI_Filter_VP04_C_OCT2( piSrcTmp, 1 ); 1112 piDst[x ] = ClipC ((iSum + 32) >> 6 );1114 piDst[x ] = xClipC ((iSum + 32) >> 6 ); 1113 1115 piSrcTmp++; 1114 1116 } … … 1126 1128 { 1127 1129 iSum = xCTI_Filter_VP04_C_OCT3( piSrcTmp, 1 ); 1128 piDst[x ] = ClipC ((iSum + 32) >> 6 );1130 piDst[x ] = xClipC ((iSum + 32) >> 6 ); 1129 1131 piSrcTmp++; 1130 1132 } … … 1142 1144 { 1143 1145 iSum = xCTI_Filter_VPS04_C_HAL( piSrcTmp, 1 ); 1144 piDst[x ] = ClipC ((iSum + 32) >> 6 );1146 piDst[x ] = xClipC ((iSum + 32) >> 6 ); 1145 1147 piSrcTmp++; 1146 1148 } … … 1156 1158 } 1157 1159 1158 __inline Int TRenInterpFilter::xCTI_Filter_VP04_C_OCT0( Pel* pSrc, Int iStride ) 1160 template<UInt bitDepth> 1161 __inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VP04_C_OCT0( Pel* pSrc, Int iStride ) 1159 1162 {// { -3, 60, 8, -1,} // 1/8 1160 1163 Int iSum, iIdx = 0; … … 1168 1171 return iSum; 1169 1172 } 1170 __inline Int TRenInterpFilter::xCTI_Filter_VI04_C_OCT0( Int* pSrc, Int iStride ) 1173 template<UInt bitDepth> 1174 __inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VI04_C_OCT0( Int* pSrc, Int iStride ) 1171 1175 { // { -3, 60, 8, -1,} //1/8 1172 1176 Int iSum, iIdx = 0; … … 1180 1184 return iSum; 1181 1185 } 1182 __inline Int TRenInterpFilter::xCTI_Filter_VP04_C_QUA0( Pel* pSrc, Int iStride ) 1186 template<UInt bitDepth> 1187 __inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VP04_C_QUA0( Pel* pSrc, Int iStride ) 1183 1188 {// { -4, 54, 16, -2,} // 1/4 1184 1189 Int iSum, iIdx = 0; … … 1192 1197 return iSum; 1193 1198 } 1194 __inline Int TRenInterpFilter::xCTI_Filter_VI04_C_QUA0( Int* pSrc, Int iStride ) 1199 1200 template<UInt bitDepth> 1201 __inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VI04_C_QUA0( Int* pSrc, Int iStride ) 1195 1202 { // { -4, 54, 16, -2,} //1/4 1196 1203 Int iSum, iIdx = 0; … … 1204 1211 return iSum; 1205 1212 } 1206 __inline Int TRenInterpFilter::xCTI_Filter_VP04_C_QUA1( Pel* pSrc, Int iStride ) 1213 template<UInt bitDepth> 1214 __inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VP04_C_QUA1( Pel* pSrc, Int iStride ) 1207 1215 {// { -2, 16, 54, -4,}// 3/4 1208 1216 Int iSum, iIdx = 0; … … 1216 1224 return iSum; 1217 1225 } 1218 __inline Int TRenInterpFilter::xCTI_Filter_VI04_C_QUA1( Int* pSrc, Int iStride ) 1226 1227 template<UInt bitDepth> 1228 __inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VI04_C_QUA1( Int* pSrc, Int iStride ) 1219 1229 {// { -2, 16, 54, -4,}// 3/4 1220 1230 Int iSum, iIdx = 0; … … 1228 1238 return iSum; 1229 1239 } 1230 __inline Int TRenInterpFilter::xCTI_Filter_VP04_C_OCT1( Pel* pSrc, Int iStride ) 1240 1241 template<UInt bitDepth> 1242 __inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VP04_C_OCT1( Pel* pSrc, Int iStride ) 1231 1243 {// { -5, 46, 27, -4,} // 3/8 1232 1244 Int iSum, iIdx = 0; … … 1241 1253 return iSum; 1242 1254 } 1243 __inline Int TRenInterpFilter::xCTI_Filter_VI04_C_OCT1( Int* pSrc, Int iStride ) 1255 1256 template<UInt bitDepth> 1257 __inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VI04_C_OCT1( Int* pSrc, Int iStride ) 1244 1258 { // { -5, 46, 27, -4,} //3/8 1245 1259 Int iSum, iIdx = 0; … … 1254 1268 return iSum; 1255 1269 } 1256 __inline Int TRenInterpFilter::xCTI_Filter_VPS04_C_HAL( Pel* pSrc, Int iStride ) 1270 1271 template<UInt bitDepth> 1272 __inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VPS04_C_HAL( Pel* pSrc, Int iStride ) 1257 1273 { 1258 1274 // { -4, 36, 36, -4,}, // 1/2 … … 1265 1281 return iSum; 1266 1282 } 1267 __inline Int TRenInterpFilter::xCTI_Filter_VIS04_C_HAL( Int* pSrc, Int iStride ) 1283 1284 template<UInt bitDepth> 1285 __inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VIS04_C_HAL( Int* pSrc, Int iStride ) 1268 1286 { 1269 1287 // { -4, 36, 36, -4,}, //1/2 … … 1276 1294 return iSum; 1277 1295 } 1278 __inline Int TRenInterpFilter::xCTI_Filter_VP04_C_OCT2( Pel* pSrc, Int iStride ) 1296 1297 template<UInt bitDepth> 1298 __inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VP04_C_OCT2( Pel* pSrc, Int iStride ) 1279 1299 {// { -4, 27, 46, -5,}, // 5/8 1280 1300 Int iSum, iIdx = 0; … … 1289 1309 return iSum; 1290 1310 } 1291 __inline Int TRenInterpFilter::xCTI_Filter_VI04_C_OCT2( Int* pSrc, Int iStride ) 1311 1312 template<UInt bitDepth> 1313 __inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VI04_C_OCT2( Int* pSrc, Int iStride ) 1292 1314 { // { -4, 27, 46, -5,}, // 5/8 1293 1315 Int iSum, iIdx = 0; … … 1302 1324 return iSum; 1303 1325 } 1304 __inline Int TRenInterpFilter::xCTI_Filter_VP04_C_OCT3( Pel* pSrc, Int iStride ) 1326 1327 template<UInt bitDepth> 1328 __inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VP04_C_OCT3( Pel* pSrc, Int iStride ) 1305 1329 {// { -1, 8, 60, -3,} // 7/8 1306 1330 Int iSum, iIdx = 0; … … 1314 1338 return iSum; 1315 1339 } 1316 __inline Int TRenInterpFilter::xCTI_Filter_VI04_C_OCT3( Int* pSrc, Int iStride ) 1340 1341 template<UInt bitDepth> 1342 __inline Int TRenInterpFilter<bitDepth>::xCTI_Filter_VI04_C_OCT3( Int* pSrc, Int iStride ) 1317 1343 { // { -1, 8, 60, -3,} // 7/8 1318 1344 Int iSum, iIdx = 0; … … 1326 1352 return iSum; 1327 1353 } 1328 #endif // H_3D 1354 1355 #endif // NH_3D 1329 1356 #endif // __TRENINTERP__ -
branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenModSetupStrParser.cpp
r1179 r1200 37 37 #include "TRenModSetupStrParser.h" 38 38 39 #if H_3D39 #if NH_3D 40 40 Int 41 41 TRenModSetupStrParser::getNumOfModels() … … 451 451 rcNextChar = m_pchSetStr[iPos]; 452 452 } 453 #endif // H_3D454 453 #endif // NH_3D 454 -
branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenModSetupStrParser.h
r1179 r1200 39 39 #include "../TLibCommon/TypeDef.h" 40 40 #include "../TAppCommon/TAppComCamPara.h" 41 #if H_3D41 #if NH_3D 42 42 43 43 … … 128 128 }; 129 129 130 #endif // H_3D130 #endif // NH_3D 131 131 #endif //__TRENMODEL__ 132 132 -
branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenModel.cpp
r1179 r1200 36 36 #include "TRenModel.h" 37 37 38 #if H_3D_VSO38 #if NH_3D_VSO 39 39 /////////// TRENMODEL ////////////////////// 40 40 TRenModel::TRenModel() … … 242 242 } 243 243 244 TRenFilter ::setSubPelShiftLUT( m_iShiftPrec, m_aaaiSubPelShiftLut[0], 0 );245 TRenFilter ::setSubPelShiftLUT( m_iShiftPrec, m_aaaiSubPelShiftLut[1], 0 );244 TRenFilter<REN_BIT_DEPTH>::setSubPelShiftLUT( m_iShiftPrec, m_aaaiSubPelShiftLut[0], 0 ); 245 TRenFilter<REN_BIT_DEPTH>::setSubPelShiftLUT( m_iShiftPrec, m_aaaiSubPelShiftLut[1], 0 ); 246 246 247 247 m_iSampledWidth = iWidth << m_iShiftPrec; … … 357 357 AOT( iBaseViewNum != -1 && iBaseViewNum != iLeftViewNum && iBaseViewNum != iRightViewNum ); 358 358 AOT( iContent < -1 || iContent > 1 ); 359 AOT( iBlendMode < -1 || iBlendMode > 2 ); 360 AOT( g_bitDepthY != g_bitDepthC ); 361 362 Bool bBitInc = ( DISTORTION_PRECISION_ADJUSTMENT( g_bitDepthY - 8 ) != 0); 359 AOT( iBlendMode < -1 || iBlendMode > 2 ); 360 361 Bool bBitInc = ( REN_BIT_DEPTH != ENC_INTERNAL_BIT_DEPTH ); 363 362 364 363 AOT( m_apcRenModels[iModelNum] ); … … 437 436 { 438 437 AOT( iViewNum < 0 || iViewNum > m_iNumOfBaseViews ); 439 AOF( pcPicYuvVideoData->getHeight() >= m_iUsedHeight + m_uiHorOff && pcPicYuvVideoData->getWidth() == m_iWidth ); 440 AOF( pcPicYuvDepthData->getHeight() >= m_iUsedHeight + m_uiHorOff && pcPicYuvDepthData->getWidth() == m_iWidth ); 441 438 AOF( pcPicYuvVideoData->getHeight( COMPONENT_Y ) >= m_iUsedHeight + m_uiHorOff && pcPicYuvVideoData->getWidth( COMPONENT_Y ) == m_iWidth ); 439 AOF( pcPicYuvDepthData->getHeight( COMPONENT_Y ) >= m_iUsedHeight + m_uiHorOff && pcPicYuvDepthData->getWidth( COMPONENT_Y ) == m_iWidth ); 440 441 AOF( pcPicYuvVideoData ->getChromaFormat() == CHROMA_420 ); 442 442 443 pcPicYuvVideoData->extendPicBorder(); 443 444 444 TRenFilter ::sampleHorUp ( m_iShiftPrec, pcPicYuvVideoData->getLumaAddr() + m_uiHorOff * pcPicYuvVideoData->getStride () , pcPicYuvVideoData->getStride() , m_iWidth, m_iUsedHeight, m_aapiCurVideoPel[ iViewNum ][0], m_aaiCurVideoStrides[iViewNum][0] );445 TRenFilter ::sampleCUpHorUp( m_iShiftPrec, pcPicYuvVideoData->getCbAddr() + (m_uiHorOff >> 1 ) * pcPicYuvVideoData->getCStride() , pcPicYuvVideoData->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiCurVideoPel[ iViewNum ][1], m_aaiCurVideoStrides[iViewNum][1] );446 TRenFilter ::sampleCUpHorUp( m_iShiftPrec, pcPicYuvVideoData->getCrAddr() + (m_uiHorOff >> 1 ) * pcPicYuvVideoData->getCStride() , pcPicYuvVideoData->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiCurVideoPel[ iViewNum ][2], m_aaiCurVideoStrides[iViewNum][2] );447 TRenFilter ::copy ( pcPicYuvDepthData->getLumaAddr() + m_uiHorOff * pcPicYuvDepthData->getStride () , pcPicYuvDepthData->getStride(), m_iWidth, m_iUsedHeight, m_apiCurDepthPel [ iViewNum], m_aiCurDepthStrides [iViewNum] );445 TRenFilter<REN_BIT_DEPTH>::sampleHorUp ( m_iShiftPrec, pcPicYuvVideoData->getAddr( COMPONENT_Y ) + m_uiHorOff * pcPicYuvVideoData->getStride( COMPONENT_Y ) , pcPicYuvVideoData->getStride( COMPONENT_Y ) , m_iWidth, m_iUsedHeight, m_aapiCurVideoPel[ iViewNum ][0], m_aaiCurVideoStrides[iViewNum][0] ); 446 TRenFilter<REN_BIT_DEPTH>::sampleCUpHorUp( m_iShiftPrec, pcPicYuvVideoData->getAddr( COMPONENT_Cb ) + (m_uiHorOff >> 1 ) * pcPicYuvVideoData->getStride( COMPONENT_Cb) , pcPicYuvVideoData->getStride( COMPONENT_Cb ), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiCurVideoPel[ iViewNum ][1], m_aaiCurVideoStrides[iViewNum][1] ); 447 TRenFilter<REN_BIT_DEPTH>::sampleCUpHorUp( m_iShiftPrec, pcPicYuvVideoData->getAddr( COMPONENT_Cr ) + (m_uiHorOff >> 1 ) * pcPicYuvVideoData->getStride( COMPONENT_Cr) , pcPicYuvVideoData->getStride( COMPONENT_Cr ), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiCurVideoPel[ iViewNum ][2], m_aaiCurVideoStrides[iViewNum][2] ); 448 TRenFilter<REN_BIT_DEPTH>::copy ( pcPicYuvDepthData->getAddr( COMPONENT_Y ) + m_uiHorOff * pcPicYuvDepthData->getStride( COMPONENT_Y ) , pcPicYuvDepthData->getStride( COMPONENT_Y ), m_iWidth, m_iUsedHeight, m_apiCurDepthPel [ iViewNum], m_aiCurDepthStrides [iViewNum] ); 448 449 449 450 // Used for rendering reference pic from original video data … … 453 454 if ( m_abSetupVideoFromOrgForView[iViewNum] ) 454 455 { 455 AOF( pcPicYuvOrgVideoData->getHeight() >= m_iUsedHeight + m_uiHorOff && pcPicYuvOrgVideoData->getWidth() == m_iWidth ); 456 AOF( pcPicYuvOrgVideoData->getChromaFormat() == CHROMA_420 ); 457 AOF( pcPicYuvOrgVideoData->getHeight( COMPONENT_Y ) >= m_iUsedHeight + m_uiHorOff && pcPicYuvOrgVideoData->getWidth( COMPONENT_Y) == m_iWidth ); 456 458 pcPicYuvOrgVideoData->extendPicBorder(); 457 TRenFilter ::sampleHorUp ( m_iShiftPrec, pcPicYuvOrgVideoData->getLumaAddr() + m_uiHorOff * pcPicYuvOrgVideoData->getStride() , pcPicYuvOrgVideoData->getStride() , m_iWidth, m_iUsedHeight, m_aapiOrgVideoPel[ iViewNum ][0], m_aaiOrgVideoStrides[iViewNum][0] );458 TRenFilter ::sampleCUpHorUp( m_iShiftPrec, pcPicYuvOrgVideoData->getCbAddr() + (m_uiHorOff >> 1 ) * pcPicYuvOrgVideoData->getCStride(), pcPicYuvOrgVideoData->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiOrgVideoPel[ iViewNum ][1], m_aaiOrgVideoStrides[iViewNum][1] );459 TRenFilter ::sampleCUpHorUp( m_iShiftPrec, pcPicYuvOrgVideoData->getCrAddr() + (m_uiHorOff >> 1 ) * pcPicYuvOrgVideoData->getCStride(), pcPicYuvOrgVideoData->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiOrgVideoPel[ iViewNum ][2], m_aaiOrgVideoStrides[iViewNum][2] );459 TRenFilter<REN_BIT_DEPTH>::sampleHorUp ( m_iShiftPrec, pcPicYuvOrgVideoData->getAddr( COMPONENT_Y ) + m_uiHorOff * pcPicYuvOrgVideoData->getStride( COMPONENT_Y ), pcPicYuvOrgVideoData->getStride( COMPONENT_Y ) , m_iWidth, m_iUsedHeight, m_aapiOrgVideoPel[ iViewNum ][0], m_aaiOrgVideoStrides[iViewNum][0] ); 460 TRenFilter<REN_BIT_DEPTH>::sampleCUpHorUp( m_iShiftPrec, pcPicYuvOrgVideoData->getAddr( COMPONENT_Cb ) + (m_uiHorOff >> 1 ) * pcPicYuvOrgVideoData->getStride( COMPONENT_Cb ), pcPicYuvOrgVideoData->getStride( COMPONENT_Cb ), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiOrgVideoPel[ iViewNum ][1], m_aaiOrgVideoStrides[iViewNum][1] ); 461 TRenFilter<REN_BIT_DEPTH>::sampleCUpHorUp( m_iShiftPrec, pcPicYuvOrgVideoData->getAddr( COMPONENT_Cr ) + (m_uiHorOff >> 1 ) * pcPicYuvOrgVideoData->getStride( COMPONENT_Cr ), pcPicYuvOrgVideoData->getStride( COMPONENT_Cr ), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiOrgVideoPel[ iViewNum ][2], m_aaiOrgVideoStrides[iViewNum][2] ); 460 462 } 461 463 462 464 if ( m_abSetupDepthFromOrgForView[iViewNum] ) 463 { 464 AOF( pcPicYuvOrgDepthData->getHeight( ) >= m_iUsedHeight + m_uiHorOff && pcPicYuvOrgDepthData->getWidth() == m_iWidth );465 TRenFilter ::copy ( pcPicYuvOrgDepthData->getLumaAddr() + m_uiHorOff * pcPicYuvOrgDepthData->getStride() , pcPicYuvOrgDepthData->getStride(), m_iWidth, m_iUsedHeight, m_apiOrgDepthPel [ iViewNum], m_aiOrgDepthStrides [iViewNum] );465 { 466 AOF( pcPicYuvOrgDepthData->getHeight( COMPONENT_Y ) >= m_iUsedHeight + m_uiHorOff && pcPicYuvOrgDepthData->getWidth( COMPONENT_Y ) == m_iWidth ); 467 TRenFilter<REN_BIT_DEPTH>::copy ( pcPicYuvOrgDepthData->getAddr( COMPONENT_Y ) + m_uiHorOff * pcPicYuvOrgDepthData->getStride( COMPONENT_Y) , pcPicYuvOrgDepthData->getStride( COMPONENT_Y), m_iWidth, m_iUsedHeight, m_apiOrgDepthPel [ iViewNum], m_aiOrgDepthStrides [iViewNum] ); 466 468 } 467 469 } … … 592 594 593 595 Void 594 TRenModel::setData( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData )596 TRenModel::setData( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ) 595 597 { 596 598 iStartPosY -= m_uiHorOff; … … 625 627 { 626 628 Int iTargetStride = m_aiCurDepthStrides[ m_iCurrentView ]; 627 TRenFilter ::copy( piNewData, iStride, iWidth, iHeight, m_apiCurDepthPel[ m_iCurrentView ] + iStartPosY * iTargetStride + iStartPosX, iTargetStride );629 TRenFilter<REN_BIT_DEPTH>::copy( piNewData, iStride, iWidth, iHeight, m_apiCurDepthPel[ m_iCurrentView ] + iStartPosY * iTargetStride + iStartPosX, iTargetStride ); 628 630 } 629 631 #endif … … 646 648 { 647 649 TComPicYuv cPicYuvSynth; 648 cPicYuvSynth.create( m_iWidth, m_iUsedHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth);650 cPicYuvSynth.create( m_iWidth, m_iUsedHeight, CHROMA_420, 1, 1, 1, true); 649 651 650 652 TComPicYuv cPicYuvTempRef; 651 cPicYuvTempRef.create( m_iWidth, m_iUsedHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth);653 cPicYuvTempRef.create( m_iWidth, m_iUsedHeight, CHROMA_420, 1, 1, 1, true); 652 654 653 655 Int64 iSSEY = 0; … … 660 662 m_apcCurRenModels[iCurModel]->getRefVideo ( m_aiCurPosInModels[iCurModel], &cPicYuvTempRef ); 661 663 662 iSSEY += TRenFilter ::SSE( cPicYuvSynth.getLumaAddr(), cPicYuvSynth.getStride(), m_iWidth, m_iUsedHeight , cPicYuvTempRef.getLumaAddr(), cPicYuvTempRef.getStride(), true );663 iSSEU += TRenFilter ::SSE( cPicYuvSynth.getCbAddr() , cPicYuvSynth.getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, cPicYuvTempRef.getCbAddr() , cPicYuvTempRef.getCStride(), false );664 iSSEV += TRenFilter ::SSE( cPicYuvSynth.getCrAddr() , cPicYuvSynth.getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, cPicYuvTempRef.getCrAddr() , cPicYuvTempRef.getCStride(), false );664 iSSEY += TRenFilter<REN_BIT_DEPTH>::SSE( cPicYuvSynth.getAddr( COMPONENT_Y ), cPicYuvSynth.getStride( COMPONENT_Y ), m_iWidth, m_iUsedHeight , cPicYuvTempRef.getAddr( COMPONENT_Y ), cPicYuvTempRef.getStride( COMPONENT_Y ), true ); 665 iSSEU += TRenFilter<REN_BIT_DEPTH>::SSE( cPicYuvSynth.getAddr( COMPONENT_Cb ), cPicYuvSynth.getStride( COMPONENT_Cb ), m_iWidth >> 1, m_iUsedHeight >> 1, cPicYuvTempRef.getAddr( COMPONENT_Cb ), cPicYuvTempRef.getStride( COMPONENT_Cb ), false ); 666 iSSEV += TRenFilter<REN_BIT_DEPTH>::SSE( cPicYuvSynth.getAddr( COMPONENT_Cr ), cPicYuvSynth.getStride( COMPONENT_Cr ), m_iWidth >> 1, m_iUsedHeight >> 1, cPicYuvTempRef.getAddr( COMPONENT_Cr ), cPicYuvTempRef.getStride( COMPONENT_Cr ), false ); 665 667 } 666 668 … … 699 701 } 700 702 } 701 #endif // H_3D703 #endif // NH_3D -
branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenModel.h
r1179 r1200 42 42 #include "../TLibCommon/TypeDef.h" 43 43 44 #if H_3D_VSO44 #if NH_3D_VSO 45 45 46 46 class TRenModel … … 75 75 Int64 getDist ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ); 76 76 #endif 77 Void setData ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData );77 Void setData ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ); 78 78 79 79 // Get Rendered View … … 157 157 }; 158 158 159 #endif // H_3D159 #endif // NH_3D 160 160 #endif //__TRENMODEL__ 161 161 -
branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenSingleModel.cpp
r1179 r1200 36 36 #include "TRenSingleModel.h" 37 37 38 #if H_3D_VSO38 #if NH_3D_VSO 39 39 40 40 ////////////// TRENSINGLE MODEL /////////////// 41 41 template <BlenMod iBM, Bool bBitInc> 42 42 TRenSingleModelC<iBM,bBitInc>::TRenSingleModelC() 43 : m_iDistShift ( ( g_bitDepthY - 8) << 1 )43 : m_iDistShift ( ( ENC_INTERNAL_BIT_DEPTH - REN_BIT_DEPTH) << 1 ) 44 44 { 45 45 m_iWidth = -1; … … 259 259 if ( pcOrgVideo && !bKeepReference ) 260 260 { 261 TRenFilter::copy( pcOrgVideo->getLumaAddr() + m_iHorOffset * pcOrgVideo->getStride() , pcOrgVideo->getStride() , m_iWidth, m_iUsedHeight, m_aapiRefVideoPel[0], m_aiRefVideoStrides[0]); 262 TRenFilter::sampleCUpHorUp(0, pcOrgVideo->getCbAddr() + (m_iHorOffset >> 1) * pcOrgVideo->getCStride(), pcOrgVideo->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiRefVideoPel[1], m_aiRefVideoStrides[1]); 263 TRenFilter::sampleCUpHorUp(0, pcOrgVideo->getCrAddr() + (m_iHorOffset >> 1) * pcOrgVideo->getCStride(), pcOrgVideo->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiRefVideoPel[2], m_aiRefVideoStrides[2]); 261 assert( pcOrgVideo->getChromaFormat() != CHROMA_420 ); 262 263 TRenFilter<REN_BIT_DEPTH>::copy( pcOrgVideo->getAddr( COMPONENT_Y ) + m_iHorOffset * pcOrgVideo->getStride( COMPONENT_Y ), pcOrgVideo->getStride( COMPONENT_Y ), m_iWidth, m_iUsedHeight, m_aapiRefVideoPel[0], m_aiRefVideoStrides[0]); 264 TRenFilter<REN_BIT_DEPTH>::sampleCUpHorUp(0, pcOrgVideo->getAddr( COMPONENT_Cb ) + (m_iHorOffset >> 1) * pcOrgVideo->getStride( COMPONENT_Cb ), pcOrgVideo->getStride( COMPONENT_Cb ), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiRefVideoPel[1], m_aiRefVideoStrides[1]); 265 TRenFilter<REN_BIT_DEPTH>::sampleCUpHorUp(0, pcOrgVideo->getAddr( COMPONENT_Cr ) + (m_iHorOffset >> 1) * pcOrgVideo->getStride( COMPONENT_Cr ), pcOrgVideo->getStride( COMPONENT_Cr ), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiRefVideoPel[2], m_aiRefVideoStrides[2]); 264 266 xSetStructRefView(); 265 267 } … … 285 287 break; 286 288 case 2: 287 TRenFilter ::setupZLUT( true, 30, iDistToLeft, ppiBaseShiftLutLeft, ppiBaseShiftLutRight, m_iBlendZThres, m_iBlendDistWeight, m_piInvZLUTLeft, m_piInvZLUTRight );289 TRenFilter<REN_BIT_DEPTH>::setupZLUT( true, 30, iDistToLeft, ppiBaseShiftLutLeft, ppiBaseShiftLutRight, m_iBlendZThres, m_iBlendDistWeight, m_piInvZLUTLeft, m_piInvZLUTRight ); 288 290 #if H_3D_VSO_EARLY_SKIP 289 291 xRenderL<true>( 0, 0, m_iWidth, m_iUsedHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0],false); … … 452 454 #if H_3D_VSO_COLOR_PLANES 453 455 // U Planes 454 pcOutSampleRow[iPosX].iULeft = 1 << ( g_bitDepthC- 1);455 pcOutSampleRow[iPosX].iURight = 1 << ( g_bitDepthC- 1);456 pcOutSampleRow[iPosX].iUBlended = 1 << ( g_bitDepthC- 1);457 458 // V Planes 459 pcOutSampleRow[iPosX].iVLeft = 1 << ( g_bitDepthC- 1);460 pcOutSampleRow[iPosX].iVRight = 1 << ( g_bitDepthC- 1);461 pcOutSampleRow[iPosX].iVBlended = 1 << ( g_bitDepthC- 1);456 pcOutSampleRow[iPosX].iULeft = 1 << (REN_BIT_DEPTH - 1); 457 pcOutSampleRow[iPosX].iURight = 1 << (REN_BIT_DEPTH - 1); 458 pcOutSampleRow[iPosX].iUBlended = 1 << (REN_BIT_DEPTH - 1); 459 460 // V Planes 461 pcOutSampleRow[iPosX].iVLeft = 1 << (REN_BIT_DEPTH - 1); 462 pcOutSampleRow[iPosX].iVRight = 1 << (REN_BIT_DEPTH - 1); 463 pcOutSampleRow[iPosX].iVBlended = 1 << (REN_BIT_DEPTH - 1); 462 464 #endif 463 465 //// Input Samples … … 475 477 #if H_3D_VSO_EARLY_SKIP 476 478 template <BlenMod iBM, Bool bBitInc> RMDist 477 TRenSingleModelC<iBM,bBitInc>::getDistDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ,Pel * piOrgData, Int iOrgStride )479 TRenSingleModelC<iBM,bBitInc>::getDistDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData , const Pel * piOrgData, Int iOrgStride ) 478 480 #else 479 481 template <BlenMod iBM, Bool bBitInc> RMDist 480 TRenSingleModelC<iBM,bBitInc>::getDistDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData )482 TRenSingleModelC<iBM,bBitInc>::getDistDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ) 481 483 #endif 482 484 { … … 517 519 #if H_3D_VSO_EARLY_SKIP 518 520 template <BlenMod iBM, Bool bBitInc> Void 519 TRenSingleModelC<iBM,bBitInc>::setDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData,Pel* piOrgData, Int iOrgStride )521 TRenSingleModelC<iBM,bBitInc>::setDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel* piOrgData, Int iOrgStride ) 520 522 #else 521 523 template <BlenMod iBM, Bool bBitInc> Void 522 TRenSingleModelC<iBM,bBitInc>::setDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData )524 TRenSingleModelC<iBM,bBitInc>::setDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ) 523 525 #endif 524 526 { … … 558 560 TRenSingleModelC<iBM,bBitInc>::getSynthVideo( Int iViewPos, TComPicYuv* pcPicYuv ) 559 561 { 560 AOT( pcPicYuv->getWidth() != m_iWidth ); 561 AOT( pcPicYuv->getHeight() < m_iUsedHeight + m_iHorOffset ); 562 AOT( pcPicYuv->getWidth( COMPONENT_Y ) != m_iWidth ); 563 AOT( pcPicYuv->getChromaFormat() != CHROMA_420 ); 564 565 AOT( pcPicYuv->getHeight( COMPONENT_Y ) < m_iUsedHeight + m_iHorOffset ); 562 566 563 567 #if H_3D_VSO_COLOR_PLANES … … 590 594 { 591 595 AOT( iViewPos != 0 && iViewPos != 1); 592 AOT( pcPicYuv->getWidth() != m_iWidth ); 593 AOT( pcPicYuv->getHeight() < m_iUsedHeight + m_iHorOffset ); 596 AOT( pcPicYuv->getWidth( COMPONENT_Y) != m_iWidth ); 597 AOT( pcPicYuv->getChromaFormat( ) != CHROMA_420 ); 598 AOT( pcPicYuv->getHeight( COMPONENT_Y ) < m_iUsedHeight + m_iHorOffset ); 594 599 595 600 Pel RenModelOutPels::* piD = 0; 596 601 xGetSampleStrDepthPtrs(iViewPos, piD); 597 xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, piD, pcPicYuv->get LumaAddr() + pcPicYuv->getStride() * m_iHorOffset, pcPicYuv->getStride(), m_iWidth, m_iUsedHeight );598 pcPicYuv->setChromaTo( 1 << ( g_bitDepthC- 1) );602 xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, piD, pcPicYuv->getAddr( COMPONENT_Y ) + pcPicYuv->getStride( COMPONENT_Y ) * m_iHorOffset, pcPicYuv->getStride( COMPONENT_Y ), m_iWidth, m_iUsedHeight ); 603 pcPicYuv->setChromaTo( 1 << (REN_BIT_DEPTH - 1) ); 599 604 } 600 605 … … 603 608 TRenSingleModelC<iBM,bBitInc>::getRefVideo ( Int iViewPos, TComPicYuv* pcPicYuv ) 604 609 { 605 AOT( pcPicYuv->getWidth() != m_iWidth ); 606 AOT( pcPicYuv->getHeight() < m_iUsedHeight + m_iHorOffset); 610 AOT( pcPicYuv->getChromaFormat( ) != CHROMA_420 ); 611 AOT( pcPicYuv->getWidth( COMPONENT_Y ) != m_iWidth ); 612 AOT( pcPicYuv->getHeight( COMPONENT_Y ) < m_iUsedHeight + m_iHorOffset); 607 613 608 614 #if H_3D_VSO_COLOR_PLANES … … 633 639 634 640 template <BlenMod iBM, Bool bBitInc> RMDist 635 TRenSingleModelC<iBM,bBitInc>::getDistVideo( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData )641 TRenSingleModelC<iBM,bBitInc>::getDistVideo( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ) 636 642 { 637 643 AOF(false); … … 640 646 641 647 template <BlenMod iBM, Bool bBitInc> Void 642 TRenSingleModelC<iBM,bBitInc>::setVideo( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData )648 TRenSingleModelC<iBM,bBitInc>::setVideo( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ) 643 649 { 644 650 AOF(false); … … 665 671 #if H_3D_VSO_EARLY_SKIP 666 672 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline RMDist 667 TRenSingleModelC<iBM,bBitInc>::xRenderL( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Bool bFast)673 TRenSingleModelC<iBM,bBitInc>::xRenderL( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, Bool bFast) 668 674 #else 669 675 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline RMDist 670 TRenSingleModelC<iBM,bBitInc>::xRenderL( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData)676 TRenSingleModelC<iBM,bBitInc>::xRenderL( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData) 671 677 #endif 672 678 { … … 789 795 #ifdef H_3D_VSO_EARLY_SKIP 790 796 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline RMDist 791 TRenSingleModelC<iBM,bBitInc>::xRenderR( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData , Bool bFast)797 TRenSingleModelC<iBM,bBitInc>::xRenderR( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData , Bool bFast) 792 798 #else 793 799 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline RMDist 794 TRenSingleModelC<iBM,bBitInc>::xRenderR( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData )800 TRenSingleModelC<iBM,bBitInc>::xRenderR( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ) 795 801 #endif 796 802 { … … 1877 1883 TRenSingleModelC<iBM,bBitInc>::xCopy2PicYuv( Pel** ppiSrcVideoPel, Int* piStrides, TComPicYuv* rpcPicYuvTarget ) 1878 1884 { 1879 TRenFilter ::copy ( ppiSrcVideoPel[0], piStrides[0], m_iWidth, m_iUsedHeight, rpcPicYuvTarget->getLumaAddr() + m_iHorOffset * rpcPicYuvTarget->getStride() , rpcPicYuvTarget->getStride () );1880 TRenFilter ::sampleDown2Tap13( ppiSrcVideoPel[1], piStrides[1], m_iWidth, m_iUsedHeight, rpcPicYuvTarget->getCbAddr () + (m_iHorOffset >> 1) * rpcPicYuvTarget->getCStride(), rpcPicYuvTarget->getCStride() );1881 TRenFilter ::sampleDown2Tap13( ppiSrcVideoPel[2], piStrides[2], m_iWidth, m_iUsedHeight, rpcPicYuvTarget->getCrAddr () + (m_iHorOffset >> 1) * rpcPicYuvTarget->getCStride(), rpcPicYuvTarget->getCStride() );1885 TRenFilter<REN_BIT_DEPTH>::copy ( ppiSrcVideoPel[0], piStrides[0], m_iWidth, m_iUsedHeight, rpcPicYuvTarget->getAddr( COMPONENT_Y ) + m_iHorOffset * rpcPicYuvTarget->getStride( COMPONENT_Y ), rpcPicYuvTarget->getStride( COMPONENT_Y ) ); 1886 TRenFilter<REN_BIT_DEPTH>::sampleDown2Tap13( ppiSrcVideoPel[1], piStrides[1], m_iWidth, m_iUsedHeight, rpcPicYuvTarget->getAddr( COMPONENT_Cb ) + (m_iHorOffset >> 1) * rpcPicYuvTarget->getStride( COMPONENT_Cb ), rpcPicYuvTarget->getStride( COMPONENT_Cb) ); 1887 TRenFilter<REN_BIT_DEPTH>::sampleDown2Tap13( ppiSrcVideoPel[2], piStrides[2], m_iWidth, m_iUsedHeight, rpcPicYuvTarget->getAddr( COMPONENT_Cr ) + (m_iHorOffset >> 1) * rpcPicYuvTarget->getStride( COMPONENT_Cr ), rpcPicYuvTarget->getStride( COMPONENT_Cr) ); 1882 1888 } 1883 1889 … … 1895 1901 template <BlenMod iBM, Bool bBitInc> 1896 1902 __inline Bool 1897 TRenSingleModelC<iBM,bBitInc>::xDetectEarlySkipL( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData,Pel* piOrgData, Int iOrgStride)1903 TRenSingleModelC<iBM,bBitInc>::xDetectEarlySkipL( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel* piOrgData, Int iOrgStride) 1898 1904 { 1899 1905 RM_AOF( m_bEarlySkip ); … … 1927 1933 template <BlenMod iBM, Bool bBitInc> 1928 1934 __inline Bool 1929 TRenSingleModelC<iBM,bBitInc>::xDetectEarlySkipR( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData,Pel* piOrgData, Int iOrgStride)1935 TRenSingleModelC<iBM,bBitInc>::xDetectEarlySkipR( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel* piOrgData, Int iOrgStride) 1930 1936 { 1931 1937 RM_AOF( m_bEarlySkip ); … … 1958 1964 } 1959 1965 #endif 1960 #endif // H_3D1961 1966 #endif // NH_3D 1967 -
branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenSingleModel.h
r1179 r1200 51 51 #include <cstring> 52 52 53 #if H_3D_VSO53 #if NH_3D_VSO 54 54 using namespace std; 55 55 … … 82 82 // Set Data 83 83 #if H_3D_VSO_EARLY_SKIP 84 virtual Void setDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData,Pel* piOrgData, Int iOrgStride ) = 0;85 #else 86 virtual Void setDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) = 0;87 #endif 88 virtual Void setVideo ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) = 0;84 virtual Void setDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel* piOrgData, Int iOrgStride ) = 0; 85 #else 86 virtual Void setDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ) = 0; 87 #endif 88 virtual Void setVideo ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ) = 0; 89 89 90 90 // Get Distortion 91 91 #if H_3D_VSO_EARLY_SKIP 92 virtual RMDist getDistDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData,Pel * piOrgData , Int iOrgStride)=0;93 #else 94 virtual RMDist getDistDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) = 0;95 #endif 96 virtual RMDist getDistVideo ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) = 0;92 virtual RMDist getDistDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel * piOrgData , Int iOrgStride)=0; 93 #else 94 virtual RMDist getDistDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ) = 0; 95 #endif 96 virtual RMDist getDistVideo ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ) = 0; 97 97 98 98 virtual Void getSynthVideo ( Int iViewPos, TComPicYuv* pcPicYuv ) = 0; … … 172 172 173 173 #if H_3D_VSO_EARLY_SKIP 174 Void setDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData,Pel* piOrgData, Int iOrgStride );175 #else 176 Void setDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData );177 #endif 178 Void setVideo ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData );179 180 // Get Distortion 181 #if H_3D_VSO_EARLY_SKIP 182 RMDist getDistDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData,Pel * piOrgData , Int iOrgStride);183 #else 184 RMDist getDistDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData );185 #endif 186 RMDist getDistVideo ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData );174 Void setDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel* piOrgData, Int iOrgStride ); 175 #else 176 Void setDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ); 177 #endif 178 Void setVideo ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ); 179 180 // Get Distortion 181 #if H_3D_VSO_EARLY_SKIP 182 RMDist getDistDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel * piOrgData , Int iOrgStride); 183 #else 184 RMDist getDistDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ); 185 #endif 186 RMDist getDistVideo ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ); 187 187 188 188 Void getSynthVideo ( Int iViewPos, TComPicYuv* pcPicYuv ); … … 198 198 // Left to Right 199 199 #if H_3D_VSO_EARLY_SKIP 200 __inline Bool xDetectEarlySkipL ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData,Pel* piOrgData, Int iOrgStride );201 __inline Bool xDetectEarlySkipR ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData,Pel* piOrgData, Int iOrgStride );202 template<Bool bSet> __inline RMDist xRenderL ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Bool bFast );203 template<Bool bSet> __inline RMDist xRenderR ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Bool bFast );204 #else 205 template<Bool bSet> __inline RMDist xRenderR ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData );206 template<Bool bSet> __inline RMDist xRenderL ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData );200 __inline Bool xDetectEarlySkipL ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel* piOrgData, Int iOrgStride ); 201 __inline Bool xDetectEarlySkipR ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel* piOrgData, Int iOrgStride ); 202 template<Bool bSet> __inline RMDist xRenderL ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, Bool bFast ); 203 template<Bool bSet> __inline RMDist xRenderR ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, Bool bFast ); 204 #else 205 template<Bool bSet> __inline RMDist xRenderR ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ); 206 template<Bool bSet> __inline RMDist xRenderL ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ); 207 207 #endif 208 208 __inline Void xInitRenderPartL ( Int iEndChangePos, Int iLastSPos ); … … 353 353 Int m_iCurViewPos; // Current View Position 0: Left, 1: Right 354 354 Int m_iOtherViewPos; // Other View Position 0: Left, 1: Right 355 Pel* m_piNewDepthData; // Pointer to new depth data355 const Pel* m_piNewDepthData; // Pointer to new depth data 356 356 Int m_iStartChangePosX; // Start Position of new data 357 357 Int m_iNewDataWidth; // Width of new data … … 389 389 }; 390 390 391 #endif // H_3D391 #endif // NH_3D 392 392 #endif //__TRENSINGLEMODEL__ 393 393 -
branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenTop.cpp
r1179 r1200 40 40 #include <math.h> 41 41 #include "../TLibCommon/CommonDef.h" 42 #if H_3D42 #if NH_3D 43 43 44 44 … … 114 114 if (uiPlane == 0) 115 115 { 116 TRenFilter ::sampleHorUp ( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());116 TRenFilter<REN_BIT_DEPTH>::sampleHorUp ( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride()); 117 117 } 118 118 else … … 120 120 if ( m_bUVUp ) 121 121 { 122 TRenFilter ::sampleCUpHorUp( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());122 TRenFilter<REN_BIT_DEPTH>::sampleCUpHorUp( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride()); 123 123 } 124 124 else 125 125 { 126 TRenFilter ::sampleCHorUp ( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());126 TRenFilter<REN_BIT_DEPTH>::sampleCHorUp ( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride()); 127 127 } 128 128 } … … 147 147 AOT( iLog2SamplingFactor > 2); 148 148 149 TRenFilter ::sampleHorUp(iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());149 TRenFilter<REN_BIT_DEPTH>::sampleHorUp(iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride()); 150 150 151 151 if ( !m_bUVUp ) //GT: depth down … … 154 154 PelImagePlane* pcTempPlane = new PelImagePlane(pcOrgInputImage->getPlane(0)->getWidth(), ( pcOrgInputImage->getPlane(0)->getHeight() >> 1), REN_LUMA_MARGIN ); 155 155 156 TRenFilter ::sampleVerDown2Tap13(pcOrgInputImage->getPlane(0), pcTempPlane, PICYUV_PAD);156 TRenFilter<REN_BIT_DEPTH>::sampleVerDown2Tap13(pcOrgInputImage->getPlane(0), pcTempPlane, PICYUV_PAD); 157 157 pcConvPlane = pcConvInputImage->getPlane(1); 158 158 159 159 if ( iLog2SamplingFactor == 0 ) 160 160 { 161 TRenFilter ::sampleHorDown2Tap13(pcTempPlane, pcConvPlane, 0 );161 TRenFilter<REN_BIT_DEPTH>::sampleHorDown2Tap13(pcTempPlane, pcConvPlane, 0 ); 162 162 } 163 163 else 164 164 { 165 TRenFilter ::sampleHorUp ( iLog2SamplingFactor - 1, pcTempPlane->getPlaneData(), pcTempPlane->getStride(), pcTempPlane->getWidth(), pcTempPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());165 TRenFilter<REN_BIT_DEPTH>::sampleHorUp ( iLog2SamplingFactor - 1, pcTempPlane->getPlaneData(), pcTempPlane->getStride(), pcTempPlane->getWidth(), pcTempPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride()); 166 166 } 167 167 delete pcTempPlane; … … 175 175 { 176 176 m_pcTempImage->assign( pcOrgInputImage ); 177 TRenFilter ::mirrorHor( m_pcTempImage );177 TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcTempImage ); 178 178 m_pcTempImage->extendMargin(); 179 179 xConvertInputVideo( m_pcTempImage, pcConvInputImage ); 180 180 181 181 m_pcTempImage->getPlane(0)->assign( pcOrgInputDepth->getPlane(0) ); 182 TRenFilter ::mirrorHor( m_pcTempImage->getPlane(0) );182 TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcTempImage->getPlane(0) ); 183 183 m_pcTempImage->getPlane(0)->extendMargin(); 184 184 xConvertInputDepth( m_pcTempImage, pcConvInputDepth ); … … 209 209 if ( uiPlane == 0 ) 210 210 { 211 TRenFilter ::sampleHorDown( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());211 TRenFilter<REN_BIT_DEPTH>::sampleHorDown( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride()); 212 212 } 213 213 else … … 215 215 if ( m_bUVUp ) 216 216 { 217 TRenFilter ::sampleCDownHorDown( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());217 TRenFilter<REN_BIT_DEPTH>::sampleCDownHorDown( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride()); 218 218 } 219 219 else 220 220 { 221 TRenFilter ::sampleCHorDown ( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());221 TRenFilter<REN_BIT_DEPTH>::sampleCHorDown ( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride()); 222 222 } 223 223 } … … 226 226 if ( bMirror ) 227 227 { 228 TRenFilter ::mirrorHor( pcConvOutputImage );228 TRenFilter<REN_BIT_DEPTH>::mirrorHor( pcConvOutputImage ); 229 229 } 230 230 … … 253 253 if ( !m_bExtrapolate ) 254 254 { 255 TRenFilter ::setupZLUT( m_bBlendUseDistWeight, m_iBlendZThresPerc, iRelDistToLeft, ppiBaseShiftLUTLeft, ppiBaseShiftLUTRight, m_iBlendZThres, m_iBlendDistWeight, m_piInvZLUTLeft, m_piInvZLUTRight);255 TRenFilter<REN_BIT_DEPTH>::setupZLUT( m_bBlendUseDistWeight, m_iBlendZThresPerc, iRelDistToLeft, ppiBaseShiftLUTLeft, ppiBaseShiftLUTRight, m_iBlendZThres, m_iBlendDistWeight, m_piInvZLUTLeft, m_piInvZLUTRight); 256 256 } 257 257 } … … 261 261 AOF( m_bExtrapolate ); 262 262 AOF( bRenderFromLeft ? m_ppiShiftLUTLeft || m_ppdShiftLUTLeft : m_ppiShiftLUTRight || m_ppdShiftLUTRight ); 263 AOF( m_auiInputResolution[0] == pcPicYuvVideo->getWidth ( ));264 AOF( m_auiInputResolution[1] == pcPicYuvVideo->getHeight( ));263 AOF( m_auiInputResolution[0] == pcPicYuvVideo->getWidth ( COMPONENT_Y )); 264 AOF( m_auiInputResolution[1] == pcPicYuvVideo->getHeight( COMPONENT_Y )); 265 265 266 266 PelImage cInputImage ( pcPicYuvVideo ); … … 284 284 { 285 285 AOF( bRenderFromLeft ? m_ppiShiftLUTLeft && m_ppdShiftLUTLeft : m_ppiShiftLUTRight && m_ppdShiftLUTRight ); 286 AOF(m_auiInputResolution[0] == pcPicYuvDepth->getWidth ( ));287 AOF(m_auiInputResolution[1] == pcPicYuvDepth->getHeight( ));286 AOF(m_auiInputResolution[0] == pcPicYuvDepth->getWidth (COMPONENT_Y)); 287 AOF(m_auiInputResolution[1] == pcPicYuvDepth->getHeight(COMPONENT_Y)); 288 288 289 289 PelImage cInputDepth ( pcPicYuvDepth , true); … … 300 300 if ( !bRenderFromLeft ) 301 301 { 302 TRenFilter ::mirrorHor( m_pcFilled );303 } 304 305 TRenFilter ::filledToUsedPelMap( m_pcFilled, &cOutputImage, m_iUsedPelMapMarExt );302 TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcFilled ); 303 } 304 305 TRenFilter<REN_BIT_DEPTH>::filledToUsedPelMap( m_pcFilled, &cOutputImage, m_iUsedPelMapMarExt ); 306 306 }; 307 307 … … 310 310 { 311 311 assert( !m_bExtrapolate ); 312 assert( m_auiInputResolution[0] == pcPicYuvVideoLeft ->getWidth ( ) );313 assert( m_auiInputResolution[1] == pcPicYuvVideoRight->getHeight( ) );312 assert( m_auiInputResolution[0] == pcPicYuvVideoLeft ->getWidth ( COMPONENT_Y ) ); 313 assert( m_auiInputResolution[1] == pcPicYuvVideoRight->getHeight( COMPONENT_Y ) ); 314 314 315 315 AOT( iBlendMode == 3); … … 363 363 xCreateAlphaMap( m_pcRightFilled, m_pcRightFilled, false ); 364 364 365 TRenFilter ::mirrorHor( m_pcRightOutputImage );366 TRenFilter ::mirrorHor( m_pcRightOutputDepth );367 TRenFilter ::mirrorHor( m_pcRightFilled );365 TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcRightOutputImage ); 366 TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcRightOutputDepth ); 367 TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcRightFilled ); 368 368 369 369 xEnhSimilarity( m_pcLeftOutputImage, m_pcRightOutputImage, m_pcLeftFilled, m_pcRightFilled ); … … 377 377 xCreateAlphaMap ( m_pcLeftFilled, m_pcLeftFilled, true ); 378 378 379 TRenFilter ::mirrorHor( m_pcRightInputImage );379 TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcRightInputImage ); 380 380 xBackShiftPixels ( m_pcRightInputImage, m_pcOutputDepth, m_pcRightOutputImage, m_pcRightFilled , true ); 381 381 xFillHoles ( m_pcRightOutputImage, m_pcRightFilled, m_pcRightOutputImage, true); 382 382 383 TRenFilter ::mirrorHor( m_pcRightFilled );383 TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcRightFilled ); 384 384 xCreateAlphaMap ( m_pcRightFilled, m_pcRightFilled, true ); 385 TRenFilter ::mirrorHor( m_pcRightFilled );385 TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcRightFilled ); 386 386 } 387 387 … … 415 415 { 416 416 case eRenPreProBinom: 417 TRenFilter ::binominal(pcOutImage, pcTemp, m_iPreFilterSize);417 TRenFilter<REN_BIT_DEPTH>::binominal(pcOutImage, pcTemp, m_iPreFilterSize); 418 418 break; 419 419 case eRenPreProNone: … … 607 607 { 608 608 apcDiffPlane[uiCurPlane] = new IntImagePlane( iWidth, iHeight, apcInputPlanes[uiCurPlane]->getPad()); 609 TRenFilter ::diffHorSym(apcInputPlanes[uiCurPlane] , apcDiffPlane[uiCurPlane]);609 TRenFilter<REN_BIT_DEPTH>::diffHorSym(apcInputPlanes[uiCurPlane] , apcDiffPlane[uiCurPlane]); 610 610 ppiDiffPlanes[uiCurPlane] = apcDiffPlane[uiCurPlane]->getPlaneData(); 611 611 } … … 659 659 for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++) 660 660 { 661 cVal = TRenFilter ::interpCHSpline(iInterPolPos, dShiftedPos, dPrevShiftedPos, apcInputData[uiCurPlane][iPosX - 1], ppiDiffPlanes[uiCurPlane][iPosX - 1], apcInputData[uiCurPlane][iPosX], ppiDiffPlanes[uiCurPlane][iPosX] );661 cVal = TRenFilter<REN_BIT_DEPTH>::interpCHSpline(iInterPolPos, dShiftedPos, dPrevShiftedPos, apcInputData[uiCurPlane][iPosX - 1], ppiDiffPlanes[uiCurPlane][iPosX - 1], apcInputData[uiCurPlane][iPosX], ppiDiffPlanes[uiCurPlane][iPosX] ); 662 662 apcOutputData[uiCurPlane][iInterPolPos] = cVal; 663 663 } … … 1516 1516 { 1517 1517 case eRenPostProMed: 1518 TRenFilter ::lineMedian3(pcTemp);1518 TRenFilter<REN_BIT_DEPTH>::lineMedian3(pcTemp); 1519 1519 break; 1520 1520 case eRenPostProNone: … … 1599 1599 1600 1600 Void TRenTop::xEnhSimilarityPlane ( PelImagePlane** apcLeftPlane, PelImagePlane** apcRightPlane, PelImagePlane* pcFilledLeftPlane, PelImagePlane* pcFilledRightPlane, UInt uiNumberOfPlanes ) 1601 { 1602 AOF( g_bitDepthC == g_bitDepthY ); 1601 { 1603 1602 AOT( m_iSimEnhBaseView != 1 && m_iSimEnhBaseView != 2 ); 1604 1603 Int iWidth = (*apcRightPlane)->getWidth (); 1605 1604 Int iHeight = (*apcRightPlane)->getHeight(); 1606 1605 1607 Int* aiHistLeft = new Int[ ((Int64)1 ) << g_bitDepthY];1608 Int* aiHistRight = new Int[ ((Int64)1 ) << g_bitDepthY];1609 Pel* aiConvLUT = new Pel[ ((Int64)1 ) << g_bitDepthY];1606 Int* aiHistLeft = new Int[ ((Int64)1 ) << REN_BIT_DEPTH ]; 1607 Int* aiHistRight = new Int[ ((Int64)1 ) << REN_BIT_DEPTH ]; 1608 Pel* aiConvLUT = new Pel[ ((Int64)1 ) << REN_BIT_DEPTH ]; 1610 1609 1611 1610 for (UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++ ) 1612 1611 { 1613 for (Int iCurVal = 0 ; iCurVal < ( 1 << g_bitDepthY); iCurVal++)1612 for (Int iCurVal = 0 ; iCurVal < ( 1 << REN_BIT_DEPTH ); iCurVal++) 1614 1613 { 1615 1614 aiHistLeft [iCurVal] = 0; … … 1658 1657 Int iCheckSumRight = 0; 1659 1658 1660 for (Int iCurVal = 0 ; iCurVal < ( 1 << g_bitDepthY); iCurVal++)1659 for (Int iCurVal = 0 ; iCurVal < ( 1 << REN_BIT_DEPTH ); iCurVal++) 1661 1660 { 1662 1661 iCheckSumLeft += aiHistLeft [iCurVal]; … … 1665 1664 1666 1665 1667 while( iCurChangeVal < ( 1 << g_bitDepthY) )1666 while( iCurChangeVal < ( 1 << REN_BIT_DEPTH ) ) 1668 1667 { 1669 1668 if ( iCumSumBase == iCumSumChange ) 1670 1669 { 1671 aiConvLUT[iCurChangeVal] = std::min( iCurBaseVal, ( 1 << g_bitDepthY) - 1 );1670 aiConvLUT[iCurChangeVal] = std::min( iCurBaseVal, ( 1 << REN_BIT_DEPTH ) - 1 ); 1672 1671 iCurBaseVal ++; 1673 1672 iCurChangeVal++; 1674 1673 iCumSumChange += aiHistChange[iCurChangeVal]; 1675 if (iCurBaseVal < ( 1 << g_bitDepthY) )1674 if (iCurBaseVal < ( 1 << REN_BIT_DEPTH ) ) 1676 1675 { 1677 1676 iCumSumBase += aiHistBase [iCurBaseVal] ; … … 1681 1680 { 1682 1681 iCurBaseVal++; 1683 if (iCurBaseVal < ( 1 << g_bitDepthY) )1682 if (iCurBaseVal < ( 1 << REN_BIT_DEPTH ) ) 1684 1683 { 1685 1684 iCumSumBase += aiHistBase [iCurBaseVal] ; … … 1688 1687 else if ( iCumSumBase > iCumSumChange) 1689 1688 { 1690 aiConvLUT[iCurChangeVal] = std::min(iCurBaseVal, ( 1 << g_bitDepthY)-1);1689 aiConvLUT[iCurChangeVal] = std::min(iCurBaseVal, ( 1 << REN_BIT_DEPTH )-1); 1691 1690 iCurChangeVal++; 1692 1691 iCumSumChange += aiHistChange [iCurChangeVal] ; … … 1897 1896 Void TRenTop::temporalFilterVSRS( TComPicYuv* pcPicYuvVideoCur, TComPicYuv* pcPicYuvDepthCur, TComPicYuv* pcPicYuvVideoLast, TComPicYuv* pcPicYuvDepthLast, Bool bFirstFrame ) 1898 1897 { 1899 AOF( g_bitDepthY == g_bitDepthC );1900 1898 Int iSADThres = 100 ; //threshold of sad in 4*4 block motion detection 1901 1899 … … 1906 1904 Int* piFlagMoving = m_aiBlkMoving + 2; 1907 1905 1908 Int iVideoCurStride = pcPicYuvVideoCur ->getStride( );1909 Int iVideoLastStride = pcPicYuvVideoLast->getStride( );1910 Int iDepthCurStride = pcPicYuvDepthCur ->getStride( );1911 Int iDepthLastStride = pcPicYuvDepthLast->getStride( );1912 1913 Pel* pcVideoCurData = pcPicYuvVideoCur ->get LumaAddr();1914 Pel* pcVideoLastData = pcPicYuvVideoLast->get LumaAddr();1915 Pel* pcDepthCurData = pcPicYuvDepthCur ->get LumaAddr();1916 Pel* pcDepthLastData = pcPicYuvDepthLast->get LumaAddr();1906 Int iVideoCurStride = pcPicYuvVideoCur ->getStride( COMPONENT_Y ); 1907 Int iVideoLastStride = pcPicYuvVideoLast->getStride( COMPONENT_Y ); 1908 Int iDepthCurStride = pcPicYuvDepthCur ->getStride( COMPONENT_Y ); 1909 Int iDepthLastStride = pcPicYuvDepthLast->getStride( COMPONENT_Y ); 1910 1911 Pel* pcVideoCurData = pcPicYuvVideoCur ->getAddr( COMPONENT_Y ); 1912 Pel* pcVideoLastData = pcPicYuvVideoLast->getAddr( COMPONENT_Y ); 1913 Pel* pcDepthCurData = pcPicYuvDepthCur ->getAddr( COMPONENT_Y ); 1914 Pel* pcDepthLastData = pcPicYuvDepthLast->getAddr( COMPONENT_Y ); 1917 1915 1918 1916 Pel* pcVideoCurDataFrm = pcVideoCurData ; … … 1964 1962 { //Weight: 0.75 1965 1963 Int iFilt = (( (pcDepthLastDataBlk[iCurPosX] << 1 ) + pcDepthLastDataBlk[iCurPosX] + pcDepthCurDataBlk[iCurPosX] + 2 ) >> 2 ); 1966 assert( (iFilt >= 0) && (iFilt < ( 1 << g_bitDepthY) ) );1964 assert( (iFilt >= 0) && (iFilt < ( 1 << REN_BIT_DEPTH ) ) ); 1967 1965 pcDepthCurDataBlk[iCurPosX] = pcDepthLastDataBlk[iCurPosX]; 1968 1966 pcDepthCurDataBlk[iCurPosX] = iFilt; … … 2169 2167 } 2170 2168 2171 TRenFilter ::setSubPelShiftLUT(m_iRelShiftLUTPrec, m_aaiSubPelShift, -1);2169 TRenFilter<REN_BIT_DEPTH>::setSubPelShiftLUT(m_iRelShiftLUTPrec, m_aaiSubPelShift, -1); 2172 2170 } 2173 2171 … … 2235 2233 if(m_aiBlkMoving != NULL ) delete[] m_aiBlkMoving; 2236 2234 } 2237 #endif // H_3D2238 2235 #endif // NH_3D 2236 -
branches/HTM-14.1-update-dev0/source/Lib/TLibRenderer/TRenTop.h
r1179 r1200 39 39 #include "../TLibCommon/TComPicYuv.h" 40 40 41 #if H_3D41 #if NH_3D 42 42 #include <list> 43 43 #include <vector> … … 270 270 }; 271 271 272 #endif // H_3D272 #endif // NH_3D 273 273 #endif //__TRENTOP__
Note: See TracChangeset for help on using the changeset viewer.