Blame patches/ffmpeg-5.1.local.patch

a5db05
diff -ru ffmpeg-5.1.orig/libavcodec/x86/cabac.h ffmpeg-5.1/libavcodec/x86/cabac.h
a5db05
--- ffmpeg-5.1.orig/libavcodec/x86/cabac.h	2022-07-22 19:58:39.000000000 +0200
a5db05
+++ ffmpeg-5.1/libavcodec/x86/cabac.h	2022-08-21 12:11:42.010806805 +0200
a5db05
@@ -145,12 +145,12 @@
a5db05
         "movzbl "statep"    , "ret"                                     \n\t"\
a5db05
         "mov    "range"     , "tmp"                                     \n\t"\
a5db05
         "and    $0xC0       , "range"                                   \n\t"\
a5db05
-        "movzbl "MANGLE(ff_h264_cabac_tables)"+"lps_off"("ret", "range", 2), "range" \n\t"\
a5db05
+        "movzbl "LOCAL_MANGLE(ff_h264_cabac_tables)"+"lps_off"("ret", "range", 2), "range" \n\t"\
a5db05
         "sub    "range"     , "tmp"                                     \n\t"\
a5db05
         BRANCHLESS_GET_CABAC_UPDATE(ret, low, range, tmp)                    \
a5db05
-        "movzbl "MANGLE(ff_h264_cabac_tables)"+"norm_off"("range"), %%ecx    \n\t"\
a5db05
+        "movzbl "LOCAL_MANGLE(ff_h264_cabac_tables)"+"norm_off"("range"), %%ecx    \n\t"\
a5db05
         "shl    %%cl        , "range"                                   \n\t"\
a5db05
-        "movzbl "MANGLE(ff_h264_cabac_tables)"+"mlps_off"+128("ret"), "tmp"  \n\t"\
a5db05
+        "movzbl "LOCAL_MANGLE(ff_h264_cabac_tables)"+"mlps_off"+128("ret"), "tmp"  \n\t"\
a5db05
         "shl    %%cl        , "low"                                     \n\t"\
a5db05
         "mov    "tmpbyte"   , "statep"                                  \n\t"\
a5db05
         "test   "lowword"   , "lowword"                                 \n\t"\
a5db05
@@ -165,7 +165,7 @@
a5db05
         "shr    $15         , %%ecx                                     \n\t"\
a5db05
         "bswap  "tmp"                                                   \n\t"\
a5db05
         "shr    $15         , "tmp"                                     \n\t"\
a5db05
-        "movzbl "MANGLE(ff_h264_cabac_tables)"+"norm_off"(%%ecx), %%ecx \n\t"\
a5db05
+        "movzbl "LOCAL_MANGLE(ff_h264_cabac_tables)"+"norm_off"(%%ecx), %%ecx \n\t"\
a5db05
         "sub    $0xFFFF     , "tmp"                                     \n\t"\
a5db05
         "neg    %%ecx                                                   \n\t"\
a5db05
         "add    $7          , %%ecx                                     \n\t"\
a5db05
@@ -190,7 +190,7 @@
a5db05
     void *tables;
a5db05
 
a5db05
     __asm__ volatile(
a5db05
-        "lea    "MANGLE(ff_h264_cabac_tables)", %0      \n\t"
a5db05
+        "lea    "LOCAL_MANGLE(ff_h264_cabac_tables)", %0      \n\t"
a5db05
         : "=&r"(tables)
a5db05
         : NAMED_CONSTRAINTS_ARRAY(ff_h264_cabac_tables)
a5db05
     );
a5db05
diff -ru ffmpeg-5.1.orig/libavcodec/x86/cavsdsp.c ffmpeg-5.1/libavcodec/x86/cavsdsp.c
a5db05
--- ffmpeg-5.1.orig/libavcodec/x86/cavsdsp.c	2022-07-22 19:58:39.000000000 +0200
a5db05
+++ ffmpeg-5.1/libavcodec/x86/cavsdsp.c	2022-08-21 12:11:42.010806805 +0200
a5db05
@@ -61,9 +61,9 @@
a5db05
 #define QPEL_CAVSV1(A,B,C,D,E,F,OP,ADD, MUL1, MUL2) \
a5db05
         "movd (%0), "#F"            \n\t"\
a5db05
         "movq "#C", %%mm6           \n\t"\
a5db05
-        "pmullw "MANGLE(MUL1)", %%mm6\n\t"\
a5db05
+        "pmullw "LOCAL_MANGLE(MUL1)", %%mm6\n\t"\
a5db05
         "movq "#D", %%mm7           \n\t"\
a5db05
-        "pmullw "MANGLE(MUL2)", %%mm7\n\t"\
a5db05
+        "pmullw "LOCAL_MANGLE(MUL2)", %%mm7\n\t"\
a5db05
         "psllw $3, "#E"             \n\t"\
a5db05
         "psubw "#E", %%mm6          \n\t"\
a5db05
         "psraw $3, "#E"             \n\t"\
a5db05
@@ -76,7 +76,7 @@
a5db05
         "psubw "#B", %%mm6          \n\t"\
a5db05
         "psraw $1, "#B"             \n\t"\
a5db05
         "psubw "#A", %%mm6          \n\t"\
a5db05
-        "paddw "MANGLE(ADD)", %%mm6 \n\t"\
a5db05
+        "paddw "LOCAL_MANGLE(ADD)", %%mm6 \n\t"\
a5db05
         "psraw $7, %%mm6            \n\t"\
a5db05
         "packuswb %%mm6, %%mm6      \n\t"\
a5db05
         OP(%%mm6, (%1), A, d)            \
a5db05
@@ -87,12 +87,12 @@
a5db05
         "movd (%0), "#F"            \n\t"\
a5db05
         "movq "#C", %%mm6           \n\t"\
a5db05
         "paddw "#D", %%mm6          \n\t"\
a5db05
-        "pmullw "MANGLE(MUL1)", %%mm6\n\t"\
a5db05
+        "pmullw "LOCAL_MANGLE(MUL1)", %%mm6\n\t"\
a5db05
         "add %2, %0                 \n\t"\
a5db05
         "punpcklbw %%mm7, "#F"      \n\t"\
a5db05
         "psubw "#B", %%mm6          \n\t"\
a5db05
         "psubw "#E", %%mm6          \n\t"\
a5db05
-        "paddw "MANGLE(ADD)", %%mm6 \n\t"\
a5db05
+        "paddw "LOCAL_MANGLE(ADD)", %%mm6 \n\t"\
a5db05
         "psraw $3, %%mm6            \n\t"\
a5db05
         "packuswb %%mm6, %%mm6      \n\t"\
a5db05
         OP(%%mm6, (%1), A, d)            \
a5db05
@@ -102,9 +102,9 @@
a5db05
 #define QPEL_CAVSV3(A,B,C,D,E,F,OP,ADD, MUL1, MUL2) \
a5db05
         "movd (%0), "#F"            \n\t"\
a5db05
         "movq "#C", %%mm6           \n\t"\
a5db05
-        "pmullw "MANGLE(MUL2)", %%mm6\n\t"\
a5db05
+        "pmullw "LOCAL_MANGLE(MUL2)", %%mm6\n\t"\
a5db05
         "movq "#D", %%mm7           \n\t"\
a5db05
-        "pmullw "MANGLE(MUL1)", %%mm7\n\t"\
a5db05
+        "pmullw "LOCAL_MANGLE(MUL1)", %%mm7\n\t"\
a5db05
         "psllw $3, "#B"             \n\t"\
a5db05
         "psubw "#B", %%mm6          \n\t"\
a5db05
         "psraw $3, "#B"             \n\t"\
a5db05
@@ -117,7 +117,7 @@
a5db05
         "psubw "#E", %%mm6          \n\t"\
a5db05
         "psraw $1, "#E"             \n\t"\
a5db05
         "psubw "#F", %%mm6          \n\t"\
a5db05
-        "paddw "MANGLE(ADD)", %%mm6 \n\t"\
a5db05
+        "paddw "LOCAL_MANGLE(ADD)", %%mm6 \n\t"\
a5db05
         "psraw $7, %%mm6            \n\t"\
a5db05
         "packuswb %%mm6, %%mm6      \n\t"\
a5db05
         OP(%%mm6, (%1), A, d)            \
a5db05
@@ -187,7 +187,7 @@
a5db05
     int h=8;\
a5db05
     __asm__ volatile(\
a5db05
         "pxor %%mm7, %%mm7          \n\t"\
a5db05
-        "movq "MANGLE(ff_pw_5)", %%mm6\n\t"\
a5db05
+        "movq "LOCAL_MANGLE(ff_pw_5)", %%mm6\n\t"\
a5db05
         "1:                         \n\t"\
a5db05
         "movq    (%0), %%mm0        \n\t"\
a5db05
         "movq   1(%0), %%mm2        \n\t"\
a5db05
@@ -213,7 +213,7 @@
a5db05
         "paddw %%mm3, %%mm5         \n\t"\
a5db05
         "psubw %%mm2, %%mm0         \n\t"\
a5db05
         "psubw %%mm5, %%mm1         \n\t"\
a5db05
-        "movq "MANGLE(ff_pw_4)", %%mm5\n\t"\
a5db05
+        "movq "LOCAL_MANGLE(ff_pw_4)", %%mm5\n\t"\
a5db05
         "paddw %%mm5, %%mm0         \n\t"\
a5db05
         "paddw %%mm5, %%mm1         \n\t"\
a5db05
         "psraw $3, %%mm0            \n\t"\
a5db05
diff -ru ffmpeg-5.1.orig/libavcodec/x86/h264_cabac.c ffmpeg-5.1/libavcodec/x86/h264_cabac.c
a5db05
--- ffmpeg-5.1.orig/libavcodec/x86/h264_cabac.c	2022-07-22 19:58:39.000000000 +0200
a5db05
+++ ffmpeg-5.1/libavcodec/x86/h264_cabac.c	2022-08-21 12:11:41.986806805 +0200
a5db05
@@ -56,7 +56,7 @@
a5db05
     void *tables;
a5db05
 
a5db05
     __asm__ volatile(
a5db05
-        "lea   "MANGLE(ff_h264_cabac_tables)", %0      \n\t"
a5db05
+        "lea   "LOCAL_MANGLE(ff_h264_cabac_tables)", %0      \n\t"
a5db05
         : "=&r"(tables)
a5db05
         : NAMED_CONSTRAINTS_ARRAY(ff_h264_cabac_tables)
a5db05
     );
a5db05
@@ -132,7 +132,7 @@
a5db05
     void *tables;
a5db05
 
a5db05
     __asm__ volatile(
a5db05
-        "lea    "MANGLE(ff_h264_cabac_tables)", %0      \n\t"
a5db05
+        "lea    "LOCAL_MANGLE(ff_h264_cabac_tables)", %0      \n\t"
a5db05
         : "=&r"(tables)
a5db05
         : NAMED_CONSTRAINTS_ARRAY(ff_h264_cabac_tables)
a5db05
     );
a5db05
@@ -161,7 +161,7 @@
a5db05
 #ifdef BROKEN_RELOCATIONS
a5db05
         "movzb %c14(%15, %q6), %6\n\t"
a5db05
 #else
a5db05
-        "movzb "MANGLE(ff_h264_cabac_tables)"+%c14(%6), %6\n\t"
a5db05
+        "movzb "LOCAL_MANGLE(ff_h264_cabac_tables)"+%c14(%6), %6\n\t"
a5db05
 #endif
a5db05
         "add %11, %6                            \n\t"
a5db05
 
a5db05
diff -ru ffmpeg-5.1.orig/libavcodec/x86/lpc.c ffmpeg-5.1/libavcodec/x86/lpc.c
a5db05
--- ffmpeg-5.1.orig/libavcodec/x86/lpc.c	2022-07-22 19:58:39.000000000 +0200
a5db05
+++ ffmpeg-5.1/libavcodec/x86/lpc.c	2022-08-21 12:11:41.774806812 +0200
a5db05
@@ -40,8 +40,8 @@
a5db05
     x86_reg j =  n2*sizeof(int32_t);
a5db05
     __asm__ volatile(
a5db05
         "movsd   %4,     %%xmm7                \n\t"
a5db05
-        "movapd  "MANGLE(pd_1)", %%xmm6        \n\t"
a5db05
-        "movapd  "MANGLE(pd_2)", %%xmm5        \n\t"
a5db05
+        "movapd  "LOCAL_MANGLE(pd_1)", %%xmm6        \n\t"
a5db05
+        "movapd  "LOCAL_MANGLE(pd_2)", %%xmm5        \n\t"
a5db05
         "movlhps %%xmm7, %%xmm7                \n\t"
a5db05
         "subpd   %%xmm5, %%xmm7                \n\t"
a5db05
         "addsd   %%xmm6, %%xmm7                \n\t"
a5db05
@@ -91,9 +91,9 @@
a5db05
         x86_reg i = -len*sizeof(double);
a5db05
         if(j == lag-2) {
a5db05
             __asm__ volatile(
a5db05
-                "movsd    "MANGLE(pd_1)", %%xmm0    \n\t"
a5db05
-                "movsd    "MANGLE(pd_1)", %%xmm1    \n\t"
a5db05
-                "movsd    "MANGLE(pd_1)", %%xmm2    \n\t"
a5db05
+                "movsd    "LOCAL_MANGLE(pd_1)", %%xmm0    \n\t"
a5db05
+                "movsd    "LOCAL_MANGLE(pd_1)", %%xmm1    \n\t"
a5db05
+                "movsd    "LOCAL_MANGLE(pd_1)", %%xmm2    \n\t"
a5db05
                 "1:                                 \n\t"
a5db05
                 "movapd   (%2,%0), %%xmm3           \n\t"
a5db05
                 "movupd -8(%3,%0), %%xmm4           \n\t"
a5db05
@@ -122,8 +122,8 @@
a5db05
             );
a5db05
         } else {
a5db05
             __asm__ volatile(
a5db05
-                "movsd    "MANGLE(pd_1)", %%xmm0    \n\t"
a5db05
-                "movsd    "MANGLE(pd_1)", %%xmm1    \n\t"
a5db05
+                "movsd    "LOCAL_MANGLE(pd_1)", %%xmm0    \n\t"
a5db05
+                "movsd    "LOCAL_MANGLE(pd_1)", %%xmm1    \n\t"
a5db05
                 "1:                                 \n\t"
a5db05
                 "movapd   (%3,%0), %%xmm3           \n\t"
a5db05
                 "movupd -8(%4,%0), %%xmm4           \n\t"
a5db05
diff -ru ffmpeg-5.1.orig/libavcodec/x86/mlpdsp_init.c ffmpeg-5.1/libavcodec/x86/mlpdsp_init.c
a5db05
--- ffmpeg-5.1.orig/libavcodec/x86/mlpdsp_init.c	2022-07-22 19:58:39.000000000 +0200
a5db05
+++ ffmpeg-5.1/libavcodec/x86/mlpdsp_init.c	2022-08-21 12:11:42.286806796 +0200
a5db05
@@ -47,21 +47,25 @@
a5db05
 
a5db05
 #if HAVE_7REGS && HAVE_INLINE_ASM && HAVE_INLINE_ASM_NONLOCAL_LABELS
a5db05
 
a5db05
-extern char ff_mlp_firorder_8;
a5db05
-extern char ff_mlp_firorder_7;
a5db05
-extern char ff_mlp_firorder_6;
a5db05
-extern char ff_mlp_firorder_5;
a5db05
-extern char ff_mlp_firorder_4;
a5db05
-extern char ff_mlp_firorder_3;
a5db05
-extern char ff_mlp_firorder_2;
a5db05
-extern char ff_mlp_firorder_1;
a5db05
-extern char ff_mlp_firorder_0;
a5db05
+#ifndef ATTR_HIDDEN
a5db05
+#define ATTR_HIDDEN __attribute__((visibility("hidden")))
a5db05
+#endif
a5db05
 
a5db05
-extern char ff_mlp_iirorder_4;
a5db05
-extern char ff_mlp_iirorder_3;
a5db05
-extern char ff_mlp_iirorder_2;
a5db05
-extern char ff_mlp_iirorder_1;
a5db05
-extern char ff_mlp_iirorder_0;
a5db05
+extern char ATTR_HIDDEN ff_mlp_firorder_8;
a5db05
+extern char ATTR_HIDDEN ff_mlp_firorder_7;
a5db05
+extern char ATTR_HIDDEN ff_mlp_firorder_6;
a5db05
+extern char ATTR_HIDDEN ff_mlp_firorder_5;
a5db05
+extern char ATTR_HIDDEN ff_mlp_firorder_4;
a5db05
+extern char ATTR_HIDDEN ff_mlp_firorder_3;
a5db05
+extern char ATTR_HIDDEN ff_mlp_firorder_2;
a5db05
+extern char ATTR_HIDDEN ff_mlp_firorder_1;
a5db05
+extern char ATTR_HIDDEN ff_mlp_firorder_0;
a5db05
+
a5db05
+extern char ATTR_HIDDEN ff_mlp_iirorder_4;
a5db05
+extern char ATTR_HIDDEN ff_mlp_iirorder_3;
a5db05
+extern char ATTR_HIDDEN ff_mlp_iirorder_2;
a5db05
+extern char ATTR_HIDDEN ff_mlp_iirorder_1;
a5db05
+extern char ATTR_HIDDEN ff_mlp_iirorder_0;
a5db05
 
a5db05
 static const void * const firtable[9] = { &ff_mlp_firorder_0, &ff_mlp_firorder_1,
a5db05
                                           &ff_mlp_firorder_2, &ff_mlp_firorder_3,
a5db05
diff -ru ffmpeg-5.1.orig/libavcodec/x86/vc1dsp_mmx.c ffmpeg-5.1/libavcodec/x86/vc1dsp_mmx.c
a5db05
--- ffmpeg-5.1.orig/libavcodec/x86/vc1dsp_mmx.c	2022-07-22 19:58:39.000000000 +0200
a5db05
+++ ffmpeg-5.1/libavcodec/x86/vc1dsp_mmx.c	2022-08-21 12:11:42.010806805 +0200
a5db05
@@ -86,7 +86,7 @@
a5db05
     __asm__ volatile(\
a5db05
         "mov       $8, %%"FF_REG_c"        \n\t"\
a5db05
         LOAD_ROUNDER_MMX("%5")\
a5db05
-        "movq      "MANGLE(ff_pw_9)", %%mm6\n\t"\
a5db05
+        "movq      "LOCAL_MANGLE(ff_pw_9)", %%mm6\n\t"\
a5db05
         "1:                                \n\t"\
a5db05
         "movd      0(%0   ), %%mm3         \n\t"\
a5db05
         "movd      4(%0   ), %%mm4         \n\t"\
a5db05
@@ -147,8 +147,8 @@
a5db05
      MOVQ "*4+"A1", %%mm2       \n\t"                           \
a5db05
      UNPACK("%%mm1")                                            \
a5db05
      UNPACK("%%mm2")                                            \
a5db05
-     "pmullw    "MANGLE(ff_pw_3)", %%mm1\n\t"                   \
a5db05
-     "pmullw    "MANGLE(ff_pw_3)", %%mm2\n\t"                   \
a5db05
+     "pmullw    "LOCAL_MANGLE(ff_pw_3)", %%mm1\n\t"                   \
a5db05
+     "pmullw    "LOCAL_MANGLE(ff_pw_3)", %%mm2\n\t"                   \
a5db05
      MOVQ "*0+"A2", %%mm3       \n\t"                           \
a5db05
      MOVQ "*4+"A2", %%mm4       \n\t"                           \
a5db05
      UNPACK("%%mm3")                                            \
a5db05
@@ -192,8 +192,8 @@
a5db05
     src -= src_stride;                                                  \
a5db05
     __asm__ volatile(                                                       \
a5db05
         LOAD_ROUNDER_MMX("%5")                                          \
a5db05
-        "movq      "MANGLE(ff_pw_53)", %%mm5\n\t"                       \
a5db05
-        "movq      "MANGLE(ff_pw_18)", %%mm6\n\t"                       \
a5db05
+        "movq      "LOCAL_MANGLE(ff_pw_53)", %%mm5\n\t"                       \
a5db05
+        "movq      "LOCAL_MANGLE(ff_pw_18)", %%mm6\n\t"                       \
a5db05
         ".p2align 3                \n\t"                                \
a5db05
         "1:                        \n\t"                                \
a5db05
         MSPEL_FILTER13_CORE(DO_UNPACK, "movd  1", A1, A2, A3, A4)       \
a5db05
@@ -249,15 +249,15 @@
a5db05
     rnd -= (-4+58+13-3)*256; /* Add -256 bias */                        \
a5db05
     __asm__ volatile(                                                       \
a5db05
         LOAD_ROUNDER_MMX("%4")                                          \
a5db05
-        "movq      "MANGLE(ff_pw_18)", %%mm6   \n\t"                    \
a5db05
-        "movq      "MANGLE(ff_pw_53)", %%mm5   \n\t"                    \
a5db05
+        "movq      "LOCAL_MANGLE(ff_pw_18)", %%mm6   \n\t"                    \
a5db05
+        "movq      "LOCAL_MANGLE(ff_pw_53)", %%mm5   \n\t"                    \
a5db05
         ".p2align 3                \n\t"                                \
a5db05
         "1:                        \n\t"                                \
a5db05
         MSPEL_FILTER13_CORE(DONT_UNPACK, "movq 2", A1, A2, A3, A4)      \
a5db05
         NORMALIZE_MMX("$7")                                             \
a5db05
         /* Remove bias */                                               \
a5db05
-        "paddw     "MANGLE(ff_pw_128)", %%mm3  \n\t"                    \
a5db05
-        "paddw     "MANGLE(ff_pw_128)", %%mm4  \n\t"                    \
a5db05
+        "paddw     "LOCAL_MANGLE(ff_pw_128)", %%mm3  \n\t"                    \
a5db05
+        "paddw     "LOCAL_MANGLE(ff_pw_128)", %%mm4  \n\t"                    \
a5db05
         TRANSFER_DO_PACK(OP)                                            \
a5db05
         "add       $24, %1         \n\t"                                \
a5db05
         "add       %3, %2          \n\t"                                \
a5db05
@@ -288,8 +288,8 @@
a5db05
     rnd = 32-rnd;                                                       \
a5db05
     __asm__ volatile (                                                      \
a5db05
         LOAD_ROUNDER_MMX("%6")                                          \
a5db05
-        "movq      "MANGLE(ff_pw_53)", %%mm5       \n\t"                \
a5db05
-        "movq      "MANGLE(ff_pw_18)", %%mm6       \n\t"                \
a5db05
+        "movq      "LOCAL_MANGLE(ff_pw_53)", %%mm5       \n\t"                \
a5db05
+        "movq      "LOCAL_MANGLE(ff_pw_18)", %%mm6       \n\t"                \
a5db05
         ".p2align 3                \n\t"                                \
a5db05
         "1:                        \n\t"                                \
a5db05
         MSPEL_FILTER13_CORE(DO_UNPACK, "movd   1", A1, A2, A3, A4)      \
a5db05
diff -ru ffmpeg-5.1.orig/libavutil/x86/asm.h ffmpeg-5.1/libavutil/x86/asm.h
a5db05
--- ffmpeg-5.1.orig/libavutil/x86/asm.h	2022-07-22 19:58:39.000000000 +0200
a5db05
+++ ffmpeg-5.1/libavutil/x86/asm.h	2022-08-21 12:11:41.786806812 +0200
a5db05
@@ -100,7 +100,11 @@
a5db05
 #endif
a5db05
 
a5db05
 /* Use to export labels from asm. */
a5db05
+#ifndef __midipix__
a5db05
 #define LABEL_MANGLE(a) EXTERN_PREFIX #a
a5db05
+#else
a5db05
+#define LABEL_MANGLE(a) #a
a5db05
+#endif
a5db05
 
a5db05
 // Use rip-relative addressing if compiling PIC code on x86-64.
a5db05
 #if ARCH_X86_64 && defined(PIC)
a5db05
diff -ru ffmpeg-5.1.orig/libpostproc/postprocess_template.c ffmpeg-5.1/libpostproc/postprocess_template.c
a5db05
--- ffmpeg-5.1.orig/libpostproc/postprocess_template.c	2022-07-22 19:58:39.000000000 +0200
a5db05
+++ ffmpeg-5.1/libpostproc/postprocess_template.c	2022-08-21 12:11:41.774806812 +0200
a5db05
@@ -441,7 +441,7 @@
9a80b2
         "paddusb %%mm0, %%mm0                   \n\t"
9a80b2
         "psubusb %%mm0, %%mm4                   \n\t"
9a80b2
         "pcmpeqb %%mm7, %%mm4                   \n\t" // d <= QP ? -1 : 0
9a80b2
-        "psubusb "MANGLE(b01)", %%mm3           \n\t"
a5c457
+        "psubusb "LOCAL_MANGLE(b01)", %%mm3     \n\t"
9a80b2
         "pand %%mm4, %%mm3                      \n\t" // d <= QP ? d : 0
a5db05
 
9a80b2
         PAVGB(%%mm7, %%mm3)                           // d/2
a5db05
@@ -621,7 +621,7 @@
a5db05
 
9a80b2
         PMINUB(%%mm2, %%mm1, %%mm4)                   // MIN(|lenergy|,|renergy|)/8
9a80b2
         "movq %2, %%mm4                         \n\t" // QP //FIXME QP+1 ?
9a80b2
-        "paddusb "MANGLE(b01)", %%mm4           \n\t"
9a80b2
+        "paddusb "LOCAL_MANGLE(b01)", %%mm4     \n\t"
9a80b2
         "pcmpgtb %%mm3, %%mm4                   \n\t" // |menergy|/8 < QP
9a80b2
         "psubusb %%mm1, %%mm3                   \n\t" // d=|menergy|/8-MIN(|lenergy|,|renergy|)/8
9a80b2
         "pand %%mm4, %%mm3                      \n\t"
a5db05
@@ -644,7 +644,7 @@
9a80b2
         "pand %%mm0, %%mm3                      \n\t"
9a80b2
         PMINUB(%%mm5, %%mm3, %%mm0)
a5db05
 
9a80b2
-        "psubusb "MANGLE(b01)", %%mm3           \n\t"
9a80b2
+        "psubusb "LOCAL_MANGLE(b01)", %%mm3     \n\t"
9a80b2
         PAVGB(%%mm7, %%mm3)
a5db05
 
9a80b2
         "movq (%%"FF_REG_a", %1, 2), %%mm0      \n\t"
a5db05
@@ -676,7 +676,7 @@
9a80b2
         "movq (%%"FF_REG_a", %1), %%mm3         \n\t" // l2
9a80b2
         "pxor %%mm6, %%mm2                      \n\t" // -l5-1
9a80b2
         "movq %%mm2, %%mm5                      \n\t" // -l5-1
9a80b2
-        "movq "MANGLE(b80)", %%mm4              \n\t" // 128
9a80b2
+        "movq "LOCAL_MANGLE(b80)", %%mm4        \n\t" // 128
9a80b2
         "lea (%%"FF_REG_a", %1, 4), %%"FF_REG_c"\n\t"
9a80b2
         PAVGB(%%mm3, %%mm2)                           // (l2-l5+256)/2
9a80b2
         PAVGB(%%mm0, %%mm4)                           // ~(l4-l3)/4 + 128
a5db05
@@ -688,7 +688,7 @@
9a80b2
         "pxor %%mm6, %%mm2                      \n\t" // -l1-1
9a80b2
         PAVGB(%%mm3, %%mm2)                           // (l2-l1+256)/2
9a80b2
         PAVGB((%0), %%mm1)                            // (l0-l3+256)/2
9a80b2
-        "movq "MANGLE(b80)", %%mm3              \n\t" // 128
9a80b2
+        "movq "LOCAL_MANGLE(b80)", %%mm3        \n\t" // 128
9a80b2
         PAVGB(%%mm2, %%mm3)                           // ~(l2-l1)/4 + 128
9a80b2
         PAVGB(%%mm1, %%mm3)                           // ~(l0-l3)/4 +(l2-l1)/8 + 128
9a80b2
         PAVGB(%%mm2, %%mm3)                           // ~(l0-l3)/8 +5(l2-l1)/16 + 128
a5db05
@@ -698,14 +698,14 @@
9a80b2
         "movq (%%"FF_REG_c", %1, 2), %%mm1      \n\t" // l7
9a80b2
         "pxor %%mm6, %%mm1                      \n\t" // -l7-1
9a80b2
         PAVGB((%0, %1, 4), %%mm1)                     // (l4-l7+256)/2
9a80b2
-        "movq "MANGLE(b80)", %%mm2              \n\t" // 128
9a80b2
+        "movq "LOCAL_MANGLE(b80)", %%mm2        \n\t" // 128
9a80b2
         PAVGB(%%mm5, %%mm2)                           // ~(l6-l5)/4 + 128
9a80b2
         PAVGB(%%mm1, %%mm2)                           // ~(l4-l7)/4 +(l6-l5)/8 + 128
9a80b2
         PAVGB(%%mm5, %%mm2)                           // ~(l4-l7)/8 +5(l6-l5)/16 + 128
9a80b2
 // mm0=128-q, mm2=renergy/16 + 128, mm3=lenergy/16 + 128, mm4= menergy/16 + 128
a5db05
 
9a80b2
-        "movq "MANGLE(b00)", %%mm1              \n\t" // 0
9a80b2
-        "movq "MANGLE(b00)", %%mm5              \n\t" // 0
9a80b2
+        "movq "LOCAL_MANGLE(b00)", %%mm1        \n\t" // 0
9a80b2
+        "movq "LOCAL_MANGLE(b00)", %%mm5        \n\t" // 0
9a80b2
         "psubb %%mm2, %%mm1                     \n\t" // 128 - renergy/16
9a80b2
         "psubb %%mm3, %%mm5                     \n\t" // 128 - lenergy/16
9a80b2
         PMAXUB(%%mm1, %%mm2)                          // 128 + |renergy/16|
a5db05
@@ -714,7 +714,7 @@
a5db05
 
9a80b2
 // mm0=128-q, mm3=128 + MIN(|lenergy|,|renergy|)/16, mm4= menergy/16 + 128
a5db05
 
9a80b2
-        "movq "MANGLE(b00)", %%mm7              \n\t" // 0
9a80b2
+        "movq "LOCAL_MANGLE(b00)", %%mm7        \n\t" // 0
9a80b2
         "movq %2, %%mm2                         \n\t" // QP
9a80b2
         PAVGB(%%mm6, %%mm2)                           // 128 + QP/2
9a80b2
         "psubb %%mm6, %%mm2                     \n\t"
a5db05
@@ -728,13 +728,13 @@
9a80b2
 // mm0=128-q, mm1= SIGN(menergy), mm2= |menergy|/16 < QP/2, mm4= d/16
a5db05
 
9a80b2
         "movq %%mm4, %%mm3                      \n\t" // d
9a80b2
-        "psubusb "MANGLE(b01)", %%mm4           \n\t"
9a80b2
+        "psubusb "LOCAL_MANGLE(b01)", %%mm4     \n\t"
9a80b2
         PAVGB(%%mm7, %%mm4)                           // d/32
9a80b2
         PAVGB(%%mm7, %%mm4)                           // (d + 32)/64
9a80b2
         "paddb %%mm3, %%mm4                     \n\t" // 5d/64
9a80b2
         "pand %%mm2, %%mm4                      \n\t"
a5db05
 
9a80b2
-        "movq "MANGLE(b80)", %%mm5              \n\t" // 128
9a80b2
+        "movq "LOCAL_MANGLE(b80)", %%mm5        \n\t" // 128
9a80b2
         "psubb %%mm0, %%mm5                     \n\t" // q
9a80b2
         "paddsb %%mm6, %%mm5                    \n\t" // fix bad rounding
9a80b2
         "pcmpgtb %%mm5, %%mm7                   \n\t" // SIGN(q)
a5db05
@@ -991,10 +991,10 @@
9a80b2
         "psubusw %%mm1, %%mm5                   \n\t" // ld
a5db05
 
a5db05
 
9a80b2
-        "movq "MANGLE(w05)", %%mm2              \n\t" // 5
9a80b2
+        "movq "LOCAL_MANGLE(w05)", %%mm2        \n\t" // 5
9a80b2
         "pmullw %%mm2, %%mm4                    \n\t"
9a80b2
         "pmullw %%mm2, %%mm5                    \n\t"
9a80b2
-        "movq "MANGLE(w20)", %%mm2              \n\t" // 32
9a80b2
+        "movq "LOCAL_MANGLE(w20)", %%mm2        \n\t" // 32
9a80b2
         "paddw %%mm2, %%mm4                     \n\t"
9a80b2
         "paddw %%mm2, %%mm5                     \n\t"
9a80b2
         "psrlw $6, %%mm4                        \n\t"
a5db05
@@ -1187,7 +1187,7 @@
9a80b2
         "psubb %%mm7, %%mm6                     \n\t" // max - min
a5c457
         "push %%"FF_REG_a"                      \n\t"
a5c457
         "movd %%mm6, %%eax                      \n\t"
a5c457
-        "cmpb "MANGLE(deringThreshold)", %%al   \n\t"
a5c457
+        "cmpb "LOCAL_MANGLE(deringThreshold)", %%al   \n\t"
a5c457
         "pop %%"FF_REG_a"                       \n\t"
9a80b2
         " jb 1f                                 \n\t"
9a80b2
         PAVGB(%%mm0, %%mm7)                           // a=(max + min)/2
a5db05
@@ -1213,9 +1213,9 @@
9a80b2
         "psubusb %%mm7, %%mm0                   \n\t"
9a80b2
         "psubusb %%mm7, %%mm2                   \n\t"
9a80b2
         "psubusb %%mm7, %%mm3                   \n\t"
9a80b2
-        "pcmpeqb "MANGLE(b00)", %%mm0           \n\t" // L10 > a ? 0 : -1
9a80b2
-        "pcmpeqb "MANGLE(b00)", %%mm2           \n\t" // L20 > a ? 0 : -1
9a80b2
-        "pcmpeqb "MANGLE(b00)", %%mm3           \n\t" // L00 > a ? 0 : -1
9a80b2
+        "pcmpeqb "LOCAL_MANGLE(b00)", %%mm0     \n\t" // L10 > a ? 0 : -1
9a80b2
+        "pcmpeqb "LOCAL_MANGLE(b00)", %%mm2     \n\t" // L20 > a ? 0 : -1
9a80b2
+        "pcmpeqb "LOCAL_MANGLE(b00)", %%mm3     \n\t" // L00 > a ? 0 : -1
9a80b2
         "paddb %%mm2, %%mm0                     \n\t"
9a80b2
         "paddb %%mm3, %%mm0                     \n\t"
a5db05
 
a5db05
@@ -1236,9 +1236,9 @@
9a80b2
         "psubusb %%mm7, %%mm2                   \n\t"
9a80b2
         "psubusb %%mm7, %%mm4                   \n\t"
9a80b2
         "psubusb %%mm7, %%mm5                   \n\t"
9a80b2
-        "pcmpeqb "MANGLE(b00)", %%mm2           \n\t" // L11 > a ? 0 : -1
9a80b2
-        "pcmpeqb "MANGLE(b00)", %%mm4           \n\t" // L21 > a ? 0 : -1
9a80b2
-        "pcmpeqb "MANGLE(b00)", %%mm5           \n\t" // L01 > a ? 0 : -1
9a80b2
+        "pcmpeqb "LOCAL_MANGLE(b00)", %%mm2     \n\t" // L11 > a ? 0 : -1
9a80b2
+        "pcmpeqb "LOCAL_MANGLE(b00)", %%mm4     \n\t" // L21 > a ? 0 : -1
9a80b2
+        "pcmpeqb "LOCAL_MANGLE(b00)", %%mm5     \n\t" // L01 > a ? 0 : -1
9a80b2
         "paddb %%mm4, %%mm2                     \n\t"
9a80b2
         "paddb %%mm5, %%mm2                     \n\t"
9a80b2
 // 0, 2, 3, 1
a5db05
@@ -1263,7 +1263,7 @@
9a80b2
         "psubusb " #lx ", " #t1 "               \n\t"\
9a80b2
         "psubusb " #lx ", " #t0 "               \n\t"\
9a80b2
         "psubusb " #lx ", " #sx "               \n\t"\
9a80b2
-        "movq "MANGLE(b00)", " #lx "            \n\t"\
9a80b2
+        "movq "LOCAL_MANGLE(b00)", " #lx "      \n\t"\
9a80b2
         "pcmpeqb " #lx ", " #t1 "               \n\t" /* src[-1] > a ? 0 : -1*/\
9a80b2
         "pcmpeqb " #lx ", " #t0 "               \n\t" /* src[+1] > a ? 0 : -1*/\
9a80b2
         "pcmpeqb " #lx ", " #sx "               \n\t" /* src[0]  > a ? 0 : -1*/\
a5db05
@@ -1279,8 +1279,8 @@
9a80b2
         PMINUB(t1, pplx, t0)\
9a80b2
         "paddb " #sx ", " #ppsx "               \n\t"\
9a80b2
         "paddb " #psx ", " #ppsx "              \n\t"\
9a80b2
-        "#paddb "MANGLE(b02)", " #ppsx "        \n\t"\
9a80b2
-        "pand "MANGLE(b08)", " #ppsx "          \n\t"\
9a80b2
+        "#paddb "LOCAL_MANGLE(b02)", " #ppsx "  \n\t"\
9a80b2
+        "pand "LOCAL_MANGLE(b08)", " #ppsx "    \n\t"\
9a80b2
         "pcmpeqb " #lx ", " #ppsx "             \n\t"\
9a80b2
         "pand " #ppsx ", " #pplx "              \n\t"\
9a80b2
         "pandn " #dst ", " #ppsx "              \n\t"\
a5db05
@@ -2201,7 +2201,7 @@
9a80b2
 #else //L1_DIFF
9a80b2
 #if defined (FAST_L2_DIFF)
9a80b2
         "pcmpeqb %%mm7, %%mm7                   \n\t"
9a80b2
-        "movq "MANGLE(b80)", %%mm6              \n\t"
9a80b2
+        "movq "LOCAL_MANGLE(b80)", %%mm6        \n\t"
9a80b2
         "pxor %%mm0, %%mm0                      \n\t"
9a80b2
 #define REAL_L2_DIFF_CORE(a, b)\
9a80b2
         "movq " #a ", %%mm5                     \n\t"\
a5db05
@@ -2705,8 +2705,8 @@
9a80b2
             "movq %%mm6, %%mm1                      \n\t"
9a80b2
             "psllw $2, %%mm0                        \n\t"
9a80b2
             "psllw $2, %%mm1                        \n\t"
9a80b2
-            "paddw "MANGLE(w04)", %%mm0             \n\t"
9a80b2
-            "paddw "MANGLE(w04)", %%mm1             \n\t"
9a80b2
+            "paddw "LOCAL_MANGLE(w04)", %%mm0       \n\t"
9a80b2
+            "paddw "LOCAL_MANGLE(w04)", %%mm1       \n\t"
a5db05
 
9a80b2
 #define NEXT\
9a80b2
             "movq (%0), %%mm2                       \n\t"\
a5db05
@@ -3012,10 +3012,10 @@
9a80b2
             "psubusw %%mm1, %%mm5                   \n\t" // ld
a5db05
 
a5db05
 
9a80b2
-            "movq "MANGLE(w05)", %%mm2              \n\t" // 5
9a80b2
+            "movq "LOCAL_MANGLE(w05)", %%mm2        \n\t" // 5
9a80b2
             "pmullw %%mm2, %%mm4                    \n\t"
9a80b2
             "pmullw %%mm2, %%mm5                    \n\t"
9a80b2
-            "movq "MANGLE(w20)", %%mm2              \n\t" // 32
9a80b2
+            "movq "LOCAL_MANGLE(w20)", %%mm2        \n\t" // 32
9a80b2
             "paddw %%mm2, %%mm4                     \n\t"
9a80b2
             "paddw %%mm2, %%mm5                     \n\t"
9a80b2
             "psrlw $6, %%mm4                        \n\t"
a5db05
diff -ru ffmpeg-5.1.orig/libswscale/x86/rgb2rgb_template.c ffmpeg-5.1/libswscale/x86/rgb2rgb_template.c
a5db05
--- ffmpeg-5.1.orig/libswscale/x86/rgb2rgb_template.c	2022-07-22 19:58:40.000000000 +0200
a5db05
+++ ffmpeg-5.1/libswscale/x86/rgb2rgb_template.c	2022-08-21 12:14:19.034801888 +0200
a5db05
@@ -94,14 +94,14 @@
Lucio Andrés Illanes Albornoz b2043d
             "psrlq         $8, %%mm3    \n\t" \
Lucio Andrés Illanes Albornoz b2043d
             "psrlq         $8, %%mm6    \n\t" \
Lucio Andrés Illanes Albornoz b2043d
             "psrlq         $8, %%mm7    \n\t" \
Lucio Andrés Illanes Albornoz b2043d
-            "pand "MANGLE(mask24l)", %%mm0\n\t" \
Lucio Andrés Illanes Albornoz b2043d
-            "pand "MANGLE(mask24l)", %%mm1\n\t" \
Lucio Andrés Illanes Albornoz b2043d
-            "pand "MANGLE(mask24l)", %%mm4\n\t" \
Lucio Andrés Illanes Albornoz b2043d
-            "pand "MANGLE(mask24l)", %%mm5\n\t" \
Lucio Andrés Illanes Albornoz b2043d
-            "pand "MANGLE(mask24h)", %%mm2\n\t" \
Lucio Andrés Illanes Albornoz b2043d
-            "pand "MANGLE(mask24h)", %%mm3\n\t" \
Lucio Andrés Illanes Albornoz b2043d
-            "pand "MANGLE(mask24h)", %%mm6\n\t" \
Lucio Andrés Illanes Albornoz b2043d
-            "pand "MANGLE(mask24h)", %%mm7\n\t" \
Lucio Andrés Illanes Albornoz b2043d
+            "pand "LOCAL_MANGLE(mask24l)", %%mm0\n\t" \
Lucio Andrés Illanes Albornoz b2043d
+            "pand "LOCAL_MANGLE(mask24l)", %%mm1\n\t" \
Lucio Andrés Illanes Albornoz b2043d
+            "pand "LOCAL_MANGLE(mask24l)", %%mm4\n\t" \
Lucio Andrés Illanes Albornoz b2043d
+            "pand "LOCAL_MANGLE(mask24l)", %%mm5\n\t" \
Lucio Andrés Illanes Albornoz b2043d
+            "pand "LOCAL_MANGLE(mask24h)", %%mm2\n\t" \
Lucio Andrés Illanes Albornoz b2043d
+            "pand "LOCAL_MANGLE(mask24h)", %%mm3\n\t" \
Lucio Andrés Illanes Albornoz b2043d
+            "pand "LOCAL_MANGLE(mask24h)", %%mm6\n\t" \
Lucio Andrés Illanes Albornoz b2043d
+            "pand "LOCAL_MANGLE(mask24h)", %%mm7\n\t" \
Lucio Andrés Illanes Albornoz b2043d
             "por        %%mm2, %%mm0    \n\t" \
Lucio Andrés Illanes Albornoz b2043d
             "por        %%mm3, %%mm1    \n\t" \
Lucio Andrés Illanes Albornoz b2043d
             "por        %%mm6, %%mm4    \n\t" \
a5db05
@@ -714,9 +714,9 @@
Lucio Andrés Illanes Albornoz b2043d
             "pand          %3, %%mm1    \n\t"
Lucio Andrés Illanes Albornoz b2043d
             "pand          %4, %%mm2    \n\t"
Lucio Andrés Illanes Albornoz b2043d
             "psllq         $5, %%mm0    \n\t"
Lucio Andrés Illanes Albornoz b2043d
-            "pmulhw        "MANGLE(mul15_mid)", %%mm0    \n\t"
Lucio Andrés Illanes Albornoz b2043d
-            "pmulhw        "MANGLE(mul15_mid)", %%mm1    \n\t"
Lucio Andrés Illanes Albornoz b2043d
-            "pmulhw        "MANGLE(mul15_hi)", %%mm2    \n\t"
Lucio Andrés Illanes Albornoz b2043d
+            "pmulhw        "LOCAL_MANGLE(mul15_mid)", %%mm0    \n\t"
Lucio Andrés Illanes Albornoz b2043d
+            "pmulhw        "LOCAL_MANGLE(mul15_mid)", %%mm1    \n\t"
Lucio Andrés Illanes Albornoz b2043d
+            "pmulhw        "LOCAL_MANGLE(mul15_hi)", %%mm2    \n\t"
Lucio Andrés Illanes Albornoz b2043d
             "movq       %%mm0, %%mm3    \n\t"
Lucio Andrés Illanes Albornoz b2043d
             "movq       %%mm1, %%mm4    \n\t"
Lucio Andrés Illanes Albornoz b2043d
             "movq       %%mm2, %%mm5    \n\t"
a5db05
@@ -745,9 +745,9 @@
Lucio Andrés Illanes Albornoz b2043d
             "pand          %3, %%mm1    \n\t"
Lucio Andrés Illanes Albornoz b2043d
             "pand          %4, %%mm2    \n\t"
Lucio Andrés Illanes Albornoz b2043d
             "psllq         $5, %%mm0    \n\t"
Lucio Andrés Illanes Albornoz b2043d
-            "pmulhw        "MANGLE(mul15_mid)", %%mm0    \n\t"
Lucio Andrés Illanes Albornoz b2043d
-            "pmulhw        "MANGLE(mul15_mid)", %%mm1    \n\t"
Lucio Andrés Illanes Albornoz b2043d
-            "pmulhw        "MANGLE(mul15_hi)", %%mm2    \n\t"
Lucio Andrés Illanes Albornoz b2043d
+            "pmulhw        "LOCAL_MANGLE(mul15_mid)", %%mm0    \n\t"
Lucio Andrés Illanes Albornoz b2043d
+            "pmulhw        "LOCAL_MANGLE(mul15_mid)", %%mm1    \n\t"
Lucio Andrés Illanes Albornoz b2043d
+            "pmulhw        "LOCAL_MANGLE(mul15_hi)", %%mm2    \n\t"
Lucio Andrés Illanes Albornoz b2043d
             "movq       %%mm0, %%mm3    \n\t"
Lucio Andrés Illanes Albornoz b2043d
             "movq       %%mm1, %%mm4    \n\t"
Lucio Andrés Illanes Albornoz b2043d
             "movq       %%mm2, %%mm5    \n\t"
a5db05
@@ -821,9 +821,9 @@
Lucio Andrés Illanes Albornoz b2043d
             "pand          %4, %%mm2    \n\t"
Lucio Andrés Illanes Albornoz b2043d
             "psllq         $5, %%mm0    \n\t"
Lucio Andrés Illanes Albornoz b2043d
             "psrlq         $1, %%mm2    \n\t"
Lucio Andrés Illanes Albornoz b2043d
-            "pmulhw        "MANGLE(mul15_mid)", %%mm0    \n\t"
Lucio Andrés Illanes Albornoz b2043d
-            "pmulhw        "MANGLE(mul16_mid)", %%mm1    \n\t"
Lucio Andrés Illanes Albornoz b2043d
-            "pmulhw        "MANGLE(mul15_hi)", %%mm2    \n\t"
Lucio Andrés Illanes Albornoz b2043d
+            "pmulhw        "LOCAL_MANGLE(mul15_mid)", %%mm0    \n\t"
Lucio Andrés Illanes Albornoz b2043d
+            "pmulhw        "LOCAL_MANGLE(mul16_mid)", %%mm1    \n\t"
Lucio Andrés Illanes Albornoz b2043d
+            "pmulhw        "LOCAL_MANGLE(mul15_hi)", %%mm2    \n\t"
Lucio Andrés Illanes Albornoz b2043d
             "movq       %%mm0, %%mm3    \n\t"
Lucio Andrés Illanes Albornoz b2043d
             "movq       %%mm1, %%mm4    \n\t"
Lucio Andrés Illanes Albornoz b2043d
             "movq       %%mm2, %%mm5    \n\t"
a5db05
@@ -853,9 +853,9 @@
Lucio Andrés Illanes Albornoz b2043d
             "pand          %4, %%mm2    \n\t"
Lucio Andrés Illanes Albornoz b2043d
             "psllq         $5, %%mm0    \n\t"
Lucio Andrés Illanes Albornoz b2043d
             "psrlq         $1, %%mm2    \n\t"
Lucio Andrés Illanes Albornoz b2043d
-            "pmulhw        "MANGLE(mul15_mid)", %%mm0    \n\t"
Lucio Andrés Illanes Albornoz b2043d
-            "pmulhw        "MANGLE(mul16_mid)", %%mm1    \n\t"
Lucio Andrés Illanes Albornoz b2043d
-            "pmulhw        "MANGLE(mul15_hi)", %%mm2    \n\t"
Lucio Andrés Illanes Albornoz b2043d
+            "pmulhw        "LOCAL_MANGLE(mul15_mid)", %%mm0    \n\t"
Lucio Andrés Illanes Albornoz b2043d
+            "pmulhw        "LOCAL_MANGLE(mul16_mid)", %%mm1    \n\t"
Lucio Andrés Illanes Albornoz b2043d
+            "pmulhw        "LOCAL_MANGLE(mul15_hi)", %%mm2    \n\t"
Lucio Andrés Illanes Albornoz b2043d
             "movq       %%mm0, %%mm3    \n\t"
Lucio Andrés Illanes Albornoz b2043d
             "movq       %%mm1, %%mm4    \n\t"
Lucio Andrés Illanes Albornoz b2043d
             "movq       %%mm2, %%mm5    \n\t"
a5db05
@@ -950,7 +950,7 @@
Lucio Andrés Illanes Albornoz b2043d
             "psllq         $5, %%mm0    \n\t"
Lucio Andrés Illanes Albornoz b2043d
             "pmulhw        %5, %%mm0    \n\t"
Lucio Andrés Illanes Albornoz b2043d
             "pmulhw        %5, %%mm1    \n\t"
Lucio Andrés Illanes Albornoz b2043d
-            "pmulhw        "MANGLE(mul15_hi)", %%mm2    \n\t"
Lucio Andrés Illanes Albornoz b2043d
+            "pmulhw        "LOCAL_MANGLE(mul15_hi)", %%mm2    \n\t"
Lucio Andrés Illanes Albornoz b2043d
             PACK_RGB32
Lucio Andrés Illanes Albornoz b2043d
             ::"r"(d),"r"(s),"m"(mask15b),"m"(mask15g),"m"(mask15r) ,"m"(mul15_mid)
Lucio Andrés Illanes Albornoz b2043d
               NAMED_CONSTRAINTS_ADD(mul15_hi)
a5db05
@@ -993,8 +993,8 @@
Lucio Andrés Illanes Albornoz b2043d
             "psllq         $5, %%mm0    \n\t"
Lucio Andrés Illanes Albornoz b2043d
             "psrlq         $1, %%mm2    \n\t"
Lucio Andrés Illanes Albornoz b2043d
             "pmulhw        %5, %%mm0    \n\t"
Lucio Andrés Illanes Albornoz b2043d
-            "pmulhw        "MANGLE(mul16_mid)", %%mm1    \n\t"
Lucio Andrés Illanes Albornoz b2043d
-            "pmulhw        "MANGLE(mul15_hi)", %%mm2    \n\t"
Lucio Andrés Illanes Albornoz b2043d
+            "pmulhw        "LOCAL_MANGLE(mul16_mid)", %%mm1    \n\t"
Lucio Andrés Illanes Albornoz b2043d
+            "pmulhw        "LOCAL_MANGLE(mul15_hi)", %%mm2    \n\t"
Lucio Andrés Illanes Albornoz b2043d
             PACK_RGB32
Lucio Andrés Illanes Albornoz b2043d
             ::"r"(d),"r"(s),"m"(mask16b),"m"(mask16g),"m"(mask16r),"m"(mul15_mid)
Lucio Andrés Illanes Albornoz b2043d
               NAMED_CONSTRAINTS_ADD(mul16_mid,mul15_hi)
a5db05
@@ -1021,9 +1021,9 @@
Lucio Andrés Illanes Albornoz b2043d
     __asm__ volatile (
Lucio Andrés Illanes Albornoz b2043d
         "test             %%"FF_REG_a", %%"FF_REG_a"    \n\t"
Lucio Andrés Illanes Albornoz b2043d
         "jns                     2f                     \n\t"
Lucio Andrés Illanes Albornoz b2043d
-        "movq     "MANGLE(mask24r)", %%mm5              \n\t"
Lucio Andrés Illanes Albornoz b2043d
-        "movq     "MANGLE(mask24g)", %%mm6              \n\t"
Lucio Andrés Illanes Albornoz b2043d
-        "movq     "MANGLE(mask24b)", %%mm7              \n\t"
Lucio Andrés Illanes Albornoz b2043d
+        "movq     "LOCAL_MANGLE(mask24r)", %%mm5              \n\t"
Lucio Andrés Illanes Albornoz b2043d
+        "movq     "LOCAL_MANGLE(mask24g)", %%mm6              \n\t"
Lucio Andrés Illanes Albornoz b2043d
+        "movq     "LOCAL_MANGLE(mask24b)", %%mm7              \n\t"
Lucio Andrés Illanes Albornoz b2043d
         ".p2align                 4                     \n\t"
Lucio Andrés Illanes Albornoz b2043d
         "1:                                             \n\t"
Lucio Andrés Illanes Albornoz b2043d
         PREFETCH" 32(%1, %%"FF_REG_a")                  \n\t"
a5db05
@@ -1355,7 +1355,7 @@
a5db05
         if (mmxSize) {
a5db05
         __asm__ volatile(
a5db05
             "mov                       %4, %%"FF_REG_a" \n\t"
a5db05
-            "movq        "MANGLE(mmx_ff)", %%mm0    \n\t"
a5db05
+            "movq        "LOCAL_MANGLE(mmx_ff)", %%mm0    \n\t"
a5db05
             "movq      (%0, %%"FF_REG_a"), %%mm4    \n\t"
a5db05
             "movq                   %%mm4, %%mm2    \n\t"
a5db05
             "psllq                     $8, %%mm4    \n\t"
a5db05
@@ -1570,7 +1570,7 @@
a5db05
             __asm__ volatile(
a5db05
                 "mov                        %2, %%"FF_REG_a"\n\t"
a5db05
                 "movq          "BGR2Y_IDX"(%3), %%mm6       \n\t"
a5db05
-                "movq       "MANGLE(ff_w1111)", %%mm5       \n\t"
a5db05
+                "movq       "LOCAL_MANGLE(ff_w1111)", %%mm5       \n\t"
a5db05
                 "pxor                    %%mm7, %%mm7       \n\t"
a5db05
                 "lea (%%"FF_REG_a", %%"FF_REG_a", 2), %%"FF_REG_d" \n\t"
a5db05
                 ".p2align                    4              \n\t"
a5db05
@@ -1624,7 +1624,7 @@
a5db05
                 "psraw                      $7, %%mm4       \n\t"
Lucio Andrés Illanes Albornoz fabd50
 
a5db05
                 "packuswb                %%mm4, %%mm0       \n\t"
a5db05
-                "paddusb "MANGLE(ff_bgr2YOffset)", %%mm0    \n\t"
a5db05
+                "paddusb "LOCAL_MANGLE(ff_bgr2YOffset)", %%mm0    \n\t"
1fafd5
 
a5db05
                 MOVNTQ"                  %%mm0, (%1, %%"FF_REG_a") \n\t"
a5db05
                 "add                        $8,      %%"FF_REG_a"  \n\t"
a5db05
@@ -1639,7 +1639,7 @@
a5db05
         src -= srcStride*2;
a5db05
         __asm__ volatile(
a5db05
             "mov                        %4, %%"FF_REG_a"\n\t"
a5db05
-            "movq       "MANGLE(ff_w1111)", %%mm5       \n\t"
a5db05
+            "movq       "LOCAL_MANGLE(ff_w1111)", %%mm5       \n\t"
a5db05
             "movq          "BGR2U_IDX"(%5), %%mm6       \n\t"
a5db05
             "pxor                    %%mm7, %%mm7       \n\t"
a5db05
             "lea (%%"FF_REG_a", %%"FF_REG_a", 2), %%"FF_REG_d" \n\t"
a5db05
@@ -1717,7 +1717,7 @@
a5db05
             "punpckldq               %%mm4, %%mm0           \n\t"
a5db05
             "punpckhdq               %%mm4, %%mm1           \n\t"
a5db05
             "packsswb                %%mm1, %%mm0           \n\t"
a5db05
-            "paddb "MANGLE(ff_bgr2UVOffset)", %%mm0         \n\t"
a5db05
+            "paddb "LOCAL_MANGLE(ff_bgr2UVOffset)", %%mm0         \n\t"
a5db05
             "movd                    %%mm0, (%2, %%"FF_REG_a") \n\t"
a5db05
             "punpckhdq               %%mm0, %%mm0              \n\t"
a5db05
             "movd                    %%mm0, (%3, %%"FF_REG_a") \n\t"
a5db05
diff -ru ffmpeg-5.1.orig/libswscale/x86/swscale_template.c ffmpeg-5.1/libswscale/x86/swscale_template.c
a5db05
--- ffmpeg-5.1.orig/libswscale/x86/swscale_template.c	2022-07-22 19:58:40.000000000 +0200
a5db05
+++ ffmpeg-5.1/libswscale/x86/swscale_template.c	2022-08-21 12:11:41.774806812 +0200
a5db05
@@ -342,9 +342,9 @@
a5db05
 }
1fafd5
 
a5db05
 #define REAL_WRITERGB16(dst, dstw, index) \
a5db05
-    "pand "MANGLE(bF8)", %%mm2  \n\t" /* B */\
a5db05
-    "pand "MANGLE(bFC)", %%mm4  \n\t" /* G */\
a5db05
-    "pand "MANGLE(bF8)", %%mm5  \n\t" /* R */\
a5db05
+    "pand "LOCAL_MANGLE(bF8)", %%mm2  \n\t" /* B */\
a5db05
+    "pand "LOCAL_MANGLE(bFC)", %%mm4  \n\t" /* G */\
a5db05
+    "pand "LOCAL_MANGLE(bF8)", %%mm5  \n\t" /* R */\
a5db05
     "psrlq           $3, %%mm2  \n\t"\
a5db05
 \
a5db05
     "movq         %%mm2, %%mm1  \n\t"\
a5db05
@@ -418,9 +418,9 @@
a5db05
 }
1fafd5
 
a5db05
 #define REAL_WRITERGB15(dst, dstw, index) \
a5db05
-    "pand "MANGLE(bF8)", %%mm2  \n\t" /* B */\
a5db05
-    "pand "MANGLE(bF8)", %%mm4  \n\t" /* G */\
a5db05
-    "pand "MANGLE(bF8)", %%mm5  \n\t" /* R */\
a5db05
+    "pand "LOCAL_MANGLE(bF8)", %%mm2  \n\t" /* B */\
a5db05
+    "pand "LOCAL_MANGLE(bF8)", %%mm4  \n\t" /* G */\
a5db05
+    "pand "LOCAL_MANGLE(bF8)", %%mm5  \n\t" /* R */\
a5db05
     "psrlq           $3, %%mm2  \n\t"\
a5db05
     "psrlq           $1, %%mm5  \n\t"\
a5db05
 \
a5db05
@@ -549,8 +549,8 @@
1fafd5
 
a5db05
 #define WRITEBGR24MMXEXT(dst, dstw, index) \
a5db05
     /* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */\
a5db05
-    "movq "MANGLE(ff_M24A)", %%mm0 \n\t"\
a5db05
-    "movq "MANGLE(ff_M24C)", %%mm7 \n\t"\
a5db05
+    "movq "LOCAL_MANGLE(ff_M24A)", %%mm0 \n\t"\
a5db05
+    "movq "LOCAL_MANGLE(ff_M24C)", %%mm7 \n\t"\
a5db05
     "pshufw $0x50, %%mm2, %%mm1 \n\t" /* B3 B2 B3 B2  B1 B0 B1 B0 */\
a5db05
     "pshufw $0x50, %%mm4, %%mm3 \n\t" /* G3 G2 G3 G2  G1 G0 G1 G0 */\
a5db05
     "pshufw $0x00, %%mm5, %%mm6 \n\t" /* R1 R0 R1 R0  R1 R0 R1 R0 */\
a5db05
@@ -569,7 +569,7 @@
a5db05
     "pshufw $0x55, %%mm4, %%mm3 \n\t" /* G4 G3 G4 G3  G4 G3 G4 G3 */\
a5db05
     "pshufw $0xA5, %%mm5, %%mm6 \n\t" /* R5 R4 R5 R4  R3 R2 R3 R2 */\
a5db05
 \
a5db05
-    "pand "MANGLE(ff_M24B)", %%mm1 \n\t" /* B5       B4        B3    */\
a5db05
+    "pand "LOCAL_MANGLE(ff_M24B)", %%mm1 \n\t" /* B5       B4        B3    */\
a5db05
     "pand   %%mm7, %%mm3        \n\t" /*       G4        G3       */\
a5db05
     "pand   %%mm0, %%mm6        \n\t" /*    R4        R3       R2 */\
a5db05
 \
a5db05
@@ -583,7 +583,7 @@
a5db05
 \
a5db05
     "pand   %%mm7, %%mm1        \n\t" /*       B7        B6       */\
a5db05
     "pand   %%mm0, %%mm3        \n\t" /*    G7        G6       G5 */\
a5db05
-    "pand "MANGLE(ff_M24B)", %%mm6 \n\t" /* R7       R6        R5    */\
a5db05
+    "pand "LOCAL_MANGLE(ff_M24B)", %%mm6 \n\t" /* R7       R6        R5    */\
a5db05
 \
a5db05
     "por    %%mm1, %%mm3        \n\t"\
a5db05
     "por    %%mm3, %%mm6        \n\t"\