summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2007-07-08 15:21:11 +0000
committeriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2007-07-08 15:21:11 +0000
commit85655f6c409cfbadbf96b652af1dca571ef9d9bf (patch)
tree2395aa7e4d135ff1e236eaeb476127d1640d0750
parent1ad598d6d1b539d1f0158491c104129190594f7d (diff)
rmdmacro.h: made appropriate changes to rgb2yuv macros,
so that cache blocks will calculated during the conversion and not later, on a step of their own. Added MARK_BACK_BUFFER* macros, so that cursor will be updated normally during conversion. git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@365 f606c939-3180-4ac9-a4b8-4b8779d57d0a
-rw-r--r--recordmydesktop/include/rmdmacro.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/recordmydesktop/include/rmdmacro.h b/recordmydesktop/include/rmdmacro.h
index eaa6180..b768ac5 100644
--- a/recordmydesktop/include/rmdmacro.h
+++ b/recordmydesktop/include/rmdmacro.h
@@ -284,6 +284,10 @@
(t3&__B16_MASK)+(t4&__B16_MASK))/4)&__B16_MASK);\
}
+#define POINT_IN_BLOCK(xv,yv,widthv,blocksize) ((yv/blocksize)*\
+ (widthv/blocksize)+\
+ (xv/blocksize))
+
#define UPDATE_Y_PLANE(data,\
x_tm,\
y_tm,\
@@ -330,6 +334,7 @@
*yuv_y=_yr[__RVALUE_##__bit_depth__(t_val)] +\
_yg[__GVALUE_##__bit_depth__(t_val)] +\
_yb[__BVALUE_##__bit_depth__(t_val)] ;\
+ yblocks[POINT_IN_BLOCK(i,k,width_tm,Y_UNIT_WIDTH)]=1;\
}\
datapi++;\
datapi_back++;\
@@ -441,6 +446,8 @@
_ur,_ug,_ubvr,_vg,_vb,\
__sampling_type,\
__bit_depth__)\
+ ublocks[POINT_IN_BLOCK(i,k,width_tm,Y_UNIT_WIDTH)]=1;\
+ vblocks[POINT_IN_BLOCK(i,k,width_tm,Y_UNIT_WIDTH)]=1;\
}\
datapi+=2;\
datapi_back+=2;\
@@ -473,6 +480,8 @@
_ur,_ug,_ubvr,_vg,_vb,\
__sampling_type,\
__bit_depth__)\
+ ublocks[POINT_IN_BLOCK(i,k,width_tm,Y_UNIT_WIDTH)]=1;\
+ vblocks[POINT_IN_BLOCK(i,k,width_tm,Y_UNIT_WIDTH)]=1;\
}\
datapi+=2;\
datapi_back+=2;\
@@ -620,6 +629,61 @@
}\
}
+#define MARK_BACK_BUFFER( data,\
+ data_back,\
+ x_tm,\
+ y_tm,\
+ width_tm,\
+ height_tm,\
+ buffer_width,\
+ __bit_depth__){\
+ if((__bit_depth__==24)||(__bit_depth__==32)){\
+ MARK_BACK_BUFFER_C( data,\
+ data_back,\
+ x_tm,\
+ y_tm,\
+ width_tm,\
+ height_tm,\
+ buffer_width,\
+ 32)\
+ }\
+ else{\
+ MARK_BACK_BUFFER_C( data,\
+ data_back,\
+ x_tm,\
+ y_tm,\
+ width_tm,\
+ height_tm,\
+ buffer_width,\
+ 16)\
+ }\
+}\
+
+
+#define MARK_BACK_BUFFER_C( data,\
+ data_back,\
+ x_tm,\
+ y_tm,\
+ width_tm,\
+ height_tm,\
+ buffer_width,\
+ __bit_depth__){\
+ int k,i;\
+ register u_int##__bit_depth__##_t\
+ *datapi=\
+ ((u_int##__bit_depth__##_t *)data)+y_tm*buffer_width+x_tm,\
+ *datapi_back=\
+ ((u_int##__bit_depth__##_t *)data_back)+y_tm*buffer_width+x_tm;\
+ for(k=0;k<height_tm;k++){\
+ for(i=0;i<width_tm;i++){\
+ *datapi_back=*datapi+1;\
+ datapi++;\
+ datapi_back++;\
+ }\
+ datapi+=buffer_width-width_tm;\
+ datapi_back+=buffer_width-width_tm;\
+ }\
+}
#define I16TOA(number,buffer){\
int t_num=(number),__k=0,__i=0;\
© All Rights Reserved