summaryrefslogtreecommitdiff
path: root/recordmydesktop/src/rmd_yuv_utils.c
diff options
context:
space:
mode:
authoriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2008-12-13 17:20:24 +0000
committeriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2008-12-13 17:20:24 +0000
commitd7f4fe1de14209b7d2587a602a01dd93f6714fad (patch)
tree29ace7d04af2c02398b7da59b1014a6b7242d77f /recordmydesktop/src/rmd_yuv_utils.c
parent61ab7edf42e5a7ff3b7d663a2661d3b60723cf14 (diff)
Added missing stdio.h and errno.h headers in any
files that needed them (could cause compilation failure on some platforms). Also, rearranged the sequence with which include's happen, so that any missing headers will be more likely to show up as copilation errors, in the future. rmd_yuv_utils.[ch] and rmd_block_utils.[ch] have been merged within the former, as they deal with the same subject (converting rgb buffers to yuv ones, with the only difference that rmd_block_utils had the double-buffer convertions while rmd_yuv_utils dealt with the single-buffered ones). Their headers also had the a circular dependency (rmd_yuv_utils.h included rmd_block_utils.h and vice-versa). rmd_math.[ch] was added. This file holds now the rmdRoundf function which is a portable implementation of roundf (which depends on C99). The reasoning behind the addition of these files, is that they might hold more purely mathematical functions, in the future. git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@583 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'recordmydesktop/src/rmd_yuv_utils.c')
-rw-r--r--recordmydesktop/src/rmd_yuv_utils.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/recordmydesktop/src/rmd_yuv_utils.c b/recordmydesktop/src/rmd_yuv_utils.c
index 5da501b..dbe87ae 100644
--- a/recordmydesktop/src/rmd_yuv_utils.c
+++ b/recordmydesktop/src/rmd_yuv_utils.c
@@ -25,14 +25,23 @@
******************************************************************************/
#include "config.h"
-
#include "rmd_yuv_utils.h"
+#include "rmd_math.h"
+
+
// Keep these global (for performance reasons I assume).
unsigned char Yr[256], Yg[256], Yb[256],
Ur[256], Ug[256], UbVr[256],
Vg[256], Vb[256];
+// FIXME: These globals are modified in other source files! We keep
+// thsee here for now. These are the cache blocks. They need to be
+// accesible in the dbuf macros
+u_int32_t *yblocks,
+ *ublocks,
+ *vblocks;
+
void MakeMatrices (void) {
int i;
@@ -68,16 +77,16 @@ void MakeMatrices (void) {
for( i = 0 ; i < 256 ; i++ ) {
- Yr[i] = (unsigned char) roundf( Yoffset + yr * i );
- Yg[i] = (unsigned char) roundf( yg * i );
- Yb[i] = (unsigned char) roundf( yb * i );
+ Yr[i] = (unsigned char) rmdRoundf( Yoffset + yr * i );
+ Yg[i] = (unsigned char) rmdRoundf( yg * i );
+ Yb[i] = (unsigned char) rmdRoundf( yb * i );
- Ur[i] = (unsigned char) roundf( Coffset + ur * i );
- Ug[i] = (unsigned char) roundf( ug * i );
- UbVr[i] = (unsigned char) roundf( ub * i );
+ Ur[i] = (unsigned char) rmdRoundf( Coffset + ur * i );
+ Ug[i] = (unsigned char) rmdRoundf( ug * i );
+ UbVr[i] = (unsigned char) rmdRoundf( ub * i );
- Vg[i] = (unsigned char) roundf( vg * i );
- Vb[i] = (unsigned char) roundf( Coffset + vb * i );
+ Vg[i] = (unsigned char) rmdRoundf( vg * i );
+ Vb[i] = (unsigned char) rmdRoundf( Coffset + vb * i );
}
© All Rights Reserved