changeset 5888:55a1e9f82bb7 libavcodec

factorize
author michael
date Fri, 09 Nov 2007 21:40:36 +0000
parents 83ac4620c6ed
children 7eb994e6c047
files intrax8dsp.c
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/intrax8dsp.c	Fri Nov 09 21:37:48 2007 +0000
+++ b/intrax8dsp.c	Fri Nov 09 21:40:36 2007 +0000
@@ -118,15 +118,13 @@
     }
 //now calc the stuff we need
     if(edges&3){//mb_x==0 || mb_y==0){
+        int avg=(sum+4)>>3;
         if(edges&1){ //(mb_x==0) {//implies mb_y!=0
-            int avg=(sum+4)>>3;
             memset(dst+area1,avg,8+8+1);//areas 1,2 and 3 are averaged
-            sum+=avg*9;//8+1(egde pixel)
         }else{//implies y==0 x!=0
-            int avg=(sum+4)>>3;
             memset(dst+area3,avg, 1+16+8);//areas 3, 4,5,6
-            sum+=avg*9;
         }
+        sum+=avg*9;
     }else{
         uint8_t c;
         c=*(src-1-linesize);//the edge pixel,in the top line and left column