/* ----------------------------------------------------------------------- */
/* Neighbourhood of 3D EBCOT (Significance context)*/
-#define T1_3D_SIG_NE 0x00000001 /*< Context orientation : North-East direction */
-#define T1_3D_SIG_SE 0x00000002 /*< Context orientation : South-East direction */
-#define T1_3D_SIG_SW 0x00000004 /*< Context orientation : South-West direction */
-#define T1_3D_SIG_NW 0x00000008 /* Context orientation : North-West direction */
-#define T1_3D_SIG_N 0x00000010 /*< Context orientation : North direction */
-#define T1_3D_SIG_E 0x00000020 /*< Context orientation : East direction */
-#define T1_3D_SIG_S 0x00000040 /*< Context orientation : South direction */
-#define T1_3D_SIG_W 0x00000080 /*< Context orientation : West direction */
-#define T1_3D_SIG_FC 0x00000100 /*< Context orientation : Forward Central direction */
-#define T1_3D_SIG_BC 0x00000200 /*< Context orientation : Backward Central direction */
-#define T1_3D_SIG_FNE 0x00000400 /*< Context orientation : Forward North-East direction */
-#define T1_3D_SIG_FSE 0x00000800 /*< Context orientation : Forward South-East direction */
-#define T1_3D_SIG_FSW 0x00001000 /*< Context orientation : Forward South-West direction */
-#define T1_3D_SIG_FNW 0x00002000 /*< Context orientation : Forward North-West direction */
-#define T1_3D_SIG_FN 0x00004000 /*< Context orientation : Forward North direction */
-#define T1_3D_SIG_FE 0x00008000 /*< Context orientation : Forward East direction */
-#define T1_3D_SIG_FS 0x00010000 /*< Context orientation : Forward South direction */
-#define T1_3D_SIG_FW 0x00020000 /*< Context orientation : Forward West direction */
-#define T1_3D_SIG_BNE 0x00040000 /*< Context orientation : Backward North-East direction */
-#define T1_3D_SIG_BSE 0x00080000 /*< Context orientation : Backward South-East direction */
-#define T1_3D_SIG_BSW 0x00100000 /*< Context orientation : Backward South-West direction */
-#define T1_3D_SIG_BNW 0x00200000 /*< Context orientation : Backward North-West direction */
-#define T1_3D_SIG_BN 0x00400000 /*< Context orientation : Backward North direction */
-#define T1_3D_SIG_BE 0x00800000 /*< Context orientation : Backward East direction */
-#define T1_3D_SIG_BS 0x01000000 /*< Context orientation : Backward South direction */
-#define T1_3D_SIG_BW 0x02000000 /*< Context orientation : Backward West direction */
-#define T1_3D_SIG_COTH (T1_3D_SIG_N|T1_3D_SIG_NE|T1_3D_SIG_E|T1_3D_SIG_SE|T1_3D_SIG_S|T1_3D_SIG_SW|T1_3D_SIG_W|T1_3D_SIG_NW)
-#define T1_3D_SIG_BOTH (T1_3D_SIG_BN|T1_3D_SIG_BNE|T1_3D_SIG_BE|T1_3D_SIG_BSE|T1_3D_SIG_BS|T1_3D_SIG_BSW|T1_3D_SIG_BW|T1_3D_SIG_BNW|T1_3D_SIG_BC)
+#define T1_3D_SIG_NE 0x00000001 /*< Context orientation : North-East direction */
+#define T1_3D_SIG_SE 0x00000002 /*< Context orientation : South-East direction */
+#define T1_3D_SIG_SW 0x00000004 /*< Context orientation : South-West direction */
+#define T1_3D_SIG_NW 0x00000008 /* Context orientation : North-West direction */
+#define T1_3D_SIG_N 0x00000010 /*< Context orientation : North direction */
+#define T1_3D_SIG_E 0x00000020 /*< Context orientation : East direction */
+#define T1_3D_SIG_S 0x00000040 /*< Context orientation : South direction */
+#define T1_3D_SIG_W 0x00000080 /*< Context orientation : West direction */
+#define T1_3D_SIG_FC 0x00000100 /*< Context orientation : Forward Central direction */
+#define T1_3D_SIG_BC 0x00000200 /*< Context orientation : Backward Central direction */
+#define T1_3D_SIG_FNE 0x00000400 /*< Context orientation : Forward North-East direction */
+#define T1_3D_SIG_FSE 0x00000800 /*< Context orientation : Forward South-East direction */
+#define T1_3D_SIG_FSW 0x00001000 /*< Context orientation : Forward South-West direction */
+#define T1_3D_SIG_FNW 0x00002000 /*< Context orientation : Forward North-West direction */
+#define T1_3D_SIG_FN 0x00004000 /*< Context orientation : Forward North direction */
+#define T1_3D_SIG_FE 0x00008000 /*< Context orientation : Forward East direction */
+#define T1_3D_SIG_FS 0x00010000 /*< Context orientation : Forward South direction */
+#define T1_3D_SIG_FW 0x00020000 /*< Context orientation : Forward West direction */
+#define T1_3D_SIG_BNE 0x00040000 /*< Context orientation : Backward North-East direction */
+#define T1_3D_SIG_BSE 0x00080000 /*< Context orientation : Backward South-East direction */
+#define T1_3D_SIG_BSW 0x00100000 /*< Context orientation : Backward South-West direction */
+#define T1_3D_SIG_BNW 0x00200000 /*< Context orientation : Backward North-West direction */
+#define T1_3D_SIG_BN 0x00400000 /*< Context orientation : Backward North direction */
+#define T1_3D_SIG_BE 0x00800000 /*< Context orientation : Backward East direction */
+#define T1_3D_SIG_BS 0x01000000 /*< Context orientation : Backward South direction */
+#define T1_3D_SIG_BW 0x02000000 /*< Context orientation : Backward West direction */
+#define T1_3D_SIG_COTH (T1_3D_SIG_N|T1_3D_SIG_NE|T1_3D_SIG_E|T1_3D_SIG_SE|T1_3D_SIG_S|T1_3D_SIG_SW|T1_3D_SIG_W|T1_3D_SIG_NW)
+#define T1_3D_SIG_BOTH (T1_3D_SIG_BN|T1_3D_SIG_BNE|T1_3D_SIG_BE|T1_3D_SIG_BSE|T1_3D_SIG_BS|T1_3D_SIG_BSW|T1_3D_SIG_BW|T1_3D_SIG_BNW|T1_3D_SIG_BC)
#define T1_3D_SIG_FOTH (T1_3D_SIG_FN|T1_3D_SIG_FNE|T1_3D_SIG_FE|T1_3D_SIG_FSE|T1_3D_SIG_FS|T1_3D_SIG_FSW|T1_3D_SIG_FW|T1_3D_SIG_FNW|T1_3D_SIG_FC)
-#define T1_3D_SIG_OTH (T1_3D_SIG_FOTH|T1_3D_SIG_BOTH|T1_3D_SIG_COTH)
-#define T1_3D_SIG_PRIM (T1_3D_SIG_N|T1_3D_SIG_E|T1_3D_SIG_S|T1_3D_SIG_W|T1_3D_SIG_FC|T1_3D_SIG_BC)
+#define T1_3D_SIG_OTH (T1_3D_SIG_FOTH|T1_3D_SIG_BOTH|T1_3D_SIG_COTH)
+#define T1_3D_SIG_PRIM (T1_3D_SIG_N|T1_3D_SIG_E|T1_3D_SIG_S|T1_3D_SIG_W|T1_3D_SIG_FC|T1_3D_SIG_BC)
-#define T1_3D_SGN_N 0x0400
-#define T1_3D_SGN_E 0x0800
-#define T1_3D_SGN_S 0x1000
-#define T1_3D_SGN_W 0x2000
-#define T1_3D_SGN_F 0x4000
-#define T1_3D_SGN_B 0x8000
-#define T1_3D_SGN (T1_3D_SGN_N|T1_3D_SGN_E|T1_3D_SGN_S|T1_3D_SGN_W|T1_3D_SGN_F|T1_3D_SGN_B)
+#define T1_3D_SGN_N 0x0400
+#define T1_3D_SGN_E 0x0800
+#define T1_3D_SGN_S 0x1000
+#define T1_3D_SGN_W 0x2000
+#define T1_3D_SGN_F 0x4000
+#define T1_3D_SGN_B 0x8000
+#define T1_3D_SGN (T1_3D_SGN_N|T1_3D_SGN_E|T1_3D_SGN_S|T1_3D_SGN_W|T1_3D_SGN_F|T1_3D_SGN_B)
-#define T1_3D_SIG 0x0001 /*Significance state*/
-#define T1_3D_REFINE 0x0002 /*Delayed significance*/
-#define T1_3D_VISIT 0x0004 /*First-pass membership*/
+#define T1_3D_SIG 0x0001 /*Significance state*/
+#define T1_3D_REFINE 0x0002 /*Delayed significance*/
+#define T1_3D_VISIT 0x0004 /*First-pass membership*/
-#define T1_3D_NUMCTXS_AGG 1
-#define T1_3D_NUMCTXS_ZC 16
-#define T1_3D_NUMCTXS_MAG 3
-#define T1_3D_NUMCTXS_SC 6
-#define T1_3D_NUMCTXS_UNI 1
+#define T1_3D_NUMCTXS_AGG 1
+#define T1_3D_NUMCTXS_ZC 16
+#define T1_3D_NUMCTXS_MAG 3
+#define T1_3D_NUMCTXS_SC 6
+#define T1_3D_NUMCTXS_UNI 1
#define T1_3D_CTXNO_AGG 0
-#define T1_3D_CTXNO_ZC (T1_3D_CTXNO_AGG+T1_3D_NUMCTXS_AGG) /*1*/
-#define T1_3D_CTXNO_MAG (T1_3D_CTXNO_ZC+T1_3D_NUMCTXS_ZC) /*17*/
-#define T1_3D_CTXNO_SC (T1_3D_CTXNO_MAG+T1_3D_NUMCTXS_MAG) /*20*/
-#define T1_3D_CTXNO_UNI (T1_3D_CTXNO_SC+T1_3D_NUMCTXS_SC) /*26*/
-#define T1_3D_NUMCTXS (T1_3D_CTXNO_UNI+T1_3D_NUMCTXS_UNI) /*27*/
+#define T1_3D_CTXNO_ZC (T1_3D_CTXNO_AGG+T1_3D_NUMCTXS_AGG) /*1*/
+#define T1_3D_CTXNO_MAG (T1_3D_CTXNO_ZC+T1_3D_NUMCTXS_ZC) /*17*/
+#define T1_3D_CTXNO_SC (T1_3D_CTXNO_MAG+T1_3D_NUMCTXS_MAG) /*20*/
+#define T1_3D_CTXNO_UNI (T1_3D_CTXNO_SC+T1_3D_NUMCTXS_SC) /*26*/
+#define T1_3D_NUMCTXS (T1_3D_CTXNO_UNI+T1_3D_NUMCTXS_UNI) /*27*/
/* ----------------------------------------------------------------------- */
Tier-1 coding (coding of code-block coefficients)
*/
typedef struct opj_t1_3d {
- /** Codec context */
- opj_common_ptr cinfo;
- /** MQC component */
- opj_mqc_t *mqc;
- /** RAW component */
- opj_raw_t *raw;
- /** LUTs for decoding normalised MSE */
- int lut_nmsedec_sig[1 << T1_NMSEDEC_BITS];
- int lut_nmsedec_sig0[1 << T1_NMSEDEC_BITS];
- int lut_nmsedec_ref[1 << T1_NMSEDEC_BITS];
- int lut_nmsedec_ref0[1 << T1_NMSEDEC_BITS];
- /** Codeblock data */
- int data[T1_CBLKD][T1_CBLKH][T1_CBLKW];
- /** Context information for each voxel in codeblock */
- unsigned int flags[T1_CBLKD + 2][T1_CBLKH + 2][T1_CBLKH + 2];
- /** Voxel information (significance/visited/refined) */
- int flagSVR[T1_CBLKD + 2][T1_CBLKH + 2][T1_CBLKH + 2];
+ /** Codec context */
+ opj_common_ptr cinfo;
+ /** MQC component */
+ opj_mqc_t *mqc;
+ /** RAW component */
+ opj_raw_t *raw;
+ /** LUTs for decoding normalised MSE */
+ int lut_nmsedec_sig[1 << T1_NMSEDEC_BITS];
+ int lut_nmsedec_sig0[1 << T1_NMSEDEC_BITS];
+ int lut_nmsedec_ref[1 << T1_NMSEDEC_BITS];
+ int lut_nmsedec_ref0[1 << T1_NMSEDEC_BITS];
+ /** Codeblock data */
+ int data[T1_CBLKD][T1_CBLKH][T1_CBLKW];
+ /** Context information for each voxel in codeblock */
+ unsigned int flags[T1_CBLKD + 2][T1_CBLKH + 2][T1_CBLKH + 2];
+ /** Voxel information (significance/visited/refined) */
+ int flagSVR[T1_CBLKD + 2][T1_CBLKH + 2][T1_CBLKH + 2];
} opj_t1_3d_t;
/** @name Exported functions */
/*@{*/
/* ----------------------------------------------------------------------- */
/**
-Create a new T1_3D handle
+Create a new T1_3D handle
and initialize the look-up tables of the Tier-1 coder/decoder
@return Returns a new T1 handle if successful, returns NULL otherwise
@see t1_init_luts
/**
Get weigths of MSE decoding
@param nmsedec The normalized MSE reduction
-@param compno
-@param level
+@param compno
+@param level
@param orient
@param bpno
@param reversible