Files
FFmpeg/libswscale/x86/Makefile
Andreas Rheinhardt 2d3776b8cc avutil/x86/emms: Unavpriv avpriv_emms_asm()
This fallback function is used if external MMX is available,
while inline MMX and intrinsics for emitting emms are unavailable.
It is implemented as an avpriv function, which has several
drawbacks for shared builds:
1. The function is so small (3 bytes; 16 with padding)
that the overhead of exporting and importing it dwarfs
the gains from code deduplication.
2. A call to an external library has more overhead than
a library-internal one.
3. It may cause linking failures when a libavutil not exporting
avpriv_emms_asm() is paired with a library needing it
(if inline assembly and intrinsics were unavailable when building
the dependent library). I am not aware of this ever happening.
4. We would be forced to keep avpriv_emms_asm() around for ABI stability
even after it is no longer needed.

This commit therefore uses the STLIBOBJS, SHLIBOBJS approach
to duplicating it into each library on its own if needed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-06-23 19:15:57 +02:00

37 lines
1.8 KiB
Makefile

OBJS += x86/rgb2rgb.o \
x86/swscale.o \
x86/yuv2rgb.o \
OBJS-$(HAVE_MMXEXT_INLINE) += x86/hscale_fast_bilinear_simd.o \
OBJS-$(CONFIG_XMM_CLOBBER_TEST) += x86/w64xmmtest.o
EMMS_OBJS_$(HAVE_MMX_INLINE)_$(HAVE_MMX_EXTERNAL)_$(HAVE_MM_EMPTY) = x86/emms.o
# Add internal copy of ff_emms() to swscale for shared builds (if needed).
SHLIBOBJS += $(EMMS_OBJS__yes_)
X86ASM-OBJS += x86/input.o \
x86/output.o \
x86/scale.o \
x86/scale_avx2.o \
x86/range_convert.o \
x86/rgb_2_rgb.o \
x86/yuv_2_rgb.o \
x86/yuv2yuvX.o \
SKIPHEADERS += x86/uops_macros.asm.h
ifdef ARCH_X86_64
X86ASM-OBJS-$(CONFIG_UNSTABLE) += x86/ops_common.o \
x86/ops_int.o \
x86/ops_float.o \
x86/ops.o
$(SUBDIR)x86/ops_common.o: $(SUBDIR)x86/uops_macros.gen.asm
$(SUBDIR)x86/ops_int.o: $(SUBDIR)x86/uops_macros.gen.asm
$(SUBDIR)x86/ops_float.o: $(SUBDIR)x86/uops_macros.gen.asm
$(SUBDIR)x86/uops_macros.gen.asm: $(SRC_PATH)/libswscale/x86/uops_macros.asm.h \
$(SRC_PATH)/libswscale/uops_macros.h
$(HOSTCC) $(HOSTCC_E) $(CPPFLAGS) $<
endif