[FFmpeg-devel] [PATCH] ppc bswap (WR 1.9)

Michael Niedermayer michaelni at gmx.at
Wed Sep 28 20:51:53 CEST 2011


Hi

Patch below is from wunderadio 1.9 i have no means to test this
Author is unknown


diff -wru ./libavutil/bswap.h /home/michael/wunderadio/WR1.9/ffmpeg//libavutil/bswap.h
--- ./libavutil/bswap.h 2011-09-20 17:25:06.739577809 +0200
+++ /home/michael/wunderadio/WR1.9/ffmpeg//libavutil/bswap.h    2009-02-06 02:32:39.000000000 +0100
@@ -40,6 +40,31 @@
 #   include "x86/bswap.h"
 #endif

+
+#ifdef __APPLE__
+#include <TargetConditionals.h>
+#if (TARGET_IPHONE_SIMULATOR == 0) && (TARGET_OS_IPHONE == 1)
+
+#define bswap_16 bswap_16
+static av_always_inline av_const uint16_t bswap_16(uint16_t x)
+{
+    __asm__("rev16 %0, %0" : "+r"(x));
+    return x;
+}
+
+#define bswap_32 bswap_32
+static av_always_inline av_const uint32_t bswap_32(uint32_t x)
+{
+    __asm__("rev %0, %0" : "+r"(x));
+    return x;
+}
+
+
+
+#endif
+#endif
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- Plato 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110928/19d07491/attachment.asc>


More information about the ffmpeg-devel mailing list