diff options
author | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2006-11-07 09:56:04 +0000 |
---|---|---|
committer | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2006-11-07 09:56:04 +0000 |
commit | b3ef3b6cb05fbedb3e224521afd19b2c43d3a7db (patch) | |
tree | b07f326c265b4fa9732b037952a7522ebd794a33 /rMD-exp | |
parent | c8a065fce0937a40a0f050c1c8b19ad0700a7625 (diff) |
placed values in variables, while averaging
git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@151 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'rMD-exp')
-rw-r--r-- | rMD-exp/include/recordmydesktop.h | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/rMD-exp/include/recordmydesktop.h b/rMD-exp/include/recordmydesktop.h index bd67869..8a9b09e 100644 --- a/rMD-exp/include/recordmydesktop.h +++ b/rMD-exp/include/recordmydesktop.h @@ -478,7 +478,7 @@ int capture_busy, #define UPDATE_YUV_BUFFER_SH_AVG(yuv,data,x_tm,y_tm,width_tm,height_tm){\ int k,i;\ - register unsigned int t_val;\ + register unsigned int t_val,t1,t2,t3,t4;\ register unsigned int *datapi=(unsigned int*)data+x_tm+y_tm*yuv->y_width,\ *datapi_next=(unsigned int*)data+x_tm+(y_tm+1)*yuv->y_width;\ register unsigned char *yuv_y=yuv->y+x_tm+y_tm*yuv->y_width,\ @@ -501,14 +501,18 @@ int capture_busy, datapi=(unsigned int*)data+x_tm+y_tm*yuv->y_width;\ for(k=0;k<height_tm;k+=2){\ for(i=0;i<width_tm;i+=2){\ - t_val=(((((*datapi)&0xff000000) +((*(datapi+1))&0xff000000)+\ - ((*(datapi_next))&0xff000000)+((*(datapi_next+1))&0xff000000))/4)&0xff000000) \ - +(((((*datapi)&0x00ff0000) +((*(datapi+1))&0x00ff0000)+\ - ((*(datapi_next))&0x00ff0000)+((*(datapi_next+1))&0x00ff0000))/4)&0x00ff0000)\ - +(((((*datapi)&0x0000ff00) +((*(datapi+1))&0x0000ff00)+\ - ((*(datapi_next))&0x0000ff00)+((*(datapi_next+1))&0x0000ff00))/4)&0x0000ff00)\ - +(((((*datapi)&0x000000ff) +((*(datapi+1))&0x000000ff)+\ - ((*(datapi_next))&0x000000ff)+((*(datapi_next+1))&0x000000ff))/4)&0x000000ff);\ + t1=*datapi;\ + t2=*(datapi+1);\ + t3=*datapi_next;\ + t4=*(datapi_next+1);\ + t_val=((((t1&0xff000000) +(t2&0xff000000)+\ + (t3&0xff000000)+(t4&0xff000000))/4)&0xff000000) \ + +((((t1&0x00ff0000) +(t2&0x00ff0000)+\ + (t3&0x00ff0000)+(t4&0x00ff0000))/4)&0x00ff0000)\ + +((((t1&0x0000ff00) +(t2&0x0000ff00)+\ + (t3&0x0000ff00)+(t4&0x0000ff00))/4)&0x0000ff00)\ + +((((t1&0x000000ff) +(t2&0x000000ff)+\ + (t3&0x000000ff)+(t4&0x000000ff))/4)&0x000000ff);\ \ *yuv_u=\ _ur[__RVALUE(t_val)] + _ug[__GVALUE(t_val)] + _ub[__BVALUE(t_val)];\ @@ -568,7 +572,7 @@ int capture_busy, #define UPDATE_YUV_BUFFER_IM_AVG(yuv,data,x_tm,y_tm,width_tm,height_tm){\ int k,i;\ - register unsigned int t_val;\ + register unsigned int t_val,t1,t2,t3,t4;\ register unsigned int *datapi=(unsigned int*)data,\ *datapi_next=(unsigned int*)data+width_tm;\ register unsigned char *yuv_y=yuv->y+x_tm+y_tm*yuv->y_width,\ @@ -590,14 +594,18 @@ int capture_busy, datapi=(unsigned int*)data;\ for(k=0;k<height_tm;k+=2){\ for(i=0;i<width_tm;i+=2){\ - t_val=(((((*datapi)&0xff000000) +((*(datapi+1))&0xff000000)+\ - ((*(datapi_next))&0xff000000)+((*(datapi_next+1))&0xff000000))/4)&0xff000000) \ - +(((((*datapi)&0x00ff0000) +((*(datapi+1))&0x00ff0000)+\ - ((*(datapi_next))&0x00ff0000)+((*(datapi_next+1))&0x00ff0000))/4)&0x00ff0000)\ - +(((((*datapi)&0x0000ff00) +((*(datapi+1))&0x0000ff00)+\ - ((*(datapi_next))&0x0000ff00)+((*(datapi_next+1))&0x0000ff00))/4)&0x0000ff00)\ - +(((((*datapi)&0x000000ff) +((*(datapi+1))&0x000000ff)+\ - ((*(datapi_next))&0x000000ff)+((*(datapi_next+1))&0x000000ff))/4)&0x000000ff);\ + t1=*datapi;\ + t2=*(datapi+1);\ + t3=*datapi_next;\ + t4=*(datapi_next+1);\ + t_val=((((t1&0xff000000) +(t2&0xff000000)+\ + (t3&0xff000000)+(t4&0xff000000))/4)&0xff000000) \ + +((((t1&0x00ff0000) +(t2&0x00ff0000)+\ + (t3&0x00ff0000)+(t4&0x00ff0000))/4)&0x00ff0000)\ + +((((t1&0x0000ff00) +(t2&0x0000ff00)+\ + (t3&0x0000ff00)+(t4&0x0000ff00))/4)&0x0000ff00)\ + +((((t1&0x000000ff) +(t2&0x000000ff)+\ + (t3&0x000000ff)+(t4&0x000000ff))/4)&0x000000ff);\ \ *yuv_u=\ _ur[__RVALUE(t_val)] + _ug[__GVALUE(t_val)] + _ub[__BVALUE(t_val)];\ |