Refactored to use new TurboJPEG API and new BMP library + additional cleanup. There is no legacy code remaining, so the refactored version of the program has been re-licensed under a BSD-style license.
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@629 632fc199-4ca6-4c93-a231-07263d6284db
This commit is contained in:
@@ -77,11 +77,14 @@ TSTHDRS = rrutil.h rrtimer.h
|
||||
bin_PROGRAMS = cjpeg djpeg jpegtran rdjpgcom wrjpgcom jpgtest
|
||||
noinst_PROGRAMS = jpegut
|
||||
|
||||
jpgtest_SOURCES = $(TSTHDRS) jpgtest.c bmp.h bmp.c
|
||||
jpgtest_SOURCES = $(TSTHDRS) jpgtest.c bmp.h bmp.c tjutil.h tjutil.c \
|
||||
rdbmp.c rdppm.c wrbmp.c wrppm.c
|
||||
|
||||
jpgtest_LDADD = libturbojpeg.la -lm
|
||||
jpgtest_LDADD = libturbojpeg.la libjpeg.la -lm
|
||||
|
||||
jpegut_SOURCES = $(TSTHDRS) jpegut.c bmp.h bmp.c tjutil.h tjutil.c
|
||||
jpgtest_CFLAGS = -DBMP_SUPPORTED -DPPM_SUPPORTED
|
||||
|
||||
jpegut_SOURCES = $(TSTHDRS) jpegut.c tjutil.h tjutil.c
|
||||
|
||||
jpegut_LDADD = libturbojpeg.la
|
||||
|
||||
|
||||
50
rrtimer.h
50
rrtimer.h
@@ -1,50 +0,0 @@
|
||||
/* Copyright (C)2004 Landmark Graphics Corporation
|
||||
* Copyright (C)2005 Sun Microsystems, Inc.
|
||||
*
|
||||
* This library is free software and may be redistributed and/or modified under
|
||||
* the terms of the wxWindows Library License, Version 3.1 or (at your option)
|
||||
* any later version. The full license is in the LICENSE.txt file included
|
||||
* with this distribution.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* wxWindows Library License for more details.
|
||||
*/
|
||||
|
||||
#ifndef __RRTIMER_H__
|
||||
#define __RRTIMER_H__
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
__inline double rrtime(void)
|
||||
{
|
||||
LARGE_INTEGER Frequency, Time;
|
||||
if(QueryPerformanceFrequency(&Frequency)!=0)
|
||||
{
|
||||
QueryPerformanceCounter(&Time);
|
||||
return (double)Time.QuadPart/(double)Frequency.QuadPart;
|
||||
}
|
||||
else return (double)GetTickCount()*0.001;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include <sys/time.h>
|
||||
|
||||
#ifdef sun
|
||||
#define __inline inline
|
||||
#endif
|
||||
|
||||
static __inline double rrtime(void)
|
||||
{
|
||||
struct timeval __tv;
|
||||
gettimeofday(&__tv, (struct timezone *)NULL);
|
||||
return((double)__tv.tv_sec+(double)__tv.tv_usec*0.000001);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
62
rrutil.h
62
rrutil.h
@@ -1,62 +0,0 @@
|
||||
/* Copyright (C)2004 Landmark Graphics Corporation
|
||||
* Copyright (C)2005 Sun Microsystems, Inc.
|
||||
* Copyright (C)2010 D. R. Commander
|
||||
*
|
||||
* This library is free software and may be redistributed and/or modified under
|
||||
* the terms of the wxWindows Library License, Version 3.1 or (at your option)
|
||||
* any later version. The full license is in the LICENSE.txt file included
|
||||
* with this distribution.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* wxWindows Library License for more details.
|
||||
*/
|
||||
|
||||
#ifndef __RRUTIL_H__
|
||||
#define __RRUTIL_H__
|
||||
|
||||
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||
#include <stdio.h>
|
||||
#define snprintf(str, n, format, ...) \
|
||||
_snprintf_s(str, n, _TRUNCATE, format, __VA_ARGS__)
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#define stricmp strcasecmp
|
||||
#define strnicmp strncasecmp
|
||||
#endif
|
||||
|
||||
#ifndef min
|
||||
#define min(a,b) ((a)<(b)?(a):(b))
|
||||
#endif
|
||||
|
||||
#ifndef max
|
||||
#define max(a,b) ((a)>(b)?(a):(b))
|
||||
#endif
|
||||
|
||||
#define pow2(i) (1<<(i))
|
||||
#define isPow2(x) (((x)&(x-1))==0)
|
||||
|
||||
#ifdef sun
|
||||
#define __inline inline
|
||||
#endif
|
||||
|
||||
#define byteswap(i) ( \
|
||||
(((i) & 0xff000000) >> 24) | \
|
||||
(((i) & 0x00ff0000) >> 8) | \
|
||||
(((i) & 0x0000ff00) << 8) | \
|
||||
(((i) & 0x000000ff) << 24) )
|
||||
|
||||
#define byteswap16(i) ( \
|
||||
(((i) & 0xff00) >> 8) | \
|
||||
(((i) & 0x00ff) << 8) )
|
||||
|
||||
static __inline int littleendian(void)
|
||||
{
|
||||
unsigned int value=1;
|
||||
unsigned char *ptr=(unsigned char *)(&value);
|
||||
if(ptr[0]==1 && ptr[3]==0) return 1;
|
||||
else return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user