Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Carsten Munk
committed
Oct 4, 2011
0 parents
commit 307a783
Showing
21 changed files
with
1,210 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<attributes> | ||
<attribute namespace="Mer" name="MeeGoUpstreamRev"> | ||
<value>ec096f766adbffc96bdbb926b917c87d</value> | ||
</attribute> | ||
</attributes> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<package project="Mer:Trunk:Base" name="openjpeg"> | ||
<title>OpenJPEG command line tools</title> | ||
<description>OpenJPEG is an open-source JPEG 2000 codec written in C language. It has been | ||
developed in order to promote the use of JPEG 2000, the new still-image | ||
compression standard from the Joint Photographic Experts Group (JPEG). | ||
|
||
</description> | ||
<url>http://www.openjpeg.org/</url> | ||
</package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Index: OpenJPEG_v1_3/libopenjpeg/t1.c | ||
=================================================================== | ||
--- OpenJPEG_v1_3.orig/libopenjpeg/t1.c | ||
+++ OpenJPEG_v1_3/libopenjpeg/t1.c | ||
@@ -320,9 +320,9 @@ static void t1_updateflags(flag_t *flags | ||
__m64 tmp2 = *(__m64*)((void*)&flagsp[-1 ]); | ||
__m64 tmp3 = *(__m64*)((void*)&flagsp[-1 + stride]); | ||
|
||
- tmp1 = _mm_or_si64(tmp1, mod[s]); | ||
- tmp2 = _mm_or_si64(tmp2, mod[s+2]); | ||
- tmp3 = _mm_or_si64(tmp3, mod[s+4]); | ||
+ tmp1 = _mm_or_si64(tmp1, (__m64)mod[s]); | ||
+ tmp2 = _mm_or_si64(tmp2, (__m64)mod[s+2]); | ||
+ tmp3 = _mm_or_si64(tmp3, (__m64)mod[s+4]); | ||
|
||
*(__m64*)((void*)&flagsp[-1 - stride]) = tmp1; | ||
*(__m64*)((void*)&flagsp[-1 ]) = tmp2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
diff -up OpenJPEG_v1_3/codec/CMakeLists.txt.libm OpenJPEG_v1_3/codec/CMakeLists.txt | ||
--- OpenJPEG_v1_3/codec/CMakeLists.txt.libm 2007-11-27 06:38:52.000000000 -0600 | ||
+++ OpenJPEG_v1_3/codec/CMakeLists.txt 2009-06-19 09:20:59.473980422 -0500 | ||
@@ -46,10 +46,6 @@ FOREACH(exe j2k_to_image image_to_j2k) | ||
ADD_TEST(${exe} ${EXECUTABLE_OUTPUT_PATH}/${exe}) | ||
# calling those exe without option will make them fail always: | ||
SET_TESTS_PROPERTIES(${exe} PROPERTIES WILL_FAIL TRUE) | ||
- # On unix you need to link to the math library: | ||
- IF(UNIX) | ||
- TARGET_LINK_LIBRARIES(${exe} m) | ||
- ENDIF(UNIX) | ||
# Install exe | ||
INSTALL_TARGETS(/bin/ ${exe}) | ||
ENDFOREACH(exe) | ||
diff -up OpenJPEG_v1_3/libopenjpeg/CMakeLists.txt.libm OpenJPEG_v1_3/libopenjpeg/CMakeLists.txt | ||
--- OpenJPEG_v1_3/libopenjpeg/CMakeLists.txt.libm 2009-06-19 09:18:44.021229314 -0500 | ||
+++ OpenJPEG_v1_3/libopenjpeg/CMakeLists.txt 2009-06-19 09:18:44.074248015 -0500 | ||
@@ -35,6 +35,11 @@ ADD_LIBRARY(${OPENJPEG_LIBRARY_NAME} ${O | ||
SET_TARGET_PROPERTIES(${OPENJPEG_LIBRARY_NAME} PROPERTIES | ||
${OPENJPEG_LIBRARY_PROPERTIES}) | ||
|
||
+IF(UNIX) | ||
+ TARGET_LINK_LIBRARIES(${OPENJPEG_LIBRARY_NAME} m) | ||
+ TARGET_LINK_LIBRARIES(${OPENJPEG_LIBRARY_NAME} LINK_INTERFACE_LIBRARIES) | ||
+ENDIF(UNIX) | ||
+ | ||
# Install library | ||
INSTALL(TARGETS ${OPENJPEG_LIBRARY_NAME} | ||
DESTINATION ${CMAKE_INSTALL_LIBDIR}) | ||
diff -up OpenJPEG_v1_3/mj2/CMakeLists.txt.libm OpenJPEG_v1_3/mj2/CMakeLists.txt | ||
--- OpenJPEG_v1_3/mj2/CMakeLists.txt.libm 2007-09-12 04:04:03.000000000 -0500 | ||
+++ OpenJPEG_v1_3/mj2/CMakeLists.txt 2009-06-19 09:18:44.074248015 -0500 | ||
@@ -10,33 +10,21 @@ ADD_EXECUTABLE(frames_to_mj2 | ||
compat/getopt.c | ||
mj2_convert.c mj2.c ) | ||
TARGET_LINK_LIBRARIES(frames_to_mj2 ${OPJ_PREFIX}openjpeg) | ||
-IF(UNIX) | ||
- TARGET_LINK_LIBRARIES(frames_to_mj2 m) | ||
-ENDIF(UNIX) | ||
|
||
ADD_EXECUTABLE(mj2_to_frames | ||
mj2_to_frames.c | ||
compat/getopt.c mj2_convert.c mj2.c ) | ||
TARGET_LINK_LIBRARIES(mj2_to_frames ${OPJ_PREFIX}openjpeg) | ||
-IF(UNIX) | ||
- TARGET_LINK_LIBRARIES(mj2_to_frames m) | ||
-ENDIF(UNIX) | ||
|
||
ADD_EXECUTABLE(extract_j2k_from_mj2 | ||
extract_j2k_from_mj2.c | ||
mj2.c ) | ||
TARGET_LINK_LIBRARIES(extract_j2k_from_mj2 ${OPJ_PREFIX}openjpeg) | ||
-IF(UNIX) | ||
- TARGET_LINK_LIBRARIES(extract_j2k_from_mj2 m) | ||
-ENDIF(UNIX) | ||
|
||
ADD_EXECUTABLE(wrap_j2k_in_mj2 | ||
wrap_j2k_in_mj2.c | ||
mj2.c ) | ||
TARGET_LINK_LIBRARIES(wrap_j2k_in_mj2 ${OPJ_PREFIX}openjpeg) | ||
-IF(UNIX) | ||
- TARGET_LINK_LIBRARIES(wrap_j2k_in_mj2 m) | ||
-ENDIF(UNIX) | ||
|
||
INSTALL(TARGETS frames_to_mj2 mj2_to_frames extract_j2k_from_mj2 wrap_j2k_in_mj2 | ||
DESTINATION bin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- OpenJPEG_v1_3/libopenjpeg/opj_malloc.h 2007-12-21 04:19:01.000000000 -0600 | ||
+++ trunk/libopenjpeg/opj_malloc.h 2007-10-18 07:26:11.000000000 -0500 | ||
@@ -75,9 +75,6 @@ | ||
#else /* Not WIN32 */ | ||
#if defined(__sun) | ||
#define HAVE_MEMALIGN | ||
- #elif defined(__GNUC__) | ||
- #define HAVE_MEMALIGN | ||
- #include <malloc.h> | ||
/* Linux x86_64 and OSX always align allocations to 16 bytes */ | ||
#elif !defined(__amd64__) && !defined(__APPLE__) | ||
/* FIXME: Yes, this is a big assumption */ | ||
@@ -85,8 +82,6 @@ | ||
#endif | ||
#endif | ||
|
||
- | ||
- | ||
#define opj_aligned_malloc(size) malloc(size) | ||
#define opj_aligned_free(m) free(m) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
diff -urN -x '*.orig' -x '*.rej' -x '*~' -x '.*' OpenJPEG.orig/libopenjpeg/tcd.c OpenJPEG.patched/libopenjpeg/tcd.c | ||
--- OpenJPEG.orig/libopenjpeg/tcd.c 2007-12-19 06:28:40.000000000 -0600 | ||
+++ OpenJPEG.patched/libopenjpeg/tcd.c 2007-12-27 21:58:57.000000000 -0600 | ||
@@ -584,7 +584,9 @@ | ||
cblk->y0 = int_max(cblkystart, prc->y0); | ||
cblk->x1 = int_min(cblkxend, prc->x1); | ||
cblk->y1 = int_min(cblkyend, prc->y1); | ||
- cblk->data = (unsigned char*) opj_calloc(8192, sizeof(unsigned char)); | ||
+ cblk->data = (unsigned char*) opj_calloc(8192+2, sizeof(unsigned char)); | ||
+ /* FIXME: mqc_init_enc and mqc_byteout underrun the buffer if we don't do this. Why? */ | ||
+ cblk->data += 2; | ||
cblk->layers = (opj_tcd_layer_t*) opj_calloc(100, sizeof(opj_tcd_layer_t)); | ||
cblk->passes = (opj_tcd_pass_t*) opj_calloc(100, sizeof(opj_tcd_pass_t)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff -urN -x '*.orig' -x '*.rej' -x '*~' -x '.*' OpenJPEG.orig/codec/convert.c OpenJPEG.patched/codec/convert.c | ||
--- OpenJPEG.orig/codec/convert.c 2007-07-17 11:19:41.000000000 -0500 | ||
+++ OpenJPEG.patched/codec/convert.c 2007-07-17 19:40:02.000000000 -0500 | ||
@@ -33,7 +33,7 @@ | ||
#include <stdlib.h> | ||
#include <string.h> | ||
#include "openjpeg.h" | ||
-#include "../libs/libtiff/tiffio.h" | ||
+#include "tiffio.h" | ||
#include "convert.h" | ||
|
||
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
diff -urN -x '*.orig' -x '*.rej' -x '*~' -x '.*' OpenJPEG.orig/libopenjpeg/mqc.c OpenJPEG.patched/libopenjpeg/mqc.c | ||
--- OpenJPEG.orig/libopenjpeg/mqc.c 2007-07-17 20:07:22.000000000 -0500 | ||
+++ OpenJPEG.patched/libopenjpeg/mqc.c 2007-07-17 20:07:44.000000000 -0500 | ||
@@ -507,20 +507,20 @@ | ||
|
||
int mqc_decode(opj_mqc_t *mqc) { | ||
int d; | ||
- mqc->a -= (*mqc->curctx)->qeval; | ||
- if ((mqc->c >> 16) < (*mqc->curctx)->qeval) { | ||
+ unsigned int qeval = (*mqc->curctx)->qeval; | ||
+ mqc->a -= qeval; | ||
+ qeval <<= 16; | ||
+ if (mqc->c < qeval) { | ||
d = mqc_lpsexchange(mqc); | ||
- mqc_renormd(mqc); | ||
} else { | ||
- mqc->c -= (*mqc->curctx)->qeval << 16; | ||
+ mqc->c -= qeval; | ||
if ((mqc->a & 0x8000) == 0) { | ||
d = mqc_mpsexchange(mqc); | ||
- mqc_renormd(mqc); | ||
} else { | ||
- d = (*mqc->curctx)->mps; | ||
+ return (*mqc->curctx)->mps; | ||
} | ||
} | ||
- | ||
+ mqc_renormd(mqc); | ||
return d; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
diff -urN -x '*.orig' -x '*.rej' -x '*~' -x '.*' OpenJPEG.orig/libopenjpeg/mqc.c OpenJPEG.patched/libopenjpeg/mqc.c | ||
--- OpenJPEG.orig/libopenjpeg/mqc.c 2007-08-06 16:16:00.000000000 -0500 | ||
+++ OpenJPEG.patched/libopenjpeg/mqc.c 2007-08-06 19:07:28.000000000 -0500 | ||
@@ -68,13 +68,13 @@ | ||
@param mqc MQC handle | ||
@return | ||
*/ | ||
-static int mqc_mpsexchange(opj_mqc_t *mqc); | ||
+//static int mqc_mpsexchange(opj_mqc_t *mqc); | ||
/** | ||
FIXME: documentation ??? | ||
@param mqc MQC handle | ||
@return | ||
*/ | ||
-static int mqc_lpsexchange(opj_mqc_t *mqc); | ||
+//static int mqc_lpsexchange(opj_mqc_t *mqc); | ||
/** | ||
Input a byte | ||
@param mqc MQC handle | ||
@@ -271,33 +271,22 @@ | ||
} | ||
} | ||
|
||
+/* | ||
static int mqc_mpsexchange(opj_mqc_t *mqc) { | ||
- int d; | ||
- if (mqc->a < (*mqc->curctx)->qeval) { | ||
- d = 1 - (*mqc->curctx)->mps; | ||
- *mqc->curctx = (*mqc->curctx)->nlps; | ||
- } else { | ||
- d = (*mqc->curctx)->mps; | ||
- *mqc->curctx = (*mqc->curctx)->nmps; | ||
- } | ||
- | ||
- return d; | ||
+ int d = (*mqc->curctx)->mps; | ||
+ int tmp = (mqc->a < (*mqc->curctx)->qeval); | ||
+ *mqc->curctx = tmp ? (*mqc->curctx)->nlps : (*mqc->curctx)->nmps; | ||
+ return tmp ^ d; | ||
} | ||
|
||
static int mqc_lpsexchange(opj_mqc_t *mqc) { | ||
- int d; | ||
- if (mqc->a < (*mqc->curctx)->qeval) { | ||
- mqc->a = (*mqc->curctx)->qeval; | ||
- d = (*mqc->curctx)->mps; | ||
- *mqc->curctx = (*mqc->curctx)->nmps; | ||
- } else { | ||
- mqc->a = (*mqc->curctx)->qeval; | ||
- d = 1 - (*mqc->curctx)->mps; | ||
- *mqc->curctx = (*mqc->curctx)->nlps; | ||
- } | ||
- | ||
- return d; | ||
+ int d = (*mqc->curctx)->mps; | ||
+ int tmp = !(mqc->a < (*mqc->curctx)->qeval); | ||
+ mqc->a = (*mqc->curctx)->qeval; | ||
+ *mqc->curctx = tmp ? (*mqc->curctx)->nlps : (*mqc->curctx)->nmps; | ||
+ return tmp ^ d; | ||
} | ||
+*/ | ||
|
||
static void mqc_bytein(opj_mqc_t *mqc) { | ||
if (mqc->bp != mqc->end) { | ||
@@ -506,22 +495,27 @@ | ||
} | ||
|
||
int mqc_decode(opj_mqc_t *mqc) { | ||
- int d; | ||
unsigned int qeval = (*mqc->curctx)->qeval; | ||
mqc->a -= qeval; | ||
+ bool tmp = (mqc->a < qeval); | ||
qeval <<= 16; | ||
- if (mqc->c < qeval) { | ||
- d = mqc_lpsexchange(mqc); | ||
- } else { | ||
+ if (mqc->c >= qeval) { | ||
mqc->c -= qeval; | ||
- if ((mqc->a & 0x8000) == 0) { | ||
- d = mqc_mpsexchange(mqc); | ||
- } else { | ||
+ if (mqc->a & 0x8000) { | ||
return (*mqc->curctx)->mps; | ||
} | ||
+ }else{ | ||
+ tmp = !tmp; | ||
+ mqc->a = (*mqc->curctx)->qeval; | ||
} | ||
+ | ||
+ opj_mqc_state_t* nmps = (*mqc->curctx)->nmps; | ||
+ opj_mqc_state_t* nlps = (*mqc->curctx)->nlps; | ||
+ int mps = (*mqc->curctx)->mps ^ tmp; | ||
+ *mqc->curctx = tmp ? nlps : nmps; | ||
+ | ||
mqc_renormd(mqc); | ||
- return d; | ||
+ return mps; | ||
} | ||
|
||
void mqc_resetstates(opj_mqc_t *mqc) { |
28 changes: 28 additions & 0 deletions
28
openjpeg-20070719svn-t1-t1_dec_sigpass_step-optimize.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
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-09 19:26:57.000000000 -0500 | ||
+++ OpenJPEG.patched/libopenjpeg/t1.c 2007-08-09 19:44:25.000000000 -0500 | ||
@@ -40,7 +40,7 @@ | ||
/*@{*/ | ||
|
||
static INLINE char t1_getctxno_zc(int f, int orient); | ||
-static char t1_getctxno_sc(int f); | ||
+static INLINE char t1_getctxno_sc(int f); | ||
static INLINE int t1_getctxno_mag(int f); | ||
static char t1_getspb(int f); | ||
static short t1_getnmsedec_sig(int x, int bitpos); | ||
@@ -334,6 +334,7 @@ | ||
|
||
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))) { | ||
+ *flagsp |= T1_VISIT; | ||
if (type == T1_TYPE_RAW) { | ||
if (raw_decode(raw)) { | ||
v = raw_decode(raw); /* ESSAI */ | ||
@@ -349,7 +350,6 @@ | ||
t1_updateflags(flagsp, v, t1->flags_stride); | ||
} | ||
} | ||
- *flagsp |= T1_VISIT; | ||
} | ||
} /* VSC and BYPASS by Antonin */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
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-06 14:07:59.000000000 -0500 | ||
+++ OpenJPEG.patched/libopenjpeg/t1.c 2007-08-06 15:54:31.000000000 -0500 | ||
@@ -669,6 +669,17 @@ | ||
for (k = 0; k < t1->h; k += 4) { | ||
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]); | ||
+ if (cblksty & J2K_CCP_CBLKSTY_VSC) { | ||
+ tmp &= ~((int64)(T1_SIG_S | T1_SIG_SE | T1_SIG_SW | T1_SGN_S)<<48); | ||
+ } | ||
+ tmp &= (int64)(T1_SIG | T1_VISIT | T1_SIG_OTH) | ||
+ | ((int64)(T1_SIG | T1_VISIT | T1_SIG_OTH)<<16) | ||
+ | ((int64)(T1_SIG | T1_VISIT | T1_SIG_OTH)<<32) | ||
+ | ((int64)(T1_SIG | T1_VISIT | T1_SIG_OTH)<<48); | ||
+ 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) | ||
@@ -681,6 +692,7 @@ | ||
|| 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)); | ||
} | ||
+#endif | ||
} else { | ||
agg = 0; | ||
} |
Oops, something went wrong.