diff options
author | D Richard Felker III <dalias@aerifal.cx> | 2003-01-23 04:19:24 +0000 |
---|---|---|
committer | D Richard Felker III <dalias@aerifal.cx> | 2003-01-23 04:19:24 +0000 |
commit | 9b1663fcd04822acde72d023601427726723c053 (patch) | |
tree | c8ec60c4015560c76dbe3a0dc7392133fc57b362 /postproc | |
parent | e78df69997e3c357b721631dbaac0b3d1c019b01 (diff) | |
download | ffmpeg-9b1663fcd04822acde72d023601427726723c053.tar.gz |
C implementation of the median deinterlacer (seems to be the only one
that generates tolerable output for anime) so it will work on non-MMX
architectures. Someone should optimize it better eventually.
Originally committed as revision 9071 to svn://svn.mplayerhq.hu/mplayer/trunk/postproc
Diffstat (limited to 'postproc')
-rw-r--r-- | postproc/postprocess.c | 2 | ||||
-rw-r--r-- | postproc/postprocess_template.c | 25 |
2 files changed, 16 insertions, 11 deletions
diff --git a/postproc/postprocess.c b/postproc/postprocess.c index 222c39db00..b25c24baf2 100644 --- a/postproc/postprocess.c +++ b/postproc/postprocess.c @@ -34,7 +34,7 @@ Horizontal X1# a E E LinIpolDeinterlace e E E* CubicIpolDeinterlace a e e* LinBlendDeinterlace e E E* -MedianDeinterlace# Ec Ec +MedianDeinterlace# E Ec Ec TempDeNoiser# E e e * i dont have a 3dnow CPU -> its untested, but noone said it doesnt work so it seems to work diff --git a/postproc/postprocess_template.c b/postproc/postprocess_template.c index df54e6f09c..af48cdcba8 100644 --- a/postproc/postprocess_template.c +++ b/postproc/postprocess_template.c @@ -1889,19 +1889,24 @@ MEDIAN((%%edx, %1), (%%edx, %1, 2), (%0, %1, 8)) ); #endif // MMX #else - //FIXME - int x; + int x, y; src+= 4*stride; + // FIXME - there should be a way to do a few columns in parallel like w/mmx for(x=0; x<8; x++) { - src[0 ] = (src[0 ] + 2*src[stride ] + src[stride*2])>>2; - src[stride ] = (src[stride ] + 2*src[stride*2] + src[stride*3])>>2; - src[stride*2] = (src[stride*2] + 2*src[stride*3] + src[stride*4])>>2; - src[stride*3] = (src[stride*3] + 2*src[stride*4] + src[stride*5])>>2; - src[stride*4] = (src[stride*4] + 2*src[stride*5] + src[stride*6])>>2; - src[stride*5] = (src[stride*5] + 2*src[stride*6] + src[stride*7])>>2; - src[stride*6] = (src[stride*6] + 2*src[stride*7] + src[stride*8])>>2; - src[stride*7] = (src[stride*7] + 2*src[stride*8] + src[stride*9])>>2; + uint8_t *colsrc = src; + for (y=0; y<4; y++) + { + int a, b, c, d, e, f; + a = colsrc[0 ]; + b = colsrc[stride ]; + c = colsrc[stride*2]; + d = (a-b)>>31; + e = (b-c)>>31; + f = (c-a)>>31; + colsrc[stride ] = (a|(d^f)) & (b|(d^e)) & (c|(e^f)); + colsrc += stride*2; + } src++; } #endif |