move the nnsdk lib to aml-toolkit
This commit is contained in:
parent
3c8209fdea
commit
85e0b73aa1
15 changed files with 0 additions and 3082 deletions
|
|
@ -1,137 +0,0 @@
|
||||||
#define HAVE_PROTOTYPES
|
|
||||||
#define HAVE_UNSIGNED_CHAR
|
|
||||||
#define HAVE_UNSIGNED_SHORT
|
|
||||||
|
|
||||||
/* Define this if an ordinary "char" type is unsigned.
|
|
||||||
* If you're not sure, leaving it undefined will work at some cost in speed.
|
|
||||||
* If you defined HAVE_UNSIGNED_CHAR then the speed difference is minimal.
|
|
||||||
*/
|
|
||||||
#undef CHAR_IS_UNSIGNED
|
|
||||||
|
|
||||||
#if defined __MINGW__ || defined __MINGW32__ || (!defined WIN32 && !defined _WIN32)
|
|
||||||
/* Define this if your system has an ANSI-conforming <stddef.h> file.
|
|
||||||
*/
|
|
||||||
#define HAVE_STDDEF_H
|
|
||||||
|
|
||||||
/* Define this if your system has an ANSI-conforming <stdlib.h> file.
|
|
||||||
*/
|
|
||||||
#define HAVE_STDLIB_H
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Define this if your system does not have an ANSI/SysV <string.h>,
|
|
||||||
* but does have a BSD-style <strings.h>.
|
|
||||||
*/
|
|
||||||
#undef NEED_BSD_STRINGS
|
|
||||||
|
|
||||||
/* Define this if your system does not provide typedef size_t in any of the
|
|
||||||
* ANSI-standard places (stddef.h, stdlib.h, or stdio.h), but places it in
|
|
||||||
* <sys/types.h> instead.
|
|
||||||
*/
|
|
||||||
#undef NEED_SYS_TYPES_H
|
|
||||||
|
|
||||||
/* For 80x86 machines, you need to define NEED_FAR_POINTERS,
|
|
||||||
* unless you are using a large-data memory model or 80386 flat-memory mode.
|
|
||||||
* On less brain-damaged CPUs this symbol must not be defined.
|
|
||||||
* (Defining this symbol causes large data structures to be referenced through
|
|
||||||
* "far" pointers and to be allocated with a special version of malloc.)
|
|
||||||
*/
|
|
||||||
#undef NEED_FAR_POINTERS
|
|
||||||
|
|
||||||
/* Define this if your linker needs global names to be unique in less
|
|
||||||
* than the first 15 characters.
|
|
||||||
*/
|
|
||||||
#undef NEED_SHORT_EXTERNAL_NAMES
|
|
||||||
|
|
||||||
/* Although a real ANSI C compiler can deal perfectly well with pointers to
|
|
||||||
* unspecified structures (see "incomplete types" in the spec), a few pre-ANSI
|
|
||||||
* and pseudo-ANSI compilers get confused. To keep one of these bozos happy,
|
|
||||||
* define INCOMPLETE_TYPES_BROKEN. This is not recommended unless you
|
|
||||||
* actually get "missing structure definition" warnings or errors while
|
|
||||||
* compiling the JPEG code.
|
|
||||||
*/
|
|
||||||
#undef INCOMPLETE_TYPES_BROKEN
|
|
||||||
|
|
||||||
/* Define "boolean" as unsigned char, not int, on Windows systems.
|
|
||||||
*/
|
|
||||||
#ifdef _WIN32
|
|
||||||
#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
|
|
||||||
typedef unsigned char boolean;
|
|
||||||
#endif
|
|
||||||
#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following options affect code selection within the JPEG library,
|
|
||||||
* but they don't need to be visible to applications using the library.
|
|
||||||
* To minimize application namespace pollution, the symbols won't be
|
|
||||||
* defined unless JPEG_INTERNALS has been defined.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef JPEG_INTERNALS
|
|
||||||
|
|
||||||
/* Define this if your compiler implements ">>" on signed values as a logical
|
|
||||||
* (unsigned) shift; leave it undefined if ">>" is a signed (arithmetic) shift,
|
|
||||||
* which is the normal and rational definition.
|
|
||||||
*/
|
|
||||||
#undef RIGHT_SHIFT_IS_UNSIGNED
|
|
||||||
|
|
||||||
/* These are for configuring the JPEG memory manager. */
|
|
||||||
#define DEFAULT_MAX_MEM 1073741824 /*1Gb*/
|
|
||||||
|
|
||||||
#if !defined WIN32 && !defined _WIN32
|
|
||||||
#define INLINE __inline__
|
|
||||||
#undef NO_MKTEMP
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* JPEG_INTERNALS */
|
|
||||||
|
|
||||||
#define JDCT_DEFAULT JDCT_FLOAT
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The remaining options do not affect the JPEG library proper,
|
|
||||||
* but only the sample applications cjpeg/djpeg (see cjpeg.c, djpeg.c).
|
|
||||||
* Other applications can ignore these.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef JPEG_CJPEG_DJPEG
|
|
||||||
|
|
||||||
/* These defines indicate which image (non-JPEG) file formats are allowed. */
|
|
||||||
|
|
||||||
#define BMP_SUPPORTED /* BMP image file format */
|
|
||||||
#define GIF_SUPPORTED /* GIF image file format */
|
|
||||||
#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
|
|
||||||
#undef RLE_SUPPORTED /* Utah RLE image file format */
|
|
||||||
#define TARGA_SUPPORTED /* Targa image file format */
|
|
||||||
|
|
||||||
/* Define this if you want to name both input and output files on the command
|
|
||||||
* line, rather than using stdout and optionally stdin. You MUST do this if
|
|
||||||
* your system can't cope with binary I/O to stdin/stdout. See comments at
|
|
||||||
* head of cjpeg.c or djpeg.c.
|
|
||||||
*/
|
|
||||||
#if defined WIN32 || defined _WIN32
|
|
||||||
#define TWO_FILE_COMMANDLINE /* optional */
|
|
||||||
#define USE_SETMODE /* Microsoft has setmode() */
|
|
||||||
#else
|
|
||||||
#undef TWO_FILE_COMMANDLINE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Define this if your system needs explicit cleanup of temporary files.
|
|
||||||
* This is crucial under MS-DOS, where the temporary "files" may be areas
|
|
||||||
* of extended memory; on most other systems it's not as important.
|
|
||||||
*/
|
|
||||||
#undef NEED_SIGNAL_CATCHER
|
|
||||||
|
|
||||||
/* By default, we open image files with fopen(...,"rb") or fopen(...,"wb").
|
|
||||||
* This is necessary on systems that distinguish text files from binary files,
|
|
||||||
* and is harmless on most systems that don't. If you have one of the rare
|
|
||||||
* systems that complains about the "b" spec, define this symbol.
|
|
||||||
*/
|
|
||||||
#undef DONT_USE_B_MODE
|
|
||||||
|
|
||||||
/* Define this if you want percent-done progress reports from cjpeg/djpeg.
|
|
||||||
*/
|
|
||||||
#undef PROGRESS_REPORT
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* JPEG_CJPEG_DJPEG */
|
|
||||||
|
|
@ -1,453 +0,0 @@
|
||||||
/*
|
|
||||||
* jmorecfg.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
|
||||||
* Modified 1997-2013 by Guido Vollbeding.
|
|
||||||
* This file is part of the Independent JPEG Group's software.
|
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
|
||||||
*
|
|
||||||
* This file contains additional configuration options that customize the
|
|
||||||
* JPEG software for special applications or support machine-dependent
|
|
||||||
* optimizations. Most users will not need to touch this file.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Define BITS_IN_JSAMPLE as either
|
|
||||||
* 8 for 8-bit sample values (the usual setting)
|
|
||||||
* 9 for 9-bit sample values
|
|
||||||
* 10 for 10-bit sample values
|
|
||||||
* 11 for 11-bit sample values
|
|
||||||
* 12 for 12-bit sample values
|
|
||||||
* Only 8, 9, 10, 11, and 12 bits sample data precision are supported for
|
|
||||||
* full-feature DCT processing. Further depths up to 16-bit may be added
|
|
||||||
* later for the lossless modes of operation.
|
|
||||||
* Run-time selection and conversion of data precision will be added later
|
|
||||||
* and are currently not supported, sorry.
|
|
||||||
* Exception: The transcoding part (jpegtran) supports all settings in a
|
|
||||||
* single instance, since it operates on the level of DCT coefficients and
|
|
||||||
* not sample values. The DCT coefficients are of the same type (16 bits)
|
|
||||||
* in all cases (see below).
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define BITS_IN_JSAMPLE 8 /* use 8, 9, 10, 11, or 12 */
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Maximum number of components (color channels) allowed in JPEG image.
|
|
||||||
* To meet the letter of the JPEG spec, set this to 255. However, darn
|
|
||||||
* few applications need more than 4 channels (maybe 5 for CMYK + alpha
|
|
||||||
* mask). We recommend 10 as a reasonable compromise; use 4 if you are
|
|
||||||
* really short on memory. (Each allowed component costs a hundred or so
|
|
||||||
* bytes of storage, whether actually used in an image or not.)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MAX_COMPONENTS 10 /* maximum number of image components */
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Basic data types.
|
|
||||||
* You may need to change these if you have a machine with unusual data
|
|
||||||
* type sizes; for example, "char" not 8 bits, "short" not 16 bits,
|
|
||||||
* or "long" not 32 bits. We don't care whether "int" is 16 or 32 bits,
|
|
||||||
* but it had better be at least 16.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Representation of a single sample (pixel element value).
|
|
||||||
* We frequently allocate large arrays of these, so it's important to keep
|
|
||||||
* them small. But if you have memory to burn and access to char or short
|
|
||||||
* arrays is very slow on your hardware, you might want to change these.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if BITS_IN_JSAMPLE == 8
|
|
||||||
/* JSAMPLE should be the smallest type that will hold the values 0..255.
|
|
||||||
* You can use a signed char by having GETJSAMPLE mask it with 0xFF.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef HAVE_UNSIGNED_CHAR
|
|
||||||
|
|
||||||
typedef unsigned char JSAMPLE;
|
|
||||||
#define GETJSAMPLE(value) ((int) (value))
|
|
||||||
|
|
||||||
#else /* not HAVE_UNSIGNED_CHAR */
|
|
||||||
|
|
||||||
typedef char JSAMPLE;
|
|
||||||
#ifdef CHAR_IS_UNSIGNED
|
|
||||||
#define GETJSAMPLE(value) ((int) (value))
|
|
||||||
#else
|
|
||||||
#define GETJSAMPLE(value) ((int) (value) & 0xFF)
|
|
||||||
#endif /* CHAR_IS_UNSIGNED */
|
|
||||||
|
|
||||||
#endif /* HAVE_UNSIGNED_CHAR */
|
|
||||||
|
|
||||||
#define MAXJSAMPLE 255
|
|
||||||
#define CENTERJSAMPLE 128
|
|
||||||
|
|
||||||
#endif /* BITS_IN_JSAMPLE == 8 */
|
|
||||||
|
|
||||||
|
|
||||||
#if BITS_IN_JSAMPLE == 9
|
|
||||||
/* JSAMPLE should be the smallest type that will hold the values 0..511.
|
|
||||||
* On nearly all machines "short" will do nicely.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef short JSAMPLE;
|
|
||||||
#define GETJSAMPLE(value) ((int) (value))
|
|
||||||
|
|
||||||
#define MAXJSAMPLE 511
|
|
||||||
#define CENTERJSAMPLE 256
|
|
||||||
|
|
||||||
#endif /* BITS_IN_JSAMPLE == 9 */
|
|
||||||
|
|
||||||
|
|
||||||
#if BITS_IN_JSAMPLE == 10
|
|
||||||
/* JSAMPLE should be the smallest type that will hold the values 0..1023.
|
|
||||||
* On nearly all machines "short" will do nicely.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef short JSAMPLE;
|
|
||||||
#define GETJSAMPLE(value) ((int) (value))
|
|
||||||
|
|
||||||
#define MAXJSAMPLE 1023
|
|
||||||
#define CENTERJSAMPLE 512
|
|
||||||
|
|
||||||
#endif /* BITS_IN_JSAMPLE == 10 */
|
|
||||||
|
|
||||||
|
|
||||||
#if BITS_IN_JSAMPLE == 11
|
|
||||||
/* JSAMPLE should be the smallest type that will hold the values 0..2047.
|
|
||||||
* On nearly all machines "short" will do nicely.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef short JSAMPLE;
|
|
||||||
#define GETJSAMPLE(value) ((int) (value))
|
|
||||||
|
|
||||||
#define MAXJSAMPLE 2047
|
|
||||||
#define CENTERJSAMPLE 1024
|
|
||||||
|
|
||||||
#endif /* BITS_IN_JSAMPLE == 11 */
|
|
||||||
|
|
||||||
|
|
||||||
#if BITS_IN_JSAMPLE == 12
|
|
||||||
/* JSAMPLE should be the smallest type that will hold the values 0..4095.
|
|
||||||
* On nearly all machines "short" will do nicely.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef short JSAMPLE;
|
|
||||||
#define GETJSAMPLE(value) ((int) (value))
|
|
||||||
|
|
||||||
#define MAXJSAMPLE 4095
|
|
||||||
#define CENTERJSAMPLE 2048
|
|
||||||
|
|
||||||
#endif /* BITS_IN_JSAMPLE == 12 */
|
|
||||||
|
|
||||||
|
|
||||||
/* Representation of a DCT frequency coefficient.
|
|
||||||
* This should be a signed value of at least 16 bits; "short" is usually OK.
|
|
||||||
* Again, we allocate large arrays of these, but you can change to int
|
|
||||||
* if you have memory to burn and "short" is really slow.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef short JCOEF;
|
|
||||||
|
|
||||||
|
|
||||||
/* Compressed datastreams are represented as arrays of JOCTET.
|
|
||||||
* These must be EXACTLY 8 bits wide, at least once they are written to
|
|
||||||
* external storage. Note that when using the stdio data source/destination
|
|
||||||
* managers, this is also the data type passed to fread/fwrite.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef HAVE_UNSIGNED_CHAR
|
|
||||||
|
|
||||||
typedef unsigned char JOCTET;
|
|
||||||
#define GETJOCTET(value) (value)
|
|
||||||
|
|
||||||
#else /* not HAVE_UNSIGNED_CHAR */
|
|
||||||
|
|
||||||
typedef char JOCTET;
|
|
||||||
#ifdef CHAR_IS_UNSIGNED
|
|
||||||
#define GETJOCTET(value) (value)
|
|
||||||
#else
|
|
||||||
#define GETJOCTET(value) ((value) & 0xFF)
|
|
||||||
#endif /* CHAR_IS_UNSIGNED */
|
|
||||||
|
|
||||||
#endif /* HAVE_UNSIGNED_CHAR */
|
|
||||||
|
|
||||||
|
|
||||||
/* These typedefs are used for various table entries and so forth.
|
|
||||||
* They must be at least as wide as specified; but making them too big
|
|
||||||
* won't cost a huge amount of memory, so we don't provide special
|
|
||||||
* extraction code like we did for JSAMPLE. (In other words, these
|
|
||||||
* typedefs live at a different point on the speed/space tradeoff curve.)
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* UINT8 must hold at least the values 0..255. */
|
|
||||||
|
|
||||||
#ifdef HAVE_UNSIGNED_CHAR
|
|
||||||
typedef unsigned char UINT8;
|
|
||||||
#else /* not HAVE_UNSIGNED_CHAR */
|
|
||||||
#ifdef CHAR_IS_UNSIGNED
|
|
||||||
typedef char UINT8;
|
|
||||||
#else /* not CHAR_IS_UNSIGNED */
|
|
||||||
typedef short UINT8;
|
|
||||||
#endif /* CHAR_IS_UNSIGNED */
|
|
||||||
#endif /* HAVE_UNSIGNED_CHAR */
|
|
||||||
|
|
||||||
/* UINT16 must hold at least the values 0..65535. */
|
|
||||||
|
|
||||||
#ifdef HAVE_UNSIGNED_SHORT
|
|
||||||
typedef unsigned short UINT16;
|
|
||||||
#else /* not HAVE_UNSIGNED_SHORT */
|
|
||||||
typedef unsigned int UINT16;
|
|
||||||
#endif /* HAVE_UNSIGNED_SHORT */
|
|
||||||
|
|
||||||
/* INT16 must hold at least the values -32768..32767. */
|
|
||||||
|
|
||||||
#ifndef XMD_H /* X11/xmd.h correctly defines INT16 */
|
|
||||||
typedef short INT16;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* INT32 must hold at least signed 32-bit values. */
|
|
||||||
|
|
||||||
#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */
|
|
||||||
#ifndef _BASETSD_H_ /* Microsoft defines it in basetsd.h */
|
|
||||||
#ifndef _BASETSD_H /* MinGW is slightly different */
|
|
||||||
#ifndef QGLOBAL_H /* Qt defines it in qglobal.h */
|
|
||||||
typedef long INT32;
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Datatype used for image dimensions. The JPEG standard only supports
|
|
||||||
* images up to 64K*64K due to 16-bit fields in SOF markers. Therefore
|
|
||||||
* "unsigned int" is sufficient on all machines. However, if you need to
|
|
||||||
* handle larger images and you don't mind deviating from the spec, you
|
|
||||||
* can change this datatype.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef unsigned int JDIMENSION;
|
|
||||||
|
|
||||||
#define JPEG_MAX_DIMENSION 65500L /* a tad under 64K to prevent overflows */
|
|
||||||
|
|
||||||
|
|
||||||
/* These macros are used in all function definitions and extern declarations.
|
|
||||||
* You could modify them if you need to change function linkage conventions;
|
|
||||||
* in particular, you'll need to do that to make the library a Windows DLL.
|
|
||||||
* Another application is to make all functions global for use with debuggers
|
|
||||||
* or code profilers that require it.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* a function called through method pointers: */
|
|
||||||
#define METHODDEF(type) static type
|
|
||||||
/* a function used only in its module: */
|
|
||||||
#define LOCAL(type) static type
|
|
||||||
/* a function referenced thru EXTERNs: */
|
|
||||||
#define GLOBAL(type) type
|
|
||||||
/* a reference to a GLOBAL function: */
|
|
||||||
#define EXTERN(type) extern type
|
|
||||||
|
|
||||||
|
|
||||||
/* This macro is used to declare a "method", that is, a function pointer.
|
|
||||||
* We want to supply prototype parameters if the compiler can cope.
|
|
||||||
* Note that the arglist parameter must be parenthesized!
|
|
||||||
* Again, you can customize this if you need special linkage keywords.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef HAVE_PROTOTYPES
|
|
||||||
#define JMETHOD(type,methodname,arglist) type (*methodname) arglist
|
|
||||||
#else
|
|
||||||
#define JMETHOD(type,methodname,arglist) type (*methodname) ()
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* The noreturn type identifier is used to declare functions
|
|
||||||
* which cannot return.
|
|
||||||
* Compilers can thus create more optimized code and perform
|
|
||||||
* better checks for warnings and errors.
|
|
||||||
* Static analyzer tools can make improved inferences about
|
|
||||||
* execution paths and are prevented from giving false alerts.
|
|
||||||
*
|
|
||||||
* Unfortunately, the proposed specifications of corresponding
|
|
||||||
* extensions in the Dec 2011 ISO C standard revision (C11),
|
|
||||||
* GCC, MSVC, etc. are not viable.
|
|
||||||
* Thus we introduce a user defined type to declare noreturn
|
|
||||||
* functions at least for clarity. A proper compiler would
|
|
||||||
* have a suitable noreturn type to match in place of void.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef HAVE_NORETURN_T
|
|
||||||
typedef void noreturn_t;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* Here is the pseudo-keyword for declaring pointers that must be "far"
|
|
||||||
* on 80x86 machines. Most of the specialized coding for 80x86 is handled
|
|
||||||
* by just saying "FAR *" where such a pointer is needed. In a few places
|
|
||||||
* explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef FAR
|
|
||||||
#ifdef NEED_FAR_POINTERS
|
|
||||||
#define FAR far
|
|
||||||
#else
|
|
||||||
#define FAR
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* On a few systems, type boolean and/or its values FALSE, TRUE may appear
|
|
||||||
* in standard header files. Or you may have conflicts with application-
|
|
||||||
* specific header files that you want to include together with these files.
|
|
||||||
* Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef HAVE_BOOLEAN
|
|
||||||
#if defined FALSE || defined TRUE || defined QGLOBAL_H
|
|
||||||
/* Qt3 defines FALSE and TRUE as "const" variables in qglobal.h */
|
|
||||||
typedef int boolean;
|
|
||||||
#ifndef FALSE /* in case these macros already exist */
|
|
||||||
#define FALSE 0 /* values of boolean */
|
|
||||||
#endif
|
|
||||||
#ifndef TRUE
|
|
||||||
#define TRUE 1
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
typedef enum { FALSE = 0, TRUE = 1 } boolean;
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#ifndef FALSE /* in case these macros already exist */
|
|
||||||
#define FALSE 0 /* values of boolean */
|
|
||||||
#endif
|
|
||||||
#ifndef TRUE
|
|
||||||
#define TRUE 1
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The remaining options affect code selection within the JPEG library,
|
|
||||||
* but they don't need to be visible to most applications using the library.
|
|
||||||
* To minimize application namespace pollution, the symbols won't be
|
|
||||||
* defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef JPEG_INTERNALS
|
|
||||||
#define JPEG_INTERNAL_OPTIONS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef JPEG_INTERNAL_OPTIONS
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* These defines indicate whether to include various optional functions.
|
|
||||||
* Undefining some of these symbols will produce a smaller but less capable
|
|
||||||
* library. Note that you can leave certain source files out of the
|
|
||||||
* compilation/linking process if you've #undef'd the corresponding symbols.
|
|
||||||
* (You may HAVE to do that if your compiler doesn't like null source files.)
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Capability options common to encoder and decoder: */
|
|
||||||
|
|
||||||
#define DCT_ISLOW_SUPPORTED /* slow but accurate integer algorithm */
|
|
||||||
#define DCT_IFAST_SUPPORTED /* faster, less accurate integer method */
|
|
||||||
#define DCT_FLOAT_SUPPORTED /* floating-point: accurate, fast on fast HW */
|
|
||||||
|
|
||||||
/* Encoder capability options: */
|
|
||||||
|
|
||||||
#define C_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */
|
|
||||||
#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
|
|
||||||
#define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
|
|
||||||
#define DCT_SCALING_SUPPORTED /* Input rescaling via DCT? (Requires DCT_ISLOW)*/
|
|
||||||
#define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */
|
|
||||||
/* Note: if you selected more than 8-bit data precision, it is dangerous to
|
|
||||||
* turn off ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only
|
|
||||||
* good for 8-bit precision, so arithmetic coding is recommended for higher
|
|
||||||
* precision. The Huffman encoder normally uses entropy optimization to
|
|
||||||
* compute usable tables for higher precision. Otherwise, you'll have to
|
|
||||||
* supply different default Huffman tables.
|
|
||||||
* The exact same statements apply for progressive JPEG: the default tables
|
|
||||||
* don't work for progressive mode. (This may get fixed, however.)
|
|
||||||
*/
|
|
||||||
#define INPUT_SMOOTHING_SUPPORTED /* Input image smoothing option? */
|
|
||||||
|
|
||||||
/* Decoder capability options: */
|
|
||||||
|
|
||||||
#define D_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */
|
|
||||||
#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
|
|
||||||
#define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
|
|
||||||
#define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? (Requires DCT_ISLOW)*/
|
|
||||||
#define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */
|
|
||||||
#define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */
|
|
||||||
#undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */
|
|
||||||
#define UPSAMPLE_MERGING_SUPPORTED /* Fast path for sloppy upsampling? */
|
|
||||||
#define QUANT_1PASS_SUPPORTED /* 1-pass color quantization? */
|
|
||||||
#define QUANT_2PASS_SUPPORTED /* 2-pass color quantization? */
|
|
||||||
|
|
||||||
/* more capability options later, no doubt */
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Ordering of RGB data in scanlines passed to or from the application.
|
|
||||||
* If your application wants to deal with data in the order B,G,R, just
|
|
||||||
* change these macros. You can also deal with formats such as R,G,B,X
|
|
||||||
* (one extra byte per pixel) by changing RGB_PIXELSIZE. Note that changing
|
|
||||||
* the offsets will also change the order in which colormap data is organized.
|
|
||||||
* RESTRICTIONS:
|
|
||||||
* 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats.
|
|
||||||
* 2. The color quantizer modules will not behave desirably if RGB_PIXELSIZE
|
|
||||||
* is not 3 (they don't understand about dummy color components!). So you
|
|
||||||
* can't use color quantization if you change that value.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define RGB_RED 0 /* Offset of Red in an RGB scanline element */
|
|
||||||
#define RGB_GREEN 1 /* Offset of Green */
|
|
||||||
#define RGB_BLUE 2 /* Offset of Blue */
|
|
||||||
#define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */
|
|
||||||
|
|
||||||
|
|
||||||
/* Definitions for speed-related optimizations. */
|
|
||||||
|
|
||||||
|
|
||||||
/* If your compiler supports inline functions, define INLINE
|
|
||||||
* as the inline keyword; otherwise define it as empty.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef INLINE
|
|
||||||
#ifdef __GNUC__ /* for instance, GNU C knows about inline */
|
|
||||||
#define INLINE __inline__
|
|
||||||
#endif
|
|
||||||
#ifndef INLINE
|
|
||||||
#define INLINE /* default is to define it as empty */
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* On some machines (notably 68000 series) "int" is 32 bits, but multiplying
|
|
||||||
* two 16-bit shorts is faster than multiplying two ints. Define MULTIPLIER
|
|
||||||
* as short on such a machine. MULTIPLIER must be at least 16 bits wide.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MULTIPLIER
|
|
||||||
#define MULTIPLIER int /* type for fastest integer multiply */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* FAST_FLOAT should be either float or double, whichever is done faster
|
|
||||||
* by your compiler. (Note that this type is only used in the floating point
|
|
||||||
* DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.)
|
|
||||||
* Typically, float is faster in ANSI C compilers, while double is faster in
|
|
||||||
* pre-ANSI compilers (because they insist on converting to double anyway).
|
|
||||||
* The code below therefore chooses float if we have ANSI-style prototypes.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef FAST_FLOAT
|
|
||||||
#ifdef HAVE_PROTOTYPES
|
|
||||||
#define FAST_FLOAT float
|
|
||||||
#else
|
|
||||||
#define FAST_FLOAT double
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* JPEG_INTERNAL_OPTIONS */
|
|
||||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -1,187 +0,0 @@
|
||||||
#ifndef POSTPROCESS_H
|
|
||||||
#define POSTPROCESS_H
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include "nn_sdk.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct __box
|
|
||||||
{
|
|
||||||
float x;
|
|
||||||
float y;
|
|
||||||
float w;
|
|
||||||
float h;
|
|
||||||
float score;
|
|
||||||
float objectClass;
|
|
||||||
}detBox;
|
|
||||||
|
|
||||||
typedef struct __point
|
|
||||||
{
|
|
||||||
float x;
|
|
||||||
float y;
|
|
||||||
}point_t;
|
|
||||||
|
|
||||||
typedef struct{
|
|
||||||
int index;
|
|
||||||
int classId;
|
|
||||||
float **probs;
|
|
||||||
} sortable_bbox;
|
|
||||||
|
|
||||||
typedef struct{
|
|
||||||
float x, y;
|
|
||||||
} landmark;
|
|
||||||
|
|
||||||
typedef struct{
|
|
||||||
float x, y, w, h, prob_obj;
|
|
||||||
} box;
|
|
||||||
|
|
||||||
typedef struct plate_box_{
|
|
||||||
float x, y, w, h;
|
|
||||||
}plate_box;
|
|
||||||
|
|
||||||
typedef struct{
|
|
||||||
int index;
|
|
||||||
int classId;
|
|
||||||
float probs; //**probs to probs
|
|
||||||
} sortable_bbox_plate;
|
|
||||||
|
|
||||||
/*=================================================
|
|
||||||
output of aml_module_t type:IMAGE_CLASSIFY
|
|
||||||
score: top 5 class confidence
|
|
||||||
top: the class of top 5
|
|
||||||
=================================================*/
|
|
||||||
typedef struct __nn_image_classify
|
|
||||||
{
|
|
||||||
float score[5];
|
|
||||||
unsigned int topClass[5];
|
|
||||||
}img_classify_out_t;
|
|
||||||
|
|
||||||
/*=================================================
|
|
||||||
output of aml_module_t type:OBJECT_DETECT
|
|
||||||
detNum: the number of object detect
|
|
||||||
pBox: the object info detect
|
|
||||||
=================================================*/
|
|
||||||
typedef struct __nn_obj_detect
|
|
||||||
{
|
|
||||||
unsigned int detNum;
|
|
||||||
detBox *pBox;
|
|
||||||
}obj_detect_out_t;
|
|
||||||
|
|
||||||
/*=================================================
|
|
||||||
output of aml_module_t type:FACE_DETECTION
|
|
||||||
detNum: the number of face detect
|
|
||||||
pBox: the face info detect
|
|
||||||
=================================================*/
|
|
||||||
typedef struct __nn_face_detect
|
|
||||||
{
|
|
||||||
unsigned int detNum;
|
|
||||||
detBox pBox[MAX_DETECT_NUM];
|
|
||||||
}face_detect_out_t;
|
|
||||||
|
|
||||||
/*=================================================
|
|
||||||
output of aml_module_t type:FACE_LANDMARK_5
|
|
||||||
pos value:
|
|
||||||
0:left-eye,
|
|
||||||
1:right-eye,
|
|
||||||
2:nose,
|
|
||||||
3:left-mouth,
|
|
||||||
4:right-mouth
|
|
||||||
=================================================*/
|
|
||||||
typedef struct __nn_face_landmark_5
|
|
||||||
{
|
|
||||||
unsigned int detNum;
|
|
||||||
detBox facebox[MAX_DETECT_NUM];
|
|
||||||
point_t pos[MAX_DETECT_NUM][5];
|
|
||||||
}face_landmark5_out_t;
|
|
||||||
|
|
||||||
/*=================================================
|
|
||||||
output of aml_module_t type:FACE_RECOGNIZE
|
|
||||||
faceVector: the vector generate by input face,
|
|
||||||
can recognized by this vector
|
|
||||||
=================================================*/
|
|
||||||
typedef struct __nn_face_recognize
|
|
||||||
{
|
|
||||||
float faceVector[512];
|
|
||||||
}face_recognize_out_t;
|
|
||||||
|
|
||||||
/*=================================================
|
|
||||||
output of aml_module_t type:YOLO_V3
|
|
||||||
detNum: the number of object detect
|
|
||||||
pBox: the object info detect
|
|
||||||
=================================================*/
|
|
||||||
typedef struct __nn_yolov3
|
|
||||||
{
|
|
||||||
unsigned int detNum;
|
|
||||||
detBox *pBox;
|
|
||||||
}yolov3_out_t;
|
|
||||||
|
|
||||||
/*=================================================
|
|
||||||
output of aml_module_t type:YOLO_V5
|
|
||||||
detNum: the number of object detect
|
|
||||||
pBox: the object info detect
|
|
||||||
=================================================*/
|
|
||||||
typedef struct __nn_yolov5
|
|
||||||
{
|
|
||||||
unsigned int detNum;
|
|
||||||
detBox *pBox;
|
|
||||||
}yolov5_out_t;
|
|
||||||
|
|
||||||
/*=================================================
|
|
||||||
output of aml_module_t type:HEAD_DETECTION
|
|
||||||
the return value are detect region for these type.
|
|
||||||
=================================================*/
|
|
||||||
typedef struct __nn_head_detect
|
|
||||||
{
|
|
||||||
obj_detect_out_t headOut;
|
|
||||||
}head_det_out_t;
|
|
||||||
|
|
||||||
/*=================================================
|
|
||||||
output of aml_module_t type:PERSON_DETECT
|
|
||||||
detNum: the number of person detect
|
|
||||||
pBox: the person info detect
|
|
||||||
=================================================*/
|
|
||||||
typedef struct __nn_person_detect
|
|
||||||
{
|
|
||||||
unsigned int detNum;
|
|
||||||
detBox pBox[MAX_DETECT_NUM];
|
|
||||||
}person_detect_out_t;
|
|
||||||
|
|
||||||
typedef struct __nn_plate_detect
|
|
||||||
{
|
|
||||||
unsigned int detNum;
|
|
||||||
float score;
|
|
||||||
detBox pBox[MAX_DETECT_NUM];
|
|
||||||
point_t pos[MAX_DETECT_NUM][4];
|
|
||||||
}plate_det_out_t;
|
|
||||||
|
|
||||||
|
|
||||||
void* process_top5_f32(float *buf, unsigned int num);
|
|
||||||
void* process_top5_i8(int8_t *buf, unsigned int num);
|
|
||||||
void* process_top5_u8(uint8_t *buf, unsigned int num);
|
|
||||||
void process_top5_i8_sta_top15(int8_t *buf,int num, int zeroPoint, float scale, unsigned int label, int *top1_ture, int *top5_ture);
|
|
||||||
|
|
||||||
void* postprocess_object_detect(nn_output *pout);
|
|
||||||
void* postprocess_yolov3(nn_output *pout);
|
|
||||||
void *postprocess_yolov3_dequant(nn_output *pout);
|
|
||||||
void* postprocess_yolov5s(nn_output *pout);
|
|
||||||
void* postprocess_yolov5s_dequant(nn_output *pout);
|
|
||||||
|
|
||||||
void* postprocess_faceland5(nn_output *pout);
|
|
||||||
void* postprocess_faceland5_dequant(nn_output *pout);
|
|
||||||
|
|
||||||
void* postprocess_headdet(nn_output *pout);
|
|
||||||
|
|
||||||
void* postprocess_person_detect(nn_output *pout);
|
|
||||||
|
|
||||||
void* postprocess_plate_detect(nn_output *pout);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} //extern "C"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // POSTPROCESS_H
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
#ifndef UTILS_H
|
|
||||||
#define UTILS_H
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
unsigned char *get_jpeg_rawData(const char *name,unsigned int width,unsigned int height);
|
|
||||||
void *read_file(const char *file_path, int *file_size);
|
|
||||||
int find_max_index(float *buf, unsigned int length);
|
|
||||||
void save_file(void * buffer, const char *file_path, unsigned int file_size);
|
|
||||||
double cosine_similarity(char *file1, char *file2, int file_size);
|
|
||||||
int bmp_read(const char *filename, int *nRGB, int *xsize, int *ysize);
|
|
||||||
void data_to_fp32(float *new_buffer, unsigned char *old_buffer, int sz, float scale, int zero_point, int type);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} //extern "C"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // UTILS_H
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue