Decoding: do not allocate memory for the codestream of each codeblock
[openjpeg.git] / src / lib / openjp2 / t1.h
index 9d4245ebc2c8edd6393adf6049873a057ab26504..da8b0c80256ccf15682e7742fefe7a14a6c44ffa 100644 (file)
@@ -36,8 +36,8 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
-#ifndef __T1_H
-#define __T1_H
+#ifndef OPJ_T1_H
+#define OPJ_T1_H
 /**
 @file t1.h
 @brief Implementation of the tier-1 coding (coding of code-block coefficients) (T1)
@@ -75,7 +75,7 @@ in T1.C are used by some function in TCD.C.
  *  a single 32-bit flags word to hold the state of 4 data points.  This corresponds
  *  to the 4-point-high columns that the data is processed in.
  *
- *  These #defines declare the layout of a 32-bit flags word.
+ *  These \#defines declare the layout of a 32-bit flags word.
  *
  *  This is currently done for encoding only.
  *  The values must NOT be changed, otherwise this is going to break a lot of
@@ -134,7 +134,7 @@ in T1.C are used by some function in TCD.C.
  *  word right by 3 bits and look at the same bit positions to see the
  *  values for data point 1.
  *
- *  The #defines below help a bit with this; say you have a flags word
+ *  The \#defines below help a bit with this; say you have a flags word
  *  f, you can do things like
  *
  *  (f & T1_SIGMA_THIS)
@@ -200,6 +200,12 @@ typedef struct opj_t1 {
     OPJ_UINT32 flagssize;
     OPJ_UINT32 data_stride;
     OPJ_BOOL   encoder;
+
+    /* Thre 3 variables below are only used by the decoder */
+    OPJ_BOOL     mustuse_segdatabuffer; /* set to TRUE in multithreaded context */
+    OPJ_BYTE
+    *segdatabuffer;     /* Temporary buffer to concatenate all chunks of a segment */
+    OPJ_UINT32   segdatabuffersize; /* Maximum size available in segdatabuffer */
 } opj_t1_t;
 
 /** @name Exported functions */
@@ -226,11 +232,17 @@ Decode the code-blocks of a tile
 @param pret Pointer to return value
 @param tilec The tile to decode
 @param tccp Tile coding parameters
+@param p_manager the event manager
+@param p_manager_mutex mutex for the event manager
+@param check_pterm whether PTERM correct termination should be checked
 */
 void opj_t1_decode_cblks(opj_thread_pool_t* tp,
                          volatile OPJ_BOOL* pret,
                          opj_tcd_tilecomp_t* tilec,
-                         opj_tccp_t* tccp);
+                         opj_tccp_t* tccp,
+                         opj_event_mgr_t *p_manager,
+                         opj_mutex_t* p_manager_mutex,
+                         OPJ_BOOL check_pterm);
 
 
 
@@ -252,4 +264,4 @@ void opj_t1_destroy(opj_t1_t *p_t1);
 
 /*@}*/
 
-#endif /* __T1_H */
+#endif /* OPJ_T1_H */