From 85655f6c409cfbadbf96b652af1dca571ef9d9bf Mon Sep 17 00:00:00 2001 From: iovar Date: Sun, 8 Jul 2007 15:21:11 +0000 Subject: 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 --- recordmydesktop/include/rmdmacro.h | 64 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) 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