[Sumover-dev] [svn commit] r4516 - in vic/branches/mpeg4: video
sumover-dev at cs.ucl.ac.uk
sumover-dev at cs.ucl.ac.uk
Thu Oct 15 17:37:42 BST 2009
Author: piers
Date: Thu Oct 15 17:37:41 2009
New Revision: 4516
Modified:
vic/branches/mpeg4/ (props changed)
vic/branches/mpeg4/module.h
vic/branches/mpeg4/video/grabber-file.cpp
Log:
Updated props to exclude a few files so svn status is cleaner
Added comments explaining the default YUV format (ie four-cc I420)
Modified: vic/branches/mpeg4/module.h
==============================================================================
--- vic/branches/mpeg4/module.h (original)
+++ vic/branches/mpeg4/module.h Thu Oct 15 17:37:41 2009
@@ -54,6 +54,12 @@
int layer_;
};
+/* YUV Frame uses I420(fourcc code) representation - Each frame is
+ * stored as firstly the Y(Intensity) at full resolution - ie WxH
+ * Followed by U(Chrominance Cb) subsampled 2x2 i.e. W/2*H/2
+ * Followed by V(Chrominance Cr) also subsampled 2x2
+ * Hence 12 bits/pixel and frame size = WxH+2*(W/2*H/2)
+ */
class YuvFrame : public VideoFrame {
public:
inline YuvFrame(u_int32_t ts, u_int8_t* bp, u_int8_t* crvec,
Modified: vic/branches/mpeg4/video/grabber-file.cpp
==============================================================================
--- vic/branches/mpeg4/video/grabber-file.cpp (original)
+++ vic/branches/mpeg4/video/grabber-file.cpp Thu Oct 15 17:37:41 2009
@@ -238,10 +238,13 @@
int frc = 0;
- // "framesize_" is just the number of pixels,
- // so the number of bytes becomes "3 * framesize_ / 2"
+ // "framesize_" is just the number of pixels for a frame,
+ // YUV frame is Y at full res followed by Y then U subsampled
+ // by 2x2 so the number of bytes becomes = W*H + 2*(W/2*H/2)
+ // which = framesize_ + framesize_/2
memcpy (frame_, file_device.frame_ + num_frame_,
framesize_ + (framesize_ >> 1));
+ //memset(frame_+framesize_+framesize_/4,128,framesize_/4);
if ((num_frame_ += framesize_ + (framesize_ >> 1))
< file_device.len_) {
More information about the Sumover-dev
mailing list