# HG changeset patch # User michael # Date 1067298459 0 # Node ID 66bdf2002aab2c000f74e1108b7566ad0b4f01e1 # Parent 14dbc88adaf00e1d2e94e8db7cd81f7542ded064 optimizing diff -r 14dbc88adaf0 -r 66bdf2002aab libmpcodecs/vf_spp.c --- a/libmpcodecs/vf_spp.c Mon Oct 27 22:25:28 2003 +0000 +++ b/libmpcodecs/vf_spp.c Mon Oct 27 23:47:39 2003 +0000 @@ -128,20 +128,85 @@ } } +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 @@ //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);