imagingmodules/jp2kcodec/Inc/JP2KEntropyDecoder.h
changeset 0 469c91dae73b
equal deleted inserted replaced
-1:000000000000 0:469c91dae73b
       
     1 /*
       
     2 * Copyright (c) 2003, 2004 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  CJ2kEntropyDecoder class used to perform entropy decoding
       
    15 *                on the codebloc.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef __JP2KENTROPYDECODER_H__
       
    21 #define __JP2KENTROPYDECODER_H__
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include "JP2KUtils.h"
       
    26 
       
    27 // CONSTANTS
       
    28 const TUint8 KSignShift = (TUint8)( KImplementationPrecision - 1 );
       
    29 
       
    30 // Flags for positions of the contexts of the state of a pixel
       
    31 const TUint8 KPositionSignificant = 14;
       
    32 const TUint8 KPositionVisited     = 13;
       
    33 const TUint8 KPositionHorNeg      = 12;
       
    34 const TUint8 KPositionHorPos      = 11;
       
    35 const TUint8 KPositionVerNeg      = 10;
       
    36 const TUint8 KPositionVerPos      = 9;
       
    37 const TUint8 KPositionMR          = 8;
       
    38 const TUint8 KPositionLeft        = 7;
       
    39 const TUint8 KPositionRight       = 6;
       
    40 const TUint8 KPositionUp          = 5;
       
    41 const TUint8 KPositionDown        = 4;
       
    42 const TUint8 KPositionUpperLeft   = 3;
       
    43 const TUint8 KPositionUpperRight  = 2;
       
    44 const TUint8 KPositionLowerLeft   = 1;
       
    45 const TUint8 KPositionLowerRight  = 0;
       
    46 
       
    47 // Flags for the values of the contexts of the state of a pixel
       
    48 const TInt16 KStateSignificant    = (TInt16)( 1 << KPositionSignificant );
       
    49 const TInt16 KStateVisited        = (TInt16)( 1 << KPositionVisited );
       
    50 const TInt16 KStateHorNegative    = (TInt16)( 1 << KPositionHorNeg );
       
    51 const TInt16 KStateHorPositive    = (TInt16)( 1 << KPositionHorPos );
       
    52 const TInt16 KStateVerNegative    = (TInt16)( 1 << KPositionVerNeg );
       
    53 const TInt16 KStateVerPositive    = (TInt16)( 1 << KPositionVerPos );
       
    54 const TInt16 KStatePreviousMR     = (TInt16)( 1 << KPositionMR );
       
    55 const TInt16 KStateLeft           = (TInt16)( 1 << KPositionLeft );
       
    56 const TInt16 KStateRight          = (TInt16)( 1 << KPositionRight );
       
    57 const TInt16 KStateUp             = (TInt16)( 1 << KPositionUp );
       
    58 const TInt16 KStateDown           = (TInt16)( 1 << KPositionDown );
       
    59 const TInt16 KStateUpperLeft      = (TInt16)( 1 << KPositionUpperLeft );
       
    60 const TInt16 KStateUpperRight     = (TInt16)( 1 << KPositionUpperRight );
       
    61 const TInt16 KStateLowerLeft      = (TInt16)( 1 << KPositionLowerLeft );
       
    62 const TInt16 KStateLowerRight     = (TInt16)( 1 << KPositionLowerRight );
       
    63 
       
    64 const TInt16 KZcMask              = (TInt16)( ( 1 << 8 ) - 1 ); // First eight bits of states
       
    65 const TUint8 KPredictionBit       = 6;
       
    66 const TUint8 KScShift             = 9;
       
    67 const TUint8 KScLutMask           = (TUint8)( ( 1 << 4 ) - 1 ); // First four bits of states 
       
    68 const TUint8 KZcLutBits           = 8;
       
    69 const TUint8 KLutSize             = 16;
       
    70 const TUint8 KUniformContext      = 0;
       
    71 const TUint8 KRlcContext          = 1;
       
    72 const TUint8 KSegmentationMarker         = 10;   // Segmentation markers with one int
       
    73 const TUint8 KErrorResilienceTermination = 0x55; // Error resilience prediction termination.
       
    74 const TUint8 KStripeHeight            = 4;
       
    75 
       
    76 // MQ related parameters
       
    77 const TUint8 KNumberContexts          = 19;
       
    78 const TUint8 KNumberOriginalMQEntries = 47;
       
    79 
       
    80 // Coding pass related parameters
       
    81 const TUint8 KFirstLazyPassIndex    = 9;
       
    82 const TUint8 KFirstBypassTermIndex  = 10;  // Pass which is terminated first if AC bypass and no termination 
       
    83 
       
    84 // MACROS
       
    85 
       
    86 // DATA TYPES
       
    87 
       
    88 // Entropy coding parameters: flags for arithmetic bypass, context
       
    89 // resetting, termination, vertical stripes, prediction termination
       
    90 // and segment symbols.
       
    91 enum TEntropyErrorState
       
    92     {
       
    93     ENoError = 0, 
       
    94     EEntropyCodingError, 
       
    95     };
       
    96 
       
    97 // FUNCTION PROTOTYPES
       
    98 
       
    99 // FORWARD DECLARATIONS
       
   100 class J2KMQCoder;
       
   101 class CJ2kEntropyDecoder;
       
   102 class CJ2kImageInfo;
       
   103 class CJ2kCodeBlock;
       
   104 class CJ2kSynthesis;
       
   105 
       
   106 // CLASS DECLARATION
       
   107 
       
   108 /**
       
   109  * J2KEntropyStream class is used to handle 
       
   110  * the buffer of encoded bytes as well as 
       
   111  * reading bits and bytes from it.
       
   112  *
       
   113  * JP2KCodec.dll
       
   114  * @since 2.6
       
   115  */
       
   116 class J2KEntropyStream
       
   117 {
       
   118 
       
   119     public:  // Constructors and destructor
       
   120         
       
   121     public: // New functions
       
   122 
       
   123         /**
       
   124         * Read a byte from the input stream
       
   125         * @since 2.6
       
   126         * @return TUint8: a byte from the input stream.
       
   127         */
       
   128         TUint8 ReadByteFromStream();
       
   129 
       
   130         /**
       
   131         * Read a bit from the input stream
       
   132         * @since 2.6
       
   133         * @return TUint8: a bit from the input stream.
       
   134         */
       
   135         TUint8 ReadBitFromStream();
       
   136 
       
   137         /**
       
   138         * Check a prediction termination for raw coding
       
   139         * @since 2.6
       
   140         * @return TEntropyErrorState: ENoError if success.
       
   141         */
       
   142         TEntropyErrorState CheckPrediction();
       
   143 
       
   144         /**
       
   145         * Reset the input stream
       
   146         * @since 2.6
       
   147         */
       
   148         void ResetInputStream();
       
   149 
       
   150     public: // Functions from base classes
       
   151         
       
   152     protected:  // New functions       
       
   153 
       
   154     protected:  // Functions from base classes
       
   155 
       
   156     private:
       
   157 
       
   158     public:     // Data
       
   159     
       
   160     protected:  // Data
       
   161 
       
   162     private:    // Data
       
   163         
       
   164         // The size of the buffer
       
   165         TInt32 iNumBytes;      
       
   166 
       
   167         // Position of the next byte in the buffer
       
   168         TInt32 iPosition;      
       
   169 
       
   170         // Buffer for bytes 
       
   171         TUint8* iBuffer;       
       
   172         
       
   173         // Buffer for bit-output 
       
   174         TUint8 iTinyBuffer;    
       
   175 
       
   176         // Flag for delaying the input of 0xFF byte
       
   177         TUint8 iDelayedFF;     
       
   178 
       
   179         // Position of the next bit in the the tiny_buffer
       
   180         TInt8 iTinyBufferPos; 
       
   181 
       
   182     public:     // Friend classes
       
   183 
       
   184         friend class J2KMQCoder;
       
   185         friend class CJ2kEntropyDecoder;
       
   186 
       
   187     protected:  // Friend classes
       
   188         
       
   189     private:    // Friend classes
       
   190 };
       
   191 
       
   192 /**
       
   193  * J2KEntropyStates class is used to handle 
       
   194  * the states and state transition information
       
   195  * for the MQ entropy decoding.
       
   196  *
       
   197  * JP2KCodec.dll
       
   198  * @since 2.6
       
   199  */
       
   200 class J2KEntropyStates : public CBase
       
   201     {
       
   202     public:  // Constructors and destructor
       
   203         
       
   204     public: // New functions
       
   205         
       
   206     public: // Functions from base classes
       
   207         
       
   208     protected:  // New functions
       
   209         
       
   210     protected:  // Functions from base classes
       
   211         
       
   212     private:
       
   213 
       
   214     public:     // Data
       
   215     
       
   216     protected:  // Data
       
   217 
       
   218     private:    // Data
       
   219 
       
   220         // Pointer to the next mps state 
       
   221         J2KEntropyStates* iNextMPS;    
       
   222 
       
   223         // Pointer to the next lps state 
       
   224         J2KEntropyStates* iNextLPS;    
       
   225 
       
   226         // Current estimate for lps symbol probability
       
   227         TUint32 iQe;        
       
   228         
       
   229         // Flag for switching the mps (0->1 or 1->0)
       
   230         TInt32 iSwitchFlag; 
       
   231 
       
   232     public:     // Friend classes
       
   233         friend class J2KMQCoder;
       
   234     protected:  // Friend classes
       
   235 
       
   236     private:    // Friend classes
       
   237 
       
   238     };
       
   239 
       
   240 /**
       
   241  * J2KEntropyContexts class is used to handle 
       
   242  * the context information for the MQ entropy 
       
   243  * decoding.
       
   244  *
       
   245  * JP2KCodec.dll
       
   246  * @since 2.6
       
   247  */
       
   248 class J2KEntropyContexts : public CBase
       
   249     {
       
   250     public:  // Constructors and destructor
       
   251         
       
   252     public: // New functions
       
   253         
       
   254     public: // Functions from base classes
       
   255         
       
   256     protected:  // New functions
       
   257         
       
   258     protected:  // Functions from base classes
       
   259         
       
   260     private:
       
   261 
       
   262     public:     // Data
       
   263     
       
   264     protected:  // Data
       
   265 
       
   266     private:    // Data
       
   267 
       
   268         // Entropy state.
       
   269         J2KEntropyStates* iState;
       
   270         
       
   271         // Most probable symbol
       
   272         TInt32 iMPS;
       
   273 
       
   274     public:     // Friend classes
       
   275         friend class J2KMQCoder;
       
   276     protected:  // Friend classes
       
   277 
       
   278     private:    // Friend classes
       
   279 
       
   280     };
       
   281 
       
   282 /**
       
   283  * J2KMQCoder class is used to perform
       
   284  * the actual MQ entropy decoding.
       
   285  *
       
   286  * JP2KCodec.dll
       
   287  * @since 2.6
       
   288  */
       
   289 class J2KMQCoder : public CBase
       
   290     {
       
   291     public:  // Constructors and destructor
       
   292                 
       
   293         /**
       
   294         * Destructor.
       
   295         */
       
   296         virtual ~J2KMQCoder();
       
   297 
       
   298     public: // New functions
       
   299 
       
   300         /**
       
   301         * Read a byte from the input stream
       
   302         * @since 2.6
       
   303         */
       
   304         void MqByteIn();
       
   305 
       
   306         /**
       
   307         * Decode the symbol
       
   308         * @since 2.6
       
   309         * @param aContextIndex: the context index.
       
   310         * @return TUint8: a decision.
       
   311         */
       
   312         TUint8 MqDecodeSymbol( TInt32 aContextIndex );
       
   313 
       
   314         /**
       
   315         * Initialize the MQCoder
       
   316         * @since 2.6
       
   317         */
       
   318         void MqInitDecoder();
       
   319 
       
   320         /**
       
   321         * Check the prediction termination
       
   322         * @since 2.6
       
   323         * @return TEntropyErrorState: ENoError if success.
       
   324         */
       
   325         TEntropyErrorState MqCheckPrediction();
       
   326 
       
   327         /**
       
   328         * Reset the MQCoder context list to the original state
       
   329         * @since 2.6
       
   330         */
       
   331         void ResetMqContexts();
       
   332 
       
   333         /**
       
   334         * Initialze MQCoder and reset the context
       
   335         * @since 2.6
       
   336         * @param aSegmentLength: the segment length.
       
   337         */
       
   338         void ResetMQDecoder( TInt32 aSegmentLength );
       
   339 
       
   340         /**
       
   341         * Initialize MQCoder original states table
       
   342         * @since 2.6
       
   343         */
       
   344         void InitializeOrigMqTable();
       
   345 
       
   346     public: // Functions from base classes
       
   347        
       
   348     protected:  // New functions
       
   349         
       
   350     protected:  // Functions from base classes
       
   351         
       
   352     private:
       
   353 
       
   354         /**
       
   355         * Renormalize
       
   356         * @since 2.6
       
   357         */
       
   358         void ReNormalize();
       
   359 
       
   360         /**
       
   361         * MPS exchange
       
   362         * @since 2.6
       
   363         * @param aD: a reference to TInt32.
       
   364         */
       
   365         void MpsExchange( TInt32& aD );
       
   366         /**
       
   367         * LPS exchange
       
   368         * @since 2.6
       
   369         * @param aD: a reference to TInt32.
       
   370         */
       
   371         void LpsExchange( TInt32& aD );
       
   372 
       
   373     public:     // Data
       
   374     
       
   375     protected:  // Data
       
   376 
       
   377     private:    // Data
       
   378 
       
   379         // Original states table
       
   380         RPointerArray<J2KEntropyStates> iOriginalStates;
       
   381 
       
   382         // An array of contexts
       
   383         RPointerArray<J2KEntropyContexts> iContextList;   
       
   384 
       
   385         // Context corresponding to the current context index
       
   386         J2KEntropyContexts* iCurrentContext;              
       
   387 
       
   388         // State of the current context
       
   389         J2KEntropyStates* iCurrentState;                
       
   390 
       
   391         // Input stream
       
   392         J2KEntropyStream iInputStream;                 
       
   393 
       
   394         // The C register, i.e. the code register
       
   395         TUint32 iC;        
       
   396 
       
   397         // The A register, i.e. the interval register
       
   398         TUint32 iA;        
       
   399 
       
   400         // The counter
       
   401         TUint32 iCT;       
       
   402 
       
   403         // Buffer for the output byte 
       
   404         TUint8  iB;        
       
   405 
       
   406         // Current marker
       
   407         TUint8  iMarker;
       
   408 
       
   409     public:     // Friend classes
       
   410         friend class CJ2kEntropyDecoder;
       
   411 
       
   412     protected:  // Friend classes
       
   413 
       
   414     private:    // Friend classes
       
   415     };
       
   416 
       
   417 /**
       
   418  * CJ2kEntropyDecoder class is used to perform
       
   419  * the initializations and coding passes of 
       
   420  * the entropy decoding process.
       
   421  *
       
   422  * JP2KCodec.dll
       
   423  * @since 2.6
       
   424  */
       
   425 class CJ2kEntropyDecoder : public CBase  
       
   426     {
       
   427     public:  // Constructors and destructor
       
   428         
       
   429         /**
       
   430         * Two-phased constructor.
       
   431         */
       
   432         static CJ2kEntropyDecoder* NewL( CJ2kImageInfo& aImageInfo );
       
   433         
       
   434         /**
       
   435         * Destructor.
       
   436         */
       
   437         virtual ~CJ2kEntropyDecoder();
       
   438 
       
   439     public: // New functions
       
   440         
       
   441         /**
       
   442         * Set the size of internal buffer and other control data
       
   443         * @since 2.6
       
   444         * @param aSize: the size of the internal buffer.
       
   445         */
       
   446         void SetNewSizeL( const TSize& aSize );
       
   447 
       
   448         /**
       
   449         * Set the current pointer to point to the right LUT 
       
   450         * depending on the current subband
       
   451         * @since 2.6
       
   452         * @param aBandIndex: the subband index.
       
   453         */
       
   454         void SetCurrentZCLUT( TUint8 aBandIndex );
       
   455 
       
   456         /**
       
   457         * Decode the coded codeblock
       
   458         * @since 2.6
       
   459         * @param aCodeblock: a reference to CJ2kCodeBlock object.
       
   460         * @param aCblkStyle: the codeblock style.
       
   461         * @param aMagBits: the magniture bits.
       
   462         */
       
   463         void DecodeCodeblock( CJ2kCodeBlock& aCodeblock, TUint8 aCblkStyle, TUint8 aMagBits );
       
   464 
       
   465     public: // Functions from base classes
       
   466        
       
   467     protected:  // New functions
       
   468         
       
   469     protected:  // Functions from base classes
       
   470 
       
   471     private:
       
   472 
       
   473         /**
       
   474         * By default Symbian 2nd phase constructor is private.
       
   475         */
       
   476         void ConstructL( CJ2kImageInfo& aImageInfo );
       
   477 
       
   478         /**
       
   479         * Initialize ZC lookup table
       
   480         * @since 2.6
       
   481         */
       
   482         void InitializeZCLut();
       
   483 
       
   484         /**
       
   485         * Initialize SC/MR lookup table
       
   486         * @since 2.6
       
   487         */
       
   488         void InitializeScMrLut();
       
   489 
       
   490         /**
       
   491         * Get the casual
       
   492         * @since 2.6
       
   493         * @param aDataCol: a reference to the pointer of data column.
       
   494         * @param aStateCol: a reference to the pointer of state column.
       
   495         */
       
   496         void GetCausal( TPrecInt*& aDataCol, TInt16*& aStateCol );
       
   497 
       
   498         /**
       
   499         * Decode the significance bit
       
   500         * @since 2.6
       
   501         * @param aDataValue: a reference to the pointer of data value.
       
   502         * @param aStateValue: a reference to the pointer of state value.
       
   503         * @param aMask: the mask.
       
   504         */
       
   505         void DecodeSignificance( TPrecInt*& aDataValue, TInt16*& aStateValue, TPrecInt aMask );
       
   506 
       
   507         /**
       
   508         * Decode the lazy significance bit
       
   509         * @since 2.6
       
   510         * @param aDataValue: a reference to the pointer of data value.
       
   511         * @param aStateValue: a reference to the pointer of state value.
       
   512         * @param aMask: the mask.
       
   513         */
       
   514         void DecodeRawSignificance( TPrecInt*& aDataValue, TInt16*& aStateValue, TPrecInt aMask );
       
   515 
       
   516         /**
       
   517         * Decode the refinement bit
       
   518         * @since 2.6
       
   519         * @param aDataValue: a reference to the pointer of data value.
       
   520         * @param aStateValue: a reference to the pointer of state value.
       
   521         * @param aMask: the mask.
       
   522         * @param aResetMask: the reset mask.
       
   523         */
       
   524         void DecodeRefinement( TPrecInt*& aDataValue, TInt16*& aStateValue, TPrecInt aMask, TInt32 aResetMask );
       
   525 
       
   526         /**
       
   527         * Decode the lazy refinement bit
       
   528         * @since 2.6
       
   529         * @param aDataValue: a reference to the pointer of data value.
       
   530         * @param aStateValue: a reference to the pointer of state value.
       
   531         * @param aMask: the mask.
       
   532         * @param aResetMask: the reset mask.
       
   533         */
       
   534         void DecodeRawRefinement( TPrecInt*& aDataValue, TInt16*& aStateValue, TPrecInt aMask, TInt32 aResetMask );
       
   535 
       
   536         /**
       
   537         * Perform the normalization
       
   538         * @since 2.6
       
   539         * @param aDataValue: a reference to the pointer of data value.
       
   540         * @param aStateValue: a reference to the pointer of state value.
       
   541         * @param aMask: the mask.
       
   542         * @param aZCValue: a reference to ZC value.
       
   543         */
       
   544         void DecodeNormalization( TPrecInt*& aDataValue, TInt16*& aStateValue, TPrecInt aMask, TInt32& aZCValue );
       
   545 
       
   546         /**
       
   547         * Update the significance
       
   548         * @since 2.6
       
   549         * @param aStateValue: a reference to the pointer of state value.
       
   550         * @param aSymbol: the symbol.
       
   551         */
       
   552         void UpdateSignificance( TInt16*& aStateValue, TInt32 aSymbol );
       
   553 
       
   554         /**
       
   555         * Perform the significance pass
       
   556         * @since 2.6
       
   557         */
       
   558         void SignificancePass();
       
   559 
       
   560         /**
       
   561         * Perform the lazy significance pass
       
   562         * @since 2.6
       
   563         */
       
   564         void LazySignificancePass();
       
   565 
       
   566         /**
       
   567         * Perform the refinement pass
       
   568         * @since 2.6
       
   569         */
       
   570         void RefinementPass();
       
   571 
       
   572         /**
       
   573         * Perform the lszy refinement pass
       
   574         * @since 2.6
       
   575         */
       
   576         void LazyRefinementPass();
       
   577 
       
   578         /**
       
   579         * Perform the cleanup pass
       
   580         * @since 2.6
       
   581         * @param aSegSymbols: segmentation symbols at the end of coding pass.
       
   582         */
       
   583         void CleanupPass( TUint8 aSegSymbols );
       
   584 
       
   585         /**
       
   586         * Get the first state row
       
   587         * @since 2.6
       
   588         * @return TInt16*: a pointer to the first state row.
       
   589         */ 
       
   590         const TInt16* GetFirstStateRow() const;
       
   591 
       
   592     public:     // Data
       
   593 
       
   594     protected:  // Data
       
   595 
       
   596     private:    // Data
       
   597 
       
   598         // Coding flags
       
   599         enum TCodingFlags
       
   600             {
       
   601             EArithmeticBypass         = 1,
       
   602             EResetContext             = 1 << 1,
       
   603             ETermination              = 1 << 2,
       
   604             EVerticalStripe           = 1 << 3,
       
   605             EPredictableTermination   = 1 << 4,
       
   606             ESegmentationSymbols      = 1 << 5
       
   607             };
       
   608 
       
   609         // MQCoder
       
   610         J2KMQCoder iMQDecoder;           
       
   611 
       
   612         // States.
       
   613         TInt16* iStates; 
       
   614 
       
   615         // SC lut buffer
       
   616         HBufC8* iSCLutBuf;            
       
   617     
       
   618         // Pointer to SC lut buffer
       
   619         TUint8* iSCLut;   
       
   620         
       
   621         // MR lut buffer
       
   622         HBufC8* iMRLutBuf;            
       
   623 
       
   624         // Pointer to MR lut buffer
       
   625         TUint8* iMRLut;               
       
   626 
       
   627         // ZC lut for LL/LH band
       
   628         HBufC8* iZcLutLL;    
       
   629         
       
   630         // ZC lut for HL band
       
   631         HBufC8* iZcLutHL;        
       
   632         
       
   633         // ZC lut for HH band
       
   634         HBufC8* iZcLutHH;             
       
   635 
       
   636         // Pointer to one of the ZC lut 
       
   637         TUint8* iCurrentZcLutPtr;     
       
   638     
       
   639         // Image max block size
       
   640         TSize iCurrentSize;        
       
   641         
       
   642         // Number of stripes in the current codeblock
       
   643         TUint16 iNumStripes;     
       
   644         
       
   645         // Image max block width
       
   646         TUint16 iMaxBlockWidth;       
       
   647     
       
   648         // Width of data samples in the codeblock 
       
   649         TInt32 iBlockDataWidth;          
       
   650 
       
   651         // Width of state samples in the codeblock
       
   652         TInt32 iStateWidth;              
       
   653 
       
   654         // Size of the iStates array 
       
   655         TInt32 iStateSize;               
       
   656 
       
   657         // Number of data samples in one full stripe 
       
   658         TInt32 iDataSamplesPerStripe;    
       
   659 
       
   660         // Number of state samples in one full stripe
       
   661         TInt32 iStateSamplesPerStripe;   
       
   662 
       
   663         // Height of the last stripe in the codeblock
       
   664         TInt32 iLastStripeHeight;        
       
   665 
       
   666         // Width of the current codeblock
       
   667         TInt32 iBlockWidth;              
       
   668 
       
   669         // Max bit depth of the image
       
   670         TInt32 iMaxBitDepth;             
       
   671 
       
   672         // Error state of the Entropy decoder
       
   673         TEntropyErrorState iErrorState;    
       
   674 
       
   675         // Code block style has Reset Context Probabilities
       
   676         TUint8 iResetContexts;             
       
   677 
       
   678         // Code block style has Vertical Context Casual
       
   679         TUint8 iVerticalCausalContextUsed; 
       
   680 
       
   681         // Code block style has Predictable Termination
       
   682         TUint8 iPredictableTerminationUsed;
       
   683 
       
   684         // Current bitplane
       
   685         TUint8 iCurrentBitplane;           
       
   686 
       
   687         // Code block style has Termination on each coding pass
       
   688         TUint8 iTerminateThisPass;         
       
   689 
       
   690         // Internal two dimensional data array
       
   691         TPrecInt** iData;       
       
   692         
       
   693     public:     // Friend classes
       
   694         friend class CJ2kSynthesis;
       
   695 
       
   696     protected:  // Friend classes
       
   697          
       
   698     private:    // Friend classes         
       
   699     };
       
   700 
       
   701 #endif // __JP2KENTROPYDECODER_H__