diff mbox series

[FFmpeg-devel,06/18] postproc/postprocess: Don't generally include arch-specific headers

Message ID AS8P250MB0744EDAEBA3973A135F3BAF18F3B2@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit 7d9d400695552d98408107c11bf488ea9a161c57
Headers show
Series [FFmpeg-devel,01/18] avcodec/mips/ac3dsp_mips: Add missing includes | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt March 28, 2024, 11:10 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libpostproc/postprocess.c          | 3 ++-
 libpostproc/postprocess_template.c | 5 ++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

Comments

Sean McGovern March 29, 2024, 2:54 p.m. UTC | #1
Andreas:

On Thu, Mar 28, 2024 at 7:11 PM Andreas Rheinhardt
<andreas.rheinhardt@outlook.com> wrote:
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  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"
> --
> 2.40.1
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

OK, looks good to me.

-- Sean McGovern
diff mbox series

Patch

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"