123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- diff -urN -x '*.orig' -x '*.rej' -x '*~' -x '.*' OpenJPEG.orig/libopenjpeg/t1.c OpenJPEG.patched/libopenjpeg/t1.c
- --- OpenJPEG.orig/libopenjpeg/t1.c 2007-08-23 05:48:09.000000000 -0500
- +++ OpenJPEG.patched/libopenjpeg/t1.c 2007-08-23 05:50:29.000000000 -0500
- @@ -312,7 +312,7 @@
- } else {
- mqc_encode(mqc, v ^ t1_getspb(flag));
- }
- - t1_updateflags(flagsp, v, t1->flags_stride);
- + t1_updateflags(flagsp, v, (t1->h+2));
- }
- *flagsp |= T1_VISIT;
- }
- @@ -339,7 +339,7 @@
- if (raw_decode(raw)) {
- v = raw_decode(raw); /* ESSAI */
- *datap = v ? -oneplushalf : oneplushalf;
- - t1_updateflags(flagsp, v, t1->flags_stride);
- + t1_updateflags(flagsp, v, (t1->h+2));
- }
- } else {
- mqc_setcurctx(mqc, t1_getctxno_zc(flag, orient));
- @@ -347,7 +347,7 @@
- mqc_setcurctx(mqc, t1_getctxno_sc(flag));
- v = mqc_decode(mqc) ^ t1_getspb(flag);
- *datap = v ? -oneplushalf : oneplushalf;
- - t1_updateflags(flagsp, v, t1->flags_stride);
- + t1_updateflags(flagsp, v, (t1->h+2));
- }
- }
- }
- @@ -370,7 +370,7 @@
- vsc = ((cblksty & J2K_CCP_CBLKSTY_VSC) && (j == k + 3 || j == t1->h - 1)) ? 1 : 0;
- t1_enc_sigpass_step(
- t1,
- - &t1->flags[(j+1) + (i+1)*t1->flags_stride],
- + &t1->flags[(j+1) + (i+1)*(t1->h+2)],
- &t1->data[(j * t1->w) + i],
- orient,
- bpno,
- @@ -400,7 +400,7 @@
- vsc = ((cblksty & J2K_CCP_CBLKSTY_VSC) && (j == k + 3 || j == t1->h - 1)) ? 1 : 0;
- t1_dec_sigpass_step(
- t1,
- - &t1->flags[(j+1) + (i+1)*t1->flags_stride],
- + &t1->flags[(j+1) + (i+1)*(t1->h+2)],
- &t1->data[(j * t1->w) + i],
- orient,
- oneplushalf,
- @@ -483,7 +483,7 @@
- vsc = ((cblksty & J2K_CCP_CBLKSTY_VSC) && (j == k + 3 || j == t1->h - 1)) ? 1 : 0;
- t1_enc_refpass_step(
- t1,
- - &t1->flags[(j+1) + (i+1)*t1->flags_stride],
- + &t1->flags[(j+1) + (i+1)*(t1->h+2)],
- &t1->data[(j * t1->w) + i],
- bpno,
- one,
- @@ -512,7 +512,7 @@
- vsc = ((cblksty & J2K_CCP_CBLKSTY_VSC) && (j == k + 3 || j == t1->h - 1)) ? 1 : 0;
- t1_dec_refpass_step(
- t1,
- - &t1->flags[(j+1) + (i+1)*t1->flags_stride],
- + &t1->flags[(j+1) + (i+1)*(t1->h+2)],
- &t1->data[(j * t1->w) + i],
- poshalf,
- neghalf,
- @@ -552,7 +552,7 @@
- mqc_setcurctx(mqc, t1_getctxno_sc(flag));
- v = *datap < 0 ? 1 : 0;
- mqc_encode(mqc, v ^ t1_getspb(flag));
- - t1_updateflags(flagsp, v, t1->flags_stride);
- + t1_updateflags(flagsp, v, (t1->h+2));
- }
- }
- *flagsp &= ~T1_VISIT;
- @@ -582,7 +582,7 @@
- mqc_setcurctx(mqc, t1_getctxno_sc(flag));
- v = mqc_decode(mqc) ^ t1_getspb(flag);
- *datap = v ? -oneplushalf : oneplushalf;
- - t1_updateflags(flagsp, v, t1->flags_stride);
- + t1_updateflags(flagsp, v, (t1->h+2));
- }
- }
- *flagsp &= ~T1_VISIT;
- @@ -605,16 +605,16 @@
- for (i = 0; i < t1->w; ++i) {
- if (k + 3 < t1->h) {
- if (cblksty & J2K_CCP_CBLKSTY_VSC) {
- - agg = !(t1->flags[(k+1) + (i+1)*t1->flags_stride] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
- - || t1->flags[(k+2) + (i+1)*t1->flags_stride] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
- - || t1->flags[(k+3) + (i+1)*t1->flags_stride] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
- - || (t1->flags[(k+4) + (i+1)*t1->flags_stride]
- + agg = !(t1->flags[(k+1) + (i+1)*(t1->h+2)] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
- + || t1->flags[(k+2) + (i+1)*(t1->h+2)] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
- + || t1->flags[(k+3) + (i+1)*(t1->h+2)] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
- + || (t1->flags[(k+4) + (i+1)*(t1->h+2)]
- & (~(T1_SIG_S | T1_SIG_SE | T1_SIG_SW | T1_SGN_S))) & (T1_SIG | T1_VISIT | T1_SIG_OTH));
- } else {
- - agg = !(t1->flags[(k+1) + (i+1)*t1->flags_stride] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
- - || t1->flags[(k+2) + (i+1)*t1->flags_stride] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
- - || t1->flags[(k+3) + (i+1)*t1->flags_stride] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
- - || t1->flags[(k+4) + (i+1)*t1->flags_stride] & (T1_SIG | T1_VISIT | T1_SIG_OTH));
- + agg = !(t1->flags[(k+1) + (i+1)*(t1->h+2)] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
- + || t1->flags[(k+2) + (i+1)*(t1->h+2)] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
- + || t1->flags[(k+3) + (i+1)*(t1->h+2)] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
- + || t1->flags[(k+4) + (i+1)*(t1->h+2)] & (T1_SIG | T1_VISIT | T1_SIG_OTH));
- }
- } else {
- agg = 0;
- @@ -639,7 +639,7 @@
- vsc = ((cblksty & J2K_CCP_CBLKSTY_VSC) && (j == k + 3 || j == t1->h - 1)) ? 1 : 0;
- t1_enc_clnpass_step(
- t1,
- - &t1->flags[(j+1) + (i+1)*t1->flags_stride],
- + &t1->flags[(j+1) + (i+1)*(t1->h+2)],
- &t1->data[(j * t1->w) + i],
- orient,
- bpno,
- @@ -670,7 +670,7 @@
- for (i = 0; i < t1->w; ++i) {
- if (k + 3 < t1->h) {
- #ifdef __amd64__
- - int64 tmp = *((int64*)&t1->flags[(k+1) + (i+1)*t1->flags_stride]);
- + int64 tmp = *((int64*)&t1->flags[(k+1) + (i+1)*(t1->h+2)]);
- if (cblksty & J2K_CCP_CBLKSTY_VSC) {
- tmp &= ~((int64)(T1_SIG_S | T1_SIG_SE | T1_SIG_SW | T1_SGN_S)<<48);
- }
- @@ -681,16 +681,16 @@
- agg = !tmp;
- #else
- if (cblksty & J2K_CCP_CBLKSTY_VSC) {
- - agg = !(t1->flags[(k+1) + (i+1)*t1->flags_stride] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
- - || t1->flags[(k+2) + (i+1)*t1->flags_stride] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
- - || t1->flags[(k+3) + (i+1)*t1->flags_stride] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
- - || (t1->flags[(k+4) + (i+1)*t1->flags_stride]
- + agg = !(t1->flags[(k+1) + (i+1)*(t1->h+2)] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
- + || t1->flags[(k+2) + (i+1)*(t1->h+2)] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
- + || t1->flags[(k+3) + (i+1)*(t1->h+2)] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
- + || (t1->flags[(k+4) + (i+1)*(t1->h+2)]
- & (~(T1_SIG_S | T1_SIG_SE | T1_SIG_SW | T1_SGN_S))) & (T1_SIG | T1_VISIT | T1_SIG_OTH));
- } else {
- - agg = !(t1->flags[(k+1) + (i+1)*t1->flags_stride] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
- - || t1->flags[(k+2) + (i+1)*t1->flags_stride] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
- - || t1->flags[(k+3) + (i+1)*t1->flags_stride] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
- - || t1->flags[(k+4) + (i+1)*t1->flags_stride] & (T1_SIG | T1_VISIT | T1_SIG_OTH));
- + agg = !(t1->flags[(k+1) + (i+1)*(t1->h+2)] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
- + || t1->flags[(k+2) + (i+1)*(t1->h+2)] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
- + || t1->flags[(k+3) + (i+1)*(t1->h+2)] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
- + || t1->flags[(k+4) + (i+1)*(t1->h+2)] & (T1_SIG | T1_VISIT | T1_SIG_OTH));
- }
- #endif
- } else {
- @@ -711,7 +711,7 @@
- vsc = ((cblksty & J2K_CCP_CBLKSTY_VSC) && (j == k + 3 || j == t1->h - 1)) ? 1 : 0;
- t1_dec_clnpass_step(
- t1,
- - &t1->flags[(j+1) + (i+1)*t1->flags_stride],
- + &t1->flags[(j+1) + (i+1)*(t1->h+2)],
- &t1->data[(j * t1->w) + i],
- orient,
- oneplushalf,
- @@ -779,8 +779,7 @@
- }
- memset(t1->data,0,datasize * sizeof(int));
-
- - t1->flags_stride=h+2;
- - flagssize=t1->flags_stride * (w+2);
- + flagssize=(h+2) * (w+2);
-
- if(flagssize > t1->flagssize){
- opj_aligned_free(t1->flags);
- diff -urN -x '*.orig' -x '*.rej' -x '*~' -x '.*' OpenJPEG.orig/libopenjpeg/t1.h OpenJPEG.patched/libopenjpeg/t1.h
- --- OpenJPEG.orig/libopenjpeg/t1.h 2007-08-23 05:48:09.000000000 -0500
- +++ OpenJPEG.patched/libopenjpeg/t1.h 2007-08-23 05:48:37.000000000 -0500
- @@ -105,7 +105,6 @@
- int h;
- int datasize;
- int flagssize;
- - int flags_stride;
- } opj_t1_t;
-
- /** @name Exported functions */
|