COMMON: Move cosine/sine tables out of header files
Access is now restricted to using the getSineTable()/getCosineTable() helper functions.
This commit is contained in:
parent
54f25aa843
commit
6334ec413f
9 changed files with 16566 additions and 16527 deletions
8274
common/cosinetables.cpp
Normal file
8274
common/cosinetables.cpp
Normal file
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -26,6 +26,7 @@
|
||||||
// Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
|
// Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
|
||||||
// Copyright (c) 2010 Vitor Sessak
|
// Copyright (c) 2010 Vitor Sessak
|
||||||
|
|
||||||
|
#include "common/cosinetables.h"
|
||||||
#include "common/dct.h"
|
#include "common/dct.h"
|
||||||
|
|
||||||
namespace Common {
|
namespace Common {
|
||||||
|
|
|
@ -1,44 +0,0 @@
|
||||||
/* ScummVM - Graphic Adventure Engine
|
|
||||||
*
|
|
||||||
* ScummVM is the legal property of its developers, whose names
|
|
||||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
||||||
* file distributed with this source distribution.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License
|
|
||||||
* as published by the Free Software Foundation; either version 2
|
|
||||||
* of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
* This program 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
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Based on eos' math code
|
|
||||||
|
|
||||||
#include "common/math.h"
|
|
||||||
|
|
||||||
#include "common/sinetables.h"
|
|
||||||
#include "common/cosinetables.h"
|
|
||||||
|
|
||||||
namespace Common {
|
|
||||||
|
|
||||||
const float *getSineTable(int bits) {
|
|
||||||
assert((bits >= 4) && (bits <= 16));
|
|
||||||
|
|
||||||
return sinTables[bits];
|
|
||||||
}
|
|
||||||
|
|
||||||
const float *getCosineTable(int bits) {
|
|
||||||
assert((bits >= 4) && (bits <= 16));
|
|
||||||
|
|
||||||
return cosTables[bits];
|
|
||||||
}
|
|
||||||
|
|
||||||
} // End of namespace Common
|
|
|
@ -50,9 +50,6 @@ struct Complex {
|
||||||
float re, im;
|
float re, im;
|
||||||
};
|
};
|
||||||
|
|
||||||
const float *getSineTable(int bits);
|
|
||||||
const float *getCosineTable(int bits);
|
|
||||||
|
|
||||||
// See http://graphics.stanford.edu/~seander/bithacks.html#IntegerLogLookup
|
// See http://graphics.stanford.edu/~seander/bithacks.html#IntegerLogLookup
|
||||||
static const char LogTable256[256] = {
|
static const char LogTable256[256] = {
|
||||||
#define LT(n) n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n
|
#define LT(n) n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n
|
||||||
|
|
|
@ -38,11 +38,12 @@ MODULE_OBJS := \
|
||||||
ifdef USE_BINK
|
ifdef USE_BINK
|
||||||
MODULE_OBJS += \
|
MODULE_OBJS += \
|
||||||
bitstream.o \
|
bitstream.o \
|
||||||
|
cosinetables.o \
|
||||||
dct.o \
|
dct.o \
|
||||||
fft.o \
|
fft.o \
|
||||||
huffman.o \
|
huffman.o \
|
||||||
math.o \
|
rdft.o \
|
||||||
rdft.o
|
sinetables.o
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Include common rules
|
# Include common rules
|
||||||
|
|
|
@ -25,6 +25,8 @@
|
||||||
// Copyright (c) 2009 Alex Converse <alex dot converse at gmail dot com>
|
// Copyright (c) 2009 Alex Converse <alex dot converse at gmail dot com>
|
||||||
|
|
||||||
#include "common/rdft.h"
|
#include "common/rdft.h"
|
||||||
|
#include "common/cosinetables.h"
|
||||||
|
#include "common/sinetables.h"
|
||||||
|
|
||||||
namespace Common {
|
namespace Common {
|
||||||
|
|
||||||
|
|
8274
common/sinetables.cpp
Normal file
8274
common/sinetables.cpp
Normal file
File diff suppressed because it is too large
Load diff
8245
common/sinetables.h
8245
common/sinetables.h
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue