summaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2014-01-15 12:17:20 +0100
committerDiego Biurrun <diego@biurrun.de>2014-03-20 05:03:22 -0700
commitb045283f2126637477a597f184638ebef09bf898 (patch)
tree36019cae0c7f9787f06eff08b571afc14a0caaae /libavcodec
parent8bd6f88266740068415f7da0628117f1b802efb9 (diff)
downloadffmpeg-streaming-b045283f2126637477a597f184638ebef09bf898.zip
ffmpeg-streaming-b045283f2126637477a597f184638ebef09bf898.tar.gz
ppc: dsputil: Simplify some ifdeffed function definitions
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/ppc/dsputil_ppc.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/libavcodec/ppc/dsputil_ppc.c b/libavcodec/ppc/dsputil_ppc.c
index eac0d3d..1bd11b1 100644
--- a/libavcodec/ppc/dsputil_ppc.c
+++ b/libavcodec/ppc/dsputil_ppc.c
@@ -74,9 +74,9 @@ static void clear_blocks_dcbz32_ppc(int16_t *blocks)
/* Same as above, when dcbzl clears a whole 128 bytes cache line
* i.e. the PPC970 AKA G5. */
-#if HAVE_DCBZL
static void clear_blocks_dcbz128_ppc(int16_t *blocks)
{
+#if HAVE_DCBZL
register int misal = (unsigned long) blocks & 0x0000007f;
register int i = 0;
@@ -89,26 +89,23 @@ static void clear_blocks_dcbz128_ppc(int16_t *blocks)
for (; i < sizeof(int16_t) * 6 * 64; i += 128)
__asm__ volatile ("dcbzl %0,%1" :: "b" (blocks), "r" (i) : "memory");
}
-}
#else
-static void clear_blocks_dcbz128_ppc(int16_t *blocks)
-{
memset(blocks, 0, sizeof(int16_t) * 6 * 64);
-}
#endif
+}
-#if HAVE_DCBZL
/* Check dcbz report how many bytes are set to 0 by dcbz. */
/* update 24/06/2003: Replace dcbz by dcbzl to get the intended effect
* (Apple "fixed" dcbz). Unfortunately this cannot be used unless the
* assembler knows about dcbzl ... */
static long check_dcbzl_effect(void)
{
+ long count = 0;
+#if HAVE_DCBZL
register char *fakedata = av_malloc(1024);
register char *fakedata_middle;
register long zero = 0;
register long i = 0;
- long count = 0;
if (!fakedata)
return 0L;
@@ -126,15 +123,10 @@ static long check_dcbzl_effect(void)
count++;
av_free(fakedata);
+#endif
return count;
}
-#else
-static long check_dcbzl_effect(void)
-{
- return 0;
-}
-#endif
av_cold void ff_dsputil_init_ppc(DSPContext *c, AVCodecContext *avctx)
{
OpenPOWER on IntegriCloud