* [Callum Lerwick] Memory leaks fixed
* [Callum Lerwick] Reworks of t1_updateflags to get rid of the shift operation
* [Callum Lerwick] mqc_setcurctx moved to the header to allow it to be inlined into the t1.
+* [Callum Lerwick] Consolidated some calls to mqc_setcurctx.
+* [Callum Lerwick] Cleaned up t1_generate_luts to output the proper types.
August 20, 2007
+ [FOD] Added support for the TGA file format in the codec
ProjectType="Visual C++"\r
Version="8,00"\r
Name="LibOpenJPEG"\r
- ProjectGUID="{4F27AA53-4181-4A1A-8238-3931B0A41048}"\r
+ ProjectGUID="{BDB8C37B-824E-4617-827C-B13E2F015EFE}"\r
>\r
<Platforms>\r
<Platform\r
flag = vsc ? ((*flagsp) & (~(T1_SIG_S | T1_SIG_SE | T1_SIG_SW | T1_SGN_S))) : (*flagsp);
if ((flag & T1_SIG_OTH) && !(flag & (T1_SIG | T1_VISIT))) {
v = int_abs(*datap) & one ? 1 : 0;
+ mqc_setcurctx(mqc, t1_getctxno_zc(flag, orient)); /* ESSAI */
if (type == T1_TYPE_RAW) { /* BYPASS/LAZY MODE */
- mqc_setcurctx(mqc, t1_getctxno_zc(flag, orient)); /* ESSAI */
mqc_bypass_enc(mqc, v);
} else {
- mqc_setcurctx(mqc, t1_getctxno_zc(flag, orient));
mqc_encode(mqc, v);
}
if (v) {
v = *datap < 0 ? 1 : 0;
*nmsedec += t1_getnmsedec_sig(int_abs(*datap), bpno + T1_NMSEDEC_FRACBITS);
+ mqc_setcurctx(mqc, t1_getctxno_sc(flag)); /* ESSAI */
if (type == T1_TYPE_RAW) { /* BYPASS/LAZY MODE */
- mqc_setcurctx(mqc, t1_getctxno_sc(flag)); /* ESSAI */
mqc_bypass_enc(mqc, v);
} else {
- mqc_setcurctx(mqc, t1_getctxno_sc(flag));
mqc_encode(mqc, v ^ t1_getspb(flag));
}
t1_updateflags(flagsp, v, t1->flags_stride);
if ((flag & (T1_SIG | T1_VISIT)) == T1_SIG) {
*nmsedec += t1_getnmsedec_ref(int_abs(*datap), bpno + T1_NMSEDEC_FRACBITS);
v = int_abs(*datap) & one ? 1 : 0;
+ mqc_setcurctx(mqc, t1_getctxno_mag(flag)); /* ESSAI */
if (type == T1_TYPE_RAW) { /* BYPASS/LAZY MODE */
- mqc_setcurctx(mqc, t1_getctxno_mag(flag)); /* ESSAI */
mqc_bypass_enc(mqc, v);
} else {
- mqc_setcurctx(mqc, t1_getctxno_mag(flag));
mqc_encode(mqc, v);
}
*flagsp |= T1_REFINE;
flag = vsc ? ((*flagsp) & (~(T1_SIG_S | T1_SIG_SE | T1_SIG_SW | T1_SGN_S))) : (*flagsp);
if ((flag & (T1_SIG | T1_VISIT)) == T1_SIG) {
+ mqc_setcurctx(mqc, t1_getctxno_mag(flag)); /* ESSAI */
if (type == T1_TYPE_RAW) {
- mqc_setcurctx(mqc, t1_getctxno_mag(flag)); /* ESSAI */
v = raw_decode(raw);
} else {
- mqc_setcurctx(mqc, t1_getctxno_mag(flag));
v = mqc_decode(mqc);
}
t = v ? poshalf : neghalf;
}
}
- printf("static int8_t lut_ctxno_zc[1024] = {\n ");
+ printf("static char lut_ctxno_zc[1024] = {\n ");
for (i = 0; i < 1023; ++i) {
printf("%i, ", lut_ctxno_zc[i]);
if(!((i+1)&0x1f))
printf("%i\n};\n\n", lut_ctxno_zc[1023]);
// lut_ctxno_sc
- printf("static int8_t lut_ctxno_sc[256] = {\n ");
+ printf("static char lut_ctxno_sc[256] = {\n ");
for (i = 0; i < 255; ++i) {
printf("0x%x, ", t1_init_ctxno_sc(i << 4));
if(!((i+1)&0xf))
}
}
- printf("static int8_t lut_ctxno_mag[4096] = {\n ");
+ printf("static char lut_ctxno_mag[4096] = {\n ");
for (i = 0; i < 4095; ++i) {
printf("%i, ", lut_ctxno_mag[i]);
if(!((i+1)&0xf))
printf("%i\n};\n\n", lut_ctxno_mag[4095]);
// lut_spb
- printf("static int8_t lut_spb[256] = {\n ");
+ printf("static char lut_spb[256] = {\n ");
for (i = 0; i < 255; ++i) {
printf("%i, ", t1_init_spb(i << 4));
if(!((i+1)&0x1f))
(int) (floor((u * u) * pow(2, T1_NMSEDEC_FRACBITS) + 0.5) / pow(2, T1_NMSEDEC_FRACBITS) * 8192.0));
}
- printf("static int16_t lut_nmsedec_sig[1 << T1_NMSEDEC_BITS] = {\n ");
+ printf("static short lut_nmsedec_sig[1 << T1_NMSEDEC_BITS] = {\n ");
dump_array16(&lut_nmsedec_sig, 1 << T1_NMSEDEC_BITS);
- printf("static int16_t lut_nmsedec_sig0[1 << T1_NMSEDEC_BITS] = {\n ");
+ printf("static short lut_nmsedec_sig0[1 << T1_NMSEDEC_BITS] = {\n ");
dump_array16(&lut_nmsedec_sig0, 1 << T1_NMSEDEC_BITS);
- printf("static int16_t lut_nmsedec_ref[1 << T1_NMSEDEC_BITS] = {\n ");
+ printf("static short lut_nmsedec_ref[1 << T1_NMSEDEC_BITS] = {\n ");
dump_array16(&lut_nmsedec_ref, 1 << T1_NMSEDEC_BITS);
- printf("static int16_t lut_nmsedec_ref0[1 << T1_NMSEDEC_BITS] = {\n ");
+ printf("static short lut_nmsedec_ref0[1 << T1_NMSEDEC_BITS] = {\n ");
dump_array16(&lut_nmsedec_ref0, 1 << T1_NMSEDEC_BITS);
return 0;