Index: trunk/build/HM_vc10.sln
===================================================================
--- trunk/build/HM_vc10.sln	(revision 77)
+++ trunk/build/HM_vc10.sln	(revision 608)
@@ -5,7 +5,4 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TAppEncoder", "vc10\TAppEncoder_vc10.vcxproj", "{D759E4E1-D33A-4483-B57B-0FD248E022FE}"
-	ProjectSection(ProjectDependencies) = postProject
-		{2B298BE6-DFF0-4BD2-8F26-395FFE7F9EB4} = {2B298BE6-DFF0-4BD2-8F26-395FFE7F9EB4}
-	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TAppCommon", "vc10\TAppCommon_vc10.vcxproj", "{D1E8A1C2-15DB-4C94-80E8-4F70CF0A2DC5}"
@@ -16,19 +13,10 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TLibEncoder", "vc10\TLibEncoder_vc10.vcxproj", "{47E90995-1FC5-4EE4-A94D-AD474169F0E1}"
-	ProjectSection(ProjectDependencies) = postProject
-		{2B298BE6-DFF0-4BD2-8F26-395FFE7F9EB4} = {2B298BE6-DFF0-4BD2-8F26-395FFE7F9EB4}
-	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TLibVideoIO", "vc10\TLibVideoIO_vc10.vcxproj", "{5280C25A-D316-4BE7-AE50-29D72108624F}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TAppRenderer", "vc10\TAppRenderer_vc10.vcxproj", "{3A5A8B26-8CA4-4690-944E-AB78559DE848}"
-	ProjectSection(ProjectDependencies) = postProject
-		{2B298BE6-DFF0-4BD2-8F26-395FFE7F9EB4} = {2B298BE6-DFF0-4BD2-8F26-395FFE7F9EB4}
-	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TLibRenderer", "vc10\TLibRenderer_vc10.vcxproj", "{2B298BE6-DFF0-4BD2-8F26-395FFE7F9EB4}"
-	ProjectSection(ProjectDependencies) = postProject
-		{78018D78-F890-47E3-A0B7-09D273F0B11D} = {78018D78-F890-47E3-A0B7-09D273F0B11D}
-	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TLibExtractor", "vc10\TLibExtractor_vc10.vcxproj", "{27E2C758-E3CE-44CA-A226-83491EC7F798}"
Index: trunk/build/HM_vc8.sln
===================================================================
--- trunk/build/HM_vc8.sln	(revision 77)
+++ trunk/build/HM_vc8.sln	(revision 608)
@@ -4,8 +4,8 @@
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TAppDecoder", "vc8\TAppDecoder_vc8.vcproj", "{A7A515D9-E917-4706-BD5B-57DC6C78D612}"
 	ProjectSection(ProjectDependencies) = postProject
+		{8783AD3A-A5CA-42B7-AAC4-A07EB845A684} = {8783AD3A-A5CA-42B7-AAC4-A07EB845A684}
+		{5280C25A-D316-4BE7-AE50-29D72108624F} = {5280C25A-D316-4BE7-AE50-29D72108624F}
+		{F8B77A48-AF6C-4746-A89F-B706ABA6AD94} = {F8B77A48-AF6C-4746-A89F-B706ABA6AD94}
 		{78018D78-F890-47E3-A0B7-09D273F0B11D} = {78018D78-F890-47E3-A0B7-09D273F0B11D}
-		{F8B77A48-AF6C-4746-A89F-B706ABA6AD94} = {F8B77A48-AF6C-4746-A89F-B706ABA6AD94}
-		{5280C25A-D316-4BE7-AE50-29D72108624F} = {5280C25A-D316-4BE7-AE50-29D72108624F}
-		{8783AD3A-A5CA-42B7-AAC4-A07EB845A684} = {8783AD3A-A5CA-42B7-AAC4-A07EB845A684}
 	EndProjectSection
 EndProject
@@ -13,8 +13,8 @@
 	ProjectSection(ProjectDependencies) = postProject
 		{5280C25A-D316-4BE7-AE50-29D72108624F} = {5280C25A-D316-4BE7-AE50-29D72108624F}
+		{47E90995-1FC5-4EE4-A94D-AD474169F0E1} = {47E90995-1FC5-4EE4-A94D-AD474169F0E1}
+		{78018D78-F890-47E3-A0B7-09D273F0B11D} = {78018D78-F890-47E3-A0B7-09D273F0B11D}
+		{8783AD3A-A5CA-42B7-AAC4-A07EB845A684} = {8783AD3A-A5CA-42B7-AAC4-A07EB845A684}
 		{5E87AD84-AC4F-4336-B4EE-549CA210EE4A} = {5E87AD84-AC4F-4336-B4EE-549CA210EE4A}
-		{8783AD3A-A5CA-42B7-AAC4-A07EB845A684} = {8783AD3A-A5CA-42B7-AAC4-A07EB845A684}
-		{78018D78-F890-47E3-A0B7-09D273F0B11D} = {78018D78-F890-47E3-A0B7-09D273F0B11D}
-		{47E90995-1FC5-4EE4-A94D-AD474169F0E1} = {47E90995-1FC5-4EE4-A94D-AD474169F0E1}
 	EndProjectSection
 EndProject
Index: trunk/build/linux/app/TAppRenderer/makefile
===================================================================
--- trunk/build/linux/app/TAppRenderer/makefile	(revision 77)
+++ trunk/build/linux/app/TAppRenderer/makefile	(revision 608)
@@ -4,5 +4,5 @@
 # set directories to your wanted values
 SRC_DIR				= ../../../../source/App/TAppRenderer
-INC_DIR				= ../../../../source/App
+INC_DIR				= ../../../../source/Lib
 LIB_DIR				= ../../../../lib
 BIN_DIR				= ../../../../bin
Index: trunk/build/linux/common/makefile.base
===================================================================
--- trunk/build/linux/common/makefile.base	(revision 77)
+++ trunk/build/linux/common/makefile.base	(revision 608)
@@ -47,5 +47,5 @@
 # default cpp flags for all configurations
 #CPPFLAGS          = -Wall -fPIC $(DEFS) -I$(CURDIR)/$(INC_DIR) $(USER_INC_DIRS)
-CPPFLAGS          = -fPIC $(DEFS) -I$(CURDIR)/$(INC_DIR) $(USER_INC_DIRS) -Wall -Wshadow -Wno-sign-compare -Werror
+CPPFLAGS          = -fPIC $(DEFS) $(ADDDEFS) -I$(CURDIR)/$(INC_DIR) $(USER_INC_DIRS) -Wall -Wshadow -Wno-sign-compare -Werror
 
 ########## 
Index: trunk/build/linux/lib/TLibCommon/makefile
===================================================================
--- trunk/build/linux/lib/TLibCommon/makefile	(revision 77)
+++ trunk/build/linux/lib/TLibCommon/makefile	(revision 608)
@@ -35,10 +35,9 @@
 			$(OBJ_DIR)/ContextModel.o \
 			$(OBJ_DIR)/ContextModel3DBuffer.o \
+			$(OBJ_DIR)/SEI.o \
 			$(OBJ_DIR)/TComCABACTables.o \
-			$(OBJ_DIR)/TComAdaptiveLoopFilter.o \
 			$(OBJ_DIR)/TComSampleAdaptiveOffset.o \
 			$(OBJ_DIR)/TComBitStream.o \
 			$(OBJ_DIR)/TComDataCU.o \
-			$(OBJ_DIR)/TComDepthMapGenerator.o \
 			$(OBJ_DIR)/TComLoopFilter.o \
 			$(OBJ_DIR)/TComMotionInfo.o \
@@ -50,5 +49,4 @@
 			$(OBJ_DIR)/TComPrediction.o \
 			$(OBJ_DIR)/TComRdCost.o \
-			$(OBJ_DIR)/TComResidualGenerator.o \
 			$(OBJ_DIR)/TComRom.o \
 			$(OBJ_DIR)/TComSlice.o \
@@ -57,7 +55,7 @@
 			$(OBJ_DIR)/TComInterpolationFilter.o \
 			$(OBJ_DIR)/libmd5.o \
+			$(OBJ_DIR)/TComWedgelet.o \
 			$(OBJ_DIR)/TComWeightPrediction.o \
 			$(OBJ_DIR)/TComRdCostWeightPrediction.o \
-			$(OBJ_DIR)/TComWedgelet.o \
 
 LIBS				= -lpthread
Index: trunk/build/linux/lib/TLibDecoder/makefile
===================================================================
--- trunk/build/linux/lib/TLibDecoder/makefile	(revision 77)
+++ trunk/build/linux/lib/TLibDecoder/makefile	(revision 608)
@@ -36,4 +36,5 @@
 				$(OBJ_DIR)/NALread.o \
 				$(OBJ_DIR)/SEIread.o \
+				$(OBJ_DIR)/SyntaxElementParser.o \
 				$(OBJ_DIR)/TDecBinCoderCABAC.o \
 				$(OBJ_DIR)/TDecCAVLC.o \
Index: trunk/build/linux/lib/TLibEncoder/makefile
===================================================================
--- trunk/build/linux/lib/TLibEncoder/makefile	(revision 77)
+++ trunk/build/linux/lib/TLibEncoder/makefile	(revision 608)
@@ -35,8 +35,9 @@
 			$(OBJ_DIR)/NALwrite.o \
 			$(OBJ_DIR)/SEIwrite.o \
+			$(OBJ_DIR)/SyntaxElementWriter.o \
 			$(OBJ_DIR)/TEncBinCoderCABAC.o \
 			$(OBJ_DIR)/TEncBinCoderCABACCounter.o \
-			$(OBJ_DIR)/TEncAdaptiveLoopFilter.o \
 			$(OBJ_DIR)/TEncSampleAdaptiveOffset.o \
+			$(OBJ_DIR)/TEncAnalyze.o \
 			$(OBJ_DIR)/TEncCavlc.o \
 			$(OBJ_DIR)/TEncCu.o \
@@ -50,4 +51,5 @@
 			$(OBJ_DIR)/TEncPreanalyzer.o \
 			$(OBJ_DIR)/WeightPredAnalysis.o \
+			$(OBJ_DIR)/TEncRateCtrl.o \
 
 LIBS				= -lpthread
Index: trunk/build/linux/makefile
===================================================================
--- trunk/build/linux/makefile	(revision 77)
+++ trunk/build/linux/makefile	(revision 608)
@@ -1,54 +1,56 @@
 ### enforce 32-bit build : 1=yes, 0=no
 M32?= 0
+HEVC_EXT?= ''
  
 export M32
 
+ifneq ($(HEVC_EXT), '')
+ADDDEFS = -DHEVC_EXT=$(HEVC_EXT)
+endif
+
 all:
-	$(MAKE) -C lib/TLibVideoIO 	MM32=$(M32)
-	$(MAKE) -C lib/TLibCommon 	MM32=$(M32)
-	$(MAKE) -C lib/TLibDecoder 	MM32=$(M32)
-	$(MAKE) -C lib/TLibEncoder 	MM32=$(M32)
-	$(MAKE) -C lib/TLibRenderer  MM32=$(M32)
-	$(MAKE) -C lib/TLibExtractor  MM32=$(M32)
-	$(MAKE) -C lib/TAppCommon   MM32=$(M32)
-	$(MAKE) -C app/TAppDecoder      MM32=$(M32)
-	$(MAKE) -C app/TAppEncoder      MM32=$(M32)
-	$(MAKE) -C app/TAppRenderer     MM32=$(M32)
-	$(MAKE) -C app/TAppExtractor    MM32=$(M32)
-	$(MAKE) -C utils/annexBbytecount       MM32=$(M32)
-	$(MAKE) -C utils/convert_NtoMbit_YCbCr MM32=$(M32)
-
+	$(MAKE) -C lib/TLibVideoIO 	MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C lib/TLibCommon 	MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C lib/TLibDecoder 	MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C lib/TLibEncoder 	MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C lib/TLibRenderer  MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C lib/TLibExtractor  MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C lib/TAppCommon       MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C app/TAppDecoder      MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C app/TAppEncoder      MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C app/TAppRenderer     MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C app/TAppExtractor    MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C utils/annexBbytecount       MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C utils/convert_NtoMbit_YCbCr MM32=$(M32) ADDDEFS=$(ADDDEFS)
 
 debug:
-	$(MAKE) -C lib/TLibVideoIO 	debug	MM32=$(M32)
-	$(MAKE) -C lib/TLibCommon 	debug	MM32=$(M32)
-	$(MAKE) -C lib/TLibDecoder 	debug MM32=$(M32)
-	$(MAKE) -C lib/TLibEncoder 	debug MM32=$(M32)
-	$(MAKE) -C lib/TLibRenderer  debug	MM32=$(M32)
-	$(MAKE) -C lib/TLibExtractor  debug	MM32=$(M32)
-	$(MAKE) -C lib/TAppCommon   debug MM32=$(M32)
-	$(MAKE) -C app/TAppDecoder      debug MM32=$(M32)
-	$(MAKE) -C app/TAppEncoder      debug MM32=$(M32)
-	$(MAKE) -C app/TAppRenderer     debug MM32=$(M32)
-	$(MAKE) -C app/TAppExtractor    debug MM32=$(M32)
-	$(MAKE) -C utils/annexBbytecount       debug MM32=$(M32)
-	$(MAKE) -C utils/convert_NtoMbit_YCbCr debug MM32=$(M32)
-
+	$(MAKE) -C lib/TLibVideoIO 	debug MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C lib/TLibCommon 	debug MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C lib/TLibDecoder 	debug MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C lib/TLibEncoder 	debug MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C lib/TLibRenderer  debug	MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C lib/TLibExtractor  debug	MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C lib/TAppCommon       debug MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C app/TAppDecoder      debug MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C app/TAppEncoder      debug MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C app/TAppRenderer     debug MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C app/TAppExtractor    debug MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C utils/annexBbytecount       debug MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C utils/convert_NtoMbit_YCbCr debug MM32=$(M32) ADDDEFS=$(ADDDEFS)
 
 release:
-	$(MAKE) -C lib/TLibVideoIO 	release MM32=$(M32)
-	$(MAKE) -C lib/TLibCommon 	release MM32=$(M32)
-	$(MAKE) -C lib/TLibDecoder 	release MM32=$(M32)
-	$(MAKE) -C lib/TLibEncoder 	release MM32=$(M32)
-	$(MAKE) -C lib/TLibRenderer  release MM32=$(M32)
-	$(MAKE) -C lib/TLibExtractor  release MM32=$(M32)
-	$(MAKE) -C lib/TAppCommon   release MM32=$(M32)
-	$(MAKE) -C app/TAppDecoder      release MM32=$(M32)
-	$(MAKE) -C app/TAppEncoder      release MM32=$(M32)
-	$(MAKE) -C app/TAppRenderer    release MM32=$(M32)	
-	$(MAKE) -C app/TAppExtractor    release MM32=$(M32)	
-	$(MAKE) -C utils/annexBbytecount       release MM32=$(M32)
-	$(MAKE) -C utils/convert_NtoMbit_YCbCr release MM32=$(M32)
-
+	$(MAKE) -C lib/TLibVideoIO 	release MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C lib/TLibCommon 	release MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C lib/TLibDecoder 	release MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C lib/TLibEncoder 	release MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C lib/TLibRenderer  release MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C lib/TLibExtractor  release MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C lib/TAppCommon       release MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C app/TAppDecoder      release MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C app/TAppEncoder      release MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C app/TAppRenderer    release MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C app/TAppExtractor    release MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C utils/annexBbytecount       release MM32=$(M32) ADDDEFS=$(ADDDEFS)
+	$(MAKE) -C utils/convert_NtoMbit_YCbCr release MM32=$(M32) ADDDEFS=$(ADDDEFS)
 
 clean:
@@ -59,5 +61,5 @@
 	$(MAKE) -C lib/TLibRenderer  clean MM32=$(M32)
 	$(MAKE) -C lib/TLibExtractor  clean MM32=$(M32)
-	$(MAKE) -C lib/TAppCommon   clean MM32=$(M32)
+	$(MAKE) -C lib/TAppCommon       clean MM32=$(M32)
 	$(MAKE) -C app/TAppDecoder      clean MM32=$(M32)
 	$(MAKE) -C app/TAppEncoder      clean MM32=$(M32)
Index: trunk/build/vc10/TLibCommon_vc10.vcxproj
===================================================================
--- trunk/build/vc10/TLibCommon_vc10.vcxproj	(revision 77)
+++ trunk/build/vc10/TLibCommon_vc10.vcxproj	(revision 608)
@@ -147,9 +147,8 @@
     <ClCompile Include="..\..\source\Lib\TLibCommon\ContextModel3DBuffer.cpp" />
     <ClCompile Include="..\..\source\Lib\libmd5\libmd5.c" />
-    <ClCompile Include="..\..\source\Lib\TLibCommon\TComAdaptiveLoopFilter.cpp" />
+    <ClCompile Include="..\..\source\Lib\TLibCommon\SEI.cpp" />
     <ClCompile Include="..\..\source\Lib\TLibCommon\TComBitStream.cpp" />
     <ClCompile Include="..\..\source\Lib\TLibCommon\TComCABACTables.cpp" />
     <ClCompile Include="..\..\source\Lib\TLibCommon\TComDataCU.cpp" />
-    <ClCompile Include="..\..\source\Lib\TLibCommon\TComDepthMapGenerator.cpp" />
     <ClCompile Include="..\..\source\Lib\TLibCommon\TComInterpolationFilter.cpp" />
     <ClCompile Include="..\..\source\Lib\TLibCommon\TComLoopFilter.cpp" />
@@ -163,5 +162,4 @@
     <ClCompile Include="..\..\source\Lib\TLibCommon\TComRdCost.cpp" />
     <ClCompile Include="..\..\source\Lib\TLibCommon\TComRdCostWeightPrediction.cpp" />
-    <ClCompile Include="..\..\source\Lib\TLibCommon\TComResidualGenerator.cpp" />
     <ClCompile Include="..\..\source\Lib\TLibCommon\TComRom.cpp" />
     <ClCompile Include="..\..\source\Lib\TLibCommon\TComSampleAdaptiveOffset.cpp" />
@@ -182,10 +180,8 @@
     <ClInclude Include="..\..\source\Lib\TLibCommon\NAL.h" />
     <ClInclude Include="..\..\source\Lib\TLibCommon\SEI.h" />
-    <ClInclude Include="..\..\source\Lib\TLibCommon\TComAdaptiveLoopFilter.h" />
     <ClInclude Include="..\..\source\Lib\TLibCommon\TComBitCounter.h" />
     <ClInclude Include="..\..\source\Lib\TLibCommon\TComBitStream.h" />
     <ClInclude Include="..\..\source\Lib\TLibCommon\TComCABACTables.h" />
     <ClInclude Include="..\..\source\Lib\TLibCommon\TComDataCU.h" />
-    <ClInclude Include="..\..\source\Lib\TLibCommon\TComDepthMapGenerator.h" />
     <ClInclude Include="..\..\source\Lib\TLibCommon\TComInterpolationFilter.h" />
     <ClInclude Include="..\..\source\Lib\TLibCommon\TComList.h" />
@@ -200,5 +196,4 @@
     <ClInclude Include="..\..\source\Lib\TLibCommon\TComRdCost.h" />
     <ClInclude Include="..\..\source\Lib\TLibCommon\TComRdCostWeightPrediction.h" />
-    <ClInclude Include="..\..\source\Lib\TLibCommon\TComResidualGenerator.h" />
     <ClInclude Include="..\..\source\Lib\TLibCommon\TComRom.h" />
     <ClInclude Include="..\..\source\Lib\TLibCommon\TComSampleAdaptiveOffset.h" />
Index: trunk/build/vc10/TLibDecoder_vc10.vcxproj
===================================================================
--- trunk/build/vc10/TLibDecoder_vc10.vcxproj	(revision 77)
+++ trunk/build/vc10/TLibDecoder_vc10.vcxproj	(revision 608)
@@ -147,4 +147,5 @@
     <ClCompile Include="..\..\source\Lib\TLibDecoder\NALread.cpp" />
     <ClCompile Include="..\..\source\Lib\TLibDecoder\SEIread.cpp" />
+    <ClCompile Include="..\..\source\Lib\TLibDecoder\SyntaxElementParser.cpp" />
     <ClCompile Include="..\..\source\Lib\TLibDecoder\TDecBinCoderCABAC.cpp" />
     <ClCompile Include="..\..\source\Lib\TLibDecoder\TDecCAVLC.cpp" />
@@ -160,4 +161,5 @@
     <ClInclude Include="..\..\source\Lib\TLibDecoder\NALread.h" />
     <ClInclude Include="..\..\source\Lib\TLibDecoder\SEIread.h" />
+    <ClInclude Include="..\..\source\Lib\TLibDecoder\SyntaxElementParser.h" />
     <ClInclude Include="..\..\source\Lib\TLibDecoder\TDecBinCoder.h" />
     <ClInclude Include="..\..\source\Lib\TLibDecoder\TDecBinCoderCABAC.h" />
Index: trunk/build/vc10/TLibEncoder_vc10.vcxproj
===================================================================
--- trunk/build/vc10/TLibEncoder_vc10.vcxproj	(revision 77)
+++ trunk/build/vc10/TLibEncoder_vc10.vcxproj	(revision 608)
@@ -146,5 +146,6 @@
     <ClCompile Include="..\..\source\Lib\TLibEncoder\NALwrite.cpp" />
     <ClCompile Include="..\..\source\Lib\TLibEncoder\SEIwrite.cpp" />
-    <ClCompile Include="..\..\source\Lib\TLibEncoder\TEncAdaptiveLoopFilter.cpp" />
+    <ClCompile Include="..\..\source\Lib\TLibEncoder\SyntaxElementWriter.cpp" />
+    <ClCompile Include="..\..\source\Lib\TLibEncoder\TEncAnalyze.cpp" />
     <ClCompile Include="..\..\source\Lib\TLibEncoder\TEncBinCoderCABAC.cpp" />
     <ClCompile Include="..\..\source\Lib\TLibEncoder\TEncBinCoderCABACCounter.cpp" />
@@ -155,4 +156,5 @@
     <ClCompile Include="..\..\source\Lib\TLibEncoder\TEncPic.cpp" />
     <ClCompile Include="..\..\source\Lib\TLibEncoder\TEncPreanalyzer.cpp" />
+    <ClCompile Include="..\..\source\Lib\TLibEncoder\TEncRateCtrl.cpp" />
     <ClCompile Include="..\..\source\Lib\TLibEncoder\TEncSampleAdaptiveOffset.cpp" />
     <ClCompile Include="..\..\source\Lib\TLibEncoder\TEncSbac.cpp" />
@@ -166,5 +168,5 @@
     <ClInclude Include="..\..\source\Lib\TLibEncoder\NALwrite.h" />
     <ClInclude Include="..\..\source\Lib\TLibEncoder\SEIwrite.h" />
-    <ClInclude Include="..\..\source\Lib\TLibEncoder\TEncAdaptiveLoopFilter.h" />
+    <ClInclude Include="..\..\source\Lib\TLibEncoder\SyntaxElementWriter.h" />
     <ClInclude Include="..\..\source\Lib\TLibEncoder\TEncAnalyze.h" />
     <ClInclude Include="..\..\source\Lib\TLibEncoder\TEncBinCoder.h" />
@@ -178,4 +180,5 @@
     <ClInclude Include="..\..\source\Lib\TLibEncoder\TEncPic.h" />
     <ClInclude Include="..\..\source\Lib\TLibEncoder\TEncPreanalyzer.h" />
+    <ClInclude Include="..\..\source\Lib\TLibEncoder\TEncRateCtrl.h" />
     <ClInclude Include="..\..\source\Lib\TLibEncoder\TEncSampleAdaptiveOffset.h" />
     <ClInclude Include="..\..\source\Lib\TLibEncoder\TEncSbac.h" />
Index: trunk/build/vc8/TLibCommon_vc8.vcproj
===================================================================
--- trunk/build/vc8/TLibCommon_vc8.vcproj	(revision 77)
+++ trunk/build/vc8/TLibCommon_vc8.vcproj	(revision 608)
@@ -2,5 +2,5 @@
 <VisualStudioProject
 	ProjectType="Visual C++"
-	Version="8.00"
+	Version="8,00"
 	Name="TLibCommon"
 	ProjectGUID="{78018D78-F890-47E3-A0B7-09D273F0B11D}"
@@ -81,4 +81,66 @@
 		</Configuration>
 		<Configuration
+			Name="Debug|x64"
+			OutputDirectory="$(SolutionDir)\vc8\$(PlatformName)\$(ConfigurationName)\$(RootNamespace)"
+			IntermediateDirectory="$(SolutionDir)\vc8\$(PlatformName)\$(ConfigurationName)\$(RootNamespace)"
+			ConfigurationType="4"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="3"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="$(SolutionDir)\..\source\Lib\;$(SolutionDir)\..\compat\msvc"
+				PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
 			Name="Release|Win32"
 			OutputDirectory="$(SolutionDir)\vc8\$(PlatformName)\$(ConfigurationName)\$(RootNamespace)"
@@ -145,66 +207,4 @@
 		</Configuration>
 		<Configuration
-			Name="Debug|x64"
-			OutputDirectory="$(SolutionDir)\vc8\$(PlatformName)\$(ConfigurationName)\$(RootNamespace)"
-			IntermediateDirectory="$(SolutionDir)\vc8\$(PlatformName)\$(ConfigurationName)\$(RootNamespace)"
-			ConfigurationType="4"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="$(SolutionDir)\..\source\Lib\;$(SolutionDir)\..\compat\msvc"
-				PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS"
-				MinimalRebuild="true"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="1"
-				WarningLevel="3"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
 			Name="Release|x64"
 			OutputDirectory="$(SolutionDir)\vc8\$(PlatformName)\$(ConfigurationName)\$(RootNamespace)"
@@ -293,5 +293,5 @@
 			</File>
 			<File
-				RelativePath="..\..\source\Lib\TLibCommon\TComAdaptiveLoopFilter.cpp"
+				RelativePath="..\..\source\Lib\TLibCommon\SEI.cpp"
 				>
 			</File>
@@ -309,8 +309,4 @@
 			</File>
 			<File
-				RelativePath="..\..\source\Lib\TLibCommon\TComDepthMapGenerator.cpp"
-				>
-			</File>
-			<File
 				RelativePath="..\..\source\Lib\TLibCommon\TComInterpolationFilter.cpp"
 				>
@@ -354,8 +350,4 @@
 			<File
 				RelativePath="..\..\source\Lib\TLibCommon\TComRdCostWeightPrediction.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\source\Lib\TLibCommon\TComResidualGenerator.cpp"
 				>
 			</File>
@@ -431,8 +423,4 @@
 			</File>
 			<File
-				RelativePath="..\..\source\Lib\TLibCommon\TComAdaptiveLoopFilter.h"
-				>
-			</File>
-			<File
 				RelativePath="..\..\source\Lib\TLibCommon\TComBitCounter.h"
 				>
@@ -451,8 +439,4 @@
 			</File>
 			<File
-				RelativePath="..\..\source\Lib\TLibCommon\TComDepthMapGenerator.h"
-				>
-			</File>
-			<File
 				RelativePath="..\..\source\Lib\TLibCommon\TComInterpolationFilter.h"
 				>
@@ -500,8 +484,4 @@
 			<File
 				RelativePath="..\..\source\Lib\TLibCommon\TComRdCostWeightPrediction.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\source\Lib\TLibCommon\TComResidualGenerator.h"
 				>
 			</File>
Index: trunk/build/vc8/TLibDecoder_vc8.vcproj
===================================================================
--- trunk/build/vc8/TLibDecoder_vc8.vcproj	(revision 77)
+++ trunk/build/vc8/TLibDecoder_vc8.vcproj	(revision 608)
@@ -292,4 +292,8 @@
 			</File>
 			<File
+				RelativePath="..\..\source\Lib\TLibDecoder\SyntaxElementParser.cpp"
+				>
+			</File>
+			<File
 				RelativePath="..\..\source\Lib\TLibDecoder\TDecBinCoderCABAC.cpp"
 				>
@@ -338,4 +342,8 @@
 			<File
 				RelativePath="..\..\source\Lib\TLibDecoder\SEIread.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\source\Lib\TLibDecoder\SyntaxElementParser.h"
 				>
 			</File>
Index: trunk/build/vc8/TLibEncoder_vc8.vcproj
===================================================================
--- trunk/build/vc8/TLibEncoder_vc8.vcproj	(revision 77)
+++ trunk/build/vc8/TLibEncoder_vc8.vcproj	(revision 608)
@@ -288,5 +288,9 @@
 			</File>
 			<File
-				RelativePath="..\..\source\Lib\TLibEncoder\TEncAdaptiveLoopFilter.cpp"
+				RelativePath="..\..\source\Lib\TLibEncoder\SyntaxElementWriter.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\source\Lib\TLibEncoder\TEncAnalyze.cpp"
 				>
 			</File>
@@ -321,4 +325,8 @@
 			<File
 				RelativePath="..\..\source\Lib\TLibEncoder\TEncPreanalyzer.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\source\Lib\TLibEncoder\TEncRateCtrl.cpp"
 				>
 			</File>
@@ -365,5 +373,5 @@
 			</File>
 			<File
-				RelativePath="..\..\source\Lib\TLibEncoder\TEncAdaptiveLoopFilter.h"
+				RelativePath="..\..\source\Lib\TLibEncoder\SyntaxElementWriter.h"
 				>
 			</File>
@@ -410,4 +418,8 @@
 			<File
 				RelativePath="..\..\source\Lib\TLibEncoder\TEncPreanalyzer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\source\Lib\TLibEncoder\TEncRateCtrl.h"
 				>
 			</File>
Index: trunk/build/vc9/TAppDecoder_vc9.vcproj
===================================================================
--- trunk/build/vc9/TAppDecoder_vc9.vcproj	(revision 77)
+++ trunk/build/vc9/TAppDecoder_vc9.vcproj	(revision 608)
@@ -2,5 +2,5 @@
 <VisualStudioProject
 	ProjectType="Visual C++"
-	Version="9,00"
+	Version="9.00"
 	Name="TAppDecoder"
 	ProjectGUID="{A7A515D9-E917-4706-BD5B-57DC6C78D612}"
Index: trunk/build/vc9/TAppExtractor_vc9.vcproj
===================================================================
--- trunk/build/vc9/TAppExtractor_vc9.vcproj	(revision 77)
+++ trunk/build/vc9/TAppExtractor_vc9.vcproj	(revision 608)
@@ -45,5 +45,5 @@
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="&quot;..\..\compat\msvc&quot;"
+				AdditionalIncludeDirectories="$(SolutionDir)\..\source\Lib\;$(SolutionDir)\..\compat\msvc"
 				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
 				MinimalRebuild="true"
@@ -68,4 +68,76 @@
 				SubSystem="1"
 				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|x64"
+			OutputDirectory="$(SolutionDir)\..\bin\vc9\$(PlatformName)\$(ConfigurationName)\"
+			IntermediateDirectory="$(SolutionDir)\vc9\$(PlatformName)\$(ConfigurationName)\$(RootNamespace)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="3"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="&quot;$(SolutionDir)\source\Lib&quot;;&quot;$(SolutionDir)\..\source\Lib\&quot;;&quot;$(SolutionDir)\..\compat\msvc&quot;"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="2"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				TargetMachine="17"
 			/>
 			<Tool
@@ -120,5 +192,5 @@
 				EnableIntrinsicFunctions="false"
 				FavorSizeOrSpeed="1"
-				AdditionalIncludeDirectories="&quot;..\..\compat\msvc&quot;"
+				AdditionalIncludeDirectories="$(SolutionDir)\..\source\Lib\;$(SolutionDir)\..\compat\msvc"
 				PreprocessorDefinitions="WIN32;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
 				StringPooling="true"
@@ -143,76 +215,4 @@
 				SubSystem="1"
 				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|x64"
-			OutputDirectory="$(SolutionDir)\..\bin\vc9\$(PlatformName)\$(ConfigurationName)\"
-			IntermediateDirectory="$(SolutionDir)\vc9\$(PlatformName)\$(ConfigurationName)\$(RootNamespace)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
-				AdditionalIncludeDirectories="&quot;..\..\compat\msvc&quot;"
-				MinimalRebuild="true"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="1"
-				WarningLevel="3"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="2"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				TargetMachine="17"
 			/>
 			<Tool
@@ -268,6 +268,6 @@
 				EnableIntrinsicFunctions="false"
 				FavorSizeOrSpeed="1"
+				AdditionalIncludeDirectories="$(SolutionDir)\..\source\Lib\;$(SolutionDir)\..\compat\msvc"
 				PreprocessorDefinitions="WIN32;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
-				AdditionalIncludeDirectories="&quot;..\..\compat\msvc&quot;"
 				StringPooling="true"
 				RuntimeLibrary="0"
Index: trunk/build/vc9/TLibCommon_vc9.vcproj
===================================================================
--- trunk/build/vc9/TLibCommon_vc9.vcproj	(revision 77)
+++ trunk/build/vc9/TLibCommon_vc9.vcproj	(revision 608)
@@ -296,5 +296,5 @@
 			</File>
 			<File
-				RelativePath="..\..\source\Lib\TLibCommon\TComAdaptiveLoopFilter.cpp"
+				RelativePath="..\..\source\Lib\TLibCommon\SEI.cpp"
 				>
 			</File>
@@ -312,8 +312,4 @@
 			</File>
 			<File
-				RelativePath="..\..\source\Lib\TLibCommon\TComDepthMapGenerator.cpp"
-				>
-			</File>
-			<File
 				RelativePath="..\..\source\Lib\TLibCommon\TComInterpolationFilter.cpp"
 				>
@@ -357,8 +353,4 @@
 			<File
 				RelativePath="..\..\source\Lib\TLibCommon\TComRdCostWeightPrediction.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\source\Lib\TLibCommon\TComResidualGenerator.cpp"
 				>
 			</File>
@@ -434,8 +426,4 @@
 			</File>
 			<File
-				RelativePath="..\..\source\Lib\TLibCommon\TComAdaptiveLoopFilter.h"
-				>
-			</File>
-			<File
 				RelativePath="..\..\source\Lib\TLibCommon\TComBitCounter.h"
 				>
@@ -454,8 +442,4 @@
 			</File>
 			<File
-				RelativePath="..\..\source\Lib\TLibCommon\TComDepthMapGenerator.h"
-				>
-			</File>
-			<File
 				RelativePath="..\..\source\Lib\TLibCommon\TComInterpolationFilter.h"
 				>
@@ -503,8 +487,4 @@
 			<File
 				RelativePath="..\..\source\Lib\TLibCommon\TComRdCostWeightPrediction.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\source\Lib\TLibCommon\TComResidualGenerator.h"
 				>
 			</File>
Index: trunk/build/vc9/TLibDecoder_vc9.vcproj
===================================================================
--- trunk/build/vc9/TLibDecoder_vc9.vcproj	(revision 77)
+++ trunk/build/vc9/TLibDecoder_vc9.vcproj	(revision 608)
@@ -295,4 +295,8 @@
 			</File>
 			<File
+				RelativePath="..\..\source\Lib\TLibDecoder\SyntaxElementParser.cpp"
+				>
+			</File>
+			<File
 				RelativePath="..\..\source\Lib\TLibDecoder\TDecBinCoderCABAC.cpp"
 				>
@@ -341,4 +345,8 @@
 			<File
 				RelativePath="..\..\source\Lib\TLibDecoder\SEIread.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\source\Lib\TLibDecoder\SyntaxElementParser.h"
 				>
 			</File>
Index: trunk/build/vc9/TLibEncoder_vc9.vcproj
===================================================================
--- trunk/build/vc9/TLibEncoder_vc9.vcproj	(revision 77)
+++ trunk/build/vc9/TLibEncoder_vc9.vcproj	(revision 608)
@@ -291,5 +291,9 @@
 			</File>
 			<File
-				RelativePath="..\..\source\Lib\TLibEncoder\TEncAdaptiveLoopFilter.cpp"
+				RelativePath="..\..\source\Lib\TLibEncoder\SyntaxElementWriter.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\source\Lib\TLibEncoder\TEncAnalyze.cpp"
 				>
 			</File>
@@ -324,4 +328,8 @@
 			<File
 				RelativePath="..\..\source\Lib\TLibEncoder\TEncPreanalyzer.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\source\Lib\TLibEncoder\TEncRateCtrl.cpp"
 				>
 			</File>
@@ -368,5 +376,5 @@
 			</File>
 			<File
-				RelativePath="..\..\source\Lib\TLibEncoder\TEncAdaptiveLoopFilter.h"
+				RelativePath="..\..\source\Lib\TLibEncoder\SyntaxElementWriter.h"
 				>
 			</File>
@@ -413,4 +421,8 @@
 			<File
 				RelativePath="..\..\source\Lib\TLibEncoder\TEncPreanalyzer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\source\Lib\TLibEncoder\TEncRateCtrl.h"
 				>
 			</File>
