Commit 13405ecd authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '30f3f959'

* commit '30f3f959':
  ppc: dsputil: K&R formatting cosmetics
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 047cf46e 30f3f959
This diff is collapsed.
...@@ -24,11 +24,13 @@ ...@@ -24,11 +24,13 @@
#define AVCODEC_PPC_DSPUTIL_ALTIVEC_H #define AVCODEC_PPC_DSPUTIL_ALTIVEC_H
#include <stdint.h> #include <stdint.h>
#include "libavcodec/dsputil.h"
void ff_put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); #include "libavcodec/dsputil.h"
void ff_avg_pixels16_altivec(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); void ff_avg_pixels16_altivec(uint8_t *block, const uint8_t *pixels,
ptrdiff_t line_size, int h);
void ff_put_pixels16_altivec(uint8_t *block, const uint8_t *pixels,
ptrdiff_t line_size, int h);
void ff_fdct_altivec(int16_t *block); void ff_fdct_altivec(int16_t *block);
void ff_gmc1_altivec(uint8_t *dst, uint8_t *src, int stride, int h, void ff_gmc1_altivec(uint8_t *dst, uint8_t *src, int stride, int h,
...@@ -36,7 +38,7 @@ void ff_gmc1_altivec(uint8_t *dst, uint8_t *src, int stride, int h, ...@@ -36,7 +38,7 @@ void ff_gmc1_altivec(uint8_t *dst, uint8_t *src, int stride, int h,
void ff_idct_put_altivec(uint8_t *dest, int line_size, int16_t *block); void ff_idct_put_altivec(uint8_t *dest, int line_size, int16_t *block);
void ff_idct_add_altivec(uint8_t *dest, int line_size, int16_t *block); void ff_idct_add_altivec(uint8_t *dest, int line_size, int16_t *block);
void ff_dsputil_init_altivec(DSPContext* c, AVCodecContext *avctx); void ff_dsputil_init_altivec(DSPContext *c, AVCodecContext *avctx);
void ff_int_init_altivec(DSPContext* c, AVCodecContext *avctx); void ff_int_init_altivec(DSPContext *c, AVCodecContext *avctx);
#endif /* AVCODEC_PPC_DSPUTIL_ALTIVEC_H */ #endif /* AVCODEC_PPC_DSPUTIL_ALTIVEC_H */
...@@ -51,23 +51,23 @@ ...@@ -51,23 +51,23 @@
*/ */
static void clear_blocks_dcbz32_ppc(int16_t *blocks) static void clear_blocks_dcbz32_ppc(int16_t *blocks)
{ {
register int misal = ((unsigned long)blocks & 0x00000010); register int misal = ((unsigned long) blocks & 0x00000010);
register int i = 0; register int i = 0;
if (misal) { if (misal) {
((unsigned long*)blocks)[0] = 0L; ((unsigned long *) blocks)[0] = 0L;
((unsigned long*)blocks)[1] = 0L; ((unsigned long *) blocks)[1] = 0L;
((unsigned long*)blocks)[2] = 0L; ((unsigned long *) blocks)[2] = 0L;
((unsigned long*)blocks)[3] = 0L; ((unsigned long *) blocks)[3] = 0L;
i += 16; i += 16;
} }
for ( ; i < sizeof(int16_t)*6*64-31 ; i += 32) { for (; i < sizeof(int16_t) * 6 * 64 - 31; i += 32)
__asm__ volatile("dcbz %0,%1" : : "b" (blocks), "r" (i) : "memory"); __asm__ volatile ("dcbz %0,%1" :: "b" (blocks), "r" (i) : "memory");
}
if (misal) { if (misal) {
((unsigned long*)blocks)[188] = 0L; ((unsigned long *) blocks)[188] = 0L;
((unsigned long*)blocks)[189] = 0L; ((unsigned long *) blocks)[189] = 0L;
((unsigned long*)blocks)[190] = 0L; ((unsigned long *) blocks)[190] = 0L;
((unsigned long*)blocks)[191] = 0L; ((unsigned long *) blocks)[191] = 0L;
i += 16; i += 16;
} }
} }
...@@ -77,23 +77,23 @@ static void clear_blocks_dcbz32_ppc(int16_t *blocks) ...@@ -77,23 +77,23 @@ static void clear_blocks_dcbz32_ppc(int16_t *blocks)
#if HAVE_DCBZL #if HAVE_DCBZL
static void clear_blocks_dcbz128_ppc(int16_t *blocks) static void clear_blocks_dcbz128_ppc(int16_t *blocks)
{ {
register int misal = ((unsigned long)blocks & 0x0000007f); register int misal = ((unsigned long) blocks & 0x0000007f);
register int i = 0; register int i = 0;
if (misal) { if (misal) {
/* We could probably also optimize this case, /* We could probably also optimize this case,
* but there's not much point as the machines * but there's not much point as the machines
* aren't available yet (2003-06-26). */ * aren't available yet (2003-06-26). */
memset(blocks, 0, sizeof(int16_t)*6*64); memset(blocks, 0, sizeof(int16_t) * 6 * 64);
} } else {
else for (; i < sizeof(int16_t) * 6 * 64; i += 128)
for ( ; i < sizeof(int16_t)*6*64 ; i += 128) { __asm__ volatile ("dcbzl %0,%1" :: "b" (blocks), "r" (i) : "memory");
__asm__ volatile("dcbzl %0,%1" : : "b" (blocks), "r" (i) : "memory");
} }
} }
#else #else
static void clear_blocks_dcbz128_ppc(int16_t *blocks) static void clear_blocks_dcbz128_ppc(int16_t *blocks)
{ {
memset(blocks, 0, sizeof(int16_t)*6*64); memset(blocks, 0, sizeof(int16_t) * 6 * 64);
} }
#endif #endif
...@@ -110,9 +110,8 @@ static long check_dcbzl_effect(void) ...@@ -110,9 +110,8 @@ static long check_dcbzl_effect(void)
register long i = 0; register long i = 0;
long count = 0; long count = 0;
if (!fakedata) { if (!fakedata)
return 0L; return 0L;
}
fakedata_middle = (fakedata + 512); fakedata_middle = (fakedata + 512);
...@@ -120,12 +119,11 @@ static long check_dcbzl_effect(void) ...@@ -120,12 +119,11 @@ static long check_dcbzl_effect(void)
/* Below the constraint "b" seems to mean "address base register" /* Below the constraint "b" seems to mean "address base register"
* in gcc-3.3 / RS/6000 speaks. Seems to avoid using r0, so.... */ * in gcc-3.3 / RS/6000 speaks. Seems to avoid using r0, so.... */
__asm__ volatile("dcbzl %0, %1" : : "b" (fakedata_middle), "r" (zero)); __asm__ volatile ("dcbzl %0, %1" :: "b" (fakedata_middle), "r" (zero));
for (i = 0; i < 1024 ; i ++) { for (i = 0; i < 1024; i++)
if (fakedata[i] == (char)0) if (fakedata[i] == (char) 0)
count++; count++;
}
av_free(fakedata); av_free(fakedata);
...@@ -178,6 +176,5 @@ av_cold void ff_dsputil_init_ppc(DSPContext *c, AVCodecContext *avctx) ...@@ -178,6 +176,5 @@ av_cold void ff_dsputil_init_ppc(DSPContext *c, AVCodecContext *avctx)
c->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM; c->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
} }
} }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment