diff options
author | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2006-12-08 13:48:40 +0000 |
---|---|---|
committer | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2006-12-08 13:48:40 +0000 |
commit | e22b4a99483a13ec44d5151c6f825516ebfb9c04 (patch) | |
tree | 4b2660f15cb470a017f340f6e4982654227c122b | |
parent | 2e4914864f80df5c29a8b492fd1fdbee6f0416a5 (diff) |
faster CompareBlocks
git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@223 f606c939-3180-4ac9-a4b8-4b8779d57d0a
-rw-r--r-- | recordmydesktop/src/cache_frame.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/recordmydesktop/src/cache_frame.c b/recordmydesktop/src/cache_frame.c index 7f8c826..725a1df 100644 --- a/recordmydesktop/src/cache_frame.c +++ b/recordmydesktop/src/cache_frame.c @@ -35,12 +35,10 @@ int CompareBlocks(unsigned char *incoming,unsigned char *old,int blockno,int wid *old_reg=&(old[block_i*(width*height/divisor)+block_k*width/divisor]); for(j=0;j<height/divisor;j++){ - for(i=0;i<width/divisor;i++){ - if((*(incoming_reg++))!=(*(old_reg++))) - return 1; - } - incoming_reg+=(width-width/divisor); - old_reg+=(width-width/divisor); + if(memcmp(incoming_reg,old_reg,width/divisor)) + return 1; + incoming_reg+=width; + old_reg+=width; } return 0; |