History

rgb2rgb_template: add MMX/SSE2/AVX-optimized deinterleaveBytes

Michael Niedermayer committed 12 years ago

Commit 91c98181 parent 7597e6e1 file · +27 −0Browse files

Unified · Split

libswscale/x86/rgb2rgb_template.c+27−0
@@ -1943,6 +1943,30 @@ static void RENAME(interleaveBytes)(const uint8_t *src1, const uint8_t *src2, ui · 1942 unmodified lines
19431943 }
19441944 #endif /* !COMPILE_TEMPLATE_AMD3DNOW && !COMPILE_TEMPLATE_AVX */
19451945
1946+#if !COMPILE_TEMPLATE_AMD3DNOW && (ARCH_X86_32 || COMPILE_TEMPLATE_SSE2) && COMPILE_TEMPLATE_MMXEXT == COMPILE_TEMPLATE_SSE2 && HAVE_YASM
1947+void RENAME(ff_nv12ToUV)(uint8_t *dstU, uint8_t *dstV,
1948+ const uint8_t *src, const uint8_t *unused, int w,
1949+ uint32_t *unused2);
1950+static void RENAME(deinterleaveBytes)(const uint8_t *src, uint8_t *dst1, uint8_t *dst2,
1951+ int width, int height, int srcStride,
1952+ int dst1Stride, int dst2Stride)
1953+{
1954+ int h;
1955+
1956+ for (h = 0; h < height; h++) {
1957+ RENAME(ff_nv12ToUV)(dst1, dst2, src, NULL, width, NULL);
1958+ src += srcStride;
1959+ dst1 += dst1Stride;
1960+ dst2 += dst2Stride;
1961+ }
1962+ __asm__(
1963+ EMMS" \n\t"
1964+ SFENCE" \n\t"
1965+ ::: "memory"
1966+ );
1967+}
1968+#endif /* !COMPILE_TEMPLATE_AMD3DNOW */
1969+
19461970 #if !COMPILE_TEMPLATE_SSE2
19471971 #if !COMPILE_TEMPLATE_AMD3DNOW
19481972 static inline void RENAME(vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2,
@@ -2512,4 +2536,7 @@ static av_cold void RENAME(rgb2rgb_init)(void) · 563 unmodified lines
25122536 #if !COMPILE_TEMPLATE_AMD3DNOW && !COMPILE_TEMPLATE_AVX
25132537 interleaveBytes = RENAME(interleaveBytes);
25142538 #endif /* !COMPILE_TEMPLATE_AMD3DNOW && !COMPILE_TEMPLATE_AVX */
2539+#if !COMPILE_TEMPLATE_AMD3DNOW && (ARCH_X86_32 || COMPILE_TEMPLATE_SSE2) && COMPILE_TEMPLATE_MMXEXT == COMPILE_TEMPLATE_SSE2 && HAVE_YASM
2540+ deinterleaveBytes = RENAME(deinterleaveBytes);
2541+#endif
25152542 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t