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.
This commit is contained in:
wm4 2012-11-09 01:31:49 +01:00
parent 34649dbd1d
commit eb6688724c
14 changed files with 27 additions and 38 deletions

View File

@ -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;
}
}

View File

@ -24,7 +24,6 @@
#include <stdlib.h>
#include <inttypes.h>
#include <string.h>
#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],

View File

@ -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;
}

View File

@ -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)

View File

@ -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;

View File

@ -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; y<height; y++)
{
fast_memcpy(dst, src, width);
memcpy(dst, src, width);
dst+= dstStride;
src+= srcStride;
}

View File

@ -63,8 +63,8 @@ static void do_plane(unsigned char *to, unsigned char *from,
for(end=to+h*ts, buf=*bufp, top=1; to<end; from+=fs, to+=ts, buf+=w, top^=1)
{
fast_memcpy(to, mode==(top?BOTTOM_FIRST:TOP_FIRST)?buf:from, w);
fast_memcpy(buf, from, w);
memcpy(to, mode==(top?BOTTOM_FIRST:TOP_FIRST)?buf:from, w);
memcpy(buf, from, w);
}
}

View File

@ -138,8 +138,8 @@ static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
}
}
if (mpi->qscale) {
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 :

View File

@ -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; y<height; y++, dst+=dstStride, src+=srcStride )
fast_memcpy( dst, src, width );
memcpy( dst, src, width );
return;
}

View File

@ -66,13 +66,13 @@ static void store_ref(struct vf_priv_s *p, uint8_t *src[3], int src_stride[3], i
memcpy_pic(p->ref[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);
}
}
}

View File

@ -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;x<asf->scrambling_w;x++)
for(y=0;y<asf->scrambling_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(i<len) fast_memcpy(dst+i,src+i,len-i);
//if(i<len) memcpy(dst+i,src+i,len-i);
free(*src);
*src = dst;
}
@ -102,7 +101,7 @@ static void demux_asf_append_to_packet(demux_packet_t* dp,unsigned char *data,in
{
if(dp->len!=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

View File

@ -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);

View File

@ -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;

View File

@ -24,9 +24,6 @@
#include <string.h>
#include <stddef.h>
// 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)