UncompressedVideoFrame Class Reference

<class description="" goes="" here=""> <short description=""> More...

#include <UncompressedVideoFrame.hpp>

Inheritance diagram for UncompressedVideoFrame:

VideoFrame Frame List of all members.

Public Types

typedef enum UncompressedVideoFrame::ColorSpace ColorSpace
 Colorspace enumeration of colorspaces available.
enum  ColorSpace {
  ColorSpaceDefault = 4, ColorSpaceRGB24 = 0, ColorSpaceYV12 = 1, ColorSpaceI420 = 4,
  ColorSpaceRGB32 = 1000, ColorSpaceRGB565, ColorSpaceGRAY8, ColorSpaceUNKNOWN
}
 Colorspace enumeration of colorspaces available. More...

Public Member Functions

 UncompressedVideoFrame (FrameType t, int width, int height)
 Constructor -----------.
virtual ~UncompressedVideoFrame ()
 Destructor ----------.
Frame::FrameType detectFrameType ()
 Determines the correctness of the buffer and extracts the frametype of the frame On any problem: FrameType ERROR_VOP is returned.
void setColorSpace (ColorSpace c)
ColorSpace getColorSpace ()
UncompressedVideoFrameconvertToColorSpace (ColorSpace cs)
int getYBuffer (u8 **buf)
 Returns the buffer with Y component of *YUVI420* of Uncompressed Video.
int getUBuffer (u8 **buf)
 Returns the buffer with U component of *YUVI420* of Uncompressed Video.
int getVBuffer (u8 **buf)
 Returns the buffer with V component of *YUVI420* of Uncompressed Video.
double computePSNRy (UncompressedVideoFrame *f)
 computePSNRy ------------
double computePSNRu (UncompressedVideoFrame *f)
 computePSNRu ------------
double computePSNRv (UncompressedVideoFrame *f)
 computePSNRv ------------
double computePSNR (UncompressedVideoFrame *f)
 computePSNR -----------
double getPSNR ()

Static Public Member Functions

Frame::FrameType detectFrameType (AU *accessUnit)
int mapColorSpaceToBitDepth (ColorSpace colorspace)

Protected Member Functions

double computePSNRwithOffset (UncompressedVideoFrame *f, long offset)

Protected Attributes

double psnr
ColorSpace colorSpace

Detailed Description

<class description="" goes="" here=""> <short description="">

Author:
Michael Kropfberger and Peter Schojer
Version:
Id
UncompressedVideoFrame.hpp,v 1.7 2006/06/22 13:31:17 mkropfbe Exp

Definition at line 61 of file UncompressedVideoFrame.hpp.


Member Typedef Documentation

typedef enum UncompressedVideoFrame::ColorSpace UncompressedVideoFrame::ColorSpace
 

Colorspace enumeration of colorspaces available.

This is an excerpt of the colorspaces available in XviD (xvid.h) and/or FFmpeg (avcodec.h). so those colorSpaces are also avail in MP4Decoder

  • ColorSpaceDefault: Default is set to YUV420P.
  • ColorSpaceYV12: YV12 format, U and V swapped here!
  • ColorSpaceI420: I420 format,
  • ColorSpaceRGB24: Standard RGB colorspace 24 bit, but 4 byte
  • ColorSpaceRGB32: RGB Colorspace with alpha channel, so 4 byte
  • ColorSpaceRGB565: RGB with 16 bit with 2 byte

Referenced by mapColorSpaceToBitDepth(), MP4Encoder::mapToFFMPEGColorspace(), MP4Decoder::mapToFFMPEGColorspace(), MP4Decoder::mapToXVIDColorspace(), MP4Decoder::MP4Decoder(), QLabelRenderer::QLabelRenderer(), SDLRenderer::SDLRenderer(), VideoRenderer::VideoRenderer(), DataChannel::visualizeCaching(), and X11Renderer::X11Renderer().


Member Enumeration Documentation

enum UncompressedVideoFrame::ColorSpace
 

Colorspace enumeration of colorspaces available.

This is an excerpt of the colorspaces available in XviD (xvid.h) and/or FFmpeg (avcodec.h). so those colorSpaces are also avail in MP4Decoder

  • ColorSpaceDefault: Default is set to YUV420P.
  • ColorSpaceYV12: YV12 format, U and V swapped here!
  • ColorSpaceI420: I420 format,
  • ColorSpaceRGB24: Standard RGB colorspace 24 bit, but 4 byte
  • ColorSpaceRGB32: RGB Colorspace with alpha channel, so 4 byte
  • ColorSpaceRGB565: RGB with 16 bit with 2 byte
Definition at line 88 of file UncompressedVideoFrame.hpp.
00088 { 00089 ColorSpaceDefault = 4, 00090 ColorSpaceRGB24 = 0, 00091 ColorSpaceYV12 = 1, 00092 ColorSpaceI420 = 4, 00093 ColorSpaceRGB32 = 1000, 00094 ColorSpaceRGB565, // implemented in interface to FFMPEG only 00095 ColorSpaceGRAY8, // implemented in interface to FFMPEG only 00096 ColorSpaceUNKNOWN 00097 } ColorSpace;


Member Function Documentation

int UncompressedVideoFrame::getUBuffer u8 **  buf  ) 
 

Returns the buffer with U component of *YUVI420* of Uncompressed Video.

Parameters:
buf - This is the buffer which will ultimately contain the Y component
Returns:
Size of the buffer
Definition at line 272 of file UncompressedVideoFrame.cpp.
00272 { 00273 00274 assert((colorSpace == ColorSpaceI420) || (colorSpace == ColorSpaceYV12)); 00275 00276 if(accessUnit->payload && accessUnit->size > 0) 00277 { 00278 *buf = accessUnit->payload + (width*height); 00279 return width*height/4; 00280 } 00281 else 00282 { 00283 *buf = NULL; 00284 return -1; 00285 } 00286 }

int UncompressedVideoFrame::getVBuffer u8 **  buf  ) 
 

Returns the buffer with V component of *YUVI420* of Uncompressed Video.

Parameters:
buf - This is the buffer which will ultimately contain the Y component
Returns:
Size of the buffer
Definition at line 290 of file UncompressedVideoFrame.cpp.
00290 { 00291 00292 assert((colorSpace == ColorSpaceI420) || (colorSpace == ColorSpaceYV12)); 00293 00294 if(accessUnit->payload && accessUnit->size > 0) 00295 { 00296 *buf = accessUnit->payload + (width*height) + width*height/4; 00297 return width*height/4; 00298 } 00299 else 00300 { 00301 *buf = NULL; 00302 return -1; 00303 } 00304 }

int UncompressedVideoFrame::getYBuffer u8 **  buf  ) 
 

Returns the buffer with Y component of *YUVI420* of Uncompressed Video.

Parameters:
buf - This is the buffer which will ultimately contain the Y component
Returns:
Size of the buffer
Definition at line 254 of file UncompressedVideoFrame.cpp.
00254 { 00255 00256 assert((colorSpace == ColorSpaceI420) || (colorSpace == ColorSpaceYV12)); 00257 00258 if(accessUnit->payload && accessUnit->size > 0) 00259 { 00260 *buf = accessUnit->payload; 00261 return width*height; 00262 } 00263 else 00264 { 00265 *buf = NULL; 00266 return -1; 00267 } 00268 }

int UncompressedVideoFrame::mapColorSpaceToBitDepth ColorSpace  colorspace  )  [static]
 

Returns:
eg. for ColorSpaceGRAY8 the value 8, RGB32 and RGB24 will be 32, whereas RGB565 will be 16
Definition at line 111 of file UncompressedVideoFrame.cpp.

References ColorSpace.

Referenced by FrameRotate::adapt(), X11Renderer::open(), and SDLRenderer::open().

00111 { 00112 switch (colorspace) { 00113 case ColorSpaceRGB32: 00114 return 32; 00115 break; 00116 case ColorSpaceRGB24: 00117 return 24; 00118 break; 00119 case ColorSpaceRGB565: 00120 return 16; 00121 break; 00122 case ColorSpaceGRAY8: 00123 return 8; 00124 break; 00125 case ColorSpaceYV12: // FIXME: not perfect, but 8 is well-used for adaptors/FrameRotate... 00126 case ColorSpaceI420: 00127 return 8; 00128 break; 00129 default: 00130 dprintf_err("MP4Decoder::mapColorSpaceToBitDepth: Unknown colorspace\n"); 00131 exit(-1); 00132 } 00133 }


The documentation for this class was generated from the following files: