T1: Transpose coder optimizations to decoder, and cleanup code
This commit is contained in:
parent
1957a498b6
commit
68557ff503
|
@ -77,7 +77,8 @@ typedef struct opj_mqc {
|
|||
OPJ_BYTE *end;
|
||||
opj_mqc_state_t *ctxs[MQC_NUMCTXS];
|
||||
opj_mqc_state_t **curctx;
|
||||
const OPJ_BYTE *lut_ctxno_zc_orient; /* lut_ctxno_zc shifted by 256 * bandno */
|
||||
/* lut_ctxno_zc shifted by (1 << 9) * bandno */
|
||||
const OPJ_BYTE* lut_ctxno_zc_orient;
|
||||
} opj_mqc_t;
|
||||
|
||||
#include "mqc_inl.h"
|
||||
|
@ -199,7 +200,7 @@ Decode a symbol
|
|||
@param mqc MQC handle
|
||||
@return Returns the decoded symbol (0 or 1)
|
||||
*/
|
||||
static INLINE OPJ_INT32 opj_mqc_decode(opj_mqc_t * const mqc);
|
||||
static INLINE OPJ_UINT32 opj_mqc_decode(opj_mqc_t * const mqc);
|
||||
/* ----------------------------------------------------------------------- */
|
||||
/*@}*/
|
||||
|
||||
|
|
|
@ -43,14 +43,14 @@ FIXME DOC
|
|||
@param mqc MQC handle
|
||||
@return
|
||||
*/
|
||||
static INLINE OPJ_INT32 opj_mqc_mpsexchange(opj_mqc_t *const mqc)
|
||||
static INLINE OPJ_UINT32 opj_mqc_mpsexchange(opj_mqc_t *const mqc)
|
||||
{
|
||||
OPJ_INT32 d;
|
||||
OPJ_UINT32 d;
|
||||
if (mqc->a < (*mqc->curctx)->qeval) {
|
||||
d = (OPJ_INT32)(1 - (*mqc->curctx)->mps);
|
||||
d = !((*mqc->curctx)->mps);
|
||||
*mqc->curctx = (*mqc->curctx)->nlps;
|
||||
} else {
|
||||
d = (OPJ_INT32)(*mqc->curctx)->mps;
|
||||
d = (*mqc->curctx)->mps;
|
||||
*mqc->curctx = (*mqc->curctx)->nmps;
|
||||
}
|
||||
|
||||
|
@ -62,16 +62,16 @@ FIXME DOC
|
|||
@param mqc MQC handle
|
||||
@return
|
||||
*/
|
||||
static INLINE OPJ_INT32 opj_mqc_lpsexchange(opj_mqc_t *const mqc)
|
||||
static INLINE OPJ_UINT32 opj_mqc_lpsexchange(opj_mqc_t *const mqc)
|
||||
{
|
||||
OPJ_INT32 d;
|
||||
OPJ_UINT32 d;
|
||||
if (mqc->a < (*mqc->curctx)->qeval) {
|
||||
mqc->a = (*mqc->curctx)->qeval;
|
||||
d = (OPJ_INT32)(*mqc->curctx)->mps;
|
||||
d = (*mqc->curctx)->mps;
|
||||
*mqc->curctx = (*mqc->curctx)->nmps;
|
||||
} else {
|
||||
mqc->a = (*mqc->curctx)->qeval;
|
||||
d = (OPJ_INT32)(1 - (*mqc->curctx)->mps);
|
||||
d = !((*mqc->curctx)->mps);
|
||||
*mqc->curctx = (*mqc->curctx)->nlps;
|
||||
}
|
||||
|
||||
|
@ -136,13 +136,13 @@ Decode a symbol
|
|||
@param mqc MQC handle
|
||||
@return Returns the decoded symbol (0 or 1)
|
||||
*/
|
||||
static INLINE OPJ_INT32 opj_mqc_decode(opj_mqc_t *const mqc)
|
||||
static INLINE OPJ_UINT32 opj_mqc_decode(opj_mqc_t *const mqc)
|
||||
{
|
||||
/* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */
|
||||
/* Note: alternate "J.2 - Decoding an MPS or an LPS in the */
|
||||
/* software-conventions decoder" has been tried, but does not bring any */
|
||||
/* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */
|
||||
OPJ_INT32 d;
|
||||
OPJ_UINT32 d;
|
||||
mqc->a -= (*mqc->curctx)->qeval;
|
||||
if ((mqc->c >> 16) < (*mqc->curctx)->qeval) {
|
||||
d = opj_mqc_lpsexchange(mqc);
|
||||
|
@ -153,7 +153,7 @@ static INLINE OPJ_INT32 opj_mqc_decode(opj_mqc_t *const mqc)
|
|||
d = opj_mqc_mpsexchange(mqc);
|
||||
opj_mqc_renormd(mqc);
|
||||
} else {
|
||||
d = (OPJ_INT32)(*mqc->curctx)->mps;
|
||||
d = (*mqc->curctx)->mps;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -52,33 +52,6 @@ in T1.C are used by some function in TCD.C.
|
|||
/* ----------------------------------------------------------------------- */
|
||||
#define T1_NMSEDEC_BITS 7
|
||||
|
||||
/* CAUTION: the value of those constants must not be changed, otherwise the */
|
||||
/* optimization of opj_t1_updateflags() will break! */
|
||||
/* BEGINNING of flags that apply to opj_flag_t */
|
||||
#define T1_SIG_NE 0x0001U /**< Context orientation : North-East direction */
|
||||
#define T1_SIG_SE 0x0002U /**< Context orientation : South-East direction */
|
||||
#define T1_SIG_SW 0x0004U /**< Context orientation : South-West direction */
|
||||
#define T1_SIG_NW 0x0008U /**< Context orientation : North-West direction */
|
||||
#define T1_SIG_N 0x0010U /**< Context orientation : North direction */
|
||||
#define T1_SIG_E 0x0020U /**< Context orientation : East direction */
|
||||
#define T1_SIG_S 0x0040U /**< Context orientation : South direction */
|
||||
#define T1_SIG_W 0x0080U /**< Context orientation : West direction */
|
||||
#define T1_SIG_OTH (T1_SIG_N|T1_SIG_NE|T1_SIG_E|T1_SIG_SE|T1_SIG_S|T1_SIG_SW|T1_SIG_W|T1_SIG_NW)
|
||||
#define T1_SIG_PRIM (T1_SIG_N|T1_SIG_E|T1_SIG_S|T1_SIG_W)
|
||||
|
||||
#define T1_SGN_N 0x0100U
|
||||
#define T1_SGN_E 0x0200U
|
||||
#define T1_SGN_S 0x0400U
|
||||
#define T1_SGN_W 0x0800U
|
||||
#define T1_SGN (T1_SGN_N|T1_SGN_E|T1_SGN_S|T1_SGN_W)
|
||||
|
||||
#ifdef CONSISTENCY_CHECK
|
||||
#define T1_SIG 0x1000U /**< No longer used by decoder */
|
||||
#define T1_VISIT 0x4000U /**< No longer used by decoder */
|
||||
#endif
|
||||
|
||||
/* END of flags that apply to opj_flag_t */
|
||||
|
||||
#define T1_NUMCTXS_ZC 9
|
||||
#define T1_NUMCTXS_SC 5
|
||||
#define T1_NUMCTXS_MAG 3
|
||||
|
@ -97,27 +70,7 @@ in T1.C are used by some function in TCD.C.
|
|||
#define T1_TYPE_MQ 0 /**< Normal coding using entropy coder */
|
||||
#define T1_TYPE_RAW 1 /**< No encoding the information is store under raw format in codestream (mode switch RAW)*/
|
||||
|
||||
/* Those flags are used by opj_colflag_t */
|
||||
#define T1_COLFLAG_RBS 4U /* RBS = Row Bit Shift */
|
||||
#define T1_COLFLAG_SIG_OTHER_ROW_0 (1U << 0U) /**< This sample has at least one significant neighbour */
|
||||
#define T1_COLFLAG_SIG_ROW_0 (1U << 1U) /**< This sample is significant */
|
||||
#define T1_COLFLAG_VISIT_ROW_0 (1U << 2U) /**< This sample has been visited */
|
||||
#define T1_COLFLAG_REFINE_ROW_0 (1U << 3U) /**< This sample has been refined */
|
||||
#define T1_COLFLAG_SIG_OTHER_ROW_1 (T1_COLFLAG_SIG_OTHER_ROW_0 << (1U * T1_COLFLAG_RBS))
|
||||
#define T1_COLFLAG_SIG_ROW_1 (T1_COLFLAG_SIG_ROW_0 << (1U * T1_COLFLAG_RBS))
|
||||
#define T1_COLFLAG_VISIT_ROW_1 (T1_COLFLAG_VISIT_ROW_0 << (1U * T1_COLFLAG_RBS))
|
||||
#define T1_COLFLAG_REFINE_ROW_1 (T1_COLFLAG_REFINE_ROW_0 << (1U * T1_COLFLAG_RBS))
|
||||
#define T1_COLFLAG_SIG_OTHER_ROW_2 (T1_COLFLAG_SIG_OTHER_ROW_0 << (2U * T1_COLFLAG_RBS))
|
||||
#define T1_COLFLAG_SIG_ROW_2 (T1_COLFLAG_SIG_ROW_0 << (2U * T1_COLFLAG_RBS))
|
||||
#define T1_COLFLAG_VISIT_ROW_2 (T1_COLFLAG_VISIT_ROW_0 << (2U * T1_COLFLAG_RBS))
|
||||
#define T1_COLFLAG_REFINE_ROW_2 (T1_COLFLAG_REFINE_ROW_0 << (2U * T1_COLFLAG_RBS))
|
||||
#define T1_COLFLAG_SIG_OTHER_ROW_3 (T1_COLFLAG_SIG_OTHER_ROW_0 << (3U * T1_COLFLAG_RBS))
|
||||
#define T1_COLFLAG_SIG_ROW_3 (T1_COLFLAG_SIG_ROW_0 << (3U * T1_COLFLAG_RBS))
|
||||
#define T1_COLFLAG_VISIT_ROW_3 (T1_COLFLAG_VISIT_ROW_0 << (3U * T1_COLFLAG_RBS))
|
||||
#define T1_COLFLAG_REFINE_ROW_3 (T1_COLFLAG_REFINE_ROW_0 << (3U * T1_COLFLAG_RBS))
|
||||
|
||||
|
||||
/* BEGINNING of flags that apply to opj_flag_enc_t */
|
||||
/* BEGINNING of flags that apply to opj_flag_t */
|
||||
/** We hold the state of individual data points for the T1 encoder using
|
||||
* 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.
|
||||
|
@ -217,16 +170,12 @@ in T1.C are used by some function in TCD.C.
|
|||
#define T1_LUT_SIG_E (1U << 5)
|
||||
#define T1_LUT_SGN_S (1U << 6)
|
||||
#define T1_LUT_SIG_S (1U << 7)
|
||||
/* END of flags that apply to opj_flag_enc_t */
|
||||
/* END of flags that apply to opj_flag_t */
|
||||
|
||||
/* ----------------------------------------------------------------------- */
|
||||
|
||||
typedef OPJ_UINT16 opj_flag_t;
|
||||
|
||||
/** Flags for 4 consecutive rows of a column */
|
||||
typedef OPJ_UINT16 opj_colflag_t;
|
||||
|
||||
typedef OPJ_UINT32 opj_flag_enc_t;
|
||||
typedef OPJ_UINT32 opj_flag_t;
|
||||
|
||||
/**
|
||||
Tier-1 coding (coding of code-block coefficients)
|
||||
|
@ -239,27 +188,22 @@ typedef struct opj_t1 {
|
|||
opj_raw_t *raw;
|
||||
|
||||
OPJ_INT32 *data;
|
||||
/** Flags used by decoder */
|
||||
opj_flag_t *flags;
|
||||
/** Addition flag array such that colflags[1+0] is for state of col=0,row=0..3,
|
||||
colflags[1+1] for col=1, row=0..3, colflags[1+flags_stride] for col=0,row=4..7, ...
|
||||
/** Flags used by decoder and encoder.
|
||||
* Such that flags[1+0] is for state of col=0,row=0..3,
|
||||
flags[1+1] for col=1, row=0..3, flags[1+flags_stride] for col=0,row=4..7, ...
|
||||
This array avoids too much cache trashing when processing by 4 vertical samples
|
||||
as done in the various decoding steps. */
|
||||
opj_colflag_t* colflags;
|
||||
/** Flags used by encoder */
|
||||
opj_flag_enc_t *enc_flags;
|
||||
opj_flag_t *flags;
|
||||
|
||||
OPJ_UINT32 w;
|
||||
OPJ_UINT32 h;
|
||||
OPJ_UINT32 datasize;
|
||||
OPJ_UINT32 flagssize;
|
||||
OPJ_UINT32 flags_stride;
|
||||
OPJ_UINT32 colflags_size;
|
||||
OPJ_UINT32 data_stride;
|
||||
OPJ_BOOL encoder;
|
||||
} opj_t1_t;
|
||||
|
||||
#define MACRO_t1_flags(x,y) t1->flags[((x)*(t1->flags_stride))+(y)]
|
||||
|
||||
/** @name Exported functions */
|
||||
/*@{*/
|
||||
/* ----------------------------------------------------------------------- */
|
||||
|
|
|
@ -39,87 +39,7 @@
|
|||
|
||||
#include "opj_includes.h"
|
||||
|
||||
static int t1_init_ctxno_zc(unsigned int f, unsigned int orient)
|
||||
{
|
||||
int h, v, d, n, t, hv;
|
||||
h = ((f & T1_SIG_W) != 0) + ((f & T1_SIG_E) != 0);
|
||||
v = ((f & T1_SIG_N) != 0) + ((f & T1_SIG_S) != 0);
|
||||
d = ((f & T1_SIG_NW) != 0) + ((f & T1_SIG_NE) != 0) + ((
|
||||
f & T1_SIG_SE) != 0) + ((f & T1_SIG_SW) != 0);
|
||||
n = 0;
|
||||
t = 0;
|
||||
hv = 0;
|
||||
|
||||
switch (orient) {
|
||||
case 2:
|
||||
t = h;
|
||||
h = v;
|
||||
v = t;
|
||||
/* fall through */
|
||||
case 0:
|
||||
case 1:
|
||||
if (!h) {
|
||||
if (!v) {
|
||||
if (!d) {
|
||||
n = 0;
|
||||
} else if (d == 1) {
|
||||
n = 1;
|
||||
} else {
|
||||
n = 2;
|
||||
}
|
||||
} else if (v == 1) {
|
||||
n = 3;
|
||||
} else {
|
||||
n = 4;
|
||||
}
|
||||
} else if (h == 1) {
|
||||
if (!v) {
|
||||
if (!d) {
|
||||
n = 5;
|
||||
} else {
|
||||
n = 6;
|
||||
}
|
||||
} else {
|
||||
n = 7;
|
||||
}
|
||||
} else {
|
||||
n = 8;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
hv = h + v;
|
||||
if (!d) {
|
||||
if (!hv) {
|
||||
n = 0;
|
||||
} else if (hv == 1) {
|
||||
n = 1;
|
||||
} else {
|
||||
n = 2;
|
||||
}
|
||||
} else if (d == 1) {
|
||||
if (!hv) {
|
||||
n = 3;
|
||||
} else if (hv == 1) {
|
||||
n = 4;
|
||||
} else {
|
||||
n = 5;
|
||||
}
|
||||
} else if (d == 2) {
|
||||
if (!hv) {
|
||||
n = 6;
|
||||
} else {
|
||||
n = 7;
|
||||
}
|
||||
} else {
|
||||
n = 8;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return (T1_CTXNO_ZC + n);
|
||||
}
|
||||
|
||||
static int t1_init_enc_ctxno_zc(int f, int orient)
|
||||
static int t1_init_ctxno_zc(int f, int orient)
|
||||
{
|
||||
int h, v, d, n, t, hv;
|
||||
n = 0;
|
||||
|
@ -196,51 +116,7 @@ static int t1_init_enc_ctxno_zc(int f, int orient)
|
|||
return (T1_CTXNO_ZC + n);
|
||||
}
|
||||
|
||||
static int t1_init_ctxno_sc(unsigned int f)
|
||||
{
|
||||
int hc, vc, n;
|
||||
n = 0;
|
||||
|
||||
hc = opj_int_min(((f & (T1_SIG_E | T1_SGN_E)) ==
|
||||
T1_SIG_E) + ((f & (T1_SIG_W | T1_SGN_W)) == T1_SIG_W),
|
||||
1) - opj_int_min(((f & (T1_SIG_E | T1_SGN_E)) ==
|
||||
(T1_SIG_E | T1_SGN_E)) +
|
||||
((f & (T1_SIG_W | T1_SGN_W)) ==
|
||||
(T1_SIG_W | T1_SGN_W)), 1);
|
||||
|
||||
vc = opj_int_min(((f & (T1_SIG_N | T1_SGN_N)) ==
|
||||
T1_SIG_N) + ((f & (T1_SIG_S | T1_SGN_S)) == T1_SIG_S),
|
||||
1) - opj_int_min(((f & (T1_SIG_N | T1_SGN_N)) ==
|
||||
(T1_SIG_N | T1_SGN_N)) +
|
||||
((f & (T1_SIG_S | T1_SGN_S)) ==
|
||||
(T1_SIG_S | T1_SGN_S)), 1);
|
||||
|
||||
if (hc < 0) {
|
||||
hc = -hc;
|
||||
vc = -vc;
|
||||
}
|
||||
if (!hc) {
|
||||
if (vc == -1) {
|
||||
n = 1;
|
||||
} else if (!vc) {
|
||||
n = 0;
|
||||
} else {
|
||||
n = 1;
|
||||
}
|
||||
} else if (hc == 1) {
|
||||
if (vc == -1) {
|
||||
n = 2;
|
||||
} else if (!vc) {
|
||||
n = 3;
|
||||
} else {
|
||||
n = 4;
|
||||
}
|
||||
}
|
||||
|
||||
return (T1_CTXNO_SC + n);
|
||||
}
|
||||
|
||||
static int t1_init_enc_ctxno_sc(int f)
|
||||
static int t1_init_ctxno_sc(int f)
|
||||
{
|
||||
int hc, vc, n;
|
||||
n = 0;
|
||||
|
@ -284,34 +160,7 @@ static int t1_init_enc_ctxno_sc(int f)
|
|||
return (T1_CTXNO_SC + n);
|
||||
}
|
||||
|
||||
static int t1_init_spb(unsigned int f)
|
||||
{
|
||||
int hc, vc, n;
|
||||
|
||||
hc = opj_int_min(((f & (T1_SIG_E | T1_SGN_E)) ==
|
||||
T1_SIG_E) + ((f & (T1_SIG_W | T1_SGN_W)) == T1_SIG_W),
|
||||
1) - opj_int_min(((f & (T1_SIG_E | T1_SGN_E)) ==
|
||||
(T1_SIG_E | T1_SGN_E)) +
|
||||
((f & (T1_SIG_W | T1_SGN_W)) ==
|
||||
(T1_SIG_W | T1_SGN_W)), 1);
|
||||
|
||||
vc = opj_int_min(((f & (T1_SIG_N | T1_SGN_N)) ==
|
||||
T1_SIG_N) + ((f & (T1_SIG_S | T1_SGN_S)) == T1_SIG_S),
|
||||
1) - opj_int_min(((f & (T1_SIG_N | T1_SGN_N)) ==
|
||||
(T1_SIG_N | T1_SGN_N)) +
|
||||
((f & (T1_SIG_S | T1_SGN_S)) ==
|
||||
(T1_SIG_S | T1_SGN_S)), 1);
|
||||
|
||||
if (!hc && !vc) {
|
||||
n = 0;
|
||||
} else {
|
||||
n = (!(hc > 0 || (!hc && vc > 0)));
|
||||
}
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
static int t1_init_enc_spb(int f)
|
||||
static int t1_init_spb(int f)
|
||||
{
|
||||
int hc, vc, n;
|
||||
|
||||
|
@ -358,8 +207,7 @@ int main(int argc, char **argv)
|
|||
unsigned int i, j;
|
||||
double u, v, t;
|
||||
|
||||
int lut_ctxno_zc[1024];
|
||||
int lut_enc_ctxno_zc[2048];
|
||||
int lut_ctxno_zc[2048];
|
||||
int lut_nmsedec_sig[1 << T1_NMSEDEC_BITS];
|
||||
int lut_nmsedec_sig0[1 << T1_NMSEDEC_BITS];
|
||||
int lut_nmsedec_ref[1 << T1_NMSEDEC_BITS];
|
||||
|
@ -370,30 +218,6 @@ int main(int argc, char **argv)
|
|||
printf("/* This file was automatically generated by t1_generate_luts.c */\n\n");
|
||||
|
||||
/* lut_ctxno_zc */
|
||||
for (j = 0U; j < 4U; ++j) {
|
||||
for (i = 0U; i < 256U; ++i) {
|
||||
unsigned int orient = j;
|
||||
if (orient == 2U) {
|
||||
orient = 1U;
|
||||
} else if (orient == 1U) {
|
||||
orient = 2U;
|
||||
}
|
||||
lut_ctxno_zc[(orient << 8) | i] = t1_init_ctxno_zc(i, j);
|
||||
}
|
||||
}
|
||||
|
||||
printf("static const OPJ_BYTE lut_ctxno_zc[1024] = {\n ");
|
||||
for (i = 0U; i < 1023U; ++i) {
|
||||
printf("%i,", lut_ctxno_zc[i]);
|
||||
if (!((i + 1U) & 0x1fU)) {
|
||||
printf("\n ");
|
||||
} else {
|
||||
printf(" ");
|
||||
}
|
||||
}
|
||||
printf("%i\n};\n\n", lut_ctxno_zc[1023]);
|
||||
|
||||
/* lut_enc_ctxno_zc */
|
||||
for (j = 0; j < 4; ++j) {
|
||||
for (i = 0; i < 512; ++i) {
|
||||
int orient = j;
|
||||
|
@ -402,68 +226,44 @@ int main(int argc, char **argv)
|
|||
} else if (orient == 1) {
|
||||
orient = 2;
|
||||
}
|
||||
lut_enc_ctxno_zc[(orient << 9) | i] = t1_init_enc_ctxno_zc(i, j);
|
||||
lut_ctxno_zc[(orient << 9) | i] = t1_init_ctxno_zc(i, j);
|
||||
}
|
||||
}
|
||||
|
||||
printf("static const OPJ_BYTE lut_enc_ctxno_zc[2048] = {\n ");
|
||||
printf("static const OPJ_BYTE lut_ctxno_zc[2048] = {\n ");
|
||||
for (i = 0; i < 2047; ++i) {
|
||||
printf("%i,", lut_enc_ctxno_zc[i]);
|
||||
printf("%i,", lut_ctxno_zc[i]);
|
||||
if (!((i + 1) & 0x1f)) {
|
||||
printf("\n ");
|
||||
} else {
|
||||
printf(" ");
|
||||
}
|
||||
}
|
||||
printf("%i\n};\n\n", lut_enc_ctxno_zc[2047]);
|
||||
printf("%i\n};\n\n", lut_ctxno_zc[2047]);
|
||||
|
||||
/* lut_ctxno_sc */
|
||||
printf("static const OPJ_BYTE lut_ctxno_sc[256] = {\n ");
|
||||
for (i = 0U; i < 255U; ++i) {
|
||||
printf("0x%x,", t1_init_ctxno_sc(i << 4));
|
||||
if (!((i + 1U) & 0xfU)) {
|
||||
printf("\n ");
|
||||
} else {
|
||||
printf(" ");
|
||||
}
|
||||
}
|
||||
printf("0x%x\n};\n\n", t1_init_ctxno_sc(255U << 4));
|
||||
|
||||
/* lut_enc_ctxno_sc */
|
||||
printf("static const OPJ_BYTE lut_enc_ctxno_sc[256] = {\n ");
|
||||
for (i = 0; i < 255; ++i) {
|
||||
printf("0x%x,", t1_init_enc_ctxno_sc(i));
|
||||
printf("0x%x,", t1_init_ctxno_sc(i));
|
||||
if (!((i + 1) & 0xf)) {
|
||||
printf("\n ");
|
||||
} else {
|
||||
printf(" ");
|
||||
}
|
||||
}
|
||||
printf("0x%x\n};\n\n", t1_init_enc_ctxno_sc(255));
|
||||
printf("0x%x\n};\n\n", t1_init_ctxno_sc(255));
|
||||
|
||||
/* lut_spb */
|
||||
printf("static const OPJ_BYTE lut_spb[256] = {\n ");
|
||||
for (i = 0U; i < 255U; ++i) {
|
||||
printf("%i,", t1_init_spb(i << 4));
|
||||
if (!((i + 1U) & 0x1fU)) {
|
||||
printf("\n ");
|
||||
} else {
|
||||
printf(" ");
|
||||
}
|
||||
}
|
||||
printf("%i\n};\n\n", t1_init_spb(255U << 4));
|
||||
|
||||
/* lut_enc_spb */
|
||||
printf("static const OPJ_BYTE lut_enc_spb[256] = {\n ");
|
||||
for (i = 0; i < 255; ++i) {
|
||||
printf("%i,", t1_init_enc_spb(i));
|
||||
printf("%i,", t1_init_spb(i));
|
||||
if (!((i + 1) & 0x1f)) {
|
||||
printf("\n ");
|
||||
} else {
|
||||
printf(" ");
|
||||
}
|
||||
}
|
||||
printf("%i\n};\n\n", t1_init_enc_spb(255));
|
||||
printf("%i\n};\n\n", t1_init_spb(255));
|
||||
|
||||
/* FIXME FIXME FIXME */
|
||||
/* fprintf(stdout,"nmsedec luts:\n"); */
|
||||
|
|
|
@ -1,41 +1,6 @@
|
|||
/* This file was automatically generated by t1_generate_luts.c */
|
||||
|
||||
static const OPJ_BYTE lut_ctxno_zc[1024] = {
|
||||
0, 1, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
||||
5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
|
||||
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
|
||||
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 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