00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef OPJ_INCLUDES_H
00034 #define OPJ_INCLUDES_H
00035
00036
00037
00038
00039
00040 #include "opj_config_private.h"
00041
00042
00043
00044
00045
00046
00047 #include <memory.h>
00048 #include <stdlib.h>
00049 #include <string.h>
00050 #include <math.h>
00051 #include <float.h>
00052 #include <time.h>
00053 #include <stdio.h>
00054 #include <stdarg.h>
00055 #include <ctype.h>
00056 #include <assert.h>
00057
00058
00059
00060
00061
00062
00063
00064 #if defined(OPJ_HAVE_FSEEKO) && !defined(fseek)
00065 # define fseek fseeko
00066 # define ftell ftello
00067 #endif
00068
00069
00070 #if defined(WIN32) && !defined(Windows95) && !defined(__BORLANDC__) && \
00071 !(defined(_MSC_VER) && _MSC_VER < 1400) && \
00072 !(defined(__MINGW32__) && __MSVCRT_VERSION__ < 0x800)
00073
00074
00075
00076
00077
00078 # define OPJ_FSEEK(stream,offset,whence) _fseeki64(stream, offset,whence)
00079 # define OPJ_FSTAT(fildes,stat_buff) _fstati64(fildes, stat_buff)
00080 # define OPJ_FTELL(stream) _ftelli64(stream)
00081 # define OPJ_STAT_STRUCT_T struct _stati64
00082 # define OPJ_STAT(path,stat_buff) _stati64(path, stat_buff)
00083 #else
00084 # define OPJ_FSEEK(stream,offset,whence) fseek(stream,offset,whence)
00085 # define OPJ_FSTAT(fildes,stat_buff) fstat(fildes,stat_buff)
00086 # define OPJ_FTELL(stream) ftell(stream)
00087 # define OPJ_STAT_STRUCT_T struct stat
00088 # define OPJ_STAT(path,stat_buff) stat(path,stat_buff)
00089 #endif
00090
00091
00092
00093
00094
00095
00096
00097 #include "openjpeg.h"
00098
00099
00100
00101
00102
00103
00104
00105
00106 #if (__STDC_VERSION__ >= 199901L)
00107 #define OPJ_RESTRICT restrict
00108 #else
00109
00110 #if defined(__GNUC__)
00111 #define OPJ_RESTRICT __restrict__
00112
00113
00114
00115
00116
00117
00118
00119 #else
00120 #define OPJ_RESTRICT
00121 #endif
00122 #endif
00123
00124 #ifdef __has_attribute
00125 #if __has_attribute(no_sanitize)
00126 #define OPJ_NOSANITIZE(kind) __attribute__((no_sanitize(kind)))
00127 #endif
00128 #endif
00129 #ifndef OPJ_NOSANITIZE
00130 #define OPJ_NOSANITIZE(kind)
00131 #endif
00132
00133
00134
00135 #if defined(_MSC_VER)
00136 #include <intrin.h>
00137 static INLINE long opj_lrintf(float f){
00138 #ifdef _M_X64
00139 return _mm_cvt_ss2si(_mm_load_ss(&f));
00140
00141
00142
00143 #elif defined(_M_IX86)
00144 int i;
00145 _asm{
00146 fld f
00147 fistp i
00148 };
00149
00150 return i;
00151 #else
00152 return (long)((f>0.0f) ? (f + 0.5f) : (f - 0.5f));
00153 #endif
00154 }
00155 #elif defined(__BORLANDC__)
00156 static INLINE long opj_lrintf(float f) {
00157 #ifdef _M_X64
00158 return (long)((f>0.0f) ? (f + 0.5f):(f -0.5f));
00159 #else
00160 int i;
00161
00162 _asm {
00163 fld f
00164 fistp i
00165 };
00166
00167 return i;
00168 #endif
00169 }
00170 #else
00171 static INLINE long opj_lrintf(float f) {
00172 return lrintf(f);
00173 }
00174 #endif
00175
00176 #if defined(_MSC_VER) && (_MSC_VER < 1400)
00177 #define vsnprintf _vsnprintf
00178 #endif
00179
00180
00181 #if defined(_MSC_VER) && (_MSC_VER >= 1400) && !defined(__INTEL_COMPILER) && defined(_M_IX86)
00182 # include <intrin.h>
00183 # pragma intrinsic(__emul)
00184 #endif
00185
00186 #include "opj_inttypes.h"
00187 #include "opj_clock.h"
00188 #include "opj_malloc.h"
00189 #include "event.h"
00190 #include "function_list.h"
00191 #include "bio.h"
00192 #include "cio.h"
00193
00194 #include "image.h"
00195 #include "invert.h"
00196 #include "j2k.h"
00197 #include "jp2.h"
00198
00199 #include "mqc.h"
00200 #include "raw.h"
00201 #include "bio.h"
00202
00203 #include "pi.h"
00204 #include "tgt.h"
00205 #include "tcd.h"
00206 #include "t1.h"
00207 #include "dwt.h"
00208 #include "t2.h"
00209 #include "mct.h"
00210 #include "opj_intmath.h"
00211
00212 #ifdef USE_JPIP
00213 #include "cidx_manager.h"
00214 #include "indexbox_manager.h"
00215 #endif
00216
00217
00218 #ifdef USE_JPWL
00219 #include "openjpwl/jpwl.h"
00220 #endif
00221
00222
00223
00224 #include "opj_codec.h"
00225
00226
00227 #endif