Index: /branches/HTM-15.2-dev/compat/msvc/stdint.h
===================================================================
--- /branches/HTM-15.2-dev/compat/msvc/stdint.h	(revision 1361)
+++ /branches/HTM-15.2-dev/compat/msvc/stdint.h	(revision 1362)
@@ -1,3 +1,9 @@
 #pragma once
+#ifndef _MSC_VER
+#error local C99 type definition should only be used in Visual C++ before 2010
+#endif
+#if _MSC_VER > 1500
+#error local C99 type definition should only be used in Visual C++ before 2010
+#endif
 
 /* a minimal set of C99 types for use with MSVC */
Index: /branches/HTM-15.2-dev/doc/Doxyfile
===================================================================
--- /branches/HTM-15.2-dev/doc/Doxyfile	(revision 1361)
+++ /branches/HTM-15.2-dev/doc/Doxyfile	(revision 1362)
@@ -39,5 +39,5 @@
 # control system is used.
 
-PROJECT_NUMBER         = HM-16.6
+PROJECT_NUMBER         = HM-16.7
 
 # Using the PROJECT_BRIEF tag one can provide an optional one line description
@@ -2373,5 +2373,5 @@
 # This tag requires that the tag HAVE_DOT is set to YES.
 
-DOT_GRAPH_MAX_NODES    = 60
+DOT_GRAPH_MAX_NODES    = 100
 
 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
Index: /branches/HTM-15.2-dev/doc/software-manual.tex
===================================================================
--- /branches/HTM-15.2-dev/doc/software-manual.tex	(revision 1361)
+++ /branches/HTM-15.2-dev/doc/software-manual.tex	(revision 1362)
@@ -4,5 +4,9 @@
 
 \usepackage{hyperref}
-\hypersetup{colorlinks=true}
+\hypersetup{colorlinks=true,
+            linkcolor=black,      % color of internal links (change box color with linkbordercolor)
+            citecolor=black,      % color of links to bibliography
+            filecolor=black,      % color of file links
+            urlcolor=blue}
 \usepackage{color,soul}
 
@@ -187,5 +191,5 @@
 \begin{abstract}
 This document is a user manual describing usage of reference software
-for the HEVC project. It applies to version 16.6
+for the HEVC project. It applies to version 16.7
 of the software.
 \end{abstract}
@@ -241,9 +245,11 @@
 % Environment          & Location of project file \\
 \hline
-MS Visual Studio 8   & build/HM_vc8.sln \\
-MS Visual Studio 9   & build/HM_vc9.sln \\
-MS Visual Studio 10  & build/HM_vc10.sln \\
-Xcode                & HM.xcodeproj \\
-Linux                & build/linux/makefile \\
+MS Visual Studio 2008 (VC9)   & build/HM_vc9.sln \\
+MS Visual Studio 2010 (VC10)  & build/HM_vc2010.sln \\
+MS Visual Studio 2012 (VC11)  & build/HM_vc2012.sln \\
+MS Visual Studio 2013 (VC12)  & build/HM_vc2013.sln \\
+Xcode                         & HM.xcodeproj \\
+Eclipse                       & .project .cproject \\
+make/gcc (e.g. Linux)         & build/linux/makefile \\
 \hline
 \end{tabular}
@@ -483,5 +489,5 @@
 
 \setlength{\algomargin}{2em}
-\begin{algorithm}[h]
+\begin{algorithm}[ht]
 \SetKwData{deltaRIdx}{deltaRIdx}
 \SetKwData{deltaRPS}{deltaRPS}
@@ -793,4 +799,10 @@
 \\
 
+\Option{AccessUnitDelimiter} &
+%\ShortOption{\None} &
+\Default{0} &
+Add Access Unit Delimiter NAL units between all Access Units.
+\\
+
 \end{OptionTableNoShorthand}
 
@@ -1004,6 +1016,7 @@
 \begin{tabular}{cp{0.45\textwidth}}
  0 & Full search method \\
- 1 & Fast search method \\
- 2 & Previous motion vector fast search method \\
+ 1 & Fast search method - TZSearch\\
+ 2 & Predictive motion vector fast search method \\
+ 3 & Extended TZSearch method \\
 \end{tabular}
 \\
@@ -1094,8 +1107,31 @@
 $\lambda$, for use in the rate-distortion optimised cost calculation
 when encoding temporal layer~$N$.
+If LambdaModifierI is specified, then LambdaModifierI will be used for intra pictures.
 \par
 $N$ may be in the range 0 (inclusive) to 7 (exclusive).
 \\
 
+\Option{LambdaModifierI (-LMI)} &
+%\ShortOption{-LMI} &
+\Default{} &
+Specifies one or more of the LambdaModifiers to use intra pictures at each of the temporal layers.
+If not present, then the LambdaModifier$N$ settings are used instead. If the list of values
+(comma or space separated) does not include enough values for each of the temporal layers,
+the last value is repeated as required.
+\\
+
+\Option{IQPFactor (-IQF)} &
+%\ShortOption{-IQF} &
+\Default{-1} &
+Specifies the QP factor to be used for intra pictures during the lambda computation.
+(The values specified in the GOP structure are only used for inter pictures).
+If negative (default), the following equation is used to derive the value:
+\par
+$IQP_{factor}=0.57*(1.0-Max(0.5, Min(0.0, 0.05*s)))$
+\par
+where $s = Int(isField ? (GS-1)/2 : GS-1)$ and
+$GS$ is the gop size.
+\\
+
 \Option{ECU} &
 %\ShortOption{\None} &
@@ -1118,13 +1154,23 @@
 \Option{FEN} &
 %\ShortOption{\None} &
-\Default{false} &
-Enables or disables the use of fast encoder mode.  When enabled,
-the following occurs:
-\begin{itemize}
-\item In the SAD computation for blocks having size larger than 8, only
-      the lines of even rows in the block are considered.
-\item The number of iterations used in the bi-directional motion vector
-      refinement in the motion estimation process is reduced from 4 to 1.
-\end{itemize}
+\Default{0} &
+Controls the use of different fast encoder coding tools.  The following
+tools are supported in different combinations:
+\par
+\begin{tabular}{cp{0.45\textwidth}}
+ a & In the SAD computation for blocks having size larger than 8, only
+     the lines of even rows in the block are considered. \\
+ b & The number of iterations used in the bi-directional motion vector
+     refinement in the motion estimation process is reduced from 4 to 1. \\
+\end{tabular}
+Depending on the value of the parameter, the following combinations are
+supported:
+\par
+\begin{tabular}{cp{0.45\textwidth}}
+ 0 & Disable all modes \\
+ 1 & Use both a \& b tools\\
+ 2 & Use only tool b \\
+ 3 & Use only tool a \\
+\end{tabular}
 \\
 
@@ -1596,4 +1642,19 @@
 \\
 
+\Option{WPMethod (-wpM)} &
+%\ShortOption{\-wpM} &
+\Default{0} &
+Sets the Weighted Prediction method to be used.
+\par
+\begin{tabular}{cp{0.45\textwidth}}
+  0 & Image DC based method with joint color component decision. \\
+  1 & Image DC based method with separate color component decision. \\
+  2 & DC + Histogram refinement method (no clipping). \\
+  3 & DC + Histogram refinement method (with clipping). \\
+  4 & DC + Dual Histogram refinement method (with clipping). \\
+\end{tabular}
+\\
+
+
 \Option{Log2ParallelMergeLevel} &
 %\ShortOption{\None} &
@@ -1703,4 +1764,23 @@
 \Default{false} &
 Rate control: force intra QP to be equal to initial QP or not.
+\\
+
+\Option{RCCpbSaturation} &
+%\ShortOption{\None} &
+\Default{false} &
+Rate control: enable target bits saturation to avoid CPB overflow and underflow or not.
+\\
+
+\Option{RCCpbSize} &
+%\ShortOption{\None} &
+\Default{0} &
+Rate control: CPB size, in bps.
+\\
+
+\Option{RCInitialCpbFullness} &
+%\ShortOption{\None} &
+\Default{0.9} &
+Rate control: ratio of initial CPB fullness per CPB size. (InitalCpbFullness/CpbSize)
+RCInitialCpbFullness should be smaller than or equal to 1.
 \\
 \end{OptionTableNoShorthand}
@@ -1978,5 +2058,5 @@
   140 & Chroma resampling filter hint            & Table \ref{tab:chroma-resampling-filter-hint} \\
   141 & Knee function information                & Table \ref{tab:sei-knee-function} \\
-  142 & Colour remapping information             & (Not handled)\\
+  142 & Colour remapping information             & Table \ref{tab:sei-colour-remapping}\\
   143 & Deinterlaced field identification        & (Not handled)\\
 \end{SEIListTable}
@@ -2469,9 +2549,9 @@
 
 \begin{OptionTableNoShorthand}{Chroma resampling filter hint SEI message encoder parameters}{tab:chroma-resampling-filter-hint}
-\Option{SEIChromaSamplingFilterHint} &
+\Option{SEIChromaResamplingFilterHint} &
 \Default{false} &
 When true (non-zero), generates example chroma sampling filter hint SEI messages.
 \\
-\Option{SEIChromaSamplingHorizontalFilterType} &
+\Option{SEIChromaResamplingHorizontalFilterType} &
 \Default{2} &
 Defines the index of the chroma sampling horizontal filter:
@@ -2483,5 +2563,5 @@
 \end{tabular}
 \\
-\Option{SEIChromaSamplingVerticalFilterType} &
+\Option{SEIChromaResamplingVerticalFilterType} &
 \Default{2} &
 Defines the index of the chroma sampling vertical filter:
@@ -2549,4 +2629,14 @@
 100 250 450
 \end{tabular}
+\\
+\end{OptionTableNoShorthand}
+
+
+\begin{OptionTableNoShorthand}{Colour remapping SEI message encoder parameters}{tab:sei-colour-remapping}
+\Option{SEIColourRemappingInfoFileRoot (-cri)} &
+\Default{\NotSet} &
+Specifies the prefix of input Colour Remapping Information file. Prefix is completed by ``_x.txt'' where x is the  POC number.
+The contents of the file are a list of the SEI message's syntax element names (in decoding order) immediately followed by a `:' and then the associated value.
+An example file can be found in cfg/misc/example_colour_remapping_sei_encoder_0.txt.
 \\
 \end{OptionTableNoShorthand}
@@ -2731,4 +2821,11 @@
 \\
 
+\Option{SEIColourRemappingInfoFilename} &
+%\ShortOption{\None} &
+\Default{\NotSet} &
+Specifies that the colour remapping SEI message should be applied to the output video, with the output written to this file.
+If no value is specified, the SEI message is ignored and no mapping is applied.
+\\
+
 \Option{RespectDefDispWindow (-w)} &
 %\ShortOption{-w} &
Index: /branches/HTM-15.2-dev/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- /branches/HTM-15.2-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1361)
+++ /branches/HTM-15.2-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1362)
@@ -723,11 +723,4 @@
   Bool do_help = false;
 
-#if !NH_MV
-  string cfg_InputFile;
-#endif
-  string cfg_BitstreamFile;
-#if !NH_MV
-  string cfg_ReconFile;
-#endif
 #if NH_MV
   vector<Int>   cfg_dimensionLength; 
@@ -742,6 +735,4 @@
 #endif 
 #endif
-  string cfg_dQPFile;
-  string cfg_ScalingListFile;
 
   Int tmpChromaFormat;
Index: /branches/HTM-15.2-dev/source/App/TAppEncoder/TAppEncCfg.h
===================================================================
--- /branches/HTM-15.2-dev/source/App/TAppEncoder/TAppEncCfg.h	(revision 1361)
+++ /branches/HTM-15.2-dev/source/App/TAppEncoder/TAppEncCfg.h	(revision 1362)
@@ -136,4 +136,5 @@
 #endif
 #endif
+  // Lambda modifiers
   Double    m_adLambdaModifier[ MAX_TLAYER ];                 ///< Lambda modifier array for each temporal layer
   std::vector<Double> m_adIntraLambdaModifier;                ///< Lambda modifier for Intra pictures, one for each temporal layer. If size>temporalLayer, then use [temporalLayer], else if size>0, use [size()-1], else use m_adLambdaModifier.
Index: /branches/HTM-15.2-dev/source/Lib/TAppCommon/program_options_lite.h
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TAppCommon/program_options_lite.h	(revision 1361)
+++ /branches/HTM-15.2-dev/source/Lib/TAppCommon/program_options_lite.h	(revision 1362)
@@ -37,5 +37,4 @@
 #include <map>
 #include  "../TLibCommon/CommonDef.h" 
-
 #if NH_MV
 #include <vector>
Index: /branches/HTM-15.2-dev/source/Lib/TLibCommon/CommonDef.h
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibCommon/CommonDef.h	(revision 1361)
+++ /branches/HTM-15.2-dev/source/Lib/TLibCommon/CommonDef.h	(revision 1362)
@@ -54,6 +54,4 @@
 // 
 #endif // _MSC_VER > 1000
-
-
 #include "TypeDef.h"
 #ifdef _MSC_VER
Index: /branches/HTM-15.2-dev/source/Lib/TLibCommon/SEI.cpp
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibCommon/SEI.cpp	(revision 1361)
+++ /branches/HTM-15.2-dev/source/Lib/TLibCommon/SEI.cpp	(revision 1362)
@@ -32,5 +32,5 @@
  */
 
-/** \file     #SEI.cpp
+/** \file     SEI.cpp
     \brief    helper functions for SEI handling
 */
Index: /branches/HTM-15.2-dev/source/Lib/TLibCommon/SEI.h
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibCommon/SEI.h	(revision 1361)
+++ /branches/HTM-15.2-dev/source/Lib/TLibCommon/SEI.h	(revision 1362)
@@ -678,5 +678,4 @@
 
 };
-
 #if NH_MV_SEI
 #if NH_MV_LAYERS_NOT_PRESENT_SEI
@@ -1377,5 +1376,5 @@
 #endif
 #endif
-
-#endif
+#endif
+
 //! \}
Index: /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1361)
+++ /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1362)
@@ -1121,9 +1121,9 @@
 
 // Copy inter prediction info from the biggest CU
-Void TComDataCU::copyInterPredInfoFrom    ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList 
 #if NH_3D_NBDV
-  , Bool bNBDV
-#endif
-)
+Void TComDataCU::copyInterPredInfoFrom    ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList   , Bool bNBDV )
+#else
+Void TComDataCU::copyInterPredInfoFrom    ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList )
+#endif
 {
   m_pcPic              = pcCU->getPic();
@@ -4372,9 +4372,9 @@
       }
     }
-    if ( ctuRsAddr >= 0 && xGetColMVP( eRefPicList, ctuRsAddr, absPartAddr, cColMv, refIdx_Col 
 #if NH_3D_TMVP
-      , 0
-#endif
-      ) )
+        if ( ctuRsAddr >= 0 && xGetColMVP( eRefPicList, ctuRsAddr, absPartAddr, cColMv, refIdx_Col  , 0 ) )
+#else
+    if ( ctuRsAddr >= 0 && xGetColMVP( eRefPicList, ctuRsAddr, absPartAddr, cColMv, refIdx_Col ) )
+#endif
     {
       pInfo->m_acMvCand[pInfo->iN++] = cColMv;
@@ -4384,9 +4384,9 @@
       UInt uiPartIdxCenter;
       xDeriveCenterIdx( partIdx, uiPartIdxCenter );
-      if (xGetColMVP( eRefPicList, getCtuRsAddr(), uiPartIdxCenter,  cColMv, refIdx_Col 
 #if NH_3D_TMVP
-        , 0
-#endif
-        ))
+      if (xGetColMVP( eRefPicList, getCtuRsAddr(), uiPartIdxCenter,  cColMv, refIdx_Col , 0 )) 
+#else
+      if (xGetColMVP( eRefPicList, getCtuRsAddr(), uiPartIdxCenter,  cColMv, refIdx_Col ))
+#endif
       {
         pInfo->m_acMvCand[pInfo->iN++] = cColMv;
Index: /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComDataCU.h
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComDataCU.h	(revision 1361)
+++ /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComDataCU.h	(revision 1362)
@@ -239,5 +239,4 @@
 
   /// compute scaling factor from POC difference
-
 #if !NH_3D_ARP
   static Int    xGetDistScaleFactor           ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC );
@@ -277,9 +276,9 @@
 
   Void          copySubCU             ( TComDataCU* pcCU, UInt uiPartUnitIdx );
-  Void          copyInterPredInfoFrom ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList 
 #if NH_3D_NBDV
-  , Bool bNBDV = false
-#endif
-);
+    Void          copyInterPredInfoFrom ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList, Bool bNBDV = false );
+#else
+  Void          copyInterPredInfoFrom ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList );
+#endif
   Void          copyPartFrom          ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth );
 
Index: /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComInterpolationFilter.cpp
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComInterpolationFilter.cpp	(revision 1361)
+++ /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComInterpolationFilter.cpp	(revision 1362)
@@ -360,9 +360,10 @@
  * \param  bitDepth   Bit depth
  */
-Void TComInterpolationFilter::filterHor(const ComponentID compID, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast, const ChromaFormat fmt, const Int bitDepth 
-#if NH_3D_ARP
-    , Bool filterType
-#endif
-)
+#if NH_3D_ARP
+Void TComInterpolationFilter::filterHor(const ComponentID compID, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast, const ChromaFormat fmt, const Int bitDepth, Bool filterType )
+#else
+Void TComInterpolationFilter::filterHor(const ComponentID compID, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast, const ChromaFormat fmt, const Int bitDepth )
+#endif 
+
 {
   if ( frac == 0 )
@@ -423,9 +424,9 @@
  * \param  bitDepth   Bit depth
  */
-Void TComInterpolationFilter::filterVer(const ComponentID compID, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast, const ChromaFormat fmt, const Int bitDepth 
-#if NH_3D_ARP
-    , Bool filterType
-#endif
-)
+#if NH_3D_ARP
+Void TComInterpolationFilter::filterVer(const ComponentID compID, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast, const ChromaFormat fmt, const Int bitDepth, Bool filterType )
+#else
+Void TComInterpolationFilter::filterVer(const ComponentID compID, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast, const ChromaFormat fmt, const Int bitDepth )
+#endif
 {
   if ( frac == 0 )
Index: /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComInterpolationFilter.h
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComInterpolationFilter.h	(revision 1361)
+++ /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComInterpolationFilter.h	(revision 1362)
@@ -82,9 +82,10 @@
   ~TComInterpolationFilter() {}
 
-  Void filterHor(const ComponentID compID, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Int frac,               Bool isLast, const ChromaFormat fmt, const Int bitDepth 
 #if NH_3D_ARP
-    , Bool filterType = false
+  Void filterHor(const ComponentID compID, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Int frac,               Bool isLast, const ChromaFormat fmt, const Int bitDepth , Bool filterType = false );
+#else
+  Void filterHor(const ComponentID compID, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Int frac,               Bool isLast, const ChromaFormat fmt, const Int bitDepth );
 #endif
-);
+
   Void filterVer(const ComponentID compID, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast, const ChromaFormat fmt, const Int bitDepth 
 #if NH_3D_ARP
Index: /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComMv.h
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComMv.h	(revision 1361)
+++ /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComMv.h	(revision 1362)
@@ -100,15 +100,12 @@
   Void  setHor    ( Short i )                   { m_iHor = i;                               }
   Void  setVer    ( Short i )                   { m_iVer = i;                               }
-  Void  setZero   ()                            { m_iHor = m_iVer = 0; 
- #if NH_3D_NBDV
-   m_bIDV = false; m_iIDVHor = m_iIDVVer = 0;
-   m_iIDVVId = 0; 
-#endif
- }
-#if NH_3D_NBDV
+#if NH_3D_NBDV
+  Void  setZero   ()                            { m_iHor = m_iVer = 0; m_bIDV = false; m_iIDVHor = m_iIDVVer = 0; m_iIDVVId = 0;  }
   Void   setIDVHor  (Short i)                    {m_iIDVHor = i;}
   Void   setIDVVer  (Short i)                    {m_iIDVVer = i;}
   Void   setIDVFlag (Bool b )                    {m_bIDV    = b;}
   Void   setIDVVId  (Short i)                    {m_iIDVVId = i;}
+#else
+  Void  setZero   ()                            { m_iHor = m_iVer = 0;  }
 #endif
   // ------------------------------------------------------------------------------------------------------------------
@@ -145,5 +142,16 @@
   }
 
-#if NH_3D || !ME_ENABLE_ROUNDING_OF_MVS
+#if NH_3D
+#if ME_ENABLE_ROUNDING_OF_MVS
+
+  const TComMv& operator>>= (const Int i)
+  {
+    m_iHor >>= i;
+    m_iVer >>= i;
+    return  *this;
+  }
+#endif
+#endif
+#if !ME_ENABLE_ROUNDING_OF_MVS
   const TComMv& operator>>= (const Int i)
   {
Index: /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComPicYuv.cpp
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComPicYuv.cpp	(revision 1361)
+++ /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComPicYuv.cpp	(revision 1362)
@@ -108,6 +108,8 @@
   // initialize pointers for unused components to NULL
   for(UInt comp=getNumberValidComponents();comp<MAX_NUM_COMPONENT; comp++)
-    {
-    }
+  {
+    m_apiPicBuf[comp] = NULL;
+    m_piPicOrg[comp]  = NULL;
+  }
 
   for(Int chan=0; chan<MAX_NUM_CHANNEL_TYPE; chan++)
Index: /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComPrediction.cpp
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComPrediction.cpp	(revision 1361)
+++ /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComPrediction.cpp	(revision 1362)
@@ -1827,4 +1827,5 @@
 
 
+#if NH_3D
 Void TComPrediction::xPredInterBlk(const ComponentID compID, TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *dstPic, Bool bi, const Int bitDepth 
 #if NH_3D_ARP
@@ -1835,4 +1836,7 @@
 #endif
 )
+#else
+Void TComPrediction::xPredInterBlk(const ComponentID compID, TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *dstPic, Bool bi, const Int bitDepth )
+#endif
 {
 #if NH_MV
@@ -1870,25 +1874,34 @@
   if ( yFrac == 0 )
   {
+#if NH_3D
+    m_if.filterHor(compID, ref, refStride, dst,  dstStride, cxWidth, cxHeight, xFrac, !bi 
 #if NH_3D_IC
-    m_if.filterHor(compID, ref, refStride, dst,  dstStride, cxWidth, cxHeight, xFrac, !bi || bICFlag, chFmt, bitDepth
-#else
-    m_if.filterHor(compID, ref, refStride, dst,  dstStride, cxWidth, cxHeight, xFrac, !bi, chFmt, bitDepth
-#endif
+     || bICFlag
+#endif
+    , chFmt, bitDepth
 #if NH_3D_ARP 
     , filterType
 #endif 
 );
+#else
+    m_if.filterHor(compID, ref, refStride, dst,  dstStride, cxWidth, cxHeight, xFrac, !bi, chFmt, bitDepth );
+#endif
   }
   else if ( xFrac == 0 )
   {
+#if NH_3D
+  m_if.filterVer(compID, ref, refStride, dst, dstStride, cxWidth, cxHeight, yFrac, true, !bi 
 #if NH_3D_IC
-    m_if.filterVer(compID, ref, refStride, dst, dstStride, cxWidth, cxHeight, yFrac, true, !bi || bICFlag, chFmt, bitDepth
-#else
-    m_if.filterVer(compID, ref, refStride, dst, dstStride, cxWidth, cxHeight, yFrac, true, !bi, chFmt, bitDepth
-#endif
+    || bICFlag
+#endif
+    , chFmt, bitDepth
 #if NH_3D_ARP
     , filterType
 #endif
 );
+#else
+    m_if.filterVer(compID, ref, refStride, dst, dstStride, cxWidth, cxHeight, yFrac, true, !bi, chFmt, bitDepth );
+
+#endif
   }
   else
