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:
Matthew Hoops 2011-07-19 00:41:21 -04:00
parent 54f25aa843
commit 6334ec413f
9 changed files with 16566 additions and 16527 deletions

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

View File

@ -26,6 +26,7 @@
// Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
// Copyright (c) 2010 Vitor Sessak
#include "common/cosinetables.h"
#include "common/dct.h"
namespace Common {

View File

@ -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

View File

@ -50,9 +50,6 @@ struct Complex {
float re, im;
};
const float *getSineTable(int bits);
const float *getCosineTable(int bits);
// See http://graphics.stanford.edu/~seander/bithacks.html#IntegerLogLookup
static const char LogTable256[256] = {
#define LT(n) n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n

View File

@ -38,11 +38,12 @@ MODULE_OBJS := \
ifdef USE_BINK
MODULE_OBJS += \
bitstream.o \
cosinetables.o \
dct.o \
fft.o \
huffman.o \
math.o \
rdft.o
rdft.o \
sinetables.o
endif
# Include common rules

View File

@ -25,6 +25,8 @@
// Copyright (c) 2009 Alex Converse <alex dot converse at gmail dot com>
#include "common/rdft.h"
#include "common/cosinetables.h"
#include "common/sinetables.h"
namespace Common {

8274
common/sinetables.cpp Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff