mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-10-24 02:09:03 +03:00
This is a complete rewrite of the math in swscale/utils.c initFilter(), using
floating point math and with a bit more polished UI and internals. I have
also included a substantial number of improvements, including a method to
numerically compute the true filter support size from the parameters, and a
more robust logic for the edge conditions. The upshot of these changes is
that the filter weight computation is now much simpler and faster, and with
fewer edge cases.
I copy/pasted the actual underlying kernel functions from libplacebo, so this
math is already quite battle-tested. I made some adjustments to the defaults
to align with the existing defaults in libswscale, for backwards compatibility.
Note that this commit introduces a lot more filter kernels than what we
actually expose; but they are cheap to carry around, don't take up binary
space, and will probably save some poor soul from incorrectly reimplementing
them in the future. Plus, I have plans to expand the list of functions down
the line, so it makes sense to just define them all, even if we don't
necessarily use them yet.
Backported-from: 475b11b2e0
Since this depended on changes to the public swscale API, I have instead
added the necessary enums/defines to filters.h itself for now.
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
53 lines
2.5 KiB
Makefile
53 lines
2.5 KiB
Makefile
NAME = swscale
|
|
DESC = FFmpeg image rescaling library
|
|
|
|
HEADERS = swscale.h \
|
|
version.h \
|
|
version_major.h \
|
|
|
|
OBJS = alphablend.o \
|
|
cms.o \
|
|
csputils.o \
|
|
hscale.o \
|
|
hscale_fast_bilinear.o \
|
|
filters.o \
|
|
format.o \
|
|
gamma.o \
|
|
graph.o \
|
|
input.o \
|
|
lut3d.o \
|
|
options.o \
|
|
output.o \
|
|
rgb2rgb.o \
|
|
slice.o \
|
|
swscale.o \
|
|
swscale_unscaled.o \
|
|
utils.o \
|
|
version.o \
|
|
yuv2rgb.o \
|
|
vscale.o \
|
|
|
|
OBJS-$(CONFIG_UNSTABLE) += \
|
|
ops.o \
|
|
ops_backend.o \
|
|
ops_chain.o \
|
|
ops_dispatch.o \
|
|
ops_memcpy.o \
|
|
ops_optimizer.o \
|
|
|
|
ifeq ($(CONFIG_UNSTABLE),yes)
|
|
include $(SRC_PATH)/libswscale/vulkan/Makefile
|
|
endif
|
|
|
|
# Objects duplicated from other libraries for shared builds
|
|
SHLIBOBJS += log2_tab.o half2float.o
|
|
|
|
# Windows resource file
|
|
SHLIBOBJS-$(HAVE_GNU_WINDRES) += swscaleres.o
|
|
|
|
TESTPROGS = colorspace \
|
|
floatimg_cmp \
|
|
pixdesc_query \
|
|
swscale \
|
|
sws_ops \
|