changeset 11280:b677102fa650

10l and minor optimization
author michael
date Sun, 26 Oct 2003 23:35:46 +0000
parents 46067d1a28aa
children 47b69dcf384d
files libmpcodecs/vf_spp.c
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf_spp.c	Sun Oct 26 23:20:47 2003 +0000
+++ b/libmpcodecs/vf_spp.c	Sun Oct 26 23:35:46 2003 +0000
@@ -114,12 +114,13 @@
 }
 
 static inline void add_block(int16_t *dst, int stride, DCTELEM block[64]){
-	int x,y;
+	int y;
 	
 	for(y=0; y<8; y++){
-		for(x=0; x<8; x++){
-			dst[x + y*stride]+= block[x + y*8];
-		}
+		*(uint32_t*)&dst[0 + y*stride]+= *(uint32_t*)&block[0 + y*8];
+		*(uint32_t*)&dst[2 + y*stride]+= *(uint32_t*)&block[2 + y*8];
+		*(uint32_t*)&dst[4 + y*stride]+= *(uint32_t*)&block[4 + y*8];
+		*(uint32_t*)&dst[6 + y*stride]+= *(uint32_t*)&block[6 + y*8];
 	}
 }
 
@@ -290,6 +291,9 @@
     vf->uninit=uninit;
     vf->priv=malloc(sizeof(struct vf_priv_s));
     memset(vf->priv, 0, sizeof(struct vf_priv_s));
+    
+    avcodec_init();
+
     vf->priv->avctx= avcodec_alloc_context();
     dsputil_init(&vf->priv->dsp, vf->priv->avctx);