fixed a bug in image_to_j2k.c that was preventing the 'r' option to work properly...
[openjpeg.git] / libopenjpeg / t1_generate_luts.c
index af298133d1c530a0a4c68a468c2c5fc9646d17c3..1925b951f1beb8b252b6ad504bedd806ed1b106c 100644 (file)
@@ -197,7 +197,13 @@ int main(){
        // lut_ctxno_zc
        for (j = 0; j < 4; ++j) {
                for (i = 0; i < 256; ++i) {
-                       lut_ctxno_zc[(j << 8) | i] = t1_init_ctxno_zc(i, j);
+                       int orient = j;
+                       if (orient == 2) {
+                               orient = 1;
+                       } else if (orient == 1) {
+                               orient = 2;
+                       }
+                       lut_ctxno_zc[(orient << 8) | i] = t1_init_ctxno_zc(i, j);
                }
        }