diff options
author | Brian Foley <bfoley@compsoc.nuigalway.ie> | 2006-11-26 18:25:07 +0000 |
---|---|---|
committer | Guillaume Poirier <gpoirier@mplayerhq.hu> | 2006-11-26 18:25:07 +0000 |
commit | 49cef7443a37a91827f0b8d8f7494f1fec563a1b (patch) | |
tree | 106111d78739644196ace939788c4916e1b94deb /libavcodec | |
parent | 61f5b14a8e2b4f64acb6296ac64c2309e13d3ae9 (diff) | |
download | ffmpeg-streaming-49cef7443a37a91827f0b8d8f7494f1fec563a1b.zip ffmpeg-streaming-49cef7443a37a91827f0b8d8f7494f1fec563a1b.tar.gz |
Move copy_block* functions to dsp dsputil.h
Patch by Brian Foley % bfoley A compsoc P nuigalway P ie %
Original thread:
Date: Nov 26, 2006 6:44 PM
Subject: Re: [Ffmpeg-devel] [PATCH] put_mpeg4_qpel16_h_lowpass altivec, take 2
Originally committed as revision 7172 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/dsputil.c | 77 | ||||
-rw-r--r-- | libavcodec/dsputil.h | 77 | ||||
-rw-r--r-- | libavcodec/sh4/qpel.c | 67 |
3 files changed, 77 insertions, 144 deletions
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c index 50ef6b3..51eddbc 100644 --- a/libavcodec/dsputil.c +++ b/libavcodec/dsputil.c @@ -1513,83 +1513,6 @@ static void put_no_rnd_h264_chroma_mc8_c(uint8_t *dst/*align 8*/, uint8_t *src/* } } -static inline void copy_block2(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h) -{ - int i; - for(i=0; i<h; i++) - { - ST16(dst , LD16(src )); - dst+=dstStride; - src+=srcStride; - } -} - -static inline void copy_block4(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h) -{ - int i; - for(i=0; i<h; i++) - { - ST32(dst , LD32(src )); - dst+=dstStride; - src+=srcStride; - } -} - -static inline void copy_block8(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h) -{ - int i; - for(i=0; i<h; i++) - { - ST32(dst , LD32(src )); - ST32(dst+4 , LD32(src+4 )); - dst+=dstStride; - src+=srcStride; - } -} - -static inline void copy_block16(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h) -{ - int i; - for(i=0; i<h; i++) - { - ST32(dst , LD32(src )); - ST32(dst+4 , LD32(src+4 )); - ST32(dst+8 , LD32(src+8 )); - ST32(dst+12, LD32(src+12)); - dst+=dstStride; - src+=srcStride; - } -} - -static inline void copy_block17(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h) -{ - int i; - for(i=0; i<h; i++) - { - ST32(dst , LD32(src )); - ST32(dst+4 , LD32(src+4 )); - ST32(dst+8 , LD32(src+8 )); - ST32(dst+12, LD32(src+12)); - dst[16]= src[16]; - dst+=dstStride; - src+=srcStride; - } -} - -static inline void copy_block9(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h) -{ - int i; - for(i=0; i<h; i++) - { - ST32(dst , LD32(src )); - ST32(dst+4 , LD32(src+4 )); - dst[8]= src[8]; - dst+=dstStride; - src+=srcStride; - } -} - - #define QPEL_MC(r, OPNAME, RND, OP) \ static void OPNAME ## mpeg4_qpel8_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\ uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\ diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h index 1097b87..35deb6a 100644 --- a/libavcodec/dsputil.h +++ b/libavcodec/dsputil.h @@ -698,4 +698,81 @@ static int name16(void /*MpegEncContext*/ *s, uint8_t *dst, uint8_t *src, int st return score;\ } + +static inline void copy_block2(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h) +{ + int i; + for(i=0; i<h; i++) + { + ST16(dst , LD16(src )); + dst+=dstStride; + src+=srcStride; + } +} + +static inline void copy_block4(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h) +{ + int i; + for(i=0; i<h; i++) + { + ST32(dst , LD32(src )); + dst+=dstStride; + src+=srcStride; + } +} + +static inline void copy_block8(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h) +{ + int i; + for(i=0; i<h; i++) + { + ST32(dst , LD32(src )); + ST32(dst+4 , LD32(src+4 )); + dst+=dstStride; + src+=srcStride; + } +} + +static inline void copy_block9(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h) +{ + int i; + for(i=0; i<h; i++) + { + ST32(dst , LD32(src )); + ST32(dst+4 , LD32(src+4 )); + dst[8]= src[8]; + dst+=dstStride; + src+=srcStride; + } +} + +static inline void copy_block16(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h) +{ + int i; + for(i=0; i<h; i++) + { + ST32(dst , LD32(src )); + ST32(dst+4 , LD32(src+4 )); + ST32(dst+8 , LD32(src+8 )); + ST32(dst+12, LD32(src+12)); + dst+=dstStride; + src+=srcStride; + } +} + +static inline void copy_block17(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h) +{ + int i; + for(i=0; i<h; i++) + { + ST32(dst , LD32(src )); + ST32(dst+4 , LD32(src+4 )); + ST32(dst+8 , LD32(src+8 )); + ST32(dst+12, LD32(src+12)); + dst[16]= src[16]; + dst+=dstStride; + src+=srcStride; + } +} + #endif diff --git a/libavcodec/sh4/qpel.c b/libavcodec/sh4/qpel.c index 5e5f8d1..7a73ac5 100644 --- a/libavcodec/sh4/qpel.c +++ b/libavcodec/sh4/qpel.c @@ -564,73 +564,6 @@ H264_CHROMA_MC(avg_ , op_avg) #undef op_avg #undef op_put -/* not yet optimized */ -static inline void copy_block4(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h) -{ - int i; - for(i=0; i<h; i++) - { - ST32(dst , LD32(src )); - dst+=dstStride; - src+=srcStride; - } -} - -static inline void copy_block8(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h) -{ - int i; - for(i=0; i<h; i++) - { - ST32(dst , LD32(src )); - ST32(dst+4 , LD32(src+4 )); - dst+=dstStride; - src+=srcStride; - } -} - -static inline void copy_block16(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h) -{ - int i; - for(i=0; i<h; i++) - { - ST32(dst , LD32(src )); - ST32(dst+4 , LD32(src+4 )); - ST32(dst+8 , LD32(src+8 )); - ST32(dst+12, LD32(src+12)); - dst+=dstStride; - src+=srcStride; - } -} - -static inline void copy_block17(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h) -{ - int i; - for(i=0; i<h; i++) - { - ST32(dst , LD32(src )); - ST32(dst+4 , LD32(src+4 )); - ST32(dst+8 , LD32(src+8 )); - ST32(dst+12, LD32(src+12)); - dst[16]= src[16]; - dst+=dstStride; - src+=srcStride; - } -} - -static inline void copy_block9(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h) -{ - int i; - for(i=0; i<h; i++) - { - ST32(dst , LD32(src )); - ST32(dst+4 , LD32(src+4 )); - dst[8]= src[8]; - dst+=dstStride; - src+=srcStride; - } -} -/* end not optimized */ - #define QPEL_MC(r, OPNAME, RND, OP) \ static void OPNAME ## mpeg4_qpel8_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\ uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\ |