summaryrefslogtreecommitdiff
path: root/rMD-exp
diff options
context:
space:
mode:
authoriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2006-11-06 14:54:36 +0000
committeriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2006-11-06 14:54:36 +0000
commit08bb79c370f6033a09b29022e45863c23b052828 (patch)
treea8768ae97d71a208dbbea9eef65849e83121d425 /rMD-exp
parent4b3a533d8609a7e066c6a28da0bb30c160d6c9eb (diff)
quick subsampling routine optimisation
git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@144 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'rMD-exp')
-rw-r--r--rMD-exp/include/recordmydesktop.h27
1 files changed, 15 insertions, 12 deletions
diff --git a/rMD-exp/include/recordmydesktop.h b/rMD-exp/include/recordmydesktop.h
index 374efeb..3696cdc 100644
--- a/rMD-exp/include/recordmydesktop.h
+++ b/rMD-exp/include/recordmydesktop.h
@@ -461,20 +461,23 @@ int capture_busy,
}
#define UPDATE_YUV_BUFFER_IM(yuv,data,x_tm,y_tm,width_tm,height_tm){\
- int i,k,j=0;\
+ int k,i;\
+ register unsigned char *datap=data;\
int x_2=x_tm/2,y_2=y_tm/2;\
- for(k=0;k<height_tm;k++){\
- for(i=0;i<width_tm;i++){\
- yuv->y[x_tm+i+(k+y_tm)*yuv->y_width]=Yr[data[(j*4)+__RBYTE]] + Yg[data[(j*4)+__GBYTE]] + Yb[data[(j*4)+__BBYTE]] ;\
- if((k%2)&&(i%2)){\
- yuv->u[x_2+i/2+(k/2+y_2)*yuv->uv_width]=\
- Ur[data[(k*width_tm+i)*4+__RBYTE]] + Ug[data[(k*width_tm+i)*4+__GBYTE]] + Ub[data[(k*width_tm+i)*4+__BBYTE]];\
- yuv->v[x_2+i/2+(k/2+y_2)*yuv->uv_width]=\
- Vr[data[(k*width_tm+i)*4+__RBYTE]] + Vg[data[(k*width_tm+i)*4+__GBYTE]] + Vb[data[(k*width_tm+i)*4+__BBYTE]];\
- }\
- \
- j++;\
+ for(k=0;k<height_tm*width_tm;k++){\
+ yuv->y[k]=Yr[datap[__RBYTE]] + Yg[datap[__GBYTE]] + Yb[datap[__BBYTE]] ;\
+ datap+=4;\
+ }\
+ datap=data;\
+ for(k=0;k<height_tm;k+=2){\
+ for(i=0;i<width_tm;i+=2){\
+ yuv->u[x_2+i/2+(k/2+y_2)*yuv->uv_width]=\
+ Ur[datap[__RBYTE]] + Ug[datap[__GBYTE]] + Ub[datap[__BBYTE]];\
+ yuv->v[x_2+i/2+(k/2+y_2)*yuv->uv_width]=\
+ Vr[datap[__RBYTE]] + Vg[datap[__GBYTE]] + Vb[datap[__BBYTE]];\
+ datap+=8;\
}\
+ datap+=width_tm*4;\
}\
}
© All Rights Reserved