openjpeg-20070821svn-t1-remove-macro.patch 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. diff -urN -x '*.orig' -x '*.rej' -x '*~' -x '.*' OpenJPEG.orig/libopenjpeg/t1.c OpenJPEG.patched/libopenjpeg/t1.c
  2. --- OpenJPEG.orig/libopenjpeg/t1.c 2007-08-23 05:43:10.000000000 -0500
  3. +++ OpenJPEG.patched/libopenjpeg/t1.c 2007-08-23 05:46:31.000000000 -0500
  4. @@ -259,27 +259,24 @@
  5. }
  6. static void t1_updateflags(flag_t *flagsp, int s, int stride) {
  7. - flag_t *np = flagsp - stride;
  8. - flag_t *sp = flagsp + stride;
  9. -
  10. static const flag_t mod[] = {
  11. - T1_SIG_S, T1_SIG_S|T1_SGN_S,
  12. T1_SIG_E, T1_SIG_E|T1_SGN_E,
  13. - T1_SIG_W, T1_SIG_W|T1_SGN_W,
  14. - T1_SIG_N, T1_SIG_N|T1_SGN_N
  15. + T1_SIG_S, T1_SIG_S|T1_SGN_S,
  16. + T1_SIG_N, T1_SIG_N|T1_SGN_N,
  17. + T1_SIG_W, T1_SIG_W|T1_SGN_W
  18. };
  19. - np[-1] |= T1_SIG_SE;
  20. - np[0] |= mod[s];
  21. - np[1] |= T1_SIG_SW;
  22. + flagsp[-1 - stride] |= T1_SIG_SE;
  23. + flagsp[ 0 - stride] |= mod[s];
  24. + flagsp[ 1 - stride] |= T1_SIG_NE;
  25. flagsp[-1] |= mod[s+2];
  26. - flagsp[0] |= T1_SIG;
  27. - flagsp[1] |= mod[s+4];
  28. + flagsp[ 0] |= T1_SIG;
  29. + flagsp[ 1] |= mod[s+4];
  30. - sp[-1] |= T1_SIG_NE;
  31. - sp[0] |= mod[s+6];
  32. - sp[1] |= T1_SIG_NW;
  33. + flagsp[-1 + stride] |= T1_SIG_SW;
  34. + flagsp[ 0 + stride] |= mod[s+6];
  35. + flagsp[ 1 + stride] |= T1_SIG_NW;
  36. }
  37. static void t1_enc_sigpass_step(
  38. @@ -373,7 +370,7 @@
  39. vsc = ((cblksty & J2K_CCP_CBLKSTY_VSC) && (j == k + 3 || j == t1->h - 1)) ? 1 : 0;
  40. t1_enc_sigpass_step(
  41. t1,
  42. - &t1->flags[((j+1) * t1->flags_stride) + i + 1],
  43. + &t1->flags[(j+1) + (i+1)*t1->flags_stride],
  44. &t1->data[(j * t1->w) + i],
  45. orient,
  46. bpno,
  47. @@ -403,7 +400,7 @@
  48. vsc = ((cblksty & J2K_CCP_CBLKSTY_VSC) && (j == k + 3 || j == t1->h - 1)) ? 1 : 0;
  49. t1_dec_sigpass_step(
  50. t1,
  51. - &t1->flags[((j+1) * t1->flags_stride) + i + 1],
  52. + &t1->flags[(j+1) + (i+1)*t1->flags_stride],
  53. &t1->data[(j * t1->w) + i],
  54. orient,
  55. oneplushalf,
  56. @@ -486,7 +483,7 @@
  57. vsc = ((cblksty & J2K_CCP_CBLKSTY_VSC) && (j == k + 3 || j == t1->h - 1)) ? 1 : 0;
  58. t1_enc_refpass_step(
  59. t1,
  60. - &t1->flags[((j+1) * t1->flags_stride) + i + 1],
  61. + &t1->flags[(j+1) + (i+1)*t1->flags_stride],
  62. &t1->data[(j * t1->w) + i],
  63. bpno,
  64. one,
  65. @@ -515,7 +512,7 @@
  66. vsc = ((cblksty & J2K_CCP_CBLKSTY_VSC) && (j == k + 3 || j == t1->h - 1)) ? 1 : 0;
  67. t1_dec_refpass_step(
  68. t1,
  69. - &t1->flags[((j+1) * t1->flags_stride) + i + 1],
  70. + &t1->flags[(j+1) + (i+1)*t1->flags_stride],
  71. &t1->data[(j * t1->w) + i],
  72. poshalf,
  73. neghalf,
  74. @@ -608,16 +605,16 @@
  75. for (i = 0; i < t1->w; ++i) {
  76. if (k + 3 < t1->h) {
  77. if (cblksty & J2K_CCP_CBLKSTY_VSC) {
  78. - agg = !(MACRO_t1_flags(1 + k,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)
  79. - || MACRO_t1_flags(1 + k + 1,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)
  80. - || MACRO_t1_flags(1 + k + 2,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)
  81. - || (MACRO_t1_flags(1 + k + 3,1 + i)
  82. - & (~(T1_SIG_S | T1_SIG_SE | T1_SIG_SW | T1_SGN_S))) & (T1_SIG | T1_VISIT | T1_SIG_OTH));
  83. + agg = !(t1->flags[(k+1) + (i+1)*t1->flags_stride] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
  84. + || t1->flags[(k+2) + (i+1)*t1->flags_stride] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
  85. + || t1->flags[(k+3) + (i+1)*t1->flags_stride] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
  86. + || (t1->flags[(k+4) + (i+1)*t1->flags_stride]
  87. + & (~(T1_SIG_S | T1_SIG_SE | T1_SIG_SW | T1_SGN_S))) & (T1_SIG | T1_VISIT | T1_SIG_OTH));
  88. } else {
  89. - agg = !(MACRO_t1_flags(1 + k,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)
  90. - || MACRO_t1_flags(1 + k + 1,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)
  91. - || MACRO_t1_flags(1 + k + 2,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)
  92. - || MACRO_t1_flags(1 + k + 3,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH));
  93. + agg = !(t1->flags[(k+1) + (i+1)*t1->flags_stride] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
  94. + || t1->flags[(k+2) + (i+1)*t1->flags_stride] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
  95. + || t1->flags[(k+3) + (i+1)*t1->flags_stride] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
  96. + || t1->flags[(k+4) + (i+1)*t1->flags_stride] & (T1_SIG | T1_VISIT | T1_SIG_OTH));
  97. }
  98. } else {
  99. agg = 0;
  100. @@ -642,7 +639,7 @@
  101. vsc = ((cblksty & J2K_CCP_CBLKSTY_VSC) && (j == k + 3 || j == t1->h - 1)) ? 1 : 0;
  102. t1_enc_clnpass_step(
  103. t1,
  104. - &t1->flags[((j+1) * t1->flags_stride) + i + 1],
  105. + &t1->flags[(j+1) + (i+1)*t1->flags_stride],
  106. &t1->data[(j * t1->w) + i],
  107. orient,
  108. bpno,
  109. @@ -673,16 +670,16 @@
  110. for (i = 0; i < t1->w; ++i) {
  111. if (k + 3 < t1->h) {
  112. if (cblksty & J2K_CCP_CBLKSTY_VSC) {
  113. - agg = !(MACRO_t1_flags(1 + k,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)
  114. - || MACRO_t1_flags(1 + k + 1,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)
  115. - || MACRO_t1_flags(1 + k + 2,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)
  116. - || (MACRO_t1_flags(1 + k + 3,1 + i)
  117. - & (~(T1_SIG_S | T1_SIG_SE | T1_SIG_SW | T1_SGN_S))) & (T1_SIG | T1_VISIT | T1_SIG_OTH));
  118. + agg = !(t1->flags[(k+1) + (i+1)*t1->flags_stride] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
  119. + || t1->flags[(k+2) + (i+1)*t1->flags_stride] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
  120. + || t1->flags[(k+3) + (i+1)*t1->flags_stride] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
  121. + || (t1->flags[(k+4) + (i+1)*t1->flags_stride]
  122. + & (~(T1_SIG_S | T1_SIG_SE | T1_SIG_SW | T1_SGN_S))) & (T1_SIG | T1_VISIT | T1_SIG_OTH));
  123. } else {
  124. - agg = !(MACRO_t1_flags(1 + k,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)
  125. - || MACRO_t1_flags(1 + k + 1,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)
  126. - || MACRO_t1_flags(1 + k + 2,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)
  127. - || MACRO_t1_flags(1 + k + 3,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH));
  128. + agg = !(t1->flags[(k+1) + (i+1)*t1->flags_stride] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
  129. + || t1->flags[(k+2) + (i+1)*t1->flags_stride] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
  130. + || t1->flags[(k+3) + (i+1)*t1->flags_stride] & (T1_SIG | T1_VISIT | T1_SIG_OTH)
  131. + || t1->flags[(k+4) + (i+1)*t1->flags_stride] & (T1_SIG | T1_VISIT | T1_SIG_OTH));
  132. }
  133. } else {
  134. agg = 0;
  135. @@ -702,7 +699,7 @@
  136. vsc = ((cblksty & J2K_CCP_CBLKSTY_VSC) && (j == k + 3 || j == t1->h - 1)) ? 1 : 0;
  137. t1_dec_clnpass_step(
  138. t1,
  139. - &t1->flags[((j+1) * t1->flags_stride) + i + 1],
  140. + &t1->flags[(j+1) + (i+1)*t1->flags_stride],
  141. &t1->data[(j * t1->w) + i],
  142. orient,
  143. oneplushalf,
  144. @@ -770,8 +767,8 @@
  145. }
  146. memset(t1->data,0,datasize * sizeof(int));
  147. - t1->flags_stride=w+2;
  148. - flagssize=t1->flags_stride * (h+2);
  149. + t1->flags_stride=h+2;
  150. + flagssize=t1->flags_stride * (w+2);
  151. if(flagssize > t1->flagssize){
  152. opj_aligned_free(t1->flags);
  153. diff -urN -x '*.orig' -x '*.rej' -x '*~' -x '.*' OpenJPEG.orig/libopenjpeg/t1.h OpenJPEG.patched/libopenjpeg/t1.h
  154. --- OpenJPEG.orig/libopenjpeg/t1.h 2007-05-22 08:14:13.000000000 -0500
  155. +++ OpenJPEG.patched/libopenjpeg/t1.h 2007-08-23 05:44:00.000000000 -0500
  156. @@ -108,8 +108,6 @@
  157. int flags_stride;
  158. } opj_t1_t;
  159. -#define MACRO_t1_flags(x,y) t1->flags[((x)*(t1->flags_stride))+(y)]
  160. -
  161. /** @name Exported functions */
  162. /*@{*/
  163. /* ----------------------------------------------------------------------- */