byte interleaving for mga
[ffmpeg.git] / postproc / rgb2rgb.c
index abe122306580d8f261fe9840c84bb592a980dd00..f9f3ec9774fd73ffa1cf2eb8fb13500e37f5f961 100644 (file)
@@ -409,3 +409,21 @@ void rgb24toyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst
                rgb24toyv12_C(src, ydst, udst, vdst, width,  height, lumStride, chromStride, srcStride);
 #endif
 }
+
+void interleaveBytes(uint8_t *src1, uint8_t *src2, uint8_t *dst,
+                    int width, int height, int src1Stride, int src2Stride, int dstStride)
+{
+#ifdef CAN_COMPILE_X86_ASM
+       // ordered per speed fasterst first
+       if(gCpuCaps.hasMMX2)
+               interleaveBytes_MMX2(src1, src2, dst, width, height, src1Stride, src2Stride, dstStride);
+       else if(gCpuCaps.has3DNow)
+               interleaveBytes_3DNow(src1, src2, dst, width, height, src1Stride, src2Stride, dstStride);
+       else if(gCpuCaps.hasMMX)
+               interleaveBytes_MMX(src1, src2, dst, width, height, src1Stride, src2Stride, dstStride);
+       else
+               interleaveBytes_C(src1, src2, dst, width, height, src1Stride, src2Stride, dstStride);
+#else
+               interleaveBytes_C(src1, src2, dst, width, height, src1Stride, src2Stride, dstStride);
+#endif
+}