Index: branches/SHM-dev/source/App/TAppDecoder/TAppDecCfg.cpp
===================================================================
--- branches/SHM-dev/source/App/TAppDecoder/TAppDecCfg.cpp	(revision 1319)
+++ branches/SHM-dev/source/App/TAppDecoder/TAppDecCfg.cpp	(revision 1323)
@@ -124,4 +124,5 @@
 #endif
   ("OutputDecodedSEIMessagesFilename",  m_outputDecodedSEIMessagesFilename,    string(""), "When non empty, output decoded SEI messages to the indicated file. If file is '-', then output to stdout\n")
+  ("ClipOutputVideoToRec709Range",      m_bClipOutputVideoToRec709Range,  false, "If true then clip output video to the Rec. 709 Range on saving")
 #if Q0074_COLOUR_REMAPPING_SEI
   ("SEIColourRemappingInfo,-cri", m_colourRemapSEIEnabled, false, "Control handling of Colour Remapping Information SEI messages\n"
Index: branches/SHM-dev/source/App/TAppDecoder/TAppDecCfg.h
===================================================================
--- branches/SHM-dev/source/App/TAppDecoder/TAppDecCfg.h	(revision 1319)
+++ branches/SHM-dev/source/App/TAppDecoder/TAppDecCfg.h	(revision 1323)
@@ -80,4 +80,5 @@
 #endif
   std::string   m_outputDecodedSEIMessagesFilename;   ///< filename to output decoded SEI messages to. If '-', then use stdout. If empty, do not output details.
+  Bool          m_bClipOutputVideoToRec709Range;      ///< If true, clip the output video to the Rec 709 range on saving.
 
 #if SVC_EXTENSION
Index: branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.cpp
===================================================================
--- branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.cpp	(revision 1319)
+++ branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.cpp	(revision 1323)
@@ -915,5 +915,6 @@
             conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(),
             conf.getWindowTopOffset()   * yScal + defDisp.getWindowTopOffset(),
-            conf.getWindowBottomOffset()* yScal + defDisp.getWindowBottomOffset() );
+            conf.getWindowBottomOffset()* yScal + defDisp.getWindowBottomOffset(),
+            NUM_CHROMA_FORMAT, m_bClipOutputVideoToRec709Range  );
         }
 
@@ -931,5 +932,6 @@
                                          conf.getWindowRightOffset() + defDisp.getWindowRightOffset(),
                                          conf.getWindowTopOffset() + defDisp.getWindowTopOffset(),
-                                         conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() );
+                                         conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(),
+                                         NUM_CHROMA_FORMAT, m_bClipOutputVideoToRec709Range  );
         }
 
@@ -1138,9 +1140,11 @@
           Int xScal =  TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc );
 
-          m_acTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(), m_outputColourSpaceConvert,
-            conf.getWindowLeftOffset()  *xScal + defDisp.getWindowLeftOffset(),
-            conf.getWindowRightOffset() *xScal + defDisp.getWindowRightOffset(),
-            conf.getWindowTopOffset()   *yScal + defDisp.getWindowTopOffset(),
-            conf.getWindowBottomOffset()*yScal + defDisp.getWindowBottomOffset() );
+          m_acTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(),
+                                                   m_outputColourSpaceConvert,
+                                                   conf.getWindowLeftOffset()  *xScal + defDisp.getWindowLeftOffset(),
+                                                   conf.getWindowRightOffset() *xScal + defDisp.getWindowRightOffset(),
+                                                   conf.getWindowTopOffset()   *yScal + defDisp.getWindowTopOffset(),
+                                                   conf.getWindowBottomOffset()*yScal + defDisp.getWindowBottomOffset(),            
+                                                   NUM_CHROMA_FORMAT, m_bClipOutputVideoToRec709Range );
         }
 
@@ -1158,5 +1162,6 @@
                                          conf.getWindowRightOffset() + defDisp.getWindowRightOffset(),
                                          conf.getWindowTopOffset() + defDisp.getWindowTopOffset(),
-                                         conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() );
+                                         conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(),
+                                         NUM_CHROMA_FORMAT, m_bClipOutputVideoToRec709Range );
         }
 
