YUVColorReductionAdaptor Class Reference

Implementation of Adaptor that applies color reduction on YUVFrame objects. <short description="">. More...

#include <YUVColorReductionAdaptor.hpp>

Inheritance diagram for YUVColorReductionAdaptor:

VideoAdaptor Adaptor List of all members.

Public Member Functions

 YUVColorReductionAdaptor (VideoESInfo *pESInfo)
 Constructor.
virtual ~YUVColorReductionAdaptor ()
 Destructor.
list< Frame * > adapt (Frame *frm)
 YUVFrame frm in - list of YUVFrame objects out.
list< Frame * > close ()
 Flush all buffered YUVFrame objects (if any).
Adaptorclone ()
 Not implemented.
void initialize ()
 Initialize internal data structures.
u32 getTranscodingCosts () const
 returns adaptation costs (CPU only).

Detailed Description

Implementation of Adaptor that applies color reduction on YUVFrame objects. <short description="">.

In addition average bitrate of the ESInfo object is reduced by 20%.

Author:
Bernhard Penz
Version:
Id
YUVColorReductionAdaptor.hpp,v 1.6 2005/06/19 14:47:41 mkropfbe Exp

Definition at line 62 of file YUVColorReductionAdaptor.hpp.


Constructor & Destructor Documentation

YUVColorReductionAdaptor::YUVColorReductionAdaptor VideoESInfo *  pESInfo  ) 
 

Constructor.

Takes input frame size from pESInfo, and reduces average bitrate setting of ESInfo by 20%.

Parameters:
pESInfo Pointer to ESInfo object, containing valid size information about the input YUVFrame objects.
Definition at line 48 of file YUVColorReductionAdaptor.cpp.

Referenced by clone().

00049 { 00050 this->es=pESInfo; 00051 initialized=false; 00052 strcpy(name,"YUVColorReductionAdaptor"); 00053 }

YUVColorReductionAdaptor::~YUVColorReductionAdaptor  )  [virtual]
 

Destructor.

Definition at line 64 of file YUVColorReductionAdaptor.cpp.

00065 { 00066 }


Member Function Documentation

list< Frame * > YUVColorReductionAdaptor::adapt Frame frm  )  [virtual]
 

YUVFrame frm in - list of YUVFrame objects out.

Output list will contain one YUVFrame object only.

Parameters:
frm Pointer to uncompressed YUVFrame object
Returns:
List of YUVFrame objects

Reimplemented from Adaptor.

Definition at line 68 of file YUVColorReductionAdaptor.cpp.

References Frame::getAU(), and initialize().

00069 { 00070 if(!initialized) 00071 initialize(); 00072 00073 list < Frame * >retFrameList; 00074 00075 memset(frm->getAU()->payload + muiUVStart, 128, muiUVSize); 00076 00077 retFrameList.push_back(frm); 00078 00079 return retFrameList; 00080 00081 }

Adaptor * YUVColorReductionAdaptor::clone  )  [virtual]
 

Not implemented.

Returns:
Defaults to NULL.

Implements Adaptor.

Definition at line 89 of file YUVColorReductionAdaptor.cpp.

References YUVColorReductionAdaptor().

00090 { 00091 return new YUVColorReductionAdaptor(es); 00092 }

list< Frame * > YUVColorReductionAdaptor::close  )  [virtual]
 

Flush all buffered YUVFrame objects (if any).

Returns:
List of YUVFrame objects

Reimplemented from Adaptor.

Definition at line 83 of file YUVColorReductionAdaptor.cpp.

00084 { 00085 list < Frame * >retFrameList; 00086 return retFrameList; 00087 }

u32 YUVColorReductionAdaptor::getTranscodingCosts  )  const [inline, virtual]
 

returns adaptation costs (CPU only).

Throwing away color is extremely cheap.. memset per frame 0.4% of decoding costs

Implements Adaptor.

Definition at line 103 of file YUVColorReductionAdaptor.hpp.

00103 { 00104 return (u32)(((VideoESInfo*)es)->getWidth() * ((VideoESInfo*)es)->getHeight() 00105 * ((VideoESInfo*)es)->getFPS() * 0.008); 00106 }

void YUVColorReductionAdaptor::initialize  )  [virtual]
 

Initialize internal data structures.

Implements Adaptor.

Definition at line 56 of file YUVColorReductionAdaptor.cpp.

Referenced by adapt().

00057 { 00058 es->setHasColor(false); 00059 muiUVStart = es->getWidth() * es->getHeight(); 00060 muiUVSize = (es->getWidth() / 2) * (es->getHeight() / 2) * 2; 00061 initialized = true; 00062 };


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