From 7d9d400695552d98408107c11bf488ea9a161c57 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Thu, 28 Mar 2024 16:08:36 +0100 Subject: [PATCH] postproc/postprocess: Don't generally include arch-specific headers Reviewed-by: Sean McGovern Signed-off-by: Andreas Rheinhardt --- libpostproc/postprocess.c | 3 ++- libpostproc/postprocess_template.c | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c index 0586e458b4..8f4de8b1e1 100644 --- a/libpostproc/postprocess.c +++ b/libpostproc/postprocess.c @@ -88,7 +88,6 @@ try to unroll inner for(x=0 ... loop to avoid these damn if(x ... checks #include "postprocess.h" #include "postprocess_internal.h" #include "libavutil/avstring.h" -#include "libavutil/ppc/util_altivec.h" #define GET_MODE_BUFFER_SIZE 500 #define OPTIONS_ARRAY_SIZE 10 @@ -499,6 +498,8 @@ static av_always_inline void do_a_deblock_C(uint8_t *src, int step, #include "postprocess_template.c" #if HAVE_ALTIVEC +#include "libavutil/ppc/util_altivec.h" + # define TEMPLATE_PP_ALTIVEC 1 # include "postprocess_altivec_template.c" # include "postprocess_template.c" diff --git a/libpostproc/postprocess_template.c b/libpostproc/postprocess_template.c index ade1d6ce2b..d56b45d3b4 100644 --- a/libpostproc/postprocess_template.c +++ b/libpostproc/postprocess_template.c @@ -22,9 +22,12 @@ * @file * mmx/mmx2/sse2 postprocess code. */ +#include "config.h" #include "libavutil/mem_internal.h" +#if ARCH_X86 #include "libavutil/x86/asm.h" +#endif /* A single TEMPLATE_PP_* should be defined (to 1) when this template is * included. The following macros will define its dependencies to 1 as well @@ -830,7 +833,7 @@ static inline void RENAME(doVertDefFilter)(uint8_t src[], int stride, PPContext #if !TEMPLATE_PP_ALTIVEC static inline void RENAME(dering)(uint8_t src[], int stride, PPContext *c) { -#if HAVE_7REGS && TEMPLATE_PP_MMXEXT +#if TEMPLATE_PP_MMXEXT && HAVE_7REGS DECLARE_ALIGNED(8, uint64_t, tmp)[3]; __asm__ volatile( "pxor %%mm6, %%mm6 \n\t"