From 5ac153b4c5997c86130bc59fffc7f1c3f36f8b14 Mon Sep 17 00:00:00 2001 From: michael Date: Mon, 27 Oct 2003 23:47:39 +0000 Subject: [PATCH] optimizing git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11300 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vf_spp.c | 106 +++++++++++++++++++++++++++++++------------ 1 file changed, 78 insertions(+), 28 deletions(-) diff --git a/libmpcodecs/vf_spp.c b/libmpcodecs/vf_spp.c index d2dfd07b58..3c0eafa1f6 100644 --- a/libmpcodecs/vf_spp.c +++ b/libmpcodecs/vf_spp.c @@ -128,20 +128,85 @@ static inline void add_block(int16_t *dst, int stride, DCTELEM block[64]){ } } +static void store_slice_c(uint8_t *dst, int16_t *src, int dst_stride, int src_stride, int width, int log2_scale){ + int y, x; + +#define STORE(pos) \ + temp= ((src[x + y*src_stride + pos]<>6;\ + if(temp & 0x100) temp= ~(temp>>31);\ + dst[x + y*dst_stride + pos]= temp; + + for(y=0; y<8; y++){ + uint8_t *d= dither[y]; + for(x=0; xlog2_count; - const int log2_scale= 6-p->log2_count; - const int stride= p->temp_stride; //FIXME + const int stride= is_luma ? p->temp_stride : (p->temp_stride/2 + 8); uint64_t block_align[32]; DCTELEM *block = (DCTELEM *)block_align; DCTELEM *block2= (DCTELEM *)(block_align+16); - + for(y=0; ysrc + 8 + 8*stride + y*stride, src + y*src_stride, width); - memset(p->temp + 8*stride + y*stride, 0, stride*sizeof(int16_t)); + int index= 8 + 8*stride + y*stride; + memcpy(p->src + index, src + y*src_stride, width); for(x=0; x<8; x++){ - int index= 8 + 8*stride + y*stride; p->src[index - x - 1]= p->src[index + x ]; p->src[index + width + x ]= p->src[index + width - x - 1]; } @@ -153,6 +218,7 @@ static void filter(struct vf_priv_s *p, uint8_t *dst, uint8_t *src, int dst_stri //FIXME (try edge emu) for(y=0; ytemp + (8+y)*stride, 0, 8*stride*sizeof(int16_t)); for(x=0; xtemp + index, stride, block2); } } - } - -#define STORE(pos) \ - temp= ((p->temp[index + pos]<>6;\ - if(temp & 0x100) temp= ~(temp>>31);\ - dst[x + y*dst_stride + pos]= temp; - - for(y=0; ytemp + 8 + y*stride, dst_stride, stride, width, 6-p->log2_count); } #if 0 for(y=0; ypriv->avctx= avcodec_alloc_context(); dsputil_init(&vf->priv->dsp, vf->priv->avctx); - + if(gCpuCaps.hasMMX){ + store_slice= store_slice_mmx; + } + vf->priv->log2_count= 6; if (args) sscanf(args, "%d:%d", &vf->priv->log2_count, &vf->priv->qp);