Index: branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 41)
+++ branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 46)
@@ -82,4 +82,21 @@
 // ====================================================================================================================
 
+#if BITSTREAM_EXTRACTION
+Void  TDecCavlc::parseNalUnitHeader ( NalUnitType& eNalUnitType, UInt& TemporalId, UInt& uiLayerId )
+{
+  UInt  uiCode;
+
+  xReadCode ( 1, uiCode ); assert( 0 == uiCode); // forbidden_zero_bit
+  xReadCode ( 1, uiCode );                       // nal_ref_flag
+  xReadCode ( 6, uiCode );                       // nal_unit_type
+  eNalUnitType = (NalUnitType) uiCode;
+
+  xReadCode(3, uiCode); // temporal_id
+  TemporalId = uiCode;
+  xReadCode(5, uiCode); // layer_id_plus1
+  assert( 1 <= uiCode );
+  uiLayerId = uiCode - 1;
+}
+#else
 Void  TDecCavlc::parseNalUnitHeader ( NalUnitType& eNalUnitType, UInt& TemporalId, Bool& bOutputFlag )
 {
@@ -105,4 +122,5 @@
   }
 }
+#endif
 
 /**
Index: branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecCAVLC.h
===================================================================
--- branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 41)
+++ branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 46)
@@ -182,5 +182,10 @@
 #endif
   
+#if BITSTREAM_EXTRACTION
+  Void  parseNalUnitHeader  ( NalUnitType& eNalUnitType, UInt& TemporalId, UInt& uiLayerId );
+#else
   Void  parseNalUnitHeader  ( NalUnitType& eNalUnitType, UInt& TemporalId, Bool& bOutputFlag );
+#endif
+
   
   Void  parseSPS            ( TComSPS* pcSPS );
Index: branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecEntropy.h
===================================================================
--- branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecEntropy.h	(revision 41)
+++ branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecEntropy.h	(revision 46)
@@ -67,5 +67,9 @@
   virtual Void  setBitstream          ( TComBitstream* p )  = 0;
 
+#if BITSTREAM_EXTRACTION
+  virtual Void  parseNalUnitHeader    ( NalUnitType& eNalUnitType, UInt& TemporalId, UInt& uiLayerId )  = 0;
+#else
   virtual Void  parseNalUnitHeader    ( NalUnitType& eNalUnitType, UInt& TemporalId, Bool& bOutputFlag )  = 0;
+#endif
 
   virtual Void  parseSPS                  ( TComSPS* pcSPS )                                      = 0;
@@ -147,7 +151,11 @@
   Void    resetEntropy                ( TComSlice* p)           { m_pcEntropyDecoderIf->resetEntropy(p);                    }
 
+#if BITSTREAM_EXTRACTION
+  Void    decodeNalUnitHeader         ( NalUnitType& eNalUnitType, UInt& TemporalId, UInt& uiLayerId )
+                                                                { m_pcEntropyDecoderIf->parseNalUnitHeader( eNalUnitType, TemporalId, uiLayerId ); }
+#else
   Void    decodeNalUnitHeader         ( NalUnitType& eNalUnitType, UInt& TemporalId, Bool& bOutputFlag )
                                                                 { m_pcEntropyDecoderIf->parseNalUnitHeader(eNalUnitType, TemporalId, bOutputFlag ); }
-
+#endif
 
   Void    decodeSPS                   ( TComSPS* pcSPS     )    { m_pcEntropyDecoderIf->parseSPS(pcSPS);                    }
Index: branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecSbac.h
===================================================================
--- branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecSbac.h	(revision 41)
+++ branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecSbac.h	(revision 46)
@@ -75,5 +75,9 @@
   Void  setMaxAlfCtrlDepth        ( UInt uiMaxAlfCtrlDepth ) { m_uiMaxAlfCtrlDepth = uiMaxAlfCtrlDepth; }
   
+#if BITSTREAM_EXTRACTION
+  Void  parseNalUnitHeader    ( NalUnitType& eNalUnitType, UInt& TemporalId, UInt& uiLayerId ) {}
+#else
   Void  parseNalUnitHeader    ( NalUnitType& eNalUnitType, UInt& TemporalId, Bool& bOutputFlag ) {}
+#endif
   
   Void  parseSPS                  ( TComSPS* pcSPS         ) {}
Index: branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecTop.cpp	(revision 41)
+++ branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecTop.cpp	(revision 46)
@@ -709,7 +709,15 @@
   NalUnitType eNalUnitType;
   UInt        TemporalId;
+
+#if BITSTREAM_EXTRACTION
+  UInt        uiLayerId;
+
+  m_cEntropyDecoder.decodeNalUnitHeader(eNalUnitType, TemporalId, uiLayerId);
+#else
   Bool        OutputFlag;
 
   m_cEntropyDecoder.decodeNalUnitHeader(eNalUnitType, TemporalId, OutputFlag);
+#endif
+
   reNalUnitType = eNalUnitType;
 
