1
This patch is currently being worked on to resolve all non-PIC issues with
2
the libswscale library.
3
For inquiries about this patch, please see bug #528080.
4
==========================================================================
5
--- a/libswscale/rgb2rgb_template.c
6
+++ b/libswscale/rgb2rgb_template.c
9
"test %%"REG_a", %%"REG_a" \n\t"
11
- "movq "MANGLE(mask24r)", %%mm5 \n\t"
12
- "movq "MANGLE(mask24g)", %%mm6 \n\t"
13
- "movq "MANGLE(mask24b)", %%mm7 \n\t"
14
+ "movq %0, %%mm5 \n\t"
15
+ "movq %1, %%mm6 \n\t"
16
+ "movq %2, %%mm7 \n\t"
17
+ : : "m"(mask24r), "m"(mask24g), "m"(mask24b)
22
PREFETCH" 32(%1, %%"REG_a") \n\t"
26
"mov %2, %%"REG_a" \n\t"
27
- "movq "MANGLE(ff_bgr2YCoeff)", %%mm6 \n\t"
28
- "movq "MANGLE(ff_w1111)", %%mm5 \n\t"
29
+ "movq %3, %%mm6 \n\t"
30
+ "movq %4, %%mm5 \n\t"
31
"pxor %%mm7, %%mm7 \n\t"
32
"lea (%%"REG_a", %%"REG_a", 2), %%"REG_d" \n\t"
34
@@ -2206,12 +2209,13 @@
35
"psraw $7, %%mm4 \n\t"
37
"packuswb %%mm4, %%mm0 \n\t"
38
- "paddusb "MANGLE(ff_bgr2YOffset)", %%mm0 \n\t"
39
+ "paddusb %5, %%mm0 \n\t"
41
MOVNTQ" %%mm0, (%1, %%"REG_a") \n\t"
42
"add $8, %%"REG_a" \n\t"
44
- : : "r" (src+width*3), "r" (ydst+width), "g" (-width)
45
+ : : "r" (src+width*3), "r" (ydst+width), "g" (-width),
46
+ "m"(ff_bgr2YCoeff), "m"(ff_w1111), "m"(ff_bgr2YOffset)
53
"mov %4, %%"REG_a" \n\t"
54
- "movq "MANGLE(ff_w1111)", %%mm5 \n\t"
55
- "movq "MANGLE(ff_bgr2UCoeff)", %%mm6 \n\t"
56
+ "movq %5, %%mm5 \n\t"
57
+ "movq %6, %%mm6 \n\t"
58
"pxor %%mm7, %%mm7 \n\t"
59
"lea (%%"REG_a", %%"REG_a", 2), %%"REG_d" \n\t"
60
"add %%"REG_d", %%"REG_d" \n\t"
62
"psrlw $2, %%mm0 \n\t"
63
"psrlw $2, %%mm2 \n\t"
65
- "movq "MANGLE(ff_bgr2VCoeff)", %%mm1 \n\t"
66
- "movq "MANGLE(ff_bgr2VCoeff)", %%mm3 \n\t"
67
+ "movq %7, %%mm1 \n\t"
68
+ "movq %7, %%mm3 \n\t"
70
"pmaddwd %%mm0, %%mm1 \n\t"
71
"pmaddwd %%mm2, %%mm3 \n\t"
72
@@ -2328,12 +2332,12 @@
73
"paddw %%mm1, %%mm5 \n\t"
74
"paddw %%mm3, %%mm2 \n\t"
75
"paddw %%mm5, %%mm2 \n\t"
76
- "movq "MANGLE(ff_w1111)", %%mm5 \n\t"
77
+ "movq %5, %%mm5 \n\t"
78
"psrlw $2, %%mm4 \n\t"
79
"psrlw $2, %%mm2 \n\t"
81
- "movq "MANGLE(ff_bgr2VCoeff)", %%mm1 \n\t"
82
- "movq "MANGLE(ff_bgr2VCoeff)", %%mm3 \n\t"
83
+ "movq %7, %%mm1 \n\t"
84
+ "movq %7, %%mm3 \n\t"
86
"pmaddwd %%mm4, %%mm1 \n\t"
87
"pmaddwd %%mm2, %%mm3 \n\t"
88
@@ -2357,13 +2361,16 @@
89
"punpckldq %%mm4, %%mm0 \n\t"
90
"punpckhdq %%mm4, %%mm1 \n\t"
91
"packsswb %%mm1, %%mm0 \n\t"
92
- "paddb "MANGLE(ff_bgr2UVOffset)", %%mm0 \n\t"
93
+ "paddb %8, %%mm0 \n\t"
94
"movd %%mm0, (%2, %%"REG_a") \n\t"
95
"punpckhdq %%mm0, %%mm0 \n\t"
96
"movd %%mm0, (%3, %%"REG_a") \n\t"
97
"add $4, %%"REG_a" \n\t"
99
- : : "r" (src+chromWidth*6), "r" (src+srcStride+chromWidth*6), "r" (udst+chromWidth), "r" (vdst+chromWidth), "g" (-chromWidth)
100
+ : : "r" (src+chromWidth*6), "r" (src+srcStride+chromWidth*6),
101
+ "r" (udst+chromWidth), "r" (vdst+chromWidth), "g" (-chromWidth),
102
+ "m"(ff_w1111), "m"(ff_bgr2UCoeff), "m"(ff_bgr2VCoeff),
103
+ "m"(ff_bgr2UVOffset)
107
--- a/libswscale/rgb2rgb.c
108
+++ b/libswscale/rgb2rgb.c
110
DECLARE_ASM_CONST(8, uint64_t, red_15mask) = 0x00007c0000007c00ULL;
111
DECLARE_ASM_CONST(8, uint64_t, green_15mask) = 0x000003e0000003e0ULL;
112
DECLARE_ASM_CONST(8, uint64_t, blue_15mask) = 0x0000001f0000001fULL;
114
+// Some constants from swscale.c that are used here
115
+extern const uint64_t __attribute__((visibility("hidden"))) ff_bgr2YCoeff;
116
+extern const uint64_t __attribute__((visibility("hidden"))) ff_bgr2UCoeff;
117
+extern const uint64_t __attribute__((visibility("hidden"))) ff_bgr2VCoeff;
118
+extern const uint64_t __attribute__((visibility("hidden"))) ff_bgr2YOffset;
119
+extern const uint64_t __attribute__((visibility("hidden"))) ff_bgr2UVOffset;
120
+extern const uint64_t __attribute__((visibility("hidden"))) ff_w1111;
121
+extern const uint64_t __attribute__((visibility("hidden"))) ff_M24A;
122
+extern const uint64_t __attribute__((visibility("hidden"))) ff_M24B;
123
+extern const uint64_t __attribute__((visibility("hidden"))) ff_M24C;
125
#endif /* ARCH_X86 */
127
#define RGB2YUV_SHIFT 8
128
--- a/libswscale/swscale_template.c
129
+++ b/libswscale/swscale_template.c
131
#define WRITEBGR32(dst, dstw, index, b, g, r, a, q0, q2, q3, t) REAL_WRITEBGR32(dst, dstw, index, b, g, r, a, q0, q2, q3, t)
133
#define REAL_WRITERGB16(dst, dstw, index) \
134
- "pand "MANGLE(bF8)", %%mm2 \n\t" /* B */\
135
- "pand "MANGLE(bFC)", %%mm4 \n\t" /* G */\
136
- "pand "MANGLE(bF8)", %%mm5 \n\t" /* R */\
137
+ "pand %6, %%mm2 \n\t" /* B */\
138
+ "pand %7, %%mm4 \n\t" /* G */\
139
+ "pand %6, %%mm5 \n\t" /* R */\
140
"psrlq $3, %%mm2 \n\t"\
142
"movq %%mm2, %%mm1 \n\t"\
143
@@ -695,11 +695,18 @@
144
"cmp "#dstw", "#index" \n\t"\
146
#define WRITERGB16(dst, dstw, index) REAL_WRITERGB16(dst, dstw, index)
147
+#define WRITERGB16_END \
148
+ :: "r" (&c->redDither), \
149
+ "m" (dummy), "m" (dummy), "m" (dummy),\
150
+ "r" (dest), "m" (dstW), "m" (bF8), \
152
+ : "%"REG_a, "%"REG_d, "%"REG_S \
155
#define REAL_WRITERGB15(dst, dstw, index) \
156
- "pand "MANGLE(bF8)", %%mm2 \n\t" /* B */\
157
- "pand "MANGLE(bF8)", %%mm4 \n\t" /* G */\
158
- "pand "MANGLE(bF8)", %%mm5 \n\t" /* R */\
159
+ "pand %6, %%mm2 \n\t" /* B */\
160
+ "pand %6, %%mm4 \n\t" /* G */\
161
+ "pand %6, %%mm5 \n\t" /* R */\
162
"psrlq $3, %%mm2 \n\t"\
163
"psrlq $1, %%mm5 \n\t"\
166
"cmp "#dstw", "#index" \n\t"\
168
#define WRITERGB15(dst, dstw, index) REAL_WRITERGB15(dst, dstw, index)
169
+#define WRITERGB15_END \
170
+ :: "r" (&c->redDither), \
171
+ "m" (dummy), "m" (dummy), "m" (dummy),\
172
+ "r" (dest), "m" (dstW), "m" (bF8) \
173
+ : "%"REG_a, "%"REG_d, "%"REG_S \
176
#define WRITEBGR24OLD(dst, dstw, index) \
177
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */\
178
@@ -1063,7 +1076,7 @@
181
WRITERGB15(%4, %5, %%REGa)
182
- YSCALEYUV2PACKEDX_END
186
YSCALEYUV2PACKEDX_ACCURATE
187
@@ -1077,7 +1090,7 @@
190
WRITERGB16(%4, %5, %%REGa)
191
- YSCALEYUV2PACKEDX_END
194
case PIX_FMT_YUYV422:
195
YSCALEYUV2PACKEDX_ACCURATE
196
@@ -1127,7 +1140,7 @@
199
WRITERGB15(%4, %5, %%REGa)
200
- YSCALEYUV2PACKEDX_END
205
@@ -1141,7 +1154,7 @@
208
WRITERGB16(%4, %5, %%REGa)
209
- YSCALEYUV2PACKEDX_END
212
case PIX_FMT_YUYV422:
214
@@ -1238,7 +1251,7 @@
215
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
217
:: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
218
- "a" (&c->redDither)
219
+ "a" (&c->redDither), "m" (bF8)
223
@@ -1259,7 +1272,7 @@
224
"pop %%"REG_BP" \n\t"
225
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
226
:: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
227
- "a" (&c->redDither)
228
+ "a" (&c->redDither), "m" (bF8), "m" (bFC)
231
case PIX_FMT_YUYV422:
232
@@ -1354,7 +1367,7 @@
233
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
235
:: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
236
- "a" (&c->redDither)
237
+ "a" (&c->redDither), "m" (bF8)
241
@@ -1376,7 +1389,7 @@
242
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
244
:: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
245
- "a" (&c->redDither)
246
+ "a" (&c->redDither), "m" (bF8), "m" (bFC)
249
case PIX_FMT_YUYV422:
250
@@ -1447,7 +1460,7 @@
251
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
253
:: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
254
- "a" (&c->redDither)
255
+ "a" (&c->redDither), "m" (bF8)
259
@@ -1469,7 +1482,7 @@
260
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
262
:: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
263
- "a" (&c->redDither)
264
+ "a" (&c->redDither), "m" (bF8), "m" (bFC)
267
case PIX_FMT_YUYV422:
268
@@ -1504,7 +1517,7 @@
272
- "movq "MANGLE(bm01010101)", %%mm2 \n\t"
273
+ "movq %3, %%mm2 \n\t"
274
"mov %0, %%"REG_a" \n\t"
276
"movq (%1, %%"REG_a",2), %%mm0 \n\t"
277
@@ -1515,7 +1528,7 @@
278
"movq %%mm0, (%2, %%"REG_a") \n\t"
279
"add $8, %%"REG_a" \n\t"
281
- : : "g" (-width), "r" (src+width*2), "r" (dst+width)
282
+ : : "g" (-width), "r" (src+width*2), "r" (dst+width), "m"(bm01010101)
286
@@ -1529,7 +1542,7 @@
290
- "movq "MANGLE(bm01010101)", %%mm4 \n\t"
291
+ "movq %4, %%mm4 \n\t"
292
"mov %0, %%"REG_a" \n\t"
294
"movq (%1, %%"REG_a",4), %%mm0 \n\t"
295
@@ -1546,7 +1559,8 @@
296
"movd %%mm1, (%2, %%"REG_a") \n\t"
297
"add $4, %%"REG_a" \n\t"
299
- : : "g" (-width), "r" (src1+width*4), "r" (dstU+width), "r" (dstV+width)
300
+ : : "g" (-width), "r" (src1+width*4), "r" (dstU+width), "r" (dstV+width),
305
@@ -1590,7 +1604,7 @@
309
- "movq "MANGLE(bm01010101)", %%mm4 \n\t"
310
+ "movq %4, %%mm4 \n\t"
311
"mov %0, %%"REG_a" \n\t"
313
"movq (%1, %%"REG_a",4), %%mm0 \n\t"
314
@@ -1607,7 +1621,8 @@
315
"movd %%mm1, (%2, %%"REG_a") \n\t"
316
"add $4, %%"REG_a" \n\t"
318
- : : "g" (-width), "r" (src1+width*4), "r" (dstU+width), "r" (dstV+width)
319
+ : : "g" (-width), "r" (src1+width*4), "r" (dstU+width), "r" (dstV+width),
324
@@ -1688,20 +1703,20 @@
326
if(srcFormat == PIX_FMT_BGR24){
328
- "movq "MANGLE(ff_bgr24toY1Coeff)", %%mm5 \n\t"
329
- "movq "MANGLE(ff_bgr24toY2Coeff)", %%mm6 \n\t"
331
+ "movq %0, %%mm5 \n\t"
332
+ "movq %1, %%mm6 \n\t"
333
+ : : "m"(ff_bgr24toY1Coeff), "m"(ff_bgr24toY2Coeff)
337
- "movq "MANGLE(ff_rgb24toY1Coeff)", %%mm5 \n\t"
338
- "movq "MANGLE(ff_rgb24toY2Coeff)", %%mm6 \n\t"
340
+ "movq %0, %%mm5 \n\t"
341
+ "movq %1, %%mm6 \n\t"
342
+ : : "m"(ff_rgb24toY1Coeff), "m"(ff_rgb24toY2Coeff)
347
- "movq "MANGLE(ff_bgr24toYOffset)", %%mm4 \n\t"
348
+ "movq %3, %%mm4 \n\t"
349
"mov %2, %%"REG_a" \n\t"
350
"pxor %%mm7, %%mm7 \n\t"
352
@@ -1731,7 +1746,7 @@
353
"add $4, %%"REG_a" \n\t"
356
- : "r" (dst+width), "g" (-width)
357
+ : "r" (dst+width), "g" (-width), "m"(ff_bgr24toYOffset)
361
@@ -1771,7 +1786,7 @@
362
"paddd %%mm3, %%mm1 \n\t"
363
"paddd %%mm5, %%mm4 \n\t"
365
- "movq "MANGLE(ff_bgr24toUVOffset)", %%mm3 \n\t"
366
+ "movq %4, %%mm3 \n\t"
367
"paddd %%mm3, %%mm0 \n\t"
368
"paddd %%mm3, %%mm2 \n\t"
369
"paddd %%mm3, %%mm1 \n\t"
370
@@ -1789,7 +1804,8 @@
371
"add $4, %%"REG_a" \n\t"
374
- : "r" (dstU+width), "r" (dstV+width), "g" (-width), "m"(ff_bgr24toUV[srcFormat == PIX_FMT_RGB24][0])
375
+ : "r" (dstU+width), "r" (dstV+width), "g" (-width),
376
+ "m"(ff_bgr24toUV[srcFormat == PIX_FMT_RGB24][0]), "m"(ff_bgr24toUVOffset)
380
--- a/libswscale/yuv2rgb_template.c
381
+++ b/libswscale/yuv2rgb_template.c
384
/* convert the luma part */\
385
"movq %%mm6, %%mm7;" /* Copy 8 Y Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 */\
386
- "pand "MANGLE(mmx_00ffw)", %%mm6;" /* get Y even 00 Y6 00 Y4 00 Y2 00 Y0 */\
387
+ "pand %9, %%mm6;" /* get Y even 00 Y6 00 Y4 00 Y2 00 Y0 */\
389
"psrlw $8, %%mm7;" /* get Y odd 00 Y7 00 Y5 00 Y3 00 Y1 */\
391
@@ -158,21 +158,63 @@
392
PREFETCH" 64(%2) \n\t" \
395
-#define YUV2RGB_ENDLOOP(depth) \
396
+#define YUV2RGB16_ENDLOOP(depth) \
397
"add $"AV_STRINGIFY(depth*8)", %1 \n\t" \
401
: "+r" (index), "+r" (image) \
402
- : "r" (pu - index), "r" (pv - index), "r"(&c->redDither), "r" (py - 2*index) \
403
+ : "r" (pu - index), "r" (pv - index), "r"(&c->redDither), "r" (py - 2*index), \
404
+ "m"(mmx_redmask), "m"(mmx_grnmask), "m"(dummy), "m"(mmx_00ffw) \
407
__asm__ volatile (EMMS); \
410
+#define YUV2RGB15_ENDLOOP(depth) \
411
+ "add $"AV_STRINGIFY(depth*8)", %1 \n\t" \
412
+ "add $4, %0 \n\t" \
415
+ : "+r" (index), "+r" (image) \
416
+ : "r" (pu - index), "r" (pv - index), "r"(&c->redDither), "r" (py - 2*index), \
417
+ "m"(mmx_redmask), "m"(dummy), "m"(dummy), "m"(mmx_00ffw) \
420
+ __asm__ volatile (EMMS); \
421
+ return srcSliceH; \
423
+#define YUV2RGB24_ENDLOOP(depth) \
424
+ "add $"AV_STRINGIFY(depth*8)", %1 \n\t" \
425
+ "add $4, %0 \n\t" \
428
+ : "+r" (index), "+r" (image) \
429
+ : "r" (pu - index), "r" (pv - index), "r"(&c->redDither), "r" (py - 2*index), \
430
+ "m"(ff_M24A), "m"(ff_M24C), "m"(ff_M24B), "m"(mmx_00ffw) \
433
+ __asm__ volatile (EMMS); \
434
+ return srcSliceH; \
436
+#define YUV2RGB32_ENDLOOP(depth) \
437
+ "add $"AV_STRINGIFY(depth*8)", %1 \n\t" \
438
+ "add $4, %0 \n\t" \
441
+ : "+r" (index), "+r" (image) \
442
+ : "r" (pu - index), "r" (pv - index), "r"(&c->redDither), "r" (py - 2*index), \
443
+ "m"(dummy), "m"(dummy), "m"(dummy), "m"(mmx_00ffw) \
446
+ __asm__ volatile (EMMS); \
447
+ return srcSliceH; \
450
static inline int RENAME(yuv420_rgb16)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
451
int srcSliceH, uint8_t* dst[], int dstStride[]){
458
"paddusb "RED_DITHER"(%4), %%mm1;"
460
/* mask unneeded bits off */
461
- "pand "MANGLE(mmx_redmask)", %%mm0;" /* b7b6b5b4 b3_0_0_0 b7b6b5b4 b3_0_0_0 */
462
- "pand "MANGLE(mmx_grnmask)", %%mm2;" /* g7g6g5g4 g3g2_0_0 g7g6g5g4 g3g2_0_0 */
463
- "pand "MANGLE(mmx_redmask)", %%mm1;" /* r7r6r5r4 r3_0_0_0 r7r6r5r4 r3_0_0_0 */
464
+ "pand %6, %%mm0;" /* b7b6b5b4 b3_0_0_0 b7b6b5b4 b3_0_0_0 */
465
+ "pand %7, %%mm2;" /* g7g6g5g4 g3g2_0_0 g7g6g5g4 g3g2_0_0 */
466
+ "pand %6, %%mm1;" /* r7r6r5r4 r3_0_0_0 r7r6r5r4 r3_0_0_0 */
468
"psrlw $3, %%mm0;" /* 0_0_0_b7 b6b5b4b3 0_0_0_b7 b6b5b4b3 */
469
"pxor %%mm4, %%mm4;" /* zero mm4 */
470
@@ -222,12 +264,13 @@
472
MOVNTQ " %%mm5, 8 (%1);" /* store pixel 4-7 */
475
+ YUV2RGB16_ENDLOOP(2)
478
static inline int RENAME(yuv420_rgb15)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
479
int srcSliceH, uint8_t* dst[], int dstStride[]){
488
/* mask unneeded bits off */
489
- "pand "MANGLE(mmx_redmask)", %%mm0;" /* b7b6b5b4 b3_0_0_0 b7b6b5b4 b3_0_0_0 */
490
- "pand "MANGLE(mmx_redmask)", %%mm2;" /* g7g6g5g4 g3_0_0_0 g7g6g5g4 g3_0_0_0 */
491
- "pand "MANGLE(mmx_redmask)", %%mm1;" /* r7r6r5r4 r3_0_0_0 r7r6r5r4 r3_0_0_0 */
492
+ "pand %6, %%mm0;" /* b7b6b5b4 b3_0_0_0 b7b6b5b4 b3_0_0_0 */
493
+ "pand %6, %%mm2;" /* g7g6g5g4 g3_0_0_0 g7g6g5g4 g3_0_0_0 */
494
+ "pand %6, %%mm1;" /* r7r6r5r4 r3_0_0_0 r7r6r5r4 r3_0_0_0 */
496
"psrlw $3, %%mm0;" /* 0_0_0_b7 b6b5b4b3 0_0_0_b7 b6b5b4b3 */
497
"psrlw $1, %%mm1;" /* 0_r7r6r5 r4r3_0_0 0_r7r6r5 r4r3_0_0 */
498
@@ -279,12 +322,13 @@
500
MOVNTQ " %%mm5, 8 (%1);" /* store pixel 4-7 */
503
+ YUV2RGB15_ENDLOOP(2)
506
static inline int RENAME(yuv420_rgb24)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
507
int srcSliceH, uint8_t* dst[], int dstStride[]){
515
/* mm0=B, %%mm2=G, %%mm1=R */
517
- "movq "MANGLE(ff_M24A)", %%mm4 \n\t"
518
- "movq "MANGLE(ff_M24C)", %%mm7 \n\t"
519
+ "movq %6, %%mm4 \n\t"
520
+ "movq %7, %%mm7 \n\t"
521
"pshufw $0x50, %%mm0, %%mm5 \n\t" /* B3 B2 B3 B2 B1 B0 B1 B0 */
522
"pshufw $0x50, %%mm2, %%mm3 \n\t" /* G3 G2 G3 G2 G1 G0 G1 G0 */
523
"pshufw $0x00, %%mm1, %%mm6 \n\t" /* R1 R0 R1 R0 R1 R0 R1 R0 */
525
"pshufw $0x55, %%mm2, %%mm3 \n\t" /* G4 G3 G4 G3 G4 G3 G4 G3 */
526
"pshufw $0xA5, %%mm1, %%mm6 \n\t" /* R5 R4 R5 R4 R3 R2 R3 R2 */
528
- "pand "MANGLE(ff_M24B)", %%mm5 \n\t" /* B5 B4 B3 */
529
+ "pand %8, %%mm5 \n\t" /* B5 B4 B3 */
530
"pand %%mm7, %%mm3 \n\t" /* G4 G3 */
531
"pand %%mm4, %%mm6 \n\t" /* R4 R3 R2 */
535
"pand %%mm7, %%mm5 \n\t" /* B7 B6 */
536
"pand %%mm4, %%mm3 \n\t" /* G7 G6 G5 */
537
- "pand "MANGLE(ff_M24B)", %%mm6 \n\t" /* R7 R6 R5 */
538
+ "pand %8, %%mm6 \n\t" /* R7 R6 R5 */
539
"movd 4 (%3, %0), %%mm1;" /* Load 4 Cr 00 00 00 00 v3 v2 v1 v0 */
541
"por %%mm5, %%mm3 \n\t"
543
"pxor %%mm4, %%mm4 \n\t"
547
+ YUV2RGB24_ENDLOOP(3)
550
#define RGB_PLANAR2PACKED32 \
552
static inline int RENAME(yuv420_rgb32)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
553
int srcSliceH, uint8_t* dst[], int dstStride[]){
560
"pcmpeqd %%mm3, %%mm3;" /* fill mm3 */
564
+ YUV2RGB32_ENDLOOP(4)
566
--- a/libswscale/yuv2rgb.c
567
+++ b/libswscale/yuv2rgb.c
569
DECLARE_ASM_CONST(8, uint64_t, mmx_redmask) = 0xf8f8f8f8f8f8f8f8ULL;
570
DECLARE_ASM_CONST(8, uint64_t, mmx_grnmask) = 0xfcfcfcfcfcfcfcfcULL;
572
+extern const uint64_t __attribute__((visibility("hidden"))) ff_M24A;
573
+extern const uint64_t __attribute__((visibility("hidden"))) ff_M24B;
574
+extern const uint64_t __attribute__((visibility("hidden"))) ff_M24C;