[FFmpeg-devel] ffmpeg on SH4
Tamas Selmeci
tselmeci
Mon Dec 10 12:12:00 CET 2007
Hello,
Diego Biurrun wrote:
> Please send us the patch.
Included as inline.
> For the rest of the problems, please ask on the ffmpeg-user, it is
> offtopic here.
OK. But now the -fno-strict-aliasing seems to solve the problem...
---------------------------------------
diff -pru orig/ffmpeg/libavcodec/dsputil.h
hacked/ffmpeg/libavcodec/dsputil.h
--- orig/ffmpeg/libavcodec/dsputil.h 2007-12-04 08:16:26.000000000 +0100
+++ hacked/ffmpeg/libavcodec/dsputil.h 2007-12-04 11:38:56.000000000 +0100
@@ -121,9 +121,9 @@ typedef void (*h264_weight_func)(uint8_t
typedef void (*h264_biweight_func)(uint8_t *dst, uint8_t *src, int
stride, int log2_denom, int weightd, int weights, int offset);
#define DEF_OLD_QPEL(name)\
-void ff_put_ ## name (uint8_t *dst/*align width (8 or 16)*/,
uint8_t *src/*align 1*/, int stride);\
-void ff_put_no_rnd_ ## name (uint8_t *dst/*align width (8 or 16)*/,
uint8_t *src/*align 1*/, int stride);\
-void ff_avg_ ## name (uint8_t *dst/*align width (8 or 16)*/,
uint8_t *src/*align 1*/, int stride);
+static void ff_put_ ## name (uint8_t *dst/*align width (8 or
16)*/, uint8_t *src/*align 1*/, int stride);\
+static void ff_put_no_rnd_ ## name (uint8_t *dst/*align width (8 or
16)*/, uint8_t *src/*align 1*/, int stride);\
+static void ff_avg_ ## name (uint8_t *dst/*align width (8 or
16)*/, uint8_t *src/*align 1*/, int stride);
DEF_OLD_QPEL(qpel16_mc11_old_c)
DEF_OLD_QPEL(qpel16_mc31_old_c)
diff -pru orig/ffmpeg/libavcodec/sh4/dsputil_align.c
hacked/ffmpeg/libavcodec/sh4/dsputil_align.c
--- orig/ffmpeg/libavcodec/sh4/dsputil_align.c 2007-12-04
08:16:23.000000000 +0100
+++ hacked/ffmpeg/libavcodec/sh4/dsputil_align.c 2007-12-04
11:44:40.000000000 +0100
@@ -262,13 +262,20 @@ if (sz==16) { \
static void op##_##rnd##_pixels##sz##_##xy (uint8_t * dest, const
uint8_t * ref, \
const int stride, int height) \
{ \
+ /* This eliminates "undefined reference to no_rnd_avg2" \
+ and such messages, but may seriously damaga video decoding \
+ functionality... */ \
+ return; \
+}
+
+/*
switch((int)ref&3) { \
case 0:OP_N##0(sz,rnd##_##avgfunc); return; \
case 1:OP_N(1,sz,rnd##_##avgfunc); return; \
case 2:OP_N(2,sz,rnd##_##avgfunc); return; \
case 3:OP_N(3,sz,rnd##_##avgfunc); return; \
} \
-}
+*/
#define OP put
diff -pru orig/ffmpeg/libavcodec/sh4/dsputil_sh4.c
hacked/ffmpeg/libavcodec/sh4/dsputil_sh4.c
--- orig/ffmpeg/libavcodec/sh4/dsputil_sh4.c 2007-12-04
08:16:23.000000000 +0100
+++ hacked/ffmpeg/libavcodec/sh4/dsputil_sh4.c 2007-12-04
11:41:12.000000000 +0100
@@ -26,7 +26,7 @@
static void memzero_align8(void *dst,size_t size)
{
#if defined(__SH4__) || defined(__SH4_SINGLE__) ||
defined(__SH4_SINGLE_ONLY__)
- (char*)dst+=size;
+ dst+=size;
size/=8*4;
asm(
#if defined(__SH4__)
diff -pru orig/ffmpeg/libavcodec/sh4/idct_sh4.c
hacked/ffmpeg/libavcodec/sh4/idct_sh4.c
--- orig/ffmpeg/libavcodec/sh4/idct_sh4.c 2007-12-04 08:16:23.000000000
+0100
+++ hacked/ffmpeg/libavcodec/sh4/idct_sh4.c 2007-12-04
11:37:18.000000000 +0100
@@ -126,7 +126,7 @@ static void load_matrix_(float xf[],cons
/* this code work worse on gcc cvs. 3.2.3 work fine */
-#if 1
+#if 0
//optimized
void idct_sh4(DCTELEM *block)
----------------------------------------
--
Tamas Selmeci
R&D Engineer
DENSION Audio Systems Ltd.
H-1116 Budapest, Sztregova u. 1.
HUNGARY
Tel: +36-1-463-0470
Fax: +36-1-463-0479
www.dension.com
mailto: tselmeci at dension.com
More information about the ffmpeg-devel
mailing list