From eb6688724ceb0e222ccc9f1de6640bfabdd67a43 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 9 Nov 2012 01:31:49 +0100 Subject: Replace fast_memcpy() uses fast_memcpy, defined in fastmemcpy.h, used to be mplayer's "optimized" memcpy. It has been removed from this fork, and fast_memcpy has been reduced to an alias for memcpy. Replace all remaining uses of the fast_memcpy macro alias. --- libaf/af_format.c | 3 +-- libaf/reorder_ch.c | 7 +++---- libao2/ao_dsound.c | 5 ++--- libmpcodecs/ad_mpg123.c | 2 -- libmpcodecs/vf_down3dright.c | 2 +- libmpcodecs/vf_noise.c | 4 ++-- libmpcodecs/vf_phase.c | 4 ++-- libmpcodecs/vf_pullup.c | 4 ++-- libmpcodecs/vf_unsharp.c | 4 ++-- libmpcodecs/vf_yadif.c | 10 +++++----- libmpdemux/demux_asf.c | 9 ++++----- libmpdemux/demux_gif.c | 4 ++-- libmpdemux/demuxer.c | 4 +--- libvo/fastmemcpy.h | 3 --- 14 files changed, 27 insertions(+), 38 deletions(-) diff --git a/libaf/af_format.c b/libaf/af_format.c index bdbc9a7c4c..4ac9caaa85 100644 --- a/libaf/af_format.c +++ b/libaf/af_format.c @@ -31,7 +31,6 @@ #include "config.h" #include "af.h" #include "mpbswap.h" -#include "libvo/fastmemcpy.h" /* Functions used by play to convert the input audio to the correct format */ @@ -295,7 +294,7 @@ static struct mp_audio* play(struct af_instance* af, struct mp_audio* data) if(c->bps != l->bps) change_bps(c->audio,l->audio,len,c->bps,l->bps); else - fast_memcpy(l->audio,c->audio,len*c->bps); + memcpy(l->audio,c->audio,len*c->bps); break; } } diff --git a/libaf/reorder_ch.c b/libaf/reorder_ch.c index d1d7e8de63..50379de2c5 100644 --- a/libaf/reorder_ch.c +++ b/libaf/reorder_ch.c @@ -24,7 +24,6 @@ #include #include #include -#include "libvo/fastmemcpy.h" #include "reorder_ch.h" @@ -285,7 +284,7 @@ void reorder_channel_copy(void *src, int samplesize) { if (dest_layout==src_layout) { - fast_memcpy(dest, src, samples*samplesize); + memcpy(dest, src, samples*samplesize); return; } if (!AF_IS_SAME_CH_NUM(dest_layout,src_layout)) { @@ -400,7 +399,7 @@ void reorder_channel_copy(void *src, mp_msg(MSGT_GLOBAL, MSGL_WARN, "[reorder_channel_copy] unsupport " "from %x to %x, %d * %d\n", src_layout, dest_layout, samples, samplesize); - fast_memcpy(dest, src, samples*samplesize); + memcpy(dest, src, samples*samplesize); } } @@ -1327,7 +1326,7 @@ void reorder_channel_copy_nch(void *src, src_layout < 0 || dest_layout < 0 || src_layout >= AF_CHANNEL_LAYOUT_SOURCE_NUM || dest_layout >= AF_CHANNEL_LAYOUT_SOURCE_NUM) - fast_memcpy(dest, src, samples*samplesize); + memcpy(dest, src, samples*samplesize); else if (chnum == 6) reorder_channel_copy(src, channel_layout_mapping_6ch[src_layout], dest, channel_layout_mapping_6ch[dest_layout], diff --git a/libao2/ao_dsound.c b/libao2/ao_dsound.c index 4ef7029c29..f2f44dd401 100644 --- a/libao2/ao_dsound.c +++ b/libao2/ao_dsound.c @@ -37,7 +37,6 @@ #include "audio_out.h" #include "audio_out_internal.h" #include "mp_msg.h" -#include "libvo/fastmemcpy.h" #include "osdep/timer.h" #include "subopt-helper.h" @@ -358,8 +357,8 @@ static int write_buffer(unsigned char *data, int len) if(write_offset>=buffer_size)write_offset=dwBytes2; } else { // Write to pointers without reordering. - fast_memcpy(lpvPtr1,data,dwBytes1); - if (NULL != lpvPtr2 )fast_memcpy(lpvPtr2,data+dwBytes1,dwBytes2); + memcpy(lpvPtr1,data,dwBytes1); + if (NULL != lpvPtr2 )memcpy(lpvPtr2,data+dwBytes1,dwBytes2); write_offset+=dwBytes1+dwBytes2; if(write_offset>=buffer_size)write_offset=dwBytes2; } diff --git a/libmpcodecs/ad_mpg123.c b/libmpcodecs/ad_mpg123.c index 7450b55c25..a3ce2cdcf6 100644 --- a/libmpcodecs/ad_mpg123.c +++ b/libmpcodecs/ad_mpg123.c @@ -36,8 +36,6 @@ static const ad_info_t info = { LIBAD_EXTERN(mpg123) -#include "libvo/fastmemcpy.h" - /* Reducing the ifdeffery to two main variants: * 1. most compatible to any libmpg123 version * 2. fastest variant with recent libmpg123 (>=1.14) diff --git a/libmpcodecs/vf_down3dright.c b/libmpcodecs/vf_down3dright.c index a263661592..561bc898d0 100644 --- a/libmpcodecs/vf_down3dright.c +++ b/libmpcodecs/vf_down3dright.c @@ -85,7 +85,7 @@ static void toright(unsigned char *dst[3], unsigned char *src[3], *t++ = *sR++; } if (p->scaleh == 1) { - fast_memcpy(to + dst, to, dst); + memcpy(to + dst, to, dst); to += dst; } to += dst; diff --git a/libmpcodecs/vf_noise.c b/libmpcodecs/vf_noise.c index c623e11562..87a480d655 100644 --- a/libmpcodecs/vf_noise.c +++ b/libmpcodecs/vf_noise.c @@ -277,12 +277,12 @@ static void noise(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int { if(src==dst) return; - if(dstStride==srcStride) fast_memcpy(dst, src, srcStride*height); + if(dstStride==srcStride) memcpy(dst, src, srcStride*height); else { for(y=0; yqscale) { - fast_memcpy(b->planes[3], mpi->qscale, c->w[3]); - fast_memcpy(b->planes[3]+c->w[3], mpi->qscale, c->w[3]); + memcpy(b->planes[3], mpi->qscale, c->w[3]); + memcpy(b->planes[3]+c->w[3], mpi->qscale, c->w[3]); } p = mpi->fields & MP_IMGFIELD_TOP_FIRST ? 0 : diff --git a/libmpcodecs/vf_unsharp.c b/libmpcodecs/vf_unsharp.c index 69d573cdc2..69368d6bf5 100644 --- a/libmpcodecs/vf_unsharp.c +++ b/libmpcodecs/vf_unsharp.c @@ -82,10 +82,10 @@ static void unsharp( uint8_t *dst, uint8_t *src, int dstStride, int srcStride, i if( src == dst ) return; if( dstStride == srcStride ) - fast_memcpy( dst, src, srcStride*height ); + memcpy( dst, src, srcStride*height ); else for( y=0; yref[2][i], src[i], pn_width, pn_height, p->stride[i], src_stride[i]); - fast_memcpy(p->ref[2][i] + pn_height * p->stride[i], + memcpy(p->ref[2][i] + pn_height * p->stride[i], src[i] + (pn_height-1)*src_stride[i], pn_width); - fast_memcpy(p->ref[2][i] + (pn_height+1)* p->stride[i], + memcpy(p->ref[2][i] + (pn_height+1)* p->stride[i], src[i] + (pn_height-1)*src_stride[i], pn_width); - fast_memcpy(p->ref[2][i] - p->stride[i], src[i], pn_width); - fast_memcpy(p->ref[2][i] - 2*p->stride[i], src[i], pn_width); + memcpy(p->ref[2][i] - p->stride[i], src[i], pn_width); + memcpy(p->ref[2][i] - 2*p->stride[i], src[i], pn_width); } } @@ -367,7 +367,7 @@ static void filter(struct vf_priv_s *p, uint8_t *dst[3], int dst_stride[3], int uint8_t *dst2= &dst[i][y*dst_stride[i]]; filter_line(p, dst2, prev, cur, next, w, refs, parity ^ tff); }else{ - fast_memcpy(&dst[i][y*dst_stride[i]], &p->ref[1][i][y*refs], w); + memcpy(&dst[i][y*dst_stride[i]], &p->ref[1][i][y*refs], w); } } } diff --git a/libmpdemux/demux_asf.c b/libmpdemux/demux_asf.c index 68ccab07d2..9d189ef095 100644 --- a/libmpdemux/demux_asf.c +++ b/libmpdemux/demux_asf.c @@ -34,7 +34,6 @@ #include "asfheader.h" #include "demuxer.h" #include "libmpcodecs/dec_audio.h" -#include "libvo/fastmemcpy.h" // based on asf file-format doc by Eugene [http://divx.euro.ru] @@ -77,12 +76,12 @@ static void asf_descrambling(unsigned char **src,unsigned len, struct asf_priv* //i+=asf_scrambling_h*asf_scrambling_w; for(x=0;xscrambling_w;x++) for(y=0;yscrambling_h;y++){ - fast_memcpy(dst+i,s2+(y*asf->scrambling_w+x)*asf->scrambling_b,asf->scrambling_b); + memcpy(dst+i,s2+(y*asf->scrambling_w+x)*asf->scrambling_b,asf->scrambling_b); i+=asf->scrambling_b; } s2+=asf->scrambling_h*asf->scrambling_w*asf->scrambling_b; } - //if(ilen!=offs && offs!=-1) mp_msg(MSGT_DEMUX,MSGL_V,"warning! fragment.len=%d BUT next fragment offset=%d \n",dp->len,offs); dp->buffer=realloc(dp->buffer,dp->len+len+MP_INPUT_BUFFER_PADDING_SIZE); - fast_memcpy(dp->buffer+dp->len,data,len); + memcpy(dp->buffer+dp->len,data,len); memset(dp->buffer+dp->len+len, 0, MP_INPUT_BUFFER_PADDING_SIZE); mp_dbg(MSGT_DEMUX,MSGL_DBG4,"data appended! %d+%d\n",dp->len,len); dp->len+=len; @@ -172,7 +171,7 @@ static int demux_asf_read_packet(demuxer_t *demux,unsigned char *data,int len,in return 0; } dp=new_demux_packet(len); - fast_memcpy(dp->buffer,data,len); + memcpy(dp->buffer,data,len); if (asf->asf_is_dvr_ms) dp->pts=time*0.0000001; else diff --git a/libmpdemux/demux_gif.c b/libmpdemux/demux_gif.c index d46e35a564..18bf9abfd7 100644 --- a/libmpdemux/demux_gif.c +++ b/libmpdemux/demux_gif.c @@ -173,7 +173,7 @@ static int demux_gif_fill_buffer(demuxer_t *demuxer, demux_stream_t *ds) dp->avpacket = avpacket; if (priv->useref) - fast_memcpy(dp->buffer, priv->refimg, priv->w * priv->h); + memcpy(dp->buffer, priv->refimg, priv->w * priv->h); else memset(dp->buffer, gif->SBackGroundColor, priv->w * priv->h); @@ -222,7 +222,7 @@ static int demux_gif_fill_buffer(demuxer_t *demuxer, demux_stream_t *ds) memcpy_transp_pic(dest, buf, w, h, priv->w, gif->Image.Width, transparency, transparent_col); - if (refmode == 1) fast_memcpy(priv->refimg, dp->buffer, priv->w * priv->h); + if (refmode == 1) memcpy(priv->refimg, dp->buffer, priv->w * priv->h); if (refmode == 2 && priv->useref) { dest = priv->refimg + priv->w * t + l; memset(buf, gif->SBackGroundColor, len); diff --git a/libmpdemux/demuxer.c b/libmpdemux/demuxer.c index 1119e61013..3673fd06e3 100644 --- a/libmpdemux/demuxer.c +++ b/libmpdemux/demuxer.c @@ -33,8 +33,6 @@ #include "mp_msg.h" #include "m_config.h" -#include "libvo/fastmemcpy.h" - #include "stream/stream.h" #include "demuxer.h" #include "stheader.h" @@ -701,7 +699,7 @@ int demux_read_data(demux_stream_t *ds, unsigned char *mem, int len) if (x > len) x = len; if (mem) - fast_memcpy(mem + bytes, &ds->buffer[ds->buffer_pos], x); + memcpy(mem + bytes, &ds->buffer[ds->buffer_pos], x); bytes += x; len -= x; ds->buffer_pos += x; diff --git a/libvo/fastmemcpy.h b/libvo/fastmemcpy.h index 36fada39fe..c2cd79314f 100644 --- a/libvo/fastmemcpy.h +++ b/libvo/fastmemcpy.h @@ -24,9 +24,6 @@ #include #include -// meaningless ancient alias -#define fast_memcpy memcpy - #define memcpy_pic(d, s, b, h, ds, ss) memcpy_pic2(d, s, b, h, ds, ss, 0) #define my_memcpy_pic(d, s, b, h, ds, ss) memcpy_pic2(d, s, b, h, ds, ss, 1) -- cgit v1.2.3