summaryrefslogtreecommitdiffhomepage
path: root/patches/ffmpeg-4.1.local.patch
blob: 70fa76369bc78a3decc01c21d2e84dc7fb33f71e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
--- ffmpeg-4.1/libswscale/x86/rgb2rgb_template.c.orig	2018-11-05 23:22:26.000000000 +0000
+++ ffmpeg-4.1/libswscale/x86/rgb2rgb_template.c	2019-01-16 00:16:40.272000000 +0000
@@ -114,14 +114,14 @@
             "psrlq         $8, %%mm3    \n\t" \
             "psrlq         $8, %%mm6    \n\t" \
             "psrlq         $8, %%mm7    \n\t" \
-            "pand "MANGLE(mask24l)", %%mm0\n\t" \
-            "pand "MANGLE(mask24l)", %%mm1\n\t" \
-            "pand "MANGLE(mask24l)", %%mm4\n\t" \
-            "pand "MANGLE(mask24l)", %%mm5\n\t" \
-            "pand "MANGLE(mask24h)", %%mm2\n\t" \
-            "pand "MANGLE(mask24h)", %%mm3\n\t" \
-            "pand "MANGLE(mask24h)", %%mm6\n\t" \
-            "pand "MANGLE(mask24h)", %%mm7\n\t" \
+            "pand "LOCAL_MANGLE(mask24l)", %%mm0\n\t" \
+            "pand "LOCAL_MANGLE(mask24l)", %%mm1\n\t" \
+            "pand "LOCAL_MANGLE(mask24l)", %%mm4\n\t" \
+            "pand "LOCAL_MANGLE(mask24l)", %%mm5\n\t" \
+            "pand "LOCAL_MANGLE(mask24h)", %%mm2\n\t" \
+            "pand "LOCAL_MANGLE(mask24h)", %%mm3\n\t" \
+            "pand "LOCAL_MANGLE(mask24h)", %%mm6\n\t" \
+            "pand "LOCAL_MANGLE(mask24h)", %%mm7\n\t" \
             "por        %%mm2, %%mm0    \n\t" \
             "por        %%mm3, %%mm1    \n\t" \
             "por        %%mm6, %%mm4    \n\t" \
@@ -734,9 +734,9 @@
             "pand          %3, %%mm1    \n\t"
             "pand          %4, %%mm2    \n\t"
             "psllq         $5, %%mm0    \n\t"
-            "pmulhw        "MANGLE(mul15_mid)", %%mm0    \n\t"
-            "pmulhw        "MANGLE(mul15_mid)", %%mm1    \n\t"
-            "pmulhw        "MANGLE(mul15_hi)", %%mm2    \n\t"
+            "pmulhw        "LOCAL_MANGLE(mul15_mid)", %%mm0    \n\t"
+            "pmulhw        "LOCAL_MANGLE(mul15_mid)", %%mm1    \n\t"
+            "pmulhw        "LOCAL_MANGLE(mul15_hi)", %%mm2    \n\t"
             "movq       %%mm0, %%mm3    \n\t"
             "movq       %%mm1, %%mm4    \n\t"
             "movq       %%mm2, %%mm5    \n\t"
@@ -765,9 +765,9 @@
             "pand          %3, %%mm1    \n\t"
             "pand          %4, %%mm2    \n\t"
             "psllq         $5, %%mm0    \n\t"
-            "pmulhw        "MANGLE(mul15_mid)", %%mm0    \n\t"
-            "pmulhw        "MANGLE(mul15_mid)", %%mm1    \n\t"
-            "pmulhw        "MANGLE(mul15_hi)", %%mm2    \n\t"
+            "pmulhw        "LOCAL_MANGLE(mul15_mid)", %%mm0    \n\t"
+            "pmulhw        "LOCAL_MANGLE(mul15_mid)", %%mm1    \n\t"
+            "pmulhw        "LOCAL_MANGLE(mul15_hi)", %%mm2    \n\t"
             "movq       %%mm0, %%mm3    \n\t"
             "movq       %%mm1, %%mm4    \n\t"
             "movq       %%mm2, %%mm5    \n\t"
@@ -841,9 +841,9 @@
             "pand          %4, %%mm2    \n\t"
             "psllq         $5, %%mm0    \n\t"
             "psrlq         $1, %%mm2    \n\t"
-            "pmulhw        "MANGLE(mul15_mid)", %%mm0    \n\t"
-            "pmulhw        "MANGLE(mul16_mid)", %%mm1    \n\t"
-            "pmulhw        "MANGLE(mul15_hi)", %%mm2    \n\t"
+            "pmulhw        "LOCAL_MANGLE(mul15_mid)", %%mm0    \n\t"
+            "pmulhw        "LOCAL_MANGLE(mul16_mid)", %%mm1    \n\t"
+            "pmulhw        "LOCAL_MANGLE(mul15_hi)", %%mm2    \n\t"
             "movq       %%mm0, %%mm3    \n\t"
             "movq       %%mm1, %%mm4    \n\t"
             "movq       %%mm2, %%mm5    \n\t"
@@ -873,9 +873,9 @@
             "pand          %4, %%mm2    \n\t"
             "psllq         $5, %%mm0    \n\t"
             "psrlq         $1, %%mm2    \n\t"
-            "pmulhw        "MANGLE(mul15_mid)", %%mm0    \n\t"
-            "pmulhw        "MANGLE(mul16_mid)", %%mm1    \n\t"
-            "pmulhw        "MANGLE(mul15_hi)", %%mm2    \n\t"
+            "pmulhw        "LOCAL_MANGLE(mul15_mid)", %%mm0    \n\t"
+            "pmulhw        "LOCAL_MANGLE(mul16_mid)", %%mm1    \n\t"
+            "pmulhw        "LOCAL_MANGLE(mul15_hi)", %%mm2    \n\t"
             "movq       %%mm0, %%mm3    \n\t"
             "movq       %%mm1, %%mm4    \n\t"
             "movq       %%mm2, %%mm5    \n\t"
@@ -970,7 +970,7 @@
             "psllq         $5, %%mm0    \n\t"
             "pmulhw        %5, %%mm0    \n\t"
             "pmulhw        %5, %%mm1    \n\t"
-            "pmulhw        "MANGLE(mul15_hi)", %%mm2    \n\t"
+            "pmulhw        "LOCAL_MANGLE(mul15_hi)", %%mm2    \n\t"
             PACK_RGB32
             ::"r"(d),"r"(s),"m"(mask15b),"m"(mask15g),"m"(mask15r) ,"m"(mul15_mid)
               NAMED_CONSTRAINTS_ADD(mul15_hi)
@@ -1013,8 +1013,8 @@
             "psllq         $5, %%mm0    \n\t"
             "psrlq         $1, %%mm2    \n\t"
             "pmulhw        %5, %%mm0    \n\t"
-            "pmulhw        "MANGLE(mul16_mid)", %%mm1    \n\t"
-            "pmulhw        "MANGLE(mul15_hi)", %%mm2    \n\t"
+            "pmulhw        "LOCAL_MANGLE(mul16_mid)", %%mm1    \n\t"
+            "pmulhw        "LOCAL_MANGLE(mul15_hi)", %%mm2    \n\t"
             PACK_RGB32
             ::"r"(d),"r"(s),"m"(mask16b),"m"(mask16g),"m"(mask16r),"m"(mul15_mid)
               NAMED_CONSTRAINTS_ADD(mul16_mid,mul15_hi)
@@ -1041,9 +1041,9 @@
     __asm__ volatile (
         "test             %%"FF_REG_a", %%"FF_REG_a"    \n\t"
         "jns                     2f                     \n\t"
-        "movq     "MANGLE(mask24r)", %%mm5              \n\t"
-        "movq     "MANGLE(mask24g)", %%mm6              \n\t"
-        "movq     "MANGLE(mask24b)", %%mm7              \n\t"
+        "movq     "LOCAL_MANGLE(mask24r)", %%mm5              \n\t"
+        "movq     "LOCAL_MANGLE(mask24g)", %%mm6              \n\t"
+        "movq     "LOCAL_MANGLE(mask24b)", %%mm7              \n\t"
         ".p2align                 4                     \n\t"
         "1:                                             \n\t"
         PREFETCH" 32(%1, %%"FF_REG_a")                  \n\t"
@@ -1377,7 +1377,7 @@
         if (mmxSize) {
         __asm__ volatile(
             "mov                       %4, %%"FF_REG_a" \n\t"
-            "movq        "MANGLE(mmx_ff)", %%mm0    \n\t"
+            "movq        "LOCAL_MANGLE(mmx_ff)", %%mm0    \n\t"
             "movq      (%0, %%"FF_REG_a"), %%mm4    \n\t"
             "movq                   %%mm4, %%mm2    \n\t"
             "psllq                     $8, %%mm4    \n\t"
@@ -1595,7 +1595,7 @@
             __asm__ volatile(
                 "mov                        %2, %%"FF_REG_a"\n\t"
                 "movq          "BGR2Y_IDX"(%3), %%mm6       \n\t"
-                "movq       "MANGLE(ff_w1111)", %%mm5       \n\t"
+                "movq       "LOCAL_MANGLE(ff_w1111)", %%mm5       \n\t"
                 "pxor                    %%mm7, %%mm7       \n\t"
                 "lea (%%"FF_REG_a", %%"FF_REG_a", 2), %%"FF_REG_d" \n\t"
                 ".p2align                    4              \n\t"
@@ -1649,7 +1649,7 @@
                 "psraw                      $7, %%mm4       \n\t"
 
                 "packuswb                %%mm4, %%mm0       \n\t"
-                "paddusb "MANGLE(ff_bgr2YOffset)", %%mm0    \n\t"
+                "paddusb "LOCAL_MANGLE(ff_bgr2YOffset)", %%mm0    \n\t"
 
                 MOVNTQ"                  %%mm0, (%1, %%"FF_REG_a") \n\t"
                 "add                        $8,      %%"FF_REG_a"  \n\t"
@@ -1664,7 +1664,7 @@
         src -= srcStride*2;
         __asm__ volatile(
             "mov                        %4, %%"FF_REG_a"\n\t"
-            "movq       "MANGLE(ff_w1111)", %%mm5       \n\t"
+            "movq       "LOCAL_MANGLE(ff_w1111)", %%mm5       \n\t"
             "movq          "BGR2U_IDX"(%5), %%mm6       \n\t"
             "pxor                    %%mm7, %%mm7       \n\t"
             "lea (%%"FF_REG_a", %%"FF_REG_a", 2), %%"FF_REG_d" \n\t"
@@ -1770,7 +1770,7 @@
             "paddw                   %%mm1, %%mm5       \n\t"
             "paddw                   %%mm3, %%mm2       \n\t"
             "paddw                   %%mm5, %%mm2       \n\t"
-            "movq       "MANGLE(ff_w1111)", %%mm5       \n\t"
+            "movq       "LOCAL_MANGLE(ff_w1111)", %%mm5       \n\t"
             "psrlw                      $2, %%mm4       \n\t"
             "psrlw                      $2, %%mm2       \n\t"
 #endif
@@ -1797,7 +1797,7 @@
             "punpckldq               %%mm4, %%mm0           \n\t"
             "punpckhdq               %%mm4, %%mm1           \n\t"
             "packsswb                %%mm1, %%mm0           \n\t"
-            "paddb "MANGLE(ff_bgr2UVOffset)", %%mm0         \n\t"
+            "paddb "LOCAL_MANGLE(ff_bgr2UVOffset)", %%mm0         \n\t"
             "movd                    %%mm0, (%2, %%"FF_REG_a") \n\t"
             "punpckhdq               %%mm0, %%mm0              \n\t"
             "movd                    %%mm0, (%3, %%"FF_REG_a") \n\t"
--- ffmpeg-4.1/libswscale/x86/swscale_template.c.orig	2018-11-05 23:22:26.000000000 +0000
+++ ffmpeg-4.1/libswscale/x86/swscale_template.c	2019-01-16 00:19:06.024000000 +0000
@@ -429,9 +429,9 @@
 }
 
 #define REAL_WRITERGB16(dst, dstw, index) \
-    "pand "MANGLE(bF8)", %%mm2  \n\t" /* B */\
-    "pand "MANGLE(bFC)", %%mm4  \n\t" /* G */\
-    "pand "MANGLE(bF8)", %%mm5  \n\t" /* R */\
+    "pand "LOCAL_MANGLE(bF8)", %%mm2  \n\t" /* B */\
+    "pand "LOCAL_MANGLE(bFC)", %%mm4  \n\t" /* G */\
+    "pand "LOCAL_MANGLE(bF8)", %%mm5  \n\t" /* R */\
     "psrlq           $3, %%mm2  \n\t"\
 \
     "movq         %%mm2, %%mm1  \n\t"\
@@ -505,9 +505,9 @@
 }
 
 #define REAL_WRITERGB15(dst, dstw, index) \
-    "pand "MANGLE(bF8)", %%mm2  \n\t" /* B */\
-    "pand "MANGLE(bF8)", %%mm4  \n\t" /* G */\
-    "pand "MANGLE(bF8)", %%mm5  \n\t" /* R */\
+    "pand "LOCAL_MANGLE(bF8)", %%mm2  \n\t" /* B */\
+    "pand "LOCAL_MANGLE(bF8)", %%mm4  \n\t" /* G */\
+    "pand "LOCAL_MANGLE(bF8)", %%mm5  \n\t" /* R */\
     "psrlq           $3, %%mm2  \n\t"\
     "psrlq           $1, %%mm5  \n\t"\
 \
@@ -636,8 +636,8 @@
 
 #define WRITEBGR24MMXEXT(dst, dstw, index) \
     /* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */\
-    "movq "MANGLE(ff_M24A)", %%mm0 \n\t"\
-    "movq "MANGLE(ff_M24C)", %%mm7 \n\t"\
+    "movq "LOCAL_MANGLE(ff_M24A)", %%mm0 \n\t"\
+    "movq "LOCAL_MANGLE(ff_M24C)", %%mm7 \n\t"\
     "pshufw $0x50, %%mm2, %%mm1 \n\t" /* B3 B2 B3 B2  B1 B0 B1 B0 */\
     "pshufw $0x50, %%mm4, %%mm3 \n\t" /* G3 G2 G3 G2  G1 G0 G1 G0 */\
     "pshufw $0x00, %%mm5, %%mm6 \n\t" /* R1 R0 R1 R0  R1 R0 R1 R0 */\
@@ -656,7 +656,7 @@
     "pshufw $0x55, %%mm4, %%mm3 \n\t" /* G4 G3 G4 G3  G4 G3 G4 G3 */\
     "pshufw $0xA5, %%mm5, %%mm6 \n\t" /* R5 R4 R5 R4  R3 R2 R3 R2 */\
 \
-    "pand "MANGLE(ff_M24B)", %%mm1 \n\t" /* B5       B4        B3    */\
+    "pand "LOCAL_MANGLE(ff_M24B)", %%mm1 \n\t" /* B5       B4        B3    */\
     "pand   %%mm7, %%mm3        \n\t" /*       G4        G3       */\
     "pand   %%mm0, %%mm6        \n\t" /*    R4        R3       R2 */\
 \
@@ -670,7 +670,7 @@
 \
     "pand   %%mm7, %%mm1        \n\t" /*       B7        B6       */\
     "pand   %%mm0, %%mm3        \n\t" /*    G7        G6       G5 */\
-    "pand "MANGLE(ff_M24B)", %%mm6 \n\t" /* R7       R6        R5    */\
+    "pand "LOCAL_MANGLE(ff_M24B)", %%mm6 \n\t" /* R7       R6        R5    */\
 \
     "por    %%mm1, %%mm3        \n\t"\
     "por    %%mm3, %%mm6        \n\t"\
--- ffmpeg-4.1/libswscale/x86/yuv2rgb_template.c.orig	2016-03-29 02:25:33.000000000 +0000
+++ ffmpeg-4.1/libswscale/x86/yuv2rgb_template.c	2019-01-16 00:24:06.884000000 +0000
@@ -86,7 +86,7 @@
     "movq      %%mm6, %%mm7\n\t"                 \
     "punpcklbw %%mm4, %%mm0\n\t"                 \
     "punpcklbw %%mm4, %%mm1\n\t"                 \
-    "pand     "MANGLE(mmx_00ffw)", %%mm6\n\t"    \
+    "pand     "LOCAL_MANGLE(mmx_00ffw)", %%mm6\n\t"    \
     "psrlw     $8,    %%mm7\n\t"                 \
     "psllw     $3,    %%mm0\n\t"                 \
     "psllw     $3,    %%mm1\n\t"                 \
@@ -175,15 +175,15 @@
 #define IF1(x) x
 
 #define RGB_PACK16(gmask, is15)                  \
-    "pand      "MANGLE(mmx_redmask)", %%mm0\n\t" \
-    "pand      "MANGLE(mmx_redmask)", %%mm1\n\t" \
+    "pand      "LOCAL_MANGLE(mmx_redmask)", %%mm0\n\t" \
+    "pand      "LOCAL_MANGLE(mmx_redmask)", %%mm1\n\t" \
     "movq      %%mm2,     %%mm3\n\t"             \
     "psllw   $"AV_STRINGIFY(3-is15)", %%mm2\n\t" \
     "psrlw   $"AV_STRINGIFY(5+is15)", %%mm3\n\t" \
     "psrlw     $3,        %%mm0\n\t"             \
     IF##is15("psrlw  $1,  %%mm1\n\t")            \
-    "pand "MANGLE(pb_e0)", %%mm2\n\t"            \
-    "pand "MANGLE(gmask)", %%mm3\n\t"            \
+    "pand "LOCAL_MANGLE(pb_e0)", %%mm2\n\t"            \
+    "pand "LOCAL_MANGLE(gmask)", %%mm3\n\t"            \
     "por       %%mm2,     %%mm0\n\t"             \
     "por       %%mm3,     %%mm1\n\t"             \
     "movq      %%mm0,     %%mm2\n\t"             \
@@ -281,15 +281,15 @@
     "pshufw    $0xc6,  %%mm2, %%mm1 \n"\
     "pshufw    $0x84,  %%mm3, %%mm6 \n"\
     "pshufw    $0x38,  %%mm5, %%mm7 \n"\
-    "pand "MANGLE(mask1101)", %%mm6 \n" /* R0 G0 B0 R1 -- -- R2 G2 */\
+    "pand "LOCAL_MANGLE(mask1101)", %%mm6 \n" /* R0 G0 B0 R1 -- -- R2 G2 */\
     "movq      %%mm1,         %%mm0 \n"\
-    "pand "MANGLE(mask0110)", %%mm7 \n" /* -- -- R6 G6 B6 R7 -- -- */\
+    "pand "LOCAL_MANGLE(mask0110)", %%mm7 \n" /* -- -- R6 G6 B6 R7 -- -- */\
     "movq      %%mm1,         %%mm2 \n"\
-    "pand "MANGLE(mask0100)", %%mm1 \n" /* -- -- G3 B3 -- -- -- -- */\
+    "pand "LOCAL_MANGLE(mask0100)", %%mm1 \n" /* -- -- G3 B3 -- -- -- -- */\
     "psrlq       $48,         %%mm3 \n" /* B2 R3 -- -- -- -- -- -- */\
-    "pand "MANGLE(mask0010)", %%mm0 \n" /* -- -- -- -- G1 B1 -- -- */\
+    "pand "LOCAL_MANGLE(mask0010)", %%mm0 \n" /* -- -- -- -- G1 B1 -- -- */\
     "psllq       $32,         %%mm5 \n" /* -- -- -- -- R4 G4 B4 R5 */\
-    "pand "MANGLE(mask1001)", %%mm2 \n" /* G5 B5 -- -- -- -- G7 B7 */\
+    "pand "LOCAL_MANGLE(mask1001)", %%mm2 \n" /* G5 B5 -- -- -- -- G7 B7 */\
     "por       %%mm3,         %%mm1 \n"\
     "por       %%mm6,         %%mm0 \n"\
     "por       %%mm5,         %%mm1 \n"\
--- ffmpeg-4.1/libavcodec/x86/lpc.c.orig	2018-11-01 18:34:25.000000000 +0000
+++ ffmpeg-4.1/libavcodec/x86/lpc.c	2019-01-16 00:26:53.376000000 +0000
@@ -40,8 +40,8 @@
     x86_reg j =  n2*sizeof(int32_t);
     __asm__ volatile(
         "movsd   %4,     %%xmm7                \n\t"
-        "movapd  "MANGLE(pd_1)", %%xmm6        \n\t"
-        "movapd  "MANGLE(pd_2)", %%xmm5        \n\t"
+        "movapd  "LOCAL_MANGLE(pd_1)", %%xmm6        \n\t"
+        "movapd  "LOCAL_MANGLE(pd_2)", %%xmm5        \n\t"
         "movlhps %%xmm7, %%xmm7                \n\t"
         "subpd   %%xmm5, %%xmm7                \n\t"
         "addsd   %%xmm6, %%xmm7                \n\t"
@@ -91,9 +91,9 @@
         x86_reg i = -len*sizeof(double);
         if(j == lag-2) {
             __asm__ volatile(
-                "movsd    "MANGLE(pd_1)", %%xmm0    \n\t"
-                "movsd    "MANGLE(pd_1)", %%xmm1    \n\t"
-                "movsd    "MANGLE(pd_1)", %%xmm2    \n\t"
+                "movsd    "LOCAL_MANGLE(pd_1)", %%xmm0    \n\t"
+                "movsd    "LOCAL_MANGLE(pd_1)", %%xmm1    \n\t"
+                "movsd    "LOCAL_MANGLE(pd_1)", %%xmm2    \n\t"
                 "1:                                 \n\t"
                 "movapd   (%2,%0), %%xmm3           \n\t"
                 "movupd -8(%3,%0), %%xmm4           \n\t"
@@ -122,8 +122,8 @@
             );
         } else {
             __asm__ volatile(
-                "movsd    "MANGLE(pd_1)", %%xmm0    \n\t"
-                "movsd    "MANGLE(pd_1)", %%xmm1    \n\t"
+                "movsd    "LOCAL_MANGLE(pd_1)", %%xmm0    \n\t"
+                "movsd    "LOCAL_MANGLE(pd_1)", %%xmm1    \n\t"
                 "1:                                 \n\t"
                 "movapd   (%3,%0), %%xmm3           \n\t"
                 "movupd -8(%4,%0), %%xmm4           \n\t"
--- ffmpeg-4.1/libavutil/x86/asm.h.orig	2018-11-01 18:34:28.000000000 +0000
+++ ffmpeg-4.1/libavutil/x86/asm.h	2019-01-16 00:36:18.480000000 +0000
@@ -100,7 +100,11 @@
 #endif
 
 /* Use to export labels from asm. */
+#ifndef __midipix__
 #define LABEL_MANGLE(a) EXTERN_PREFIX #a
+#else
+#define LABEL_MANGLE(a) #a
+#endif
 
 // Use rip-relative addressing if compiling PIC code on x86-64.
 #if ARCH_X86_64 && defined(PIC)
--- ffmpeg-4.1/libavcodec/x86/h264_cabac.c.orig	2018-11-01 18:34:25.000000000 +0000
+++ ffmpeg-4.1/libavcodec/x86/h264_cabac.c	2019-01-18 20:04:01.480000000 +0000
@@ -56,7 +56,7 @@
     void *tables;
 
     __asm__ volatile(
-        "lea   "MANGLE(ff_h264_cabac_tables)", %0      \n\t"
+        "lea   "LOCAL_MANGLE(ff_h264_cabac_tables)", %0      \n\t"
         : "=&r"(tables)
         : NAMED_CONSTRAINTS_ARRAY(ff_h264_cabac_tables)
     );
@@ -132,7 +132,7 @@
     void *tables;
 
     __asm__ volatile(
-        "lea    "MANGLE(ff_h264_cabac_tables)", %0      \n\t"
+        "lea    "LOCAL_MANGLE(ff_h264_cabac_tables)", %0      \n\t"
         : "=&r"(tables)
         : NAMED_CONSTRAINTS_ARRAY(ff_h264_cabac_tables)
     );
@@ -161,7 +161,7 @@
 #ifdef BROKEN_RELOCATIONS
         "movzb %c14(%15, %q6), %6\n\t"
 #else
-        "movzb "MANGLE(ff_h264_cabac_tables)"+%c14(%6), %6\n\t"
+        "movzb "LOCAL_MANGLE(ff_h264_cabac_tables)"+%c14(%6), %6\n\t"
 #endif
         "add %11, %6                            \n\t"
 
--- ffmpeg-4.1/libavcodec/x86/cabac.h.orig	2018-11-01 18:34:25.000000000 +0000
+++ ffmpeg-4.1/libavcodec/x86/cabac.h	2019-01-18 20:20:12.052000000 +0000
@@ -143,12 +143,12 @@
         "movzbl "statep"    , "ret"                                     \n\t"\
         "mov    "range"     , "tmp"                                     \n\t"\
         "and    $0xC0       , "range"                                   \n\t"\
-        "movzbl "MANGLE(ff_h264_cabac_tables)"+"lps_off"("ret", "range", 2), "range" \n\t"\
+        "movzbl "LOCAL_MANGLE(ff_h264_cabac_tables)"+"lps_off"("ret", "range", 2), "range" \n\t"\
         "sub    "range"     , "tmp"                                     \n\t"\
         BRANCHLESS_GET_CABAC_UPDATE(ret, low, range, tmp)                    \
-        "movzbl "MANGLE(ff_h264_cabac_tables)"+"norm_off"("range"), %%ecx    \n\t"\
+        "movzbl "LOCAL_MANGLE(ff_h264_cabac_tables)"+"norm_off"("range"), %%ecx    \n\t"\
         "shl    %%cl        , "range"                                   \n\t"\
-        "movzbl "MANGLE(ff_h264_cabac_tables)"+"mlps_off"+128("ret"), "tmp"  \n\t"\
+        "movzbl "LOCAL_MANGLE(ff_h264_cabac_tables)"+"mlps_off"+128("ret"), "tmp"  \n\t"\
         "shl    %%cl        , "low"                                     \n\t"\
         "mov    "tmpbyte"   , "statep"                                  \n\t"\
         "test   "lowword"   , "lowword"                                 \n\t"\
@@ -163,7 +163,7 @@
         "shr    $15         , %%ecx                                     \n\t"\
         "bswap  "tmp"                                                   \n\t"\
         "shr    $15         , "tmp"                                     \n\t"\
-        "movzbl "MANGLE(ff_h264_cabac_tables)"+"norm_off"(%%ecx), %%ecx \n\t"\
+        "movzbl "LOCAL_MANGLE(ff_h264_cabac_tables)"+"norm_off"(%%ecx), %%ecx \n\t"\
         "sub    $0xFFFF     , "tmp"                                     \n\t"\
         "neg    %%ecx                                                   \n\t"\
         "add    $7          , %%ecx                                     \n\t"\
@@ -183,7 +183,7 @@
     void *tables;
 
     __asm__ volatile(
-        "lea    "MANGLE(ff_h264_cabac_tables)", %0      \n\t"
+        "lea    "LOCAL_MANGLE(ff_h264_cabac_tables)", %0      \n\t"
         : "=&r"(tables)
         : NAMED_CONSTRAINTS_ARRAY(ff_h264_cabac_tables)
     );
--- ffmpeg-4.1/libavcodec/x86/cavsdsp.c.orig	2018-11-01 18:34:25.000000000 +0000
+++ ffmpeg-4.1/libavcodec/x86/cavsdsp.c	2019-01-18 20:26:50.820000000 +0000
@@ -69,9 +69,9 @@
 #define QPEL_CAVSV1(A,B,C,D,E,F,OP,ADD, MUL1, MUL2) \
         "movd (%0), "#F"            \n\t"\
         "movq "#C", %%mm6           \n\t"\
-        "pmullw "MANGLE(MUL1)", %%mm6\n\t"\
+        "pmullw "LOCAL_MANGLE(MUL1)", %%mm6\n\t"\
         "movq "#D", %%mm7           \n\t"\
-        "pmullw "MANGLE(MUL2)", %%mm7\n\t"\
+        "pmullw "LOCAL_MANGLE(MUL2)", %%mm7\n\t"\
         "psllw $3, "#E"             \n\t"\
         "psubw "#E", %%mm6          \n\t"\
         "psraw $3, "#E"             \n\t"\
@@ -84,7 +84,7 @@
         "psubw "#B", %%mm6          \n\t"\
         "psraw $1, "#B"             \n\t"\
         "psubw "#A", %%mm6          \n\t"\
-        "paddw "MANGLE(ADD)", %%mm6 \n\t"\
+        "paddw "LOCAL_MANGLE(ADD)", %%mm6 \n\t"\
         "psraw $7, %%mm6            \n\t"\
         "packuswb %%mm6, %%mm6      \n\t"\
         OP(%%mm6, (%1), A, d)            \
@@ -95,12 +95,12 @@
         "movd (%0), "#F"            \n\t"\
         "movq "#C", %%mm6           \n\t"\
         "paddw "#D", %%mm6          \n\t"\
-        "pmullw "MANGLE(MUL1)", %%mm6\n\t"\
+        "pmullw "LOCAL_MANGLE(MUL1)", %%mm6\n\t"\
         "add %2, %0                 \n\t"\
         "punpcklbw %%mm7, "#F"      \n\t"\
         "psubw "#B", %%mm6          \n\t"\
         "psubw "#E", %%mm6          \n\t"\
-        "paddw "MANGLE(ADD)", %%mm6 \n\t"\
+        "paddw "LOCAL_MANGLE(ADD)", %%mm6 \n\t"\
         "psraw $3, %%mm6            \n\t"\
         "packuswb %%mm6, %%mm6      \n\t"\
         OP(%%mm6, (%1), A, d)            \
@@ -110,9 +110,9 @@
 #define QPEL_CAVSV3(A,B,C,D,E,F,OP,ADD, MUL1, MUL2) \
         "movd (%0), "#F"            \n\t"\
         "movq "#C", %%mm6           \n\t"\
-        "pmullw "MANGLE(MUL2)", %%mm6\n\t"\
+        "pmullw "LOCAL_MANGLE(MUL2)", %%mm6\n\t"\
         "movq "#D", %%mm7           \n\t"\
-        "pmullw "MANGLE(MUL1)", %%mm7\n\t"\
+        "pmullw "LOCAL_MANGLE(MUL1)", %%mm7\n\t"\
         "psllw $3, "#B"             \n\t"\
         "psubw "#B", %%mm6          \n\t"\
         "psraw $3, "#B"             \n\t"\
@@ -125,7 +125,7 @@
         "psubw "#E", %%mm6          \n\t"\
         "psraw $1, "#E"             \n\t"\
         "psubw "#F", %%mm6          \n\t"\
-        "paddw "MANGLE(ADD)", %%mm6 \n\t"\
+        "paddw "LOCAL_MANGLE(ADD)", %%mm6 \n\t"\
         "psraw $7, %%mm6            \n\t"\
         "packuswb %%mm6, %%mm6      \n\t"\
         OP(%%mm6, (%1), A, d)            \
@@ -195,7 +195,7 @@
     int h=8;\
     __asm__ volatile(\
         "pxor %%mm7, %%mm7          \n\t"\
-        "movq "MANGLE(ff_pw_5)", %%mm6\n\t"\
+        "movq "LOCAL_MANGLE(ff_pw_5)", %%mm6\n\t"\
         "1:                         \n\t"\
         "movq    (%0), %%mm0        \n\t"\
         "movq   1(%0), %%mm2        \n\t"\
@@ -221,7 +221,7 @@
         "paddw %%mm3, %%mm5         \n\t"\
         "psubw %%mm2, %%mm0         \n\t"\
         "psubw %%mm5, %%mm1         \n\t"\
-        "movq "MANGLE(ff_pw_4)", %%mm5\n\t"\
+        "movq "LOCAL_MANGLE(ff_pw_4)", %%mm5\n\t"\
         "paddw %%mm5, %%mm0         \n\t"\
         "paddw %%mm5, %%mm1         \n\t"\
         "psraw $3, %%mm0            \n\t"\
--- ffmpeg-4.1/libavcodec/x86/vc1dsp_mmx.c.orig	2018-11-01 18:34:25.000000000 +0000
+++ ffmpeg-4.1/libavcodec/x86/vc1dsp_mmx.c	2019-01-18 20:30:04.396000000 +0000
@@ -86,7 +86,7 @@
     __asm__ volatile(\
         "mov       $8, %%"FF_REG_c"        \n\t"\
         LOAD_ROUNDER_MMX("%5")\
-        "movq      "MANGLE(ff_pw_9)", %%mm6\n\t"\
+        "movq      "LOCAL_MANGLE(ff_pw_9)", %%mm6\n\t"\
         "1:                                \n\t"\
         "movd      0(%0   ), %%mm3         \n\t"\
         "movd      4(%0   ), %%mm4         \n\t"\
@@ -147,8 +147,8 @@
      MOVQ "*4+"A1", %%mm2       \n\t"                           \
      UNPACK("%%mm1")                                            \
      UNPACK("%%mm2")                                            \
-     "pmullw    "MANGLE(ff_pw_3)", %%mm1\n\t"                   \
-     "pmullw    "MANGLE(ff_pw_3)", %%mm2\n\t"                   \
+     "pmullw    "LOCAL_MANGLE(ff_pw_3)", %%mm1\n\t"                   \
+     "pmullw    "LOCAL_MANGLE(ff_pw_3)", %%mm2\n\t"                   \
      MOVQ "*0+"A2", %%mm3       \n\t"                           \
      MOVQ "*4+"A2", %%mm4       \n\t"                           \
      UNPACK("%%mm3")                                            \
@@ -192,8 +192,8 @@
     src -= src_stride;                                                  \
     __asm__ volatile(                                                       \
         LOAD_ROUNDER_MMX("%5")                                          \
-        "movq      "MANGLE(ff_pw_53)", %%mm5\n\t"                       \
-        "movq      "MANGLE(ff_pw_18)", %%mm6\n\t"                       \
+        "movq      "LOCAL_MANGLE(ff_pw_53)", %%mm5\n\t"                       \
+        "movq      "LOCAL_MANGLE(ff_pw_18)", %%mm6\n\t"                       \
         ".p2align 3                \n\t"                                \
         "1:                        \n\t"                                \
         MSPEL_FILTER13_CORE(DO_UNPACK, "movd  1", A1, A2, A3, A4)       \
@@ -249,15 +249,15 @@
     rnd -= (-4+58+13-3)*256; /* Add -256 bias */                        \
     __asm__ volatile(                                                       \
         LOAD_ROUNDER_MMX("%4")                                          \
-        "movq      "MANGLE(ff_pw_18)", %%mm6   \n\t"                    \
-        "movq      "MANGLE(ff_pw_53)", %%mm5   \n\t"                    \
+        "movq      "LOCAL_MANGLE(ff_pw_18)", %%mm6   \n\t"                    \
+        "movq      "LOCAL_MANGLE(ff_pw_53)", %%mm5   \n\t"                    \
         ".p2align 3                \n\t"                                \
         "1:                        \n\t"                                \
         MSPEL_FILTER13_CORE(DONT_UNPACK, "movq 2", A1, A2, A3, A4)      \
         NORMALIZE_MMX("$7")                                             \
         /* Remove bias */                                               \
-        "paddw     "MANGLE(ff_pw_128)", %%mm3  \n\t"                    \
-        "paddw     "MANGLE(ff_pw_128)", %%mm4  \n\t"                    \
+        "paddw     "LOCAL_MANGLE(ff_pw_128)", %%mm3  \n\t"                    \
+        "paddw     "LOCAL_MANGLE(ff_pw_128)", %%mm4  \n\t"                    \
         TRANSFER_DO_PACK(OP)                                            \
         "add       $24, %1         \n\t"                                \
         "add       %3, %2          \n\t"                                \
@@ -288,8 +288,8 @@
     rnd = 32-rnd;                                                       \
     __asm__ volatile (                                                      \
         LOAD_ROUNDER_MMX("%6")                                          \
-        "movq      "MANGLE(ff_pw_53)", %%mm5       \n\t"                \
-        "movq      "MANGLE(ff_pw_18)", %%mm6       \n\t"                \
+        "movq      "LOCAL_MANGLE(ff_pw_53)", %%mm5       \n\t"                \
+        "movq      "LOCAL_MANGLE(ff_pw_18)", %%mm6       \n\t"                \
         ".p2align 3                \n\t"                                \
         "1:                        \n\t"                                \
         MSPEL_FILTER13_CORE(DO_UNPACK, "movd   1", A1, A2, A3, A4)      \