aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/module.mk9
-rw-r--r--common/scaler.cpp6
-rw-r--r--common/scaler.h3
3 files changed, 16 insertions, 2 deletions
diff --git a/common/module.mk b/common/module.mk
index 83177bcfee..9d455e153a 100644
--- a/common/module.mk
+++ b/common/module.mk
@@ -18,13 +18,16 @@ MODULE_OBJS += \
common/scaler.o \
common/scaler/2xsai.o \
common/scaler/aspect.o \
- common/scaler/hq2x.o \
- common/scaler/hq3x.o \
common/scaler/scale2x.o \
common/scaler/scale3x.o \
common/scaler/scalebit.o \
common/scaler/thumbnail.o
+ifndef DISABLE_HQ_SCALERS
+MODULE_OBJS += \
+ common/scaler/hq2x.o \
+ common/scaler/hq3x.o
+
ifdef HAVE_NASM
MODULE_OBJS += \
common/scaler/hq2x_i386.o \
@@ -33,6 +36,8 @@ endif
endif
+endif
+
MODULE_DIRS += \
common \
common/scaler
diff --git a/common/scaler.cpp b/common/scaler.cpp
index db37cc72bd..0d059f84ec 100644
--- a/common/scaler.cpp
+++ b/common/scaler.cpp
@@ -27,6 +27,7 @@
int gBitFormat = 565;
+#ifndef DISABLE_HQ_SCALERS
// RGB-to-YUV lookup table
extern "C" {
@@ -71,6 +72,7 @@ uint RGBtoYUVstorage[65536];
uint *RGBtoYUV = RGBtoYUVstorage;
uint LUT16to32[65536];
}
+#endif
static const uint16 dotmatrix_565[16] = {
0x01E0, 0x0007, 0x3800, 0x0000,
@@ -101,6 +103,9 @@ void InitScalers(uint32 BitFormat) {
InitLUT(BitFormat);
}
+#ifdef DISABLE_HQ_SCALERS
+void InitLUT(uint32 BitFormat) {}
+#else
void InitLUT(uint32 BitFormat) {
int r, g, b;
int Y, u, v;
@@ -129,6 +134,7 @@ void InitLUT(uint32 BitFormat) {
}
}
}
+#endif
/**
* Trivial 'scaler' - in fact it doesn't do any scaling but just copies the
diff --git a/common/scaler.h b/common/scaler.h
index 37f7be99ff..10d7e1161d 100644
--- a/common/scaler.h
+++ b/common/scaler.h
@@ -45,8 +45,11 @@ DECLARE_SCALER(Normal3x);
DECLARE_SCALER(Normal1o5x);
DECLARE_SCALER(TV2x);
DECLARE_SCALER(DotMatrix);
+
+#ifndef DISABLE_HQ_SCALERS
DECLARE_SCALER(HQ2x);
DECLARE_SCALER(HQ3x);
+#endif
FORCEINLINE int real2Aspect(int y) {
return y + (y + 1) / 5;