Changeset 28 in 3DVCSoftware
- Timestamp:
- 24 Feb 2012, 20:22:58 (13 years ago)
- Location:
- branches/0.3-poznan-univ
- Files:
-
- 2 added
- 69 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/0.3-poznan-univ/CommonTestConditionsCfgs/baseCfg_2view+depth.cfg
r18 r28 97 97 ALF : 1 # use adaptive loop filter 98 98 ALFEncodePassReduction : 0 # ALF encoding (0:original 16-pass, 1:one-pass, 2:two-pass) 99 99 DBMP : 1 # use depth base motion prediction 100 CUSkip : 1 # encode only disoccluded CUs in dependend views 101 TDdQP : 1 # texture TU blocks QP param modification according to depth map's values 100 102 101 103 #========== multiview coding tools ========== … … 113 115 VSO : 1 # use of view synthesis optimization for depth coding 114 116 MVI : 1 # motion parameter inheritance 115 117 DepthPower : -1 # nonlinear depth representation 116 118 117 119 #========== view synthesis optimization (VSO) ========== -
branches/0.3-poznan-univ/CommonTestConditionsCfgs/baseCfg_3view+depth.cfg
r18 r28 101 101 ALF : 1 # use adaptive loop filter 102 102 ALFEncodePassReduction : 0 # ALF encoding (0:original 16-pass, 1:one-pass, 2:two-pass) 103 103 DBMP : 1 # use depth base motion prediction 104 CUSkip : 1 # encode only disoccluded CUs in dependend views 105 TDdQP : 1 # texture TU blocks QP param modification according to depth map's values 104 106 105 107 #========== multiview coding tools ========== … … 117 119 VSO : 1 # use of view synthesis optimization for depth coding 118 120 MVI : 1 # motion parameter inheritance 119 121 DepthPower : -1 # nonlinear depth representation 120 122 121 123 #========== view synthesis optimization (VSO) ========== … … 123 125 # VSO configuration string 124 126 127 128 -
branches/0.3-poznan-univ/build/HM_vc10.sln
r2 r28 3 3 # Visual Studio 2010 4 4 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TAppDecoder", "vc10\TAppDecoder_vc10.vcxproj", "{A7A515D9-E917-4706-BD5B-57DC6C78D612}" 5 ProjectSection(ProjectDependencies) = postProject 6 {2B298BE6-DFF0-4BD2-8F26-395FFE7F9EB4} = {2B298BE6-DFF0-4BD2-8F26-395FFE7F9EB4} 7 EndProjectSection 5 8 EndProject 6 9 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TAppEncoder", "vc10\TAppEncoder_vc10.vcxproj", "{D759E4E1-D33A-4483-B57B-0FD248E022FE}" -
branches/0.3-poznan-univ/build/HM_vc8.sln
r2 r28 5 5 ProjectSection(ProjectDependencies) = postProject 6 6 {8783AD3A-A5CA-42B7-AAC4-A07EB845A684} = {8783AD3A-A5CA-42B7-AAC4-A07EB845A684} 7 {5E87AD84-AC4F-4336-B4EE-549CA210EE4A} = {5E87AD84-AC4F-4336-B4EE-549CA210EE4A} 8 {78018D78-F890-47E3-A0B7-09D273F0B11D} = {78018D78-F890-47E3-A0B7-09D273F0B11D} 9 {F8B77A48-AF6C-4746-A89F-B706ABA6AD94} = {F8B77A48-AF6C-4746-A89F-B706ABA6AD94} 7 10 {5280C25A-D316-4BE7-AE50-29D72108624F} = {5280C25A-D316-4BE7-AE50-29D72108624F} 8 {F8B77A48-AF6C-4746-A89F-B706ABA6AD94} = {F8B77A48-AF6C-4746-A89F-B706ABA6AD94}9 {78018D78-F890-47E3-A0B7-09D273F0B11D} = {78018D78-F890-47E3-A0B7-09D273F0B11D}10 11 EndProjectSection 11 12 EndProject 12 13 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TAppEncoder", "vc8\TAppEncoder_vc8.vcproj", "{D759E4E1-D33A-4483-B57B-0FD248E022FE}" 13 14 ProjectSection(ProjectDependencies) = postProject 15 {8783AD3A-A5CA-42B7-AAC4-A07EB845A684} = {8783AD3A-A5CA-42B7-AAC4-A07EB845A684} 16 {78018D78-F890-47E3-A0B7-09D273F0B11D} = {78018D78-F890-47E3-A0B7-09D273F0B11D} 17 {47E90995-1FC5-4EE4-A94D-AD474169F0E1} = {47E90995-1FC5-4EE4-A94D-AD474169F0E1} 18 {5280C25A-D316-4BE7-AE50-29D72108624F} = {5280C25A-D316-4BE7-AE50-29D72108624F} 14 19 {5E87AD84-AC4F-4336-B4EE-549CA210EE4A} = {5E87AD84-AC4F-4336-B4EE-549CA210EE4A} 15 {5280C25A-D316-4BE7-AE50-29D72108624F} = {5280C25A-D316-4BE7-AE50-29D72108624F}16 {47E90995-1FC5-4EE4-A94D-AD474169F0E1} = {47E90995-1FC5-4EE4-A94D-AD474169F0E1}17 {78018D78-F890-47E3-A0B7-09D273F0B11D} = {78018D78-F890-47E3-A0B7-09D273F0B11D}18 {8783AD3A-A5CA-42B7-AAC4-A07EB845A684} = {8783AD3A-A5CA-42B7-AAC4-A07EB845A684}19 20 EndProjectSection 20 21 EndProject … … 31 32 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TAppRenderer", "vc8\TAppRenderer_vc8.vcproj", "{CE149235-A923-4BA7-B552-3A02287CD3E4}" 32 33 ProjectSection(ProjectDependencies) = postProject 34 {8783AD3A-A5CA-42B7-AAC4-A07EB845A684} = {8783AD3A-A5CA-42B7-AAC4-A07EB845A684} 35 {5280C25A-D316-4BE7-AE50-29D72108624F} = {5280C25A-D316-4BE7-AE50-29D72108624F} 36 {78018D78-F890-47E3-A0B7-09D273F0B11D} = {78018D78-F890-47E3-A0B7-09D273F0B11D} 33 37 {5E87AD84-AC4F-4336-B4EE-549CA210EE4A} = {5E87AD84-AC4F-4336-B4EE-549CA210EE4A} 34 {78018D78-F890-47E3-A0B7-09D273F0B11D} = {78018D78-F890-47E3-A0B7-09D273F0B11D}35 {5280C25A-D316-4BE7-AE50-29D72108624F} = {5280C25A-D316-4BE7-AE50-29D72108624F}36 {8783AD3A-A5CA-42B7-AAC4-A07EB845A684} = {8783AD3A-A5CA-42B7-AAC4-A07EB845A684}37 38 EndProjectSection 38 39 EndProject -
branches/0.3-poznan-univ/build/HM_vc9.sln
r2 r28 8 8 {78018D78-F890-47E3-A0B7-09D273F0B11D} = {78018D78-F890-47E3-A0B7-09D273F0B11D} 9 9 {D1E8A1C2-15DB-4C94-80E8-4F70CF0A2DC5} = {D1E8A1C2-15DB-4C94-80E8-4F70CF0A2DC5} 10 {457993C6-AE2C-4B9B-B5F9-71033279A0B9} = {457993C6-AE2C-4B9B-B5F9-71033279A0B9} 10 11 EndProjectSection 11 12 EndProject -
branches/0.3-poznan-univ/build/linux/common/makefile.base
r2 r28 47 47 # default cpp flags for all configurations 48 48 #CPPFLAGS = -Wall -fPIC $(DEFS) -I$(CURDIR)/$(INC_DIR) $(USER_INC_DIRS) 49 CPPFLAGS = -fPIC $(DEFS) -I$(CURDIR)/$(INC_DIR) $(USER_INC_DIRS) -Wall -Wshadow -Wno-sign-compare -Werror49 CPPFLAGS = -fPIC $(DEFS) -I$(CURDIR)/$(INC_DIR) $(USER_INC_DIRS) -Wall -Wshadow -Wno-sign-compare 50 50 51 51 ########## -
branches/0.3-poznan-univ/build/linux/lib/TLibCommon/makefile
r2 r28 42 42 $(OBJ_DIR)/TComLoopFilter.o \ 43 43 $(OBJ_DIR)/TComMotionInfo.o \ 44 $(OBJ_DIR)/TComMP.o \ 44 45 $(OBJ_DIR)/TComPattern.o \ 45 46 $(OBJ_DIR)/TComPic.o \ -
branches/0.3-poznan-univ/build/linux/test/TAppDecoder/makefile
r2 r28 41 41 42 42 43 DYN_DEBUG_LIBS = -lTLibDecoderd -lTLibCommond -lTLibVideoIOd -lTAppCommond 44 DYN_DEBUG_PREREQS = $(LIB_DIR)/libTLibDecoderd.a $(LIB_DIR)/libTLibCommond.a $(LIB_DIR)/libTLibVideoIOd.a $(LIB_DIR)/libTAppCommond.a45 STAT_DEBUG_LIBS = -lTLibDecoderStaticd -lTLibCommonStaticd -lTLibVideoIOStaticd -lTAppCommonStaticd 46 STAT_DEBUG_PREREQS = $(LIB_DIR)/libTLibDecoderStaticd.a $(LIB_DIR)/libTLibCommonStaticd.a $(LIB_DIR)/libTLibVideoIOStaticd.a $(LIB_DIR)/libTAppCommonStaticd.a43 DYN_DEBUG_LIBS = -lTLibDecoderd -lTLibCommond -lTLibVideoIOd -lTAppCommond -lTLibRendererd 44 DYN_DEBUG_PREREQS = $(LIB_DIR)/libTLibDecoderd.a $(LIB_DIR)/libTLibCommond.a $(LIB_DIR)/libTLibVideoIOd.a $(LIB_DIR)/libTAppCommond.a $(LIB_DIR)/libTLibRendererd.a 45 STAT_DEBUG_LIBS = -lTLibDecoderStaticd -lTLibCommonStaticd -lTLibVideoIOStaticd -lTAppCommonStaticd -lTLibRendererStaticd 46 STAT_DEBUG_PREREQS = $(LIB_DIR)/libTLibDecoderStaticd.a $(LIB_DIR)/libTLibCommonStaticd.a $(LIB_DIR)/libTLibVideoIOStaticd.a $(LIB_DIR)/libTAppCommonStaticd.a $(LIB_DIR)/libTLibRendererStaticd.a 47 47 48 DYN_RELEASE_LIBS = -lTLibDecoder -lTLibCommon -lTLibVideoIO -lTAppCommon 49 DYN_RELEASE_PREREQS = $(LIB_DIR)/libTLibDecoder.a $(LIB_DIR)/libTLibCommon.a $(LIB_DIR)/libTLibVideoIO.a $(LIB_DIR)/libTAppCommon.a 50 STAT_RELEASE_LIBS = -lTLibDecoderStatic -lTLibCommonStatic -lTLibVideoIOStatic -lTAppCommonStatic 51 STAT_RELEASE_PREREQS = $(LIB_DIR)/libTLibDecoderStatic.a $(LIB_DIR)/libTLibCommonStatic.a $(LIB_DIR)/libTLibVideoIOStatic.a $(LIB_DIR)/libTAppCommonStatic.a 48 DYN_RELEASE_LIBS = -lTLibDecoder -lTLibCommon -lTLibVideoIO -lTAppCommon -lTLibRenderer 49 DYN_RELEASE_PREREQS = $(LIB_DIR)/libTLibDecoder.a $(LIB_DIR)/libTLibCommon.a $(LIB_DIR)/libTLibVideoIO.a $(LIB_DIR)/libTAppCommon.a $(LIB_DIR)/libTLibRenderer.a 50 STAT_RELEASE_LIBS = -lTLibDecoderStatic -lTLibCommonStatic -lTLibVideoIOStatic -lTAppCommonStatic -lTLibRendererStatic 51 STAT_RELEASE_PREREQS = $(LIB_DIR)/libTLibDecoderStatic.a $(LIB_DIR)/libTLibCommonStatic.a $(LIB_DIR)/libTLibVideoIOStatic.a $(LIB_DIR)/libTAppCommonStatic.a $(LIB_DIR)/libTLibRendererStatic.a 52 52 53 53 -
branches/0.3-poznan-univ/build/vc10/TAppDecoder_vc10.vcxproj
r2 r28 190 190 <ReferenceOutputAssembly>false</ReferenceOutputAssembly> 191 191 </ProjectReference> 192 <ProjectReference Include="TLibRenderer_vc10.vcxproj"> 193 <Project>{2b298be6-dff0-4bd2-8f26-395ffe7f9eb4}</Project> 194 <Private>true</Private> 195 <ReferenceOutputAssembly>false</ReferenceOutputAssembly> 196 <CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies> 197 <LinkLibraryDependencies>true</LinkLibraryDependencies> 198 <UseLibraryDependencyInputs>false</UseLibraryDependencyInputs> 199 </ProjectReference> 192 200 </ItemGroup> 193 201 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> -
branches/0.3-poznan-univ/build/vc10/TLibCommon_vc10.vcxproj
r2 r28 152 152 <ClCompile Include="..\..\source\Lib\TLibCommon\TComLoopFilter.cpp" /> 153 153 <ClCompile Include="..\..\source\Lib\TLibCommon\TComMotionInfo.cpp" /> 154 <ClCompile Include="..\..\source\Lib\TLibCommon\TComMP.cpp" /> 154 155 <ClCompile Include="..\..\source\Lib\TLibCommon\TComMVDRefData.cpp" /> 155 156 <ClCompile Include="..\..\source\Lib\TLibCommon\TComPattern.cpp" /> … … 187 188 <ClInclude Include="..\..\source\Lib\TLibCommon\TComLoopFilter.h" /> 188 189 <ClInclude Include="..\..\source\Lib\TLibCommon\TComMotionInfo.h" /> 190 <ClInclude Include="..\..\source\Lib\TLibCommon\TComMP.h" /> 189 191 <ClInclude Include="..\..\source\Lib\TLibCommon\TComMv.h" /> 190 192 <ClInclude Include="..\..\source\Lib\TLibCommon\TComMVDRefData.h" /> -
branches/0.3-poznan-univ/build/vc10/TLibCommon_vc10.vcxproj.filters
r2 r28 90 90 <Filter>Source Files</Filter> 91 91 </ClCompile> 92 <ClCompile Include="..\..\source\Lib\TLibCommon\TComWeightPrediction.cpp.cpp"> 92 <ClCompile Include="..\..\source\Lib\TLibCommon\TComWeightPrediction.cpp"> 93 <Filter>Source Files</Filter> 94 </ClCompile> 95 <ClCompile Include="..\..\source\Lib\TLibCommon\TComMP.cpp"> 93 96 <Filter>Source Files</Filter> 94 97 </ClCompile> … … 197 200 <Filter>Header Files</Filter> 198 201 </ClInclude> 202 <ClInclude Include="..\..\source\Lib\TLibCommon\TComMP.h"> 203 <Filter>Header Files</Filter> 204 </ClInclude> 199 205 </ItemGroup> 200 206 </Project> -
branches/0.3-poznan-univ/build/vc8/TLibCommon_vc8.vcproj
r2 r28 81 81 </Configuration> 82 82 <Configuration 83 Name="Debug|x64" 84 OutputDirectory="$(SolutionDir)\vc8\$(PlatformName)\$(ConfigurationName)\$(RootNamespace)" 85 IntermediateDirectory="$(SolutionDir)\vc8\$(PlatformName)\$(ConfigurationName)\$(RootNamespace)" 86 ConfigurationType="4" 87 CharacterSet="2" 88 > 89 <Tool 90 Name="VCPreBuildEventTool" 91 /> 92 <Tool 93 Name="VCCustomBuildTool" 94 /> 95 <Tool 96 Name="VCXMLDataGeneratorTool" 97 /> 98 <Tool 99 Name="VCWebServiceProxyGeneratorTool" 100 /> 101 <Tool 102 Name="VCMIDLTool" 103 TargetEnvironment="3" 104 /> 105 <Tool 106 Name="VCCLCompilerTool" 107 Optimization="0" 108 AdditionalIncludeDirectories=""..\..\compat\msvc"" 109 PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS" 110 MinimalRebuild="true" 111 BasicRuntimeChecks="3" 112 RuntimeLibrary="1" 113 WarningLevel="3" 114 DebugInformationFormat="3" 115 /> 116 <Tool 117 Name="VCManagedResourceCompilerTool" 118 /> 119 <Tool 120 Name="VCResourceCompilerTool" 121 /> 122 <Tool 123 Name="VCPreLinkEventTool" 124 /> 125 <Tool 126 Name="VCLibrarianTool" 127 /> 128 <Tool 129 Name="VCALinkTool" 130 /> 131 <Tool 132 Name="VCXDCMakeTool" 133 /> 134 <Tool 135 Name="VCBscMakeTool" 136 /> 137 <Tool 138 Name="VCFxCopTool" 139 /> 140 <Tool 141 Name="VCPostBuildEventTool" 142 /> 143 </Configuration> 144 <Configuration 83 145 Name="Release|Win32" 84 146 OutputDirectory="$(SolutionDir)\vc8\$(PlatformName)\$(ConfigurationName)\$(RootNamespace)" … … 145 207 </Configuration> 146 208 <Configuration 147 Name="Debug|x64"148 OutputDirectory="$(SolutionDir)\vc8\$(PlatformName)\$(ConfigurationName)\$(RootNamespace)"149 IntermediateDirectory="$(SolutionDir)\vc8\$(PlatformName)\$(ConfigurationName)\$(RootNamespace)"150 ConfigurationType="4"151 CharacterSet="2"152 >153 <Tool154 Name="VCPreBuildEventTool"155 />156 <Tool157 Name="VCCustomBuildTool"158 />159 <Tool160 Name="VCXMLDataGeneratorTool"161 />162 <Tool163 Name="VCWebServiceProxyGeneratorTool"164 />165 <Tool166 Name="VCMIDLTool"167 TargetEnvironment="3"168 />169 <Tool170 Name="VCCLCompilerTool"171 Optimization="0"172 PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS"173 AdditionalIncludeDirectories=""..\..\compat\msvc""174 MinimalRebuild="true"175 BasicRuntimeChecks="3"176 RuntimeLibrary="1"177 WarningLevel="3"178 DebugInformationFormat="3"179 />180 <Tool181 Name="VCManagedResourceCompilerTool"182 />183 <Tool184 Name="VCResourceCompilerTool"185 />186 <Tool187 Name="VCPreLinkEventTool"188 />189 <Tool190 Name="VCLibrarianTool"191 />192 <Tool193 Name="VCALinkTool"194 />195 <Tool196 Name="VCXDCMakeTool"197 />198 <Tool199 Name="VCBscMakeTool"200 />201 <Tool202 Name="VCFxCopTool"203 />204 <Tool205 Name="VCPostBuildEventTool"206 />207 </Configuration>208 <Configuration209 209 Name="Release|x64" 210 210 OutputDirectory="$(SolutionDir)\vc8\$(PlatformName)\$(ConfigurationName)\$(RootNamespace)" … … 236 236 EnableIntrinsicFunctions="false" 237 237 FavorSizeOrSpeed="1" 238 AdditionalIncludeDirectories=""..\..\compat\msvc"" 238 239 PreprocessorDefinitions="WIN32;_LIB;_CRT_SECURE_NO_WARNINGS" 239 AdditionalIncludeDirectories=""..\..\compat\msvc""240 240 StringPooling="true" 241 241 RuntimeLibrary="0" … … 321 321 </File> 322 322 <File 323 RelativePath="..\..\source\Lib\TLibCommon\TComMP.cpp" 324 > 325 </File> 326 <File 323 327 RelativePath="..\..\source\Lib\TLibCommon\TComMVDRefData.cpp" 324 328 > … … 459 463 </File> 460 464 <File 465 RelativePath="..\..\source\Lib\TLibCommon\TComMP.h" 466 > 467 </File> 468 <File 461 469 RelativePath="..\..\source\Lib\TLibCommon\TComMv.h" 462 470 > -
branches/0.3-poznan-univ/build/vc9/TLibCommon_vc9.vcproj
r2 r28 324 324 </File> 325 325 <File 326 RelativePath="..\..\source\Lib\TLibCommon\TComMP.cpp" 327 > 328 </File> 329 <File 326 330 RelativePath="..\..\source\Lib\TLibCommon\TComMVDRefData.cpp" 327 331 > … … 462 466 </File> 463 467 <File 468 RelativePath="..\..\source\Lib\TLibCommon\TComMP.h" 469 > 470 </File> 471 <File 464 472 RelativePath="..\..\source\Lib\TLibCommon\TComMv.h" 465 473 > -
branches/0.3-poznan-univ/source/App/TAppCommon/TAppComCamPara.cpp
r21 r28 76 76 77 77 radLUT [ uiSourceView ][ uiTargetView ] = new Double*[ 2 ]; 78 radLUT [ uiSourceView ][ uiTargetView ][ 0 ] = new Double [ 257];79 radLUT [ uiSourceView ][ uiTargetView ][ 1 ] = new Double [ 257];78 radLUT [ uiSourceView ][ uiTargetView ][ 0 ] = new Double [ SizeOfLUT+1 ]; 79 radLUT [ uiSourceView ][ uiTargetView ][ 1 ] = new Double [ SizeOfLUT+1 ]; 80 80 81 81 raiLUT [ uiSourceView ][ uiTargetView ] = new Int* [ 2 ]; 82 raiLUT [ uiSourceView ][ uiTargetView ][ 0 ] = new Int [ 257];83 raiLUT [ uiSourceView ][ uiTargetView ][ 1 ] = new Int [ 257];82 raiLUT [ uiSourceView ][ uiTargetView ][ 0 ] = new Int [ SizeOfLUT+1 ]; 83 raiLUT [ uiSourceView ][ uiTargetView ][ 1 ] = new Int [ SizeOfLUT+1 ]; 84 84 } 85 85 } … … 877 877 radShiftParams[ uiSourceView][ uiTargetView ][ 1 ] = dOffset; 878 878 879 for( UInt uiDepthValue = 0; uiDepthValue < 256; uiDepthValue++ ) 880 { 879 #if POZNAN_NONLINEAR_DEPTH 880 TComNonlinearDepthBackward cNonlinearDepthBwd(m_fDepthPower, (POZNAN_LUT_INCREASED_PRECISION) ? g_uiBitIncrement : 0, (POZNAN_LUT_INCREASED_PRECISION) ? g_uiBitIncrement : 0); 881 #endif 882 883 for( UInt uiDepthValue = 0; uiDepthValue < SizeOfLUT; uiDepthValue++ ) 884 { 885 Double dDepthValue = (Double)uiDepthValue; 886 Int64 iDepthValue = (Int64)uiDepthValue; 887 #if POZNAN_NONLINEAR_DEPTH 888 dDepthValue = cNonlinearDepthBwd(dDepthValue); 889 iDepthValue = (Int64)(dDepthValue+0.5); 890 #endif 891 #if POZNAN_LUT_INCREASED_PRECISION 892 dDepthValue /= (1<<g_uiBitIncrement); 893 #endif 881 894 // real-valued look-up tables 882 Double dShiftLuma = ( (Double)uiDepthValue * dScale + dOffset ) * Double( 1 << m_iLog2Precision ); 895 896 Double dShiftLuma = ( dDepthValue * dScale + dOffset ) * Double( 1 << m_iLog2Precision ); 883 897 Double dShiftChroma = dShiftLuma / 2; 884 898 radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = dShiftLuma; … … 886 900 887 901 // integer-valued look-up tables 888 Int64 iTempScale = (Int64)uiDepthValue * iScale; 902 Int64 iTempScale = iDepthValue * iScale; 903 #if POZNAN_LUT_INCREASED_PRECISION 904 iTempScale >>= g_uiBitIncrement; 905 #endif 889 906 Int64 iTestScale = ( iTempScale + iOffset ); // for checking accuracy of camera parameters 890 907 Int64 iShiftLuma = ( iTempScale + iOffsetLuma ) >> iLog2DivLuma; … … 899 916 } 900 917 901 radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 255];902 radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 255];903 raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 255];904 raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 255];918 radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ SizeOfLUT ] = radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ SizeOfLUT-1 ]; 919 radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ SizeOfLUT ] = radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ SizeOfLUT-1 ]; 920 raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ SizeOfLUT ] = raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ SizeOfLUT-1 ]; 921 raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ SizeOfLUT ] = raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ SizeOfLUT-1 ]; 905 922 } 906 923 } … … 1235 1252 Char* pchSynthViewNumbers, 1236 1253 std::vector<Int>* paiSynthViewNumbers, 1237 Int iLog2Precision ) 1254 Int iLog2Precision 1255 #if POZNAN_NONLINEAR_DEPTH 1256 ,Float fDepthPower 1257 #endif 1258 ) 1238 1259 { 1239 1260 //===== set miscellaneous variables ===== … … 1243 1264 m_uiCamParsCodedPrecision = uiCodedCamParsPrecision; 1244 1265 m_iLog2Precision = iLog2Precision; 1266 1267 #if POZNAN_NONLINEAR_DEPTH 1268 m_fDepthPower = fDepthPower; 1269 #endif 1245 1270 1246 1271 xReadCameraParameterFile( pchCfgFileName ); … … 1460 1485 } 1461 1486 1487 #if POZNAN_SYNTH 1488 Bool 1489 TAppComCamPara::getNearestBaseView( Int iSynthViewIdx, Int &riNearestViewIdx, Int &riRelDistToLeft, Bool& rbRenderFromLeft) 1490 { 1491 riNearestViewIdx = 0; 1492 1493 Bool bDecencdingVN = ( m_aiSortedBaseViews.size() >= 2 && m_aiSortedBaseViews[ 0 ] > m_aiSortedBaseViews[ 1 ] ); 1494 Int iFactor = ( bDecencdingVN ? -1 : 1 ); 1495 1496 if( ( m_aiBaseId2SortedId[iSynthViewIdx] - m_aiBaseId2SortedId[riNearestViewIdx] ) * iFactor <= 0 ) 1497 { 1498 rbRenderFromLeft = true; 1499 } 1500 else 1501 { 1502 rbRenderFromLeft = false; 1503 } 1504 1505 riRelDistToLeft = 128; //Not used for now; 1506 1507 return true; 1508 } 1509 #endif 1510 1511 1512 1462 1513 Int TAppComCamPara::getRelDistLeft( Int iSynthViewIdx, Int iLeftViewIdx, Int iRightViewIdx ) 1463 1514 { … … 1474 1525 return xGetViewId(m_aiRelSynthViewsNum, iRelNum ); 1475 1526 } 1527 1528 1529 #if POZNAN_MP 1530 Bool 1531 TAppComCamPara::isLeftView( Int iSynthViewIdx, Int iNearestViewIdx) 1532 { 1533 Bool bDecencdingVN = ( m_aiSortedBaseViews.size() >= 2 && m_aiSortedBaseViews[ 0 ] > m_aiSortedBaseViews[ 1 ] ); 1534 Int iFactor = ( bDecencdingVN ? -1 : 1 ); 1535 1536 if( ( m_aiBaseId2SortedId[iSynthViewIdx] - m_aiBaseId2SortedId[iNearestViewIdx] ) * iFactor <= 0 ) return true; 1537 else return false; 1538 } 1539 #endif -
branches/0.3-poznan-univ/source/App/TAppCommon/TAppComCamPara.h
r5 r28 104 104 Int**** m_aiSynthViewShiftLUT; ///< Disparity LUT 105 105 106 #if POZNAN_NONLINEAR_DEPTH 107 Float m_fDepthPower; 108 #endif 106 109 107 110 protected: … … 161 164 Char* pchSynthViewNumbers, 162 165 std::vector<Int>* paiSynthViewNumbers, 163 Int iLog2Precision ); 166 Int iLog2Precision 167 #if POZNAN_NONLINEAR_DEPTH 168 ,Float fDepthPower 169 #endif 170 ); 164 171 165 172 Void init ( UInt uiInputBitDepth, … … 170 177 std::vector<Int>* paiSynthViewNumbers, 171 178 Int iLog2Precision 179 #if POZNAN_NONLINEAR_DEPTH 180 ,Float fDepthPower 181 #endif 172 182 ); 173 183 … … 182 192 Int synthRelNum2Idx ( Int iRelNum ); 183 193 Bool getLeftRightBaseView( Int iSynthViewIdx, Int &riLeftViewIdx, Int &riRightViewIdx, Int &riRelDistToLeft, Bool& rbIsBaseView ); 194 #if POZNAN_SYNTH 195 Bool getNearestBaseView( Int iSynthViewIdx, Int &riNearestViewIdx, Int &riRelDistToLeft, Bool& rbRenderFromLeft); 196 #endif 197 184 198 Int getRelDistLeft ( Int iSynthViewIdx, Int iLeftViewIdx, Int iRightViewIdx ); 185 199 UInt getCurFrameId () { return m_iCurrentFrameId; } 186 200 static Void convertNumberString ( Char* pchViewNumberString, std::vector<Int>& raiViewNumbers, Double dViewNumPrec ); 201 202 #if POZNAN_MP 203 Bool isLeftView( Int iSynthViewIdx, Int iNearestViewIdx); 204 #endif 187 205 188 206 // function for getting parameters and parameter arrays -
branches/0.3-poznan-univ/source/App/TAppDecoder/TAppDecTop.cpp
r21 r28 64 64 // m_iPOCLastDisplay = -1; 65 65 m_pScaleOffsetFile = 0; 66 67 #if POZNAN_MP 68 m_pcMP = NULL; 69 #endif 66 70 } 67 71 … … 71 75 72 76 m_apcBitstream->create( BITS_BUF_SIZE ); 77 78 #if POZNAN_MP 79 m_pcMP = new TComMP(); 80 #endif 73 81 } 74 82 … … 89 97 free(m_pchReconFile); 90 98 } 99 100 #if POZNAN_MP 101 if(m_pcMP) { delete m_pcMP; m_pcMP = NULL; }; 102 #endif 91 103 } 92 104 … … 163 175 if( eNalUnitType == NAL_UNIT_SPS ) 164 176 { 177 #if POZNAN_SYNTH 178 if(cComSPS.getViewId()==0 && !cComSPS.isDepth()) // it should be called at first view at the begining of the stream 179 initRenderer(cComSPS); 180 #endif 165 181 if( cComSPS.isDepth() && (m_bUsingDepth==false) ) // expected not using depth, but bitstream are using depth 166 182 { // know from sps … … 415 431 if ( m_pchReconFile ) 416 432 { 433 434 #if POZNAN_NONLINEAR_DEPTH 435 TComSPS* pcSPS = pcPic->getSlice(0)->getSPS(); 436 TComPicYuv cPicPower; 437 438 //pcPic->getPicYuvRec() 439 cPicPower.create(pcSPS->getWidth(), pcSPS->getHeight(), pcSPS->getMaxCUWidth(), pcSPS->getMaxCUHeight(), pcSPS->getMaxCUDepth() ); 440 441 pcPic->getPicYuvRec()->nonlinearDepthBackward(&cPicPower, pcSPS->getDepthPower()); 442 443 m_acTVideoIOYuvDepthReconFileList[iViewIdx]->write(&cPicPower, pcSPS->getPad()); 444 cPicPower.destroy(); 445 #else 417 446 m_acTVideoIOYuvDepthReconFileList[iViewIdx]->write( pcPic->getPicYuvRec(), pcPic->getSlice(0)->getSPS()->getPad() ); 447 #endif 418 448 } 419 449 … … 542 572 return pcRefPic; 543 573 } 574 575 #if POZNAN_SYNTH 576 Void TAppDecTop::initRenderer(TComSPS &cComSPS) 577 { 578 m_cAvailabilityRenderer.init(cComSPS.getWidth(), cComSPS.getHeight(),true,0,LOG2_DISP_PREC_LUT,true, 0,0,0,0,0,6,4,1,0,6 ); //GT: simplest configuration 579 } 580 //* 581 Void TAppDecTop::storeSynthPicsInBuffer(Int iCoddedViewIdx,Int iCoddedViewOrderIdx, Int iCurPoc, Bool bDepth) 582 { 583 Int iLeftViewIdx = -1; 584 Int iRightViewIdx = -1; 585 Int iNearestViewIdx = -1; 586 Bool bRenderFromLeft; 587 588 Int iRelDistToLeft = 128; 589 if(iCoddedViewIdx==0) //First on View Coded List 590 { 591 //TComPic* pcPic = getPicFromView( iCoddedViewIdx, iCurPoc, false ); 592 return; 593 } 594 iNearestViewIdx = 0; 595 //bRenderFromLeft = iCoddedViewOrderIdx>0?true:false; 596 //bRenderFromLeft = iCoddedViewOrderIdx<0?true:false; 597 //m_cCamParsCollector.getNearestBaseView(iCoddedViewIdx, iNearestViewIdx, iRelDistToLeft, bRenderFromLeft); 598 bRenderFromLeft = iCoddedViewIdx>1?true:false; 599 600 m_cAvailabilityRenderer.setShiftLUTs( 601 m_cCamParsCollector.getBaseViewShiftLUTD()[iNearestViewIdx][iCoddedViewIdx], 602 m_cCamParsCollector.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx], 603 m_cCamParsCollector.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx], 604 m_cCamParsCollector.getBaseViewShiftLUTD()[iNearestViewIdx][iCoddedViewIdx],//right 605 m_cCamParsCollector.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx], 606 m_cCamParsCollector.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx], 607 iRelDistToLeft 608 ); 609 610 TComPic* pcPic = getPicFromView( iCoddedViewIdx, iCurPoc, bDepth ); 611 612 TComPicYuv* pcPicYuvSynthView = pcPic->getPicYuvSynth(); 613 TComPicYuv* pcPicYuvAvailView = pcPic->getPicYuvAvail(); 614 if(!pcPicYuvSynthView) 615 { 616 pcPic->addSynthesisBuffer(); 617 pcPicYuvSynthView = pcPic->getPicYuvSynth(); 618 } 619 if(!pcPicYuvAvailView) 620 { 621 pcPic->addAvailabilityBuffer(); 622 pcPicYuvAvailView = pcPic->getPicYuvAvail(); 623 } 624 // usun i uzyj syntezy Krzysztofa tylko przesun ja przed dekodowanie tekstury to do 625 /* 626 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 627 if(!bDepth) 628 { 629 TComPicYuv* pcPicYuvSynthDepthView = pcPic->getPicYuvSynthDepth(); 630 if(!pcPicYuvSynthDepthView) 631 { 632 pcPic->addSynthesisDepthBuffer(); 633 pcPicYuvSynthDepthView = pcPic->getPicYuvSynthDepth(); 634 } 635 m_cAvailabilityRenderer.extrapolateAvailabilityView( getPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), getPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), pcPicYuvSynthDepthView, pcPicYuvAvailView, bRenderFromLeft ); 636 637 #if POZNAN_OUTPUT_SYNTH 638 Char acFilenameBaseD[1024]; 639 //printf("\niNearestViewIdx: %d, iCurPoc: %d, bRenderFromLeft: %s\n", iNearestViewIdx, iCurPoc, (bRenderFromLeft)?"true":"false"); 640 ::sprintf( acFilenameBaseD, "SynthInputDepth_%s_V%d.yuv", ( true ? "Dec" : "Enc" ),iCoddedViewIdx ); 641 getPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec()->dump(acFilenameBaseD, iCurPoc!=0); 642 ::sprintf( acFilenameBaseD, "SynthDepth_%s_V%d.yuv", ( true ? "Dec" : "Enc" ),iCoddedViewIdx ); 643 pcPicYuvSynthDepthView->dump(acFilenameBaseD, iCurPoc!=0); 644 #endif 645 } 646 #endif//*/ 647 648 //m_cAvailabilityRenderer.extrapolateAvailabilityView( xGetPicFromView( iNearestViewIdx, iCurPoc, false )->getPicYuvRec(), xGetPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), pcPicYuvERView, pcPicYuvAvailView, bRenderFromLeft ); 649 m_cAvailabilityRenderer.extrapolateAvailabilityView( getPicFromView( iNearestViewIdx, iCurPoc, bDepth )->getPicYuvRec(), getPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), pcPicYuvSynthView, pcPicYuvAvailView, bRenderFromLeft ); 650 651 pcPicYuvAvailView->setBorderExtension( false );//Needed?? 652 pcPicYuvAvailView->extendPicBorder();//Needed?? 653 654 #if POZNAN_OUTPUT_AVAILABLE_MAP 655 { 656 Char acFilenameBase[1024]; 657 ::sprintf( acFilenameBase, "Available_%s_%s_V%d.yuv", (bDepth ? "Depth":"Tex"),( true ? "Dec" : "Enc" ), iCoddedViewIdx); 658 pcPicYuvAvailView->dump(acFilenameBase, iCurPoc!=0); 659 } 660 #endif 661 #if POZNAN_OUTPUT_SYNTH 662 { 663 Char acFilenameBase[1024]; 664 ::sprintf( acFilenameBase, "Synth_%s_%s_V%d.yuv", (bDepth ? "Depth":"Tex"),( true ? "Dec" : "Enc" ), iCoddedViewIdx ); 665 pcPicYuvSynthView->dump(acFilenameBase, iCurPoc!=0); 666 } 667 #endif 668 } 669 #endif 670 671 //* 672 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 673 Void TAppDecTop::storeDepthSynthPicsInBuffer(Int iCoddedViewIdx,Int iCoddedViewOrderIdx, Int iCurPoc) 674 { 675 Int iLeftViewIdx = -1; 676 Int iRightViewIdx = -1; 677 Int iNearestViewIdx = -1; 678 Bool bRenderFromLeft; 679 680 Int iRelDistToLeft = 128; 681 if(iCoddedViewIdx==0) //First on View Coded List 682 { 683 //TComPic* pcPic = getPicFromView( iCoddedViewIdx, iCurPoc, false ); 684 return; 685 } 686 iNearestViewIdx = 0; 687 //bRenderFromLeft = iCoddedViewOrderIdx>0?true:false; 688 //bRenderFromLeft = iCoddedViewOrderIdx<0?true:false; 689 //m_cCamParsCollector.getNearestBaseView(iCoddedViewIdx, iNearestViewIdx, iRelDistToLeft, bRenderFromLeft); 690 bRenderFromLeft = iCoddedViewIdx>1?true:false; 691 692 m_cAvailabilityRenderer.setShiftLUTs( 693 m_cCamParsCollector.getBaseViewShiftLUTD()[iNearestViewIdx][iCoddedViewIdx], 694 m_cCamParsCollector.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx], 695 m_cCamParsCollector.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx], 696 m_cCamParsCollector.getBaseViewShiftLUTD()[iNearestViewIdx][iCoddedViewIdx],//right 697 m_cCamParsCollector.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx], 698 m_cCamParsCollector.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx], 699 iRelDistToLeft 700 ); 701 702 TComPic* pcPic = getPicFromView( iCoddedViewIdx, iCurPoc, false ); 703 704 TComPicYuv* pcPicYuvSynthDepthView = pcPic->getPicYuvSynthDepth(); 705 if(!pcPicYuvSynthDepthView) 706 { 707 pcPic->addSynthesisDepthBuffer(); 708 pcPicYuvSynthDepthView = pcPic->getPicYuvSynthDepth(); 709 } 710 711 Int iWidth = pcPicYuvSynthDepthView->getWidth (); 712 Int iHeight = pcPicYuvSynthDepthView->getHeight (); 713 UInt uiMaxCuWidth = pcPicYuvSynthDepthView->getMaxCuWidth (); 714 UInt uiMaxCuHeight = pcPicYuvSynthDepthView->getMaxCuHeight(); 715 UInt uiMaxCuDepth = pcPicYuvSynthDepthView->getMaxCuDepth (); 716 717 TComPicYuv* pcPicYuvAvailView = new TComPicYuv; 718 pcPicYuvAvailView->create( iWidth, iHeight, uiMaxCuWidth, uiMaxCuHeight, uiMaxCuDepth ); 719 720 m_cAvailabilityRenderer.extrapolateAvailabilityView( getPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), getPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), pcPicYuvSynthDepthView, pcPicYuvAvailView, bRenderFromLeft ); 721 722 pcPicYuvAvailView->destroy(); 723 delete pcPicYuvAvailView; 724 725 #if POZNAN_OUTPUT_SYNTH 726 Char acFilenameBaseD[1024]; 727 //printf("\niNearestViewIdx: %d, iCurPoc: %d, bRenderFromLeft: %s\n", iNearestViewIdx, iCurPoc, (bRenderFromLeft)?"true":"false"); 728 ::sprintf( acFilenameBaseD, "SynthInputDepth_%s_V%d.yuv", ( true ? "Dec" : "Enc" ),iCoddedViewIdx ); 729 getPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec()->dump(acFilenameBaseD, iCurPoc!=0); 730 ::sprintf( acFilenameBaseD, "SynthDepth_%s_V%d.yuv", ( true ? "Dec" : "Enc" ),iCoddedViewIdx ); 731 pcPicYuvSynthDepthView->dump(acFilenameBaseD, iCurPoc!=0); 732 #endif 733 734 } 735 #endif//*/ -
branches/0.3-poznan-univ/source/App/TAppDecoder/TAppDecTop.h
r21 r28 52 52 #include "../../Lib/TLibCommon/TComDepthMapGenerator.h" 53 53 #include "../../Lib/TLibDecoder/TDecTop.h" 54 #if POZNAN_SYNTH 55 #include "../../Lib/TLibRenderer/TRenTop.h" 56 #endif 54 57 #include "TAppDecCfg.h" 58 59 #if POZNAN_MP 60 #include "../../Lib/TLibCommon/TComMP.h" 61 #endif 55 62 56 63 // ==================================================================================================================== … … 87 94 #endif 88 95 96 #if POZNAN_SYNTH 97 TRenTop m_cAvailabilityRenderer; 98 #endif 99 100 #if POZNAN_MP 101 TComMP* m_pcMP; 102 #endif 103 89 104 public: 90 105 TAppDecTop(); … … 97 112 Void startUsingDepth() ; 98 113 99 // GT FIX 114 #if POZNAN_SYNTH 115 Void initRenderer(TComSPS &cComSPS); 116 Void storeSynthPicsInBuffer(Int iCoddedViewIdx,Int iCoddedViewOrderIdx,Int iCurPoc,Bool bDepth); 117 #endif 118 119 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 120 Void storeDepthSynthPicsInBuffer(Int iCoddedViewIdx,Int iCoddedViewOrderIdx, Int iCurPoc); 121 #endif 122 123 // GT FIX 100 124 std::vector<TComPic*> getSpatialRefPics( Int iViewIdx, Int iPoc, Bool bIsDepth ); 101 125 TComPic* getPicFromView( Int iViewIdx, Int iPoc, bool bDepth ); … … 106 130 TComAUPicAccess* getAUPicAccess() { return &m_cAUPicAccess; } 107 131 TDecTop* getDecTop0 () { return m_acTDecTopList[0]; } 132 #endif 133 134 #if POZNAN_MP 135 TComMP* getMP() { return m_pcMP; } 108 136 #endif 109 137 -
branches/0.3-poznan-univ/source/App/TAppEncoder/TAppEncCfg.cpp
r21 r28 341 341 #endif 342 342 343 #if POZNAN_DBMP 344 ("DBMP", m_uiDBMP, (UInt)0, "usage of Depth-Based Motion Prediction" ) 345 #endif 346 347 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 348 ("CUSkip", m_uiUseCUSkip, (UInt)1, "encode only disoccluded CUs in dependend view" ) 349 #endif 350 343 351 ("QpChangeFrame", m_iQpChangeFrame, PicOrderCnt(0), "start frame for QP change") 344 352 ("QpChangeOffsetVideo", m_iQpChangeOffsetVideo, 0, "QP change offset for video") … … 350 358 #endif 351 359 #endif 360 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 361 ("TDdQP", m_bUseTexDqpAccordingToDepth, false, "texture TU blocks QP param modification according to depth map's values") 362 #endif 363 #if POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC 364 ("TDdQPOffset", m_dTexDqpAccordingToDepthOffset, (Double)(-2.6), "texture block QP changing tool based on coresponding depth block values - offset parameter" ) 365 ("TDdQPMul", m_dTexDqpAccordingToDepthMul, (Double)(1), "texture block QP changing tool based on coresponding depth block values - multiplicative parameter" ) 366 ("TDdQPTopBottomRow", m_iTexDqpAccordingToDepthTopBottomRow, (Int)2, "texture block QP changing tool - top and bottom CU rows delta QP parameter" ) 367 #endif 368 #if POZNAN_NONLINEAR_DEPTH 369 ("DepthPower,-dpow", m_fDepthPower, (Double)1.0, "Depth power value (for non-linear processing)") 370 #endif 371 352 372 353 373 /* Compatability with old style -1 FOO or -0 FOO options. */ … … 437 457 #endif 438 458 459 #if POZNAN_NONLINEAR_DEPTH 460 if (m_fDepthPower<=0) 461 { 462 Float fDepthQP = m_adQP[ m_adQP.size() < 2 ? 0 : 1]; 463 m_fDepthPower = (fDepthQP-30) *0.25/20.0 + 1.25; 464 if (m_fDepthPower<=1.0) m_fDepthPower = 1.0; 465 // QP = 30 = 1.25 466 // QP = 50 = 1.5 467 if (m_fDepthPower>=1.66) m_fDepthPower = 1.66; 468 }; 469 470 #if POZNAN_NONLINEAR_DEPTH_SEND_AS_BYTE 471 m_fDepthPower = dequantizeDepthPower(quantizeDepthPower((Float)m_fDepthPower)); 472 #endif 473 474 #endif 475 439 476 xCleanUpVectors(); 440 477 … … 516 553 NULL, 517 554 m_cRenModStrParser.getSynthViews(), 518 LOG2_DISP_PREC_LUT ); 555 LOG2_DISP_PREC_LUT 556 #if POZNAN_NONLINEAR_DEPTH 557 ,m_fDepthPower 558 #endif 559 ); 519 560 } 520 561 else if ( m_bUseVSO && m_uiVSOMode != 4 ) … … 529 570 m_pchVSOConfig, 530 571 NULL, 531 LOG2_DISP_PREC_LUT ); 572 LOG2_DISP_PREC_LUT 573 #if POZNAN_NONLINEAR_DEPTH 574 ,m_fDepthPower 575 #endif 576 ); 532 577 } 533 578 else … … 542 587 NULL, 543 588 NULL, 544 LOG2_DISP_PREC_LUT ); 589 LOG2_DISP_PREC_LUT 590 #if POZNAN_NONLINEAR_DEPTH 591 ,m_fDepthPower 592 #endif 593 ); 545 594 } 546 595 #else … … 554 603 NULL, 555 604 NULL, 556 LOG2_DISP_PREC_LUT ); 605 LOG2_DISP_PREC_LUT 606 #if POZNAN_NONLINEAR_DEPTH 607 ,m_fDepthPower 608 #endif 609 ); 557 610 #endif 558 611 … … 665 718 #endif 666 719 720 #if POZNAN_DBMP 721 xConfirmPara ( m_uiDBMP > 1, "DBMP must be less than or equal to 1" ); 722 #endif 723 724 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 725 xConfirmPara ( m_uiUseCUSkip > 1, "CU-Skip must be less than or equal to 1" ); 726 #endif 727 667 728 #if HHI_INTERVIEW_SKIP 668 729 xConfirmPara ( m_uiInterViewSkip > 1, "RenderingSkipMode > 1 not supported" ); … … 933 994 #if MTK_SAO 934 995 #endif 996 997 #if POZNAN_MP 998 printf("POZNAN_MP(1){ "); 999 1000 #if POZNAN_MP_USE_DEPTH_MAP_GENERATION 1001 printf("dmg=1 "); 1002 #else 1003 printf("dmg=0 "); 1004 #endif 1005 1006 #if POZNAN_MP_FILL 1007 printf("fill=%d ",POZNAN_MP_FILL_TYPE); 1008 #else 1009 printf("fill=- "); 1010 #endif 1011 1012 #if POZNAN_DBMP 1013 printf("DBMP:%d ", m_uiDBMP); 1014 if(m_uiDBMP) 1015 { 1016 printf("cand=%d ",POZNAN_DBMP_MERGE_POS); 1017 #if POZNAN_DBMP_CALC_PRED_DATA 1018 printf("pr=1 "); 1019 #else 1020 printf("pr=0 "); 1021 #endif 1022 #if POZNAN_DBMP_COMPRESS_ME_DATA 1023 printf("comp=1 "); 1024 #else 1025 printf("comp=0 "); 1026 #endif 1027 #if POZNAN_DBMP_USE_IN_NONANCHOR_PIC_ONLY 1028 printf("na=1 "); 1029 #else 1030 printf("na=0 "); 1031 #endif 1032 } 1033 #endif 1034 printf("} "); 1035 #endif 1036 1037 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 1038 printf("CU-Skip:%d ", m_uiUseCUSkip); 1039 #endif 1040 935 1041 printf("\n"); 936 1042 printf("TOOL CFG VIDEO : "); … … 938 1044 printf("SAO:%d ", (m_abUseSAO [0] ? 1 : 0)); 939 1045 printf("RDQ:%d ", (m_abUseRDOQ[0] ? 1 : 0) ); 1046 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 1047 printf("TDdQP:%d ", m_bUseTexDqpAccordingToDepth); 1048 #endif 1049 940 1050 printf("\n"); 941 1051 … … 952 1062 #if HHI_MPI 953 1063 printf("MVI:%d ", m_bUseMVI ? 1 : 0 ); 1064 #endif 1065 #if POZNAN_NONLINEAR_DEPTH 1066 printf("DepthPower:%f ", m_fDepthPower); 954 1067 #endif 955 1068 printf("\n"); -
branches/0.3-poznan-univ/source/App/TAppEncoder/TAppEncCfg.h
r5 r28 178 178 #endif 179 179 180 #if POZNAN_DBMP 181 UInt m_uiDBMP; ///< using Depth-Based Motion Prediction 182 #endif 183 184 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 185 UInt m_uiUseCUSkip; ///< using CU-Skip - Encode only disoccluded CUs in dependend view 186 #endif 187 180 188 #if HHI_INTERVIEW_SKIP 181 189 UInt m_uiInterViewSkip; ///< usage of interview skip mode ( do not transmit residual) … … 246 254 #endif 247 255 256 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 257 Bool m_bUseTexDqpAccordingToDepth; ///< flag for using texture QP param modyfication according to depth map's values 258 #endif 248 259 // internal member functions 249 260 Void xSetGlobal (); ///< set global variables … … 271 282 TRenModSetupStrParser m_cRenModStrParser; 272 283 #endif 284 285 #if POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC 286 Double m_dTexDqpAccordingToDepthOffset; 287 Double m_dTexDqpAccordingToDepthMul; 288 Int m_iTexDqpAccordingToDepthTopBottomRow; 289 #endif 290 291 #if POZNAN_NONLINEAR_DEPTH 292 Double m_fDepthPower; ///< Depth power value 293 #endif 294 273 295 public: 274 296 -
branches/0.3-poznan-univ/source/App/TAppEncoder/TAppEncTop.cpp
r21 r28 141 141 m_acTEncTopList[iViewIdx]->setUseFastEnc ( m_bUseFastEnc ); 142 142 143 #if POZNAN_NONLINEAR_DEPTH 144 m_acTEncTopList[iViewIdx]->setDepthPower ( (Float)m_fDepthPower ); 145 #endif 146 143 147 #if HHI_VSO 144 148 m_acTEncTopList[iViewIdx]->setUseVSO ( false ); //GT: might be enabled later for VSO Mode 4 … … 167 171 #endif 168 172 173 #if POZNAN_DBMP 174 m_acTEncTopList[iViewIdx]->setDBMP ( m_uiDBMP ); 175 #endif 176 177 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 178 m_acTEncTopList[iViewIdx]->setUseCUSkip ( m_uiUseCUSkip ); 179 #endif 169 180 170 181 #if HHI_INTERVIEW_SKIP … … 222 233 m_acTEncTopList[iViewIdx]->setQpChangeOffsetVideo( m_iQpChangeOffsetVideo ); 223 234 m_acTEncTopList[iViewIdx]->setQpChangeOffsetDepth( m_iQpChangeOffsetDepth ); 235 236 237 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 238 m_acTEncTopList[iViewIdx]->setUseTexDqpAccordingToDepth ( m_bUseTexDqpAccordingToDepth ); 239 #endif 240 #if POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC 241 m_acTEncTopList[iViewIdx]->setTexDqpAccordingToDepthOffset( m_dTexDqpAccordingToDepthOffset ); 242 m_acTEncTopList[iViewIdx]->setTexDqpAccordingToDepthMul( m_dTexDqpAccordingToDepthMul ); 243 m_acTEncTopList[iViewIdx]->setTexDqpAccordingToDepthTopBottomRow( m_iTexDqpAccordingToDepthTopBottomRow ); 244 #endif 224 245 } 225 246 if( m_bUsingDepthMaps ) … … 382 403 m_acTEncDepthTopList[iViewIdx]->setUseMVI( m_bUseMVI ); 383 404 #endif 405 #if POZNAN_DBMP 406 m_acTEncDepthTopList[iViewIdx]->setDBMP ( m_uiDBMP ); 407 #endif 408 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 409 m_acTEncDepthTopList[iViewIdx]->setUseCUSkip ( m_uiUseCUSkip ); 410 #endif 411 #if POZNAN_NONLINEAR_DEPTH 412 m_acTEncDepthTopList[iViewIdx]->setDepthPower ( (Float)m_fDepthPower ); 413 #endif 384 414 385 415 m_acTEncDepthTopList[iViewIdx]->setPictureDigestEnabled(m_pictureDigestEnabled); … … 435 465 #endif 436 466 467 #if POZNAN_SYNTH 468 //m_cAvailabilityRenderer.init(m_iSourceWidth, m_iSourceHeight,true,0,0,true, 0,0,0,0,0,0,0,1,0,0 ); //GT: simplest configuration 469 m_cAvailabilityRenderer.init(m_iSourceWidth, m_iSourceHeight,true,0,LOG2_DISP_PREC_LUT,true, 0,0,0,0,0,6,4,1,0,6 ); //GT: simplest configuration 470 #endif 471 437 472 #if HHI_INTERVIEW_SKIP 438 473 m_cUsedPelsRenderer.init(m_iSourceWidth, m_iSourceHeight, true, 0, LOG2_DISP_PREC_LUT, true, 0, 0, 0, 0, 0, 6, 4, 1, 0, 6 ); 439 474 #endif 475 476 #if POZNAN_MP 477 #if POZNAN_MP_USE_DEPTH_MAP_GENERATION 478 m_pcMP = new TComMP(m_iSourceHeight, m_iSourceWidth); 479 #else 480 //m_pcMP = new TComMP(m_iSourceHeight, m_iSourceWidth, &m_cCameraData); 481 m_pcMP = new TComMP(m_iSourceHeight, m_iSourceWidth, m_cCameraData.getBaseViewShiftLUTI()); 482 #endif 483 #endif 484 440 485 } 441 486 … … 485 530 486 531 m_cTVideoIOBitsFile.closeBits(); 532 533 #if POZNAN_MP 534 if (m_pcMP) { delete m_pcMP; m_pcMP=NULL; }; 535 #endif 487 536 488 537 #if HHI_VSO … … 640 689 { 641 690 m_acTVideoIOYuvDepthInputFileList[iViewIdx]->read( pcPdmDepthOrg, m_aiPad, m_bUsingDepthMaps ); 691 #if POZNAN_NONLINEAR_DEPTH 692 pcPdmDepthOrg->nonlinearDepthForward(pcPdmDepthOrg, m_fDepthPower); 693 #endif 642 694 } 643 695 #endif … … 661 713 // read input YUV file 662 714 m_acTVideoIOYuvDepthInputFileList[iViewIdx]->read( pcDepthPicYuvOrg, m_aiPad ) ; 715 #if POZNAN_NONLINEAR_DEPTH 716 pcDepthPicYuvOrg->nonlinearDepthForward(pcDepthPicYuvOrg, m_fDepthPower); 717 #endif 663 718 bDepthEos[iViewIdx] = ( m_acTVideoIOYuvDepthInputFileList[iViewIdx]->isEof() == 1 ? true : false ); 664 719 bDepthEos[iViewIdx] = ( m_iDepthFrameRcvdVector[iViewIdx] == (m_iFrameToBeEncoded - 1) ? true : bDepthEos[iViewIdx] ); … … 692 747 for(Int iViewIdx=0; iViewIdx < m_iNumberOfViews; iViewIdx++ ) // Start encoding 693 748 { 749 #if POZNAN_SYNTH 750 if( m_uiUseCUSkip ) 751 { 752 xStoreSynthPicsInBuffer(iViewIdx,false); 753 } 754 #endif 755 //* 756 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 757 if(m_bUseTexDqpAccordingToDepth) 758 { 759 xStoreDepthSynthPicsInBuffer(iViewIdx); 760 } 761 #endif 762 //*/ 694 763 bool bThisViewContinueReadingPics = bContinueReadingPics[iViewIdx]; 695 764 m_acTEncTopList[iViewIdx]->encode( bEos[iViewIdx], m_cListPicYuvRecMap[iViewIdx], pcBitstream, bThisViewContinueReadingPics ); … … 708 777 if( m_bUsingDepthMaps ) 709 778 { 779 #if POZNAN_SYNTH 780 if( m_uiUseCUSkip ) 781 { 782 xStoreSynthPicsInBuffer(iViewIdx,true); 783 } 784 #endif 710 785 bool bThisViewContinueReadingDepthPics = bContinueReadingDepthPics[iViewIdx]; 711 786 m_acTEncDepthTopList[iViewIdx]->encode( bDepthEos[iViewIdx], m_cListPicYuvDepthRecMap[iViewIdx], pcBitstream, bThisViewContinueReadingDepthPics ); … … 928 1003 { 929 1004 riNextPocToDump++; 1005 #if POZNAN_NONLINEAR_DEPTH 1006 if(isDepth) 1007 { 1008 TComPicYuv *pcPicOrg = i->second; 1009 TComPicYuv *pcPicPow = new TComPicYuv; 1010 //pcPicYuvRec->createCompatibleAs(*iterPicYuvRec); 1011 pcPicPow->create( pcPicOrg->getWidth(), pcPicOrg->getHeight(), pcPicOrg->getMaxCuWidth(), pcPicOrg->getMaxCuHeight(), pcPicOrg->getMaxCuDepth() ); 1012 //cPicPower.create(pcSPS->getWidth(), pcSPS->getHeight(), pcSPS->getMaxCUWidth(), pcSPS->getMaxCUHeight(), pcSPS->getMaxCUDepth() ); 1013 pcPicOrg->nonlinearDepthBackward(pcPicPow, m_fDepthPower); 1014 rpcTVideoIOYuvReconFile->write( pcPicPow, m_aiPad ); 1015 // to do destroy pcPicow 1016 } else 1017 #endif 930 1018 rpcTVideoIOYuvReconFile->write( i->second, m_aiPad ); 931 1019 rcMap.erase( i ); … … 1177 1265 #endif 1178 1266 1267 #if POZNAN_SYNTH 1268 Void TAppEncTop::xStoreSynthPicsInBuffer(Int iCoddedViewIdx,Bool bDepth) 1269 { 1270 Int iCurPoc; 1271 if(bDepth) 1272 { 1273 iCurPoc = m_acTEncDepthTopList[ iCoddedViewIdx ]->getNextFrameId(); 1274 if (!(m_acTEncDepthTopList[ iCoddedViewIdx ]->currentPocWillBeCoded())) return; 1275 } 1276 else 1277 { 1278 iCurPoc = m_acTEncTopList[ iCoddedViewIdx ]->getNextFrameId(); 1279 if (!(m_acTEncTopList[ iCoddedViewIdx ]->currentPocWillBeCoded())) return; 1280 } 1281 1282 Int iNumberOfReferenceViews = 0; 1283 Int iNearestViewIdx = -1; 1284 Bool bRenderFromLeft; 1285 1286 Int iRelDistToLeft; 1287 if(iCoddedViewIdx==0) //First on View Coded List 1288 { 1289 //TComPic* pcPic = xGetPicFromView( iCoddedViewIdx, iCurPoc, false ); 1290 return; 1291 } 1292 m_cCameraData.getNearestBaseView(iCoddedViewIdx, iNearestViewIdx, iRelDistToLeft, bRenderFromLeft); 1293 1294 m_cAvailabilityRenderer.setShiftLUTs( 1295 m_cCameraData.getBaseViewShiftLUTD()[iNearestViewIdx][iCoddedViewIdx], 1296 m_cCameraData.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx], 1297 m_cCameraData.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx], 1298 m_cCameraData.getBaseViewShiftLUTD()[iNearestViewIdx][iCoddedViewIdx],//right 1299 m_cCameraData.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx], 1300 m_cCameraData.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx], 1301 iRelDistToLeft 1302 ); 1303 1304 1305 TComPicYuv* pcPicYuvERView = new TComPicYuv; 1306 pcPicYuvERView->create( m_iSourceWidth, m_iSourceHeight, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); 1307 1308 TComPic* pcPic = xGetPicFromView( iCoddedViewIdx, iCurPoc, bDepth ); 1309 pcPic->addSynthesisBuffer(); 1310 pcPic->addAvailabilityBuffer(); 1311 // usun to i wykorzystaj synteze która robi krzysztof dla glebi - tylko najpierw ja przeson przed kodowanie tekstury //to do 1312 /* 1313 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 1314 if(!bDepth) 1315 { 1316 pcPic->addSynthesisDepthBuffer(); 1317 TComPicYuv* pcPicYuvSynthDepthView = pcPic->getPicYuvSynthDepth(); 1318 m_cAvailabilityRenderer.extrapolateAvailabilityView( xGetPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), xGetPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), pcPicYuvSynthDepthView, pcPic->getPicYuvAvail(), bRenderFromLeft ); 1319 #if POZNAN_OUTPUT_SYNTH 1320 Char acFilenameBaseD[1024]; 1321 //printf("\niNearestViewIdx: %d, iCurPoc: %d, bRenderFromLeft: %s\n", iNearestViewIdx, iCurPoc, (bRenderFromLeft)?"true":"false"); 1322 ::sprintf( acFilenameBaseD, "SynthInputDepth_%s_V%d.yuv", ( false ? "Dec" : "Enc" ),iCoddedViewIdx ); 1323 xGetPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec()->dump(acFilenameBaseD, iCurPoc!=0); 1324 ::sprintf( acFilenameBaseD, "SynthDepth_%s_V%d.yuv", ( false ? "Dec" : "Enc" ),iCoddedViewIdx ); 1325 pcPicYuvSynthDepthView->dump(acFilenameBaseD, iCurPoc!=0); 1326 #endif 1327 } 1328 #endif//*/ 1329 TComPicYuv* pcPicYuvSynthView = pcPic->getPicYuvSynth(); 1330 TComPicYuv* pcPicYuvAvailView = pcPic->getPicYuvAvail(); 1331 1332 //m_cAvailabilityRenderer.extrapolateAvailabilityView( xGetPicFromView( iNearestViewIdx, iCurPoc, false )->getPicYuvRec(), xGetPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), pcPicYuvERView, pcPicYuvAvailView, bRenderFromLeft ); 1333 m_cAvailabilityRenderer.extrapolateAvailabilityView( xGetPicFromView( iNearestViewIdx, iCurPoc, bDepth )->getPicYuvRec(), xGetPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), pcPicYuvSynthView, pcPicYuvAvailView, bRenderFromLeft ); 1334 1335 pcPicYuvAvailView->setBorderExtension( false );//Needed?? 1336 pcPicYuvAvailView->extendPicBorder();//Needed?? 1337 1338 pcPicYuvSynthView->setBorderExtension( false );//Needed?? 1339 pcPicYuvSynthView->extendPicBorder();//Needed?? 1340 1341 //TComPic* pcPicDepth = xGetPicFromView( iCoddedViewIdx, iCurPoc, true ); 1342 //pcPicDepth->addAvailabilityBuffer(); 1343 //pcPicDepth->addSynthesisBuffer(); 1344 //pcPicYuvAvailView->copyToPic(pcPicDepth->getPicYuvAvail()); 1345 1346 #if POZNAN_OUTPUT_AVAILABLE_MAP 1347 { 1348 Char acFilenameBase[1024]; 1349 ::sprintf( acFilenameBase, "Available_%s_%s_V%d.yuv", (bDepth?"Depth":"Tex"),( false ? "Dec" : "Enc" ),iCoddedViewIdx ); 1350 pcPicYuvAvailView->dump(acFilenameBase, iCurPoc!=0); 1351 } 1352 #endif 1353 #if POZNAN_OUTPUT_SYNTH 1354 { 1355 Char acFilenameBase[1024]; 1356 ::sprintf( acFilenameBase, "Synth_%s_%s_V%d.yuv", (bDepth?"Depth":"Tex"),( false ? "Dec" : "Enc" ),iCoddedViewIdx ); 1357 pcPicYuvERView->dump(acFilenameBase, iCurPoc!=0); 1358 } 1359 #endif 1360 1361 //Usun pcPicYuvERView i inne bufforki 1362 } 1363 #endif 1364 1365 //* 1366 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 1367 Void TAppEncTop::xStoreDepthSynthPicsInBuffer(Int iCoddedViewIdx) 1368 { 1369 Int iLeftViewIdx = -1; 1370 Int iRightViewIdx = -1; 1371 Int iNearestViewIdx = -1; 1372 Bool bRenderFromLeft; 1373 1374 Int iCurPoc = m_acTEncTopList[ iCoddedViewIdx ]->getNextFrameId(); 1375 if (!(m_acTEncTopList[ iCoddedViewIdx ]->currentPocWillBeCoded())) return; 1376 1377 Int iRelDistToLeft = 128; 1378 if(iCoddedViewIdx==0) //First on View Coded List 1379 { 1380 //TComPic* pcPic = getPicFromView( iCoddedViewIdx, iCurPoc, false ); 1381 return; 1382 } 1383 iNearestViewIdx = 0; 1384 //bRenderFromLeft = iCoddedViewOrderIdx>0?true:false; 1385 //bRenderFromLeft = iCoddedViewOrderIdx<0?true:false; 1386 //m_cCamParsCollector.getNearestBaseView(iCoddedViewIdx, iNearestViewIdx, iRelDistToLeft, bRenderFromLeft); 1387 bRenderFromLeft = iCoddedViewIdx>1?true:false; 1388 1389 m_cAvailabilityRenderer.setShiftLUTs( 1390 m_cCameraData.getBaseViewShiftLUTD()[iNearestViewIdx][iCoddedViewIdx], 1391 m_cCameraData.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx], 1392 m_cCameraData.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx], 1393 m_cCameraData.getBaseViewShiftLUTD()[iNearestViewIdx][iCoddedViewIdx],//right 1394 m_cCameraData.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx], 1395 m_cCameraData.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx], 1396 iRelDistToLeft 1397 ); 1398 1399 TComPic* pcPic = getPicFromView( iCoddedViewIdx, iCurPoc, false ); 1400 1401 TComPicYuv* pcPicYuvSynthDepthView = pcPic->getPicYuvSynthDepth(); 1402 if(!pcPicYuvSynthDepthView) 1403 { 1404 pcPic->addSynthesisDepthBuffer(); 1405 pcPicYuvSynthDepthView = pcPic->getPicYuvSynthDepth(); 1406 } 1407 1408 Int iWidth = pcPicYuvSynthDepthView->getWidth (); 1409 Int iHeight = pcPicYuvSynthDepthView->getHeight (); 1410 UInt uiMaxCuWidth = pcPicYuvSynthDepthView->getMaxCuWidth (); 1411 UInt uiMaxCuHeight = pcPicYuvSynthDepthView->getMaxCuHeight(); 1412 UInt uiMaxCuDepth = pcPicYuvSynthDepthView->getMaxCuDepth (); 1413 1414 TComPicYuv* pcPicYuvAvailView = new TComPicYuv; 1415 pcPicYuvAvailView->create( iWidth, iHeight, uiMaxCuWidth, uiMaxCuHeight, uiMaxCuDepth ); 1416 1417 m_cAvailabilityRenderer.extrapolateAvailabilityView( getPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), getPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), pcPicYuvSynthDepthView, pcPicYuvAvailView, bRenderFromLeft ); 1418 1419 pcPicYuvAvailView->destroy(); 1420 delete pcPicYuvAvailView; 1421 1422 #if POZNAN_OUTPUT_SYNTH 1423 Char acFilenameBaseD[1024]; 1424 //printf("\niNearestViewIdx: %d, iCurPoc: %d, bRenderFromLeft: %s\n", iNearestViewIdx, iCurPoc, (bRenderFromLeft)?"true":"false"); 1425 ::sprintf( acFilenameBaseD, "SynthInputDepth_%s_V%d.yuv", ( false ? "Dec" : "Enc" ),iCoddedViewIdx ); 1426 getPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec()->dump(acFilenameBaseD, iCurPoc!=0); 1427 ::sprintf( acFilenameBaseD, "SynthDepth_%s_V%d.yuv", ( false ? "Dec" : "Enc" ),iCoddedViewIdx ); 1428 pcPicYuvSynthDepthView->dump(acFilenameBaseD, iCurPoc!=0); 1429 #endif 1430 1431 } 1432 #endif//*/ 1433 1434 1179 1435 #if HHI_INTERVIEW_SKIP 1180 1436 Void TAppEncTop::getUsedPelsMap( Int iViewIdx, Int iPoc, TComPicYuv* pcPicYuvUsedSplsMap ) -
branches/0.3-poznan-univ/source/App/TAppEncoder/TAppEncTop.h
r5 r28 51 51 //GT VSO end 52 52 53 #if POZNAN_MP 54 #include "../../Lib/TLibCommon/TComMP.h" 55 #endif 56 53 57 // ==================================================================================================================== 54 58 // Class definition … … 92 96 #endif 93 97 98 #if POZNAN_SYNTH 99 TRenTop m_cAvailabilityRenderer; 100 #endif 101 102 #if POZNAN_MP 103 TComMP* m_pcMP; 104 #endif 94 105 protected: 95 106 // initialization … … 145 156 #endif 146 157 158 #if POZNAN_MP 159 TComMP* getMP() {return m_pcMP;} 160 #endif 161 147 162 #if HHI_VSO 148 163 private: … … 155 170 #endif 156 171 172 173 #if POZNAN_SYNTH 174 private: 175 Void xStoreSynthPicsInBuffer(Int iCoddedViewIdx, Bool bDepth); 176 #endif 177 178 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 179 private: 180 Void xStoreDepthSynthPicsInBuffer(Int iCoddedViewIdx); 181 #endif 182 157 183 };// END CLASS DEFINITION TAppEncTop 158 184 -
branches/0.3-poznan-univ/source/App/TAppRenderer/TAppRendererCfg.cpp
r5 r28 186 186 { 187 187 m_cCameraData.init( MAX_INPUT_VIEW_NUM, uiInputBitDepth, uiCamParPrecision, (UInt)m_iFrameSkip, (UInt)m_iFramesToBeRendered, 188 m_pchCameraParameterFile, m_pchBaseViewCameraNumbers, NULL, NULL, m_iLog2SamplingFactor+m_iShiftPrecision ); 188 m_pchCameraParameterFile, m_pchBaseViewCameraNumbers, NULL, NULL, m_iLog2SamplingFactor+m_iShiftPrecision 189 #if POZNAN_NONLINEAR_DEPTH 190 ,1.0f 191 #endif 192 ); 189 193 m_iNumberOfInputViews = (Int) m_cCameraData.getBaseViewNumbers() .size(); 190 194 m_iNumberOfOutputViews = m_iNumberOfInputViews - 1; … … 205 209 206 210 m_cCameraData.init( MAX_INPUT_VIEW_NUM, uiInputBitDepth, uiCamParPrecision, (UInt)m_iFrameSkip, (UInt)m_iFramesToBeRendered, 207 m_pchCameraParameterFile, m_pchBaseViewCameraNumbers, NULL, piaTempViews, m_iLog2SamplingFactor+m_iShiftPrecision ); 211 m_pchCameraParameterFile, m_pchBaseViewCameraNumbers, NULL, piaTempViews, m_iLog2SamplingFactor+m_iShiftPrecision 212 #if POZNAN_NONLINEAR_DEPTH 213 , 1.0f 214 #endif 215 ); 208 216 } 209 217 else 210 218 { 211 219 m_cCameraData.init( MAX_INPUT_VIEW_NUM, uiInputBitDepth, uiCamParPrecision, (UInt)m_iFrameSkip, (UInt)m_iFramesToBeRendered, 212 m_pchCameraParameterFile, m_pchBaseViewCameraNumbers, m_pchSynthViewCameraNumbers, NULL, m_iLog2SamplingFactor+m_iShiftPrecision ); 220 m_pchCameraParameterFile, m_pchBaseViewCameraNumbers, m_pchSynthViewCameraNumbers, NULL, m_iLog2SamplingFactor+m_iShiftPrecision 221 #if POZNAN_NONLINEAR_DEPTH 222 ,1.0f 223 #endif 224 ); 213 225 m_iNumberOfOutputViews = (Int) m_cCameraData.getSynthViewNumbers().size(); 214 226 m_iNumberOfInputViews = (Int) m_cCameraData.getBaseViewNumbers() .size(); -
branches/0.3-poznan-univ/source/Lib/TLibCommon/CommonDef.h
r21 r28 138 138 139 139 140 #if ( HHI_INTER_VIEW_MOTION_PRED || HHI_INTER_VIEW_RESIDUAL_PRED )140 #if ( HHI_INTER_VIEW_MOTION_PRED || HHI_INTER_VIEW_RESIDUAL_PRED || POZNAN_MP_USE_DEPTH_MAP_GENERATION) 141 141 #define DEPTH_MAP_GENERATION 1 142 142 #else 143 143 #define DEPTH_MAP_GENERATION 0 144 #endif 145 146 #if POZNAN_NONLINEAR_DEPTH 147 #define POZNAN_LUT_INCREASED_PRECISION 0 // 1 //to do 148 #else 149 #define POZNAN_LUT_INCREASED_PRECISION 0 144 150 #endif 145 151 … … 174 180 #define OUTPUT_RESIDUAL_PICTURES 0 // output residual pictures (for debugging) 175 181 176 #define HHI_MPI_MERGE_POS 0 // position of mvi in merge list (0..5) 177 182 #define HHI_MPI_MERGE_POS 0 // position of mvi in merge list (0..5) 183 184 // ==================================================================================================================== 185 // POZNAN DEFINE SECTION 186 // ==================================================================================================================== 187 #define POZNAN_OUTPUT_AVAILABLE_MAP 0 // output available map (for debugging) 188 #define POZNAN_OUTPUT_SYNTH 0 // output synthesised view (for debugging) 189 190 #if POZNAN_DBMP 191 #define POZNAN_DBMP_MERGE_POS 0 // position of DBMP candidate in merge list for coding (0..6) - overwrites PDM_MERGE_POS settings, is overwritten by HHI_MPI_MERGE_POS settings!!! 192 #endif 193 194 #if POZNAN_NONLINEAR_DEPTH 195 inline UChar quantizeDepthPower(Float fDepthPower) 196 { 197 Int r = (Int) ( (fDepthPower-1.0f)*128.0f + 0.5f); 198 if (r<=0) return 0; 199 if (r>255) r=255; 200 return r; 201 }; 202 203 inline Float dequantizeDepthPower(Int iDepthQuant) 204 { 205 return iDepthQuant/128.0f + 1.0f; 206 }; 207 #endif 178 208 179 209 // ==================================================================================================================== … … 186 216 #define Clip(x) ( Min(g_uiIBDI_MAX, Max( 0, (x)) ) ) ///< clip with bit-depth range 187 217 #define Clip3( MinVal, MaxVal, a) ( ((a)<(MinVal)) ? (MinVal) : (((a)>(MaxVal)) ? (MaxVal) :(a)) ) ///< general min/max clip 188 #define RemoveBitIncrement(x) ( (x + ( (1 << g_uiBitIncrement) >> 1 )) >> g_uiBitIncrement ) ///< Remove Bit increment 218 #define RemoveBitIncrement(x) ( ((x) + ( (1 << g_uiBitIncrement) >> 1 )) >> g_uiBitIncrement ) ///< Remove Bit increment 219 220 #if POZNAN_LUT_INCREASED_PRECISION 221 #define RemoveBitIncrementLUT(x) (x) ///< Remove Bit increment 222 #define SizeOfLUT (256 << g_uiBitIncrement) 223 #else 224 #define SizeOfLUT 256 225 #define RemoveBitIncrementLUT(x) ( ((x) + ( (1 << g_uiBitIncrement) >> 1 )) >> g_uiBitIncrement ) ///< Remove Bit increment 226 #endif 189 227 190 228 #define DATA_ALIGN 1 ///< use 32-bit aligned malloc/free … … 216 254 #define AMVP_MAX_NUM_CANDS 6 ///< max number of final candidates 217 255 // MERGE 256 #if POZNAN_DBMP 257 #define MRG_MAX_NUM_CANDS 7 258 #define POZNAN_DBMP_MRG_CAND MRG_MAX_NUM_CANDS-1 // position of DBMP candidate in merge list (0..6) 259 #else 218 260 #define MRG_MAX_NUM_CANDS 6 261 #endif 219 262 220 263 // Reference memory management -
branches/0.3-poznan-univ/source/Lib/TLibCommon/ContextTables.h
r5 r28 53 53 #define NUM_MERGE_FLAG_EXT_CTX 3 ///< number of context models for merge flag of merge extended 54 54 #define NUM_MERGE_IDX_EXT_CTX 4 ///< number of context models for merge index of merge extended 55 #if POZNAN_DBMP 56 #define NUM_MV_MERGE_IDX_EXT_CTX 6 ///< number of context models for merge index of merge extended 57 #else 55 58 #define NUM_MV_MERGE_IDX_EXT_CTX 5 ///< number of context models for merge index of merge extended 59 #endif 56 60 #define NUM_RES_PRED_FLAG_CTX 3 ///< number of context for residual prediction flag 57 61 -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComDataCU.cpp
r21 r28 187 187 m_acCUMvField[1].create( uiNumPartition ); 188 188 189 #if POZNAN_DBMP_CALC_PRED_DATA 190 m_acCUMvField2nd[0].create( uiNumPartition ); 191 m_acCUMvField2nd[1].create( uiNumPartition ); 192 #endif 193 189 194 #if HHI_DMM_WEDGE_INTRA 190 195 m_puiWedgeFullTabIdx = (UInt*)xMalloc(UInt, uiNumPartition); … … 210 215 m_acCUMvField[0].setNumPartition(uiNumPartition ); 211 216 m_acCUMvField[1].setNumPartition(uiNumPartition ); 217 218 #if POZNAN_DBMP_CALC_PRED_DATA 219 m_acCUMvField2nd[0].setNumPartition(uiNumPartition ); 220 m_acCUMvField2nd[1].setNumPartition(uiNumPartition ); 221 #endif 212 222 } 213 223 … … 296 306 if ( m_piContourPredTexDeltaDC2 ) { xFree(m_piContourPredTexDeltaDC2); m_piContourPredTexDeltaDC2 = NULL; } 297 307 #endif 308 309 #if POZNAN_DBMP_CALC_PRED_DATA 310 m_acCUMvField2nd[0].destroy(); 311 m_acCUMvField2nd[1].destroy(); 312 #endif 313 298 314 } 299 315 … … 388 404 m_acCUMvField[0].clearMvField(); 389 405 m_acCUMvField[1].clearMvField(); 406 407 #if POZNAN_DBMP_CALC_PRED_DATA 408 m_acCUMvField2nd[0].clearMvField(); 409 m_acCUMvField2nd[1].clearMvField(); 410 #endif 390 411 391 412 UInt uiTmp = m_puhWidth[0]*m_puhHeight[0]; … … 508 529 m_acCUMvField[1].clearMvField(); 509 530 531 #if POZNAN_DBMP_CALC_PRED_DATA 532 m_acCUMvField2nd[0].clearMvField(); 533 m_acCUMvField2nd[1].clearMvField(); 534 #endif 535 510 536 #if HHI_DMM_WEDGE_INTRA 511 537 memset( m_puiWedgeFullTabIdx, 0, iSizeInUInt ); … … 617 643 m_uiEntropySliceStartCU = pcCU->getEntropySliceStartCU(); 618 644 645 #if POZNAN_DBMP_CALC_PRED_DATA 646 m_acCUMvField2nd[0].clearMvField(); 647 m_acCUMvField2nd[1].clearMvField(); 648 #endif 649 619 650 #if HHI_DMM_WEDGE_INTRA 620 651 memset( m_puiWedgeFullTabIdx, 0, iSizeInUInt ); … … 719 750 m_acCUMvField[1].setMvdPtr(pcCU->getCUMvField(REF_PIC_LIST_1)->getMvd() + uiPart); 720 751 m_acCUMvField[1].setRefIdxPtr(pcCU->getCUMvField(REF_PIC_LIST_1)->getRefIdx() + uiPart); 752 753 #if POZNAN_DBMP_CALC_PRED_DATA 754 m_acCUMvField2nd[0].setMvPtr(pcCU->getCUMvField2nd(REF_PIC_LIST_0)->getMv() + uiPart); 755 m_acCUMvField2nd[0].setMvdPtr(pcCU->getCUMvField2nd(REF_PIC_LIST_0)->getMvd() + uiPart); 756 m_acCUMvField2nd[0].setRefIdxPtr(pcCU->getCUMvField2nd(REF_PIC_LIST_0)->getRefIdx() + uiPart); 757 m_acCUMvField2nd[1].setMvPtr(pcCU->getCUMvField2nd(REF_PIC_LIST_1)->getMv() + uiPart); 758 m_acCUMvField2nd[1].setMvdPtr(pcCU->getCUMvField2nd(REF_PIC_LIST_1)->getMvd() + uiPart); 759 m_acCUMvField2nd[1].setRefIdxPtr(pcCU->getCUMvField2nd(REF_PIC_LIST_1)->getRefIdx() + uiPart); 760 #endif 761 721 762 m_uiSliceStartCU = pcCU->getSliceStartCU(); 722 763 m_uiEntropySliceStartCU = pcCU->getEntropySliceStartCU(); … … 787 828 m_acCUMvField[eRefPicList].setMvdPtr(pcCU->getCUMvField(eRefPicList)->getMvd() + uiAbsPartIdx); 788 829 m_acCUMvField[eRefPicList].setRefIdxPtr(pcCU->getCUMvField(eRefPicList)->getRefIdx() + uiAbsPartIdx); 830 831 #if POZNAN_DBMP_CALC_PRED_DATA 832 m_acCUMvField2nd[eRefPicList].setMvPtr(pcCU->getCUMvField2nd(eRefPicList)->getMv() + uiAbsPartIdx); 833 m_acCUMvField2nd[eRefPicList].setMvdPtr(pcCU->getCUMvField2nd(eRefPicList)->getMvd() + uiAbsPartIdx); 834 m_acCUMvField2nd[eRefPicList].setRefIdxPtr(pcCU->getCUMvField2nd(eRefPicList)->getRefIdx() + uiAbsPartIdx); 835 #endif 836 789 837 #if HHI_MPI 790 838 m_piTextureModeDepth = pcCU->getTextureModeDepth() + uiAbsPartIdx; … … 857 905 m_acCUMvField[1].copyFrom( pcCU->getCUMvField( REF_PIC_LIST_1 ), pcCU->getTotalNumPart(), uiOffset ); 858 906 907 #if POZNAN_DBMP_CALC_PRED_DATA 908 m_acCUMvField2nd[0].copyFrom( pcCU->getCUMvField2nd( REF_PIC_LIST_0 ), pcCU->getTotalNumPart(), uiOffset ); 909 m_acCUMvField2nd[1].copyFrom( pcCU->getCUMvField2nd( REF_PIC_LIST_1 ), pcCU->getTotalNumPart(), uiOffset ); 910 #endif 911 859 912 UInt uiTmp = g_uiMaxCUWidth*g_uiMaxCUHeight >> (uiDepth<<1); 860 913 UInt uiTmp2 = uiPartUnitIdx*uiTmp; … … 943 996 m_acCUMvField[0].copyTo( rpcCU->getCUMvField( REF_PIC_LIST_0 ), m_uiAbsIdxInLCU ); 944 997 m_acCUMvField[1].copyTo( rpcCU->getCUMvField( REF_PIC_LIST_1 ), m_uiAbsIdxInLCU ); 998 999 #if POZNAN_DBMP_CALC_PRED_DATA 1000 m_acCUMvField2nd[0].copyTo( rpcCU->getCUMvField2nd( REF_PIC_LIST_0 ), m_uiAbsIdxInLCU ); 1001 m_acCUMvField2nd[1].copyTo( rpcCU->getCUMvField2nd( REF_PIC_LIST_1 ), m_uiAbsIdxInLCU ); 1002 #endif 945 1003 946 1004 UInt uiTmp = (g_uiMaxCUWidth*g_uiMaxCUHeight)>>(uhDepth<<1); … … 1030 1088 m_acCUMvField[0].copyTo( rpcCU->getCUMvField( REF_PIC_LIST_0 ), m_uiAbsIdxInLCU, uiPartStart, uiQNumPart ); 1031 1089 m_acCUMvField[1].copyTo( rpcCU->getCUMvField( REF_PIC_LIST_1 ), m_uiAbsIdxInLCU, uiPartStart, uiQNumPart ); 1090 1091 #if POZNAN_DBMP_CALC_PRED_DATA 1092 m_acCUMvField2nd[0].copyTo( rpcCU->getCUMvField2nd( REF_PIC_LIST_0 ), m_uiAbsIdxInLCU, uiPartStart, uiQNumPart ); 1093 m_acCUMvField2nd[1].copyTo( rpcCU->getCUMvField2nd( REF_PIC_LIST_1 ), m_uiAbsIdxInLCU, uiPartStart, uiQNumPart ); 1094 #endif 1032 1095 1033 1096 UInt uiTmp = (g_uiMaxCUWidth*g_uiMaxCUHeight)>>((uhDepth+uiPartDepth)<<1); … … 2697 2760 #endif 2698 2761 2762 #if POZNAN_DBMP 2763 Bool bDBMPMerge = getSlice()->getMP()->isDBMPEnabled(); 2764 UInt uiDBMPAddr = POZNAN_DBMP_MRG_CAND; 2765 #endif 2766 2699 2767 bool abCandIsInter[ MRG_MAX_NUM_CANDS ]; 2700 2768 for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS; ++ui ) … … 2711 2779 pcCULeft = NULL; 2712 2780 } 2713 if( pcCULeft && !pcCULeft->isIntra( uiLeftPartIdx ) ) 2781 if( pcCULeft && !pcCULeft->isIntra( uiLeftPartIdx ) 2782 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 2783 && !pcCULeft->isCUSkiped( uiLeftPartIdx ) 2784 #endif 2785 ) 2714 2786 { 2715 2787 abCandIsInter[uiLeftAddr] = true; … … 2737 2809 pcCUAbove = NULL; 2738 2810 } 2739 if ( pcCUAbove && !pcCUAbove->isIntra( uiAbovePartIdx ) ) 2811 if ( pcCUAbove && !pcCUAbove->isIntra( uiAbovePartIdx ) 2812 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 2813 && !pcCUAbove->isCUSkiped( uiAbovePartIdx ) 2814 #endif 2815 ) 2740 2816 { 2741 2817 abCandIsInter[uiAboveAddr] = true; … … 3183 3259 #endif 3184 3260 3261 #if POZNAN_DBMP 3262 //===== add point-to-point merge with depth maps ===== 3263 if ( bDBMPMerge ) 3264 { 3265 //prediction of motion data for points with disocclusion: 3266 UInt uiRefArrayAddr = uiDBMPAddr; 3267 for(UInt ui=0; ui<MRG_MAX_NUM_CANDS; ui++) if ( ui!=uiDBMPAddr && abCandIsInter[ui] ) {uiRefArrayAddr = ui; break;} 3268 if(uiRefArrayAddr != uiDBMPAddr) 3269 { 3270 puhInterDirNeighbours[uiDBMPAddr] = puhInterDirNeighbours[uiRefArrayAddr]; 3271 pcMvFieldNeighbours[uiDBMPAddr << 1].setMvField(pcMvFieldNeighbours[uiRefArrayAddr << 1].getMv(),pcMvFieldNeighbours[uiRefArrayAddr << 1].getRefIdx()); 3272 pcMvFieldNeighbours[(uiDBMPAddr << 1)+1].setMvField(pcMvFieldNeighbours[(uiRefArrayAddr << 1)+1].getMv(),pcMvFieldNeighbours[(uiRefArrayAddr << 1)+1].getRefIdx()); 3273 } 3274 else 3275 { 3276 TComMv cMVzero; cMVzero.setZero(); 3277 if( getSlice()->isInterB() ) 3278 { 3279 puhInterDirNeighbours[uiDBMPAddr] = 3; 3280 pcMvFieldNeighbours[uiDBMPAddr << 1].setMvField(cMVzero,0); 3281 pcMvFieldNeighbours[(uiDBMPAddr << 1)+1].setMvField(cMVzero,0); 3282 } 3283 else 3284 { 3285 if(getSlice()->getNumRefIdx(REF_PIC_LIST_0)>0) 3286 { 3287 puhInterDirNeighbours[uiDBMPAddr] = 1; 3288 pcMvFieldNeighbours[uiDBMPAddr << 1].setMvField(cMVzero,0); 3289 } 3290 else if(getSlice()->getNumRefIdx(REF_PIC_LIST_1)>0) 3291 { 3292 puhInterDirNeighbours[uiDBMPAddr] = 2; 3293 pcMvFieldNeighbours[(uiDBMPAddr << 1)+1].setMvField(cMVzero,0); 3294 } 3295 else puhInterDirNeighbours[uiDBMPAddr] = 0; 3296 } 3297 } 3298 if(puhInterDirNeighbours[uiDBMPAddr]) 3299 { 3300 abCandIsInter[uiDBMPAddr] = true; 3301 puiNeighbourCandIdx[uiDBMPAddr] = uiDBMPAddr + 1; 3302 } 3303 } 3304 #endif 3305 3185 3306 3186 3307 //===== remove duplicates ===== 3187 3308 for( UInt uiOuter = 0; uiOuter < MRG_MAX_NUM_CANDS; uiOuter++ ) 3188 3309 { 3310 #if POZNAN_DBMP 3311 if(uiOuter==POZNAN_DBMP_MRG_CAND) continue; 3312 #endif 3189 3313 if( abCandIsInter[ uiOuter ] && ( puiNeighbourCandIdx[uiOuter] == uiOuter + 1 ) ) 3190 3314 { 3191 3315 for( UInt uiIter = uiOuter + 1; uiIter < MRG_MAX_NUM_CANDS; uiIter++ ) 3192 3316 { 3317 #if POZNAN_DBMP 3318 if(uiIter==POZNAN_DBMP_MRG_CAND) continue; 3319 #endif 3193 3320 if( abCandIsInter[ uiIter ] ) 3194 3321 { … … 3271 3398 if( uiIter == 0 ) 3272 3399 { 3273 if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) ) 3400 if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) 3401 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 3402 && !pcCorner->isCUSkiped( uiCornerPUIdx ) 3403 #endif 3404 ) 3274 3405 { 3275 3406 rbValidCand = true; … … 3306 3437 else 3307 3438 { 3308 if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) ) 3439 if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) 3440 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 3441 && !pcCorner->isCUSkiped( uiCornerPUIdx ) 3442 #endif 3443 ) 3309 3444 { 3310 3445 rbValidCand = true; … … 4464 4599 return false; 4465 4600 4601 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 4602 if (pColCU->isSkipped(uiPartIdxCenter)) 4603 return false; 4604 #endif 4605 4466 4606 if( m_pcSlice->getRefPic(eRefPicList, iRefIdx)->getViewIdx() != m_pcSlice->getViewIdx() ) 4467 4607 return false; … … 4821 4961 } 4822 4962 #endif 4963 4964 #if POZNAN_DBMP_CALC_PRED_DATA 4965 pcCU->getCUMvField2nd( REF_PIC_LIST_0 )->copyTo( &m_acCUMvField2nd[0], -Int(uiAbsPartIdxSrc) + uiAbsPartIdxDst, uiAbsPartIdxSrc, uiNumPartition ); 4966 pcCU->getCUMvField2nd( REF_PIC_LIST_1 )->copyTo( &m_acCUMvField2nd[1], -Int(uiAbsPartIdxSrc) + uiAbsPartIdxDst, uiAbsPartIdxSrc, uiNumPartition ); 4967 #if HHI_FULL_PEL_DEPTH_MAP_MV_ACC 4968 for( UInt ui = 0; ui < uiNumPartition; ui++ ) 4969 { 4970 m_acCUMvField2nd[0].getMv( uiAbsPartIdxDst + ui ) += TComMv( 2, 2 ); 4971 m_acCUMvField2nd[0].getMv( uiAbsPartIdxDst + ui ) >>= 2; 4972 4973 m_acCUMvField2nd[1].getMv( uiAbsPartIdxDst + ui ) += TComMv( 2, 2 ); 4974 m_acCUMvField2nd[1].getMv( uiAbsPartIdxDst + ui ) >>= 2; 4975 4976 m_acCUMvField2nd[0].getMvd( uiAbsPartIdxDst + ui ) += TComMv( 2, 2 ); 4977 m_acCUMvField2nd[0].getMvd( uiAbsPartIdxDst + ui ) >>= 2; 4978 4979 m_acCUMvField2nd[1].getMvd( uiAbsPartIdxDst + ui ) += TComMv( 2, 2 ); 4980 m_acCUMvField2nd[1].getMvd( uiAbsPartIdxDst + ui ) >>= 2; 4981 } 4982 #endif 4983 #endif 4823 4984 } 4824 4985 #endif … … 4829 4990 riPosY = g_auiRasterToPelY[g_auiZscanToRaster[uiAbsPartIndex]] + getCUPelY(); 4830 4991 } 4992 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 4993 Int TComDataCU::CuQpIncrementFunction(Pel uiBlockMax) 4994 { 4995 if((uiBlockMax >> g_uiBitIncrement) >= 256 || (uiBlockMax >> g_uiBitIncrement) <0) 4996 { 4997 fprintf(stderr, "Bitincrement = %d, uiBlockMax = %d\n", g_uiBitIncrement, uiBlockMax); 4998 exit(333); 4999 } 5000 Float fVal = (Float)((255 - (uiBlockMax >> g_uiBitIncrement)) >> 4); 5001 fVal = (fVal * fVal); 5002 #if POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC 5003 fVal = (Float)( fVal + getPic()->getTexDqpAccordingToDepthOffset() * 32); // add offset, if offset is negative than objects in front will have smaller QP than originaly - quality in front will be increased and in bacground will be decreased 5004 fVal = (Float)( fVal * getPic()->getTexDqpAccordingToDepthMul()); // 5005 #else 5006 fVal = (Float)( fVal + POZNAN_TEXTURE_TU_DELTA_QP_OFFSET * 32); // add offset, if offset is negative objects in front will have smaller QP than in original approach - quality in front will be increased and in bacground will be decreased 5007 fVal = (Float)( fVal * POZNAN_TEXTURE_TU_DELTA_QP_MUL); // 5008 #endif 5009 return (Int)fVal >> 5; 5010 } 5011 Int TComDataCU::getQpOffsetForTextCU(UInt uiPartIdx, Bool bIsIntra) 5012 { 5013 if(!getPic()->getSlice(0)->getSPS()->getUseTexDqpAccordingToDepth()) 5014 { 5015 return 0; 5016 } 5017 if(this->getPic()->getSlice(0)->getSPS()->isDepth()) 5018 { 5019 return 0; 5020 } 5021 #if POZNAN_TEXTURE_TU_DELTA_QP_NOT_IN_BASE_VIEW 5022 //if(!getPic()->getIsSideView()) 5023 if(this->getPic()->getViewIdx() == 0) 5024 { 5025 return 0; 5026 } 5027 #endif 5028 UInt iCuAddr = getAddr(); 5029 //TComPic * pcDepthPic = getPic()->getDepthPic(); 5030 TComPicYuv * pcDepthPicYUV = getPic()->getPicYuvSynthDepth(); 5031 if(pcDepthPicYUV /*pcDepthPic*/ == NULL) 5032 { 5033 char errortext[200]; 5034 sprintf(errortext, "depth map expected"); 5035 fprintf(stderr, "%s\n", errortext); 5036 exit(123); 5037 } 5038 //TComDataCU* rpcCUDepth = pcDepthPic->getCU(iCuAddr); 5039 Pel uiDepthLumaTransformBlockMax; 5040 if(bIsIntra) 5041 { 5042 // in intra block CU each TU block has QP chosen separatly so dQP is calculated for TU 5043 uiDepthLumaTransformBlockMax = getDepthLumaTransformBlockMax( pcDepthPicYUV /*rpcCUDepth*/, iCuAddr, uiPartIdx ); 5044 } 5045 else 5046 { 5047 // in inter block CU all TU block has the same QP so dQP is calculated for CU 5048 uiDepthLumaTransformBlockMax = getDepthLumaCodingBlockMax( pcDepthPicYUV /*rpcCUDepth*/, iCuAddr, uiPartIdx ); 5049 } 5050 #if POZNAN_NONLINEAR_DEPTH 5051 TComNonlinearDepthBackward cNonlinearDepthBwd(getSlice()->getSPS()->getDepthPower(), g_uiBitIncrement, g_uiBitIncrement); 5052 uiDepthLumaTransformBlockMax = (Pel)( cNonlinearDepthBwd(uiDepthLumaTransformBlockMax) + 0.5); 5053 #endif 5054 Int iDeltaQP = CuQpIncrementFunction(uiDepthLumaTransformBlockMax); 5055 #if POZNAN_TEXTURE_TU_DELTA_QP_TOP_BOTTOM_CU_ROW 5056 //Int iMaxCUHeight = this->getPic()->getPicSym()->getMaxCUHeight(); 5057 //Int iPicHeight = this->getPic()->getPicSym()->getPicHeight(); 5058 Int iMaxCUHeight = this->getPic()->getPicYuvRec()->getMaxCuHeight(); 5059 Int iPicHeight = this->getPic()->getPicYuvRec()->getHeight(); 5060 Int iLastPelYInFirstCURow = 0 + iMaxCUHeight; 5061 Int iFirstPelYInLastCURow = iPicHeight - iMaxCUHeight; 5062 Int iCUStartPelY = getCUPelY(); 5063 if((iCUStartPelY <= iLastPelYInFirstCURow) || (iCUStartPelY >= iFirstPelYInLastCURow)) 5064 { 5065 #if POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC 5066 iDeltaQP += getPic()->getTexDqpAccordingToDepthTopBottomRow();// POZNAN_TEXTURE_TU_DELTA_QP_TOP_BOTTOM_CU_ROW; 5067 #else 5068 iDeltaQP += POZNAN_TEXTURE_TU_DELTA_QP_TOP_BOTTOM_ROW_VAL;// POZNAN_TEXTURE_TU_DELTA_QP_TOP_BOTTOM_CU_ROW; 5069 #endif 5070 } 5071 #endif 5072 return iDeltaQP; 5073 } 5074 5075 Int cmpProc(const Void *arg1, const Void *arg2) 5076 { 5077 return *((Pel*)arg2) - *((Pel*)arg1); 5078 } 5079 5080 // Function gets median value of depth block that has the same size and position as texture block that calls this function 5081 Pel TComDataCU::getDepthLumaCodingBlockMedian( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx ) 5082 { 5083 static Pel pSortTable [64 * 64]; 5084 Int CUWidth, CUHeight; 5085 sortDepthLumaCodingBlock( pcDepthPicYUV /*rpcCUDepth*/, iCuAddr, uiPartIdx, pSortTable, CUWidth, CUHeight ); 5086 return pSortTable[(CUHeight * CUWidth) / 2]; 5087 } 5088 5089 // Function gets maximal value of depth block that has the same size and position as texture block that calls this function 5090 Pel TComDataCU::getDepthLumaCodingBlockMax( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx ) 5091 { 5092 return maxDepthLumaCodingBlock( pcDepthPicYUV /*rpcCUDepth*/, iCuAddr, uiPartIdx); 5093 } 5094 Void TComDataCU::sortDepthLumaCodingBlock ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx, Pel * pSortTable, Int& CUWidth, Int& CUHeight ) 5095 { 5096 Int x, y; 5097 UInt uiAbsZorderIdx = getZorderIdxInCU() + uiPartIdx; 5098 // CU size: 5099 CUHeight = getHeight(uiPartIdx); // Size is based on coded texture block size not on depth picture size 5100 CUWidth = getWidth(uiPartIdx); 5101 // uiAbsZorderIdx is z order idx of one particular base block (4x4 pix) in block that we process 5102 // What we need is z-order idx of first Base block (4x4 pix) in this block 5103 Int iNumBase4x4InBlock = (CUWidth >> 2) * (CUHeight >> 2); 5104 5105 UInt uiAbsZorderIdxBlockStart = (uiAbsZorderIdx / iNumBase4x4InBlock) * iNumBase4x4InBlock; 5106 // Address of block 5107 Pel* pPel = pcDepthPicYUV/*rpcCUDepth->getPic()->getPicYuvRec()*/->getLumaAddr ( iCuAddr, uiAbsZorderIdxBlockStart ); 5108 5109 Int p =0; 5110 Int iStride = getPic()->getPicYuvRec()->getStride(); 5111 for ( y = CUHeight - 1; y >= 0; y-- ) 5112 { 5113 for ( x = CUWidth - 1; x >= 0; x-- ) 5114 { 5115 pSortTable[p] = pPel[x]; ++p; 5116 } 5117 pPel += iStride; 5118 } 5119 // sort elements 5120 qsort(pSortTable, CUHeight * CUWidth, sizeof(Pel), cmpProc); 5121 } 5122 5123 Pel TComDataCU::maxDepthLumaCodingBlock ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx) 5124 { 5125 Int x, y; 5126 UInt uiAbsZorderIdx = getZorderIdxInCU() + uiPartIdx; 5127 // CU size: 5128 Int CUHeight = getHeight(uiPartIdx); // Size is based on coded texture block size not on depth picture size 5129 Int CUWidth = getWidth(uiPartIdx); 5130 // uiAbsZorderIdx is z order idx of one particular base block (4x4 pix) in block that we process 5131 // What we need is z-order idx of first Base block (4x4 pix) in this block 5132 Int iNumBase4x4InBlock = (CUWidth >> 2) * (CUHeight >> 2); 5133 5134 UInt uiAbsZorderIdxBlockStart = (uiAbsZorderIdx / iNumBase4x4InBlock) * iNumBase4x4InBlock; 5135 // Address of block 5136 Pel* pPel = pcDepthPicYUV/*rpcCUDepth->getPic()->getPicYuvRec()*/->getLumaAddr ( iCuAddr, uiAbsZorderIdxBlockStart ); 5137 5138 Pel pValue = 0; 5139 Int iStride = getPic()->getPicYuvRec()->getStride(); 5140 for ( y = CUHeight - 1; y >= 0; y-- ) 5141 { 5142 for ( x = CUWidth - 1; x >= 0; x-- ) 5143 { 5144 if (pPel[x]>pValue) pValue = pPel[x]; 5145 } 5146 pPel += iStride; 5147 } 5148 return pValue; 5149 } 5150 5151 // Function gets median value of depth block that has the same size and position as texture block that calls this function 5152 Pel TComDataCU::getDepthLumaTransformBlockMedian( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx ) 5153 { 5154 static Pel pSortTable [64 * 64]; 5155 Int TUWidth, TUHeight; 5156 sortDepthLumaTransformBlock( pcDepthPicYUV/*rpcCUDepth*/, iCuAddr, uiPartIdx, pSortTable, TUWidth, TUHeight ); 5157 return pSortTable[(TUHeight * TUWidth) / 2]; 5158 } 5159 5160 // Function gets maximal value of depth block that has the same size and position as texture block that calls this function 5161 Pel TComDataCU::getDepthLumaTransformBlockMax( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx ) 5162 { 5163 return maxDepthLumaTransformBlock( pcDepthPicYUV/*rpcCUDepth*/, iCuAddr, uiPartIdx ); 5164 } 5165 Void TComDataCU::sortDepthLumaTransformBlock ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx, Pel * pSortTable, Int& TUWidth, Int& TUHeight ) 5166 { 5167 Int x, y; 5168 UInt uiAbsZorderIdx = getZorderIdxInCU() + uiPartIdx; 5169 // CU size: 5170 TUHeight = getHeight(uiPartIdx); // Size is based on coded texture block size not on depth picture size 5171 TUWidth = getWidth(uiPartIdx); 5172 // correct CU size to trnsform size: 5173 if( getTransformIdx(uiPartIdx) ) 5174 { 5175 TUWidth = TUWidth >> 1; 5176 TUHeight = TUHeight >> 1; 5177 } 5178 // uiAbsZorderIdx is z order idx of one particular base block (4x4 pix) in block that we process 5179 // What we need is z-order idx of first Base block (4x4 pix) in this block 5180 Int iNumBase4x4InBlock = (TUWidth >> 2) * (TUHeight >> 2); 5181 5182 UInt uiAbsZorderIdxBlockStart = (uiAbsZorderIdx / iNumBase4x4InBlock) * iNumBase4x4InBlock; 5183 // Address of block 5184 Pel* pPel = pcDepthPicYUV/*rpcCUDepth->getPic()->getPicYuvRec()*/->getLumaAddr ( iCuAddr, uiAbsZorderIdxBlockStart ); 5185 5186 int p = 0; 5187 Int iStride = getPic()->getPicYuvRec()->getStride(); 5188 for ( y = TUHeight - 1; y >= 0; y-- ) 5189 { 5190 for ( x = TUWidth - 1; x >= 0; x-- ) 5191 { 5192 pSortTable[p] = pPel[x]; 5193 } 5194 pPel += iStride; 5195 } 5196 // sort elements 5197 qsort(pSortTable, TUHeight * TUWidth, sizeof(Pel), cmpProc); 5198 } 5199 Pel TComDataCU::maxDepthLumaTransformBlock ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx) 5200 { 5201 Int x, y; 5202 UInt uiAbsZorderIdx = getZorderIdxInCU() + uiPartIdx; 5203 // CU size: 5204 Int TUHeight = getHeight(uiPartIdx); // Size is based on coded texture block size not on depth picture size 5205 Int TUWidth = getWidth(uiPartIdx); 5206 // correct CU size to trnsform size: 5207 if( getTransformIdx(uiPartIdx) ) 5208 { 5209 TUWidth = TUWidth >> 1; 5210 TUHeight = TUHeight >> 1; 5211 } 5212 // uiAbsZorderIdx is z order idx of one particular base block (4x4 pix) in block that we process 5213 // What we need is z-order idx of first Base block (4x4 pix) in this block 5214 Int iNumBase4x4InBlock = (TUWidth >> 2) * (TUHeight >> 2); 5215 5216 UInt uiAbsZorderIdxBlockStart = (uiAbsZorderIdx / iNumBase4x4InBlock) * iNumBase4x4InBlock; 5217 // Address of block 5218 Pel* pPel = pcDepthPicYUV/*rpcCUDepth->getPic()->getPicYuvRec()*/->getLumaAddr ( iCuAddr, uiAbsZorderIdxBlockStart ); 5219 5220 Pel pValue = 0; 5221 Int iStride = getPic()->getPicYuvRec()->getStride(); 5222 for ( y = TUHeight - 1; y >= 0; y-- ) 5223 { 5224 for ( x = TUWidth - 1; x >= 0; x-- ) 5225 { 5226 if (pPel[x]>pValue) pValue = pPel[x]; 5227 } 5228 pPel += iStride; 5229 } 5230 return pValue; 5231 } 5232 // Function gets median value of depth block that has the same size and position as texture block that calls this function 5233 Pel TComDataCU::getDepthLumaPredictionBlockMedian( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx ) 5234 { 5235 static Pel pSortTable [64 * 64]; 5236 Int PUWidth, PUHeight; 5237 sortDepthLumaPredictionBlock( pcDepthPicYUV/*rpcCUDepth*/, iCuAddr, uiPartIdx, pSortTable, PUWidth, PUHeight ); 5238 return pSortTable[(PUHeight * PUWidth) / 2]; 5239 } 5240 5241 // Function gets maximal value of depth block that has the same size and position as texture block that calls this function 5242 Pel TComDataCU::getDepthLumaPredictionBlockMax( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx ) 5243 { 5244 static Pel pSortTable [64 * 64]; 5245 Int PUWidth, PUHeight; 5246 sortDepthLumaPredictionBlock( pcDepthPicYUV/*rpcCUDepth*/, iCuAddr, uiPartIdx, pSortTable, PUWidth, PUHeight ); 5247 return pSortTable[0]; 5248 } 5249 Void TComDataCU::sortDepthLumaPredictionBlock ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx, Pel * pSortTable, Int& PUWidth, Int& PUHeight ) 5250 { 5251 Int x, y; 5252 UInt uiAbsZorderIdx = getZorderIdxInCU() + uiPartIdx; 5253 // CU size: 5254 PUHeight = getHeight(uiPartIdx); // Size is based on coded texture block size not on depth picture size 5255 PUWidth = getWidth(uiPartIdx); 5256 // correct CU size to partition size: 5257 if( getPartitionSize(uiPartIdx) == SIZE_Nx2N || getPartitionSize(uiPartIdx) == SIZE_NxN ) 5258 { 5259 PUWidth = PUWidth >> 1; 5260 } 5261 if( getPartitionSize(uiPartIdx) == SIZE_2NxN || getPartitionSize(uiPartIdx) == SIZE_NxN ) 5262 { 5263 PUHeight = PUHeight >> 1; 5264 } 5265 5266 // uiAbsZorderIdx is z order idx of one particular base block (4x4 pix) in block that we process 5267 // What we need is z-order idx of first Base block (4x4 pix) in this block 5268 Int iNumBase4x4InBlock = (PUWidth >> 2) * (PUHeight >> 2); 5269 if(getPartitionSize(uiPartIdx) == SIZE_Nx2N) 5270 { 5271 iNumBase4x4InBlock = iNumBase4x4InBlock << 1; // KUBA if PU is Nx2N than to count start z-order idx we need to make such trick 5272 } 5273 UInt uiAbsZorderIdxBlockStart = (uiAbsZorderIdx / iNumBase4x4InBlock) * iNumBase4x4InBlock; 5274 // Address of block 5275 Pel* pPel = pcDepthPicYUV/*rpcCUDepth->getPic()->getPicYuvRec()*/->getLumaAddr ( iCuAddr, uiAbsZorderIdxBlockStart ); 5276 5277 UInt uiStride = getPic()->getPicYuvRec()->getStride(); 5278 for ( y = PUHeight - 1; y >= 0; y-- ) 5279 { 5280 for ( x = PUWidth - 1; x >= 0; x-- ) 5281 { 5282 pSortTable[y*PUWidth + x] = pPel[y*uiStride + x]; 5283 } 5284 } 5285 // sort elements 5286 qsort(pSortTable, PUHeight * PUWidth, sizeof(Pel), cmpProc); 5287 } 5288 #endif -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComDataCU.h
r5 r28 105 105 #endif//SNY_DQP 106 106 107 #if POZNAN_DBMP_CALC_PRED_DATA 108 TComCUMvField m_acCUMvField2nd[2]; ///< array of motion vectors selected for points with no MP prediction available 109 #endif 110 107 111 // ------------------------------------------------------------------------------------------------------------------- 108 112 // neighbour access variables … … 310 314 #endif 311 315 316 #if POZNAN_DBMP_CALC_PRED_DATA 317 TComCUMvField* getCUMvField2nd ( RefPicList e ) { return &m_acCUMvField2nd[e]; } 318 #endif 319 312 320 // ------------------------------------------------------------------------------------------------------------------- 313 321 // member functions for coding tool information … … 529 537 Bool isIntra ( UInt uiPartIdx ) { return m_pePredMode[ uiPartIdx ] == MODE_INTRA; } 530 538 Bool isSkipped ( UInt uiPartIdx ); ///< SKIP (no residual) 539 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 540 Bool isCUSkiped( UInt uiPartIdx ) { return m_pePredMode[ uiPartIdx ] == MODE_SYNTH; } 541 #endif 531 542 532 543 // ------------------------------------------------------------------------------------------------------------------- … … 585 596 #endif //QC_MDCS 586 597 598 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 599 Int CuQpIncrementFunction ( Pel uiBlockMax ); 600 Int getQpOffsetForTextCU ( UInt uiPartIdx, Bool bIsIntra ); 601 Pel getDepthLumaCodingBlockMedian ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx ); 602 Pel getDepthLumaCodingBlockMax ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx ); 603 Void sortDepthLumaCodingBlock ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx, Pel * pSortTable, Int& TUWidth, Int& TUHeight); 604 Pel maxDepthLumaCodingBlock ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx ); 605 Pel getDepthLumaTransformBlockMedian ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx ); 606 Pel getDepthLumaTransformBlockMax ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx ); 607 Void sortDepthLumaTransformBlock ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx , Pel * pSortTable, Int& TUWidth, Int& TUHeight); 608 Pel maxDepthLumaTransformBlock ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx ); 609 Pel getDepthLumaPredictionBlockMedian( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx ); 610 Pel getDepthLumaPredictionBlockMax ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx ); 611 Void sortDepthLumaPredictionBlock ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx , Pel * pSortTable, Int& PUWidth, Int& PUHeight); 612 #endif 587 613 }; 588 614 -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComDepthMapGenerator.cpp
r21 r28 985 985 xInterPredictCUDepthMap( pcSubCU, pcSubDM ); 986 986 break; 987 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 988 case MODE_SYNTH: 989 //What to do? Need Fix! 990 xIntraPredictCUDepthMap( pcSubCU, pcSubDM ); 991 break; 992 #endif 987 993 default: 988 994 AOT( true ); -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComLoopFilter.cpp
r5 r28 444 444 445 445 //-- Set BS for Intra MB : BS = 4 or 3 446 if ( pcCUP->isIntra(uiPartP) || pcCUQ->isIntra(uiPartQ) ) 446 if ( pcCUP->isIntra(uiPartP) || pcCUQ->isIntra(uiPartQ) 447 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 448 || pcCUP->isCUSkiped(uiPartP) || pcCUQ->isCUSkiped(uiPartQ) 449 #endif 450 ) 447 451 { 448 452 uiBs = bAtCUBoundary ? 4 : 3; // Intra MB && MB boundary … … 450 454 451 455 //-- Set BS for not Intra MB : BS = 2 or 1 or 0 452 if ( !pcCUP->isIntra(uiPartP) && !pcCUQ->isIntra(uiPartQ) ) 456 if ( !pcCUP->isIntra(uiPartP) && !pcCUQ->isIntra(uiPartQ) 457 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 458 && !pcCUP->isCUSkiped(uiPartP) && !pcCUQ->isCUSkiped(uiPartQ) 459 #endif 460 ) 453 461 { 454 462 if ( pcCUQ->getCbf( uiPartQ, TEXT_LUMA, pcCUQ->getTransformIdx(uiPartQ)) != 0 || pcCUP->getCbf( uiPartP, TEXT_LUMA, pcCUP->getTransformIdx(uiPartP) ) != 0) … … 528 536 } // enf of "if( not Intra )" 529 537 538 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU //if one of the block is CUSkipped dont use loop filter 539 if ( pcCUP->isCUSkiped(uiPartP) || pcCUQ->isCUSkiped(uiPartQ)) 540 { 541 uiBs = 0; 542 } 543 #endif 544 530 545 m_aapucBS[iDir][0][uiAbsPartIdx] = uiBs; 531 546 if ( bAtCUBoundary || bAtCUHalf ) -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComPic.cpp
r21 r28 50 50 m_apcPicYuv[0] = NULL; 51 51 m_apcPicYuv[1] = NULL; 52 #if POZNAN_AVAIL_MAP 53 m_apcPicYuvAvail = NULL; 54 #endif 55 #if POZNAN_SYNTH_VIEW 56 m_apcPicYuvSynth = NULL; 57 #endif 58 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 59 m_apcPicYuvSynthDepth= NULL; 60 #endif 52 61 #if DEPTH_MAP_GENERATION 53 62 m_pcPredDepthMap = NULL; … … 118 127 m_apcPicYuv[1] = NULL; 119 128 } 129 #if POZNAN_AVAIL_MAP 130 if (m_apcPicYuvAvail) 131 { 132 m_apcPicYuvAvail->destroy(); 133 delete m_apcPicYuvAvail; 134 m_apcPicYuvAvail = NULL; 135 } 136 #endif 137 138 #if POZNAN_SYNTH_VIEW 139 if (m_apcPicYuvSynth) 140 { 141 m_apcPicYuvSynth->destroy(); 142 delete m_apcPicYuvSynth; 143 m_apcPicYuvSynth = NULL; 144 } 145 #endif 146 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 147 if (m_apcPicYuvSynthDepth) 148 { 149 m_apcPicYuvSynthDepth->destroy(); 150 delete m_apcPicYuvSynthDepth; 151 m_apcPicYuvSynthDepth = NULL; 152 } 153 #endif 120 154 121 155 #if DEPTH_MAP_GENERATION … … 195 229 } 196 230 231 #if POZNAN_AVAIL_MAP 232 Void 233 TComPic::addAvailabilityBuffer() 234 { 235 AOT( m_apcPicYuvAvail ); 236 AOF( m_apcPicYuv[1] ); 237 Int iWidth = m_apcPicYuv[1]->getWidth (); 238 Int iHeight = m_apcPicYuv[1]->getHeight (); 239 UInt uiMaxCuWidth = m_apcPicYuv[1]->getMaxCuWidth (); 240 UInt uiMaxCuHeight = m_apcPicYuv[1]->getMaxCuHeight(); 241 UInt uiMaxCuDepth = m_apcPicYuv[1]->getMaxCuDepth (); 242 m_apcPicYuvAvail = new TComPicYuv; 243 m_apcPicYuvAvail ->create( iWidth, iHeight, uiMaxCuWidth, uiMaxCuHeight, uiMaxCuDepth ); 244 } 245 #endif 246 247 #if POZNAN_SYNTH_VIEW 248 Void 249 TComPic::addSynthesisBuffer() 250 { 251 AOT( m_apcPicYuvSynth ); 252 AOF( m_apcPicYuv[1] ); 253 Int iWidth = m_apcPicYuv[1]->getWidth (); 254 Int iHeight = m_apcPicYuv[1]->getHeight (); 255 UInt uiMaxCuWidth = m_apcPicYuv[1]->getMaxCuWidth (); 256 UInt uiMaxCuHeight = m_apcPicYuv[1]->getMaxCuHeight(); 257 UInt uiMaxCuDepth = m_apcPicYuv[1]->getMaxCuDepth (); 258 m_apcPicYuvSynth = new TComPicYuv; 259 m_apcPicYuvSynth ->create( iWidth, iHeight, uiMaxCuWidth, uiMaxCuHeight, uiMaxCuDepth ); 260 } 261 #endif 262 263 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 264 Void 265 TComPic::addSynthesisDepthBuffer() 266 { 267 AOT( m_apcPicYuvSynthDepth ); 268 AOF( m_apcPicYuv[1] ); 269 Int iWidth = m_apcPicYuv[1]->getWidth (); 270 Int iHeight = m_apcPicYuv[1]->getHeight (); 271 UInt uiMaxCuWidth = m_apcPicYuv[1]->getMaxCuWidth (); 272 UInt uiMaxCuHeight = m_apcPicYuv[1]->getMaxCuHeight(); 273 UInt uiMaxCuDepth = m_apcPicYuv[1]->getMaxCuDepth (); 274 m_apcPicYuvSynthDepth = new TComPicYuv; 275 m_apcPicYuvSynthDepth ->create( iWidth, iHeight, uiMaxCuWidth, uiMaxCuHeight, uiMaxCuDepth ); 276 } 277 #endif 278 197 279 #if PARALLEL_MERGED_DEBLK 198 280 Void … … 286 368 } 287 369 370 #if POZNAN_AVAIL_MAP 371 Void 372 TComPic::removeAvailabilityBuffer() 373 { 374 if( m_apcPicYuvAvail ) 375 { 376 m_apcPicYuvAvail->destroy(); 377 delete m_apcPicYuvAvail; 378 m_apcPicYuvAvail = NULL; 379 } 380 } 381 #endif 382 383 #if POZNAN_SYNTH_VIEW 384 Void 385 TComPic::removeSynthesisBuffer() 386 { 387 if( m_apcPicYuvSynth ) 388 { 389 m_apcPicYuvSynth->destroy(); 390 delete m_apcPicYuvSynth; 391 m_apcPicYuvSynth = NULL; 392 } 393 } 394 #endif 395 396 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 397 Void 398 TComPic::removeSynthesisDepthBuffer() 399 { 400 if( m_apcPicYuvSynthDepth ) 401 { 402 m_apcPicYuvSynthDepth->destroy(); 403 delete m_apcPicYuvSynthDepth; 404 m_apcPicYuvSynthDepth = NULL; 405 } 406 } 407 #endif 408 288 409 #if PARALLEL_MERGED_DEBLK 289 410 Void … … 351 472 #endif 352 473 474 #if POZNAN_AVAIL_MAP 475 Void TComPic::checkSynthesisAvailability( TComDataCU*& rpcCU, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth, Bool *&rpbCUSynthesied ) 476 { 477 rpbCUSynthesied[0] = true; 478 rpbCUSynthesied[1] = true; 479 rpbCUSynthesied[2] = true; 480 rpbCUSynthesied[3] = true; 481 482 if (!getPicYuvAvail()) 483 { 484 rpbCUSynthesied[0] = false; 485 rpbCUSynthesied[1] = false; 486 rpbCUSynthesied[2] = false; 487 rpbCUSynthesied[3] = false; 488 return; 489 } 490 491 Int x, y; 492 Bool bAvailable = true; 493 Pel* pAvail = getPicYuvAvail()->getLumaAddr ( iCuAddr, uiAbsZorderIdx ); 494 Int CUHeight = g_uiMaxCUHeight >> uiPartDepth; //rpcCU->getHeight(uiAbsZorderIdx); 495 Int CUWidth = g_uiMaxCUWidth >> uiPartDepth; //rpcCU->getWidth(uiAbsZorderIdx); 496 497 Int iStride = getPicYuvAvail()->getStride(); 498 for ( y = ((CUHeight - 1) >> 1); y >= 0; y-- ) 499 { 500 for ( x = ((CUWidth - 1) >> 1); x >= 0; x-- ) 501 { 502 rpbCUSynthesied[0] &= (pAvail[x] != 0); 503 } 504 for ( x = CUWidth - 1; x >= ((CUWidth) >> 1); x-- ) 505 { 506 rpbCUSynthesied[1] &= (pAvail[x] != 0); 507 } 508 pAvail += iStride; 509 } 510 //for ( y = CUHeight - 1; y >= ((CUHeight) >> 1); y-- ) 511 for ( y = ((CUHeight - 1) >> 1); y >= 0; y-- ) //Owieczka 512 { 513 for ( x = ((CUWidth - 1) >> 1); x >= 0; x-- ) 514 { 515 rpbCUSynthesied[2] &= (pAvail[x] != 0); 516 } 517 for ( x = CUWidth - 1; x >= ((CUWidth) >> 1); x-- ) 518 { 519 rpbCUSynthesied[3] &= (pAvail[x] != 0); 520 } 521 pAvail += iStride; 522 } 523 524 //rpbCUSynthesied[0] = !rpbCUSynthesied[0]; 525 //rpbCUSynthesied[1] = !rpbCUSynthesied[1]; 526 //rpbCUSynthesied[2] = !rpbCUSynthesied[2]; 527 //rpbCUSynthesied[3] = !rpbCUSynthesied[3]; 528 } 529 #endif -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComPic.h
r21 r28 61 61 62 62 TComPicYuv* m_apcPicYuv[2]; // Texture, 0:org / 1:rec 63 64 #if POZNAN_AVAIL_MAP 65 TComPicYuv* m_apcPicYuvAvail; // Availability Map - Does the given pixel can be synthesised in receiver 66 #endif 67 68 #if POZNAN_SYNTH_VIEW 69 TComPicYuv* m_apcPicYuvSynth; // Sythesied image 70 #endif 71 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 72 TComPicYuv* m_apcPicYuvSynthDepth; // Sythesied depth image 73 #endif 74 63 75 #if DEPTH_MAP_GENERATION 64 76 TComPicYuv* m_pcPredDepthMap; // estimated depth map … … 101 113 #if HHI_INTERVIEW_SKIP 102 114 TComPicYuv* m_pcUsedPelsMap; 115 #endif 116 #if POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC 117 Double m_dTexDqpAccordingToDepthOffset; 118 Double m_dTexDqpAccordingToDepthMul; 119 Int m_iTexDqpAccordingToDepthTopBottomRow; 103 120 #endif 104 121 … … 129 146 TComPicYuv* getPicYuvOrg() { return m_apcPicYuv[0]; } 130 147 TComPicYuv* getPicYuvRec() { return m_apcPicYuv[1]; } 148 149 #if POZNAN_AVAIL_MAP 150 TComPicYuv* getPicYuvAvail() { return m_apcPicYuvAvail; } //Owieczka - returns available map from other pic image 151 #endif 152 153 #if POZNAN_SYNTH_VIEW 154 TComPicYuv* getPicYuvSynth() { return m_apcPicYuvSynth; } //Owieczka - returns synth form other pic in image 155 #endif 156 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 157 TComPicYuv* getPicYuvSynthDepth() { return m_apcPicYuvSynthDepth; }; // Sythesied depth image 158 #endif 131 159 132 160 #if DEPTH_MAP_GENERATION … … 203 231 204 232 Void addOriginalBuffer (); 233 #if POZNAN_AVAIL_MAP 234 Void addAvailabilityBuffer (); 235 #endif 236 #if POZNAN_SYNTH_VIEW 237 Void addSynthesisBuffer (); 238 #endif 239 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 240 Void addSynthesisDepthBuffer (); 241 #endif 205 242 #if PARALLEL_MERGED_DEBLK 206 243 Void addDeblockBuffer (); … … 221 258 222 259 Void removeOriginalBuffer (); 260 #if POZNAN_SYNTH_VIEW 261 Void removeSynthesisBuffer (); 262 #endif 263 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 264 Void removeSynthesisDepthBuffer (); 265 #endif 266 #if POZNAN_AVAIL_MAP 267 Void removeAvailabilityBuffer(); 268 #endif 223 269 #if PARALLEL_MERGED_DEBLK 224 270 Void removeDeblockBuffer (); … … 235 281 #if HHI_INTERVIEW_SKIP 236 282 Void removeUsedPelsMapBuffer (); 283 #endif 284 285 #if POZNAN_AVAIL_MAP 286 Void checkSynthesisAvailability( TComDataCU*& rpcBestCU, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth, Bool *&rpbCUSynthesied); 237 287 #endif 238 288 … … 254 304 const SEImessages* getSEIs() const { return m_SEIs; } 255 305 306 #if POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC 307 Double getTexDqpAccordingToDepthOffset( ) { return m_dTexDqpAccordingToDepthOffset;} 308 Double getTexDqpAccordingToDepthMul( ) { return m_dTexDqpAccordingToDepthMul;} 309 Int getTexDqpAccordingToDepthTopBottomRow( ){ return m_iTexDqpAccordingToDepthTopBottomRow;} 310 Void setTexDqpAccordingToDepthOffset ( Double dTexDqpAccordingToDepthOffset ){ m_dTextureCuDeltaQpOffset = dTexDqpAccordingToDepthOffset; } 311 Void setTexDqpAccordingToDepthMul ( Double dTexDqpAccordingToDepthMul ){ m_dTexDqpAccordingToDepthMul = dTexDqpAccordingToDepthMul; } 312 Void setTexDqpAccordingToDepthTopBottomRow( Int iTexDqpAccordingToDepthTopBottomRow ){ m_iTexDqpAccordingToDepthTopBottomRow = iTexDqpAccordingToDepthTopBottomRow; } 313 #endif 256 314 };// END CLASS DEFINITION TComPic 257 315 -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComPicSym.h
r5 r28 43 43 44 44 // Include files 45 #if POZNAN_MP 46 #include "../TLibCommon/TComMP.h" 47 #endif 48 45 49 #include "CommonDef.h" 46 50 #include "TComSlice.h" -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComPicYuv.cpp
r17 r28 8 8 #include <assert.h> 9 9 #include <memory.h> 10 #include <math.h> 10 11 11 12 #ifdef __APPLE__ … … 455 456 } 456 457 } 458 #if POZNAN_NONLINEAR_DEPTH 459 Void TComPicYuv::nonlinearDepthForward(TComPicYuv *pcPicDst, Float p) 460 { 461 Int x,y; 462 TComNonlinearDepthForward cNonlinearDepthFwd(p, g_uiBitIncrement, g_uiBitIncrement); 463 464 // Luma 465 Pel* pPelSrc = getLumaAddr(); 466 Pel* pPelDst = pcPicDst->getLumaAddr(); 467 for(y=0; y<m_iPicHeight; y++) 468 { 469 for(x=0; x<m_iPicWidth; x++) 470 { 471 pPelDst[x] = (Pel)( cNonlinearDepthFwd(pPelSrc[x]) + 0.5); 472 } 473 pPelDst += pcPicDst->getStride(); 474 pPelSrc += getStride(); 475 } 476 // Chroma 477 copyToPicCb(pcPicDst); 478 copyToPicCr(pcPicDst); 479 } 480 Void TComPicYuv::nonlinearDepthBackward(TComPicYuv *pcPicDst, Float p) 481 { 482 Int x,y; 483 TComNonlinearDepthBackward cNonlinearDepthBwd(p, g_uiBitIncrement, g_uiBitIncrement); 484 485 // Luma 486 Pel* pPelSrc = getLumaAddr(); 487 Pel* pPelDst = pcPicDst->getLumaAddr(); 488 for(y=0; y<m_iPicHeight; y++) 489 { 490 for(x=0; x<m_iPicWidth; x++) 491 { 492 pPelDst[x] = (Pel)( cNonlinearDepthBwd(pPelSrc[x]) + 0.5); 493 } 494 pPelDst += pcPicDst->getStride(); 495 pPelSrc += getStride(); 496 } 497 // Chroma 498 copyToPicCb(pcPicDst); 499 copyToPicCr(pcPicDst); 500 } 501 #endif -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComPicYuv.h
r5 r28 44 44 #include "CommonDef.h" 45 45 46 #if POZNAN_NONLINEAR_DEPTH 47 48 #include <math.h> 49 50 class TComNonlinearDepthForward // OLGIERD - Z-NL-Power conversion 51 { 52 private: 53 Double m_fMul; 54 Float m_fPower; 55 56 public: 57 58 TComNonlinearDepthForward(Float fPower, Int iInputBitIncrement, Int iOutputBitIncrement) 59 { 60 m_fPower = fPower; 61 Double fPostMul = (1<<(8+iOutputBitIncrement))-1; // OLGIERD ToDo - should be or not? 62 Double fPreMul = 1.0/((1<<(8+iInputBitIncrement))-1); 63 m_fMul = fPostMul*pow(fPreMul,(Double)fPower); 64 }; 65 66 inline Double operator() (Double Value) 67 { 68 if (Value<0) return -pow( -Value,(Double)m_fPower)*m_fMul; 69 return pow(Value,(Double)m_fPower)*m_fMul; 70 }; 71 }; 72 73 class TComNonlinearDepthBackward // OLGIERD - Z-NL-Power conversion 74 { 75 private: 76 Double m_fMul; 77 Float m_fPower; 78 79 public: 80 81 TComNonlinearDepthBackward(Float fPower, Int iInputBitIncrement, Int iOutputBitIncrement) 82 { 83 m_fPower = fPower = 1.0/fPower; 84 Double fPostMul = (1<<(8+iOutputBitIncrement))-1; // OLGIERD ToDo - should be or not? 85 Double fPreMul = 1.0/((1<<(8+iInputBitIncrement))-1); 86 m_fMul = fPostMul*pow(fPreMul,(Double)fPower); 87 }; 88 89 inline Double operator() (Double Value) 90 { 91 if (Value<0) return -pow( -Value,(Double)m_fPower)*m_fMul; 92 return pow(Value,(Double)m_fPower)*m_fMul; 93 }; 94 }; 95 #endif 46 96 // ==================================================================================================================== 47 97 // Class definition … … 175 225 Void setChromaTo ( Pel pVal ); 176 226 227 #if POZNAN_NONLINEAR_DEPTH 228 Void nonlinearDepthForward(TComPicYuv *pcPicDst, Float p); 229 Void nonlinearDepthBackward(TComPicYuv *pcPicDst, Float p); 230 #endif 177 231 };// END CLASS DEFINITION TComPicYuv 178 232 -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComPrediction.cpp
r21 r28 1521 1521 pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight ); 1522 1522 1523 #if POZNAN_DBMP 1524 if(pcCU->getMergeIndex(uiPartAddr)==POZNAN_DBMP_MRG_CAND) 1525 { 1526 #if DEPTH_MAP_GENERATION 1527 motionCompensation_DBMP( pcCU, pcYuvPred, eRefPicList, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY ); 1528 #else 1529 motionCompensation_DBMP( pcCU, pcYuvPred, eRefPicList, iPartIdx ); 1530 #endif 1531 return; 1532 } 1533 #endif 1534 1523 1535 #if DEPTH_MAP_GENERATION 1524 1536 if( bPrdDepthMap ) … … 1558 1570 pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight ); 1559 1571 1572 #if POZNAN_DBMP 1573 if(pcCU->getMergeIndex(uiPartAddr)==POZNAN_DBMP_MRG_CAND) 1574 { 1575 #if DEPTH_MAP_GENERATION 1576 motionCompensation_DBMP( pcCU, pcYuvPred, eRefPicList, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY ); 1577 #else 1578 motionCompensation_DBMP( pcCU, pcYuvPred, eRefPicList, iPartIdx ); 1579 #endif 1580 continue; 1581 } 1582 #endif 1583 1560 1584 #if DEPTH_MAP_GENERATION 1561 1585 if( bPrdDepthMap ) … … 1591 1615 return; 1592 1616 } 1617 1618 #if POZNAN_DBMP 1619 #if DEPTH_MAP_GENERATION 1620 Void TComPrediction::motionCompensation_DBMP ( TComDataCU* pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX, UInt uiSubSampExpY ) 1621 #else 1622 Void TComPrediction::motionCompensation_DBMP ( TComDataCU* pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList, Int iPartIdx ) 1623 #endif 1624 { 1625 if(!pcCU->getSlice()->getMP()->isDBMPEnabled()) return; 1626 1627 Int iPartIdxOrg = iPartIdx; 1628 Int iWidth; 1629 Int iHeight; 1630 UInt uiPartAddr; 1631 1632 Int x,y; 1633 Int px,py,iCUBaseX,iCUBaseY; 1634 Int ref_frame0, ref_frame1; 1635 Int ref_frame0_idx, ref_frame1_idx; 1636 TComMv mv0,mv1; 1637 1638 Int ref_frame0_idx_2nd, ref_frame1_idx_2nd; 1639 TComMv mv0_2nd,mv1_2nd; 1640 1641 Pel* piDstCb; 1642 Pel* piDstCr; 1643 Pel aiUTab[MAX_CU_SIZE]; 1644 Pel aiVTab[MAX_CU_SIZE]; 1645 Pel iULast; 1646 Pel iVLast; 1647 Pel iTemp; 1648 1649 TComMP* pcMP = pcCU->getSlice()->getMP(); 1650 UInt uiViewId = pcCU->getSlice()->getSPS()->getViewId(); 1651 Bool bIsDepth = pcCU->getSlice()->getSPS()->isDepth(); 1652 1653 #if POZNAN_DBMP_CALC_PRED_DATA 1654 UInt uiPointCnt; 1655 #endif 1656 1657 for ( iPartIdx = 0; iPartIdx < pcCU->getNumPartInter(); iPartIdx++ ) 1658 { 1659 if ( iPartIdxOrg >= 0 ) iPartIdx = iPartIdxOrg; 1660 1661 pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight ); 1662 1663 //get motion data used for no-MP predicted points 1664 #if POZNAN_DBMP_CALC_PRED_DATA 1665 ref_frame0_idx_2nd = pcCU->getCUMvField2nd(REF_PIC_LIST_0)->getRefIdx(uiPartAddr); 1666 mv0_2nd = pcCU->getCUMvField2nd( REF_PIC_LIST_0 )->getMv( uiPartAddr ); 1667 1668 ref_frame1_idx_2nd = pcCU->getCUMvField2nd(REF_PIC_LIST_1)->getRefIdx(uiPartAddr); 1669 mv1_2nd = pcCU->getCUMvField2nd( REF_PIC_LIST_1 )->getMv( uiPartAddr ); 1670 #else 1671 ref_frame0_idx_2nd = pcCU->getCUMvField(REF_PIC_LIST_0)->getRefIdx(uiPartAddr); 1672 mv0_2nd = pcCU->getCUMvField( REF_PIC_LIST_0 )->getMv( uiPartAddr ); 1673 1674 ref_frame1_idx_2nd = pcCU->getCUMvField(REF_PIC_LIST_1)->getRefIdx(uiPartAddr); 1675 mv1_2nd = pcCU->getCUMvField( REF_PIC_LIST_1 )->getMv( uiPartAddr ); 1676 #endif 1677 1678 iCUBaseX = pcCU->getCUPelX()+g_auiRasterToPelX[ g_auiZscanToRaster[uiPartAddr] ]; 1679 iCUBaseY = pcCU->getCUPelY()+g_auiRasterToPelY[ g_auiZscanToRaster[uiPartAddr] ]; 1680 1681 #if DEPTH_MAP_GENERATION 1682 if( bPrdDepthMap ) 1683 { 1684 iWidth >>= uiSubSampExpX; 1685 iHeight >>= uiSubSampExpY; 1686 } 1687 #endif 1688 1689 #if POZNAN_DBMP_CALC_PRED_DATA 1690 uiPointCnt = 0; 1691 #endif 1692 1693 for( py = 0; py < iHeight; py++) 1694 { 1695 for( px = 0; px < iWidth; px++) 1696 { 1697 #if DEPTH_MAP_GENERATION 1698 if( bPrdDepthMap ) 1699 { 1700 x = iCUBaseX+(px<<uiSubSampExpX); 1701 y = iCUBaseY+(py<<uiSubSampExpY); 1702 } 1703 else 1704 #endif 1705 { 1706 x = iCUBaseX+px; 1707 y = iCUBaseY+py; 1708 } 1709 1710 pcMP->getDBMPPredData(pcCU, x, y, ref_frame0, ref_frame0_idx, mv0, ref_frame0_idx_2nd, mv0_2nd, 1711 ref_frame1, ref_frame1_idx, mv1, ref_frame1_idx_2nd, mv1_2nd); 1712 1713 pcCU->getCUMvField(REF_PIC_LIST_0)->setRefIdx(ref_frame0_idx, uiPartAddr); 1714 pcCU->getCUMvField( REF_PIC_LIST_0 )->setMv( mv0, uiPartAddr ); 1715 1716 pcCU->getCUMvField(REF_PIC_LIST_1)->setRefIdx(ref_frame1_idx, uiPartAddr); 1717 pcCU->getCUMvField( REF_PIC_LIST_1 )->setMv( mv1, uiPartAddr ); 1718 1719 if ( eRefPicList != REF_PIC_LIST_X ) 1720 { 1721 #if DEPTH_MAP_GENERATION 1722 xPredInterUni_DBMP (pcCU, uiPartAddr, px, py, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY ); 1723 #else 1724 xPredInterUni_DBMP (pcCU, uiPartAddr, px, py, eRefPicList, pcYuvPred, iPartIdx ); 1725 #endif 1726 #ifdef WEIGHT_PRED 1727 if ( pcCU->getSlice()->getPPS()->getUseWP() ) 1728 { 1729 xWeightedPredictionUni_DBMP( pcCU, pcYuvPred, uiPartAddr, px, py, eRefPicList, pcYuvPred, iPartIdx ); 1730 } 1731 #endif 1732 } 1733 else 1734 { 1735 #if DEPTH_MAP_GENERATION 1736 xPredInterBi_DBMP (pcCU, uiPartAddr, px, py, uiSubSampExpX, uiSubSampExpY, pcYuvPred, iPartIdx, bPrdDepthMap ); 1737 #else 1738 xPredInterBi_DBMP (pcCU, uiPartAddr, px, py, pcYuvPred, iPartIdx ); 1739 #endif 1740 } 1741 1742 if(!pcCU->getSlice()->getSPS()->isDepth()) // Chroma check only for non depth 1743 { 1744 piDstCb = pcYuvPred->getCbAddr( uiPartAddr ) + (py>>1)*pcYuvPred->getCStride(); 1745 piDstCr = pcYuvPred->getCrAddr( uiPartAddr ) + (py>>1)*pcYuvPred->getCStride(); 1746 1747 //Chroma decimation 16x16 -> 8x8: 1748 if(py%2 && px%2) 1749 { 1750 iTemp = (aiUTab[px-1] + aiUTab[px] + iULast + piDstCb[px>>1] + 2)>>2; 1751 aiUTab[px-1] = iULast; 1752 iULast = piDstCb[px>>1]; 1753 piDstCb[px>>1] = iTemp; 1754 1755 iTemp = (aiVTab[px-1] + aiVTab[px] + iVLast + piDstCr[px>>1] + 2)>>2; 1756 aiVTab[px-1] = iVLast; 1757 iVLast = piDstCr[px>>1]; 1758 piDstCr[px>>1] = iTemp; 1759 } 1760 else 1761 { 1762 aiUTab[(px==0)? iWidth-1 : (px-1)] = iULast; 1763 iULast = piDstCb[px>>1]; 1764 1765 aiVTab[(px==0)? iWidth-1 : (px-1)] = iVLast; 1766 iVLast = piDstCr[px>>1]; 1767 } 1768 } 1769 1770 #if !POZNAN_DBMP_COMPRESS_ME_DATA 1771 //save motion data for every CU point 1772 #if DEPTH_MAP_GENERATION 1773 if( !bPrdDepthMap ) 1774 #endif 1775 { 1776 pcMP->setL0RefPOC(uiViewId,bIsDepth,x,y,ref_frame0); 1777 pcMP->setL0MvX(uiViewId,bIsDepth,x,y,mv0.getHor()); 1778 pcMP->setL0MvY(uiViewId,bIsDepth,x,y,mv0.getVer()); 1779 1780 pcMP->setL1RefPOC(uiViewId,bIsDepth,x,y,ref_frame1); 1781 pcMP->setL1MvX(uiViewId,bIsDepth,x,y,mv1.getHor()); 1782 pcMP->setL1MvY(uiViewId,bIsDepth,x,y,mv1.getVer()); 1783 } 1784 #endif 1785 1786 #if POZNAN_DBMP_CALC_PRED_DATA 1787 #if DEPTH_MAP_GENERATION 1788 if( !bPrdDepthMap ) 1789 #endif 1790 { 1791 pcMP->getTempL0RefIdx()[uiPointCnt] = ref_frame0_idx; 1792 pcMP->getTempL0MvX()[uiPointCnt] = mv0.getHor(); 1793 pcMP->getTempL0MvY()[uiPointCnt] = mv0.getVer(); 1794 1795 pcMP->getTempL1RefIdx()[uiPointCnt] = ref_frame1_idx; 1796 pcMP->getTempL1MvX()[uiPointCnt] = mv1.getHor(); 1797 pcMP->getTempL1MvY()[uiPointCnt] = mv1.getVer(); 1798 } 1799 uiPointCnt++; 1800 #endif 1801 1802 } 1803 } 1804 1805 //set motion data representing CU with DBMP 1806 #if DEPTH_MAP_GENERATION 1807 if( !bPrdDepthMap ) 1808 #endif 1809 { 1810 PartSize ePartSize = pcCU->getPartitionSize( uiPartAddr ); //PartSize ePartSize = pcCU->getPartitionSize( 0 ); 1811 #if POZNAN_DBMP_CALC_PRED_DATA 1812 pcMP->xCalcDBMPPredData(uiPointCnt, ref_frame0_idx, mv0, ref_frame1_idx, mv1); 1813 1814 pcCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( mv0, ref_frame0_idx, ePartSize, uiPartAddr, iPartIdx, 0 ); 1815 pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( mv1, ref_frame1_idx, ePartSize, uiPartAddr, iPartIdx, 0 ); 1816 #else 1817 pcCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( mv0_2nd, ref_frame0_idx_2nd, ePartSize, uiPartAddr, iPartIdx, 0 ); 1818 pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( mv1_2nd, ref_frame1_idx_2nd, ePartSize, uiPartAddr, iPartIdx, 0 ); 1819 #endif 1820 } 1821 1822 if ( iPartIdxOrg >= 0 ) break; 1823 } 1824 return; 1825 } 1826 #endif 1593 1827 1594 1828 #if HIGH_ACCURACY_BI … … 2135 2369 } 2136 2370 2371 2372 2373 #if POZNAN_DBMP 2374 2375 #if HIGH_ACCURACY_BI 2376 #if DEPTH_MAP_GENERATION 2377 Void TComPrediction::xPredInterUni_DBMP ( TComDataCU* pcCU, UInt uiPartAddr, Int iPosX, Int iPosY, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX, UInt uiSubSampExpY, Bool bi ) 2378 #else 2379 Void TComPrediction::xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iPosX, Int iPosY, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bi ) 2380 #endif 2381 #else 2382 #if DEPTH_MAP_GENERATION 2383 Void TComPrediction::xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iPosX, Int iPosY, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX, UInt uiSubSampExpY ) 2384 #else 2385 Void TComPrediction::xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iPosX, Int iPosY, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx ) 2386 #endif 2387 #endif 2388 { 2389 Int iRefIdx = pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr ); assert (iRefIdx >= 0); 2390 TComMv cMv = pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr ); 2391 pcCU->clipMv(cMv); 2392 2393 #if DEPTH_MAP_GENERATION 2394 if( bPrdDepthMap ) 2395 { 2396 UInt uiRShift = 0; 2397 xPredInterPrdDepthMap_DBMP( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPredDepthMap(), uiPartAddr, &cMv, iPosX, iPosY, uiSubSampExpX, uiSubSampExpY, rpcYuvPred, uiRShift ); 2398 return; 2399 } 2400 #endif 2401 2402 #if HHI_FULL_PEL_DEPTH_MAP_MV_ACC 2403 if( pcCU->getSlice()->getSPS()->isDepth() ) 2404 { 2405 #if HIGH_ACCURACY_BI 2406 UInt uiRShift = ( bi ? 14-g_uiBitDepth-g_uiBitIncrement : 0 ); 2407 #else 2408 UInt uiRShift = 0; 2409 #endif 2410 #if DEPTH_MAP_GENERATION 2411 xPredInterPrdDepthMap_DBMP( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iPosX, iPosY, 0, 0, rpcYuvPred, uiRShift ); 2412 #else 2413 xPredInterPrdDepthMap_DBMP( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iPosX, iPosY, rpcYuvPred, uiRShift ); 2414 #endif 2415 } 2416 else 2417 { 2418 #endif 2419 #if HIGH_ACCURACY_BI 2420 if(!bi) 2421 { 2422 xPredInterLumaBlk_DBMP ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iPosX, iPosY, rpcYuvPred ); 2423 } 2424 else 2425 { 2426 xPredInterLumaBlk_DBMP_ha ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iPosX, iPosY, rpcYuvPred ); 2427 } 2428 #else 2429 xPredInterLumaBlk_DBMP ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iPosX, iPosY, rpcYuvPred ); 2430 #endif 2431 #if HHI_FULL_PEL_DEPTH_MAP_MV_ACC 2432 } 2433 #endif 2434 2435 #if HIGH_ACCURACY_BI 2436 if (!bi) 2437 { 2438 xPredInterChromaBlk_DBMP ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iPosX, iPosY, rpcYuvPred ); 2439 } 2440 else 2441 { 2442 xPredInterChromaBlk_DBMP_ha ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec() , uiPartAddr, &cMv, iPosX, iPosY, rpcYuvPred ); 2443 } 2444 #else 2445 xPredInterChromaBlk_DBMP ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iPosX, iPosY, rpcYuvPred ); 2446 #endif 2447 } 2448 2449 #if DEPTH_MAP_GENERATION 2450 Void TComPrediction::xPredInterBi_DBMP ( TComDataCU* pcCU, UInt uiPartAddr, Int iPosX, Int iPosY, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap ) 2451 #else 2452 Void TComPrediction::xPredInterBi_DBMP ( TComDataCU* pcCU, UInt uiPartAddr, Int iPosX, Int iPosY, TComYuv*& rpcYuvPred, Int iPartIdx ) 2453 #endif 2454 { 2455 TComYuv* pcMbYuv; 2456 Int iRefIdx[2] = {-1, -1}; 2457 2458 for ( Int iRefList = 0; iRefList < 2; iRefList++ ) 2459 { 2460 RefPicList eRefPicList = (iRefList ? REF_PIC_LIST_1 : REF_PIC_LIST_0); 2461 iRefIdx[iRefList] = pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr ); 2462 2463 if ( iRefIdx[iRefList] < 0 ) 2464 { 2465 continue; 2466 } 2467 2468 assert( iRefIdx[iRefList] < pcCU->getSlice()->getNumRefIdx(eRefPicList) ); 2469 2470 pcMbYuv = &m_acYuvPred[iRefList]; 2471 #if HIGH_ACCURACY_BI 2472 if( pcCU->getCUMvField( REF_PIC_LIST_0 )->getRefIdx( uiPartAddr ) >= 0 && pcCU->getCUMvField( REF_PIC_LIST_1 )->getRefIdx( uiPartAddr ) >= 0 ) 2473 #if DEPTH_MAP_GENERATION 2474 xPredInterUni_DBMP ( pcCU, uiPartAddr, iPosX, iPosY, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, true ); 2475 #else 2476 xPredInterUni_DBMP ( pcCU, uiPartAddr, iPosX, iPosY, eRefPicList, pcMbYuv, iPartIdx, true ); 2477 #endif 2478 else 2479 #if DEPTH_MAP_GENERATION 2480 xPredInterUni_DBMP ( pcCU, uiPartAddr, iPosX, iPosY, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY ); 2481 #else 2482 xPredInterUni_DBMP ( pcCU, uiPartAddr, iPosX, iPosY, eRefPicList, pcMbYuv, iPartIdx ); 2483 #endif 2484 #else 2485 #if DEPTH_MAP_GENERATION 2486 xPredInterUni_DBMP ( pcCU, uiPartAddr, iPosX, iPosY, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY ); 2487 #else 2488 xPredInterUni_DBMP ( pcCU, uiPartAddr, iPosX, iPosY, eRefPicList, pcMbYuv, iPartIdx ); 2489 #endif 2490 #endif 2491 } 2492 2493 #ifdef WEIGHT_PRED 2494 if ( pcCU->getSlice()->getPPS()->getWPBiPredIdc() ) 2495 { 2496 xWeightedPredictionBi_DBMP( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iPosX, iPosY, rpcYuvPred ); 2497 } 2498 else 2499 #endif 2500 2501 #if DEPTH_MAP_GENERATION 2502 if ( bPrdDepthMap ) 2503 { 2504 xWeightedAveragePdm_DBMP( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iPosX, iPosY, rpcYuvPred, uiSubSampExpX, uiSubSampExpY ); 2505 } 2506 else 2507 { 2508 xWeightedAverage_DBMP( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iPosX, iPosY, rpcYuvPred ); 2509 } 2510 #else 2511 xWeightedAverage_DBMP( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iPosX, iPosY, rpcYuvPred ); 2512 #endif 2513 } 2514 2515 Void 2516 #if DEPTH_MAP_GENERATION 2517 TComPrediction::xPredInterPrdDepthMap_DBMP( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuv, UInt uiRShift ) 2518 #else 2519 TComPrediction::xPredInterPrdDepthMap_DBMP( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, TComYuv*& rpcYuv, UInt uiRShift ) 2520 #endif 2521 { 2522 #if DEPTH_MAP_GENERATION 2523 Int iShiftX = 2 + uiSubSampExpX; 2524 Int iShiftY = 2 + uiSubSampExpY; 2525 Int iAddX = ( 1 << iShiftX ) >> 1; 2526 Int iAddY = ( 1 << iShiftY ) >> 1; 2527 Int iHor = ( pcMv->getHor() + iAddX ) >> iShiftX; 2528 Int iVer = ( pcMv->getVer() + iAddY ) >> iShiftY; 2529 #if HHI_FULL_PEL_DEPTH_MAP_MV_ACC 2530 if( pcCU->getSlice()->getSPS()->isDepth() ) 2531 { 2532 iHor = pcMv->getHor(); 2533 iVer = pcMv->getVer(); 2534 } 2535 #endif 2536 Int iRefStride = pcPicYuvRef->getStride(); 2537 Int iDstStride = rpcYuv->getStride(); 2538 Int iRefOffset = iHor + iVer * iRefStride; 2539 #else 2540 Int iFPelMask = ~3; 2541 Int iRefStride = pcPicYuvRef->getStride(); 2542 Int iDstStride = rpcYuv->getStride(); 2543 Int iHor = ( pcMv->getHor() + 2 ) & iFPelMask; 2544 Int iVer = ( pcMv->getVer() + 2 ) & iFPelMask; 2545 #if HHI_FULL_PEL_DEPTH_MAP_MV_ACC 2546 if( pcCU->getSlice()->getSPS()->isDepth() ) 2547 { 2548 iHor = pcMv->getHor() * 4; 2549 iVer = pcMv->getVer() * 4; 2550 } 2551 #endif 2552 Int ixFrac = iHor & 0x3; 2553 Int iyFrac = iVer & 0x3; 2554 Int iRefOffset = ( iHor >> 2 ) + ( iVer >> 2 ) * iRefStride; 2555 #endif 2556 2557 Pel* piRefY = pcPicYuvRef->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr ) + iRefOffset; 2558 Pel* piDstY = rpcYuv->getLumaAddr( uiPartAddr ); 2559 2560 piDstY[ iPosY*iDstStride + iPosX ] = piRefY[ iPosY*iRefStride + iPosX ] << uiRShift; 2561 } 2562 2563 2564 #if HIGH_ACCURACY_BI 2565 2566 Void TComPrediction::xPredInterLumaBlk_DBMP_ha( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, TComYuv*& rpcYuv ) 2567 { 2568 Int iRefStride = pcPicYuvRef->getStride(); 2569 Int iDstStride = rpcYuv->getStride(); 2570 2571 Int iRefOffset = ( pcMv->getHor() >> 2 ) + ( pcMv->getVer() >> 2 ) * iRefStride; 2572 Pel* piRefY = pcPicYuvRef->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr ) + iRefOffset; 2573 2574 Int ixFrac = pcMv->getHor() & 0x3; 2575 Int iyFrac = pcMv->getVer() & 0x3; 2576 2577 Pel* piDstY = rpcYuv->getLumaAddr( uiPartAddr ); 2578 UInt shiftNum = 14-g_uiBitDepth-g_uiBitIncrement; 2579 2580 piDstY += iPosY*iDstStride+iPosX; 2581 piRefY += iPosY*iRefStride+iPosX; 2582 2583 // Integer point 2584 if ( ixFrac == 0 && iyFrac == 0 ) 2585 { 2586 *piDstY = (*piRefY)<<shiftNum; 2587 return; 2588 } 2589 2590 Int iWidth = 1; 2591 Int iHeight = 1; 2592 2593 // Half-pel horizontal 2594 if ( ixFrac == 2 && iyFrac == 0 ) 2595 { 2596 xCTI_FilterHalfHor_ha ( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY ); 2597 return; 2598 } 2599 2600 // Half-pel vertical 2601 if ( ixFrac == 0 && iyFrac == 2 ) 2602 { 2603 xCTI_FilterHalfVer_ha ( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY ); 2604 return; 2605 } 2606 2607 Int iExtStride = m_iYuvExtStride;//m_cYuvExt.getStride(); 2608 Int* piExtY = m_piYuvExt;//m_cYuvExt.getLumaAddr(); 2609 2610 // Half-pel center 2611 if ( ixFrac == 2 && iyFrac == 2 ) 2612 { 2613 xCTI_FilterHalfVer (piRefY - 3, iRefStride, 1, iWidth +7, iHeight, iExtStride, 1, piExtY ); 2614 xCTI_FilterHalfHor_ha (piExtY + 3, iExtStride, 1, iWidth , iHeight, iDstStride, 1, piDstY ); 2615 return; 2616 } 2617 2618 // Quater-pel horizontal 2619 if ( iyFrac == 0) 2620 { 2621 if ( ixFrac == 1) 2622 { 2623 xCTI_FilterQuarter0Hor_ha( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY ); 2624 return; 2625 } 2626 if ( ixFrac == 3) 2627 { 2628 xCTI_FilterQuarter1Hor_ha( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY ); 2629 return; 2630 } 2631 } 2632 if ( iyFrac == 2 ) 2633 { 2634 if ( ixFrac == 1) 2635 { 2636 xCTI_FilterHalfVer (piRefY -3, iRefStride, 1, iWidth +7, iHeight, iExtStride, 1, piExtY ); 2637 xCTI_FilterQuarter0Hor_ha (piExtY + 3, iExtStride, 1, iWidth, iHeight, iDstStride, 1, piDstY ); 2638 return; 2639 } 2640 if ( ixFrac == 3) 2641 { 2642 xCTI_FilterHalfVer (piRefY - 3, iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY ); 2643 xCTI_FilterQuarter1Hor_ha (piExtY + 3, iExtStride, 1, iWidth, iHeight, iDstStride, 1, piDstY ); 2644 return; 2645 } 2646 } 2647 2648 // Quater-pel vertical 2649 if( ixFrac == 0 ) 2650 { 2651 if( iyFrac == 1 ) 2652 { 2653 xCTI_FilterQuarter0Ver_ha( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY ); 2654 return; 2655 } 2656 if( iyFrac == 3 ) 2657 { 2658 xCTI_FilterQuarter1Ver_ha( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY ); 2659 return; 2660 } 2661 } 2662 2663 if( ixFrac == 2 ) 2664 { 2665 if( iyFrac == 1 ) 2666 { 2667 xCTI_FilterQuarter0Ver (piRefY - 3, iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY ); 2668 xCTI_FilterHalfHor_ha (piExtY + 3, iExtStride, 1, iWidth , iHeight, iDstStride, 1, piDstY ); 2669 2670 return; 2671 } 2672 if( iyFrac == 3 ) 2673 { 2674 xCTI_FilterQuarter1Ver (piRefY -3, iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY ); 2675 xCTI_FilterHalfHor_ha (piExtY + 3, iExtStride, 1, iWidth , iHeight, iDstStride, 1, piDstY ); 2676 return; 2677 } 2678 } 2679 2680 /// Quarter-pel center 2681 if ( iyFrac == 1) 2682 { 2683 if ( ixFrac == 1) 2684 { 2685 xCTI_FilterQuarter0Ver (piRefY - 3, iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY ); 2686 xCTI_FilterQuarter0Hor_ha (piExtY + 3, iExtStride, 1, iWidth , iHeight, iDstStride, 1, piDstY ); 2687 return; 2688 } 2689 if ( ixFrac == 3) 2690 { 2691 xCTI_FilterQuarter0Ver (piRefY - 3, iRefStride, 1, iWidth +7, iHeight, iExtStride, 1, piExtY ); 2692 xCTI_FilterQuarter1Hor_ha (piExtY + 3, iExtStride, 1, iWidth , iHeight, iDstStride, 1, piDstY ); 2693 2694 return; 2695 } 2696 } 2697 if ( iyFrac == 3 ) 2698 { 2699 if ( ixFrac == 1) 2700 { 2701 xCTI_FilterQuarter1Ver (piRefY - 3, iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY ); 2702 xCTI_FilterQuarter0Hor_ha (piExtY + 3, iExtStride, 1, iWidth , iHeight, iDstStride, 1, piDstY ); 2703 return; 2704 } 2705 if ( ixFrac == 3) 2706 { 2707 xCTI_FilterQuarter1Ver (piRefY - 3, iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY ); 2708 xCTI_FilterQuarter1Hor_ha (piExtY + 3, iExtStride, 1, iWidth , iHeight, iDstStride, 1, piDstY ); 2709 return; 2710 } 2711 } 2712 } 2713 2714 #endif 2715 2716 Void TComPrediction::xPredInterLumaBlk_DBMP( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, TComYuv*& rpcYuv ) 2717 { 2718 Int iRefStride = pcPicYuvRef->getStride(); 2719 Int iDstStride = rpcYuv->getStride(); 2720 2721 Int iRefOffset = ( pcMv->getHor() >> 2 ) + ( pcMv->getVer() >> 2 ) * iRefStride; 2722 Pel* piRefY = pcPicYuvRef->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr ) + iRefOffset; 2723 2724 Int ixFrac = pcMv->getHor() & 0x3; 2725 Int iyFrac = pcMv->getVer() & 0x3; 2726 2727 Pel* piDstY = rpcYuv->getLumaAddr( uiPartAddr ); 2728 2729 piDstY += iPosY*iDstStride+iPosX; 2730 piRefY += iPosY*iRefStride+iPosX; 2731 2732 // Integer point 2733 if ( ixFrac == 0 && iyFrac == 0 ) 2734 { 2735 ::memcpy(piDstY, piRefY, sizeof(Pel)); 2736 return; 2737 } 2738 2739 Int iWidth = 1; 2740 Int iHeight = 1; 2741 2742 // Half-pel horizontal 2743 if ( ixFrac == 2 && iyFrac == 0 ) 2744 { 2745 xCTI_FilterHalfHor ( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY ); 2746 return; 2747 } 2748 2749 // Half-pel vertical 2750 if ( ixFrac == 0 && iyFrac == 2 ) 2751 { 2752 xCTI_FilterHalfVer ( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY ); 2753 return; 2754 } 2755 2756 Int iExtStride = m_iYuvExtStride;//m_cYuvExt.getStride(); 2757 Int* piExtY = m_piYuvExt;//m_cYuvExt.getLumaAddr(); 2758 2759 // Half-pel center 2760 if ( ixFrac == 2 && iyFrac == 2 ) 2761 { 2762 2763 xCTI_FilterHalfVer (piRefY - 3, iRefStride, 1, iWidth +7, iHeight, iExtStride, 1, piExtY ); 2764 xCTI_FilterHalfHor (piExtY + 3, iExtStride, 1, iWidth , iHeight, iDstStride, 1, piDstY ); 2765 return; 2766 } 2767 2768 // Quater-pel horizontal 2769 if ( iyFrac == 0) 2770 { 2771 if ( ixFrac == 1) 2772 { 2773 xCTI_FilterQuarter0Hor( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY ); 2774 return; 2775 } 2776 if ( ixFrac == 3) 2777 { 2778 xCTI_FilterQuarter1Hor( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY ); 2779 return; 2780 } 2781 } 2782 if ( iyFrac == 2 ) 2783 { 2784 if ( ixFrac == 1) 2785 { 2786 xCTI_FilterHalfVer (piRefY -3, iRefStride, 1, iWidth +7, iHeight, iExtStride, 1, piExtY ); 2787 xCTI_FilterQuarter0Hor (piExtY + 3, iExtStride, 1, iWidth, iHeight, iDstStride, 1, piDstY ); 2788 return; 2789 } 2790 if ( ixFrac == 3) 2791 { 2792 xCTI_FilterHalfVer (piRefY - 3, iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY ); 2793 xCTI_FilterQuarter1Hor (piExtY + 3, iExtStride, 1, iWidth, iHeight, iDstStride, 1, piDstY ); 2794 return; 2795 } 2796 } 2797 2798 // Quater-pel vertical 2799 if( ixFrac == 0 ) 2800 { 2801 if( iyFrac == 1 ) 2802 { 2803 xCTI_FilterQuarter0Ver( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY ); 2804 return; 2805 } 2806 if( iyFrac == 3 ) 2807 { 2808 xCTI_FilterQuarter1Ver( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY ); 2809 return; 2810 } 2811 } 2812 2813 if( ixFrac == 2 ) 2814 { 2815 if( iyFrac == 1 ) 2816 { 2817 xCTI_FilterQuarter0Ver (piRefY - 3, iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY ); 2818 xCTI_FilterHalfHor (piExtY + 3, iExtStride, 1, iWidth , iHeight, iDstStride, 1, piDstY ); 2819 return; 2820 } 2821 if( iyFrac == 3 ) 2822 { 2823 xCTI_FilterQuarter1Ver (piRefY -3, iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY ); 2824 xCTI_FilterHalfHor (piExtY + 3, iExtStride, 1, iWidth , iHeight, iDstStride, 1, piDstY ); 2825 return; 2826 } 2827 } 2828 2829 /// Quarter-pel center 2830 if ( iyFrac == 1) 2831 { 2832 if ( ixFrac == 1) 2833 { 2834 xCTI_FilterQuarter0Ver (piRefY - 3, iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY ); 2835 xCTI_FilterQuarter0Hor (piExtY + 3, iExtStride, 1, iWidth , iHeight, iDstStride, 1, piDstY ); 2836 return; 2837 } 2838 if ( ixFrac == 3) 2839 { 2840 xCTI_FilterQuarter0Ver (piRefY - 3, iRefStride, 1, iWidth +7, iHeight, iExtStride, 1, piExtY ); 2841 xCTI_FilterQuarter1Hor (piExtY + 3, iExtStride, 1, iWidth , iHeight, iDstStride, 1, piDstY ); 2842 return; 2843 } 2844 } 2845 if ( iyFrac == 3 ) 2846 { 2847 if ( ixFrac == 1) 2848 { 2849 xCTI_FilterQuarter1Ver (piRefY - 3, iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY ); 2850 xCTI_FilterQuarter0Hor (piExtY + 3, iExtStride, 1, iWidth , iHeight, iDstStride, 1, piDstY ); 2851 return; 2852 } 2853 if ( ixFrac == 3) 2854 { 2855 xCTI_FilterQuarter1Ver (piRefY - 3, iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY ); 2856 xCTI_FilterQuarter1Hor (piExtY + 3, iExtStride, 1, iWidth , iHeight, iDstStride, 1, piDstY ); 2857 return; 2858 } 2859 } 2860 } 2861 2862 #if HIGH_ACCURACY_BI 2863 Void TComPrediction::xPredInterChromaBlk_DBMP_ha( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, TComYuv*& rpcYuv ) 2864 { 2865 Int iRefStride = pcPicYuvRef->getCStride(); 2866 Int iDstStride = rpcYuv->getCStride(); 2867 2868 Int iRefOffset = (pcMv->getHor() >> 3) + (pcMv->getVer() >> 3) * iRefStride; 2869 2870 Pel* piRefCb = pcPicYuvRef->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr ) + iRefOffset; 2871 Pel* piRefCr = pcPicYuvRef->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr ) + iRefOffset; 2872 2873 Pel* piDstCb = rpcYuv->getCbAddr( uiPartAddr ); 2874 Pel* piDstCr = rpcYuv->getCrAddr( uiPartAddr ); 2875 2876 Int ixFrac = pcMv->getHor() & 0x7; 2877 Int iyFrac = pcMv->getVer() & 0x7; 2878 UInt uiCWidth = 1; 2879 UInt uiCHeight = 1; 2880 2881 piDstCb += (iPosY>>1)*iDstStride+(iPosX>>1); 2882 piDstCr += (iPosY>>1)*iDstStride+(iPosX>>1); 2883 piRefCb += (iPosY>>1)*iRefStride+(iPosX>>1); 2884 piRefCr += (iPosY>>1)*iRefStride+(iPosX>>1); 2885 2886 xDCTIF_FilterC_ha(piRefCb, iRefStride,piDstCb,iDstStride,uiCWidth,uiCHeight, iyFrac, ixFrac); 2887 xDCTIF_FilterC_ha(piRefCr, iRefStride,piDstCr,iDstStride,uiCWidth,uiCHeight, iyFrac, ixFrac); 2888 return; 2889 } 2890 #endif 2891 2892 //-- 2893 Void TComPrediction::xPredInterChromaBlk_DBMP( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, TComYuv*& rpcYuv ) 2894 { 2895 Int iRefStride = pcPicYuvRef->getCStride(); 2896 Int iDstStride = rpcYuv->getCStride(); 2897 2898 Int iRefOffset = (pcMv->getHor() >> 3) + (pcMv->getVer() >> 3) * iRefStride; 2899 2900 Pel* piRefCb = pcPicYuvRef->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr ) + iRefOffset; 2901 Pel* piRefCr = pcPicYuvRef->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr ) + iRefOffset; 2902 2903 Pel* piDstCb = rpcYuv->getCbAddr( uiPartAddr ); 2904 Pel* piDstCr = rpcYuv->getCrAddr( uiPartAddr ); 2905 2906 Int ixFrac = pcMv->getHor() & 0x7; 2907 Int iyFrac = pcMv->getVer() & 0x7; 2908 UInt uiCWidth = 1; 2909 UInt uiCHeight = 1; 2910 2911 piDstCb += (iPosY>>1)*iDstStride+(iPosX>>1); 2912 piDstCr += (iPosY>>1)*iDstStride+(iPosX>>1); 2913 piRefCb += (iPosY>>1)*iRefStride+(iPosX>>1); 2914 piRefCr += (iPosY>>1)*iRefStride+(iPosX>>1); 2915 2916 xDCTIF_FilterC(piRefCb, iRefStride,piDstCb,iDstStride,uiCWidth,uiCHeight, iyFrac, ixFrac); 2917 xDCTIF_FilterC(piRefCr, iRefStride,piDstCr,iDstStride,uiCWidth,uiCHeight, iyFrac, ixFrac); 2918 return; 2919 } 2920 2921 #endif 2922 2923 2137 2924 Void TComPrediction::xDCTIF_FilterC ( Pel* piRefC, Int iRefStride,Pel* piDstC,Int iDstStride, 2138 2925 Int iWidth, Int iHeight,Int iMVyFrac,Int iMVxFrac) … … 2260 3047 } 2261 3048 } 3049 3050 #if POZNAN_DBMP 3051 3052 #if DEPTH_MAP_GENERATION 3053 Void TComPrediction::xWeightedAveragePdm_DBMP( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartIdx, Int iPosX, Int iPosY, TComYuv*& rpcYuvDst, UInt uiSubSampExpX, UInt uiSubSampExpY ) 3054 { 3055 if( iRefIdx0 >= 0 && iRefIdx1 >= 0 ) 3056 { 3057 rpcYuvDst->addAvgPdm_DBMP( pcYuvSrc0, pcYuvSrc1, uiPartIdx, iPosX, iPosY, uiSubSampExpX, uiSubSampExpY ); 3058 } 3059 else if ( iRefIdx0 >= 0 && iRefIdx1 < 0 ) 3060 { 3061 pcYuvSrc0->copyPartToPartYuvPdm_DBMP( rpcYuvDst, uiPartIdx, iPosX, iPosY, uiSubSampExpX, uiSubSampExpY ); 3062 } 3063 else if ( iRefIdx0 < 0 && iRefIdx1 >= 0 ) 3064 { 3065 pcYuvSrc1->copyPartToPartYuvPdm_DBMP( rpcYuvDst, uiPartIdx, iPosX, iPosY, uiSubSampExpX, uiSubSampExpY ); 3066 } 3067 else 3068 { 3069 assert (0); 3070 } 3071 } 3072 #endif 3073 3074 Void TComPrediction::xWeightedAverage_DBMP( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartIdx, Int iPosX, Int iPosY, TComYuv*& rpcYuvDst ) 3075 { 3076 if( iRefIdx0 >= 0 && iRefIdx1 >= 0 ) 3077 { 3078 #ifdef ROUNDING_CONTROL_BIPRED 3079 rpcYuvDst->addAvg_DBMP( pcYuvSrc0, pcYuvSrc1, uiPartIdx, iPosX, iPosY, pcCU->getSlice()->isRounding()); 3080 #else 3081 rpcYuvDst->addAvg_DBMP( pcYuvSrc0, pcYuvSrc1, uiPartIdx, iPosX, iPosY ); 3082 #endif 3083 } 3084 else if ( iRefIdx0 >= 0 && iRefIdx1 < 0 ) 3085 { 3086 pcYuvSrc0->copyPartToPartYuv_DBMP( rpcYuvDst, uiPartIdx, iPosX, iPosY ); 3087 } 3088 else if ( iRefIdx0 < 0 && iRefIdx1 >= 0 ) 3089 { 3090 pcYuvSrc1->copyPartToPartYuv_DBMP( rpcYuvDst, uiPartIdx, iPosX, iPosY ); 3091 } 3092 else 3093 { 3094 assert (0); 3095 } 3096 } 3097 #endif 2262 3098 2263 3099 // AMVP -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComPrediction.h
r21 r28 52 52 #endif 53 53 54 #if POZNAN_MP 55 #include "../TLibCommon/TComMP.h" 56 #endif 57 54 58 // ==================================================================================================================== 55 59 // Class definition … … 124 128 #endif 125 129 130 #if POZNAN_DBMP 131 #if HIGH_ACCURACY_BI 132 #if DEPTH_MAP_GENERATION 133 Void xPredInterUni_DBMP ( TComDataCU* pcCU, UInt uiPartAddr, Int iPosX, Int iPosY, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX = 0, UInt uiSubSampExpY = 0, Bool bi=false ); 134 #else 135 Void xPredInterUni_DBMP ( TComDataCU* pcCU, UInt uiPartAddr, Int iPosX, Int iPosY, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bi=false ); 136 #endif 137 #else 138 #if DEPTH_MAP_GENERATION 139 Void xPredInterUni_DBMP ( TComDataCU* pcCU, UInt uiPartAddr, Int iPosX, Int iPosY, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX = 0, UInt uiSubSampExpY = 0 ); 140 #else 141 Void xPredInterUni_DBMP ( TComDataCU* pcCU, UInt uiPartAddr, Int iPosX, Int iPosY, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx ); 142 #endif 143 #endif 144 #if DEPTH_MAP_GENERATION 145 Void xPredInterBi_DBMP ( TComDataCU* pcCU, UInt uiPartAddr, Int iPosX, Int iPosY, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap ); 146 Void xPredInterPrdDepthMap_DBMP( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuv, UInt uiRShift ); 147 #else 148 Void xPredInterBi_DBMP ( TComDataCU* pcCU, UInt uiPartAddr, Int iPosX, Int iPosY, TComYuv*& rpcYuvPred, Int iPartIdx ); 149 Void xPredInterPrdDepthMap_DBMP ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, TComYuv*& rpcYuv, UInt uiRShift ); 150 #endif 151 152 Void xPredInterLumaBlk_DBMP ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, TComYuv*& rpcYuv ); 153 Void xPredInterChromaBlk_DBMP ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, TComYuv*& rpcYuv ); 154 155 #if DEPTH_MAP_GENERATION 156 Void xWeightedAveragePdm_DBMP ( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iPosX, Int iPosY, TComYuv*& rpcYuvDst, UInt uiSubSampExpX, UInt uiSubSampExpY ); 157 #endif 158 Void xWeightedAverage_DBMP ( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iPosX, Int iPosY, TComYuv*& rpcYuvDst ); 159 160 #if HIGH_ACCURACY_BI 161 Void xPredInterLumaBlk_DBMP_ha( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, TComYuv*& rpcYuv ); 162 Void xPredInterChromaBlk_DBMP_ha( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, TComYuv*& rpcYuv ); 163 #endif 164 #endif 165 126 166 #if HHI_DMM_WEDGE_INTRA 127 167 Void xPredIntraWedgeFull ( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bAbove, Bool bLeft, Bool bEncoder, Bool bDelta, UInt uiTabIdx, Int iDeltaDC1 = 0, Int iDeltaDC2 = 0 ); … … 160 200 #else 161 201 Void motionCompensation ( TComDataCU* pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1 ); 202 #endif 203 204 #if POZNAN_DBMP 205 #if DEPTH_MAP_GENERATION 206 Void motionCompensation_DBMP ( TComDataCU* pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1, Bool bPrdDepthMap = false, UInt uiSubSampExpX = 0, UInt uiSubSampExpY = 0 ); 207 #else 208 Void motionCompensation_DBMP ( TComDataCU* pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1 ); 209 #endif 210 162 211 #endif 163 212 -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComResidualGenerator.cpp
r21 r28 306 306 xSetRecResidualInterCU( pcSubCU, pcSubRes ); 307 307 break; 308 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 309 case MODE_SYNTH: 310 xSetRecResidualIntraCU( pcSubCU, pcSubRes ); //MayBe it should be seperate function 311 break; 312 #endif 308 313 default: 309 314 AOT( true ); … … 336 341 UInt uiLumaTrMode, uiChromaTrMode; 337 342 pcCU->convertTransIdx ( 0, pcCU->getTransformIdx( 0 ), uiLumaTrMode, uiChromaTrMode ); 343 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 344 m_pcTrQuant->setQPforQuant ( pcCU->getQP( 0 ) + pcCU->getQpOffsetForTextCU(0/*uiAbsPartIdx*/, false), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA ); 345 #else 338 346 m_pcTrQuant->setQPforQuant ( pcCU->getQP( 0 ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA ); 347 #endif 339 348 m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_LUMA, pRes, 0, pcCUResidual->getStride(), uiWidth, uiHeight, uiLumaTrMode, 0, piCoeff ); 340 349 // chroma Cb … … 343 352 piCoeff = pcCU->getCoeffCb(); 344 353 pRes = pcCUResidual->getCbAddr(); 354 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 355 m_pcTrQuant->setQPforQuant ( pcCU->getQP( 0 ) + pcCU->getQpOffsetForTextCU(0/*uiAbsPartIdx*/, false), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_CHROMA ); 356 #else 345 357 m_pcTrQuant->setQPforQuant ( pcCU->getQP( 0 ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_CHROMA ); 358 #endif 346 359 m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_CHROMA_U, pRes, 0, pcCUResidual->getCStride(), uiWidth, uiHeight, uiChromaTrMode, 0, piCoeff ); 347 360 // chroma Cr -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComSlice.cpp
r21 r28 89 89 initWpAcDcParam(); 90 90 #endif 91 92 #if POZNAN_MP 93 m_pcMP = NULL; 94 #endif 91 95 } 92 96 93 97 TComSlice::~TComSlice() 94 98 { 99 #if POZNAN_MP 100 m_pcMP = NULL; 101 #endif 95 102 } 96 103 … … 681 688 #endif 682 689 690 #if POZNAN_DBMP 691 m_uiDBMP = 0; 692 #endif 693 694 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 695 m_uiUseCUSkip = 0; 696 #endif 697 698 683 699 // AMVP parameter 684 700 ::memset( m_aeAMVPMode, 0, sizeof( m_aeAMVPMode ) ); … … 730 746 } 731 747 } 748 #if POZNAN_NONLINEAR_DEPTH 749 m_fDepthPower = 1.0; 750 #endif 751 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 752 m_bUseTexDqpAccordingToDepth = false; 753 #endif 732 754 } 733 755 … … 745 767 ::memset( m_aaiCodedScale, 0x00, sizeof( m_aaiCodedScale ) ); 746 768 ::memset( m_aaiCodedOffset, 0x00, sizeof( m_aaiCodedOffset ) ); 769 #if POZNAN_NONLINEAR_DEPTH 770 m_fDepthPower = 1.0; 771 #endif 747 772 } 748 773 -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComSlice.h
r21 r28 57 57 #endif 58 58 59 #if POZNAN_MP 60 //#include "../TLibCommon/TComMP.h" 61 class TComMP; 62 #endif 63 59 64 // ==================================================================================================================== 60 65 // Class definition … … 148 153 #endif 149 154 155 #if POZNAN_DBMP 156 UInt m_uiDBMP; 157 #endif 158 159 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 160 UInt m_uiUseCUSkip; 161 #endif 162 150 163 #if DEPTH_MAP_GENERATION 151 164 TComDepthMapGenerator* m_pcDepthMapGenerator; … … 153 166 #if HHI_INTER_VIEW_RESIDUAL_PRED 154 167 TComResidualGenerator* m_pcResidualGenerator; 168 #endif 169 170 #if POZNAN_NONLINEAR_DEPTH 171 Float m_fDepthPower; 172 #endif 173 174 #if POZNAN_MP 175 TComMP* m_pcMP; 176 #endif 177 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 178 Bool m_bUseTexDqpAccordingToDepth; 155 179 #endif 156 180 … … 208 232 209 233 // Tool list 234 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 235 Bool getUseALF () { return (getViewId()>0)?false:m_bUseALF;} //todo fix ALF 236 #else 210 237 Bool getUseALF () { return m_bUseALF; } 238 #endif 211 239 Bool getUseDQP () { return m_bUseDQP; } 212 240 … … 266 294 #if MTK_SAO 267 295 Void setUseSAO (Bool bVal) {m_bUseSAO = bVal;} 296 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU //todo fix SAO 297 Bool getUseSAO () { return (getViewId()>0)?false:m_bUseSAO;} 298 #else 268 299 Bool getUseSAO () {return m_bUseSAO;} 300 #endif 269 301 #endif 270 302 … … 282 314 #if HHI_INTER_VIEW_RESIDUAL_PRED 283 315 Void setMultiviewResPredMode ( UInt uiResPrdMode ) { m_uiMultiviewResPredMode = uiResPrdMode; } 316 #endif 317 318 #if POZNAN_DBMP 319 Void setDBMP ( UInt uiDBMP ) { m_uiDBMP = uiDBMP; } 320 #endif 321 322 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 323 Void setUseCUSkip ( UInt uiUseCUSkip ) { m_uiUseCUSkip = uiUseCUSkip; } 284 324 #endif 285 325 … … 297 337 #endif 298 338 339 #if POZNAN_DBMP 340 UInt getDBMP () { return m_uiDBMP; } 341 #endif 342 343 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 344 UInt getUseCUSkip () { return m_uiUseCUSkip; } 345 #endif 346 299 347 #if DEPTH_MAP_GENERATION 300 348 Void setDepthMapGenerator( TComDepthMapGenerator* pcDepthMapGenerator ) { m_pcDepthMapGenerator = pcDepthMapGenerator; } … … 304 352 Void setResidualGenerator( TComResidualGenerator* pcResidualGenerator ) { m_pcResidualGenerator = pcResidualGenerator; } 305 353 TComResidualGenerator* getResidualGenerator() { return m_pcResidualGenerator; } 354 #endif 355 #if POZNAN_NONLINEAR_DEPTH 356 inline Void setDepthPower(Float p) {m_fDepthPower = p;} 357 inline Float getDepthPower() {return m_fDepthPower;} 358 #else 359 inline Float getDepthPower() {return 1.0f;} 360 #endif 361 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 362 Void setUseTexDqpAccordingToDepth (Bool bVal) {m_bUseTexDqpAccordingToDepth = bVal;} 363 Bool getUseTexDqpAccordingToDepth () {return m_bUseTexDqpAccordingToDepth;} 306 364 #endif 307 365 }; … … 448 506 #endif 449 507 508 #if POZNAN_MP 509 TComMP* m_pcMP; 510 #endif 511 450 512 public: 451 513 TComSlice(); 514 #if POZNAN_MP 515 ~TComSlice(); 516 #else 452 517 virtual ~TComSlice(); 518 #endif 453 519 454 520 Void initSlice (); … … 614 680 #endif 615 681 682 #if POZNAN_MP 683 Void setMP(TComMP* pcMP) { m_pcMP = pcMP; } 684 TComMP* getMP() { return m_pcMP; } 685 #endif 686 616 687 protected: 617 688 #if 0 -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComWeightPrediction.cpp
r5 r28 393 393 } 394 394 395 #if POZNAN_DBMP 396 397 Void TComWeightPrediction::addWeightBi_DBMP( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt iPartUnitIdx, UInt iPosX, Int iPosY, wpScalingParam *wp0, wpScalingParam *wp1, TComYuv* rpcYuvDst, Bool bRound ) 398 { 399 Pel* pSrcY0 = pcYuvSrc0->getLumaAddr( iPartUnitIdx ); 400 Pel* pSrcU0 = pcYuvSrc0->getCbAddr ( iPartUnitIdx ); 401 Pel* pSrcV0 = pcYuvSrc0->getCrAddr ( iPartUnitIdx ); 402 403 Pel* pSrcY1 = pcYuvSrc1->getLumaAddr( iPartUnitIdx ); 404 Pel* pSrcU1 = pcYuvSrc1->getCbAddr ( iPartUnitIdx ); 405 Pel* pSrcV1 = pcYuvSrc1->getCrAddr ( iPartUnitIdx ); 406 407 Pel* pDstY = rpcYuvDst->getLumaAddr( iPartUnitIdx ); 408 Pel* pDstU = rpcYuvDst->getCbAddr ( iPartUnitIdx ); 409 Pel* pDstV = rpcYuvDst->getCrAddr ( iPartUnitIdx ); 410 411 // Luma : -------------------------------------------- 412 Int w0 = wp0[0].w; 413 Int o0 = wp0[0].o; 414 Int offset = wp0[0].offset; 415 Int shiftNum = 14 - (g_uiBitDepth + g_uiBitIncrement); 416 Int shift = wp0[0].shift + shiftNum; 417 Int round = (1<<(shift-1)) * bRound; 418 Int w1 = wp1[0].w; 419 Int o1 = wp1[0].o; 420 421 UInt iSrc0Stride = pcYuvSrc0->getStride(); 422 UInt iSrc1Stride = pcYuvSrc1->getStride(); 423 UInt iDstStride = rpcYuvDst->getStride(); 424 425 pDstY[iPosY*iDstStride+iPosX] = weightBidir(w0,pSrcY0[iPosY*iSrc0Stride+iPosX], w1,pSrcY1[iPosY*iSrc1Stride+iPosX], round, shift, offset); 426 427 // Chromas : -------------------------------------------- 428 iSrc0Stride = pcYuvSrc0->getCStride(); 429 iSrc1Stride = pcYuvSrc1->getCStride(); 430 iDstStride = rpcYuvDst->getCStride(); 431 432 iPosX = iPosX>>1; 433 iPosY = iPosY>>1; 434 435 // Chroma U : -------------------------------------------- 436 w0 = wp0[1].w; 437 o0 = wp0[1].o; 438 offset = wp0[1].offset; 439 shift = wp0[1].shift + shiftNum; 440 round = (1<<(shift-1)); 441 w1 = wp1[1].w; 442 o1 = wp1[1].o; 443 444 pDstU[iPosY*iDstStride+iPosX] = weightBidir(w0,pSrcU0[iPosY*iSrc0Stride+iPosX], w1,pSrcU1[iPosY*iSrc1Stride+iPosX], round, shift, offset); 445 446 // Chroma V : -------------------------------------------- 447 w0 = wp0[2].w; 448 o0 = wp0[2].o; 449 offset = wp0[2].offset; 450 shift = wp0[2].shift + shiftNum; 451 round = (1<<(shift-1)); 452 w1 = wp1[2].w; 453 o1 = wp1[2].o; 454 455 pDstV[iPosY*iDstStride+iPosX] = weightBidir(w0,pSrcV0[iPosY*iSrc0Stride+iPosX], w1,pSrcV1[iPosY*iSrc1Stride+iPosX], round, shift, offset); 456 } 457 458 Void TComWeightPrediction::addWeightUni_DBMP( TComYuv* pcYuvSrc0, UInt iPartUnitIdx, UInt iPosX, Int iPosY, wpScalingParam *wp0, TComYuv* rpcYuvDst ) 459 { 460 Pel* pSrcY0 = pcYuvSrc0->getLumaAddr( iPartUnitIdx ); 461 Pel* pSrcU0 = pcYuvSrc0->getCbAddr ( iPartUnitIdx ); 462 Pel* pSrcV0 = pcYuvSrc0->getCrAddr ( iPartUnitIdx ); 463 464 Pel* pDstY = rpcYuvDst->getLumaAddr( iPartUnitIdx ); 465 Pel* pDstU = rpcYuvDst->getCbAddr ( iPartUnitIdx ); 466 Pel* pDstV = rpcYuvDst->getCrAddr ( iPartUnitIdx ); 467 468 // Luma : -------------------------------------------- 469 Int w0 = wp0[0].w; 470 Int offset = wp0[0].offset; 471 Int shift = wp0[0].shift; 472 Int round = wp0[0].round; 473 474 UInt iSrc0Stride = pcYuvSrc0->getStride(); 475 UInt iDstStride = rpcYuvDst->getStride(); 476 477 pDstY[iPosY*iDstStride+iPosX] = weightUnidir(w0,pSrcY0[iPosY*iSrc0Stride+iPosX], round, shift, offset); 478 479 // Chromas : -------------------------------------------- 480 iSrc0Stride = pcYuvSrc0->getCStride(); 481 iDstStride = rpcYuvDst->getCStride(); 482 483 iPosX = iPosX>>1; 484 iPosY = iPosY>>1; 485 486 // Chroma U : -------------------------------------------- 487 w0 = wp0[1].w; 488 offset = wp0[1].offset; 489 shift = wp0[1].shift; 490 round = wp0[1].round; 491 492 pDstU[iPosY*iDstStride+iPosX] = weightUnidir(w0,pSrcU0[iPosY*iSrc0Stride+iPosX], round, shift, offset); 493 494 // Chroma V : -------------------------------------------- 495 w0 = wp0[2].w; 496 offset = wp0[2].offset; 497 shift = wp0[2].shift; 498 round = wp0[2].round; 499 500 pDstV[iPosY*iDstStride+iPosX] = weightUnidir(w0,pSrcV0[iPosY*iSrc0Stride+iPosX], round, shift, offset); 501 } 502 503 Void TComWeightPrediction::xWeightedPredictionUni_DBMP( TComDataCU* pcCU, TComYuv* pcYuvSrc, UInt uiPartAddr, Int iPosX, Int iPosY, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx ) 504 { 505 wpScalingParam *pwp, *pwpTmp; 506 Int iRefIdx = pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr ); assert (iRefIdx >= 0); 507 Int ibdi = (g_uiBitDepth+g_uiBitIncrement); 508 509 if ( eRefPicList == REF_PIC_LIST_0 ) 510 { 511 getWpScaling(pcCU, iRefIdx, -1, pwp, pwpTmp, ibdi); 512 } 513 else 514 { 515 getWpScaling(pcCU, -1, iRefIdx, pwpTmp, pwp, ibdi); 516 } 517 addWeightUni_DBMP( pcYuvSrc, uiPartAddr, iPosX, iPosY, pwp, rpcYuvPred ); 518 } 519 520 Void TComWeightPrediction::xWeightedPredictionBi_DBMP( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartIdx, Int iPosX, Int iPosY, TComYuv* rpcYuvDst ) 521 { 522 wpScalingParam *pwp0, *pwp1; 523 TComPPS *pps = pcCU->getSlice()->getPPS(); 524 525 if ( !pps->getUseWP() ) { 526 printf("TComWeightPrediction::xWeightedPredictionBi():\tassert failed: useWP is false.\n"); 527 exit(0); 528 } 529 530 Int ibdi = (g_uiBitDepth+g_uiBitIncrement); 531 getWpScaling(pcCU, iRefIdx0, iRefIdx1, pwp0, pwp1, ibdi); 532 533 if( iRefIdx0 >= 0 && iRefIdx1 >= 0 ) 534 { 535 addWeightBi_DBMP(pcYuvSrc0, pcYuvSrc1, uiPartIdx, iPosX, iPosY, pwp0, pwp1, rpcYuvDst ); 536 } 537 else if ( iRefIdx0 >= 0 && iRefIdx1 < 0 ) 538 { 539 addWeightUni_DBMP( pcYuvSrc0, uiPartIdx, iPosX, iPosY, pwp0, rpcYuvDst ); 540 } 541 else if ( iRefIdx0 < 0 && iRefIdx1 >= 0 ) 542 { 543 addWeightUni_DBMP( pcYuvSrc1, uiPartIdx, iPosX, iPosY, pwp1, rpcYuvDst ); 544 } 545 else 546 assert (0); 547 548 } 549 #endif 550 395 551 #endif // WEIGHT_PRED 396 552 -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComWeightPrediction.h
r2 r28 37 37 Void xWeightedPredictionBi( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartIdx, Int iWidth, Int iHeight, TComYuv* rpcYuvDst ); 38 38 39 #if POZNAN_DBMP 40 Void addWeightBi_DBMP( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt iPartUnitIdx, UInt iPosX, Int iPosY, wpScalingParam *wp0, wpScalingParam *wp1, TComYuv* rpcYuvDst, Bool bRound=true ); 41 Void addWeightUni_DBMP( TComYuv* pcYuvSrc0, UInt iPartUnitIdx, UInt iPosX, Int iPosY, wpScalingParam *wp0, TComYuv* rpcYuvDst ); 42 43 Void xWeightedPredictionUni_DBMP( TComDataCU* pcCU, TComYuv* pcYuvSrc, UInt uiPartAddr, Int iPosX, Int iPosY, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx ); 44 Void xWeightedPredictionBi_DBMP( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartIdx, Int iPosX, Int iPosY, TComYuv* rpcYuvDst ); 45 #endif 46 39 47 __inline Pel xClip ( Int x ); 40 48 __inline Pel weightBidir( Int w0, Pel P0, Int w1, Pel P1, Int round, Int shift, Int offset); -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComYuv.cpp
r21 r28 387 387 } 388 388 389 #if POZNAN_DBMP 390 391 Void TComYuv::copyPartToPartYuv_DBMP ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt uiPosX, UInt uiPosY ) 392 { 393 copyPartToPartLuma_DBMP (pcYuvDst, uiPartIdx, uiPosX, uiPosY ); 394 copyPartToPartChroma_DBMP (pcYuvDst, uiPartIdx, uiPosX>>1, uiPosY>>1 ); 395 } 396 397 Void TComYuv::copyPartToPartLuma_DBMP ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt uiPosX, UInt uiPosY ) 398 { 399 Pel* pSrc = getLumaAddr(uiPartIdx); 400 Pel* pDst = pcYuvDst->getLumaAddr(uiPartIdx); 401 if( pSrc == pDst ) 402 { 403 //th not a good idea 404 //th best would be to fix the caller 405 return ; 406 } 407 408 UInt iSrcStride = getStride(); 409 UInt iDstStride = pcYuvDst->getStride(); 410 411 ::memcpy( pDst+uiPosY*iDstStride+uiPosX, pSrc+uiPosY*iSrcStride+uiPosX, sizeof(Pel) ); 412 } 413 414 Void TComYuv::copyPartToPartChroma_DBMP( TComYuv* pcYuvDst, UInt uiPartIdx, UInt uiPosX, UInt uiPosY ) 415 { 416 Pel* pSrcU = getCbAddr(uiPartIdx); 417 Pel* pSrcV = getCrAddr(uiPartIdx); 418 Pel* pDstU = pcYuvDst->getCbAddr(uiPartIdx); 419 Pel* pDstV = pcYuvDst->getCrAddr(uiPartIdx); 420 421 if( getCbAddr() == NULL || getCrAddr() == NULL || pcYuvDst->getCbAddr() == NULL || pcYuvDst->getCrAddr() == NULL ) //KUBA CHROMA 422 { 423 return ; 424 } 425 if( pSrcU == pDstU && pSrcV == pDstV) 426 { 427 //th not a good idea 428 //th best would be to fix the caller 429 return ; 430 } 431 432 UInt iSrcStride = getCStride(); 433 UInt iDstStride = pcYuvDst->getCStride(); 434 435 ::memcpy( pDstU+uiPosY*iDstStride+uiPosX, pSrcU+uiPosY*iSrcStride+uiPosX, sizeof(Pel) ); 436 ::memcpy( pDstV+uiPosY*iDstStride+uiPosX, pSrcV+uiPosY*iSrcStride+uiPosX, sizeof(Pel) ); 437 } 438 439 #if DEPTH_MAP_GENERATION 440 Void TComYuv::copyPartToPartYuvPdm_DBMP ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt uiPosX, UInt uiPosY, UInt uiSubSampExpX, UInt uiSubSampExpY ) 441 { 442 copyPartToPartLumaPdm_DBMP (pcYuvDst, uiPartIdx, uiPosX, uiPosY, uiSubSampExpX, uiSubSampExpY ); 443 } 444 445 Void TComYuv::copyPartToPartLumaPdm_DBMP ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt uiPosX, UInt uiPosY, UInt uiSubSampExpX, UInt uiSubSampExpY ) 446 { 447 UInt uiBlkX = g_auiRasterToPelX[ g_auiZscanToRaster[ uiPartIdx ] ] >> uiSubSampExpX; 448 UInt uiBlkY = g_auiRasterToPelY[ g_auiZscanToRaster[ uiPartIdx ] ] >> uiSubSampExpY; 449 Pel* pSrc = getLumaAddr(uiPartIdx); 450 Pel* pDst = pcYuvDst->getLumaAddr() + uiBlkY * pcYuvDst->getStride() + uiBlkX; 451 452 if( pSrc == pDst ) 453 { 454 //th not a good idea 455 //th best would be to fix the caller 456 return ; 457 } 458 459 UInt iSrcStride = getStride(); 460 UInt iDstStride = pcYuvDst->getStride(); 461 462 ::memcpy( pDst+uiPosY*iDstStride+uiPosX, pSrc+uiPosY*iSrcStride+uiPosX, sizeof(Pel) ); 463 } 464 465 #endif 466 467 #endif 468 389 469 Void TComYuv::addClipPartLuma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ) 390 470 { … … 862 942 #endif 863 943 944 #if POZNAN_DBMP 945 946 #ifdef ROUNDING_CONTROL_BIPRED 947 948 Void TComYuv::addAvg_DBMP( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt iPartUnitIdx, UInt iPosX, UInt iPosY, Bool bRound ) 949 { 950 Pel* pSrcY0 = pcYuvSrc0->getLumaAddr( iPartUnitIdx ); 951 Pel* pSrcU0 = pcYuvSrc0->getCbAddr ( iPartUnitIdx ); 952 Pel* pSrcV0 = pcYuvSrc0->getCrAddr ( iPartUnitIdx ); 953 954 Pel* pSrcY1 = pcYuvSrc1->getLumaAddr( iPartUnitIdx ); 955 Pel* pSrcU1 = pcYuvSrc1->getCbAddr ( iPartUnitIdx ); 956 Pel* pSrcV1 = pcYuvSrc1->getCrAddr ( iPartUnitIdx ); 957 958 Pel* pDstY = getLumaAddr( iPartUnitIdx ); 959 Pel* pDstU = getCbAddr ( iPartUnitIdx ); 960 Pel* pDstV = getCrAddr ( iPartUnitIdx ); 961 962 UInt iSrc0Stride = pcYuvSrc0->getStride(); 963 UInt iSrc1Stride = pcYuvSrc1->getStride(); 964 UInt iDstStride = getStride(); 965 966 #if HIGH_ACCURACY_BI 967 Int shiftNum = 15 - (g_uiBitDepth + g_uiBitIncrement); 968 Int offset = (1<<(shiftNum - 1)); 969 970 //Luma 971 (pDstY+iPosY*iDstStride)[iPosX] = Clip(((pSrcY0+iPosY*iSrc0Stride)[iPosX] + (pSrcY1+iPosY*iSrc1Stride)[iPosX] + offset) >> shiftNum ); 972 973 iSrc0Stride = pcYuvSrc0->getCStride(); 974 iSrc1Stride = pcYuvSrc1->getCStride(); 975 iDstStride = getCStride(); 976 977 //Chroma 978 (pDstU+(iPosY>>1)*iDstStride)[(iPosX>>1)] = Clip(((pSrcU0+(iPosY>>1)*iSrc0Stride)[(iPosX>>1)] + (pSrcU1+(iPosY>>1)*iSrc1Stride)[(iPosX>>1)] + offset) >> shiftNum ); 979 (pDstV+(iPosY>>1)*iDstStride)[(iPosX>>1)] = Clip(((pSrcV0+(iPosY>>1)*iSrc0Stride)[(iPosX>>1)] + (pSrcV1+(iPosY>>1)*iSrc1Stride)[(iPosX>>1)] + offset) >> shiftNum ); 980 981 #else 982 983 //Luma 984 (pDstY+iPosY*iDstStride)[iPosX] = ((pSrcY0+iPosY*iSrc0Stride)[iPosX] + (pSrcY1+iPosY*iSrc1Stride)[iPosX] + bRound) >> 1; 985 986 iSrc0Stride = pcYuvSrc0->getCStride(); 987 iSrc1Stride = pcYuvSrc1->getCStride(); 988 iDstStride = getCStride(); 989 990 //Chroma 991 (pDstU+(iPosY>>1)*iDstStride)[(iPosX>>1)] = ((pSrcU0+(iPosY>>1)*iSrc0Stride)[(iPosX>>1)] + (pSrcU1+(iPosY>>1)*iSrc1Stride)[(iPosX>>1)] + bRound) >> 1; 992 (pDstV+(iPosY>>1)*iDstStride)[(iPosX>>1)] = ((pSrcV0+(iPosY>>1)*iSrc0Stride)[(iPosX>>1)] + (pSrcV1+(iPosY>>1)*iSrc1Stride)[(iPosX>>1)] + bRound) >> 1; 993 #endif 994 } 995 996 #endif 997 998 Void TComYuv::addAvg_DBMP( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt iPartUnitIdx, UInt iPosX, UInt iPosY ) 999 { 1000 Pel* pSrcY0 = pcYuvSrc0->getLumaAddr( iPartUnitIdx ); 1001 Pel* pSrcU0 = pcYuvSrc0->getCbAddr ( iPartUnitIdx ); 1002 Pel* pSrcV0 = pcYuvSrc0->getCrAddr ( iPartUnitIdx ); 1003 1004 Pel* pSrcY1 = pcYuvSrc1->getLumaAddr( iPartUnitIdx ); 1005 Pel* pSrcU1 = pcYuvSrc1->getCbAddr ( iPartUnitIdx ); 1006 Pel* pSrcV1 = pcYuvSrc1->getCrAddr ( iPartUnitIdx ); 1007 1008 Pel* pDstY = getLumaAddr( iPartUnitIdx ); 1009 Pel* pDstU = getCbAddr ( iPartUnitIdx ); 1010 Pel* pDstV = getCrAddr ( iPartUnitIdx ); 1011 1012 UInt iSrc0Stride = pcYuvSrc0->getStride(); 1013 UInt iSrc1Stride = pcYuvSrc1->getStride(); 1014 UInt iDstStride = getStride(); 1015 #if HIGH_ACCURACY_BI 1016 Int shiftNum = 15 - (g_uiBitDepth + g_uiBitIncrement); 1017 Int offset = (1<<(shiftNum - 1)); 1018 1019 //Luma 1020 (pDstY+iPosY*iDstStride)[iPosX] = Clip(((pSrcY0+iPosY*iSrc0Stride)[iPosX] + (pSrcY1+iPosY*iSrc1Stride)[iPosX] + offset) >> shiftNum ); 1021 1022 iSrc0Stride = pcYuvSrc0->getCStride(); 1023 iSrc1Stride = pcYuvSrc1->getCStride(); 1024 iDstStride = getCStride(); 1025 1026 //Chroma 1027 (pDstU+(iPosY>>1)*iDstStride)[(iPosX>>1)] = Clip(((pSrcU0+(iPosY>>1)*iSrc0Stride)[(iPosX>>1)] + (pSrcU1+(iPosY>>1)*iSrc1Stride)[(iPosX>>1)] + offset) >> shiftNum ); 1028 (pDstV+(iPosY>>1)*iDstStride)[(iPosX>>1)] = Clip(((pSrcV0+(iPosY>>1)*iSrc0Stride)[(iPosX>>1)] + (pSrcV1+(iPosY>>1)*iSrc1Stride)[(iPosX>>1)] + offset) >> shiftNum ); 1029 1030 #else 1031 //Luma 1032 (pDstY+iPosY*iDstStride)[iPosX] = ((pSrcY0+iPosY*iSrc0Stride)[iPosX] + (pSrcY1+iPosY*iSrc1Stride)[iPosX] + 1) >> 1; 1033 1034 iSrc0Stride = pcYuvSrc0->getCStride(); 1035 iSrc1Stride = pcYuvSrc1->getCStride(); 1036 iDstStride = getCStride(); 1037 1038 //Chroma 1039 (pDstU+(iPosY>>1)*iDstStride)[(iPosX>>1)] = ((pSrcU0+(iPosY>>1)*iSrc0Stride)[(iPosX>>1)] + (pSrcU1+(iPosY>>1)*iSrc1Stride)[(iPosX>>1)] + 1) >> 1; 1040 (pDstV+(iPosY>>1)*iDstStride)[(iPosX>>1)] = ((pSrcV0+(iPosY>>1)*iSrc0Stride)[(iPosX>>1)] + (pSrcV1+(iPosY>>1)*iSrc1Stride)[(iPosX>>1)] + 1) >> 1; 1041 #endif 1042 } 1043 1044 #if DEPTH_MAP_GENERATION 1045 Void TComYuv::addAvgPdm_DBMP( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt iPartUnitIdx, UInt iPosX, UInt iPosY, UInt uiSubSampExpX, UInt uiSubSampExpY ) 1046 { 1047 UInt uiBlkX = g_auiRasterToPelX[ g_auiZscanToRaster[ iPartUnitIdx ] ] >> uiSubSampExpX; 1048 UInt uiBlkY = g_auiRasterToPelY[ g_auiZscanToRaster[ iPartUnitIdx ] ] >> uiSubSampExpY; 1049 Pel* pSrcY0 = pcYuvSrc0->getLumaAddr( iPartUnitIdx ); 1050 Pel* pSrcY1 = pcYuvSrc1->getLumaAddr( iPartUnitIdx ); 1051 Pel* pDstY = getLumaAddr() + uiBlkY * getStride() + uiBlkX; 1052 1053 UInt iSrc0Stride = pcYuvSrc0->getStride(); 1054 UInt iSrc1Stride = pcYuvSrc1->getStride(); 1055 UInt iDstStride = getStride(); 1056 1057 pDstY[iPosY*iDstStride+iPosX] = (pSrcY0[iPosY*iSrc0Stride+iPosX] + pSrcY1[iPosY*iSrc1Stride+iPosX] + 1) >> 1; 1058 } 1059 #endif 1060 1061 #endif 864 1062 865 1063 Void TComYuv::removeHighFreq( TComYuv* pcYuvSrc, UInt uiWidht, UInt uiHeight ) -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComYuv.h
r21 r28 118 118 #endif 119 119 120 #if POZNAN_DBMP 121 Void copyPartToPartYuv_DBMP ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt uiPosX, UInt uiPosY ); 122 Void copyPartToPartLuma_DBMP ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt uiPosX, UInt uiPosY ); 123 Void copyPartToPartChroma_DBMP ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt uiPosX, UInt uiPosY ); 124 #if DEPTH_MAP_GENERATION 125 Void copyPartToPartYuvPdm_DBMP ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt uiPosX, UInt uiPosY, UInt uiSubSampExpX, UInt uiSubSampExpY ); 126 Void copyPartToPartLumaPdm_DBMP ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt uiPosX, UInt uiPosY, UInt uiSubSampExpX, UInt uiSubSampExpY ); 127 #endif 128 #endif 129 120 130 // ------------------------------------------------------------------------------------------------------------------ 121 131 // Algebraic operation for YUV buffer … … 143 153 #endif 144 154 155 #if POZNAN_DBMP 156 #ifdef ROUNDING_CONTROL_BIPRED 157 Void addAvg_DBMP ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt iPartUnitIdx, UInt iPosX, UInt iPosY, Bool bRound ); 158 #endif 159 Void addAvg_DBMP ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt iPartUnitIdx, UInt iPosX, UInt iPosY ); 160 #if DEPTH_MAP_GENERATION 161 Void addAvgPdm_DBMP ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt iPartUnitIdx, UInt iPosX, UInt iPosY, UInt uiSubSampExpX, UInt uiSubSampExpY ); 162 #endif 163 #endif 164 145 165 // Remove High frequency 146 166 Void removeHighFreq ( TComYuv* pcYuvSrc, UInt uiWidht, UInt uiHeight ); -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TypeDef.h
r21 r28 65 65 //<<<<< HHI 3DV tools <<<<< 66 66 67 67 //<<<<< Poznan 3DV tools <<<<<< 68 #define POZNAN_CU_SKIP 1 //Poznan Cu Skip 69 #define POZNAN_CU_SYNTH 1 //Poznan Cu Synth 70 71 #define POZNAN_AVAIL_MAP 1 //Creates Availibity buffers in all needed classes 72 73 #define POZNAN_SYNTH_VIEW 1 //Creates view synthesis buffers in all needed classes 74 #define POZNAN_SYNTH_DEPTH 1 75 76 #define POZNAN_SYNTH 1 //Creates aligned synthesis classes in encoder and decoder 77 78 #define POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 1 //Poznan CU Skip 79 #define POZNAN_FILL_OCCLUDED_CU_WITH_SYNTHESIS 1 //Fill not sended CUs with synthesized data 80 81 #define POZNAN_VSO_FIX 0 82 83 #define POZNAN_CU_SKIP_PSNR 1 //Poznan Cu Skip Display psnr of the codded CUs only 84 85 #define POZNAN_NONLINEAR_DEPTH 1 /// Non-linear depth processing (Maciej Kurc) 86 #define POZNAN_NONLINEAR_DEPTH_SEND_AS_BYTE 1 /// Send DepthPower as byte instead of float 87 88 #if POZNAN_SYNTH 89 #define POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 1 /// Increase QP for texture CUs that are in the background (according to proper depth map). This QP change is not encoded in a bitstream 90 #endif 91 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 92 #define POZNAN_TEXTURE_TU_DELTA_QP_NOT_IN_BASE_VIEW 1 /// should not be disabled in current software version - no depth synthesis map is available for base view anyway 93 #define POZNAN_TEXTURE_TU_DELTA_QP_TOP_BOTTOM_CU_ROW 1 /// increase of QP param for top and bottom LCU row in frame 94 #define POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC 0 /// used for optimization of function calculating dQP from depth block max value. Standard values set if disabled. If enabled params are set in cfg file for encoder (no decoder is supported in that case). 95 #if !POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC 96 #define POZNAN_TEXTURE_TU_DELTA_QP_OFFSET (-2.6) 97 #define POZNAN_TEXTURE_TU_DELTA_QP_MUL (1) 98 #define POZNAN_TEXTURE_TU_DELTA_QP_TOP_BOTTOM_ROW_VAL (0) 99 #endif 100 #endif 101 102 #define POZNAN_MP 1 /// Depth-Based Multiview Prediction of CU parameters 103 #if POZNAN_MP 104 105 #define POZNAN_MP_USE_DEPTH_MAP_GENERATION 0 // determines if DEPTH_MAP_GENERATION is used for calculating corresponding pixel position in PUT multiview prediction (POZNAN_MP): 106 // POZNAN_MP_USE_DEPTH_MAP_GENERATION=1 - use DEPTH_MAP_GENERATION, 107 // POZNAN_MP_USE_DEPTH_MAP_GENERATION=0 - use reconstructed depth maps from neighboring views 108 109 #define POZNAN_MP_FILL 1 // Depth-Based Multiview Prediction of CU parameters with fill option for occluded areas 110 #if POZNAN_MP_FILL 111 #define POZNAN_MP_FILL_TYPE 0 // Variant of fill algorithm used for occluded areas (0 - smaller disparity, 1 - larger disparity) 112 #endif 113 114 // --------------------------------------- 115 116 #define POZNAN_DBMP 1 // Depth Based Motion Prediction prediction for MERGE 117 #if POZNAN_DBMP 118 #define POZNAN_DBMP_USE_FOR_TEXTURE 1 //use Depth Based Motion Prediction in texture pictures (0 - no, 1 -yes) 119 #define POZNAN_DBMP_USE_FOR_DEPTH 1 // use Depth Based Motion Prediction in depth pictures (0 - no, 1 -yes) 120 121 #define POZNAN_DBMP_CALC_PRED_DATA 1 // Depth Based Motion Prediction motion data used for prediction in other CUs is calculated based on all CU points (otherwise motion data for none-MP points is used for prediction) 122 #define POZNAN_DBMP_COMPRESS_ME_DATA 0 // Depth Based Motion Prediction derives representative motion data from reference CUs even if they are DBMP-based predicted (otherwise motion data is derived with per-point resolution for DBMP-based predicted reference CUs) 123 #define POZNAN_DBMP_USE_IN_NONANCHOR_PIC_ONLY 1 // determines if Depth Based Motion Prediction is used in non-anchor pictures only 124 #endif 125 126 #endif 127 128 129 //<<<<< Poznan 3DV tools <<<<<< 68 130 69 131 //////////////////////////// … … 345 407 typedef unsigned long ULong; 346 408 typedef double Double; 409 typedef float Float; 347 410 348 411 // ==================================================================================================================== … … 580 643 MODE_INTER, ///< inter-prediction mode 581 644 MODE_INTRA, ///< intra-prediction mode 645 #if POZNAN_SYNTH 646 MODE_SYNTH, ///< synth-mode 647 #endif 582 648 MODE_NONE = 15 583 649 }; -
branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecCAVLC.cpp
r5 r28 237 237 xReadFlag( uiCode ); pcSPS->setUseSAO ( uiCode ? true : false ); 238 238 #endif 239 239 #if POZNAN_DBMP 240 xReadFlag( uiCode ); 241 pcSPS->setDBMP ( uiCode ); 242 #endif 243 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 244 xReadFlag( uiCode ); 245 pcSPS->setUseCUSkip ( uiCode ); 246 #endif 240 247 xReadFlag( uiCode ); // SPS base view flag 241 248 if( uiCode ) … … 270 277 xReadFlag( uiCode ); 271 278 pcSPS->setUseMVI( uiCode ? true : false ); 279 #endif 280 #if POZNAN_NONLINEAR_DEPTH 281 #if POZNAN_NONLINEAR_DEPTH_SEND_AS_BYTE 282 uiCode = 0; 283 xReadCode(8, uiCode); 284 pcSPS->setDepthPower(dequantizeDepthPower(uiCode)); 285 #else 286 uiCode = 0; 287 xReadCode(sizeof(float)*8, uiCode); // We do not send seign 288 //uiCode &= ~0x80000000; 289 pcSPS->setDepthPower(*((float*)&uiCode)); 290 #endif 291 printf("\nfDepthPower = %f", pcSPS->getDepthPower()); 272 292 #endif 273 293 } … … 325 345 pcSPS->setMultiviewResPredMode ( uiMultiviewResPredMode ); 326 346 #endif 347 #endif 348 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 349 xReadFlag( uiCode ); 350 pcSPS->setUseTexDqpAccordingToDepth( uiCode ? true : false ); 327 351 #endif 328 352 #if HHI_MPI … … 2621 2645 2622 2646 2623 #if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI 2647 #if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI || POZNAN_DBMP 2624 2648 Void 2625 2649 TDecCavlc::parseMergeIndexMV( TComDataCU* pcCU, UInt& ruiMergeIndex, UInt uiAbsPartIdx, UInt uiDepth ) … … 2632 2656 uiNumCand++; 2633 2657 #endif 2658 #if POZNAN_DBMP 2659 UInt uiModIdx; 2660 const Bool bDBMPAvailable = pcCU->getSlice()->getMP()->isDBMPEnabled(); 2661 #endif 2634 2662 for( UInt uiIdx = 0; uiIdx < MRG_MAX_NUM_CANDS; uiIdx++ ) 2635 2663 { … … 2656 2684 if( uiIdx > uiMviMergePos ) 2657 2685 { 2686 #if POZNAN_DBMP 2687 if(bDBMPAvailable) 2688 { 2689 if(uiIdx==POZNAN_DBMP_MERGE_POS) uiModIdx = POZNAN_DBMP_MRG_CAND; 2690 else if(uiIdx>POZNAN_DBMP_MERGE_POS) uiModIdx = uiIdx--; 2691 else uiModIdx = uiIdx; 2692 } 2693 else uiModIdx = uiIdx; 2694 if( pcCU->getNeighbourCandIdx( uiModIdx-1, uiAbsPartIdx ) != uiModIdx ) 2695 { 2696 ruiMergeIndex++; 2697 } 2698 #else 2658 2699 if( pcCU->getNeighbourCandIdx( uiIdx - 1, uiAbsPartIdx ) != uiIdx ) 2659 2700 { 2660 2701 ruiMergeIndex++; 2661 2702 } 2703 #endif 2662 2704 } 2663 2705 else if( uiIdx < uiMviMergePos ) 2664 2706 #endif 2707 #if POZNAN_DBMP 2708 if(bDBMPAvailable) 2709 { 2710 if(uiIdx==POZNAN_DBMP_MERGE_POS) uiModIdx = POZNAN_DBMP_MRG_CAND; 2711 else if(uiIdx>POZNAN_DBMP_MERGE_POS) uiModIdx = uiIdx--; 2712 else uiModIdx = uiIdx; 2713 } 2714 else uiModIdx = uiIdx; 2715 if( pcCU->getNeighbourCandIdx( uiModIdx, uiAbsPartIdx ) != uiModIdx + 1 ) 2716 { 2717 ruiMergeIndex++; 2718 } 2719 #else 2665 2720 if( pcCU->getNeighbourCandIdx( uiIdx, uiAbsPartIdx ) != uiIdx + 1 ) 2666 2721 { 2667 2722 ruiMergeIndex++; 2668 2723 } 2724 #endif 2669 2725 } 2670 2726 #if HHI_MPI … … 2676 2732 { 2677 2733 pcCU->setTextureModeDepthSubParts( uiDepth, uiAbsPartIdx, uiDepth ); 2734 } 2735 #endif 2736 #if POZNAN_DBMP 2737 if(bDBMPAvailable) 2738 { 2739 if(ruiMergeIndex==POZNAN_DBMP_MERGE_POS) ruiMergeIndex = POZNAN_DBMP_MRG_CAND; 2740 else if(ruiMergeIndex>POZNAN_DBMP_MERGE_POS) ruiMergeIndex--; 2678 2741 } 2679 2742 #endif … … 2691 2754 Void TDecCavlc::parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex, UInt uiAbsPartIdx, UInt uiDepth ) 2692 2755 { 2693 #if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI 2756 #if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI || POZNAN_DBMP 2694 2757 if( 2695 2758 #if HHI_INTER_VIEW_MOTION_PRED … … 2698 2761 #if HHI_MPI 2699 2762 ( pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) || 2763 #endif 2764 #if POZNAN_DBMP 2765 ( pcCU->getSlice()->getMP()->isDBMPEnabled() ) || 2700 2766 #endif 2701 2767 0 -
branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecCAVLC.h
r5 r28 195 195 Void parseMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ); 196 196 Void parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex, UInt uiAbsPartIdx, UInt uiDepth ); 197 #if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI 197 #if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI || POZNAN_DBMP 198 198 Void parseMergeIndexMV ( TComDataCU* pcCU, UInt& ruiMergeIndex, UInt uiAbsPartIdx, UInt uiDepth ); 199 199 #endif -
branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecCu.cpp
r5 r28 49 49 m_ppcYuvReco = NULL; 50 50 m_ppcYuvResPred = NULL; 51 #if POZNAN_AVAIL_MAP 52 m_ppcYuvAvail = NULL; 53 #endif 54 #if POZNAN_SYNTH_VIEW 55 m_ppcYuvSynth = NULL; 56 #endif 51 57 m_ppcCU = NULL; 52 58 } … … 75 81 m_ppcYuvReco = new TComYuv* [m_uiMaxDepth-1]; 76 82 m_ppcYuvResPred = new TComYuv* [m_uiMaxDepth-1]; 83 #if POZNAN_AVAIL_MAP 84 m_ppcYuvAvail = new TComYuv* [m_uiMaxDepth-1]; 85 #endif 86 #if POZNAN_SYNTH_VIEW 87 m_ppcYuvSynth = new TComYuv* [m_uiMaxDepth-1]; 88 #endif 77 89 m_ppcCU = new TComDataCU* [m_uiMaxDepth-1]; 78 90 … … 87 99 m_ppcYuvReco [ui] = new TComYuv; m_ppcYuvReco [ui]->create( uiWidth, uiHeight ); 88 100 m_ppcYuvResPred[ui] = new TComYuv; m_ppcYuvResPred[ui]->create( uiWidth, uiHeight ); 101 #if POZNAN_AVAIL_MAP 102 m_ppcYuvAvail [ui] = new TComYuv; m_ppcYuvAvail [ui]->create( uiWidth, uiHeight ); 103 #endif 104 #if POZNAN_SYNTH_VIEW 105 m_ppcYuvSynth [ui] = new TComYuv; m_ppcYuvSynth [ui]->create( uiWidth, uiHeight ); 106 #endif 107 89 108 m_ppcCU [ui] = new TComDataCU; m_ppcCU [ui]->create( uiNumPartitions, uiWidth, uiHeight, true ); 90 109 } … … 106 125 m_ppcYuvReco [ui]->destroy(); delete m_ppcYuvReco [ui]; m_ppcYuvReco [ui] = NULL; 107 126 m_ppcYuvResPred[ui]->destroy(); delete m_ppcYuvResPred[ui]; m_ppcYuvResPred[ui] = NULL; 127 #if POZNAN_AVAIL_MAP 128 m_ppcYuvAvail [ui]->destroy(); delete m_ppcYuvAvail [ui]; m_ppcYuvAvail [ui] = NULL; 129 #endif 130 #if POZNAN_SYNTH_VIEW 131 m_ppcYuvSynth [ui]->destroy(); delete m_ppcYuvSynth [ui]; m_ppcYuvSynth [ui] = NULL; 132 #endif 108 133 m_ppcCU [ui]->destroy(); delete m_ppcCU [ui]; m_ppcCU [ui] = NULL; 109 134 } … … 112 137 delete [] m_ppcYuvReco; m_ppcYuvReco = NULL; 113 138 delete [] m_ppcYuvResPred; m_ppcYuvResPred = NULL; 139 #if POZNAN_AVAIL_MAP 140 delete [] m_ppcYuvAvail; m_ppcYuvAvail = NULL; 141 #endif 142 #if POZNAN_SYNTH_VIEW 143 delete [] m_ppcYuvSynth; m_ppcYuvSynth = NULL; 144 #endif 145 114 146 delete [] m_ppcCU; m_ppcCU = NULL; 115 147 } … … 184 216 { 185 217 TComPic* pcPic = pcCU->getPic(); 218 219 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 220 Bool bWholeCUCanBeSynthesized = false; 221 Bool bOneSubCUCanNotBeSynthesied = false; 222 Bool bSubCUCanBeSynthesized[4]; 223 Bool * pbSubCUCanBeSynthesized = bSubCUCanBeSynthesized; 224 pcPic->checkSynthesisAvailability(pcCU, pcCU->getAddr(), uiAbsPartIdx, uiDepth, pbSubCUCanBeSynthesized); //KUBA SYNTH 225 Int iSubCUCanNotBeSynthesized = 0; 226 Int iSubCUCanBeSynthesizedCnt = 0; 227 for(Int i = 0; i < 4; i++) 228 { 229 if (!bSubCUCanBeSynthesized[i]) 230 { 231 iSubCUCanNotBeSynthesized = i; 232 } 233 else 234 { 235 iSubCUCanBeSynthesizedCnt ++; 236 } 237 } 238 if(iSubCUCanBeSynthesizedCnt == 4) 239 { 240 bWholeCUCanBeSynthesized = true; 241 } 242 else if(iSubCUCanBeSynthesizedCnt == 3) 243 { 244 bOneSubCUCanNotBeSynthesied = true; 245 } 246 247 if(bWholeCUCanBeSynthesized) 248 { 249 pcCU->setPredModeSubParts( MODE_SYNTH, uiAbsPartIdx, uiDepth ); 250 pcCU->setDepthSubParts( uiDepth, uiAbsPartIdx ); 251 pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 252 pcCU->setSizeSubParts( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth ); 253 //pcCU->setSizeSubParts( pcCU->getSlice()->getSPS()->getMaxCUWidth()>>uiDepth, pcCU->getSlice()->getSPS()->getMaxCUHeight()>>uiDepth, uiAbsPartIdx, uiDepth ); 254 return; 255 } 256 #endif 257 186 258 UInt uiCurNumParts = pcPic->getNumPartInCU() >> (uiDepth<<1); 187 259 UInt uiQNumParts = uiCurNumParts>>2; … … 195 267 if( ( uiRPelX < pcCU->getSlice()->getSPS()->getWidth() ) && ( uiBPelY < pcCU->getSlice()->getSPS()->getHeight() ) ) 196 268 { 269 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 270 if(bOneSubCUCanNotBeSynthesied && (uiDepth < g_uiMaxCUDepth - g_uiAddCUDepth )) // Check if CU has 3 synthesied subCU - no split flag is send in that case and CU split is assumed 271 { 272 pcCU->setDepthSubParts( uiDepth + 1, uiAbsPartIdx ); 273 } 274 else 275 #endif 197 276 #if HHI_MPI 198 277 if( pcCU->getTextureModeDepth( uiAbsPartIdx ) == -1 || uiDepth < pcCU->getTextureModeDepth( uiAbsPartIdx ) ) … … 367 446 { 368 447 TComPic* pcPic = pcCU->getPic(); 448 #if POZNAN_SYNTH_VIEW 449 if(pcPic->getPicYuvSynth()) m_ppcYuvSynth[uiDepth]->copyFromPicYuv( pcPic->getPicYuvSynth(), pcCU->getAddr(), uiAbsPartIdx ); 450 #endif 451 #if POZNAN_AVAIL_MAP 452 if(pcPic->getPicYuvAvail()) m_ppcYuvAvail[uiDepth]->copyFromPicYuv( pcPic->getPicYuvAvail(), pcCU->getAddr(), uiAbsPartIdx ); 453 #endif 369 454 370 455 Bool bBoundary = false; … … 411 496 xReconIntraQT( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth ); 412 497 break; 498 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 499 case MODE_SYNTH: 500 // break; 501 #if POZNAN_FILL_OCCLUDED_CU_WITH_SYNTHESIS 502 m_ppcYuvReco[uiDepth]->copyFromPicYuv(pcPic->getPicYuvSynth(), pcCU->getAddr(), uiAbsPartIdx); 503 #else 504 m_ppcYuvReco[uiDepth]->copyFromPicYuv(pcPic->getPicYuvAvail(), pcCU->getAddr(), uiAbsPartIdx); //Poprawiæ 505 #endif 506 //m_ppcYuvReco[uiDepth]->clear(); 507 break; 508 #endif 413 509 default: 414 510 assert(0); … … 485 581 m_pcPrediction->predIntraLumaAng( pcPattern, pcCU->getLumaIntraDir(uiPartIdx), pPred, uiStride, uiWidth, uiHeight, pcCU, bAboveAvail, bLeftAvail ); 486 582 583 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 584 m_pcTrQuant->setQPforQuant( pcCU->getQP(uiPartIdx) + pcCU->getQpOffsetForTextCU(uiPartIdx, true), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA ); 585 #else 487 586 m_pcTrQuant->setQPforQuant( pcCU->getQP(uiPartIdx), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA ); 587 #endif 488 588 #if INTRA_DST_TYPE_7 489 589 m_pcTrQuant->invtransformNxN(TEXT_LUMA, pcCU->getLumaIntraDir(uiPartIdx), pResi, uiStride, pCoeff, uiWidth, uiHeight ); … … 682 782 } 683 783 //===== inverse transform ===== 784 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 785 m_pcTrQuant->setQPforQuant( pcCU->getQP(0) + pcCU->getQpOffsetForTextCU(uiAbsPartIdx, true), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA ); 786 #else 684 787 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA ); 788 #endif 685 789 #if INTRA_DST_TYPE_7 686 790 m_pcTrQuant->invtransformNxN( TEXT_LUMA, pcCU->getLumaIntraDir( uiAbsPartIdx ), piResi, uiStride, pcCoeff, uiWidth, uiHeight ); … … 789 893 790 894 //===== inverse transform ===== 895 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 896 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0) + pcCU->getQpOffsetForTextCU(uiAbsPartIdx, true), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), eText ); 897 #else 791 898 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), eText ); 899 #endif 792 900 #if INTRA_DST_TYPE_7 793 901 m_pcTrQuant->invtransformNxN( eText, REG_DCT, piResi, uiStride, pcCoeff, uiWidth, uiHeight ); … … 965 1073 piCoeff = pcCU->getCoeffY(); 966 1074 pResi = m_ppcYuvResi[uiDepth]->getLumaAddr(); 1075 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 1076 Int QPoffset = pcCU->getQpOffsetForTextCU(uiAbsPartIdx, false); 1077 m_pcTrQuant->setQPforQuant ( pcCU->getQP(uiAbsPartIdx) + QPoffset, !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA ); 1078 #else 967 1079 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA ); 1080 #endif 968 1081 m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_LUMA, pResi, 0, m_ppcYuvResi[uiDepth]->getStride(), uiWidth, uiHeight, uiLumaTrMode, 0, piCoeff ); 969 1082 970 1083 // Cb and Cr 1084 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 1085 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ) + QPoffset, !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_CHROMA ); 1086 #else 971 1087 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_CHROMA ); 1088 #endif 972 1089 973 1090 uiWidth >>= 1; -
branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecCu.h
r5 r28 61 61 TComYuv** m_ppcYuvReco; ///< array of prediction & reconstruction buffer 62 62 TComYuv** m_ppcYuvResPred; ///< residual prediction buffer 63 #if POZNAN_AVAIL_MAP 64 TComYuv** m_ppcYuvAvail; ///< array of available map buffer 65 #endif 66 #if POZNAN_SYNTH_VIEW 67 TComYuv** m_ppcYuvSynth; ///< array of synth buffer 68 #endif 63 69 TComDataCU** m_ppcCU; ///< CU data array 64 70 -
branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecEntropy.cpp
r5 r28 430 430 pcCU->setInterDirSubParts( puhInterDirNeighbours[uiMergeIndex], uiAbsPartIdx, uiPartIdx, uiDepth ); 431 431 432 #if POZNAN_DBMP_CALC_PRED_DATA 433 Int ref_idx0_DBMP,ref_idx1_DBMP; 434 TComMv cMv0_DBMP( 0, 0 ),cMv1_DBMP( 0, 0 ); 435 if(uiMergeIndex==POZNAN_DBMP_MRG_CAND) 436 { 437 pcCU->getCUMvField2nd( REF_PIC_LIST_0 )->setAllMvField( pcMvFieldNeighbours[ 2*uiMergeIndex ].getMv(), pcMvFieldNeighbours[ 2*uiMergeIndex ].getRefIdx(), eCUMode, uiAbsPartIdx, uiPartIdx, uiDepth ); 438 pcCU->getCUMvField2nd( REF_PIC_LIST_1 )->setAllMvField( pcMvFieldNeighbours[ 2*uiMergeIndex + 1 ].getMv(), pcMvFieldNeighbours[ 2*uiMergeIndex + 1 ].getRefIdx(), eCUMode, uiAbsPartIdx, uiPartIdx, uiDepth ); 439 pcCU->getSlice()->getMP()->calcDBMPPredData(pcCU, uiAbsPartIdx, ref_idx0_DBMP, cMv0_DBMP, ref_idx1_DBMP, cMv1_DBMP); 440 } 441 #endif 442 432 443 TComMv cTmpMv( 0, 0 ); 433 444 if ( pcCU->getSlice()->getNumRefIdx( REF_PIC_LIST_0 ) > 0 ) //if ( ref. frame list0 has at least 1 entry ) … … 436 447 pcCU->setMVPNumSubParts( 0, REF_PIC_LIST_0, uiAbsPartIdx, uiPartIdx, uiDepth); 437 448 pcCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvd( cTmpMv, eCUMode, uiAbsPartIdx, uiPartIdx, uiDepth ); 449 #if POZNAN_DBMP_CALC_PRED_DATA 450 if(uiMergeIndex==POZNAN_DBMP_MRG_CAND) 451 pcCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMv0_DBMP, ref_idx0_DBMP, eCUMode, uiAbsPartIdx, uiPartIdx, uiDepth ); 452 else 453 #endif 438 454 pcCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( pcMvFieldNeighbours[ 2*uiMergeIndex ].getMv(), pcMvFieldNeighbours[ 2*uiMergeIndex ].getRefIdx(), eCUMode, uiAbsPartIdx, uiPartIdx, uiDepth ); 439 455 … … 444 460 pcCU->setMVPNumSubParts( 0, REF_PIC_LIST_1, uiAbsPartIdx, uiPartIdx, uiDepth); 445 461 pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvd( cTmpMv, eCUMode, uiAbsPartIdx, uiPartIdx, uiDepth ); 462 #if POZNAN_DBMP_CALC_PRED_DATA 463 if(uiMergeIndex==POZNAN_DBMP_MRG_CAND) 464 pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMv1_DBMP, ref_idx1_DBMP, eCUMode, uiAbsPartIdx, uiPartIdx, uiDepth ); 465 else 466 #endif 446 467 pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( pcMvFieldNeighbours[ 2*uiMergeIndex + 1 ].getMv(), pcMvFieldNeighbours[ 2*uiMergeIndex + 1 ].getRefIdx(), eCUMode, uiAbsPartIdx, uiPartIdx, uiDepth ); 447 468 } -
branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecGop.cpp
r5 r28 199 199 #endif 200 200 201 #if POZNAN_MP 202 if( uiStartCUAddr == 0 ) 203 { 204 #if POZNAN_MP_USE_DEPTH_MAP_GENERATION 205 pcSlice->getMP()->setDepthMapGenerator(m_pcDepthMapGenerator); 206 #endif 207 pcSlice->getMP()->pairMultiview(rpcPic); 208 } 209 #endif 210 201 211 // decode slice 202 212 m_pcSliceDecoder->decompressSlice(pcBitstream, rpcPic); -
branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecSbac.cpp
r5 r28 579 579 580 580 581 #if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI 581 #if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI || POZNAN_DBMP 582 582 Void TDecSbac::parseMergeIndexMV( TComDataCU* pcCU, UInt& ruiMergeIndex, UInt uiAbsPartIdx, UInt uiDepth ) 583 583 { … … 585 585 const Bool bMVIAvailable = pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE; 586 586 const UInt uiMviMergePos = bMVIAvailable ? HHI_MPI_MERGE_POS : MRG_MAX_NUM_CANDS; 587 #endif 588 #if POZNAN_DBMP 589 const Bool bDBMPAvailable = pcCU->getSlice()->getMP()->isDBMPEnabled(); 590 Bool bDBMPModifyMergeIdx = true; 587 591 #endif 588 592 //--- set number of candidates and availability --- … … 611 615 } 612 616 } 617 618 #if POZNAN_DBMP 619 if(bDBMPAvailable) 620 { 621 UInt uiDBMPMergePos = POZNAN_DBMP_MERGE_POS; 622 #if HHI_MPI 623 if(bMVIAvailable && uiDBMPMergePos>=uiMviMergePos) uiDBMPMergePos++; 624 #endif 625 for( Int iIdx = MRG_MAX_NUM_CANDS-2; iIdx >= (Int)uiDBMPMergePos; iIdx-- ) 626 { 627 Int iWrIdx = iIdx+1; 628 #if HHI_MPI 629 if(bMVIAvailable) 630 { 631 if(iIdx==(Int)uiMviMergePos) continue; 632 if(iWrIdx==(Int)uiMviMergePos) iWrIdx++; 633 } 634 #endif 635 if(iWrIdx>=MRG_MAX_NUM_CANDS) continue; 636 637 abAvailable[ iWrIdx ] = abAvailable[ iIdx ]; 638 } 639 abAvailable[ uiDBMPMergePos ] = ( pcCU->getNeighbourCandIdx( POZNAN_DBMP_MRG_CAND, uiAbsPartIdx ) == POZNAN_DBMP_MRG_CAND + 1 ); 640 641 uiNumCand = 0; for( UInt uiIdx = 0; uiIdx < MRG_MAX_NUM_CANDS; uiIdx++ ) if(abAvailable[ uiIdx ]) uiNumCand++; 642 } 643 #endif 644 613 645 AOF( uiNumCand > 1 ); 614 646 … … 665 697 { 666 698 pcCU->setTextureModeDepthSubParts( uiDepth, uiAbsPartIdx, uiDepth ); 699 #if POZNAN_DBMP 700 bDBMPModifyMergeIdx = false; 701 #endif 702 } 703 #endif 704 705 #if POZNAN_DBMP 706 if(bDBMPAvailable && bDBMPModifyMergeIdx) 707 { 708 if(ruiMergeIndex==POZNAN_DBMP_MERGE_POS) ruiMergeIndex = POZNAN_DBMP_MRG_CAND; 709 else if(ruiMergeIndex>POZNAN_DBMP_MERGE_POS) ruiMergeIndex--; 667 710 } 668 711 #endif … … 694 737 Void TDecSbac::parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex, UInt uiAbsPartIdx, UInt uiDepth ) 695 738 { 696 #if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI 739 #if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI || POZNAN_DBMP 697 740 if( 698 741 #if HHI_INTER_VIEW_MOTION_PRED … … 701 744 #if HHI_MPI 702 745 ( pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) || 746 #endif 747 #if POZNAN_DBMP 748 ( pcCU->getSlice()->getMP()->isDBMPEnabled() ) || 703 749 #endif 704 750 0 -
branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecSbac.h
r5 r28 144 144 Void parseMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ); 145 145 Void parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex, UInt uiAbsPartIdx, UInt uiDepth ); 146 #if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI 146 #if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI || POZNAN_DBMP 147 147 Void parseMergeIndexMV ( TComDataCU* pcCU, UInt& ruiMergeIndex, UInt uiAbsPartIdx, UInt uiDepth ); 148 148 #endif -
branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecTop.cpp
r21 r28 53 53 m_aaiCodedScale [ uiId ] = new Int [ MAX_NUMBER_VIEWS ]; 54 54 } 55 #if POZNAN_SYNTH || (POZNAN_MP && !POZNAN_MP_USE_DEPTH_MAP_GENERATION) 56 xCreateLUTs ( (UInt)MAX_NUMBER_VIEWS, (UInt)MAX_NUMBER_VIEWS, m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT); 57 58 m_iLog2Precision = LOG2_DISP_PREC_LUT; 59 m_uiBitDepthForLUT = 8; //fixed 60 #endif 55 61 } 56 62 … … 66 72 delete [] m_aiViewOrderIndex; 67 73 delete [] m_aiViewReceived; 74 75 #if POZNAN_SYNTH || (POZNAN_MP && !POZNAN_MP_USE_DEPTH_MAP_GENERATION) 76 xDeleteArray( m_adBaseViewShiftLUT, MAX_NUMBER_VIEWS, MAX_NUMBER_VIEWS, 2 ); 77 xDeleteArray( m_aiBaseViewShiftLUT, MAX_NUMBER_VIEWS, MAX_NUMBER_VIEWS, 2 ); 78 #endif 68 79 } 69 80 … … 78 89 m_iLastPOC = -1; 79 90 m_uiMaxViewId = 0; 80 } 91 #if POZNAN_NONLINEAR_DEPTH 92 m_fDepthPower = 1.0; 93 #endif 94 } 95 96 #if POZNAN_SYNTH || (POZNAN_MP && !POZNAN_MP_USE_DEPTH_MAP_GENERATION) 97 Void 98 CamParsCollector::xCreateLUTs( UInt uiNumberSourceViews, UInt uiNumberTargetViews, Double****& radLUT, Int****& raiLUT) 99 { 100 //AOF( m_uiBitDepthForLUT == 8 ); 101 //AOF(radLUT == NULL && raiLUT == NULL ); 102 103 uiNumberSourceViews = Max( 1, uiNumberSourceViews ); 104 uiNumberTargetViews = Max( 1, uiNumberTargetViews ); 105 106 radLUT = new Double***[ uiNumberSourceViews ]; 107 raiLUT = new Int ***[ uiNumberSourceViews ]; 108 109 for( UInt uiSourceView = 0; uiSourceView < uiNumberSourceViews; uiSourceView++ ) 110 { 111 radLUT [ uiSourceView ] = new Double**[ uiNumberTargetViews ]; 112 raiLUT [ uiSourceView ] = new Int **[ uiNumberTargetViews ]; 113 114 for( UInt uiTargetView = 0; uiTargetView < uiNumberTargetViews; uiTargetView++ ) 115 { 116 radLUT [ uiSourceView ][ uiTargetView ] = new Double*[ 2 ]; 117 radLUT [ uiSourceView ][ uiTargetView ][ 0 ] = new Double [ 257 ]; 118 radLUT [ uiSourceView ][ uiTargetView ][ 1 ] = new Double [ 257 ]; 119 120 raiLUT [ uiSourceView ][ uiTargetView ] = new Int* [ 2 ]; 121 raiLUT [ uiSourceView ][ uiTargetView ][ 0 ] = new Int [ 257 ]; 122 raiLUT [ uiSourceView ][ uiTargetView ][ 1 ] = new Int [ 257 ]; 123 } 124 } 125 } 126 127 Void 128 CamParsCollector::xInitLUTs( UInt uiSourceView, UInt uiTargetView, Int iScale, Int iOffset, Double****& radLUT, Int****& raiLUT) 129 { 130 Int iLog2DivLuma = m_uiBitDepthForLUT + m_uiCamParsCodedPrecision + 1 - m_iLog2Precision; AOF( iLog2DivLuma > 0 ); 131 Int iLog2DivChroma = iLog2DivLuma + 1; 132 133 iOffset <<= m_uiBitDepthForLUT; 134 135 Double dScale = (Double) iScale / (( Double ) ( 1 << iLog2DivLuma )); 136 Double dOffset = (Double) iOffset / (( Double ) ( 1 << iLog2DivLuma )); 137 138 // offsets including rounding offsets 139 Int64 iOffsetLuma = iOffset + ( ( 1 << iLog2DivLuma ) >> 1 ); 140 Int64 iOffsetChroma = iOffset + ( ( 1 << iLog2DivChroma ) >> 1 ); 141 142 #if POZNAN_NONLINEAR_DEPTH 143 TComNonlinearDepthBackward cNonlinearDepthBwd(m_fDepthPower, (POZNAN_LUT_INCREASED_PRECISION) ? g_uiBitIncrement : 0, (POZNAN_LUT_INCREASED_PRECISION) ? g_uiBitIncrement : 0); 144 #endif 145 146 for( UInt uiDepthValue = 0; uiDepthValue < 256; uiDepthValue++ ) 147 { 148 Double dDepthValue = (Double)uiDepthValue; 149 Int64 iDepthValue = (Int64)uiDepthValue; 150 #if POZNAN_NONLINEAR_DEPTH 151 dDepthValue = cNonlinearDepthBwd(dDepthValue); 152 iDepthValue = (Int64)(dDepthValue+0.5); 153 #endif 154 #if POZNAN_LUT_INCREASED_PRECISION 155 dDepthValue /= (1<<g_uiBitIncrement); 156 #endif 157 158 // real-valued look-up tables 159 Double dShiftLuma = ( dDepthValue * dScale + dOffset ) * Double( 1 << m_iLog2Precision ); 160 Double dShiftChroma = dShiftLuma / 2; 161 radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = dShiftLuma; 162 radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = dShiftChroma; 163 164 // integer-valued look-up tables 165 Int64 iTempScale = iDepthValue * iScale; 166 #if POZNAN_LUT_INCREASED_PRECISION 167 iTempScale >>= g_uiBitIncrement; 168 #endif 169 Int64 iTestScale = ( iTempScale + iOffset ); // for checking accuracy of camera parameters 170 Int64 iShiftLuma = ( iTempScale + iOffsetLuma ) >> iLog2DivLuma; 171 Int64 iShiftChroma = ( iTempScale + iOffsetChroma ) >> iLog2DivChroma; 172 raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = (Int)iShiftLuma; 173 raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = (Int)iShiftChroma; 174 175 // maximum deviation 176 //dMaxDispDev = Max( dMaxDispDev, fabs( Double( (Int) iTestScale ) - dShiftLuma * Double( 1 << iLog2DivLuma ) ) / Double( 1 << iLog2DivLuma ) ); 177 //dMaxRndDispDvL = Max( dMaxRndDispDvL, fabs( Double( (Int) iShiftLuma ) - dShiftLuma ) ); 178 //dMaxRndDispDvC = Max( dMaxRndDispDvC, fabs( Double( (Int) iShiftChroma ) - dShiftChroma ) ); 179 } 180 181 radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 255 ]; 182 radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 255 ]; 183 raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 255 ]; 184 raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 255 ]; 185 } 186 187 Bool 188 CamParsCollector::getNearestBaseView( Int iSynthViewIdx, Int &riNearestViewIdx, Int &riRelDistToLeft, Bool& rbRenderFromLeft) 189 { 190 /* 191 riNearestViewIdx = 0; 192 193 Bool bDecencdingVN = ( m_aiSortedBaseViews.size() >= 2 && m_aiSortedBaseViews[ 0 ] > m_aiSortedBaseViews[ 1 ] ); 194 Int iFactor = ( bDecencdingVN ? -1 : 1 ); 195 196 if( ( m_aiBaseId2SortedId[iSynthViewIdx] - m_aiBaseId2SortedId[riNearestViewIdx] ) * iFactor <= 0 ) 197 { 198 rbRenderFromLeft = true; 199 } 200 else 201 { 202 rbRenderFromLeft = false; 203 } 204 205 riRelDistToLeft = 128; //Not used for now; 206 //*/ 207 return true; 208 } 209 210 #endif 81 211 82 212 Void … … 102 232 if ( pcSlice->getSPS()->isDepth () ) 103 233 { 234 #if POZNAN_NONLINEAR_DEPTH 235 m_fDepthPower = pcSlice->getSPS()->getDepthPower(); 236 #endif 104 237 return; 238 } 239 else 240 { 241 #if POZNAN_NONLINEAR_DEPTH 242 pcSlice->getSPS()->setDepthPower(m_fDepthPower); // OLGIERD: ToDo - QP-Tex should not use getDepthPower() from texture SPS. 243 #endif 105 244 } 106 245 Bool bFirstAU = ( pcSlice->getPOC() == 0 ); … … 161 300 m_aaiCodedScale [ uiViewId ][ uiBaseId ] = pcSlice->getInvCodedScale () [ uiBaseId ]; 162 301 m_aaiCodedOffset[ uiViewId ][ uiBaseId ] = pcSlice->getInvCodedOffset() [ uiBaseId ]; 302 #if POZNAN_SYNTH || (POZNAN_MP && !POZNAN_MP_USE_DEPTH_MAP_GENERATION) 303 xInitLUTs(uiBaseId,uiViewId,m_aaiCodedScale [ uiBaseId ][ uiViewId ],m_aaiCodedOffset[ uiBaseId ][ uiViewId ],m_adBaseViewShiftLUT,m_aiBaseViewShiftLUT); 304 xInitLUTs(uiViewId,uiBaseId,m_aaiCodedScale [ uiViewId ][ uiBaseId ],m_aaiCodedOffset[ uiViewId ][ uiBaseId ],m_adBaseViewShiftLUT,m_aiBaseViewShiftLUT); 305 #endif 163 306 } 164 307 else … … 168 311 m_aaiCodedScale [ uiViewId ][ uiBaseId ] = pcSlice->getSPS()->getInvCodedScale () [ uiBaseId ]; 169 312 m_aaiCodedOffset[ uiViewId ][ uiBaseId ] = pcSlice->getSPS()->getInvCodedOffset() [ uiBaseId ]; 313 #if POZNAN_SYNTH || (POZNAN_MP && !POZNAN_MP_USE_DEPTH_MAP_GENERATION) 314 xInitLUTs(uiBaseId,uiViewId,m_aaiCodedScale [ uiBaseId ][ uiViewId ],m_aaiCodedOffset[ uiBaseId ][ uiViewId ],m_adBaseViewShiftLUT,m_aiBaseViewShiftLUT); 315 xInitLUTs(uiViewId,uiBaseId,m_aaiCodedScale [ uiViewId ][ uiBaseId ],m_aaiCodedOffset[ uiViewId ][ uiBaseId ],m_adBaseViewShiftLUT,m_aiBaseViewShiftLUT); 316 #endif 170 317 } 171 318 } … … 182 329 m_aaiCodedScale [ uiViewId ][ uiBaseId ] = pcSlice->getInvCodedScale () [ uiBaseId ]; 183 330 m_aaiCodedOffset[ uiViewId ][ uiBaseId ] = pcSlice->getInvCodedOffset() [ uiBaseId ]; 331 #if POZNAN_SYNTH || (POZNAN_MP && !POZNAN_MP_USE_DEPTH_MAP_GENERATION) 332 xInitLUTs(uiBaseId,uiViewId,m_aaiCodedScale [ uiBaseId ][ uiViewId ],m_aaiCodedOffset[ uiBaseId ][ uiViewId ],m_adBaseViewShiftLUT,m_aiBaseViewShiftLUT); 333 xInitLUTs(uiViewId,uiBaseId,m_aaiCodedScale [ uiViewId ][ uiBaseId ],m_aaiCodedOffset[ uiViewId ][ uiBaseId ],m_adBaseViewShiftLUT,m_aiBaseViewShiftLUT); 334 #endif 184 335 } 185 336 } … … 269 420 m_bFirstSliceInSequence = true; 270 421 m_pcCamParsCollector = 0; 422 #if POZNAN_MP 423 m_pcMP = NULL; 424 #endif 271 425 } 272 426 … … 299 453 #if HHI_INTER_VIEW_RESIDUAL_PRED 300 454 m_cResidualGenerator.destroy(); 455 #endif 456 457 #if POZNAN_MP 458 m_pcMP = NULL; 301 459 #endif 302 460 } … … 336 494 m_cResidualGenerator.init( &m_cTrQuant, &m_cDepthMapGenerator ); 337 495 #endif 496 497 #if POZNAN_MP 498 m_pcMP = pcTAppDecTop->getMP(); 499 #endif 338 500 } 339 501 … … 462 624 #if HHI_INTERVIEW_SKIP 463 625 pcPic->removeUsedPelsMapBuffer(); 626 #endif 627 #if POZNAN_AVAIL_MAP 628 pcPic->removeAvailabilityBuffer(); 629 #endif 630 #if POZNAN_SYNTH_VIEW 631 pcPic->removeSynthesisBuffer(); 632 #endif 633 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 634 pcPic->removeSynthesisDepthBuffer(); 464 635 #endif 465 636 } … … 549 720 else 550 721 { 722 #if POZNAN_NONLINEAR_DEPTH 723 // For texture complete depth power information. Depth power is sended, for example, for base view depth map and it should be available prior non-base texture decoding 724 if(!cTempSPS.isDepth() && cTempSPS.getViewId()) 725 { 726 Float fDepthPower = getDecTop()->getPicFromView( 0, pcPic->getPOC(), true )->getSPS()->getDepthPower(); 727 cTempSPS.setDepthPower(fDepthPower); 728 } 729 #endif 551 730 cComSPS = cTempSPS; 552 731 return false; … … 563 742 } 564 743 m_uiValidPS |= 1; 744 745 #if POZNAN_MP 746 #if POZNAN_MP_USE_DEPTH_MAP_GENERATION 747 m_pcMP->init( m_cSPS.getHeight(), m_cSPS.getWidth() ); 748 #else 749 m_pcMP->init( m_cSPS.getHeight(), m_cSPS.getWidth(), m_pcCamParsCollector->getBaseViewShiftLUTI()); 750 #endif 751 #endif 565 752 566 753 return false; … … 686 873 m_apcSlicePilot = pcPic->getPicSym()->getSlice(m_uiSliceIdx); 687 874 pcPic->getPicSym()->setSlice(pcSlice, m_uiSliceIdx); 875 876 #if POZNAN_MP 877 pcSlice->setMP(m_pcMP); 878 #endif 688 879 689 880 if (bNextSlice) … … 744 935 #endif 745 936 937 #if POZNAN_SYNTH 938 if( m_pcCamParsCollector) 939 { 940 m_pcCamParsCollector->setSlice( pcSlice ); 941 } 942 //if(!getIsDepth()) 943 if(pcSlice->getSPS()->getUseCUSkip()) 944 { 945 getDecTop()->storeSynthPicsInBuffer(pcSlice->getViewIdx(),pcSlice->getSPS()->getViewOrderIdx(),pcSlice->getPOC(),getIsDepth()); 946 } 947 #endif 948 949 //* 950 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 951 if(!getIsDepth() && pcSlice->getSPS()->getUseTexDqpAccordingToDepth()) 952 { 953 getDecTop()->storeDepthSynthPicsInBuffer(pcSlice->getViewIdx(),pcSlice->getSPS()->getViewOrderIdx(),pcSlice->getPOC()); 954 } 955 #endif 956 //*/ 957 958 #if POZNAN_MP 959 std::vector<TComPic*> apcSpatDataRefPics = getDecTop()->getSpatialRefPics( pcPic->getViewIdx(), pcSlice->getPOC(), m_cSPS.isDepth() ); 960 pcSlice->getMP()->setRefPicsList(&apcSpatDataRefPics); 961 #if !POZNAN_MP_USE_DEPTH_MAP_GENERATION 962 std::vector<TComPic*> apcSpatDepthRefPics = getDecTop()->getSpatialRefPics( pcPic->getViewIdx(), pcSlice->getPOC(), true ); 963 pcSlice->getMP()->setDepthRefPicsList(&apcSpatDepthRefPics); 964 #endif 965 #endif 966 746 967 // Decode a picture 747 968 m_cGopDecoder.decompressGop ( bEos, pcBitstream, pcPic, false ); 969 970 #if POZNAN_MP 971 //pcSlice->getMP()->disable(); 972 #endif 748 973 749 974 if( m_pcCamParsCollector ) -
branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecTop.h
r21 r28 55 55 #include "TDecCAVLC.h" 56 56 57 #if POZNAN_MP 58 #include "../TLibCommon/TComMP.h" 59 #endif 60 57 61 // ==================================================================================================================== 58 62 // Class definition … … 71 75 Void uninit (); 72 76 Void setSlice ( TComSlice* pcSlice ); 77 #if POZNAN_SYNTH || (POZNAN_MP && !POZNAN_MP_USE_DEPTH_MAP_GENERATION) 78 Double**** getBaseViewShiftLUTD () { return m_adBaseViewShiftLUT; } 79 Int**** getBaseViewShiftLUTI () { return m_aiBaseViewShiftLUT; } 80 81 Int** getBaseViewOffsetI () { return m_aaiCodedOffset; } 82 Int** getBaseViewScaleI () { return m_aaiCodedScale; } 83 84 Bool getNearestBaseView ( Int iSynthViewIdx, Int &riNearestViewIdx, Int &riRelDistToLeft, Bool& rbRenderFromLeft); 85 #endif 73 86 74 87 private: … … 89 102 Int m_iLastPOC; 90 103 UInt m_uiMaxViewId; 104 105 #if POZNAN_SYNTH || (POZNAN_MP && !POZNAN_MP_USE_DEPTH_MAP_GENERATION) 106 107 UInt m_uiBitDepthForLUT; 108 UInt m_iLog2Precision; 109 UInt m_uiInputBitDepth; 110 111 // look-up tables 112 Double**** m_adBaseViewShiftLUT; ///< Disparity LUT 113 Int**** m_aiBaseViewShiftLUT; ///< Disparity LUT 114 115 Void xCreateLUTs( UInt uiNumberSourceViews, UInt uiNumberTargetViews, Double****& radLUT, Int****& raiLUT); 116 Void xInitLUTs( UInt uiSourceView, UInt uiTargetView, Int iScale, Int iOffset, Double****& radLUT, Int****& raiLUT); 117 118 template<class T> Void xDeleteArray ( T*& rpt, UInt uiSize1, UInt uiSize2, UInt uiSize3 ); 119 template<class T> Void xDeleteArray ( T*& rpt, UInt uiSize1, UInt uiSize2 ); 120 template<class T> Void xDeleteArray ( T*& rpt, UInt uiSize ); 121 #endif 122 #if POZNAN_NONLINEAR_DEPTH 123 Float m_fDepthPower; 124 #endif 125 126 91 127 }; 128 129 #if POZNAN_SYNTH || (POZNAN_MP && !POZNAN_MP_USE_DEPTH_MAP_GENERATION) 130 template <class T> 131 Void CamParsCollector::xDeleteArray( T*& rpt, UInt uiSize1, UInt uiSize2, UInt uiSize3 ) 132 { 133 if( rpt ) 134 { 135 for( UInt uiK = 0; uiK < uiSize1; uiK++ ) 136 { 137 for( UInt uiL = 0; uiL < uiSize2; uiL++ ) 138 { 139 for( UInt uiM = 0; uiM < uiSize3; uiM++ ) 140 { 141 delete[] rpt[ uiK ][ uiL ][ uiM ]; 142 } 143 delete[] rpt[ uiK ][ uiL ]; 144 } 145 delete[] rpt[ uiK ]; 146 } 147 delete[] rpt; 148 } 149 rpt = NULL; 150 }; 151 152 153 template <class T> 154 Void CamParsCollector::xDeleteArray( T*& rpt, UInt uiSize1, UInt uiSize2 ) 155 { 156 if( rpt ) 157 { 158 for( UInt uiK = 0; uiK < uiSize1; uiK++ ) 159 { 160 for( UInt uiL = 0; uiL < uiSize2; uiL++ ) 161 { 162 delete[] rpt[ uiK ][ uiL ]; 163 } 164 delete[] rpt[ uiK ]; 165 } 166 delete[] rpt; 167 } 168 rpt = NULL; 169 }; 170 171 172 template <class T> 173 Void CamParsCollector::xDeleteArray( T*& rpt, UInt uiSize ) 174 { 175 if( rpt ) 176 { 177 for( UInt uiK = 0; uiK < uiSize; uiK++ ) 178 { 179 delete[] rpt[ uiK ]; 180 } 181 delete[] rpt; 182 } 183 rpt = NULL; 184 }; 185 #endif 92 186 93 187 … … 138 232 #endif 139 233 234 #if POZNAN_MP 235 TComMP* m_pcMP; 236 #endif 237 140 238 Bool m_bIsDepth; 141 239 Int m_iViewIdx; -
branches/0.3-poznan-univ/source/Lib/TLibEncoder/TEncCavlc.cpp
r5 r28 326 326 xWriteFlag( pcSPS->getUseSAO() ? 1 : 0); 327 327 #endif 328 #if POZNAN_DBMP 329 xWriteFlag( pcSPS->getDBMP() ); 330 #endif 331 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 332 xWriteFlag( pcSPS->getUseCUSkip() ); 333 #endif 328 334 329 335 if( pcSPS->getViewId() || pcSPS->isDepth() ) … … 340 346 #if HHI_MPI 341 347 xWriteFlag( pcSPS->getUseMVI() ? 1 : 0 ); 348 #endif 349 #if POZNAN_NONLINEAR_DEPTH 350 // Depth power coefficient 351 #if POZNAN_NONLINEAR_DEPTH_SEND_AS_BYTE 352 UInt uiCode = quantizeDepthPower(pcSPS->getDepthPower()); 353 xWriteCode(uiCode, 8); 354 #else 355 float fCode = pcSPS->getDepthPower(); 356 UInt uiCode = *((UInt*)&fCode); 357 //uiCode &= ~0x80000000; 358 xWriteCode(uiCode, sizeof(float)*8); // we do not send sign?; 359 #endif 342 360 #endif 343 361 } … … 377 395 } 378 396 #endif 397 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 398 xWriteFlag ( pcSPS->getUseTexDqpAccordingToDepth() ? 1 : 0 ); 399 #endif 379 400 } 380 401 } … … 727 748 728 749 729 #if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI 750 #if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI || POZNAN_DBMP 730 751 Void 731 752 TEncCavlc::codeMergeIndexMV( TComDataCU* pcCU, UInt uiAbsPartIdx ) … … 733 754 UInt uiNumCand = 0; 734 755 UInt uiMergeIdx = pcCU->getMergeIndex( uiAbsPartIdx ); 756 757 #if POZNAN_DBMP 758 UInt uiModIdx; 759 const Bool bDBMPAvailable = pcCU->getSlice()->getMP()->isDBMPEnabled(); 760 if(bDBMPAvailable) 761 { 762 if(uiMergeIdx==POZNAN_DBMP_MRG_CAND) uiMergeIdx = POZNAN_DBMP_MERGE_POS; 763 else if(uiMergeIdx>=POZNAN_DBMP_MERGE_POS) uiMergeIdx++; 764 } 765 #endif 735 766 #if HHI_MPI 736 767 const Bool bMVIAvailable = pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE; … … 750 781 if( uiIdx < uiMviMergePos ) 751 782 { 783 #if POZNAN_DBMP 784 if(bDBMPAvailable) 785 { 786 if(uiIdx==POZNAN_DBMP_MERGE_POS) uiModIdx = POZNAN_DBMP_MRG_CAND; 787 else if(uiIdx>POZNAN_DBMP_MERGE_POS) uiModIdx = uiIdx--; 788 else uiModIdx = uiIdx; 789 } 790 else uiModIdx = uiIdx; 791 if( pcCU->getNeighbourCandIdx( uiModIdx, uiAbsPartIdx ) == uiModIdx + 1 ) 792 { 793 uiNumCand++; 794 } 795 else if( uiIdx < uiMergeIdx ) 796 { 797 uiUnaryIdx--; 798 } 799 #else 752 800 if( pcCU->getNeighbourCandIdx( uiIdx, uiAbsPartIdx ) == uiIdx + 1 ) 753 801 { … … 758 806 uiUnaryIdx--; 759 807 } 808 #endif 760 809 } 761 810 else if( uiIdx > uiMviMergePos ) 762 811 { 812 #if POZNAN_DBMP 813 if(bDBMPAvailable) 814 { 815 if(uiIdx==POZNAN_DBMP_MERGE_POS) uiModIdx = POZNAN_DBMP_MRG_CAND; 816 else if(uiIdx>POZNAN_DBMP_MERGE_POS) uiModIdx = uiIdx--; 817 else uiModIdx = uiIdx; 818 } 819 else uiModIdx = uiIdx; 820 if( pcCU->getNeighbourCandIdx( uiModIdx-1, uiAbsPartIdx ) == uiModIdx ) 821 { 822 uiNumCand++; 823 } 824 else if( uiIdx < uiMergeIdx ) 825 { 826 uiUnaryIdx--; 827 } 828 #else 763 829 if( pcCU->getNeighbourCandIdx( uiIdx - 1, uiAbsPartIdx ) == uiIdx ) 764 830 { … … 769 835 uiUnaryIdx--; 770 836 } 837 #endif 771 838 } 772 839 } … … 775 842 for( UInt uiIdx = 0; uiIdx < MRG_MAX_NUM_CANDS; uiIdx++ ) 776 843 { 844 #if POZNAN_DBMP 845 if(bDBMPAvailable) 846 { 847 if(uiIdx==POZNAN_DBMP_MERGE_POS) uiModIdx = POZNAN_DBMP_MRG_CAND; 848 else if(uiIdx>POZNAN_DBMP_MERGE_POS) uiModIdx = uiIdx--; 849 else uiModIdx = uiIdx; 850 } 851 else uiModIdx = uiIdx; 852 if( pcCU->getNeighbourCandIdx( uiModIdx, uiAbsPartIdx ) == uiModIdx + 1 ) 853 { 854 uiNumCand++; 855 } 856 else if( uiIdx < uiMergeIdx ) 857 { 858 uiUnaryIdx--; 859 } 860 #else 777 861 if( pcCU->getNeighbourCandIdx( uiIdx, uiAbsPartIdx ) == uiIdx + 1 ) 778 862 { … … 783 867 uiUnaryIdx--; 784 868 } 869 #endif 785 870 } 786 871 #endif … … 806 891 Void TEncCavlc::codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ) 807 892 { 893 /* todo JAcek sprawdzic co jest zgane 808 894 #if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI 809 895 #if HHI_INTER_VIEW_MOTION_PRED && HHI_MPI … … 814 900 #else 815 901 if( pcCU->getSlice()->getSPS()->getViewId() > 0 && ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() & PDM_USE_FOR_MERGE ) == PDM_USE_FOR_MERGE ) 816 #endif 902 #endif//*/ 903 #if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI || POZNAN_DBMP 904