[Sumover-dev] [svn commit] r4682 - vic/branches/cc/video

sumover-dev at cs.ucl.ac.uk sumover-dev at cs.ucl.ac.uk
Thu Mar 11 14:55:01 GMT 2010


Author: soohyunc
Date: Thu Mar 11 14:55:01 2010
New Revision: 4682

Modified:
   vic/branches/cc/video/grabber.cpp

Log:
-- framebase_ is composed of Y size + (U + V) size.
   (it's more straightforward to understand than before)

actually, set_size_411 is wrong - instead, it should be YUV420.



Modified: vic/branches/cc/video/grabber.cpp
==============================================================================
--- vic/branches/cc/video/grabber.cpp	(original)
+++ vic/branches/cc/video/grabber.cpp	Thu Mar 11 14:55:01 2010
@@ -169,7 +169,7 @@
 	double dmin = min, dmax = max;
 	double dslope = 219. / (dmax - dmin) * c;
 	double dy = 16.;
-	int i;
+	u_int i;
 	for (i = 0; i < min; ++i)
 		ynorm_[i] = u_char(dy);
 	for ( ; i < max; ++i) {
@@ -434,10 +434,12 @@
 
 	int s = w * h;
 	framesize_ = s;
-	int n = s + (s >> 1) + 2 * GRABBER_VPAD * outw_;
-	framebase_ = new u_char[n];
-	/* initialize to gray */
-	memset(framebase_, 0x80, n);
+	int ny = s + GRABBER_VPAD * outw_;	// Y size
+	int nuv = (s >> 1) + GRABBER_VPAD * outw_;	// U + V size
+	framebase_ = new u_char[ny + nuv];
+	/* initialize to black */
+	memset(framebase_, 0, ny);
+	memset(framebase_ + ny, 0x80, nuv);
 	frame_ = framebase_ + GRABBER_VPAD * outw_;
 	crinit(w, h);
 



More information about the Sumover-dev mailing list