[FFmpeg-devel] [PATCH v3] swscale: Allow the max filter size to be set at compile time

Derek Buitenhuis derek.buitenhuis at gmail.com
Thu Jun 12 15:12:19 CEST 2014


This can help "extreme" resizes, e.g with some 4k stuff.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
---
 configure                     | 6 ++++++
 libswscale/swscale_internal.h | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index fa66c4f..5a76fed 100755
--- a/configure
+++ b/configure
@@ -314,6 +314,7 @@ Advanced options (experts only):
                            (faster, but may crash)
   --enable-memalign-hack   emulate memalign, interferes with memory debuggers
   --enable-sram            allow use of on-chip SRAM
+  --sws-max-filter-size=N  the max filter size swscale uses [$sws_max_filter_size_default]
 
 Optimization options (experts only):
   --disable-asm            disable all assembler optimizations
@@ -1892,6 +1893,7 @@ CMDLINE_SET="
     ranlib
     samples
     strip
+    sws_max_filter_size
     sysinclude
     sysroot
     target_exec
@@ -2646,6 +2648,9 @@ enable safe_bitstream_reader
 enable static
 enable swscale_alpha
 
+sws_max_filter_size_default=256
+set_default sws_max_filter_size
+
 # Enable hwaccels by default.
 enable dxva2 vaapi vda vdpau xvmc
 enable xlib
@@ -5451,6 +5456,7 @@ cat > $TMPH <<EOF
 #define BUILDSUF "$build_suffix"
 #define SLIBSUF "$SLIBSUF"
 #define HAVE_MMX2 HAVE_MMXEXT
+#define SWS_MAX_FILTER_SIZE $sws_max_filter_size
 EOF
 
 test -n "$assert_level" &&
diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index 42a17e5..8cf4317 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -39,7 +39,7 @@
 
 #define YUVRGB_TABLE_HEADROOM 128
 
-#define MAX_FILTER_SIZE 256
+#define MAX_FILTER_SIZE SWS_MAX_FILTER_SIZE
 
 #define DITHER1XBPP
 
-- 
2.0.0



More information about the ffmpeg-devel mailing list