From 5d02058b47aadcc384ddd02083b8ee0639fb2592 Mon Sep 17 00:00:00 2001 From: reimar Date: Tue, 5 Jun 2007 15:09:49 +0000 Subject: [PATCH] Do not use fast_memcpy for small size copy, esp. when the size is constant git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23476 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libao2/ao_dsound.c | 6 +++--- libmenu/vf_menu.c | 4 ++-- libmpcodecs/vd_mtga.c | 2 +- libmpcodecs/vf_fspp.c | 4 ++-- libmpcodecs/vf_yadif.c | 2 +- libvo/vo_bl.c | 2 +- libvo/vo_dxr3.c | 2 +- libvo/vo_vesa.c | 4 ++-- libvo/vo_zr2.c | 4 ++-- mencoder.c | 4 ++-- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/libao2/ao_dsound.c b/libao2/ao_dsound.c index 5f6bc8daea..d66de37ec5 100644 --- a/libao2/ao_dsound.c +++ b/libao2/ao_dsound.c @@ -199,7 +199,7 @@ static BOOL CALLBACK DirectSoundEnum(LPGUID guid,LPCSTR desc,LPCSTR module,LPVOI if(device_num==*device_index){ mp_msg(MSGT_AO, MSGL_V,"<--"); if(guid){ - fast_memcpy(&device,guid,sizeof(GUID)); + memcpy(&device,guid,sizeof(GUID)); } } mp_msg(MSGT_AO, MSGL_V,"\n"); @@ -337,14 +337,14 @@ static int write_buffer(unsigned char *data, int len) numsamp = dwBytes1 / (ao_data.channels * sampsize); // number of samples for each channel in this buffer for( i = 0; i < numsamp; i++ ) for( j = 0; j < ao_data.channels; j++ ) { - fast_memcpy(lpvPtr1+(i*ao_data.channels*sampsize)+(chantable[j]*sampsize),data+(i*ao_data.channels*sampsize)+(j*sampsize),sampsize); + memcpy(lpvPtr1+(i*ao_data.channels*sampsize)+(chantable[j]*sampsize),data+(i*ao_data.channels*sampsize)+(j*sampsize),sampsize); } if (NULL != lpvPtr2 ) { numsamp = dwBytes2 / (ao_data.channels * sampsize); for( i = 0; i < numsamp; i++ ) for( j = 0; j < ao_data.channels; j++ ) { - fast_memcpy(lpvPtr2+(i*ao_data.channels*sampsize)+(chantable[j]*sampsize),data+dwBytes1+(i*ao_data.channels*sampsize)+(j*sampsize),sampsize); + memcpy(lpvPtr2+(i*ao_data.channels*sampsize)+(chantable[j]*sampsize),data+dwBytes1+(i*ao_data.channels*sampsize)+(j*sampsize),sampsize); } } diff --git a/libmenu/vf_menu.c b/libmenu/vf_menu.c index 3b1e1cc2a1..7996c24adc 100644 --- a/libmenu/vf_menu.c +++ b/libmenu/vf_menu.c @@ -146,8 +146,8 @@ static void get_image(struct vf_instance_s* vf, mp_image_t *mpi){ if(mpi->type == MP_IMGTYPE_TEMP && (!(mpi->flags&MP_IMGFLAG_PRESERVE)) ) { dmpi = vf_get_image(vf->next,mpi->imgfmt,mpi->type, mpi->flags, mpi->w, mpi->h); - fast_memcpy(mpi->planes,dmpi->planes,MP_MAX_PLANES*sizeof(unsigned char*)); - fast_memcpy(mpi->stride,dmpi->stride,MP_MAX_PLANES*sizeof(unsigned int)); + memcpy(mpi->planes,dmpi->planes,MP_MAX_PLANES*sizeof(unsigned char*)); + memcpy(mpi->stride,dmpi->stride,MP_MAX_PLANES*sizeof(unsigned int)); mpi->flags|=MP_IMGFLAG_DIRECT; mpi->priv=(void*)dmpi; return; diff --git a/libmpcodecs/vd_mtga.c b/libmpcodecs/vd_mtga.c index f9f2301da2..c61492e6fc 100644 --- a/libmpcodecs/vd_mtga.c +++ b/libmpcodecs/vd_mtga.c @@ -110,7 +110,7 @@ static void decode_rle_tga(TGAInfo *info, unsigned char *data, mp_image_t *mpi) if (packet_header & 0x80) /* runlength encoded packet */ { - fast_memcpy(final, data, num_bytes); + memcpy(final, data, num_bytes); // Note: this will be slow when DR to vram! i=num_bytes; diff --git a/libmpcodecs/vf_fspp.c b/libmpcodecs/vf_fspp.c index acb39f5c56..021aa03de2 100644 --- a/libmpcodecs/vf_fspp.c +++ b/libmpcodecs/vf_fspp.c @@ -456,8 +456,8 @@ static void filter(struct vf_priv_s *p, uint8_t *dst, uint8_t *src, column_fidct_s((int16_t*)(&p->threshold_mtx[0]), block+x*8, block3+x*8, 8); //yes, this is a HOTSPOT } row_idct_s(block3+0*8, p->temp + (y&15)*stride+x0+2-(y&1), stride, 2*(BLOCKSZ-1)); - fast_memcpy(block, block+(BLOCKSZ-1)*64, 8*8*sizeof(DCTELEM)); //cycling - fast_memcpy(block3, block3+(BLOCKSZ-1)*64, 6*8*sizeof(DCTELEM)); + memcpy(block, block+(BLOCKSZ-1)*64, 8*8*sizeof(DCTELEM)); //cycling + memcpy(block3, block3+(BLOCKSZ-1)*64, 6*8*sizeof(DCTELEM)); } // es=width+8-x0; // 8, ... diff --git a/libmpcodecs/vf_yadif.c b/libmpcodecs/vf_yadif.c index 89c1a8b6bd..7ffded56a6 100644 --- a/libmpcodecs/vf_yadif.c +++ b/libmpcodecs/vf_yadif.c @@ -62,7 +62,7 @@ static void (*filter_line)(struct vf_priv_s *p, uint8_t *dst, uint8_t *prev, uin static void store_ref(struct vf_priv_s *p, uint8_t *src[3], int src_stride[3], int width, int height){ int i; - fast_memcpy (p->ref[3], p->ref[0], sizeof(uint8_t *)*3); + memcpy (p->ref[3], p->ref[0], sizeof(uint8_t *)*3); memmove(p->ref[0], p->ref[1], sizeof(uint8_t *)*3*3); for(i=0; i<3; i++){ diff --git a/libvo/vo_bl.c b/libvo/vo_bl.c index 7036c3c4f3..19f85a8c76 100644 --- a/libvo/vo_bl.c +++ b/libvo/vo_bl.c @@ -174,7 +174,7 @@ static int udp_init(bl_host_t *h) { addr.sin_family = AF_INET; addr.sin_port = htons(h->port); - fast_memcpy(&addr.sin_addr.s_addr, dest->h_addr_list[0], dest->h_length); + memcpy(&addr.sin_addr.s_addr, dest->h_addr_list[0], dest->h_length); h->fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); if (h->fd < 0) { diff --git a/libvo/vo_dxr3.c b/libvo/vo_dxr3.c index 8d86b61a83..754efd22b2 100644 --- a/libvo/vo_dxr3.c +++ b/libvo/vo_dxr3.c @@ -1106,7 +1106,7 @@ static struct lut_entry *new_lookuptable(overlay_t *o) },*p; p = malloc(sizeof(m)); - fast_memcpy(p,m,sizeof(m)); + memcpy(p,m,sizeof(m)); return p; } diff --git a/libvo/vo_vesa.c b/libvo/vo_vesa.c index a7c51197a0..9f5a8d0591 100644 --- a/libvo/vo_vesa.c +++ b/libvo/vo_vesa.c @@ -217,7 +217,7 @@ static void __vbeSetPixel(int x, int y, int r, int g, int b) color = (r << shift_r) | (g << shift_g) | (b << shift_b); offset = y * bpl + (x * pixel_size); if(!VALID_WIN_FRAME(offset)) __vbeSwitchBank(offset); - fast_memcpy(VIDEO_PTR(offset), &color, pixel_size); + memcpy(VIDEO_PTR(offset), &color, pixel_size); } /* @@ -649,7 +649,7 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin else fs_mode = 1; } if((err=vbeInit()) != VBE_OK) { PRINT_VBE_ERR("vbeInit",err); return -1; } - fast_memcpy(vib.VESASignature,"VBE2",4); + memcpy(vib.VESASignature,"VBE2",4); if(!vib_set && (err=vbeGetControllerInfo(&vib)) != VBE_OK) { PRINT_VBE_ERR("vbeGetControllerInfo",err); diff --git a/libvo/vo_zr2.c b/libvo/vo_zr2.c index 613496d48c..e1413ac83d 100644 --- a/libvo/vo_zr2.c +++ b/libvo/vo_zr2.c @@ -394,7 +394,7 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, * We make configuration changes to a temporary params structure, * compare it with the old params structure and only apply the new * config if it is different from the old one. */ - fast_memcpy(&zptmp, &p->zp, sizeof(zptmp)); + memcpy(&zptmp, &p->zp, sizeof(zptmp)); /* translate the configuration to zoran understandable format */ zptmp.decimation = 0; @@ -423,7 +423,7 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, if (memcmp(&zptmp, &p->zp, sizeof(zptmp))) { /* config differs, we must update */ - fast_memcpy(&p->zp, &zptmp, sizeof(zptmp)); + memcpy(&p->zp, &zptmp, sizeof(zptmp)); stop_playing(p); if (ioctl(p->vdes, MJPIOC_S_PARAMS, &p->zp) < 0) { ERROR("error writing display params to card\n"); diff --git a/mencoder.c b/mencoder.c index efec45eb14..089473711a 100644 --- a/mencoder.c +++ b/mencoder.c @@ -771,7 +771,7 @@ case VCODEC_COPY: if (!curfile) { if (sh_video->bih) { mux_v->bih=malloc(sh_video->bih->biSize); - fast_memcpy(mux_v->bih, sh_video->bih, sh_video->bih->biSize); + memcpy(mux_v->bih, sh_video->bih, sh_video->bih->biSize); } else { @@ -941,7 +941,7 @@ case ACODEC_COPY: } if (sh_audio->wf){ mux_a->wf=malloc(sizeof(WAVEFORMATEX) + sh_audio->wf->cbSize); - fast_memcpy(mux_a->wf, sh_audio->wf, sizeof(WAVEFORMATEX) + sh_audio->wf->cbSize); + memcpy(mux_a->wf, sh_audio->wf, sizeof(WAVEFORMATEX) + sh_audio->wf->cbSize); if(!sh_audio->i_bps) sh_audio->i_bps=mux_a->wf->nAvgBytesPerSec; } else { mux_a->wf = malloc(sizeof(WAVEFORMATEX));